@vkzstudio/muza-ui 1.0.7 → 1.0.9
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/components/Button/Button.js +19 -19
- package/dist/components/Button/ButtonLoader.d.ts +7 -0
- package/dist/components/Button/ButtonLoader.d.ts.map +1 -0
- package/dist/components/Button/ButtonLoader.js +40 -0
- package/dist/components/Chip/Chip.d.ts +43 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.js +98 -0
- package/dist/components/Chip/Chip.stories.d.ts +9 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +10 -4
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +77 -49
- package/dist/components/DataTable/DataTable.stories.d.ts +4 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts +100 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.js +197 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts +14 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -0
- package/dist/components/Reorderable/index.d.ts +2 -0
- package/dist/components/Reorderable/index.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +40 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +175 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +18 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -0
- package/dist/components/ReorderableTable/index.d.ts +2 -0
- package/dist/components/ReorderableTable/index.d.ts.map +1 -0
- package/dist/components/SwipeButton/SwipeButton.js +7 -7
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +196 -183
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/animation/animate/subject.js +24 -24
- package/dist/node_modules/framer-motion/dist/es/animation/sequence/create.js +61 -56
- package/dist/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.js +8 -8
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +32 -30
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +22 -22
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +34 -32
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +46 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +34 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +64 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +2 -2
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +3 -3
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +100 -89
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +11 -7
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +2 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +106 -59
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +6 -6
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +5 -5
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +18 -6
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +27 -42
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -7
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +49 -49
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -13
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +41 -40
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +13 -13
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -6
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +12 -12
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +3 -3
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +7 -7
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +5 -5
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +26 -18
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +33 -30
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +17 -17
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +20 -19
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/motion-value.js +13 -13
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-target.js +11 -11
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +24 -20
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/default-transitions.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +7 -3
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +1 -1
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/animation/mix-values.js +2 -2
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-apply.js +4 -4
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-calc.js +1 -1
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-remove.js +6 -6
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/DocumentProjectionNode.js +7 -4
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/create-projection-node.js +149 -149
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +60 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-border-radius.js +1 -1
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-box-shadow.js +2 -2
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/VisualElement.js +58 -50
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/dom/DOMVisualElement.js +7 -6
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/animation-state.js +31 -31
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-controlling-variants.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/motion-values.js +6 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/setters.js +4 -4
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/delay.js +2 -2
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +8 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +62 -42
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- package/dist/node_modules/motion-utils/dist/es/errors.js +10 -9
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +4 -0
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +4 -0
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +4 -0
- package/dist/translations/types.d.ts +8 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/node_modules/framer-motion/dist/es/animation/animate/single-value.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -58
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -38
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -29
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -31
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -40
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -23
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -7
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-variant.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/data-id.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/get-appear-id.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/calc-child-stagger.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/animation/animators/waapi → motion-dom/dist/es/animation}/utils/get-final-keyframe.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/is-transition-defined.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/events/add-dom-event.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/conversion.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/copy.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/models.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/utils.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/HTMLProjectionNode.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/state.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/transform.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/compare-by-depth.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/each-axis.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/flat-tree.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/has-transform.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/measure.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/motion/features → motion-dom/dist/es/render}/Feature.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/html/utils/render.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/object/ObjectVisualElement.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/store.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/camel-case-attrs.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/is-svg-tag.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/render.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/get-variant-context.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-animation-controls.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-keyframes-target.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-variant-label.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/reduced-motion/state.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-dynamic-variants.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-variants.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/shallow-compare.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/variant-props.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/value/use-will-change → motion-dom/dist/es/value/will-change}/add-will-change.js +0 -0
package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-box-shadow.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { complex as f } from "
|
|
2
|
-
import { mixNumber as i } from "
|
|
1
|
+
import { complex as f } from "../../value/types/complex/index.js";
|
|
2
|
+
import { mixNumber as i } from "../../utils/mix/number.js";
|
|
3
3
|
const y = {
|
|
4
4
|
correct: (e, { treeScale: c, projectionDelta: t }) => {
|
|
5
5
|
const a = e, o = f.parse(e);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { correctBorderRadius as o } from "./scale-border-radius.js";
|
|
2
|
+
import { correctBoxShadow as r } from "./scale-box-shadow.js";
|
|
3
|
+
const e = {
|
|
4
|
+
borderRadius: {
|
|
5
|
+
...o,
|
|
6
|
+
applyTo: [
|
|
7
|
+
"borderTopLeftRadius",
|
|
8
|
+
"borderTopRightRadius",
|
|
9
|
+
"borderBottomLeftRadius",
|
|
10
|
+
"borderBottomRightRadius"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
borderTopLeftRadius: o,
|
|
14
|
+
borderTopRightRadius: o,
|
|
15
|
+
borderBottomLeftRadius: o,
|
|
16
|
+
borderBottomRightRadius: o,
|
|
17
|
+
boxShadow: r
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
e as scaleCorrectors
|
|
21
|
+
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { SubscriptionManager as
|
|
22
|
-
|
|
23
|
-
const f = [
|
|
1
|
+
import { microtask as g } from "../frameloop/microtask.js";
|
|
2
|
+
import { time as C } from "../frameloop/sync-time.js";
|
|
3
|
+
import { motionValue as M } from "../value/index.js";
|
|
4
|
+
import { isMotionValue as h } from "../value/utils/is-motion-value.js";
|
|
5
|
+
import { KeyframeResolver as S } from "../animation/keyframes/KeyframesResolver.js";
|
|
6
|
+
import { transformProps as b } from "./utils/keys-transform.js";
|
|
7
|
+
import { complex as T } from "../value/types/complex/index.js";
|
|
8
|
+
import { findValueType as w } from "../value/types/utils/find.js";
|
|
9
|
+
import { getAnimatableNone as P } from "../value/types/utils/animatable-none.js";
|
|
10
|
+
import { createBox as F } from "../projection/geometry/models.js";
|
|
11
|
+
import { initPrefersReducedMotion as R } from "./utils/reduced-motion/index.js";
|
|
12
|
+
import { visualElementStore as B } from "./store.js";
|
|
13
|
+
import { isControllingVariants as N, isVariantNode as E } from "./utils/is-controlling-variants.js";
|
|
14
|
+
import { updateMotionValuesFromProps as x } from "./utils/motion-values.js";
|
|
15
|
+
import { resolveVariantFromProps as A } from "./utils/resolve-variants.js";
|
|
16
|
+
import { hasReducedMotionListener as j, prefersReducedMotion as y } from "./utils/reduced-motion/state.js";
|
|
17
|
+
import { frame as f, cancelFrame as c } from "../frameloop/frame.js";
|
|
18
|
+
import { warnOnce as I } from "../../../../motion-utils/dist/es/warn-once.js";
|
|
19
|
+
import { isNumericalString as D } from "../../../../motion-utils/dist/es/is-numerical-string.js";
|
|
20
|
+
import { isZeroValueString as U } from "../../../../motion-utils/dist/es/is-zero-value-string.js";
|
|
21
|
+
import { SubscriptionManager as L } from "../../../../motion-utils/dist/es/subscription-manager.js";
|
|
22
|
+
const m = [
|
|
24
23
|
"AnimationStart",
|
|
25
24
|
"AnimationComplete",
|
|
26
25
|
"Update",
|
|
@@ -29,7 +28,14 @@ const f = [
|
|
|
29
28
|
"LayoutAnimationStart",
|
|
30
29
|
"LayoutAnimationComplete"
|
|
31
30
|
];
|
|
32
|
-
|
|
31
|
+
let u = {};
|
|
32
|
+
function at(l) {
|
|
33
|
+
u = l;
|
|
34
|
+
}
|
|
35
|
+
function ht() {
|
|
36
|
+
return u;
|
|
37
|
+
}
|
|
38
|
+
class ut {
|
|
33
39
|
/**
|
|
34
40
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
35
41
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -40,24 +46,24 @@ class ht {
|
|
|
40
46
|
scrapeMotionValuesFromProps(t, e, i) {
|
|
41
47
|
return {};
|
|
42
48
|
}
|
|
43
|
-
constructor({ parent: t, props: e, presenceContext: i, reducedMotionConfig: s, blockInitialAnimation: r, visualState: n },
|
|
44
|
-
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver =
|
|
49
|
+
constructor({ parent: t, props: e, presenceContext: i, reducedMotionConfig: s, blockInitialAnimation: r, visualState: n }, V = {}) {
|
|
50
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = S, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
45
51
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
46
52
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
47
|
-
const o =
|
|
48
|
-
this.renderScheduledAt < o && (this.renderScheduledAt = o,
|
|
53
|
+
const o = C.now();
|
|
54
|
+
this.renderScheduledAt < o && (this.renderScheduledAt = o, f.render(this.render, !1, !0));
|
|
49
55
|
};
|
|
50
|
-
const { latestValues: a, renderState:
|
|
51
|
-
this.latestValues = a, this.baseTarget = { ...a }, this.initialValues = e.initial ? { ...a } : {}, this.renderState =
|
|
52
|
-
const { willChange: O, ...
|
|
53
|
-
for (const o in
|
|
54
|
-
const
|
|
55
|
-
a[o] !== void 0 && h(
|
|
56
|
+
const { latestValues: a, renderState: v } = n;
|
|
57
|
+
this.latestValues = a, this.baseTarget = { ...a }, this.initialValues = e.initial ? { ...a } : {}, this.renderState = v, this.parent = t, this.props = e, this.presenceContext = i, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = s, this.options = V, this.blockInitialAnimation = !!r, this.isControllingVariants = N(e), this.isVariantNode = E(e), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
|
|
58
|
+
const { willChange: O, ...d } = this.scrapeMotionValuesFromProps(e, {}, this);
|
|
59
|
+
for (const o in d) {
|
|
60
|
+
const p = d[o];
|
|
61
|
+
a[o] !== void 0 && h(p) && p.set(a[o]);
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
mount(t) {
|
|
59
65
|
var e;
|
|
60
|
-
this.current = t,
|
|
66
|
+
this.current = t, B.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((i, s) => this.bindToMotionValue(s, i)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = !1 : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = !0 : (j.current || R(), this.shouldReduceMotion = y.current), process.env.NODE_ENV !== "production" && I(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), (e = this.parent) == null || e.addChild(this), this.update(this.props, this.presenceContext);
|
|
61
67
|
}
|
|
62
68
|
unmount() {
|
|
63
69
|
var t;
|
|
@@ -78,13 +84,13 @@ class ht {
|
|
|
78
84
|
}
|
|
79
85
|
bindToMotionValue(t, e) {
|
|
80
86
|
this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)();
|
|
81
|
-
const i =
|
|
87
|
+
const i = b.has(t);
|
|
82
88
|
i && this.onBindTransform && this.onBindTransform();
|
|
83
89
|
const s = e.on("change", (n) => {
|
|
84
|
-
this.latestValues[t] = n, this.props.onUpdate &&
|
|
90
|
+
this.latestValues[t] = n, this.props.onUpdate && f.preRender(this.notifyUpdate), i && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
|
|
85
91
|
});
|
|
86
92
|
let r;
|
|
87
|
-
window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, t, e)), this.valueSubscriptions.set(t, () => {
|
|
93
|
+
typeof window < "u" && window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, t, e)), this.valueSubscriptions.set(t, () => {
|
|
88
94
|
s(), r && r(), e.owner && e.stop();
|
|
89
95
|
});
|
|
90
96
|
}
|
|
@@ -93,8 +99,8 @@ class ht {
|
|
|
93
99
|
}
|
|
94
100
|
updateFeatures() {
|
|
95
101
|
let t = "animation";
|
|
96
|
-
for (t in
|
|
97
|
-
const e =
|
|
102
|
+
for (t in u) {
|
|
103
|
+
const e = u[t];
|
|
98
104
|
if (!e)
|
|
99
105
|
continue;
|
|
100
106
|
const { isEnabled: i, Feature: s } = e;
|
|
@@ -113,7 +119,7 @@ class ht {
|
|
|
113
119
|
* removed with a re-render to work.
|
|
114
120
|
*/
|
|
115
121
|
measureViewportBox() {
|
|
116
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
122
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : F();
|
|
117
123
|
}
|
|
118
124
|
getStaticValue(t) {
|
|
119
125
|
return this.latestValues[t];
|
|
@@ -127,13 +133,13 @@ class ht {
|
|
|
127
133
|
*/
|
|
128
134
|
update(t, e) {
|
|
129
135
|
(t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = e;
|
|
130
|
-
for (let i = 0; i <
|
|
131
|
-
const s =
|
|
136
|
+
for (let i = 0; i < m.length; i++) {
|
|
137
|
+
const s = m[i];
|
|
132
138
|
this.propEventSubscriptions[s] && (this.propEventSubscriptions[s](), delete this.propEventSubscriptions[s]);
|
|
133
139
|
const r = "on" + s, n = t[r];
|
|
134
140
|
n && (this.propEventSubscriptions[s] = this.on(s, n));
|
|
135
141
|
}
|
|
136
|
-
this.prevMotionValues =
|
|
142
|
+
this.prevMotionValues = x(this, this.scrapeMotionValuesFromProps(t, this.prevProps || {}, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
137
143
|
}
|
|
138
144
|
getProps() {
|
|
139
145
|
return this.props;
|
|
@@ -189,7 +195,7 @@ class ht {
|
|
|
189
195
|
if (this.props.values && this.props.values[t])
|
|
190
196
|
return this.props.values[t];
|
|
191
197
|
let i = this.values.get(t);
|
|
192
|
-
return i === void 0 && e !== void 0 && (i =
|
|
198
|
+
return i === void 0 && e !== void 0 && (i = M(e === null ? void 0 : e, { owner: this }), this.addValue(t, i)), i;
|
|
193
199
|
}
|
|
194
200
|
/**
|
|
195
201
|
* If we're trying to animate to a previously unencountered value,
|
|
@@ -198,7 +204,7 @@ class ht {
|
|
|
198
204
|
*/
|
|
199
205
|
readValue(t, e) {
|
|
200
206
|
let i = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
|
|
201
|
-
return i != null && (typeof i == "string" && (
|
|
207
|
+
return i != null && (typeof i == "string" && (D(i) || U(i)) ? i = parseFloat(i) : !w(i) && T.test(e) && (i = P(t, e)), this.setBaseTarget(t, h(i) ? i.get() : i)), h(i) ? i.get() : i;
|
|
202
208
|
}
|
|
203
209
|
/**
|
|
204
210
|
* Set the base target to later animate back to. This is currently
|
|
@@ -216,7 +222,7 @@ class ht {
|
|
|
216
222
|
const { initial: e } = this.props;
|
|
217
223
|
let i;
|
|
218
224
|
if (typeof e == "string" || typeof e == "object") {
|
|
219
|
-
const n =
|
|
225
|
+
const n = A(this.props, e, (r = this.presenceContext) == null ? void 0 : r.custom);
|
|
220
226
|
n && (i = n[t]);
|
|
221
227
|
}
|
|
222
228
|
if (e && i !== void 0)
|
|
@@ -225,15 +231,17 @@ class ht {
|
|
|
225
231
|
return s !== void 0 && !h(s) ? s : this.initialValues[t] !== void 0 && i === void 0 ? void 0 : this.baseTarget[t];
|
|
226
232
|
}
|
|
227
233
|
on(t, e) {
|
|
228
|
-
return this.events[t] || (this.events[t] = new
|
|
234
|
+
return this.events[t] || (this.events[t] = new L()), this.events[t].add(e);
|
|
229
235
|
}
|
|
230
236
|
notify(t, ...e) {
|
|
231
237
|
this.events[t] && this.events[t].notify(...e);
|
|
232
238
|
}
|
|
233
239
|
scheduleRenderMicrotask() {
|
|
234
|
-
|
|
240
|
+
g.render(this.render);
|
|
235
241
|
}
|
|
236
242
|
}
|
|
237
243
|
export {
|
|
238
|
-
|
|
244
|
+
ut as VisualElement,
|
|
245
|
+
ht as getFeatureDefinitions,
|
|
246
|
+
at as setFeatureDefinitions
|
|
239
247
|
};
|
package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/dom/DOMVisualElement.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DOMKeyframesResolver as o } from "
|
|
3
|
-
import {
|
|
4
|
-
class a extends
|
|
1
|
+
import { isMotionValue as r } from "../../value/utils/is-motion-value.js";
|
|
2
|
+
import { DOMKeyframesResolver as o } from "../../animation/keyframes/DOMKeyframesResolver.js";
|
|
3
|
+
import { VisualElement as s } from "../VisualElement.js";
|
|
4
|
+
class a extends s {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments), this.KeyframeResolver = o;
|
|
7
7
|
}
|
|
@@ -9,7 +9,8 @@ class a extends r {
|
|
|
9
9
|
return e.compareDocumentPosition(t) & 2 ? 1 : -1;
|
|
10
10
|
}
|
|
11
11
|
getBaseTargetFromProps(e, t) {
|
|
12
|
-
|
|
12
|
+
const i = e.style;
|
|
13
|
+
return i ? i[t] : void 0;
|
|
13
14
|
}
|
|
14
15
|
removeValueFromRenderState(e, { vars: t, style: i }) {
|
|
15
16
|
delete t[e], delete i[e];
|
|
@@ -17,7 +18,7 @@ class a extends r {
|
|
|
17
18
|
handleChildMotionValue() {
|
|
18
19
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
19
20
|
const { children: e } = this.props;
|
|
20
|
-
|
|
21
|
+
r(e) && (this.childSubscription = e.on("change", (t) => {
|
|
21
22
|
this.current && (this.current.textContent = `${t}`);
|
|
22
23
|
}));
|
|
23
24
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isCSSVariableName as n } from "../../animation/utils/is-css-variable.js";
|
|
2
|
+
import { transformProps as a } from "../utils/keys-transform.js";
|
|
3
|
+
import { defaultTransformValue as i, readTransformValue as u } from "../dom/parse-transform.js";
|
|
4
|
+
import { measureViewportBox as p } from "../../projection/utils/measure.js";
|
|
5
|
+
import { DOMVisualElement as l } from "../dom/DOMVisualElement.js";
|
|
6
|
+
import { buildHTMLStyles as f } from "./utils/build-styles.js";
|
|
7
|
+
import { renderHTML as c } from "./utils/render.js";
|
|
8
|
+
import { scrapeMotionValuesFromProps as d } from "./utils/scrape-motion-values.js";
|
|
9
|
+
function V(m) {
|
|
10
|
+
return window.getComputedStyle(m);
|
|
11
|
+
}
|
|
12
|
+
class b extends l {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.type = "html", this.renderInstance = c;
|
|
15
|
+
}
|
|
16
|
+
readValueFromInstance(e, r) {
|
|
17
|
+
var t;
|
|
18
|
+
if (a.has(r))
|
|
19
|
+
return (t = this.projection) != null && t.isProjecting ? i(r) : u(e, r);
|
|
20
|
+
{
|
|
21
|
+
const s = V(e), o = (n(r) ? s.getPropertyValue(r) : s[r]) || 0;
|
|
22
|
+
return typeof o == "string" ? o.trim() : o;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
measureInstanceViewportBox(e, { transformPagePoint: r }) {
|
|
26
|
+
return p(e, r);
|
|
27
|
+
}
|
|
28
|
+
build(e, r, t) {
|
|
29
|
+
f(e, r, t.transformTemplate);
|
|
30
|
+
}
|
|
31
|
+
scrapeMotionValuesFromProps(e, r, t) {
|
|
32
|
+
return d(e, r, t);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
b as HTMLVisualElement,
|
|
37
|
+
V as getComputedStyle
|
|
38
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getValueAsType as p } from "../../../value/types/utils/get-as-type.js";
|
|
2
|
+
import { numberValueTypes as u } from "../../../value/types/maps/number.js";
|
|
3
|
+
import { transformProps as c } from "../../utils/keys-transform.js";
|
|
4
|
+
import { isCSSVariableName as g } from "../../../animation/utils/is-css-variable.js";
|
|
5
|
+
import { buildTransform as y } from "./build-transform.js";
|
|
6
|
+
function S(f, i, e) {
|
|
7
|
+
const { style: o, vars: l, transformOrigin: t } = f;
|
|
8
|
+
let m = !1, a = !1;
|
|
9
|
+
for (const r in i) {
|
|
10
|
+
const n = i[r];
|
|
11
|
+
if (c.has(r)) {
|
|
12
|
+
m = !0;
|
|
13
|
+
continue;
|
|
14
|
+
} else if (g(r)) {
|
|
15
|
+
l[r] = n;
|
|
16
|
+
continue;
|
|
17
|
+
} else {
|
|
18
|
+
const s = p(n, u[r]);
|
|
19
|
+
r.startsWith("origin") ? (a = !0, t[r] = s) : o[r] = s;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (i.transform || (m || e ? o.transform = y(i, f.transform, e) : o.transform && (o.transform = "none")), a) {
|
|
23
|
+
const { originX: r = "50%", originY: n = "50%", originZ: s = 0 } = t;
|
|
24
|
+
o.transformOrigin = `${r} ${n} ${s}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
S as buildHTMLStyles
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getValueAsType as m } from "../../../value/types/utils/get-as-type.js";
|
|
2
|
+
import { numberValueTypes as p } from "../../../value/types/maps/number.js";
|
|
3
|
+
import { transformPropOrder as f } from "../../utils/keys-transform.js";
|
|
4
|
+
const y = {
|
|
5
|
+
x: "translateX",
|
|
6
|
+
y: "translateY",
|
|
7
|
+
z: "translateZ",
|
|
8
|
+
transformPerspective: "perspective"
|
|
9
|
+
}, d = f.length;
|
|
10
|
+
function h(u, l, n) {
|
|
11
|
+
let e = "", o = !0;
|
|
12
|
+
for (let i = 0; i < d; i++) {
|
|
13
|
+
const t = f[i], r = u[t];
|
|
14
|
+
if (r === void 0)
|
|
15
|
+
continue;
|
|
16
|
+
let a = !0;
|
|
17
|
+
if (typeof r == "number")
|
|
18
|
+
a = r === (t.startsWith("scale") ? 1 : 0);
|
|
19
|
+
else {
|
|
20
|
+
const s = parseFloat(r);
|
|
21
|
+
a = t.startsWith("scale") ? s === 1 : s === 0;
|
|
22
|
+
}
|
|
23
|
+
if (!a || n) {
|
|
24
|
+
const s = m(r, p[t]);
|
|
25
|
+
if (!a) {
|
|
26
|
+
o = !1;
|
|
27
|
+
const c = y[t] || t;
|
|
28
|
+
e += `${c}(${s}) `;
|
|
29
|
+
}
|
|
30
|
+
n && (l[t] = s);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return e = e.trim(), n ? e = n(l, o ? "" : e) : o && (e = "none"), e;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
h as buildTransform
|
|
37
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isMotionValue as y } from "../../../value/utils/is-motion-value.js";
|
|
2
|
+
import { isForcedMotionValue as u } from "../../utils/is-forced-motion-value.js";
|
|
3
|
+
function d(c, n, e) {
|
|
4
|
+
var r;
|
|
5
|
+
const t = c.style, f = n == null ? void 0 : n.style, i = {};
|
|
6
|
+
if (!t)
|
|
7
|
+
return i;
|
|
8
|
+
for (const o in t)
|
|
9
|
+
(y(t[o]) || f && y(f[o]) || u(o, c) || ((r = e == null ? void 0 : e.getValue(o)) == null ? void 0 : r.liveStyle) !== void 0) && (i[o] = t[o]);
|
|
10
|
+
return i;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
d as scrapeMotionValuesFromProps
|
|
14
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { transformProps as s } from "../utils/keys-transform.js";
|
|
2
|
+
import { getDefaultValueType as a } from "../../value/types/maps/defaults.js";
|
|
3
|
+
import { createBox as m } from "../../projection/geometry/models.js";
|
|
4
|
+
import { DOMVisualElement as i } from "../dom/DOMVisualElement.js";
|
|
5
|
+
import { camelToDash as u } from "../dom/utils/camel-to-dash.js";
|
|
6
|
+
import { buildSVGAttrs as n } from "./utils/build-attrs.js";
|
|
7
|
+
import { camelCaseAttributes as p } from "./utils/camel-case-attrs.js";
|
|
8
|
+
import { isSVGTag as l } from "./utils/is-svg-tag.js";
|
|
9
|
+
import { renderSVG as f } from "./utils/render.js";
|
|
10
|
+
import { scrapeMotionValuesFromProps as V } from "./utils/scrape-motion-values.js";
|
|
11
|
+
class A extends i {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = m;
|
|
14
|
+
}
|
|
15
|
+
getBaseTargetFromProps(t, r) {
|
|
16
|
+
return t[r];
|
|
17
|
+
}
|
|
18
|
+
readValueFromInstance(t, r) {
|
|
19
|
+
if (s.has(r)) {
|
|
20
|
+
const e = a(r);
|
|
21
|
+
return e && e.default || 0;
|
|
22
|
+
}
|
|
23
|
+
return r = p.has(r) ? r : u(r), t.getAttribute(r);
|
|
24
|
+
}
|
|
25
|
+
scrapeMotionValuesFromProps(t, r, e) {
|
|
26
|
+
return V(t, r, e);
|
|
27
|
+
}
|
|
28
|
+
build(t, r, e) {
|
|
29
|
+
n(t, r, this.isSVGTag, e.transformTemplate, e.style);
|
|
30
|
+
}
|
|
31
|
+
renderInstance(t, r, e, o) {
|
|
32
|
+
f(t, r, e, o);
|
|
33
|
+
}
|
|
34
|
+
mount(t) {
|
|
35
|
+
this.isSVGTag = l(t.tagName), super.mount(t);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
A as SVGVisualElement
|
|
40
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { buildHTMLStyles as c } from "../../html/utils/build-styles.js";
|
|
2
|
+
import { buildSVGPath as B } from "./path.js";
|
|
3
|
+
const b = [
|
|
4
|
+
"offsetDistance",
|
|
5
|
+
"offsetPath",
|
|
6
|
+
"offsetRotate",
|
|
7
|
+
"offsetAnchor"
|
|
8
|
+
];
|
|
9
|
+
function g(r, {
|
|
10
|
+
attrX: e,
|
|
11
|
+
attrY: s,
|
|
12
|
+
attrScale: t,
|
|
13
|
+
pathLength: d,
|
|
14
|
+
pathSpacing: m = 1,
|
|
15
|
+
pathOffset: l = 0,
|
|
16
|
+
// This is object creation, which we try to avoid per-frame.
|
|
17
|
+
...a
|
|
18
|
+
}, u, x, n) {
|
|
19
|
+
if (c(r, a, x), u) {
|
|
20
|
+
r.style.viewBox && (r.attrs.viewBox = r.style.viewBox);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
r.attrs = r.style, r.style = {};
|
|
24
|
+
const { attrs: f, style: i } = r;
|
|
25
|
+
f.transform && (i.transform = f.transform, delete f.transform), (i.transform || f.transformOrigin) && (i.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), i.transform && (i.transformBox = (n == null ? void 0 : n.transformBox) ?? "fill-box", delete f.transformBox);
|
|
26
|
+
for (const o of b)
|
|
27
|
+
f[o] !== void 0 && (i[o] = f[o], delete f[o]);
|
|
28
|
+
e !== void 0 && (f.x = e), s !== void 0 && (f.y = s), t !== void 0 && (f.scale = t), d !== void 0 && B(f, d, m, l, !1);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
g as buildSVGAttrs
|
|
32
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const f = {
|
|
2
|
+
offset: "stroke-dashoffset",
|
|
3
|
+
array: "stroke-dasharray"
|
|
4
|
+
}, h = {
|
|
5
|
+
offset: "strokeDashoffset",
|
|
6
|
+
array: "strokeDasharray"
|
|
7
|
+
};
|
|
8
|
+
function y(s, e, o = 1, r = 0, t = !0) {
|
|
9
|
+
s.pathLength = 1;
|
|
10
|
+
const a = t ? f : h;
|
|
11
|
+
s[a.offset] = `${-r}`, s[a.array] = `${e} ${o}`;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
y as buildSVGPath
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isMotionValue as n } from "../../../value/utils/is-motion-value.js";
|
|
2
|
+
import { transformPropOrder as i } from "../../utils/keys-transform.js";
|
|
3
|
+
import { scrapeMotionValuesFromProps as m } from "../../html/utils/scrape-motion-values.js";
|
|
4
|
+
function l(r, t, s) {
|
|
5
|
+
const e = m(r, t, s);
|
|
6
|
+
for (const o in r)
|
|
7
|
+
if (n(r[o]) || n(t[o])) {
|
|
8
|
+
const a = i.indexOf(o) !== -1 ? "attr" + o.charAt(0).toUpperCase() + o.substring(1) : o;
|
|
9
|
+
e[a] = r[o];
|
|
10
|
+
}
|
|
11
|
+
return e;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
l as scrapeMotionValuesFromProps
|
|
15
|
+
};
|
package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/animation-state.js
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { animateVisualElement as J } from "../../animation/interfaces/visual-element.js";
|
|
2
2
|
import { calcChildStagger as N } from "../../animation/utils/calc-child-stagger.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getVariantContext as U } from "./get-variant-context.js";
|
|
3
|
+
import { getVariantContext as Q } from "./get-variant-context.js";
|
|
4
|
+
import { isAnimationControls as U } from "./is-animation-controls.js";
|
|
5
|
+
import { isKeyframesTarget as M } from "./is-keyframes-target.js";
|
|
7
6
|
import { isVariantLabel as W } from "./is-variant-label.js";
|
|
8
7
|
import { resolveVariant as K } from "./resolve-dynamic-variants.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { shallowCompare as B } from "./shallow-compare.js";
|
|
9
|
+
import { variantPriorityOrder as H } from "./variant-props.js";
|
|
10
|
+
const X = [...H].reverse(), Y = H.length;
|
|
11
11
|
function Z(e) {
|
|
12
12
|
return (c) => Promise.all(c.map(({ animation: d, options: m }) => J(e, d, m)));
|
|
13
13
|
}
|
|
14
14
|
function le(e) {
|
|
15
15
|
let c = Z(e), d = k(), m = !0;
|
|
16
|
-
const
|
|
16
|
+
const L = (l) => (t, y) => {
|
|
17
17
|
var a;
|
|
18
|
-
const f = K(e,
|
|
18
|
+
const f = K(e, y, l === "exit" ? (a = e.presenceContext) == null ? void 0 : a.custom : void 0);
|
|
19
19
|
if (f) {
|
|
20
20
|
const { transition: p, transitionEnd: v, ...C } = f;
|
|
21
21
|
t = { ...t, ...C, ...v };
|
|
@@ -26,23 +26,23 @@ function le(e) {
|
|
|
26
26
|
c = l(e);
|
|
27
27
|
}
|
|
28
28
|
function b(l) {
|
|
29
|
-
const { props: t } = e,
|
|
29
|
+
const { props: t } = e, y = Q(e.parent) || {}, f = [], a = /* @__PURE__ */ new Set();
|
|
30
30
|
let p = {}, v = 1 / 0;
|
|
31
31
|
for (let u = 0; u < Y; u++) {
|
|
32
|
-
const n = X[u], r = d[n], o = t[n] !== void 0 ? t[n] :
|
|
32
|
+
const n = X[u], r = d[n], o = t[n] !== void 0 ? t[n] : y[n], P = W(o), S = n === l ? r.isActive : null;
|
|
33
33
|
S === !1 && (v = u);
|
|
34
|
-
let w = o ===
|
|
34
|
+
let w = o === y[n] && o !== t[n] && P;
|
|
35
35
|
if (w && m && e.manuallyAnimateOnMount && (w = !1), r.protectedKeys = { ...p }, // If it isn't active and hasn't *just* been set as inactive
|
|
36
36
|
!r.isActive && S === null || // If we didn't and don't have any defined prop for this animation type
|
|
37
37
|
!o && !r.prevProp || // Or if the prop doesn't define an animation
|
|
38
|
-
|
|
38
|
+
U(o) || typeof o == "boolean")
|
|
39
39
|
continue;
|
|
40
40
|
const I = _(r.prevProp, o);
|
|
41
41
|
let T = I || // If we're making this variant active, we want to always make it active
|
|
42
42
|
n === l && r.isActive && !w && P || // If we removed a higher-priority variant (i is in reverse order)
|
|
43
43
|
u > v && P, O = !1;
|
|
44
44
|
const R = Array.isArray(o) ? o : [o];
|
|
45
|
-
let V = R.reduce(
|
|
45
|
+
let V = R.reduce(L(n), {});
|
|
46
46
|
S === !1 && (V = {});
|
|
47
47
|
const { prevResolvedValues: x = {} } = r, q = {
|
|
48
48
|
...x,
|
|
@@ -53,21 +53,21 @@ function le(e) {
|
|
|
53
53
|
s && (s.liveStyle = !1);
|
|
54
54
|
};
|
|
55
55
|
for (const i in q) {
|
|
56
|
-
const s = V[i],
|
|
56
|
+
const s = V[i], A = x[i];
|
|
57
57
|
if (p.hasOwnProperty(i))
|
|
58
58
|
continue;
|
|
59
59
|
let g = !1;
|
|
60
|
-
M(s) && M(
|
|
60
|
+
M(s) && M(A) ? g = !B(s, A) : g = s !== A, g ? s != null ? D(i) : a.add(i) : s !== void 0 && a.has(i) ? D(i) : r.protectedKeys[i] = !0;
|
|
61
61
|
}
|
|
62
62
|
r.prevProp = o, r.prevResolvedValues = V, r.isActive && (p = { ...p, ...V }), m && e.blockInitialAnimation && (T = !1);
|
|
63
|
-
const
|
|
64
|
-
T && (!
|
|
63
|
+
const F = w && I;
|
|
64
|
+
T && (!F || O) && f.push(...R.map((i) => {
|
|
65
65
|
const s = { type: n };
|
|
66
|
-
if (typeof i == "string" && m && !
|
|
67
|
-
const { parent:
|
|
68
|
-
if (
|
|
66
|
+
if (typeof i == "string" && m && !F && e.manuallyAnimateOnMount && e.parent) {
|
|
67
|
+
const { parent: A } = e, g = K(A, i);
|
|
68
|
+
if (A.enteringChildren && g) {
|
|
69
69
|
const { delayChildren: G } = g.transition || {};
|
|
70
|
-
s.delay = N(
|
|
70
|
+
s.delay = N(A.enteringChildren, e, G);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
@@ -98,10 +98,10 @@ function le(e) {
|
|
|
98
98
|
var p;
|
|
99
99
|
return (p = a.animationState) == null ? void 0 : p.setActive(l, t);
|
|
100
100
|
}), d[l].isActive = t;
|
|
101
|
-
const
|
|
101
|
+
const y = b(l);
|
|
102
102
|
for (const a in d)
|
|
103
103
|
d[a].protectedKeys = {};
|
|
104
|
-
return
|
|
104
|
+
return y;
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
107
|
animateChanges: b,
|
|
@@ -116,7 +116,7 @@ function le(e) {
|
|
|
116
116
|
function _(e, c) {
|
|
117
117
|
return typeof c == "string" ? c !== e : Array.isArray(c) ? !B(c, e) : !1;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function h(e = !1) {
|
|
120
120
|
return {
|
|
121
121
|
isActive: e,
|
|
122
122
|
protectedKeys: {},
|
|
@@ -126,13 +126,13 @@ function y(e = !1) {
|
|
|
126
126
|
}
|
|
127
127
|
function k() {
|
|
128
128
|
return {
|
|
129
|
-
animate:
|
|
130
|
-
whileInView:
|
|
131
|
-
whileHover:
|
|
132
|
-
whileTap:
|
|
133
|
-
whileDrag:
|
|
134
|
-
whileFocus:
|
|
135
|
-
exit:
|
|
129
|
+
animate: h(!0),
|
|
130
|
+
whileInView: h(),
|
|
131
|
+
whileHover: h(),
|
|
132
|
+
whileTap: h(),
|
|
133
|
+
whileDrag: h(),
|
|
134
|
+
whileFocus: h(),
|
|
135
|
+
exit: h()
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAnimationControls as o } from "
|
|
1
|
+
import { isAnimationControls as o } from "./is-animation-controls.js";
|
|
2
2
|
import { isVariantLabel as r } from "./is-variant-label.js";
|
|
3
3
|
import { variantProps as t } from "./variant-props.js";
|
|
4
4
|
function a(i) {
|