react-timelane 1.2.1 → 1.2.2

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 (139) hide show
  1. package/dist/_virtual/bind-all.js +4 -0
  2. package/dist/_virtual/bind.js +4 -0
  3. package/dist/_virtual/index.js +5 -0
  4. package/dist/_virtual/index2.js +4 -0
  5. package/dist/_virtual/index3.js +5 -0
  6. package/dist/_virtual/index4.js +4 -0
  7. package/dist/_virtual/react-dom.development.js +4 -0
  8. package/dist/_virtual/react-dom.production.js +4 -0
  9. package/dist/components/Timelane/Timelane.css +1 -0
  10. package/dist/components/Timelane/Timelane.js +53 -0
  11. package/dist/components/TimelaneAllocation/TimelaneAllocation.js +49 -0
  12. package/dist/components/TimelaneAside/TimelaneAside.js +60 -0
  13. package/dist/components/TimelaneBackground/TimelaneBackground.js +46 -0
  14. package/dist/components/TimelaneBody/TimelaneBody.js +13 -0
  15. package/dist/components/TimelaneBody/TimelaneSelectionLayer.js +96 -0
  16. package/dist/components/TimelaneHeader/DaysHeader.js +30 -0
  17. package/dist/components/TimelaneHeader/MonthsHeader.js +38 -0
  18. package/dist/components/TimelaneHeader/TimelaneHeader.js +55 -0
  19. package/dist/components/TimelaneHeader/WeeksHeader.js +39 -0
  20. package/dist/components/TimelaneHeader/renderingUtils.js +26 -0
  21. package/dist/components/TimelaneItem/DragResizeComponent.js +125 -0
  22. package/dist/components/TimelaneItem/TimelaneItem.js +42 -0
  23. package/dist/components/TimelaneLane/DropPreview.js +25 -0
  24. package/dist/components/TimelaneLane/DropTarget.js +57 -0
  25. package/dist/components/TimelaneLane/OverlapIndicator.js +21 -0
  26. package/dist/components/TimelaneLane/TimelaneLane.js +164 -0
  27. package/dist/components/TimelaneLayout/TimelaneLayout.js +77 -0
  28. package/dist/components/TimelaneLayout/layout.css +1 -0
  29. package/dist/components/TimelaneSettingsProvider/TimelaneSettingsContext.js +21 -0
  30. package/dist/components/TimelaneSettingsProvider/TimelaneSettingsProvider.js +15 -0
  31. package/dist/components/utils.js +243 -0
  32. package/dist/hooks/useScroll.js +47 -0
  33. package/dist/hooks/useTimelaneContext.js +6 -0
  34. package/dist/index.js +36 -0
  35. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js +4 -0
  36. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js +127 -0
  37. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js +9 -0
  38. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js +4 -0
  39. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js +7 -0
  40. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js +226 -0
  41. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js +107 -0
  42. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js +195 -0
  43. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js +21 -0
  44. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js +43 -0
  45. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js +253 -0
  46. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js +121 -0
  47. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js +12 -0
  48. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js +17 -0
  49. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js +9 -0
  50. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js +8 -0
  51. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js +57 -0
  52. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js +9 -0
  53. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js +13 -0
  54. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js +47 -0
  55. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js +17 -0
  56. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js +7 -0
  57. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js +10 -0
  58. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js +4 -0
  59. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js +4 -0
  60. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js +4 -0
  61. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
  62. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +6 -0
  63. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
  64. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
  65. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
  66. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +21 -0
  67. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +7 -0
  68. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +7 -0
  69. package/dist/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +10 -0
  70. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
  71. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
  72. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
  73. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
  74. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
  75. package/dist/node_modules/bind-event-listener/dist/bind-all.js +45 -0
  76. package/dist/node_modules/bind-event-listener/dist/bind.js +16 -0
  77. package/dist/node_modules/bind-event-listener/dist/index.js +20 -0
  78. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  79. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  80. package/dist/node_modules/date-fns/_lib/format/formatters.js +583 -0
  81. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
  82. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
  83. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  84. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  85. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  86. package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
  87. package/dist/node_modules/date-fns/addDays.js +10 -0
  88. package/dist/node_modules/date-fns/addWeeks.js +8 -0
  89. package/dist/node_modules/date-fns/constants.js +6 -0
  90. package/dist/node_modules/date-fns/constructFrom.js +8 -0
  91. package/dist/node_modules/date-fns/differenceInCalendarDays.js +16 -0
  92. package/dist/node_modules/date-fns/eachDayOfInterval.js +17 -0
  93. package/dist/node_modules/date-fns/eachMonthOfInterval.js +17 -0
  94. package/dist/node_modules/date-fns/eachWeekOfInterval.js +22 -0
  95. package/dist/node_modules/date-fns/format.js +59 -0
  96. package/dist/node_modules/date-fns/getDay.js +8 -0
  97. package/dist/node_modules/date-fns/getDayOfYear.js +11 -0
  98. package/dist/node_modules/date-fns/getISOWeek.js +12 -0
  99. package/dist/node_modules/date-fns/getISOWeekYear.js +15 -0
  100. package/dist/node_modules/date-fns/getWeek.js +12 -0
  101. package/dist/node_modules/date-fns/getWeekYear.js +17 -0
  102. package/dist/node_modules/date-fns/isDate.js +7 -0
  103. package/dist/node_modules/date-fns/isSameDay.js +14 -0
  104. package/dist/node_modules/date-fns/isSunday.js +8 -0
  105. package/dist/node_modules/date-fns/isValid.js +9 -0
  106. package/dist/node_modules/date-fns/lastDayOfMonth.js +9 -0
  107. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  108. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  109. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  110. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  111. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  112. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  113. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  114. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  115. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  116. package/dist/node_modules/date-fns/locale/en-US.js +21 -0
  117. package/dist/node_modules/date-fns/max.js +14 -0
  118. package/dist/node_modules/date-fns/min.js +14 -0
  119. package/dist/node_modules/date-fns/nextDay.js +10 -0
  120. package/dist/node_modules/date-fns/nextSunday.js +8 -0
  121. package/dist/node_modules/date-fns/setHours.js +9 -0
  122. package/dist/node_modules/date-fns/startOfDay.js +9 -0
  123. package/dist/node_modules/date-fns/startOfISOWeek.js +8 -0
  124. package/dist/node_modules/date-fns/startOfISOWeekYear.js +11 -0
  125. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  126. package/dist/node_modules/date-fns/startOfWeekYear.js +13 -0
  127. package/dist/node_modules/date-fns/startOfYear.js +9 -0
  128. package/dist/node_modules/date-fns/toDate.js +8 -0
  129. package/dist/node_modules/raf-schd/dist/raf-schd.esm.js +15 -0
  130. package/dist/node_modules/re-resizable/lib/index.js +424 -0
  131. package/dist/node_modules/re-resizable/lib/resizer.js +49 -0
  132. package/dist/node_modules/react-dom/cjs/react-dom.development.js +227 -0
  133. package/dist/node_modules/react-dom/cjs/react-dom.production.js +147 -0
  134. package/dist/node_modules/react-dom/index.js +23 -0
  135. package/dist/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +12 -0
  136. package/dist/types/Item.js +6 -0
  137. package/package.json +10 -7
  138. package/dist/react-timelane.css +0 -1
  139. package/dist/react-timelane.js +0 -4754
@@ -0,0 +1,243 @@
1
+ import { differenceInCalendarDays as p } from "../node_modules/date-fns/differenceInCalendarDays.js";
2
+ import { setHours as y } from "../node_modules/date-fns/setHours.js";
3
+ import { addDays as g } from "../node_modules/date-fns/addDays.js";
4
+ import { max as m } from "../node_modules/date-fns/max.js";
5
+ import { min as w } from "../node_modules/date-fns/min.js";
6
+ function D(e, t, n) {
7
+ const r = v(e, t, n), o = M(e, t);
8
+ return { width: r, height: o };
9
+ }
10
+ function M(e, t) {
11
+ return t.pixelsPerLane;
12
+ }
13
+ function v(e, t, n) {
14
+ return Math.abs(
15
+ (p(n.end, n.start) + 1) * t.pixelsPerDay
16
+ );
17
+ }
18
+ function P(e, t, n, r) {
19
+ const o = x(e, t, r), i = O(e, t, n.start, r);
20
+ return {
21
+ ...o,
22
+ ...i
23
+ };
24
+ }
25
+ function x(e, t, n) {
26
+ const r = p(e.end, e.start) * n.pixelsPerDay, o = e.size / t.capacity * n.pixelsPerLane;
27
+ return { width: r, height: o };
28
+ }
29
+ function T(e, t, n) {
30
+ return p(e, t) * n.pixelsPerDay + n.pixelsPerDay / 2;
31
+ }
32
+ function z(e, t, n) {
33
+ return e / t * n.pixelsPerLane;
34
+ }
35
+ function O(e, t, n, r) {
36
+ const o = T(e.start, n, r), i = z(e.offset, t.capacity, r);
37
+ return { x: o, y: i };
38
+ }
39
+ function q(e, t) {
40
+ const n = e.element.getBoundingClientRect(), r = {
41
+ x: n.x - t.initial.input.pageX,
42
+ y: n.y - t.initial.input.pageY
43
+ }, o = {
44
+ x: r.x / n.width,
45
+ y: r.y / n.height
46
+ };
47
+ return {
48
+ absolute: r,
49
+ relative: o
50
+ };
51
+ }
52
+ function E(e, t, n, r, o) {
53
+ return {
54
+ id: e.id,
55
+ laneId: t.id,
56
+ start: y(
57
+ g(o.start, Math.floor(n.x / r.pixelsPerDay)),
58
+ 12
59
+ ),
60
+ end: y(
61
+ g(
62
+ o.start,
63
+ Math.floor(
64
+ (n.x + n.width) / r.pixelsPerDay
65
+ )
66
+ ),
67
+ 12
68
+ ),
69
+ offset: Math.floor(
70
+ n.y / r.pixelsPerLane * t.capacity
71
+ ),
72
+ size: Math.floor(
73
+ n.height / r.pixelsPerLane * t.capacity
74
+ ),
75
+ payload: e.payload
76
+ };
77
+ }
78
+ function F(e, t, n, r, o, i, a, u, l) {
79
+ if (r === null)
80
+ return null;
81
+ const h = D(
82
+ e,
83
+ i,
84
+ u
85
+ ), s = t.filter((c) => c.id !== n.id).map((c) => P(c, e, u, i));
86
+ let f = null;
87
+ return f = C(
88
+ e,
89
+ n,
90
+ o,
91
+ i,
92
+ r
93
+ ), f = A(f, a), f = I(
94
+ f,
95
+ h
96
+ ), f = B(
97
+ f,
98
+ s,
99
+ h,
100
+ l
101
+ ), f;
102
+ }
103
+ function C(e, t, n, r, o) {
104
+ const { width: i, height: a } = x(t, e, r), u = o.x + i * n.relative.x, l = o.y + a * n.relative.y;
105
+ return {
106
+ x: u,
107
+ y: l,
108
+ width: i,
109
+ height: a
110
+ };
111
+ }
112
+ function I(e, t) {
113
+ const n = Math.max(
114
+ 0,
115
+ Math.min(e.x, t.width - e.width)
116
+ ), r = Math.max(
117
+ 0,
118
+ Math.min(e.y, t.height - e.height)
119
+ );
120
+ return {
121
+ ...e,
122
+ x: n,
123
+ y: r
124
+ };
125
+ }
126
+ function A(e, t) {
127
+ const n = {
128
+ ...e
129
+ };
130
+ return t && t.x && (n.x = d(n.x, t.x, t.offsetX || 0)), t && t.y && (n.y = d(n.y, t.y, t.offsetY || 0)), n;
131
+ }
132
+ function d(e, t, n) {
133
+ return Math.max(
134
+ n,
135
+ n + Math.round((e - n) / t) * t
136
+ );
137
+ }
138
+ function B(e, t, n, r) {
139
+ const o = {
140
+ ...e
141
+ };
142
+ if (!r) {
143
+ let i = !0;
144
+ for (; i; ) {
145
+ const a = t.find((u) => X(o, u));
146
+ a !== void 0 ? o.y = a.y + a.height : i = !1;
147
+ }
148
+ }
149
+ return G(o, n) ? o : null;
150
+ }
151
+ function X(e, t) {
152
+ return !(e.x >= t.x + t.width || t.x >= e.x + e.width || e.y >= t.y + t.height || t.y >= e.y + e.height);
153
+ }
154
+ function J(e, t) {
155
+ const n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), o = Math.min(e.x + e.width, t.x + t.width), i = Math.min(e.y + e.height, t.y + t.height);
156
+ return n < o && r < i ? {
157
+ x: n,
158
+ y: r,
159
+ width: o - n,
160
+ height: i - r
161
+ } : null;
162
+ }
163
+ function Y(e, t) {
164
+ return !(e.start >= t.end || t.start >= e.end || e.offset >= t.offset + t.size || t.offset >= e.offset + e.size);
165
+ }
166
+ function G(e, t) {
167
+ return e.x >= 0 && e.y >= 0 && e.x + e.width <= t.width && e.y + e.height <= t.height;
168
+ }
169
+ function K(e, t, n, r, o) {
170
+ const i = L(
171
+ e,
172
+ t,
173
+ n.capacity,
174
+ r
175
+ );
176
+ if (i) {
177
+ const a = R(
178
+ e,
179
+ o.start,
180
+ o.end,
181
+ r,
182
+ i
183
+ );
184
+ if (a)
185
+ return {
186
+ start: a.lower,
187
+ end: a.upper,
188
+ minOffset: i.lower,
189
+ maxOffset: i.upper
190
+ };
191
+ }
192
+ return null;
193
+ }
194
+ function L(e, t, n, r) {
195
+ const o = r.filter((s) => s.start <= e && s.end >= e);
196
+ if (o.find(
197
+ (s) => s.offset <= t && s.offset + s.size >= t
198
+ ))
199
+ return null;
200
+ const a = o.filter((s) => s.offset + s.size <= t), u = o.filter((s) => s.offset >= t), l = a.length > 0 ? Math.max(...a.map((s) => s.offset + s.size)) : 0, h = u.length > 0 ? Math.min(...u.map((s) => s.offset)) : n;
201
+ return {
202
+ lower: l,
203
+ upper: h
204
+ };
205
+ }
206
+ function R(e, t, n, r, o) {
207
+ const i = {
208
+ start: t,
209
+ end: n,
210
+ offset: o.lower,
211
+ size: o.upper - o.lower
212
+ }, a = r.filter(
213
+ (f) => Y(f, i)
214
+ );
215
+ if (a.length === 0)
216
+ return {
217
+ lower: t,
218
+ upper: n
219
+ };
220
+ const u = a.filter((f) => f.end <= e), l = a.filter((f) => f.start >= e), h = u.length > 0 ? m(u.map((f) => f.end)) : t, s = l.length > 0 ? w(l.map((f) => f.start)) : n;
221
+ return {
222
+ lower: h,
223
+ upper: s
224
+ };
225
+ }
226
+ export {
227
+ T as dateToPixel,
228
+ X as doOverlap,
229
+ K as getAvailableSpace,
230
+ F as getDropPreviewRectangle,
231
+ D as getDropTargetDimensions,
232
+ M as getDropTargetHeight,
233
+ v as getDropTargetWidth,
234
+ q as getGrabPosition,
235
+ x as getItemDimensions,
236
+ O as getItemPosition,
237
+ P as getItemRectangle,
238
+ J as getOverlap,
239
+ E as getUpdatedItem,
240
+ G as isWithinTargetDimensions,
241
+ Y as itemsDoOverlap,
242
+ z as offsetToPixel
243
+ };
@@ -0,0 +1,47 @@
1
+ import { dateToPixel as m } from "../components/utils.js";
2
+ import { useTimelaneContext as s } from "./useTimelaneContext.js";
3
+ const u = () => {
4
+ const { settings: t } = s();
5
+ function c(e) {
6
+ e instanceof Object ? (e.horz !== void 0 && n(e.horz), e.vert !== void 0 && r(e.vert)) : l(e);
7
+ }
8
+ function n(e) {
9
+ window.requestAnimationFrame(() => {
10
+ const o = document.getElementById(
11
+ "timelane-background-date-anchor"
12
+ );
13
+ if (o) {
14
+ const i = m(e, t.start, t);
15
+ o.style.setProperty("left", `${i}px`), o.scrollIntoView({
16
+ block: "nearest",
17
+ inline: "center",
18
+ behavior: "smooth"
19
+ });
20
+ }
21
+ });
22
+ }
23
+ function r(e) {
24
+ window.requestAnimationFrame(() => {
25
+ const o = document.getElementById(
26
+ `timelane-lane-${e}`
27
+ );
28
+ o && o.scrollIntoView({ block: "center", behavior: "smooth" });
29
+ });
30
+ }
31
+ function l(e) {
32
+ window.requestAnimationFrame(() => {
33
+ const o = document.getElementById(
34
+ `timelane-item-${e}`
35
+ );
36
+ o && o.scrollIntoView({
37
+ block: "center",
38
+ inline: "center",
39
+ behavior: "smooth"
40
+ });
41
+ });
42
+ }
43
+ return { scrollTo: c, scrollToDate: n, scrollToItem: l, scrollToLane: r };
44
+ };
45
+ export {
46
+ u as useScroll
47
+ };
@@ -0,0 +1,6 @@
1
+ import { useContext as t } from "react";
2
+ import { TimelaneSettingsContext as e } from "../components/TimelaneSettingsProvider/TimelaneSettingsContext.js";
3
+ const r = () => t(e);
4
+ export {
5
+ r as useTimelaneContext
6
+ };
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ import { Timelane as o } from "./components/Timelane/Timelane.js";
2
+ import { TimelaneLayout as t } from "./components/TimelaneLayout/TimelaneLayout.js";
3
+ import { TimelaneAside as n } from "./components/TimelaneAside/TimelaneAside.js";
4
+ import { TimelaneBackground as f } from "./components/TimelaneBackground/TimelaneBackground.js";
5
+ import { TimelaneLane as i } from "./components/TimelaneLane/TimelaneLane.js";
6
+ import { TimelaneBody as l } from "./components/TimelaneBody/TimelaneBody.js";
7
+ import { TimelaneSettingsProvider as s } from "./components/TimelaneSettingsProvider/TimelaneSettingsProvider.js";
8
+ import { TimelaneAllocation as u } from "./components/TimelaneAllocation/TimelaneAllocation.js";
9
+ import { useScroll as c } from "./hooks/useScroll.js";
10
+ import { useTimelaneContext as g } from "./hooks/useTimelaneContext.js";
11
+ import { DaysHeader as A } from "./components/TimelaneHeader/DaysHeader.js";
12
+ import { WeeksHeader as D } from "./components/TimelaneHeader/WeeksHeader.js";
13
+ import { MonthsHeader as M } from "./components/TimelaneHeader/MonthsHeader.js";
14
+ import { TimelaneHeader as W } from "./components/TimelaneHeader/TimelaneHeader.js";
15
+ import { renderDayHeader as C, renderMonthHeader as I, renderWeekHeader as P } from "./components/TimelaneHeader/renderingUtils.js";
16
+ import { isItem as j } from "./types/Item.js";
17
+ export {
18
+ A as DaysHeader,
19
+ M as MonthsHeader,
20
+ o as Timelane,
21
+ u as TimelaneAllocation,
22
+ n as TimelaneAside,
23
+ f as TimelaneBackground,
24
+ l as TimelaneBody,
25
+ W as TimelaneHeader,
26
+ i as TimelaneLane,
27
+ t as TimelaneLayout,
28
+ s as TimelaneSettingsProvider,
29
+ D as WeeksHeader,
30
+ j as isItem,
31
+ C as renderDayHeader,
32
+ I as renderMonthHeader,
33
+ P as renderWeekHeader,
34
+ c as useScroll,
35
+ g as useTimelaneContext
36
+ };
@@ -0,0 +1,4 @@
1
+ var a = "application/vnd.pdnd";
2
+ export {
3
+ a as elementAdapterNativeDataKey
4
+ };
@@ -0,0 +1,127 @@
1
+ import P from "../../../../../@babel/runtime/helpers/esm/slicedToArray.js";
2
+ import { d as k } from "../../../../../../_virtual/index.js";
3
+ import { getElementFromPointWithoutHoneypot as _ } from "../honey-pot-fix/get-element-from-point-without-honey-pot.js";
4
+ import { makeHoneyPotFix as w } from "../honey-pot-fix/make-honey-pot-fix.js";
5
+ import { makeAdapter as A } from "../make-adapter/make-adapter.js";
6
+ import { combine as H } from "../public-utils/combine.js";
7
+ import { once as R } from "../public-utils/once.js";
8
+ import { addAttribute as $ } from "../util/add-attribute.js";
9
+ import { isAndroid as M, androidFallbackText as O } from "../util/android.js";
10
+ import { getInput as S } from "../util/get-input.js";
11
+ import { textMediaType as h } from "../util/media-types/text-media-type.js";
12
+ import { URLMediaType as V } from "../util/media-types/url-media-type.js";
13
+ import { elementAdapterNativeDataKey as K } from "./element-adapter-native-data-key.js";
14
+ var i = /* @__PURE__ */ new WeakMap();
15
+ function L(t) {
16
+ return i.set(t.element, t), function() {
17
+ i.delete(t.element);
18
+ };
19
+ }
20
+ var b = w(), v = A({
21
+ typeKey: "element",
22
+ defaultDropEffect: "move",
23
+ mount: function(r) {
24
+ return H(b.bindEvents(), k.bind(document, {
25
+ type: "dragstart",
26
+ listener: function(e) {
27
+ var l, o, d, u, m, s;
28
+ if (r.canStart(e) && !e.defaultPrevented) {
29
+ if (!e.dataTransfer) {
30
+ process.env.NODE_ENV !== "production" && console.warn(`
31
+ It appears as though you have are not testing DragEvents correctly.
32
+
33
+ - If you are unit testing, ensure you have polyfilled DragEvent.
34
+ - If you are browser testing, ensure you are dispatching drag events correctly.
35
+
36
+ Please see our testing guides for more information:
37
+ https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
38
+ `.replace(/ {2}/g, ""));
39
+ return;
40
+ }
41
+ var y = e.target;
42
+ if (!(y instanceof HTMLElement))
43
+ return null;
44
+ var a = i.get(y);
45
+ if (!a)
46
+ return null;
47
+ var g = S(e), p = {
48
+ element: a.element,
49
+ dragHandle: (l = a.dragHandle) !== null && l !== void 0 ? l : null,
50
+ input: g
51
+ };
52
+ if (a.canDrag && !a.canDrag(p))
53
+ return e.preventDefault(), null;
54
+ if (a.dragHandle) {
55
+ var I = _({
56
+ x: g.clientX,
57
+ y: g.clientY
58
+ });
59
+ if (!a.dragHandle.contains(I))
60
+ return e.preventDefault(), null;
61
+ }
62
+ var D = (o = (d = a.getInitialDataForExternal) === null || d === void 0 ? void 0 : d.call(a, p)) !== null && o !== void 0 ? o : null;
63
+ if (D)
64
+ for (var c = 0, E = Object.entries(D); c < E.length; c++) {
65
+ var T = P(E[c], 2), N = T[0], f = T[1];
66
+ e.dataTransfer.setData(N, f ?? "");
67
+ }
68
+ M() && !e.dataTransfer.types.includes(h) && !e.dataTransfer.types.includes(V) && e.dataTransfer.setData(h, O), e.dataTransfer.setData(K, "");
69
+ var x = {
70
+ element: a.element,
71
+ dragHandle: (u = a.dragHandle) !== null && u !== void 0 ? u : null,
72
+ data: (m = (s = a.getInitialData) === null || s === void 0 ? void 0 : s.call(a, p)) !== null && m !== void 0 ? m : {}
73
+ }, F = {
74
+ type: "element",
75
+ payload: x,
76
+ startedFrom: "internal"
77
+ };
78
+ r.start({
79
+ event: e,
80
+ dragType: F
81
+ });
82
+ }
83
+ }
84
+ }));
85
+ },
86
+ dispatchEventToSource: function(r) {
87
+ var n, e, l = r.eventName, o = r.payload;
88
+ (n = i.get(o.source.element)) === null || n === void 0 || (e = n[l]) === null || e === void 0 || e.call(
89
+ n,
90
+ // I cannot seem to get the types right here.
91
+ // TS doesn't seem to like that one event can need `nativeSetDragImage`
92
+ // @ts-expect-error
93
+ o
94
+ );
95
+ },
96
+ onPostDispatch: b.getOnPostDispatch()
97
+ }), ee = v.dropTarget, te = v.monitor;
98
+ function ae(t) {
99
+ if (process.env.NODE_ENV !== "production" && t.dragHandle && !t.element.contains(t.dragHandle) && console.warn("Drag handle element must be contained in draggable element", {
100
+ element: t.element,
101
+ dragHandle: t.dragHandle
102
+ }), process.env.NODE_ENV !== "production") {
103
+ var r = i.get(t.element);
104
+ r && console.warn("You have already registered a `draggable` on the same element", {
105
+ existing: r,
106
+ proposed: t
107
+ });
108
+ }
109
+ var n = H(
110
+ // making the draggable register the adapter rather than drop targets
111
+ // this is because you *must* have a draggable element to start a drag
112
+ // but you _might_ not have any drop targets immediately
113
+ // (You might create drop targets async)
114
+ v.registerUsage(),
115
+ L(t),
116
+ $(t.element, {
117
+ attribute: "draggable",
118
+ value: "true"
119
+ })
120
+ );
121
+ return R(n);
122
+ }
123
+ export {
124
+ ae as draggable,
125
+ ee as dropTargetForElements,
126
+ te as monitorForElements
127
+ };
@@ -0,0 +1,9 @@
1
+ import m from "../../../../../@babel/runtime/helpers/esm/slicedToArray.js";
2
+ import { isHoneyPotElement as l } from "./is-honey-pot-element.js";
3
+ function d(t) {
4
+ var r = document.elementsFromPoint(t.x, t.y), n = m(r, 2), e = n[0], o = n[1];
5
+ return e ? l(e) ? o ?? null : e : null;
6
+ }
7
+ export {
8
+ d as getElementFromPointWithoutHoneypot
9
+ };
@@ -0,0 +1,4 @@
1
+ var t = "data-pdnd-honey-pot";
2
+ export {
3
+ t as honeyPotDataAttribute
4
+ };
@@ -0,0 +1,7 @@
1
+ import { honeyPotDataAttribute as e } from "./honey-pot-data-attribute.js";
2
+ function o(t) {
3
+ return t instanceof Element && t.hasAttribute(e);
4
+ }
5
+ export {
6
+ o as isHoneyPotElement
7
+ };