Skip to content

Commit

Permalink
Merge pull request #44 from Heatmanofurioso/develop
Browse files Browse the repository at this point in the history
Merge for 1.3.2 release
  • Loading branch information
Heatmanofurioso authored May 23, 2022
2 parents 902c5ca + 25cdc2e commit ba38928
Show file tree
Hide file tree
Showing 9 changed files with 1,707 additions and 1,258 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/.angular/cache
#IDE configuration files
.idea
.vscode
Expand All @@ -14,4 +13,6 @@ typings
# custom
/dist
.DS_Store
src/.DS_Store
src/.DS_Store
.angular
.husky
5 changes: 4 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.3.2] - 2022-05-23
- Add referrerpolicy option to the img tag configurations
- Update dependencies
- Remove codelyzer

# [1.3.1] - 2022-02-14
- Update Angular to 13.2.2
Expand Down
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,29 +140,30 @@ $ ng serve

## Options

| Attribute | Type | Default | Description |
| ------------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| `facebookId` | *string \| null* | | Facebook ID |
| `googleId` | *string \| null* | | Google ID |
| `twitterId` | *string \| null* | | Twitter Handle |
| `instagramId` | *string \| null* | | Instagram Handle |
| `vkontakteId` | *string \| null* | | VK ID |
| `skypeId` | *string \| null* | | Skype ID |
| `gravatarId` | *string \| null* | | email or md5 email related to gravatar |
| `githubId` | *string \| null* | | Github ID |
| `src` | *string \| null* | | Fallback image to use |
| `name` | *string \| null* | | Will be used to generate avatar based on the initials of the person |
| `value` | *string \| null* | | Show a value as avatar |
| `initialsSize`| *number* | 0 | Restricts the size of initials - it goes along with the name property and can be used to fix the number of characters that will be displayed as initials. The `0` means no restrictions. |
| `bgColor` | *string* | random | Give the background a fixed color with a hex like for example #FF0000 |
| `fgColor` | *string* | #FFF | Give the text a fixed color with a hex like for example #FF0000 |
| `size` | *number* | 50 | Size of the avatar |
| `textSizeRatio`| *number* | 3 | For text based avatars the size of the text as a fragment of size (size / textSizeRatio) |
| `round` | *boolean* | true | Round the avatar corners |
| `cornerRadius`| *number* | 0 | Square avatars can have rounded corners using this property |
| `borderColor` | *string* | undefined | Add border with the given color. boder's default style is '1px solid borderColor' |
| `style` | *object* | | Style that will be applied on the root element |
| `clickOnAvatar`| *Output* | | Fired when the avatar is clicked. The component emits the source object that has been used to fetch the avatar.|
| Attribute | Type | Default | Description |
|------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `facebookId` | *string* | null | | Facebook ID |
| `googleId` | *string* | null | | Google ID |
| `twitterId` | *string* | null | | Twitter Handle |
| `instagramId` | *string* | null | | Instagram Handle |
| `vkontakteId` | *string* | null | | VK ID |
| `skypeId` | *string* | null | | Skype ID |
| `gravatarId` | *string* | null | | email or md5 email related to gravatar |
| `githubId` | *string* | null | | Github ID |
| `src` | *string* | null | | Fallback image to use |
| `name` | *string* | null | | Will be used to generate avatar based on the initials of the person |
| `value` | *string* | null | | Show a value as avatar |
| `initialsSize` | *number* | 0 | Restricts the size of initials - it goes along with the name property and can be used to fix the number of characters that will be displayed as initials. The `0` means no restrictions. |
| `bgColor` | *string* | random | Give the background a fixed color with a hex like for example #FF0000 |
| `fgColor` | *string* | #FFF | Give the text a fixed color with a hex like for example #FF0000 |
| `size` | *number* | 50 | Size of the avatar |
| `textSizeRatio` | *number* | 3 | For text based avatars the size of the text as a fragment of size (size / textSizeRatio) |
| `round` | *boolean* | true | Round the avatar corners |
| `cornerRadius` | *number* | 0 | Square avatars can have rounded corners using this property |
| `borderColor` | *string* | undefined | Add border with the given color. border's default style is '1px solid borderColor' |
| `style` | *object* | | Style that will be applied on the root element |
| `clickOnAvatar` | *Output* | | Fired when the avatar is clicked. The component emits the source object that has been used to fetch the avatar. |
| `referrerpolicy` | *string* | null | Adds the noreferrer flag to the img tag. |

The source object has the following properties:
* sourceType : avatar source ( Facebook, twitter, etc)
Expand Down Expand Up @@ -261,6 +262,7 @@ export class AppModule { }
```

## Release Notes & History
* 1.3.2: Add referrerpolicy configuration to img tag. Update dependencies. Remove codelyzer.
* 1.3.1: Update dependencies
* 1.3.0: Added ability to disable src cache.
* 1.2.1: Updated several dependencies. Update Angular minor version. Add Husky Git Hooks. Migrate from TSLint to ESLint
Expand Down
73 changes: 36 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,48 @@
},
"private": false,
"dependencies": {
"@angular/animations": "^13.2.2",
"@angular/common": "^13.2.2",
"@angular/compiler": "^13.2.2",
"@angular/core": "^13.2.2",
"@angular/forms": "^13.2.2",
"@angular/platform-browser": "^13.2.2",
"@angular/platform-browser-dynamic": "^13.2.2",
"@angular/router": "^13.2.2",
"rxjs": "^7.4.0",
"@angular/animations": "^13.3.9",
"@angular/common": "^13.3.9",
"@angular/compiler": "^13.3.9",
"@angular/core": "^13.3.9",
"@angular/forms": "^13.3.9",
"@angular/platform-browser": "^13.3.9",
"@angular/platform-browser-dynamic": "^13.3.9",
"@angular/router": "^13.3.9",
"rxjs": "^7.5.5",
"ts-md5": "^1.2.11",
"tslib": "^2.3.1",
"zone.js": "~0.11.4"
"tslib": "^2.4.0",
"zone.js": "~0.11.5"
},
"devDependencies": {
"@angular-builders/jest": "13.0.3",
"@angular-devkit/build-angular": "~13.2.3",
"@angular-builders/jest": "13.0.4",
"@angular-devkit/build-angular": "~13.3.6",
"@angular-devkit/build-ng-packagr": "~0.1002.0",
"@angular-eslint/builder": "13.1.0",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/schematics": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "~13.2.3",
"@angular/compiler-cli": "^13.2.2",
"@angular/language-service": "^13.2.2",
"@testing-library/jest-dom": "5.16.2",
"@types/jest": "27.4.0",
"@types/node": "^17.0.18",
"@typescript-eslint/eslint-plugin": "5.12.0",
"@typescript-eslint/parser": "5.12.0",
"codelyzer": "^6.0.2",
"eslint": "8.9.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsdoc": "37.9.1",
"@angular-eslint/builder": "13.2.1",
"@angular-eslint/eslint-plugin": "13.2.1",
"@angular-eslint/eslint-plugin-template": "13.2.1",
"@angular-eslint/schematics": "13.2.1",
"@angular-eslint/template-parser": "13.2.1",
"@angular/cli": "~13.3.6",
"@angular/compiler-cli": "^13.3.9",
"@angular/language-service": "^13.3.9",
"@testing-library/jest-dom": "5.16.4",
"@types/jest": "27.5.1",
"@types/node": "^17.0.35",
"@typescript-eslint/eslint-plugin": "5.25.0",
"@typescript-eslint/parser": "5.25.0",
"eslint": "8.16.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsdoc": "39.3.0",
"eslint-plugin-prefer-arrow": "1.2.3",
"husky": "^7.0.4",
"jest": "27.5.1",
"jest-preset-angular": "11.1.1",
"ng-packagr": "^13.2.1",
"husky": "^8.0.1",
"jest": "28.1.0",
"jest-preset-angular": "12.0.1",
"ng-packagr": "^13.3.1",
"protractor": "~7.0.0",
"ts-jest": "27.1.3",
"ts-node": "~10.5.0",
"typescript": "~4.5.4"
"ts-jest": "28.0.2",
"ts-node": "~10.8.0",
"typescript": "~4.6.4"
},
"jest": {
"preset": "jest-preset-angular",
Expand Down
8 changes: 4 additions & 4 deletions projects/ngx-avatars/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ngx-avatars",
"description": "A universal avatar component for Angular applications that fetches / generates avatar based on the information you have about the user.",
"version": "1.3.1",
"version": "1.3.2",
"keywords": [
"angular",
"avatar",
Expand All @@ -24,10 +24,10 @@
"sideEffects": false,
"dependencies": {
"ts-md5": "^1.2.11",
"tslib": "^2.3.1"
"tslib": "^2.4.0"
},
"peerDependencies": {
"@angular/common": "^13.2.2",
"@angular/core": "^13.2.2"
"@angular/common": "^13.3.9",
"@angular/core": "^13.3.9"
}
}
3 changes: 3 additions & 0 deletions projects/ngx-avatars/src/lib/avatar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Style = Partial<CSSStyleDeclaration>;
[width]="size"
[height]="size"
[ngStyle]="avatarStyle"
[referrerPolicy]="referrerpolicy"
(error)="fetchAvatarSource()"
class="avatar-content"
loading="lazy"
Expand Down Expand Up @@ -101,6 +102,8 @@ export class AvatarComponent implements OnChanges, OnDestroy {
@Input()
public value?: string | null;
@Input()
public referrerpolicy?: string | null;
@Input()
public placeholder?: string;
@Input()
public initialsSize: string | number = 0;
Expand Down
18 changes: 0 additions & 18 deletions projects/ngx-avatars/tslint.json

This file was deleted.

17 changes: 0 additions & 17 deletions src/tslint.json

This file was deleted.

Loading

0 comments on commit ba38928

Please sign in to comment.