@eightshift/ui-components 6.0.9 → 6.0.10

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.
@@ -455,6 +455,7 @@
455
455
  --es-color-black: #000;
456
456
  --es-color-white: #fff;
457
457
  --es-spacing: .25rem;
458
+ --es-container-xs: 20rem;
458
459
  --es-container-lg: 32rem;
459
460
  --es-container-2xl: 42rem;
460
461
  --es-container-4xl: 56rem;
@@ -1503,6 +1504,10 @@ input[data-rac]::-webkit-search-cancel-button {
1503
1504
  top: var(--es-spacing-3_25);
1504
1505
  }
1505
1506
 
1507
+ :is(body, body #wpwrap) .es\:top-4 {
1508
+ top: calc(var(--es-spacing) * 4);
1509
+ }
1510
+
1506
1511
  :is(body, body #wpwrap) .es\:top-5 {
1507
1512
  top: calc(var(--es-spacing) * 5);
1508
1513
  }
@@ -1531,6 +1536,10 @@ input[data-rac]::-webkit-search-cancel-button {
1531
1536
  right: calc(var(--es-spacing) * 3);
1532
1537
  }
1533
1538
 
1539
+ :is(body, body #wpwrap) .es\:right-4 {
1540
+ right: calc(var(--es-spacing) * 4);
1541
+ }
1542
+
1534
1543
  :is(body, body #wpwrap) .es\:right-6 {
1535
1544
  right: calc(var(--es-spacing) * 6);
1536
1545
  }
@@ -1663,10 +1672,6 @@ input[data-rac]::-webkit-search-cancel-button {
1663
1672
  margin: calc(var(--es-spacing) * 1.5);
1664
1673
  }
1665
1674
 
1666
- :is(body, body #wpwrap) .es\:m-5 {
1667
- margin: calc(var(--es-spacing) * 5);
1668
- }
1669
-
1670
1675
  :is(body, body #wpwrap) .es\:m-auto {
1671
1676
  margin: auto;
1672
1677
  }
@@ -1727,10 +1732,6 @@ input[data-rac]::-webkit-search-cancel-button {
1727
1732
  margin-block: calc(var(--es-spacing) * 2);
1728
1733
  }
1729
1734
 
1730
- :is(body, body #wpwrap) .es\:my-5 {
1731
- margin-block: calc(var(--es-spacing) * 5);
1732
- }
1733
-
1734
1735
  :is(body, body #wpwrap) .es\:my-auto {
1735
1736
  margin-block: auto;
1736
1737
  }
@@ -1779,6 +1780,10 @@ input[data-rac]::-webkit-search-cancel-button {
1779
1780
  margin-top: calc(var(--es-spacing) * 5);
1780
1781
  }
1781
1782
 
1783
+ :is(body, body #wpwrap) .es\:mt-auto {
1784
+ margin-top: auto;
1785
+ }
1786
+
1782
1787
  :is(body, body #wpwrap) .es\:mr-0\.5 {
1783
1788
  margin-right: calc(var(--es-spacing) * .5);
1784
1789
  }
@@ -2179,10 +2184,6 @@ input[data-rac]::-webkit-search-cancel-button {
2179
2184
  min-height: 100%;
2180
2185
  }
2181
2186
 
2182
- :is(body, body #wpwrap) .es\:min-h-screen {
2183
- min-height: 100vh;
2184
- }
2185
-
2186
2187
  :is(body, body #wpwrap) .es\:w-fill {
2187
2188
  width: -moz-available;
2188
2189
  width: -webkit-fill-available;
@@ -2297,6 +2298,10 @@ input[data-rac]::-webkit-search-cancel-button {
2297
2298
  width: 1px;
2298
2299
  }
2299
2300
 
2301
+ :is(body, body #wpwrap) .es\:w-xs {
2302
+ width: var(--es-container-xs);
2303
+ }
2304
+
2300
2305
  :is(body, body #wpwrap) .es\:max-w-2xl {
2301
2306
  max-width: var(--es-container-2xl);
2302
2307
  }
@@ -3117,8 +3122,8 @@ input[data-rac]::-webkit-search-cancel-button {
3117
3122
  overflow-y: visible;
3118
3123
  }
3119
3124
 
3120
- :is(body, body #wpwrap) .es\:overscroll-contain {
3121
- overscroll-behavior: contain;
3125
+ :is(body, body #wpwrap) .es\:overscroll-none {
3126
+ overscroll-behavior: none;
3122
3127
  }
3123
3128
 
3124
3129
  :is(body, body #wpwrap) .es\:rounded {
@@ -455,6 +455,7 @@
455
455
  --es-color-black: #000;
456
456
  --es-color-white: #fff;
457
457
  --es-spacing: .25rem;
458
+ --es-container-xs: 20rem;
458
459
  --es-container-lg: 32rem;
459
460
  --es-container-2xl: 42rem;
460
461
  --es-container-4xl: 56rem;
@@ -1471,6 +1472,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
1471
1472
  top: var(--es-spacing-3_25);
1472
1473
  }
1473
1474
 
1475
+ :is(body, #wpwrap #editor) .es\:top-4 {
1476
+ top: calc(var(--es-spacing) * 4);
1477
+ }
1478
+
1474
1479
  :is(body, #wpwrap #editor) .es\:top-5 {
1475
1480
  top: calc(var(--es-spacing) * 5);
1476
1481
  }
@@ -1499,6 +1504,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
1499
1504
  right: calc(var(--es-spacing) * 3);
1500
1505
  }
1501
1506
 
1507
+ :is(body, #wpwrap #editor) .es\:right-4 {
1508
+ right: calc(var(--es-spacing) * 4);
1509
+ }
1510
+
1502
1511
  :is(body, #wpwrap #editor) .es\:right-6 {
1503
1512
  right: calc(var(--es-spacing) * 6);
1504
1513
  }
@@ -1631,10 +1640,6 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
1631
1640
  margin: calc(var(--es-spacing) * 1.5);
1632
1641
  }
1633
1642
 
1634
- :is(body, #wpwrap #editor) .es\:m-5 {
1635
- margin: calc(var(--es-spacing) * 5);
1636
- }
1637
-
1638
1643
  :is(body, #wpwrap #editor) .es\:m-auto {
1639
1644
  margin: auto;
1640
1645
  }
@@ -1695,10 +1700,6 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
1695
1700
  margin-block: calc(var(--es-spacing) * 2);
1696
1701
  }
1697
1702
 
1698
- :is(body, #wpwrap #editor) .es\:my-5 {
1699
- margin-block: calc(var(--es-spacing) * 5);
1700
- }
1701
-
1702
1703
  :is(body, #wpwrap #editor) .es\:my-auto {
1703
1704
  margin-block: auto;
1704
1705
  }
@@ -1747,6 +1748,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
1747
1748
  margin-top: calc(var(--es-spacing) * 5);
1748
1749
  }
1749
1750
 
1751
+ :is(body, #wpwrap #editor) .es\:mt-auto {
1752
+ margin-top: auto;
1753
+ }
1754
+
1750
1755
  :is(body, #wpwrap #editor) .es\:mr-0\.5 {
1751
1756
  margin-right: calc(var(--es-spacing) * .5);
1752
1757
  }
@@ -2147,10 +2152,6 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
2147
2152
  min-height: 100%;
2148
2153
  }
2149
2154
 
2150
- :is(body, #wpwrap #editor) .es\:min-h-screen {
2151
- min-height: 100vh;
2152
- }
2153
-
2154
2155
  :is(body, #wpwrap #editor) .es\:w-fill {
2155
2156
  width: -moz-available;
2156
2157
  width: -webkit-fill-available;
@@ -2265,6 +2266,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
2265
2266
  width: 1px;
2266
2267
  }
2267
2268
 
2269
+ :is(body, #wpwrap #editor) .es\:w-xs {
2270
+ width: var(--es-container-xs);
2271
+ }
2272
+
2268
2273
  :is(body, #wpwrap #editor) .es\:max-w-2xl {
2269
2274
  max-width: var(--es-container-2xl);
2270
2275
  }
@@ -3085,8 +3090,8 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
3085
3090
  overflow-y: visible;
3086
3091
  }
3087
3092
 
3088
- :is(body, #wpwrap #editor) .es\:overscroll-contain {
3089
- overscroll-behavior: contain;
3093
+ :is(body, #wpwrap #editor) .es\:overscroll-none {
3094
+ overscroll-behavior: none;
3090
3095
  }
3091
3096
 
3092
3097
  :is(body, #wpwrap #editor) .es\:rounded {
@@ -455,6 +455,7 @@
455
455
  --es-color-black: #000;
456
456
  --es-color-white: #fff;
457
457
  --es-spacing: .25rem;
458
+ --es-container-xs: 20rem;
458
459
  --es-container-lg: 32rem;
459
460
  --es-container-2xl: 42rem;
460
461
  --es-container-4xl: 56rem;
@@ -1956,6 +1957,10 @@ input[data-rac]::-webkit-search-cancel-button {
1956
1957
  top: var(--es-spacing-3_25);
1957
1958
  }
1958
1959
 
1960
+ .es\:top-4 {
1961
+ top: calc(var(--es-spacing) * 4);
1962
+ }
1963
+
1959
1964
  .es\:top-5 {
1960
1965
  top: calc(var(--es-spacing) * 5);
1961
1966
  }
@@ -1984,6 +1989,10 @@ input[data-rac]::-webkit-search-cancel-button {
1984
1989
  right: calc(var(--es-spacing) * 3);
1985
1990
  }
1986
1991
 
1992
+ .es\:right-4 {
1993
+ right: calc(var(--es-spacing) * 4);
1994
+ }
1995
+
1987
1996
  .es\:right-6 {
1988
1997
  right: calc(var(--es-spacing) * 6);
1989
1998
  }
@@ -2116,10 +2125,6 @@ input[data-rac]::-webkit-search-cancel-button {
2116
2125
  margin: calc(var(--es-spacing) * 1.5);
2117
2126
  }
2118
2127
 
2119
- .es\:m-5 {
2120
- margin: calc(var(--es-spacing) * 5);
2121
- }
2122
-
2123
2128
  .es\:m-auto {
2124
2129
  margin: auto;
2125
2130
  }
@@ -2180,10 +2185,6 @@ input[data-rac]::-webkit-search-cancel-button {
2180
2185
  margin-block: calc(var(--es-spacing) * 2);
2181
2186
  }
2182
2187
 
2183
- .es\:my-5 {
2184
- margin-block: calc(var(--es-spacing) * 5);
2185
- }
2186
-
2187
2188
  .es\:my-auto {
2188
2189
  margin-block: auto;
2189
2190
  }
@@ -2232,6 +2233,10 @@ input[data-rac]::-webkit-search-cancel-button {
2232
2233
  margin-top: calc(var(--es-spacing) * 5);
2233
2234
  }
2234
2235
 
2236
+ .es\:mt-auto {
2237
+ margin-top: auto;
2238
+ }
2239
+
2235
2240
  .es\:mr-0\.5 {
2236
2241
  margin-right: calc(var(--es-spacing) * .5);
2237
2242
  }
@@ -2632,10 +2637,6 @@ input[data-rac]::-webkit-search-cancel-button {
2632
2637
  min-height: 100%;
2633
2638
  }
2634
2639
 
2635
- .es\:min-h-screen {
2636
- min-height: 100vh;
2637
- }
2638
-
2639
2640
  .es\:w-fill {
2640
2641
  width: -moz-available;
2641
2642
  width: -webkit-fill-available;
@@ -2750,6 +2751,10 @@ input[data-rac]::-webkit-search-cancel-button {
2750
2751
  width: 1px;
2751
2752
  }
2752
2753
 
2754
+ .es\:w-xs {
2755
+ width: var(--es-container-xs);
2756
+ }
2757
+
2753
2758
  .es\:max-w-2xl {
2754
2759
  max-width: var(--es-container-2xl);
2755
2760
  }
@@ -3570,8 +3575,8 @@ input[data-rac]::-webkit-search-cancel-button {
3570
3575
  overflow-y: visible;
3571
3576
  }
3572
3577
 
3573
- .es\:overscroll-contain {
3574
- overscroll-behavior: contain;
3578
+ .es\:overscroll-none {
3579
+ overscroll-behavior: none;
3575
3580
  }
3576
3581
 
3577
3582
  .es\:rounded {
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useEffect, useRef, useLayoutEffect, useMemo, useState, useCallback, startTransition, createContext, memo, forwardRef, useImperativeHandle, useContext, useId } from "react";
2
+ import { useEffect, useRef, useLayoutEffect, useMemo, useState, useCallback, createContext, memo, useInsertionEffect, forwardRef, startTransition, useImperativeHandle, useContext } from "react";
3
3
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
4
4
  import { DraggableContext } from "./draggable-context.js";
5
5
  import { r as reactDomExports } from "../../index-sSixe2j_.js";
@@ -532,7 +532,7 @@ function enumerable(enumerable2 = true) {
532
532
  };
533
533
  }
534
534
  function effects(...entries) {
535
- const effects2 = entries.map(E);
535
+ const effects2 = entries.map((fn) => E(fn));
536
536
  return () => effects2.forEach((cleanup) => cleanup());
537
537
  }
538
538
  var _previous_dec, _initial_dec, _current_dec$1, _current_dec2, _previous_dec2, _initial_dec2, _init$5, _initial, _a$3, initial_get, initial_set, _ValueHistory_instances, _previous, _b$1, previous_get, previous_set, _current, _c$2, current_get, current_set;
@@ -2018,6 +2018,56 @@ var Sensor = class extends Plugin {
2018
2018
  this.options = options2;
2019
2019
  }
2020
2020
  };
2021
+ var ActivationController = class extends AbortController {
2022
+ constructor(constraints, onActivate) {
2023
+ super();
2024
+ this.constraints = constraints;
2025
+ this.onActivate = onActivate;
2026
+ this.activated = false;
2027
+ for (const constraint of constraints != null ? constraints : []) {
2028
+ constraint.controller = this;
2029
+ }
2030
+ }
2031
+ onEvent(event) {
2032
+ var _a4;
2033
+ if (this.activated) return;
2034
+ if ((_a4 = this.constraints) == null ? void 0 : _a4.length) {
2035
+ for (const constraint of this.constraints) {
2036
+ constraint.onEvent(event);
2037
+ }
2038
+ } else {
2039
+ this.activate(event);
2040
+ }
2041
+ }
2042
+ activate(event) {
2043
+ if (this.activated) return;
2044
+ this.activated = true;
2045
+ this.onActivate(event);
2046
+ }
2047
+ abort(event) {
2048
+ this.activated = false;
2049
+ super.abort(event);
2050
+ }
2051
+ };
2052
+ var _controller;
2053
+ var ActivationConstraint = class {
2054
+ constructor(options2) {
2055
+ this.options = options2;
2056
+ __privateAdd$4(this, _controller);
2057
+ }
2058
+ set controller(controller) {
2059
+ __privateSet$4(this, _controller, controller);
2060
+ controller.signal.addEventListener("abort", () => this.abort());
2061
+ }
2062
+ /**
2063
+ * Called when the activation is triggered.
2064
+ */
2065
+ activate(event) {
2066
+ var _a4;
2067
+ (_a4 = __privateGet$4(this, _controller)) == null ? void 0 : _a4.activate(event);
2068
+ }
2069
+ };
2070
+ _controller = /* @__PURE__ */ new WeakMap();
2021
2071
  var Modifier = class extends Plugin {
2022
2072
  /**
2023
2073
  * Creates a new modifier instance.
@@ -2461,7 +2511,6 @@ function getBoundingRectangle(element) {
2461
2511
  const { width, height, top, left, bottom, right } = element.getBoundingClientRect();
2462
2512
  return { width, height, top, left, bottom, right };
2463
2513
  }
2464
- var canUseDOM$1 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
2465
2514
  function isWindow(element) {
2466
2515
  const elementString = Object.prototype.toString.call(element);
2467
2516
  return elementString === "[object Window]" || // In Electron context the Window object serializes to [object global]
@@ -2590,6 +2639,40 @@ function getVisibleBoundingRectangle(element, boundingClientRect = element.getBo
2590
2639
  }
2591
2640
  return rect;
2592
2641
  }
2642
+ function getEventCoordinates(event) {
2643
+ return {
2644
+ x: event.clientX,
2645
+ y: event.clientY
2646
+ };
2647
+ }
2648
+ var canUseDOM$1 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
2649
+ function getDocuments(rootDoc = document, seen = /* @__PURE__ */ new Set()) {
2650
+ if (seen.has(rootDoc)) return [];
2651
+ seen.add(rootDoc);
2652
+ const docs = [rootDoc];
2653
+ for (const frame of Array.from(
2654
+ rootDoc.querySelectorAll("iframe, frame")
2655
+ )) {
2656
+ try {
2657
+ const childDoc = frame.contentDocument;
2658
+ if (childDoc && !seen.has(childDoc)) {
2659
+ docs.push(...getDocuments(childDoc, seen));
2660
+ }
2661
+ } catch (e2) {
2662
+ }
2663
+ }
2664
+ try {
2665
+ const win = rootDoc.defaultView;
2666
+ if (win && win !== window.top) {
2667
+ const parentWin = win.parent;
2668
+ if (parentWin && parentWin.document && parentWin.document !== rootDoc) {
2669
+ docs.push(...getDocuments(parentWin.document, seen));
2670
+ }
2671
+ }
2672
+ } catch (e2) {
2673
+ }
2674
+ return docs;
2675
+ }
2593
2676
  function isSafari() {
2594
2677
  return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
2595
2678
  }
@@ -2639,6 +2722,18 @@ function isIFrameElement(element) {
2639
2722
  return (element == null ? void 0 : element.tagName) === "IFRAME";
2640
2723
  }
2641
2724
  var ProxiedElements = /* @__PURE__ */ new WeakMap();
2725
+ function isInteractiveElement(element) {
2726
+ return Boolean(
2727
+ element.closest(`
2728
+ input:not([disabled]),
2729
+ select:not([disabled]),
2730
+ textarea:not([disabled]),
2731
+ button:not([disabled]),
2732
+ a[href],
2733
+ [contenteditable]:not([contenteditable="false"])
2734
+ `)
2735
+ );
2736
+ }
2642
2737
  var Listeners = class {
2643
2738
  constructor() {
2644
2739
  this.entries = /* @__PURE__ */ new Set();
@@ -2651,14 +2746,17 @@ var Listeners = class {
2651
2746
  };
2652
2747
  }
2653
2748
  bind(target, input) {
2749
+ const eventTargets = Array.isArray(target) ? target : [target];
2654
2750
  const listeners = Array.isArray(input) ? input : [input];
2655
2751
  const entries = [];
2656
- for (const descriptor2 of listeners) {
2657
- const { type, listener, options: options2 } = descriptor2;
2658
- const entry = [target, descriptor2];
2659
- target.addEventListener(type, listener, options2);
2660
- this.entries.add(entry);
2661
- entries.push(entry);
2752
+ for (const target2 of eventTargets) {
2753
+ for (const descriptor2 of listeners) {
2754
+ const { type, listener, options: options2 } = descriptor2;
2755
+ const entry = [target2, descriptor2];
2756
+ target2.addEventListener(type, listener, options2);
2757
+ this.entries.add(entry);
2758
+ entries.push(entry);
2759
+ }
2662
2760
  }
2663
2761
  return function cleanup() {
2664
2762
  for (const [target2, { type, listener, options: options2 }] of entries) {
@@ -4979,9 +5077,8 @@ var defaults = Object.freeze({
4979
5077
  left: ["ArrowLeft"],
4980
5078
  right: ["ArrowRight"]
4981
5079
  },
4982
- shouldActivate(args) {
5080
+ preventActivation(event, source) {
4983
5081
  var _a4;
4984
- const { event, source } = args;
4985
5082
  const target = (_a4 = source.handle) != null ? _a4 : source.element;
4986
5083
  return event.target === target;
4987
5084
  }
@@ -5006,7 +5103,7 @@ var _KeyboardSensor = class _KeyboardSensor2 extends Sensor {
5006
5103
  }
5007
5104
  const {
5008
5105
  keyboardCodes = defaults.keyboardCodes,
5009
- shouldActivate = defaults.shouldActivate
5106
+ preventActivation = defaults.preventActivation
5010
5107
  } = options3 != null ? options3 : {};
5011
5108
  if (!keyboardCodes.start.includes(event.code)) {
5012
5109
  return;
@@ -5014,9 +5111,8 @@ var _KeyboardSensor = class _KeyboardSensor2 extends Sensor {
5014
5111
  if (!this.manager.dragOperation.status.idle) {
5015
5112
  return;
5016
5113
  }
5017
- if (shouldActivate({ event, source, manager: this.manager })) {
5018
- this.handleStart(event, source, options3);
5019
- }
5114
+ if (preventActivation == null ? void 0 : preventActivation(event, source)) return;
5115
+ this.handleStart(event, source, options3);
5020
5116
  };
5021
5117
  }
5022
5118
  bind(source, options2 = this.options) {
@@ -5156,6 +5252,89 @@ var KeyboardSensor = _KeyboardSensor;
5156
5252
  function isKeycode(event, codes) {
5157
5253
  return codes.includes(event.code);
5158
5254
  }
5255
+ var _coordinates;
5256
+ var DistanceConstraint = class extends ActivationConstraint {
5257
+ constructor() {
5258
+ super(...arguments);
5259
+ __privateAdd$2(this, _coordinates);
5260
+ }
5261
+ onEvent(event) {
5262
+ switch (event.type) {
5263
+ case "pointerdown":
5264
+ __privateSet$2(this, _coordinates, getEventCoordinates(event));
5265
+ break;
5266
+ case "pointermove":
5267
+ if (!__privateGet$2(this, _coordinates)) return;
5268
+ const { x, y: y2 } = getEventCoordinates(event);
5269
+ const delta = {
5270
+ x: x - __privateGet$2(this, _coordinates).x,
5271
+ y: y2 - __privateGet$2(this, _coordinates).y
5272
+ };
5273
+ const { tolerance } = this.options;
5274
+ if (tolerance && exceedsDistance(delta, tolerance)) {
5275
+ this.abort();
5276
+ return;
5277
+ }
5278
+ if (exceedsDistance(delta, this.options.value)) {
5279
+ this.activate(event);
5280
+ }
5281
+ break;
5282
+ case "pointerup":
5283
+ this.abort();
5284
+ break;
5285
+ }
5286
+ }
5287
+ abort() {
5288
+ __privateSet$2(this, _coordinates, void 0);
5289
+ }
5290
+ };
5291
+ _coordinates = /* @__PURE__ */ new WeakMap();
5292
+ var _timeout2, _coordinates2;
5293
+ var DelayConstraint = class extends ActivationConstraint {
5294
+ constructor() {
5295
+ super(...arguments);
5296
+ __privateAdd$2(this, _timeout2);
5297
+ __privateAdd$2(this, _coordinates2);
5298
+ }
5299
+ onEvent(event) {
5300
+ switch (event.type) {
5301
+ case "pointerdown":
5302
+ __privateSet$2(this, _coordinates2, getEventCoordinates(event));
5303
+ __privateSet$2(this, _timeout2, setTimeout(
5304
+ () => this.activate(event),
5305
+ this.options.value
5306
+ ));
5307
+ break;
5308
+ case "pointermove":
5309
+ if (!__privateGet$2(this, _coordinates2)) return;
5310
+ const { x, y: y2 } = getEventCoordinates(event);
5311
+ const delta = {
5312
+ x: x - __privateGet$2(this, _coordinates2).x,
5313
+ y: y2 - __privateGet$2(this, _coordinates2).y
5314
+ };
5315
+ if (exceedsDistance(delta, this.options.tolerance)) {
5316
+ this.abort();
5317
+ }
5318
+ break;
5319
+ case "pointerup":
5320
+ this.abort();
5321
+ break;
5322
+ }
5323
+ }
5324
+ abort() {
5325
+ if (__privateGet$2(this, _timeout2)) {
5326
+ clearTimeout(__privateGet$2(this, _timeout2));
5327
+ __privateSet$2(this, _coordinates2, void 0);
5328
+ __privateSet$2(this, _timeout2, void 0);
5329
+ }
5330
+ }
5331
+ };
5332
+ _timeout2 = /* @__PURE__ */ new WeakMap();
5333
+ _coordinates2 = /* @__PURE__ */ new WeakMap();
5334
+ var PointerActivationConstraints = class {
5335
+ };
5336
+ PointerActivationConstraints.Delay = DelayConstraint;
5337
+ PointerActivationConstraints.Distance = DistanceConstraint;
5159
5338
  var defaults2 = Object.freeze({
5160
5339
  activationConstraints(event, source) {
5161
5340
  var _a4;
@@ -5164,29 +5343,37 @@ var defaults2 = Object.freeze({
5164
5343
  return void 0;
5165
5344
  }
5166
5345
  if (pointerType === "touch") {
5167
- return {
5168
- delay: { value: 250, tolerance: 5 }
5169
- };
5346
+ return [
5347
+ new PointerActivationConstraints.Delay({ value: 250, tolerance: 5 })
5348
+ ];
5170
5349
  }
5171
5350
  if (isTextInput(target) && !event.defaultPrevented) {
5172
- return {
5173
- delay: { value: 200, tolerance: 0 }
5174
- };
5351
+ return [
5352
+ new PointerActivationConstraints.Delay({ value: 200, tolerance: 0 })
5353
+ ];
5175
5354
  }
5176
- return {
5177
- delay: { value: 200, tolerance: 10 },
5178
- distance: { value: 5 }
5179
- };
5355
+ return [
5356
+ new PointerActivationConstraints.Delay({ value: 200, tolerance: 10 }),
5357
+ new PointerActivationConstraints.Distance({ value: 5 })
5358
+ ];
5359
+ },
5360
+ preventActivation(event, source) {
5361
+ var _a4;
5362
+ const { target } = event;
5363
+ if (target === source.element) return false;
5364
+ if (target === source.handle) return false;
5365
+ if (!isElement(target)) return false;
5366
+ if ((_a4 = source.handle) == null ? void 0 : _a4.contains(target)) return false;
5367
+ return isInteractiveElement(target);
5180
5368
  }
5181
5369
  });
5182
- var _cleanup, _clearTimeout;
5370
+ var _cleanup;
5183
5371
  var _PointerSensor = class _PointerSensor2 extends Sensor {
5184
5372
  constructor(manager, options2) {
5185
5373
  super(manager);
5186
5374
  this.manager = manager;
5187
5375
  this.options = options2;
5188
5376
  __privateAdd$2(this, _cleanup, /* @__PURE__ */ new Set());
5189
- __privateAdd$2(this, _clearTimeout);
5190
5377
  this.listeners = new Listeners();
5191
5378
  this.latest = {
5192
5379
  event: void 0,
@@ -5236,36 +5423,33 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
5236
5423
  });
5237
5424
  return unbind;
5238
5425
  }
5239
- handlePointerDown(event, source, options2 = {}) {
5426
+ handlePointerDown(event, source, options2) {
5240
5427
  if (this.disabled || !event.isPrimary || event.button !== 0 || !isElement(event.target) || source.disabled || isCapturedBySensor(event) || !this.manager.dragOperation.status.idle) {
5241
5428
  return;
5242
5429
  }
5430
+ const { preventActivation = defaults2.preventActivation } = options2 != null ? options2 : {};
5431
+ if (preventActivation == null ? void 0 : preventActivation(event, source)) {
5432
+ return;
5433
+ }
5243
5434
  const { target } = event;
5244
5435
  const isNativeDraggable = isHTMLElement(target) && target.draggable && target.getAttribute("draggable") === "true";
5245
5436
  const offset = getFrameTransform(source.element);
5437
+ const { x, y: y2 } = getEventCoordinates(event);
5246
5438
  this.initialCoordinates = {
5247
- x: event.clientX * offset.scaleX + offset.x,
5248
- y: event.clientY * offset.scaleY + offset.y
5439
+ x: x * offset.scaleX + offset.x,
5440
+ y: y2 * offset.scaleY + offset.y
5249
5441
  };
5250
5442
  const constraints = this.activationConstraints(event, source);
5251
5443
  event.sensor = this;
5252
- if (!(constraints == null ? void 0 : constraints.delay) && !(constraints == null ? void 0 : constraints.distance)) {
5253
- this.handleStart(source, event);
5254
- } else {
5255
- const { delay } = constraints;
5256
- if (delay) {
5257
- const timeout2 = setTimeout(
5258
- () => this.handleStart(source, event),
5259
- delay.value
5260
- );
5261
- __privateSet$2(this, _clearTimeout, () => {
5262
- clearTimeout(timeout2);
5263
- __privateSet$2(this, _clearTimeout, void 0);
5264
- });
5265
- }
5266
- }
5267
- const ownerDocument = getDocument(event.target);
5268
- const unbindListeners = this.listeners.bind(ownerDocument, [
5444
+ const controller = new ActivationController(
5445
+ constraints,
5446
+ (event2) => this.handleStart(source, event2)
5447
+ );
5448
+ controller.signal.onabort = () => this.handleCancel(event);
5449
+ controller.onEvent(event);
5450
+ this.controller = controller;
5451
+ const documents = getDocuments();
5452
+ const unbindListeners = this.listeners.bind(documents, [
5269
5453
  {
5270
5454
  type: "pointermove",
5271
5455
  listener: (event2) => this.handlePointerMove(event2, source)
@@ -5287,50 +5471,27 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
5287
5471
  }
5288
5472
  ]);
5289
5473
  const cleanup = () => {
5290
- var _a4;
5291
5474
  unbindListeners();
5292
- (_a4 = __privateGet$2(this, _clearTimeout)) == null ? void 0 : _a4.call(this);
5293
5475
  this.initialCoordinates = void 0;
5294
5476
  };
5295
5477
  __privateGet$2(this, _cleanup).add(cleanup);
5296
5478
  }
5297
5479
  handlePointerMove(event, source) {
5298
- const coordinates = {
5299
- x: event.clientX,
5300
- y: event.clientY
5301
- };
5302
- const offset = getFrameTransform(source.element);
5303
- coordinates.x = coordinates.x * offset.scaleX + offset.x;
5304
- coordinates.y = coordinates.y * offset.scaleY + offset.y;
5480
+ var _a4, _b2;
5481
+ if (((_a4 = this.controller) == null ? void 0 : _a4.activated) === false) {
5482
+ (_b2 = this.controller) == null ? void 0 : _b2.onEvent(event);
5483
+ return;
5484
+ }
5305
5485
  if (this.manager.dragOperation.status.dragging) {
5486
+ const coordinates = getEventCoordinates(event);
5487
+ const offset = getFrameTransform(source.element);
5488
+ coordinates.x = coordinates.x * offset.scaleX + offset.x;
5489
+ coordinates.y = coordinates.y * offset.scaleY + offset.y;
5306
5490
  event.preventDefault();
5307
5491
  event.stopPropagation();
5308
5492
  this.latest.event = event;
5309
5493
  this.latest.coordinates = coordinates;
5310
5494
  scheduler.schedule(this.handleMove);
5311
- return;
5312
- }
5313
- if (!this.initialCoordinates) {
5314
- return;
5315
- }
5316
- const delta = {
5317
- x: coordinates.x - this.initialCoordinates.x,
5318
- y: coordinates.y - this.initialCoordinates.y
5319
- };
5320
- const constraints = this.activationConstraints(event, source);
5321
- const { distance, delay } = constraints != null ? constraints : {};
5322
- if (distance) {
5323
- if (distance.tolerance != null && exceedsDistance(delta, distance.tolerance)) {
5324
- return this.handleCancel(event);
5325
- }
5326
- if (exceedsDistance(delta, distance.value)) {
5327
- return this.handleStart(source, event);
5328
- }
5329
- }
5330
- if (delay) {
5331
- if (exceedsDistance(delta, delay.tolerance)) {
5332
- return this.handleCancel(event);
5333
- }
5334
5495
  }
5335
5496
  }
5336
5497
  handlePointerUp(event) {
@@ -5350,9 +5511,7 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
5350
5511
  }
5351
5512
  }
5352
5513
  handleStart(source, event) {
5353
- var _a4;
5354
5514
  const { manager, initialCoordinates } = this;
5355
- (_a4 = __privateGet$2(this, _clearTimeout)) == null ? void 0 : _a4.call(this);
5356
5515
  if (!initialCoordinates || !manager.dragOperation.status.idle) {
5357
5516
  return;
5358
5517
  }
@@ -5369,7 +5528,8 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
5369
5528
  const ownerDocument = getDocument(event.target);
5370
5529
  const pointerCaptureTarget = ownerDocument.body;
5371
5530
  pointerCaptureTarget.setPointerCapture(event.pointerId);
5372
- const unbind = this.listeners.bind(ownerDocument, [
5531
+ const listenerTargets = isElement(event.target) ? [event.target, ownerDocument.body] : ownerDocument.body;
5532
+ const unbind = this.listeners.bind(listenerTargets, [
5373
5533
  {
5374
5534
  // Prevent scrolling on touch devices
5375
5535
  type: "touchmove",
@@ -5390,13 +5550,6 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
5390
5550
  {
5391
5551
  type: "keydown",
5392
5552
  listener: this.handleKeyDown
5393
- },
5394
- {
5395
- type: "lostpointercapture",
5396
- listener: (event2) => {
5397
- if (event2.target !== pointerCaptureTarget) return;
5398
- this.handlePointerUp(event2);
5399
- }
5400
5553
  }
5401
5554
  ]);
5402
5555
  __privateGet$2(this, _cleanup).add(unbind);
@@ -5422,7 +5575,6 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
5422
5575
  }
5423
5576
  };
5424
5577
  _cleanup = /* @__PURE__ */ new WeakMap();
5425
- _clearTimeout = /* @__PURE__ */ new WeakMap();
5426
5578
  _PointerSensor.configure = configurator(_PointerSensor);
5427
5579
  _PointerSensor.defaults = defaults2;
5428
5580
  var PointerSensor = _PointerSensor;
@@ -6566,9 +6718,7 @@ function DragDropProvider(_a22) {
6566
6718
  "onDragOver",
6567
6719
  "onDragEnd"
6568
6720
  ]);
6569
- var _a32;
6570
6721
  const rendererRef = useRef(null);
6571
- const [manager, setManager] = useState((_a32 = input.manager) != null ? _a32 : null);
6572
6722
  const { plugins, modifiers, sensors } = input;
6573
6723
  const handleBeforeDragStart = useLatest(onBeforeDragStart);
6574
6724
  const handleDragStart = useLatest(onDragStart);
@@ -6576,53 +6726,57 @@ function DragDropProvider(_a22) {
6576
6726
  const handleDragMove = useLatest(onDragMove);
6577
6727
  const handleDragEnd = useLatest(onDragEnd);
6578
6728
  const handleCollision = useLatest(onCollision);
6729
+ const manager = useStableInstance(() => {
6730
+ var _a32;
6731
+ return (_a32 = input.manager) != null ? _a32 : new DragDropManager2(input);
6732
+ });
6579
6733
  useEffect(() => {
6580
- var _a4;
6581
6734
  if (!rendererRef.current) throw new Error("Renderer not found");
6582
6735
  const { renderer, trackRendering } = rendererRef.current;
6583
- const manager2 = (_a4 = input.manager) != null ? _a4 : new DragDropManager2(input);
6584
- manager2.renderer = renderer;
6585
- manager2.monitor.addEventListener("beforedragstart", (event) => {
6586
- const callback = handleBeforeDragStart.current;
6587
- if (callback) {
6588
- trackRendering(() => callback(event, manager2));
6589
- }
6590
- });
6591
- manager2.monitor.addEventListener(
6592
- "dragstart",
6593
- (event) => {
6594
- var _a5;
6595
- return (_a5 = handleDragStart.current) == null ? void 0 : _a5.call(handleDragStart, event, manager2);
6596
- }
6597
- );
6598
- manager2.monitor.addEventListener("dragover", (event) => {
6599
- const callback = handleDragOver.current;
6600
- if (callback) {
6601
- trackRendering(() => callback(event, manager2));
6602
- }
6603
- });
6604
- manager2.monitor.addEventListener("dragmove", (event) => {
6605
- const callback = handleDragMove.current;
6606
- if (callback) {
6607
- trackRendering(() => callback(event, manager2));
6608
- }
6609
- });
6610
- manager2.monitor.addEventListener("dragend", (event) => {
6611
- const callback = handleDragEnd.current;
6612
- if (callback) {
6613
- trackRendering(() => callback(event, manager2));
6614
- }
6615
- });
6616
- manager2.monitor.addEventListener(
6617
- "collision",
6618
- (event) => {
6619
- var _a5;
6620
- return (_a5 = handleCollision.current) == null ? void 0 : _a5.call(handleCollision, event, manager2);
6621
- }
6622
- );
6623
- startTransition(() => setManager(manager2));
6624
- return manager2.destroy;
6625
- }, [input.manager]);
6736
+ const { monitor } = manager;
6737
+ manager.renderer = renderer;
6738
+ const listeners = [
6739
+ monitor.addEventListener("beforedragstart", (event) => {
6740
+ const callback = handleBeforeDragStart.current;
6741
+ if (callback) {
6742
+ trackRendering(() => callback(event, manager));
6743
+ }
6744
+ }),
6745
+ monitor.addEventListener(
6746
+ "dragstart",
6747
+ (event) => {
6748
+ var _a32;
6749
+ return (_a32 = handleDragStart.current) == null ? void 0 : _a32.call(handleDragStart, event, manager);
6750
+ }
6751
+ ),
6752
+ monitor.addEventListener("dragover", (event) => {
6753
+ const callback = handleDragOver.current;
6754
+ if (callback) {
6755
+ trackRendering(() => callback(event, manager));
6756
+ }
6757
+ }),
6758
+ monitor.addEventListener("dragmove", (event) => {
6759
+ const callback = handleDragMove.current;
6760
+ if (callback) {
6761
+ trackRendering(() => callback(event, manager));
6762
+ }
6763
+ }),
6764
+ monitor.addEventListener("dragend", (event) => {
6765
+ const callback = handleDragEnd.current;
6766
+ if (callback) {
6767
+ trackRendering(() => callback(event, manager));
6768
+ }
6769
+ }),
6770
+ monitor.addEventListener(
6771
+ "collision",
6772
+ (event) => {
6773
+ var _a32;
6774
+ return (_a32 = handleCollision.current) == null ? void 0 : _a32.call(handleCollision, event, manager);
6775
+ }
6776
+ )
6777
+ ];
6778
+ return () => listeners.forEach((dispose) => dispose());
6779
+ }, [manager]);
6626
6780
  useOnValueChange(
6627
6781
  plugins,
6628
6782
  () => manager && (manager.plugins = plugins != null ? plugins : defaultPreset.plugins),
@@ -6643,6 +6797,19 @@ function DragDropProvider(_a22) {
6643
6797
  children
6644
6798
  ] });
6645
6799
  }
6800
+ function useStableInstance(create) {
6801
+ const ref = useRef(null);
6802
+ if (!ref.current) {
6803
+ ref.current = create();
6804
+ }
6805
+ useInsertionEffect(() => {
6806
+ return () => {
6807
+ var _a22;
6808
+ return (_a22 = ref.current) == null ? void 0 : _a22.destroy();
6809
+ };
6810
+ }, []);
6811
+ return ref.current;
6812
+ }
6646
6813
  function useDragDropManager() {
6647
6814
  return useContext(DragDropContext);
6648
6815
  }
@@ -7223,6 +7390,7 @@ function mutate(items, event, mutation) {
7223
7390
  function move(items, event) {
7224
7391
  return mutate(items, event, arrayMove);
7225
7392
  }
7393
+ const removeIds = (arr) => arr.map(({ id, ...item }) => item);
7226
7394
  const SortableItem = ({ id, index, disabled, children, axis }) => {
7227
7395
  const [element, setElement] = useState(null);
7228
7396
  const handleRef = useRef(null);
@@ -7282,7 +7450,6 @@ const SortableItem = ({ id, index, disabled, children, axis }) => {
7282
7450
  * @preserve
7283
7451
  */
7284
7452
  const Draggable3 = (props) => {
7285
- useId("draggable-list-item-");
7286
7453
  const {
7287
7454
  children,
7288
7455
  items: rawItems,
@@ -7297,9 +7464,12 @@ const Draggable3 = (props) => {
7297
7464
  if (typeof rawItems === "undefined" || rawItems === null || !Array.isArray(rawItems)) {
7298
7465
  console.warn(__("Draggable: 'items' are not an array or are undefined!", "eightshift-ui-components"));
7299
7466
  }
7300
- const [items, setItems] = useState(rawItems);
7467
+ const [items, setItems] = useState(rawItems.map((item) => ({ ...item, id: item?.id || randomId(6) })));
7301
7468
  useEffect(() => {
7302
- setItems(rawItems);
7469
+ if (JSON.stringify(rawItems) === JSON.stringify(removeIds(items))) {
7470
+ return;
7471
+ }
7472
+ setItems(rawItems.map((item) => ({ ...item, id: randomId(6) })));
7303
7473
  }, [rawItems]);
7304
7474
  if (hidden) {
7305
7475
  return null;
@@ -7312,18 +7482,20 @@ const Draggable3 = (props) => {
7312
7482
  children: /* @__PURE__ */ jsx(
7313
7483
  DragDropProvider,
7314
7484
  {
7315
- onDragOver: (event) => setItems((items2) => move(items2, event)),
7316
7485
  onDragEnd: (event) => {
7317
7486
  if (event?.canceled) {
7318
7487
  return;
7319
7488
  }
7320
- setItems((items2) => move(items2, event));
7321
- onChange(items);
7489
+ setItems((items2) => {
7490
+ const newItems = move(items2, event);
7491
+ onChange(removeIds(newItems));
7492
+ return newItems;
7493
+ });
7322
7494
  },
7323
- children: items.map((item, index) => /* @__PURE__ */ jsx(
7495
+ children: items.map(({ id, ...item }, index) => /* @__PURE__ */ jsx(
7324
7496
  SortableItem,
7325
7497
  {
7326
- id: randomId(6),
7498
+ id,
7327
7499
  index,
7328
7500
  item,
7329
7501
  disabled: noReorder,
@@ -7336,20 +7508,21 @@ const Draggable3 = (props) => {
7336
7508
  ...updated[index],
7337
7509
  ...newValue
7338
7510
  };
7339
- onChange(updated);
7340
7511
  setItems(updated);
7512
+ onChange(removeIds(updated));
7341
7513
  },
7342
7514
  itemIndex: index,
7343
7515
  deleteItem: () => {
7344
7516
  setItems([...items].filter((_2, i2) => i2 !== index));
7345
- onChange([...items].filter((_2, i2) => i2 !== index));
7517
+ onChange(removeIds([...items].filter((_2, i2) => i2 !== index)));
7346
7518
  if (onAfterItemRemove) {
7347
- onAfterItemRemove(item);
7519
+ const { id: id2, ...restItem } = item;
7520
+ onAfterItemRemove(restItem);
7348
7521
  }
7349
7522
  }
7350
7523
  }) })
7351
7524
  },
7352
- index
7525
+ id
7353
7526
  ))
7354
7527
  }
7355
7528
  )
@@ -244,7 +244,8 @@ const $28f4fd908f0de97f$export$feabaa331e1d464c = /* @__PURE__ */ forwardRef(fun
244
244
  * @param {string} props.label - Label to display.
245
245
  * @param {string} [props.subtitle] - Subtitle to display.
246
246
  * @param {string} [props.className] - Classes to pass to the container.
247
- * @param {string} [props.contentClassName] - Classes to pass to the inner content wrapper.
247
+ * @param {string} [props.contentClassName] - Classes to pass to the inner content outer wrapper.
248
+ * @param {string} [props.contentWrapClassName] - Classes to pass to the inner content wrapper.
248
249
  * @param {string} [props.labelClassName] - Classes to pass to the label.
249
250
  * @param {string} [props.headerClassName] - Classes to pass to the header (label + trigger).
250
251
  * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display in the panel header, left of the expand button.
@@ -275,6 +276,7 @@ const Expandable = (props) => {
275
276
  className,
276
277
  labelClassName,
277
278
  contentClassName,
279
+ contentWrapClassName,
278
280
  headerClassName,
279
281
  actions,
280
282
  keepActionsOnExpand = false,
@@ -396,7 +398,7 @@ const Expandable = (props) => {
396
398
  "es:transition-plus-h",
397
399
  contentClassName
398
400
  ),
399
- children: /* @__PURE__ */ jsx("div", { className: "es:space-y-1 es:px-3 es:py-3.5", children })
401
+ children: /* @__PURE__ */ jsx("div", { className: clsx("es:flex es:flex-col es:gap-2.5 es:px-3 es:py-3.5", contentWrapClassName), children })
400
402
  }
401
403
  )
402
404
  ]
@@ -7,7 +7,7 @@ import { BaseControl } from "../base-control/base-control.js";
7
7
  import { icons } from "../../icons/icons.js";
8
8
  import { getColumnConfigOutputText } from "./utils.js";
9
9
  import { c as clsx } from "../../clsx-DgYk2OaC.js";
10
- import { A as AnimatePresence, m as motion } from "../../proxy-Bj4KTTJt.js";
10
+ import { A as AnimatePresence, m as motion } from "../../proxy-CcjltLEW.js";
11
11
  /**
12
12
  * A two-thumb slider for selecting a range of columns.
13
13
  *
@@ -6,7 +6,7 @@ import { c as clsx } from "../../clsx-DgYk2OaC.js";
6
6
  import { NumberPicker } from "../number-picker/number-picker.js";
7
7
  import { generateMarkers, generateGridTemplate } from "./utils.js";
8
8
  import { HStack } from "../layout/hstack.js";
9
- import { A as AnimatePresence, m as motion } from "../../proxy-Bj4KTTJt.js";
9
+ import { A as AnimatePresence, m as motion } from "../../proxy-CcjltLEW.js";
10
10
  /**
11
11
  * A single/multi-thumb slider component.
12
12
  *
@@ -5187,13 +5187,22 @@ function distance2D(a, b) {
5187
5187
  const yDelta = distance(a.y, b.y);
5188
5188
  return Math.sqrt(xDelta ** 2 + yDelta ** 2);
5189
5189
  }
5190
+ const overflowStyles = /* @__PURE__ */ new Set(["auto", "scroll"]);
5190
5191
  class PanSession {
5191
- constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3 } = {}) {
5192
+ constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element } = {}) {
5192
5193
  this.startEvent = null;
5193
5194
  this.lastMoveEvent = null;
5194
5195
  this.lastMoveEventInfo = null;
5195
5196
  this.handlers = {};
5196
5197
  this.contextWindow = window;
5198
+ this.scrollPositions = /* @__PURE__ */ new Map();
5199
+ this.removeScrollListeners = null;
5200
+ this.onElementScroll = (event2) => {
5201
+ this.handleScroll(event2.target);
5202
+ };
5203
+ this.onWindowScroll = () => {
5204
+ this.handleScroll(window);
5205
+ };
5197
5206
  this.updatePoint = () => {
5198
5207
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
5199
5208
  return;
@@ -5246,12 +5255,82 @@ class PanSession {
5246
5255
  const { onSessionStart } = handlers;
5247
5256
  onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
5248
5257
  this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
5258
+ if (element) {
5259
+ this.startScrollTracking(element);
5260
+ }
5261
+ }
5262
+ /**
5263
+ * Start tracking scroll on ancestors and window.
5264
+ */
5265
+ startScrollTracking(element) {
5266
+ let current = element.parentElement;
5267
+ while (current) {
5268
+ const style = getComputedStyle(current);
5269
+ if (overflowStyles.has(style.overflowX) || overflowStyles.has(style.overflowY)) {
5270
+ this.scrollPositions.set(current, {
5271
+ x: current.scrollLeft,
5272
+ y: current.scrollTop
5273
+ });
5274
+ }
5275
+ current = current.parentElement;
5276
+ }
5277
+ this.scrollPositions.set(window, {
5278
+ x: window.scrollX,
5279
+ y: window.scrollY
5280
+ });
5281
+ window.addEventListener("scroll", this.onElementScroll, {
5282
+ capture: true,
5283
+ passive: true
5284
+ });
5285
+ window.addEventListener("scroll", this.onWindowScroll, {
5286
+ passive: true
5287
+ });
5288
+ this.removeScrollListeners = () => {
5289
+ window.removeEventListener("scroll", this.onElementScroll, {
5290
+ capture: true
5291
+ });
5292
+ window.removeEventListener("scroll", this.onWindowScroll);
5293
+ };
5294
+ }
5295
+ /**
5296
+ * Handle scroll compensation during drag.
5297
+ *
5298
+ * For element scroll: adjusts history origin since pageX/pageY doesn't change.
5299
+ * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
5300
+ */
5301
+ handleScroll(target) {
5302
+ const initial = this.scrollPositions.get(target);
5303
+ if (!initial)
5304
+ return;
5305
+ const isWindow = target === window;
5306
+ const current = isWindow ? { x: window.scrollX, y: window.scrollY } : {
5307
+ x: target.scrollLeft,
5308
+ y: target.scrollTop
5309
+ };
5310
+ const delta = { x: current.x - initial.x, y: current.y - initial.y };
5311
+ if (delta.x === 0 && delta.y === 0)
5312
+ return;
5313
+ if (isWindow) {
5314
+ if (this.lastMoveEventInfo) {
5315
+ this.lastMoveEventInfo.point.x += delta.x;
5316
+ this.lastMoveEventInfo.point.y += delta.y;
5317
+ }
5318
+ } else {
5319
+ if (this.history.length > 0) {
5320
+ this.history[0].x -= delta.x;
5321
+ this.history[0].y -= delta.y;
5322
+ }
5323
+ }
5324
+ this.scrollPositions.set(target, current);
5325
+ frame.update(this.updatePoint, true);
5249
5326
  }
5250
5327
  updateHandlers(handlers) {
5251
5328
  this.handlers = handlers;
5252
5329
  }
5253
5330
  end() {
5254
5331
  this.removeListeners && this.removeListeners();
5332
+ this.removeScrollListeners && this.removeScrollListeners();
5333
+ this.scrollPositions.clear();
5255
5334
  cancelFrame(this.updatePoint);
5256
5335
  }
5257
5336
  }
@@ -5488,7 +5567,8 @@ class VisualElementDragControls {
5488
5567
  transformPagePoint: this.visualElement.getTransformPagePoint(),
5489
5568
  dragSnapToOrigin,
5490
5569
  distanceThreshold,
5491
- contextWindow: getContextWindow(this.visualElement)
5570
+ contextWindow: getContextWindow(this.visualElement),
5571
+ element: this.visualElement.current
5492
5572
  });
5493
5573
  }
5494
5574
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightshift/ui-components",
3
- "version": "6.0.9",
3
+ "version": "6.0.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -50,15 +50,11 @@
50
50
  "devDependencies": {
51
51
  "@adobe/react-spectrum": "^3.46.0",
52
52
  "@atom-universe/use-web-worker": "^2.2.1",
53
- "@dnd-kit/abstract": "^0.1.21",
54
- "@dnd-kit/core": "^6.3.1",
55
- "@dnd-kit/dom": "^0.1.21",
56
- "@dnd-kit/helpers": "^0.1.21",
57
- "@dnd-kit/modifiers": "^9.0.0",
58
- "@dnd-kit/react": "^0.1.21",
59
- "@dnd-kit/sortable": "^10.0.0",
60
- "@dnd-kit/utilities": "^3.2.2",
61
- "@eslint/compat": "^2.0.0",
53
+ "@dnd-kit/abstract": "^0.2.1",
54
+ "@dnd-kit/dom": "^0.2.1",
55
+ "@dnd-kit/helpers": "^0.2.1",
56
+ "@dnd-kit/react": "^0.2.1",
57
+ "@eslint/compat": "^2.0.1",
62
58
  "@react-stately/collections": "^3.12.8",
63
59
  "@stylistic/eslint-plugin-js": "^4.4.1",
64
60
  "@tailwindcss/vite": "^4.1.18",
@@ -76,7 +72,7 @@
76
72
  "css-gradient-parser": "^0.0.18",
77
73
  "eslint": "^9.39.2",
78
74
  "eslint-config-prettier": "^10.1.8",
79
- "eslint-plugin-jsdoc": "^61.5.0",
75
+ "eslint-plugin-jsdoc": "^61.7.1",
80
76
  "eslint-plugin-prettier": "^5.5.4",
81
77
  "glob": "^13.0.0",
82
78
  "globals": "^16.5.0",
@@ -107,6 +103,6 @@
107
103
  "dependencies": {
108
104
  "@fontsource-variable/geist-mono": "^5.2.7",
109
105
  "@fontsource-variable/roboto-flex": "^5.2.8",
110
- "motion": "^12.24.11"
106
+ "motion": "^12.25.0"
111
107
  }
112
108
  }