@object-ui/plugin-kanban 3.1.1 → 3.1.3
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.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +18 -0
- package/dist/{KanbanEnhanced-CXDSLlGR.js → KanbanEnhanced-DbOkJkpo.js} +357 -316
- package/dist/{KanbanImpl-4dgoNPtI.js → KanbanImpl-BnNosFpy.js} +1 -1
- package/dist/{index-CyNcIIS1.js → index-DP2mI15e.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +4 -4
- package/package.json +8 -8
- package/src/ObjectKanban.msw.test.tsx +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as U, j as a, C as
|
|
2
|
-
import * as
|
|
1
|
+
import { c as U, j as a, C as J, P as Q } from "./index-DP2mI15e.js";
|
|
2
|
+
import * as g from "react";
|
|
3
3
|
import { flushSync as Z } from "react-dom";
|
|
4
|
-
import { u as ee, a as te, D as se, c as ne, b as ie, d as re, P as oe, e as
|
|
5
|
-
import { Button as
|
|
4
|
+
import { u as ee, a as te, D as se, c as ne, b as ie, d as re, P as oe, e as X, S as le, v as ae, C as ce } from "./sortable.esm-CNNHgHk5.js";
|
|
5
|
+
import { Button as Y, Badge as L, Card as he, CardHeader as de, CardTitle as ue, CardDescription as fe, CardContent as me, Input as ge } from "@object-ui/components";
|
|
6
6
|
const pe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ve = U("chevron-right", pe);
|
|
7
7
|
const xe = [
|
|
8
8
|
[
|
|
@@ -15,117 +15,117 @@ const xe = [
|
|
|
15
15
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
16
16
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
17
17
|
], be = U("triangle-alert", xe);
|
|
18
|
-
function
|
|
19
|
-
let s = e.initialDeps ?? [], t,
|
|
18
|
+
function _(i, l, e) {
|
|
19
|
+
let s = e.initialDeps ?? [], t, n = !0;
|
|
20
20
|
function o() {
|
|
21
|
-
var r,
|
|
21
|
+
var r, h, d;
|
|
22
22
|
let u;
|
|
23
23
|
e.key && ((r = e.debug) != null && r.call(e)) && (u = Date.now());
|
|
24
|
-
const m =
|
|
25
|
-
if (!(m.length !== s.length || m.some((
|
|
24
|
+
const m = i();
|
|
25
|
+
if (!(m.length !== s.length || m.some((E, x) => s[x] !== E)))
|
|
26
26
|
return t;
|
|
27
27
|
s = m;
|
|
28
|
-
let
|
|
29
|
-
if (e.key && ((
|
|
30
|
-
const
|
|
31
|
-
for (
|
|
32
|
-
|
|
33
|
-
return
|
|
28
|
+
let v;
|
|
29
|
+
if (e.key && ((h = e.debug) != null && h.call(e)) && (v = Date.now()), t = l(...m), e.key && ((d = e.debug) != null && d.call(e))) {
|
|
30
|
+
const E = Math.round((Date.now() - u) * 100) / 100, x = Math.round((Date.now() - v) * 100) / 100, y = x / 16, O = (S, R) => {
|
|
31
|
+
for (S = String(S); S.length < R; )
|
|
32
|
+
S = " " + S;
|
|
33
|
+
return S;
|
|
34
34
|
};
|
|
35
35
|
console.info(
|
|
36
|
-
`%c⏱ ${
|
|
36
|
+
`%c⏱ ${O(x, 5)} /${O(E, 5)} ms`,
|
|
37
37
|
`
|
|
38
38
|
font-size: .6rem;
|
|
39
39
|
font-weight: bold;
|
|
40
40
|
color: hsl(${Math.max(
|
|
41
41
|
0,
|
|
42
|
-
Math.min(120 - 120 *
|
|
42
|
+
Math.min(120 - 120 * y, 120)
|
|
43
43
|
)}deg 100% 31%);`,
|
|
44
44
|
e?.key
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
return e?.onChange && !(
|
|
47
|
+
return e?.onChange && !(n && e.skipInitialOnChange) && e.onChange(t), n = !1, t;
|
|
48
48
|
}
|
|
49
49
|
return o.updateDeps = (r) => {
|
|
50
50
|
s = r;
|
|
51
51
|
}, o;
|
|
52
52
|
}
|
|
53
|
-
function P(
|
|
54
|
-
if (
|
|
53
|
+
function P(i, l) {
|
|
54
|
+
if (i === void 0)
|
|
55
55
|
throw new Error("Unexpected undefined");
|
|
56
|
-
return
|
|
56
|
+
return i;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const Se = (i, l) => Math.abs(i - l) < 1.01, Ce = (i, l, e) => {
|
|
59
59
|
let s;
|
|
60
60
|
return function(...t) {
|
|
61
|
-
|
|
61
|
+
i.clearTimeout(s), s = i.setTimeout(() => l.apply(this, t), e);
|
|
62
62
|
};
|
|
63
|
-
}, H = (
|
|
64
|
-
const { offsetWidth: l, offsetHeight: e } =
|
|
63
|
+
}, H = (i) => {
|
|
64
|
+
const { offsetWidth: l, offsetHeight: e } = i;
|
|
65
65
|
return { width: l, height: e };
|
|
66
|
-
}, we = (
|
|
67
|
-
const l = Math.max(
|
|
66
|
+
}, we = (i) => i, Ee = (i) => {
|
|
67
|
+
const l = Math.max(i.startIndex - i.overscan, 0), e = Math.min(i.endIndex + i.overscan, i.count - 1), s = [];
|
|
68
68
|
for (let t = l; t <= e; t++)
|
|
69
69
|
s.push(t);
|
|
70
70
|
return s;
|
|
71
|
-
},
|
|
72
|
-
const e =
|
|
71
|
+
}, ye = (i, l) => {
|
|
72
|
+
const e = i.scrollElement;
|
|
73
73
|
if (!e)
|
|
74
74
|
return;
|
|
75
|
-
const s =
|
|
75
|
+
const s = i.targetWindow;
|
|
76
76
|
if (!s)
|
|
77
77
|
return;
|
|
78
78
|
const t = (o) => {
|
|
79
|
-
const { width: r, height:
|
|
80
|
-
l({ width: Math.round(r), height: Math.round(
|
|
79
|
+
const { width: r, height: h } = o;
|
|
80
|
+
l({ width: Math.round(r), height: Math.round(h) });
|
|
81
81
|
};
|
|
82
82
|
if (t(H(e)), !s.ResizeObserver)
|
|
83
83
|
return () => {
|
|
84
84
|
};
|
|
85
|
-
const
|
|
85
|
+
const n = new s.ResizeObserver((o) => {
|
|
86
86
|
const r = () => {
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
t({ width:
|
|
87
|
+
const h = o[0];
|
|
88
|
+
if (h?.borderBoxSize) {
|
|
89
|
+
const d = h.borderBoxSize[0];
|
|
90
|
+
if (d) {
|
|
91
|
+
t({ width: d.inlineSize, height: d.blockSize });
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
t(H(e));
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
i.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
|
|
98
98
|
});
|
|
99
|
-
return
|
|
100
|
-
|
|
99
|
+
return n.observe(e, { box: "border-box" }), () => {
|
|
100
|
+
n.unobserve(e);
|
|
101
101
|
};
|
|
102
102
|
}, $ = {
|
|
103
103
|
passive: !0
|
|
104
|
-
}, q = typeof window > "u" ? !0 : "onscrollend" in window, Ie = (
|
|
105
|
-
const e =
|
|
104
|
+
}, q = typeof window > "u" ? !0 : "onscrollend" in window, Ie = (i, l) => {
|
|
105
|
+
const e = i.scrollElement;
|
|
106
106
|
if (!e)
|
|
107
107
|
return;
|
|
108
|
-
const s =
|
|
108
|
+
const s = i.targetWindow;
|
|
109
109
|
if (!s)
|
|
110
110
|
return;
|
|
111
111
|
let t = 0;
|
|
112
|
-
const
|
|
113
|
-
} :
|
|
112
|
+
const n = i.options.useScrollendEvent && q ? () => {
|
|
113
|
+
} : Ce(
|
|
114
114
|
s,
|
|
115
115
|
() => {
|
|
116
116
|
l(t, !1);
|
|
117
117
|
},
|
|
118
|
-
|
|
118
|
+
i.options.isScrollingResetDelay
|
|
119
119
|
), o = (u) => () => {
|
|
120
|
-
const { horizontal: m, isRtl: c } =
|
|
121
|
-
t = m ? e.scrollLeft * (c && -1 || 1) : e.scrollTop,
|
|
122
|
-
}, r = o(!0),
|
|
120
|
+
const { horizontal: m, isRtl: c } = i.options;
|
|
121
|
+
t = m ? e.scrollLeft * (c && -1 || 1) : e.scrollTop, n(), l(t, u);
|
|
122
|
+
}, r = o(!0), h = o(!1);
|
|
123
123
|
e.addEventListener("scroll", r, $);
|
|
124
|
-
const
|
|
125
|
-
return
|
|
126
|
-
e.removeEventListener("scroll", r),
|
|
124
|
+
const d = i.options.useScrollendEvent && q;
|
|
125
|
+
return d && e.addEventListener("scrollend", h, $), () => {
|
|
126
|
+
e.removeEventListener("scroll", r), d && e.removeEventListener("scrollend", h);
|
|
127
127
|
};
|
|
128
|
-
},
|
|
128
|
+
}, Oe = (i, l, e) => {
|
|
129
129
|
if (l?.borderBoxSize) {
|
|
130
130
|
const s = l.borderBoxSize[0];
|
|
131
131
|
if (s)
|
|
@@ -133,26 +133,29 @@ const Ce = (n, l) => Math.abs(n - l) < 1.01, ye = (n, l, e) => {
|
|
|
133
133
|
s[e.options.horizontal ? "inlineSize" : "blockSize"]
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
|
-
return
|
|
137
|
-
}, Me = (
|
|
136
|
+
return i[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
137
|
+
}, Me = (i, {
|
|
138
138
|
adjustments: l = 0,
|
|
139
139
|
behavior: e
|
|
140
140
|
}, s) => {
|
|
141
|
-
var t,
|
|
142
|
-
const o =
|
|
143
|
-
(
|
|
141
|
+
var t, n;
|
|
142
|
+
const o = i + l;
|
|
143
|
+
(n = (t = s.scrollElement) == null ? void 0 : t.scrollTo) == null || n.call(t, {
|
|
144
144
|
[s.options.horizontal ? "left" : "top"]: o,
|
|
145
145
|
behavior: e
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
|
-
class
|
|
148
|
+
class ze {
|
|
149
149
|
constructor(l) {
|
|
150
|
-
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.
|
|
150
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
151
|
+
var e, s, t;
|
|
152
|
+
return ((t = (s = (e = this.targetWindow) == null ? void 0 : e.performance) == null ? void 0 : s.now) == null ? void 0 : t.call(s)) ?? Date.now();
|
|
153
|
+
}, this.observer = /* @__PURE__ */ (() => {
|
|
151
154
|
let e = null;
|
|
152
155
|
const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
|
|
153
|
-
t.forEach((
|
|
156
|
+
t.forEach((n) => {
|
|
154
157
|
const o = () => {
|
|
155
|
-
this._measureElement(
|
|
158
|
+
this._measureElement(n.target, n);
|
|
156
159
|
};
|
|
157
160
|
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
158
161
|
});
|
|
@@ -163,12 +166,12 @@ class Oe {
|
|
|
163
166
|
(t = s()) == null || t.disconnect(), e = null;
|
|
164
167
|
},
|
|
165
168
|
observe: (t) => {
|
|
166
|
-
var
|
|
167
|
-
return (
|
|
169
|
+
var n;
|
|
170
|
+
return (n = s()) == null ? void 0 : n.observe(t, { box: "border-box" });
|
|
168
171
|
},
|
|
169
172
|
unobserve: (t) => {
|
|
170
|
-
var
|
|
171
|
-
return (
|
|
173
|
+
var n;
|
|
174
|
+
return (n = s()) == null ? void 0 : n.unobserve(t);
|
|
172
175
|
}
|
|
173
176
|
};
|
|
174
177
|
})(), this.range = null, this.setOptions = (e) => {
|
|
@@ -184,10 +187,10 @@ class Oe {
|
|
|
184
187
|
scrollPaddingEnd: 0,
|
|
185
188
|
horizontal: !1,
|
|
186
189
|
getItemKey: we,
|
|
187
|
-
rangeExtractor:
|
|
190
|
+
rangeExtractor: Ee,
|
|
188
191
|
onChange: () => {
|
|
189
192
|
},
|
|
190
|
-
measureElement:
|
|
193
|
+
measureElement: Oe,
|
|
191
194
|
initialRect: { width: 0, height: 0 },
|
|
192
195
|
scrollMargin: 0,
|
|
193
196
|
gap: 0,
|
|
@@ -204,7 +207,7 @@ class Oe {
|
|
|
204
207
|
}, this.notify = (e) => {
|
|
205
208
|
var s, t;
|
|
206
209
|
(t = (s = this.options).onChange) == null || t.call(s, this, e);
|
|
207
|
-
}, this.maybeNotify =
|
|
210
|
+
}, this.maybeNotify = _(
|
|
208
211
|
() => (this.calculateRange(), [
|
|
209
212
|
this.isScrolling,
|
|
210
213
|
this.range ? this.range.startIndex : null,
|
|
@@ -223,7 +226,7 @@ class Oe {
|
|
|
223
226
|
]
|
|
224
227
|
}
|
|
225
228
|
), this.cleanup = () => {
|
|
226
|
-
this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
|
229
|
+
this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
227
230
|
}, this._didMount = () => () => {
|
|
228
231
|
this.cleanup();
|
|
229
232
|
}, this._willUpdate = () => {
|
|
@@ -241,28 +244,28 @@ class Oe {
|
|
|
241
244
|
this.scrollRect = t, this.maybeNotify();
|
|
242
245
|
})
|
|
243
246
|
), this.unsubs.push(
|
|
244
|
-
this.options.observeElementOffset(this, (t,
|
|
245
|
-
this.scrollAdjustments = 0, this.scrollDirection =
|
|
247
|
+
this.options.observeElementOffset(this, (t, n) => {
|
|
248
|
+
this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < t ? "forward" : "backward" : null, this.scrollOffset = t, this.isScrolling = n, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
246
249
|
})
|
|
247
250
|
), this._scrollToOffset(this.getScrollOffset(), {
|
|
248
251
|
adjustments: void 0,
|
|
249
252
|
behavior: void 0
|
|
250
253
|
});
|
|
251
254
|
}
|
|
252
|
-
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
|
|
253
|
-
const t = /* @__PURE__ */ new Map(),
|
|
255
|
+
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
|
|
256
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
254
257
|
for (let o = s - 1; o >= 0; o--) {
|
|
255
258
|
const r = e[o];
|
|
256
259
|
if (t.has(r.lane))
|
|
257
260
|
continue;
|
|
258
|
-
const
|
|
261
|
+
const h = n.get(
|
|
259
262
|
r.lane
|
|
260
263
|
);
|
|
261
|
-
if (
|
|
264
|
+
if (h == null || r.end > h.end ? n.set(r.lane, r) : r.end < h.end && t.set(r.lane, !0), t.size === this.options.lanes)
|
|
262
265
|
break;
|
|
263
266
|
}
|
|
264
|
-
return
|
|
265
|
-
}, this.getMeasurementOptions =
|
|
267
|
+
return n.size === this.options.lanes ? Array.from(n.values()).sort((o, r) => o.end === r.end ? o.index - r.index : o.end - r.end)[0] : void 0;
|
|
268
|
+
}, this.getMeasurementOptions = _(
|
|
266
269
|
() => [
|
|
267
270
|
this.options.count,
|
|
268
271
|
this.options.paddingStart,
|
|
@@ -271,20 +274,20 @@ class Oe {
|
|
|
271
274
|
this.options.enabled,
|
|
272
275
|
this.options.lanes
|
|
273
276
|
],
|
|
274
|
-
(e, s, t,
|
|
277
|
+
(e, s, t, n, o, r) => (this.prevLanes !== void 0 && this.prevLanes !== r && (this.lanesChangedFlag = !0), this.prevLanes = r, this.pendingMeasuredCacheIndexes = [], {
|
|
275
278
|
count: e,
|
|
276
279
|
paddingStart: s,
|
|
277
280
|
scrollMargin: t,
|
|
278
|
-
getItemKey:
|
|
281
|
+
getItemKey: n,
|
|
279
282
|
enabled: o,
|
|
280
283
|
lanes: r
|
|
281
284
|
}),
|
|
282
285
|
{
|
|
283
286
|
key: !1
|
|
284
287
|
}
|
|
285
|
-
), this.getMeasurements =
|
|
288
|
+
), this.getMeasurements = _(
|
|
286
289
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
287
|
-
({ count: e, paddingStart: s, scrollMargin: t, getItemKey:
|
|
290
|
+
({ count: e, paddingStart: s, scrollMargin: t, getItemKey: n, enabled: o, lanes: r }, h) => {
|
|
288
291
|
if (!o)
|
|
289
292
|
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
290
293
|
if (this.laneAssignments.size > e)
|
|
@@ -293,35 +296,35 @@ class Oe {
|
|
|
293
296
|
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
|
|
294
297
|
this.itemSizeCache.set(c.key, c.size);
|
|
295
298
|
}));
|
|
296
|
-
const
|
|
299
|
+
const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
297
300
|
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
|
|
298
|
-
const u = this.measurementsCache.slice(0,
|
|
301
|
+
const u = this.measurementsCache.slice(0, d), m = new Array(r).fill(
|
|
299
302
|
void 0
|
|
300
303
|
);
|
|
301
|
-
for (let c = 0; c <
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
+
for (let c = 0; c < d; c++) {
|
|
305
|
+
const v = u[c];
|
|
306
|
+
v && (m[v.lane] = c);
|
|
304
307
|
}
|
|
305
|
-
for (let c =
|
|
306
|
-
const
|
|
307
|
-
let
|
|
308
|
-
if (
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
|
|
308
|
+
for (let c = d; c < e; c++) {
|
|
309
|
+
const v = n(c), E = this.laneAssignments.get(c);
|
|
310
|
+
let x, y;
|
|
311
|
+
if (E !== void 0 && this.options.lanes > 1) {
|
|
312
|
+
x = E;
|
|
313
|
+
const w = m[x], f = w !== void 0 ? u[w] : void 0;
|
|
314
|
+
y = f ? f.end + this.options.gap : s + t;
|
|
312
315
|
} else {
|
|
313
|
-
const
|
|
314
|
-
|
|
316
|
+
const w = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c);
|
|
317
|
+
y = w ? w.end + this.options.gap : s + t, x = w ? w.lane : c % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(c, x);
|
|
315
318
|
}
|
|
316
|
-
const
|
|
319
|
+
const O = h.get(v), S = typeof O == "number" ? O : this.options.estimateSize(c), R = y + S;
|
|
317
320
|
u[c] = {
|
|
318
321
|
index: c,
|
|
319
|
-
start:
|
|
320
|
-
size:
|
|
321
|
-
end:
|
|
322
|
-
key:
|
|
323
|
-
lane:
|
|
324
|
-
}, m[
|
|
322
|
+
start: y,
|
|
323
|
+
size: S,
|
|
324
|
+
end: R,
|
|
325
|
+
key: v,
|
|
326
|
+
lane: x
|
|
327
|
+
}, m[x] = c;
|
|
325
328
|
}
|
|
326
329
|
return this.measurementsCache = u, u;
|
|
327
330
|
},
|
|
@@ -329,24 +332,24 @@ class Oe {
|
|
|
329
332
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
330
333
|
debug: () => this.options.debug
|
|
331
334
|
}
|
|
332
|
-
), this.calculateRange =
|
|
335
|
+
), this.calculateRange = _(
|
|
333
336
|
() => [
|
|
334
337
|
this.getMeasurements(),
|
|
335
338
|
this.getSize(),
|
|
336
339
|
this.getScrollOffset(),
|
|
337
340
|
this.options.lanes
|
|
338
341
|
],
|
|
339
|
-
(e, s, t,
|
|
342
|
+
(e, s, t, n) => this.range = e.length > 0 && s > 0 ? je({
|
|
340
343
|
measurements: e,
|
|
341
344
|
outerSize: s,
|
|
342
345
|
scrollOffset: t,
|
|
343
|
-
lanes:
|
|
346
|
+
lanes: n
|
|
344
347
|
}) : null,
|
|
345
348
|
{
|
|
346
349
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
347
350
|
debug: () => this.options.debug
|
|
348
351
|
}
|
|
349
|
-
), this.getVirtualIndexes =
|
|
352
|
+
), this.getVirtualIndexes = _(
|
|
350
353
|
() => {
|
|
351
354
|
let e = null, s = null;
|
|
352
355
|
const t = this.calculateRange();
|
|
@@ -358,8 +361,8 @@ class Oe {
|
|
|
358
361
|
s
|
|
359
362
|
];
|
|
360
363
|
},
|
|
361
|
-
(e, s, t,
|
|
362
|
-
startIndex:
|
|
364
|
+
(e, s, t, n, o) => n === null || o === null ? [] : e({
|
|
365
|
+
startIndex: n,
|
|
363
366
|
endIndex: o,
|
|
364
367
|
overscan: s,
|
|
365
368
|
count: t
|
|
@@ -373,21 +376,42 @@ class Oe {
|
|
|
373
376
|
return t ? parseInt(t, 10) : (console.warn(
|
|
374
377
|
`Missing attribute name '${s}={index}' on measured element.`
|
|
375
378
|
), -1);
|
|
379
|
+
}, this.shouldMeasureDuringScroll = (e) => {
|
|
380
|
+
var s;
|
|
381
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth")
|
|
382
|
+
return !0;
|
|
383
|
+
const t = this.scrollState.index ?? ((s = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : s.index);
|
|
384
|
+
if (t !== void 0 && this.range) {
|
|
385
|
+
const n = Math.max(
|
|
386
|
+
this.options.overscan,
|
|
387
|
+
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
388
|
+
), o = Math.max(0, t - n), r = Math.min(
|
|
389
|
+
this.options.count - 1,
|
|
390
|
+
t + n
|
|
391
|
+
);
|
|
392
|
+
return e >= o && e <= r;
|
|
393
|
+
}
|
|
394
|
+
return !0;
|
|
376
395
|
}, this._measureElement = (e, s) => {
|
|
377
|
-
|
|
378
|
-
|
|
396
|
+
if (!e.isConnected) {
|
|
397
|
+
this.observer.unobserve(e);
|
|
379
398
|
return;
|
|
380
|
-
|
|
381
|
-
|
|
399
|
+
}
|
|
400
|
+
const t = this.indexFromElement(e), n = this.measurementsCache[t];
|
|
401
|
+
if (!n)
|
|
402
|
+
return;
|
|
403
|
+
const o = n.key, r = this.elementsCache.get(o);
|
|
404
|
+
r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(o, e)), this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, s, this));
|
|
382
405
|
}, this.resizeItem = (e, s) => {
|
|
383
|
-
|
|
384
|
-
|
|
406
|
+
var t;
|
|
407
|
+
const n = this.measurementsCache[e];
|
|
408
|
+
if (!n)
|
|
385
409
|
return;
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
adjustments: this.scrollAdjustments +=
|
|
410
|
+
const o = this.itemSizeCache.get(n.key) ?? n.size, r = s - o;
|
|
411
|
+
r !== 0 && (((t = this.scrollState) == null ? void 0 : t.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(n, r, this) : n.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
|
|
412
|
+
adjustments: this.scrollAdjustments += r,
|
|
389
413
|
behavior: void 0
|
|
390
|
-
})), this.pendingMeasuredCacheIndexes.push(
|
|
414
|
+
})), this.pendingMeasuredCacheIndexes.push(n.index), this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, s)), this.notify(!1));
|
|
391
415
|
}, this.measureElement = (e) => {
|
|
392
416
|
if (!e) {
|
|
393
417
|
this.elementsCache.forEach((s, t) => {
|
|
@@ -396,13 +420,13 @@ class Oe {
|
|
|
396
420
|
return;
|
|
397
421
|
}
|
|
398
422
|
this._measureElement(e, void 0);
|
|
399
|
-
}, this.getVirtualItems =
|
|
423
|
+
}, this.getVirtualItems = _(
|
|
400
424
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
401
425
|
(e, s) => {
|
|
402
426
|
const t = [];
|
|
403
|
-
for (let
|
|
404
|
-
const r = e[
|
|
405
|
-
t.push(
|
|
427
|
+
for (let n = 0, o = e.length; n < o; n++) {
|
|
428
|
+
const r = e[n], h = s[r];
|
|
429
|
+
t.push(h);
|
|
406
430
|
}
|
|
407
431
|
return t;
|
|
408
432
|
},
|
|
@@ -414,7 +438,7 @@ class Oe {
|
|
|
414
438
|
const s = this.getMeasurements();
|
|
415
439
|
if (s.length !== 0)
|
|
416
440
|
return P(
|
|
417
|
-
s[
|
|
441
|
+
s[G(
|
|
418
442
|
0,
|
|
419
443
|
s.length - 1,
|
|
420
444
|
(t) => P(s[t]).start,
|
|
@@ -431,76 +455,65 @@ class Oe {
|
|
|
431
455
|
}
|
|
432
456
|
}, this.getOffsetForAlignment = (e, s, t = 0) => {
|
|
433
457
|
if (!this.scrollElement) return 0;
|
|
434
|
-
const
|
|
435
|
-
s === "auto" && (s = e >= o +
|
|
458
|
+
const n = this.getSize(), o = this.getScrollOffset();
|
|
459
|
+
s === "auto" && (s = e >= o + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
|
|
436
460
|
const r = this.getMaxScrollOffset();
|
|
437
461
|
return Math.max(Math.min(r, e), 0);
|
|
438
462
|
}, this.getOffsetForIndex = (e, s = "auto") => {
|
|
439
463
|
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
440
|
-
const t = this.measurementsCache[e];
|
|
441
|
-
if (!
|
|
442
|
-
return;
|
|
443
|
-
const i = this.getSize(), o = this.getScrollOffset();
|
|
464
|
+
const t = this.getSize(), n = this.getScrollOffset(), o = this.measurementsCache[e];
|
|
465
|
+
if (!o) return;
|
|
444
466
|
if (s === "auto")
|
|
445
|
-
if (
|
|
467
|
+
if (o.end >= n + t - this.options.scrollPaddingEnd)
|
|
446
468
|
s = "end";
|
|
447
|
-
else if (
|
|
469
|
+
else if (o.start <= n + this.options.scrollPaddingStart)
|
|
448
470
|
s = "start";
|
|
449
471
|
else
|
|
450
|
-
return [
|
|
472
|
+
return [n, s];
|
|
451
473
|
if (s === "end" && e === this.options.count - 1)
|
|
452
474
|
return [this.getMaxScrollOffset(), s];
|
|
453
|
-
const r = s === "end" ?
|
|
475
|
+
const r = s === "end" ? o.end + this.options.scrollPaddingEnd : o.start - this.options.scrollPaddingStart;
|
|
454
476
|
return [
|
|
455
|
-
this.getOffsetForAlignment(r, s,
|
|
477
|
+
this.getOffsetForAlignment(r, s, o.size),
|
|
456
478
|
s
|
|
457
479
|
];
|
|
458
|
-
}, this.
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
behavior: t
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
};
|
|
496
|
-
r(s);
|
|
497
|
-
}, this.scrollBy = (e, { behavior: s } = {}) => {
|
|
498
|
-
s === "smooth" && this.isDynamicMode() && console.warn(
|
|
499
|
-
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
500
|
-
), this._scrollToOffset(this.getScrollOffset() + e, {
|
|
501
|
-
adjustments: void 0,
|
|
502
|
-
behavior: s
|
|
503
|
-
});
|
|
480
|
+
}, this.scrollToOffset = (e, { align: s = "start", behavior: t = "auto" } = {}) => {
|
|
481
|
+
const n = this.getOffsetForAlignment(e, s), o = this.now();
|
|
482
|
+
this.scrollState = {
|
|
483
|
+
index: null,
|
|
484
|
+
align: s,
|
|
485
|
+
behavior: t,
|
|
486
|
+
startedAt: o,
|
|
487
|
+
lastTargetOffset: n,
|
|
488
|
+
stableFrames: 0
|
|
489
|
+
}, this._scrollToOffset(n, { adjustments: void 0, behavior: t }), this.scheduleScrollReconcile();
|
|
490
|
+
}, this.scrollToIndex = (e, {
|
|
491
|
+
align: s = "auto",
|
|
492
|
+
behavior: t = "auto"
|
|
493
|
+
} = {}) => {
|
|
494
|
+
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
495
|
+
const n = this.getOffsetForIndex(e, s);
|
|
496
|
+
if (!n)
|
|
497
|
+
return;
|
|
498
|
+
const [o, r] = n, h = this.now();
|
|
499
|
+
this.scrollState = {
|
|
500
|
+
index: e,
|
|
501
|
+
align: r,
|
|
502
|
+
behavior: t,
|
|
503
|
+
startedAt: h,
|
|
504
|
+
lastTargetOffset: o,
|
|
505
|
+
stableFrames: 0
|
|
506
|
+
}, this._scrollToOffset(o, { adjustments: void 0, behavior: t }), this.scheduleScrollReconcile();
|
|
507
|
+
}, this.scrollBy = (e, { behavior: s = "auto" } = {}) => {
|
|
508
|
+
const t = this.getScrollOffset() + e, n = this.now();
|
|
509
|
+
this.scrollState = {
|
|
510
|
+
index: null,
|
|
511
|
+
align: "start",
|
|
512
|
+
behavior: s,
|
|
513
|
+
startedAt: n,
|
|
514
|
+
lastTargetOffset: t,
|
|
515
|
+
stableFrames: 0
|
|
516
|
+
}, this._scrollToOffset(t, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
|
|
504
517
|
}, this.getTotalSize = () => {
|
|
505
518
|
var e;
|
|
506
519
|
const s = this.getMeasurements();
|
|
@@ -510,13 +523,13 @@ class Oe {
|
|
|
510
523
|
else if (this.options.lanes === 1)
|
|
511
524
|
t = ((e = s[s.length - 1]) == null ? void 0 : e.end) ?? 0;
|
|
512
525
|
else {
|
|
513
|
-
const
|
|
526
|
+
const n = Array(this.options.lanes).fill(null);
|
|
514
527
|
let o = s.length - 1;
|
|
515
|
-
for (; o >= 0 &&
|
|
528
|
+
for (; o >= 0 && n.some((r) => r === null); ) {
|
|
516
529
|
const r = s[o];
|
|
517
|
-
|
|
530
|
+
n[r.lane] === null && (n[r.lane] = r.end), o--;
|
|
518
531
|
}
|
|
519
|
-
t = Math.max(...
|
|
532
|
+
t = Math.max(...n.filter((r) => r !== null));
|
|
520
533
|
}
|
|
521
534
|
return Math.max(
|
|
522
535
|
t - this.options.scrollMargin + this.options.paddingEnd,
|
|
@@ -531,99 +544,127 @@ class Oe {
|
|
|
531
544
|
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
532
545
|
}, this.setOptions(l);
|
|
533
546
|
}
|
|
547
|
+
scheduleScrollReconcile() {
|
|
548
|
+
if (!this.targetWindow) {
|
|
549
|
+
this.scrollState = null;
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
553
|
+
this.rafId = null, this.reconcileScroll();
|
|
554
|
+
}));
|
|
555
|
+
}
|
|
556
|
+
reconcileScroll() {
|
|
557
|
+
if (!this.scrollState || !this.scrollElement) return;
|
|
558
|
+
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
559
|
+
this.scrollState = null;
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
const s = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, t = s ? s[0] : this.scrollState.lastTargetOffset, n = 1, o = t !== this.scrollState.lastTargetOffset;
|
|
563
|
+
if (!o && Se(t, this.getScrollOffset())) {
|
|
564
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= n) {
|
|
565
|
+
this.scrollState = null;
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
} else
|
|
569
|
+
this.scrollState.stableFrames = 0, o && (this.scrollState.lastTargetOffset = t, this.scrollState.behavior = "auto", this._scrollToOffset(t, {
|
|
570
|
+
adjustments: void 0,
|
|
571
|
+
behavior: "auto"
|
|
572
|
+
}));
|
|
573
|
+
this.scheduleScrollReconcile();
|
|
574
|
+
}
|
|
534
575
|
}
|
|
535
|
-
const
|
|
536
|
-
for (;
|
|
537
|
-
const t = (
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
else if (
|
|
576
|
+
const G = (i, l, e, s) => {
|
|
577
|
+
for (; i <= l; ) {
|
|
578
|
+
const t = (i + l) / 2 | 0, n = e(t);
|
|
579
|
+
if (n < s)
|
|
580
|
+
i = t + 1;
|
|
581
|
+
else if (n > s)
|
|
541
582
|
l = t - 1;
|
|
542
583
|
else
|
|
543
584
|
return t;
|
|
544
585
|
}
|
|
545
|
-
return
|
|
586
|
+
return i > 0 ? i - 1 : 0;
|
|
546
587
|
};
|
|
547
588
|
function je({
|
|
548
|
-
measurements:
|
|
589
|
+
measurements: i,
|
|
549
590
|
outerSize: l,
|
|
550
591
|
scrollOffset: e,
|
|
551
592
|
lanes: s
|
|
552
593
|
}) {
|
|
553
|
-
const t =
|
|
554
|
-
if (
|
|
594
|
+
const t = i.length - 1, n = (h) => i[h].start;
|
|
595
|
+
if (i.length <= s)
|
|
555
596
|
return {
|
|
556
597
|
startIndex: 0,
|
|
557
598
|
endIndex: t
|
|
558
599
|
};
|
|
559
|
-
let o =
|
|
600
|
+
let o = G(
|
|
560
601
|
0,
|
|
561
602
|
t,
|
|
562
|
-
|
|
603
|
+
n,
|
|
563
604
|
e
|
|
564
605
|
), r = o;
|
|
565
606
|
if (s === 1)
|
|
566
|
-
for (; r < t &&
|
|
607
|
+
for (; r < t && i[r].end < e + l; )
|
|
567
608
|
r++;
|
|
568
609
|
else if (s > 1) {
|
|
569
|
-
const
|
|
570
|
-
for (; r < t &&
|
|
571
|
-
const u =
|
|
572
|
-
|
|
610
|
+
const h = Array(s).fill(0);
|
|
611
|
+
for (; r < t && h.some((u) => u < e + l); ) {
|
|
612
|
+
const u = i[r];
|
|
613
|
+
h[u.lane] = u.end, r++;
|
|
573
614
|
}
|
|
574
|
-
const
|
|
575
|
-
for (; o >= 0 &&
|
|
576
|
-
const u =
|
|
577
|
-
|
|
615
|
+
const d = Array(s).fill(e + l);
|
|
616
|
+
for (; o >= 0 && d.some((u) => u >= e); ) {
|
|
617
|
+
const u = i[o];
|
|
618
|
+
d[u.lane] = u.start, o--;
|
|
578
619
|
}
|
|
579
620
|
o = Math.max(0, o - o % s), r = Math.min(t, r + (s - 1 - r % s));
|
|
580
621
|
}
|
|
581
622
|
return { startIndex: o, endIndex: r };
|
|
582
623
|
}
|
|
583
|
-
const K = typeof document < "u" ?
|
|
624
|
+
const K = typeof document < "u" ? g.useLayoutEffect : g.useEffect;
|
|
584
625
|
function Ne({
|
|
585
|
-
useFlushSync:
|
|
626
|
+
useFlushSync: i = !0,
|
|
586
627
|
...l
|
|
587
628
|
}) {
|
|
588
|
-
const e =
|
|
629
|
+
const e = g.useReducer(() => ({}), {})[1], s = {
|
|
589
630
|
...l,
|
|
590
|
-
onChange: (
|
|
631
|
+
onChange: (n, o) => {
|
|
591
632
|
var r;
|
|
592
|
-
|
|
633
|
+
i && o ? Z(e) : e(), (r = l.onChange) == null || r.call(l, n, o);
|
|
593
634
|
}
|
|
594
|
-
}, [t] =
|
|
595
|
-
() => new
|
|
635
|
+
}, [t] = g.useState(
|
|
636
|
+
() => new ze(s)
|
|
596
637
|
);
|
|
597
638
|
return t.setOptions(s), K(() => t._didMount(), []), K(() => t._willUpdate()), t;
|
|
598
639
|
}
|
|
599
|
-
function
|
|
640
|
+
function Ae(i) {
|
|
600
641
|
return Ne({
|
|
601
|
-
observeElementRect:
|
|
642
|
+
observeElementRect: ye,
|
|
602
643
|
observeElementOffset: Ie,
|
|
603
644
|
scrollToFn: Me,
|
|
604
|
-
...
|
|
645
|
+
...i
|
|
605
646
|
});
|
|
606
647
|
}
|
|
607
|
-
const V = (...
|
|
608
|
-
function
|
|
648
|
+
const V = (...i) => i.filter(Boolean).join(" ");
|
|
649
|
+
function _e(i, l) {
|
|
609
650
|
if (!l || l.length === 0) return {};
|
|
610
651
|
for (const e of l) {
|
|
611
|
-
const s =
|
|
652
|
+
const s = i[e.field];
|
|
612
653
|
if (s == null) continue;
|
|
613
654
|
let t = !1;
|
|
614
|
-
const
|
|
655
|
+
const n = String(s);
|
|
615
656
|
switch (e.operator) {
|
|
616
657
|
case "equals":
|
|
617
|
-
t =
|
|
658
|
+
t = n === String(e.value);
|
|
618
659
|
break;
|
|
619
660
|
case "not_equals":
|
|
620
|
-
t =
|
|
661
|
+
t = n !== String(e.value);
|
|
621
662
|
break;
|
|
622
663
|
case "contains":
|
|
623
|
-
t =
|
|
664
|
+
t = n.toLowerCase().includes(String(e.value).toLowerCase());
|
|
624
665
|
break;
|
|
625
666
|
case "in":
|
|
626
|
-
t = Array.isArray(e.value) && e.value.includes(
|
|
667
|
+
t = Array.isArray(e.value) && e.value.includes(n);
|
|
627
668
|
break;
|
|
628
669
|
}
|
|
629
670
|
if (t)
|
|
@@ -634,39 +675,39 @@ function Ae(n, l) {
|
|
|
634
675
|
}
|
|
635
676
|
return {};
|
|
636
677
|
}
|
|
637
|
-
function W({ card:
|
|
678
|
+
function W({ card: i, conditionalFormatting: l }) {
|
|
638
679
|
const {
|
|
639
680
|
attributes: e,
|
|
640
681
|
listeners: s,
|
|
641
682
|
setNodeRef: t,
|
|
642
|
-
transform:
|
|
683
|
+
transform: n,
|
|
643
684
|
transition: o,
|
|
644
685
|
isDragging: r
|
|
645
|
-
} =
|
|
646
|
-
transform: ce.Transform.toString(
|
|
686
|
+
} = X({ id: i.id }), h = {
|
|
687
|
+
transform: ce.Transform.toString(n),
|
|
647
688
|
transition: o,
|
|
648
689
|
opacity: r ? 0.5 : void 0
|
|
649
|
-
},
|
|
650
|
-
return /* @__PURE__ */ a.jsx("div", { ref: t, style:
|
|
651
|
-
|
|
690
|
+
}, d = _e(i, l);
|
|
691
|
+
return /* @__PURE__ */ a.jsx("div", { ref: t, style: h, ...e, ...s, children: /* @__PURE__ */ a.jsxs(he, { className: "mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group", style: d, children: [
|
|
692
|
+
i.coverImage && /* @__PURE__ */ a.jsx("div", { className: "w-full h-32 overflow-hidden rounded-t-lg", children: /* @__PURE__ */ a.jsx(
|
|
652
693
|
"img",
|
|
653
694
|
{
|
|
654
|
-
src:
|
|
695
|
+
src: i.coverImage,
|
|
655
696
|
alt: "",
|
|
656
697
|
className: "w-full h-full object-cover",
|
|
657
698
|
loading: "lazy"
|
|
658
699
|
}
|
|
659
700
|
) }),
|
|
660
|
-
/* @__PURE__ */ a.jsxs(
|
|
661
|
-
/* @__PURE__ */ a.jsx(ue, { className: "text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors", children:
|
|
662
|
-
|
|
701
|
+
/* @__PURE__ */ a.jsxs(de, { className: "p-4", children: [
|
|
702
|
+
/* @__PURE__ */ a.jsx(ue, { className: "text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors", children: i.title }),
|
|
703
|
+
i.description && /* @__PURE__ */ a.jsx(fe, { className: "text-xs text-muted-foreground font-mono", children: i.description })
|
|
663
704
|
] }),
|
|
664
|
-
|
|
705
|
+
i.badges && i.badges.length > 0 && /* @__PURE__ */ a.jsx(me, { className: "p-4 pt-0", children: /* @__PURE__ */ a.jsx("div", { className: "flex flex-wrap gap-1", children: i.badges.map((u, m) => /* @__PURE__ */ a.jsx(L, { variant: u.variant || "default", className: "text-xs", children: u.label }, m)) }) })
|
|
665
706
|
] }) });
|
|
666
707
|
}
|
|
667
|
-
function
|
|
668
|
-
const s =
|
|
669
|
-
count:
|
|
708
|
+
function Re({ cards: i, parentRef: l, conditionalFormatting: e }) {
|
|
709
|
+
const s = Ae({
|
|
710
|
+
count: i.length,
|
|
670
711
|
getScrollElement: () => l.current,
|
|
671
712
|
estimateSize: () => 120,
|
|
672
713
|
overscan: 5
|
|
@@ -680,7 +721,7 @@ function De({ cards: n, parentRef: l, conditionalFormatting: e }) {
|
|
|
680
721
|
position: "relative"
|
|
681
722
|
},
|
|
682
723
|
children: s.getVirtualItems().map((t) => {
|
|
683
|
-
const
|
|
724
|
+
const n = i[t.index];
|
|
684
725
|
return /* @__PURE__ */ a.jsx(
|
|
685
726
|
"div",
|
|
686
727
|
{
|
|
@@ -691,35 +732,35 @@ function De({ cards: n, parentRef: l, conditionalFormatting: e }) {
|
|
|
691
732
|
width: "100%",
|
|
692
733
|
transform: `translateY(${t.start}px)`
|
|
693
734
|
},
|
|
694
|
-
children: /* @__PURE__ */ a.jsx(W, { card:
|
|
735
|
+
children: /* @__PURE__ */ a.jsx(W, { card: n, conditionalFormatting: e })
|
|
695
736
|
},
|
|
696
|
-
|
|
737
|
+
n.id
|
|
697
738
|
);
|
|
698
739
|
})
|
|
699
740
|
}
|
|
700
741
|
);
|
|
701
742
|
}
|
|
702
|
-
function
|
|
703
|
-
const [e, s] =
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
},
|
|
707
|
-
|
|
743
|
+
function ke({ columnId: i, onAdd: l }) {
|
|
744
|
+
const [e, s] = g.useState(!1), [t, n] = g.useState(""), o = g.useRef(null), r = () => {
|
|
745
|
+
const d = t.trim();
|
|
746
|
+
d && (l(i, d), n("")), s(!1);
|
|
747
|
+
}, h = (d) => {
|
|
748
|
+
d.key === "Enter" ? (d.preventDefault(), r()) : d.key === "Escape" && (n(""), s(!1));
|
|
708
749
|
};
|
|
709
750
|
return e ? /* @__PURE__ */ a.jsx("div", { className: "mt-2 space-y-2", children: /* @__PURE__ */ a.jsx(
|
|
710
751
|
ge,
|
|
711
752
|
{
|
|
712
753
|
ref: o,
|
|
713
754
|
value: t,
|
|
714
|
-
onChange: (
|
|
715
|
-
onKeyDown:
|
|
755
|
+
onChange: (d) => n(d.target.value),
|
|
756
|
+
onKeyDown: h,
|
|
716
757
|
onBlur: r,
|
|
717
758
|
placeholder: "Enter card title...",
|
|
718
759
|
className: "text-sm",
|
|
719
760
|
autoFocus: !0
|
|
720
761
|
}
|
|
721
762
|
) }) : /* @__PURE__ */ a.jsxs(
|
|
722
|
-
|
|
763
|
+
Y,
|
|
723
764
|
{
|
|
724
765
|
variant: "ghost",
|
|
725
766
|
size: "sm",
|
|
@@ -728,176 +769,176 @@ function Re({ columnId: n, onAdd: l }) {
|
|
|
728
769
|
s(!0), setTimeout(() => o.current?.focus(), 0);
|
|
729
770
|
},
|
|
730
771
|
children: [
|
|
731
|
-
/* @__PURE__ */ a.jsx(
|
|
772
|
+
/* @__PURE__ */ a.jsx(Q, { className: "h-4 w-4 mr-1" }),
|
|
732
773
|
"Add Card"
|
|
733
774
|
]
|
|
734
775
|
}
|
|
735
776
|
);
|
|
736
777
|
}
|
|
737
|
-
function
|
|
738
|
-
column:
|
|
778
|
+
function De({
|
|
779
|
+
column: i,
|
|
739
780
|
cards: l,
|
|
740
781
|
onToggle: e,
|
|
741
782
|
enableVirtual: s,
|
|
742
783
|
quickAdd: t,
|
|
743
|
-
onQuickAdd:
|
|
784
|
+
onQuickAdd: n,
|
|
744
785
|
conditionalFormatting: o
|
|
745
786
|
}) {
|
|
746
|
-
const r = l || [],
|
|
747
|
-
id:
|
|
787
|
+
const r = l || [], h = g.useRef(null), { setNodeRef: d } = X({
|
|
788
|
+
id: i.id,
|
|
748
789
|
data: {
|
|
749
790
|
type: "column"
|
|
750
791
|
}
|
|
751
|
-
}), u =
|
|
792
|
+
}), u = i.limit && r.length >= i.limit, m = i.limit && r.length >= i.limit * 0.8;
|
|
752
793
|
return /* @__PURE__ */ a.jsxs(
|
|
753
794
|
"div",
|
|
754
795
|
{
|
|
755
|
-
ref:
|
|
796
|
+
ref: d,
|
|
756
797
|
className: V(
|
|
757
798
|
"flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",
|
|
758
|
-
|
|
759
|
-
|
|
799
|
+
i.collapsed ? "w-16" : "w-80",
|
|
800
|
+
i.className
|
|
760
801
|
),
|
|
761
802
|
children: [
|
|
762
803
|
/* @__PURE__ */ a.jsxs("div", { className: "p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between", children: [
|
|
763
804
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
764
805
|
/* @__PURE__ */ a.jsx(
|
|
765
|
-
|
|
806
|
+
Y,
|
|
766
807
|
{
|
|
767
808
|
variant: "ghost",
|
|
768
809
|
size: "sm",
|
|
769
810
|
className: "h-6 w-6 p-0",
|
|
770
|
-
onClick: () => e(!
|
|
771
|
-
children:
|
|
811
|
+
onClick: () => e(!i.collapsed),
|
|
812
|
+
children: i.collapsed ? /* @__PURE__ */ a.jsx(ve, { className: "h-4 w-4" }) : /* @__PURE__ */ a.jsx(J, { className: "h-4 w-4" })
|
|
772
813
|
}
|
|
773
814
|
),
|
|
774
|
-
!
|
|
775
|
-
/* @__PURE__ */ a.jsx("h3", { className: "font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate", children:
|
|
815
|
+
!i.collapsed && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
816
|
+
/* @__PURE__ */ a.jsx("h3", { className: "font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate", children: i.title }),
|
|
776
817
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
777
818
|
/* @__PURE__ */ a.jsxs("span", { className: V(
|
|
778
819
|
"font-mono text-xs",
|
|
779
820
|
u ? "text-destructive" : m ? "text-yellow-500" : "text-muted-foreground"
|
|
780
821
|
), children: [
|
|
781
822
|
r.length,
|
|
782
|
-
|
|
823
|
+
i.limit && ` / ${i.limit}`
|
|
783
824
|
] }),
|
|
784
825
|
u && /* @__PURE__ */ a.jsx(L, { variant: "destructive", className: "text-xs", children: "Full" }),
|
|
785
826
|
m && !u && /* @__PURE__ */ a.jsx(be, { className: "h-3 w-3 text-yellow-500" })
|
|
786
827
|
] })
|
|
787
828
|
] })
|
|
788
829
|
] }),
|
|
789
|
-
|
|
790
|
-
/* @__PURE__ */ a.jsx("span", { className: "font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180", children:
|
|
830
|
+
i.collapsed && /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
831
|
+
/* @__PURE__ */ a.jsx("span", { className: "font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180", children: i.title }),
|
|
791
832
|
/* @__PURE__ */ a.jsx(L, { variant: "secondary", className: "text-xs", children: r.length })
|
|
792
833
|
] })
|
|
793
834
|
] }),
|
|
794
|
-
!
|
|
835
|
+
!i.collapsed && /* @__PURE__ */ a.jsxs("div", { ref: h, className: "flex-1 p-4 overflow-y-auto", style: { maxHeight: "600px" }, children: [
|
|
795
836
|
/* @__PURE__ */ a.jsx(
|
|
796
837
|
le,
|
|
797
838
|
{
|
|
798
839
|
items: r.map((c) => c.id),
|
|
799
840
|
strategy: ae,
|
|
800
|
-
children: s ? /* @__PURE__ */ a.jsx(
|
|
841
|
+
children: s ? /* @__PURE__ */ a.jsx(Re, { cards: r, parentRef: h, conditionalFormatting: o }) : /* @__PURE__ */ a.jsx("div", { className: "space-y-2", children: r.map((c) => /* @__PURE__ */ a.jsx(W, { card: c, conditionalFormatting: o }, c.id)) })
|
|
801
842
|
}
|
|
802
843
|
),
|
|
803
|
-
t &&
|
|
844
|
+
t && n && /* @__PURE__ */ a.jsx(ke, { columnId: i.id, onAdd: n })
|
|
804
845
|
] })
|
|
805
846
|
]
|
|
806
847
|
}
|
|
807
848
|
);
|
|
808
849
|
}
|
|
809
850
|
function We({
|
|
810
|
-
columns:
|
|
851
|
+
columns: i,
|
|
811
852
|
onCardMove: l,
|
|
812
853
|
onColumnToggle: e,
|
|
813
854
|
enableVirtualScrolling: s = !1,
|
|
814
855
|
virtualScrollThreshold: t = 50,
|
|
815
|
-
className:
|
|
856
|
+
className: n,
|
|
816
857
|
quickAdd: o,
|
|
817
858
|
onQuickAdd: r,
|
|
818
|
-
conditionalFormatting:
|
|
859
|
+
conditionalFormatting: h
|
|
819
860
|
}) {
|
|
820
|
-
const [
|
|
861
|
+
const [d, u] = g.useState(null), m = g.useMemo(() => (i || []).map((f) => ({
|
|
821
862
|
...f,
|
|
822
863
|
cards: f.cards || []
|
|
823
|
-
})), [
|
|
824
|
-
|
|
825
|
-
|
|
864
|
+
})), [i]), [c, v] = g.useState(m);
|
|
865
|
+
g.useEffect(() => {
|
|
866
|
+
v(m);
|
|
826
867
|
}, [m]);
|
|
827
|
-
const
|
|
868
|
+
const E = ee(
|
|
828
869
|
te(oe, {
|
|
829
870
|
activationConstraint: {
|
|
830
871
|
distance: 8
|
|
831
872
|
}
|
|
832
873
|
})
|
|
833
|
-
),
|
|
834
|
-
const { active:
|
|
874
|
+
), x = (f) => {
|
|
875
|
+
const { active: p } = f, b = O(p.id);
|
|
835
876
|
u(b);
|
|
836
|
-
},
|
|
837
|
-
const { active:
|
|
877
|
+
}, y = (f) => {
|
|
878
|
+
const { active: p, over: b } = f;
|
|
838
879
|
if (u(null), !b) return;
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
841
|
-
const M = C
|
|
880
|
+
const C = p.id, j = b.id;
|
|
881
|
+
if (C === j) return;
|
|
882
|
+
const M = S(C), N = S(j) || R(j);
|
|
842
883
|
if (!(!M || !N))
|
|
843
884
|
if (M.id === N.id) {
|
|
844
|
-
const
|
|
845
|
-
|
|
885
|
+
const z = [...M.cards], A = z.findIndex((I) => I.id === C), T = z.findIndex((I) => I.id === j), B = re(z, A, T);
|
|
886
|
+
v(
|
|
846
887
|
(I) => I.map(
|
|
847
|
-
(
|
|
888
|
+
(k) => k.id === M.id ? { ...k, cards: B } : k
|
|
848
889
|
)
|
|
849
890
|
);
|
|
850
891
|
} else {
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
(
|
|
854
|
-
), l && l(
|
|
892
|
+
const z = [...M.cards], A = [...N.cards], T = z.findIndex((D) => D.id === C), I = j === N.id ? A.length : A.findIndex((D) => D.id === j), [k] = z.splice(T, 1);
|
|
893
|
+
A.splice(I, 0, k), v(
|
|
894
|
+
(D) => D.map((F) => F.id === M.id ? { ...F, cards: z } : F.id === N.id ? { ...F, cards: A } : F)
|
|
895
|
+
), l && l(C, M.id, N.id, I);
|
|
855
896
|
}
|
|
856
|
-
},
|
|
897
|
+
}, O = g.useCallback(
|
|
857
898
|
(f) => {
|
|
858
|
-
for (const
|
|
859
|
-
const b =
|
|
899
|
+
for (const p of c) {
|
|
900
|
+
const b = p.cards.find((C) => C.id === f);
|
|
860
901
|
if (b) return b;
|
|
861
902
|
}
|
|
862
903
|
return null;
|
|
863
904
|
},
|
|
864
905
|
[c]
|
|
865
|
-
),
|
|
866
|
-
(f) => c.find((
|
|
906
|
+
), S = g.useCallback(
|
|
907
|
+
(f) => c.find((p) => p.cards.some((b) => b.id === f)) || null,
|
|
867
908
|
[c]
|
|
868
|
-
),
|
|
869
|
-
(f) => c.find((
|
|
909
|
+
), R = g.useCallback(
|
|
910
|
+
(f) => c.find((p) => p.id === f) || null,
|
|
870
911
|
[c]
|
|
871
|
-
),
|
|
872
|
-
|
|
873
|
-
(b) => b.map((
|
|
874
|
-
), e?.(f,
|
|
912
|
+
), w = g.useCallback((f, p) => {
|
|
913
|
+
v(
|
|
914
|
+
(b) => b.map((C) => C.id === f ? { ...C, collapsed: p } : C)
|
|
915
|
+
), e?.(f, p);
|
|
875
916
|
}, [e]);
|
|
876
917
|
return /* @__PURE__ */ a.jsxs(
|
|
877
918
|
se,
|
|
878
919
|
{
|
|
879
|
-
sensors:
|
|
920
|
+
sensors: E,
|
|
880
921
|
collisionDetection: ne,
|
|
881
|
-
onDragStart:
|
|
882
|
-
onDragEnd:
|
|
922
|
+
onDragStart: x,
|
|
923
|
+
onDragEnd: y,
|
|
883
924
|
children: [
|
|
884
|
-
/* @__PURE__ */ a.jsx("div", { className: V("flex gap-4 overflow-x-auto p-4",
|
|
885
|
-
const
|
|
925
|
+
/* @__PURE__ */ a.jsx("div", { className: V("flex gap-4 overflow-x-auto p-4", n), children: c.map((f) => {
|
|
926
|
+
const p = s && f.cards.length > t;
|
|
886
927
|
return /* @__PURE__ */ a.jsx(
|
|
887
|
-
|
|
928
|
+
De,
|
|
888
929
|
{
|
|
889
930
|
column: f,
|
|
890
931
|
cards: f.cards,
|
|
891
|
-
onToggle: (b) =>
|
|
892
|
-
enableVirtual:
|
|
932
|
+
onToggle: (b) => w(f.id, b),
|
|
933
|
+
enableVirtual: p,
|
|
893
934
|
quickAdd: o,
|
|
894
935
|
onQuickAdd: r,
|
|
895
|
-
conditionalFormatting:
|
|
936
|
+
conditionalFormatting: h
|
|
896
937
|
},
|
|
897
938
|
f.id
|
|
898
939
|
);
|
|
899
940
|
}) }),
|
|
900
|
-
/* @__PURE__ */ a.jsx(ie, { children:
|
|
941
|
+
/* @__PURE__ */ a.jsx(ie, { children: d ? /* @__PURE__ */ a.jsx(W, { card: d, conditionalFormatting: h }) : null })
|
|
901
942
|
]
|
|
902
943
|
}
|
|
903
944
|
);
|