@mikezimm/fps-library-v2 1.0.201 → 1.0.202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -1
- package/lib/components/atoms/EasyIcons/getEasyIcon.d.ts +11 -2
- package/lib/components/atoms/EasyIcons/getEasyIcon.d.ts.map +1 -1
- package/lib/components/atoms/EasyIcons/getEasyIcon.js +26 -4
- package/lib/components/atoms/EasyIcons/getEasyIcon.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,13 +5,16 @@ npm run build
|
|
|
5
5
|
npm version major/minor/patch
|
|
6
6
|
npm publish --access=public
|
|
7
7
|
|
|
8
|
-
npm install @mikezimm/fps-library-v2@1.0.
|
|
8
|
+
npm install @mikezimm/fps-library-v2@1.0.202
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
# Changelog
|
|
12
12
|
|
|
13
13
|
NOTE: TURN BACK ON STRICT NULL CHECKS - turned off for PropPaneCols
|
|
14
14
|
|
|
15
|
+
## 1.0.202 - 2023-May-26: EasyIcons
|
|
16
|
+
- create replaceDefaultIcons which looks for some SharePoint Icons and replaces if it can find a new one
|
|
17
|
+
|
|
15
18
|
## 1.0.201 - 2023-May-26: EasyIcons
|
|
16
19
|
- add Acronyms: IEasyIconGroup; AcronymsW: IEasyIconGroup;
|
|
17
20
|
- add optional paramter: 'defaultIcon' to getEasyIcon
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ISourcePropsEP } from '../../../banner/components/EasyPages/epTypes';
|
|
2
2
|
import { IEasyIcons } from './eiTypes';
|
|
3
|
+
/**
|
|
4
|
+
* replaceDefaultIcons will test to see if the current imageUrl value is a default image.
|
|
5
|
+
* If it is found to be a default image already, it will then look for a replacement
|
|
6
|
+
* @param EasyIconsObject
|
|
7
|
+
* @param item
|
|
8
|
+
* @param current
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function replaceDefaultIcons(EasyIconsObject: IEasyIcons, item: any, current: string): string;
|
|
3
12
|
/**
|
|
4
13
|
* Logic order:
|
|
5
14
|
* First checks keywords in the first Prop to test ( Title )
|
|
@@ -7,10 +16,10 @@ import { IEasyIcons } from './eiTypes';
|
|
|
7
16
|
* Then repeats for the next Prop - Description
|
|
8
17
|
* @param EasyIcons
|
|
9
18
|
* @param item
|
|
10
|
-
* @param
|
|
19
|
+
* @param fallbackIcon? Fallback Icon if one is not found
|
|
11
20
|
* @returns
|
|
12
21
|
*/
|
|
13
|
-
export declare function getEasyIcon(EasyIcons: IEasyIcons, item: any,
|
|
22
|
+
export declare function getEasyIcon(EasyIcons: IEasyIcons, item: any, fallbackIcon?: string): string | null;
|
|
14
23
|
export declare const DefaultSiteLogo: string;
|
|
15
24
|
export declare function addEasyIcons(items: any[], sourceProps: ISourcePropsEP, EasyIcons: IEasyIcons): any[];
|
|
16
25
|
//# sourceMappingURL=getEasyIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEasyIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/EasyIcons/getEasyIcon.ts"],"names":[],"mappings":"AACA,OAAO,EAAyD,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACrI,OAAO,EAAoB,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"getEasyIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/EasyIcons/getEasyIcon.ts"],"names":[],"mappings":"AACA,OAAO,EAAyD,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACrI,OAAO,EAAoB,UAAU,EAAE,MAAM,WAAW,CAAC;AAGzD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAI,MAAM,CAYrG;AAGD;;;;;;;;;GASG;AAGH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAiCnG;AAOD,eAAO,MAAM,eAAe,EAAG,MAAmD,CAAC;AAEnF,wBAAgB,YAAY,CAAE,KAAK,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,SA2D7F"}
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { EasyPagesCCSPages, EasyPagesSysPages, EasyPagesSysTab } from '../../../banner/components/EasyPages/epTypes';
|
|
2
2
|
import { EasyIconLocation } from './eiTypes';
|
|
3
|
+
const commonDefaultIcons = ['sitepagethumbnail.'];
|
|
4
|
+
/**
|
|
5
|
+
* replaceDefaultIcons will test to see if the current imageUrl value is a default image.
|
|
6
|
+
* If it is found to be a default image already, it will then look for a replacement
|
|
7
|
+
* @param EasyIconsObject
|
|
8
|
+
* @param item
|
|
9
|
+
* @param current
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export function replaceDefaultIcons(EasyIconsObject, item, current) {
|
|
13
|
+
let result = `${current}`;
|
|
14
|
+
let isCommon = false;
|
|
15
|
+
commonDefaultIcons.map((partial) => {
|
|
16
|
+
if (current.indexOf(partial) > -1)
|
|
17
|
+
isCommon = true;
|
|
18
|
+
});
|
|
19
|
+
if (isCommon === true) {
|
|
20
|
+
const originalImageUrl = `${current}`; // If an easyIcon is not found, use the default one
|
|
21
|
+
result = getEasyIcon(EasyIconsObject, item, originalImageUrl);
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
3
25
|
/**
|
|
4
26
|
* Logic order:
|
|
5
27
|
* First checks keywords in the first Prop to test ( Title )
|
|
@@ -7,14 +29,14 @@ import { EasyIconLocation } from './eiTypes';
|
|
|
7
29
|
* Then repeats for the next Prop - Description
|
|
8
30
|
* @param EasyIcons
|
|
9
31
|
* @param item
|
|
10
|
-
* @param
|
|
32
|
+
* @param fallbackIcon? Fallback Icon if one is not found
|
|
11
33
|
* @returns
|
|
12
34
|
*/
|
|
13
35
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
-
export function getEasyIcon(EasyIcons, item,
|
|
36
|
+
export function getEasyIcon(EasyIcons, item, fallbackIcon) {
|
|
15
37
|
//If this is disabled, then exit
|
|
16
38
|
if (EasyIcons.Enabled !== true)
|
|
17
|
-
return
|
|
39
|
+
return fallbackIcon;
|
|
18
40
|
const EasyErrors = [];
|
|
19
41
|
let EasyIconUrl = '';
|
|
20
42
|
EasyIcons.Priority.map(prop => {
|
|
@@ -43,7 +65,7 @@ export function getEasyIcon(EasyIcons, item, defaultIcon) {
|
|
|
43
65
|
});
|
|
44
66
|
}
|
|
45
67
|
});
|
|
46
|
-
return EasyIconUrl ? EasyIconUrl :
|
|
68
|
+
return EasyIconUrl ? EasyIconUrl : fallbackIcon;
|
|
47
69
|
}
|
|
48
70
|
const DefaultThumbCCS = `https://www.crowcanyon.com/wp-content/uploads/2020/12/NITRO_Studio_Transparent2.png`;
|
|
49
71
|
const DefaultThumbEasyContents = `https://cdn.hubblecontent.osi.office.net/m365content/publish/8833527d-1d55-40be-8d14-0e45b17ce81b/thumbnails/large.jpg`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEasyIcon.js","sourceRoot":"","sources":["../../../../src/components/atoms/EasyIcons/getEasyIcon.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAkB,MAAM,8CAA8C,CAAC;AACrI,OAAO,EAAE,gBAAgB,EAAc,MAAM,WAAW,CAAC;AAEzD;;;;;;;;;GASG;AACH,8DAA8D;AAE9D,MAAM,UAAU,WAAW,CAAC,SAAqB,EAAE,IAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"getEasyIcon.js","sourceRoot":"","sources":["../../../../src/components/atoms/EasyIcons/getEasyIcon.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,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