@hanzogui/animate 3.0.2 → 7.0.0
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/package.json +8 -8
- package/types/Animate.d.ts +1 -1
- package/dist/cjs/Animate.cjs +0 -66
- package/dist/cjs/Animate.native.js +0 -70
- package/dist/cjs/Animate.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -18
- package/dist/cjs/index.native.js +0 -21
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/esm/Animate.mjs +0 -43
- package/dist/esm/Animate.mjs.map +0 -1
- package/dist/esm/Animate.native.js +0 -44
- package/dist/esm/Animate.native.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -2
- package/dist/esm/index.native.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/animate",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "
|
|
35
|
-
"watch": "
|
|
36
|
-
"clean": "
|
|
37
|
-
"clean:build": "
|
|
34
|
+
"build": "hanzogui-build",
|
|
35
|
+
"watch": "hanzogui-build --watch",
|
|
36
|
+
"clean": "hanzogui-build clean",
|
|
37
|
+
"clean:build": "hanzogui-build clean:build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hanzogui/animate-presence": "
|
|
40
|
+
"@hanzogui/animate-presence": "^7.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@hanzogui/build": "
|
|
43
|
+
"@hanzogui/build": "^7.0.0",
|
|
44
44
|
"react": ">=19"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=19"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
package/types/Animate.d.ts
CHANGED
package/dist/cjs/Animate.cjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: !0
|
|
9
|
-
});
|
|
10
|
-
},
|
|
11
|
-
__copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
-
get: () => from[key],
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value: !0
|
|
20
|
-
}), mod);
|
|
21
|
-
var Animate_exports = {};
|
|
22
|
-
__export(Animate_exports, {
|
|
23
|
-
Animate: () => Animate
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Animate_exports);
|
|
26
|
-
var import_gui_animate_presence = require("@hanzogui/animate-presence"),
|
|
27
|
-
import_react = require("react"),
|
|
28
|
-
import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
function Animate({
|
|
30
|
-
children,
|
|
31
|
-
lazyMount,
|
|
32
|
-
type,
|
|
33
|
-
present,
|
|
34
|
-
passThrough,
|
|
35
|
-
...props
|
|
36
|
-
}) {
|
|
37
|
-
const [lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? !1 : present);
|
|
38
|
-
(0, import_react.useEffect)(() => {
|
|
39
|
-
passThrough || lazyMount && present && (0, import_react.startTransition)(() => {
|
|
40
|
-
setLazyMounted(present);
|
|
41
|
-
});
|
|
42
|
-
}, [lazyMount, present]);
|
|
43
|
-
const mounted = present ? lazyMount ? lazyMounted : present : !1;
|
|
44
|
-
return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_animate_presence.PresenceChild, {
|
|
45
|
-
isPresent: !0,
|
|
46
|
-
...(!passThrough && {
|
|
47
|
-
initial: props.initial ? void 0 : !1,
|
|
48
|
-
onExitComplete: props.onExitComplete,
|
|
49
|
-
enterVariant: props.enterVariant,
|
|
50
|
-
exitVariant: props.exitVariant,
|
|
51
|
-
enterExitVariant: props.enterExitVariant,
|
|
52
|
-
// BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
|
|
53
|
-
// but since we always re-render this component on open changes this should be fine to leave off?
|
|
54
|
-
presenceAffectsLayout: !1,
|
|
55
|
-
isPresent: present,
|
|
56
|
-
custom: props.custom
|
|
57
|
-
}),
|
|
58
|
-
children
|
|
59
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_animate_presence.AnimatePresence, {
|
|
60
|
-
passThrough,
|
|
61
|
-
...props,
|
|
62
|
-
children: mounted || passThrough ? children : null
|
|
63
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
64
|
-
children
|
|
65
|
-
});
|
|
66
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: !0
|
|
11
|
-
});
|
|
12
|
-
},
|
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
-
get: () => from[key],
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var Animate_exports = {};
|
|
24
|
-
__export(Animate_exports, {
|
|
25
|
-
Animate: () => Animate
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(Animate_exports);
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
29
|
-
import_gui_animate_presence = require("@hanzogui/animate-presence"),
|
|
30
|
-
import_react = require("react");
|
|
31
|
-
function Animate(param) {
|
|
32
|
-
var {
|
|
33
|
-
children,
|
|
34
|
-
lazyMount,
|
|
35
|
-
type,
|
|
36
|
-
present,
|
|
37
|
-
passThrough,
|
|
38
|
-
...props
|
|
39
|
-
} = param,
|
|
40
|
-
[lazyMounted, setLazyMounted] = (0, import_react.useState)(lazyMount ? !1 : present);
|
|
41
|
-
(0, import_react.useEffect)(function () {
|
|
42
|
-
passThrough || lazyMount && present && (0, import_react.startTransition)(function () {
|
|
43
|
-
setLazyMounted(present);
|
|
44
|
-
});
|
|
45
|
-
}, [lazyMount, present]);
|
|
46
|
-
var mounted = present ? lazyMount ? lazyMounted : present : !1;
|
|
47
|
-
return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_animate_presence.PresenceChild, {
|
|
48
|
-
isPresent: !0,
|
|
49
|
-
...(!passThrough && {
|
|
50
|
-
initial: props.initial ? void 0 : !1,
|
|
51
|
-
onExitComplete: props.onExitComplete,
|
|
52
|
-
enterVariant: props.enterVariant,
|
|
53
|
-
exitVariant: props.exitVariant,
|
|
54
|
-
enterExitVariant: props.enterExitVariant,
|
|
55
|
-
// BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
|
|
56
|
-
// but since we always re-render this component on open changes this should be fine to leave off?
|
|
57
|
-
presenceAffectsLayout: !1,
|
|
58
|
-
isPresent: present,
|
|
59
|
-
custom: props.custom
|
|
60
|
-
}),
|
|
61
|
-
children
|
|
62
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_animate_presence.AnimatePresence, {
|
|
63
|
-
passThrough,
|
|
64
|
-
...props,
|
|
65
|
-
children: mounted || passThrough ? children : null
|
|
66
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
67
|
-
children
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=Animate.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Animate_exports","__export","Animate","module","exports","import_jsx_runtime","require","import_gui_animate_presence","import_react","param","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","useState","useEffect","startTransition","mounted","keepChildrenMounted","jsx","PresenceChild","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom","AnimatePresence","Fragment"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAA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cL,QAChB,EAAAW,OAAA,IAAAP,WAAA,GAAAJ,QAAA;EAAA,KAEC,mBAAAL,kBAAA,CAAAkB,GAAA,EAAAlB,kBAAA,CAAA6B,QAAA;IAAAxB;EACH;AAYR","ignoreList":[]}
|
package/dist/cjs/index.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
-
get: () => from[key],
|
|
8
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
-
});
|
|
10
|
-
return to;
|
|
11
|
-
},
|
|
12
|
-
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
-
value: !0
|
|
15
|
-
}), mod);
|
|
16
|
-
var index_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(index_exports);
|
|
18
|
-
__reExport(index_exports, require("./Animate.cjs"), module.exports);
|
package/dist/cjs/index.native.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
-
get: () => from[key],
|
|
10
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
-
});
|
|
12
|
-
return to;
|
|
13
|
-
},
|
|
14
|
-
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: !0
|
|
17
|
-
}), mod);
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./Animate.native.js"), module.exports);
|
|
21
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
|
package/dist/esm/Animate.mjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AnimatePresence, PresenceChild } from "@hanzogui/animate-presence";
|
|
2
|
-
import { startTransition, useEffect, useState } from "react";
|
|
3
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
-
function Animate({
|
|
5
|
-
children,
|
|
6
|
-
lazyMount,
|
|
7
|
-
type,
|
|
8
|
-
present,
|
|
9
|
-
passThrough,
|
|
10
|
-
...props
|
|
11
|
-
}) {
|
|
12
|
-
const [lazyMounted, setLazyMounted] = useState(lazyMount ? !1 : present);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
passThrough || lazyMount && present && startTransition(() => {
|
|
15
|
-
setLazyMounted(present);
|
|
16
|
-
});
|
|
17
|
-
}, [lazyMount, present]);
|
|
18
|
-
const mounted = present ? lazyMount ? lazyMounted : present : !1;
|
|
19
|
-
return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */jsx(PresenceChild, {
|
|
20
|
-
isPresent: !0,
|
|
21
|
-
...(!passThrough && {
|
|
22
|
-
initial: props.initial ? void 0 : !1,
|
|
23
|
-
onExitComplete: props.onExitComplete,
|
|
24
|
-
enterVariant: props.enterVariant,
|
|
25
|
-
exitVariant: props.exitVariant,
|
|
26
|
-
enterExitVariant: props.enterExitVariant,
|
|
27
|
-
// BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
|
|
28
|
-
// but since we always re-render this component on open changes this should be fine to leave off?
|
|
29
|
-
presenceAffectsLayout: !1,
|
|
30
|
-
isPresent: present,
|
|
31
|
-
custom: props.custom
|
|
32
|
-
}),
|
|
33
|
-
children
|
|
34
|
-
}) : /* @__PURE__ */jsx(AnimatePresence, {
|
|
35
|
-
passThrough,
|
|
36
|
-
...props,
|
|
37
|
-
children: mounted || passThrough ? children : null
|
|
38
|
-
}) : /* @__PURE__ */jsx(Fragment, {
|
|
39
|
-
children
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
export { Animate };
|
|
43
|
-
//# sourceMappingURL=Animate.mjs.map
|
package/dist/esm/Animate.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatePresence","PresenceChild","startTransition","useEffect","useState","Fragment","jsx","Animate","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","mounted","keepChildrenMounted","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,eAAA,EAAiBC,aAAA,QAAqB;AAC/C,SAASC,eAAA,EAAiBC,SAAA,EAAWC,QAAA,Q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x-runtime";
|
|
2
|
-
import { AnimatePresence, PresenceChild } from "@hanzogui/animate-presence";
|
|
3
|
-
import { startTransition, useEffect, useState } from "react";
|
|
4
|
-
function Animate(param) {
|
|
5
|
-
var {
|
|
6
|
-
children,
|
|
7
|
-
lazyMount,
|
|
8
|
-
type,
|
|
9
|
-
present,
|
|
10
|
-
passThrough,
|
|
11
|
-
...props
|
|
12
|
-
} = param,
|
|
13
|
-
[lazyMounted, setLazyMounted] = useState(lazyMount ? !1 : present);
|
|
14
|
-
useEffect(function () {
|
|
15
|
-
passThrough || lazyMount && present && startTransition(function () {
|
|
16
|
-
setLazyMounted(present);
|
|
17
|
-
});
|
|
18
|
-
}, [lazyMount, present]);
|
|
19
|
-
var mounted = present ? lazyMount ? lazyMounted : present : !1;
|
|
20
|
-
return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */_jsx(PresenceChild, {
|
|
21
|
-
isPresent: !0,
|
|
22
|
-
...(!passThrough && {
|
|
23
|
-
initial: props.initial ? void 0 : !1,
|
|
24
|
-
onExitComplete: props.onExitComplete,
|
|
25
|
-
enterVariant: props.enterVariant,
|
|
26
|
-
exitVariant: props.exitVariant,
|
|
27
|
-
enterExitVariant: props.enterExitVariant,
|
|
28
|
-
// BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
|
|
29
|
-
// but since we always re-render this component on open changes this should be fine to leave off?
|
|
30
|
-
presenceAffectsLayout: !1,
|
|
31
|
-
isPresent: present,
|
|
32
|
-
custom: props.custom
|
|
33
|
-
}),
|
|
34
|
-
children
|
|
35
|
-
}) : /* @__PURE__ */_jsx(AnimatePresence, {
|
|
36
|
-
passThrough,
|
|
37
|
-
...props,
|
|
38
|
-
children: mounted || passThrough ? children : null
|
|
39
|
-
}) : /* @__PURE__ */_jsx(_Fragment, {
|
|
40
|
-
children
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
export { Animate };
|
|
44
|
-
//# sourceMappingURL=Animate.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","Fragment","_Fragment","AnimatePresence","PresenceChild","startTransition","useEffect","useState","Animate","param","children","lazyMount","type","present","passThrough","props","lazyMounted","setLazyMounted","mounted","keepChildrenMounted","isPresent","initial","onExitComplete","enterVariant","exitVariant","enterExitVariant","presenceAffectsLayout","custom"],"sources":["../../src/Animate.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,EAAAC,QAAiB,IAAAC,SAAA,QAAqB;AAC/C,SAASC,eAAA,EAAiBC,aAAW,qCAAgB;AA4D7C,SA2BCC,eA3BD,EAAAC,SAAA,EAAAC,QAAA;AAzBD,SAASC,QAAQC,KAAA;EACtB;MAAAC,QAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,OAAA;MAAAC,WAAA;MAAA,GAAAC;IAAA,IAAAN,KAAA;IAAA,CAAAO,WAAA,EAAAC,cAAA,IAAAV,QAAA,CAAAI,SAAA,QAAAE,OAAA;EACAP,SAAA;IACAQ,WAAA,IAAAH,SAAA,IAAAE,OAAA,IAAAR,eAAA;MACAY,cAAA,CAAAJ,OAAA;IACA;EACA,GAAG,CAC6BF,SAAA,EAChCE,OAAO,CAEP;EACE,IAAIK,OAAA,GAAAL,OACC,GAAAF,SACA,GAAAK,WACL,GAAAH,OAAgB;EACd,OAAAD,IAAA,eAAsB,GAAAG,KAAA,CAAAI,mBAAA,kBAAAnB,IAAA,CAAAI,aAAA;IACxBgB,SAAC;IACH,IAAI,CAAAN,WAAW;MAGfO,OAAM,EAAAN,KAAW,CAAAM,OAAkB,YAAY;MAE/CC,cAAa,EAAAP,KAAA,CAAAO,cACD;MAELC,YAAA,EAAAR,KAAA,CAAAQ,YAAA;MAAAC,WAAA,EAAAT,KAAA,CAAAS,WAAA;MACCC,gBAAS,EAAAV,KAAA,CAAAU,gBAAA;MACR;MAAoB;MACkBC,qBACrB,GAAM;MAAAN,SACtB,EAAAP,OAAc;MAAMc,MACpB,EAAAZ,KAAA,CAAAY;IAAmB;IACKjB;EAAA,oBAAAV,IAAA,CAAAG,eAAA;IAAAW,WAGxB;IAAuB,GAAAC,KACvB;IAAWL,QACX,EAAAQ,OAAQ,IAAMJ,WAAA,GAAAJ,QAAA;EAAA,KAChB,eAAAV,IAAA,CAAAE,SAAA;IAAAQ;EAEC;AAAA;AAaX,S","ignoreList":[]}
|
package/dist/esm/index.js
DELETED
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/esm/index.mjs
DELETED
package/dist/esm/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/esm/index.native.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|