@eightshift/ui-components 6.1.0 → 6.1.1

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 (78) hide show
  1. package/dist/{Button-BTCA69Lt.js → Button-CFnNdpNZ.js} +3 -3
  2. package/dist/{Dialog-BbNWvB5_.js → Dialog-D0jMcN-a.js} +13 -13
  3. package/dist/{FocusScope-BxT4xfe9.js → FocusScope-BJhC1-1e.js} +1 -1
  4. package/dist/{Input-Wrnm2nxy.js → Input-B4X6-x6r.js} +4 -4
  5. package/dist/{List-CWheI3JH.js → List-CQFXnN4w.js} +1 -1
  6. package/dist/{ListBox-yHUyUAAH.js → ListBox-BaN0n5h3.js} +8 -8
  7. package/dist/{OverlayArrow-NzRV9wsn.js → OverlayArrow-Dy0qw7WL.js} +1 -1
  8. package/dist/{PortalProvider-CHPnqDSH.js → PortalProvider-BQ1X8vGX.js} +1 -1
  9. package/dist/{RadioGroup-BFDueqHz.js → RadioGroup-CjCAbUr4.js} +8 -8
  10. package/dist/{SearchField-CmRhtrQf.js → SearchField-CafsA525.js} +5 -5
  11. package/dist/{SelectionManager-VgpR-1Ri.js → SelectionManager-oojq6MOy.js} +9 -9
  12. package/dist/{SharedElementTransition-B_vnQ1uR.js → SharedElementTransition-CtoWSaF0.js} +1 -1
  13. package/dist/{Slider-Bl5G0ZHE.js → Slider-BIbaMdUE.js} +6 -6
  14. package/dist/{VisuallyHidden-DXVaR_RC.js → VisuallyHidden-CqnizvzQ.js} +1 -1
  15. package/dist/{animation-B2sADg3I.js → animation-Dfl8uEb3.js} +1 -1
  16. package/dist/{color-swatch-DtaLObbd.js → color-swatch-bUFkK7ox.js} +2 -2
  17. package/dist/components/button/button.js +3 -3
  18. package/dist/components/checkbox/checkbox.js +7 -7
  19. package/dist/components/color-pickers/color-picker.js +1 -1
  20. package/dist/components/color-pickers/color-swatch.js +1 -1
  21. package/dist/components/color-pickers/gradient-editor.js +2 -2
  22. package/dist/components/color-pickers/solid-color-picker.js +10 -10
  23. package/dist/components/draggable/draggable-handle.js +1 -1
  24. package/dist/components/draggable/draggable.js +841 -633
  25. package/dist/components/draggable-list/draggable-list-item.js +1 -1
  26. package/dist/components/draggable-list/draggable-list.js +1 -1
  27. package/dist/components/expandable/expandable.js +6 -6
  28. package/dist/components/index.js +1 -1
  29. package/dist/components/input-field/input-field.js +3 -3
  30. package/dist/components/link-input/link-input.js +13 -13
  31. package/dist/components/matrix-align/matrix-align.js +1 -1
  32. package/dist/components/menu/menu.js +1 -1
  33. package/dist/components/modal/modal.js +6 -6
  34. package/dist/components/number-picker/number-picker.js +4 -4
  35. package/dist/components/placeholders/file-picker-shell.js +1 -1
  36. package/dist/components/popover/popover.js +1 -1
  37. package/dist/components/portal-provider/portal-provider.js +1 -1
  38. package/dist/components/radio/radio.js +1 -1
  39. package/dist/components/repeater/repeater.js +1 -1
  40. package/dist/components/select/async-multi-select.js +52 -31
  41. package/dist/components/select/async-select.js +7 -7
  42. package/dist/components/select/multi-select.js +8 -8
  43. package/dist/components/select/shared.js +4 -4
  44. package/dist/components/select/single-select.js +8 -8
  45. package/dist/components/slider/column-config-slider.js +2 -2
  46. package/dist/components/slider/slider.js +2 -2
  47. package/dist/components/smart-image/smart-image-next.js +1 -1
  48. package/dist/components/smart-image/smart-image.js +2 -2
  49. package/dist/components/smart-image/worker-inline.js +1 -1
  50. package/dist/components/tabs/tabs.js +9 -9
  51. package/dist/components/toggle/switch.js +5 -5
  52. package/dist/components/toggle-button/toggle-button.js +4 -4
  53. package/dist/components/tooltip/tooltip.js +6 -6
  54. package/dist/{general-C8Q0dvEx.js → general-BfKmjm56.js} +3 -4
  55. package/dist/icons/jsx-svg.js +1 -1
  56. package/dist/{index-sSixe2j_.js → index-BL5gdWX4.js} +52 -52
  57. package/dist/index.js +1 -1
  58. package/dist/{proxy-CgLBbUpw.js → proxy-DFlYXk07.js} +130 -47
  59. package/dist/{react-jsx-parser.min-B_hvYYa1.js → react-jsx-parser.min-DAh4myol.js} +35 -35
  60. package/dist/{shared-DSTKnPjF.js → shared-CMLCUova.js} +13 -13
  61. package/dist/{textSelection-D_BSbtab.js → textSelection-CeoEP4rL.js} +1 -1
  62. package/dist/{useButton-DofKjCES.js → useButton-5YL_nmpZ.js} +2 -2
  63. package/dist/{useEvent-ADVZr4I3.js → useEvent-Zze2g7CX.js} +1 -1
  64. package/dist/{useFilter-Cqw0-KoB.js → useFilter-8S94U4xM.js} +1 -1
  65. package/dist/{useFocusRing-Ct2N5S1b.js → useFocusRing-rUOwLdTK.js} +1 -1
  66. package/dist/{useFormReset-KT27O1en.js → useFormReset-BxtOoO5Q.js} +1 -1
  67. package/dist/{useFormValidation-DwbcW-pN.js → useFormValidation-DTmPrTD8.js} +2 -2
  68. package/dist/{useHover-VPZwb-1l.js → useHover-CmyvqeWX.js} +4 -4
  69. package/dist/{useListState-jHobZH6F.js → useListState-B22CApJO.js} +1 -1
  70. package/dist/{useNumberField-CrLevIP3.js → useNumberField-CTkI-U9a.js} +7 -7
  71. package/dist/{usePress-BPCda-AF.js → usePress-CNefMs8d.js} +3 -3
  72. package/dist/{useSingleSelectListState-sLg_MnX8.js → useSingleSelectListState-CDZGQDLC.js} +2 -2
  73. package/dist/{useToggle-D0-c9HPm.js → useToggle-CFFOmZWi.js} +3 -3
  74. package/dist/{useToggleState-BhJn-Dz7.js → useToggleState-BWrKKisg.js} +1 -1
  75. package/dist/utilities/general.js +1 -1
  76. package/dist/utilities/index.js +1 -1
  77. package/dist/workers/image-analysis.worker.js +1 -1
  78. package/package.json +5 -5
@@ -19,7 +19,7 @@ var hasRequiredScheduler_production_min;
19
19
  function requireScheduler_production_min() {
20
20
  if (hasRequiredScheduler_production_min) return scheduler_production_min;
21
21
  hasRequiredScheduler_production_min = 1;
22
- (function(exports) {
22
+ (function(exports$1) {
23
23
  function f(a, b) {
24
24
  var c = a.length;
25
25
  a.push(b);
@@ -52,12 +52,12 @@ function requireScheduler_production_min() {
52
52
  }
53
53
  if ("object" === typeof performance && "function" === typeof performance.now) {
54
54
  var l = performance;
55
- exports.unstable_now = function() {
55
+ exports$1.unstable_now = function() {
56
56
  return l.now();
57
57
  };
58
58
  } else {
59
59
  var p = Date, q = p.now();
60
- exports.unstable_now = function() {
60
+ exports$1.unstable_now = function() {
61
61
  return p.now() - q;
62
62
  };
63
63
  }
@@ -93,7 +93,7 @@ function requireScheduler_production_min() {
93
93
  v.callback = null;
94
94
  y = v.priorityLevel;
95
95
  var e = d(v.expirationTime <= b);
96
- b = exports.unstable_now();
96
+ b = exports$1.unstable_now();
97
97
  "function" === typeof e ? v.callback = e : v === h(r) && k(r);
98
98
  G(b);
99
99
  } else k(r);
@@ -112,11 +112,11 @@ function requireScheduler_production_min() {
112
112
  }
113
113
  var N = false, O = null, L = -1, P = 5, Q = -1;
114
114
  function M() {
115
- return exports.unstable_now() - Q < P ? false : true;
115
+ return exports$1.unstable_now() - Q < P ? false : true;
116
116
  }
117
117
  function R() {
118
118
  if (null !== O) {
119
- var a = exports.unstable_now();
119
+ var a = exports$1.unstable_now();
120
120
  Q = a;
121
121
  var b = true;
122
122
  try {
@@ -145,31 +145,31 @@ function requireScheduler_production_min() {
145
145
  }
146
146
  function K(a, b) {
147
147
  L = D(function() {
148
- a(exports.unstable_now());
148
+ a(exports$1.unstable_now());
149
149
  }, b);
150
150
  }
151
- exports.unstable_IdlePriority = 5;
152
- exports.unstable_ImmediatePriority = 1;
153
- exports.unstable_LowPriority = 4;
154
- exports.unstable_NormalPriority = 3;
155
- exports.unstable_Profiling = null;
156
- exports.unstable_UserBlockingPriority = 2;
157
- exports.unstable_cancelCallback = function(a) {
151
+ exports$1.unstable_IdlePriority = 5;
152
+ exports$1.unstable_ImmediatePriority = 1;
153
+ exports$1.unstable_LowPriority = 4;
154
+ exports$1.unstable_NormalPriority = 3;
155
+ exports$1.unstable_Profiling = null;
156
+ exports$1.unstable_UserBlockingPriority = 2;
157
+ exports$1.unstable_cancelCallback = function(a) {
158
158
  a.callback = null;
159
159
  };
160
- exports.unstable_continueExecution = function() {
160
+ exports$1.unstable_continueExecution = function() {
161
161
  A || z || (A = true, I(J));
162
162
  };
163
- exports.unstable_forceFrameRate = function(a) {
163
+ exports$1.unstable_forceFrameRate = function(a) {
164
164
  0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P = 0 < a ? Math.floor(1e3 / a) : 5;
165
165
  };
166
- exports.unstable_getCurrentPriorityLevel = function() {
166
+ exports$1.unstable_getCurrentPriorityLevel = function() {
167
167
  return y;
168
168
  };
169
- exports.unstable_getFirstCallbackNode = function() {
169
+ exports$1.unstable_getFirstCallbackNode = function() {
170
170
  return h(r);
171
171
  };
172
- exports.unstable_next = function(a) {
172
+ exports$1.unstable_next = function(a) {
173
173
  switch (y) {
174
174
  case 1:
175
175
  case 2:
@@ -187,11 +187,11 @@ function requireScheduler_production_min() {
187
187
  y = c;
188
188
  }
189
189
  };
190
- exports.unstable_pauseExecution = function() {
190
+ exports$1.unstable_pauseExecution = function() {
191
191
  };
192
- exports.unstable_requestPaint = function() {
192
+ exports$1.unstable_requestPaint = function() {
193
193
  };
194
- exports.unstable_runWithPriority = function(a, b) {
194
+ exports$1.unstable_runWithPriority = function(a, b) {
195
195
  switch (a) {
196
196
  case 1:
197
197
  case 2:
@@ -210,8 +210,8 @@ function requireScheduler_production_min() {
210
210
  y = c;
211
211
  }
212
212
  };
213
- exports.unstable_scheduleCallback = function(a, b, c) {
214
- var d = exports.unstable_now();
213
+ exports$1.unstable_scheduleCallback = function(a, b, c) {
214
+ var d = exports$1.unstable_now();
215
215
  "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
216
216
  switch (a) {
217
217
  case 1:
@@ -234,8 +234,8 @@ function requireScheduler_production_min() {
234
234
  c > d ? (a.sortIndex = c, f(t, a), null === h(r) && a === h(t) && (B ? (E(L), L = -1) : B = true, K(H, c - d))) : (a.sortIndex = e, f(r, a), A || z || (A = true, I(J)));
235
235
  return a;
236
236
  };
237
- exports.unstable_shouldYield = M;
238
- exports.unstable_wrapCallback = function(a) {
237
+ exports$1.unstable_shouldYield = M;
238
+ exports$1.unstable_wrapCallback = function(a) {
239
239
  var b = y;
240
240
  return function() {
241
241
  var c = y;
@@ -264,7 +264,7 @@ var hasRequiredScheduler_development;
264
264
  function requireScheduler_development() {
265
265
  if (hasRequiredScheduler_development) return scheduler_development;
266
266
  hasRequiredScheduler_development = 1;
267
- (function(exports) {
267
+ (function(exports$1) {
268
268
  if (process.env.NODE_ENV !== "production") {
269
269
  (function() {
270
270
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
@@ -348,13 +348,13 @@ function requireScheduler_development() {
348
348
  var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
349
349
  if (hasPerformanceNow) {
350
350
  var localPerformance = performance;
351
- exports.unstable_now = function() {
351
+ exports$1.unstable_now = function() {
352
352
  return localPerformance.now();
353
353
  };
354
354
  } else {
355
355
  var localDate = Date;
356
356
  var initialTime = localDate.now();
357
- exports.unstable_now = function() {
357
+ exports$1.unstable_now = function() {
358
358
  return localDate.now() - initialTime;
359
359
  };
360
360
  }
@@ -440,7 +440,7 @@ function requireScheduler_development() {
440
440
  currentPriorityLevel = currentTask.priorityLevel;
441
441
  var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
442
442
  var continuationCallback = callback(didUserCallbackTimeout);
443
- currentTime = exports.unstable_now();
443
+ currentTime = exports$1.unstable_now();
444
444
  if (typeof continuationCallback === "function") {
445
445
  currentTask.callback = continuationCallback;
446
446
  } else {
@@ -516,7 +516,7 @@ function requireScheduler_development() {
516
516
  };
517
517
  }
518
518
  function unstable_scheduleCallback(priorityLevel, callback, options) {
519
- var currentTime = exports.unstable_now();
519
+ var currentTime = exports$1.unstable_now();
520
520
  var startTime2;
521
521
  if (typeof options === "object" && options !== null) {
522
522
  var delay = options.delay;
@@ -600,7 +600,7 @@ function requireScheduler_development() {
600
600
  var frameInterval = frameYieldMs;
601
601
  var startTime = -1;
602
602
  function shouldYieldToHost() {
603
- var timeElapsed = exports.unstable_now() - startTime;
603
+ var timeElapsed = exports$1.unstable_now() - startTime;
604
604
  if (timeElapsed < frameInterval) {
605
605
  return false;
606
606
  }
@@ -621,7 +621,7 @@ function requireScheduler_development() {
621
621
  }
622
622
  var performWorkUntilDeadline = function() {
623
623
  if (scheduledHostCallback !== null) {
624
- var currentTime = exports.unstable_now();
624
+ var currentTime = exports$1.unstable_now();
625
625
  startTime = currentTime;
626
626
  var hasTimeRemaining = true;
627
627
  var hasMoreWork = true;
@@ -665,7 +665,7 @@ function requireScheduler_development() {
665
665
  }
666
666
  function requestHostTimeout(callback, ms) {
667
667
  taskTimeoutID = localSetTimeout(function() {
668
- callback(exports.unstable_now());
668
+ callback(exports$1.unstable_now());
669
669
  }, ms);
670
670
  }
671
671
  function cancelHostTimeout() {
@@ -674,24 +674,24 @@ function requireScheduler_development() {
674
674
  }
675
675
  var unstable_requestPaint = requestPaint;
676
676
  var unstable_Profiling = null;
677
- exports.unstable_IdlePriority = IdlePriority;
678
- exports.unstable_ImmediatePriority = ImmediatePriority;
679
- exports.unstable_LowPriority = LowPriority;
680
- exports.unstable_NormalPriority = NormalPriority;
681
- exports.unstable_Profiling = unstable_Profiling;
682
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
683
- exports.unstable_cancelCallback = unstable_cancelCallback;
684
- exports.unstable_continueExecution = unstable_continueExecution;
685
- exports.unstable_forceFrameRate = forceFrameRate;
686
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
687
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
688
- exports.unstable_next = unstable_next;
689
- exports.unstable_pauseExecution = unstable_pauseExecution;
690
- exports.unstable_requestPaint = unstable_requestPaint;
691
- exports.unstable_runWithPriority = unstable_runWithPriority;
692
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
693
- exports.unstable_shouldYield = shouldYieldToHost;
694
- exports.unstable_wrapCallback = unstable_wrapCallback;
677
+ exports$1.unstable_IdlePriority = IdlePriority;
678
+ exports$1.unstable_ImmediatePriority = ImmediatePriority;
679
+ exports$1.unstable_LowPriority = LowPriority;
680
+ exports$1.unstable_NormalPriority = NormalPriority;
681
+ exports$1.unstable_Profiling = unstable_Profiling;
682
+ exports$1.unstable_UserBlockingPriority = UserBlockingPriority;
683
+ exports$1.unstable_cancelCallback = unstable_cancelCallback;
684
+ exports$1.unstable_continueExecution = unstable_continueExecution;
685
+ exports$1.unstable_forceFrameRate = forceFrameRate;
686
+ exports$1.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
687
+ exports$1.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
688
+ exports$1.unstable_next = unstable_next;
689
+ exports$1.unstable_pauseExecution = unstable_pauseExecution;
690
+ exports$1.unstable_requestPaint = unstable_requestPaint;
691
+ exports$1.unstable_runWithPriority = unstable_runWithPriority;
692
+ exports$1.unstable_scheduleCallback = unstable_scheduleCallback;
693
+ exports$1.unstable_shouldYield = shouldYieldToHost;
694
+ exports$1.unstable_wrapCallback = unstable_wrapCallback;
695
695
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
696
696
  __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
697
697
  }
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { Button, ButtonGroup } from "./components/button/button.js";
5
5
  import { Checkbox } from "./components/checkbox/checkbox.js";
6
6
  import { ComponentToggle } from "./components/component-toggle/component-toggle.js";
7
7
  import { ContainerPanel } from "./components/container-panel/container-panel.js";
8
- import { C } from "./color-swatch-DtaLObbd.js";
8
+ import { C } from "./color-swatch-bUFkK7ox.js";
9
9
  import { ColorPicker } from "./components/color-pickers/color-picker.js";
10
10
  import { ColumnConfigSlider, ColumnConfigSliderOutput } from "./components/slider/column-config-slider.js";
11
11
  import { Container, ContainerGroup } from "./components/base-control/container.js";
@@ -1949,7 +1949,7 @@ function makeAnimationInstant(options) {
1949
1949
  options.duration = 0;
1950
1950
  options.type = "keyframes";
1951
1951
  }
1952
- const acceleratedValues = /* @__PURE__ */ new Set([
1952
+ const acceleratedValues$1 = /* @__PURE__ */ new Set([
1953
1953
  "opacity",
1954
1954
  "clipPath",
1955
1955
  "filter",
@@ -1965,7 +1965,7 @@ function supportsBrowserAnimation(options) {
1965
1965
  return false;
1966
1966
  }
1967
1967
  const { onUpdate, transformTemplate } = motionValue2.owner.getProps();
1968
- return supportsWaapi() && name && acceleratedValues.has(name) && (name !== "transform" || !transformTemplate) && /**
1968
+ return supportsWaapi() && name && acceleratedValues$1.has(name) && (name !== "transform" || !transformTemplate) && /**
1969
1969
  * If we're outputting values to onUpdate then we can't use WAAPI as there's
1970
1970
  * no way to read the value from WAAPI every frame.
1971
1971
  */
@@ -2165,8 +2165,19 @@ function getFinalKeyframe(keyframes2, { repeat, repeatType = "loop" }, finalKeyf
2165
2165
  const index = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1;
2166
2166
  return resolvedKeyframes[index];
2167
2167
  }
2168
+ function resolveTransition(transition, parentTransition) {
2169
+ if (transition?.inherit && parentTransition) {
2170
+ const { inherit: _, ...rest } = transition;
2171
+ return { ...parentTransition, ...rest };
2172
+ }
2173
+ return transition;
2174
+ }
2168
2175
  function getValueTransition(transition, key) {
2169
- return transition?.[key] ?? transition?.["default"] ?? transition;
2176
+ const valueTransition = transition?.[key] ?? transition?.["default"] ?? transition;
2177
+ if (valueTransition !== transition) {
2178
+ return resolveTransition(valueTransition, transition);
2179
+ }
2180
+ return valueTransition;
2170
2181
  }
2171
2182
  function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
2172
2183
  return !!Object.keys(transition).length;
@@ -2589,7 +2600,9 @@ function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
2589
2600
  return shouldBlock;
2590
2601
  }
2591
2602
  function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0, transitionOverride, type } = {}) {
2592
- let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
2603
+ let { transition, transitionEnd, ...target } = targetAndTransition;
2604
+ const defaultTransition = visualElement.getDefaultTransition();
2605
+ transition = transition ? resolveTransition(transition, defaultTransition) : defaultTransition;
2593
2606
  const reduceMotion = transition?.reduceMotion;
2594
2607
  if (transitionOverride)
2595
2608
  transition = transitionOverride;
@@ -2629,11 +2642,14 @@ function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0,
2629
2642
  }
2630
2643
  }
2631
2644
  if (transitionEnd) {
2632
- Promise.all(animations2).then(() => {
2633
- frame.update(() => {
2634
- transitionEnd && setTarget(visualElement, transitionEnd);
2635
- });
2645
+ const applyTransitionEnd = () => frame.update(() => {
2646
+ transitionEnd && setTarget(visualElement, transitionEnd);
2636
2647
  });
2648
+ if (animations2.length) {
2649
+ Promise.all(animations2).then(applyTransitionEnd);
2650
+ } else {
2651
+ applyTransitionEnd();
2652
+ }
2637
2653
  }
2638
2654
  return animations2;
2639
2655
  }
@@ -2951,6 +2967,15 @@ class DOMKeyframesResolver extends KeyframeResolver {
2951
2967
  this.resolveNoneKeyframes();
2952
2968
  }
2953
2969
  }
2970
+ const acceleratedValues = /* @__PURE__ */ new Set([
2971
+ "opacity",
2972
+ "clipPath",
2973
+ "filter",
2974
+ "transform"
2975
+ // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
2976
+ // or until we implement support for linear() easing.
2977
+ // "background-color"
2978
+ ]);
2954
2979
  function resolveElements(elementOrSelector, scope, selectorCache) {
2955
2980
  if (elementOrSelector == null) {
2956
2981
  return [];
@@ -3129,13 +3154,19 @@ const enableKeyboardPress = (focusEvent, eventOptions) => {
3129
3154
  function isValidPressEvent(event) {
3130
3155
  return isPrimaryPointer(event) && !isDragActive();
3131
3156
  }
3157
+ const claimedPointerDownEvents = /* @__PURE__ */ new WeakSet();
3132
3158
  function press(targetOrSelector, onPressStart, options = {}) {
3133
3159
  const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);
3134
3160
  const startPress = (startEvent) => {
3135
3161
  const target = startEvent.currentTarget;
3136
3162
  if (!isValidPressEvent(startEvent))
3137
3163
  return;
3164
+ if (claimedPointerDownEvents.has(startEvent))
3165
+ return;
3138
3166
  isPressing.add(target);
3167
+ if (options.stopPropagation) {
3168
+ claimedPointerDownEvents.add(startEvent);
3169
+ }
3139
3170
  const onPressEnd = onPressStart(target, startEvent);
3140
3171
  const onPointerEnd = (endEvent, success) => {
3141
3172
  window.removeEventListener("pointerup", onPointerUp);
@@ -3281,22 +3312,6 @@ const createBox = () => ({
3281
3312
  x: createAxis(),
3282
3313
  y: createAxis()
3283
3314
  });
3284
- const prefersReducedMotion = { current: null };
3285
- const hasReducedMotionListener = { current: false };
3286
- const isBrowser = typeof window !== "undefined";
3287
- function initPrefersReducedMotion() {
3288
- hasReducedMotionListener.current = true;
3289
- if (!isBrowser)
3290
- return;
3291
- if (window.matchMedia) {
3292
- const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
3293
- const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches;
3294
- motionMediaQuery.addEventListener("change", setReducedMotionPreferences);
3295
- setReducedMotionPreferences();
3296
- } else {
3297
- prefersReducedMotion.current = false;
3298
- }
3299
- }
3300
3315
  const visualElementStore = /* @__PURE__ */ new WeakMap();
3301
3316
  function isAnimationControls(v) {
3302
3317
  return v !== null && typeof v === "object" && typeof v.start === "function";
@@ -3348,6 +3363,22 @@ function updateMotionValuesFromProps(element, next, prev) {
3348
3363
  }
3349
3364
  return next;
3350
3365
  }
3366
+ const prefersReducedMotion = { current: null };
3367
+ const hasReducedMotionListener = { current: false };
3368
+ const isBrowser = typeof window !== "undefined";
3369
+ function initPrefersReducedMotion() {
3370
+ hasReducedMotionListener.current = true;
3371
+ if (!isBrowser)
3372
+ return;
3373
+ if (window.matchMedia) {
3374
+ const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
3375
+ const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches;
3376
+ motionMediaQuery.addEventListener("change", setReducedMotionPreferences);
3377
+ setReducedMotionPreferences();
3378
+ } else {
3379
+ prefersReducedMotion.current = false;
3380
+ }
3381
+ }
3351
3382
  const propEventHandlers = [
3352
3383
  "AnimationStart",
3353
3384
  "AnimationComplete",
@@ -3387,6 +3418,7 @@ class VisualElement {
3387
3418
  this.features = {};
3388
3419
  this.valueSubscriptions = /* @__PURE__ */ new Map();
3389
3420
  this.prevMotionValues = {};
3421
+ this.hasBeenMounted = false;
3390
3422
  this.events = {};
3391
3423
  this.propEventSubscriptions = {};
3392
3424
  this.notifyUpdate = () => this.notify("Update", this.latestValues);
@@ -3432,6 +3464,12 @@ class VisualElement {
3432
3464
  }
3433
3465
  }
3434
3466
  mount(instance) {
3467
+ if (this.hasBeenMounted) {
3468
+ for (const key in this.initialValues) {
3469
+ this.values.get(key)?.jump(this.initialValues[key]);
3470
+ this.latestValues[key] = this.initialValues[key];
3471
+ }
3472
+ }
3435
3473
  this.current = instance;
3436
3474
  visualElementStore.set(instance, this);
3437
3475
  if (this.projection && !this.projection.instance) {
@@ -3457,6 +3495,7 @@ class VisualElement {
3457
3495
  this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;
3458
3496
  this.parent?.addChild(this);
3459
3497
  this.update(this.props, this.presenceContext);
3498
+ this.hasBeenMounted = true;
3460
3499
  }
3461
3500
  unmount() {
3462
3501
  this.projection && this.projection.unmount();
@@ -3491,6 +3530,23 @@ class VisualElement {
3491
3530
  if (this.valueSubscriptions.has(key)) {
3492
3531
  this.valueSubscriptions.get(key)();
3493
3532
  }
3533
+ if (value.accelerate && acceleratedValues.has(key) && this.current instanceof HTMLElement) {
3534
+ const { factory, keyframes: keyframes2, times, ease: ease2, duration } = value.accelerate;
3535
+ const animation = new NativeAnimation({
3536
+ element: this.current,
3537
+ name: key,
3538
+ keyframes: keyframes2,
3539
+ times,
3540
+ ease: ease2,
3541
+ duration: /* @__PURE__ */ secondsToMilliseconds(duration)
3542
+ });
3543
+ const cleanup = factory(animation);
3544
+ this.valueSubscriptions.set(key, () => {
3545
+ cleanup();
3546
+ animation.cancel();
3547
+ });
3548
+ return;
3549
+ }
3494
3550
  const valueIsTransform = transformProps.has(key);
3495
3551
  if (valueIsTransform && this.onBindTransform) {
3496
3552
  this.onBindTransform();
@@ -4291,6 +4347,15 @@ function createAnimationState(visualElement) {
4291
4347
  ) {
4292
4348
  continue;
4293
4349
  }
4350
+ if (type === "exit" && typeState.isActive && activeDelta !== true) {
4351
+ if (typeState.prevResolvedValues) {
4352
+ encounteredKeys = {
4353
+ ...encounteredKeys,
4354
+ ...typeState.prevResolvedValues
4355
+ };
4356
+ }
4357
+ continue;
4358
+ }
4294
4359
  const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
4295
4360
  let shouldAnimateType = variantDidChange || // If we're making this variant active, we want to always make it active
4296
4361
  type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || // If we removed a higher-priority variant (i is in reverse order)
@@ -4685,6 +4750,15 @@ class NodeStack {
4685
4750
  }
4686
4751
  add(node) {
4687
4752
  addUniqueItem(this.members, node);
4753
+ for (let i = this.members.length - 1; i >= 0; i--) {
4754
+ const m = this.members[i];
4755
+ if (m === node || m === this.lead || m === this.prevLead)
4756
+ continue;
4757
+ const inst = m.instance;
4758
+ if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) {
4759
+ removeItem(this.members, m);
4760
+ }
4761
+ }
4688
4762
  node.scheduleRender();
4689
4763
  }
4690
4764
  remove(node) {
@@ -4706,7 +4780,8 @@ class NodeStack {
4706
4780
  let prevLead;
4707
4781
  for (let i = indexOfNode; i >= 0; i--) {
4708
4782
  const member = this.members[i];
4709
- if (member.isPresent !== false) {
4783
+ const inst = member.instance;
4784
+ if (member.isPresent !== false && (!inst || inst.isConnected !== false)) {
4710
4785
  prevLead = member;
4711
4786
  break;
4712
4787
  }
@@ -4732,16 +4807,20 @@ class NodeStack {
4732
4807
  const nextDep = node.options.layoutDependency;
4733
4808
  const dependencyMatches = prevDep !== void 0 && nextDep !== void 0 && prevDep === nextDep;
4734
4809
  if (!dependencyMatches) {
4735
- node.resumeFrom = prevLead;
4736
- if (preserveFollowOpacity) {
4737
- node.resumeFrom.preserveOpacity = true;
4738
- }
4739
- if (prevLead.snapshot) {
4740
- node.snapshot = prevLead.snapshot;
4741
- node.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues;
4742
- }
4743
- if (node.root && node.root.isUpdating) {
4744
- node.isLayoutDirty = true;
4810
+ const prevInstance = prevLead.instance;
4811
+ const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot;
4812
+ if (!isStale) {
4813
+ node.resumeFrom = prevLead;
4814
+ if (preserveFollowOpacity) {
4815
+ node.resumeFrom.preserveOpacity = true;
4816
+ }
4817
+ if (prevLead.snapshot) {
4818
+ node.snapshot = prevLead.snapshot;
4819
+ node.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues;
4820
+ }
4821
+ if (node.root && node.root.isUpdating) {
4822
+ node.isLayoutDirty = true;
4823
+ }
4745
4824
  }
4746
4825
  }
4747
4826
  const { crossfade } = node.options;
@@ -6188,6 +6267,7 @@ const validMotionProps = /* @__PURE__ */ new Set([
6188
6267
  "onViewportEnter",
6189
6268
  "onViewportLeave",
6190
6269
  "globalTapTarget",
6270
+ "propagate",
6191
6271
  "ignoreStrict",
6192
6272
  "viewport"
6193
6273
  ]);
@@ -6918,6 +6998,9 @@ function getVelocity(history, timeDelta) {
6918
6998
  if (!timestampedPoint) {
6919
6999
  return { x: 0, y: 0 };
6920
7000
  }
7001
+ if (timestampedPoint === history[0] && history.length > 2 && lastPoint.timestamp - timestampedPoint.timestamp > /* @__PURE__ */ secondsToMilliseconds(timeDelta) * 2) {
7002
+ timestampedPoint = history[1];
7003
+ }
6921
7004
  const time2 = /* @__PURE__ */ millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
6922
7005
  if (time2 === 0) {
6923
7006
  return { x: 0, y: 0 };
@@ -7030,14 +7113,11 @@ class VisualElementDragControls {
7030
7113
  return;
7031
7114
  const onSessionStart = (event) => {
7032
7115
  if (snapToCursor) {
7033
- this.stopAnimation();
7034
7116
  this.snapToCursor(extractEventInfo(event).point);
7035
- } else {
7036
- this.pauseAnimation();
7037
7117
  }
7118
+ this.stopAnimation();
7038
7119
  };
7039
7120
  const onStart = (event, info) => {
7040
- this.stopAnimation();
7041
7121
  const { drag: drag2, dragPropagation, onDragStart } = this.getProps();
7042
7122
  if (drag2 && !dragPropagation) {
7043
7123
  if (this.openDragLock)
@@ -7104,7 +7184,12 @@ class VisualElementDragControls {
7104
7184
  this.latestPointerEvent = null;
7105
7185
  this.latestPanInfo = null;
7106
7186
  };
7107
- const resumeAnimation = () => eachAxis((axis) => this.getAnimationState(axis) === "paused" && this.getAxisMotionValue(axis).animation?.play());
7187
+ const resumeAnimation = () => {
7188
+ const { dragSnapToOrigin: snap } = this.getProps();
7189
+ if (snap || this.constraints) {
7190
+ this.startAnimation({ x: 0, y: 0 });
7191
+ }
7192
+ };
7108
7193
  const { dragSnapToOrigin } = this.getProps();
7109
7194
  this.panSession = new PanSession(originEvent, {
7110
7195
  onSessionStart,
@@ -7254,12 +7339,6 @@ class VisualElementDragControls {
7254
7339
  stopAnimation() {
7255
7340
  eachAxis((axis) => this.getAxisMotionValue(axis).stop());
7256
7341
  }
7257
- pauseAnimation() {
7258
- eachAxis((axis) => this.getAxisMotionValue(axis).animation?.pause());
7259
- }
7260
- getAnimationState(axis) {
7261
- return this.getAxisMotionValue(axis).animation?.state;
7262
- }
7263
7342
  /**
7264
7343
  * Drag works differently depending on which props are provided.
7265
7344
  *
@@ -7670,10 +7749,14 @@ class PressGesture extends Feature {
7670
7749
  const { current } = this.node;
7671
7750
  if (!current)
7672
7751
  return;
7752
+ const { globalTapTarget, propagate } = this.node.props;
7673
7753
  this.unmount = press(current, (_element, startEvent) => {
7674
7754
  handlePressEvent(this.node, startEvent, "Start");
7675
7755
  return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel");
7676
- }, { useGlobalTarget: this.node.props.globalTapTarget });
7756
+ }, {
7757
+ useGlobalTarget: globalTapTarget,
7758
+ stopPropagation: propagate?.tap === false
7759
+ });
7677
7760
  }
7678
7761
  unmount() {
7679
7762
  }