grab-url 1.0.3 → 1.0.4
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/grab-api.cjs.js +1 -1
- package/dist/grab-api.cjs.js.map +1 -1
- package/dist/grab-api.d.ts +1 -1
- package/dist/grab-api.es.js +23 -28
- package/dist/grab-api.es.js.map +1 -1
- package/dist/icons.cjs.js +1 -1
- package/dist/icons.cjs.js.map +1 -1
- package/dist/icons.d.ts +0 -0
- package/dist/icons.es.js +113 -1
- package/dist/icons.es.js.map +1 -1
- package/package.json +3 -3
- package/readme.md +0 -0
- package/src/grab-api.ts +33 -39
- package/src/grab-url.js +19 -5
- package/src/icons/cli/spinners.json +0 -0
- package/src/icons/index.ts +0 -0
- package/src/icons/svg/index.ts +0 -0
- package/src/icons/svg/loading-bouncy-ball.svg +0 -0
- package/src/icons/svg/loading-double-ring.svg +0 -0
- package/src/icons/svg/loading-eclipse.svg +0 -0
- package/src/icons/svg/loading-ellipsis.svg +0 -0
- package/src/icons/svg/loading-floating-search.svg +0 -0
- package/src/icons/svg/loading-gears.svg +0 -0
- package/src/icons/svg/loading-infinity.svg +0 -0
- package/src/icons/svg/loading-orbital.svg +0 -0
- package/src/icons/svg/loading-pacman.svg +0 -0
- package/src/icons/svg/loading-pulse-bars.svg +0 -0
- package/src/icons/svg/loading-red-blue-ball.svg +0 -0
- package/src/icons/svg/loading-reload-arrow.svg +0 -0
- package/src/icons/svg/loading-ring.svg +0 -0
- package/src/icons/svg/loading-ripple.svg +0 -0
- package/src/icons/svg/loading-spinner-oval.svg +0 -0
- package/src/icons/svg/loading-spinner.svg +0 -0
- package/src/icons/svg/loading-square-blocks.svg +0 -0
- package/src/log.ts +1 -1
package/dist/icons.es.js
CHANGED
|
@@ -1,2 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
const loadingBouncyBall = (options = {}) => customSVG(
|
|
2
|
+
options,
|
|
3
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><circle fill="#e15b64" r="13" cy="23" cx="50"><animate values="23;77;23" keyTimes="0;0.5;1" keySplines="0.45 0 0.9 0.55;0 0.45 0.55 0.9" calcMode="spline" repeatCount="indefinite" dur="1s" attributeName="cy"></animate></circle><g></g></g></svg>`
|
|
4
|
+
);
|
|
5
|
+
const loadingDoubleRing = (options = {}) => customSVG(
|
|
6
|
+
options,
|
|
7
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#0099e5" stroke-width="8" r="32" cy="50" cx="50"><animateTransform values="0 50 50;360 50 50" keyTimes="0;1" repeatCount="indefinite" dur="1s" type="rotate" attributeName="transform"></animateTransform></circle><circle stroke-linecap="round" fill="none" stroke-dashoffset="36.12831551628262" stroke-dasharray="36.12831551628262 36.12831551628262" stroke="#ff4c4c" stroke-width="8" r="23" cy="50" cx="50"><animateTransform values="0 50 50;-360 50 50" keyTimes="0;1" repeatCount="indefinite" dur="1s" type="rotate" attributeName="transform"></animateTransform></circle><g></g></g></svg>`
|
|
8
|
+
);
|
|
9
|
+
const loadingEclipse = (options = {}) => customSVG(
|
|
10
|
+
options,
|
|
11
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block;"><g><path stroke="none" fill="#ffb900" d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50"><animateTransform values="0 50 51;360 50 51" keyTimes="0;1" repeatCount="indefinite" dur="1s" type="rotate" attributeName="transform"></animateTransform></path><g></g></g></svg>`
|
|
12
|
+
);
|
|
13
|
+
const loadingEllipsis = (options = {}) => customSVG(
|
|
14
|
+
options,
|
|
15
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block;"><g><circle fill="#d20962" r="10" cy="50" cx="84"><animate begin="0s" keySplines="0 0.5 0.5 1" values="10;0" keyTimes="0;1" calcMode="spline" dur="0.25s" repeatCount="indefinite" attributeName="r"></animate><animate begin="0s" values="#d20962;#00a78e;#7ac143;#f47721;#d20962" keyTimes="0;0.25;0.5;0.75;1" calcMode="discrete" dur="1s" repeatCount="indefinite" attributeName="fill"></animate></circle><circle fill="#d20962" r="10" cy="50" cx="16"><animate begin="0s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="0;0;10;10;10" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="r"></animate><animate begin="0s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="16;16;16;50;84" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="cx"></animate></circle><circle fill="#f47721" r="10" cy="50" cx="50"><animate begin="-0.25s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="0;0;10;10;10" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="r"></animate><animate begin="-0.25s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="16;16;16;50;84" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="cx"></animate></circle><circle fill="#7ac143" r="10" cy="50" cx="84"><animate begin="-0.5s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="0;0;10;10;10" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="r"></animate><animate begin="-0.5s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="16;16;16;50;84" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="cx"></animate></circle><circle fill="#00a78e" r="10" cy="50" cx="16"><animate begin="-0.75s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="0;0;10;10;10" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="r"></animate><animate begin="-0.75s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" values="16;16;16;50;84" keyTimes="0;0.25;0.5;0.75;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="cx"></animate></circle><g></g></g></svg>`
|
|
16
|
+
);
|
|
17
|
+
const loadingFloatingSearch = (options = {}) => customSVG(
|
|
18
|
+
options,
|
|
19
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="339" height="339" style="shape-rendering: auto; display: block; "><g><g transform="translate(50 50)"><g transform="scale(0.6)"><g transform="translate(-50 -50)"><g><animateTransform keyTimes="0;0.33;0.66;1" values="-20 -20;20 -20;0 20;-20 -20" dur="1s" repeatCount="indefinite" type="translate" attributeName="transform"></animateTransform><path d="M44.19 26.158c-4.817 0-9.345 1.876-12.751 5.282c-3.406 3.406-5.282 7.934-5.282 12.751 c0 4.817 1.876 9.345 5.282 12.751c3.406 3.406 7.934 5.282 12.751 5.282s9.345-1.876 12.751-5.282 c3.406-3.406 5.282-7.934 5.282-12.751c0-4.817-1.876-9.345-5.282-12.751C53.536 28.033 49.007 26.158 44.19 26.158z" fill="#9ccbfb"></path><path d="M78.712 72.492L67.593 61.373l-3.475-3.475c1.621-2.352 2.779-4.926 3.475-7.596c1.044-4.008 1.044-8.23 0-12.238 c-1.048-4.022-3.146-7.827-6.297-10.979C56.572 22.362 50.381 20 44.19 20C38 20 31.809 22.362 27.085 27.085 c-9.447 9.447-9.447 24.763 0 34.21C31.809 66.019 38 68.381 44.19 68.381c4.798 0 9.593-1.425 13.708-4.262l9.695 9.695 l4.899 4.899C73.351 79.571 74.476 80 75.602 80s2.251-0.429 3.11-1.288C80.429 76.994 80.429 74.209 78.712 72.492z M56.942 56.942 c-3.406 3.406-7.934 5.282-12.751 5.282s-9.345-1.876-12.751-5.282c-3.406-3.406-5.282-7.934-5.282-12.751 c0-4.817 1.876-9.345 5.282-12.751c3.406-3.406 7.934-5.282 12.751-5.282c4.817 0 9.345 1.876 12.751 5.282 c3.406 3.406 5.282 7.934 5.282 12.751C62.223 49.007 60.347 53.536 56.942 56.942z" fill="#0c13e9"></path></g></g></g></g><g></g></g></svg>`
|
|
20
|
+
);
|
|
21
|
+
const loadingGears = (options = {}) => customSVG(
|
|
22
|
+
options,
|
|
23
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><g transform="translate(50 50)"><g><animateTransform repeatCount="indefinite" dur="0.2s" keyTimes="0;1" values="0;45" type="rotate" attributeName="transform"></animateTransform><path fill="#fd5c63" d="M29.491524206117255 -5.5 L37.491524206117255 -5.5 L37.491524206117255 5.5 L29.491524206117255 5.5 A30 30 0 0 1 24.742744050198738 16.964569457146712 L24.742744050198738 16.964569457146712 L30.399598299691117 22.621423706639092 L22.621423706639096 30.399598299691114 L16.964569457146716 24.742744050198734 A30 30 0 0 1 5.5 29.491524206117255 L5.5 29.491524206117255 L5.5 37.491524206117255 L-5.499999999999997 37.491524206117255 L-5.499999999999997 29.491524206117255 A30 30 0 0 1 -16.964569457146705 24.742744050198738 L-16.964569457146705 24.742744050198738 L-22.621423706639085 30.399598299691117 L-30.399598299691117 22.621423706639092 L-24.742744050198738 16.964569457146712 A30 30 0 0 1 -29.491524206117255 5.500000000000009 L-29.491524206117255 5.500000000000009 L-37.491524206117255 5.50000000000001 L-37.491524206117255 -5.500000000000001 L-29.491524206117255 -5.500000000000002 A30 30 0 0 1 -24.742744050198738 -16.964569457146705 L-24.742744050198738 -16.964569457146705 L-30.399598299691117 -22.621423706639085 L-22.621423706639092 -30.399598299691117 L-16.964569457146712 -24.742744050198738 A30 30 0 0 1 -5.500000000000011 -29.491524206117255 L-5.500000000000011 -29.491524206117255 L-5.500000000000012 -37.491524206117255 L5.499999999999998 -37.491524206117255 L5.5 -29.491524206117255 A30 30 0 0 1 16.964569457146702 -24.74274405019874 L16.964569457146702 -24.74274405019874 L22.62142370663908 -30.39959829969112 L30.399598299691117 -22.6214237066391 L24.742744050198738 -16.964569457146716 A30 30 0 0 1 29.491524206117255 -5.500000000000013 M0 -20A20 20 0 1 0 0 20 A20 20 0 1 0 0 -20"></path></g></g><g></g></g></svg>`
|
|
24
|
+
);
|
|
25
|
+
const loadingInfinity = (options = {}) => customSVG(
|
|
26
|
+
options,
|
|
27
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block;"><g><path style="transform:scale(0.8);transform-origin:50px 50px" stroke-linecap="round" d="M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40 C88.6 30 95 43.3 95 50s-6.4 20-19.3 20C56.4 70 43.6 30 24.3 30z" stroke-dasharray="42.76482137044271 42.76482137044271" stroke-width="8" stroke="#0099e5" fill="none"><animate values="0;256.58892822265625" keyTimes="0;1" dur="1.7543859649122806s" repeatCount="indefinite" attributeName="stroke-dashoffset"></animate></path><g></g></g></svg>`
|
|
28
|
+
);
|
|
29
|
+
const loadingOrbital = (options = {}) => customSVG(
|
|
30
|
+
options,
|
|
31
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><g transform="translate(50,50)"><g transform="scale(0.7)"><circle fill="#e90c59" r="50" cy="0" cx="0"></circle><circle fill="#46dff0" r="15" cy="-28" cx="0"><animateTransform values="0 0 0;360 0 0" keyTimes="0;1" repeatCount="indefinite" dur="1s" type="rotate" attributeName="transform"></animateTransform></circle></g></g><g></g></g></svg>`
|
|
32
|
+
);
|
|
33
|
+
const loadingPacman = (options = {}) => customSVG(
|
|
34
|
+
options,
|
|
35
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><g><circle fill="#e15b64" r="4" cy="50" cx="60"><animate begin="-0.67s" keyTimes="0;1" values="95;35" dur="1s" repeatCount="indefinite" attributeName="cx"></animate><animate begin="-0.67s" keyTimes="0;0.2;1" values="0;1;1" dur="1s" repeatCount="indefinite" attributeName="fill-opacity"></animate></circle><circle fill="#e15b64" r="4" cy="50" cx="60"><animate begin="-0.33s" keyTimes="0;1" values="95;35" dur="1s" repeatCount="indefinite" attributeName="cx"></animate><animate begin="-0.33s" keyTimes="0;0.2;1" values="0;1;1" dur="1s" repeatCount="indefinite" attributeName="fill-opacity"></animate></circle><circle fill="#e15b64" r="4" cy="50" cx="60"><animate begin="0s" keyTimes="0;1" values="95;35" dur="1s" repeatCount="indefinite" attributeName="cx"></animate><animate begin="0s" keyTimes="0;0.2;1" values="0;1;1" dur="1s" repeatCount="indefinite" attributeName="fill-opacity"></animate></circle></g><g transform="translate(-15 0)"><path transform="rotate(90 50 50)" fill="#f8b26a" d="M50 50L20 50A30 30 0 0 0 80 50Z"></path><path fill="#f8b26a" d="M50 50L20 50A30 30 0 0 0 80 50Z"><animateTransform keyTimes="0;0.5;1" values="0 50 50;45 50 50;0 50 50" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform></path><path fill="#f8b26a" d="M50 50L20 50A30 30 0 0 1 80 50Z"><animateTransform keyTimes="0;0.5;1" values="0 50 50;-45 50 50;0 50 50" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform></path></g><g></g></g></svg>`
|
|
36
|
+
);
|
|
37
|
+
const loadingPulseBars = (options = {}) => customSVG(
|
|
38
|
+
options,
|
|
39
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><rect fill="#e15b64" height="40" width="15" y="30" x="17.5"><animate begin="-0.2s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" values="18;30;30" keyTimes="0;0.5;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="y"></animate><animate begin="-0.2s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" values="64;40;40" keyTimes="0;0.5;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="height"></animate></rect><rect fill="#f8b26a" height="40" width="15" y="30" x="42.5"><animate begin="-0.1s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" values="20.999999999999996;30;30" keyTimes="0;0.5;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="y"></animate><animate begin="-0.1s" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" values="58.00000000000001;40;40" keyTimes="0;0.5;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="height"></animate></rect><rect fill="#abbd81" height="40" width="15" y="30" x="67.5"><animate keySplines="0 0.5 0.5 1;0 0.5 0.5 1" values="20.999999999999996;30;30" keyTimes="0;0.5;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="y"></animate><animate keySplines="0 0.5 0.5 1;0 0.5 0.5 1" values="58.00000000000001;40;40" keyTimes="0;0.5;1" calcMode="spline" dur="1s" repeatCount="indefinite" attributeName="height"></animate></rect><g></g></g></svg>`
|
|
40
|
+
);
|
|
41
|
+
const loadingRedBlueBall = (options = {}) => customSVG(
|
|
42
|
+
options,
|
|
43
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><circle r="20" fill="#e90c59" cy="50" cx="30"><animate begin="-0.5s" values="30;70;30" keyTimes="0;0.5;1" dur="1s" repeatCount="indefinite" attributeName="cx"></animate></circle><circle r="20" fill="#0f3bc6" cy="50" cx="70"><animate begin="0s" values="30;70;30" keyTimes="0;0.5;1" dur="1s" repeatCount="indefinite" attributeName="cx"></animate></circle><circle r="20" fill="#e90c59" cy="50" cx="30"><animate begin="-0.5s" values="30;70;30" keyTimes="0;0.5;1" dur="1s" repeatCount="indefinite" attributeName="cx"></animate><animate repeatCount="indefinite" dur="1s" keyTimes="0;0.499;0.5;1" calcMode="discrete" values="0;0;1;1" attributeName="fill-opacity"></animate></circle><g></g></g></svg>`
|
|
44
|
+
);
|
|
45
|
+
const loadingReloadArrow = (options = {}) => customSVG(
|
|
46
|
+
options,
|
|
47
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><g><path stroke-width="12" stroke="#e1945b" fill="none" d="M50 15A35 35 0 1 0 74.74873734152916 25.251262658470843"></path><path fill="#e1945b" d="M49 3L49 27L61 15L49 3"></path><animateTransform keyTimes="0;1" values="0 50 50;360 50 50" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform></g><g></g></g></svg>`
|
|
48
|
+
);
|
|
49
|
+
const loadingRing = (options = {}) => customSVG(
|
|
50
|
+
options,
|
|
51
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#fe718d" stroke-width="8" r="32" cy="50" cx="50"><animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform></circle><g></g></g></svg>`
|
|
52
|
+
);
|
|
53
|
+
const loadingRipple = (options = {}) => customSVG(
|
|
54
|
+
options,
|
|
55
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block"><g><circle stroke-width="2" stroke="#cbb953" fill="none" r="0" cy="50" cx="50"><animate begin="0s" calcMode="spline" keySplines="0 0.2 0.8 1" keyTimes="0;1" values="0;40" dur="1s" repeatCount="indefinite" attributeName="r"></animate><animate begin="0s" calcMode="spline" keySplines="0.2 0 0.8 1" keyTimes="0;1" values="1;0" dur="1s" repeatCount="indefinite" attributeName="opacity"></animate></circle><circle stroke-width="2" stroke="#cbb953" fill="none" r="0" cy="50" cx="50"><animate begin="-0.5s" calcMode="spline" keySplines="0 0.2 0.8 1" keyTimes="0;1" values="0;40" dur="1s" repeatCount="indefinite" attributeName="r"></animate><animate begin="-0.5s" calcMode="spline" keySplines="0.2 0 0.8 1" keyTimes="0;1" values="1;0" dur="1s" repeatCount="indefinite" attributeName="opacity"></animate></circle><g></g></g></svg>`
|
|
56
|
+
);
|
|
57
|
+
const loadingSpinnerOval = (options = {}) => customSVG(
|
|
58
|
+
options,
|
|
59
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><g transform="rotate(0 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.9166666666666666s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(30 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.8333333333333334s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(60 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.75s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(90 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.6666666666666666s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(120 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.5833333333333334s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(150 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.5s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(180 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.4166666666666667s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(210 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.3333333333333333s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(240 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.25s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(270 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.16666666666666666s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(300 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="-0.08333333333333333s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g transform="rotate(330 50 50)"><rect fill="#0099e5" height="12" width="6" ry="6" rx="3" y="24" x="47"><animate repeatCount="indefinite" begin="0s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate></rect></g><g></g></g></svg>`
|
|
60
|
+
);
|
|
61
|
+
const loadingSpinner = (options = {}) => customSVG(
|
|
62
|
+
options,
|
|
63
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><g transform="translate(80,50)"><g transform="rotate(0)"><circle fill-opacity="1" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.875s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.875s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(71.21320343559643,71.21320343559643)"><g transform="rotate(45)"><circle fill-opacity="0.875" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.75s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.75s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(50,80)"><g transform="rotate(90)"><circle fill-opacity="0.75" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.625s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.625s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(28.786796564403577,71.21320343559643)"><g transform="rotate(135)"><circle fill-opacity="0.625" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.5s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.5s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(20,50.00000000000001)"><g transform="rotate(180)"><circle fill-opacity="0.5" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.375s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.375s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(28.78679656440357,28.786796564403577)"><g transform="rotate(225)"><circle fill-opacity="0.375" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.25s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.25s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(49.99999999999999,20)"><g transform="rotate(270)"><circle fill-opacity="0.25" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="-0.125s" type="scale" attributeName="transform"></animateTransform><animate begin="-0.125s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g transform="translate(71.21320343559643,28.78679656440357)"><g transform="rotate(315)"><circle fill-opacity="0.125" fill="#0099e5" r="6" cy="0" cx="0"><animateTransform repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.5 1.5;1 1" begin="0s" type="scale" attributeName="transform"></animateTransform><animate begin="0s" values="1;0" repeatCount="indefinite" dur="1s" keyTimes="0;1" attributeName="fill-opacity"></animate></circle></g></g><g></g></g></svg>`
|
|
64
|
+
);
|
|
65
|
+
const loadingSquareBlocks = (options = {}) => customSVG(
|
|
66
|
+
options,
|
|
67
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="200" height="200" style="shape-rendering: auto; display: block; "><g><rect fill="#e15b64" height="20" width="20" y="19" x="19"><animate calcMode="discrete" begin="0s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="19" x="40"><animate calcMode="discrete" begin="0.125s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="19" x="61"><animate calcMode="discrete" begin="0.25s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="40" x="19"><animate calcMode="discrete" begin="0.875s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="40" x="61"><animate calcMode="discrete" begin="0.375s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="61" x="19"><animate calcMode="discrete" begin="0.75s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="61" x="40"><animate calcMode="discrete" begin="0.625s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><rect fill="#e15b64" height="20" width="20" y="61" x="61"><animate calcMode="discrete" begin="0.5s" repeatCount="indefinite" dur="1s" keyTimes="0;0.125;1" values="#f8b26a;#e15b64;#e15b64" attributeName="fill"></animate></rect><g></g></g></svg>`
|
|
68
|
+
);
|
|
69
|
+
function customSVG(options, svgString) {
|
|
70
|
+
const { colors = [], width, height, size, raw = false } = options;
|
|
71
|
+
const widthMatch = svgString.match(/width="[^"]*"/);
|
|
72
|
+
const heightMatch = svgString.match(/height="[^"]*"/);
|
|
73
|
+
const finalWidth = size || width || (widthMatch == null ? void 0 : widthMatch[1]) || "100";
|
|
74
|
+
const finalHeight = size || height || (heightMatch == null ? void 0 : heightMatch[1]) || "100";
|
|
75
|
+
if (width || height || size) {
|
|
76
|
+
svgString = svgString.replace(/width="[^"]*"/, `width="${finalWidth}px"`);
|
|
77
|
+
svgString = svgString.replace(/height="[^"]*"/, `height="${finalHeight}px"`);
|
|
78
|
+
}
|
|
79
|
+
if (colors && colors.length > 0) {
|
|
80
|
+
const hexColorRegex = /#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}/g;
|
|
81
|
+
let colorIndex = 0;
|
|
82
|
+
svgString = svgString.replace(hexColorRegex, (match) => {
|
|
83
|
+
if (colorIndex < colors.length) {
|
|
84
|
+
const replacement = colors[colorIndex];
|
|
85
|
+
colorIndex++;
|
|
86
|
+
return (replacement == null ? void 0 : replacement.startsWith("#")) ? replacement : `#${replacement}`;
|
|
87
|
+
}
|
|
88
|
+
return match;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (!raw)
|
|
92
|
+
svgString = (width || height || size ? `<img width="${finalWidth}" height="${finalHeight}"` : "<img") + ` alt="icon" src="data:image/svg+xml;utf8,${encodeURIComponent(svgString)}" />`;
|
|
93
|
+
return svgString;
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
loadingBouncyBall,
|
|
97
|
+
loadingDoubleRing,
|
|
98
|
+
loadingEclipse,
|
|
99
|
+
loadingEllipsis,
|
|
100
|
+
loadingFloatingSearch,
|
|
101
|
+
loadingGears,
|
|
102
|
+
loadingInfinity,
|
|
103
|
+
loadingOrbital,
|
|
104
|
+
loadingPacman,
|
|
105
|
+
loadingPulseBars,
|
|
106
|
+
loadingRedBlueBall,
|
|
107
|
+
loadingReloadArrow,
|
|
108
|
+
loadingRing,
|
|
109
|
+
loadingRipple,
|
|
110
|
+
loadingSpinner,
|
|
111
|
+
loadingSpinnerOval,
|
|
112
|
+
loadingSquareBlocks
|
|
113
|
+
};
|
|
2
114
|
//# sourceMappingURL=icons.es.js.map
|
package/dist/icons.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"icons.es.js","sources":["../src/icons/svg/index.ts"],"sourcesContent":["// Do a Barrel Roll (auto-generated) index of SVG icons as JS exports, tree shaking to only the icons used.\n\n/**\n* Returns a customized SVG string for icon loading-bouncy-ball\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingBouncyBall({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingBouncyBall = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><circle fill=\"#e15b64\" r=\"13\" cy=\"23\" cx=\"50\"><animate values=\"23;77;23\" keyTimes=\"0;0.5;1\" keySplines=\"0.45 0 0.9 0.55;0 0.45 0.55 0.9\" calcMode=\"spline\" repeatCount=\"indefinite\" dur=\"1s\" attributeName=\"cy\"></animate></circle><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-double-ring\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingDoubleRing({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingDoubleRing = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><circle stroke-linecap=\"round\" fill=\"none\" stroke-dasharray=\"50.26548245743669 50.26548245743669\" stroke=\"#0099e5\" stroke-width=\"8\" r=\"32\" cy=\"50\" cx=\"50\"><animateTransform values=\"0 50 50;360 50 50\" keyTimes=\"0;1\" repeatCount=\"indefinite\" dur=\"1s\" type=\"rotate\" attributeName=\"transform\"></animateTransform></circle><circle stroke-linecap=\"round\" fill=\"none\" stroke-dashoffset=\"36.12831551628262\" stroke-dasharray=\"36.12831551628262 36.12831551628262\" stroke=\"#ff4c4c\" stroke-width=\"8\" r=\"23\" cy=\"50\" cx=\"50\"><animateTransform values=\"0 50 50;-360 50 50\" keyTimes=\"0;1\" repeatCount=\"indefinite\" dur=\"1s\" type=\"rotate\" attributeName=\"transform\"></animateTransform></circle><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-eclipse\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingEclipse({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingEclipse = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block;\"><g><path stroke=\"none\" fill=\"#ffb900\" d=\"M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50\"><animateTransform values=\"0 50 51;360 50 51\" keyTimes=\"0;1\" repeatCount=\"indefinite\" dur=\"1s\" type=\"rotate\" attributeName=\"transform\"></animateTransform></path><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-ellipsis\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingEllipsis({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingEllipsis = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block;\"><g><circle fill=\"#d20962\" r=\"10\" cy=\"50\" cx=\"84\"><animate begin=\"0s\" keySplines=\"0 0.5 0.5 1\" values=\"10;0\" keyTimes=\"0;1\" calcMode=\"spline\" dur=\"0.25s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"0s\" values=\"#d20962;#00a78e;#7ac143;#f47721;#d20962\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"discrete\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"fill\"></animate></circle><circle fill=\"#d20962\" r=\"10\" cy=\"50\" cx=\"16\"><animate begin=\"0s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"0;0;10;10;10\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"0s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"16;16;16;50;84\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate></circle><circle fill=\"#f47721\" r=\"10\" cy=\"50\" cx=\"50\"><animate begin=\"-0.25s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"0;0;10;10;10\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"-0.25s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"16;16;16;50;84\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate></circle><circle fill=\"#7ac143\" r=\"10\" cy=\"50\" cx=\"84\"><animate begin=\"-0.5s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"0;0;10;10;10\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"-0.5s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"16;16;16;50;84\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate></circle><circle fill=\"#00a78e\" r=\"10\" cy=\"50\" cx=\"16\"><animate begin=\"-0.75s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"0;0;10;10;10\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"-0.75s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1\" values=\"16;16;16;50;84\" keyTimes=\"0;0.25;0.5;0.75;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate></circle><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-floating-search\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 339)\n* @param {number} [options.height] - Height of the SVG (default: 339)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingFloatingSearch({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingFloatingSearch = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"339\" height=\"339\" style=\"shape-rendering: auto; display: block; \"><g><g transform=\"translate(50 50)\"><g transform=\"scale(0.6)\"><g transform=\"translate(-50 -50)\"><g><animateTransform keyTimes=\"0;0.33;0.66;1\" values=\"-20 -20;20 -20;0 20;-20 -20\" dur=\"1s\" repeatCount=\"indefinite\" type=\"translate\" attributeName=\"transform\"></animateTransform><path d=\"M44.19 26.158c-4.817 0-9.345 1.876-12.751 5.282c-3.406 3.406-5.282 7.934-5.282 12.751 c0 4.817 1.876 9.345 5.282 12.751c3.406 3.406 7.934 5.282 12.751 5.282s9.345-1.876 12.751-5.282 c3.406-3.406 5.282-7.934 5.282-12.751c0-4.817-1.876-9.345-5.282-12.751C53.536 28.033 49.007 26.158 44.19 26.158z\" fill=\"#9ccbfb\"></path><path d=\"M78.712 72.492L67.593 61.373l-3.475-3.475c1.621-2.352 2.779-4.926 3.475-7.596c1.044-4.008 1.044-8.23 0-12.238 c-1.048-4.022-3.146-7.827-6.297-10.979C56.572 22.362 50.381 20 44.19 20C38 20 31.809 22.362 27.085 27.085 c-9.447 9.447-9.447 24.763 0 34.21C31.809 66.019 38 68.381 44.19 68.381c4.798 0 9.593-1.425 13.708-4.262l9.695 9.695 l4.899 4.899C73.351 79.571 74.476 80 75.602 80s2.251-0.429 3.11-1.288C80.429 76.994 80.429 74.209 78.712 72.492z M56.942 56.942 c-3.406 3.406-7.934 5.282-12.751 5.282s-9.345-1.876-12.751-5.282c-3.406-3.406-5.282-7.934-5.282-12.751 c0-4.817 1.876-9.345 5.282-12.751c3.406-3.406 7.934-5.282 12.751-5.282c4.817 0 9.345 1.876 12.751 5.282 c3.406 3.406 5.282 7.934 5.282 12.751C62.223 49.007 60.347 53.536 56.942 56.942z\" fill=\"#0c13e9\"></path></g></g></g></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-gears\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingGears({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingGears = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><g transform=\"translate(50 50)\"><g><animateTransform repeatCount=\"indefinite\" dur=\"0.2s\" keyTimes=\"0;1\" values=\"0;45\" type=\"rotate\" attributeName=\"transform\"></animateTransform><path fill=\"#fd5c63\" d=\"M29.491524206117255 -5.5 L37.491524206117255 -5.5 L37.491524206117255 5.5 L29.491524206117255 5.5 A30 30 0 0 1 24.742744050198738 16.964569457146712 L24.742744050198738 16.964569457146712 L30.399598299691117 22.621423706639092 L22.621423706639096 30.399598299691114 L16.964569457146716 24.742744050198734 A30 30 0 0 1 5.5 29.491524206117255 L5.5 29.491524206117255 L5.5 37.491524206117255 L-5.499999999999997 37.491524206117255 L-5.499999999999997 29.491524206117255 A30 30 0 0 1 -16.964569457146705 24.742744050198738 L-16.964569457146705 24.742744050198738 L-22.621423706639085 30.399598299691117 L-30.399598299691117 22.621423706639092 L-24.742744050198738 16.964569457146712 A30 30 0 0 1 -29.491524206117255 5.500000000000009 L-29.491524206117255 5.500000000000009 L-37.491524206117255 5.50000000000001 L-37.491524206117255 -5.500000000000001 L-29.491524206117255 -5.500000000000002 A30 30 0 0 1 -24.742744050198738 -16.964569457146705 L-24.742744050198738 -16.964569457146705 L-30.399598299691117 -22.621423706639085 L-22.621423706639092 -30.399598299691117 L-16.964569457146712 -24.742744050198738 A30 30 0 0 1 -5.500000000000011 -29.491524206117255 L-5.500000000000011 -29.491524206117255 L-5.500000000000012 -37.491524206117255 L5.499999999999998 -37.491524206117255 L5.5 -29.491524206117255 A30 30 0 0 1 16.964569457146702 -24.74274405019874 L16.964569457146702 -24.74274405019874 L22.62142370663908 -30.39959829969112 L30.399598299691117 -22.6214237066391 L24.742744050198738 -16.964569457146716 A30 30 0 0 1 29.491524206117255 -5.500000000000013 M0 -20A20 20 0 1 0 0 20 A20 20 0 1 0 0 -20\"></path></g></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-infinity\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingInfinity({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingInfinity = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block;\"><g><path style=\"transform:scale(0.8);transform-origin:50px 50px\" stroke-linecap=\"round\" d=\"M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40 C88.6 30 95 43.3 95 50s-6.4 20-19.3 20C56.4 70 43.6 30 24.3 30z\" stroke-dasharray=\"42.76482137044271 42.76482137044271\" stroke-width=\"8\" stroke=\"#0099e5\" fill=\"none\"><animate values=\"0;256.58892822265625\" keyTimes=\"0;1\" dur=\"1.7543859649122806s\" repeatCount=\"indefinite\" attributeName=\"stroke-dashoffset\"></animate></path><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-orbital\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingOrbital({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingOrbital = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><g transform=\"translate(50,50)\"><g transform=\"scale(0.7)\"><circle fill=\"#e90c59\" r=\"50\" cy=\"0\" cx=\"0\"></circle><circle fill=\"#46dff0\" r=\"15\" cy=\"-28\" cx=\"0\"><animateTransform values=\"0 0 0;360 0 0\" keyTimes=\"0;1\" repeatCount=\"indefinite\" dur=\"1s\" type=\"rotate\" attributeName=\"transform\"></animateTransform></circle></g></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-pacman\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingPacman({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingPacman = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><g><circle fill=\"#e15b64\" r=\"4\" cy=\"50\" cx=\"60\"><animate begin=\"-0.67s\" keyTimes=\"0;1\" values=\"95;35\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate><animate begin=\"-0.67s\" keyTimes=\"0;0.2;1\" values=\"0;1;1\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"fill-opacity\"></animate></circle><circle fill=\"#e15b64\" r=\"4\" cy=\"50\" cx=\"60\"><animate begin=\"-0.33s\" keyTimes=\"0;1\" values=\"95;35\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate><animate begin=\"-0.33s\" keyTimes=\"0;0.2;1\" values=\"0;1;1\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"fill-opacity\"></animate></circle><circle fill=\"#e15b64\" r=\"4\" cy=\"50\" cx=\"60\"><animate begin=\"0s\" keyTimes=\"0;1\" values=\"95;35\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate><animate begin=\"0s\" keyTimes=\"0;0.2;1\" values=\"0;1;1\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"fill-opacity\"></animate></circle></g><g transform=\"translate(-15 0)\"><path transform=\"rotate(90 50 50)\" fill=\"#f8b26a\" d=\"M50 50L20 50A30 30 0 0 0 80 50Z\"></path><path fill=\"#f8b26a\" d=\"M50 50L20 50A30 30 0 0 0 80 50Z\"><animateTransform keyTimes=\"0;0.5;1\" values=\"0 50 50;45 50 50;0 50 50\" dur=\"1s\" repeatCount=\"indefinite\" type=\"rotate\" attributeName=\"transform\"></animateTransform></path><path fill=\"#f8b26a\" d=\"M50 50L20 50A30 30 0 0 1 80 50Z\"><animateTransform keyTimes=\"0;0.5;1\" values=\"0 50 50;-45 50 50;0 50 50\" dur=\"1s\" repeatCount=\"indefinite\" type=\"rotate\" attributeName=\"transform\"></animateTransform></path></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-pulse-bars\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingPulseBars({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingPulseBars = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><rect fill=\"#e15b64\" height=\"40\" width=\"15\" y=\"30\" x=\"17.5\"><animate begin=\"-0.2s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" values=\"18;30;30\" keyTimes=\"0;0.5;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"y\"></animate><animate begin=\"-0.2s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" values=\"64;40;40\" keyTimes=\"0;0.5;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"height\"></animate></rect><rect fill=\"#f8b26a\" height=\"40\" width=\"15\" y=\"30\" x=\"42.5\"><animate begin=\"-0.1s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" values=\"20.999999999999996;30;30\" keyTimes=\"0;0.5;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"y\"></animate><animate begin=\"-0.1s\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" values=\"58.00000000000001;40;40\" keyTimes=\"0;0.5;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"height\"></animate></rect><rect fill=\"#abbd81\" height=\"40\" width=\"15\" y=\"30\" x=\"67.5\"><animate keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" values=\"20.999999999999996;30;30\" keyTimes=\"0;0.5;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"y\"></animate><animate keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" values=\"58.00000000000001;40;40\" keyTimes=\"0;0.5;1\" calcMode=\"spline\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"height\"></animate></rect><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-red-blue-ball\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingRedBlueBall({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingRedBlueBall = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><circle r=\"20\" fill=\"#e90c59\" cy=\"50\" cx=\"30\"><animate begin=\"-0.5s\" values=\"30;70;30\" keyTimes=\"0;0.5;1\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate></circle><circle r=\"20\" fill=\"#0f3bc6\" cy=\"50\" cx=\"70\"><animate begin=\"0s\" values=\"30;70;30\" keyTimes=\"0;0.5;1\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate></circle><circle r=\"20\" fill=\"#e90c59\" cy=\"50\" cx=\"30\"><animate begin=\"-0.5s\" values=\"30;70;30\" keyTimes=\"0;0.5;1\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"cx\"></animate><animate repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.499;0.5;1\" calcMode=\"discrete\" values=\"0;0;1;1\" attributeName=\"fill-opacity\"></animate></circle><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-reload-arrow\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingReloadArrow({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingReloadArrow = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><g><path stroke-width=\"12\" stroke=\"#e1945b\" fill=\"none\" d=\"M50 15A35 35 0 1 0 74.74873734152916 25.251262658470843\"></path><path fill=\"#e1945b\" d=\"M49 3L49 27L61 15L49 3\"></path><animateTransform keyTimes=\"0;1\" values=\"0 50 50;360 50 50\" dur=\"1s\" repeatCount=\"indefinite\" type=\"rotate\" attributeName=\"transform\"></animateTransform></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-ring\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingRing({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingRing = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><circle stroke-linecap=\"round\" fill=\"none\" stroke-dasharray=\"50.26548245743669 50.26548245743669\" stroke=\"#fe718d\" stroke-width=\"8\" r=\"32\" cy=\"50\" cx=\"50\"><animateTransform values=\"0 50 50;360 50 50\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" type=\"rotate\" attributeName=\"transform\"></animateTransform></circle><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-ripple\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingRipple({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingRipple = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block\"><g><circle stroke-width=\"2\" stroke=\"#cbb953\" fill=\"none\" r=\"0\" cy=\"50\" cx=\"50\"><animate begin=\"0s\" calcMode=\"spline\" keySplines=\"0 0.2 0.8 1\" keyTimes=\"0;1\" values=\"0;40\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"0s\" calcMode=\"spline\" keySplines=\"0.2 0 0.8 1\" keyTimes=\"0;1\" values=\"1;0\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"opacity\"></animate></circle><circle stroke-width=\"2\" stroke=\"#cbb953\" fill=\"none\" r=\"0\" cy=\"50\" cx=\"50\"><animate begin=\"-0.5s\" calcMode=\"spline\" keySplines=\"0 0.2 0.8 1\" keyTimes=\"0;1\" values=\"0;40\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"r\"></animate><animate begin=\"-0.5s\" calcMode=\"spline\" keySplines=\"0.2 0 0.8 1\" keyTimes=\"0;1\" values=\"1;0\" dur=\"1s\" repeatCount=\"indefinite\" attributeName=\"opacity\"></animate></circle><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-spinner-oval\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingSpinnerOval({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingSpinnerOval = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><g transform=\"rotate(0 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.9166666666666666s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(30 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.8333333333333334s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(60 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.75s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(90 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.6666666666666666s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(120 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.5833333333333334s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(150 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.5s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(180 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.4166666666666667s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(210 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.3333333333333333s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(240 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.25s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(270 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.16666666666666666s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(300 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"-0.08333333333333333s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g transform=\"rotate(330 50 50)\"><rect fill=\"#0099e5\" height=\"12\" width=\"6\" ry=\"6\" rx=\"3\" y=\"24\" x=\"47\"><animate repeatCount=\"indefinite\" begin=\"0s\" dur=\"1s\" keyTimes=\"0;1\" values=\"1;0\" attributeName=\"opacity\"></animate></rect></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-spinner\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingSpinner({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingSpinner = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><g transform=\"translate(80,50)\"><g transform=\"rotate(0)\"><circle fill-opacity=\"1\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.875s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.875s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(71.21320343559643,71.21320343559643)\"><g transform=\"rotate(45)\"><circle fill-opacity=\"0.875\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.75s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.75s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(50,80)\"><g transform=\"rotate(90)\"><circle fill-opacity=\"0.75\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.625s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.625s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(28.786796564403577,71.21320343559643)\"><g transform=\"rotate(135)\"><circle fill-opacity=\"0.625\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.5s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.5s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(20,50.00000000000001)\"><g transform=\"rotate(180)\"><circle fill-opacity=\"0.5\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.375s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.375s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(28.78679656440357,28.786796564403577)\"><g transform=\"rotate(225)\"><circle fill-opacity=\"0.375\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.25s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.25s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(49.99999999999999,20)\"><g transform=\"rotate(270)\"><circle fill-opacity=\"0.25\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"-0.125s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"-0.125s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g transform=\"translate(71.21320343559643,28.78679656440357)\"><g transform=\"rotate(315)\"><circle fill-opacity=\"0.125\" fill=\"#0099e5\" r=\"6\" cy=\"0\" cx=\"0\"><animateTransform repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" values=\"1.5 1.5;1 1\" begin=\"0s\" type=\"scale\" attributeName=\"transform\"></animateTransform><animate begin=\"0s\" values=\"1;0\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;1\" attributeName=\"fill-opacity\"></animate></circle></g></g><g></g></g></svg>`);\n\n/**\n* Returns a customized SVG string for icon loading-square-blocks\n*\n* \n* @param {Object} options - Configuration options\n* @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n* @param {number} [options.width] - Width of the SVG (default: 200)\n* @param {number} [options.height] - Height of the SVG (default: 200)\n* @param {number} [options.size] - Size for both width and height\n* @example loadingSquareBlocks({ colors: ['#0099e5', '#ff4c4c'], size: 100 });\n* @returns {string} SVG string with applied customizations\n*/\nexport const loadingSquareBlocks = (options: LoadingOptions = {}) => customSVG(options, \n`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" width=\"200\" height=\"200\" style=\"shape-rendering: auto; display: block; \"><g><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"19\" x=\"19\"><animate calcMode=\"discrete\" begin=\"0s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"19\" x=\"40\"><animate calcMode=\"discrete\" begin=\"0.125s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"19\" x=\"61\"><animate calcMode=\"discrete\" begin=\"0.25s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"40\" x=\"19\"><animate calcMode=\"discrete\" begin=\"0.875s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"40\" x=\"61\"><animate calcMode=\"discrete\" begin=\"0.375s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"61\" x=\"19\"><animate calcMode=\"discrete\" begin=\"0.75s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"61\" x=\"40\"><animate calcMode=\"discrete\" begin=\"0.625s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><rect fill=\"#e15b64\" height=\"20\" width=\"20\" y=\"61\" x=\"61\"><animate calcMode=\"discrete\" begin=\"0.5s\" repeatCount=\"indefinite\" dur=\"1s\" keyTimes=\"0;0.125;1\" values=\"#f8b26a;#e15b64;#e15b64\" attributeName=\"fill\"></animate></rect><g></g></g></svg>`);\n\n/**\n * Shared utility function for processing SVG icons\n * @param {Object} options - Configuration options\n * @param {boolean} [options.raw] - Whether to return the raw SVG string or an img tag\n * @param {string[]} [options.colors] - Array of hex colors to replace existing colors\n * @param {number|string} [options.width] - Width of the SVG\n * @param {number|string} [options.height] - Height of the SVG\n * @param {number|string} [options.size] - Size for both width and height (overrides width/height)\n * @param {string} svgString - The original SVG content\n * @returns {string} SVG string with applied customizations\n */\nfunction customSVG( options: LoadingOptions, svgString: string) {\n const { colors = [], width, height, size, raw = false } = options;\n\n const widthMatch = svgString.match(/width=\"[^\"]*\"/);\n const heightMatch = svgString.match(/height=\"[^\"]*\"/);\n const finalWidth = size || width || widthMatch?.[1] || '100';\n const finalHeight = size || height || heightMatch?.[1] || '100';\n\n if (width || height || size) {\n svgString = svgString.replace(/width=\"[^\"]*\"/, `width=\"${finalWidth}px\"`);\n svgString = svgString.replace(/height=\"[^\"]*\"/, `height=\"${finalHeight}px\"`);\n }\n\n\n // If colors array is provided, replace hex colors in order of appearance\n if (colors && colors.length > 0) {\n const hexColorRegex = /#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}/g;\n let colorIndex = 0;\n \n svgString = svgString.replace(hexColorRegex, (match) => {\n if (colorIndex < colors.length) {\n const replacement = colors[colorIndex];\n colorIndex++;\n return replacement?.startsWith('#') ? replacement : `#${replacement}`;\n }\n return match; // Keep original color if no replacement available\n });\n }\n if (!raw) \n svgString = (width || height || size ? `<img width=\"${finalWidth}\" height=\"${finalHeight}\"` : '<img') + ` alt=\"icon\" src=\"data:image/svg+xml;utf8,${encodeURIComponent(svgString)}\" />`\n\n return svgString;\n}\ninterface LoadingOptions {\n /** Array of hex colors to replace existing colors, in order of appearance in SVG*/\n colors?: string[];\n /** Width of the SVG */\n width?: number;\n /** Height of the SVG */\n height?: number;\n /** Size for both width and height (overrides width/height) */\n size?: number;\n /** Whether to return the raw SVG string or an img tag */\n raw?: boolean;\n}\n"],"names":[],"mappings":"AAcO,MAAM,oBAAoB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC7E;AAA+Z;AAcxZ,MAAM,oBAAoB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC7E;AAA61B;AAct1B,MAAM,iBAAiB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC1E;AAA6a;AActa,MAAM,kBAAkB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC3E;AAAo+E;AAc79E,MAAM,wBAAwB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EACjF;AAA+iD;AAcxiD,MAAM,eAAe,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EACxE;AAAq9D;AAc98D,MAAM,kBAAkB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC3E;AAAwpB;AAcjpB,MAAM,iBAAiB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC1E;AAA+f;AAcxf,MAAM,gBAAgB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EACzE;AAA+oD;AAcxoD,MAAM,mBAAmB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC5E;AAA49C;AAcr9C,MAAM,qBAAqB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC9E;AAA+1B;AAcx1B,MAAM,qBAAqB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC9E;AAA2gB;AAcpgB,MAAM,cAAc,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EACvE;AAAyf;AAclf,MAAM,gBAAgB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EACzE;AAA49B;AAcr9B,MAAM,qBAAqB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC9E;AAAwiG;AAcjiG,MAAM,iBAAiB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC1E;AAAspH;AAc/oH,MAAM,sBAAsB,CAAC,UAA0B,CAAA,MAAO;AAAA,EAAU;AAAA,EAC/E;AAAo9D;AAap9D,SAAS,UAAW,SAAyB,WAAmB;AAC5D,QAAM,EAAE,SAAS,CAAA,GAAI,OAAO,QAAQ,MAAM,MAAM,MAAA,IAAU;AAE1D,QAAM,aAAa,UAAU,MAAM,eAAe;AAClD,QAAM,cAAc,UAAU,MAAM,gBAAgB;AACpD,QAAM,aAAa,QAAQ,UAAS,yCAAa,OAAM;AACvD,QAAM,cAAc,QAAQ,WAAU,2CAAc,OAAM;AAE1D,MAAI,SAAS,UAAU,MAAM;AACzB,gBAAY,UAAU,QAAQ,iBAAiB,UAAU,UAAU,KAAK;AACxE,gBAAY,UAAU,QAAQ,kBAAkB,WAAW,WAAW,KAAK;AAAA,EAC/E;AAIA,MAAI,UAAU,OAAO,SAAS,GAAG;AAC7B,UAAM,gBAAgB;AACtB,QAAI,aAAa;AAEjB,gBAAY,UAAU,QAAQ,eAAe,CAAC,UAAU;AACpD,UAAI,aAAa,OAAO,QAAQ;AAC5B,cAAM,cAAc,OAAO,UAAU;AACrC;AACA,gBAAO,2CAAa,WAAW,QAAO,cAAc,IAAI,WAAW;AAAA,MACvE;AACA,aAAO;AAAA,IACX,CAAC;AAAA,EACL;AACA,MAAI,CAAC;AACD,iBAAa,SAAS,UAAU,OAAO,eAAe,UAAU,aAAa,WAAW,MAAM,UAAU,4CAA4C,mBAAmB,SAAS,CAAC;AAErL,SAAO;AACX;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "grab-url",
|
|
3
3
|
"description": "📥 Generate Request to API from Browser",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"author": "vtempest",
|
|
7
7
|
"license": "rights.institute/prosper",
|
|
8
8
|
"repository": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"down": "bun test command.test.js",
|
|
44
44
|
"make": "npm run make:icons; npm run make:docs; npm run make:main",
|
|
45
|
-
"make:docs": "cd docs
|
|
45
|
+
"make:docs": "cd docs && npm run build",
|
|
46
46
|
"make:icons": "npx export-svg-typescript@latest -i ./src/icons/svg -o ./src/icons/svg/index.ts",
|
|
47
47
|
"make:main": "vite build",
|
|
48
48
|
"ship": "npx standard-version --release-as patch; npm publish",
|
|
49
49
|
"check": "vitest --ui",
|
|
50
|
-
"docs": "cd docs
|
|
50
|
+
"docs": "cd docs && npm run start"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@vitest/ui": "^3.1.4",
|
package/readme.md
CHANGED
|
File without changes
|
package/src/grab-api.ts
CHANGED
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
/**
|
|
22
22
|
* ### GRAB: Generate Request to API from Browser
|
|
23
23
|
* 
|
|
24
|
-
*
|
|
25
|
-
* 1. **GRAB is the FBEST Request Manager: Functionally Brilliant, Elegantly Simple Tool**: One Function, no dependencies,
|
|
24
|
+
*
|
|
25
|
+
* 1. **GRAB is the FBEST Request Manager: Functionally Brilliant, Elegantly Simple Tool**: One Function, no dependencies,
|
|
26
26
|
* minimalist syntax, [more features than alternatives](https://grab.js.org/guide/Comparisons)
|
|
27
27
|
* 2. **Auto-JSON Convert**: Pass parameters and get response or error in JSON, handling other data types as is.
|
|
28
28
|
* 3. **isLoading Status**: Sets `.isLoading=true` on the pre-initialized response object so you can show a "Loading..." in any framework
|
|
@@ -141,8 +141,7 @@ export default async function grab<TResponse = any, TParams = any>(
|
|
|
141
141
|
let s = (t) => path.startsWith(t);
|
|
142
142
|
if (s("http:") || s("https:")) baseURL = "";
|
|
143
143
|
else if (!s("/") && !baseURL.endsWith("/")) path = "/" + path;
|
|
144
|
-
else if (s("/") && baseURL.endsWith("/")) path = path.slice(1)
|
|
145
|
-
|
|
144
|
+
else if (s("/") && baseURL.endsWith("/")) path = path.slice(1);
|
|
146
145
|
|
|
147
146
|
try {
|
|
148
147
|
//handle debounce
|
|
@@ -203,39 +202,35 @@ export default async function grab<TResponse = any, TParams = any>(
|
|
|
203
202
|
|
|
204
203
|
// Configure infinite scroll behavior if enabled
|
|
205
204
|
// Attaches scroll listener to specified element that triggers next page load
|
|
206
|
-
if (infiniteScroll?.length && typeof window
|
|
205
|
+
if (infiniteScroll?.length && typeof window !== "undefined") {
|
|
207
206
|
let paginateDOM =
|
|
208
207
|
typeof paginateElement === "string"
|
|
209
208
|
? document.querySelector(paginateElement)
|
|
210
209
|
: paginateElement;
|
|
211
210
|
|
|
212
|
-
if (
|
|
213
|
-
paginateDOM.removeEventListener(
|
|
211
|
+
if (window.scrollListener)
|
|
212
|
+
paginateDOM.removeEventListener("scroll", window.scrollListener);
|
|
213
|
+
|
|
214
|
+
// Your modified scroll listener with position saving
|
|
215
|
+
window.scrollListener = async (event) => {
|
|
216
|
+
const t = event.target as HTMLElement;
|
|
217
|
+
|
|
218
|
+
// Save scroll position whenever user scrolls
|
|
219
|
+
localStorage.setItem(
|
|
214
220
|
"scroll",
|
|
215
|
-
(
|
|
221
|
+
JSON.stringify([t.scrollTop, t.scrollLeft, paginateElement])
|
|
216
222
|
);
|
|
217
223
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
localStorage.setItem(
|
|
226
|
-
"scroll",
|
|
227
|
-
JSON.stringify([t.scrollTop, t.scrollLeft, paginateElement])
|
|
228
|
-
);
|
|
229
|
-
|
|
230
|
-
if (t.scrollHeight - t.scrollTop <= t.clientHeight + 200) {
|
|
231
|
-
await grab(path, {
|
|
232
|
-
...options,
|
|
233
|
-
cache: false,
|
|
234
|
-
[paginateKey]: priorRequest?.currentPage + 1,
|
|
235
|
-
});
|
|
236
|
-
}
|
|
224
|
+
if (t.scrollHeight - t.scrollTop <= t.clientHeight + 200) {
|
|
225
|
+
await grab(path, {
|
|
226
|
+
...options,
|
|
227
|
+
cache: false,
|
|
228
|
+
[paginateKey]: priorRequest?.currentPage + 1,
|
|
229
|
+
});
|
|
237
230
|
}
|
|
238
|
-
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
paginateDOM.addEventListener("scroll", window.scrollListener);
|
|
239
234
|
}
|
|
240
235
|
|
|
241
236
|
// Check request history for a previous request with same path/params
|
|
@@ -452,23 +447,21 @@ export default async function grab<TResponse = any, TParams = any>(
|
|
|
452
447
|
? [...response[key], ...res[key]]
|
|
453
448
|
: res[key];
|
|
454
449
|
|
|
455
|
-
|
|
450
|
+
if (typeof response !== "undefined") response.data = res; // for axios compat
|
|
456
451
|
} else if (resFunction) resFunction({ data: res, ...res });
|
|
457
452
|
else if (typeof response === "object") response.data = res;
|
|
458
|
-
|
|
459
453
|
|
|
460
|
-
|
|
461
454
|
// Store request/response in history log
|
|
462
455
|
if (typeof grab.log != "undefined")
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
456
|
+
grab.log?.unshift({
|
|
457
|
+
path,
|
|
458
|
+
request: JSON.stringify({ ...params, paginateKey: undefined }),
|
|
459
|
+
response,
|
|
460
|
+
lastFetchTime: Date.now(),
|
|
461
|
+
});
|
|
462
|
+
|
|
470
463
|
if (resFunction) response = resFunction(response);
|
|
471
|
-
|
|
464
|
+
|
|
472
465
|
return response;
|
|
473
466
|
} catch (error) {
|
|
474
467
|
// Handle any errors that occurred during request processing
|
|
@@ -765,6 +758,7 @@ declare global {
|
|
|
765
758
|
interface Window {
|
|
766
759
|
grab: GrabFunction;
|
|
767
760
|
log: LogFunction;
|
|
761
|
+
scrollListener: (event: Event) => void; // replace 'any' with the actual type if you know it (e.g., a function type)
|
|
768
762
|
}
|
|
769
763
|
|
|
770
764
|
// Node.js globals
|
package/src/grab-url.js
CHANGED
|
@@ -8,10 +8,10 @@ import cliProgress from 'cli-progress';
|
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import Table from 'cli-table3';
|
|
11
|
-
import grab, { log } from './grab-api
|
|
11
|
+
import grab, { log } from './grab-api';
|
|
12
12
|
import readline from 'readline';
|
|
13
13
|
import { readFileSync } from 'fs';
|
|
14
|
-
import { fileURLToPath } from 'url';
|
|
14
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
15
15
|
import { dirname, join } from 'path';
|
|
16
16
|
|
|
17
17
|
// Try multiple possible paths for spinners.json
|
|
@@ -1908,10 +1908,21 @@ resumeAll() {
|
|
|
1908
1908
|
|
|
1909
1909
|
// --- Main CLI logic ---
|
|
1910
1910
|
// Only run CLI when this file is executed directly, not when imported
|
|
1911
|
-
|
|
1911
|
+
const __isMain = (typeof import.meta.main === 'boolean' && import.meta.main) || (() => {
|
|
1912
|
+
try {
|
|
1913
|
+
const scriptArg = process.argv[1] ? path.resolve(process.argv[1]) : '';
|
|
1914
|
+
if (!scriptArg) return false;
|
|
1915
|
+
const href = pathToFileURL(scriptArg).href;
|
|
1916
|
+
return import.meta.url === href;
|
|
1917
|
+
} catch {
|
|
1918
|
+
return false;
|
|
1919
|
+
}
|
|
1920
|
+
})();
|
|
1921
|
+
|
|
1922
|
+
if (__isMain) {
|
|
1912
1923
|
const argv = new ArgParser()
|
|
1913
|
-
.usage('Usage: grab-url <url
|
|
1914
|
-
.command('$0 <url>', 'Fetch data
|
|
1924
|
+
.usage('Usage: grab-url <url...> [options]')
|
|
1925
|
+
.command('$0 <url>', 'Fetch data or download files; pass one or more URLs')
|
|
1915
1926
|
.option('no-save', {
|
|
1916
1927
|
type: 'boolean',
|
|
1917
1928
|
default: false,
|
|
@@ -1934,6 +1945,9 @@ if (import.meta.url === `file://${process.argv[1]}`) {
|
|
|
1934
1945
|
})
|
|
1935
1946
|
.help()
|
|
1936
1947
|
.alias('h', 'help')
|
|
1948
|
+
.example('grab-url https://api.example.com/data', 'Fetch JSON/text from an API and save to output.json')
|
|
1949
|
+
.example('grab-url https://example.com/file1.zip https://example.com/file2.zip', 'Download multiple files concurrently')
|
|
1950
|
+
.example('grab-url https://example.com/file.iso -o ubuntu.iso', 'Save the first URL to a custom filename')
|
|
1937
1951
|
.version('1.0.0')
|
|
1938
1952
|
.strict()
|
|
1939
1953
|
.parseSync();
|
|
File without changes
|
package/src/icons/index.ts
CHANGED
|
File without changes
|
package/src/icons/svg/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|