@vuu-ui/vuu-utils 4.0.0 → 4.1.0

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 (40) hide show
  1. package/package.json +7 -7
  2. package/src/vendor/@dnd-kit/abstract/index.d.ts +114 -32
  3. package/src/vendor/@dnd-kit/abstract/index.js +430 -280
  4. package/src/vendor/@dnd-kit/abstract/index.js.map +1 -1
  5. package/src/vendor/@dnd-kit/abstract/modifiers.d.ts +7 -7
  6. package/src/vendor/@dnd-kit/abstract/modifiers.js.map +1 -1
  7. package/src/vendor/@dnd-kit/abstract/package.json +8 -3
  8. package/src/vendor/@dnd-kit/collision/dist/index.js +10 -3
  9. package/src/vendor/@dnd-kit/collision/package.json +8 -3
  10. package/src/vendor/@dnd-kit/dom/index.d.ts +225 -126
  11. package/src/vendor/@dnd-kit/dom/index.js +998 -484
  12. package/src/vendor/@dnd-kit/dom/index.js.map +1 -1
  13. package/src/vendor/@dnd-kit/dom/modifiers.d.ts +1 -1
  14. package/src/vendor/@dnd-kit/dom/package.json +11 -5
  15. package/src/vendor/@dnd-kit/dom/plugins/debug.js +10 -7
  16. package/src/vendor/@dnd-kit/dom/plugins/debug.js.map +1 -1
  17. package/src/vendor/@dnd-kit/dom/sortable.d.ts +45 -11
  18. package/src/vendor/@dnd-kit/dom/sortable.js +203 -54
  19. package/src/vendor/@dnd-kit/dom/sortable.js.map +1 -1
  20. package/src/vendor/@dnd-kit/dom/utilities.d.ts +82 -10
  21. package/src/vendor/@dnd-kit/dom/utilities.js +249 -95
  22. package/src/vendor/@dnd-kit/dom/utilities.js.map +1 -1
  23. package/src/vendor/@dnd-kit/geometry/package.json +7 -2
  24. package/src/vendor/@dnd-kit/react/hooks.js +61 -38
  25. package/src/vendor/@dnd-kit/react/hooks.js.map +1 -0
  26. package/src/vendor/@dnd-kit/react/index.d.ts +18 -9
  27. package/src/vendor/@dnd-kit/react/index.js +100 -59
  28. package/src/vendor/@dnd-kit/react/index.js.map +1 -0
  29. package/src/vendor/@dnd-kit/react/package.json +17 -5
  30. package/src/vendor/@dnd-kit/react/sortable.d.ts +1 -1
  31. package/src/vendor/@dnd-kit/react/sortable.js +24 -10
  32. package/src/vendor/@dnd-kit/react/sortable.js.map +1 -0
  33. package/src/vendor/@dnd-kit/react/utilities.js.map +1 -0
  34. package/src/vendor/@dnd-kit/state/dist/index.js +1 -1
  35. package/src/vendor/@dnd-kit/state/package.json +6 -1
  36. package/src/vendor/@preact/signals-core/dist/signals-core.js +1 -1
  37. package/src/vendor/@preact/signals-core/dist/signals-core.js.map +1 -1
  38. package/types/ThemeProvider.d.ts +1 -1
  39. package/types/context-definitions/DataProvider.d.ts +1 -1
  40. package/types/context-definitions/DataSourceProvider.d.ts +1 -1
@@ -1,7 +1,8 @@
1
- import { configurator, Sensor, Plugin, CorePlugin, DragDropManager as DragDropManager$1, Draggable as Draggable$1, Droppable as Droppable$1, descriptor } from '../abstract/index.js';
2
- import { ScrollDirection, Listeners, isElement, scrollIntoViewIfNeeded, DOMRectangle, getDocument, isHTMLElement, getFrameTransform, scheduler, isTextInput, isKeyboardEvent, isPointerEvent, canScroll, detectScrollIntent, getElementFromPoint, getScrollableAncestors, generateUniqueId, isSafari, Styles, getComputedStyles, parseTranslate, supportsPopover, showPopover, getWindow, supportsStyle, getFrameElement, cloneElement, getFinalKeyframe, animateTransform, ProxiedElements, PositionObserver } from './utilities.js';
3
- import { effect, computed, deepEqual, signal, batch, untracked, effects, reactive } from '../state/dist/index.js';
4
- import { exceedsDistance, Axes, Point, Rectangle } from '../geometry/dist/index.js';
1
+ import { configurator, Plugin, Sensor, ActivationController, CorePlugin, DragDropManager as DragDropManager$1, resolveCustomizable, Draggable as Draggable$1, Droppable as Droppable$1, ActivationConstraint, descriptor } from '../abstract/index.js';
2
+ export { resolveCustomizable } from '../abstract/index.js';
3
+ import { ScrollDirection, getRoot, Listeners, isElement, scrollIntoViewIfNeeded, DOMRectangle, getDocument, isHTMLElement, getFrameTransform, getEventCoordinates, getDocuments, scheduler, getInteractiveElement, isTextInput, getScrollPosition, canScroll, detectScrollIntent, getElementFromPoint, getScrollableAncestors, isKeyboardEvent, isPointerEvent, generateUniqueId, isSafari, isDocument, isShadowRoot, Styles, getComputedStyles, parseTransform, parseTranslate, getFixedPositionOffset, supportsPopover, showPopover, getWindow, prefersReducedMotion, getFrameElement, cloneElement, supportsStyle, getFinalKeyframe, animateTransform, ProxiedElements, PositionObserver } from './utilities.js';
4
+ import { untracked, effect, computed, deepEqual, signal, batch, effects, reactive, derived } from '../state/dist/index.js';
5
+ import { Axes, Point, Rectangle, exceedsDistance } from '../geometry/dist/index.js';
5
6
  import { defaultCollisionDetection } from '../collision/dist/index.js';
6
7
 
7
8
  var __create = Object.create;
@@ -43,8 +44,8 @@ var __objRest = (source, exclude) => {
43
44
  return target;
44
45
  };
45
46
  var __decoratorStart = (base) => {
46
- var _a4;
47
- return [, , , __create((_a4 = base == null ? void 0 : base[__knownSymbol("metadata")]) != null ? _a4 : null)];
47
+ var _a5;
48
+ return [, , , __create((_a5 = base == null ? void 0 : base[__knownSymbol("metadata")]) != null ? _a5 : null)];
48
49
  };
49
50
  var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
50
51
  var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
@@ -123,6 +124,10 @@ function isFocusable(element) {
123
124
  const tagName = element.tagName.toLowerCase();
124
125
  return ["input", "select", "textarea", "a", "button"].includes(tagName);
125
126
  }
127
+ function supportsPressedState(element) {
128
+ var _a5;
129
+ return ((_a5 = element.getAttribute("role")) != null ? _a5 : "button") === "button";
130
+ }
126
131
 
127
132
  // src/core/plugins/accessibility/HiddenText.ts
128
133
  function createHiddenText(id, value) {
@@ -232,10 +237,10 @@ var Accessibility = class extends Plugin {
232
237
  }
233
238
  }
234
239
  this.registerEffect(() => {
235
- var _a4;
240
+ var _a5;
236
241
  mutations.clear();
237
242
  for (const draggable of this.manager.registry.draggables.value) {
238
- const activator = (_a4 = draggable.handle) != null ? _a4 : draggable.element;
243
+ const activator = (_a5 = draggable.handle) != null ? _a5 : draggable.element;
239
244
  if (activator) {
240
245
  if (!hiddenTextElement || !liveRegionElement) {
241
246
  mutations.add(initialize);
@@ -261,7 +266,8 @@ var Accessibility = class extends Plugin {
261
266
  () => activator.setAttribute("aria-describedby", descriptionId)
262
267
  );
263
268
  }
264
- for (const key of ["aria-pressed", "aria-grabbed"]) {
269
+ const stateAttributes = supportsPressedState(activator) ? ["aria-pressed", "aria-grabbed"] : ["aria-grabbed"];
270
+ for (const key of stateAttributes) {
265
271
  const value = String(draggable.isDragging);
266
272
  if (activator.getAttribute(key) !== value) {
267
273
  mutations.add(() => activator.setAttribute(key, value));
@@ -296,31 +302,285 @@ function debounce(fn, wait) {
296
302
  debounced.cancel = () => clearTimeout(timeout);
297
303
  return debounced;
298
304
  }
299
- var Cursor = class extends Plugin {
305
+ var styleRegistry = /* @__PURE__ */ new Map();
306
+ function isAttached(root) {
307
+ return isShadowRoot(root) ? root.host.isConnected : root.defaultView != null;
308
+ }
309
+ var _roots_dec, _targetRoot_dec, _sourceRoot_dec, _additionalRoots_dec, _registeredRules_dec, _a, _init, _registeredRules, _additionalRoots, _retainedRoots, _injections, _StyleInjector_instances, syncStyles_fn, inject_fn, injectStyleElement_fn, injectAdoptedSheet_fn;
310
+ var _StyleInjector = class _StyleInjector extends (_a = CorePlugin, _registeredRules_dec = [reactive], _additionalRoots_dec = [reactive], _sourceRoot_dec = [derived], _targetRoot_dec = [derived], _roots_dec = [derived], _a) {
300
311
  constructor(manager, options) {
301
312
  super(manager, options);
302
- this.manager = manager;
303
- const doc = computed(
304
- () => {
305
- var _a4;
306
- return getDocument((_a4 = this.manager.dragOperation.source) == null ? void 0 : _a4.element);
313
+ __runInitializers(_init, 5, this);
314
+ __privateAdd(this, _StyleInjector_instances);
315
+ __privateAdd(this, _registeredRules, __runInitializers(_init, 8, this, /* @__PURE__ */ new Map())), __runInitializers(_init, 11, this);
316
+ __privateAdd(this, _additionalRoots, __runInitializers(_init, 12, this, /* @__PURE__ */ new Set())), __runInitializers(_init, 15, this);
317
+ /**
318
+ * Roots that have taken part in a drag operation, where retained rules stay
319
+ * injected between drag operations.
320
+ */
321
+ __privateAdd(this, _retainedRoots, /* @__PURE__ */ new Set());
322
+ __privateAdd(this, _injections, /* @__PURE__ */ new Map());
323
+ this.registerEffect(__privateMethod(this, _StyleInjector_instances, syncStyles_fn));
324
+ }
325
+ /**
326
+ * Registers CSS rules to be injected into the active drag operation's
327
+ * document and shadow roots. The StyleInjector handles tracking
328
+ * which roots need the styles and cleaning up when they're no longer needed.
329
+ *
330
+ * Returns a cleanup function that unregisters the rules.
331
+ */
332
+ register(cssRules, options) {
333
+ untracked(() => {
334
+ var _a5;
335
+ const rules = new Map(this.registeredRules);
336
+ rules.set(cssRules, (_a5 = options == null ? void 0 : options.retain) != null ? _a5 : false);
337
+ this.registeredRules = rules;
338
+ });
339
+ return () => {
340
+ untracked(() => {
341
+ const rules = new Map(this.registeredRules);
342
+ rules.delete(cssRules);
343
+ this.registeredRules = rules;
344
+ });
345
+ };
346
+ }
347
+ /**
348
+ * Adds an additional root to track for style injection.
349
+ * Returns a cleanup function that removes the root.
350
+ */
351
+ addRoot(root) {
352
+ untracked(() => {
353
+ const roots = new Set(this.additionalRoots);
354
+ roots.add(root);
355
+ this.additionalRoots = roots;
356
+ });
357
+ return () => {
358
+ untracked(() => {
359
+ const roots = new Set(this.additionalRoots);
360
+ roots.delete(root);
361
+ this.additionalRoots = roots;
362
+ });
363
+ };
364
+ }
365
+ get sourceRoot() {
366
+ var _a5;
367
+ const { source } = this.manager.dragOperation;
368
+ return getRoot((_a5 = source == null ? void 0 : source.element) != null ? _a5 : null);
369
+ }
370
+ get targetRoot() {
371
+ var _a5;
372
+ const { target } = this.manager.dragOperation;
373
+ return getRoot((_a5 = target == null ? void 0 : target.element) != null ? _a5 : null);
374
+ }
375
+ get roots() {
376
+ const { status } = this.manager.dragOperation;
377
+ if (status.initializing || status.initialized) {
378
+ const roots = [this.sourceRoot, this.targetRoot].filter(
379
+ (root) => root != null
380
+ );
381
+ return /* @__PURE__ */ new Set([...roots, ...this.additionalRoots]);
382
+ }
383
+ return /* @__PURE__ */ new Set();
384
+ }
385
+ destroy() {
386
+ for (const injected of __privateGet(this, _injections).values()) {
387
+ for (const cleanup of injected.values()) {
388
+ cleanup();
389
+ }
390
+ }
391
+ __privateGet(this, _injections).clear();
392
+ __privateGet(this, _retainedRoots).clear();
393
+ super.destroy();
394
+ }
395
+ };
396
+ _init = __decoratorStart(_a);
397
+ _registeredRules = new WeakMap();
398
+ _additionalRoots = new WeakMap();
399
+ _retainedRoots = new WeakMap();
400
+ _injections = new WeakMap();
401
+ _StyleInjector_instances = new WeakSet();
402
+ /**
403
+ * Injects and removes only the rules whose target roots changed, so that a
404
+ * stylesheet that is still needed is never removed and added back.
405
+ */
406
+ syncStyles_fn = function() {
407
+ const { roots, registeredRules } = this;
408
+ for (const root of roots) {
409
+ __privateGet(this, _retainedRoots).add(root);
410
+ }
411
+ const wanted = /* @__PURE__ */ new Map();
412
+ for (const root of __privateGet(this, _retainedRoots)) {
413
+ const active = roots.has(root);
414
+ if (!active && !isAttached(root)) {
415
+ __privateGet(this, _retainedRoots).delete(root);
416
+ continue;
417
+ }
418
+ for (const [cssRules, retain] of registeredRules) {
419
+ if (!active && !retain) continue;
420
+ let rules = wanted.get(root);
421
+ if (!rules) {
422
+ rules = /* @__PURE__ */ new Set();
423
+ wanted.set(root, rules);
424
+ }
425
+ rules.add(cssRules);
426
+ }
427
+ }
428
+ for (const [root, injected] of __privateGet(this, _injections)) {
429
+ const rules = wanted.get(root);
430
+ for (const [cssRules, cleanup] of injected) {
431
+ if (rules == null ? void 0 : rules.has(cssRules)) continue;
432
+ cleanup();
433
+ injected.delete(cssRules);
434
+ }
435
+ if (injected.size === 0) {
436
+ __privateGet(this, _injections).delete(root);
437
+ }
438
+ }
439
+ for (const [root, rules] of wanted) {
440
+ let injected = __privateGet(this, _injections).get(root);
441
+ if (!injected) {
442
+ injected = /* @__PURE__ */ new Map();
443
+ __privateGet(this, _injections).set(root, injected);
444
+ }
445
+ for (const cssRules of rules) {
446
+ if (!injected.has(cssRules)) {
447
+ injected.set(cssRules, __privateMethod(this, _StyleInjector_instances, inject_fn).call(this, root, cssRules));
448
+ }
449
+ }
450
+ }
451
+ };
452
+ inject_fn = function(root, cssRules) {
453
+ let rootStyles = styleRegistry.get(root);
454
+ if (!rootStyles) {
455
+ rootStyles = /* @__PURE__ */ new Map();
456
+ styleRegistry.set(root, rootStyles);
457
+ }
458
+ let registration = rootStyles.get(cssRules);
459
+ if (!registration) {
460
+ const created = isDocument(root) ? __privateMethod(this, _StyleInjector_instances, injectStyleElement_fn).call(this, root, rootStyles, cssRules) : __privateMethod(this, _StyleInjector_instances, injectAdoptedSheet_fn).call(this, root, rootStyles, cssRules);
461
+ if (!created) {
462
+ return () => {
463
+ };
464
+ }
465
+ registration = created;
466
+ rootStyles.set(cssRules, registration);
467
+ }
468
+ registration.refCount++;
469
+ let disposed = false;
470
+ return () => {
471
+ if (disposed) return;
472
+ disposed = true;
473
+ registration.refCount--;
474
+ if (registration.refCount === 0) {
475
+ registration.cleanup();
476
+ }
477
+ };
478
+ };
479
+ /**
480
+ * For Document roots, prepend a <style> element to <head> so that any
481
+ * @layer declarations appear before layers from regular stylesheets,
482
+ * giving them the lowest cascade priority.
483
+ */
484
+ injectStyleElement_fn = function(root, rootStyles, cssRules) {
485
+ var _a5;
486
+ const style = root.createElement("style");
487
+ const { nonce } = (_a5 = this.options) != null ? _a5 : {};
488
+ if (nonce) {
489
+ style.setAttribute("nonce", nonce);
490
+ }
491
+ style.textContent = cssRules;
492
+ root.head.prepend(style);
493
+ const observer = new MutationObserver((entries) => {
494
+ for (const entry of entries) {
495
+ for (const node of Array.from(entry.removedNodes)) {
496
+ if (node === style) {
497
+ root.head.prepend(style);
498
+ return;
499
+ }
500
+ }
501
+ }
502
+ });
503
+ observer.observe(root.head, { childList: true });
504
+ return {
505
+ refCount: 0,
506
+ cleanup: () => {
507
+ observer.disconnect();
508
+ style.remove();
509
+ rootStyles.delete(cssRules);
510
+ if (rootStyles.size === 0) {
511
+ styleRegistry.delete(root);
307
512
  }
513
+ }
514
+ };
515
+ };
516
+ /**
517
+ * For ShadowRoot roots, use adoptedStyleSheets to avoid DOM side effects
518
+ * like interfering with :first-child or :nth-child selectors.
519
+ */
520
+ injectAdoptedSheet_fn = function(root, rootStyles, cssRules) {
521
+ if (!("adoptedStyleSheets" in root && Array.isArray(root.adoptedStyleSheets)) && process.env.NODE_ENV !== "production") {
522
+ console.error(
523
+ "Cannot inject styles: This browser doesn't support adoptedStyleSheets"
308
524
  );
309
- this.destroy = effect(() => {
310
- var _a4;
311
- const { dragOperation } = this.manager;
312
- const { cursor = "grabbing", nonce } = (_a4 = this.options) != null ? _a4 : {};
313
- if (dragOperation.status.initialized) {
314
- const document2 = doc.value;
315
- const style = document2.createElement("style");
316
- if (nonce) {
317
- style.setAttribute("nonce", nonce);
525
+ }
526
+ const targetWindow = root.ownerDocument.defaultView;
527
+ const { CSSStyleSheet } = targetWindow != null ? targetWindow : {};
528
+ if (!CSSStyleSheet) {
529
+ if (process.env.NODE_ENV !== "production") {
530
+ console.error(
531
+ "Cannot inject styles: CSSStyleSheet constructor not available"
532
+ );
533
+ }
534
+ return null;
535
+ }
536
+ const sheet = new CSSStyleSheet();
537
+ sheet.replaceSync(cssRules);
538
+ root.adoptedStyleSheets.push(sheet);
539
+ return {
540
+ refCount: 0,
541
+ cleanup: () => {
542
+ var _a5;
543
+ if (isShadowRoot(root) && ((_a5 = root.host) == null ? void 0 : _a5.isConnected)) {
544
+ const index = root.adoptedStyleSheets.indexOf(sheet);
545
+ if (index !== -1) {
546
+ root.adoptedStyleSheets.splice(index, 1);
318
547
  }
319
- style.textContent = `* { cursor: ${cursor} !important; }`;
320
- document2.head.appendChild(style);
321
- return () => style.remove();
322
548
  }
323
- });
549
+ rootStyles.delete(cssRules);
550
+ if (rootStyles.size === 0) {
551
+ styleRegistry.delete(root);
552
+ }
553
+ }
554
+ };
555
+ };
556
+ __decorateElement(_init, 4, "registeredRules", _registeredRules_dec, _StyleInjector, _registeredRules);
557
+ __decorateElement(_init, 4, "additionalRoots", _additionalRoots_dec, _StyleInjector, _additionalRoots);
558
+ __decorateElement(_init, 2, "sourceRoot", _sourceRoot_dec, _StyleInjector);
559
+ __decorateElement(_init, 2, "targetRoot", _targetRoot_dec, _StyleInjector);
560
+ __decorateElement(_init, 2, "roots", _roots_dec, _StyleInjector);
561
+ __decoratorMetadata(_init, _StyleInjector);
562
+ _StyleInjector.configure = configurator(_StyleInjector);
563
+ var StyleInjector = _StyleInjector;
564
+
565
+ // src/core/plugins/cursor/Cursor.ts
566
+ var Cursor = class extends Plugin {
567
+ constructor(manager, options) {
568
+ super(manager, options);
569
+ this.manager = manager;
570
+ const { cursor = "grabbing" } = options != null ? options : {};
571
+ const styleInjector = manager.registry.plugins.get(
572
+ StyleInjector
573
+ );
574
+ const unregisterStyles = styleInjector == null ? void 0 : styleInjector.register(
575
+ `* { cursor: ${cursor} !important; }`
576
+ );
577
+ if (unregisterStyles) {
578
+ const originalDestroy = this.destroy.bind(this);
579
+ this.destroy = () => {
580
+ unregisterStyles();
581
+ originalDestroy();
582
+ };
583
+ }
324
584
  }
325
585
  };
326
586
 
@@ -339,7 +599,7 @@ var IGNORED_ATTRIBUTES = [
339
599
  ];
340
600
  var IGNORED_STYLES = ["view-transition-name"];
341
601
  var CSS_RULES = `
342
- :root [${ATTRIBUTE}] {
602
+ :is(:root,:host) [${ATTRIBUTE}] {
343
603
  position: fixed !important;
344
604
  pointer-events: none !important;
345
605
  touch-action: none;
@@ -353,14 +613,15 @@ var CSS_RULES = `
353
613
  max-width: var(${CSS_PREFIX}width, auto);
354
614
  height: var(${CSS_PREFIX}height, auto);
355
615
  max-height: var(${CSS_PREFIX}height, auto);
616
+ transform: var(${CSS_PREFIX}transform, none) !important;
356
617
  transition: var(${CSS_PREFIX}transition) !important;
357
618
  }
358
619
 
359
- :root [${PLACEHOLDER_ATTRIBUTE}] {
620
+ :is(:root,:host) [${PLACEHOLDER_ATTRIBUTE}] {
360
621
  transition: none;
361
622
  }
362
623
 
363
- :root [${PLACEHOLDER_ATTRIBUTE}='hidden'] {
624
+ :is(:root,:host) [${PLACEHOLDER_ATTRIBUTE}='hidden'] {
364
625
  visibility: hidden;
365
626
  }
366
627
 
@@ -377,7 +638,7 @@ var CSS_RULES = `
377
638
  transform-origin: var(${CSS_PREFIX}transform-origin) !important;
378
639
  }
379
640
 
380
- @layer {
641
+ @layer dnd-kit {
381
642
  :where([${ATTRIBUTE}][popover]) {
382
643
  overflow: visible;
383
644
  background: unset;
@@ -465,40 +726,250 @@ function preventPopoverClose(event) {
465
726
  function isTableRow(element) {
466
727
  return element.tagName === "TR";
467
728
  }
729
+ function createElementMutationObserver(element, placeholder, clone) {
730
+ const observer = new MutationObserver((mutations) => {
731
+ let hasChildrenMutations = false;
732
+ for (const mutation of mutations) {
733
+ if (mutation.target !== element) {
734
+ hasChildrenMutations = true;
735
+ continue;
736
+ }
737
+ if (mutation.type !== "attributes") {
738
+ continue;
739
+ }
740
+ const attributeName = mutation.attributeName;
741
+ if (attributeName.startsWith("aria-") || IGNORED_ATTRIBUTES.includes(attributeName)) {
742
+ continue;
743
+ }
744
+ const attributeValue = element.getAttribute(attributeName);
745
+ if (attributeName === "style") {
746
+ if (supportsStyle(element) && supportsStyle(placeholder)) {
747
+ const styles = element.style;
748
+ for (const key of Array.from(placeholder.style)) {
749
+ if (styles.getPropertyValue(key) === "") {
750
+ placeholder.style.removeProperty(key);
751
+ }
752
+ }
753
+ for (const key of Array.from(styles)) {
754
+ if (IGNORED_STYLES.includes(key) || key.startsWith(CSS_PREFIX)) {
755
+ continue;
756
+ }
757
+ const value = styles.getPropertyValue(key);
758
+ placeholder.style.setProperty(key, value);
759
+ }
760
+ }
761
+ } else if (attributeValue !== null) {
762
+ placeholder.setAttribute(attributeName, attributeValue);
763
+ } else {
764
+ placeholder.removeAttribute(attributeName);
765
+ }
766
+ }
767
+ if (hasChildrenMutations && clone) {
768
+ placeholder.replaceChildren(...element.cloneNode(true).childNodes);
769
+ }
770
+ });
771
+ observer.observe(element, {
772
+ attributes: true,
773
+ subtree: true,
774
+ childList: true
775
+ });
776
+ return observer;
777
+ }
778
+ function createDocumentMutationObserver(element, placeholder, feedbackElement) {
779
+ const observer = new MutationObserver((entries) => {
780
+ for (const entry of entries) {
781
+ if (entry.addedNodes.length === 0) continue;
782
+ for (const node of Array.from(entry.addedNodes)) {
783
+ if (node.contains(element) && element.nextElementSibling !== placeholder) {
784
+ element.insertAdjacentElement("afterend", placeholder);
785
+ showPopover(feedbackElement);
786
+ return;
787
+ }
788
+ if (node.contains(placeholder) && placeholder.previousElementSibling !== element) {
789
+ placeholder.insertAdjacentElement("beforebegin", element);
790
+ showPopover(feedbackElement);
791
+ return;
792
+ }
793
+ }
794
+ }
795
+ if (element.isConnected && placeholder.isConnected && element.nextElementSibling !== placeholder) {
796
+ element.insertAdjacentElement("afterend", placeholder);
797
+ showPopover(feedbackElement);
798
+ }
799
+ });
800
+ observer.observe(element.ownerDocument.body, {
801
+ childList: true,
802
+ subtree: true
803
+ });
804
+ return observer;
805
+ }
806
+ function createResizeObserver(ctx) {
807
+ return new ResizeObserver(() => {
808
+ var _a5, _b2, _c3;
809
+ const placeholderShape = new DOMRectangle(ctx.placeholder, {
810
+ frameTransform: ctx.frameTransform,
811
+ ignoreTransforms: true
812
+ });
813
+ const origin = (_a5 = ctx.transformOrigin) != null ? _a5 : { x: 1, y: 1 };
814
+ const dX = (ctx.width - placeholderShape.width) * origin.x + ctx.delta.x;
815
+ const dY = (ctx.height - placeholderShape.height) * origin.y + ctx.delta.y;
816
+ const fixedOffset = getFixedPositionOffset();
817
+ ctx.styles.set(
818
+ {
819
+ width: placeholderShape.width - ctx.widthOffset,
820
+ height: placeholderShape.height - ctx.heightOffset,
821
+ top: ctx.top + dY + fixedOffset.y,
822
+ left: ctx.left + dX + fixedOffset.x
823
+ },
824
+ CSS_PREFIX
825
+ );
826
+ (_b2 = ctx.getElementMutationObserver()) == null ? void 0 : _b2.takeRecords();
827
+ if (isTableRow(ctx.element) && isTableRow(ctx.placeholder)) {
828
+ const cells = Array.from(ctx.element.cells);
829
+ const placeholderCells = Array.from(ctx.placeholder.cells);
830
+ if (!ctx.getSavedCellWidths()) {
831
+ ctx.setSavedCellWidths(cells.map((cell) => cell.style.width));
832
+ }
833
+ for (const [index, cell] of cells.entries()) {
834
+ const placeholderCell = placeholderCells[index];
835
+ cell.style.width = `${placeholderCell.getBoundingClientRect().width}px`;
836
+ }
837
+ }
838
+ const translate = (_c3 = ctx.getTranslate()) != null ? _c3 : { x: 0, y: 0 };
839
+ const shapeLeft = ctx.left + dX + fixedOffset.x + translate.x;
840
+ const shapeTop = ctx.top + dY + fixedOffset.y + translate.y;
841
+ const shapeWidth = placeholderShape.width - ctx.widthOffset;
842
+ const shapeHeight = placeholderShape.height - ctx.heightOffset;
843
+ const ft = ctx.frameTransform;
844
+ ctx.dragOperation.shape = new Rectangle(
845
+ shapeLeft * ft.scaleX + ft.x,
846
+ shapeTop * ft.scaleY + ft.y,
847
+ shapeWidth * ft.scaleX,
848
+ shapeHeight * ft.scaleY
849
+ );
850
+ });
851
+ }
852
+ var DEFAULT_DURATION = 250;
853
+ var DEFAULT_EASING = "ease";
854
+ function runDropAnimation(ctx) {
855
+ var _a5, _b2, _c3, _d2;
856
+ const { animation } = ctx;
857
+ if (typeof animation === "function") {
858
+ const result = animation({
859
+ source: ctx.source,
860
+ element: ctx.element,
861
+ feedbackElement: ctx.feedbackElement,
862
+ placeholder: ctx.placeholder,
863
+ translate: ctx.translate,
864
+ moved: ctx.moved
865
+ });
866
+ Promise.resolve(result).then(() => {
867
+ ctx.cleanup();
868
+ requestAnimationFrame(ctx.restoreFocus);
869
+ });
870
+ return;
871
+ }
872
+ const {
873
+ duration = DEFAULT_DURATION,
874
+ easing = DEFAULT_EASING
875
+ } = animation != null ? animation : {};
876
+ showPopover(ctx.feedbackElement);
877
+ const [, runningAnimation] = (_a5 = getFinalKeyframe(
878
+ ctx.feedbackElement,
879
+ (keyframe) => "translate" in keyframe
880
+ )) != null ? _a5 : [];
881
+ runningAnimation == null ? void 0 : runningAnimation.pause();
882
+ const target = (_b2 = ctx.placeholder) != null ? _b2 : ctx.element;
883
+ const options = {
884
+ frameTransform: isSameFrame(ctx.feedbackElement, target) ? null : void 0
885
+ };
886
+ const current = new DOMRectangle(ctx.feedbackElement, options);
887
+ const currentTranslate = (_c3 = parseTranslate(getComputedStyles(ctx.feedbackElement).translate)) != null ? _c3 : ctx.translate;
888
+ const final = new DOMRectangle(target, options);
889
+ const delta = Rectangle.delta(current, final, ctx.alignment);
890
+ const finalTranslate = {
891
+ x: currentTranslate.x - delta.x,
892
+ y: currentTranslate.y - delta.y
893
+ };
894
+ const heightKeyframes = Math.round(current.intrinsicHeight) !== Math.round(final.intrinsicHeight) ? {
895
+ minHeight: [
896
+ `${current.intrinsicHeight}px`,
897
+ `${final.intrinsicHeight}px`
898
+ ],
899
+ maxHeight: [
900
+ `${current.intrinsicHeight}px`,
901
+ `${final.intrinsicHeight}px`
902
+ ]
903
+ } : {};
904
+ const widthKeyframes = Math.round(current.intrinsicWidth) !== Math.round(final.intrinsicWidth) ? {
905
+ minWidth: [
906
+ `${current.intrinsicWidth}px`,
907
+ `${final.intrinsicWidth}px`
908
+ ],
909
+ maxWidth: [
910
+ `${current.intrinsicWidth}px`,
911
+ `${final.intrinsicWidth}px`
912
+ ]
913
+ } : {};
914
+ ctx.styles.set({ transition: ctx.transition }, CSS_PREFIX);
915
+ ctx.feedbackElement.setAttribute(DROPPING_ATTRIBUTE, "");
916
+ (_d2 = ctx.getElementMutationObserver()) == null ? void 0 : _d2.takeRecords();
917
+ animateTransform({
918
+ element: ctx.feedbackElement,
919
+ keyframes: __spreadProps(__spreadValues(__spreadValues({}, heightKeyframes), widthKeyframes), {
920
+ translate: [
921
+ `${currentTranslate.x}px ${currentTranslate.y}px 0`,
922
+ `${finalTranslate.x}px ${finalTranslate.y}px 0`
923
+ ]
924
+ }),
925
+ options: {
926
+ duration: prefersReducedMotion(getWindow(ctx.feedbackElement)) ? 0 : ctx.moved || ctx.feedbackElement !== ctx.element ? duration : 0,
927
+ easing
928
+ }
929
+ }).then(() => {
930
+ ctx.feedbackElement.removeAttribute(DROPPING_ATTRIBUTE);
931
+ runningAnimation == null ? void 0 : runningAnimation.finish();
932
+ ctx.cleanup();
933
+ requestAnimationFrame(ctx.restoreFocus);
934
+ });
935
+ }
468
936
 
469
937
  // src/core/plugins/feedback/Feedback.ts
470
- var styleSheetRegistry = /* @__PURE__ */ new Map();
471
- var _overlay_dec, _a, _init, _overlay, _Feedback_instances, render_fn, injectStyles_fn;
472
- var _Feedback = class _Feedback extends (_a = Plugin, _overlay_dec = [reactive], _a) {
938
+ var _overlay_dec, _a2, _init2, _overlay, _Feedback_instances, trackOverlayRoot_fn, render_fn;
939
+ var _Feedback = class _Feedback extends (_a2 = Plugin, _overlay_dec = [reactive], _a2) {
473
940
  constructor(manager, options) {
474
941
  super(manager, options);
475
942
  __privateAdd(this, _Feedback_instances);
476
- __privateAdd(this, _overlay, __runInitializers(_init, 8, this)), __runInitializers(_init, 11, this);
943
+ __privateAdd(this, _overlay, __runInitializers(_init2, 8, this)), __runInitializers(_init2, 11, this);
477
944
  this.state = {
478
945
  initial: {},
479
946
  current: {}
480
947
  };
481
- this.registerEffect(__privateMethod(this, _Feedback_instances, injectStyles_fn));
482
- this.registerEffect(__privateMethod(this, _Feedback_instances, render_fn));
483
- }
484
- destroy() {
485
- super.destroy();
486
- for (const [doc, registration] of styleSheetRegistry.entries()) {
487
- if (registration.instances.has(this)) {
488
- registration.instances.delete(this);
489
- if (registration.instances.size === 0) {
490
- registration.cleanup();
491
- styleSheetRegistry.delete(doc);
492
- }
493
- }
948
+ const styleInjector = manager.registry.plugins.get(StyleInjector);
949
+ const unregisterStyles = styleInjector == null ? void 0 : styleInjector.register(CSS_RULES, { retain: true });
950
+ if (unregisterStyles) {
951
+ const originalDestroy = this.destroy.bind(this);
952
+ this.destroy = () => {
953
+ unregisterStyles();
954
+ originalDestroy();
955
+ };
494
956
  }
957
+ this.registerEffect(__privateMethod(this, _Feedback_instances, trackOverlayRoot_fn).bind(this, styleInjector));
958
+ this.registerEffect(__privateMethod(this, _Feedback_instances, render_fn));
495
959
  }
496
960
  };
497
- _init = __decoratorStart(_a);
961
+ _init2 = __decoratorStart(_a2);
498
962
  _overlay = new WeakMap();
499
963
  _Feedback_instances = new WeakSet();
964
+ trackOverlayRoot_fn = function(styleInjector) {
965
+ const { overlay } = this;
966
+ if (!overlay || !styleInjector) return;
967
+ const root = getRoot(overlay);
968
+ if (!root) return;
969
+ return styleInjector.addRoot(root);
970
+ };
500
971
  render_fn = function() {
501
- var _a4, _b2, _c3;
972
+ var _a5, _b2, _c3, _d2, _e, _f, _g;
502
973
  const { state, manager, options } = this;
503
974
  const { dragOperation } = manager;
504
975
  const { position, source, status } = dragOperation;
@@ -508,12 +979,15 @@ render_fn = function() {
508
979
  return;
509
980
  }
510
981
  if (!source) return;
511
- const { element, feedback } = source;
982
+ const { element } = source;
983
+ const entityOptions = source.pluginConfig(_Feedback);
984
+ const feedbackOption = (_b2 = (_a5 = entityOptions == null ? void 0 : entityOptions.feedback) != null ? _a5 : options == null ? void 0 : options.feedback) != null ? _b2 : "default";
985
+ const feedback = typeof feedbackOption === "function" ? feedbackOption(source, manager) : feedbackOption;
512
986
  if (!element || feedback === "none" || !status.initialized || status.initializing) {
513
987
  return;
514
988
  }
515
989
  const { initial } = state;
516
- const feedbackElement = (_a4 = this.overlay) != null ? _a4 : element;
990
+ const feedbackElement = (_c3 = this.overlay) != null ? _c3 : element;
517
991
  const frameTransform = getFrameTransform(feedbackElement);
518
992
  const elementFrameTransform = getFrameTransform(element);
519
993
  const crossFrame = !isSameFrame(element, feedbackElement);
@@ -530,9 +1004,8 @@ render_fn = function() {
530
1004
  width = width / scaleDelta.x;
531
1005
  height = height / scaleDelta.y;
532
1006
  }
533
- let elementMutationObserver;
534
- let documentMutationObserver;
535
1007
  const styles = new Styles(feedbackElement);
1008
+ const elementStyles = getComputedStyles(element);
536
1009
  const {
537
1010
  transition,
538
1011
  translate,
@@ -545,7 +1018,10 @@ render_fn = function() {
545
1018
  borderInlineEndWidth,
546
1019
  borderBlockStartWidth,
547
1020
  borderBlockEndWidth
548
- } = getComputedStyles(element);
1021
+ } = elementStyles;
1022
+ const feedbackTransition = transition.split(",").filter((t) => !/^\s*(transform|translate|scale)\b/.test(t)).join(",");
1023
+ const parsedTransform = parseTransform(elementStyles);
1024
+ const initialTransformStyle = elementStyles.transform;
549
1025
  const clone = feedback === "clone";
550
1026
  const contentBox = boxSizing === "content-box";
551
1027
  const widthOffset = contentBox ? parseInt(paddingInlineStart) + parseInt(paddingInlineEnd) + parseInt(borderInlineStartWidth) + parseInt(borderInlineEndWidth) : 0;
@@ -554,17 +1030,23 @@ render_fn = function() {
554
1030
  const isKeyboardOperation = untracked(
555
1031
  () => isKeyboardEvent(manager.dragOperation.activatorEvent)
556
1032
  );
557
- if (translate !== "none") {
558
- const parsedTranslate = parseTranslate(translate);
559
- if (parsedTranslate && !initial.translate) {
560
- initial.translate = parsedTranslate;
1033
+ if (!initial.translate) {
1034
+ if (this.overlay && parsedTransform) {
1035
+ initial.translate = { x: parsedTransform.x, y: parsedTransform.y };
1036
+ } else if (translate !== "none") {
1037
+ const parsedTranslate = parseTranslate(translate);
1038
+ if (parsedTranslate) {
1039
+ initial.translate = parsedTranslate;
1040
+ }
561
1041
  }
562
1042
  }
563
1043
  if (!initial.transformOrigin) {
564
1044
  const current = untracked(() => position.current);
1045
+ const visualLeft = left + ((_d2 = parsedTransform == null ? void 0 : parsedTransform.x) != null ? _d2 : 0);
1046
+ const visualTop = top + ((_e = parsedTransform == null ? void 0 : parsedTransform.y) != null ? _e : 0);
565
1047
  initial.transformOrigin = {
566
- x: (current.x - left * frameTransform.scaleX - frameTransform.x) / (width * frameTransform.scaleX),
567
- y: (current.y - top * frameTransform.scaleY - frameTransform.y) / (height * frameTransform.scaleY)
1048
+ x: (current.x - visualLeft * frameTransform.scaleX - frameTransform.x) / (width * frameTransform.scaleX),
1049
+ y: (current.y - visualTop * frameTransform.scaleY - frameTransform.y) / (height * frameTransform.scaleY)
568
1050
  };
569
1051
  }
570
1052
  const { transformOrigin } = initial;
@@ -606,19 +1088,19 @@ render_fn = function() {
606
1088
  };
607
1089
  feedbackElement.setAttribute(ATTRIBUTE, "true");
608
1090
  const transform = untracked(() => dragOperation.transform);
609
- const initialTranslate = (_b2 = initial.translate) != null ? _b2 : { x: 0, y: 0 };
1091
+ const initialTranslate = (_f = initial.translate) != null ? _f : { x: 0, y: 0 };
610
1092
  const tX = transform.x * frameTransform.scaleX + initialTranslate.x;
611
1093
  const tY = transform.y * frameTransform.scaleY + initialTranslate.y;
612
- const translateString = `${tX}px ${tY}px 0`;
613
- const transitionString = transition ? `${transition}, translate 0ms linear` : "";
1094
+ const fixedOffset = getFixedPositionOffset();
614
1095
  styles.set(
615
1096
  {
616
1097
  width: width - widthOffset,
617
1098
  height: height - heightOffset,
618
- top: projected.top,
619
- left: projected.left,
620
- translate: translateString,
621
- transition: transitionString,
1099
+ top: projected.top + fixedOffset.y,
1100
+ left: projected.left + fixedOffset.x,
1101
+ translate: `${tX}px ${tY}px 0`,
1102
+ transform: this.overlay ? "none" : initialTransformStyle,
1103
+ transition: feedbackTransition ? `${feedbackTransition}, translate 0ms linear` : "translate 0ms linear",
622
1104
  scale: crossFrame ? `${scaleDelta.x} ${scaleDelta.y}` : "",
623
1105
  "transform-origin": `${transformOrigin.x * 100}% ${transformOrigin.y * 100}%`
624
1106
  },
@@ -638,34 +1120,30 @@ render_fn = function() {
638
1120
  showPopover(feedbackElement);
639
1121
  feedbackElement.addEventListener("beforetoggle", preventPopoverClose);
640
1122
  }
641
- const resizeObserver = new ResizeObserver(() => {
642
- if (!placeholder) return;
643
- const placeholderShape = new DOMRectangle(placeholder, {
644
- frameTransform,
645
- ignoreTransforms: true
646
- });
647
- const origin = transformOrigin != null ? transformOrigin : { x: 1, y: 1 };
648
- const dX = (width - placeholderShape.width) * origin.x + delta.x;
649
- const dY = (height - placeholderShape.height) * origin.y + delta.y;
650
- styles.set(
651
- {
652
- width: placeholderShape.width - widthOffset,
653
- height: placeholderShape.height - heightOffset,
654
- top: top + dY,
655
- left: left + dX
656
- },
657
- CSS_PREFIX
658
- );
659
- elementMutationObserver == null ? void 0 : elementMutationObserver.takeRecords();
660
- if (isTableRow(element) && isTableRow(placeholder)) {
661
- const cells = Array.from(element.cells);
662
- const placeholderCells = Array.from(placeholder.cells);
663
- for (const [index, cell] of cells.entries()) {
664
- const placeholderCell = placeholderCells[index];
665
- cell.style.width = `${placeholderCell.offsetWidth}px`;
666
- }
1123
+ let elementMutationObserver;
1124
+ let documentMutationObserver;
1125
+ let savedCellWidths;
1126
+ const resizeObserver = createResizeObserver({
1127
+ placeholder,
1128
+ element,
1129
+ feedbackElement,
1130
+ frameTransform,
1131
+ transformOrigin,
1132
+ width,
1133
+ height,
1134
+ top,
1135
+ left,
1136
+ widthOffset,
1137
+ heightOffset,
1138
+ delta,
1139
+ styles,
1140
+ dragOperation,
1141
+ getTranslate: () => state.current.translate,
1142
+ getElementMutationObserver: () => elementMutationObserver,
1143
+ getSavedCellWidths: () => savedCellWidths,
1144
+ setSavedCellWidths: (widths) => {
1145
+ savedCellWidths = widths;
667
1146
  }
668
- dragOperation.shape = new DOMRectangle(feedbackElement);
669
1147
  });
670
1148
  const initialShape = new DOMRectangle(feedbackElement);
671
1149
  untracked(() => dragOperation.shape = initialShape);
@@ -673,6 +1151,7 @@ render_fn = function() {
673
1151
  const handleWindowResize = (event) => {
674
1152
  this.manager.actions.stop({ event });
675
1153
  };
1154
+ const reducedMotion = prefersReducedMotion(feedbackWindow);
676
1155
  if (isKeyboardOperation) {
677
1156
  feedbackWindow.addEventListener("resize", handleWindowResize);
678
1157
  }
@@ -681,84 +1160,25 @@ render_fn = function() {
681
1160
  }
682
1161
  if (placeholder) {
683
1162
  resizeObserver.observe(placeholder);
684
- elementMutationObserver = new MutationObserver((mutations) => {
685
- let hasChildrenMutations = false;
686
- for (const mutation of mutations) {
687
- if (mutation.target !== element) {
688
- hasChildrenMutations = true;
689
- continue;
690
- }
691
- if (mutation.type !== "attributes") {
692
- continue;
693
- }
694
- const attributeName = mutation.attributeName;
695
- if (attributeName.startsWith("aria-") || IGNORED_ATTRIBUTES.includes(attributeName)) {
696
- continue;
697
- }
698
- const attributeValue = element.getAttribute(attributeName);
699
- if (attributeName === "style") {
700
- if (supportsStyle(element) && supportsStyle(placeholder)) {
701
- const styles2 = element.style;
702
- for (const key of Array.from(placeholder.style)) {
703
- if (styles2.getPropertyValue(key) === "") {
704
- placeholder.style.removeProperty(key);
705
- }
706
- }
707
- for (const key of Array.from(styles2)) {
708
- if (IGNORED_STYLES.includes(key) || key.startsWith(CSS_PREFIX)) {
709
- continue;
710
- }
711
- const value = styles2.getPropertyValue(key);
712
- placeholder.style.setProperty(key, value);
713
- }
714
- }
715
- } else if (attributeValue !== null) {
716
- placeholder.setAttribute(attributeName, attributeValue);
717
- } else {
718
- placeholder.removeAttribute(attributeName);
719
- }
720
- }
721
- if (hasChildrenMutations && clone) {
722
- placeholder.innerHTML = element.innerHTML;
723
- }
724
- });
725
- elementMutationObserver.observe(element, {
726
- attributes: true,
727
- subtree: true,
728
- childList: true
729
- });
730
- documentMutationObserver = new MutationObserver((entries) => {
731
- for (const entry of entries) {
732
- if (entry.addedNodes.length === 0) continue;
733
- for (const node of Array.from(entry.addedNodes)) {
734
- if (node.contains(element) && element.nextElementSibling !== placeholder) {
735
- element.insertAdjacentElement("afterend", placeholder);
736
- showPopover(feedbackElement);
737
- return;
738
- }
739
- if (node.contains(placeholder) && placeholder.previousElementSibling !== element) {
740
- placeholder.insertAdjacentElement("beforebegin", element);
741
- showPopover(feedbackElement);
742
- return;
743
- }
744
- }
745
- }
746
- });
747
- documentMutationObserver.observe(element.ownerDocument.body, {
748
- childList: true,
749
- subtree: true
750
- });
1163
+ elementMutationObserver = createElementMutationObserver(
1164
+ element,
1165
+ placeholder,
1166
+ clone
1167
+ );
1168
+ documentMutationObserver = createDocumentMutationObserver(
1169
+ element,
1170
+ placeholder,
1171
+ feedbackElement
1172
+ );
751
1173
  }
752
- const id = (_c3 = manager.dragOperation.source) == null ? void 0 : _c3.id;
1174
+ const id = (_g = manager.dragOperation.source) == null ? void 0 : _g.id;
753
1175
  const restoreFocus = () => {
754
- var _a5;
755
- if (!isKeyboardOperation || id == null) {
756
- return;
757
- }
1176
+ var _a6;
1177
+ if (!isKeyboardOperation || id == null) return;
758
1178
  const draggable = manager.registry.draggables.get(id);
759
- const element2 = (_a5 = draggable == null ? void 0 : draggable.handle) != null ? _a5 : draggable == null ? void 0 : draggable.element;
760
- if (isHTMLElement(element2)) {
761
- element2.focus();
1179
+ const focusTarget = (_a6 = draggable == null ? void 0 : draggable.handle) != null ? _a6 : draggable == null ? void 0 : draggable.element;
1180
+ if (isHTMLElement(focusTarget)) {
1181
+ focusTarget.focus();
762
1182
  }
763
1183
  };
764
1184
  const cleanup = () => {
@@ -775,23 +1195,40 @@ render_fn = function() {
775
1195
  }
776
1196
  feedbackElement.removeAttribute(ATTRIBUTE);
777
1197
  styles.reset();
778
- source.status = "idle";
779
- const moved = state.current.translate != null;
780
- if (placeholder && (moved || placeholder.parentElement !== feedbackElement.parentElement) && feedbackElement.isConnected) {
781
- placeholder.replaceWith(feedbackElement);
1198
+ const finalize = () => {
1199
+ var _a6;
1200
+ if (savedCellWidths && isTableRow(element)) {
1201
+ const cells = Array.from(element.cells);
1202
+ for (const [index, cell] of cells.entries()) {
1203
+ cell.style.width = (_a6 = savedCellWidths[index]) != null ? _a6 : "";
1204
+ }
1205
+ }
1206
+ source.status = "idle";
1207
+ const moved = state.current.translate != null;
1208
+ const isDragging = dragOperation.status.dragging;
1209
+ if (placeholder && (!isDragging && moved || placeholder.parentElement !== feedbackElement.parentElement) && feedbackElement.isConnected) {
1210
+ placeholder.replaceWith(feedbackElement);
1211
+ }
1212
+ placeholder == null ? void 0 : placeholder.remove();
1213
+ };
1214
+ if (feedbackElement === this.overlay) {
1215
+ setTimeout(finalize, 0);
1216
+ } else {
1217
+ finalize();
782
1218
  }
783
- placeholder == null ? void 0 : placeholder.remove();
784
1219
  };
1220
+ const optionsDropAnimation = options == null ? void 0 : options.dropAnimation;
1221
+ const feedbackPlugin = this;
785
1222
  const cleanupEffects = effects(
786
1223
  // Update transform on move
787
1224
  () => {
788
- var _a5;
1225
+ var _a6, _b3, _c4;
789
1226
  const { transform: transform2, status: status2 } = dragOperation;
790
1227
  if (!transform2.x && !transform2.y && !state.current.translate) {
791
1228
  return;
792
1229
  }
793
1230
  if (status2.dragging) {
794
- const initialTranslate2 = (_a5 = initial.translate) != null ? _a5 : { x: 0, y: 0 };
1231
+ const initialTranslate2 = (_a6 = initial.translate) != null ? _a6 : { x: 0, y: 0 };
795
1232
  const translate2 = {
796
1233
  x: transform2.x / frameTransform.scaleX + initialTranslate2.x,
797
1234
  y: transform2.y / frameTransform.scaleY + initialTranslate2.y
@@ -799,13 +1236,14 @@ render_fn = function() {
799
1236
  const previousTranslate = state.current.translate;
800
1237
  const modifiers = untracked(() => dragOperation.modifiers);
801
1238
  const currentShape = untracked(() => {
802
- var _a6;
803
- return (_a6 = dragOperation.shape) == null ? void 0 : _a6.current;
1239
+ var _a7;
1240
+ return (_a7 = dragOperation.shape) == null ? void 0 : _a7.current;
804
1241
  });
805
- const translateTransition = isKeyboardOperation ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
1242
+ const keyboardTransition = options == null ? void 0 : options.keyboardTransition;
1243
+ const translateTransition = isKeyboardOperation && !reducedMotion && keyboardTransition !== null ? `${(_b3 = keyboardTransition == null ? void 0 : keyboardTransition.duration) != null ? _b3 : 250}ms ${(_c4 = keyboardTransition == null ? void 0 : keyboardTransition.easing) != null ? _c4 : "cubic-bezier(0.25, 1, 0.5, 1)"}` : "0ms linear";
806
1244
  styles.set(
807
1245
  {
808
- transition: `${transition}, translate ${translateTransition}`,
1246
+ transition: feedbackTransition ? `${feedbackTransition}, translate ${translateTransition}` : `translate ${translateTransition}`,
809
1247
  translate: `${translate2.x}px ${translate2.y}px 0`
810
1248
  },
811
1249
  CSS_PREFIX
@@ -816,7 +1254,6 @@ render_fn = function() {
816
1254
  dragOperation.shape = Rectangle.from(
817
1255
  currentShape.boundingRectangle
818
1256
  ).translate(
819
- // Need to take into account frame transform when optimistically updating shape
820
1257
  delta2.x * frameTransform.scaleX,
821
1258
  delta2.y * frameTransform.scaleY
822
1259
  );
@@ -831,83 +1268,33 @@ render_fn = function() {
831
1268
  if (dragOperation.status.dropped) {
832
1269
  this.dispose();
833
1270
  source.status = "dropping";
1271
+ const dropAnimationConfig = (entityOptions == null ? void 0 : entityOptions.dropAnimation) !== void 0 ? entityOptions.dropAnimation : feedbackPlugin.dropAnimation !== void 0 ? feedbackPlugin.dropAnimation : optionsDropAnimation;
834
1272
  let translate2 = state.current.translate;
835
1273
  const moved = translate2 != null;
836
1274
  if (!translate2 && element !== feedbackElement) {
837
- translate2 = {
838
- x: 0,
839
- y: 0
840
- };
1275
+ translate2 = { x: 0, y: 0 };
841
1276
  }
842
- if (!translate2) {
1277
+ if (!translate2 || dropAnimationConfig === null) {
843
1278
  cleanup();
844
1279
  return;
845
1280
  }
846
- const dropAnimation = () => {
847
- var _a5, _b3;
848
- {
849
- showPopover(feedbackElement);
850
- const [, animation] = (_a5 = getFinalKeyframe(
851
- feedbackElement,
852
- (keyframe) => "translate" in keyframe
853
- )) != null ? _a5 : [];
854
- animation == null ? void 0 : animation.pause();
855
- const target = placeholder != null ? placeholder : element;
856
- const options2 = {
857
- frameTransform: isSameFrame(feedbackElement, target) ? null : void 0
858
- };
859
- const current = new DOMRectangle(feedbackElement, options2);
860
- const currentTranslate = (_b3 = parseTranslate(getComputedStyles(feedbackElement).translate)) != null ? _b3 : translate2;
861
- const final = new DOMRectangle(target, options2);
862
- const delta2 = Rectangle.delta(current, final, source.alignment);
863
- const finalTranslate = {
864
- x: currentTranslate.x - delta2.x,
865
- y: currentTranslate.y - delta2.y
866
- };
867
- const heightKeyframes = Math.round(current.intrinsicHeight) !== Math.round(final.intrinsicHeight) ? {
868
- minHeight: [
869
- `${current.intrinsicHeight}px`,
870
- `${final.intrinsicHeight}px`
871
- ],
872
- maxHeight: [
873
- `${current.intrinsicHeight}px`,
874
- `${final.intrinsicHeight}px`
875
- ]
876
- } : {};
877
- const widthKeyframes = Math.round(current.intrinsicWidth) !== Math.round(final.intrinsicWidth) ? {
878
- minWidth: [
879
- `${current.intrinsicWidth}px`,
880
- `${final.intrinsicWidth}px`
881
- ],
882
- maxWidth: [
883
- `${current.intrinsicWidth}px`,
884
- `${final.intrinsicWidth}px`
885
- ]
886
- } : {};
887
- styles.set({ transition }, CSS_PREFIX);
888
- feedbackElement.setAttribute(DROPPING_ATTRIBUTE, "");
889
- elementMutationObserver == null ? void 0 : elementMutationObserver.takeRecords();
890
- animateTransform({
891
- element: feedbackElement,
892
- keyframes: __spreadProps(__spreadValues(__spreadValues({}, heightKeyframes), widthKeyframes), {
893
- translate: [
894
- `${currentTranslate.x}px ${currentTranslate.y}px 0`,
895
- `${finalTranslate.x}px ${finalTranslate.y}px 0`
896
- ]
897
- }),
898
- options: {
899
- duration: moved || feedbackElement !== element ? 250 : 0,
900
- easing: "ease"
901
- }
902
- }).then(() => {
903
- feedbackElement.removeAttribute(DROPPING_ATTRIBUTE);
904
- animation == null ? void 0 : animation.finish();
905
- cleanup();
906
- requestAnimationFrame(restoreFocus);
907
- });
908
- }
909
- };
910
- manager.renderer.rendering.then(dropAnimation);
1281
+ manager.renderer.rendering.then(() => {
1282
+ runDropAnimation({
1283
+ source,
1284
+ element,
1285
+ feedbackElement,
1286
+ placeholder,
1287
+ translate: translate2,
1288
+ moved,
1289
+ transition,
1290
+ alignment: source.alignment,
1291
+ styles,
1292
+ animation: dropAnimationConfig != null ? dropAnimationConfig : void 0,
1293
+ getElementMutationObserver: () => elementMutationObserver,
1294
+ cleanup,
1295
+ restoreFocus
1296
+ });
1297
+ });
911
1298
  }
912
1299
  }
913
1300
  );
@@ -916,59 +1303,18 @@ render_fn = function() {
916
1303
  cleanupEffects();
917
1304
  };
918
1305
  };
919
- injectStyles_fn = function() {
920
- var _a4, _b2, _c3;
921
- const { status, source, target } = this.manager.dragOperation;
922
- const { nonce } = (_a4 = this.options) != null ? _a4 : {};
923
- if (status.initializing) {
924
- const sourceDocument = getDocument((_b2 = source == null ? void 0 : source.element) != null ? _b2 : null);
925
- const targetDocument = getDocument((_c3 = target == null ? void 0 : target.element) != null ? _c3 : null);
926
- const documents = /* @__PURE__ */ new Set([sourceDocument, targetDocument]);
927
- for (const doc of documents) {
928
- let registration = styleSheetRegistry.get(doc);
929
- if (!registration) {
930
- const style = document.createElement("style");
931
- style.textContent = CSS_RULES;
932
- if (nonce) {
933
- style.setAttribute("nonce", nonce);
934
- }
935
- doc.head.prepend(style);
936
- const mutationObserver = new MutationObserver((entries) => {
937
- for (const entry of entries) {
938
- if (entry.type === "childList") {
939
- const removedNodes = Array.from(entry.removedNodes);
940
- if (removedNodes.length > 0 && removedNodes.includes(style)) {
941
- doc.head.prepend(style);
942
- }
943
- }
944
- }
945
- });
946
- mutationObserver.observe(doc.head, { childList: true });
947
- registration = {
948
- cleanup: () => {
949
- mutationObserver.disconnect();
950
- style.remove();
951
- },
952
- instances: /* @__PURE__ */ new Set()
953
- };
954
- styleSheetRegistry.set(doc, registration);
955
- }
956
- registration.instances.add(this);
957
- }
958
- }
959
- };
960
- __decorateElement(_init, 4, "overlay", _overlay_dec, _Feedback, _overlay);
961
- __decoratorMetadata(_init, _Feedback);
1306
+ __decorateElement(_init2, 4, "overlay", _overlay_dec, _Feedback, _overlay);
1307
+ __decoratorMetadata(_init2, _Feedback);
962
1308
  _Feedback.configure = configurator(_Feedback);
963
1309
  var Feedback = _Feedback;
964
1310
  var LOCKED = true;
965
1311
  var UNLOCKED = false;
966
- var _dec, _a2, _dec2, _b, _init2, __b, __a;
967
- _b = (_dec2 = [reactive], ScrollDirection.Forward), _a2 = (_dec = [reactive], ScrollDirection.Reverse);
1312
+ var _dec, _a3, _dec2, _b, _init3, __b, __a;
1313
+ _b = (_dec2 = [reactive], ScrollDirection.Forward), _a3 = (_dec = [reactive], ScrollDirection.Reverse);
968
1314
  var ScrollLock = class {
969
1315
  constructor() {
970
- __privateAdd(this, __b, __runInitializers(_init2, 8, this, LOCKED)), __runInitializers(_init2, 11, this);
971
- __privateAdd(this, __a, __runInitializers(_init2, 12, this, LOCKED)), __runInitializers(_init2, 15, this);
1316
+ __privateAdd(this, __b, __runInitializers(_init3, 8, this, LOCKED)), __runInitializers(_init3, 11, this);
1317
+ __privateAdd(this, __a, __runInitializers(_init3, 12, this, LOCKED)), __runInitializers(_init3, 15, this);
972
1318
  }
973
1319
  isLocked(direction) {
974
1320
  if (direction === ScrollDirection.Idle) {
@@ -986,12 +1332,12 @@ var ScrollLock = class {
986
1332
  this[direction] = UNLOCKED;
987
1333
  }
988
1334
  };
989
- _init2 = __decoratorStart(null);
1335
+ _init3 = __decoratorStart(null);
990
1336
  __b = new WeakMap();
991
1337
  __a = new WeakMap();
992
- __decorateElement(_init2, 4, _b, _dec2, ScrollLock, __b);
993
- __decorateElement(_init2, 4, _a2, _dec, ScrollLock, __a);
994
- __decoratorMetadata(_init2, ScrollLock);
1338
+ __decorateElement(_init3, 4, _b, _dec2, ScrollLock, __b);
1339
+ __decorateElement(_init3, 4, _a3, _dec, ScrollLock, __a);
1340
+ __decoratorMetadata(_init3, ScrollLock);
995
1341
 
996
1342
  // src/core/plugins/scrolling/ScrollIntent.ts
997
1343
  var DIRECTIONS = [ScrollDirection.Forward, ScrollDirection.Reverse];
@@ -1047,11 +1393,11 @@ function getDirection(a, b) {
1047
1393
  }
1048
1394
 
1049
1395
  // src/core/plugins/scrolling/Scroller.ts
1050
- var _autoScrolling_dec, _a3, _init3, _autoScrolling, _meta, _scroll;
1051
- var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive], _a3) {
1396
+ var _autoScrolling_dec, _a4, _init4, _autoScrolling, _meta, _scroll;
1397
+ var Scroller = class extends (_a4 = CorePlugin, _autoScrolling_dec = [reactive], _a4) {
1052
1398
  constructor(manager) {
1053
1399
  super(manager);
1054
- __privateAdd(this, _autoScrolling, __runInitializers(_init3, 8, this, false)), __runInitializers(_init3, 11, this);
1400
+ __privateAdd(this, _autoScrolling, __runInitializers(_init4, 8, this, false)), __runInitializers(_init4, 11, this);
1055
1401
  __privateAdd(this, _meta);
1056
1402
  __privateAdd(this, _scroll, () => {
1057
1403
  if (!__privateGet(this, _meta)) {
@@ -1061,8 +1407,8 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
1061
1407
  if (by.y) element.scrollTop += by.y;
1062
1408
  if (by.x) element.scrollLeft += by.x;
1063
1409
  });
1064
- this.scroll = (options) => {
1065
- var _a4;
1410
+ this.scroll = (options, scrollOptions) => {
1411
+ var _a5;
1066
1412
  if (this.disabled) {
1067
1413
  return false;
1068
1414
  }
@@ -1084,12 +1430,21 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
1084
1430
  return false;
1085
1431
  }
1086
1432
  for (const scrollableElement of elements) {
1087
- const elementCanScroll = canScroll(scrollableElement, by);
1433
+ const scrollPosition = getScrollPosition(scrollableElement);
1434
+ const elementCanScroll = canScroll(
1435
+ scrollableElement,
1436
+ by,
1437
+ scrollPosition
1438
+ );
1088
1439
  if (elementCanScroll.x || elementCanScroll.y) {
1089
1440
  const { speed, direction } = detectScrollIntent(
1090
1441
  scrollableElement,
1091
1442
  currentPosition,
1092
- intent
1443
+ intent,
1444
+ scrollOptions == null ? void 0 : scrollOptions.acceleration,
1445
+ scrollOptions == null ? void 0 : scrollOptions.threshold,
1446
+ void 0,
1447
+ scrollPosition
1093
1448
  );
1094
1449
  if (scrollIntent) {
1095
1450
  for (const axis of Axes) {
@@ -1104,7 +1459,7 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
1104
1459
  const scrollLeftBy = x * speed.x;
1105
1460
  const scrollTopBy = y * speed.y;
1106
1461
  if (scrollLeftBy || scrollTopBy) {
1107
- const previousScrollBy = (_a4 = __privateGet(this, _meta)) == null ? void 0 : _a4.by;
1462
+ const previousScrollBy = (_a5 = __privateGet(this, _meta)) == null ? void 0 : _a5.by;
1108
1463
  if (this.autoScrolling && previousScrollBy) {
1109
1464
  const scrollIntentMismatch = previousScrollBy.x && !scrollLeftBy || previousScrollBy.y && !scrollTopBy;
1110
1465
  if (scrollIntentMismatch) continue;
@@ -1134,7 +1489,7 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
1134
1489
  return null;
1135
1490
  }
1136
1491
  const element = getElementFromPoint(
1137
- getDocument(source == null ? void 0 : source.element),
1492
+ getRoot(source == null ? void 0 : source.element),
1138
1493
  position.current
1139
1494
  );
1140
1495
  if (element) {
@@ -1183,12 +1538,12 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
1183
1538
  });
1184
1539
  }
1185
1540
  };
1186
- _init3 = __decoratorStart(_a3);
1541
+ _init4 = __decoratorStart(_a4);
1187
1542
  _autoScrolling = new WeakMap();
1188
1543
  _meta = new WeakMap();
1189
1544
  _scroll = new WeakMap();
1190
- __decorateElement(_init3, 4, "autoScrolling", _autoScrolling_dec, Scroller, _autoScrolling);
1191
- __decoratorMetadata(_init3, Scroller);
1545
+ __decorateElement(_init4, 4, "autoScrolling", _autoScrolling_dec, Scroller, _autoScrolling);
1546
+ __decoratorMetadata(_init4, Scroller);
1192
1547
  function getScrollIntent(value) {
1193
1548
  if (value > 0) {
1194
1549
  return ScrollDirection.Forward;
@@ -1238,24 +1593,31 @@ var scheduler3 = new Scheduler((callback) => {
1238
1593
 
1239
1594
  // src/core/plugins/scrolling/AutoScroller.ts
1240
1595
  var AUTOSCROLL_INTERVAL = 10;
1241
- var AutoScroller = class extends Plugin {
1242
- constructor(manager, _options) {
1243
- super(manager);
1596
+ var _AutoScroller = class _AutoScroller extends Plugin {
1597
+ constructor(manager, options) {
1598
+ super(manager, options);
1244
1599
  const scroller = manager.registry.plugins.get(Scroller);
1245
1600
  if (!scroller) {
1246
1601
  throw new Error("AutoScroller plugin depends on Scroller plugin");
1247
1602
  }
1248
1603
  this.destroy = effect(() => {
1604
+ var _a5, _b2, _c3;
1249
1605
  if (this.disabled) {
1250
1606
  return;
1251
1607
  }
1252
1608
  const { position: _, status } = manager.dragOperation;
1253
1609
  if (status.dragging) {
1254
- const canScroll2 = scroller.scroll();
1610
+ const scrollOptions = {
1611
+ acceleration: (_a5 = this.options) == null ? void 0 : _a5.acceleration,
1612
+ threshold: typeof ((_b2 = this.options) == null ? void 0 : _b2.threshold) === "number" ? { x: this.options.threshold, y: this.options.threshold } : (_c3 = this.options) == null ? void 0 : _c3.threshold
1613
+ };
1614
+ const canScroll2 = scroller.scroll(void 0, scrollOptions);
1255
1615
  if (canScroll2) {
1256
1616
  scroller.autoScrolling = true;
1257
1617
  const interval = setInterval(
1258
- () => scheduler3.schedule(scroller.scroll),
1618
+ () => scheduler3.schedule(
1619
+ () => scroller.scroll(void 0, scrollOptions)
1620
+ ),
1259
1621
  AUTOSCROLL_INTERVAL
1260
1622
  );
1261
1623
  return () => {
@@ -1268,6 +1630,8 @@ var AutoScroller = class extends Plugin {
1268
1630
  });
1269
1631
  }
1270
1632
  };
1633
+ _AutoScroller.configure = configurator(_AutoScroller);
1634
+ var AutoScroller = _AutoScroller;
1271
1635
  var listenerOptions = {
1272
1636
  capture: true,
1273
1637
  passive: true
@@ -1287,10 +1651,10 @@ var ScrollListener = class extends CorePlugin {
1287
1651
  };
1288
1652
  const { dragOperation } = this.manager;
1289
1653
  this.destroy = effect(() => {
1290
- var _a4, _b2, _c3;
1654
+ var _a5, _b2, _c3;
1291
1655
  const enabled = dragOperation.status.dragging;
1292
1656
  if (enabled) {
1293
- const root = (_c3 = (_b2 = (_a4 = dragOperation.source) == null ? void 0 : _a4.element) == null ? void 0 : _b2.ownerDocument) != null ? _c3 : document;
1657
+ const root = (_c3 = (_b2 = (_a5 = dragOperation.source) == null ? void 0 : _a5.element) == null ? void 0 : _b2.ownerDocument) != null ? _c3 : document;
1294
1658
  root.addEventListener("scroll", this.handleScroll, listenerOptions);
1295
1659
  return () => {
1296
1660
  root.removeEventListener(
@@ -1304,21 +1668,18 @@ var ScrollListener = class extends CorePlugin {
1304
1668
  }
1305
1669
  };
1306
1670
  _timeout = new WeakMap();
1671
+ var CSS_RULES2 = "* { user-select: none !important; -webkit-user-select: none !important; }";
1307
1672
  var PreventSelection = class extends Plugin {
1308
- constructor(manager, options) {
1309
- super(manager, options);
1673
+ constructor(manager) {
1674
+ super(manager);
1310
1675
  this.manager = manager;
1676
+ const styleInjector = manager.registry.plugins.get(
1677
+ StyleInjector
1678
+ );
1679
+ const unregisterStyles = styleInjector == null ? void 0 : styleInjector.register(CSS_RULES2);
1311
1680
  this.destroy = effect(() => {
1312
- var _a4;
1313
1681
  const { dragOperation } = this.manager;
1314
- const { nonce } = (_a4 = this.options) != null ? _a4 : {};
1315
1682
  if (dragOperation.status.initialized) {
1316
- const style = document.createElement("style");
1317
- if (nonce) {
1318
- style.setAttribute("nonce", nonce);
1319
- }
1320
- style.textContent = `* { user-select: none !important; -webkit-user-select: none !important; }`;
1321
- document.head.appendChild(style);
1322
1683
  removeSelection();
1323
1684
  document.addEventListener("selectionchange", removeSelection, {
1324
1685
  capture: true
@@ -1327,16 +1688,83 @@ var PreventSelection = class extends Plugin {
1327
1688
  document.removeEventListener("selectionchange", removeSelection, {
1328
1689
  capture: true
1329
1690
  });
1330
- style.remove();
1331
1691
  };
1332
1692
  }
1333
1693
  });
1694
+ if (unregisterStyles) {
1695
+ const originalDestroy = this.destroy.bind(this);
1696
+ this.destroy = () => {
1697
+ unregisterStyles();
1698
+ originalDestroy();
1699
+ };
1700
+ }
1334
1701
  }
1335
1702
  };
1336
1703
  function removeSelection() {
1337
- var _a4;
1338
- (_a4 = document.getSelection()) == null ? void 0 : _a4.removeAllRanges();
1704
+ var _a5;
1705
+ (_a5 = document.getSelection()) == null ? void 0 : _a5.removeAllRanges();
1339
1706
  }
1707
+
1708
+ // src/core/sensors/keyboard/KeyboardSensor.helpers.ts
1709
+ function isKeyboardKey(event, codes) {
1710
+ const eventKey = normalizeKey(event.key);
1711
+ return codes.some((code) => normalizeKey(code) === eventKey);
1712
+ }
1713
+ var namedKeys = /* @__PURE__ */ new Set([
1714
+ "alt",
1715
+ "altgraph",
1716
+ "backspace",
1717
+ "capslock",
1718
+ "control",
1719
+ "delete",
1720
+ "end",
1721
+ "enter",
1722
+ "escape",
1723
+ "home",
1724
+ "insert",
1725
+ "meta",
1726
+ "pagedown",
1727
+ "pageup",
1728
+ "pause",
1729
+ "printscreen",
1730
+ "shift",
1731
+ "space",
1732
+ "tab",
1733
+ "arrowdown",
1734
+ "arrowleft",
1735
+ "arrowright",
1736
+ "arrowup",
1737
+ "f1",
1738
+ "f2",
1739
+ "f3",
1740
+ "f4",
1741
+ "f5",
1742
+ "f6",
1743
+ "f7",
1744
+ "f8",
1745
+ "f9",
1746
+ "f10",
1747
+ "f11",
1748
+ "f12"
1749
+ ]);
1750
+ function normalizeKey(key) {
1751
+ if (key === " " || key === "Spacebar") {
1752
+ return "space";
1753
+ }
1754
+ if (/^Key[A-Z]$/.test(key)) {
1755
+ return key.slice(3).toLowerCase();
1756
+ }
1757
+ if (/^Digit[0-9]$/.test(key)) {
1758
+ return key.slice(5);
1759
+ }
1760
+ if (key.length === 1) {
1761
+ return key.toLowerCase();
1762
+ }
1763
+ const lowerCaseKey = key.toLowerCase();
1764
+ return namedKeys.has(lowerCaseKey) ? lowerCaseKey : key;
1765
+ }
1766
+
1767
+ // src/core/sensors/keyboard/KeyboardSensor.ts
1340
1768
  var defaults = Object.freeze({
1341
1769
  offset: 10,
1342
1770
  keyboardCodes: {
@@ -1348,11 +1776,10 @@ var defaults = Object.freeze({
1348
1776
  left: ["ArrowLeft"],
1349
1777
  right: ["ArrowRight"]
1350
1778
  },
1351
- shouldActivate(args) {
1352
- var _a4;
1353
- const { event, source } = args;
1354
- const target = (_a4 = source.handle) != null ? _a4 : source.element;
1355
- return event.target === target;
1779
+ preventActivation(event, source) {
1780
+ var _a5;
1781
+ const target = (_a5 = source.handle) != null ? _a5 : source.element;
1782
+ return event.target !== target;
1356
1783
  }
1357
1784
  });
1358
1785
  var _cleanupFunctions;
@@ -1375,23 +1802,22 @@ var _KeyboardSensor = class _KeyboardSensor extends Sensor {
1375
1802
  }
1376
1803
  const {
1377
1804
  keyboardCodes = defaults.keyboardCodes,
1378
- shouldActivate = defaults.shouldActivate
1805
+ preventActivation = defaults.preventActivation
1379
1806
  } = options != null ? options : {};
1380
- if (!keyboardCodes.start.includes(event.code)) {
1807
+ if (!isKeyboardKey(event, keyboardCodes.start)) {
1381
1808
  return;
1382
1809
  }
1383
1810
  if (!this.manager.dragOperation.status.idle) {
1384
1811
  return;
1385
1812
  }
1386
- if (shouldActivate({ event, source, manager: this.manager })) {
1387
- this.handleStart(event, source, options);
1388
- }
1813
+ if (preventActivation == null ? void 0 : preventActivation(event, source)) return;
1814
+ this.handleStart(event, source, options);
1389
1815
  };
1390
1816
  }
1391
1817
  bind(source, options = this.options) {
1392
1818
  const unbind = effect(() => {
1393
- var _a4;
1394
- const target = (_a4 = source.handle) != null ? _a4 : source.element;
1819
+ var _a5;
1820
+ const target = (_a5 = source.handle) != null ? _a5 : source.element;
1395
1821
  const listener = (event) => {
1396
1822
  if (isKeyboardEvent(event)) {
1397
1823
  this.handleSourceKeyDown(event, source, options);
@@ -1439,20 +1865,20 @@ var _KeyboardSensor = class _KeyboardSensor extends Sensor {
1439
1865
  }
1440
1866
  handleKeyDown(event, _source, options) {
1441
1867
  const { keyboardCodes = defaults.keyboardCodes } = options != null ? options : {};
1442
- if (isKeycode(event, [...keyboardCodes.end, ...keyboardCodes.cancel])) {
1868
+ if (isKeyboardKey(event, [...keyboardCodes.end, ...keyboardCodes.cancel])) {
1443
1869
  event.preventDefault();
1444
- const canceled = isKeycode(event, keyboardCodes.cancel);
1870
+ const canceled = isKeyboardKey(event, keyboardCodes.cancel);
1445
1871
  this.handleEnd(event, canceled);
1446
1872
  return;
1447
1873
  }
1448
- if (isKeycode(event, keyboardCodes.up)) {
1874
+ if (isKeyboardKey(event, keyboardCodes.up)) {
1449
1875
  this.handleMove("up", event);
1450
- } else if (isKeycode(event, keyboardCodes.down)) {
1876
+ } else if (isKeyboardKey(event, keyboardCodes.down)) {
1451
1877
  this.handleMove("down", event);
1452
1878
  }
1453
- if (isKeycode(event, keyboardCodes.left)) {
1879
+ if (isKeyboardKey(event, keyboardCodes.left)) {
1454
1880
  this.handleMove("left", event);
1455
- } else if (isKeycode(event, keyboardCodes.right)) {
1881
+ } else if (isKeyboardKey(event, keyboardCodes.right)) {
1456
1882
  this.handleMove("right", event);
1457
1883
  }
1458
1884
  }
@@ -1464,14 +1890,14 @@ var _KeyboardSensor = class _KeyboardSensor extends Sensor {
1464
1890
  this.cleanup();
1465
1891
  }
1466
1892
  handleMove(direction, event) {
1467
- var _a4, _b2;
1893
+ var _a5, _b2;
1468
1894
  const { shape } = this.manager.dragOperation;
1469
1895
  const factor = event.shiftKey ? 5 : 1;
1470
1896
  let by = {
1471
1897
  x: 0,
1472
1898
  y: 0
1473
1899
  };
1474
- let offset = (_b2 = (_a4 = this.options) == null ? void 0 : _a4.offset) != null ? _b2 : defaults.offset;
1900
+ let offset = (_b2 = (_a5 = this.options) == null ? void 0 : _a5.offset) != null ? _b2 : defaults.offset;
1475
1901
  if (typeof offset === "number") {
1476
1902
  offset = { x: offset, y: offset };
1477
1903
  }
@@ -1522,40 +1948,134 @@ _cleanupFunctions = new WeakMap();
1522
1948
  _KeyboardSensor.configure = configurator(_KeyboardSensor);
1523
1949
  _KeyboardSensor.defaults = defaults;
1524
1950
  var KeyboardSensor = _KeyboardSensor;
1525
- function isKeycode(event, codes) {
1526
- return codes.includes(event.code);
1527
- }
1951
+ var _coordinates;
1952
+ var DistanceConstraint = class extends ActivationConstraint {
1953
+ constructor() {
1954
+ super(...arguments);
1955
+ __privateAdd(this, _coordinates);
1956
+ }
1957
+ onEvent(event) {
1958
+ switch (event.type) {
1959
+ case "pointerdown":
1960
+ __privateSet(this, _coordinates, getEventCoordinates(event));
1961
+ break;
1962
+ case "pointermove":
1963
+ if (!__privateGet(this, _coordinates)) return;
1964
+ const { x, y } = getEventCoordinates(event);
1965
+ const delta = {
1966
+ x: x - __privateGet(this, _coordinates).x,
1967
+ y: y - __privateGet(this, _coordinates).y
1968
+ };
1969
+ const { tolerance } = this.options;
1970
+ if (tolerance && exceedsDistance(delta, tolerance)) {
1971
+ this.abort();
1972
+ return;
1973
+ }
1974
+ if (exceedsDistance(delta, this.options.value)) {
1975
+ this.activate(event);
1976
+ }
1977
+ break;
1978
+ case "pointerup":
1979
+ this.abort();
1980
+ break;
1981
+ }
1982
+ }
1983
+ abort() {
1984
+ __privateSet(this, _coordinates, void 0);
1985
+ }
1986
+ };
1987
+ _coordinates = new WeakMap();
1988
+ var _timeout2, _coordinates2;
1989
+ var DelayConstraint = class extends ActivationConstraint {
1990
+ constructor() {
1991
+ super(...arguments);
1992
+ __privateAdd(this, _timeout2);
1993
+ __privateAdd(this, _coordinates2);
1994
+ }
1995
+ onEvent(event) {
1996
+ switch (event.type) {
1997
+ case "pointerdown":
1998
+ __privateSet(this, _coordinates2, getEventCoordinates(event));
1999
+ __privateSet(this, _timeout2, setTimeout(
2000
+ () => this.activate(event),
2001
+ this.options.value
2002
+ ));
2003
+ break;
2004
+ case "pointermove":
2005
+ if (!__privateGet(this, _coordinates2)) return;
2006
+ const { x, y } = getEventCoordinates(event);
2007
+ const delta = {
2008
+ x: x - __privateGet(this, _coordinates2).x,
2009
+ y: y - __privateGet(this, _coordinates2).y
2010
+ };
2011
+ if (exceedsDistance(delta, this.options.tolerance)) {
2012
+ this.abort();
2013
+ }
2014
+ break;
2015
+ case "pointerup":
2016
+ this.abort();
2017
+ break;
2018
+ }
2019
+ }
2020
+ abort() {
2021
+ if (__privateGet(this, _timeout2)) {
2022
+ clearTimeout(__privateGet(this, _timeout2));
2023
+ __privateSet(this, _coordinates2, void 0);
2024
+ __privateSet(this, _timeout2, void 0);
2025
+ }
2026
+ }
2027
+ };
2028
+ _timeout2 = new WeakMap();
2029
+ _coordinates2 = new WeakMap();
2030
+
2031
+ // src/core/sensors/pointer/PointerActivationConstraints.ts
2032
+ var PointerActivationConstraints = class {
2033
+ };
2034
+ PointerActivationConstraints.Delay = DelayConstraint;
2035
+ PointerActivationConstraints.Distance = DistanceConstraint;
2036
+
2037
+ // src/core/sensors/pointer/PointerSensor.ts
1528
2038
  var defaults2 = Object.freeze({
1529
2039
  activationConstraints(event, source) {
1530
- var _a4;
2040
+ var _a5;
1531
2041
  const { pointerType, target } = event;
1532
- if (pointerType === "mouse" && isElement(target) && (source.handle === target || ((_a4 = source.handle) == null ? void 0 : _a4.contains(target)))) {
2042
+ if (pointerType === "mouse" && isElement(target) && (source.handle === target || ((_a5 = source.handle) == null ? void 0 : _a5.contains(target)))) {
1533
2043
  return void 0;
1534
2044
  }
1535
2045
  if (pointerType === "touch") {
1536
- return {
1537
- delay: { value: 250, tolerance: 5 }
1538
- };
2046
+ return [
2047
+ new PointerActivationConstraints.Delay({ value: 250, tolerance: 5 })
2048
+ ];
1539
2049
  }
1540
2050
  if (isTextInput(target) && !event.defaultPrevented) {
1541
- return {
1542
- delay: { value: 200, tolerance: 0 }
1543
- };
2051
+ return [
2052
+ new PointerActivationConstraints.Delay({ value: 200, tolerance: 0 })
2053
+ ];
1544
2054
  }
1545
- return {
1546
- delay: { value: 200, tolerance: 10 },
1547
- distance: { value: 5 }
1548
- };
2055
+ return [
2056
+ new PointerActivationConstraints.Delay({ value: 200, tolerance: 10 }),
2057
+ new PointerActivationConstraints.Distance({ value: 5 })
2058
+ ];
2059
+ },
2060
+ preventActivation(event, source) {
2061
+ var _a5;
2062
+ const { target } = event;
2063
+ if (target === source.element) return false;
2064
+ if (target === source.handle) return false;
2065
+ if (!isElement(target)) return false;
2066
+ if ((_a5 = source.handle) == null ? void 0 : _a5.contains(target)) return false;
2067
+ const interactiveElement = getInteractiveElement(target);
2068
+ if (interactiveElement === source.element) return false;
2069
+ return Boolean(interactiveElement);
1549
2070
  }
1550
2071
  });
1551
- var _cleanup, _clearTimeout;
2072
+ var _cleanup;
1552
2073
  var _PointerSensor = class _PointerSensor extends Sensor {
1553
2074
  constructor(manager, options) {
1554
2075
  super(manager);
1555
2076
  this.manager = manager;
1556
2077
  this.options = options;
1557
2078
  __privateAdd(this, _cleanup, /* @__PURE__ */ new Set());
1558
- __privateAdd(this, _clearTimeout);
1559
2079
  this.listeners = new Listeners();
1560
2080
  this.latest = {
1561
2081
  event: void 0,
@@ -1572,15 +2092,14 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1572
2092
  this.handlePointerUp = this.handlePointerUp.bind(this);
1573
2093
  this.handleKeyDown = this.handleKeyDown.bind(this);
1574
2094
  }
1575
- activationConstraints(event, source) {
1576
- var _a4;
1577
- const { activationConstraints = defaults2.activationConstraints } = (_a4 = this.options) != null ? _a4 : {};
2095
+ activationConstraints(event, source, options = this.options) {
2096
+ const { activationConstraints = defaults2.activationConstraints } = options != null ? options : {};
1578
2097
  const constraints = typeof activationConstraints === "function" ? activationConstraints(event, source) : activationConstraints;
1579
2098
  return constraints;
1580
2099
  }
1581
2100
  bind(source, options = this.options) {
1582
2101
  const unbind = effect(() => {
1583
- var _a4;
2102
+ var _a5;
1584
2103
  const controller = new AbortController();
1585
2104
  const { signal: signal3 } = controller;
1586
2105
  const listener = (event) => {
@@ -1588,7 +2107,7 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1588
2107
  this.handlePointerDown(event, source, options);
1589
2108
  }
1590
2109
  };
1591
- let targets = [(_a4 = source.handle) != null ? _a4 : source.element];
2110
+ let targets = [(_a5 = source.handle) != null ? _a5 : source.element];
1592
2111
  if (options == null ? void 0 : options.activatorElements) {
1593
2112
  if (Array.isArray(options.activatorElements)) {
1594
2113
  targets = options.activatorElements;
@@ -1605,36 +2124,33 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1605
2124
  });
1606
2125
  return unbind;
1607
2126
  }
1608
- handlePointerDown(event, source, options = {}) {
2127
+ handlePointerDown(event, source, options) {
1609
2128
  if (this.disabled || !event.isPrimary || event.button !== 0 || !isElement(event.target) || source.disabled || isCapturedBySensor(event) || !this.manager.dragOperation.status.idle) {
1610
2129
  return;
1611
2130
  }
2131
+ const { preventActivation = defaults2.preventActivation } = options != null ? options : {};
2132
+ if (preventActivation == null ? void 0 : preventActivation(event, source)) {
2133
+ return;
2134
+ }
1612
2135
  const { target } = event;
1613
2136
  const isNativeDraggable = isHTMLElement(target) && target.draggable && target.getAttribute("draggable") === "true";
1614
2137
  const offset = getFrameTransform(source.element);
2138
+ const { x, y } = getEventCoordinates(event);
1615
2139
  this.initialCoordinates = {
1616
- x: event.clientX * offset.scaleX + offset.x,
1617
- y: event.clientY * offset.scaleY + offset.y
2140
+ x: x * offset.scaleX + offset.x,
2141
+ y: y * offset.scaleY + offset.y
1618
2142
  };
1619
- const constraints = this.activationConstraints(event, source);
2143
+ const constraints = this.activationConstraints(event, source, options);
1620
2144
  event.sensor = this;
1621
- if (!(constraints == null ? void 0 : constraints.delay) && !(constraints == null ? void 0 : constraints.distance)) {
1622
- this.handleStart(source, event);
1623
- } else {
1624
- const { delay } = constraints;
1625
- if (delay) {
1626
- const timeout = setTimeout(
1627
- () => this.handleStart(source, event),
1628
- delay.value
1629
- );
1630
- __privateSet(this, _clearTimeout, () => {
1631
- clearTimeout(timeout);
1632
- __privateSet(this, _clearTimeout, void 0);
1633
- });
1634
- }
1635
- }
1636
- const ownerDocument = getDocument(event.target);
1637
- const unbindListeners = this.listeners.bind(ownerDocument, [
2145
+ const controller = new ActivationController(
2146
+ constraints,
2147
+ (event2) => this.handleStart(source, event2)
2148
+ );
2149
+ controller.signal.onabort = () => this.handleCancel(event);
2150
+ controller.onEvent(event);
2151
+ this.controller = controller;
2152
+ const documents = getDocuments();
2153
+ const unbindListeners = this.listeners.bind(documents, [
1638
2154
  {
1639
2155
  type: "pointermove",
1640
2156
  listener: (event2) => this.handlePointerMove(event2, source)
@@ -1646,6 +2162,10 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1646
2162
  capture: true
1647
2163
  }
1648
2164
  },
2165
+ {
2166
+ type: "pointercancel",
2167
+ listener: this.handleCancel
2168
+ },
1649
2169
  {
1650
2170
  // Cancel activation if there is a competing Drag and Drop interaction
1651
2171
  type: "dragstart",
@@ -1656,49 +2176,28 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1656
2176
  }
1657
2177
  ]);
1658
2178
  const cleanup = () => {
1659
- var _a4;
1660
2179
  unbindListeners();
1661
- (_a4 = __privateGet(this, _clearTimeout)) == null ? void 0 : _a4.call(this);
1662
2180
  this.initialCoordinates = void 0;
1663
2181
  };
1664
2182
  __privateGet(this, _cleanup).add(cleanup);
1665
2183
  }
1666
2184
  handlePointerMove(event, source) {
1667
- const coordinates = {
1668
- x: event.clientX,
1669
- y: event.clientY
1670
- };
1671
- const offset = getFrameTransform(source.element);
1672
- coordinates.x = coordinates.x * offset.scaleX + offset.x;
1673
- coordinates.y = coordinates.y * offset.scaleY + offset.y;
1674
- if (this.manager.dragOperation.status.dragging) {
2185
+ var _a5, _b2;
2186
+ if (((_a5 = this.controller) == null ? void 0 : _a5.activated) === false) {
2187
+ (_b2 = this.controller) == null ? void 0 : _b2.onEvent(event);
2188
+ }
2189
+ const { status } = this.manager.dragOperation;
2190
+ if (status.initializing || status.dragging) {
2191
+ const coordinates = getEventCoordinates(event);
2192
+ const offset = getFrameTransform(source.element);
2193
+ coordinates.x = coordinates.x * offset.scaleX + offset.x;
2194
+ coordinates.y = coordinates.y * offset.scaleY + offset.y;
1675
2195
  event.preventDefault();
1676
2196
  event.stopPropagation();
1677
2197
  this.latest.event = event;
1678
2198
  this.latest.coordinates = coordinates;
1679
- scheduler.schedule(this.handleMove);
1680
- return;
1681
- }
1682
- if (!this.initialCoordinates) {
1683
- return;
1684
- }
1685
- const delta = {
1686
- x: coordinates.x - this.initialCoordinates.x,
1687
- y: coordinates.y - this.initialCoordinates.y
1688
- };
1689
- const constraints = this.activationConstraints(event, source);
1690
- const { distance, delay } = constraints != null ? constraints : {};
1691
- if (distance) {
1692
- if (distance.tolerance != null && exceedsDistance(delta, distance.tolerance)) {
1693
- return this.handleCancel(event);
1694
- }
1695
- if (exceedsDistance(delta, distance.value)) {
1696
- return this.handleStart(source, event);
1697
- }
1698
- }
1699
- if (delay) {
1700
- if (exceedsDistance(delta, delay.tolerance)) {
1701
- return this.handleCancel(event);
2199
+ if (status.dragging) {
2200
+ scheduler.schedule(this.handleMove);
1702
2201
  }
1703
2202
  }
1704
2203
  }
@@ -1708,6 +2207,20 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1708
2207
  event.preventDefault();
1709
2208
  event.stopPropagation();
1710
2209
  const canceled = !status.initialized;
2210
+ const ownerDocument = getDocument(event.target);
2211
+ const ownerWindow = ownerDocument.defaultView;
2212
+ if (!canceled && ownerWindow) {
2213
+ const suppressClick = (clickEvent) => {
2214
+ if (clickEvent.target === ownerDocument.body && clickEvent.detail > 0) {
2215
+ clickEvent.preventDefault();
2216
+ clickEvent.stopImmediatePropagation();
2217
+ }
2218
+ };
2219
+ ownerWindow.addEventListener("click", suppressClick, true);
2220
+ ownerWindow.setTimeout(() => {
2221
+ ownerWindow.removeEventListener("click", suppressClick, true);
2222
+ }, 0);
2223
+ }
1711
2224
  this.manager.actions.stop({ event, canceled });
1712
2225
  }
1713
2226
  this.cleanup();
@@ -1719,9 +2232,7 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1719
2232
  }
1720
2233
  }
1721
2234
  handleStart(source, event) {
1722
- var _a4;
1723
2235
  const { manager, initialCoordinates } = this;
1724
- (_a4 = __privateGet(this, _clearTimeout)) == null ? void 0 : _a4.call(this);
1725
2236
  if (!initialCoordinates || !manager.dragOperation.status.idle) {
1726
2237
  return;
1727
2238
  }
@@ -1737,8 +2248,14 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1737
2248
  event.preventDefault();
1738
2249
  const ownerDocument = getDocument(event.target);
1739
2250
  const pointerCaptureTarget = ownerDocument.body;
1740
- pointerCaptureTarget.setPointerCapture(event.pointerId);
1741
- const unbind = this.listeners.bind(ownerDocument, [
2251
+ try {
2252
+ pointerCaptureTarget.setPointerCapture(event.pointerId);
2253
+ } catch (e) {
2254
+ this.handleCancel(event);
2255
+ return;
2256
+ }
2257
+ const listenerTargets = isElement(event.target) ? [event.target, pointerCaptureTarget] : pointerCaptureTarget;
2258
+ const unbind = this.listeners.bind(listenerTargets, [
1742
2259
  {
1743
2260
  // Prevent scrolling on touch devices
1744
2261
  type: "touchmove",
@@ -1759,16 +2276,14 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1759
2276
  {
1760
2277
  type: "keydown",
1761
2278
  listener: this.handleKeyDown
1762
- },
1763
- {
1764
- type: "lostpointercapture",
1765
- listener: (event2) => {
1766
- if (event2.target !== pointerCaptureTarget) return;
1767
- this.handlePointerUp(event2);
1768
- }
1769
2279
  }
1770
2280
  ]);
1771
2281
  __privateGet(this, _cleanup).add(unbind);
2282
+ manager.renderer.rendering.then(() => {
2283
+ if (!controller.signal.aborted && manager.dragOperation.status.dragging) {
2284
+ scheduler.schedule(this.handleMove);
2285
+ }
2286
+ });
1772
2287
  }
1773
2288
  handleCancel(event) {
1774
2289
  const { dragOperation } = this.manager;
@@ -1778,6 +2293,11 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1778
2293
  this.cleanup();
1779
2294
  }
1780
2295
  cleanup() {
2296
+ const { controller } = this;
2297
+ this.controller = void 0;
2298
+ if (controller && !controller.signal.aborted) {
2299
+ controller.abort();
2300
+ }
1781
2301
  this.latest = {
1782
2302
  event: void 0,
1783
2303
  coordinates: void 0
@@ -1791,7 +2311,6 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1791
2311
  }
1792
2312
  };
1793
2313
  _cleanup = new WeakMap();
1794
- _clearTimeout = new WeakMap();
1795
2314
  _PointerSensor.configure = configurator(_PointerSensor);
1796
2315
  _PointerSensor.defaults = defaults2;
1797
2316
  var PointerSensor = _PointerSensor;
@@ -1823,41 +2342,40 @@ var defaultPreset = {
1823
2342
  };
1824
2343
  var DragDropManager = class extends DragDropManager$1 {
1825
2344
  constructor(input = {}) {
1826
- const {
1827
- plugins = defaultPreset.plugins,
1828
- sensors = defaultPreset.sensors,
1829
- modifiers = []
1830
- } = input;
2345
+ const plugins = resolveCustomizable(input.plugins, defaultPreset.plugins);
2346
+ const sensors = resolveCustomizable(input.sensors, defaultPreset.sensors);
2347
+ const modifiers = resolveCustomizable(
2348
+ input.modifiers,
2349
+ defaultPreset.modifiers
2350
+ );
1831
2351
  super(__spreadProps(__spreadValues({}, input), {
1832
- plugins: [ScrollListener, Scroller, ...plugins],
2352
+ plugins: [ScrollListener, Scroller, StyleInjector, ...plugins],
1833
2353
  sensors,
1834
2354
  modifiers
1835
2355
  }));
1836
2356
  }
1837
2357
  };
1838
- var _feedback_dec, _element_dec, _handle_dec, _c, _init4, _handle, _element, _feedback;
1839
- var Draggable = class extends (_c = Draggable$1, _handle_dec = [reactive], _element_dec = [reactive], _feedback_dec = [reactive], _c) {
1840
- constructor(_a4, manager) {
1841
- var _b2 = _a4, {
2358
+ var _element_dec, _handle_dec, _c, _init5, _handle, _element;
2359
+ var Draggable = class extends (_c = Draggable$1, _handle_dec = [reactive], _element_dec = [reactive], _c) {
2360
+ constructor(_a5, manager) {
2361
+ var _b2 = _a5, {
1842
2362
  element,
1843
2363
  effects: effects2 = () => [],
1844
- handle,
1845
- feedback = "default"
2364
+ handle
1846
2365
  } = _b2, input = __objRest(_b2, [
1847
2366
  "element",
1848
2367
  "effects",
1849
- "handle",
1850
- "feedback"
2368
+ "handle"
1851
2369
  ]);
1852
2370
  super(
1853
2371
  __spreadValues({
1854
2372
  effects: () => [
1855
2373
  ...effects2(),
1856
2374
  () => {
1857
- var _a5, _b3;
2375
+ var _a6, _b3;
1858
2376
  const { manager: manager2 } = this;
1859
2377
  if (!manager2) return;
1860
- const sensors = (_b3 = (_a5 = this.sensors) == null ? void 0 : _a5.map(descriptor)) != null ? _b3 : [
2378
+ const sensors = (_b3 = (_a6 = this.sensors) == null ? void 0 : _a6.map(descriptor)) != null ? _b3 : [
1861
2379
  ...manager2.sensors
1862
2380
  ];
1863
2381
  const unbindFunctions = sensors.map((entry) => {
@@ -1874,26 +2392,22 @@ var Draggable = class extends (_c = Draggable$1, _handle_dec = [reactive], _elem
1874
2392
  }, input),
1875
2393
  manager
1876
2394
  );
1877
- __privateAdd(this, _handle, __runInitializers(_init4, 8, this)), __runInitializers(_init4, 11, this);
1878
- __privateAdd(this, _element, __runInitializers(_init4, 12, this)), __runInitializers(_init4, 15, this);
1879
- __privateAdd(this, _feedback, __runInitializers(_init4, 16, this)), __runInitializers(_init4, 19, this);
2395
+ __privateAdd(this, _handle, __runInitializers(_init5, 8, this)), __runInitializers(_init5, 11, this);
2396
+ __privateAdd(this, _element, __runInitializers(_init5, 12, this)), __runInitializers(_init5, 15, this);
1880
2397
  this.element = element;
1881
2398
  this.handle = handle;
1882
- this.feedback = feedback;
1883
2399
  }
1884
2400
  };
1885
- _init4 = __decoratorStart(_c);
2401
+ _init5 = __decoratorStart(_c);
1886
2402
  _handle = new WeakMap();
1887
2403
  _element = new WeakMap();
1888
- _feedback = new WeakMap();
1889
- __decorateElement(_init4, 4, "handle", _handle_dec, Draggable, _handle);
1890
- __decorateElement(_init4, 4, "element", _element_dec, Draggable, _element);
1891
- __decorateElement(_init4, 4, "feedback", _feedback_dec, Draggable, _feedback);
1892
- __decoratorMetadata(_init4, Draggable);
1893
- var _proxy_dec, _element_dec2, _c2, _init5, _element2, _d, element_get, element_set, _Droppable_instances, _proxy;
2404
+ __decorateElement(_init5, 4, "handle", _handle_dec, Draggable, _handle);
2405
+ __decorateElement(_init5, 4, "element", _element_dec, Draggable, _element);
2406
+ __decoratorMetadata(_init5, Draggable);
2407
+ var _proxy_dec, _element_dec2, _c2, _init6, _element2, _d, element_get, element_set, _Droppable_instances, _proxy;
1894
2408
  var Droppable = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _proxy_dec = [reactive], _c2) {
1895
- constructor(_a4, manager) {
1896
- var _b2 = _a4, { element, effects: effects2 = () => [] } = _b2, input = __objRest(_b2, ["element", "effects"]);
2409
+ constructor(_a5, manager) {
2410
+ var _b2 = _a5, { element, effects: effects2 = () => [] } = _b2, input = __objRest(_b2, ["element", "effects"]);
1897
2411
  const { collisionDetector = defaultCollisionDetection } = input;
1898
2412
  const updateShape = (boundingClientRect) => {
1899
2413
  const { manager: manager2, element: element2 } = this;
@@ -1939,8 +2453,8 @@ var Droppable = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _p
1939
2453
  }
1940
2454
  },
1941
2455
  () => {
1942
- var _a5;
1943
- if ((_a5 = this.manager) == null ? void 0 : _a5.dragOperation.status.initialized) {
2456
+ var _a6;
2457
+ if ((_a6 = this.manager) == null ? void 0 : _a6.dragOperation.status.initialized) {
1944
2458
  return () => {
1945
2459
  this.shape = void 0;
1946
2460
  };
@@ -1951,8 +2465,8 @@ var Droppable = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _p
1951
2465
  manager
1952
2466
  );
1953
2467
  __privateAdd(this, _Droppable_instances);
1954
- __privateAdd(this, _element2, __runInitializers(_init5, 8, this)), __runInitializers(_init5, 11, this);
1955
- __privateAdd(this, _proxy, __runInitializers(_init5, 12, this)), __runInitializers(_init5, 15, this);
2468
+ __privateAdd(this, _element2, __runInitializers(_init6, 8, this)), __runInitializers(_init6, 11, this);
2469
+ __privateAdd(this, _proxy, __runInitializers(_init6, 12, this)), __runInitializers(_init6, 15, this);
1956
2470
  this.element = element;
1957
2471
  this.refreshShape = () => updateShape();
1958
2472
  }
@@ -1960,18 +2474,18 @@ var Droppable = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _p
1960
2474
  __privateSet(this, _Droppable_instances, element, element_set);
1961
2475
  }
1962
2476
  get element() {
1963
- var _a4;
1964
- return (_a4 = this.proxy) != null ? _a4 : __privateGet(this, _Droppable_instances, element_get);
2477
+ var _a5;
2478
+ return (_a5 = this.proxy) != null ? _a5 : __privateGet(this, _Droppable_instances, element_get);
1965
2479
  }
1966
2480
  };
1967
- _init5 = __decoratorStart(_c2);
2481
+ _init6 = __decoratorStart(_c2);
1968
2482
  _element2 = new WeakMap();
1969
2483
  _Droppable_instances = new WeakSet();
1970
2484
  _proxy = new WeakMap();
1971
- _d = __decorateElement(_init5, 20, "#element", _element_dec2, _Droppable_instances, _element2), element_get = _d.get, element_set = _d.set;
1972
- __decorateElement(_init5, 4, "proxy", _proxy_dec, Droppable, _proxy);
1973
- __decoratorMetadata(_init5, Droppable);
2485
+ _d = __decorateElement(_init6, 20, "#element", _element_dec2, _Droppable_instances, _element2), element_get = _d.get, element_set = _d.set;
2486
+ __decorateElement(_init6, 4, "proxy", _proxy_dec, Droppable, _proxy);
2487
+ __decoratorMetadata(_init6, Droppable);
1974
2488
 
1975
- export { Accessibility, AutoScroller, Cursor, DragDropManager, Draggable, Droppable, Feedback, KeyboardSensor, PointerSensor, PreventSelection, ScrollListener, Scroller, defaultPreset };
2489
+ export { Accessibility, AutoScroller, Cursor, DragDropManager, Draggable, Droppable, Feedback, KeyboardSensor, PointerActivationConstraints, PointerSensor, PreventSelection, ScrollListener, Scroller, StyleInjector, defaultPreset };
1976
2490
  //# sourceMappingURL=index.js.map
1977
2491
  //# sourceMappingURL=index.js.map