se-design 0.0.125 → 0.0.127
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/style.css +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/InputWithIcon/index.d.ts +27 -0
- package/dist/components/InputWithTags/index.d.ts +4 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/index100.js +2 -2
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -1
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +1 -1
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -1
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +1 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +1 -1
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +1 -1
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +1 -1
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +1 -1
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +1 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +1 -1
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -149
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +152 -0
- package/dist/index129.js.map +1 -0
- package/dist/index14.js +5 -5
- package/dist/index14.js.map +1 -1
- package/dist/{index140.js → index141.js} +1 -1
- package/dist/{index140.js.map → index141.js.map} +1 -1
- package/dist/{index148.js → index149.js} +1 -1
- package/dist/{index148.js.map → index149.js.map} +1 -1
- package/dist/index152.js +9 -4
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +10 -170
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +5 -11
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +170 -6
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +11 -6
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +5 -37
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +6 -2
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +37 -7
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +2 -327
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +7 -49
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +327 -2
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +45 -71
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +2 -93
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +72 -48
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +92 -7
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +51 -4
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +7 -51
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +5 -2
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +52 -2
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +5 -0
- package/dist/index171.js.map +1 -0
- package/dist/index172.js +5 -0
- package/dist/index172.js.map +1 -0
- package/dist/index21.js +28 -27
- package/dist/index21.js.map +1 -1
- package/dist/index35.js +34 -25
- package/dist/index35.js.map +1 -1
- package/dist/index38.js +1 -1
- package/dist/index44.js +1 -1
- package/dist/index5.js +79 -79
- package/dist/index50.js +55 -2
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +1 -1
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +1 -1
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +1 -1
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +1 -1
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +1 -1
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +1 -1
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +1 -1
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +1 -1
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +1 -1
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +1 -1
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +1 -1
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +1 -1
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +1 -1
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +1 -1
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +1 -1
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +1 -1
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +1 -1
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +1 -1
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +2 -2
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +2 -2
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +1 -1
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +1 -1
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +2 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +2 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +1 -1
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +1 -1
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +2 -2
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +1 -1
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +2 -2
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +1 -1
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +1 -1
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +1 -1
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +2 -2
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +2 -2
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -1
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +2 -2
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +2 -2
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +2 -2
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +2 -2
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +2 -2
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +2 -2
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index150.js +0 -13
- package/dist/index150.js.map +0 -1
- package/dist/index151.js +0 -13
- package/dist/index151.js.map +0 -1
package/dist/index14.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import r, { useState as
|
1
|
+
import r, { useState as p, useRef as d, useEffect as a } from "react";
|
2
2
|
const u = ({
|
3
3
|
content: l,
|
4
4
|
tooltipSrc: c,
|
5
5
|
position: t = "bottom-center",
|
6
6
|
displayOn: o = "hover"
|
7
7
|
}) => {
|
8
|
-
const [i, f] =
|
8
|
+
const [i, f] = p(o === "always-on"), s = d(null);
|
9
9
|
a(() => {
|
10
10
|
const e = s.current;
|
11
11
|
e && (t == "bottom-center" ? (e.setAttribute("style", "left: 50%;transform: translateX(-50%);"), e.classList.add("before:left-[calc(50%-7px)]"), e.classList.add("before:top-[-7px]")) : t == "bottom-left" ? (e.classList.add("before:left-[calc(10%-7px)]"), e.classList.add("before:top-[-7px]")) : t == "bottom-right" ? (e.setAttribute("style", "right: 0;"), e.classList.add("before:right-[calc(10%+7px)]"), e.classList.add("before:top-[-7px]")) : t == "left" ? (e.setAttribute("style", "right: calc(100% + 10px);top:0;"), e.classList.add("before:right-[-6px]"), e.classList.add("before:top-0px")) : t == "right" && (e.setAttribute("style", "left: calc(100% + 10px);top:0;"), e.classList.add("before:left-[-6px]"), e.classList.add("before:top-0px")), o == "hover" && e.classList.add("group-hover:visible"));
|
@@ -13,19 +13,19 @@ const u = ({
|
|
13
13
|
const e = s.current;
|
14
14
|
e && (i ? e.classList.remove("invisible") : e.classList.add("invisible"));
|
15
15
|
}, [i]);
|
16
|
-
const
|
16
|
+
const b = () => {
|
17
17
|
o == "click" && f((e) => !e);
|
18
18
|
};
|
19
19
|
return /* @__PURE__ */ r.createElement("div", {
|
20
20
|
className: "se-design-tooltip group relative",
|
21
|
-
onClick:
|
21
|
+
onClick: b
|
22
22
|
}, /* @__PURE__ */ r.createElement("div", {
|
23
23
|
className: "cursor-pointer",
|
24
24
|
id: "tooltip-trigger"
|
25
25
|
}, c), /* @__PURE__ */ r.createElement("div", {
|
26
26
|
ref: s,
|
27
27
|
id: "tooltip-content",
|
28
|
-
className: "flex justify-center px-3 py-2 min-w-24 max-w-60 absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-
|
28
|
+
className: "flex justify-center px-3 py-2 min-w-24 max-w-60 absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px] before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block before:absolute before:rounded-tl-sm before:rotate-45"
|
29
29
|
}, l));
|
30
30
|
};
|
31
31
|
export {
|
package/dist/index14.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from
|
1
|
+
{"version":3,"file":"index14.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nexport interface TooltipProps {\n /**\n * Tooltip contents\n */\n content: string;\n /**\n * Tooltip position\n */\n position?: 'bottom-center' | 'bottom-left' | 'bottom-right' | 'left' | 'right';\n /**\n * Display tooltip on Hover, Click or Always\n */\n displayOn?: 'hover' | 'click' | 'always-on';\n /**\n * Tooltip trigger contents\n */\n tooltipSrc?: React.ReactNode;\n}\n\nexport const Tooltip = ({ content, tooltipSrc, position = 'bottom-center', displayOn = 'hover' }: TooltipProps) => {\n const [displayTooltip, setDisplayTooltip] = useState(displayOn === 'always-on');\n const tooltipContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n\n if (position == 'bottom-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-left') {\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-right') {\n tooltipContent.setAttribute('style', `right: 0;`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'left') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-0px`);\n } else if (position == 'right') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-0px`);\n }\n\n if (displayOn == 'hover') {\n tooltipContent.classList.add(`group-hover:visible`);\n }\n }, [content]);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n if (displayTooltip) {\n tooltipContent.classList.remove(`invisible`);\n } else {\n tooltipContent.classList.add(`invisible`);\n }\n }, [displayTooltip]);\n\n const onTooltipSrcClick = () => {\n if (displayOn == 'click') {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n }\n };\n\n return (\n <div className=\"se-design-tooltip group relative\" onClick={onTooltipSrcClick}>\n <div className=\"cursor-pointer\" id=\"tooltip-trigger\">\n {tooltipSrc}\n </div>\n <div\n ref={tooltipContentRef}\n id=\"tooltip-content\"\n className=\"flex justify-center px-3 py-2 min-w-24 max-w-60\n absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45\"\n >\n {content}\n </div>\n </div>\n );\n};\n"],"names":["Tooltip","content","tooltipSrc","position","displayOn","displayTooltip","setDisplayTooltip","useState","tooltipContentRef","useRef","useEffect","tooltipContent","current","setAttribute","classList","add","remove","onTooltipSrcClick","React","createElement","className","onClick","id","ref"],"mappings":";AAqBO,MAAMA,IAAUA,CAAC;AAAA,EAAEC,SAAAA;AAAAA,EAASC,YAAAA;AAAAA,EAAYC,UAAAA,IAAW;AAAA,EAAiBC,WAAAA,IAAY;AAAsB,MAAM;A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,WAAU;AAAA,IAAiBE,IAAG;AAAA,EAChCpB,GAAAA,CACE,GACLgB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEI,KAAKf;AAAAA,IACLc,IAAG;AAAA,IACHF,WAAU;AAAA,EAG8C,GAEvDnB,CACE,CACF;AAET;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"
|
1
|
+
{"version":3,"file":"index141.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\n let timeout: ReturnType<typeof setTimeout> | null;\n const debounced = (...args: Parameters<T>) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n func(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = null;\n };\n return debounced as T & { cancel: () => void };\n }"],"names":["debounce","func","wait","timeout","debounced","args","setTimeout","cancel"],"mappings":"AAAgBA,SAAAA,EAA6CC,GAASC,GAAc;AAC5EC,MAAAA;AACEC,QAAAA,IAAYA,IAAIC,MAAwB;AACxCF,IAAAA,kBAAsBA,CAAO,GACjCA,IAAUG,WAAW,MAAM;AACzBL,MAAAA,EAAK,GAAGI,CAAI;AAAA,OACXH,CAAI;AAAA,EACT;AACAE,SAAAA,EAAUG,SAAS,MAAM;AACnBJ,IAAAA,kBAAsBA,CAAO,GACvBA,IAAA;AAAA,EACZ,GACOC;AACT;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"
|
1
|
+
{"version":3,"file":"index149.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
package/dist/index152.js
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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;
|
4
9
|
}
|
5
10
|
export {
|
6
|
-
|
11
|
+
r as default
|
7
12
|
};
|
8
13
|
//# sourceMappingURL=index152.js.map
|
package/dist/index152.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index152.js","sources":["../node_modules/@babel/runtime/helpers/esm/
|
1
|
+
{"version":3,"file":"index152.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,CAAE;AACxB,MAAIE,IAAI,CAAE;AACV,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,EACd;AACE,SAAOD;AACT;","x_google_ignoreList":[0]}
|
package/dist/index153.js
CHANGED
@@ -1,173 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var
|
4
|
-
|
5
|
-
},
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
try {
|
11
|
-
if (!/\.svg/i.test(e) && t.readyState === 2) {
|
12
|
-
var u = t.getResponseHeader("Content-Type");
|
13
|
-
if (!u)
|
14
|
-
throw new Error("Content type not found");
|
15
|
-
var i = fe(u).type;
|
16
|
-
if (!(i === "image/svg+xml" || i === "text/plain"))
|
17
|
-
throw new Error("Invalid content type: ".concat(i));
|
18
|
-
}
|
19
|
-
if (t.readyState === 4) {
|
20
|
-
if (t.status === 404 || t.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: " + e);
|
22
|
-
if (t.status === 200 || z() && t.status === 0)
|
23
|
-
n(null, t);
|
24
|
-
else
|
25
|
-
throw new Error("There was a problem injecting the SVG: " + t.status + " " + t.statusText);
|
26
|
-
}
|
27
|
-
} catch (a) {
|
28
|
-
if (t.abort(), a instanceof Error)
|
29
|
-
n(a, t);
|
30
|
-
else
|
31
|
-
throw a;
|
32
|
-
}
|
33
|
-
}, t.open("GET", e), t.withCredentials = o, t.overrideMimeType && t.overrideMimeType("text/xml"), t.send();
|
34
|
-
}, p = {}, B = function(e, o) {
|
35
|
-
p[e] = p[e] || [], p[e].push(o);
|
36
|
-
}, se = function(e) {
|
37
|
-
for (var o = function(i, a) {
|
38
|
-
setTimeout(function() {
|
39
|
-
if (Array.isArray(p[e])) {
|
40
|
-
var f = g.get(e), v = p[e][i];
|
41
|
-
f instanceof SVGSVGElement && v(null, Y(f)), f instanceof Error && v(f), i === p[e].length - 1 && delete p[e];
|
42
|
-
}
|
43
|
-
}, 0);
|
44
|
-
}, n = 0, t = p[e].length; n < t; n++)
|
45
|
-
o(n);
|
46
|
-
}, le = function(e, o, n) {
|
47
|
-
if (g.has(e)) {
|
48
|
-
var t = g.get(e);
|
49
|
-
if (t === void 0) {
|
50
|
-
B(e, n);
|
51
|
-
return;
|
52
|
-
}
|
53
|
-
if (t instanceof SVGSVGElement) {
|
54
|
-
n(null, Y(t));
|
55
|
-
return;
|
56
|
-
}
|
57
|
-
}
|
58
|
-
g.set(e, void 0), B(e, n), Z(e, o, function(u, i) {
|
59
|
-
var a;
|
60
|
-
u ? g.set(e, u) : ((a = i.responseXML) === null || a === void 0 ? void 0 : a.documentElement) instanceof SVGSVGElement && g.set(e, i.responseXML.documentElement), se(e);
|
61
|
-
});
|
62
|
-
}, ce = function(e, o, n) {
|
63
|
-
Z(e, o, function(t, u) {
|
64
|
-
var i;
|
65
|
-
t ? n(t) : ((i = u.responseXML) === null || i === void 0 ? void 0 : i.documentElement) instanceof SVGSVGElement && n(null, u.responseXML.documentElement);
|
66
|
-
});
|
67
|
-
}, de = 0, pe = function() {
|
68
|
-
return ++de;
|
69
|
-
}, l = [], J = {}, ve = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xlink", K = function(e, o, n, t, u, i, a) {
|
70
|
-
var f = e.getAttribute("data-src") || e.getAttribute("src");
|
71
|
-
if (!f) {
|
72
|
-
a(new Error("Invalid data-src or src attribute"));
|
73
|
-
return;
|
74
|
-
}
|
75
|
-
if (l.indexOf(e) !== -1) {
|
76
|
-
l.splice(l.indexOf(e), 1), e = null;
|
77
|
-
return;
|
78
|
-
}
|
79
|
-
l.push(e), e.setAttribute("src", "");
|
80
|
-
var v = t ? le : ce;
|
81
|
-
v(f, u, function(j, r) {
|
82
|
-
if (!r) {
|
83
|
-
l.splice(l.indexOf(e), 1), e = null, a(j);
|
84
|
-
return;
|
85
|
-
}
|
86
|
-
var w = e.getAttribute("id");
|
87
|
-
w && r.setAttribute("id", w);
|
88
|
-
var S = e.getAttribute("title");
|
89
|
-
S && r.setAttribute("title", S);
|
90
|
-
var E = e.getAttribute("width");
|
91
|
-
E && r.setAttribute("width", E);
|
92
|
-
var y = e.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), (e.getAttribute("class") || "").split(" "), !0))).join(" ").trim();
|
95
|
-
r.setAttribute("class", G);
|
96
|
-
var b = e.getAttribute("style");
|
97
|
-
b && r.setAttribute("style", b), r.setAttribute("data-src", f);
|
98
|
-
var R = [].filter.call(e.attributes, function(s) {
|
99
|
-
return /^data-\w[\w-]*$/.test(s.name);
|
100
|
-
});
|
101
|
-
if (Array.prototype.forEach.call(R, function(s) {
|
102
|
-
s.name && s.value && r.setAttribute(s.name, s.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(s) {
|
117
|
-
C = s, m = h[s], d = r.querySelectorAll(C + "[id]");
|
118
|
-
for (var ne = function(I, me) {
|
119
|
-
T = d[I].id, k = T + "-" + pe();
|
120
|
-
var M;
|
121
|
-
Array.prototype.forEach.call(m, function(W) {
|
122
|
-
M = r.querySelectorAll("[" + W + '*="' + T + '"]');
|
123
|
-
for (var O = 0, ue = M.length; O < ue; 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, ae = U.length; N < ae; 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, oe = H.length; Q < oe; Q++)
|
133
|
-
H[Q].setAttributeNS(F, "href", "#" + k);
|
134
|
-
d[I].id = k;
|
135
|
-
}, _ = 0, ie = d.length; _ < ie; _++)
|
136
|
-
ne(_);
|
137
|
-
});
|
138
|
-
}
|
139
|
-
r.removeAttribute("xmlns:a");
|
140
|
-
for (var x = r.querySelectorAll("script"), L = [], V, q, A = 0, ee = x.length; A < ee; 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[f])) {
|
143
|
-
for (var X = 0, te = L.length; X < te; X++)
|
144
|
-
new Function(L[X])(window);
|
145
|
-
J[f] = !0;
|
146
|
-
}
|
147
|
-
var re = r.querySelectorAll("style");
|
148
|
-
if (Array.prototype.forEach.call(re, function(s) {
|
149
|
-
s.textContent += "";
|
150
|
-
}), r.setAttribute("xmlns", ve), r.setAttribute("xmlns:xlink", F), i(r), !e.parentNode) {
|
151
|
-
l.splice(l.indexOf(e), 1), e = null, a(new Error("Parent node is null"));
|
152
|
-
return;
|
153
|
-
}
|
154
|
-
e.parentNode.replaceChild(r, e), l.splice(l.indexOf(e), 1), e = null, a(null, r);
|
155
|
-
});
|
156
|
-
}, we = function(e, o) {
|
157
|
-
var n = o === void 0 ? {} : o, t = n.afterAll, u = t === void 0 ? function() {
|
158
|
-
} : t, i = n.afterEach, a = i === void 0 ? function() {
|
159
|
-
} : i, f = n.beforeEach, v = f === void 0 ? function() {
|
160
|
-
} : f, 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 (e && "length" in e)
|
162
|
-
for (var R = 0, h = 0, C = e.length; h < C; h++)
|
163
|
-
K(e[h], S, b, r, y, v, function(d, m) {
|
164
|
-
a(d, m), e && "length" in e && e.length === ++R && u(R);
|
165
|
-
});
|
166
|
-
else e ? K(e, S, b, r, y, v, function(d, m) {
|
167
|
-
a(d, m), u(1), e = null;
|
168
|
-
}) : u(0);
|
169
|
-
};
|
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
|
+
}
|
170
10
|
export {
|
171
|
-
|
11
|
+
e as default
|
172
12
|
};
|
173
13
|
//# sourceMappingURL=index153.js.map
|
package/dist/index153.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index153.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,IAAK,GAEjBC,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,eAA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AAUzD,GAAI;AACnD,MAAI0D,IAAK1D,MAAO,SAAS,CAAE,IAAGA,GAC5B2D,IAAKD,EAAG,UACRE,IAAWD,MAAO,SAAS,WAAY;AAAA,EAE3C,IAAQA,GACJE,IAAKH,EAAG,WACRI,IAAYD,MAAO,SAAS,WAAY;AAAA,EAE5C,IAAQA,GACJE,IAAKL,EAAG,YACR7C,IAAakD,MAAO,SAAS,WAAY;AAAA,EAE7C,IAAQA,GACJC,IAAKN,EAAG,eACR9C,IAAgBoD,MAAO,SAAS,KAAOA,GACvCC,IAAKP,EAAG,aACRhD,IAAcuD,MAAO,SAAS,UAAUA,GACxCC,IAAKR,EAAG,4BACRzE,IAA6BiF,MAAO,SAAS,KAAQA,GACrDC,IAAKT,EAAG,uBACR/C,IAAwBwD,MAAO,SAAS,KAAOA;AACjD,MAAIV,KAAY,YAAYA;AAE1B,aADIW,IAAmB,GACdtE,IAAI,GAAGuE,IAAIZ,EAAS,QAAQ3D,IAAIuE,GAAGvE;AAC1C,MAAAU,EAAciD,EAAS3D,CAAC,GAAGY,GAAaC,GAAuBC,GAAe3B,GAA4B4B,GAAY,SAAUtB,GAAOyB,GAAK;AAC1I,QAAA8C,EAAUvE,GAAOyB,CAAG,GAChByC,KAAY,YAAYA,KAAYA,EAAS,WAAW,EAAEW,KAC5DR,EAASQ,CAAgB;AAAA,MAEnC,CAAO;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,EACjB,CAAK,IAEDG,EAAS,CAAC;AAEd;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index153.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,CAAE,GAAE,eAAe,KAAKA,GAAG,CAAC,MAAMF,EAAE,CAAC,IAAIE,EAAE,CAAC;AAAA,IACpE;AACI,WAAOF;AAAA,EACR,GAAED,EAAS,MAAM,MAAM,SAAS;AACnC;","x_google_ignoreList":[0]}
|
package/dist/index154.js
CHANGED
@@ -1,14 +1,8 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
|
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;
|
1
|
+
import e from "./index157.js";
|
2
|
+
function p(o, t) {
|
3
|
+
o.prototype = Object.create(t.prototype), o.prototype.constructor = o, e(o, t);
|
4
|
+
}
|
11
5
|
export {
|
12
|
-
|
6
|
+
p as default
|
13
7
|
};
|
14
8
|
//# sourceMappingURL=index154.js.map
|
package/dist/index154.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index154.js","sources":["../node_modules/
|
1
|
+
{"version":3,"file":"index154.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/index155.js
CHANGED
@@ -1,9 +1,173 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
}
|
1
|
+
import { __spreadArray as D } from "./index158.js";
|
2
|
+
import { parse as fe } from "./index159.js";
|
3
|
+
var g = /* @__PURE__ */ new Map(), Y = function(e) {
|
4
|
+
return e.cloneNode(!0);
|
5
|
+
}, z = function() {
|
6
|
+
return window.location.protocol === "file:";
|
7
|
+
}, Z = function(e, o, n) {
|
8
|
+
var t = new XMLHttpRequest();
|
9
|
+
t.onreadystatechange = function() {
|
10
|
+
try {
|
11
|
+
if (!/\.svg/i.test(e) && t.readyState === 2) {
|
12
|
+
var u = t.getResponseHeader("Content-Type");
|
13
|
+
if (!u)
|
14
|
+
throw new Error("Content type not found");
|
15
|
+
var i = fe(u).type;
|
16
|
+
if (!(i === "image/svg+xml" || i === "text/plain"))
|
17
|
+
throw new Error("Invalid content type: ".concat(i));
|
18
|
+
}
|
19
|
+
if (t.readyState === 4) {
|
20
|
+
if (t.status === 404 || t.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: " + e);
|
22
|
+
if (t.status === 200 || z() && t.status === 0)
|
23
|
+
n(null, t);
|
24
|
+
else
|
25
|
+
throw new Error("There was a problem injecting the SVG: " + t.status + " " + t.statusText);
|
26
|
+
}
|
27
|
+
} catch (a) {
|
28
|
+
if (t.abort(), a instanceof Error)
|
29
|
+
n(a, t);
|
30
|
+
else
|
31
|
+
throw a;
|
32
|
+
}
|
33
|
+
}, t.open("GET", e), t.withCredentials = o, t.overrideMimeType && t.overrideMimeType("text/xml"), t.send();
|
34
|
+
}, p = {}, B = function(e, o) {
|
35
|
+
p[e] = p[e] || [], p[e].push(o);
|
36
|
+
}, se = function(e) {
|
37
|
+
for (var o = function(i, a) {
|
38
|
+
setTimeout(function() {
|
39
|
+
if (Array.isArray(p[e])) {
|
40
|
+
var f = g.get(e), v = p[e][i];
|
41
|
+
f instanceof SVGSVGElement && v(null, Y(f)), f instanceof Error && v(f), i === p[e].length - 1 && delete p[e];
|
42
|
+
}
|
43
|
+
}, 0);
|
44
|
+
}, n = 0, t = p[e].length; n < t; n++)
|
45
|
+
o(n);
|
46
|
+
}, le = function(e, o, n) {
|
47
|
+
if (g.has(e)) {
|
48
|
+
var t = g.get(e);
|
49
|
+
if (t === void 0) {
|
50
|
+
B(e, n);
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
if (t instanceof SVGSVGElement) {
|
54
|
+
n(null, Y(t));
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
g.set(e, void 0), B(e, n), Z(e, o, function(u, i) {
|
59
|
+
var a;
|
60
|
+
u ? g.set(e, u) : ((a = i.responseXML) === null || a === void 0 ? void 0 : a.documentElement) instanceof SVGSVGElement && g.set(e, i.responseXML.documentElement), se(e);
|
61
|
+
});
|
62
|
+
}, ce = function(e, o, n) {
|
63
|
+
Z(e, o, function(t, u) {
|
64
|
+
var i;
|
65
|
+
t ? n(t) : ((i = u.responseXML) === null || i === void 0 ? void 0 : i.documentElement) instanceof SVGSVGElement && n(null, u.responseXML.documentElement);
|
66
|
+
});
|
67
|
+
}, de = 0, pe = function() {
|
68
|
+
return ++de;
|
69
|
+
}, l = [], J = {}, ve = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xlink", K = function(e, o, n, t, u, i, a) {
|
70
|
+
var f = e.getAttribute("data-src") || e.getAttribute("src");
|
71
|
+
if (!f) {
|
72
|
+
a(new Error("Invalid data-src or src attribute"));
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
if (l.indexOf(e) !== -1) {
|
76
|
+
l.splice(l.indexOf(e), 1), e = null;
|
77
|
+
return;
|
78
|
+
}
|
79
|
+
l.push(e), e.setAttribute("src", "");
|
80
|
+
var v = t ? le : ce;
|
81
|
+
v(f, u, function(j, r) {
|
82
|
+
if (!r) {
|
83
|
+
l.splice(l.indexOf(e), 1), e = null, a(j);
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
var w = e.getAttribute("id");
|
87
|
+
w && r.setAttribute("id", w);
|
88
|
+
var S = e.getAttribute("title");
|
89
|
+
S && r.setAttribute("title", S);
|
90
|
+
var E = e.getAttribute("width");
|
91
|
+
E && r.setAttribute("width", E);
|
92
|
+
var y = e.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), (e.getAttribute("class") || "").split(" "), !0))).join(" ").trim();
|
95
|
+
r.setAttribute("class", G);
|
96
|
+
var b = e.getAttribute("style");
|
97
|
+
b && r.setAttribute("style", b), r.setAttribute("data-src", f);
|
98
|
+
var R = [].filter.call(e.attributes, function(s) {
|
99
|
+
return /^data-\w[\w-]*$/.test(s.name);
|
100
|
+
});
|
101
|
+
if (Array.prototype.forEach.call(R, function(s) {
|
102
|
+
s.name && s.value && r.setAttribute(s.name, s.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(s) {
|
117
|
+
C = s, m = h[s], d = r.querySelectorAll(C + "[id]");
|
118
|
+
for (var ne = function(I, me) {
|
119
|
+
T = d[I].id, k = T + "-" + pe();
|
120
|
+
var M;
|
121
|
+
Array.prototype.forEach.call(m, function(W) {
|
122
|
+
M = r.querySelectorAll("[" + W + '*="' + T + '"]');
|
123
|
+
for (var O = 0, ue = M.length; O < ue; 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, ae = U.length; N < ae; 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, oe = H.length; Q < oe; Q++)
|
133
|
+
H[Q].setAttributeNS(F, "href", "#" + k);
|
134
|
+
d[I].id = k;
|
135
|
+
}, _ = 0, ie = d.length; _ < ie; _++)
|
136
|
+
ne(_);
|
137
|
+
});
|
138
|
+
}
|
139
|
+
r.removeAttribute("xmlns:a");
|
140
|
+
for (var x = r.querySelectorAll("script"), L = [], V, q, A = 0, ee = x.length; A < ee; 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[f])) {
|
143
|
+
for (var X = 0, te = L.length; X < te; X++)
|
144
|
+
new Function(L[X])(window);
|
145
|
+
J[f] = !0;
|
146
|
+
}
|
147
|
+
var re = r.querySelectorAll("style");
|
148
|
+
if (Array.prototype.forEach.call(re, function(s) {
|
149
|
+
s.textContent += "";
|
150
|
+
}), r.setAttribute("xmlns", ve), r.setAttribute("xmlns:xlink", F), i(r), !e.parentNode) {
|
151
|
+
l.splice(l.indexOf(e), 1), e = null, a(new Error("Parent node is null"));
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
e.parentNode.replaceChild(r, e), l.splice(l.indexOf(e), 1), e = null, a(null, r);
|
155
|
+
});
|
156
|
+
}, we = function(e, o) {
|
157
|
+
var n = o === void 0 ? {} : o, t = n.afterAll, u = t === void 0 ? function() {
|
158
|
+
} : t, i = n.afterEach, a = i === void 0 ? function() {
|
159
|
+
} : i, f = n.beforeEach, v = f === void 0 ? function() {
|
160
|
+
} : f, 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 (e && "length" in e)
|
162
|
+
for (var R = 0, h = 0, C = e.length; h < C; h++)
|
163
|
+
K(e[h], S, b, r, y, v, function(d, m) {
|
164
|
+
a(d, m), e && "length" in e && e.length === ++R && u(R);
|
165
|
+
});
|
166
|
+
else e ? K(e, S, b, r, y, v, function(d, m) {
|
167
|
+
a(d, m), u(1), e = null;
|
168
|
+
}) : u(0);
|
169
|
+
};
|
6
170
|
export {
|
7
|
-
|
171
|
+
we as SVGInjector
|
8
172
|
};
|
9
173
|
//# sourceMappingURL=index155.js.map
|