@eightshift/ui-components 6.0.6 → 6.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 (99) hide show
  1. package/dist/{Button-BXjXzdW_.js → Button-JRIu2BnS.js} +8 -8
  2. package/dist/{Dialog-D8bjn-nh.js → Dialog-Dd1yqNus.js} +31 -27
  3. package/dist/{FieldError-DwBG6m1U.js → FieldError-DmVwL6Dj.js} +2 -2
  4. package/dist/{FocusScope-BMk5oZCk.js → FocusScope-Dri1oBcH.js} +2 -2
  5. package/dist/{Heading-BmRX4BRL.js → Heading-eA6LXIKB.js} +1 -1
  6. package/dist/{Input-CNNksOWg.js → Input-Cuw9UbNb.js} +14 -24
  7. package/dist/{Label-D8a3eYb-.js → Label-DPWyf-gp.js} +1 -1
  8. package/dist/{List-BGHOoFf0.js → List-CWheI3JH.js} +1 -1
  9. package/dist/{ListBox-Dd37zMvs.js → ListBox-DT1sFY3e.js} +17 -16
  10. package/dist/{OverlayArrow-DokC40S3.js → OverlayArrow-DVJTTfZM.js} +67 -123
  11. package/dist/{RadioGroup-BVFvITWO.js → RadioGroup-Cp5cdBI_.js} +14 -14
  12. package/dist/{SearchField-CHYnN-jt.js → SearchField-CLhr5PGZ.js} +44 -37
  13. package/dist/{SelectionManager-N8X7T_4D.js → SelectionManager-DbBiF5M8.js} +41 -68
  14. package/dist/{SharedElementTransition-BDT84GtD.js → SharedElementTransition-B_vnQ1uR.js} +1 -1
  15. package/dist/{Slider-CL5CM9S8.js → Slider-CZV3HhHY.js} +119 -83
  16. package/dist/{Text-ztX6G1zR.js → Text-Dae33gHp.js} +1 -1
  17. package/dist/{VisuallyHidden-DTUuKFiI.js → VisuallyHidden-eaCBtXhE.js} +2 -2
  18. package/dist/animation-DY7CNkr6.js +67 -0
  19. package/dist/assets/style-admin.css +38 -45
  20. package/dist/assets/style-editor.css +38 -45
  21. package/dist/assets/style.css +38 -45
  22. package/dist/assets/wp-overrides/allow-full-width-blocks.css +1 -1
  23. package/dist/assets/wp-overrides/fix-label-text-case.css +1 -1
  24. package/dist/assets/wp-overrides/increase-sidebar-width.css +1 -1
  25. package/dist/assets/wp-overrides/make-block-messages-nicer.css +1 -1
  26. package/dist/assets/wp-overrides/replace-fonts.css +1 -1
  27. package/dist/assets/wp-overrides/restyle-tooltips.css +1 -1
  28. package/dist/assets/wp-overrides/round-corners.css +1 -1
  29. package/dist/assets/wp-overrides/unify-button-sizes.css +1 -1
  30. package/dist/{color-swatch-BEBLRxTy.js → color-swatch-CZj0jHZd.js} +4 -4
  31. package/dist/components/animated-visibility/animated-visibility.js +2 -2
  32. package/dist/components/base-control/base-control.js +1 -1
  33. package/dist/components/button/button.js +5 -5
  34. package/dist/components/checkbox/checkbox.js +10 -10
  35. package/dist/components/color-pickers/color-picker.js +1 -1
  36. package/dist/components/color-pickers/color-swatch.js +1 -1
  37. package/dist/components/color-pickers/gradient-editor.js +2 -2
  38. package/dist/components/color-pickers/solid-color-picker.js +17 -17
  39. package/dist/components/draggable/draggable.js +43 -44
  40. package/dist/components/draggable-list/draggable-list.js +11 -16
  41. package/dist/components/expandable/expandable.js +13 -12
  42. package/dist/components/index.js +1 -1
  43. package/dist/components/input-field/input-field.js +8 -8
  44. package/dist/components/link-input/link-input.js +25 -25
  45. package/dist/components/matrix-align/matrix-align.js +1 -1
  46. package/dist/components/menu/menu.js +1 -1
  47. package/dist/components/modal/modal.js +19 -12
  48. package/dist/components/number-picker/number-picker.js +9 -9
  49. package/dist/components/options-panel/options-panel.js +1 -1
  50. package/dist/components/popover/popover.js +5 -5
  51. package/dist/components/radio/radio.js +2 -2
  52. package/dist/components/repeater/repeater-item.js +3 -2
  53. package/dist/components/repeater/repeater.js +23 -23
  54. package/dist/components/responsive/mini-responsive.js +1 -1
  55. package/dist/components/select/async-multi-select.js +10 -10
  56. package/dist/components/select/async-select.js +10 -10
  57. package/dist/components/select/multi-select.js +10 -10
  58. package/dist/components/select/shared.js +3 -3
  59. package/dist/components/select/single-select.js +10 -10
  60. package/dist/components/slider/column-config-slider.js +3 -3
  61. package/dist/components/slider/slider.js +3 -3
  62. package/dist/components/smart-image/smart-image.js +1 -1
  63. package/dist/components/smart-image/worker-inline.js +1 -1
  64. package/dist/components/tabs/tabs.js +36 -17
  65. package/dist/components/toggle/switch.js +7 -7
  66. package/dist/components/toggle/toggle.js +1 -1
  67. package/dist/components/toggle-button/toggle-button.js +6 -6
  68. package/dist/components/tooltip/tooltip.js +10 -8
  69. package/dist/{context-BQvmiUqb.js → context-DYYO3Ns3.js} +9 -6
  70. package/dist/{filterDOMProps-D2C6R0DK.js → filterDOMProps-eGTqWSTd.js} +1 -1
  71. package/dist/{general-ChNQK6O9.js → general-C8Q0dvEx.js} +15 -14
  72. package/dist/{index-oFgxU4zs.js → index-sSixe2j_.js} +20 -20
  73. package/dist/index.js +1 -1
  74. package/dist/{proxy-DkQpcQgI.js → proxy-Bj4KTTJt.js} +190 -119
  75. package/dist/{shared-DOxXagm0.js → shared-Bg9lx3pE.js} +20 -20
  76. package/dist/{textSelection-CwHUtNVX.js → textSelection-Cq_Br7RW.js} +1 -1
  77. package/dist/{useAsyncList-D52mQcrH.js → useAsyncList-DsZvQXls.js} +5 -2
  78. package/dist/{useButton-DdZrS1Kz.js → useButton-CeuyDay5.js} +4 -4
  79. package/dist/{useEvent-BD7Olibq.js → useEvent-DoWvho2u.js} +2 -3
  80. package/dist/{useFilter-bhxeEDg8.js → useFilter-DYtfYPua.js} +1 -1
  81. package/dist/{useFocusRing-D3b7Kh4P.js → useFocusRing-WEswknAY.js} +1 -1
  82. package/dist/{useFormReset-WUv2PdFO.js → useFormReset-BDF1K4E4.js} +2 -3
  83. package/dist/{useFormValidation-DQeXkyLm.js → useFormValidation-Dqzjv4jX.js} +2 -5
  84. package/dist/{useHover-Bycb7BsD.js → useHover-CG39Ci3A.js} +164 -66
  85. package/dist/{useLabel-Bnv4-T24.js → useLabel--3fT2XKM.js} +2 -2
  86. package/dist/{useLabels-B49ptFDX.js → useLabels-vzdDMGCX.js} +1 -1
  87. package/dist/{useListState-ZKhRO8ML.js → useListState-Bya9g7W8.js} +1 -1
  88. package/dist/{useLocalizedStringFormatter-NETP-8H8.js → useLocalizedStringFormatter-M3L6Ge2c.js} +3 -3
  89. package/dist/{useNumberField-D2fUHql3.js → useNumberField-D6lsi3Vu.js} +91 -24
  90. package/dist/{useNumberFormatter-DGvuRCn7.js → useNumberFormatter-BWOyCamK.js} +1 -1
  91. package/dist/{usePress-B8OteQMu.js → usePress-B9w0X4Ur.js} +168 -180
  92. package/dist/{useSingleSelectListState-BBTu4shO.js → useSingleSelectListState-D9SqGLJ0.js} +2 -2
  93. package/dist/{useToggle-BZhaYwZl.js → useToggle-Deq2xxQV.js} +5 -5
  94. package/dist/{useToggleState-VkXJjsru.js → useToggleState-j3o1PvdS.js} +1 -1
  95. package/dist/utilities/general.js +1 -1
  96. package/dist/utilities/index.js +1 -1
  97. package/dist/{utils-DGpXyJOJ.js → utils-HC9_3Crc.js} +20 -31
  98. package/dist/workers/image-analysis.worker.js +1 -1
  99. package/package.json +19 -19
@@ -35,7 +35,7 @@ let warning = () => {
35
35
  };
36
36
  let invariant = () => {
37
37
  };
38
- if (process.env.NODE_ENV !== "production") {
38
+ if (typeof process !== "undefined" && process.env?.NODE_ENV !== "production") {
39
39
  warning = (check, message, errorCode) => {
40
40
  if (!check && typeof console !== "undefined") {
41
41
  console.warn(formatErrorMessage(message, errorCode));
@@ -341,6 +341,11 @@ const isCSSVariableToken = (value) => {
341
341
  return singleCssVariableRegex.test(value.split("/*")[0].trim());
342
342
  };
343
343
  const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
344
+ function containsCSSVariable(value) {
345
+ if (typeof value !== "string")
346
+ return false;
347
+ return value.split("/*")[0].includes("var(--");
348
+ }
344
349
  const number = {
345
350
  test: (v) => typeof v === "number",
346
351
  parse: parseFloat,
@@ -1717,6 +1722,7 @@ class NativeAnimation extends WithPromise {
1717
1722
  super();
1718
1723
  this.finishedTime = null;
1719
1724
  this.isStopped = false;
1725
+ this.manualStartTime = null;
1720
1726
  if (!options)
1721
1727
  return;
1722
1728
  const { element, name, keyframes: keyframes2, pseudoElement, allowFlatten = false, finalKeyframe, onComplete } = options;
@@ -1747,6 +1753,7 @@ class NativeAnimation extends WithPromise {
1747
1753
  play() {
1748
1754
  if (this.isStopped)
1749
1755
  return;
1756
+ this.manualStartTime = null;
1750
1757
  this.animation.play();
1751
1758
  if (this.state === "finished") {
1752
1759
  this.updateFinished();
@@ -1809,6 +1816,7 @@ class NativeAnimation extends WithPromise {
1809
1816
  return /* @__PURE__ */ millisecondsToSeconds(Number(this.animation.currentTime) || 0);
1810
1817
  }
1811
1818
  set time(newTime) {
1819
+ this.manualStartTime = null;
1812
1820
  this.finishedTime = null;
1813
1821
  this.animation.currentTime = /* @__PURE__ */ secondsToMilliseconds(newTime);
1814
1822
  }
@@ -1828,10 +1836,10 @@ class NativeAnimation extends WithPromise {
1828
1836
  return this.finishedTime !== null ? "finished" : this.animation.playState;
1829
1837
  }
1830
1838
  get startTime() {
1831
- return Number(this.animation.startTime);
1839
+ return this.manualStartTime ?? Number(this.animation.startTime);
1832
1840
  }
1833
1841
  set startTime(newStartTime) {
1834
- this.animation.startTime = newStartTime;
1842
+ this.manualStartTime = this.animation.startTime = newStartTime;
1835
1843
  }
1836
1844
  /**
1837
1845
  * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
@@ -1868,7 +1876,7 @@ class NativeAnimationExtended extends NativeAnimation {
1868
1876
  replaceStringEasing(options);
1869
1877
  replaceTransitionType(options);
1870
1878
  super(options);
1871
- if (options.startTime) {
1879
+ if (options.startTime !== void 0) {
1872
1880
  this.startTime = options.startTime;
1873
1881
  }
1874
1882
  this.options = options;
@@ -1876,7 +1884,7 @@ class NativeAnimationExtended extends NativeAnimation {
1876
1884
  /**
1877
1885
  * WAAPI doesn't natively have any interruption capabilities.
1878
1886
  *
1879
- * Rather than read commited styles back out of the DOM, we can
1887
+ * Rather than read committed styles back out of the DOM, we can
1880
1888
  * create a renderless JS animation and sample it twice to calculate
1881
1889
  * its current value, "previous" value, and therefore allow
1882
1890
  * Motion to calculate velocity for any subsequent animation.
@@ -1893,8 +1901,9 @@ class NativeAnimationExtended extends NativeAnimation {
1893
1901
  ...options,
1894
1902
  autoplay: false
1895
1903
  });
1896
- const sampleTime = /* @__PURE__ */ secondsToMilliseconds(this.finishedTime ?? this.time);
1897
- motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
1904
+ const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);
1905
+ const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);
1906
+ motionValue2.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);
1898
1907
  sampleAnimation.stop();
1899
1908
  }
1900
1909
  }
@@ -2210,17 +2219,36 @@ const numberValueTypes = {
2210
2219
  right: px,
2211
2220
  bottom: px,
2212
2221
  left: px,
2222
+ inset: px,
2223
+ insetBlock: px,
2224
+ insetBlockStart: px,
2225
+ insetBlockEnd: px,
2226
+ insetInline: px,
2227
+ insetInlineStart: px,
2228
+ insetInlineEnd: px,
2213
2229
  // Spacing props
2214
2230
  padding: px,
2215
2231
  paddingTop: px,
2216
2232
  paddingRight: px,
2217
2233
  paddingBottom: px,
2218
2234
  paddingLeft: px,
2235
+ paddingBlock: px,
2236
+ paddingBlockStart: px,
2237
+ paddingBlockEnd: px,
2238
+ paddingInline: px,
2239
+ paddingInlineStart: px,
2240
+ paddingInlineEnd: px,
2219
2241
  margin: px,
2220
2242
  marginTop: px,
2221
2243
  marginRight: px,
2222
2244
  marginBottom: px,
2223
2245
  marginLeft: px,
2246
+ marginBlock: px,
2247
+ marginBlockStart: px,
2248
+ marginBlockEnd: px,
2249
+ marginInline: px,
2250
+ marginInlineStart: px,
2251
+ marginInlineEnd: px,
2224
2252
  // Misc
2225
2253
  backgroundPositionX: px,
2226
2254
  backgroundPositionY: px,
@@ -2303,6 +2331,12 @@ class DOMKeyframesResolver extends KeyframeResolver {
2303
2331
  const [origin, target] = unresolvedKeyframes;
2304
2332
  const originType = findDimensionValueType(origin);
2305
2333
  const targetType = findDimensionValueType(target);
2334
+ const originHasVar = containsCSSVariable(origin);
2335
+ const targetHasVar = containsCSSVariable(target);
2336
+ if (originHasVar !== targetHasVar && positionalValues[name]) {
2337
+ this.needsMeasurement = true;
2338
+ return;
2339
+ }
2306
2340
  if (originType === targetType)
2307
2341
  return;
2308
2342
  if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {
@@ -2736,7 +2770,7 @@ const isPrimaryPointer = (event) => {
2736
2770
  return event.isPrimary !== false;
2737
2771
  }
2738
2772
  };
2739
- const focusableElements = /* @__PURE__ */ new Set([
2773
+ const interactiveElements = /* @__PURE__ */ new Set([
2740
2774
  "BUTTON",
2741
2775
  "INPUT",
2742
2776
  "SELECT",
@@ -2744,7 +2778,7 @@ const focusableElements = /* @__PURE__ */ new Set([
2744
2778
  "A"
2745
2779
  ]);
2746
2780
  function isElementKeyboardAccessible(element) {
2747
- return focusableElements.has(element.tagName) || element.tabIndex !== -1;
2781
+ return interactiveElements.has(element.tagName) || element.isContentEditable === true;
2748
2782
  }
2749
2783
  const isPressing = /* @__PURE__ */ new WeakSet();
2750
2784
  function filterEvents(callback) {
@@ -2903,7 +2937,8 @@ function PopChild({ children, isPresent, anchorX, root }) {
2903
2937
  right: 0
2904
2938
  });
2905
2939
  const { nonce } = useContext(MotionConfigContext);
2906
- const composedRef = useComposedRefs(ref, children?.ref);
2940
+ const childRef = children.props?.ref ?? children?.ref;
2941
+ const composedRef = useComposedRefs(ref, childRef);
2907
2942
  useInsertionEffect(() => {
2908
2943
  const { width, height, top, left, right } = size.current;
2909
2944
  if (isPresent || !ref.current || !width || !height)
@@ -3006,6 +3041,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
3006
3041
  const isInitialRender = useRef(true);
3007
3042
  const pendingPresentChildren = useRef(presentChildren);
3008
3043
  const exitComplete = useConstant(() => /* @__PURE__ */ new Map());
3044
+ const exitingComponents = useRef(/* @__PURE__ */ new Set());
3009
3045
  const [diffedChildren, setDiffedChildren] = useState(presentChildren);
3010
3046
  const [renderedChildren, setRenderedChildren] = useState(presentChildren);
3011
3047
  useIsomorphicLayoutEffect(() => {
@@ -3019,6 +3055,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
3019
3055
  }
3020
3056
  } else {
3021
3057
  exitComplete.delete(key);
3058
+ exitingComponents.current.delete(key);
3022
3059
  }
3023
3060
  }
3024
3061
  }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
@@ -3048,6 +3085,10 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
3048
3085
  const key = getChildKey(child);
3049
3086
  const isPresent = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key);
3050
3087
  const onExit = () => {
3088
+ if (exitingComponents.current.has(key)) {
3089
+ return;
3090
+ }
3091
+ exitingComponents.current.add(key);
3051
3092
  if (exitComplete.has(key)) {
3052
3093
  exitComplete.set(key, true);
3053
3094
  } else {
@@ -3200,15 +3241,63 @@ function useCreateMotionContext(props) {
3200
3241
  function variantLabelsAsDependency(prop) {
3201
3242
  return Array.isArray(prop) ? prop.join(" ") : prop;
3202
3243
  }
3203
- const scaleCorrectors = {};
3204
- function addScaleCorrector(correctors) {
3205
- for (const key in correctors) {
3206
- scaleCorrectors[key] = correctors[key];
3207
- if (isCSSVariableName(key)) {
3208
- scaleCorrectors[key].isCSSVariable = true;
3244
+ function pixelsToPercent(pixels, axis) {
3245
+ if (axis.max === axis.min)
3246
+ return 0;
3247
+ return pixels / (axis.max - axis.min) * 100;
3248
+ }
3249
+ const correctBorderRadius = {
3250
+ correct: (latest, node) => {
3251
+ if (!node.target)
3252
+ return latest;
3253
+ if (typeof latest === "string") {
3254
+ if (px.test(latest)) {
3255
+ latest = parseFloat(latest);
3256
+ } else {
3257
+ return latest;
3258
+ }
3209
3259
  }
3260
+ const x = pixelsToPercent(latest, node.target.x);
3261
+ const y = pixelsToPercent(latest, node.target.y);
3262
+ return `${x}% ${y}%`;
3210
3263
  }
3211
- }
3264
+ };
3265
+ const correctBoxShadow = {
3266
+ correct: (latest, { treeScale, projectionDelta }) => {
3267
+ const original = latest;
3268
+ const shadow = complex.parse(latest);
3269
+ if (shadow.length > 5)
3270
+ return original;
3271
+ const template = complex.createTransformer(latest);
3272
+ const offset = typeof shadow[0] !== "number" ? 1 : 0;
3273
+ const xScale = projectionDelta.x.scale * treeScale.x;
3274
+ const yScale = projectionDelta.y.scale * treeScale.y;
3275
+ shadow[0 + offset] /= xScale;
3276
+ shadow[1 + offset] /= yScale;
3277
+ const averageScale = mixNumber$1(xScale, yScale, 0.5);
3278
+ if (typeof shadow[2 + offset] === "number")
3279
+ shadow[2 + offset] /= averageScale;
3280
+ if (typeof shadow[3 + offset] === "number")
3281
+ shadow[3 + offset] /= averageScale;
3282
+ return template(shadow);
3283
+ }
3284
+ };
3285
+ const scaleCorrectors = {
3286
+ borderRadius: {
3287
+ ...correctBorderRadius,
3288
+ applyTo: [
3289
+ "borderTopLeftRadius",
3290
+ "borderTopRightRadius",
3291
+ "borderBottomLeftRadius",
3292
+ "borderBottomRightRadius"
3293
+ ]
3294
+ },
3295
+ borderTopLeftRadius: correctBorderRadius,
3296
+ borderTopRightRadius: correctBorderRadius,
3297
+ borderBottomLeftRadius: correctBorderRadius,
3298
+ borderBottomRightRadius: correctBorderRadius,
3299
+ boxShadow: correctBoxShadow
3300
+ };
3212
3301
  function isForcedMotionValue(key, { layout: layout2, layoutId }) {
3213
3302
  return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
3214
3303
  }
@@ -3344,6 +3433,12 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
3344
3433
  const pathSpacing = px.transform(spacing);
3345
3434
  attrs[keys.array] = `${pathLength} ${pathSpacing}`;
3346
3435
  }
3436
+ const cssMotionPathProperties = [
3437
+ "offsetDistance",
3438
+ "offsetPath",
3439
+ "offsetRotate",
3440
+ "offsetAnchor"
3441
+ ];
3347
3442
  function buildSVGAttrs(state, {
3348
3443
  attrX,
3349
3444
  attrY,
@@ -3376,6 +3471,12 @@ function buildSVGAttrs(state, {
3376
3471
  style.transformBox = styleProp?.transformBox ?? "fill-box";
3377
3472
  delete attrs.transformBox;
3378
3473
  }
3474
+ for (const key of cssMotionPathProperties) {
3475
+ if (attrs[key] !== void 0) {
3476
+ style[key] = attrs[key];
3477
+ delete attrs[key];
3478
+ }
3479
+ }
3379
3480
  if (attrX !== void 0)
3380
3481
  attrs.x = attrX;
3381
3482
  if (attrY !== void 0)
@@ -3459,8 +3560,8 @@ function isSVGComponent(Component2) {
3459
3560
  }
3460
3561
  return false;
3461
3562
  }
3462
- function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false) {
3463
- const useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
3563
+ function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG) {
3564
+ const useVisualProps = isSVG ?? isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
3464
3565
  const visualProps = useVisualProps(props, latestValues, isStatic, Component2);
3465
3566
  const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
3466
3567
  const elementProps = Component2 !== Fragment$1 ? { ...filteredProps, ...visualProps, ref } : {};
@@ -3579,43 +3680,46 @@ const useSVGVisualState = /* @__PURE__ */ makeUseVisualState({
3579
3680
  scrapeMotionValuesFromProps,
3580
3681
  createRenderState: createSvgRenderState
3581
3682
  });
3582
- const motionComponentSymbol = Symbol.for("motionComponentSymbol");
3583
- function isRefObject(ref) {
3584
- return ref && typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current");
3585
- }
3683
+ const motionComponentSymbol = /* @__PURE__ */ Symbol.for("motionComponentSymbol");
3586
3684
  function useMotionRef(visualState, visualElement, externalRef) {
3587
- return useCallback(
3588
- (instance) => {
3685
+ const externalRefContainer = useRef(externalRef);
3686
+ useInsertionEffect(() => {
3687
+ externalRefContainer.current = externalRef;
3688
+ });
3689
+ const refCleanup = useRef(null);
3690
+ return useCallback((instance) => {
3691
+ if (instance) {
3692
+ visualState.onMount?.(instance);
3693
+ }
3694
+ if (visualElement) {
3695
+ instance ? visualElement.mount(instance) : visualElement.unmount();
3696
+ }
3697
+ const ref = externalRefContainer.current;
3698
+ if (typeof ref === "function") {
3589
3699
  if (instance) {
3590
- visualState.onMount && visualState.onMount(instance);
3591
- }
3592
- if (visualElement) {
3593
- if (instance) {
3594
- visualElement.mount(instance);
3595
- } else {
3596
- visualElement.unmount();
3597
- }
3598
- }
3599
- if (externalRef) {
3600
- if (typeof externalRef === "function") {
3601
- externalRef(instance);
3602
- } else if (isRefObject(externalRef)) {
3603
- externalRef.current = instance;
3700
+ const cleanup = ref(instance);
3701
+ if (typeof cleanup === "function") {
3702
+ refCleanup.current = cleanup;
3604
3703
  }
3704
+ } else if (refCleanup.current) {
3705
+ refCleanup.current();
3706
+ refCleanup.current = null;
3707
+ } else {
3708
+ ref(instance);
3605
3709
  }
3606
- },
3607
- /**
3608
- * Include externalRef in dependencies to ensure the callback updates
3609
- * when the ref changes, allowing proper ref forwarding.
3610
- */
3611
- [visualElement]
3612
- );
3710
+ } else if (ref) {
3711
+ ref.current = instance;
3712
+ }
3713
+ }, [visualElement]);
3613
3714
  }
3614
3715
  const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase();
3615
3716
  const optimizedAppearDataId = "framerAppearId";
3616
3717
  const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
3617
3718
  const SwitchLayoutGroupContext = createContext({});
3618
- function useVisualElement(Component2, visualState, props, createVisualElement, ProjectionNodeConstructor) {
3719
+ function isRefObject(ref) {
3720
+ return ref && typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current");
3721
+ }
3722
+ function useVisualElement(Component2, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {
3619
3723
  const { visualElement: parent } = useContext(MotionContext);
3620
3724
  const lazyContext = useContext(LazyContext);
3621
3725
  const presenceContext = useContext(PresenceContext);
@@ -3629,7 +3733,8 @@ function useVisualElement(Component2, visualState, props, createVisualElement, P
3629
3733
  props,
3630
3734
  presenceContext,
3631
3735
  blockInitialAnimation: presenceContext ? presenceContext.initial === false : false,
3632
- reducedMotionConfig
3736
+ reducedMotionConfig,
3737
+ isSVG
3633
3738
  });
3634
3739
  }
3635
3740
  const visualElement = visualElementRef.current;
@@ -3699,9 +3804,10 @@ function getClosestProjectingNode(visualElement) {
3699
3804
  return void 0;
3700
3805
  return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent);
3701
3806
  }
3702
- function createMotionComponent(Component2, { forwardMotionProps = false } = {}, preloadedFeatures, createVisualElement) {
3807
+ function createMotionComponent(Component2, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {
3703
3808
  preloadedFeatures && loadFeatures(preloadedFeatures);
3704
- const useVisualState = isSVGComponent(Component2) ? useSVGVisualState : useHTMLVisualState;
3809
+ const isSVG = type ? type === "svg" : isSVGComponent(Component2);
3810
+ const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;
3705
3811
  function MotionDOMComponent(props, externalRef) {
3706
3812
  let MeasureLayout2;
3707
3813
  const configAndProps = {
@@ -3716,9 +3822,9 @@ function createMotionComponent(Component2, { forwardMotionProps = false } = {},
3716
3822
  useStrictMode(configAndProps, preloadedFeatures);
3717
3823
  const layoutProjection = getProjectionFunctionality(configAndProps);
3718
3824
  MeasureLayout2 = layoutProjection.MeasureLayout;
3719
- context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode);
3825
+ context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);
3720
3826
  }
3721
- return jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsx(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps)] });
3827
+ return jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsx(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] });
3722
3828
  }
3723
3829
  MotionDOMComponent.displayName = `motion.${typeof Component2 === "string" ? Component2 : `create(${Component2.displayName ?? Component2.name ?? ""})`}`;
3724
3830
  const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);
@@ -4036,10 +4142,16 @@ class VisualElement {
4036
4142
  this.removeFromVariantTree = this.parent.addVariantChild(this);
4037
4143
  }
4038
4144
  this.values.forEach((value, key) => this.bindToMotionValue(key, value));
4039
- if (!hasReducedMotionListener.current) {
4040
- initPrefersReducedMotion();
4145
+ if (this.reducedMotionConfig === "never") {
4146
+ this.shouldReduceMotion = false;
4147
+ } else if (this.reducedMotionConfig === "always") {
4148
+ this.shouldReduceMotion = true;
4149
+ } else {
4150
+ if (!hasReducedMotionListener.current) {
4151
+ initPrefersReducedMotion();
4152
+ }
4153
+ this.shouldReduceMotion = prefersReducedMotion.current;
4041
4154
  }
4042
- this.shouldReduceMotion = this.reducedMotionConfig === "never" ? false : this.reducedMotionConfig === "always" ? true : prefersReducedMotion.current;
4043
4155
  if (process.env.NODE_ENV !== "production") {
4044
4156
  warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
4045
4157
  }
@@ -4443,7 +4555,8 @@ class SVGVisualElement extends DOMVisualElement {
4443
4555
  }
4444
4556
  }
4445
4557
  const createDomVisualElement = (Component2, options) => {
4446
- return isSVGComponent(Component2) ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
4558
+ const isSVG = options.isSVG ?? isSVGComponent(Component2);
4559
+ return isSVG ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
4447
4560
  allowProjection: Component2 !== Fragment$1
4448
4561
  });
4449
4562
  };
@@ -5107,8 +5220,9 @@ class PanSession {
5107
5220
  this.handlePointerUp = (event2, info2) => {
5108
5221
  this.end();
5109
5222
  const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
5110
- if (this.dragSnapToOrigin)
5223
+ if (this.dragSnapToOrigin || !this.startEvent) {
5111
5224
  resumeAnimation && resumeAnimation();
5225
+ }
5112
5226
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
5113
5227
  return;
5114
5228
  const panInfo = getPanInfo(event2.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(info2, this.transformPagePoint), this.history);
@@ -5289,13 +5403,15 @@ class VisualElementDragControls {
5289
5403
  if (presenceContext && presenceContext.isPresent === false)
5290
5404
  return;
5291
5405
  const onSessionStart = (event) => {
5292
- const { dragSnapToOrigin: dragSnapToOrigin2 } = this.getProps();
5293
- dragSnapToOrigin2 ? this.pauseAnimation() : this.stopAnimation();
5294
5406
  if (snapToCursor) {
5407
+ this.stopAnimation();
5295
5408
  this.snapToCursor(extractEventInfo(event).point);
5409
+ } else {
5410
+ this.pauseAnimation();
5296
5411
  }
5297
5412
  };
5298
5413
  const onStart = (event, info) => {
5414
+ this.stopAnimation();
5299
5415
  const { drag: drag2, dragPropagation, onDragStart } = this.getProps();
5300
5416
  if (drag2 && !dragPropagation) {
5301
5417
  if (this.openDragLock)
@@ -5527,7 +5643,8 @@ class VisualElementDragControls {
5527
5643
  const axisValue = this.getAxisMotionValue(axis);
5528
5644
  if (projection && projection.layout) {
5529
5645
  const { min, max } = projection.layout.layoutBox[axis];
5530
- axisValue.set(point[axis] - mixNumber$1(min, max, 0.5));
5646
+ const current = axisValue.get() || 0;
5647
+ axisValue.set(point[axis] - mixNumber$1(min, max, 0.5) + current);
5531
5648
  }
5532
5649
  });
5533
5650
  }
@@ -5572,7 +5689,9 @@ class VisualElementDragControls {
5572
5689
  const element = this.visualElement.current;
5573
5690
  const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
5574
5691
  const { drag: drag2, dragListener = true } = this.getProps();
5575
- drag2 && dragListener && this.start(event);
5692
+ if (drag2 && dragListener && !isElementKeyboardAccessible(event.target)) {
5693
+ this.start(event);
5694
+ }
5576
5695
  });
5577
5696
  const measureDragConstraints = () => {
5578
5697
  const { dragConstraints } = this.getProps();
@@ -5647,6 +5766,16 @@ class DragGesture extends Feature {
5647
5766
  }
5648
5767
  this.removeListeners = this.controls.addListeners() || noop;
5649
5768
  }
5769
+ update() {
5770
+ const { dragControls } = this.node.getProps();
5771
+ const { dragControls: prevDragControls } = this.node.prevProps || {};
5772
+ if (dragControls !== prevDragControls) {
5773
+ this.removeGroupControls();
5774
+ if (dragControls) {
5775
+ this.removeGroupControls = dragControls.subscribe(this.controls);
5776
+ }
5777
+ }
5778
+ }
5650
5779
  unmount() {
5651
5780
  this.removeGroupControls();
5652
5781
  this.removeListeners();
@@ -5705,47 +5834,6 @@ const globalProjectionState = {
5705
5834
  */
5706
5835
  hasEverUpdated: false
5707
5836
  };
5708
- function pixelsToPercent(pixels, axis) {
5709
- if (axis.max === axis.min)
5710
- return 0;
5711
- return pixels / (axis.max - axis.min) * 100;
5712
- }
5713
- const correctBorderRadius = {
5714
- correct: (latest, node) => {
5715
- if (!node.target)
5716
- return latest;
5717
- if (typeof latest === "string") {
5718
- if (px.test(latest)) {
5719
- latest = parseFloat(latest);
5720
- } else {
5721
- return latest;
5722
- }
5723
- }
5724
- const x = pixelsToPercent(latest, node.target.x);
5725
- const y = pixelsToPercent(latest, node.target.y);
5726
- return `${x}% ${y}%`;
5727
- }
5728
- };
5729
- const correctBoxShadow = {
5730
- correct: (latest, { treeScale, projectionDelta }) => {
5731
- const original = latest;
5732
- const shadow = complex.parse(latest);
5733
- if (shadow.length > 5)
5734
- return original;
5735
- const template = complex.createTransformer(latest);
5736
- const offset = typeof shadow[0] !== "number" ? 1 : 0;
5737
- const xScale = projectionDelta.x.scale * treeScale.x;
5738
- const yScale = projectionDelta.y.scale * treeScale.y;
5739
- shadow[0 + offset] /= xScale;
5740
- shadow[1 + offset] /= yScale;
5741
- const averageScale = mixNumber$1(xScale, yScale, 0.5);
5742
- if (typeof shadow[2 + offset] === "number")
5743
- shadow[2 + offset] /= averageScale;
5744
- if (typeof shadow[3 + offset] === "number")
5745
- shadow[3 + offset] /= averageScale;
5746
- return template(shadow);
5747
- }
5748
- };
5749
5837
  let hasTakenAnySnapshot = false;
5750
5838
  class MeasureLayoutWithContext extends Component {
5751
5839
  /**
@@ -5756,7 +5844,6 @@ class MeasureLayoutWithContext extends Component {
5756
5844
  componentDidMount() {
5757
5845
  const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
5758
5846
  const { projection } = visualElement;
5759
- addScaleCorrector(defaultScaleCorrectors);
5760
5847
  if (projection) {
5761
5848
  if (layoutGroup.group)
5762
5849
  layoutGroup.group.add(projection);
@@ -5838,22 +5925,6 @@ function MeasureLayout(props) {
5838
5925
  const layoutGroup = useContext(LayoutGroupContext);
5839
5926
  return jsx(MeasureLayoutWithContext, { ...props, layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove });
5840
5927
  }
5841
- const defaultScaleCorrectors = {
5842
- borderRadius: {
5843
- ...correctBorderRadius,
5844
- applyTo: [
5845
- "borderTopLeftRadius",
5846
- "borderTopRightRadius",
5847
- "borderBottomLeftRadius",
5848
- "borderBottomRightRadius"
5849
- ]
5850
- },
5851
- borderTopLeftRadius: correctBorderRadius,
5852
- borderTopRightRadius: correctBorderRadius,
5853
- borderBottomLeftRadius: correctBorderRadius,
5854
- borderBottomRightRadius: correctBorderRadius,
5855
- boxShadow: correctBoxShadow
5856
- };
5857
5928
  function animateSingleValue(value, keyframes2, options) {
5858
5929
  const motionValue$1 = isMotionValue(value) ? value : motionValue(value);
5859
5930
  motionValue$1.start(animateMotionValue("", motionValue$1, keyframes2, options));
@@ -1,26 +1,26 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
2
  import { _ as __ } from "./default-i18n-CnQeC5Pl.js";
3
- import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "./Button-BXjXzdW_.js";
4
- import { c as $eed445e0843c11d0$export$7ff8f37d2d81a48d, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, e as $eed445e0843c11d0$export$a11e76429ed99b4 } from "./ListBox-Dd37zMvs.js";
5
- import { a as $3ef42575df84b30b$export$9d1611c77c2fe928, b as $bdb11010cef70236$export$f680877a34711e37, o as $ff5963eb1fccf552$export$e08e3b67e392101e, $ as $64fa3d84918910a7$export$29f1550f4b0d4415, d as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$4d86445c2cf5e3, e as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, f as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "./utils-DGpXyJOJ.js";
6
- import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "./FieldError-DwBG6m1U.js";
3
+ import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "./Button-JRIu2BnS.js";
4
+ import { c as $eed445e0843c11d0$export$7ff8f37d2d81a48d, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, e as $eed445e0843c11d0$export$a11e76429ed99b4 } from "./ListBox-DT1sFY3e.js";
5
+ import { a as $3ef42575df84b30b$export$9d1611c77c2fe928, c as $bdb11010cef70236$export$f680877a34711e37, n as $ff5963eb1fccf552$export$e08e3b67e392101e, $ as $64fa3d84918910a7$export$29f1550f4b0d4415, d as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$4d86445c2cf5e3, e as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, f as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "./utils-HC9_3Crc.js";
6
+ import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "./FieldError-DmVwL6Dj.js";
7
7
  import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "./Form-Cq3fu75_.js";
8
- import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-D8a3eYb-.js";
9
- import { i as $325a3faab7a68acd$export$a16aca283550c30d, t as $2a25aae57d74318e$export$a05409b8bb224a5a, w as $168583247155ddda$export$dc9c12ed27dd1b49, n as $de32f1b87079253c$export$d2f961adcb0afbe, x as $07b14b47974efb58$export$9b9a0cd73afb7ca4 } from "./Dialog-D8bjn-nh.js";
10
- import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-ztX6G1zR.js";
11
- import { s as $fb3050f43d946246$export$e32c88dfddc6e1d8, g as $e1995378a142960e$export$bf788dd355e3a401 } from "./SelectionManager-N8X7T_4D.js";
8
+ import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-DPWyf-gp.js";
9
+ import { i as $325a3faab7a68acd$export$a16aca283550c30d, t as $2a25aae57d74318e$export$a05409b8bb224a5a, w as $168583247155ddda$export$dc9c12ed27dd1b49, n as $de32f1b87079253c$export$d2f961adcb0afbe, x as $07b14b47974efb58$export$9b9a0cd73afb7ca4 } from "./Dialog-Dd1yqNus.js";
10
+ import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-Dae33gHp.js";
11
+ import { s as $fb3050f43d946246$export$e32c88dfddc6e1d8, g as $e1995378a142960e$export$bf788dd355e3a401 } from "./SelectionManager-DbBiF5M8.js";
12
12
  import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-Rfj-STx7.js";
13
- import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-D2C6R0DK.js";
14
- import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "./OverlayArrow-DokC40S3.js";
13
+ import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-eGTqWSTd.js";
14
+ import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, d as $9daab02d461809db$export$683480f191c0e3ea } from "./OverlayArrow-DVJTTfZM.js";
15
15
  import $dbSRa$react__default, { useMemo, useRef, useCallback, useState, forwardRef, createContext, useContext, Fragment } from "react";
16
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BQvmiUqb.js";
17
- import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-NETP-8H8.js";
18
- import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "./useFormValidation-DQeXkyLm.js";
19
- import { $ as $e72dd72e1c76a225$export$2f645645f7bca764 } from "./useListState-ZKhRO8ML.js";
20
- import { v as $507fabe10e71c6fb$export$8397ddfc504fdb9a, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-Bycb7BsD.js";
21
- import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-D3b7Kh4P.js";
22
- import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-WUv2PdFO.js";
23
- import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "./VisuallyHidden-DTUuKFiI.js";
16
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-DYYO3Ns3.js";
17
+ import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-M3L6Ge2c.js";
18
+ import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "./useFormValidation-Dqzjv4jX.js";
19
+ import { $ as $e72dd72e1c76a225$export$2f645645f7bca764 } from "./useListState-Bya9g7W8.js";
20
+ import { w as $507fabe10e71c6fb$export$8397ddfc504fdb9a, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-CG39Ci3A.js";
21
+ import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-WEswknAY.js";
22
+ import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-BDF1K4E4.js";
23
+ import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "./VisuallyHidden-eaCBtXhE.js";
24
24
  import { icons } from "./icons/icons.js";
25
25
  import "./react-jsx-parser.min-B_hvYYa1.js";
26
26
  import { c as clsx } from "./clsx-DgYk2OaC.js";
@@ -376,13 +376,13 @@ function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
376
376
  defaultSelectedKey: (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : props.selectionMode === "single" ? initialValue : null,
377
377
  focusStrategy,
378
378
  open(focusStrategy2 = null) {
379
- if (listState.collection.size !== 0) {
379
+ if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
380
380
  setFocusStrategy(focusStrategy2);
381
381
  triggerState.open();
382
382
  }
383
383
  },
384
384
  toggle(focusStrategy2 = null) {
385
- if (listState.collection.size !== 0) {
385
+ if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
386
386
  setFocusStrategy(focusStrategy2);
387
387
  triggerState.toggle();
388
388
  }
@@ -1,4 +1,4 @@
1
- import { b as $c87311424ea30a05$export$fedb369cb70207f1, c as $431fbd86ca7dc216$export$b204af158042fbac, d as $bbed8b41f857bcc0$export$24490316f764c430 } from "./useHover-Bycb7BsD.js";
1
+ import { c as $c87311424ea30a05$export$fedb369cb70207f1, d as $431fbd86ca7dc216$export$b204af158042fbac, e as $bbed8b41f857bcc0$export$24490316f764c430 } from "./useHover-CG39Ci3A.js";
2
2
  let $14c0b72509d70225$var$state = "default";
3
3
  let $14c0b72509d70225$var$savedUserSelect = "";
4
4
  let $14c0b72509d70225$var$modifiedElementMap = /* @__PURE__ */ new WeakMap();
@@ -145,11 +145,14 @@ function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
145
145
  dispatch((state) => {
146
146
  let index = state.items.findIndex((item) => getKey(item) === key);
147
147
  if (index === -1) return state;
148
+ let updatedValue;
149
+ if (typeof newValue === "function") updatedValue = newValue(state.items[index]);
150
+ else updatedValue = newValue;
148
151
  return {
149
152
  ...state,
150
153
  items: [
151
154
  ...state.items.slice(0, index),
152
- newValue,
155
+ updatedValue,
153
156
  ...state.items.slice(index + 1)
154
157
  ]
155
158
  };
@@ -264,7 +267,7 @@ function $f86e6c1ec7da6ebb$var$reducer(data, action) {
264
267
  case "sorting":
265
268
  case "filtering":
266
269
  var _data_abortController;
267
- (_data_abortController = data.abortController) === null || _data_abortController === void 0 ? void 0 : _data_abortController.abort();
270
+ (_data_abortController = data.abortController) === null || _data_abortController === void 0 ? void 0 : _data_abortController.abort("aborting current load and starting new one");
268
271
  var _action_filterText2;
269
272
  return {
270
273
  ...data,