@object-ui/plugin-kanban 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +20 -0
- package/CHANGELOG.md +11 -0
- package/dist/KanbanEnhanced-BqDEu7Z6.js +894 -0
- package/dist/KanbanImpl-B8nu2BvG.js +144 -0
- package/dist/index-CrR06na7.js +562 -0
- package/dist/index.d.ts +2 -22
- package/dist/index.js +6 -3
- package/dist/index.umd.cjs +6 -11
- package/dist/{KanbanImpl-mGLdSHcd.js → sortable.esm-ZHwgFQIO.js} +1053 -1183
- package/dist/src/KanbanEnhanced.d.ts +36 -0
- package/dist/src/KanbanEnhanced.d.ts.map +1 -0
- package/dist/{KanbanImpl.d.ts → src/KanbanImpl.d.ts} +7 -0
- package/dist/src/KanbanImpl.d.ts.map +1 -0
- package/dist/src/ObjectKanban.d.ts +10 -0
- package/dist/src/ObjectKanban.d.ts.map +1 -0
- package/dist/src/index.d.ts +31 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/{types.d.ts → src/types.d.ts} +20 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +22 -9
- package/src/KanbanEnhanced.tsx +394 -0
- package/src/KanbanImpl.tsx +8 -0
- package/src/ObjectKanban.msw.test.tsx +91 -0
- package/src/ObjectKanban.tsx +188 -0
- package/src/__tests__/KanbanEnhanced.test.tsx +259 -0
- package/src/index.test.ts +9 -1
- package/src/index.tsx +93 -2
- package/src/registration.test.tsx +26 -0
- package/src/types.ts +33 -0
- package/tsconfig.json +12 -4
- package/vite.config.ts +23 -0
- package/vitest.config.ts +12 -0
- package/vitest.setup.ts +1 -0
- package/dist/KanbanImpl.d.ts.map +0 -1
- package/dist/index-i_5clVsp.js +0 -746
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { j as e } from "./index-CrR06na7.js";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { u as L, a as P, D as T, c as F, b as H, d as M, P as $, e as k, S as q, v as z, C as G } from "./sortable.esm-ZHwgFQIO.js";
|
|
4
|
+
import { Badge as B, ScrollArea as J, Card as Q, CardHeader as U, CardTitle as V, CardDescription as W, CardContent as X } from "@object-ui/components";
|
|
5
|
+
const E = (...s) => s.filter(Boolean).join(" ");
|
|
6
|
+
function R({ card: s }) {
|
|
7
|
+
const {
|
|
8
|
+
attributes: f,
|
|
9
|
+
listeners: d,
|
|
10
|
+
setNodeRef: u,
|
|
11
|
+
transform: p,
|
|
12
|
+
transition: t,
|
|
13
|
+
isDragging: n
|
|
14
|
+
} = k({ id: s.id }), b = {
|
|
15
|
+
transform: G.Transform.toString(p),
|
|
16
|
+
transition: t,
|
|
17
|
+
opacity: n ? 0.5 : void 0
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ e.jsx("div", { ref: u, style: b, ...f, ...d, children: /* @__PURE__ */ e.jsxs(Q, { 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", children: [
|
|
20
|
+
/* @__PURE__ */ e.jsxs(U, { className: "p-4", children: [
|
|
21
|
+
/* @__PURE__ */ e.jsx(V, { className: "text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors", children: s.title }),
|
|
22
|
+
s.description && /* @__PURE__ */ e.jsx(W, { className: "text-xs text-muted-foreground font-mono", children: s.description })
|
|
23
|
+
] }),
|
|
24
|
+
s.badges && s.badges.length > 0 && /* @__PURE__ */ e.jsx(X, { className: "p-4 pt-0", children: /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1", children: s.badges.map((S, y) => /* @__PURE__ */ e.jsx(B, { variant: S.variant || "default", className: "text-xs", children: S.label }, y)) }) })
|
|
25
|
+
] }) });
|
|
26
|
+
}
|
|
27
|
+
function Y({
|
|
28
|
+
column: s,
|
|
29
|
+
cards: f
|
|
30
|
+
}) {
|
|
31
|
+
const d = f || [], { setNodeRef: u } = k({
|
|
32
|
+
id: s.id,
|
|
33
|
+
data: {
|
|
34
|
+
type: "column"
|
|
35
|
+
}
|
|
36
|
+
}), p = s.limit && d.length >= s.limit;
|
|
37
|
+
return /* @__PURE__ */ e.jsxs(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: u,
|
|
41
|
+
className: E(
|
|
42
|
+
"flex flex-col w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl",
|
|
43
|
+
s.className
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-4 border-b border-border/50 bg-muted/20", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
47
|
+
/* @__PURE__ */ e.jsx("h3", { className: "font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase", children: s.title }),
|
|
48
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
49
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-mono text-xs text-muted-foreground", children: [
|
|
50
|
+
d.length,
|
|
51
|
+
s.limit && ` / ${s.limit}`
|
|
52
|
+
] }),
|
|
53
|
+
p && /* @__PURE__ */ e.jsx(B, { variant: "destructive", className: "text-xs", children: "Full" })
|
|
54
|
+
] })
|
|
55
|
+
] }) }),
|
|
56
|
+
/* @__PURE__ */ e.jsx(J, { className: "flex-1 p-4", children: /* @__PURE__ */ e.jsx(
|
|
57
|
+
q,
|
|
58
|
+
{
|
|
59
|
+
items: d.map((t) => t.id),
|
|
60
|
+
strategy: z,
|
|
61
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((t) => /* @__PURE__ */ e.jsx(R, { card: t }, t.id)) })
|
|
62
|
+
}
|
|
63
|
+
) })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function se({ columns: s, onCardMove: f, className: d }) {
|
|
69
|
+
const [u, p] = x.useState(null), t = x.useMemo(() => (s || []).map((r) => ({
|
|
70
|
+
...r,
|
|
71
|
+
cards: r.cards || []
|
|
72
|
+
})), [s]), [n, b] = x.useState(t);
|
|
73
|
+
x.useEffect(() => {
|
|
74
|
+
b(t);
|
|
75
|
+
}, [t]);
|
|
76
|
+
const S = L(
|
|
77
|
+
P($, {
|
|
78
|
+
activationConstraint: {
|
|
79
|
+
distance: 8
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
), y = (r) => {
|
|
83
|
+
const { active: a } = r, i = A(a.id);
|
|
84
|
+
p(i);
|
|
85
|
+
}, O = (r) => {
|
|
86
|
+
const { active: a, over: i } = r;
|
|
87
|
+
if (p(null), !i) return;
|
|
88
|
+
const c = a.id, g = i.id;
|
|
89
|
+
if (c === g) return;
|
|
90
|
+
const l = I(c), h = I(g) || K(g);
|
|
91
|
+
if (!(!l || !h))
|
|
92
|
+
if (l.id === h.id) {
|
|
93
|
+
const m = [...l.cards], v = m.findIndex((o) => o.id === c), D = m.findIndex((o) => o.id === g), w = M(m, v, D);
|
|
94
|
+
b(
|
|
95
|
+
(o) => o.map(
|
|
96
|
+
(C) => C.id === l.id ? { ...C, cards: w } : C
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
} else {
|
|
100
|
+
const m = [...l.cards], v = [...h.cards], D = m.findIndex((j) => j.id === c), o = g === h.id ? v.length : v.findIndex((j) => j.id === g), [C] = m.splice(D, 1);
|
|
101
|
+
v.splice(o, 0, C), b(
|
|
102
|
+
(j) => j.map((N) => N.id === l.id ? { ...N, cards: m } : N.id === h.id ? { ...N, cards: v } : N)
|
|
103
|
+
), f && f(c, l.id, h.id, o);
|
|
104
|
+
}
|
|
105
|
+
}, A = x.useCallback(
|
|
106
|
+
(r) => {
|
|
107
|
+
for (const a of n) {
|
|
108
|
+
const i = a.cards.find((c) => c.id === r);
|
|
109
|
+
if (i) return i;
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
},
|
|
113
|
+
[n]
|
|
114
|
+
), I = x.useCallback(
|
|
115
|
+
(r) => n.find((a) => a.cards.some((i) => i.id === r)) || null,
|
|
116
|
+
[n]
|
|
117
|
+
), K = x.useCallback(
|
|
118
|
+
(r) => n.find((a) => a.id === r) || null,
|
|
119
|
+
[n]
|
|
120
|
+
);
|
|
121
|
+
return /* @__PURE__ */ e.jsxs(
|
|
122
|
+
T,
|
|
123
|
+
{
|
|
124
|
+
sensors: S,
|
|
125
|
+
collisionDetection: F,
|
|
126
|
+
onDragStart: y,
|
|
127
|
+
onDragEnd: O,
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ e.jsx("div", { className: E("flex gap-4 overflow-x-auto p-4", d), children: n.map((r) => /* @__PURE__ */ e.jsx(
|
|
130
|
+
Y,
|
|
131
|
+
{
|
|
132
|
+
column: r,
|
|
133
|
+
cards: r.cards
|
|
134
|
+
},
|
|
135
|
+
r.id
|
|
136
|
+
)) }),
|
|
137
|
+
/* @__PURE__ */ e.jsx(H, { children: u ? /* @__PURE__ */ e.jsx(R, { card: u }) : null })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
se as default
|
|
144
|
+
};
|
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import N, { useState as w, useEffect as q, useMemo as J, Suspense as Z } from "react";
|
|
2
|
+
import { ComponentRegistry as L } from "@object-ui/core";
|
|
3
|
+
import { useDataScope as ce, useSchemaContext as de } from "@object-ui/react";
|
|
4
|
+
import { Skeleton as Q } from "@object-ui/components";
|
|
5
|
+
var P = { exports: {} }, S = {};
|
|
6
|
+
var G;
|
|
7
|
+
function fe() {
|
|
8
|
+
if (G) return S;
|
|
9
|
+
G = 1;
|
|
10
|
+
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), c = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
11
|
+
function b(d, s, f) {
|
|
12
|
+
var a = null;
|
|
13
|
+
if (f !== void 0 && (a = "" + f), s.key !== void 0 && (a = "" + s.key), "key" in s) {
|
|
14
|
+
f = {};
|
|
15
|
+
for (var m in s)
|
|
16
|
+
m !== "key" && (f[m] = s[m]);
|
|
17
|
+
} else f = s;
|
|
18
|
+
return s = f.ref, {
|
|
19
|
+
$$typeof: r,
|
|
20
|
+
type: d,
|
|
21
|
+
key: a,
|
|
22
|
+
ref: s !== void 0 ? s : null,
|
|
23
|
+
props: f
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return S.Fragment = c, S.jsx = b, S.jsxs = b, S;
|
|
27
|
+
}
|
|
28
|
+
var A = {};
|
|
29
|
+
var X;
|
|
30
|
+
function be() {
|
|
31
|
+
return X || (X = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
32
|
+
function r(e) {
|
|
33
|
+
if (e == null) return null;
|
|
34
|
+
if (typeof e == "function")
|
|
35
|
+
return e.$$typeof === se ? null : e.displayName || e.name || null;
|
|
36
|
+
if (typeof e == "string") return e;
|
|
37
|
+
switch (e) {
|
|
38
|
+
case j:
|
|
39
|
+
return "Fragment";
|
|
40
|
+
case p:
|
|
41
|
+
return "Profiler";
|
|
42
|
+
case o:
|
|
43
|
+
return "StrictMode";
|
|
44
|
+
case ae:
|
|
45
|
+
return "Suspense";
|
|
46
|
+
case ne:
|
|
47
|
+
return "SuspenseList";
|
|
48
|
+
case le:
|
|
49
|
+
return "Activity";
|
|
50
|
+
}
|
|
51
|
+
if (typeof e == "object")
|
|
52
|
+
switch (typeof e.tag == "number" && console.error(
|
|
53
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
54
|
+
), e.$$typeof) {
|
|
55
|
+
case h:
|
|
56
|
+
return "Portal";
|
|
57
|
+
case _:
|
|
58
|
+
return e.displayName || "Context";
|
|
59
|
+
case n:
|
|
60
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
61
|
+
case te:
|
|
62
|
+
var t = e.render;
|
|
63
|
+
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
64
|
+
case oe:
|
|
65
|
+
return t = e.displayName || null, t !== null ? t : r(e.type) || "Memo";
|
|
66
|
+
case M:
|
|
67
|
+
t = e._payload, e = e._init;
|
|
68
|
+
try {
|
|
69
|
+
return r(e(t));
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function c(e) {
|
|
76
|
+
return "" + e;
|
|
77
|
+
}
|
|
78
|
+
function b(e) {
|
|
79
|
+
try {
|
|
80
|
+
c(e);
|
|
81
|
+
var t = !1;
|
|
82
|
+
} catch {
|
|
83
|
+
t = !0;
|
|
84
|
+
}
|
|
85
|
+
if (t) {
|
|
86
|
+
t = console;
|
|
87
|
+
var l = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
88
|
+
return l.call(
|
|
89
|
+
t,
|
|
90
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
|
+
i
|
|
92
|
+
), c(e);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function d(e) {
|
|
96
|
+
if (e === j) return "<>";
|
|
97
|
+
if (typeof e == "object" && e !== null && e.$$typeof === M)
|
|
98
|
+
return "<...>";
|
|
99
|
+
try {
|
|
100
|
+
var t = r(e);
|
|
101
|
+
return t ? "<" + t + ">" : "<...>";
|
|
102
|
+
} catch {
|
|
103
|
+
return "<...>";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function s() {
|
|
107
|
+
var e = D.A;
|
|
108
|
+
return e === null ? null : e.getOwner();
|
|
109
|
+
}
|
|
110
|
+
function f() {
|
|
111
|
+
return Error("react-stack-top-frame");
|
|
112
|
+
}
|
|
113
|
+
function a(e) {
|
|
114
|
+
if (V.call(e, "key")) {
|
|
115
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
116
|
+
if (t && t.isReactWarning) return !1;
|
|
117
|
+
}
|
|
118
|
+
return e.key !== void 0;
|
|
119
|
+
}
|
|
120
|
+
function m(e, t) {
|
|
121
|
+
function l() {
|
|
122
|
+
B || (B = !0, console.error(
|
|
123
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
124
|
+
t
|
|
125
|
+
));
|
|
126
|
+
}
|
|
127
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
128
|
+
get: l,
|
|
129
|
+
configurable: !0
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function g() {
|
|
133
|
+
var e = r(this.type);
|
|
134
|
+
return z[e] || (z[e] = !0, console.error(
|
|
135
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
136
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
137
|
+
}
|
|
138
|
+
function O(e, t, l, i, x, Y) {
|
|
139
|
+
var u = l.ref;
|
|
140
|
+
return e = {
|
|
141
|
+
$$typeof: E,
|
|
142
|
+
type: e,
|
|
143
|
+
key: t,
|
|
144
|
+
props: l,
|
|
145
|
+
_owner: i
|
|
146
|
+
}, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
|
|
147
|
+
enumerable: !1,
|
|
148
|
+
get: g
|
|
149
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
150
|
+
configurable: !1,
|
|
151
|
+
enumerable: !1,
|
|
152
|
+
writable: !0,
|
|
153
|
+
value: 0
|
|
154
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
155
|
+
configurable: !1,
|
|
156
|
+
enumerable: !1,
|
|
157
|
+
writable: !0,
|
|
158
|
+
value: null
|
|
159
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
160
|
+
configurable: !1,
|
|
161
|
+
enumerable: !1,
|
|
162
|
+
writable: !0,
|
|
163
|
+
value: x
|
|
164
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: Y
|
|
169
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
170
|
+
}
|
|
171
|
+
function R(e, t, l, i, x, Y) {
|
|
172
|
+
var u = t.children;
|
|
173
|
+
if (u !== void 0)
|
|
174
|
+
if (i)
|
|
175
|
+
if (ie(u)) {
|
|
176
|
+
for (i = 0; i < u.length; i++)
|
|
177
|
+
C(u[i]);
|
|
178
|
+
Object.freeze && Object.freeze(u);
|
|
179
|
+
} else
|
|
180
|
+
console.error(
|
|
181
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
182
|
+
);
|
|
183
|
+
else C(u);
|
|
184
|
+
if (V.call(t, "key")) {
|
|
185
|
+
u = r(e);
|
|
186
|
+
var k = Object.keys(t).filter(function(ue) {
|
|
187
|
+
return ue !== "key";
|
|
188
|
+
});
|
|
189
|
+
i = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", W[u + i] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
190
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s {...props} />
|
|
193
|
+
React keys must be passed directly to JSX without using spread:
|
|
194
|
+
let props = %s;
|
|
195
|
+
<%s key={someKey} {...props} />`,
|
|
196
|
+
i,
|
|
197
|
+
u,
|
|
198
|
+
k,
|
|
199
|
+
u
|
|
200
|
+
), W[u + i] = !0);
|
|
201
|
+
}
|
|
202
|
+
if (u = null, l !== void 0 && (b(l), u = "" + l), a(t) && (b(t.key), u = "" + t.key), "key" in t) {
|
|
203
|
+
l = {};
|
|
204
|
+
for (var I in t)
|
|
205
|
+
I !== "key" && (l[I] = t[I]);
|
|
206
|
+
} else l = t;
|
|
207
|
+
return u && m(
|
|
208
|
+
l,
|
|
209
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
210
|
+
), O(
|
|
211
|
+
e,
|
|
212
|
+
u,
|
|
213
|
+
l,
|
|
214
|
+
s(),
|
|
215
|
+
x,
|
|
216
|
+
Y
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
function C(e) {
|
|
220
|
+
T(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === M && (e._payload.status === "fulfilled" ? T(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
221
|
+
}
|
|
222
|
+
function T(e) {
|
|
223
|
+
return typeof e == "object" && e !== null && e.$$typeof === E;
|
|
224
|
+
}
|
|
225
|
+
var y = N, E = /* @__PURE__ */ Symbol.for("react.transitional.element"), h = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), o = /* @__PURE__ */ Symbol.for("react.strict_mode"), p = /* @__PURE__ */ Symbol.for("react.profiler"), n = /* @__PURE__ */ Symbol.for("react.consumer"), _ = /* @__PURE__ */ Symbol.for("react.context"), te = /* @__PURE__ */ Symbol.for("react.forward_ref"), ae = /* @__PURE__ */ Symbol.for("react.suspense"), ne = /* @__PURE__ */ Symbol.for("react.suspense_list"), oe = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), le = /* @__PURE__ */ Symbol.for("react.activity"), se = /* @__PURE__ */ Symbol.for("react.client.reference"), D = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, ie = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
226
|
+
return null;
|
|
227
|
+
};
|
|
228
|
+
y = {
|
|
229
|
+
react_stack_bottom_frame: function(e) {
|
|
230
|
+
return e();
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
var B, z = {}, K = y.react_stack_bottom_frame.bind(
|
|
234
|
+
y,
|
|
235
|
+
f
|
|
236
|
+
)(), U = F(d(f)), W = {};
|
|
237
|
+
A.Fragment = j, A.jsx = function(e, t, l) {
|
|
238
|
+
var i = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
239
|
+
return R(
|
|
240
|
+
e,
|
|
241
|
+
t,
|
|
242
|
+
l,
|
|
243
|
+
!1,
|
|
244
|
+
i ? Error("react-stack-top-frame") : K,
|
|
245
|
+
i ? F(d(e)) : U
|
|
246
|
+
);
|
|
247
|
+
}, A.jsxs = function(e, t, l) {
|
|
248
|
+
var i = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
249
|
+
return R(
|
|
250
|
+
e,
|
|
251
|
+
t,
|
|
252
|
+
l,
|
|
253
|
+
!0,
|
|
254
|
+
i ? Error("react-stack-top-frame") : K,
|
|
255
|
+
i ? F(d(e)) : U
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
})()), A;
|
|
259
|
+
}
|
|
260
|
+
var H;
|
|
261
|
+
function me() {
|
|
262
|
+
return H || (H = 1, process.env.NODE_ENV === "production" ? P.exports = fe() : P.exports = be()), P.exports;
|
|
263
|
+
}
|
|
264
|
+
var v = me();
|
|
265
|
+
const ee = ({
|
|
266
|
+
schema: r,
|
|
267
|
+
dataSource: c,
|
|
268
|
+
className: b,
|
|
269
|
+
...d
|
|
270
|
+
}) => {
|
|
271
|
+
const [s, f] = w([]), [a, m] = w(null), [g, O] = w(!1), [R, C] = w(null), T = ce(r.bind);
|
|
272
|
+
q(() => {
|
|
273
|
+
let o = !0;
|
|
274
|
+
return (async () => {
|
|
275
|
+
if (!(!c || !r.objectName))
|
|
276
|
+
try {
|
|
277
|
+
const n = await c.getObjectSchema(r.objectName);
|
|
278
|
+
o && m(n);
|
|
279
|
+
} catch (n) {
|
|
280
|
+
console.warn("Failed to fetch object def", n);
|
|
281
|
+
}
|
|
282
|
+
})(), () => {
|
|
283
|
+
o = !1;
|
|
284
|
+
};
|
|
285
|
+
}, [r.objectName, c]), q(() => {
|
|
286
|
+
let o = !0;
|
|
287
|
+
const p = async () => {
|
|
288
|
+
if (!(!c || !r.objectName)) {
|
|
289
|
+
o && O(!0);
|
|
290
|
+
try {
|
|
291
|
+
const n = await c.find(r.objectName, {
|
|
292
|
+
options: { $top: 100 },
|
|
293
|
+
$filter: r.filter
|
|
294
|
+
});
|
|
295
|
+
let _ = [];
|
|
296
|
+
Array.isArray(n) ? _ = n : n && typeof n == "object" && (Array.isArray(n.value) ? _ = n.value : Array.isArray(n.data) && (_ = n.data)), console.log(`[ObjectKanban] Extracted data (length: ${_.length})`), o && f(_);
|
|
297
|
+
} catch (n) {
|
|
298
|
+
console.error("[ObjectKanban] Fetch error:", n), o && C(n);
|
|
299
|
+
} finally {
|
|
300
|
+
o && O(!1);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
return r.objectName && !T && !r.data && !d.data && p(), () => {
|
|
305
|
+
o = !1;
|
|
306
|
+
};
|
|
307
|
+
}, [r.objectName, c, T, r.data, r.filter, d.data]);
|
|
308
|
+
const y = d.data || T || r.data || s, E = J(() => {
|
|
309
|
+
if (!Array.isArray(y)) return [];
|
|
310
|
+
let o = r.cardTitle || r.titleField;
|
|
311
|
+
if (!o && a) {
|
|
312
|
+
if (a.titleFormat) {
|
|
313
|
+
const n = /\{(.+?)\}/.exec(a.titleFormat);
|
|
314
|
+
n && (o = n[1]);
|
|
315
|
+
}
|
|
316
|
+
!o && a.NAME_FIELD_KEY && (o = a.NAME_FIELD_KEY);
|
|
317
|
+
}
|
|
318
|
+
const p = o || "name";
|
|
319
|
+
return y.map((n) => ({
|
|
320
|
+
...n,
|
|
321
|
+
// Ensure id exists
|
|
322
|
+
id: n.id || n._id,
|
|
323
|
+
// Map title
|
|
324
|
+
title: n[p] || n.title || "Untitled"
|
|
325
|
+
}));
|
|
326
|
+
}, [y, r, a]), h = J(() => {
|
|
327
|
+
if (r.columns && r.columns.length > 0)
|
|
328
|
+
if (typeof r.columns[0] == "string") {
|
|
329
|
+
if (!r.groupBy)
|
|
330
|
+
return r.columns.map((o) => ({
|
|
331
|
+
id: o,
|
|
332
|
+
title: o
|
|
333
|
+
}));
|
|
334
|
+
} else
|
|
335
|
+
return r.columns;
|
|
336
|
+
if (r.groupBy && a?.fields?.[r.groupBy]?.options)
|
|
337
|
+
return a.fields[r.groupBy].options.map((o) => ({
|
|
338
|
+
id: o.value,
|
|
339
|
+
title: o.label
|
|
340
|
+
}));
|
|
341
|
+
if (r.groupBy && E.length > 0) {
|
|
342
|
+
const o = new Set(E.map((p) => p[r.groupBy]));
|
|
343
|
+
return Array.from(o).map((p) => ({
|
|
344
|
+
id: String(p),
|
|
345
|
+
title: String(p)
|
|
346
|
+
}));
|
|
347
|
+
}
|
|
348
|
+
return [];
|
|
349
|
+
}, [r.columns, r.groupBy, E, a]), j = {
|
|
350
|
+
...r,
|
|
351
|
+
data: E,
|
|
352
|
+
columns: h,
|
|
353
|
+
className: b || r.className
|
|
354
|
+
};
|
|
355
|
+
return R ? /* @__PURE__ */ v.jsxs("div", { className: "p-4 border border-destructive/50 rounded bg-destructive/10 text-destructive", children: [
|
|
356
|
+
"Error loading kanban data: ",
|
|
357
|
+
R.message
|
|
358
|
+
] }) : /* @__PURE__ */ v.jsx($, { schema: j });
|
|
359
|
+
}, pe = N.lazy(() => import("./KanbanImpl-B8nu2BvG.js")), re = N.lazy(() => import("./KanbanEnhanced-BqDEu7Z6.js")), $ = ({ schema: r }) => {
|
|
360
|
+
const c = N.useMemo(() => {
|
|
361
|
+
const { columns: b = [], data: d, groupBy: s } = r;
|
|
362
|
+
if (d && s && Array.isArray(d)) {
|
|
363
|
+
const f = d.reduce((a, m) => {
|
|
364
|
+
const g = m[s];
|
|
365
|
+
return a[g] || (a[g] = []), a[g].push(m), a;
|
|
366
|
+
}, {});
|
|
367
|
+
return b.map((a) => ({
|
|
368
|
+
...a,
|
|
369
|
+
cards: [
|
|
370
|
+
...a.cards || [],
|
|
371
|
+
// Preserve static cards
|
|
372
|
+
...f[a.id] || []
|
|
373
|
+
// Add dynamic cards
|
|
374
|
+
]
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
return b;
|
|
378
|
+
}, [r]);
|
|
379
|
+
return /* @__PURE__ */ v.jsx(Z, { fallback: /* @__PURE__ */ v.jsx(Q, { className: "w-full h-[600px]" }), children: /* @__PURE__ */ v.jsx(
|
|
380
|
+
pe,
|
|
381
|
+
{
|
|
382
|
+
columns: c,
|
|
383
|
+
onCardMove: r.onCardMove,
|
|
384
|
+
className: r.className
|
|
385
|
+
}
|
|
386
|
+
) });
|
|
387
|
+
};
|
|
388
|
+
L.register(
|
|
389
|
+
"kanban",
|
|
390
|
+
$,
|
|
391
|
+
{
|
|
392
|
+
namespace: "plugin-kanban",
|
|
393
|
+
label: "Kanban Board",
|
|
394
|
+
icon: "LayoutDashboard",
|
|
395
|
+
category: "plugin",
|
|
396
|
+
inputs: [
|
|
397
|
+
{
|
|
398
|
+
name: "columns",
|
|
399
|
+
type: "array",
|
|
400
|
+
label: "Columns",
|
|
401
|
+
description: "Array of { id, title, cards, limit, className }",
|
|
402
|
+
required: !0
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: "onCardMove",
|
|
406
|
+
type: "code",
|
|
407
|
+
label: "On Card Move",
|
|
408
|
+
description: "Callback when a card is moved",
|
|
409
|
+
advanced: !0
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "className",
|
|
413
|
+
type: "string",
|
|
414
|
+
label: "CSS Class"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
defaultProps: {
|
|
418
|
+
columns: [
|
|
419
|
+
{
|
|
420
|
+
id: "todo",
|
|
421
|
+
title: "To Do",
|
|
422
|
+
cards: [
|
|
423
|
+
{
|
|
424
|
+
id: "card-1",
|
|
425
|
+
title: "Task 1",
|
|
426
|
+
description: "This is the first task",
|
|
427
|
+
badges: [
|
|
428
|
+
{ label: "High Priority", variant: "destructive" },
|
|
429
|
+
{ label: "Feature", variant: "default" }
|
|
430
|
+
]
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
id: "card-2",
|
|
434
|
+
title: "Task 2",
|
|
435
|
+
description: "This is the second task",
|
|
436
|
+
badges: [
|
|
437
|
+
{ label: "Bug", variant: "destructive" }
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
id: "in-progress",
|
|
444
|
+
title: "In Progress",
|
|
445
|
+
limit: 3,
|
|
446
|
+
cards: [
|
|
447
|
+
{
|
|
448
|
+
id: "card-3",
|
|
449
|
+
title: "Task 3",
|
|
450
|
+
description: "Currently working on this",
|
|
451
|
+
badges: [
|
|
452
|
+
{ label: "In Progress", variant: "default" }
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: "done",
|
|
459
|
+
title: "Done",
|
|
460
|
+
cards: [
|
|
461
|
+
{
|
|
462
|
+
id: "card-4",
|
|
463
|
+
title: "Task 4",
|
|
464
|
+
description: "This task is completed",
|
|
465
|
+
badges: [
|
|
466
|
+
{ label: "Completed", variant: "outline" }
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
id: "card-5",
|
|
471
|
+
title: "Task 5",
|
|
472
|
+
description: "Another completed task",
|
|
473
|
+
badges: [
|
|
474
|
+
{ label: "Completed", variant: "outline" }
|
|
475
|
+
]
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
className: "w-full"
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
);
|
|
484
|
+
const Te = {
|
|
485
|
+
kanban: $,
|
|
486
|
+
"kanban-enhanced": re,
|
|
487
|
+
"object-kanban": ee
|
|
488
|
+
};
|
|
489
|
+
L.register(
|
|
490
|
+
"kanban-enhanced",
|
|
491
|
+
({ schema: r }) => {
|
|
492
|
+
const c = N.useMemo(() => {
|
|
493
|
+
const { columns: b = [], data: d, groupBy: s } = r;
|
|
494
|
+
if (d && s && Array.isArray(d)) {
|
|
495
|
+
const f = d.reduce((a, m) => {
|
|
496
|
+
const g = m[s];
|
|
497
|
+
return a[g] || (a[g] = []), a[g].push(m), a;
|
|
498
|
+
}, {});
|
|
499
|
+
return b.map((a) => ({
|
|
500
|
+
...a,
|
|
501
|
+
cards: [...a.cards || [], ...f[a.id] || []]
|
|
502
|
+
}));
|
|
503
|
+
}
|
|
504
|
+
return b;
|
|
505
|
+
}, [r]);
|
|
506
|
+
return /* @__PURE__ */ v.jsx(Z, { fallback: /* @__PURE__ */ v.jsx(Q, { className: "w-full h-[600px]" }), children: /* @__PURE__ */ v.jsx(
|
|
507
|
+
re,
|
|
508
|
+
{
|
|
509
|
+
columns: c,
|
|
510
|
+
onCardMove: r.onCardMove,
|
|
511
|
+
onColumnToggle: r.onColumnToggle,
|
|
512
|
+
enableVirtualScrolling: r.enableVirtualScrolling,
|
|
513
|
+
virtualScrollThreshold: r.virtualScrollThreshold,
|
|
514
|
+
className: r.className
|
|
515
|
+
}
|
|
516
|
+
) });
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
namespace: "plugin-kanban",
|
|
520
|
+
label: "Kanban Board (Enhanced)",
|
|
521
|
+
icon: "LayoutGrid",
|
|
522
|
+
category: "plugin",
|
|
523
|
+
inputs: [
|
|
524
|
+
{ name: "columns", type: "array", label: "Columns", required: !0 },
|
|
525
|
+
{ name: "enableVirtualScrolling", type: "boolean", label: "Virtual Scrolling", defaultValue: !1 },
|
|
526
|
+
{ name: "virtualScrollThreshold", type: "number", label: "Virtual Scroll Threshold", defaultValue: 50 },
|
|
527
|
+
{ name: "onCardMove", type: "code", label: "On Card Move", advanced: !0 },
|
|
528
|
+
{ name: "onColumnToggle", type: "code", label: "On Column Toggle", advanced: !0 },
|
|
529
|
+
{ name: "className", type: "string", label: "CSS Class" }
|
|
530
|
+
],
|
|
531
|
+
defaultProps: {
|
|
532
|
+
columns: [],
|
|
533
|
+
enableVirtualScrolling: !1,
|
|
534
|
+
virtualScrollThreshold: 50,
|
|
535
|
+
className: "w-full"
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
const ge = ({ schema: r, ...c }) => {
|
|
540
|
+
const { dataSource: b } = de() || {};
|
|
541
|
+
return /* @__PURE__ */ v.jsx(ee, { schema: r, dataSource: b, ...c });
|
|
542
|
+
};
|
|
543
|
+
L.register(
|
|
544
|
+
"object-kanban",
|
|
545
|
+
ge,
|
|
546
|
+
{
|
|
547
|
+
namespace: "plugin-kanban",
|
|
548
|
+
label: "Object Kanban",
|
|
549
|
+
category: "plugin",
|
|
550
|
+
inputs: [
|
|
551
|
+
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
552
|
+
{ name: "columns", type: "array", label: "Columns" }
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
export {
|
|
557
|
+
$ as K,
|
|
558
|
+
ee as O,
|
|
559
|
+
ge as a,
|
|
560
|
+
v as j,
|
|
561
|
+
Te as k
|
|
562
|
+
};
|