se-design 1.0.69-dev → 1.0.70
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/assets/icons/file-filled-checked.svg +8 -0
- package/dist/index113.js +1 -1
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +2 -2
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +1 -1
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +2 -2
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +2 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +2 -2
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +1 -1
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +1 -1
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +1 -1
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +1 -1
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +1 -1
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +1 -1
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +2 -2
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +2 -2
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +2 -2
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +2 -2
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +2 -2
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +1 -1
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +1 -1
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +2 -2
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +1 -1
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +1 -1
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +1 -1
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +1 -1
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +1 -1
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +1 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -1
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +1 -1
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +1 -1
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +1 -1
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +2 -2
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +2 -2
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +2 -2
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +2 -2
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +1 -1
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +1 -1
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +1 -1
- package/dist/index180.js +1 -1
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +1 -1
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +1 -1
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +2 -2
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +2 -2
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +2 -2
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +2 -149
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +149 -9
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +8 -5
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +5 -4
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +8 -0
- package/dist/index190.js.map +1 -0
- package/dist/{index192.js → index193.js} +1 -1
- package/dist/{index192.js.map → index193.js.map} +1 -1
- package/dist/{index194.js → index195.js} +2 -2
- package/dist/{index194.js.map → index195.js.map} +1 -1
- package/dist/{index196.js → index197.js} +1 -1
- package/dist/{index196.js.map → index197.js.map} +1 -1
- package/dist/{index204.js → index205.js} +1 -1
- package/dist/{index204.js.map → index205.js.map} +1 -1
- package/dist/{index212.js → index213.js} +1 -1
- package/dist/{index212.js.map → index213.js.map} +1 -1
- package/dist/index216.js +32 -43
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +46 -0
- package/dist/index217.js.map +1 -0
- package/dist/index22.js +2 -2
- package/dist/{index225.js → index226.js} +1 -1
- package/dist/{index225.js.map → index226.js.map} +1 -1
- package/dist/index228.js +57 -20
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +1 -1
- package/dist/index230.js +9 -18
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +9 -9
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -9
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +170 -5
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +11 -170
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +22 -11
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +18 -5
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +5 -5
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +5 -37
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +38 -2
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +2 -2
- package/dist/index240.js +2 -8
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +7 -326
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +324 -47
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +50 -2
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -76
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +65 -82
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +89 -48
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +51 -7
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +7 -4
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +4 -51
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +52 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index252.js +5 -0
- package/dist/index252.js.map +1 -0
- package/dist/index27.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index34.js +1 -1
- package/dist/index35.js +1 -1
- package/dist/index37.js +2 -2
- package/dist/index38.js +2 -2
- package/dist/index39.js +1 -1
- package/dist/index44.js +2 -2
- package/dist/index45.js +3 -3
- package/dist/index48.js +2 -2
- package/dist/index5.js +86 -84
- package/dist/index5.js.map +1 -1
- package/dist/index51.js +1 -1
- package/dist/index52.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index6.js +1 -1
- package/dist/index62.js +1 -1
- package/dist/index64.js +2 -2
- package/dist/index8.js +2 -2
- package/package.json +1 -1
- package/dist/index215.js +0 -35
- package/dist/index215.js.map +0 -1
- package/dist/index227.js +0 -62
- package/dist/index227.js.map +0 -1
package/dist/index228.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index228.js","sources":["../src/utils/a11y/
|
|
1
|
+
{"version":3,"file":"index228.js","sources":["../src/utils/a11y/useFocusTrap.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react';\nimport { getFocusableElements, getFirstFocusableElement } from './focusableElements';\n\nexport interface UseFocusTrapOptions<T extends HTMLElement = HTMLElement> {\n /**\n * Whether the focus trap is active.\n */\n enabled: boolean;\n /**\n * Container element ref to trap focus within.\n */\n containerRef: React.RefObject<T | null>;\n /**\n * Whether to restore focus to the element that had focus before trap activated.\n * Default: true\n */\n restoreFocus?: boolean;\n /**\n * Initial focus target when trap activates.\n * - 'first': Focus first focusable element (default)\n * - 'container': Focus the container itself\n * - CSS selector: Focus element matching selector\n * - HTMLElement: Focus this specific element\n */\n initialFocus?: 'first' | 'container' | string | HTMLElement;\n}\n\nexport interface UseFocusTrapReturn {\n /**\n * Ref to the element that had focus before trap activated.\n * Useful for manual focus restoration if needed.\n */\n triggerRef: React.MutableRefObject<HTMLElement | null>;\n}\n\n/**\n * Hook to trap focus within a container (for modals, dialogs, drawers).\n * \n * Implements WCAG 2.1 focus trap pattern:\n * - Moves focus into container on activation\n * - Wraps Tab/Shift+Tab navigation within container\n * - Restores focus to trigger element on deactivation\n * - Safety net: catches focus escaping via other means\n * \n * Note: For Escape key handling, use `useDismissOnEscape` hook separately.\n * This keeps focus trap (accessibility) separate from Escape handling (UX).\n * \n * @example\n * ```tsx\n * const MyModal = ({ isOpen, onClose }) => {\n * const containerRef = useRef<HTMLDivElement>(null);\n * \n * // Escape handling (UX)\n * useDismissOnEscape({\n * containerRef,\n * onDismiss: onClose,\n * enabled: isOpen\n * });\n * \n * // Focus trap (accessibility)\n * const { triggerRef } = useFocusTrap({\n * enabled: isOpen,\n * containerRef,\n * restoreFocus: true\n * });\n * \n * return (\n * <div ref={containerRef}>\n * <button>First</button>\n * <button>Second</button>\n * </div>\n * );\n * };\n * ```\n */\n/**\n * Resolve the initial focus target based on the initialFocus option.\n */\nfunction resolveInitialFocusTarget(\n container: HTMLElement,\n initialFocus: 'first' | 'container' | string | HTMLElement\n): HTMLElement | null {\n if (initialFocus === 'first') {\n return getFirstFocusableElement({ container }) || container;\n }\n if (initialFocus === 'container') {\n return container;\n }\n if (typeof initialFocus === 'string') {\n return container.querySelector<HTMLElement>(initialFocus);\n }\n if (initialFocus instanceof HTMLElement) {\n return initialFocus;\n }\n return null;\n}\n\nexport function useFocusTrap<T extends HTMLElement = HTMLElement>({\n enabled,\n containerRef,\n restoreFocus = true,\n initialFocus = 'first'\n}: UseFocusTrapOptions<T>): UseFocusTrapReturn {\n const triggerRef = useRef<HTMLElement | null>(null);\n const lastFocusedInContainer = useRef<HTMLElement | null>(null);\n\n // Focus management: save trigger, move focus into container on activate, restore on deactivate\n useLayoutEffect(() => {\n if (!enabled) {\n // Restore focus to trigger when trap deactivates\n if (restoreFocus && triggerRef.current) {\n requestAnimationFrame(() => {\n triggerRef.current?.focus();\n triggerRef.current = null;\n });\n }\n return;\n }\n\n const container = containerRef.current;\n if (!container) return;\n\n // Save the element that had focus before trap activated\n triggerRef.current = document.activeElement as HTMLElement;\n\n // Focus initial target\n requestAnimationFrame(() => {\n resolveInitialFocusTarget(container, initialFocus)?.focus();\n });\n }, [enabled, containerRef, restoreFocus, initialFocus]);\n\n // Focus trap: Tab wrapping (only when enabled)\n useLayoutEffect(() => {\n if (!enabled) return;\n \n const container = containerRef.current;\n if (!container) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n // Tab wrapping\n if (e.key === 'Tab') {\n const focusables = getFocusableElements({ container });\n\n if (focusables.length === 0) {\n e.preventDefault();\n container.focus();\n return;\n }\n\n const first = focusables[0];\n const last = focusables[focusables.length - 1];\n const activeElement = document.activeElement;\n\n if (e.shiftKey && activeElement === first) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, true);\n return () => document.removeEventListener('keydown', handleKeyDown, true);\n }, [enabled, containerRef]);\n\n // Focus trap safety net: catch focus escaping\n useLayoutEffect(() => {\n if (!enabled) return;\n \n const container = containerRef.current;\n if (!container) return;\n\n const handleFocusIn = (e: FocusEvent) => {\n const target = e.target as Node;\n \n if (container.contains(target)) {\n lastFocusedInContainer.current = target as HTMLElement;\n } else {\n // Focus escaped - redirect back\n const fallback = lastFocusedInContainer.current \n || getFirstFocusableElement({ container }) \n || container;\n fallback.focus();\n }\n };\n\n document.addEventListener('focusin', handleFocusIn, true);\n return () => document.removeEventListener('focusin', handleFocusIn, true);\n }, [enabled, containerRef]);\n\n return { triggerRef };\n}\n"],"names":["useRef","useLayoutEffect","getFirstFocusableElement","getFocusableElements","resolveInitialFocusTarget","container","initialFocus","querySelector","HTMLElement","useFocusTrap","enabled","containerRef","restoreFocus","triggerRef","lastFocusedInContainer","current","requestAnimationFrame","focus","document","activeElement","handleKeyDown","e","key","focusables","length","preventDefault","first","last","shiftKey","addEventListener","removeEventListener","handleFocusIn","target","contains"],"mappings":"AA8EA,SAAA,UAAAA,GAAA,mBAAAC,SAAA;AAAA,SAAA,4BAAAC,GAAA,wBAAAC,SAAA;AAAA,SAASC,EACPC,GACAC,GACoB;AACpB,SAAIA,MAAiB,UACZJ,EAAyB;AAAA,IAAEG,WAAAA;AAA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GACFE,EAAKV,MAAAA,KACI,CAACI,EAAEO,YAAYT,MAAkBQ,MAC1CN,EAAEI,eAAAA,GACFC,EAAMT,MAAAA;AAAAA,MAEV;AAAA,IACF;AAEAC,oBAASW,iBAAiB,WAAWT,GAAe,EAAI,GACjD,MAAMF,SAASY,oBAAoB,WAAWV,GAAe,EAAI;AAAA,EAC1E,GAAG,CAACV,GAASC,CAAY,CAAC,GAG1BV,EAAgB,MAAM;AACpB,QAAI,CAACS,EAAS;AAEd,UAAML,IAAYM,EAAaI;AAC/B,QAAI,CAACV,EAAW;AAEhB,UAAM0B,IAAgBA,CAACV,MAAkB;AACvC,YAAMW,IAASX,EAAEW;AAEjB,MAAI3B,EAAU4B,SAASD,CAAM,IAC3BlB,EAAuBC,UAAUiB,KAGhBlB,EAAuBC,WACnCb,EAAyB;AAAA,QAAEG,WAAAA;AAAAA,MAAAA,CAAW,KACtCA,GACIY,MAAAA;AAAAA,IAEb;AAEAC,oBAASW,iBAAiB,WAAWE,GAAe,EAAI,GACjD,MAAMb,SAASY,oBAAoB,WAAWC,GAAe,EAAI;AAAA,EAC1E,GAAG,CAACrB,GAASC,CAAY,CAAC,GAEnB;AAAA,IAAEE,YAAAA;AAAAA,EAAAA;AACX;"}
|
package/dist/index229.js
CHANGED
package/dist/index230.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
enabled: c = !0,
|
|
10
|
-
scrollOptions: e = u
|
|
11
|
-
}) {
|
|
12
|
-
s(() => {
|
|
13
|
-
if (!c || o < 0 || !t?.current)
|
|
14
|
-
return;
|
|
15
|
-
const n = t.current.querySelectorAll(r)[o];
|
|
16
|
-
n && n.scrollIntoView(e);
|
|
17
|
-
}, [o, t, r, c, e]);
|
|
1
|
+
function r(t, i) {
|
|
2
|
+
if (t == null) return {};
|
|
3
|
+
var o = {};
|
|
4
|
+
for (var e in t) if ({}.hasOwnProperty.call(t, e)) {
|
|
5
|
+
if (i.indexOf(e) !== -1) continue;
|
|
6
|
+
o[e] = t[e];
|
|
7
|
+
}
|
|
8
|
+
return o;
|
|
18
9
|
}
|
|
19
10
|
export {
|
|
20
|
-
|
|
11
|
+
r as default
|
|
21
12
|
};
|
|
22
13
|
//# sourceMappingURL=index230.js.map
|
package/dist/index230.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index230.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index230.js","sources":["../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n"],"mappings":"AAAA,SAASA,EAA8BC,GAAGC,GAAG;AAC3C,MAAYD,KAAR,KAAW,QAAO,CAAA;AACtB,MAAIE,IAAI,CAAA;AACR,WAASC,KAAKH,EAAG,KAAI,CAAA,EAAG,eAAe,KAAKA,GAAGG,CAAC,GAAG;AACjD,QAAWF,EAAE,QAAQE,CAAC,MAAlB,GAAqB;AACzB,IAAAD,EAAEC,CAAC,IAAIH,EAAEG,CAAC;AAAA,EACZ;AACA,SAAOD;AACT;","x_google_ignoreList":[0]}
|
package/dist/index231.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
function e() {
|
|
2
|
+
return e = Object.assign ? Object.assign.bind() : function(t) {
|
|
3
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
4
|
+
var a = arguments[n];
|
|
5
|
+
for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
}, e.apply(null, arguments);
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
e as default
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=index231.js.map
|
package/dist/index231.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index231.js","sources":["../node_modules/@babel/runtime/helpers/esm/
|
|
1
|
+
{"version":3,"file":"index231.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","n","e","t"],"mappings":"AAAA,SAASA,IAAW;AAClB,SAAOA,IAAW,OAAO,SAAS,OAAO,OAAO,KAAI,IAAK,SAAUC,GAAG;AACpE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACzC,UAAIC,IAAI,UAAUD,CAAC;AACnB,eAAS,KAAKC,EAAG,EAAC,CAAA,GAAI,eAAe,KAAKA,GAAG,CAAC,MAAMF,EAAE,CAAC,IAAIE,EAAE,CAAC;AAAA,IAChE;AACA,WAAOF;AAAA,EACT,GAAGD,EAAS,MAAM,MAAM,SAAS;AACnC;","x_google_ignoreList":[0]}
|
package/dist/index232.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var a = arguments[n];
|
|
5
|
-
for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
}, e.apply(null, arguments);
|
|
1
|
+
import e from "./index237.js";
|
|
2
|
+
function p(o, t) {
|
|
3
|
+
o.prototype = Object.create(t.prototype), o.prototype.constructor = o, e(o, t);
|
|
9
4
|
}
|
|
10
5
|
export {
|
|
11
|
-
|
|
6
|
+
p as default
|
|
12
7
|
};
|
|
13
8
|
//# sourceMappingURL=index232.js.map
|
package/dist/index232.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index232.js","sources":["../node_modules/@babel/runtime/helpers/esm/
|
|
1
|
+
{"version":3,"file":"index232.js","sources":["../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"],"sourcesContent":["import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };"],"names":["_setPrototypeOf","_inheritsLoose","t","o","setPrototypeOf"],"mappings":"AACA,OAAAA,OAAA;AAAA,SAASC,EAAeC,GAAGC,GAAG;AAC5B,EAAAD,EAAE,YAAY,OAAO,OAAOC,EAAE,SAAS,GAAGD,EAAE,UAAU,cAAcA,GAAGE,EAAeF,GAAGC,CAAC;AAC5F;","x_google_ignoreList":[0]}
|
package/dist/index233.js
CHANGED
|
@@ -1,8 +1,173 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { __spreadArray as D } from "./index238.js";
|
|
2
|
+
import { parse as ut } from "./index239.js";
|
|
3
|
+
var g = /* @__PURE__ */ new Map(), Y = function(t) {
|
|
4
|
+
return t.cloneNode(!0);
|
|
5
|
+
}, z = function() {
|
|
6
|
+
return window.location.protocol === "file:";
|
|
7
|
+
}, Z = function(t, o, n) {
|
|
8
|
+
var e = new XMLHttpRequest();
|
|
9
|
+
e.onreadystatechange = function() {
|
|
10
|
+
try {
|
|
11
|
+
if (!/\.svg/i.test(t) && e.readyState === 2) {
|
|
12
|
+
var s = e.getResponseHeader("Content-Type");
|
|
13
|
+
if (!s)
|
|
14
|
+
throw new Error("Content type not found");
|
|
15
|
+
var i = ut(s).type;
|
|
16
|
+
if (!(i === "image/svg+xml" || i === "text/plain"))
|
|
17
|
+
throw new Error("Invalid content type: ".concat(i));
|
|
18
|
+
}
|
|
19
|
+
if (e.readyState === 4) {
|
|
20
|
+
if (e.status === 404 || e.responseXML === null)
|
|
21
|
+
throw new Error(z() ? "Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver." : "Unable to load SVG file: " + t);
|
|
22
|
+
if (e.status === 200 || z() && e.status === 0)
|
|
23
|
+
n(null, e);
|
|
24
|
+
else
|
|
25
|
+
throw new Error("There was a problem injecting the SVG: " + e.status + " " + e.statusText);
|
|
26
|
+
}
|
|
27
|
+
} catch (a) {
|
|
28
|
+
if (e.abort(), a instanceof Error)
|
|
29
|
+
n(a, e);
|
|
30
|
+
else
|
|
31
|
+
throw a;
|
|
32
|
+
}
|
|
33
|
+
}, e.open("GET", t), e.withCredentials = o, e.overrideMimeType && e.overrideMimeType("text/xml"), e.send();
|
|
34
|
+
}, v = {}, B = function(t, o) {
|
|
35
|
+
v[t] = v[t] || [], v[t].push(o);
|
|
36
|
+
}, ft = function(t) {
|
|
37
|
+
for (var o = function(i, a) {
|
|
38
|
+
setTimeout(function() {
|
|
39
|
+
if (Array.isArray(v[t])) {
|
|
40
|
+
var u = g.get(t), p = v[t][i];
|
|
41
|
+
u instanceof SVGSVGElement && p(null, Y(u)), u instanceof Error && p(u), i === v[t].length - 1 && delete v[t];
|
|
42
|
+
}
|
|
43
|
+
}, 0);
|
|
44
|
+
}, n = 0, e = v[t].length; n < e; n++)
|
|
45
|
+
o(n);
|
|
46
|
+
}, lt = function(t, o, n) {
|
|
47
|
+
if (g.has(t)) {
|
|
48
|
+
var e = g.get(t);
|
|
49
|
+
if (e === void 0) {
|
|
50
|
+
B(t, n);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (e instanceof SVGSVGElement) {
|
|
54
|
+
n(null, Y(e));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
g.set(t, void 0), B(t, n), Z(t, o, function(s, i) {
|
|
59
|
+
var a;
|
|
60
|
+
s ? g.set(t, s) : ((a = i.responseXML) === null || a === void 0 ? void 0 : a.documentElement) instanceof SVGSVGElement && g.set(t, i.responseXML.documentElement), ft(t);
|
|
61
|
+
});
|
|
62
|
+
}, ct = function(t, o, n) {
|
|
63
|
+
Z(t, o, function(e, s) {
|
|
64
|
+
var i;
|
|
65
|
+
e ? n(e) : ((i = s.responseXML) === null || i === void 0 ? void 0 : i.documentElement) instanceof SVGSVGElement && n(null, s.responseXML.documentElement);
|
|
66
|
+
});
|
|
67
|
+
}, dt = 0, vt = function() {
|
|
68
|
+
return ++dt;
|
|
69
|
+
}, l = [], J = {}, pt = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xlink", K = function(t, o, n, e, s, i, a) {
|
|
70
|
+
var u = t.getAttribute("data-src") || t.getAttribute("src");
|
|
71
|
+
if (!u) {
|
|
72
|
+
a(new Error("Invalid data-src or src attribute"));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (l.indexOf(t) !== -1) {
|
|
76
|
+
l.splice(l.indexOf(t), 1), t = null;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
l.push(t), t.setAttribute("src", "");
|
|
80
|
+
var p = e ? lt : ct;
|
|
81
|
+
p(u, s, function(j, r) {
|
|
82
|
+
if (!r) {
|
|
83
|
+
l.splice(l.indexOf(t), 1), t = null, a(j);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
var w = t.getAttribute("id");
|
|
87
|
+
w && r.setAttribute("id", w);
|
|
88
|
+
var S = t.getAttribute("title");
|
|
89
|
+
S && r.setAttribute("title", S);
|
|
90
|
+
var E = t.getAttribute("width");
|
|
91
|
+
E && r.setAttribute("width", E);
|
|
92
|
+
var y = t.getAttribute("height");
|
|
93
|
+
y && r.setAttribute("height", y);
|
|
94
|
+
var G = Array.from(new Set(D(D(D([], (r.getAttribute("class") || "").split(" "), !0), ["injected-svg"], !1), (t.getAttribute("class") || "").split(" "), !0))).join(" ").trim();
|
|
95
|
+
r.setAttribute("class", G);
|
|
96
|
+
var b = t.getAttribute("style");
|
|
97
|
+
b && r.setAttribute("style", b), r.setAttribute("data-src", u);
|
|
98
|
+
var R = [].filter.call(t.attributes, function(f) {
|
|
99
|
+
return /^data-\w[\w-]*$/.test(f.name);
|
|
100
|
+
});
|
|
101
|
+
if (Array.prototype.forEach.call(R, function(f) {
|
|
102
|
+
f.name && f.value && r.setAttribute(f.name, f.value);
|
|
103
|
+
}), n) {
|
|
104
|
+
var h = {
|
|
105
|
+
clipPath: ["clip-path"],
|
|
106
|
+
"color-profile": ["color-profile"],
|
|
107
|
+
cursor: ["cursor"],
|
|
108
|
+
filter: ["filter"],
|
|
109
|
+
linearGradient: ["fill", "stroke"],
|
|
110
|
+
marker: ["marker", "marker-start", "marker-mid", "marker-end"],
|
|
111
|
+
mask: ["mask"],
|
|
112
|
+
path: [],
|
|
113
|
+
pattern: ["fill", "stroke"],
|
|
114
|
+
radialGradient: ["fill", "stroke"]
|
|
115
|
+
}, C, d, m, T, k;
|
|
116
|
+
Object.keys(h).forEach(function(f) {
|
|
117
|
+
C = f, m = h[f], d = r.querySelectorAll(C + "[id]");
|
|
118
|
+
for (var nt = function(I, mt) {
|
|
119
|
+
T = d[I].id, k = T + "-" + vt();
|
|
120
|
+
var M;
|
|
121
|
+
Array.prototype.forEach.call(m, function(W) {
|
|
122
|
+
M = r.querySelectorAll("[" + W + '*="' + T + '"]');
|
|
123
|
+
for (var O = 0, st = M.length; O < st; O++) {
|
|
124
|
+
var $ = M[O].getAttribute(W);
|
|
125
|
+
$ && !$.match(new RegExp('url\\("?#' + T + '"?\\)')) || M[O].setAttribute(W, "url(#" + k + ")");
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
for (var U = r.querySelectorAll("[*|href]"), H = [], N = 0, at = U.length; N < at; N++) {
|
|
129
|
+
var P = U[N].getAttributeNS(F, "href");
|
|
130
|
+
P && P.toString() === "#" + d[I].id && H.push(U[N]);
|
|
131
|
+
}
|
|
132
|
+
for (var Q = 0, ot = H.length; Q < ot; Q++)
|
|
133
|
+
H[Q].setAttributeNS(F, "href", "#" + k);
|
|
134
|
+
d[I].id = k;
|
|
135
|
+
}, _ = 0, it = d.length; _ < it; _++)
|
|
136
|
+
nt(_);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
r.removeAttribute("xmlns:a");
|
|
140
|
+
for (var x = r.querySelectorAll("script"), L = [], V, q, A = 0, tt = x.length; A < tt; A++)
|
|
141
|
+
q = x[A].getAttribute("type"), (!q || q === "application/ecmascript" || q === "application/javascript" || q === "text/javascript") && (V = x[A].innerText || x[A].textContent, V && L.push(V), r.removeChild(x[A]));
|
|
142
|
+
if (L.length > 0 && (o === "always" || o === "once" && !J[u])) {
|
|
143
|
+
for (var X = 0, et = L.length; X < et; X++)
|
|
144
|
+
new Function(L[X])(window);
|
|
145
|
+
J[u] = !0;
|
|
146
|
+
}
|
|
147
|
+
var rt = r.querySelectorAll("style");
|
|
148
|
+
if (Array.prototype.forEach.call(rt, function(f) {
|
|
149
|
+
f.textContent += "";
|
|
150
|
+
}), r.setAttribute("xmlns", pt), r.setAttribute("xmlns:xlink", F), i(r), !t.parentNode) {
|
|
151
|
+
l.splice(l.indexOf(t), 1), t = null, a(new Error("Parent node is null"));
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
t.parentNode.replaceChild(r, t), l.splice(l.indexOf(t), 1), t = null, a(null, r);
|
|
155
|
+
});
|
|
156
|
+
}, wt = function(t, o) {
|
|
157
|
+
var n = o === void 0 ? {} : o, e = n.afterAll, s = e === void 0 ? function() {
|
|
158
|
+
} : e, i = n.afterEach, a = i === void 0 ? function() {
|
|
159
|
+
} : i, u = n.beforeEach, p = u === void 0 ? function() {
|
|
160
|
+
} : u, j = n.cacheRequests, r = j === void 0 ? !0 : j, w = n.evalScripts, S = w === void 0 ? "never" : w, E = n.httpRequestWithCredentials, y = E === void 0 ? !1 : E, G = n.renumerateIRIElements, b = G === void 0 ? !0 : G;
|
|
161
|
+
if (t && "length" in t)
|
|
162
|
+
for (var R = 0, h = 0, C = t.length; h < C; h++)
|
|
163
|
+
K(t[h], S, b, r, y, p, function(d, m) {
|
|
164
|
+
a(d, m), t && "length" in t && t.length === ++R && s(R);
|
|
165
|
+
});
|
|
166
|
+
else t ? K(t, S, b, r, y, p, function(d, m) {
|
|
167
|
+
a(d, m), s(1), t = null;
|
|
168
|
+
}) : s(0);
|
|
169
|
+
};
|
|
5
170
|
export {
|
|
6
|
-
|
|
171
|
+
wt as SVGInjector
|
|
7
172
|
};
|
|
8
173
|
//# sourceMappingURL=index233.js.map
|
package/dist/index233.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index233.js","sources":["../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"],"sourcesContent":["import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };"],"names":["_setPrototypeOf","_inheritsLoose","t","o","setPrototypeOf"],"mappings":"AACA,OAAAA,OAAA;AAAA,SAASC,EAAeC,GAAGC,GAAG;AAC5B,EAAAD,EAAE,YAAY,OAAO,OAAOC,EAAE,SAAS,GAAGD,EAAE,UAAU,cAAcA,GAAGE,EAAeF,GAAGC,CAAC;AAC5F;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index233.js","sources":["../node_modules/@tanem/svg-injector/dist/svg-injector.esm.js"],"sourcesContent":["import { __spreadArray } from 'tslib';\nimport { parse } from 'content-type';\n\nvar cache = new Map();\n\nvar cloneSvg = function cloneSvg(sourceSvg) {\n return sourceSvg.cloneNode(true);\n};\n\nvar isLocal = function isLocal() {\n return window.location.protocol === 'file:';\n};\n\nvar makeAjaxRequest = function makeAjaxRequest(url, httpRequestWithCredentials, callback) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function () {\n try {\n if (!/\\.svg/i.test(url) && httpRequest.readyState === 2) {\n var contentType = httpRequest.getResponseHeader('Content-Type');\n if (!contentType) {\n throw new Error('Content type not found');\n }\n var type = parse(contentType).type;\n if (!(type === 'image/svg+xml' || type === 'text/plain')) {\n throw new Error(\"Invalid content type: \".concat(type));\n }\n }\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 404 || httpRequest.responseXML === null) {\n throw new Error(isLocal() ? 'Note: SVG injection ajax calls do not work locally without ' + 'adjusting security settings in your browser. Or consider ' + 'using a local webserver.' : 'Unable to load SVG file: ' + url);\n }\n if (httpRequest.status === 200 || isLocal() && httpRequest.status === 0) {\n callback(null, httpRequest);\n } else {\n throw new Error('There was a problem injecting the SVG: ' + httpRequest.status + ' ' + httpRequest.statusText);\n }\n }\n } catch (error) {\n httpRequest.abort();\n if (error instanceof Error) {\n callback(error, httpRequest);\n } else {\n throw error;\n }\n }\n };\n httpRequest.open('GET', url);\n httpRequest.withCredentials = httpRequestWithCredentials;\n if (httpRequest.overrideMimeType) {\n httpRequest.overrideMimeType('text/xml');\n }\n httpRequest.send();\n};\n\nvar requestQueue = {};\nvar queueRequest = function queueRequest(url, callback) {\n requestQueue[url] = requestQueue[url] || [];\n requestQueue[url].push(callback);\n};\nvar processRequestQueue = function processRequestQueue(url) {\n var _loop_1 = function _loop_1(i, len) {\n setTimeout(function () {\n if (Array.isArray(requestQueue[url])) {\n var cacheValue = cache.get(url);\n var callback = requestQueue[url][i];\n if (cacheValue instanceof SVGSVGElement) {\n callback(null, cloneSvg(cacheValue));\n }\n if (cacheValue instanceof Error) {\n callback(cacheValue);\n }\n if (i === requestQueue[url].length - 1) {\n delete requestQueue[url];\n }\n }\n }, 0);\n };\n for (var i = 0, len = requestQueue[url].length; i < len; i++) {\n _loop_1(i);\n }\n};\n\nvar loadSvgCached = function loadSvgCached(url, httpRequestWithCredentials, callback) {\n if (cache.has(url)) {\n var cacheValue = cache.get(url);\n if (cacheValue === undefined) {\n queueRequest(url, callback);\n return;\n }\n if (cacheValue instanceof SVGSVGElement) {\n callback(null, cloneSvg(cacheValue));\n return;\n }\n }\n cache.set(url, undefined);\n queueRequest(url, callback);\n makeAjaxRequest(url, httpRequestWithCredentials, function (error, httpRequest) {\n var _a;\n if (error) {\n cache.set(url, error);\n } else if (((_a = httpRequest.responseXML) === null || _a === void 0 ? void 0 : _a.documentElement) instanceof SVGSVGElement) {\n cache.set(url, httpRequest.responseXML.documentElement);\n }\n processRequestQueue(url);\n });\n};\n\nvar loadSvgUncached = function loadSvgUncached(url, httpRequestWithCredentials, callback) {\n makeAjaxRequest(url, httpRequestWithCredentials, function (error, httpRequest) {\n var _a;\n if (error) {\n callback(error);\n } else if (((_a = httpRequest.responseXML) === null || _a === void 0 ? void 0 : _a.documentElement) instanceof SVGSVGElement) {\n callback(null, httpRequest.responseXML.documentElement);\n }\n });\n};\n\nvar idCounter = 0;\nvar uniqueId = function uniqueId() {\n return ++idCounter;\n};\n\nvar injectedElements = [];\nvar ranScripts = {};\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar injectElement = function injectElement(el, evalScripts, renumerateIRIElements, cacheRequests, httpRequestWithCredentials, beforeEach, callback) {\n var elUrl = el.getAttribute('data-src') || el.getAttribute('src');\n if (!elUrl) {\n callback(new Error('Invalid data-src or src attribute'));\n return;\n }\n if (injectedElements.indexOf(el) !== -1) {\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n return;\n }\n injectedElements.push(el);\n el.setAttribute('src', '');\n var loadSvg = cacheRequests ? loadSvgCached : loadSvgUncached;\n loadSvg(elUrl, httpRequestWithCredentials, function (error, svg) {\n if (!svg) {\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(error);\n return;\n }\n var elId = el.getAttribute('id');\n if (elId) {\n svg.setAttribute('id', elId);\n }\n var elTitle = el.getAttribute('title');\n if (elTitle) {\n svg.setAttribute('title', elTitle);\n }\n var elWidth = el.getAttribute('width');\n if (elWidth) {\n svg.setAttribute('width', elWidth);\n }\n var elHeight = el.getAttribute('height');\n if (elHeight) {\n svg.setAttribute('height', elHeight);\n }\n var mergedClasses = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], (svg.getAttribute('class') || '').split(' '), true), ['injected-svg'], false), (el.getAttribute('class') || '').split(' '), true))).join(' ').trim();\n svg.setAttribute('class', mergedClasses);\n var elStyle = el.getAttribute('style');\n if (elStyle) {\n svg.setAttribute('style', elStyle);\n }\n svg.setAttribute('data-src', elUrl);\n var elData = [].filter.call(el.attributes, function (at) {\n return /^data-\\w[\\w-]*$/.test(at.name);\n });\n Array.prototype.forEach.call(elData, function (dataAttr) {\n if (dataAttr.name && dataAttr.value) {\n svg.setAttribute(dataAttr.name, dataAttr.value);\n }\n });\n if (renumerateIRIElements) {\n var iriElementsAndProperties_1 = {\n clipPath: ['clip-path'],\n 'color-profile': ['color-profile'],\n cursor: ['cursor'],\n filter: ['filter'],\n linearGradient: ['fill', 'stroke'],\n marker: ['marker', 'marker-start', 'marker-mid', 'marker-end'],\n mask: ['mask'],\n path: [],\n pattern: ['fill', 'stroke'],\n radialGradient: ['fill', 'stroke']\n };\n var element_1;\n var elements_1;\n var properties_1;\n var currentId_1;\n var newId_1;\n Object.keys(iriElementsAndProperties_1).forEach(function (key) {\n element_1 = key;\n properties_1 = iriElementsAndProperties_1[key];\n elements_1 = svg.querySelectorAll(element_1 + '[id]');\n var _loop_1 = function _loop_1(a, elementsLen) {\n currentId_1 = elements_1[a].id;\n newId_1 = currentId_1 + '-' + uniqueId();\n var referencingElements;\n Array.prototype.forEach.call(properties_1, function (property) {\n referencingElements = svg.querySelectorAll('[' + property + '*=\"' + currentId_1 + '\"]');\n for (var b = 0, referencingElementLen = referencingElements.length; b < referencingElementLen; b++) {\n var attrValue = referencingElements[b].getAttribute(property);\n if (attrValue && !attrValue.match(new RegExp('url\\\\(\"?#' + currentId_1 + '\"?\\\\)'))) {\n continue;\n }\n referencingElements[b].setAttribute(property, 'url(#' + newId_1 + ')');\n }\n });\n var allLinks = svg.querySelectorAll('[*|href]');\n var links = [];\n for (var c = 0, allLinksLen = allLinks.length; c < allLinksLen; c++) {\n var href = allLinks[c].getAttributeNS(xlinkNamespace, 'href');\n if (href && href.toString() === '#' + elements_1[a].id) {\n links.push(allLinks[c]);\n }\n }\n for (var d = 0, linksLen = links.length; d < linksLen; d++) {\n links[d].setAttributeNS(xlinkNamespace, 'href', '#' + newId_1);\n }\n elements_1[a].id = newId_1;\n };\n for (var a = 0, elementsLen = elements_1.length; a < elementsLen; a++) {\n _loop_1(a);\n }\n });\n }\n svg.removeAttribute('xmlns:a');\n var scripts = svg.querySelectorAll('script');\n var scriptsToEval = [];\n var script;\n var scriptType;\n for (var i = 0, scriptsLen = scripts.length; i < scriptsLen; i++) {\n scriptType = scripts[i].getAttribute('type');\n if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript' || scriptType === 'text/javascript') {\n script = scripts[i].innerText || scripts[i].textContent;\n if (script) {\n scriptsToEval.push(script);\n }\n svg.removeChild(scripts[i]);\n }\n }\n if (scriptsToEval.length > 0 && (evalScripts === 'always' || evalScripts === 'once' && !ranScripts[elUrl])) {\n for (var l = 0, scriptsToEvalLen = scriptsToEval.length; l < scriptsToEvalLen; l++) {\n new Function(scriptsToEval[l])(window);\n }\n ranScripts[elUrl] = true;\n }\n var styleTags = svg.querySelectorAll('style');\n Array.prototype.forEach.call(styleTags, function (styleTag) {\n styleTag.textContent += '';\n });\n svg.setAttribute('xmlns', svgNamespace);\n svg.setAttribute('xmlns:xlink', xlinkNamespace);\n beforeEach(svg);\n if (!el.parentNode) {\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(new Error('Parent node is null'));\n return;\n }\n el.parentNode.replaceChild(svg, el);\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(null, svg);\n });\n};\n\nvar SVGInjector = function SVGInjector(elements, _a) {\n var _b = _a === void 0 ? {} : _a,\n _c = _b.afterAll,\n afterAll = _c === void 0 ? function () {\n return undefined;\n } : _c,\n _d = _b.afterEach,\n afterEach = _d === void 0 ? function () {\n return undefined;\n } : _d,\n _e = _b.beforeEach,\n beforeEach = _e === void 0 ? function () {\n return undefined;\n } : _e,\n _f = _b.cacheRequests,\n cacheRequests = _f === void 0 ? true : _f,\n _g = _b.evalScripts,\n evalScripts = _g === void 0 ? 'never' : _g,\n _h = _b.httpRequestWithCredentials,\n httpRequestWithCredentials = _h === void 0 ? false : _h,\n _j = _b.renumerateIRIElements,\n renumerateIRIElements = _j === void 0 ? true : _j;\n if (elements && 'length' in elements) {\n var elementsLoaded_1 = 0;\n for (var i = 0, j = elements.length; i < j; i++) {\n injectElement(elements[i], evalScripts, renumerateIRIElements, cacheRequests, httpRequestWithCredentials, beforeEach, function (error, svg) {\n afterEach(error, svg);\n if (elements && 'length' in elements && elements.length === ++elementsLoaded_1) {\n afterAll(elementsLoaded_1);\n }\n });\n }\n } else if (elements) {\n injectElement(elements, evalScripts, renumerateIRIElements, cacheRequests, httpRequestWithCredentials, beforeEach, function (error, svg) {\n afterEach(error, svg);\n afterAll(1);\n elements = null;\n });\n } else {\n afterAll(0);\n }\n};\n\nexport { SVGInjector };\n//# sourceMappingURL=svg-injector.esm.js.map\n"],"names":["__spreadArray","parse_1","cache","cloneSvg","sourceSvg","isLocal","makeAjaxRequest","url","httpRequestWithCredentials","callback","httpRequest","contentType","type","parse","error","requestQueue","queueRequest","processRequestQueue","_loop_1","len","cacheValue","i","loadSvgCached","_a","loadSvgUncached","idCounter","uniqueId","injectedElements","ranScripts","svgNamespace","xlinkNamespace","injectElement","el","evalScripts","renumerateIRIElements","cacheRequests","beforeEach","elUrl","loadSvg","svg","elId","elTitle","elWidth","elHeight","mergedClasses","elStyle","elData","at","dataAttr","iriElementsAndProperties_1","element_1","elements_1","properties_1","currentId_1","newId_1","key","a","elementsLen","referencingElements","property","b","referencingElementLen","attrValue","allLinks","links","c","allLinksLen","href","d","linksLen","scripts","scriptsToEval","script","scriptType","scriptsLen","l","scriptsToEvalLen","styleTags","styleTag","SVGInjector","elements","_b","_c","afterAll","_d","afterEach","_e","_f","_g","_h","_j","elementsLoaded_1","j"],"mappings":"AAGA,SAAA,iBAAAA,SAAA;AAAA,SAAA,SAAAC,UAAA;AAAA,IAAIC,IAAQ,oBAAI,IAAG,GAEfC,IAAW,SAAkBC,GAAW;AAC1C,SAAOA,EAAU,UAAU,EAAI;AACjC,GAEIC,IAAU,WAAmB;AAC/B,SAAO,OAAO,SAAS,aAAa;AACtC,GAEIC,IAAkB,SAAyBC,GAAKC,GAA4BC,GAAU;AACxF,MAAIC,IAAc,IAAI,eAAc;AACpC,EAAAA,EAAY,qBAAqB,WAAY;AAC3C,QAAI;AACF,UAAI,CAAC,SAAS,KAAKH,CAAG,KAAKG,EAAY,eAAe,GAAG;AACvD,YAAIC,IAAcD,EAAY,kBAAkB,cAAc;AAC9D,YAAI,CAACC;AACH,gBAAM,IAAI,MAAM,wBAAwB;AAE1C,YAAIC,IAAOC,GAAMF,CAAW,EAAE;AAC9B,YAAI,EAAEC,MAAS,mBAAmBA,MAAS;AACzC,gBAAM,IAAI,MAAM,yBAAyB,OAAOA,CAAI,CAAC;AAAA,MAEzD;AACA,UAAIF,EAAY,eAAe,GAAG;AAChC,YAAIA,EAAY,WAAW,OAAOA,EAAY,gBAAgB;AAC5D,gBAAM,IAAI,MAAML,MAAY,iJAA2J,8BAA8BE,CAAG;AAE1N,YAAIG,EAAY,WAAW,OAAOL,EAAO,KAAMK,EAAY,WAAW;AACpE,UAAAD,EAAS,MAAMC,CAAW;AAAA;AAE1B,gBAAM,IAAI,MAAM,4CAA4CA,EAAY,SAAS,MAAMA,EAAY,UAAU;AAAA,MAEjH;AAAA,IACF,SAASI,GAAO;AAEd,UADAJ,EAAY,M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;AAC1I,QAAA8C,EAAUvE,GAAOyB,CAAG,GAChByC,KAAY,YAAYA,KAAYA,EAAS,WAAW,EAAEW,KAC5DR,EAASQ,CAAgB;AAAA,MAE7B,CAAC;AAAA,MAEE,CAAIX,IACTjD,EAAciD,GAAU/C,GAAaC,GAAuBC,GAAe3B,GAA4B4B,GAAY,SAAUtB,GAAOyB,GAAK;AACvI,IAAA8C,EAAUvE,GAAOyB,CAAG,GACpB4C,EAAS,CAAC,GACVH,IAAW;AAAA,EACb,CAAC,IAEDG,EAAS,CAAC;AAEd;","x_google_ignoreList":[0]}
|
package/dist/index234.js
CHANGED
|
@@ -1,173 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!/\.svg/i.test(t) && e.readyState === 2) {
|
|
12
|
-
var s = e.getResponseHeader("Content-Type");
|
|
13
|
-
if (!s)
|
|
14
|
-
throw new Error("Content type not found");
|
|
15
|
-
var i = ut(s).type;
|
|
16
|
-
if (!(i === "image/svg+xml" || i === "text/plain"))
|
|
17
|
-
throw new Error("Invalid content type: ".concat(i));
|
|
18
|
-
}
|
|
19
|
-
if (e.readyState === 4) {
|
|
20
|
-
if (e.status === 404 || e.responseXML === null)
|
|
21
|
-
throw new Error(z() ? "Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver." : "Unable to load SVG file: " + t);
|
|
22
|
-
if (e.status === 200 || z() && e.status === 0)
|
|
23
|
-
n(null, e);
|
|
24
|
-
else
|
|
25
|
-
throw new Error("There was a problem injecting the SVG: " + e.status + " " + e.statusText);
|
|
26
|
-
}
|
|
27
|
-
} catch (a) {
|
|
28
|
-
if (e.abort(), a instanceof Error)
|
|
29
|
-
n(a, e);
|
|
30
|
-
else
|
|
31
|
-
throw a;
|
|
32
|
-
}
|
|
33
|
-
}, e.open("GET", t), e.withCredentials = o, e.overrideMimeType && e.overrideMimeType("text/xml"), e.send();
|
|
34
|
-
}, v = {}, B = function(t, o) {
|
|
35
|
-
v[t] = v[t] || [], v[t].push(o);
|
|
36
|
-
}, ft = function(t) {
|
|
37
|
-
for (var o = function(i, a) {
|
|
38
|
-
setTimeout(function() {
|
|
39
|
-
if (Array.isArray(v[t])) {
|
|
40
|
-
var u = g.get(t), p = v[t][i];
|
|
41
|
-
u instanceof SVGSVGElement && p(null, Y(u)), u instanceof Error && p(u), i === v[t].length - 1 && delete v[t];
|
|
42
|
-
}
|
|
43
|
-
}, 0);
|
|
44
|
-
}, n = 0, e = v[t].length; n < e; n++)
|
|
45
|
-
o(n);
|
|
46
|
-
}, lt = function(t, o, n) {
|
|
47
|
-
if (g.has(t)) {
|
|
48
|
-
var e = g.get(t);
|
|
49
|
-
if (e === void 0) {
|
|
50
|
-
B(t, n);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (e instanceof SVGSVGElement) {
|
|
54
|
-
n(null, Y(e));
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
g.set(t, void 0), B(t, n), Z(t, o, function(s, i) {
|
|
59
|
-
var a;
|
|
60
|
-
s ? g.set(t, s) : ((a = i.responseXML) === null || a === void 0 ? void 0 : a.documentElement) instanceof SVGSVGElement && g.set(t, i.responseXML.documentElement), ft(t);
|
|
61
|
-
});
|
|
62
|
-
}, ct = function(t, o, n) {
|
|
63
|
-
Z(t, o, function(e, s) {
|
|
64
|
-
var i;
|
|
65
|
-
e ? n(e) : ((i = s.responseXML) === null || i === void 0 ? void 0 : i.documentElement) instanceof SVGSVGElement && n(null, s.responseXML.documentElement);
|
|
66
|
-
});
|
|
67
|
-
}, dt = 0, vt = function() {
|
|
68
|
-
return ++dt;
|
|
69
|
-
}, l = [], J = {}, pt = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xlink", K = function(t, o, n, e, s, i, a) {
|
|
70
|
-
var u = t.getAttribute("data-src") || t.getAttribute("src");
|
|
71
|
-
if (!u) {
|
|
72
|
-
a(new Error("Invalid data-src or src attribute"));
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (l.indexOf(t) !== -1) {
|
|
76
|
-
l.splice(l.indexOf(t), 1), t = null;
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
l.push(t), t.setAttribute("src", "");
|
|
80
|
-
var p = e ? lt : ct;
|
|
81
|
-
p(u, s, function(j, r) {
|
|
82
|
-
if (!r) {
|
|
83
|
-
l.splice(l.indexOf(t), 1), t = null, a(j);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
var w = t.getAttribute("id");
|
|
87
|
-
w && r.setAttribute("id", w);
|
|
88
|
-
var S = t.getAttribute("title");
|
|
89
|
-
S && r.setAttribute("title", S);
|
|
90
|
-
var E = t.getAttribute("width");
|
|
91
|
-
E && r.setAttribute("width", E);
|
|
92
|
-
var y = t.getAttribute("height");
|
|
93
|
-
y && r.setAttribute("height", y);
|
|
94
|
-
var G = Array.from(new Set(D(D(D([], (r.getAttribute("class") || "").split(" "), !0), ["injected-svg"], !1), (t.getAttribute("class") || "").split(" "), !0))).join(" ").trim();
|
|
95
|
-
r.setAttribute("class", G);
|
|
96
|
-
var b = t.getAttribute("style");
|
|
97
|
-
b && r.setAttribute("style", b), r.setAttribute("data-src", u);
|
|
98
|
-
var R = [].filter.call(t.attributes, function(f) {
|
|
99
|
-
return /^data-\w[\w-]*$/.test(f.name);
|
|
100
|
-
});
|
|
101
|
-
if (Array.prototype.forEach.call(R, function(f) {
|
|
102
|
-
f.name && f.value && r.setAttribute(f.name, f.value);
|
|
103
|
-
}), n) {
|
|
104
|
-
var h = {
|
|
105
|
-
clipPath: ["clip-path"],
|
|
106
|
-
"color-profile": ["color-profile"],
|
|
107
|
-
cursor: ["cursor"],
|
|
108
|
-
filter: ["filter"],
|
|
109
|
-
linearGradient: ["fill", "stroke"],
|
|
110
|
-
marker: ["marker", "marker-start", "marker-mid", "marker-end"],
|
|
111
|
-
mask: ["mask"],
|
|
112
|
-
path: [],
|
|
113
|
-
pattern: ["fill", "stroke"],
|
|
114
|
-
radialGradient: ["fill", "stroke"]
|
|
115
|
-
}, C, d, m, T, k;
|
|
116
|
-
Object.keys(h).forEach(function(f) {
|
|
117
|
-
C = f, m = h[f], d = r.querySelectorAll(C + "[id]");
|
|
118
|
-
for (var nt = function(I, mt) {
|
|
119
|
-
T = d[I].id, k = T + "-" + vt();
|
|
120
|
-
var M;
|
|
121
|
-
Array.prototype.forEach.call(m, function(W) {
|
|
122
|
-
M = r.querySelectorAll("[" + W + '*="' + T + '"]');
|
|
123
|
-
for (var O = 0, st = M.length; O < st; O++) {
|
|
124
|
-
var $ = M[O].getAttribute(W);
|
|
125
|
-
$ && !$.match(new RegExp('url\\("?#' + T + '"?\\)')) || M[O].setAttribute(W, "url(#" + k + ")");
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
for (var U = r.querySelectorAll("[*|href]"), H = [], N = 0, at = U.length; N < at; N++) {
|
|
129
|
-
var P = U[N].getAttributeNS(F, "href");
|
|
130
|
-
P && P.toString() === "#" + d[I].id && H.push(U[N]);
|
|
131
|
-
}
|
|
132
|
-
for (var Q = 0, ot = H.length; Q < ot; Q++)
|
|
133
|
-
H[Q].setAttributeNS(F, "href", "#" + k);
|
|
134
|
-
d[I].id = k;
|
|
135
|
-
}, _ = 0, it = d.length; _ < it; _++)
|
|
136
|
-
nt(_);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
r.removeAttribute("xmlns:a");
|
|
140
|
-
for (var x = r.querySelectorAll("script"), L = [], V, q, A = 0, tt = x.length; A < tt; A++)
|
|
141
|
-
q = x[A].getAttribute("type"), (!q || q === "application/ecmascript" || q === "application/javascript" || q === "text/javascript") && (V = x[A].innerText || x[A].textContent, V && L.push(V), r.removeChild(x[A]));
|
|
142
|
-
if (L.length > 0 && (o === "always" || o === "once" && !J[u])) {
|
|
143
|
-
for (var X = 0, et = L.length; X < et; X++)
|
|
144
|
-
new Function(L[X])(window);
|
|
145
|
-
J[u] = !0;
|
|
146
|
-
}
|
|
147
|
-
var rt = r.querySelectorAll("style");
|
|
148
|
-
if (Array.prototype.forEach.call(rt, function(f) {
|
|
149
|
-
f.textContent += "";
|
|
150
|
-
}), r.setAttribute("xmlns", pt), r.setAttribute("xmlns:xlink", F), i(r), !t.parentNode) {
|
|
151
|
-
l.splice(l.indexOf(t), 1), t = null, a(new Error("Parent node is null"));
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
t.parentNode.replaceChild(r, t), l.splice(l.indexOf(t), 1), t = null, a(null, r);
|
|
155
|
-
});
|
|
156
|
-
}, wt = function(t, o) {
|
|
157
|
-
var n = o === void 0 ? {} : o, e = n.afterAll, s = e === void 0 ? function() {
|
|
158
|
-
} : e, i = n.afterEach, a = i === void 0 ? function() {
|
|
159
|
-
} : i, u = n.beforeEach, p = u === void 0 ? function() {
|
|
160
|
-
} : u, j = n.cacheRequests, r = j === void 0 ? !0 : j, w = n.evalScripts, S = w === void 0 ? "never" : w, E = n.httpRequestWithCredentials, y = E === void 0 ? !1 : E, G = n.renumerateIRIElements, b = G === void 0 ? !0 : G;
|
|
161
|
-
if (t && "length" in t)
|
|
162
|
-
for (var R = 0, h = 0, C = t.length; h < C; h++)
|
|
163
|
-
K(t[h], S, b, r, y, p, function(d, m) {
|
|
164
|
-
a(d, m), t && "length" in t && t.length === ++R && s(R);
|
|
165
|
-
});
|
|
166
|
-
else t ? K(t, S, b, r, y, p, function(d, m) {
|
|
167
|
-
a(d, m), s(1), t = null;
|
|
168
|
-
}) : s(0);
|
|
169
|
-
};
|
|
1
|
+
import { __module as r } from "./index240.js";
|
|
2
|
+
import { __require as e } from "./index241.js";
|
|
3
|
+
import { __require as o } from "./index242.js";
|
|
4
|
+
import { __require as p } from "./index243.js";
|
|
5
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6
|
+
var s = e(), i = !0;
|
|
7
|
+
r.exports = o()(s.isElement, i);
|
|
8
|
+
} else
|
|
9
|
+
r.exports = p()();
|
|
10
|
+
var _ = r.exports;
|
|
170
11
|
export {
|
|
171
|
-
|
|
12
|
+
_ as p
|
|
172
13
|
};
|
|
173
14
|
//# sourceMappingURL=index234.js.map
|