@histoire/vendors 0.17.17 → 1.0.0-alpha.1
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/dist/client/b-floating-vue.js +2175 -2150
- package/dist/client/b-iconify.js +751 -825
- package/dist/client/b-pinia.js +130 -68
- package/dist/client/b-scroll.js +3 -52
- package/dist/client/b-vue-router.js +385 -237
- package/dist/client/b-vue-use.js +3898 -2871
- package/dist/client/b-vue.js +1 -1
- package/dist/client/index.js +162 -20
- package/dist/client/node_modules/@babel/helper-string-parser/package.json +31 -0
- package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/dist/client/node_modules/@babel/parser/package.json +10 -6
- package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +47 -31
- package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +2776 -0
- package/dist/client/node_modules/@babel/types/lib/index.d.ts +3275 -0
- package/dist/client/node_modules/@babel/types/package.json +39 -0
- package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +525 -0
- package/dist/client/node_modules/@floating-ui/core/package.json +32 -39
- package/dist/client/node_modules/@floating-ui/dom/package.json +23 -24
- package/dist/client/node_modules/@floating-ui/dom/src/autoUpdate.d.ts +31 -0
- package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +11 -7
- package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +121 -20
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingRect.d.ts +12 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getCssDimensions.d.ts +4 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getNearestOverflowAncestor.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getOverflowAncestors.d.ts +3 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScale.d.ts +7 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -2
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +3 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/unwrapElement.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/userAgent.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +1 -2
- package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +103 -0
- package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +47 -0
- package/dist/client/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +47 -0
- package/dist/client/node_modules/@floating-ui/utils/dom/package.json +6 -0
- package/dist/client/node_modules/@floating-ui/utils/package.json +70 -0
- package/dist/client/node_modules/@iconify/types/package.json +23 -0
- package/dist/client/node_modules/@iconify/types/provider.d.ts +44 -0
- package/dist/client/node_modules/@iconify/types/types.d.ts +272 -0
- package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +72 -330
- package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +28 -268
- package/dist/client/node_modules/@iconify/vue/package.json +64 -60
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +2 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +3 -2
- package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +33 -14
- package/dist/client/node_modules/@types/web-bluetooth/package.json +12 -12
- package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +218 -125
- package/dist/client/node_modules/@vue/compiler-core/package.json +20 -5
- package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +6 -3
- package/dist/client/node_modules/@vue/compiler-dom/package.json +17 -3
- package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +35 -25
- package/dist/client/node_modules/@vue/compiler-sfc/package.json +27 -18
- package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +2 -2
- package/dist/client/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/dist/client/node_modules/@vue/devtools-api/package.json +1 -1
- package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +268 -166
- package/dist/client/node_modules/@vue/reactivity/package.json +16 -2
- package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +728 -529
- package/dist/client/node_modules/@vue/runtime-core/package.json +17 -3
- package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +195 -86
- package/dist/client/node_modules/@vue/runtime-dom/package.json +22 -4
- package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +4 -8
- package/dist/client/node_modules/@vue/server-renderer/package.json +18 -4
- package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +45 -30
- package/dist/client/node_modules/@vue/shared/package.json +15 -1
- package/dist/client/node_modules/@vueuse/core/index.d.ts +2040 -633
- package/dist/client/node_modules/@vueuse/core/package.json +10 -12
- package/dist/client/node_modules/@vueuse/metadata/index.d.ts +7 -5
- package/dist/client/node_modules/@vueuse/metadata/package.json +4 -4
- package/dist/client/node_modules/@vueuse/shared/index.d.ts +410 -273
- package/dist/client/node_modules/@vueuse/shared/package.json +5 -6
- package/dist/client/node_modules/compute-scroll-into-view/dist/index.d.ts +75 -0
- package/dist/client/node_modules/compute-scroll-into-view/package.json +35 -45
- package/dist/client/node_modules/entities/lib/decode.d.ts +211 -0
- package/dist/client/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/dist/client/node_modules/entities/lib/encode.d.ts +22 -0
- package/dist/client/node_modules/entities/lib/escape.d.ts +43 -0
- package/dist/client/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/dist/client/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/dist/client/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/dist/client/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/dist/client/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/dist/client/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/dist/client/node_modules/entities/lib/esm/package.json +1 -0
- package/dist/client/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/dist/client/node_modules/entities/lib/index.d.ts +96 -0
- package/dist/client/node_modules/entities/package.json +90 -0
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/Menu.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +225 -105
- package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +471 -364
- package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +14 -25
- package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +392 -6
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +49 -10
- package/dist/client/node_modules/floating-vue/dist/config.d.ts +1 -1
- package/dist/client/node_modules/floating-vue/dist/index.d.ts +2071 -247
- package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +2 -0
- package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +1 -1
- package/dist/client/node_modules/floating-vue/package.json +42 -33
- package/dist/client/node_modules/magic-string/dist/magic-string.cjs.d.ts +250 -229
- package/dist/client/node_modules/magic-string/package.json +24 -26
- package/dist/client/node_modules/nanoid/package.json +1 -1
- package/dist/client/node_modules/picocolors/package.json +2 -2
- package/dist/client/node_modules/picocolors/types.d.ts +51 -0
- package/dist/client/node_modules/pinia/dist/pinia.d.ts +116 -37
- package/dist/client/node_modules/pinia/package.json +7 -11
- package/dist/client/node_modules/postcss/lib/at-rule.d.ts +25 -22
- package/dist/client/node_modules/postcss/lib/comment.d.ts +10 -9
- package/dist/client/node_modules/postcss/lib/container.d.ts +47 -54
- package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +1 -1
- package/dist/client/node_modules/postcss/lib/declaration.d.ts +20 -17
- package/dist/client/node_modules/postcss/lib/document.d.ts +4 -4
- package/dist/client/node_modules/postcss/lib/input.d.ts +14 -0
- package/dist/client/node_modules/postcss/lib/list.d.ts +5 -2
- package/dist/client/node_modules/postcss/lib/node.d.ts +19 -14
- package/dist/client/node_modules/postcss/lib/postcss.d.ts +25 -8
- package/dist/client/node_modules/postcss/lib/processor.d.ts +1 -1
- package/dist/client/node_modules/postcss/lib/result.d.ts +0 -1
- package/dist/client/node_modules/postcss/lib/root.d.ts +4 -4
- package/dist/client/node_modules/postcss/lib/rule.d.ts +27 -18
- package/dist/client/node_modules/postcss/package.json +4 -4
- package/dist/client/node_modules/scroll-into-view-if-needed/dist/index.d.ts +79 -0
- package/dist/client/node_modules/scroll-into-view-if-needed/package.json +28 -67
- package/dist/client/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/package.json +1 -1
- package/dist/client/node_modules/source-map-js/source-map.d.ts +88 -99
- package/dist/client/node_modules/vue/dist/vue.d.ts +0 -4
- package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +2 -1
- package/dist/client/node_modules/vue/jsx.d.ts +2 -1
- package/dist/client/node_modules/vue/package.json +13 -14
- package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/package.json +1 -1
- package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +410 -81
- package/dist/client/node_modules/vue-router/package.json +66 -37
- package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.ts +4 -0
- package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +4 -0
- package/dist/client/vue.runtime.esm-bundler.js +6458 -4714
- package/package.json +17 -17
- package/rollup.config.mjs +6 -6
- package/dist/client/index2.js +0 -168
- package/dist/client/node_modules/@floating-ui/core/index.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +0 -4
- package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +0 -9
- package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +0 -4
- package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +0 -11
- package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +0 -9
- package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +0 -10
- package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +0 -5
- package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +0 -21
- package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +0 -32
- package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +0 -148
- package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +0 -5
- package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +0 -1
- package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +0 -43
- package/dist/client/node_modules/@vue/reactivity-transform/package.json +0 -41
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +0 -19
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +0 -1
- package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +0 -5
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +0 -13
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +0 -19
- package/dist/client/node_modules/vue/macros-global.d.ts +0 -19
- package/dist/client/node_modules/vue/macros.d.ts +0 -112
- package/dist/client/node_modules/vue/ref-macros.d.ts +0 -2
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2.7/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v3/index.d.ts +0 -0
package/dist/client/b-iconify.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const matchName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
4
|
-
const iconDefaults = Object.freeze({
|
|
5
|
-
left: 0,
|
|
6
|
-
top: 0,
|
|
7
|
-
width: 16,
|
|
8
|
-
height: 16,
|
|
9
|
-
rotate: 0,
|
|
10
|
-
vFlip: false,
|
|
11
|
-
hFlip: false
|
|
12
|
-
});
|
|
13
|
-
function fullIcon(data) {
|
|
14
|
-
return { ...iconDefaults, ...data };
|
|
15
|
-
}
|
|
1
|
+
import { x as h, d as defineComponent } from './vue.runtime.esm-bundler.js';
|
|
16
2
|
|
|
3
|
+
const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
17
4
|
const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
18
5
|
const colonSeparated = value.split(":");
|
|
19
6
|
if (value.slice(0, 1) === "@") {
|
|
@@ -29,11 +16,12 @@ const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
|
29
16
|
const name2 = colonSeparated.pop();
|
|
30
17
|
const prefix = colonSeparated.pop();
|
|
31
18
|
const result = {
|
|
19
|
+
// Allow provider without '@': "provider:prefix:name"
|
|
32
20
|
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
|
|
33
21
|
prefix,
|
|
34
22
|
name: name2
|
|
35
23
|
};
|
|
36
|
-
return validate && !
|
|
24
|
+
return validate && !validateIconName(result) ? null : result;
|
|
37
25
|
}
|
|
38
26
|
const name = colonSeparated[0];
|
|
39
27
|
const dashSeparated = name.split("-");
|
|
@@ -43,7 +31,7 @@ const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
|
43
31
|
prefix: dashSeparated.shift(),
|
|
44
32
|
name: dashSeparated.join("-")
|
|
45
33
|
};
|
|
46
|
-
return validate && !
|
|
34
|
+
return validate && !validateIconName(result) ? null : result;
|
|
47
35
|
}
|
|
48
36
|
if (allowSimpleName && provider === "") {
|
|
49
37
|
const result = {
|
|
@@ -51,87 +39,109 @@ const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
|
51
39
|
prefix: "",
|
|
52
40
|
name
|
|
53
41
|
};
|
|
54
|
-
return validate && !
|
|
42
|
+
return validate && !validateIconName(result, allowSimpleName) ? null : result;
|
|
55
43
|
}
|
|
56
44
|
return null;
|
|
57
45
|
};
|
|
58
|
-
const
|
|
46
|
+
const validateIconName = (icon, allowSimpleName) => {
|
|
59
47
|
if (!icon) {
|
|
60
48
|
return false;
|
|
61
49
|
}
|
|
62
|
-
return !!((icon.provider === "" || icon.provider.match(
|
|
50
|
+
return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
|
|
63
51
|
};
|
|
64
52
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
53
|
+
const defaultIconDimensions = Object.freeze(
|
|
54
|
+
{
|
|
55
|
+
left: 0,
|
|
56
|
+
top: 0,
|
|
57
|
+
width: 16,
|
|
58
|
+
height: 16
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const defaultIconTransformations = Object.freeze({
|
|
62
|
+
rotate: 0,
|
|
63
|
+
vFlip: false,
|
|
64
|
+
hFlip: false
|
|
65
|
+
});
|
|
66
|
+
const defaultIconProps = Object.freeze({
|
|
67
|
+
...defaultIconDimensions,
|
|
68
|
+
...defaultIconTransformations
|
|
69
|
+
});
|
|
70
|
+
const defaultExtendedIconProps = Object.freeze({
|
|
71
|
+
...defaultIconProps,
|
|
72
|
+
body: "",
|
|
73
|
+
hidden: false
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
function mergeIconTransformations(obj1, obj2) {
|
|
77
|
+
const result = {};
|
|
78
|
+
if (!obj1.hFlip !== !obj2.hFlip) {
|
|
79
|
+
result.hFlip = true;
|
|
80
|
+
}
|
|
81
|
+
if (!obj1.vFlip !== !obj2.vFlip) {
|
|
82
|
+
result.vFlip = true;
|
|
83
|
+
}
|
|
84
|
+
const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
|
|
85
|
+
if (rotate) {
|
|
86
|
+
result.rotate = rotate;
|
|
87
87
|
}
|
|
88
88
|
return result;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const aliases = data.aliases;
|
|
100
|
-
if (aliases && aliases[name2] !== void 0) {
|
|
101
|
-
const item = aliases[name2];
|
|
102
|
-
const result2 = getIcon(item.parent, iteration + 1);
|
|
103
|
-
if (result2) {
|
|
104
|
-
return mergeIconData(result2, item);
|
|
91
|
+
function mergeIconData(parent, child) {
|
|
92
|
+
const result = mergeIconTransformations(parent, child);
|
|
93
|
+
for (const key in defaultExtendedIconProps) {
|
|
94
|
+
if (key in defaultIconTransformations) {
|
|
95
|
+
if (key in parent && !(key in result)) {
|
|
96
|
+
result[key] = defaultIconTransformations[key];
|
|
105
97
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return getIcon(chars[name2], iteration + 1);
|
|
98
|
+
} else if (key in child) {
|
|
99
|
+
result[key] = child[key];
|
|
100
|
+
} else if (key in parent) {
|
|
101
|
+
result[key] = parent[key];
|
|
111
102
|
}
|
|
112
|
-
return null;
|
|
113
103
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getIconsTree(data, names) {
|
|
108
|
+
const icons = data.icons;
|
|
109
|
+
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
110
|
+
const resolved = /* @__PURE__ */ Object.create(null);
|
|
111
|
+
function resolve(name) {
|
|
112
|
+
if (icons[name]) {
|
|
113
|
+
return resolved[name] = [];
|
|
114
|
+
}
|
|
115
|
+
if (!(name in resolved)) {
|
|
116
|
+
resolved[name] = null;
|
|
117
|
+
const parent = aliases[name] && aliases[name].parent;
|
|
118
|
+
const value = parent && resolve(parent);
|
|
119
|
+
if (value) {
|
|
120
|
+
resolved[name] = [parent].concat(value);
|
|
119
121
|
}
|
|
120
122
|
}
|
|
123
|
+
return resolved[name];
|
|
121
124
|
}
|
|
122
|
-
|
|
125
|
+
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
|
|
126
|
+
return resolved;
|
|
123
127
|
}
|
|
124
128
|
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
function internalGetIconData(data, name, tree) {
|
|
130
|
+
const icons = data.icons;
|
|
131
|
+
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
132
|
+
let currentProps = {};
|
|
133
|
+
function parse(name2) {
|
|
134
|
+
currentProps = mergeIconData(
|
|
135
|
+
icons[name2] || aliases[name2],
|
|
136
|
+
currentProps
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
parse(name);
|
|
140
|
+
tree.forEach(parse);
|
|
141
|
+
return mergeIconData(data, currentProps);
|
|
132
142
|
}
|
|
133
|
-
|
|
134
|
-
|
|
143
|
+
|
|
144
|
+
function parseIconSet(data, callback) {
|
|
135
145
|
const names = [];
|
|
136
146
|
if (typeof data !== "object" || typeof data.icons !== "object") {
|
|
137
147
|
return names;
|
|
@@ -142,38 +152,30 @@ function parseIconSet(data, callback, options) {
|
|
|
142
152
|
names.push(name);
|
|
143
153
|
});
|
|
144
154
|
}
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
callback(name,
|
|
155
|
+
const tree = getIconsTree(data);
|
|
156
|
+
for (const name in tree) {
|
|
157
|
+
const item = tree[name];
|
|
158
|
+
if (item) {
|
|
159
|
+
callback(name, internalGetIconData(data, name, item));
|
|
150
160
|
names.push(name);
|
|
151
161
|
}
|
|
152
|
-
});
|
|
153
|
-
const parseAliases = options.aliases || "all";
|
|
154
|
-
if (parseAliases !== "none" && typeof data.aliases === "object") {
|
|
155
|
-
const aliases = data.aliases;
|
|
156
|
-
Object.keys(aliases).forEach((name) => {
|
|
157
|
-
if (parseAliases === "variations" && isVariation(aliases[name])) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const iconData = getIconData$1(data, name, true);
|
|
161
|
-
if (iconData) {
|
|
162
|
-
callback(name, iconData);
|
|
163
|
-
names.push(name);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
162
|
}
|
|
167
163
|
return names;
|
|
168
164
|
}
|
|
169
165
|
|
|
170
|
-
const
|
|
171
|
-
provider: "
|
|
172
|
-
aliases:
|
|
173
|
-
not_found:
|
|
166
|
+
const optionalPropertyDefaults = {
|
|
167
|
+
provider: "",
|
|
168
|
+
aliases: {},
|
|
169
|
+
not_found: {},
|
|
170
|
+
...defaultIconDimensions
|
|
174
171
|
};
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
function checkOptionalProps(item, defaults) {
|
|
173
|
+
for (const prop in defaults) {
|
|
174
|
+
if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
177
179
|
}
|
|
178
180
|
function quicklyValidateIconSet(obj) {
|
|
179
181
|
if (typeof obj !== "object" || obj === null) {
|
|
@@ -183,126 +185,80 @@ function quicklyValidateIconSet(obj) {
|
|
|
183
185
|
if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
|
|
184
186
|
return null;
|
|
185
187
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
188
|
+
if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
|
|
189
|
+
return null;
|
|
190
190
|
}
|
|
191
191
|
const icons = data.icons;
|
|
192
192
|
for (const name in icons) {
|
|
193
193
|
const icon = icons[name];
|
|
194
|
-
if (!name.match(
|
|
194
|
+
if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
|
|
195
|
+
icon,
|
|
196
|
+
defaultExtendedIconProps
|
|
197
|
+
)) {
|
|
195
198
|
return null;
|
|
196
199
|
}
|
|
197
|
-
for (const prop in iconDefaults) {
|
|
198
|
-
if (icon[prop] !== void 0 && typeof icon[prop] !== typeof iconDefaults[prop]) {
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
200
|
}
|
|
203
|
-
const aliases = data.aliases;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (icon[prop] !== void 0 && typeof icon[prop] !== typeof iconDefaults[prop]) {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
201
|
+
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
202
|
+
for (const name in aliases) {
|
|
203
|
+
const icon = aliases[name];
|
|
204
|
+
const parent = icon.parent;
|
|
205
|
+
if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
|
|
206
|
+
icon,
|
|
207
|
+
defaultExtendedIconProps
|
|
208
|
+
)) {
|
|
209
|
+
return null;
|
|
216
210
|
}
|
|
217
211
|
}
|
|
218
212
|
return data;
|
|
219
213
|
}
|
|
220
214
|
|
|
221
|
-
const
|
|
222
|
-
let storage$1 = /* @__PURE__ */ Object.create(null);
|
|
223
|
-
try {
|
|
224
|
-
const w = window || self;
|
|
225
|
-
if (w && w._iconifyStorage.version === storageVersion) {
|
|
226
|
-
storage$1 = w._iconifyStorage.storage;
|
|
227
|
-
}
|
|
228
|
-
} catch (err) {
|
|
229
|
-
}
|
|
230
|
-
function shareStorage() {
|
|
231
|
-
try {
|
|
232
|
-
const w = window || self;
|
|
233
|
-
if (w && !w._iconifyStorage) {
|
|
234
|
-
w._iconifyStorage = {
|
|
235
|
-
version: storageVersion,
|
|
236
|
-
storage: storage$1
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
} catch (err) {
|
|
240
|
-
}
|
|
241
|
-
}
|
|
215
|
+
const dataStorage = /* @__PURE__ */ Object.create(null);
|
|
242
216
|
function newStorage(provider, prefix) {
|
|
243
217
|
return {
|
|
244
218
|
provider,
|
|
245
219
|
prefix,
|
|
246
220
|
icons: /* @__PURE__ */ Object.create(null),
|
|
247
|
-
missing: /* @__PURE__ */
|
|
221
|
+
missing: /* @__PURE__ */ new Set()
|
|
248
222
|
};
|
|
249
223
|
}
|
|
250
224
|
function getStorage(provider, prefix) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
const providerStorage = storage$1[provider];
|
|
255
|
-
if (providerStorage[prefix] === void 0) {
|
|
256
|
-
providerStorage[prefix] = newStorage(provider, prefix);
|
|
257
|
-
}
|
|
258
|
-
return providerStorage[prefix];
|
|
225
|
+
const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
|
|
226
|
+
return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
|
|
259
227
|
}
|
|
260
|
-
function addIconSet(
|
|
228
|
+
function addIconSet(storage, data) {
|
|
261
229
|
if (!quicklyValidateIconSet(data)) {
|
|
262
230
|
return [];
|
|
263
231
|
}
|
|
264
|
-
const t = Date.now();
|
|
265
232
|
return parseIconSet(data, (name, icon) => {
|
|
266
233
|
if (icon) {
|
|
267
|
-
|
|
234
|
+
storage.icons[name] = icon;
|
|
268
235
|
} else {
|
|
269
|
-
|
|
236
|
+
storage.missing.add(name);
|
|
270
237
|
}
|
|
271
238
|
});
|
|
272
239
|
}
|
|
273
|
-
function addIconToStorage(
|
|
240
|
+
function addIconToStorage(storage, name, icon) {
|
|
274
241
|
try {
|
|
275
242
|
if (typeof icon.body === "string") {
|
|
276
|
-
|
|
243
|
+
storage.icons[name] = { ...icon };
|
|
277
244
|
return true;
|
|
278
245
|
}
|
|
279
246
|
} catch (err) {
|
|
280
247
|
}
|
|
281
248
|
return false;
|
|
282
249
|
}
|
|
283
|
-
function getIconFromStorage(storage2, name) {
|
|
284
|
-
const value = storage2.icons[name];
|
|
285
|
-
return value === void 0 ? null : value;
|
|
286
|
-
}
|
|
287
250
|
function listIcons(provider, prefix) {
|
|
288
251
|
let allIcons = [];
|
|
289
|
-
|
|
290
|
-
if (typeof provider === "string") {
|
|
291
|
-
providers = [provider];
|
|
292
|
-
} else {
|
|
293
|
-
providers = Object.keys(storage$1);
|
|
294
|
-
}
|
|
252
|
+
const providers = typeof provider === "string" ? [provider] : Object.keys(dataStorage);
|
|
295
253
|
providers.forEach((provider2) => {
|
|
296
|
-
|
|
297
|
-
if (typeof provider2 === "string" && typeof prefix === "string") {
|
|
298
|
-
prefixes = [prefix];
|
|
299
|
-
} else {
|
|
300
|
-
prefixes = storage$1[provider2] === void 0 ? [] : Object.keys(storage$1[provider2]);
|
|
301
|
-
}
|
|
254
|
+
const prefixes = typeof provider2 === "string" && typeof prefix === "string" ? [prefix] : Object.keys(dataStorage[provider2] || {});
|
|
302
255
|
prefixes.forEach((prefix2) => {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
256
|
+
const storage = getStorage(provider2, prefix2);
|
|
257
|
+
allIcons = allIcons.concat(
|
|
258
|
+
Object.keys(storage.icons).map(
|
|
259
|
+
(name) => (provider2 !== "" ? "@" + provider2 + ":" : "") + prefix2 + ":" + name
|
|
260
|
+
)
|
|
261
|
+
);
|
|
306
262
|
});
|
|
307
263
|
});
|
|
308
264
|
return allIcons;
|
|
@@ -317,7 +273,11 @@ function allowSimpleNames(allow) {
|
|
|
317
273
|
}
|
|
318
274
|
function getIconData(name) {
|
|
319
275
|
const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
|
|
320
|
-
|
|
276
|
+
if (icon) {
|
|
277
|
+
const storage = getStorage(icon.provider, icon.prefix);
|
|
278
|
+
const iconName = icon.name;
|
|
279
|
+
return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
|
|
280
|
+
}
|
|
321
281
|
}
|
|
322
282
|
function addIcon(name, data) {
|
|
323
283
|
const icon = stringToIcon(name, true, simpleNames);
|
|
@@ -332,9 +292,9 @@ function addCollection(data, provider) {
|
|
|
332
292
|
return false;
|
|
333
293
|
}
|
|
334
294
|
if (typeof provider !== "string") {
|
|
335
|
-
provider =
|
|
295
|
+
provider = data.provider || "";
|
|
336
296
|
}
|
|
337
|
-
if (simpleNames && provider
|
|
297
|
+
if (simpleNames && !provider && !data.prefix) {
|
|
338
298
|
let added = false;
|
|
339
299
|
if (quicklyValidateIconSet(data)) {
|
|
340
300
|
data.prefix = "";
|
|
@@ -346,78 +306,38 @@ function addCollection(data, provider) {
|
|
|
346
306
|
}
|
|
347
307
|
return added;
|
|
348
308
|
}
|
|
349
|
-
|
|
309
|
+
const prefix = data.prefix;
|
|
310
|
+
if (!validateIconName({
|
|
350
311
|
provider,
|
|
351
|
-
prefix
|
|
312
|
+
prefix,
|
|
352
313
|
name: "a"
|
|
353
314
|
})) {
|
|
354
315
|
return false;
|
|
355
316
|
}
|
|
356
|
-
const storage = getStorage(provider,
|
|
317
|
+
const storage = getStorage(provider, prefix);
|
|
357
318
|
return !!addIconSet(storage, data);
|
|
358
319
|
}
|
|
359
|
-
function
|
|
360
|
-
return getIconData(name)
|
|
320
|
+
function iconLoaded(name) {
|
|
321
|
+
return !!getIconData(name);
|
|
361
322
|
}
|
|
362
323
|
function getIcon(name) {
|
|
363
324
|
const result = getIconData(name);
|
|
364
|
-
return result ? {
|
|
325
|
+
return result ? {
|
|
326
|
+
...defaultIconProps,
|
|
327
|
+
...result
|
|
328
|
+
} : null;
|
|
365
329
|
}
|
|
366
330
|
|
|
367
|
-
const
|
|
368
|
-
inline: false,
|
|
331
|
+
const defaultIconSizeCustomisations = Object.freeze({
|
|
369
332
|
width: null,
|
|
370
|
-
height: null
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
333
|
+
height: null
|
|
334
|
+
});
|
|
335
|
+
const defaultIconCustomisations = Object.freeze({
|
|
336
|
+
// Dimensions
|
|
337
|
+
...defaultIconSizeCustomisations,
|
|
338
|
+
// Transformations
|
|
339
|
+
...defaultIconTransformations
|
|
377
340
|
});
|
|
378
|
-
function mergeCustomisations(defaults2, item) {
|
|
379
|
-
const result = {};
|
|
380
|
-
for (const key in defaults2) {
|
|
381
|
-
const attr = key;
|
|
382
|
-
result[attr] = defaults2[attr];
|
|
383
|
-
if (item[attr] === void 0) {
|
|
384
|
-
continue;
|
|
385
|
-
}
|
|
386
|
-
const value = item[attr];
|
|
387
|
-
switch (attr) {
|
|
388
|
-
case "inline":
|
|
389
|
-
case "slice":
|
|
390
|
-
if (typeof value === "boolean") {
|
|
391
|
-
result[attr] = value;
|
|
392
|
-
}
|
|
393
|
-
break;
|
|
394
|
-
case "hFlip":
|
|
395
|
-
case "vFlip":
|
|
396
|
-
if (value === true) {
|
|
397
|
-
result[attr] = !result[attr];
|
|
398
|
-
}
|
|
399
|
-
break;
|
|
400
|
-
case "hAlign":
|
|
401
|
-
case "vAlign":
|
|
402
|
-
if (typeof value === "string" && value !== "") {
|
|
403
|
-
result[attr] = value;
|
|
404
|
-
}
|
|
405
|
-
break;
|
|
406
|
-
case "width":
|
|
407
|
-
case "height":
|
|
408
|
-
if (typeof value === "string" && value !== "" || typeof value === "number" && value || value === null) {
|
|
409
|
-
result[attr] = value;
|
|
410
|
-
}
|
|
411
|
-
break;
|
|
412
|
-
case "rotate":
|
|
413
|
-
if (typeof value === "number") {
|
|
414
|
-
result[attr] += value;
|
|
415
|
-
}
|
|
416
|
-
break;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
return result;
|
|
420
|
-
}
|
|
421
341
|
|
|
422
342
|
const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
423
343
|
const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
@@ -425,7 +345,7 @@ function calculateSize(size, ratio, precision) {
|
|
|
425
345
|
if (ratio === 1) {
|
|
426
346
|
return size;
|
|
427
347
|
}
|
|
428
|
-
precision = precision
|
|
348
|
+
precision = precision || 100;
|
|
429
349
|
if (typeof size === "number") {
|
|
430
350
|
return Math.ceil(size * ratio * precision) / precision;
|
|
431
351
|
}
|
|
@@ -458,40 +378,53 @@ function calculateSize(size, ratio, precision) {
|
|
|
458
378
|
}
|
|
459
379
|
}
|
|
460
380
|
|
|
461
|
-
function
|
|
462
|
-
let
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
result += "xMax";
|
|
381
|
+
function splitSVGDefs(content, tag = "defs") {
|
|
382
|
+
let defs = "";
|
|
383
|
+
const index = content.indexOf("<" + tag);
|
|
384
|
+
while (index >= 0) {
|
|
385
|
+
const start = content.indexOf(">", index);
|
|
386
|
+
const end = content.indexOf("</" + tag);
|
|
387
|
+
if (start === -1 || end === -1) {
|
|
469
388
|
break;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
switch (props.vAlign) {
|
|
474
|
-
case "top":
|
|
475
|
-
result += "YMin";
|
|
476
|
-
break;
|
|
477
|
-
case "bottom":
|
|
478
|
-
result += "YMax";
|
|
389
|
+
}
|
|
390
|
+
const endEnd = content.indexOf(">", end);
|
|
391
|
+
if (endEnd === -1) {
|
|
479
392
|
break;
|
|
480
|
-
|
|
481
|
-
|
|
393
|
+
}
|
|
394
|
+
defs += content.slice(start + 1, end).trim();
|
|
395
|
+
content = content.slice(0, index).trim() + content.slice(endEnd + 1);
|
|
482
396
|
}
|
|
483
|
-
|
|
484
|
-
|
|
397
|
+
return {
|
|
398
|
+
defs,
|
|
399
|
+
content
|
|
400
|
+
};
|
|
485
401
|
}
|
|
402
|
+
function mergeDefsAndContent(defs, content) {
|
|
403
|
+
return defs ? "<defs>" + defs + "</defs>" + content : content;
|
|
404
|
+
}
|
|
405
|
+
function wrapSVGContent(body, start, end) {
|
|
406
|
+
const split = splitSVGDefs(body);
|
|
407
|
+
return mergeDefsAndContent(split.defs, start + split.content + end);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
|
|
486
411
|
function iconToSVG(icon, customisations) {
|
|
412
|
+
const fullIcon = {
|
|
413
|
+
...defaultIconProps,
|
|
414
|
+
...icon
|
|
415
|
+
};
|
|
416
|
+
const fullCustomisations = {
|
|
417
|
+
...defaultIconCustomisations,
|
|
418
|
+
...customisations
|
|
419
|
+
};
|
|
487
420
|
const box = {
|
|
488
|
-
left:
|
|
489
|
-
top:
|
|
490
|
-
width:
|
|
491
|
-
height:
|
|
421
|
+
left: fullIcon.left,
|
|
422
|
+
top: fullIcon.top,
|
|
423
|
+
width: fullIcon.width,
|
|
424
|
+
height: fullIcon.height
|
|
492
425
|
};
|
|
493
|
-
let body =
|
|
494
|
-
[
|
|
426
|
+
let body = fullIcon.body;
|
|
427
|
+
[fullIcon, fullCustomisations].forEach((props) => {
|
|
495
428
|
const transformations = [];
|
|
496
429
|
const hFlip = props.hFlip;
|
|
497
430
|
const vFlip = props.vFlip;
|
|
@@ -500,12 +433,16 @@ function iconToSVG(icon, customisations) {
|
|
|
500
433
|
if (vFlip) {
|
|
501
434
|
rotation += 2;
|
|
502
435
|
} else {
|
|
503
|
-
transformations.push(
|
|
436
|
+
transformations.push(
|
|
437
|
+
"translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
|
|
438
|
+
);
|
|
504
439
|
transformations.push("scale(-1 1)");
|
|
505
440
|
box.top = box.left = 0;
|
|
506
441
|
}
|
|
507
442
|
} else if (vFlip) {
|
|
508
|
-
transformations.push(
|
|
443
|
+
transformations.push(
|
|
444
|
+
"translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
|
|
445
|
+
);
|
|
509
446
|
transformations.push("scale(1 -1)");
|
|
510
447
|
box.top = box.left = 0;
|
|
511
448
|
}
|
|
@@ -517,18 +454,24 @@ function iconToSVG(icon, customisations) {
|
|
|
517
454
|
switch (rotation) {
|
|
518
455
|
case 1:
|
|
519
456
|
tempValue = box.height / 2 + box.top;
|
|
520
|
-
transformations.unshift(
|
|
457
|
+
transformations.unshift(
|
|
458
|
+
"rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
|
|
459
|
+
);
|
|
521
460
|
break;
|
|
522
461
|
case 2:
|
|
523
|
-
transformations.unshift(
|
|
462
|
+
transformations.unshift(
|
|
463
|
+
"rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
|
|
464
|
+
);
|
|
524
465
|
break;
|
|
525
466
|
case 3:
|
|
526
467
|
tempValue = box.width / 2 + box.left;
|
|
527
|
-
transformations.unshift(
|
|
468
|
+
transformations.unshift(
|
|
469
|
+
"rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
|
|
470
|
+
);
|
|
528
471
|
break;
|
|
529
472
|
}
|
|
530
473
|
if (rotation % 2 === 1) {
|
|
531
|
-
if (box.left !==
|
|
474
|
+
if (box.left !== box.top) {
|
|
532
475
|
tempValue = box.left;
|
|
533
476
|
box.left = box.top;
|
|
534
477
|
box.top = tempValue;
|
|
@@ -540,48 +483,41 @@ function iconToSVG(icon, customisations) {
|
|
|
540
483
|
}
|
|
541
484
|
}
|
|
542
485
|
if (transformations.length) {
|
|
543
|
-
body =
|
|
486
|
+
body = wrapSVGContent(
|
|
487
|
+
body,
|
|
488
|
+
'<g transform="' + transformations.join(" ") + '">',
|
|
489
|
+
"</g>"
|
|
490
|
+
);
|
|
544
491
|
}
|
|
545
492
|
});
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
width = calculateSize(height, box.width / box.height);
|
|
493
|
+
const customisationsWidth = fullCustomisations.width;
|
|
494
|
+
const customisationsHeight = fullCustomisations.height;
|
|
495
|
+
const boxWidth = box.width;
|
|
496
|
+
const boxHeight = box.height;
|
|
497
|
+
let width;
|
|
498
|
+
let height;
|
|
499
|
+
if (customisationsWidth === null) {
|
|
500
|
+
height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
501
|
+
width = calculateSize(height, boxWidth / boxHeight);
|
|
556
502
|
} else {
|
|
557
|
-
width =
|
|
558
|
-
height = calculateSize(width,
|
|
559
|
-
}
|
|
560
|
-
if (width === "auto") {
|
|
561
|
-
width = box.width;
|
|
562
|
-
}
|
|
563
|
-
if (height === "auto") {
|
|
564
|
-
height = box.height;
|
|
503
|
+
width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
|
|
504
|
+
height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
565
505
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
506
|
+
const attributes = {};
|
|
507
|
+
const setAttr = (prop, value) => {
|
|
508
|
+
if (!isUnsetKeyword(value)) {
|
|
509
|
+
attributes[prop] = value.toString();
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
setAttr("width", width);
|
|
513
|
+
setAttr("height", height);
|
|
514
|
+
const viewBox = [box.left, box.top, boxWidth, boxHeight];
|
|
515
|
+
attributes.viewBox = viewBox.join(" ");
|
|
516
|
+
return {
|
|
517
|
+
attributes,
|
|
518
|
+
viewBox,
|
|
575
519
|
body
|
|
576
520
|
};
|
|
577
|
-
if (customisations.inline) {
|
|
578
|
-
result.inline = true;
|
|
579
|
-
}
|
|
580
|
-
return result;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
function buildIcon(icon, customisations) {
|
|
584
|
-
return iconToSVG(fullIcon(icon), customisations ? mergeCustomisations(defaults, customisations) : defaults);
|
|
585
521
|
}
|
|
586
522
|
|
|
587
523
|
const regex = /\sid="(\S+)"/g;
|
|
@@ -596,11 +532,18 @@ function replaceIDs(body, prefix = randomPrefix) {
|
|
|
596
532
|
if (!ids.length) {
|
|
597
533
|
return body;
|
|
598
534
|
}
|
|
535
|
+
const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
599
536
|
ids.forEach((id) => {
|
|
600
537
|
const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
|
|
601
538
|
const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
602
|
-
body = body.replace(
|
|
539
|
+
body = body.replace(
|
|
540
|
+
// Allowed characters before id: [#;"]
|
|
541
|
+
// Allowed characters after id: [)"], .[a-z]
|
|
542
|
+
new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
|
|
543
|
+
"$1" + newID + suffix + "$3"
|
|
544
|
+
);
|
|
603
545
|
});
|
|
546
|
+
body = body.replace(new RegExp(suffix, "g"), "");
|
|
604
547
|
return body;
|
|
605
548
|
}
|
|
606
549
|
|
|
@@ -623,13 +566,21 @@ function createAPIConfig(source) {
|
|
|
623
566
|
}
|
|
624
567
|
}
|
|
625
568
|
const result = {
|
|
569
|
+
// API hosts
|
|
626
570
|
resources,
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
571
|
+
// Root path
|
|
572
|
+
path: source.path || "/",
|
|
573
|
+
// URL length limit
|
|
574
|
+
maxURL: source.maxURL || 500,
|
|
575
|
+
// Timeout before next host is used.
|
|
576
|
+
rotate: source.rotate || 750,
|
|
577
|
+
// Timeout before failing query.
|
|
578
|
+
timeout: source.timeout || 5e3,
|
|
579
|
+
// Randomise default API end point.
|
|
631
580
|
random: source.random === true,
|
|
632
|
-
|
|
581
|
+
// Start index
|
|
582
|
+
index: source.index || 0,
|
|
583
|
+
// Receive data after time out (used if time out kicks in first, then API module sends data anyway).
|
|
633
584
|
dataAfterTimeout: source.dataAfterTimeout !== false
|
|
634
585
|
};
|
|
635
586
|
return result;
|
|
@@ -669,35 +620,6 @@ function listAPIProviders() {
|
|
|
669
620
|
return Object.keys(configStorage);
|
|
670
621
|
}
|
|
671
622
|
|
|
672
|
-
const mergeParams = (base, params) => {
|
|
673
|
-
let result = base, hasParams = result.indexOf("?") !== -1;
|
|
674
|
-
function paramToString(value) {
|
|
675
|
-
switch (typeof value) {
|
|
676
|
-
case "boolean":
|
|
677
|
-
return value ? "true" : "false";
|
|
678
|
-
case "number":
|
|
679
|
-
return encodeURIComponent(value);
|
|
680
|
-
case "string":
|
|
681
|
-
return encodeURIComponent(value);
|
|
682
|
-
default:
|
|
683
|
-
throw new Error("Invalid parameter");
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
Object.keys(params).forEach((key) => {
|
|
687
|
-
let value;
|
|
688
|
-
try {
|
|
689
|
-
value = paramToString(params[key]);
|
|
690
|
-
} catch (err) {
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
result += (hasParams ? "&" : "?") + encodeURIComponent(key) + "=" + value;
|
|
694
|
-
hasParams = true;
|
|
695
|
-
});
|
|
696
|
-
return result;
|
|
697
|
-
};
|
|
698
|
-
|
|
699
|
-
const maxLengthCache = {};
|
|
700
|
-
const pathCache = {};
|
|
701
623
|
const detectFetch = () => {
|
|
702
624
|
let callback;
|
|
703
625
|
try {
|
|
@@ -707,7 +629,6 @@ const detectFetch = () => {
|
|
|
707
629
|
}
|
|
708
630
|
} catch (err) {
|
|
709
631
|
}
|
|
710
|
-
return null;
|
|
711
632
|
};
|
|
712
633
|
let fetchModule = detectFetch();
|
|
713
634
|
function setFetch(fetch2) {
|
|
@@ -730,14 +651,9 @@ function calculateMaxLength(provider, prefix) {
|
|
|
730
651
|
const host = item;
|
|
731
652
|
maxHostLength = Math.max(maxHostLength, host.length);
|
|
732
653
|
});
|
|
733
|
-
const url =
|
|
734
|
-
icons: ""
|
|
735
|
-
});
|
|
654
|
+
const url = prefix + ".json?icons=";
|
|
736
655
|
result = config.maxURL - maxHostLength - config.path.length - url.length;
|
|
737
656
|
}
|
|
738
|
-
const cacheKey = provider + ":" + prefix;
|
|
739
|
-
pathCache[provider] = config.path;
|
|
740
|
-
maxLengthCache[cacheKey] = result;
|
|
741
657
|
return result;
|
|
742
658
|
}
|
|
743
659
|
function shouldAbort(status) {
|
|
@@ -745,10 +661,7 @@ function shouldAbort(status) {
|
|
|
745
661
|
}
|
|
746
662
|
const prepare = (provider, prefix, icons) => {
|
|
747
663
|
const results = [];
|
|
748
|
-
|
|
749
|
-
if (maxLength === void 0) {
|
|
750
|
-
maxLength = calculateMaxLength(provider, prefix);
|
|
751
|
-
}
|
|
664
|
+
const maxLength = calculateMaxLength(provider, prefix);
|
|
752
665
|
const type = "icons";
|
|
753
666
|
let item = {
|
|
754
667
|
type,
|
|
@@ -776,14 +689,10 @@ const prepare = (provider, prefix, icons) => {
|
|
|
776
689
|
};
|
|
777
690
|
function getPath(provider) {
|
|
778
691
|
if (typeof provider === "string") {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
return "/";
|
|
783
|
-
}
|
|
784
|
-
pathCache[provider] = config.path;
|
|
692
|
+
const config = getAPIConfig(provider);
|
|
693
|
+
if (config) {
|
|
694
|
+
return config.path;
|
|
785
695
|
}
|
|
786
|
-
return pathCache[provider];
|
|
787
696
|
}
|
|
788
697
|
return "/";
|
|
789
698
|
}
|
|
@@ -798,9 +707,10 @@ const send = (host, params, callback) => {
|
|
|
798
707
|
const prefix = params.prefix;
|
|
799
708
|
const icons = params.icons;
|
|
800
709
|
const iconsList = icons.join(",");
|
|
801
|
-
|
|
710
|
+
const urlParams = new URLSearchParams({
|
|
802
711
|
icons: iconsList
|
|
803
712
|
});
|
|
713
|
+
path += prefix + ".json?" + urlParams.toString();
|
|
804
714
|
break;
|
|
805
715
|
}
|
|
806
716
|
case "custom": {
|
|
@@ -826,7 +736,11 @@ const send = (host, params, callback) => {
|
|
|
826
736
|
}).then((data) => {
|
|
827
737
|
if (typeof data !== "object" || data === null) {
|
|
828
738
|
setTimeout(() => {
|
|
829
|
-
|
|
739
|
+
if (data === 404) {
|
|
740
|
+
callback("abort", data);
|
|
741
|
+
} else {
|
|
742
|
+
callback("next", defaultError);
|
|
743
|
+
}
|
|
830
744
|
});
|
|
831
745
|
return;
|
|
832
746
|
}
|
|
@@ -871,18 +785,12 @@ function sortIcons(icons) {
|
|
|
871
785
|
const provider = icon.provider;
|
|
872
786
|
const prefix = icon.prefix;
|
|
873
787
|
const name = icon.name;
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
const providerStorage = storage[provider];
|
|
878
|
-
if (providerStorage[prefix] === void 0) {
|
|
879
|
-
providerStorage[prefix] = getStorage(provider, prefix);
|
|
880
|
-
}
|
|
881
|
-
const localStorage = providerStorage[prefix];
|
|
788
|
+
const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
|
|
789
|
+
const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
|
|
882
790
|
let list;
|
|
883
|
-
if (localStorage.icons
|
|
791
|
+
if (name in localStorage.icons) {
|
|
884
792
|
list = result.loaded;
|
|
885
|
-
} else if (prefix === "" || localStorage.missing
|
|
793
|
+
} else if (prefix === "" || localStorage.missing.has(name)) {
|
|
886
794
|
list = result.missing;
|
|
887
795
|
} else {
|
|
888
796
|
list = result.pending;
|
|
@@ -897,40 +805,26 @@ function sortIcons(icons) {
|
|
|
897
805
|
return result;
|
|
898
806
|
}
|
|
899
807
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
sources.forEach((source) => {
|
|
904
|
-
const provider = source.provider;
|
|
905
|
-
if (callbacks[provider] === void 0) {
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
908
|
-
const providerCallbacks = callbacks[provider];
|
|
909
|
-
const prefix = source.prefix;
|
|
910
|
-
const items = providerCallbacks[prefix];
|
|
808
|
+
function removeCallback(storages, id) {
|
|
809
|
+
storages.forEach((storage) => {
|
|
810
|
+
const items = storage.loaderCallbacks;
|
|
911
811
|
if (items) {
|
|
912
|
-
|
|
812
|
+
storage.loaderCallbacks = items.filter((row) => row.id !== id);
|
|
913
813
|
}
|
|
914
814
|
});
|
|
915
815
|
}
|
|
916
|
-
function updateCallbacks(
|
|
917
|
-
if (
|
|
918
|
-
|
|
919
|
-
}
|
|
920
|
-
const providerPendingUpdates = pendingUpdates[provider];
|
|
921
|
-
if (!providerPendingUpdates[prefix]) {
|
|
922
|
-
providerPendingUpdates[prefix] = true;
|
|
816
|
+
function updateCallbacks(storage) {
|
|
817
|
+
if (!storage.pendingCallbacksFlag) {
|
|
818
|
+
storage.pendingCallbacksFlag = true;
|
|
923
819
|
setTimeout(() => {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
const items = callbacks[provider][prefix].slice(0);
|
|
820
|
+
storage.pendingCallbacksFlag = false;
|
|
821
|
+
const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
|
|
929
822
|
if (!items.length) {
|
|
930
823
|
return;
|
|
931
824
|
}
|
|
932
|
-
const storage = getStorage(provider, prefix);
|
|
933
825
|
let hasPending = false;
|
|
826
|
+
const provider = storage.provider;
|
|
827
|
+
const prefix = storage.prefix;
|
|
934
828
|
items.forEach((item) => {
|
|
935
829
|
const icons = item.icons;
|
|
936
830
|
const oldLength = icons.pending.length;
|
|
@@ -939,13 +833,13 @@ function updateCallbacks(provider, prefix) {
|
|
|
939
833
|
return true;
|
|
940
834
|
}
|
|
941
835
|
const name = icon.name;
|
|
942
|
-
if (storage.icons[name]
|
|
836
|
+
if (storage.icons[name]) {
|
|
943
837
|
icons.loaded.push({
|
|
944
838
|
provider,
|
|
945
839
|
prefix,
|
|
946
840
|
name
|
|
947
841
|
});
|
|
948
|
-
} else if (storage.missing
|
|
842
|
+
} else if (storage.missing.has(name)) {
|
|
949
843
|
icons.missing.push({
|
|
950
844
|
provider,
|
|
951
845
|
prefix,
|
|
@@ -959,14 +853,14 @@ function updateCallbacks(provider, prefix) {
|
|
|
959
853
|
});
|
|
960
854
|
if (icons.pending.length !== oldLength) {
|
|
961
855
|
if (!hasPending) {
|
|
962
|
-
removeCallback([
|
|
963
|
-
{
|
|
964
|
-
provider,
|
|
965
|
-
prefix
|
|
966
|
-
}
|
|
967
|
-
], item.id);
|
|
856
|
+
removeCallback([storage], item.id);
|
|
968
857
|
}
|
|
969
|
-
item.callback(
|
|
858
|
+
item.callback(
|
|
859
|
+
icons.loaded.slice(0),
|
|
860
|
+
icons.missing.slice(0),
|
|
861
|
+
icons.pending.slice(0),
|
|
862
|
+
item.abort
|
|
863
|
+
);
|
|
970
864
|
}
|
|
971
865
|
});
|
|
972
866
|
});
|
|
@@ -985,17 +879,8 @@ function storeCallback(callback, icons, pendingSources) {
|
|
|
985
879
|
callback,
|
|
986
880
|
abort
|
|
987
881
|
};
|
|
988
|
-
pendingSources.forEach((
|
|
989
|
-
|
|
990
|
-
const prefix = source.prefix;
|
|
991
|
-
if (callbacks[provider] === void 0) {
|
|
992
|
-
callbacks[provider] = /* @__PURE__ */ Object.create(null);
|
|
993
|
-
}
|
|
994
|
-
const providerCallbacks = callbacks[provider];
|
|
995
|
-
if (providerCallbacks[prefix] === void 0) {
|
|
996
|
-
providerCallbacks[prefix] = [];
|
|
997
|
-
}
|
|
998
|
-
providerCallbacks[prefix].push(item);
|
|
882
|
+
pendingSources.forEach((storage) => {
|
|
883
|
+
(storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
|
|
999
884
|
});
|
|
1000
885
|
return abort;
|
|
1001
886
|
}
|
|
@@ -1003,13 +888,9 @@ function storeCallback(callback, icons, pendingSources) {
|
|
|
1003
888
|
function listToIcons(list, validate = true, simpleNames = false) {
|
|
1004
889
|
const result = [];
|
|
1005
890
|
list.forEach((item) => {
|
|
1006
|
-
const icon = typeof item === "string" ? stringToIcon(item,
|
|
1007
|
-
if (
|
|
1008
|
-
result.push(
|
|
1009
|
-
provider: icon.provider,
|
|
1010
|
-
prefix: icon.prefix,
|
|
1011
|
-
name: icon.name
|
|
1012
|
-
});
|
|
891
|
+
const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
|
|
892
|
+
if (icon) {
|
|
893
|
+
result.push(icon);
|
|
1013
894
|
}
|
|
1014
895
|
});
|
|
1015
896
|
return result;
|
|
@@ -1183,42 +1064,34 @@ function sendQuery(config, payload, query, done) {
|
|
|
1183
1064
|
}
|
|
1184
1065
|
|
|
1185
1066
|
// src/index.ts
|
|
1186
|
-
function setConfig(config) {
|
|
1187
|
-
if (typeof config !== "object" || typeof config.resources !== "object" || !(config.resources instanceof Array) || !config.resources.length) {
|
|
1188
|
-
throw new Error("Invalid Reduncancy configuration");
|
|
1189
|
-
}
|
|
1190
|
-
const newConfig = /* @__PURE__ */ Object.create(null);
|
|
1191
|
-
let key;
|
|
1192
|
-
for (key in defaultConfig) {
|
|
1193
|
-
if (config[key] !== void 0) {
|
|
1194
|
-
newConfig[key] = config[key];
|
|
1195
|
-
} else {
|
|
1196
|
-
newConfig[key] = defaultConfig[key];
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
return newConfig;
|
|
1200
|
-
}
|
|
1201
1067
|
function initRedundancy(cfg) {
|
|
1202
|
-
const config =
|
|
1068
|
+
const config = {
|
|
1069
|
+
...defaultConfig,
|
|
1070
|
+
...cfg
|
|
1071
|
+
};
|
|
1203
1072
|
let queries = [];
|
|
1204
1073
|
function cleanup() {
|
|
1205
1074
|
queries = queries.filter((item) => item().status === "pending");
|
|
1206
1075
|
}
|
|
1207
1076
|
function query(payload, queryCallback, doneCallback) {
|
|
1208
|
-
const query2 = sendQuery(
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1077
|
+
const query2 = sendQuery(
|
|
1078
|
+
config,
|
|
1079
|
+
payload,
|
|
1080
|
+
queryCallback,
|
|
1081
|
+
(data, error) => {
|
|
1082
|
+
cleanup();
|
|
1083
|
+
if (doneCallback) {
|
|
1084
|
+
doneCallback(data, error);
|
|
1085
|
+
}
|
|
1212
1086
|
}
|
|
1213
|
-
|
|
1087
|
+
);
|
|
1214
1088
|
queries.push(query2);
|
|
1215
1089
|
return query2;
|
|
1216
1090
|
}
|
|
1217
1091
|
function find(callback) {
|
|
1218
|
-
|
|
1092
|
+
return queries.find((value) => {
|
|
1219
1093
|
return callback(value);
|
|
1220
|
-
});
|
|
1221
|
-
return result !== void 0 ? result : null;
|
|
1094
|
+
}) || null;
|
|
1222
1095
|
}
|
|
1223
1096
|
const instance = {
|
|
1224
1097
|
query,
|
|
@@ -1236,7 +1109,7 @@ function emptyCallback$1() {
|
|
|
1236
1109
|
}
|
|
1237
1110
|
const redundancyCache = /* @__PURE__ */ Object.create(null);
|
|
1238
1111
|
function getRedundancyCache(provider) {
|
|
1239
|
-
if (redundancyCache[provider]
|
|
1112
|
+
if (!redundancyCache[provider]) {
|
|
1240
1113
|
const config = getAPIConfig(provider);
|
|
1241
1114
|
if (!config) {
|
|
1242
1115
|
return;
|
|
@@ -1282,95 +1155,257 @@ function sendAPIQuery(target, query, callback) {
|
|
|
1282
1155
|
return redundancy.query(query, send, callback)().abort;
|
|
1283
1156
|
}
|
|
1284
1157
|
|
|
1285
|
-
const
|
|
1158
|
+
const browserCacheVersion = "iconify2";
|
|
1159
|
+
const browserCachePrefix = "iconify";
|
|
1160
|
+
const browserCacheCountKey = browserCachePrefix + "-count";
|
|
1161
|
+
const browserCacheVersionKey = browserCachePrefix + "-version";
|
|
1162
|
+
const browserStorageHour = 36e5;
|
|
1163
|
+
const browserStorageCacheExpiration = 168;
|
|
1164
|
+
const browserStorageLimit = 50;
|
|
1286
1165
|
|
|
1287
|
-
function
|
|
1166
|
+
function getStoredItem(func, key) {
|
|
1167
|
+
try {
|
|
1168
|
+
return func.getItem(key);
|
|
1169
|
+
} catch (err) {
|
|
1170
|
+
}
|
|
1288
1171
|
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1172
|
+
function setStoredItem(func, key, value) {
|
|
1173
|
+
try {
|
|
1174
|
+
func.setItem(key, value);
|
|
1175
|
+
return true;
|
|
1176
|
+
} catch (err) {
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
function removeStoredItem(func, key) {
|
|
1180
|
+
try {
|
|
1181
|
+
func.removeItem(key);
|
|
1182
|
+
} catch (err) {
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
function setBrowserStorageItemsCount(storage, value) {
|
|
1187
|
+
return setStoredItem(storage, browserCacheCountKey, value.toString());
|
|
1188
|
+
}
|
|
1189
|
+
function getBrowserStorageItemsCount(storage) {
|
|
1190
|
+
return parseInt(getStoredItem(storage, browserCacheCountKey)) || 0;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
const browserStorageConfig = {
|
|
1194
|
+
local: true,
|
|
1195
|
+
session: true
|
|
1196
|
+
};
|
|
1197
|
+
const browserStorageEmptyItems = {
|
|
1198
|
+
local: /* @__PURE__ */ new Set(),
|
|
1199
|
+
session: /* @__PURE__ */ new Set()
|
|
1200
|
+
};
|
|
1201
|
+
let browserStorageStatus = false;
|
|
1202
|
+
function setBrowserStorageStatus(status) {
|
|
1203
|
+
browserStorageStatus = status;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
let _window = typeof window === "undefined" ? {} : window;
|
|
1207
|
+
function getBrowserStorage(key) {
|
|
1208
|
+
const attr = key + "Storage";
|
|
1209
|
+
try {
|
|
1210
|
+
if (_window && _window[attr] && typeof _window[attr].length === "number") {
|
|
1211
|
+
return _window[attr];
|
|
1212
|
+
}
|
|
1213
|
+
} catch (err) {
|
|
1214
|
+
}
|
|
1215
|
+
browserStorageConfig[key] = false;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
function iterateBrowserStorage(key, callback) {
|
|
1219
|
+
const func = getBrowserStorage(key);
|
|
1220
|
+
if (!func) {
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
const version = getStoredItem(func, browserCacheVersionKey);
|
|
1224
|
+
if (version !== browserCacheVersion) {
|
|
1225
|
+
if (version) {
|
|
1226
|
+
const total2 = getBrowserStorageItemsCount(func);
|
|
1227
|
+
for (let i = 0; i < total2; i++) {
|
|
1228
|
+
removeStoredItem(func, browserCachePrefix + i.toString());
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
|
|
1232
|
+
setBrowserStorageItemsCount(func, 0);
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
|
|
1236
|
+
const parseItem = (index) => {
|
|
1237
|
+
const name = browserCachePrefix + index.toString();
|
|
1238
|
+
const item = getStoredItem(func, name);
|
|
1239
|
+
if (typeof item !== "string") {
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
try {
|
|
1243
|
+
const data = JSON.parse(item);
|
|
1244
|
+
if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
|
|
1245
|
+
callback(data, index)) {
|
|
1246
|
+
return true;
|
|
1247
|
+
}
|
|
1248
|
+
} catch (err) {
|
|
1249
|
+
}
|
|
1250
|
+
removeStoredItem(func, name);
|
|
1251
|
+
};
|
|
1252
|
+
let total = getBrowserStorageItemsCount(func);
|
|
1253
|
+
for (let i = total - 1; i >= 0; i--) {
|
|
1254
|
+
if (!parseItem(i)) {
|
|
1255
|
+
if (i === total - 1) {
|
|
1256
|
+
total--;
|
|
1257
|
+
setBrowserStorageItemsCount(func, total);
|
|
1258
|
+
} else {
|
|
1259
|
+
browserStorageEmptyItems[key].add(i);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
function initBrowserStorage() {
|
|
1266
|
+
if (browserStorageStatus) {
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
setBrowserStorageStatus(true);
|
|
1270
|
+
for (const key in browserStorageConfig) {
|
|
1271
|
+
iterateBrowserStorage(key, (item) => {
|
|
1272
|
+
const iconSet = item.data;
|
|
1273
|
+
const provider = item.provider;
|
|
1274
|
+
const prefix = iconSet.prefix;
|
|
1275
|
+
const storage = getStorage(
|
|
1276
|
+
provider,
|
|
1277
|
+
prefix
|
|
1278
|
+
);
|
|
1279
|
+
if (!addIconSet(storage, iconSet).length) {
|
|
1280
|
+
return false;
|
|
1281
|
+
}
|
|
1282
|
+
const lastModified = iconSet.lastModified || -1;
|
|
1283
|
+
storage.lastModifiedCached = storage.lastModifiedCached ? Math.min(storage.lastModifiedCached, lastModified) : lastModified;
|
|
1284
|
+
return true;
|
|
1303
1285
|
});
|
|
1304
1286
|
}
|
|
1305
1287
|
}
|
|
1306
|
-
|
|
1307
|
-
function
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1288
|
+
|
|
1289
|
+
function updateLastModified(storage, lastModified) {
|
|
1290
|
+
const lastValue = storage.lastModifiedCached;
|
|
1291
|
+
if (
|
|
1292
|
+
// Matches or newer
|
|
1293
|
+
lastValue && lastValue >= lastModified
|
|
1294
|
+
) {
|
|
1295
|
+
return lastValue === lastModified;
|
|
1296
|
+
}
|
|
1297
|
+
storage.lastModifiedCached = lastModified;
|
|
1298
|
+
if (lastValue) {
|
|
1299
|
+
for (const key in browserStorageConfig) {
|
|
1300
|
+
iterateBrowserStorage(key, (item) => {
|
|
1301
|
+
const iconSet = item.data;
|
|
1302
|
+
return item.provider !== storage.provider || iconSet.prefix !== storage.prefix || iconSet.lastModified === lastModified;
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
return true;
|
|
1307
|
+
}
|
|
1308
|
+
function storeInBrowserStorage(storage, data) {
|
|
1309
|
+
if (!browserStorageStatus) {
|
|
1310
|
+
initBrowserStorage();
|
|
1311
|
+
}
|
|
1312
|
+
function store(key) {
|
|
1313
|
+
let func;
|
|
1314
|
+
if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
const set = browserStorageEmptyItems[key];
|
|
1318
|
+
let index;
|
|
1319
|
+
if (set.size) {
|
|
1320
|
+
set.delete(index = Array.from(set).shift());
|
|
1321
|
+
} else {
|
|
1322
|
+
index = getBrowserStorageItemsCount(func);
|
|
1323
|
+
if (index >= browserStorageLimit || !setBrowserStorageItemsCount(func, index + 1)) {
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1314
1326
|
}
|
|
1327
|
+
const item = {
|
|
1328
|
+
cached: Math.floor(Date.now() / browserStorageHour),
|
|
1329
|
+
provider: storage.provider,
|
|
1330
|
+
data
|
|
1331
|
+
};
|
|
1332
|
+
return setStoredItem(
|
|
1333
|
+
func,
|
|
1334
|
+
browserCachePrefix + index.toString(),
|
|
1335
|
+
JSON.stringify(item)
|
|
1336
|
+
);
|
|
1315
1337
|
}
|
|
1316
|
-
if (
|
|
1317
|
-
|
|
1338
|
+
if (data.lastModified && !updateLastModified(storage, data.lastModified)) {
|
|
1339
|
+
return;
|
|
1318
1340
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
queueFlags[provider] = /* @__PURE__ */ Object.create(null);
|
|
1341
|
+
if (!Object.keys(data.icons).length) {
|
|
1342
|
+
return;
|
|
1322
1343
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1344
|
+
if (data.not_found) {
|
|
1345
|
+
data = Object.assign({}, data);
|
|
1346
|
+
delete data.not_found;
|
|
1347
|
+
}
|
|
1348
|
+
if (!store("local")) {
|
|
1349
|
+
store("session");
|
|
1326
1350
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
function emptyCallback() {
|
|
1354
|
+
}
|
|
1355
|
+
function loadedNewIcons(storage) {
|
|
1356
|
+
if (!storage.iconsLoaderFlag) {
|
|
1357
|
+
storage.iconsLoaderFlag = true;
|
|
1358
|
+
setTimeout(() => {
|
|
1359
|
+
storage.iconsLoaderFlag = false;
|
|
1360
|
+
updateCallbacks(storage);
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
function loadNewIcons(storage, icons) {
|
|
1365
|
+
if (!storage.iconsToLoad) {
|
|
1366
|
+
storage.iconsToLoad = icons;
|
|
1330
1367
|
} else {
|
|
1331
|
-
|
|
1368
|
+
storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
|
|
1332
1369
|
}
|
|
1333
|
-
if (!
|
|
1334
|
-
|
|
1370
|
+
if (!storage.iconsQueueFlag) {
|
|
1371
|
+
storage.iconsQueueFlag = true;
|
|
1335
1372
|
setTimeout(() => {
|
|
1336
|
-
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1373
|
+
storage.iconsQueueFlag = false;
|
|
1374
|
+
const { provider, prefix } = storage;
|
|
1375
|
+
const icons2 = storage.iconsToLoad;
|
|
1376
|
+
delete storage.iconsToLoad;
|
|
1377
|
+
let api;
|
|
1378
|
+
if (!icons2 || !(api = getAPIModule(provider))) {
|
|
1342
1379
|
return;
|
|
1343
1380
|
}
|
|
1344
1381
|
const params = api.prepare(provider, prefix, icons2);
|
|
1345
1382
|
params.forEach((item) => {
|
|
1346
|
-
sendAPIQuery(provider, item, (data
|
|
1347
|
-
const storage = getStorage(provider, prefix);
|
|
1383
|
+
sendAPIQuery(provider, item, (data) => {
|
|
1348
1384
|
if (typeof data !== "object") {
|
|
1349
|
-
if (error !== 404) {
|
|
1350
|
-
return;
|
|
1351
|
-
}
|
|
1352
|
-
const t = Date.now();
|
|
1353
1385
|
item.icons.forEach((name) => {
|
|
1354
|
-
storage.missing
|
|
1386
|
+
storage.missing.add(name);
|
|
1355
1387
|
});
|
|
1356
1388
|
} else {
|
|
1357
1389
|
try {
|
|
1358
|
-
const parsed = addIconSet(
|
|
1390
|
+
const parsed = addIconSet(
|
|
1391
|
+
storage,
|
|
1392
|
+
data
|
|
1393
|
+
);
|
|
1359
1394
|
if (!parsed.length) {
|
|
1360
1395
|
return;
|
|
1361
1396
|
}
|
|
1362
|
-
const pending =
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
cache.store(provider, data);
|
|
1397
|
+
const pending = storage.pendingIcons;
|
|
1398
|
+
if (pending) {
|
|
1399
|
+
parsed.forEach((name) => {
|
|
1400
|
+
pending.delete(name);
|
|
1401
|
+
});
|
|
1368
1402
|
}
|
|
1369
|
-
|
|
1370
|
-
|
|
1403
|
+
storeInBrowserStorage(storage, data);
|
|
1404
|
+
} catch (err) {
|
|
1405
|
+
console.error(err);
|
|
1371
1406
|
}
|
|
1372
1407
|
}
|
|
1373
|
-
loadedNewIcons(
|
|
1408
|
+
loadedNewIcons(storage);
|
|
1374
1409
|
});
|
|
1375
1410
|
});
|
|
1376
1411
|
});
|
|
@@ -1384,7 +1419,12 @@ const loadIcons = (icons, callback) => {
|
|
|
1384
1419
|
if (callback) {
|
|
1385
1420
|
setTimeout(() => {
|
|
1386
1421
|
if (callCallback) {
|
|
1387
|
-
callback(
|
|
1422
|
+
callback(
|
|
1423
|
+
sortedIcons.loaded,
|
|
1424
|
+
sortedIcons.missing,
|
|
1425
|
+
sortedIcons.pending,
|
|
1426
|
+
emptyCallback
|
|
1427
|
+
);
|
|
1388
1428
|
}
|
|
1389
1429
|
});
|
|
1390
1430
|
}
|
|
@@ -1396,61 +1436,50 @@ const loadIcons = (icons, callback) => {
|
|
|
1396
1436
|
const sources = [];
|
|
1397
1437
|
let lastProvider, lastPrefix;
|
|
1398
1438
|
sortedIcons.pending.forEach((icon) => {
|
|
1399
|
-
const provider = icon
|
|
1400
|
-
const prefix = icon.prefix;
|
|
1439
|
+
const { provider, prefix } = icon;
|
|
1401
1440
|
if (prefix === lastPrefix && provider === lastProvider) {
|
|
1402
1441
|
return;
|
|
1403
1442
|
}
|
|
1404
1443
|
lastProvider = provider;
|
|
1405
1444
|
lastPrefix = prefix;
|
|
1406
|
-
sources.push(
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
});
|
|
1410
|
-
if (pendingIcons[provider] === void 0) {
|
|
1411
|
-
pendingIcons[provider] = /* @__PURE__ */ Object.create(null);
|
|
1412
|
-
}
|
|
1413
|
-
const providerPendingIcons = pendingIcons[provider];
|
|
1414
|
-
if (providerPendingIcons[prefix] === void 0) {
|
|
1415
|
-
providerPendingIcons[prefix] = /* @__PURE__ */ Object.create(null);
|
|
1416
|
-
}
|
|
1417
|
-
if (newIcons[provider] === void 0) {
|
|
1418
|
-
newIcons[provider] = /* @__PURE__ */ Object.create(null);
|
|
1419
|
-
}
|
|
1420
|
-
const providerNewIcons = newIcons[provider];
|
|
1421
|
-
if (providerNewIcons[prefix] === void 0) {
|
|
1445
|
+
sources.push(getStorage(provider, prefix));
|
|
1446
|
+
const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
|
|
1447
|
+
if (!providerNewIcons[prefix]) {
|
|
1422
1448
|
providerNewIcons[prefix] = [];
|
|
1423
1449
|
}
|
|
1424
1450
|
});
|
|
1425
|
-
const time = Date.now();
|
|
1426
1451
|
sortedIcons.pending.forEach((icon) => {
|
|
1427
|
-
const provider = icon
|
|
1428
|
-
const
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
pendingQueue[name] = time;
|
|
1452
|
+
const { provider, prefix, name } = icon;
|
|
1453
|
+
const storage = getStorage(provider, prefix);
|
|
1454
|
+
const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
|
|
1455
|
+
if (!pendingQueue.has(name)) {
|
|
1456
|
+
pendingQueue.add(name);
|
|
1433
1457
|
newIcons[provider][prefix].push(name);
|
|
1434
1458
|
}
|
|
1435
1459
|
});
|
|
1436
|
-
sources.forEach((
|
|
1437
|
-
const provider =
|
|
1438
|
-
const prefix = source.prefix;
|
|
1460
|
+
sources.forEach((storage) => {
|
|
1461
|
+
const { provider, prefix } = storage;
|
|
1439
1462
|
if (newIcons[provider][prefix].length) {
|
|
1440
|
-
loadNewIcons(
|
|
1463
|
+
loadNewIcons(storage, newIcons[provider][prefix]);
|
|
1441
1464
|
}
|
|
1442
1465
|
});
|
|
1443
1466
|
return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
|
|
1444
1467
|
};
|
|
1445
1468
|
const loadIcon = (icon) => {
|
|
1446
1469
|
return new Promise((fulfill, reject) => {
|
|
1447
|
-
const iconObj = typeof icon === "string" ? stringToIcon(icon) : icon;
|
|
1470
|
+
const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
|
|
1471
|
+
if (!iconObj) {
|
|
1472
|
+
reject(icon);
|
|
1473
|
+
return;
|
|
1474
|
+
}
|
|
1448
1475
|
loadIcons([iconObj || icon], (loaded) => {
|
|
1449
1476
|
if (loaded.length && iconObj) {
|
|
1450
|
-
const
|
|
1451
|
-
const data = getIconFromStorage(storage, iconObj.name);
|
|
1477
|
+
const data = getIconData(iconObj);
|
|
1452
1478
|
if (data) {
|
|
1453
|
-
fulfill(
|
|
1479
|
+
fulfill({
|
|
1480
|
+
...defaultIconProps,
|
|
1481
|
+
...data
|
|
1482
|
+
});
|
|
1454
1483
|
return;
|
|
1455
1484
|
}
|
|
1456
1485
|
}
|
|
@@ -1459,190 +1488,38 @@ const loadIcon = (icon) => {
|
|
|
1459
1488
|
});
|
|
1460
1489
|
};
|
|
1461
1490
|
|
|
1462
|
-
const cacheVersion = "iconify2";
|
|
1463
|
-
const cachePrefix = "iconify";
|
|
1464
|
-
const countKey = cachePrefix + "-count";
|
|
1465
|
-
const versionKey = cachePrefix + "-version";
|
|
1466
|
-
const hour = 36e5;
|
|
1467
|
-
const cacheExpiration = 168;
|
|
1468
|
-
const config = {
|
|
1469
|
-
local: true,
|
|
1470
|
-
session: true
|
|
1471
|
-
};
|
|
1472
|
-
let loaded = false;
|
|
1473
|
-
const count = {
|
|
1474
|
-
local: 0,
|
|
1475
|
-
session: 0
|
|
1476
|
-
};
|
|
1477
|
-
const emptyList = {
|
|
1478
|
-
local: [],
|
|
1479
|
-
session: []
|
|
1480
|
-
};
|
|
1481
|
-
let _window = typeof window === "undefined" ? {} : window;
|
|
1482
|
-
function getGlobal(key) {
|
|
1483
|
-
const attr = key + "Storage";
|
|
1484
|
-
try {
|
|
1485
|
-
if (_window && _window[attr] && typeof _window[attr].length === "number") {
|
|
1486
|
-
return _window[attr];
|
|
1487
|
-
}
|
|
1488
|
-
} catch (err) {
|
|
1489
|
-
}
|
|
1490
|
-
config[key] = false;
|
|
1491
|
-
return null;
|
|
1492
|
-
}
|
|
1493
|
-
function setCount(storage, key, value) {
|
|
1494
|
-
try {
|
|
1495
|
-
storage.setItem(countKey, value.toString());
|
|
1496
|
-
count[key] = value;
|
|
1497
|
-
return true;
|
|
1498
|
-
} catch (err) {
|
|
1499
|
-
return false;
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
function getCount(storage) {
|
|
1503
|
-
const count2 = storage.getItem(countKey);
|
|
1504
|
-
if (count2) {
|
|
1505
|
-
const total = parseInt(count2);
|
|
1506
|
-
return total ? total : 0;
|
|
1507
|
-
}
|
|
1508
|
-
return 0;
|
|
1509
|
-
}
|
|
1510
|
-
function initCache(storage, key) {
|
|
1511
|
-
try {
|
|
1512
|
-
storage.setItem(versionKey, cacheVersion);
|
|
1513
|
-
} catch (err) {
|
|
1514
|
-
}
|
|
1515
|
-
setCount(storage, key, 0);
|
|
1516
|
-
}
|
|
1517
|
-
function destroyCache(storage) {
|
|
1518
|
-
try {
|
|
1519
|
-
const total = getCount(storage);
|
|
1520
|
-
for (let i = 0; i < total; i++) {
|
|
1521
|
-
storage.removeItem(cachePrefix + i.toString());
|
|
1522
|
-
}
|
|
1523
|
-
} catch (err) {
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
const loadCache = () => {
|
|
1527
|
-
if (loaded) {
|
|
1528
|
-
return;
|
|
1529
|
-
}
|
|
1530
|
-
loaded = true;
|
|
1531
|
-
const minTime = Math.floor(Date.now() / hour) - cacheExpiration;
|
|
1532
|
-
function load(key) {
|
|
1533
|
-
const func = getGlobal(key);
|
|
1534
|
-
if (!func) {
|
|
1535
|
-
return;
|
|
1536
|
-
}
|
|
1537
|
-
const getItem = (index) => {
|
|
1538
|
-
const name = cachePrefix + index.toString();
|
|
1539
|
-
const item = func.getItem(name);
|
|
1540
|
-
if (typeof item !== "string") {
|
|
1541
|
-
return false;
|
|
1542
|
-
}
|
|
1543
|
-
let valid = true;
|
|
1544
|
-
try {
|
|
1545
|
-
const data = JSON.parse(item);
|
|
1546
|
-
if (typeof data !== "object" || typeof data.cached !== "number" || data.cached < minTime || typeof data.provider !== "string" || typeof data.data !== "object" || typeof data.data.prefix !== "string") {
|
|
1547
|
-
valid = false;
|
|
1548
|
-
} else {
|
|
1549
|
-
const provider = data.provider;
|
|
1550
|
-
const prefix = data.data.prefix;
|
|
1551
|
-
const storage = getStorage(provider, prefix);
|
|
1552
|
-
valid = addIconSet(storage, data.data).length > 0;
|
|
1553
|
-
}
|
|
1554
|
-
} catch (err) {
|
|
1555
|
-
valid = false;
|
|
1556
|
-
}
|
|
1557
|
-
if (!valid) {
|
|
1558
|
-
func.removeItem(name);
|
|
1559
|
-
}
|
|
1560
|
-
return valid;
|
|
1561
|
-
};
|
|
1562
|
-
try {
|
|
1563
|
-
const version = func.getItem(versionKey);
|
|
1564
|
-
if (version !== cacheVersion) {
|
|
1565
|
-
if (version) {
|
|
1566
|
-
destroyCache(func);
|
|
1567
|
-
}
|
|
1568
|
-
initCache(func, key);
|
|
1569
|
-
return;
|
|
1570
|
-
}
|
|
1571
|
-
let total = getCount(func);
|
|
1572
|
-
for (let i = total - 1; i >= 0; i--) {
|
|
1573
|
-
if (!getItem(i)) {
|
|
1574
|
-
if (i === total - 1) {
|
|
1575
|
-
total--;
|
|
1576
|
-
} else {
|
|
1577
|
-
emptyList[key].push(i);
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
setCount(func, key, total);
|
|
1582
|
-
} catch (err) {
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
for (const key in config) {
|
|
1586
|
-
load(key);
|
|
1587
|
-
}
|
|
1588
|
-
};
|
|
1589
|
-
const storeCache = (provider, data) => {
|
|
1590
|
-
if (!loaded) {
|
|
1591
|
-
loadCache();
|
|
1592
|
-
}
|
|
1593
|
-
function store(key) {
|
|
1594
|
-
if (!config[key]) {
|
|
1595
|
-
return false;
|
|
1596
|
-
}
|
|
1597
|
-
const func = getGlobal(key);
|
|
1598
|
-
if (!func) {
|
|
1599
|
-
return false;
|
|
1600
|
-
}
|
|
1601
|
-
let index = emptyList[key].shift();
|
|
1602
|
-
if (index === void 0) {
|
|
1603
|
-
index = count[key];
|
|
1604
|
-
if (!setCount(func, key, index + 1)) {
|
|
1605
|
-
return false;
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
try {
|
|
1609
|
-
const item = {
|
|
1610
|
-
cached: Math.floor(Date.now() / hour),
|
|
1611
|
-
provider,
|
|
1612
|
-
data
|
|
1613
|
-
};
|
|
1614
|
-
func.setItem(cachePrefix + index.toString(), JSON.stringify(item));
|
|
1615
|
-
} catch (err) {
|
|
1616
|
-
return false;
|
|
1617
|
-
}
|
|
1618
|
-
return true;
|
|
1619
|
-
}
|
|
1620
|
-
if (!Object.keys(data.icons).length) {
|
|
1621
|
-
return;
|
|
1622
|
-
}
|
|
1623
|
-
if (data.not_found) {
|
|
1624
|
-
data = Object.assign({}, data);
|
|
1625
|
-
delete data.not_found;
|
|
1626
|
-
}
|
|
1627
|
-
if (!store("local")) {
|
|
1628
|
-
store("session");
|
|
1629
|
-
}
|
|
1630
|
-
};
|
|
1631
|
-
|
|
1632
1491
|
function toggleBrowserCache(storage, value) {
|
|
1633
1492
|
switch (storage) {
|
|
1634
1493
|
case "local":
|
|
1635
1494
|
case "session":
|
|
1636
|
-
|
|
1495
|
+
browserStorageConfig[storage] = value;
|
|
1637
1496
|
break;
|
|
1638
1497
|
case "all":
|
|
1639
|
-
for (const key in
|
|
1640
|
-
|
|
1498
|
+
for (const key in browserStorageConfig) {
|
|
1499
|
+
browserStorageConfig[key] = value;
|
|
1641
1500
|
}
|
|
1642
1501
|
break;
|
|
1643
1502
|
}
|
|
1644
1503
|
}
|
|
1645
1504
|
|
|
1505
|
+
function mergeCustomisations(defaults, item) {
|
|
1506
|
+
const result = {
|
|
1507
|
+
...defaults
|
|
1508
|
+
};
|
|
1509
|
+
for (const key in item) {
|
|
1510
|
+
const value = item[key];
|
|
1511
|
+
const valueType = typeof value;
|
|
1512
|
+
if (key in defaultIconSizeCustomisations) {
|
|
1513
|
+
if (value === null || value && (valueType === "string" || valueType === "number")) {
|
|
1514
|
+
result[key] = value;
|
|
1515
|
+
}
|
|
1516
|
+
} else if (valueType === typeof result[key]) {
|
|
1517
|
+
result[key] = key === "rotate" ? value % 4 : value;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
return result;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1646
1523
|
const separator = /[\s,]+/;
|
|
1647
1524
|
function flipFromString(custom, flip) {
|
|
1648
1525
|
flip.split(separator).forEach((str) => {
|
|
@@ -1657,29 +1534,6 @@ function flipFromString(custom, flip) {
|
|
|
1657
1534
|
}
|
|
1658
1535
|
});
|
|
1659
1536
|
}
|
|
1660
|
-
function alignmentFromString(custom, align) {
|
|
1661
|
-
align.split(separator).forEach((str) => {
|
|
1662
|
-
const value = str.trim();
|
|
1663
|
-
switch (value) {
|
|
1664
|
-
case "left":
|
|
1665
|
-
case "center":
|
|
1666
|
-
case "right":
|
|
1667
|
-
custom.hAlign = value;
|
|
1668
|
-
break;
|
|
1669
|
-
case "top":
|
|
1670
|
-
case "middle":
|
|
1671
|
-
case "bottom":
|
|
1672
|
-
custom.vAlign = value;
|
|
1673
|
-
break;
|
|
1674
|
-
case "slice":
|
|
1675
|
-
case "crop":
|
|
1676
|
-
custom.slice = true;
|
|
1677
|
-
break;
|
|
1678
|
-
case "meet":
|
|
1679
|
-
custom.slice = false;
|
|
1680
|
-
}
|
|
1681
|
-
});
|
|
1682
|
-
}
|
|
1683
1537
|
|
|
1684
1538
|
function rotateFromString(value, defaultValue = 0) {
|
|
1685
1539
|
const units = value.replace(/^-?[0-9.]*/, "");
|
|
@@ -1713,6 +1567,29 @@ function rotateFromString(value, defaultValue = 0) {
|
|
|
1713
1567
|
return defaultValue;
|
|
1714
1568
|
}
|
|
1715
1569
|
|
|
1570
|
+
function iconToHTML(body, attributes) {
|
|
1571
|
+
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1572
|
+
for (const attr in attributes) {
|
|
1573
|
+
renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
|
|
1574
|
+
}
|
|
1575
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
function encodeSVGforURL(svg) {
|
|
1579
|
+
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1580
|
+
}
|
|
1581
|
+
function svgToData(svg) {
|
|
1582
|
+
return "data:image/svg+xml," + encodeSVGforURL(svg);
|
|
1583
|
+
}
|
|
1584
|
+
function svgToURL(svg) {
|
|
1585
|
+
return 'url("' + svgToData(svg) + '")';
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
const defaultExtendedIconCustomisations = {
|
|
1589
|
+
...defaultIconCustomisations,
|
|
1590
|
+
inline: false,
|
|
1591
|
+
};
|
|
1592
|
+
|
|
1716
1593
|
/**
|
|
1717
1594
|
* Default SVG attributes
|
|
1718
1595
|
*/
|
|
@@ -1722,27 +1599,55 @@ const svgDefaults = {
|
|
|
1722
1599
|
'aria-hidden': true,
|
|
1723
1600
|
'role': 'img',
|
|
1724
1601
|
};
|
|
1602
|
+
/**
|
|
1603
|
+
* Style modes
|
|
1604
|
+
*/
|
|
1605
|
+
const commonProps = {
|
|
1606
|
+
display: 'inline-block',
|
|
1607
|
+
};
|
|
1608
|
+
const monotoneProps = {
|
|
1609
|
+
backgroundColor: 'currentColor',
|
|
1610
|
+
};
|
|
1611
|
+
const coloredProps = {
|
|
1612
|
+
backgroundColor: 'transparent',
|
|
1613
|
+
};
|
|
1614
|
+
// Dynamically add common props to variables above
|
|
1615
|
+
const propsToAdd = {
|
|
1616
|
+
Image: 'var(--svg)',
|
|
1617
|
+
Repeat: 'no-repeat',
|
|
1618
|
+
Size: '100% 100%',
|
|
1619
|
+
};
|
|
1620
|
+
const propsToAddTo = {
|
|
1621
|
+
webkitMask: monotoneProps,
|
|
1622
|
+
mask: monotoneProps,
|
|
1623
|
+
background: coloredProps,
|
|
1624
|
+
};
|
|
1625
|
+
for (const prefix in propsToAddTo) {
|
|
1626
|
+
const list = propsToAddTo[prefix];
|
|
1627
|
+
for (const prop in propsToAdd) {
|
|
1628
|
+
list[prefix + prop] = propsToAdd[prop];
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1725
1631
|
/**
|
|
1726
1632
|
* Aliases for customisations.
|
|
1727
|
-
* In Vue 'v-' properties are reserved, so v-
|
|
1633
|
+
* In Vue 'v-' properties are reserved, so v-flip must be renamed
|
|
1728
1634
|
*/
|
|
1729
|
-
|
|
1635
|
+
const customisationAliases = {};
|
|
1730
1636
|
['horizontal', 'vertical'].forEach((prefix) => {
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
customisationAliases[prefix + '-' + suffix.toLowerCase()] = value;
|
|
1739
|
-
// v-align
|
|
1740
|
-
customisationAliases[prefix.slice(0, 1) + '-' + suffix.toLowerCase()] =
|
|
1741
|
-
value;
|
|
1742
|
-
// verticalAlign
|
|
1743
|
-
customisationAliases[prefix + suffix] = value;
|
|
1744
|
-
});
|
|
1637
|
+
const attr = prefix.slice(0, 1) + 'Flip';
|
|
1638
|
+
// vertical-flip
|
|
1639
|
+
customisationAliases[prefix + '-flip'] = attr;
|
|
1640
|
+
// v-flip
|
|
1641
|
+
customisationAliases[prefix.slice(0, 1) + '-flip'] = attr;
|
|
1642
|
+
// verticalFlip
|
|
1643
|
+
customisationAliases[prefix + 'Flip'] = attr;
|
|
1745
1644
|
});
|
|
1645
|
+
/**
|
|
1646
|
+
* Fix size: add 'px' to numbers
|
|
1647
|
+
*/
|
|
1648
|
+
function fixSize(value) {
|
|
1649
|
+
return value + (value.match(/^[-0-9.]+$/) ? 'px' : '');
|
|
1650
|
+
}
|
|
1746
1651
|
/**
|
|
1747
1652
|
* Render icon
|
|
1748
1653
|
*/
|
|
@@ -1752,11 +1657,15 @@ icon,
|
|
|
1752
1657
|
// Partial properties
|
|
1753
1658
|
props) => {
|
|
1754
1659
|
// Split properties
|
|
1755
|
-
const customisations = mergeCustomisations(
|
|
1660
|
+
const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
|
|
1756
1661
|
const componentProps = { ...svgDefaults };
|
|
1662
|
+
// Check mode
|
|
1663
|
+
const mode = props.mode || 'svg';
|
|
1757
1664
|
// Copy style
|
|
1758
|
-
|
|
1759
|
-
|
|
1665
|
+
const style = {};
|
|
1666
|
+
const propsStyle = props.style;
|
|
1667
|
+
const customStyle = typeof propsStyle === 'object' && !(propsStyle instanceof Array)
|
|
1668
|
+
? propsStyle
|
|
1760
1669
|
: {};
|
|
1761
1670
|
// Get element properties
|
|
1762
1671
|
for (let key in props) {
|
|
@@ -1769,6 +1678,7 @@ props) => {
|
|
|
1769
1678
|
case 'icon':
|
|
1770
1679
|
case 'style':
|
|
1771
1680
|
case 'onLoad':
|
|
1681
|
+
case 'mode':
|
|
1772
1682
|
break;
|
|
1773
1683
|
// Boolean attributes
|
|
1774
1684
|
case 'inline':
|
|
@@ -1783,12 +1693,6 @@ props) => {
|
|
|
1783
1693
|
flipFromString(customisations, value);
|
|
1784
1694
|
}
|
|
1785
1695
|
break;
|
|
1786
|
-
// Alignment as string
|
|
1787
|
-
case 'align':
|
|
1788
|
-
if (typeof value === 'string') {
|
|
1789
|
-
alignmentFromString(customisations, value);
|
|
1790
|
-
}
|
|
1791
|
-
break;
|
|
1792
1696
|
// Color: override style
|
|
1793
1697
|
case 'color':
|
|
1794
1698
|
style.color = value;
|
|
@@ -1810,52 +1714,69 @@ props) => {
|
|
|
1810
1714
|
delete componentProps['aria-hidden'];
|
|
1811
1715
|
}
|
|
1812
1716
|
break;
|
|
1813
|
-
default:
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
customisations[customisationAliases[key].attr] = true;
|
|
1820
|
-
}
|
|
1821
|
-
else if (!customisationAliases[key].boolean &&
|
|
1822
|
-
typeof value === 'string' &&
|
|
1823
|
-
value !== '') {
|
|
1824
|
-
// String
|
|
1825
|
-
customisations[customisationAliases[key].attr] = value;
|
|
1717
|
+
default: {
|
|
1718
|
+
const alias = customisationAliases[key];
|
|
1719
|
+
if (alias) {
|
|
1720
|
+
// Aliases for boolean customisations
|
|
1721
|
+
if (value === true || value === 'true' || value === 1) {
|
|
1722
|
+
customisations[alias] = true;
|
|
1826
1723
|
}
|
|
1827
1724
|
}
|
|
1828
|
-
else if (
|
|
1725
|
+
else if (defaultExtendedIconCustomisations[key] === void 0) {
|
|
1829
1726
|
// Copy missing property if it does not exist in customisations
|
|
1830
1727
|
componentProps[key] = value;
|
|
1831
1728
|
}
|
|
1729
|
+
}
|
|
1832
1730
|
}
|
|
1833
1731
|
}
|
|
1834
1732
|
// Generate icon
|
|
1835
1733
|
const item = iconToSVG(icon, customisations);
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
}
|
|
1840
|
-
if (item.inline &&
|
|
1841
|
-
style.verticalAlign === void 0 &&
|
|
1842
|
-
style['vertical-align'] === void 0) {
|
|
1734
|
+
const renderAttribs = item.attributes;
|
|
1735
|
+
// Inline display
|
|
1736
|
+
if (customisations.inline) {
|
|
1843
1737
|
style.verticalAlign = '-0.125em';
|
|
1844
1738
|
}
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1739
|
+
if (mode === 'svg') {
|
|
1740
|
+
// Add style
|
|
1741
|
+
componentProps.style = {
|
|
1742
|
+
...style,
|
|
1743
|
+
...customStyle,
|
|
1744
|
+
};
|
|
1745
|
+
// Add icon stuff
|
|
1746
|
+
Object.assign(componentProps, renderAttribs);
|
|
1747
|
+
// Counter for ids based on "id" property to render icons consistently on server and client
|
|
1748
|
+
let localCounter = 0;
|
|
1749
|
+
let id = props.id;
|
|
1750
|
+
if (typeof id === 'string') {
|
|
1751
|
+
// Convert '-' to '_' to avoid errors in animations
|
|
1752
|
+
id = id.replace(/-/g, '_');
|
|
1753
|
+
}
|
|
1754
|
+
// Add innerHTML and style to props
|
|
1755
|
+
componentProps['innerHTML'] = replaceIDs(item.body, id ? () => id + 'ID' + localCounter++ : 'iconifyVue');
|
|
1756
|
+
// Render icon
|
|
1757
|
+
return h('svg', componentProps);
|
|
1758
|
+
}
|
|
1759
|
+
// Render <span> with style
|
|
1760
|
+
const { body, width, height } = icon;
|
|
1761
|
+
const useMask = mode === 'mask' ||
|
|
1762
|
+
(mode === 'bg' ? false : body.indexOf('currentColor') !== -1);
|
|
1763
|
+
// Generate SVG
|
|
1764
|
+
const html = iconToHTML(body, {
|
|
1765
|
+
...renderAttribs,
|
|
1766
|
+
width: width + '',
|
|
1767
|
+
height: height + '',
|
|
1768
|
+
});
|
|
1769
|
+
// Generate style
|
|
1770
|
+
componentProps.style = {
|
|
1771
|
+
...style,
|
|
1772
|
+
'--svg': svgToURL(html),
|
|
1773
|
+
'width': fixSize(renderAttribs.width),
|
|
1774
|
+
'height': fixSize(renderAttribs.height),
|
|
1775
|
+
...commonProps,
|
|
1776
|
+
...(useMask ? monotoneProps : coloredProps),
|
|
1777
|
+
...customStyle,
|
|
1778
|
+
};
|
|
1779
|
+
return h('span', componentProps);
|
|
1859
1780
|
};
|
|
1860
1781
|
|
|
1861
1782
|
/**
|
|
@@ -1882,8 +1803,7 @@ setAPIModule('', fetchAPIModule);
|
|
|
1882
1803
|
*/
|
|
1883
1804
|
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|
1884
1805
|
// Set cache and load existing cache
|
|
1885
|
-
|
|
1886
|
-
loadCache();
|
|
1806
|
+
initBrowserStorage();
|
|
1887
1807
|
const _window = window;
|
|
1888
1808
|
// Load icons from global "IconifyPreload"
|
|
1889
1809
|
if (_window.IconifyPreload !== void 0) {
|
|
@@ -1938,15 +1858,20 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|
|
1938
1858
|
/**
|
|
1939
1859
|
* Empty icon data, rendered when icon is not available
|
|
1940
1860
|
*/
|
|
1941
|
-
const emptyIcon =
|
|
1861
|
+
const emptyIcon = {
|
|
1862
|
+
...defaultIconProps,
|
|
1942
1863
|
body: '',
|
|
1943
|
-
}
|
|
1864
|
+
};
|
|
1944
1865
|
const Icon = defineComponent({
|
|
1945
1866
|
// Do not inherit other attributes: it is handled by render()
|
|
1946
1867
|
inheritAttrs: false,
|
|
1947
1868
|
// Set initial data
|
|
1948
1869
|
data() {
|
|
1949
1870
|
return {
|
|
1871
|
+
// Current icon name
|
|
1872
|
+
_name: '',
|
|
1873
|
+
// Loading
|
|
1874
|
+
_loadingIcon: null,
|
|
1950
1875
|
// Mounted status
|
|
1951
1876
|
iconMounted: false,
|
|
1952
1877
|
// Callback counter to trigger re-render
|
|
@@ -1954,10 +1879,6 @@ const Icon = defineComponent({
|
|
|
1954
1879
|
};
|
|
1955
1880
|
},
|
|
1956
1881
|
mounted() {
|
|
1957
|
-
// Current icon name
|
|
1958
|
-
this._name = '';
|
|
1959
|
-
// Loading
|
|
1960
|
-
this._loadingIcon = null;
|
|
1961
1882
|
// Mark as mounted
|
|
1962
1883
|
this.iconMounted = true;
|
|
1963
1884
|
},
|
|
@@ -1981,7 +1902,7 @@ const Icon = defineComponent({
|
|
|
1981
1902
|
this._name = '';
|
|
1982
1903
|
this.abortLoading();
|
|
1983
1904
|
return {
|
|
1984
|
-
data:
|
|
1905
|
+
data: icon,
|
|
1985
1906
|
};
|
|
1986
1907
|
}
|
|
1987
1908
|
// Invalid icon?
|
|
@@ -1993,18 +1914,21 @@ const Icon = defineComponent({
|
|
|
1993
1914
|
}
|
|
1994
1915
|
// Load icon
|
|
1995
1916
|
const data = getIconData(iconName);
|
|
1996
|
-
if (data
|
|
1997
|
-
// Icon
|
|
1917
|
+
if (!data) {
|
|
1918
|
+
// Icon data is not available
|
|
1998
1919
|
if (!this._loadingIcon || this._loadingIcon.name !== icon) {
|
|
1999
1920
|
// New icon to load
|
|
2000
1921
|
this.abortLoading();
|
|
2001
1922
|
this._name = '';
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
1923
|
+
if (data !== null) {
|
|
1924
|
+
// Icon was not loaded
|
|
1925
|
+
this._loadingIcon = {
|
|
1926
|
+
name: icon,
|
|
1927
|
+
abort: loadIcons([iconName], () => {
|
|
1928
|
+
this.counter++;
|
|
1929
|
+
}),
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
2008
1932
|
}
|
|
2009
1933
|
return null;
|
|
2010
1934
|
}
|
|
@@ -2033,7 +1957,7 @@ const Icon = defineComponent({
|
|
|
2033
1957
|
this.counter;
|
|
2034
1958
|
const props = this.$attrs;
|
|
2035
1959
|
// Get icon data
|
|
2036
|
-
const icon = this.iconMounted
|
|
1960
|
+
const icon = (this.iconMounted || props.ssr)
|
|
2037
1961
|
? this.getIcon(props.icon, props.onLoad)
|
|
2038
1962
|
: null;
|
|
2039
1963
|
// Validate icon object
|
|
@@ -2051,7 +1975,10 @@ const Icon = defineComponent({
|
|
|
2051
1975
|
};
|
|
2052
1976
|
}
|
|
2053
1977
|
// Render icon
|
|
2054
|
-
return render(
|
|
1978
|
+
return render({
|
|
1979
|
+
...defaultIconProps,
|
|
1980
|
+
...icon.data,
|
|
1981
|
+
}, newProps);
|
|
2055
1982
|
},
|
|
2056
1983
|
});
|
|
2057
1984
|
/**
|
|
@@ -2064,7 +1991,6 @@ const _api = {
|
|
|
2064
1991
|
setFetch,
|
|
2065
1992
|
getFetch,
|
|
2066
1993
|
listAPIProviders,
|
|
2067
|
-
mergeParams,
|
|
2068
1994
|
};
|
|
2069
1995
|
|
|
2070
|
-
export { Icon, _api, addAPIProvider, addCollection, addIcon, buildIcon, calculateSize, disableCache, enableCache, getIcon, iconExists, listIcons, loadIcon, loadIcons, replaceIDs
|
|
1996
|
+
export { Icon, _api, addAPIProvider, addCollection, addIcon, iconToSVG as buildIcon, calculateSize, disableCache, enableCache, getIcon, iconLoaded as iconExists, iconLoaded, listIcons, loadIcon, loadIcons, replaceIDs };
|