@ram_28/kf-ai-sdk 1.0.13 → 1.0.15
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/dist/auth.cjs +1 -1
- package/dist/auth.mjs +90 -90
- package/dist/components/hooks/useFilter/types.d.ts +25 -22
- package/dist/components/hooks/useFilter/types.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/useFilter.d.ts.map +1 -1
- package/dist/filter.cjs +1 -1
- package/dist/filter.mjs +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +736 -1745
- package/dist/kanban.cjs +2 -2
- package/dist/kanban.mjs +469 -835
- package/dist/kanban.ui.cjs +1 -1
- package/dist/kanban.ui.mjs +27 -27
- package/dist/table.cjs +1 -1
- package/dist/table.mjs +2 -2
- package/dist/useFilter-Dofowpr_.cjs +1 -0
- package/dist/useFilter-Dv-mr9QW.js +117 -0
- package/package.json +1 -1
- package/sdk/components/hooks/useFilter/types.ts +28 -24
- package/sdk/components/hooks/useFilter/useFilter.llm.txt +199 -331
- package/sdk/components/hooks/useFilter/useFilter.ts +28 -40
- package/dist/jsx-runtime-BYECrxsp.cjs +0 -30
- package/dist/jsx-runtime-DGlMoOmv.js +0 -630
- package/dist/useFilter-CXFqEHyI.js +0 -129
- package/dist/useFilter-D-bCDo6Z.cjs +0 -1
- package/dist/useQuery-BScHEo7x.cjs +0 -1
- package/dist/useQuery-KpZFg80c.js +0 -748
package/dist/kanban.mjs
CHANGED
|
@@ -1,410 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function ve() {
|
|
12
|
-
return {
|
|
13
|
-
context: void 0,
|
|
14
|
-
data: void 0,
|
|
15
|
-
error: null,
|
|
16
|
-
failureCount: 0,
|
|
17
|
-
failureReason: null,
|
|
18
|
-
isPaused: !1,
|
|
19
|
-
status: "idle",
|
|
20
|
-
variables: void 0,
|
|
21
|
-
submittedAt: 0
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
var z, W, $, N, Y, mt, Qt, Yt, Ke = (Yt = class extends Vt {
|
|
25
|
-
constructor(e, s) {
|
|
26
|
-
super();
|
|
27
|
-
R(this, Y);
|
|
28
|
-
R(this, z);
|
|
29
|
-
R(this, W);
|
|
30
|
-
R(this, $);
|
|
31
|
-
R(this, N);
|
|
32
|
-
v(this, z, e), this.setOptions(s), this.bindMethods(), F(this, Y, mt).call(this);
|
|
33
|
-
}
|
|
34
|
-
bindMethods() {
|
|
35
|
-
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
36
|
-
}
|
|
37
|
-
setOptions(e) {
|
|
38
|
-
var t;
|
|
39
|
-
const s = this.options;
|
|
40
|
-
this.options = l(this, z).defaultMutationOptions(e), Gt(this.options, s) || l(this, z).getMutationCache().notify({
|
|
41
|
-
type: "observerOptionsUpdated",
|
|
42
|
-
mutation: l(this, $),
|
|
43
|
-
observer: this
|
|
44
|
-
}), s != null && s.mutationKey && this.options.mutationKey && It(s.mutationKey) !== It(this.options.mutationKey) ? this.reset() : ((t = l(this, $)) == null ? void 0 : t.state.status) === "pending" && l(this, $).setOptions(this.options);
|
|
45
|
-
}
|
|
46
|
-
onUnsubscribe() {
|
|
47
|
-
var e;
|
|
48
|
-
this.hasListeners() || (e = l(this, $)) == null || e.removeObserver(this);
|
|
49
|
-
}
|
|
50
|
-
onMutationUpdate(e) {
|
|
51
|
-
F(this, Y, mt).call(this), F(this, Y, Qt).call(this, e);
|
|
52
|
-
}
|
|
53
|
-
getCurrentResult() {
|
|
54
|
-
return l(this, W);
|
|
55
|
-
}
|
|
56
|
-
reset() {
|
|
57
|
-
var e;
|
|
58
|
-
(e = l(this, $)) == null || e.removeObserver(this), v(this, $, void 0), F(this, Y, mt).call(this), F(this, Y, Qt).call(this);
|
|
59
|
-
}
|
|
60
|
-
mutate(e, s) {
|
|
61
|
-
var t;
|
|
62
|
-
return v(this, N, s), (t = l(this, $)) == null || t.removeObserver(this), v(this, $, l(this, z).getMutationCache().build(l(this, z), this.options)), l(this, $).addObserver(this), l(this, $).execute(e);
|
|
63
|
-
}
|
|
64
|
-
}, z = new WeakMap(), W = new WeakMap(), $ = new WeakMap(), N = new WeakMap(), Y = new WeakSet(), mt = function() {
|
|
65
|
-
var s;
|
|
66
|
-
const e = ((s = l(this, $)) == null ? void 0 : s.state) ?? ve();
|
|
67
|
-
v(this, W, {
|
|
68
|
-
...e,
|
|
69
|
-
isPending: e.status === "pending",
|
|
70
|
-
isSuccess: e.status === "success",
|
|
71
|
-
isError: e.status === "error",
|
|
72
|
-
isIdle: e.status === "idle",
|
|
73
|
-
mutate: this.mutate,
|
|
74
|
-
reset: this.reset
|
|
75
|
-
});
|
|
76
|
-
}, Qt = function(e) {
|
|
77
|
-
ct.batch(() => {
|
|
78
|
-
var s, t, i, d, f, y, Q, E;
|
|
79
|
-
if (l(this, N) && this.hasListeners()) {
|
|
80
|
-
const C = l(this, W).variables, O = l(this, W).context, K = {
|
|
81
|
-
client: l(this, z),
|
|
82
|
-
meta: this.options.meta,
|
|
83
|
-
mutationKey: this.options.mutationKey
|
|
84
|
-
};
|
|
85
|
-
if ((e == null ? void 0 : e.type) === "success") {
|
|
86
|
-
try {
|
|
87
|
-
(t = (s = l(this, N)).onSuccess) == null || t.call(
|
|
88
|
-
s,
|
|
89
|
-
e.data,
|
|
90
|
-
C,
|
|
91
|
-
O,
|
|
92
|
-
K
|
|
93
|
-
);
|
|
94
|
-
} catch (q) {
|
|
95
|
-
Promise.reject(q);
|
|
96
|
-
}
|
|
97
|
-
try {
|
|
98
|
-
(d = (i = l(this, N)).onSettled) == null || d.call(
|
|
99
|
-
i,
|
|
100
|
-
e.data,
|
|
101
|
-
null,
|
|
102
|
-
C,
|
|
103
|
-
O,
|
|
104
|
-
K
|
|
105
|
-
);
|
|
106
|
-
} catch (q) {
|
|
107
|
-
Promise.reject(q);
|
|
108
|
-
}
|
|
109
|
-
} else if ((e == null ? void 0 : e.type) === "error") {
|
|
110
|
-
try {
|
|
111
|
-
(y = (f = l(this, N)).onError) == null || y.call(
|
|
112
|
-
f,
|
|
113
|
-
e.error,
|
|
114
|
-
C,
|
|
115
|
-
O,
|
|
116
|
-
K
|
|
117
|
-
);
|
|
118
|
-
} catch (q) {
|
|
119
|
-
Promise.reject(q);
|
|
120
|
-
}
|
|
121
|
-
try {
|
|
122
|
-
(E = (Q = l(this, N)).onSettled) == null || E.call(
|
|
123
|
-
Q,
|
|
124
|
-
void 0,
|
|
125
|
-
e.error,
|
|
126
|
-
C,
|
|
127
|
-
O,
|
|
128
|
-
K
|
|
129
|
-
);
|
|
130
|
-
} catch (q) {
|
|
131
|
-
Promise.reject(q);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
this.listeners.forEach((C) => {
|
|
136
|
-
C(l(this, W));
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
}, Yt);
|
|
140
|
-
function Bt(a, e) {
|
|
141
|
-
const s = new Set(e);
|
|
142
|
-
return a.filter((t) => !s.has(t));
|
|
143
|
-
}
|
|
144
|
-
function qe(a, e, s) {
|
|
145
|
-
const t = a.slice(0);
|
|
146
|
-
return t[e] = s, t;
|
|
147
|
-
}
|
|
148
|
-
var tt, H, it, at, I, Z, lt, dt, ht, T, Et, vt, Kt, qt, Pt, Jt, Pe = (Jt = class extends Vt {
|
|
149
|
-
constructor(e, s, t) {
|
|
150
|
-
super();
|
|
151
|
-
R(this, T);
|
|
152
|
-
R(this, tt);
|
|
153
|
-
R(this, H);
|
|
154
|
-
R(this, it);
|
|
155
|
-
R(this, at);
|
|
156
|
-
R(this, I);
|
|
157
|
-
R(this, Z);
|
|
158
|
-
R(this, lt);
|
|
159
|
-
R(this, dt);
|
|
160
|
-
R(this, ht, []);
|
|
161
|
-
v(this, tt, e), v(this, at, t), v(this, it, []), v(this, I, []), v(this, H, []), this.setQueries(s);
|
|
162
|
-
}
|
|
163
|
-
onSubscribe() {
|
|
164
|
-
this.listeners.size === 1 && l(this, I).forEach((e) => {
|
|
165
|
-
e.subscribe((s) => {
|
|
166
|
-
F(this, T, qt).call(this, e, s);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
onUnsubscribe() {
|
|
171
|
-
this.listeners.size || this.destroy();
|
|
172
|
-
}
|
|
173
|
-
destroy() {
|
|
174
|
-
this.listeners = /* @__PURE__ */ new Set(), l(this, I).forEach((e) => {
|
|
175
|
-
e.destroy();
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
setQueries(e, s) {
|
|
179
|
-
if (v(this, it, e), v(this, at, s), process.env.NODE_ENV !== "production") {
|
|
180
|
-
const t = e.map(
|
|
181
|
-
(i) => l(this, tt).defaultQueryOptions(i).queryHash
|
|
182
|
-
);
|
|
183
|
-
new Set(t).size !== t.length && console.warn(
|
|
184
|
-
"[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior."
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
ct.batch(() => {
|
|
188
|
-
const t = l(this, I), i = F(this, T, Kt).call(this, l(this, it));
|
|
189
|
-
i.forEach(
|
|
190
|
-
(O) => O.observer.setOptions(O.defaultedQueryOptions)
|
|
191
|
-
);
|
|
192
|
-
const d = i.map((O) => O.observer), f = d.map(
|
|
193
|
-
(O) => O.getCurrentResult()
|
|
194
|
-
), y = t.length !== d.length, Q = d.some(
|
|
195
|
-
(O, K) => O !== t[K]
|
|
196
|
-
), E = y || Q, C = E ? !0 : f.some((O, K) => {
|
|
197
|
-
const q = l(this, H)[K];
|
|
198
|
-
return !q || !Gt(O, q);
|
|
199
|
-
});
|
|
200
|
-
!E && !C || (E && (v(this, ht, i), v(this, I, d)), v(this, H, f), this.hasListeners() && (E && (Bt(t, d).forEach((O) => {
|
|
201
|
-
O.destroy();
|
|
202
|
-
}), Bt(d, t).forEach((O) => {
|
|
203
|
-
O.subscribe((K) => {
|
|
204
|
-
F(this, T, qt).call(this, O, K);
|
|
205
|
-
});
|
|
206
|
-
})), F(this, T, Pt).call(this)));
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
getCurrentResult() {
|
|
210
|
-
return l(this, H);
|
|
211
|
-
}
|
|
212
|
-
getQueries() {
|
|
213
|
-
return l(this, I).map((e) => e.getCurrentQuery());
|
|
214
|
-
}
|
|
215
|
-
getObservers() {
|
|
216
|
-
return l(this, I);
|
|
217
|
-
}
|
|
218
|
-
getOptimisticResult(e, s) {
|
|
219
|
-
const t = F(this, T, Kt).call(this, e), i = t.map(
|
|
220
|
-
(d) => d.observer.getOptimisticResult(d.defaultedQueryOptions)
|
|
221
|
-
);
|
|
222
|
-
return [
|
|
223
|
-
i,
|
|
224
|
-
(d) => F(this, T, vt).call(this, d ?? i, s),
|
|
225
|
-
() => F(this, T, Et).call(this, i, t)
|
|
226
|
-
];
|
|
227
|
-
}
|
|
228
|
-
}, tt = new WeakMap(), H = new WeakMap(), it = new WeakMap(), at = new WeakMap(), I = new WeakMap(), Z = new WeakMap(), lt = new WeakMap(), dt = new WeakMap(), ht = new WeakMap(), T = new WeakSet(), Et = function(e, s) {
|
|
229
|
-
return s.map((t, i) => {
|
|
230
|
-
const d = e[i];
|
|
231
|
-
return t.defaultedQueryOptions.notifyOnChangeProps ? d : t.observer.trackResult(d, (f) => {
|
|
232
|
-
s.forEach((y) => {
|
|
233
|
-
y.observer.trackProp(f);
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
}, vt = function(e, s) {
|
|
238
|
-
return s ? ((!l(this, Z) || l(this, H) !== l(this, dt) || s !== l(this, lt)) && (v(this, lt, s), v(this, dt, l(this, H)), v(this, Z, pe(
|
|
239
|
-
l(this, Z),
|
|
240
|
-
s(e)
|
|
241
|
-
))), l(this, Z)) : e;
|
|
242
|
-
}, Kt = function(e) {
|
|
243
|
-
const s = /* @__PURE__ */ new Map();
|
|
244
|
-
l(this, I).forEach((i) => {
|
|
245
|
-
const d = i.options.queryHash;
|
|
246
|
-
if (!d) return;
|
|
247
|
-
const f = s.get(d);
|
|
248
|
-
f ? f.push(i) : s.set(d, [i]);
|
|
249
|
-
});
|
|
250
|
-
const t = [];
|
|
251
|
-
return e.forEach((i) => {
|
|
252
|
-
var Q;
|
|
253
|
-
const d = l(this, tt).defaultQueryOptions(i), y = ((Q = s.get(d.queryHash)) == null ? void 0 : Q.shift()) ?? new Wt(l(this, tt), d);
|
|
254
|
-
t.push({
|
|
255
|
-
defaultedQueryOptions: d,
|
|
256
|
-
observer: y
|
|
257
|
-
});
|
|
258
|
-
}), t;
|
|
259
|
-
}, qt = function(e, s) {
|
|
260
|
-
const t = l(this, I).indexOf(e);
|
|
261
|
-
t !== -1 && (v(this, H, qe(l(this, H), t, s)), F(this, T, Pt).call(this));
|
|
262
|
-
}, Pt = function() {
|
|
263
|
-
var e;
|
|
264
|
-
if (this.hasListeners()) {
|
|
265
|
-
const s = l(this, Z), t = F(this, T, Et).call(this, l(this, H), l(this, ht)), i = F(this, T, vt).call(this, t, (e = l(this, at)) == null ? void 0 : e.combine);
|
|
266
|
-
s !== i && ct.batch(() => {
|
|
267
|
-
this.listeners.forEach((d) => {
|
|
268
|
-
d(l(this, H));
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}, Jt);
|
|
273
|
-
function ke({
|
|
274
|
-
queries: a,
|
|
275
|
-
...e
|
|
276
|
-
}, s) {
|
|
277
|
-
const t = kt(), i = ye(), d = me(), f = B.useMemo(
|
|
278
|
-
() => a.map((g) => {
|
|
279
|
-
const P = t.defaultQueryOptions(
|
|
280
|
-
g
|
|
281
|
-
);
|
|
282
|
-
return P._optimisticResults = i ? "isRestoring" : "optimistic", P;
|
|
283
|
-
}),
|
|
284
|
-
[a, t, i]
|
|
285
|
-
);
|
|
286
|
-
f.forEach((g) => {
|
|
287
|
-
be(g);
|
|
288
|
-
const P = t.getQueryCache().get(g.queryHash);
|
|
289
|
-
Ce(g, d, P);
|
|
290
|
-
}), De(d);
|
|
291
|
-
const [y] = B.useState(
|
|
292
|
-
() => new Pe(
|
|
293
|
-
t,
|
|
294
|
-
f,
|
|
295
|
-
e
|
|
296
|
-
)
|
|
297
|
-
), [Q, E, C] = y.getOptimisticResult(
|
|
298
|
-
f,
|
|
299
|
-
e.combine
|
|
300
|
-
), O = !i && e.subscribed !== !1;
|
|
301
|
-
B.useSyncExternalStore(
|
|
302
|
-
B.useCallback(
|
|
303
|
-
(g) => O ? y.subscribe(ct.batchCalls(g)) : Zt,
|
|
304
|
-
[y, O]
|
|
305
|
-
),
|
|
306
|
-
() => y.getCurrentResult(),
|
|
307
|
-
() => y.getCurrentResult()
|
|
308
|
-
), B.useEffect(() => {
|
|
309
|
-
y.setQueries(
|
|
310
|
-
f,
|
|
311
|
-
e
|
|
312
|
-
);
|
|
313
|
-
}, [f, e, y]);
|
|
314
|
-
const q = Q.some(
|
|
315
|
-
(g, P) => Ut(f[P], g)
|
|
316
|
-
) ? Q.flatMap((g, P) => {
|
|
317
|
-
const k = f[P];
|
|
318
|
-
if (k) {
|
|
319
|
-
const X = new Wt(t, k);
|
|
320
|
-
if (Ut(k, g))
|
|
321
|
-
return jt(k, X, d);
|
|
322
|
-
we(g, i) && jt(k, X, d);
|
|
323
|
-
}
|
|
324
|
-
return [];
|
|
325
|
-
}) : [];
|
|
326
|
-
if (q.length > 0)
|
|
327
|
-
throw Promise.all(q);
|
|
328
|
-
const J = Q.find(
|
|
329
|
-
(g, P) => {
|
|
330
|
-
const k = f[P];
|
|
331
|
-
return k && Oe({
|
|
332
|
-
result: g,
|
|
333
|
-
errorResetBoundary: d,
|
|
334
|
-
throwOnError: k.throwOnError,
|
|
335
|
-
query: t.getQueryCache().get(k.queryHash),
|
|
336
|
-
suspense: k.suspense
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
);
|
|
340
|
-
if (J != null && J.error)
|
|
341
|
-
throw J.error;
|
|
342
|
-
return E(C());
|
|
343
|
-
}
|
|
344
|
-
function ut(a, e) {
|
|
345
|
-
const s = kt(), [t] = B.useState(
|
|
346
|
-
() => new Ke(
|
|
347
|
-
s,
|
|
348
|
-
a
|
|
349
|
-
)
|
|
350
|
-
);
|
|
351
|
-
B.useEffect(() => {
|
|
352
|
-
t.setOptions(a);
|
|
353
|
-
}, [t, a]);
|
|
354
|
-
const i = B.useSyncExternalStore(
|
|
355
|
-
B.useCallback(
|
|
356
|
-
(f) => t.subscribe(ct.batchCalls(f)),
|
|
357
|
-
[t]
|
|
358
|
-
),
|
|
359
|
-
() => t.getCurrentResult(),
|
|
360
|
-
() => t.getCurrentResult()
|
|
361
|
-
), d = B.useCallback(
|
|
362
|
-
(f, y) => {
|
|
363
|
-
t.mutate(f, y).catch(Zt);
|
|
364
|
-
},
|
|
365
|
-
[t]
|
|
366
|
-
);
|
|
367
|
-
if (i.error && Se(t.options.throwOnError, [i.error]))
|
|
368
|
-
throw i.error;
|
|
369
|
-
return { ...i, mutate: d, mutateAsync: i.mutate };
|
|
370
|
-
}
|
|
371
|
-
const Xt = 50, zt = 5, Nt = 5;
|
|
372
|
-
function Ae({
|
|
373
|
-
onCardMove: a,
|
|
374
|
-
onError: e,
|
|
375
|
-
columns: s,
|
|
376
|
-
announceMove: t
|
|
1
|
+
import { useState as G, useRef as k, useCallback as h, useEffect as rt, useMemo as ot, createContext as qt, useContext as Qt } from "react";
|
|
2
|
+
import { useQueryClient as At, useQueries as Tt, keepPreviousData as kt, useQuery as Pt, useMutation as j } from "@tanstack/react-query";
|
|
3
|
+
import { a as F } from "./client-CfvLiGfP.js";
|
|
4
|
+
import { u as Et } from "./useFilter-Dv-mr9QW.js";
|
|
5
|
+
const ct = 50, dt = 5, ut = 5;
|
|
6
|
+
function Ft({
|
|
7
|
+
onCardMove: i,
|
|
8
|
+
onError: c,
|
|
9
|
+
columns: d,
|
|
10
|
+
announceMove: a
|
|
377
11
|
}) {
|
|
378
|
-
const [
|
|
12
|
+
const [s, O] = G({
|
|
379
13
|
isDragging: !1,
|
|
380
14
|
draggedCard: null,
|
|
381
15
|
dragOverColumn: null,
|
|
382
16
|
dragOverPosition: null,
|
|
383
17
|
dragSourceColumn: null
|
|
384
|
-
}),
|
|
385
|
-
|
|
18
|
+
}), q = k(null), _ = k(null), K = k(null), b = h(() => {
|
|
19
|
+
O({
|
|
386
20
|
isDragging: !1,
|
|
387
21
|
draggedCard: null,
|
|
388
22
|
dragOverColumn: null,
|
|
389
23
|
dragOverPosition: null,
|
|
390
24
|
dragSourceColumn: null
|
|
391
|
-
}),
|
|
392
|
-
}, []),
|
|
393
|
-
for (const
|
|
394
|
-
const
|
|
395
|
-
if (
|
|
396
|
-
return { card:
|
|
25
|
+
}), _.current && (clearTimeout(_.current), _.current = null);
|
|
26
|
+
}, []), D = h((u) => d.find((o) => o._id === u) || null, [d]), Y = h((u) => {
|
|
27
|
+
for (const o of d) {
|
|
28
|
+
const g = o.cards.find((m) => m._id === u);
|
|
29
|
+
if (g)
|
|
30
|
+
return { card: g, column: o };
|
|
397
31
|
}
|
|
398
32
|
return null;
|
|
399
|
-
}, [
|
|
400
|
-
var
|
|
33
|
+
}, [d]), P = h((u, o) => {
|
|
34
|
+
var g, m;
|
|
401
35
|
try {
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
36
|
+
const l = u.target, y = D(o.columnId);
|
|
37
|
+
if (!y)
|
|
404
38
|
throw new Error("Source column not found");
|
|
405
|
-
(
|
|
406
|
-
const
|
|
407
|
-
|
|
39
|
+
(g = u.dataTransfer) == null || g.setData("text/plain", o._id), (m = u.dataTransfer) == null || m.setData("application/json", JSON.stringify(o));
|
|
40
|
+
const S = l.cloneNode(!0);
|
|
41
|
+
S.style.cssText = `
|
|
408
42
|
position: fixed;
|
|
409
43
|
top: -1000px;
|
|
410
44
|
left: -1000px;
|
|
@@ -416,645 +50,645 @@ function Ae({
|
|
|
416
50
|
max-width: 300px;
|
|
417
51
|
background: white;
|
|
418
52
|
border-radius: 8px;
|
|
419
|
-
`, document.body.appendChild(
|
|
53
|
+
`, document.body.appendChild(S), q.current = S, u.dataTransfer && u.dataTransfer.setDragImage(S, u.offsetX || 50, u.offsetY || 20), O({
|
|
420
54
|
isDragging: !0,
|
|
421
|
-
draggedCard:
|
|
55
|
+
draggedCard: o,
|
|
422
56
|
dragOverColumn: null,
|
|
423
57
|
dragOverPosition: null,
|
|
424
|
-
dragSourceColumn:
|
|
425
|
-
}),
|
|
426
|
-
} catch (
|
|
427
|
-
|
|
58
|
+
dragSourceColumn: y._id
|
|
59
|
+
}), a == null || a(o, y.title, "being moved");
|
|
60
|
+
} catch (l) {
|
|
61
|
+
c == null || c(l instanceof Error ? l : new Error("Drag start failed")), b();
|
|
428
62
|
}
|
|
429
|
-
}, [
|
|
430
|
-
if (
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
...
|
|
434
|
-
dragOverColumn: (
|
|
63
|
+
}, [D, c, b, a]), z = h((u, o) => {
|
|
64
|
+
if (u.preventDefault(), !s.isDragging || !s.draggedCard) return;
|
|
65
|
+
const g = o ? D(o) : null;
|
|
66
|
+
O((m) => ({
|
|
67
|
+
...m,
|
|
68
|
+
dragOverColumn: (g == null ? void 0 : g._id) || null,
|
|
435
69
|
dragOverPosition: null
|
|
436
70
|
// Will be calculated based on mouse position
|
|
437
|
-
})),
|
|
438
|
-
}, [
|
|
439
|
-
if (
|
|
71
|
+
})), $(u);
|
|
72
|
+
}, [s.isDragging, s.draggedCard, D]), V = h((u, o) => {
|
|
73
|
+
if (u.preventDefault(), !(!s.isDragging || !s.draggedCard))
|
|
440
74
|
try {
|
|
441
|
-
const
|
|
442
|
-
if (!
|
|
75
|
+
const g = s.draggedCard, m = s.dragSourceColumn, l = D(o), y = D(m);
|
|
76
|
+
if (!l || !y)
|
|
443
77
|
throw new Error("Target or source column not found");
|
|
444
|
-
if (
|
|
445
|
-
|
|
78
|
+
if (m === o) {
|
|
79
|
+
b();
|
|
446
80
|
return;
|
|
447
81
|
}
|
|
448
|
-
if (
|
|
449
|
-
throw new Error(`Column "${
|
|
450
|
-
|
|
451
|
-
} catch (
|
|
452
|
-
|
|
82
|
+
if (l.limit && l.cards.length >= l.limit)
|
|
83
|
+
throw new Error(`Column "${l.title}" has reached its limit of ${l.limit} cards`);
|
|
84
|
+
i == null || i(g, m, o), a == null || a(g, y.title, l.title);
|
|
85
|
+
} catch (g) {
|
|
86
|
+
c == null || c(g instanceof Error ? g : new Error("Drop failed"));
|
|
453
87
|
} finally {
|
|
454
|
-
|
|
88
|
+
b();
|
|
455
89
|
}
|
|
456
|
-
}, [
|
|
457
|
-
|
|
458
|
-
}, [
|
|
459
|
-
const
|
|
460
|
-
if (!
|
|
461
|
-
const
|
|
462
|
-
let
|
|
463
|
-
if (
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
|
|
90
|
+
}, [s, D, i, c, b, a]), C = h(() => {
|
|
91
|
+
q.current && (document.body.removeChild(q.current), q.current = null), b();
|
|
92
|
+
}, [b]), $ = h((u) => {
|
|
93
|
+
const o = u.target.closest(".kanban-container");
|
|
94
|
+
if (!o) return;
|
|
95
|
+
const g = o.getBoundingClientRect(), m = u.clientX - g.left, l = g.width;
|
|
96
|
+
let y = 0;
|
|
97
|
+
if (m < ct ? y = -dt : m > l - ct && (y = dt), y !== 0) {
|
|
98
|
+
_.current && clearTimeout(_.current);
|
|
99
|
+
const S = () => {
|
|
100
|
+
o.scrollLeft += y, _.current = setTimeout(S, 16);
|
|
467
101
|
};
|
|
468
|
-
|
|
102
|
+
_.current = setTimeout(S, 100);
|
|
469
103
|
} else
|
|
470
|
-
|
|
471
|
-
}, []),
|
|
472
|
-
if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Enter", "Space", "Escape"].includes(
|
|
104
|
+
_.current && (clearTimeout(_.current), _.current = null);
|
|
105
|
+
}, []), L = h((u, o) => {
|
|
106
|
+
if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Enter", "Space", "Escape"].includes(u.key))
|
|
473
107
|
return;
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
if (!
|
|
477
|
-
const { column:
|
|
108
|
+
u.preventDefault();
|
|
109
|
+
const g = Y(o._id);
|
|
110
|
+
if (!g) return;
|
|
111
|
+
const { column: m } = g, l = d.findIndex((y) => y._id === m._id);
|
|
478
112
|
try {
|
|
479
|
-
switch (
|
|
113
|
+
switch (u.key) {
|
|
480
114
|
case "ArrowLeft":
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
483
|
-
|
|
115
|
+
if (l > 0) {
|
|
116
|
+
const y = d[l - 1];
|
|
117
|
+
i == null || i(o, m._id, y._id), a == null || a(o, m.title, y.title);
|
|
484
118
|
}
|
|
485
119
|
break;
|
|
486
120
|
case "ArrowRight":
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
|
|
121
|
+
if (l < d.length - 1) {
|
|
122
|
+
const y = d[l + 1];
|
|
123
|
+
i == null || i(o, m._id, y._id), a == null || a(o, m.title, y.title);
|
|
490
124
|
}
|
|
491
125
|
break;
|
|
492
126
|
case "ArrowUp":
|
|
493
|
-
|
|
127
|
+
a == null || a(o, "current position", "position above");
|
|
494
128
|
break;
|
|
495
129
|
case "ArrowDown":
|
|
496
|
-
|
|
130
|
+
a == null || a(o, "current position", "position below");
|
|
497
131
|
break;
|
|
498
132
|
case "Enter":
|
|
499
133
|
case "Space":
|
|
500
|
-
|
|
134
|
+
a == null || a(o, m.title, "drag mode");
|
|
501
135
|
break;
|
|
502
136
|
case "Escape":
|
|
503
|
-
|
|
137
|
+
a == null || a(o, "drag mode", "cancelled");
|
|
504
138
|
break;
|
|
505
139
|
}
|
|
506
|
-
} catch (
|
|
507
|
-
|
|
140
|
+
} catch (y) {
|
|
141
|
+
c == null || c(y instanceof Error ? y : new Error("Keyboard navigation failed"));
|
|
508
142
|
}
|
|
509
|
-
}, [
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
x:
|
|
513
|
-
y:
|
|
514
|
-
card:
|
|
143
|
+
}, [Y, d, i, c, a]), I = h((u, o) => {
|
|
144
|
+
const g = u.touches[0];
|
|
145
|
+
K.current = {
|
|
146
|
+
x: g.clientX,
|
|
147
|
+
y: g.clientY,
|
|
148
|
+
card: o
|
|
515
149
|
};
|
|
516
|
-
}, []),
|
|
517
|
-
if (!
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
|
|
150
|
+
}, []), H = h((u) => {
|
|
151
|
+
if (!K.current) return;
|
|
152
|
+
const o = u.touches[0], g = Math.abs(o.clientX - K.current.x), m = Math.abs(o.clientY - K.current.y);
|
|
153
|
+
if (g > ut || m > ut) {
|
|
154
|
+
const l = K.current.card, y = D(l.columnId);
|
|
155
|
+
if (!y) return;
|
|
156
|
+
O({
|
|
523
157
|
isDragging: !0,
|
|
524
|
-
draggedCard:
|
|
158
|
+
draggedCard: l,
|
|
525
159
|
dragOverColumn: null,
|
|
526
160
|
dragOverPosition: null,
|
|
527
|
-
dragSourceColumn:
|
|
528
|
-
}),
|
|
161
|
+
dragSourceColumn: y._id
|
|
162
|
+
}), a == null || a(l, y.title, "being moved");
|
|
529
163
|
}
|
|
530
|
-
}, [
|
|
531
|
-
if (!
|
|
532
|
-
|
|
164
|
+
}, [D, a]), p = h((u) => {
|
|
165
|
+
if (!s.isDragging || !s.draggedCard || !K.current) {
|
|
166
|
+
K.current = null;
|
|
533
167
|
return;
|
|
534
168
|
}
|
|
535
169
|
try {
|
|
536
|
-
const
|
|
537
|
-
if (
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
if (
|
|
541
|
-
throw new Error(`Column "${
|
|
542
|
-
|
|
170
|
+
const o = u.changedTouches[0], g = document.elementFromPoint(o.clientX, o.clientY), m = g == null ? void 0 : g.closest("[data-column-id]");
|
|
171
|
+
if (m) {
|
|
172
|
+
const l = m.dataset.columnId, y = s.draggedCard, S = s.dragSourceColumn, Q = D(l), J = D(S);
|
|
173
|
+
if (Q && J && S !== l) {
|
|
174
|
+
if (Q.limit && Q.cards.length >= Q.limit)
|
|
175
|
+
throw new Error(`Column "${Q.title}" has reached its limit of ${Q.limit} cards`);
|
|
176
|
+
i == null || i(y, S, l), a == null || a(y, J.title, Q.title);
|
|
543
177
|
}
|
|
544
178
|
}
|
|
545
|
-
} catch (
|
|
546
|
-
|
|
179
|
+
} catch (o) {
|
|
180
|
+
c == null || c(o instanceof Error ? o : new Error("Touch drop failed"));
|
|
547
181
|
} finally {
|
|
548
|
-
|
|
182
|
+
K.current = null, b();
|
|
549
183
|
}
|
|
550
|
-
}, [
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
document.body.removeChild(
|
|
554
|
-
}, 1e3), console.log(`Kanban: ${
|
|
184
|
+
}, [s, D, i, c, b, a]), T = h((u, o, g) => {
|
|
185
|
+
const m = `Moved "${u.title}" from ${o} to ${g}`, l = document.createElement("div");
|
|
186
|
+
l.setAttribute("aria-live", "polite"), l.setAttribute("aria-atomic", "true"), l.className = "sr-only", l.textContent = m, document.body.appendChild(l), setTimeout(() => {
|
|
187
|
+
document.body.removeChild(l);
|
|
188
|
+
}, 1e3), console.log(`Kanban: ${m}`);
|
|
555
189
|
}, []);
|
|
556
|
-
return
|
|
557
|
-
|
|
190
|
+
return rt(() => () => {
|
|
191
|
+
_.current && clearTimeout(_.current), q.current && document.body.contains(q.current) && document.body.removeChild(q.current);
|
|
558
192
|
}, []), {
|
|
559
193
|
// State
|
|
560
|
-
isDragging:
|
|
561
|
-
draggedCard:
|
|
562
|
-
dragOverColumn:
|
|
563
|
-
dragOverPosition:
|
|
564
|
-
dragSourceColumn:
|
|
194
|
+
isDragging: s.isDragging,
|
|
195
|
+
draggedCard: s.draggedCard,
|
|
196
|
+
dragOverColumn: s.dragOverColumn,
|
|
197
|
+
dragOverPosition: s.dragOverPosition,
|
|
198
|
+
dragSourceColumn: s.dragSourceColumn,
|
|
565
199
|
// Handlers
|
|
566
|
-
handleDragStart:
|
|
567
|
-
handleDragOver:
|
|
568
|
-
handleDrop:
|
|
569
|
-
handleDragEnd:
|
|
570
|
-
handleKeyDown:
|
|
571
|
-
handleTouchStart:
|
|
572
|
-
handleTouchMove:
|
|
573
|
-
handleTouchEnd:
|
|
200
|
+
handleDragStart: P,
|
|
201
|
+
handleDragOver: z,
|
|
202
|
+
handleDrop: V,
|
|
203
|
+
handleDragEnd: C,
|
|
204
|
+
handleKeyDown: L,
|
|
205
|
+
handleTouchStart: I,
|
|
206
|
+
handleTouchMove: H,
|
|
207
|
+
handleTouchEnd: p,
|
|
574
208
|
// Utilities
|
|
575
|
-
announceMove:
|
|
576
|
-
reset:
|
|
209
|
+
announceMove: a || T,
|
|
210
|
+
reset: b
|
|
577
211
|
};
|
|
578
212
|
}
|
|
579
|
-
function
|
|
580
|
-
var
|
|
213
|
+
function Xt(i) {
|
|
214
|
+
var at, nt, it;
|
|
581
215
|
const {
|
|
582
|
-
columns:
|
|
583
|
-
source:
|
|
584
|
-
enableDragDrop:
|
|
585
|
-
initialState:
|
|
586
|
-
onCardMove:
|
|
587
|
-
onCardCreate:
|
|
588
|
-
onCardUpdate:
|
|
589
|
-
onCardDelete:
|
|
590
|
-
onError:
|
|
591
|
-
} =
|
|
592
|
-
query: (
|
|
593
|
-
}), [
|
|
594
|
-
field: ((
|
|
595
|
-
direction: ((
|
|
596
|
-
}), [
|
|
597
|
-
const
|
|
598
|
-
return
|
|
599
|
-
|
|
600
|
-
}),
|
|
601
|
-
}),
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}, [
|
|
605
|
-
const
|
|
606
|
-
initialConditions:
|
|
607
|
-
initialOperator: (
|
|
608
|
-
}),
|
|
609
|
-
const
|
|
216
|
+
columns: c,
|
|
217
|
+
source: d,
|
|
218
|
+
enableDragDrop: a = !0,
|
|
219
|
+
initialState: s,
|
|
220
|
+
onCardMove: O,
|
|
221
|
+
onCardCreate: q,
|
|
222
|
+
onCardUpdate: _,
|
|
223
|
+
onCardDelete: K,
|
|
224
|
+
onError: b
|
|
225
|
+
} = i, [D, Y] = G({
|
|
226
|
+
query: (s == null ? void 0 : s.search) || ""
|
|
227
|
+
}), [P] = G({
|
|
228
|
+
field: ((at = s == null ? void 0 : s.sorting) == null ? void 0 : at.field) || null,
|
|
229
|
+
direction: ((nt = s == null ? void 0 : s.sorting) == null ? void 0 : nt.direction) || null
|
|
230
|
+
}), [z, V] = G(() => {
|
|
231
|
+
const t = {};
|
|
232
|
+
return c.forEach((e) => {
|
|
233
|
+
t[e.id] = 10;
|
|
234
|
+
}), t;
|
|
235
|
+
}), C = k(b), $ = k(O), L = k(q), I = k(_), H = k(K);
|
|
236
|
+
rt(() => {
|
|
237
|
+
C.current = b, $.current = O, L.current = q, I.current = _, H.current = K;
|
|
238
|
+
}, [b, O, q, _, K]);
|
|
239
|
+
const p = At(), T = Et({
|
|
240
|
+
initialConditions: s == null ? void 0 : s.filters,
|
|
241
|
+
initialOperator: (s == null ? void 0 : s.filterOperator) || "And"
|
|
242
|
+
}), u = h((t) => {
|
|
243
|
+
const e = {
|
|
610
244
|
LHSField: "columnId",
|
|
611
245
|
Operator: "EQ",
|
|
612
|
-
RHSValue:
|
|
246
|
+
RHSValue: t,
|
|
613
247
|
RHSType: "Constant"
|
|
614
|
-
},
|
|
615
|
-
let
|
|
616
|
-
|
|
617
|
-
...
|
|
618
|
-
Condition: [...
|
|
619
|
-
} :
|
|
248
|
+
}, r = T.payload;
|
|
249
|
+
let n;
|
|
250
|
+
r ? r.Operator === "And" ? n = {
|
|
251
|
+
...r,
|
|
252
|
+
Condition: [...r.Condition || [], e]
|
|
253
|
+
} : n = {
|
|
620
254
|
Operator: "And",
|
|
621
|
-
Condition: [
|
|
622
|
-
} :
|
|
255
|
+
Condition: [r, e]
|
|
256
|
+
} : n = {
|
|
623
257
|
Operator: "And",
|
|
624
|
-
Condition: [
|
|
258
|
+
Condition: [e]
|
|
625
259
|
};
|
|
626
|
-
const
|
|
260
|
+
const f = {
|
|
627
261
|
Page: 1,
|
|
628
262
|
// Always page 1 due to expanding PageSize strategy
|
|
629
|
-
PageSize:
|
|
630
|
-
Filter:
|
|
263
|
+
PageSize: z[t] || 10,
|
|
264
|
+
Filter: n
|
|
631
265
|
};
|
|
632
|
-
return
|
|
633
|
-
{ [String(
|
|
266
|
+
return P.field && P.direction ? f.Sort = [
|
|
267
|
+
{ [String(P.field)]: P.direction === "asc" ? "ASC" : "DESC" },
|
|
634
268
|
{ position: "ASC" }
|
|
635
|
-
] :
|
|
269
|
+
] : f.Sort = [
|
|
636
270
|
{ columnId: "ASC" },
|
|
637
271
|
{ position: "ASC" }
|
|
638
|
-
],
|
|
639
|
-
}, [
|
|
640
|
-
queries:
|
|
641
|
-
const
|
|
272
|
+
], D.query && (f.Search = D.query), f;
|
|
273
|
+
}, [T.payload, z, P, D.query]), o = Tt({
|
|
274
|
+
queries: c.map((t) => {
|
|
275
|
+
const e = u(t.id);
|
|
642
276
|
return {
|
|
643
|
-
queryKey: ["kanban-cards",
|
|
277
|
+
queryKey: ["kanban-cards", d, t.id, e],
|
|
644
278
|
queryFn: async () => {
|
|
645
279
|
try {
|
|
646
|
-
return await
|
|
647
|
-
} catch (
|
|
648
|
-
throw
|
|
280
|
+
return await F(d).list(e);
|
|
281
|
+
} catch (r) {
|
|
282
|
+
throw r;
|
|
649
283
|
}
|
|
650
284
|
},
|
|
651
|
-
placeholderData:
|
|
285
|
+
placeholderData: kt,
|
|
652
286
|
staleTime: 30 * 1e3
|
|
653
287
|
};
|
|
654
288
|
})
|
|
655
|
-
}),
|
|
656
|
-
await Promise.all(
|
|
657
|
-
},
|
|
658
|
-
const
|
|
659
|
-
return
|
|
660
|
-
}, [
|
|
661
|
-
data:
|
|
662
|
-
isLoading:
|
|
663
|
-
error:
|
|
664
|
-
} =
|
|
665
|
-
queryKey: ["kanban-count",
|
|
289
|
+
}), g = o.some((t) => t.isLoading), m = o.some((t) => t.isFetching), l = ((it = o.find((t) => t.error)) == null ? void 0 : it.error) || null, y = async () => {
|
|
290
|
+
await Promise.all(o.map((t) => t.refetch()));
|
|
291
|
+
}, S = ot(() => {
|
|
292
|
+
const t = {};
|
|
293
|
+
return D.query && (t.Search = D.query), T.payload && (t.Filter = T.payload), t;
|
|
294
|
+
}, [D.query, T.payload]), {
|
|
295
|
+
data: Q,
|
|
296
|
+
isLoading: J,
|
|
297
|
+
error: lt
|
|
298
|
+
} = Pt({
|
|
299
|
+
queryKey: ["kanban-count", d, S],
|
|
666
300
|
queryFn: async () => {
|
|
667
301
|
try {
|
|
668
|
-
return await
|
|
669
|
-
} catch (
|
|
670
|
-
throw
|
|
302
|
+
return await F(d).count(S);
|
|
303
|
+
} catch (t) {
|
|
304
|
+
throw C.current && C.current(t), t;
|
|
671
305
|
}
|
|
672
306
|
},
|
|
673
307
|
staleTime: 30 * 1e3,
|
|
674
308
|
gcTime: 60 * 1e3
|
|
675
|
-
}),
|
|
676
|
-
mutationFn: async (
|
|
677
|
-
const
|
|
678
|
-
return (await
|
|
309
|
+
}), et = j({
|
|
310
|
+
mutationFn: async (t) => {
|
|
311
|
+
const e = t.position ?? 999999;
|
|
312
|
+
return (await F(d).create({ ...t, position: e }))._id;
|
|
679
313
|
},
|
|
680
|
-
onMutate: async (
|
|
681
|
-
const
|
|
682
|
-
await
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
685
|
-
const
|
|
686
|
-
...
|
|
687
|
-
_id:
|
|
688
|
-
position:
|
|
314
|
+
onMutate: async (t) => {
|
|
315
|
+
const e = t.columnId, r = u(e), n = ["kanban-cards", d, e, r];
|
|
316
|
+
await p.cancelQueries({ queryKey: n });
|
|
317
|
+
const f = p.getQueryData(n);
|
|
318
|
+
if (f) {
|
|
319
|
+
const U = f.Data, A = t.position ?? U.length, X = `temp-${Date.now()}`, E = {
|
|
320
|
+
...t,
|
|
321
|
+
_id: X,
|
|
322
|
+
position: A,
|
|
689
323
|
_created_at: /* @__PURE__ */ new Date(),
|
|
690
324
|
_modified_at: /* @__PURE__ */ new Date()
|
|
691
325
|
};
|
|
692
|
-
|
|
693
|
-
...
|
|
694
|
-
Data: [...
|
|
326
|
+
p.setQueryData(n, {
|
|
327
|
+
...f,
|
|
328
|
+
Data: [...f.Data, E]
|
|
695
329
|
});
|
|
696
330
|
}
|
|
697
|
-
return { previousCards:
|
|
331
|
+
return { previousCards: f, queryKey: n };
|
|
698
332
|
},
|
|
699
|
-
onSuccess: async (
|
|
700
|
-
var
|
|
701
|
-
|
|
702
|
-
_id:
|
|
703
|
-
...
|
|
333
|
+
onSuccess: async (t, e, r) => {
|
|
334
|
+
var n;
|
|
335
|
+
r != null && r.queryKey && await p.invalidateQueries({ queryKey: r.queryKey }), (n = L.current) == null || n.call(L, {
|
|
336
|
+
_id: t,
|
|
337
|
+
...e
|
|
704
338
|
});
|
|
705
339
|
},
|
|
706
|
-
onError: (
|
|
707
|
-
var
|
|
708
|
-
|
|
340
|
+
onError: (t, e, r) => {
|
|
341
|
+
var n;
|
|
342
|
+
r != null && r.previousCards && (r != null && r.queryKey) && p.setQueryData(r.queryKey, r.previousCards), (n = C.current) == null || n.call(C, t);
|
|
709
343
|
},
|
|
710
|
-
onSettled: (
|
|
711
|
-
const
|
|
712
|
-
|
|
344
|
+
onSettled: (t, e, r) => {
|
|
345
|
+
const n = r.columnId, f = u(n);
|
|
346
|
+
p.invalidateQueries({ queryKey: ["kanban-cards", d, n, f] });
|
|
713
347
|
}
|
|
714
|
-
}),
|
|
715
|
-
mutationFn: async ({ id:
|
|
716
|
-
onMutate: async () => (await
|
|
717
|
-
onSuccess: async (
|
|
718
|
-
var
|
|
719
|
-
(
|
|
348
|
+
}), Z = j({
|
|
349
|
+
mutationFn: async ({ id: t, updates: e }) => (await F(d).update(t, e), { id: t, updates: e }),
|
|
350
|
+
onMutate: async () => (await p.cancelQueries({ queryKey: ["kanban-cards", d] }), {}),
|
|
351
|
+
onSuccess: async (t) => {
|
|
352
|
+
var e;
|
|
353
|
+
(e = I.current) == null || e.call(I, { _id: t.id, ...t.updates });
|
|
720
354
|
},
|
|
721
|
-
onError: (
|
|
722
|
-
var
|
|
723
|
-
(
|
|
355
|
+
onError: (t, e, r) => {
|
|
356
|
+
var n;
|
|
357
|
+
(n = C.current) == null || n.call(C, t);
|
|
724
358
|
},
|
|
725
359
|
onSettled: () => {
|
|
726
|
-
|
|
360
|
+
p.invalidateQueries({ queryKey: ["kanban-cards", d] });
|
|
727
361
|
}
|
|
728
|
-
}),
|
|
729
|
-
mutationFn: async (
|
|
730
|
-
onMutate: async () => (await
|
|
731
|
-
onSuccess: async (
|
|
732
|
-
var
|
|
733
|
-
(
|
|
362
|
+
}), v = j({
|
|
363
|
+
mutationFn: async (t) => (await F(d).delete(t), t),
|
|
364
|
+
onMutate: async () => (await p.cancelQueries({ queryKey: ["kanban-cards", d] }), {}),
|
|
365
|
+
onSuccess: async (t) => {
|
|
366
|
+
var e;
|
|
367
|
+
(e = H.current) == null || e.call(H, t);
|
|
734
368
|
},
|
|
735
|
-
onError: (
|
|
736
|
-
var
|
|
737
|
-
(
|
|
369
|
+
onError: (t, e, r) => {
|
|
370
|
+
var n;
|
|
371
|
+
(n = C.current) == null || n.call(C, t);
|
|
738
372
|
},
|
|
739
373
|
onSettled: () => {
|
|
740
|
-
|
|
374
|
+
p.invalidateQueries({ queryKey: ["kanban-cards", d] });
|
|
741
375
|
}
|
|
742
|
-
}),
|
|
743
|
-
mutationFn: async ({ cardId:
|
|
744
|
-
const
|
|
745
|
-
return await
|
|
376
|
+
}), B = j({
|
|
377
|
+
mutationFn: async ({ cardId: t, fromColumnId: e, toColumnId: r, position: n }) => {
|
|
378
|
+
const f = { columnId: r, ...n !== void 0 && { position: n } };
|
|
379
|
+
return await F(d).update(t, f), { cardId: t, fromColumnId: e, toColumnId: r, position: n };
|
|
746
380
|
},
|
|
747
|
-
onMutate: async ({ cardId:
|
|
748
|
-
const
|
|
749
|
-
await
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
...
|
|
756
|
-
Data:
|
|
757
|
-
},
|
|
758
|
-
...
|
|
759
|
-
columnId:
|
|
760
|
-
position:
|
|
381
|
+
onMutate: async ({ cardId: t, fromColumnId: e, toColumnId: r, position: n }) => {
|
|
382
|
+
const f = u(e), U = u(r), A = ["kanban-cards", d, e, f], X = ["kanban-cards", d, r, U];
|
|
383
|
+
await p.cancelQueries({ queryKey: A }), await p.cancelQueries({ queryKey: X });
|
|
384
|
+
const E = p.getQueryData(A), N = p.getQueryData(X);
|
|
385
|
+
if (E && N) {
|
|
386
|
+
const st = E.Data.find((M) => M._id === t);
|
|
387
|
+
if (st) {
|
|
388
|
+
const M = {
|
|
389
|
+
...E,
|
|
390
|
+
Data: E.Data.filter((tt) => tt._id !== t)
|
|
391
|
+
}, St = {
|
|
392
|
+
...st,
|
|
393
|
+
columnId: r,
|
|
394
|
+
position: n ?? N.Data.length,
|
|
761
395
|
_modified_at: /* @__PURE__ */ new Date()
|
|
762
|
-
},
|
|
763
|
-
...
|
|
764
|
-
Data: [...
|
|
396
|
+
}, Ot = {
|
|
397
|
+
...N,
|
|
398
|
+
Data: [...N.Data, St].sort((tt, Kt) => tt.position - Kt.position)
|
|
765
399
|
};
|
|
766
|
-
|
|
400
|
+
p.setQueryData(A, M), p.setQueryData(X, Ot);
|
|
767
401
|
}
|
|
768
402
|
}
|
|
769
403
|
return {
|
|
770
|
-
previousFromData:
|
|
771
|
-
previousToData:
|
|
772
|
-
fromQueryKey:
|
|
773
|
-
toQueryKey:
|
|
774
|
-
fromColumnId:
|
|
775
|
-
toColumnId:
|
|
404
|
+
previousFromData: E,
|
|
405
|
+
previousToData: N,
|
|
406
|
+
fromQueryKey: A,
|
|
407
|
+
toQueryKey: X,
|
|
408
|
+
fromColumnId: e,
|
|
409
|
+
toColumnId: r
|
|
776
410
|
};
|
|
777
411
|
},
|
|
778
|
-
onSuccess: async (
|
|
779
|
-
var
|
|
780
|
-
(
|
|
781
|
-
|
|
782
|
-
{ _id:
|
|
783
|
-
|
|
784
|
-
|
|
412
|
+
onSuccess: async (t) => {
|
|
413
|
+
var e;
|
|
414
|
+
(e = $.current) == null || e.call(
|
|
415
|
+
$,
|
|
416
|
+
{ _id: t.cardId },
|
|
417
|
+
t.fromColumnId,
|
|
418
|
+
t.toColumnId
|
|
785
419
|
);
|
|
786
420
|
},
|
|
787
|
-
onError: (
|
|
788
|
-
var
|
|
789
|
-
|
|
421
|
+
onError: (t, e, r) => {
|
|
422
|
+
var n;
|
|
423
|
+
r != null && r.previousFromData && (r != null && r.fromQueryKey) && p.setQueryData(r.fromQueryKey, r.previousFromData), r != null && r.previousToData && (r != null && r.toQueryKey) && p.setQueryData(r.toQueryKey, r.previousToData), (n = C.current) == null || n.call(C, t);
|
|
790
424
|
},
|
|
791
|
-
onSettled: (
|
|
792
|
-
const
|
|
793
|
-
|
|
425
|
+
onSettled: (t, e, r) => {
|
|
426
|
+
const n = u(r.fromColumnId), f = u(r.toColumnId);
|
|
427
|
+
p.invalidateQueries({ queryKey: ["kanban-cards", d, r.fromColumnId, n] }), p.invalidateQueries({ queryKey: ["kanban-cards", d, r.toColumnId, f] });
|
|
794
428
|
}
|
|
795
|
-
}),
|
|
796
|
-
mutationFn: async ({ cardIds:
|
|
797
|
-
const
|
|
429
|
+
}), x = j({
|
|
430
|
+
mutationFn: async ({ cardIds: t, columnId: e }) => {
|
|
431
|
+
const r = t.map((n, f) => ({ id: n, position: f, columnId: e }));
|
|
798
432
|
await Promise.all(
|
|
799
|
-
|
|
800
|
-
(
|
|
433
|
+
r.map(
|
|
434
|
+
(n) => F(d).update(n.id, { position: n.position, columnId: n.columnId })
|
|
801
435
|
)
|
|
802
436
|
);
|
|
803
437
|
},
|
|
804
|
-
onMutate: async ({ columnId:
|
|
805
|
-
const
|
|
806
|
-
return await
|
|
438
|
+
onMutate: async ({ columnId: t }) => {
|
|
439
|
+
const e = u(t), r = ["kanban-cards", d, t, e];
|
|
440
|
+
return await p.cancelQueries({ queryKey: r }), {};
|
|
807
441
|
},
|
|
808
442
|
onSuccess: () => {
|
|
809
443
|
},
|
|
810
|
-
onError: (
|
|
811
|
-
var
|
|
812
|
-
(
|
|
444
|
+
onError: (t, e, r) => {
|
|
445
|
+
var n;
|
|
446
|
+
(n = C.current) == null || n.call(C, t);
|
|
813
447
|
},
|
|
814
|
-
onSettled: (
|
|
815
|
-
const
|
|
816
|
-
|
|
448
|
+
onSettled: (t, e, r) => {
|
|
449
|
+
const n = u(r.columnId);
|
|
450
|
+
p.invalidateQueries({ queryKey: ["kanban-cards", d, r.columnId, n] });
|
|
817
451
|
}
|
|
818
|
-
}),
|
|
819
|
-
async (
|
|
452
|
+
}), gt = h(
|
|
453
|
+
async (t, e, r) => {
|
|
820
454
|
try {
|
|
821
|
-
await
|
|
822
|
-
cardId:
|
|
823
|
-
fromColumnId:
|
|
824
|
-
toColumnId:
|
|
455
|
+
await B.mutateAsync({
|
|
456
|
+
cardId: t._id,
|
|
457
|
+
fromColumnId: e,
|
|
458
|
+
toColumnId: r,
|
|
825
459
|
position: void 0
|
|
826
460
|
});
|
|
827
461
|
} catch {
|
|
828
462
|
}
|
|
829
463
|
},
|
|
830
|
-
[
|
|
831
|
-
),
|
|
832
|
-
var
|
|
833
|
-
const
|
|
464
|
+
[B]
|
|
465
|
+
), R = ot(() => c.sort((t, e) => t.position - e.position).map((t, e) => {
|
|
466
|
+
var f;
|
|
467
|
+
const n = ((f = o[e].data) == null ? void 0 : f.Data) || [];
|
|
834
468
|
return {
|
|
835
|
-
_id:
|
|
836
|
-
title:
|
|
837
|
-
position:
|
|
838
|
-
color:
|
|
839
|
-
limit:
|
|
840
|
-
cards:
|
|
469
|
+
_id: t.id,
|
|
470
|
+
title: t.title,
|
|
471
|
+
position: t.position,
|
|
472
|
+
color: t.color,
|
|
473
|
+
limit: t.limit,
|
|
474
|
+
cards: n.sort((U, A) => U.position - A.position),
|
|
841
475
|
_created_at: /* @__PURE__ */ new Date(),
|
|
842
476
|
_modified_at: /* @__PURE__ */ new Date()
|
|
843
477
|
};
|
|
844
|
-
}), [
|
|
845
|
-
onCardMove:
|
|
846
|
-
onError:
|
|
847
|
-
columns:
|
|
848
|
-
announceMove: (
|
|
478
|
+
}), [c, o]), w = Ft({
|
|
479
|
+
onCardMove: gt,
|
|
480
|
+
onError: C.current,
|
|
481
|
+
columns: R,
|
|
482
|
+
announceMove: (t, e, r) => {
|
|
849
483
|
console.log(
|
|
850
|
-
`Kanban: Moved "${
|
|
484
|
+
`Kanban: Moved "${t.title}" from ${e} to ${r}`
|
|
851
485
|
);
|
|
852
486
|
}
|
|
853
|
-
}),
|
|
854
|
-
(
|
|
855
|
-
var
|
|
487
|
+
}), yt = h(
|
|
488
|
+
(t) => {
|
|
489
|
+
var e, r;
|
|
856
490
|
return {
|
|
857
491
|
draggable: !0,
|
|
858
492
|
role: "option",
|
|
859
|
-
"aria-selected":
|
|
860
|
-
"aria-grabbed":
|
|
861
|
-
onDragStart: (
|
|
862
|
-
if (!
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
493
|
+
"aria-selected": a && ((e = w.draggedCard) == null ? void 0 : e._id) === t._id,
|
|
494
|
+
"aria-grabbed": a && ((r = w.draggedCard) == null ? void 0 : r._id) === t._id,
|
|
495
|
+
onDragStart: (n) => {
|
|
496
|
+
if (!a) return;
|
|
497
|
+
n.dataTransfer.setData("text/plain", JSON.stringify(t));
|
|
498
|
+
const f = n.nativeEvent || n;
|
|
499
|
+
w.handleDragStart(f, t);
|
|
866
500
|
},
|
|
867
|
-
onDragEnd:
|
|
868
|
-
onKeyDown: (
|
|
869
|
-
if (!
|
|
870
|
-
const
|
|
871
|
-
|
|
501
|
+
onDragEnd: w.handleDragEnd,
|
|
502
|
+
onKeyDown: (n) => {
|
|
503
|
+
if (!a) return;
|
|
504
|
+
const f = n.nativeEvent || n;
|
|
505
|
+
w.handleKeyDown(f, t);
|
|
872
506
|
}
|
|
873
507
|
};
|
|
874
508
|
},
|
|
875
|
-
[
|
|
876
|
-
),
|
|
877
|
-
(
|
|
878
|
-
"data-column-id":
|
|
509
|
+
[a, w]
|
|
510
|
+
), mt = h(
|
|
511
|
+
(t) => ({
|
|
512
|
+
"data-column-id": t,
|
|
879
513
|
role: "listbox",
|
|
880
|
-
onDragOver: (
|
|
881
|
-
if (!
|
|
882
|
-
const
|
|
883
|
-
|
|
514
|
+
onDragOver: (e) => {
|
|
515
|
+
if (!a) return;
|
|
516
|
+
const r = e.nativeEvent || e;
|
|
517
|
+
w.handleDragOver(r, t);
|
|
884
518
|
},
|
|
885
|
-
onDrop: (
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
888
|
-
|
|
519
|
+
onDrop: (e) => {
|
|
520
|
+
if (!a) return;
|
|
521
|
+
const r = e.nativeEvent || e;
|
|
522
|
+
w.handleDrop(r, t);
|
|
889
523
|
}
|
|
890
524
|
}),
|
|
891
|
-
[
|
|
892
|
-
),
|
|
893
|
-
|
|
894
|
-
}, []),
|
|
895
|
-
|
|
896
|
-
}, []),
|
|
897
|
-
await
|
|
898
|
-
}, [
|
|
899
|
-
await
|
|
900
|
-
predicate: (
|
|
525
|
+
[a, w]
|
|
526
|
+
), ft = h((t) => {
|
|
527
|
+
Y({ query: t });
|
|
528
|
+
}, []), pt = h(() => {
|
|
529
|
+
Y({ query: "" });
|
|
530
|
+
}, []), ht = (Q == null ? void 0 : Q.Count) || 0, Ct = g || J, Dt = m, wt = et.isPending || Z.isPending || v.isPending || B.isPending || x.isPending, W = l || lt, _t = h(async () => {
|
|
531
|
+
await y();
|
|
532
|
+
}, [y]), bt = h(async () => {
|
|
533
|
+
await p.invalidateQueries({
|
|
534
|
+
predicate: (t) => t.queryKey[0] === "kanban-cards" || t.queryKey[0] === "kanban-count"
|
|
901
535
|
});
|
|
902
|
-
}, [
|
|
903
|
-
return
|
|
904
|
-
|
|
905
|
-
}, [
|
|
536
|
+
}, [p]);
|
|
537
|
+
return rt(() => {
|
|
538
|
+
W && C.current && C.current(W);
|
|
539
|
+
}, [W]), {
|
|
906
540
|
// Data
|
|
907
|
-
columns:
|
|
908
|
-
totalCards:
|
|
541
|
+
columns: R,
|
|
542
|
+
totalCards: ht,
|
|
909
543
|
// Loading States
|
|
910
|
-
isLoading:
|
|
911
|
-
isFetching:
|
|
912
|
-
isUpdating:
|
|
544
|
+
isLoading: Ct,
|
|
545
|
+
isFetching: Dt,
|
|
546
|
+
isUpdating: wt,
|
|
913
547
|
// Error Handling
|
|
914
|
-
error:
|
|
548
|
+
error: W,
|
|
915
549
|
// Card Operations (Flat Access)
|
|
916
|
-
createCard:
|
|
917
|
-
updateCard:
|
|
918
|
-
async (
|
|
919
|
-
await
|
|
550
|
+
createCard: et.mutateAsync,
|
|
551
|
+
updateCard: h(
|
|
552
|
+
async (t, e) => {
|
|
553
|
+
await Z.mutateAsync({ id: t, updates: e });
|
|
920
554
|
},
|
|
921
|
-
[
|
|
555
|
+
[Z]
|
|
922
556
|
),
|
|
923
|
-
deleteCard:
|
|
924
|
-
async (
|
|
925
|
-
await
|
|
557
|
+
deleteCard: h(
|
|
558
|
+
async (t) => {
|
|
559
|
+
await v.mutateAsync(t);
|
|
926
560
|
},
|
|
927
|
-
[
|
|
561
|
+
[v]
|
|
928
562
|
),
|
|
929
|
-
moveCard:
|
|
930
|
-
async (
|
|
931
|
-
if (!
|
|
932
|
-
for (const
|
|
933
|
-
if (
|
|
934
|
-
|
|
563
|
+
moveCard: h(
|
|
564
|
+
async (t, e, r, n) => {
|
|
565
|
+
if (!n) {
|
|
566
|
+
for (const f of R)
|
|
567
|
+
if (f.cards.find((A) => A._id === t)) {
|
|
568
|
+
n = f._id;
|
|
935
569
|
break;
|
|
936
570
|
}
|
|
937
|
-
if (!
|
|
938
|
-
throw new Error(`Card ${
|
|
571
|
+
if (!n)
|
|
572
|
+
throw new Error(`Card ${t} not found in any column`);
|
|
939
573
|
}
|
|
940
|
-
await
|
|
574
|
+
await B.mutateAsync({ cardId: t, fromColumnId: n, toColumnId: e, position: r });
|
|
941
575
|
},
|
|
942
|
-
[
|
|
576
|
+
[B, R]
|
|
943
577
|
),
|
|
944
|
-
reorderCards:
|
|
945
|
-
async (
|
|
946
|
-
await
|
|
578
|
+
reorderCards: h(
|
|
579
|
+
async (t, e) => {
|
|
580
|
+
await x.mutateAsync({ cardIds: t, columnId: e });
|
|
947
581
|
},
|
|
948
|
-
[
|
|
582
|
+
[x]
|
|
949
583
|
),
|
|
950
584
|
// Search (Flat Access)
|
|
951
|
-
searchQuery:
|
|
952
|
-
setSearchQuery:
|
|
953
|
-
clearSearch:
|
|
585
|
+
searchQuery: D.query,
|
|
586
|
+
setSearchQuery: ft,
|
|
587
|
+
clearSearch: pt,
|
|
954
588
|
// Filter (Simplified chainable API)
|
|
955
|
-
filter:
|
|
589
|
+
filter: T,
|
|
956
590
|
// Drag Drop (Flat Access)
|
|
957
|
-
isDragging:
|
|
958
|
-
draggedCard:
|
|
959
|
-
dragOverColumn:
|
|
960
|
-
handleDragStart:
|
|
591
|
+
isDragging: a ? w.isDragging : !1,
|
|
592
|
+
draggedCard: a ? w.draggedCard : null,
|
|
593
|
+
dragOverColumn: a ? w.dragOverColumn : null,
|
|
594
|
+
handleDragStart: a ? w.handleDragStart : () => {
|
|
961
595
|
},
|
|
962
|
-
handleDragOver:
|
|
596
|
+
handleDragOver: a ? w.handleDragOver : () => {
|
|
963
597
|
},
|
|
964
|
-
handleDrop:
|
|
598
|
+
handleDrop: a ? w.handleDrop : () => {
|
|
965
599
|
},
|
|
966
|
-
handleDragEnd:
|
|
600
|
+
handleDragEnd: a ? w.handleDragEnd : () => {
|
|
967
601
|
},
|
|
968
|
-
handleKeyDown:
|
|
602
|
+
handleKeyDown: a ? w.handleKeyDown : () => {
|
|
969
603
|
},
|
|
970
604
|
// Prop Getters
|
|
971
|
-
getCardProps:
|
|
972
|
-
getColumnProps:
|
|
605
|
+
getCardProps: a ? yt : (t) => ({}),
|
|
606
|
+
getColumnProps: a ? mt : (t) => ({}),
|
|
973
607
|
// Load More (Per Column)
|
|
974
|
-
loadMore:
|
|
975
|
-
|
|
976
|
-
...
|
|
977
|
-
[
|
|
608
|
+
loadMore: h((t) => {
|
|
609
|
+
V((e) => ({
|
|
610
|
+
...e,
|
|
611
|
+
[t]: (e[t] || 10) + 10
|
|
978
612
|
}));
|
|
979
613
|
}, []),
|
|
980
614
|
// Utilities
|
|
981
|
-
refetch:
|
|
982
|
-
refresh:
|
|
615
|
+
refetch: _t,
|
|
616
|
+
refresh: bt
|
|
983
617
|
};
|
|
984
618
|
}
|
|
985
|
-
const
|
|
986
|
-
function
|
|
987
|
-
const
|
|
988
|
-
if (!
|
|
619
|
+
const $t = qt(null);
|
|
620
|
+
function Yt() {
|
|
621
|
+
const i = Qt($t);
|
|
622
|
+
if (!i)
|
|
989
623
|
throw new Error(
|
|
990
624
|
"Kanban components must be used within a KanbanBoard component"
|
|
991
625
|
);
|
|
992
|
-
return
|
|
626
|
+
return i;
|
|
993
627
|
}
|
|
994
|
-
function
|
|
995
|
-
const
|
|
996
|
-
return
|
|
997
|
-
...
|
|
998
|
-
cards: (
|
|
628
|
+
function Bt(i, c) {
|
|
629
|
+
const d = c.reduce((a, s) => (a[s.columnId] || (a[s.columnId] = []), a[s.columnId].push(s), a), {});
|
|
630
|
+
return i.map((a) => ({
|
|
631
|
+
...a,
|
|
632
|
+
cards: (d[a._id] || []).sort((s, O) => s.position - O.position)
|
|
999
633
|
}));
|
|
1000
634
|
}
|
|
1001
|
-
function
|
|
1002
|
-
if (
|
|
635
|
+
function Nt(i, c) {
|
|
636
|
+
if (i.cards.length === 0)
|
|
1003
637
|
return 0;
|
|
1004
|
-
if (
|
|
1005
|
-
return
|
|
1006
|
-
if (
|
|
1007
|
-
const
|
|
1008
|
-
return Math.max(0,
|
|
638
|
+
if (c === void 0 || c >= i.cards.length)
|
|
639
|
+
return i.cards[i.cards.length - 1].position + 1;
|
|
640
|
+
if (c === 0) {
|
|
641
|
+
const s = i.cards[0];
|
|
642
|
+
return Math.max(0, s.position - 1);
|
|
1009
643
|
}
|
|
1010
|
-
const
|
|
1011
|
-
return Math.floor((
|
|
644
|
+
const d = i.cards[c - 1], a = i.cards[c];
|
|
645
|
+
return Math.floor((d.position + a.position) / 2);
|
|
1012
646
|
}
|
|
1013
|
-
function
|
|
1014
|
-
if (
|
|
647
|
+
function jt(i, c) {
|
|
648
|
+
if (i.length === 0)
|
|
1015
649
|
return 0;
|
|
1016
|
-
if (
|
|
1017
|
-
return
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
return Math.max(0,
|
|
650
|
+
if (c === void 0 || c >= i.length)
|
|
651
|
+
return i[i.length - 1].position + 1;
|
|
652
|
+
if (c === 0) {
|
|
653
|
+
const s = i[0];
|
|
654
|
+
return Math.max(0, s.position - 1);
|
|
1021
655
|
}
|
|
1022
|
-
const
|
|
1023
|
-
return Math.floor((
|
|
656
|
+
const d = i[c - 1], a = i[c];
|
|
657
|
+
return Math.floor((d.position + a.position) / 2);
|
|
1024
658
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1027
|
-
...
|
|
1028
|
-
position:
|
|
659
|
+
function zt(i) {
|
|
660
|
+
return i.sort((c, d) => c.position - d.position).map((c, d) => ({
|
|
661
|
+
...c,
|
|
662
|
+
position: d
|
|
1029
663
|
}));
|
|
1030
664
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
665
|
+
function Jt(i, c, d, a) {
|
|
666
|
+
const s = `Failed to ${c} ${d}`, O = a ? ` (ID: ${a})` : "";
|
|
667
|
+
return i instanceof Error ? new Error(`${s}${O}: ${i.message}`) : new Error(`${s}${O}: Unknown error`);
|
|
1034
668
|
}
|
|
1035
|
-
function
|
|
1036
|
-
switch (
|
|
669
|
+
function Rt(i, c) {
|
|
670
|
+
switch (c) {
|
|
1037
671
|
case "list":
|
|
1038
|
-
return
|
|
672
|
+
return i && Array.isArray(i.Data);
|
|
1039
673
|
case "single":
|
|
1040
|
-
return
|
|
674
|
+
return i && typeof i == "object";
|
|
1041
675
|
case "create":
|
|
1042
|
-
return
|
|
676
|
+
return i && typeof i._id == "string";
|
|
1043
677
|
case "delete":
|
|
1044
|
-
return
|
|
678
|
+
return i && i.status === "success";
|
|
1045
679
|
default:
|
|
1046
680
|
return !1;
|
|
1047
681
|
}
|
|
1048
682
|
}
|
|
1049
683
|
export {
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
684
|
+
$t as KanbanContext,
|
|
685
|
+
Nt as calculateCardPosition,
|
|
686
|
+
jt as calculateColumnPosition,
|
|
687
|
+
Jt as handleKanbanApiError,
|
|
688
|
+
Bt as mergeCardsIntoColumns,
|
|
689
|
+
zt as normalizePositions,
|
|
690
|
+
Ft as useDragDropManager,
|
|
691
|
+
Xt as useKanban,
|
|
692
|
+
Yt as useKanbanContext,
|
|
693
|
+
Rt as validateApiResponse
|
|
1060
694
|
};
|