@vkzstudio/muza-ui 1.0.8 → 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.
Files changed (143) hide show
  1. package/dist/components/Button/Button.js +19 -19
  2. package/dist/components/Button/ButtonLoader.d.ts +7 -0
  3. package/dist/components/Button/ButtonLoader.d.ts.map +1 -0
  4. package/dist/components/Button/ButtonLoader.js +40 -0
  5. package/dist/components/Icons/CustomIcons.js +1 -1
  6. package/dist/components/ReorderableTable/ReorderableTable.js +1 -1
  7. package/dist/components/SwipeButton/SwipeButton.js +1 -1
  8. package/dist/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.js +4 -4
  9. package/dist/node_modules/framer-motion/dist/es/animation/animate/subject.js +24 -24
  10. package/dist/node_modules/framer-motion/dist/es/animation/sequence/create.js +61 -56
  11. package/dist/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.js +8 -8
  12. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +32 -30
  13. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +22 -22
  14. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +34 -32
  15. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +34 -26
  16. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +30 -25
  17. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +64 -0
  18. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +2 -2
  19. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +3 -3
  20. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +100 -89
  21. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +11 -7
  22. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +4 -4
  23. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +2 -2
  24. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +1 -1
  25. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +106 -59
  26. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +6 -6
  27. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +1 -1
  28. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +1 -1
  29. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +5 -5
  30. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +18 -6
  31. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +1 -1
  32. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +27 -42
  33. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +4 -4
  34. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -7
  35. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +4 -4
  36. package/dist/node_modules/framer-motion/dist/es/motion/index.js +49 -49
  37. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -13
  38. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +41 -40
  39. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +13 -13
  40. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -6
  41. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +12 -12
  42. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +3 -3
  43. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +7 -7
  44. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +5 -5
  45. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +1 -1
  46. package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +26 -18
  47. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +33 -30
  48. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +17 -17
  49. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +20 -19
  50. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
  51. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/motion-value.js +13 -13
  52. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-target.js +11 -11
  53. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +24 -20
  54. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/default-transitions.js +1 -1
  55. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +7 -3
  56. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +1 -1
  57. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/animation/mix-values.js +2 -2
  58. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-apply.js +4 -4
  59. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-calc.js +1 -1
  60. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-remove.js +6 -6
  61. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/DocumentProjectionNode.js +7 -4
  62. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/create-projection-node.js +149 -149
  63. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +60 -0
  64. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-border-radius.js +1 -1
  65. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-box-shadow.js +2 -2
  66. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
  67. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/VisualElement.js +58 -50
  68. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/dom/DOMVisualElement.js +7 -6
  69. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
  70. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +38 -0
  71. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
  72. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +37 -0
  73. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +14 -0
  74. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
  75. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
  76. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
  77. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
  78. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/animation-state.js +31 -31
  79. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-controlling-variants.js +1 -1
  80. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
  81. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/motion-values.js +6 -6
  82. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
  83. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/setters.js +4 -4
  84. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/delay.js +2 -2
  85. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +8 -6
  86. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +62 -42
  87. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
  88. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
  89. package/dist/node_modules/motion-utils/dist/es/errors.js +10 -9
  90. package/package.json +1 -1
  91. package/dist/node_modules/framer-motion/dist/es/animation/animate/single-value.js +0 -10
  92. package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -8
  93. package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -58
  94. package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -10
  95. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -4
  96. package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -38
  97. package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -29
  98. package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -31
  99. package/dist/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -12
  100. package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -40
  101. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -23
  102. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -18
  103. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
  104. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -13
  105. package/dist/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
  106. package/dist/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -7
  107. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-variant.js +0 -0
  108. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element.js +0 -0
  109. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/data-id.js +0 -0
  110. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/get-appear-id.js +0 -0
  111. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/calc-child-stagger.js +0 -0
  112. /package/dist/node_modules/{framer-motion/dist/es/animation/animators/waapi → motion-dom/dist/es/animation}/utils/get-final-keyframe.js +0 -0
  113. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/is-transition-defined.js +0 -0
  114. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/events/add-dom-event.js +0 -0
  115. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/conversion.js +0 -0
  116. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/copy.js +0 -0
  117. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/models.js +0 -0
  118. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/utils.js +0 -0
  119. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/HTMLProjectionNode.js +0 -0
  120. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/state.js +0 -0
  121. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/transform.js +0 -0
  122. /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/compare-by-depth.js +0 -0
  123. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/each-axis.js +0 -0
  124. /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/flat-tree.js +0 -0
  125. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/has-transform.js +0 -0
  126. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/measure.js +0 -0
  127. /package/dist/node_modules/{framer-motion/dist/es/motion/features → motion-dom/dist/es/render}/Feature.js +0 -0
  128. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/html/utils/render.js +0 -0
  129. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/object/ObjectVisualElement.js +0 -0
  130. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/store.js +0 -0
  131. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/camel-case-attrs.js +0 -0
  132. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/is-svg-tag.js +0 -0
  133. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/render.js +0 -0
  134. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/get-variant-context.js +0 -0
  135. /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-animation-controls.js +0 -0
  136. /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-keyframes-target.js +0 -0
  137. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-variant-label.js +0 -0
  138. /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/reduced-motion/state.js +0 -0
  139. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-dynamic-variants.js +0 -0
  140. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-variants.js +0 -0
  141. /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/shallow-compare.js +0 -0
  142. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/variant-props.js +0 -0
  143. /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
@@ -1,45 +1,47 @@
1
- import { jsx as E, Fragment as N } from "react/jsx-runtime";
2
- import { useMemo as F, useRef as w, useState as k, useContext as G } from "react";
1
+ import { jsx as k, Fragment as Y } from "react/jsx-runtime";
2
+ import { useMemo as F, useRef as p, useState as v, useContext as G } from "react";
3
3
  import { LayoutGroupContext as O } from "../../context/LayoutGroupContext.js";
4
4
  import { useConstant as R } from "../../utils/use-constant.js";
5
- import { useIsomorphicLayoutEffect as S } from "../../utils/use-isomorphic-effect.js";
6
- import { PresenceChild as V } from "./PresenceChild.js";
7
- import { usePresence as X } from "./use-presence.js";
8
- import { onlyElements as v, getChildKey as c } from "./utils.js";
9
- const T = ({ children: h, custom: A, initial: L = !0, onExitComplete: p, presenceAffectsLayout: b = !0, mode: u = "sync", propagate: l = !1, anchorX: j = "left", root: D }) => {
10
- const [C, f] = X(l), n = F(() => v(h), [h]), o = l && !C ? [] : n.map(c), y = w(!0), x = w(n), r = R(() => /* @__PURE__ */ new Map()), [I, K] = k(n), [i, P] = k(n);
11
- S(() => {
12
- y.current = !1, x.current = n;
13
- for (let t = 0; t < i.length; t++) {
14
- const e = c(i[t]);
15
- o.includes(e) ? r.delete(e) : r.get(e) !== !0 && r.set(e, !1);
5
+ import { useIsomorphicLayoutEffect as V } from "../../utils/use-isomorphic-effect.js";
6
+ import { PresenceChild as X } from "./PresenceChild.js";
7
+ import { usePresence as _ } from "./use-presence.js";
8
+ import { onlyElements as A, getChildKey as c } from "./utils.js";
9
+ const W = ({ children: C, custom: L, initial: b = !0, onExitComplete: y, presenceAffectsLayout: j = !0, mode: u = "sync", propagate: l = !1, anchorX: D = "left", anchorY: I = "top", root: K }) => {
10
+ const [x, f] = _(l), n = F(() => A(C), [C]), o = l && !x ? [] : n.map(c), g = p(!0), P = p(n), i = R(() => /* @__PURE__ */ new Map()), d = p(/* @__PURE__ */ new Set()), [M, N] = v(n), [r, w] = v(n);
11
+ V(() => {
12
+ g.current = !1, P.current = n;
13
+ for (let t = 0; t < r.length; t++) {
14
+ const e = c(r[t]);
15
+ o.includes(e) ? (i.delete(e), d.current.delete(e)) : i.get(e) !== !0 && i.set(e, !1);
16
16
  }
17
- }, [i, o.length, o.join("-")]);
18
- const d = [];
19
- if (n !== I) {
17
+ }, [r, o.length, o.join("-")]);
18
+ const m = [];
19
+ if (n !== M) {
20
20
  let t = [...n];
21
- for (let e = 0; e < i.length; e++) {
22
- const s = i[e], a = c(s);
23
- o.includes(a) || (t.splice(e, 0, s), d.push(s));
21
+ for (let e = 0; e < r.length; e++) {
22
+ const s = r[e], h = c(s);
23
+ o.includes(h) || (t.splice(e, 0, s), m.push(s));
24
24
  }
25
- return u === "wait" && d.length && (t = d), P(v(t)), K(n), null;
25
+ return u === "wait" && m.length && (t = m), w(A(t)), N(n), null;
26
26
  }
27
- process.env.NODE_ENV !== "production" && u === "wait" && i.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
28
- const { forceRender: m } = G(O);
29
- return E(N, { children: i.map((t) => {
30
- const e = c(t), s = l && !C ? !1 : n === i || o.includes(e), a = () => {
31
- if (r.has(e))
32
- r.set(e, !0);
27
+ process.env.NODE_ENV !== "production" && u === "wait" && r.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
28
+ const { forceRender: a } = G(O);
29
+ return k(Y, { children: r.map((t) => {
30
+ const e = c(t), s = l && !x ? !1 : n === r || o.includes(e), h = () => {
31
+ if (d.current.has(e))
32
+ return;
33
+ if (d.current.add(e), i.has(e))
34
+ i.set(e, !0);
33
35
  else
34
36
  return;
35
- let g = !0;
36
- r.forEach((M) => {
37
- M || (g = !1);
38
- }), g && (m == null || m(), P(x.current), l && (f == null || f()), p && p());
37
+ let E = !0;
38
+ i.forEach((S) => {
39
+ S || (E = !1);
40
+ }), E && (a == null || a(), w(P.current), l && (f == null || f()), y && y());
39
41
  };
40
- return E(V, { isPresent: s, initial: !y.current || L ? void 0 : !1, custom: A, presenceAffectsLayout: b, mode: u, root: D, onExitComplete: s ? void 0 : a, anchorX: j, children: t }, e);
42
+ return k(X, { isPresent: s, initial: !g.current || b ? void 0 : !1, custom: L, presenceAffectsLayout: j, mode: u, root: K, onExitComplete: s ? void 0 : h, anchorX: D, anchorY: I, children: t }, e);
41
43
  }) });
42
44
  };
43
45
  export {
44
- T as AnimatePresence
46
+ W as AnimatePresence
45
47
  };
@@ -1,38 +1,46 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as x, useRef as g, useEffect as h } from "react";
3
- import { ReorderContext as y } from "../../context/ReorderContext.js";
4
- import { motion as C } from "../../render/components/motion/proxy.js";
5
- import { useConstant as G } from "../../utils/use-constant.js";
6
- import { checkReorder as O } from "./utils/check-reorder.js";
7
- import { invariant as w } from "../../../../../motion-utils/dist/es/errors.js";
8
- function I({ children: e, as: u = "ul", axis: f = "y", onReorder: p, values: c, ...s }, a) {
9
- const l = G(() => C[u]), r = [], m = g(!1);
10
- w(!!c, "Reorder.Group must be provided a values prop", "reorder-values");
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as w, useRef as a, useEffect as G } from "react";
3
+ import { ReorderContext as O } from "../../context/ReorderContext.js";
4
+ import { motion as x } from "../../render/components/motion/proxy.js";
5
+ import { useConstant as I } from "../../utils/use-constant.js";
6
+ import { checkReorder as S } from "./utils/check-reorder.js";
7
+ import { invariant as b } from "../../../../../motion-utils/dist/es/errors.js";
8
+ function j({ children: e, as: c = "ul", axis: f = "y", onReorder: v, values: d, ...m }, t) {
9
+ const y = I(() => x[c]), o = [], s = a(!1), p = a(null);
10
+ b(!!d, "Reorder.Group must be provided a values prop", "reorder-values");
11
11
  const R = {
12
12
  axis: f,
13
- registerItem: (o, t) => {
14
- const n = r.findIndex((i) => o === i.value);
15
- n !== -1 ? r[n].layout = t[f] : r.push({ value: o, layout: t[f] }), r.sort(j);
13
+ groupRef: p,
14
+ registerItem: (r, n) => {
15
+ const u = o.findIndex((i) => r === i.value);
16
+ u !== -1 ? o[u].layout = n[f] : o.push({ value: r, layout: n[f] }), o.sort(A);
16
17
  },
17
- updateOrder: (o, t, n) => {
18
- if (m.current)
18
+ updateOrder: (r, n, u) => {
19
+ if (s.current)
19
20
  return;
20
- const i = O(r, o, t, n);
21
- r !== i && (m.current = !0, p(i.map(b).filter((v) => c.indexOf(v) !== -1)));
21
+ const i = S(o, r, n, u);
22
+ o !== i && (s.current = !0, v(i.map(k).filter((C) => d.indexOf(C) !== -1)));
22
23
  }
23
24
  };
24
- return h(() => {
25
- m.current = !1;
26
- }), d(l, { ...s, ref: a, ignoreStrict: !0, children: d(y.Provider, { value: R, children: e }) });
25
+ G(() => {
26
+ s.current = !1;
27
+ });
28
+ const g = (r) => {
29
+ p.current = r, typeof t == "function" ? t(r) : t && (t.current = r);
30
+ }, h = {
31
+ overflowAnchor: "none",
32
+ ...m.style
33
+ };
34
+ return l(y, { ...m, style: h, ref: g, ignoreStrict: !0, children: l(O.Provider, { value: R, children: e }) });
27
35
  }
28
- const q = /* @__PURE__ */ x(I);
29
- function b(e) {
36
+ const D = /* @__PURE__ */ w(j);
37
+ function k(e) {
30
38
  return e.value;
31
39
  }
32
- function j(e, u) {
33
- return e.layout.min - u.layout.min;
40
+ function A(e, c) {
41
+ return e.layout.min - c.layout.min;
34
42
  }
35
43
  export {
36
- q as ReorderGroup,
37
- I as ReorderGroupComponent
44
+ D as ReorderGroup,
45
+ j as ReorderGroupComponent
38
46
  };
@@ -1,29 +1,34 @@
1
- import { jsx as C } from "react/jsx-runtime";
2
- import { forwardRef as I, useContext as M } from "react";
3
- import { ReorderContext as h } from "../../context/ReorderContext.js";
4
- import { motion as V } from "../../render/components/motion/proxy.js";
5
- import { useConstant as O } from "../../utils/use-constant.js";
6
- import { useMotionValue as S } from "../../value/use-motion-value.js";
7
- import { useTransform as T } from "../../value/use-transform.js";
8
- import { isMotionValue as b } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
9
- import { invariant as j } from "../../../../../motion-utils/dist/es/errors.js";
10
- function f(e, o = 0) {
11
- return b(e) ? e : S(o);
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { forwardRef as V, useContext as O } from "react";
3
+ import { ReorderContext as T } from "../../context/ReorderContext.js";
4
+ import { motion as b } from "../../render/components/motion/proxy.js";
5
+ import { useConstant as j } from "../../utils/use-constant.js";
6
+ import { useMotionValue as w } from "../../value/use-motion-value.js";
7
+ import { useTransform as z } from "../../value/use-transform.js";
8
+ import { autoScrollIfNeeded as A, resetAutoScrollState as B } from "./utils/auto-scroll.js";
9
+ import { isMotionValue as D } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
10
+ import { invariant as G } from "../../../../../motion-utils/dist/es/errors.js";
11
+ function a(i, e = 0) {
12
+ return D(i) ? i : w(e);
12
13
  }
13
- function w({ children: e, style: o = {}, value: m, as: p = "li", onDrag: u, layout: c = !0, ...d }, x) {
14
- const l = O(() => V[p]), s = M(h), r = {
15
- x: f(o.x),
16
- y: f(o.y)
17
- }, y = T([r.x, r.y], ([t, i]) => t || i ? 1 : "unset");
18
- j(!!s, "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
19
- const { axis: n, registerItem: R, updateOrder: g } = s;
20
- return C(l, { drag: n, ...d, dragSnapToOrigin: !0, style: { ...o, x: r.x, y: r.y, zIndex: y }, layout: c, onDrag: (t, i) => {
21
- const { velocity: a } = i;
22
- a[n] && g(m, r[n].get(), a[n]), u && u(t, i);
23
- }, onLayoutMeasure: (t) => R(m, t), ref: x, ignoreStrict: !0, children: e });
14
+ function L({ children: i, style: e = {}, value: m, as: c = "li", onDrag: u, onDragEnd: f, layout: d = !0, ...l }, x) {
15
+ const y = j(() => b[c]), s = O(T), n = {
16
+ x: a(e.x),
17
+ y: a(e.y)
18
+ }, R = z([n.x, n.y], ([o, t]) => o || t ? 1 : "unset");
19
+ G(!!s, "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
20
+ const { axis: r, registerItem: g, updateOrder: I, groupRef: C } = s;
21
+ return h(y, { drag: r, ...l, dragSnapToOrigin: !0, style: { ...e, x: n.x, y: n.y, zIndex: R }, layout: d, onDrag: (o, t) => {
22
+ const { velocity: p, point: S } = t, M = n[r].get();
23
+ I(m, M, p[r]), A(C.current, S[r], r, p[r]), u && u(o, t);
24
+ }, onDragEnd: (o, t) => {
25
+ B(), f && f(o, t);
26
+ }, onLayoutMeasure: (o) => {
27
+ g(m, o);
28
+ }, ref: x, ignoreStrict: !0, children: i });
24
29
  }
25
- const E = /* @__PURE__ */ I(w);
30
+ const Q = /* @__PURE__ */ V(L);
26
31
  export {
27
- E as ReorderItem,
28
- w as ReorderItemComponent
32
+ Q as ReorderItem,
33
+ L as ReorderItemComponent
29
34
  };
@@ -0,0 +1,64 @@
1
+ const g = /* @__PURE__ */ new Set(["auto", "scroll"]), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
2
+ let i = null;
3
+ function p() {
4
+ if (i) {
5
+ const o = f(i, "y");
6
+ o && (d.delete(o), u.delete(o));
7
+ const l = f(i, "x");
8
+ l && l !== o && (d.delete(l), u.delete(l)), i = null;
9
+ }
10
+ }
11
+ function m(o, l) {
12
+ const t = getComputedStyle(o), n = l === "x" ? t.overflowX : t.overflowY;
13
+ return g.has(n);
14
+ }
15
+ function f(o, l) {
16
+ let t = o == null ? void 0 : o.parentElement;
17
+ for (; t; ) {
18
+ if (m(t, l))
19
+ return t;
20
+ t = t.parentElement;
21
+ }
22
+ return null;
23
+ }
24
+ function w(o, l, t) {
25
+ const n = l.getBoundingClientRect(), e = t === "x" ? n.left : n.top, a = t === "x" ? n.right : n.bottom, c = o - e, r = a - o;
26
+ if (c < 50) {
27
+ const s = 1 - c / 50;
28
+ return { amount: -25 * s * s, edge: "start" };
29
+ } else if (r < 50) {
30
+ const s = 1 - r / 50;
31
+ return { amount: 25 * s * s, edge: "end" };
32
+ }
33
+ return { amount: 0, edge: null };
34
+ }
35
+ function A(o, l, t, n) {
36
+ if (!o)
37
+ return;
38
+ i = o;
39
+ const e = f(o, t);
40
+ if (!e)
41
+ return;
42
+ const a = l - (t === "x" ? window.scrollX : window.scrollY), { amount: c, edge: r } = w(a, e, t);
43
+ if (r === null) {
44
+ d.delete(e), u.delete(e);
45
+ return;
46
+ }
47
+ if (d.get(e) !== r) {
48
+ if (!(r === "start" && n < 0 || r === "end" && n > 0))
49
+ return;
50
+ d.set(e, r);
51
+ const h = t === "x" ? e.scrollWidth - e.clientWidth : e.scrollHeight - e.clientHeight;
52
+ u.set(e, h);
53
+ }
54
+ if (c > 0) {
55
+ const S = u.get(e);
56
+ if ((t === "x" ? e.scrollLeft : e.scrollTop) >= S)
57
+ return;
58
+ }
59
+ t === "x" ? e.scrollLeft += c : e.scrollTop += c;
60
+ }
61
+ export {
62
+ A as autoScrollIfNeeded,
63
+ p as resetAutoScrollState
64
+ };
@@ -1,5 +1,5 @@
1
- import { isControllingVariants as r } from "../../render/utils/is-controlling-variants.js";
2
- import { isVariantLabel as e } from "../../render/utils/is-variant-label.js";
1
+ import { isControllingVariants as r } from "../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.js";
2
+ import { isVariantLabel as e } from "../../../../../motion-dom/dist/es/render/utils/is-variant-label.js";
3
3
  function o(i, a) {
4
4
  if (r(i)) {
5
5
  const { initial: n, animate: t } = i;
@@ -1,7 +1,7 @@
1
- import { addDomEvent as d } from "./add-dom-event.js";
2
- import { addPointerInfo as e } from "./event-info.js";
1
+ import { addPointerInfo as d } from "./event-info.js";
2
+ import { addDomEvent as e } from "../../../../motion-dom/dist/es/events/add-dom-event.js";
3
3
  function f(o, r, t, n) {
4
- return d(o, r, e(t), n);
4
+ return e(o, r, d(t), n);
5
5
  }
6
6
  export {
7
7
  f as addPointerEvent