@fullcalendar/interaction 7.0.0-beta.3 → 7.0.0-beta.5

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.
@@ -1,11 +1,15 @@
1
1
  /*!
2
- FullCalendar Interaction Plugin v7.0.0-beta.3
2
+ FullCalendar Interaction Plugin v7.0.0-beta.5
3
3
  Docs & License: https://fullcalendar.io/docs/editable
4
- (c) 2024 Adam Shaw
4
+ (c) 2025 Adam Shaw
5
5
  */
6
- FullCalendar.Interaction = (function (exports, core, internal) {
6
+ FullCalendar.Interaction = (function (exports, core, internal, classNames) {
7
7
  'use strict';
8
8
 
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
10
+
11
+ var classNames__default = /*#__PURE__*/_interopDefault(classNames);
12
+
9
13
  internal.config.touchMouseIgnoreWait = 500;
10
14
  let ignoreMouseDepth = 0;
11
15
  let listenerCnt = 0;
@@ -34,7 +38,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
34
38
  // internal states
35
39
  this.isDragging = false;
36
40
  this.isTouchDragging = false;
37
- this.wasTouchScroll = false;
41
+ this.wasTouchScroll = false; // HACK public
38
42
  // Mouse
39
43
  // ----------------------------------------------------------------------------------------------------
40
44
  this.handleMouseDown = (ev) => {
@@ -84,9 +88,11 @@ FullCalendar.Interaction = (function (exports, core, internal) {
84
88
  }
85
89
  };
86
90
  this.handleTouchMove = (ev) => {
87
- let pev = this.createEventFromTouch(ev);
88
- this.recordCoords(pev);
89
- this.emitter.trigger('pointermove', pev);
91
+ if (this.isDragging) {
92
+ let pev = this.createEventFromTouch(ev);
93
+ this.recordCoords(pev);
94
+ this.emitter.trigger('pointermove', pev);
95
+ }
90
96
  };
91
97
  this.handleTouchEnd = (ev) => {
92
98
  if (this.isDragging) { // done to guard against touchend followed by touchcancel
@@ -130,6 +136,11 @@ FullCalendar.Interaction = (function (exports, core, internal) {
130
136
  this.containerEl.removeEventListener('touchstart', this.handleTouchStart, { passive: true });
131
137
  listenerDestroyed();
132
138
  }
139
+ cancel() {
140
+ if (this.isDragging) {
141
+ this.cleanup();
142
+ }
143
+ }
133
144
  tryStart(ev) {
134
145
  let subjectEl = this.querySubjectEl(ev);
135
146
  let downEl = ev.target;
@@ -312,7 +323,9 @@ FullCalendar.Interaction = (function (exports, core, internal) {
312
323
  if (bool) {
313
324
  if (!this.isVisible) {
314
325
  if (this.mirrorEl) {
315
- this.mirrorEl.style.display = '';
326
+ // important because competes with util.module.css classNames, which are all important
327
+ // TODO: attach a util className here instead?
328
+ this.mirrorEl.style.setProperty('display', '', 'important');
316
329
  }
317
330
  this.isVisible = bool; // needs to happen before updateElPosition
318
331
  this.updateElPosition(); // because was not updating the position while invisible
@@ -320,7 +333,9 @@ FullCalendar.Interaction = (function (exports, core, internal) {
320
333
  }
321
334
  else if (this.isVisible) {
322
335
  if (this.mirrorEl) {
323
- this.mirrorEl.style.display = 'none';
336
+ // important because competes with util.module.css classNames, which are all important
337
+ // TODO: attach a util className here instead?
338
+ this.mirrorEl.style.setProperty('display', 'none', 'important');
324
339
  }
325
340
  this.isVisible = bool;
326
341
  }
@@ -380,10 +395,10 @@ FullCalendar.Interaction = (function (exports, core, internal) {
380
395
  mirrorEl = this.mirrorEl = this.sourceEl.cloneNode(true); // cloneChildren=true
381
396
  // we don't want long taps or any mouse interaction causing selection/menus.
382
397
  // would use preventSelection(), but that prevents selectstart, causing problems.
398
+ // TODO: make className for this?
383
399
  mirrorEl.style.userSelect = 'none';
384
400
  mirrorEl.style.webkitUserSelect = 'none';
385
401
  mirrorEl.style.pointerEvents = 'none';
386
- mirrorEl.classList.add('fc-event-dragging');
387
402
  internal.applyStyle(mirrorEl, {
388
403
  position: 'fixed',
389
404
  zIndex: this.zIndex,
@@ -523,7 +538,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
523
538
  constructor() {
524
539
  // options that can be set by caller
525
540
  this.isEnabled = true;
526
- this.scrollQuery = [window, '.fc-scroller'];
541
+ this.scrollQuery = [window, `.${classNames__default["default"].internalScroller}`];
527
542
  this.edgeThreshold = 50; // pixels
528
543
  this.maxVelocity = 300; // pixels per second
529
544
  // internal state
@@ -713,17 +728,16 @@ FullCalendar.Interaction = (function (exports, core, internal) {
713
728
  this.isInteracting = true;
714
729
  this.isDelayEnded = false;
715
730
  this.isDistanceSurpassed = false;
716
- internal.preventSelection(document.body);
717
- internal.preventContextMenu(document.body);
718
- // prevent links from being visited if there's an eventual drag.
719
- // also prevents selection in older browsers (maybe?).
720
- // not necessary for touch, besides, browser would complain about passiveness.
721
- if (!ev.isTouch) {
722
- ev.origEvent.preventDefault();
723
- }
724
731
  this.emitter.trigger('pointerdown', ev);
725
- if (this.isInteracting && // not destroyed via pointerdown handler
726
- !this.pointer.shouldIgnoreMove) {
732
+ if (this.isInteracting) { // not cancelled?
733
+ internal.preventSelection(document.body);
734
+ internal.preventContextMenu(document.body);
735
+ // prevent links from being visited if there's an eventual drag.
736
+ // also prevents selection in older browsers (maybe?).
737
+ // not necessary for touch, besides, browser would complain about passiveness.
738
+ if (!ev.isTouch) {
739
+ ev.origEvent.preventDefault();
740
+ }
727
741
  // actions related to initiating dragstart+dragmove+dragend...
728
742
  this.mirror.setIsVisible(false); // reset. caller must set-visible
729
743
  this.mirror.start(ev.subjectEl, ev.pageX, ev.pageY); // must happen on first pointer down
@@ -830,8 +844,14 @@ FullCalendar.Interaction = (function (exports, core, internal) {
830
844
  this.emitter.trigger('dragend', ev);
831
845
  }
832
846
  // fill in the implementations...
833
- setIgnoreMove(bool) {
834
- this.pointer.shouldIgnoreMove = bool;
847
+ /*
848
+ Can only be called by pointerdown to prevent drag
849
+ */
850
+ cancel() {
851
+ if (this.isInteracting) {
852
+ this.isInteracting = false;
853
+ this.pointer.cancel();
854
+ }
835
855
  }
836
856
  setMirrorIsVisible(bool) {
837
857
  this.mirror.setIsVisible(bool);
@@ -856,6 +876,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
856
876
  constructor(el) {
857
877
  this.el = el;
858
878
  this.origRect = internal.computeRect(el);
879
+ this.isRtl = internal.computeElIsRtl(el);
859
880
  // will work fine for divs that have overflow:hidden
860
881
  this.scrollCaches = internal.getClippingParents(el).map((scrollEl) => new ElementScrollGeomCache(scrollEl, true));
861
882
  }
@@ -926,12 +947,11 @@ FullCalendar.Interaction = (function (exports, core, internal) {
926
947
  this.prepareHits();
927
948
  this.processFirstCoord(ev);
928
949
  if (this.initialHit || !this.requireInitial) {
929
- dragging.setIgnoreMove(false);
930
950
  // TODO: fire this before computing processFirstCoord, so listeners can cancel. this gets fired by almost every handler :(
931
951
  this.emitter.trigger('pointerdown', ev);
932
952
  }
933
953
  else {
934
- dragging.setIgnoreMove(true);
954
+ dragging.cancel();
935
955
  }
936
956
  };
937
957
  this.handleDragStart = (ev) => {
@@ -1027,7 +1047,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1027
1047
  // must be within the element's bounds
1028
1048
  positionLeft >= 0 && positionLeft < width &&
1029
1049
  positionTop >= 0 && positionTop < height) {
1030
- let hit = component.queryHit(positionLeft, positionTop, width, height);
1050
+ let hit = component.queryHit(offsetTracker.isRtl, positionLeft, positionTop, width, height);
1031
1051
  if (hit && (
1032
1052
  // make sure the hit is within activeRange, meaning it's not a dead cell
1033
1053
  internal.rangeContainsRange(hit.dateProfile.activeRange, hit.dateSpan.range)) &&
@@ -1090,8 +1110,14 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1090
1110
  this.handlePointerDown = (pev) => {
1091
1111
  let { dragging } = this;
1092
1112
  let downEl = pev.origEvent.target;
1093
- // do this in pointerdown (not dragend) because DOM might be mutated by the time dragend is fired
1094
- dragging.setIgnoreMove(!this.component.isValidDateDownEl(downEl));
1113
+ /*
1114
+ If no dateClick, allow text on dates to be text-selectable
1115
+ */
1116
+ const canDateClick = this.component.context.emitter.hasHandlers('dateClick') &&
1117
+ this.component.isValidDateDownEl(downEl);
1118
+ if (!canDateClick) {
1119
+ dragging.cancel();
1120
+ }
1095
1121
  };
1096
1122
  // won't even fire if moving was ignored
1097
1123
  this.handleDragEnd = (ev) => {
@@ -1101,8 +1127,8 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1101
1127
  let { initialHit, finalHit } = this.hitDragging;
1102
1128
  if (initialHit && finalHit && isHitsEqual(initialHit, finalHit)) {
1103
1129
  let { context } = component;
1104
- let arg = Object.assign(Object.assign({}, buildDatePointApiWithContext(initialHit.dateSpan, context)), { dayEl: initialHit.dayEl, jsEvent: ev.origEvent, view: context.viewApi || context.calendarApi.view });
1105
- context.emitter.trigger('dateClick', arg);
1130
+ let data = Object.assign(Object.assign({}, buildDatePointApiWithContext(initialHit.dateSpan, context)), { dayEl: initialHit.getDayEl(), jsEvent: ev.origEvent, view: context.viewApi || context.calendarApi.view });
1131
+ context.emitter.trigger('dateClick', data);
1106
1132
  }
1107
1133
  }
1108
1134
  };
@@ -1129,12 +1155,15 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1129
1155
  this.handlePointerDown = (ev) => {
1130
1156
  let { component, dragging } = this;
1131
1157
  let { options } = component.context;
1132
- let canSelect = options.selectable &&
1158
+ let canDateSelect = options.selectable &&
1133
1159
  component.isValidDateDownEl(ev.origEvent.target);
1134
- // don't bother to watch expensive moves if component won't do selection
1135
- dragging.setIgnoreMove(!canSelect);
1136
- // if touch, require user to hold down
1137
- dragging.delay = ev.isTouch ? getComponentTouchDelay$1(component) : null;
1160
+ if (!canDateSelect) {
1161
+ dragging.cancel();
1162
+ }
1163
+ else {
1164
+ // if touch, require user to hold down
1165
+ dragging.delay = ev.isTouch ? getComponentTouchDelay$1(component) : null;
1166
+ }
1138
1167
  };
1139
1168
  this.handleDragStart = (ev) => {
1140
1169
  this.component.context.calendarApi.unselect(ev); // unselect previous selections
@@ -1255,20 +1284,20 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1255
1284
  (ev.isTouch && eventInstanceId !== component.props.eventSelection) ?
1256
1285
  getComponentTouchDelay(component) :
1257
1286
  null;
1258
- if (options.fixedMirrorParent) {
1259
- mirror.parentNode = options.fixedMirrorParent;
1287
+ mirror.parentNode = internal.getAppendableRoot(origTarget);
1288
+ mirror.revertDuration = options.dragRevertDuration;
1289
+ let isValid = component.isValidSegDownEl(origTarget) &&
1290
+ !origTarget.closest(`.${classNames__default["default"].internalEventResizer}`); // NOT on a resizer
1291
+ if (!isValid) {
1292
+ dragging.cancel();
1260
1293
  }
1261
1294
  else {
1262
- mirror.parentNode = origTarget.closest('.fc');
1295
+ // disable dragging for elements that are resizable (ie, selectable)
1296
+ // but are not draggable
1297
+ // TODO: merge this with .cancel() ?
1298
+ this.isDragging = ev.subjectEl
1299
+ .classList.contains(classNames__default["default"].internalEventDraggable);
1263
1300
  }
1264
- mirror.revertDuration = options.dragRevertDuration;
1265
- let isValid = component.isValidSegDownEl(origTarget) &&
1266
- !origTarget.closest('.fc-event-resizer'); // NOT on a resizer
1267
- dragging.setIgnoreMove(!isValid);
1268
- // disable dragging for elements that are resizable (ie, selectable)
1269
- // but are not draggable
1270
- this.isDragging = isValid &&
1271
- ev.subjectEl.classList.contains('fc-event-draggable');
1272
1301
  };
1273
1302
  this.handleDragStart = (ev) => {
1274
1303
  let initialContext = this.component.context;
@@ -1347,7 +1376,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1347
1376
  this.dragging.setMirrorNeedsRevert(!mutation);
1348
1377
  // render the mirror if no already-rendered mirror
1349
1378
  // TODO: wish we could somehow wait for dispatch to guarantee render
1350
- this.dragging.setMirrorIsVisible(!hit || !this.subjectEl.getRootNode().querySelector('.fc-event-mirror'));
1379
+ this.dragging.setMirrorIsVisible(!hit || !this.subjectEl.getRootNode().querySelector(`.${classNames__default["default"].internalEventMirror}`));
1351
1380
  // assign states based on new hit
1352
1381
  this.receivingContext = receivingContext;
1353
1382
  this.validMutation = mutation;
@@ -1385,7 +1414,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1385
1414
  type: 'MERGE_EVENTS',
1386
1415
  eventStore: mutatedRelevantEvents,
1387
1416
  });
1388
- let eventChangeArg = {
1417
+ let eventChangeData = {
1389
1418
  oldEvent: eventApi,
1390
1419
  event: updatedEventApi,
1391
1420
  relatedEvents: internal.buildEventApis(mutatedRelevantEvents, initialContext, eventInstance),
@@ -1400,12 +1429,12 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1400
1429
  for (let transformer of initialContext.getCurrentData().pluginHooks.eventDropTransformers) {
1401
1430
  Object.assign(transformed, transformer(validMutation, initialContext));
1402
1431
  }
1403
- initialContext.emitter.trigger('eventDrop', Object.assign(Object.assign(Object.assign({}, eventChangeArg), transformed), { el: ev.subjectEl, delta: validMutation.datesDelta, jsEvent: ev.origEvent, view: initialView }));
1404
- initialContext.emitter.trigger('eventChange', eventChangeArg);
1432
+ initialContext.emitter.trigger('eventDrop', Object.assign(Object.assign(Object.assign({}, eventChangeData), transformed), { el: ev.subjectEl, delta: validMutation.datesDelta, jsEvent: ev.origEvent, view: initialView }));
1433
+ initialContext.emitter.trigger('eventChange', eventChangeData);
1405
1434
  // dropped in different calendar
1406
1435
  }
1407
1436
  else if (receivingContext) {
1408
- let eventRemoveArg = {
1437
+ let eventRemoveData = {
1409
1438
  event: eventApi,
1410
1439
  relatedEvents: internal.buildEventApis(relevantEvents, initialContext, eventInstance),
1411
1440
  revert() {
@@ -1415,12 +1444,12 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1415
1444
  });
1416
1445
  },
1417
1446
  };
1418
- initialContext.emitter.trigger('eventLeave', Object.assign(Object.assign({}, eventRemoveArg), { draggedEl: ev.subjectEl, view: initialView }));
1447
+ initialContext.emitter.trigger('eventLeave', Object.assign(Object.assign({}, eventRemoveData), { draggedEl: ev.subjectEl, view: initialView }));
1419
1448
  initialContext.dispatch({
1420
1449
  type: 'REMOVE_EVENTS',
1421
1450
  eventStore: relevantEvents,
1422
1451
  });
1423
- initialContext.emitter.trigger('eventRemove', eventRemoveArg);
1452
+ initialContext.emitter.trigger('eventRemove', eventRemoveData);
1424
1453
  let addedEventDef = mutatedRelevantEvents.defs[eventDef.defId];
1425
1454
  let addedEventInstance = mutatedRelevantEvents.instances[eventInstance.instanceId];
1426
1455
  let addedEventApi = new internal.EventImpl(receivingContext, addedEventDef, addedEventInstance);
@@ -1428,7 +1457,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1428
1457
  type: 'MERGE_EVENTS',
1429
1458
  eventStore: mutatedRelevantEvents,
1430
1459
  });
1431
- let eventAddArg = {
1460
+ let eventAddData = {
1432
1461
  event: addedEventApi,
1433
1462
  relatedEvents: internal.buildEventApis(mutatedRelevantEvents, receivingContext, addedEventInstance),
1434
1463
  revert() {
@@ -1438,7 +1467,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1438
1467
  });
1439
1468
  },
1440
1469
  };
1441
- receivingContext.emitter.trigger('eventAdd', eventAddArg);
1470
+ receivingContext.emitter.trigger('eventAdd', eventAddData);
1442
1471
  if (ev.isTouch) {
1443
1472
  receivingContext.dispatch({
1444
1473
  type: 'SELECT_EVENT',
@@ -1446,7 +1475,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1446
1475
  });
1447
1476
  }
1448
1477
  receivingContext.emitter.trigger('drop', Object.assign(Object.assign({}, buildDatePointApiWithContext(finalHit.dateSpan, receivingContext)), { draggedEl: ev.subjectEl, jsEvent: ev.origEvent, view: finalHit.context.viewApi }));
1449
- receivingContext.emitter.trigger('eventReceive', Object.assign(Object.assign({}, eventAddArg), { draggedEl: ev.subjectEl, view: finalHit.context.viewApi }));
1478
+ receivingContext.emitter.trigger('eventReceive', Object.assign(Object.assign({}, eventAddData), { draggedEl: ev.subjectEl, view: finalHit.context.viewApi }));
1450
1479
  }
1451
1480
  }
1452
1481
  else {
@@ -1521,7 +1550,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1521
1550
  }
1522
1551
  // TODO: test this in IE11
1523
1552
  // QUESTION: why do we need it on the resizable???
1524
- EventDragging.SELECTOR = '.fc-event-draggable, .fc-event-resizable';
1553
+ EventDragging.SELECTOR = `.${classNames__default["default"].internalEventDraggable}, .${classNames__default["default"].internalEventResizable}`;
1525
1554
  function computeEventMutation(hit0, hit1, eventInstanceStart, massagers) {
1526
1555
  let dateSpan0 = hit0.dateSpan;
1527
1556
  let dateSpan1 = hit1.dateSpan;
@@ -1581,9 +1610,11 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1581
1610
  let segEl = this.querySegEl(ev);
1582
1611
  let eventRange = this.eventRange = internal.getElEventRange(segEl);
1583
1612
  this.dragging.minDistance = component.context.options.eventDragMinDistance;
1584
- // if touch, need to be working with a selected event
1585
- this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(ev.origEvent.target) ||
1586
- (ev.isTouch && this.component.props.eventSelection !== eventRange.instance.instanceId));
1613
+ const isValid = this.component.isValidSegDownEl(ev.origEvent.target) &&
1614
+ !(ev.isTouch && this.component.props.eventSelection !== eventRange.instance.instanceId);
1615
+ if (!isValid) {
1616
+ this.dragging.cancel();
1617
+ }
1587
1618
  };
1588
1619
  this.handleDragStart = (ev) => {
1589
1620
  let { context } = this.component;
@@ -1618,7 +1649,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1618
1649
  && this.isHitComboAllowed
1619
1650
  && !this.isHitComboAllowed(initialHit, hit);
1620
1651
  if (!disallowed) {
1621
- mutation = computeMutation(initialHit, hit, ev.subjectEl.classList.contains('fc-event-resizer-start'), eventInstance.range);
1652
+ mutation = computeMutation(initialHit, hit, ev.subjectEl.classList.contains(classNames__default["default"].internalEventResizerStart), eventInstance.range);
1622
1653
  }
1623
1654
  }
1624
1655
  if (mutation) {
@@ -1673,7 +1704,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1673
1704
  type: 'MERGE_EVENTS',
1674
1705
  eventStore: mutatedRelevantEvents,
1675
1706
  });
1676
- let eventChangeArg = {
1707
+ let eventChangeData = {
1677
1708
  oldEvent: eventApi,
1678
1709
  event: updatedEventApi,
1679
1710
  relatedEvents: internal.buildEventApis(mutatedRelevantEvents, context, eventInstance),
@@ -1684,8 +1715,8 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1684
1715
  });
1685
1716
  },
1686
1717
  };
1687
- context.emitter.trigger('eventResize', Object.assign(Object.assign({}, eventChangeArg), { el: this.draggingSegEl, startDelta: this.validMutation.startDelta || internal.createDuration(0), endDelta: this.validMutation.endDelta || internal.createDuration(0), jsEvent: ev.origEvent, view: context.viewApi }));
1688
- context.emitter.trigger('eventChange', eventChangeArg);
1718
+ context.emitter.trigger('eventResize', Object.assign(Object.assign({}, eventChangeData), { el: this.draggingSegEl, startDelta: this.validMutation.startDelta || internal.createDuration(0), endDelta: this.validMutation.endDelta || internal.createDuration(0), jsEvent: ev.origEvent, view: context.viewApi }));
1719
+ context.emitter.trigger('eventChange', eventChangeData);
1689
1720
  }
1690
1721
  else {
1691
1722
  context.emitter.trigger('_noEventResize');
@@ -1698,7 +1729,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1698
1729
  };
1699
1730
  let { component } = settings;
1700
1731
  let dragging = this.dragging = new FeaturefulElementDragging(settings.el);
1701
- dragging.pointer.selector = '.fc-event-resizer';
1732
+ dragging.pointer.selector = `.${classNames__default["default"].internalEventResizer}`;
1702
1733
  dragging.touchScrollAllowed = false;
1703
1734
  dragging.autoScroller.isEnabled = component.context.options.dragScroll;
1704
1735
  let hitDragging = this.hitDragging = new HitDragging(this.dragging, internal.interactionSettingsToStore(settings));
@@ -1711,7 +1742,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1711
1742
  this.dragging.destroy();
1712
1743
  }
1713
1744
  querySegEl(ev) {
1714
- return ev.subjectEl.closest('.fc-event');
1745
+ return ev.subjectEl.closest(`.${classNames__default["default"].internalEvent}`);
1715
1746
  }
1716
1747
  }
1717
1748
  function computeMutation(hit0, hit1, isFromStart, instanceRange) {
@@ -1736,8 +1767,8 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1736
1767
  this.isRecentPointerDateSelect = false; // wish we could use a selector to detect date selection, but uses hit system
1737
1768
  this.matchesCancel = false;
1738
1769
  this.matchesEvent = false;
1739
- this.onSelect = (selectInfo) => {
1740
- if (selectInfo.jsEvent) {
1770
+ this.onSelect = (selectData) => {
1771
+ if (selectData.jsEvent) {
1741
1772
  this.isRecentPointerDateSelect = true;
1742
1773
  }
1743
1774
  };
@@ -1785,9 +1816,7 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1785
1816
  }
1786
1817
  }
1787
1818
 
1788
- const OPTION_REFINERS = {
1789
- fixedMirrorParent: internal.identity,
1790
- };
1819
+ const OPTION_REFINERS = {};
1791
1820
  const LISTENER_REFINERS = {
1792
1821
  dateClick: internal.identity,
1793
1822
  eventDragStart: internal.identity,
@@ -1840,7 +1869,9 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1840
1869
  this.displayDrag(receivingContext, interaction);
1841
1870
  // show mirror if no already-rendered mirror element OR if we are shutting down the mirror (?)
1842
1871
  // TODO: wish we could somehow wait for dispatch to guarantee render
1843
- dragging.setMirrorIsVisible(isFinal || !droppableEvent || !document.querySelector('.fc-event-mirror'));
1872
+ dragging.setMirrorIsVisible(isFinal ||
1873
+ !droppableEvent ||
1874
+ !document.querySelector(`.${classNames__default["default"].internalEventMirror}`));
1844
1875
  if (!isInvalid) {
1845
1876
  internal.enableCursor();
1846
1877
  }
@@ -1992,8 +2023,8 @@ FullCalendar.Interaction = (function (exports, core, internal) {
1992
2023
  this.handleDragStart = (ev) => {
1993
2024
  if (ev.isTouch &&
1994
2025
  this.dragging.delay &&
1995
- ev.subjectEl.classList.contains('fc-event')) {
1996
- this.dragging.mirror.getMirrorEl().classList.add('fc-event-selected');
2026
+ ev.subjectEl.classList.contains(classNames__default["default"].internalEvent)) {
2027
+ this.dragging.mirror.getMirrorEl().classList.add(classNames__default["default"].internalEventSelected);
1997
2028
  }
1998
2029
  };
1999
2030
  this.settings = settings;
@@ -2053,8 +2084,8 @@ FullCalendar.Interaction = (function (exports, core, internal) {
2053
2084
  destroy() {
2054
2085
  this.pointer.destroy();
2055
2086
  }
2056
- setIgnoreMove(bool) {
2057
- this.shouldIgnoreMove = bool;
2087
+ cancel() {
2088
+ this.shouldIgnoreMove = true;
2058
2089
  }
2059
2090
  setMirrorIsVisible(bool) {
2060
2091
  if (bool) {
@@ -2134,4 +2165,4 @@ FullCalendar.Interaction = (function (exports, core, internal) {
2134
2165
 
2135
2166
  return exports;
2136
2167
 
2137
- })({}, FullCalendar, FullCalendar.Internal);
2168
+ })({}, FullCalendar, FullCalendar.Internal, FullCalendar.InternalClassNames);
package/global.min.js ADDED
@@ -0,0 +1,6 @@
1
+ /*!
2
+ FullCalendar Interaction Plugin v7.0.0-beta.5
3
+ Docs & License: https://fullcalendar.io/docs/editable
4
+ (c) 2025 Adam Shaw
5
+ */
6
+ FullCalendar.Interaction=function(t,e,i,n){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}var r=s(FullCalendar.InternalClassNames);i.config.touchMouseIgnoreWait=500;let o=0,l=0,a=!1;class h{constructor(t){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=t=>{if(!this.shouldIgnoreMouse()&&function(t){return 0===t.button&&!t.ctrlKey}(t)&&this.tryStart(t)){let e=this.createEventFromMouse(t,!0);this.emitter.trigger("pointerdown",e),this.initScrollWatch(e),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=t=>{let e=this.createEventFromMouse(t);this.recordCoords(e),this.emitter.trigger("pointermove",e)},this.handleMouseUp=t=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(t)),this.cleanup()},this.handleTouchStart=t=>{if(this.tryStart(t)){this.isTouchDragging=!0;let e=this.createEventFromTouch(t,!0);this.emitter.trigger("pointerdown",e),this.initScrollWatch(e);let i=t.target;this.shouldIgnoreMove||i.addEventListener("touchmove",this.handleTouchMove),i.addEventListener("touchend",this.handleTouchEnd),i.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=t=>{if(this.isDragging){let e=this.createEventFromTouch(t);this.recordCoords(e),this.emitter.trigger("pointermove",e)}},this.handleTouchEnd=t=>{if(this.isDragging){let e=t.target;e.removeEventListener("touchmove",this.handleTouchMove),e.removeEventListener("touchend",this.handleTouchEnd),e.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(t)),this.cleanup(),this.isTouchDragging=!1,o+=1,setTimeout(()=>{o-=1},i.config.touchMouseIgnoreWait)}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=t=>{if(!this.shouldIgnoreMove){let e=window.scrollX-this.prevScrollX+this.prevPageX,i=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:t,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:e,pageY:i,deltaX:e-this.origPageX,deltaY:i-this.origPageY})}},this.containerEl=t,this.emitter=new i.Emitter,t.addEventListener("mousedown",this.handleMouseDown),t.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),l+=1,1===l&&window.addEventListener("touchmove",c,{passive:!1})}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),l-=1,l||window.removeEventListener("touchmove",c,{passive:!1})}cancel(){this.isDragging&&this.cleanup()}tryStart(t){let e=this.querySubjectEl(t),i=t.target;return!(!e||this.handleSelector&&!i.closest(this.handleSelector))&&(this.subjectEl=e,this.isDragging=!0,this.wasTouchScroll=!1,!0)}cleanup(){a=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(t){return this.selector?t.target.closest(this.selector):this.containerEl}shouldIgnoreMouse(){return o||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(a=!0)}initScrollWatch(t){this.shouldWatchScroll&&(this.recordCoords(t),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(t){this.shouldWatchScroll&&(this.prevPageX=t.pageX,this.prevPageY=t.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(t,e){let i=0,n=0;return e?(this.origPageX=t.pageX,this.origPageY=t.pageY):(i=t.pageX-this.origPageX,n=t.pageY-this.origPageY),{origEvent:t,isTouch:!1,subjectEl:this.subjectEl,pageX:t.pageX,pageY:t.pageY,deltaX:i,deltaY:n}}createEventFromTouch(t,e){let i,n,s=t.touches,r=0,o=0;return s&&s.length?(i=s[0].pageX,n=s[0].pageY):(i=t.pageX,n=t.pageY),e?(this.origPageX=i,this.origPageY=n):(r=i-this.origPageX,o=n-this.origPageY),{origEvent:t,isTouch:!0,subjectEl:this.subjectEl,pageX:i,pageY:n,deltaX:r,deltaY:o}}}function c(t){a&&t.preventDefault()}class d{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(t,e,i){this.sourceEl=t,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=e-window.scrollX,this.origScreenY=i-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(t,e){this.deltaX=t-window.scrollX-this.origScreenX,this.deltaY=e-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(t){t?this.isVisible||(this.mirrorEl&&this.mirrorEl.style.setProperty("display","","important"),this.isVisible=t,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&this.mirrorEl.style.setProperty("display","none","important"),this.isVisible=t)}stop(t,e){let i=()=>{this.cleanup(),e()};t&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(i,this.revertDuration):setTimeout(i,0)}doRevertAnimation(t,e){let n=this.mirrorEl,s=this.sourceEl.getBoundingClientRect();n.style.transition="top "+e+"ms,left "+e+"ms",i.applyStyle(n,{left:s.left,top:s.top}),i.whenTransitionDone(n,()=>{n.style.transition="",t()})}cleanup(){this.mirrorEl&&(this.mirrorEl.remove(),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&i.applyStyle(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let t=this.sourceElRect,e=this.mirrorEl;return e||(e=this.mirrorEl=this.sourceEl.cloneNode(!0),e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.pointerEvents="none",i.applyStyle(e,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:t.right-t.left,height:t.bottom-t.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(e)),e}}class g extends i.ScrollController{constructor(t,e){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=t,this.doesListening=e,this.scrollTop=this.origScrollTop=t.getScrollTop(),this.scrollLeft=this.origScrollLeft=t.getScrollLeft(),this.scrollWidth=t.getScrollWidth(),this.scrollHeight=t.getScrollHeight(),this.clientWidth=t.getClientWidth(),this.clientHeight=t.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(t){this.scrollController.setScrollTop(t),this.doesListening||(this.scrollTop=Math.max(Math.min(t,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(t){this.scrollController.setScrollLeft(t),this.doesListening||(this.scrollLeft=Math.max(Math.min(t,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class u extends g{constructor(t,e){super(new i.ElementScrollController(t),e)}getEventTarget(){return this.scrollController.el}computeClientRect(){return i.computeInnerRect(this.scrollController.el)}}class p extends g{constructor(t){super(new i.WindowScrollController,t)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const v="function"==typeof performance?performance.now:Date.now;class E{constructor(){this.isEnabled=!0,this.scrollQuery=[window,"."+r.default.internalScroller],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let t=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(t){let e=v();this.handleSide(t,(e-this.msSinceRequest)/1e3),this.requestAnimation(e)}else this.isAnimating=!1}}}start(t,e,i){this.isEnabled&&(this.scrollCaches=this.buildCaches(i),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(t,e))}handleMove(t,e){if(this.isEnabled){let i=t-window.scrollX,n=e-window.scrollY,s=null===this.pointerScreenY?0:n-this.pointerScreenY,r=null===this.pointerScreenX?0:i-this.pointerScreenX;s<0?this.everMovedUp=!0:s>0&&(this.everMovedDown=!0),r<0?this.everMovedLeft=!0:r>0&&(this.everMovedRight=!0),this.pointerScreenX=i,this.pointerScreenY=n,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(v()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let t of this.scrollCaches)t.destroy();this.scrollCaches=null}}requestAnimation(t){this.msSinceRequest=t,requestAnimationFrame(this.animate)}handleSide(t,e){let{scrollCache:i}=t,{edgeThreshold:n}=this,s=n-t.distance,r=s*s/(n*n)*this.maxVelocity*e,o=1;switch(t.name){case"left":o=-1;case"right":i.setScrollLeft(i.getScrollLeft()+r*o);break;case"top":o=-1;case"bottom":i.setScrollTop(i.getScrollTop()+r*o)}}computeBestEdge(t,e){let{edgeThreshold:i}=this,n=null,s=this.scrollCaches||[];for(let r of s){let s=r.clientRect,o=t-s.left,l=s.right-t,a=e-s.top,h=s.bottom-e;o>=0&&l>=0&&a>=0&&h>=0&&(a<=i&&this.everMovedUp&&r.canScrollUp()&&(!n||n.distance>a)&&(n={scrollCache:r,name:"top",distance:a}),h<=i&&this.everMovedDown&&r.canScrollDown()&&(!n||n.distance>h)&&(n={scrollCache:r,name:"bottom",distance:h}),o<=i&&this.everMovedLeft&&r.canScrollLeft()&&(!n||n.distance>o)&&(n={scrollCache:r,name:"left",distance:o}),l<=i&&this.everMovedRight&&r.canScrollRight()&&(!n||n.distance>l)&&(n={scrollCache:r,name:"right",distance:l}))}return n}buildCaches(t){return this.queryScrollEls(t).map(t=>t===window?new p(!1):new u(t,!1))}queryScrollEls(t){let e=[];for(let i of this.scrollQuery)"object"==typeof i?e.push(i):e.push(...Array.prototype.slice.call(t.getRootNode().querySelectorAll(i)));return e}}class m extends i.ElementDragging{constructor(t,e){super(t),this.containerEl=t,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=t=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.emitter.trigger("pointerdown",t),this.isInteracting&&(i.preventSelection(document.body),i.preventContextMenu(document.body),t.isTouch||t.origEvent.preventDefault(),this.mirror.setIsVisible(!1),this.mirror.start(t.subjectEl,t.pageX,t.pageY),this.startDelay(t),this.minDistance||this.handleDistanceSurpassed(t)))},this.onPointerMove=t=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",t),!this.isDistanceSurpassed){let e,i=this.minDistance,{deltaX:n,deltaY:s}=t;e=n*n+s*s,e>=i*i&&this.handleDistanceSurpassed(t)}this.isDragging&&("scroll"!==t.origEvent.type&&(this.mirror.handleMove(t.pageX,t.pageY),this.autoScroller.handleMove(t.pageX,t.pageY)),this.emitter.trigger("dragmove",t))}},this.onPointerUp=t=>{this.isInteracting&&(this.isInteracting=!1,i.allowSelection(document.body),i.allowContextMenu(document.body),this.emitter.trigger("pointerup",t),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(t)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let n=this.pointer=new h(t);n.emitter.on("pointerdown",this.onPointerDown),n.emitter.on("pointermove",this.onPointerMove),n.emitter.on("pointerup",this.onPointerUp),e&&(n.selector=e),this.mirror=new d,this.autoScroller=new E}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(t){"number"==typeof this.delay?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(t)},this.delay):this.handleDelayEnd(t)}handleDelayEnd(t){this.isDelayEnded=!0,this.tryStartDrag(t)}handleDistanceSurpassed(t){this.isDistanceSurpassed=!0,this.tryStartDrag(t)}tryStartDrag(t){this.isDelayEnded&&this.isDistanceSurpassed&&(this.pointer.wasTouchScroll&&!this.touchScrollAllowed||(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(t.pageX,t.pageY,this.containerEl),this.emitter.trigger("dragstart",t),!1===this.touchScrollAllowed&&this.pointer.cancelTouchScroll()))}tryStopDrag(t){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,t))}stopDrag(t){this.isDragging=!1,this.emitter.trigger("dragend",t)}cancel(){this.isInteracting&&(this.isInteracting=!1,this.pointer.cancel())}setMirrorIsVisible(t){this.mirror.setIsVisible(t)}setMirrorNeedsRevert(t){this.mirrorNeedsRevert=t}setAutoScrollEnabled(t){this.autoScroller.isEnabled=t}}class S{constructor(t){this.el=t,this.origRect=i.computeRect(t),this.isRtl=i.computeElIsRtl(t),this.scrollCaches=i.getClippingParents(t).map(t=>new u(t,!0))}destroy(){for(let t of this.scrollCaches)t.destroy()}computeLeft(){let t=this.origRect.left;for(let e of this.scrollCaches)t+=e.origScrollLeft-e.getScrollLeft();return t}computeTop(){let t=this.origRect.top;for(let e of this.scrollCaches)t+=e.origScrollTop-e.getScrollTop();return t}isWithinClipping(t,e){let n={left:t,top:e};for(let t of this.scrollCaches)if(!D(t.getEventTarget())&&!i.pointInsideRect(n,t.clientRect))return!1;return!0}}function D(t){let e=t.tagName;return"HTML"===e||"BODY"===e}class f{constructor(t,e){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=t=>{let{dragging:e}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(t),this.initialHit||!this.requireInitial?this.emitter.trigger("pointerdown",t):e.cancel()},this.handleDragStart=t=>{this.emitter.trigger("dragstart",t),this.handleMove(t,!0)},this.handleDragMove=t=>{this.emitter.trigger("dragmove",t),this.handleMove(t)},this.handlePointerUp=t=>{this.releaseHits(),this.emitter.trigger("pointerup",t)},this.handleDragEnd=t=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,t),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",t)},this.droppableStore=e,t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("dragstart",this.handleDragStart),t.emitter.on("dragmove",this.handleDragMove),t.emitter.on("pointerup",this.handlePointerUp),t.emitter.on("dragend",this.handleDragEnd),this.dragging=t,this.emitter=new i.Emitter}processFirstCoord(t){let e,n={left:t.pageX,top:t.pageY},s=n,r=t.subjectEl;r instanceof HTMLElement&&(e=i.computeRect(r),s=i.constrainPoint(s,e));let o=this.initialHit=this.queryHitForOffset(s.left,s.top);if(o){if(this.useSubjectCenter&&e){let t=i.intersectRects(e,o.rect);t&&(s=i.getRectCenter(t))}this.coordAdjust=i.diffPoints(s,n)}else this.coordAdjust={left:0,top:0}}handleMove(t,e){let i=this.queryHitForOffset(t.pageX+this.coordAdjust.left,t.pageY+this.coordAdjust.top);!e&&y(this.movingHit,i)||(this.movingHit=i,this.emitter.trigger("hitupdate",i,!1,t))}prepareHits(){this.offsetTrackers=i.mapHash(this.droppableStore,t=>(t.component.prepareHits(),new S(t.el)))}releaseHits(){let{offsetTrackers:t}=this;for(let e in t)t[e].destroy();this.offsetTrackers={}}queryHitForOffset(t,e){let{droppableStore:n,offsetTrackers:s}=this,r=null;for(let o in n){let l=n[o].component,a=s[o];if(a&&a.isWithinClipping(t,e)){let n=a.computeLeft(),s=a.computeTop(),h=t-n,c=e-s,{origRect:d}=a,g=d.right-d.left,u=d.bottom-d.top;if(h>=0&&h<g&&c>=0&&c<u){let t=l.queryHit(a.isRtl,h,c,g,u);t&&i.rangeContainsRange(t.dateProfile.activeRange,t.dateSpan.range)&&(this.disablePointCheck||a.el.contains(a.el.getRootNode().elementFromPoint(h+n-window.scrollX,c+s-window.scrollY)))&&(!r||t.layer>r.layer)&&(t.componentId=o,t.context=l.context,t.rect.left+=n,t.rect.right+=n,t.rect.top+=s,t.rect.bottom+=s,r=t)}}}return r}}function y(t,e){return!t&&!e||Boolean(t)===Boolean(e)&&i.isDateSpansEqual(t.dateSpan,e.dateSpan)}function w(t,e){let i={};for(let n of e.pluginHooks.datePointTransforms)Object.assign(i,n(t,e));var n,s;return Object.assign(i,(n=t,{date:(s=e.dateEnv).toDate(n.range.start),dateStr:s.formatIso(n.range.start,{omitTime:n.allDay}),allDay:n.allDay})),i}class T extends i.Interaction{constructor(t){super(t),this.handlePointerDown=t=>{let{dragging:e}=this,i=t.origEvent.target;this.component.context.emitter.hasHandlers("dateClick")&&this.component.isValidDateDownEl(i)||e.cancel()},this.handleDragEnd=t=>{let{component:e}=this,{pointer:i}=this.dragging;if(!i.wasTouchScroll){let{initialHit:i,finalHit:n}=this.hitDragging;if(i&&n&&y(i,n)){let{context:n}=e,s=Object.assign(Object.assign({},w(i.dateSpan,n)),{dayEl:i.getDayEl(),jsEvent:t.origEvent,view:n.viewApi||n.calendarApi.view});n.emitter.trigger("dateClick",s)}}},this.dragging=new m(t.el),this.dragging.autoScroller.isEnabled=!1;let e=this.hitDragging=new f(this.dragging,i.interactionSettingsToStore(t));e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class b extends i.Interaction{constructor(t){super(t),this.dragSelection=null,this.handlePointerDown=t=>{let{component:e,dragging:i}=this,{options:n}=e.context;n.selectable&&e.isValidDateDownEl(t.origEvent.target)?i.delay=t.isTouch?function(t){let{options:e}=t.context,i=e.selectLongPressDelay;null==i&&(i=e.longPressDelay);return i}(e):null:i.cancel()},this.handleDragStart=t=>{this.component.context.calendarApi.unselect(t)},this.handleHitUpdate=(t,e)=>{let{context:n}=this.component,s=null,r=!1;if(t){let e=this.hitDragging.initialHit;t.componentId===e.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(e,t)||(s=function(t,e,n){let s=t.dateSpan,r=e.dateSpan,o=[s.range.start,s.range.end,r.range.start,r.range.end];o.sort(i.compareNumbers);let l={};for(let i of n){let n=i(t,e);if(!1===n)return null;n&&Object.assign(l,n)}return l.range={start:o[0],end:o[3]},l.allDay=s.allDay,l}(e,t,n.pluginHooks.dateSelectionTransformers)),s&&i.isDateSelectionValid(s,t.dateProfile,n)||(r=!0,s=null)}s?n.dispatch({type:"SELECT_DATES",selection:s}):e||n.dispatch({type:"UNSELECT_DATES"}),r?i.disableCursor():i.enableCursor(),e||(this.dragSelection=s)},this.handlePointerUp=t=>{this.dragSelection&&(i.triggerDateSelect(this.dragSelection,t,this.component.context),this.dragSelection=null)};let{component:e}=t,{options:n}=e.context,s=this.dragging=new m(t.el);s.touchScrollAllowed=!1,s.minDistance=n.selectMinDistance||0,s.autoScroller.isEnabled=n.dragScroll;let r=this.hitDragging=new f(this.dragging,i.interactionSettingsToStore(t));r.emitter.on("pointerdown",this.handlePointerDown),r.emitter.on("dragstart",this.handleDragStart),r.emitter.on("hitupdate",this.handleHitUpdate),r.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}class M extends i.Interaction{constructor(t){super(t),this.subjectEl=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=t=>{let e=t.origEvent.target,{component:n,dragging:s}=this,{mirror:o}=s,{options:l}=n.context,a=n.context;this.subjectEl=t.subjectEl;let h=(this.eventRange=i.getElEventRange(t.subjectEl)).instance.instanceId;this.relevantEvents=i.getRelevantEvents(a.getCurrentData().eventStore,h),s.minDistance=t.isTouch?0:l.eventDragMinDistance,s.delay=t.isTouch&&h!==n.props.eventSelection?function(t){let{options:e}=t.context,i=e.eventLongPressDelay;null==i&&(i=e.longPressDelay);return i}(n):null,o.parentNode=i.getAppendableRoot(e),o.revertDuration=l.dragRevertDuration,n.isValidSegDownEl(e)&&!e.closest("."+r.default.internalEventResizer)?this.isDragging=t.subjectEl.classList.contains(r.default.internalEventDraggable):s.cancel()},this.handleDragStart=t=>{let e=this.component.context,n=this.eventRange,s=n.instance.instanceId;t.isTouch?s!==this.component.props.eventSelection&&e.dispatch({type:"SELECT_EVENT",eventInstanceId:s}):e.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(e.calendarApi.unselect(t),e.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new i.EventImpl(e,n.def,n.instance),jsEvent:t.origEvent,view:e.viewApi}))},this.handleHitUpdate=(t,e)=>{if(!this.isDragging)return;let n=this.relevantEvents,s=this.hitDragging.initialHit,o=this.component.context,l=null,a=null,h=null,c=!1,d={affectedEvents:n,mutatedEvents:i.createEmptyEventStore(),isEvent:!0};if(t){l=t.context;let e=l.options;o===l||e.editable&&e.droppable?(a=function(t,e,n,s){let r=t.dateSpan,o=e.dateSpan,l=r.range.start,a=o.range.start,h={};r.allDay!==o.allDay&&(h.allDay=o.allDay,h.hasEnd=e.context.options.allDayMaintainDuration,l=o.allDay?i.startOfDay(n):n);let c=i.diffDates(l,a,t.context.dateEnv,t.componentId===e.componentId?t.largeUnit:null);c.milliseconds&&(h.allDay=!1);let d={datesDelta:c,standardProps:h};for(let i of s)i(d,t,e);return d}(s,t,this.eventRange.instance.range.start,l.getCurrentData().pluginHooks.eventDragMutationMassagers),a&&(h=i.applyMutationToEventStore(n,l.getCurrentData().eventUiBases,a,l),d.mutatedEvents=h,i.isInteractionValid(d,t.dateProfile,l)||(c=!0,a=null,h=null,d.mutatedEvents=i.createEmptyEventStore()))):l=null}this.displayDrag(l,d),c?i.disableCursor():i.enableCursor(),e||(o===l&&y(s,t)&&(a=null),this.dragging.setMirrorNeedsRevert(!a),this.dragging.setMirrorIsVisible(!t||!this.subjectEl.getRootNode().querySelector("."+r.default.internalEventMirror)),this.receivingContext=l,this.validMutation=a,this.mutatedRelevantEvents=h)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=t=>{if(this.isDragging){let e=this.component.context,n=e.viewApi,{receivingContext:s,validMutation:r}=this,o=this.eventRange.def,l=this.eventRange.instance,a=new i.EventImpl(e,o,l),h=this.relevantEvents,c=this.mutatedRelevantEvents,{finalHit:d}=this.hitDragging;if(this.clearDrag(),e.emitter.trigger("eventDragStop",{el:this.subjectEl,event:a,jsEvent:t.origEvent,view:n}),r){if(s===e){let s=new i.EventImpl(e,c.defs[o.defId],l?c.instances[l.instanceId]:null);e.dispatch({type:"MERGE_EVENTS",eventStore:c});let d={oldEvent:a,event:s,relatedEvents:i.buildEventApis(c,e,l),revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:h})}},g={};for(let t of e.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(g,t(r,e));e.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},d),g),{el:t.subjectEl,delta:r.datesDelta,jsEvent:t.origEvent,view:n})),e.emitter.trigger("eventChange",d)}else if(s){let r={event:a,relatedEvents:i.buildEventApis(h,e,l),revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:h})}};e.emitter.trigger("eventLeave",Object.assign(Object.assign({},r),{draggedEl:t.subjectEl,view:n})),e.dispatch({type:"REMOVE_EVENTS",eventStore:h}),e.emitter.trigger("eventRemove",r);let g=c.defs[o.defId],u=c.instances[l.instanceId],p=new i.EventImpl(s,g,u);s.dispatch({type:"MERGE_EVENTS",eventStore:c});let v={event:p,relatedEvents:i.buildEventApis(c,s,u),revert(){s.dispatch({type:"REMOVE_EVENTS",eventStore:c})}};s.emitter.trigger("eventAdd",v),t.isTouch&&s.dispatch({type:"SELECT_EVENT",eventInstanceId:l.instanceId}),s.emitter.trigger("drop",Object.assign(Object.assign({},w(d.dateSpan,s)),{draggedEl:t.subjectEl,jsEvent:t.origEvent,view:d.context.viewApi})),s.emitter.trigger("eventReceive",Object.assign(Object.assign({},v),{draggedEl:t.subjectEl,view:d.context.viewApi}))}}else e.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:e}=this,{options:n}=e.context,s=this.dragging=new m(t.el);s.pointer.selector=M.SELECTOR,s.touchScrollAllowed=!1,s.autoScroller.isEnabled=n.dragScroll;let o=this.hitDragging=new f(this.dragging,i.interactionSettingsStore);o.useSubjectCenter=t.useEventCenter,o.emitter.on("pointerdown",this.handlePointerDown),o.emitter.on("dragstart",this.handleDragStart),o.emitter.on("hitupdate",this.handleHitUpdate),o.emitter.on("pointerup",this.handlePointerUp),o.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(t,e){let n=this.component.context,s=this.receivingContext;s&&s!==t&&(s===n?s.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:e.affectedEvents,mutatedEvents:i.createEmptyEventStore(),isEvent:!0}}):s.dispatch({type:"UNSET_EVENT_DRAG"})),t&&t.dispatch({type:"SET_EVENT_DRAG",state:e})}clearDrag(){let t=this.component.context,{receivingContext:e}=this;e&&e.dispatch({type:"UNSET_EVENT_DRAG"}),t!==e&&t.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}M.SELECTOR=`.${r.default.internalEventDraggable}, .${r.default.internalEventResizable}`;class R extends i.Interaction{constructor(t){super(t),this.draggingSegEl=null,this.draggingEventRange=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=t=>{let{component:e}=this,n=this.querySegEl(t),s=this.eventRange=i.getElEventRange(n);this.dragging.minDistance=e.context.options.eventDragMinDistance;this.component.isValidSegDownEl(t.origEvent.target)&&!(t.isTouch&&this.component.props.eventSelection!==s.instance.instanceId)||this.dragging.cancel()},this.handleDragStart=t=>{let{context:e}=this.component,n=this.eventRange;this.relevantEvents=i.getRelevantEvents(e.getCurrentData().eventStore,this.eventRange.instance.instanceId);let s=this.querySegEl(t);this.draggingSegEl=s,this.draggingEventRange=i.getElEventRange(s),e.calendarApi.unselect(),e.emitter.trigger("eventResizeStart",{el:s,event:new i.EventImpl(e,n.def,n.instance),jsEvent:t.origEvent,view:e.viewApi})},this.handleHitUpdate=(t,e,n)=>{let{context:s}=this.component,o=this.relevantEvents,l=this.hitDragging.initialHit,a=this.eventRange.instance,h=null,c=null,d=!1,g={affectedEvents:o,mutatedEvents:i.createEmptyEventStore(),isEvent:!0};if(t){t.componentId===l.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(l,t)||(h=function(t,e,n,s){let r=t.context.dateEnv,o=t.dateSpan.range.start,l=e.dateSpan.range.start,a=i.diffDates(o,l,r,t.largeUnit);if(n){if(r.add(s.start,a)<s.end)return{startDelta:a}}else if(r.add(s.end,a)>s.start)return{endDelta:a};return null}(l,t,n.subjectEl.classList.contains(r.default.internalEventResizerStart),a.range))}h&&(c=i.applyMutationToEventStore(o,s.getCurrentData().eventUiBases,h,s),g.mutatedEvents=c,i.isInteractionValid(g,t.dateProfile,s)||(d=!0,h=null,c=null,g.mutatedEvents=null)),c?s.dispatch({type:"SET_EVENT_RESIZE",state:g}):s.dispatch({type:"UNSET_EVENT_RESIZE"}),d?i.disableCursor():i.enableCursor(),e||(h&&y(l,t)&&(h=null),this.validMutation=h,this.mutatedRelevantEvents=c)},this.handleDragEnd=t=>{let{context:e}=this.component,n=this.eventRange.def,s=this.eventRange.instance,r=new i.EventImpl(e,n,s),o=this.relevantEvents,l=this.mutatedRelevantEvents;if(e.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:r,jsEvent:t.origEvent,view:e.viewApi}),this.validMutation){let a=new i.EventImpl(e,l.defs[n.defId],s?l.instances[s.instanceId]:null);e.dispatch({type:"MERGE_EVENTS",eventStore:l});let h={oldEvent:r,event:a,relatedEvents:i.buildEventApis(l,e,s),revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:o})}};e.emitter.trigger("eventResize",Object.assign(Object.assign({},h),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||i.createDuration(0),endDelta:this.validMutation.endDelta||i.createDuration(0),jsEvent:t.origEvent,view:e.viewApi})),e.emitter.trigger("eventChange",h)}else e.emitter.trigger("_noEventResize");this.draggingEventRange=null,this.relevantEvents=null,this.validMutation=null};let{component:e}=t,n=this.dragging=new m(t.el);n.pointer.selector="."+r.default.internalEventResizer,n.touchScrollAllowed=!1,n.autoScroller.isEnabled=e.context.options.dragScroll;let s=this.hitDragging=new f(this.dragging,i.interactionSettingsToStore(t));s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(t){return t.subjectEl.closest("."+r.default.internalEvent)}}const C={dateClick:i.identity,eventDragStart:i.identity,eventDragStop:i.identity,eventDrop:i.identity,eventResizeStart:i.identity,eventResizeStop:i.identity,eventResize:i.identity,drop:i.identity,eventReceive:i.identity,eventLeave:i.identity};class I{constructor(t,e){this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=t=>{this.dragMeta=this.buildDragMeta(t.subjectEl)},this.handleHitUpdate=(t,e,n)=>{let{dragging:s}=this.hitDragging,o=null,l=null,a=!1,h={affectedEvents:i.createEmptyEventStore(),mutatedEvents:i.createEmptyEventStore(),isEvent:this.dragMeta.create};t&&(o=t.context,this.canDropElOnCalendar(n.subjectEl,o)&&(l=function(t,e,n){let s=Object.assign({},e.leftoverProps);for(let i of n.pluginHooks.externalDefTransforms)Object.assign(s,i(t,e));let{refined:r,extra:o}=i.refineEventDef(s,n),l=i.parseEventDef(r,o,e.sourceId,t.allDay,n.options.forceEventDuration||Boolean(e.duration),n),a=t.range.start;t.allDay&&e.startTime&&(a=n.dateEnv.add(a,e.startTime));let h=e.duration?n.dateEnv.add(a,e.duration):i.getDefaultEventEnd(t.allDay,a,n),c=i.createEventInstance(l.defId,{start:a,end:h});return{def:l,instance:c}}(t.dateSpan,this.dragMeta,o),h.mutatedEvents=i.eventTupleToStore(l),a=!i.isInteractionValid(h,t.dateProfile,o),a&&(h.mutatedEvents=i.createEmptyEventStore(),l=null))),this.displayDrag(o,h),s.setMirrorIsVisible(e||!l||!document.querySelector("."+r.default.internalEventMirror)),a?i.disableCursor():i.enableCursor(),e||(s.setMirrorNeedsRevert(!l),this.receivingContext=o,this.droppableEvent=l)},this.handleDragEnd=t=>{let{receivingContext:e,droppableEvent:n}=this;if(this.clearDrag(),e&&n){let s=this.hitDragging.finalHit,r=s.context.viewApi,o=this.dragMeta;if(e.emitter.trigger("drop",Object.assign(Object.assign({},w(s.dateSpan,e)),{draggedEl:t.subjectEl,jsEvent:t.origEvent,view:r})),o.create){let s=i.eventTupleToStore(n);e.dispatch({type:"MERGE_EVENTS",eventStore:s}),t.isTouch&&e.dispatch({type:"SELECT_EVENT",eventInstanceId:n.instance.instanceId}),e.emitter.trigger("eventReceive",{event:new i.EventImpl(e,n.def,n.instance),relatedEvents:[],revert(){e.dispatch({type:"REMOVE_EVENTS",eventStore:s})},draggedEl:t.subjectEl,view:r})}}this.receivingContext=null,this.droppableEvent=null};let n=this.hitDragging=new f(t,i.interactionSettingsStore);n.requireInitial=!1,n.emitter.on("dragstart",this.handleDragStart),n.emitter.on("hitupdate",this.handleHitUpdate),n.emitter.on("dragend",this.handleDragEnd),this.suppliedDragMeta=e}buildDragMeta(t){return"object"==typeof this.suppliedDragMeta?i.parseDragMeta(this.suppliedDragMeta):"function"==typeof this.suppliedDragMeta?i.parseDragMeta(this.suppliedDragMeta(t)):function(t){let e=function(t,e){let n=i.config.dataAttrPrefix,s=(n?n+"-":"")+e;return t.getAttribute("data-"+s)||""}(t,"event"),n=e?JSON.parse(e):{create:!1};return i.parseDragMeta(n)}(t)}displayDrag(t,e){let i=this.receivingContext;i&&i!==t&&i.dispatch({type:"UNSET_EVENT_DRAG"}),t&&t.dispatch({type:"SET_EVENT_DRAG",state:e})}clearDrag(){this.receivingContext&&this.receivingContext.dispatch({type:"UNSET_EVENT_DRAG"})}canDropElOnCalendar(t,e){let i=e.options.dropAccept;return"function"==typeof i?i.call(e.calendarApi,t):"string"!=typeof i||!i||t.matches(i)}}i.config.dataAttrPrefix="";class P extends i.ElementDragging{constructor(t){super(t),this.shouldIgnoreMove=!1,this.mirrorSelector="",this.currentMirrorEl=null,this.handlePointerDown=t=>{this.emitter.trigger("pointerdown",t),this.shouldIgnoreMove||this.emitter.trigger("dragstart",t)},this.handlePointerMove=t=>{this.shouldIgnoreMove||this.emitter.trigger("dragmove",t)},this.handlePointerUp=t=>{this.emitter.trigger("pointerup",t),this.shouldIgnoreMove||this.emitter.trigger("dragend",t)};let e=this.pointer=new h(t);e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("pointermove",this.handlePointerMove),e.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.pointer.destroy()}cancel(){this.shouldIgnoreMove=!0}setMirrorIsVisible(t){if(t)this.currentMirrorEl&&(this.currentMirrorEl.style.visibility="",this.currentMirrorEl=null);else{let t=this.mirrorSelector?document.querySelector(this.mirrorSelector):null;t&&(this.currentMirrorEl=t,t.style.visibility="hidden")}}}var x=e.createPlugin({name:"@fullcalendar/interaction",componentInteractions:[T,b,M,R],calendarInteractions:[class{constructor(t){this.context=t,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=t=>{t.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=t=>{let e=this.context.options.unselectCancel,n=i.getEventTargetViaRoot(t.origEvent);this.matchesCancel=!!n.closest(e),this.matchesEvent=!!n.closest(M.SELECTOR)},this.onDocumentPointerUp=t=>{let{context:e}=this,{documentPointer:i}=this,n=e.getCurrentData();if(!i.wasTouchScroll){if(n.dateSelection&&!this.isRecentPointerDateSelect){let i=e.options.unselectAuto;!i||i&&this.matchesCancel||e.calendarApi.unselect(t)}n.eventSelection&&!this.matchesEvent&&e.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let e=this.documentPointer=new h(document);e.shouldIgnoreMove=!0,e.shouldWatchScroll=!1,e.emitter.on("pointerdown",this.onDocumentPointerDown),e.emitter.on("pointerup",this.onDocumentPointerUp),t.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}],elementDraggingImpl:m,optionRefiners:{},listenerRefiners:C});return e.globalPlugins.push(x),t.Draggable=class{constructor(t,e={}){this.handlePointerDown=t=>{let{dragging:e}=this,{minDistance:n,longPressDelay:s}=this.settings;e.minDistance=null!=n?n:t.isTouch?0:i.BASE_OPTION_DEFAULTS.eventDragMinDistance,e.delay=t.isTouch?null!=s?s:i.BASE_OPTION_DEFAULTS.longPressDelay:0},this.handleDragStart=t=>{t.isTouch&&this.dragging.delay&&t.subjectEl.classList.contains(r.default.internalEvent)&&this.dragging.mirror.getMirrorEl().classList.add(r.default.internalEventSelected)},this.settings=e;let n=this.dragging=new m(t);n.touchScrollAllowed=!1,null!=e.itemSelector&&(n.pointer.selector=e.itemSelector),null!=e.appendTo&&(n.mirror.parentNode=e.appendTo),n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragstart",this.handleDragStart),new I(n,e.eventData)}destroy(){this.dragging.destroy()}},t.ThirdPartyDraggable=class{constructor(t,e){let i=document;t===document||t instanceof Element?(i=t,e=e||{}):e=t||{};let n=this.dragging=new P(i);"string"==typeof e.itemSelector?n.pointer.selector=e.itemSelector:i===document&&(n.pointer.selector="[data-event]"),"string"==typeof e.mirrorSelector&&(n.mirrorSelector=e.mirrorSelector),new I(n,e.eventData).hitDragging.disablePointCheck=!0}destroy(){this.dragging.destroy()}},t.default=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({},FullCalendar,FullCalendar.Internal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullcalendar/interaction",
3
- "version": "7.0.0-beta.3",
3
+ "version": "7.0.0-beta.5",
4
4
  "title": "FullCalendar Interaction Plugin",
5
5
  "description": "Calendar functionality for event drag-n-drop, event resizing, date clicking, and date selecting",
6
6
  "keywords": [
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "homepage": "https://fullcalendar.io/docs/editable",
16
16
  "peerDependencies": {
17
- "@fullcalendar/core": "7.0.0-beta.3"
17
+ "@fullcalendar/core": "7.0.0-beta.5"
18
18
  },
19
19
  "type": "module",
20
20
  "bugs": "https://fullcalendar.io/reporting-bugs",
@@ -29,21 +29,24 @@
29
29
  "email": "arshaw@arshaw.com",
30
30
  "url": "http://arshaw.com/"
31
31
  },
32
- "copyright": "2024 Adam Shaw",
33
- "types": "./index.d.ts",
34
- "main": "./index.cjs",
35
- "module": "./index.js",
36
- "unpkg": "./index.global.min.js",
37
- "jsdelivr": "./index.global.min.js",
32
+ "copyright": "2025 Adam Shaw",
33
+ "types": "./esm/index.d.ts",
34
+ "module": "./esm/index.js",
35
+ "main": "./cjs/index.cjs",
36
+ "unpkg": "./global.min.js",
37
+ "jsdelivr": "./global.min.js",
38
38
  "exports": {
39
39
  "./package.json": "./package.json",
40
- "./index.cjs": "./index.cjs",
41
- "./index.js": "./index.js",
42
40
  ".": {
43
- "types": "./index.d.ts",
44
- "require": "./index.cjs",
45
- "import": "./index.js"
41
+ "import": {
42
+ "types": "./esm/index.d.ts",
43
+ "default": "./esm/index.js"
44
+ },
45
+ "require": "./cjs/index.cjs"
46
46
  }
47
47
  },
48
- "sideEffects": false
48
+ "sideEffects": [
49
+ "./global.js",
50
+ "./global.min.js"
51
+ ]
49
52
  }