@object-ui/plugin-designer 0.1.0 → 2.0.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/dist/index.js CHANGED
@@ -1,335 +1,335 @@
1
- import { ComponentRegistry as G } from "@object-ui/core";
2
- import xe, { useState as A, useMemo as Z, useCallback as P, createContext as fe } from "react";
3
- import { Plus as K, Undo2 as be, Redo2 as ge, Eye as ye, GripVertical as ve, Trash2 as L, Layers as we, Database as le, Link2 as je, GitBranch as Ne, Play as Ee, Square as oe, Diamond as ke, FileText as Re, Type as Te, ImageIcon as _e, BarChart3 as Se, Table2 as Ae } from "lucide-react";
4
- import { clsx as M } from "clsx";
5
- import { twMerge as Y } from "tailwind-merge";
6
- var F = { exports: {} }, $ = {};
7
- var ne;
8
- function Pe() {
9
- if (ne) return $;
10
- ne = 1;
11
- var l = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function p(w, i, d) {
13
- var x = null;
14
- if (d !== void 0 && (x = "" + d), i.key !== void 0 && (x = "" + i.key), "key" in i) {
15
- d = {};
16
- for (var E in i)
17
- E !== "key" && (d[E] = i[E]);
18
- } else d = i;
19
- return i = d.ref, {
20
- $$typeof: l,
21
- type: w,
22
- key: x,
23
- ref: i !== void 0 ? i : null,
24
- props: d
1
+ import { ComponentRegistry as Z } from "@object-ui/core";
2
+ import ve, { useState as F, useMemo as ae, useCallback as D, createContext as je } from "react";
3
+ import { Plus as Y, Undo2 as we, Redo2 as Ne, Eye as be, GripVertical as ge, Trash2 as G, Layers as ye, Database as de, Link2 as ke, GitBranch as Ee, Play as Se, Square as ce, Diamond as Ce, FileText as Te, Type as Re, ImageIcon as _e, BarChart3 as Ae, Table2 as Pe, Settings2 as De, X as Fe, Save as $e, LayoutGrid as Ie, Kanban as Ve, Image as Le, Calendar as ze, Clock as Ge, GanttChart as Me, Map as Ye, Columns3 as Ue, ArrowUp as We, ArrowDown as qe, EyeOff as He } from "lucide-react";
4
+ import { clsx as K } from "clsx";
5
+ import { twMerge as Q } from "tailwind-merge";
6
+ var re = { exports: {} }, J = {};
7
+ var ue;
8
+ function Be() {
9
+ if (ue) return J;
10
+ ue = 1;
11
+ var i = /* @__PURE__ */ Symbol.for("react.transitional.element"), g = /* @__PURE__ */ Symbol.for("react.fragment");
12
+ function w(T, h, b) {
13
+ var N = null;
14
+ if (b !== void 0 && (N = "" + b), h.key !== void 0 && (N = "" + h.key), "key" in h) {
15
+ b = {};
16
+ for (var c in h)
17
+ c !== "key" && (b[c] = h[c]);
18
+ } else b = h;
19
+ return h = b.ref, {
20
+ $$typeof: i,
21
+ type: T,
22
+ key: N,
23
+ ref: h !== void 0 ? h : null,
24
+ props: b
25
25
  };
26
26
  }
27
- return $.Fragment = u, $.jsx = p, $.jsxs = p, $;
27
+ return J.Fragment = g, J.jsx = w, J.jsxs = w, J;
28
28
  }
29
- var z = {};
30
- var ie;
31
- function Ce() {
32
- return ie || (ie = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function l(t) {
34
- if (t == null) return null;
35
- if (typeof t == "function")
36
- return t.$$typeof === pe ? null : t.displayName || t.name || null;
37
- if (typeof t == "string") return t;
38
- switch (t) {
39
- case o:
29
+ var X = {};
30
+ var me;
31
+ function Je() {
32
+ return me || (me = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function i(r) {
34
+ if (r == null) return null;
35
+ if (typeof r == "function")
36
+ return r.$$typeof === z ? null : r.displayName || r.name || null;
37
+ if (typeof r == "string") return r;
38
+ switch (r) {
39
+ case u:
40
40
  return "Fragment";
41
- case c:
41
+ case x:
42
42
  return "Profiler";
43
- case r:
43
+ case a:
44
44
  return "StrictMode";
45
- case h:
46
- return "Suspense";
47
45
  case f:
46
+ return "Suspense";
47
+ case p:
48
48
  return "SuspenseList";
49
- case V:
49
+ case L:
50
50
  return "Activity";
51
51
  }
52
- if (typeof t == "object")
53
- switch (typeof t.tag == "number" && console.error(
52
+ if (typeof r == "object")
53
+ switch (typeof r.tag == "number" && console.error(
54
54
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
55
- ), t.$$typeof) {
56
- case S:
55
+ ), r.$$typeof) {
56
+ case k:
57
57
  return "Portal";
58
- case T:
59
- return t.displayName || "Context";
60
- case s:
61
- return (t._context.displayName || "Context") + ".Consumer";
62
- case m:
63
- var a = t.render;
64
- return t = t.displayName, t || (t = a.displayName || a.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
65
- case C:
66
- return a = t.displayName || null, a !== null ? a : l(t.type) || "Memo";
67
- case D:
68
- a = t._payload, t = t._init;
58
+ case A:
59
+ return r.displayName || "Context";
60
+ case o:
61
+ return (r._context.displayName || "Context") + ".Consumer";
62
+ case j:
63
+ var d = r.render;
64
+ return r = r.displayName, r || (r = d.displayName || d.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
65
+ case V:
66
+ return d = r.displayName || null, d !== null ? d : i(r.type) || "Memo";
67
+ case $:
68
+ d = r._payload, r = r._init;
69
69
  try {
70
- return l(t(a));
70
+ return i(r(d));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function u(t) {
77
- return "" + t;
76
+ function g(r) {
77
+ return "" + r;
78
78
  }
79
- function p(t) {
79
+ function w(r) {
80
80
  try {
81
- u(t);
82
- var a = !1;
81
+ g(r);
82
+ var d = !1;
83
83
  } catch {
84
- a = !0;
84
+ d = !0;
85
85
  }
86
- if (a) {
87
- a = console;
88
- var y = a.error, j = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
89
- return y.call(
90
- a,
86
+ if (d) {
87
+ d = console;
88
+ var S = d.error, P = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
89
+ return S.call(
90
+ d,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
- j
93
- ), u(t);
92
+ P
93
+ ), g(r);
94
94
  }
95
95
  }
96
- function w(t) {
97
- if (t === o) return "<>";
98
- if (typeof t == "object" && t !== null && t.$$typeof === D)
96
+ function T(r) {
97
+ if (r === u) return "<>";
98
+ if (typeof r == "object" && r !== null && r.$$typeof === $)
99
99
  return "<...>";
100
100
  try {
101
- var a = l(t);
102
- return a ? "<" + a + ">" : "<...>";
101
+ var d = i(r);
102
+ return d ? "<" + d + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
- function i() {
108
- var t = U.A;
109
- return t === null ? null : t.getOwner();
107
+ function h() {
108
+ var r = U.A;
109
+ return r === null ? null : r.getOwner();
110
110
  }
111
- function d() {
111
+ function b() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function x(t) {
115
- if (Q.call(t, "key")) {
116
- var a = Object.getOwnPropertyDescriptor(t, "key").get;
117
- if (a && a.isReactWarning) return !1;
114
+ function N(r) {
115
+ if (W.call(r, "key")) {
116
+ var d = Object.getOwnPropertyDescriptor(r, "key").get;
117
+ if (d && d.isReactWarning) return !1;
118
118
  }
119
- return t.key !== void 0;
119
+ return r.key !== void 0;
120
120
  }
121
- function E(t, a) {
122
- function y() {
123
- ee || (ee = !0, console.error(
121
+ function c(r, d) {
122
+ function S() {
123
+ O || (O = !0, console.error(
124
124
  "%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)",
125
- a
125
+ d
126
126
  ));
127
127
  }
128
- y.isReactWarning = !0, Object.defineProperty(t, "key", {
129
- get: y,
128
+ S.isReactWarning = !0, Object.defineProperty(r, "key", {
129
+ get: S,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
- function n() {
134
- var t = l(this.type);
135
- return te[t] || (te[t] = !0, console.error(
133
+ function m() {
134
+ var r = i(this.type);
135
+ return H[r] || (H[r] = !0, console.error(
136
136
  "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."
137
- )), t = this.props.ref, t !== void 0 ? t : null;
137
+ )), r = this.props.ref, r !== void 0 ? r : null;
138
138
  }
139
- function _(t, a, y, j, I, q) {
140
- var N = y.ref;
141
- return t = {
142
- $$typeof: v,
143
- type: t,
144
- key: a,
145
- props: y,
146
- _owner: j
147
- }, (N !== void 0 ? N : null) !== null ? Object.defineProperty(t, "ref", {
139
+ function l(r, d, S, P, t, n) {
140
+ var s = S.ref;
141
+ return r = {
142
+ $$typeof: C,
143
+ type: r,
144
+ key: d,
145
+ props: S,
146
+ _owner: P
147
+ }, (s !== void 0 ? s : null) !== null ? Object.defineProperty(r, "ref", {
148
148
  enumerable: !1,
149
- get: n
150
- }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
149
+ get: m
150
+ }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
151
151
  configurable: !1,
152
152
  enumerable: !1,
153
153
  writable: !0,
154
154
  value: 0
155
- }), Object.defineProperty(t, "_debugInfo", {
155
+ }), Object.defineProperty(r, "_debugInfo", {
156
156
  configurable: !1,
157
157
  enumerable: !1,
158
158
  writable: !0,
159
159
  value: null
160
- }), Object.defineProperty(t, "_debugStack", {
160
+ }), Object.defineProperty(r, "_debugStack", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: I
165
- }), Object.defineProperty(t, "_debugTask", {
164
+ value: t
165
+ }), Object.defineProperty(r, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: q
170
- }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
169
+ value: n
170
+ }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
171
171
  }
172
- function b(t, a, y, j, I, q) {
173
- var N = a.children;
174
- if (N !== void 0)
175
- if (j)
176
- if (he(N)) {
177
- for (j = 0; j < N.length; j++)
178
- k(N[j]);
179
- Object.freeze && Object.freeze(N);
172
+ function y(r, d, S, P, t, n) {
173
+ var s = d.children;
174
+ if (s !== void 0)
175
+ if (P)
176
+ if (le(s)) {
177
+ for (P = 0; P < s.length; P++)
178
+ _(s[P]);
179
+ Object.freeze && Object.freeze(s);
180
180
  } else
181
181
  console.error(
182
182
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
183
183
  );
184
- else k(N);
185
- if (Q.call(a, "key")) {
186
- N = l(t);
187
- var O = Object.keys(a).filter(function(me) {
188
- return me !== "key";
184
+ else _(s);
185
+ if (W.call(d, "key")) {
186
+ s = i(r);
187
+ var v = Object.keys(d).filter(function(B) {
188
+ return B !== "key";
189
189
  });
190
- j = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", ae[N + j] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ P = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", M[s + P] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
191
191
  `A props object containing a "key" prop is being spread into JSX:
192
192
  let props = %s;
193
193
  <%s {...props} />
194
194
  React keys must be passed directly to JSX without using spread:
195
195
  let props = %s;
196
196
  <%s key={someKey} {...props} />`,
197
- j,
198
- N,
199
- O,
200
- N
201
- ), ae[N + j] = !0);
197
+ P,
198
+ s,
199
+ v,
200
+ s
201
+ ), M[s + P] = !0);
202
202
  }
203
- if (N = null, y !== void 0 && (p(y), N = "" + y), x(a) && (p(a.key), N = "" + a.key), "key" in a) {
204
- y = {};
205
- for (var H in a)
206
- H !== "key" && (y[H] = a[H]);
207
- } else y = a;
208
- return N && E(
209
- y,
210
- typeof t == "function" ? t.displayName || t.name || "Unknown" : t
211
- ), _(
203
+ if (s = null, S !== void 0 && (w(S), s = "" + S), N(d) && (w(d.key), s = "" + d.key), "key" in d) {
204
+ S = {};
205
+ for (var I in d)
206
+ I !== "key" && (S[I] = d[I]);
207
+ } else S = d;
208
+ return s && c(
209
+ S,
210
+ typeof r == "function" ? r.displayName || r.name || "Unknown" : r
211
+ ), l(
212
+ r,
213
+ s,
214
+ S,
215
+ h(),
212
216
  t,
213
- N,
214
- y,
215
- i(),
216
- I,
217
- q
217
+ n
218
218
  );
219
219
  }
220
- function k(t) {
221
- g(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === D && (t._payload.status === "fulfilled" ? g(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
220
+ function _(r) {
221
+ E(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === $ && (r._payload.status === "fulfilled" ? E(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
222
222
  }
223
- function g(t) {
224
- return typeof t == "object" && t !== null && t.$$typeof === v;
223
+ function E(r) {
224
+ return typeof r == "object" && r !== null && r.$$typeof === C;
225
225
  }
226
- var R = xe, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), S = /* @__PURE__ */ Symbol.for("react.portal"), o = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), c = /* @__PURE__ */ Symbol.for("react.profiler"), s = /* @__PURE__ */ Symbol.for("react.consumer"), T = /* @__PURE__ */ Symbol.for("react.context"), m = /* @__PURE__ */ Symbol.for("react.forward_ref"), h = /* @__PURE__ */ Symbol.for("react.suspense"), f = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), V = /* @__PURE__ */ Symbol.for("react.activity"), pe = /* @__PURE__ */ Symbol.for("react.client.reference"), U = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, he = Array.isArray, W = console.createTask ? console.createTask : function() {
226
+ var R = ve, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), k = /* @__PURE__ */ Symbol.for("react.portal"), u = /* @__PURE__ */ Symbol.for("react.fragment"), a = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), o = /* @__PURE__ */ Symbol.for("react.consumer"), A = /* @__PURE__ */ Symbol.for("react.context"), j = /* @__PURE__ */ Symbol.for("react.forward_ref"), f = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), V = /* @__PURE__ */ Symbol.for("react.memo"), $ = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), z = /* @__PURE__ */ Symbol.for("react.client.reference"), U = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, le = Array.isArray, q = console.createTask ? console.createTask : function() {
227
227
  return null;
228
228
  };
229
229
  R = {
230
- react_stack_bottom_frame: function(t) {
231
- return t();
230
+ react_stack_bottom_frame: function(r) {
231
+ return r();
232
232
  }
233
233
  };
234
- var ee, te = {}, re = R.react_stack_bottom_frame.bind(
234
+ var O, H = {}, ee = R.react_stack_bottom_frame.bind(
235
235
  R,
236
- d
237
- )(), se = W(w(d)), ae = {};
238
- z.Fragment = o, z.jsx = function(t, a, y) {
239
- var j = 1e4 > U.recentlyCreatedOwnerStacks++;
240
- return b(
241
- t,
242
- a,
243
- y,
236
+ b
237
+ )(), te = q(T(b)), M = {};
238
+ X.Fragment = u, X.jsx = function(r, d, S) {
239
+ var P = 1e4 > U.recentlyCreatedOwnerStacks++;
240
+ return y(
241
+ r,
242
+ d,
243
+ S,
244
244
  !1,
245
- j ? Error("react-stack-top-frame") : re,
246
- j ? W(w(t)) : se
245
+ P ? Error("react-stack-top-frame") : ee,
246
+ P ? q(T(r)) : te
247
247
  );
248
- }, z.jsxs = function(t, a, y) {
249
- var j = 1e4 > U.recentlyCreatedOwnerStacks++;
250
- return b(
251
- t,
252
- a,
253
- y,
248
+ }, X.jsxs = function(r, d, S) {
249
+ var P = 1e4 > U.recentlyCreatedOwnerStacks++;
250
+ return y(
251
+ r,
252
+ d,
253
+ S,
254
254
  !0,
255
- j ? Error("react-stack-top-frame") : re,
256
- j ? W(w(t)) : se
255
+ P ? Error("react-stack-top-frame") : ee,
256
+ P ? q(T(r)) : te
257
257
  );
258
258
  };
259
- })()), z;
259
+ })()), X;
260
260
  }
261
- var de;
262
- function De() {
263
- return de || (de = 1, process.env.NODE_ENV === "production" ? F.exports = Pe() : F.exports = Ce()), F.exports;
261
+ var xe;
262
+ function Xe() {
263
+ return xe || (xe = 1, process.env.NODE_ENV === "production" ? re.exports = Be() : re.exports = Je()), re.exports;
264
264
  }
265
- var e = De();
266
- function J(...l) {
267
- return Y(M(l));
265
+ var e = Xe();
266
+ function ne(...i) {
267
+ return Q(K(i));
268
268
  }
269
- function Oe({
270
- canvas: l = { width: 1200, height: 800, gridSize: 8, showGrid: !0, snapToGrid: !0 },
271
- components: u = [],
272
- palette: p = $e,
273
- showComponentTree: w = !0,
274
- undoRedo: i = !0,
275
- readOnly: d = !1,
276
- onChange: x,
277
- className: E
269
+ function Ze({
270
+ canvas: i = { width: 1200, height: 800, gridSize: 8, showGrid: !0, snapToGrid: !0 },
271
+ components: g = [],
272
+ palette: w = Ke,
273
+ showComponentTree: T = !0,
274
+ undoRedo: h = !0,
275
+ readOnly: b = !1,
276
+ onChange: N,
277
+ className: c
278
278
  }) {
279
- const [n, _] = A(u), [b, k] = A(null), [g, R] = A(l.zoom ?? 1), v = Z(
280
- () => n.find((r) => r.id === b),
281
- [n, b]
282
- ), S = P(
283
- (r, c) => {
284
- if (d) return;
285
- const s = {
279
+ const [m, l] = F(g), [y, _] = F(null), [E, R] = F(i.zoom ?? 1), C = ae(
280
+ () => m.find((a) => a.id === y),
281
+ [m, y]
282
+ ), k = D(
283
+ (a, x) => {
284
+ if (b) return;
285
+ const o = {
286
286
  id: `comp-${Date.now()}`,
287
- type: r,
288
- label: c,
287
+ type: a,
288
+ label: x,
289
289
  position: { x: 100, y: 100, width: 200, height: 100 },
290
290
  props: {}
291
- }, T = [...n, s];
292
- _(T), k(s.id), x?.(T);
291
+ }, A = [...m, o];
292
+ l(A), _(o.id), N?.(A);
293
293
  },
294
- [n, d, x]
295
- ), o = P(
296
- (r) => {
297
- if (d) return;
298
- const c = n.filter((s) => s.id !== r);
299
- _(c), b === r && k(null), x?.(c);
294
+ [m, b, N]
295
+ ), u = D(
296
+ (a) => {
297
+ if (b) return;
298
+ const x = m.filter((o) => o.id !== a);
299
+ l(x), y === a && _(null), N?.(x);
300
300
  },
301
- [n, b, d, x]
301
+ [m, y, b, N]
302
302
  );
303
- return /* @__PURE__ */ e.jsxs("div", { className: J("flex h-full w-full border rounded-lg overflow-hidden bg-background", E), children: [
304
- !d && /* @__PURE__ */ e.jsxs("div", { className: "w-60 border-r bg-muted/30 flex flex-col", children: [
303
+ return /* @__PURE__ */ e.jsxs("div", { className: ne("flex h-full w-full border rounded-lg overflow-hidden bg-background", c), children: [
304
+ !b && /* @__PURE__ */ e.jsxs("div", { className: "w-60 border-r bg-muted/30 flex flex-col", children: [
305
305
  /* @__PURE__ */ e.jsx("div", { className: "p-3 border-b font-medium text-sm", children: "Components" }),
306
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: p.map((r) => /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
307
- /* @__PURE__ */ e.jsx("div", { className: "text-xs font-medium text-muted-foreground px-2 py-1 uppercase", children: r.label }),
308
- r.items.map((c) => /* @__PURE__ */ e.jsxs(
306
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: w.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
307
+ /* @__PURE__ */ e.jsx("div", { className: "text-xs font-medium text-muted-foreground px-2 py-1 uppercase", children: a.label }),
308
+ a.items.map((x) => /* @__PURE__ */ e.jsxs(
309
309
  "button",
310
310
  {
311
- onClick: () => S(c.type, c.label),
311
+ onClick: () => k(x.type, x.label),
312
312
  className: "w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded hover:bg-accent text-left",
313
313
  children: [
314
- /* @__PURE__ */ e.jsx(K, { className: "h-3 w-3" }),
315
- c.label
314
+ /* @__PURE__ */ e.jsx(Y, { className: "h-3 w-3" }),
315
+ x.label
316
316
  ]
317
317
  },
318
- c.type
318
+ x.type
319
319
  ))
320
- ] }, r.name)) })
320
+ ] }, a.name)) })
321
321
  ] }),
322
322
  /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex flex-col", children: [
323
323
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20", children: [
324
- i && !d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
325
- /* @__PURE__ */ e.jsx("button", { className: "p-1.5 rounded hover:bg-accent", title: "Undo", children: /* @__PURE__ */ e.jsx(be, { className: "h-4 w-4" }) }),
326
- /* @__PURE__ */ e.jsx("button", { className: "p-1.5 rounded hover:bg-accent", title: "Redo", children: /* @__PURE__ */ e.jsx(ge, { className: "h-4 w-4" }) }),
324
+ h && !b && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
325
+ /* @__PURE__ */ e.jsx("button", { className: "p-1.5 rounded hover:bg-accent", title: "Undo", children: /* @__PURE__ */ e.jsx(we, { className: "h-4 w-4" }) }),
326
+ /* @__PURE__ */ e.jsx("button", { className: "p-1.5 rounded hover:bg-accent", title: "Redo", children: /* @__PURE__ */ e.jsx(Ne, { className: "h-4 w-4" }) }),
327
327
  /* @__PURE__ */ e.jsx("div", { className: "w-px h-5 bg-border mx-1" })
328
328
  ] }),
329
- /* @__PURE__ */ e.jsx("button", { className: "p-1.5 rounded hover:bg-accent", title: "Preview", children: /* @__PURE__ */ e.jsx(ye, { className: "h-4 w-4" }) }),
329
+ /* @__PURE__ */ e.jsx("button", { className: "p-1.5 rounded hover:bg-accent", title: "Preview", children: /* @__PURE__ */ e.jsx(be, { className: "h-4 w-4" }) }),
330
330
  /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
331
331
  /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
332
- Math.round(g * 100),
332
+ Math.round(E * 100),
333
333
  "%"
334
334
  ] })
335
335
  ] }),
@@ -338,94 +338,94 @@ function Oe({
338
338
  {
339
339
  className: "relative bg-background border rounded shadow-sm mx-auto",
340
340
  style: {
341
- width: l.width * g,
342
- height: l.height * g,
343
- backgroundImage: l.showGrid ? "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)" : void 0,
344
- backgroundSize: l.showGrid && l.gridSize ? `${l.gridSize * g}px ${l.gridSize * g}px` : void 0
341
+ width: i.width * E,
342
+ height: i.height * E,
343
+ backgroundImage: i.showGrid ? "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)" : void 0,
344
+ backgroundSize: i.showGrid && i.gridSize ? `${i.gridSize * E}px ${i.gridSize * E}px` : void 0
345
345
  },
346
- children: n.map((r) => /* @__PURE__ */ e.jsxs(
346
+ children: m.map((a) => /* @__PURE__ */ e.jsxs(
347
347
  "div",
348
348
  {
349
- className: J(
349
+ className: ne(
350
350
  "absolute border rounded cursor-move select-none transition-shadow",
351
- b === r.id ? "border-primary ring-2 ring-primary/20 shadow-md" : "border-border hover:border-primary/50"
351
+ y === a.id ? "border-primary ring-2 ring-primary/20 shadow-md" : "border-border hover:border-primary/50"
352
352
  ),
353
353
  style: {
354
- left: r.position.x * g,
355
- top: r.position.y * g,
356
- width: typeof r.position.width == "number" ? r.position.width * g : r.position.width,
357
- height: typeof r.position.height == "number" ? r.position.height * g : r.position.height
354
+ left: a.position.x * E,
355
+ top: a.position.y * E,
356
+ width: typeof a.position.width == "number" ? a.position.width * E : a.position.width,
357
+ height: typeof a.position.height == "number" ? a.position.height * E : a.position.height
358
358
  },
359
- onClick: () => k(r.id),
359
+ onClick: () => _(a.id),
360
360
  children: [
361
361
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 px-2 py-1 bg-muted/50 text-xs border-b", children: [
362
- /* @__PURE__ */ e.jsx(ve, { className: "h-3 w-3 text-muted-foreground" }),
363
- /* @__PURE__ */ e.jsx("span", { className: "truncate", children: r.label ?? r.type }),
364
- !d && /* @__PURE__ */ e.jsx(
362
+ /* @__PURE__ */ e.jsx(ge, { className: "h-3 w-3 text-muted-foreground" }),
363
+ /* @__PURE__ */ e.jsx("span", { className: "truncate", children: a.label ?? a.type }),
364
+ !b && /* @__PURE__ */ e.jsx(
365
365
  "button",
366
366
  {
367
- onClick: (c) => {
368
- c.stopPropagation(), o(r.id);
367
+ onClick: (x) => {
368
+ x.stopPropagation(), u(a.id);
369
369
  },
370
370
  className: "ml-auto p-0.5 rounded hover:bg-destructive/10",
371
- children: /* @__PURE__ */ e.jsx(L, { className: "h-3 w-3 text-destructive" })
371
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-3 w-3 text-destructive" })
372
372
  }
373
373
  )
374
374
  ] }),
375
- /* @__PURE__ */ e.jsx("div", { className: "p-2 text-xs text-muted-foreground", children: r.type })
375
+ /* @__PURE__ */ e.jsx("div", { className: "p-2 text-xs text-muted-foreground", children: a.type })
376
376
  ]
377
377
  },
378
- r.id
378
+ a.id
379
379
  ))
380
380
  }
381
381
  ) })
382
382
  ] }),
383
- w && /* @__PURE__ */ e.jsxs("div", { className: "w-60 border-l bg-muted/30 flex flex-col", children: [
383
+ T && /* @__PURE__ */ e.jsxs("div", { className: "w-60 border-l bg-muted/30 flex flex-col", children: [
384
384
  /* @__PURE__ */ e.jsxs("div", { className: "p-3 border-b font-medium text-sm flex items-center gap-2", children: [
385
- /* @__PURE__ */ e.jsx(we, { className: "h-4 w-4" }),
385
+ /* @__PURE__ */ e.jsx(ye, { className: "h-4 w-4" }),
386
386
  "Component Tree"
387
387
  ] }),
388
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: n.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "text-xs text-muted-foreground text-center py-4", children: "No components added yet" }) : n.map((r) => /* @__PURE__ */ e.jsx(
388
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: m.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "text-xs text-muted-foreground text-center py-4", children: "No components added yet" }) : m.map((a) => /* @__PURE__ */ e.jsx(
389
389
  "button",
390
390
  {
391
- onClick: () => k(r.id),
392
- className: J(
391
+ onClick: () => _(a.id),
392
+ className: ne(
393
393
  "w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded text-left",
394
- b === r.id ? "bg-accent" : "hover:bg-accent/50"
394
+ y === a.id ? "bg-accent" : "hover:bg-accent/50"
395
395
  ),
396
- children: /* @__PURE__ */ e.jsx("span", { className: "truncate", children: r.label ?? r.type })
396
+ children: /* @__PURE__ */ e.jsx("span", { className: "truncate", children: a.label ?? a.type })
397
397
  },
398
- r.id
398
+ a.id
399
399
  )) }),
400
- v && /* @__PURE__ */ e.jsxs("div", { className: "border-t p-3", children: [
400
+ C && /* @__PURE__ */ e.jsxs("div", { className: "border-t p-3", children: [
401
401
  /* @__PURE__ */ e.jsx("div", { className: "text-xs font-medium mb-2", children: "Properties" }),
402
402
  /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-muted-foreground space-y-1", children: [
403
403
  /* @__PURE__ */ e.jsxs("div", { children: [
404
404
  "Type: ",
405
- v.type
405
+ C.type
406
406
  ] }),
407
407
  /* @__PURE__ */ e.jsxs("div", { children: [
408
408
  "ID: ",
409
- v.id
409
+ C.id
410
410
  ] }),
411
411
  /* @__PURE__ */ e.jsxs("div", { children: [
412
412
  "Position: ",
413
- v.position.x,
413
+ C.position.x,
414
414
  ", ",
415
- v.position.y
415
+ C.position.y
416
416
  ] }),
417
417
  /* @__PURE__ */ e.jsxs("div", { children: [
418
418
  "Size: ",
419
- v.position.width,
419
+ C.position.width,
420
420
  " × ",
421
- v.position.height
421
+ C.position.height
422
422
  ] })
423
423
  ] })
424
424
  ] })
425
425
  ] })
426
426
  ] });
427
427
  }
428
- const $e = [
428
+ const Ke = [
429
429
  {
430
430
  name: "layout",
431
431
  label: "Layout",
@@ -459,56 +459,56 @@ const $e = [
459
459
  ]
460
460
  }
461
461
  ];
462
- function B(...l) {
463
- return Y(M(l));
462
+ function oe(...i) {
463
+ return Q(K(i));
464
464
  }
465
- function ze({
466
- entities: l = [],
467
- relationships: u = [],
468
- canvas: p = { width: 1200, height: 800, showGrid: !0 },
469
- showRelationshipLabels: w = !0,
470
- readOnly: i = !1,
471
- onEntitiesChange: d,
472
- onRelationshipsChange: x,
473
- className: E
465
+ function Qe({
466
+ entities: i = [],
467
+ relationships: g = [],
468
+ canvas: w = { width: 1200, height: 800, showGrid: !0 },
469
+ showRelationshipLabels: T = !0,
470
+ readOnly: h = !1,
471
+ onEntitiesChange: b,
472
+ onRelationshipsChange: N,
473
+ className: c
474
474
  }) {
475
- const [n, _] = A(l), [b, k] = A(u), [g, R] = A(null), v = P(() => {
476
- if (i) return;
477
- const o = {
475
+ const [m, l] = F(i), [y, _] = F(g), [E, R] = F(null), C = D(() => {
476
+ if (h) return;
477
+ const u = {
478
478
  id: `entity-${Date.now()}`,
479
- name: `new_entity_${n.length + 1}`,
480
- label: `New Entity ${n.length + 1}`,
479
+ name: `new_entity_${m.length + 1}`,
480
+ label: `New Entity ${m.length + 1}`,
481
481
  fields: [
482
482
  { name: "id", type: "uuid", primaryKey: !0, required: !0 },
483
483
  { name: "created_at", type: "datetime", required: !0 },
484
484
  { name: "updated_at", type: "datetime", required: !0 }
485
485
  ],
486
- position: { x: 50 + n.length % 4 * 280, y: 50 + Math.floor(n.length / 4) * 250 }
487
- }, r = [...n, o];
488
- _(r), R(o.id), d?.(r);
489
- }, [n, i, d]), S = P(
490
- (o) => {
491
- if (i) return;
492
- const r = n.filter((s) => s.id !== o), c = b.filter(
493
- (s) => s.sourceEntity !== o && s.targetEntity !== o
486
+ position: { x: 50 + m.length % 4 * 280, y: 50 + Math.floor(m.length / 4) * 250 }
487
+ }, a = [...m, u];
488
+ l(a), R(u.id), b?.(a);
489
+ }, [m, h, b]), k = D(
490
+ (u) => {
491
+ if (h) return;
492
+ const a = m.filter((o) => o.id !== u), x = y.filter(
493
+ (o) => o.sourceEntity !== u && o.targetEntity !== u
494
494
  );
495
- _(r), k(c), g === o && R(null), d?.(r), x?.(c);
495
+ l(a), _(x), E === u && R(null), b?.(a), N?.(x);
496
496
  },
497
- [n, b, g, i, d, x]
497
+ [m, y, E, h, b, N]
498
498
  );
499
- return /* @__PURE__ */ e.jsx("div", { className: B("flex h-full w-full border rounded-lg overflow-hidden bg-background", E), children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full", children: [
499
+ return /* @__PURE__ */ e.jsx("div", { className: oe("flex h-full w-full border rounded-lg overflow-hidden bg-background", c), children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full", children: [
500
500
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20", children: [
501
- /* @__PURE__ */ e.jsx(le, { className: "h-4 w-4" }),
501
+ /* @__PURE__ */ e.jsx(de, { className: "h-4 w-4" }),
502
502
  /* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: "Data Model Designer" }),
503
503
  /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
504
- !i && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
504
+ !h && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
505
505
  /* @__PURE__ */ e.jsxs(
506
506
  "button",
507
507
  {
508
- onClick: v,
508
+ onClick: C,
509
509
  className: "flex items-center gap-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90",
510
510
  children: [
511
- /* @__PURE__ */ e.jsx(K, { className: "h-3 w-3" }),
511
+ /* @__PURE__ */ e.jsx(Y, { className: "h-3 w-3" }),
512
512
  " Add Entity"
513
513
  ]
514
514
  }
@@ -518,7 +518,7 @@ function ze({
518
518
  {
519
519
  className: "flex items-center gap-1 px-2 py-1 text-xs rounded bg-secondary text-secondary-foreground hover:bg-secondary/80",
520
520
  children: [
521
- /* @__PURE__ */ e.jsx(je, { className: "h-3 w-3" }),
521
+ /* @__PURE__ */ e.jsx(ke, { className: "h-3 w-3" }),
522
522
  " Add Relationship"
523
523
  ]
524
524
  }
@@ -530,141 +530,141 @@ function ze({
530
530
  {
531
531
  className: "relative",
532
532
  style: {
533
- width: p.width,
534
- minHeight: p.height,
535
- backgroundImage: p.showGrid ? "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)" : void 0,
536
- backgroundSize: p.showGrid ? "20px 20px" : void 0
533
+ width: w.width,
534
+ minHeight: w.height,
535
+ backgroundImage: w.showGrid ? "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)" : void 0,
536
+ backgroundSize: w.showGrid ? "20px 20px" : void 0
537
537
  },
538
538
  children: [
539
539
  /* @__PURE__ */ e.jsx(
540
540
  "svg",
541
541
  {
542
542
  className: "absolute inset-0 pointer-events-none",
543
- width: p.width,
544
- height: p.height,
545
- children: b.map((o) => {
546
- const r = n.find((s) => s.id === o.sourceEntity), c = n.find((s) => s.id === o.targetEntity);
547
- return !r || !c ? null : /* @__PURE__ */ e.jsxs("g", { children: [
543
+ width: w.width,
544
+ height: w.height,
545
+ children: y.map((u) => {
546
+ const a = m.find((o) => o.id === u.sourceEntity), x = m.find((o) => o.id === u.targetEntity);
547
+ return !a || !x ? null : /* @__PURE__ */ e.jsxs("g", { children: [
548
548
  /* @__PURE__ */ e.jsx(
549
549
  "line",
550
550
  {
551
- x1: r.position.x + 120,
552
- y1: r.position.y + 50,
553
- x2: c.position.x + 120,
554
- y2: c.position.y + 50,
551
+ x1: a.position.x + 120,
552
+ y1: a.position.y + 50,
553
+ x2: x.position.x + 120,
554
+ y2: x.position.y + 50,
555
555
  stroke: "hsl(var(--primary))",
556
556
  strokeWidth: "2",
557
- strokeDasharray: o.type === "many-to-many" ? "5,5" : void 0
557
+ strokeDasharray: u.type === "many-to-many" ? "5,5" : void 0
558
558
  }
559
559
  ),
560
- w && o.label && /* @__PURE__ */ e.jsx(
560
+ T && u.label && /* @__PURE__ */ e.jsx(
561
561
  "text",
562
562
  {
563
- x: (r.position.x + c.position.x) / 2 + 120,
564
- y: (r.position.y + c.position.y) / 2 + 50 - 8,
563
+ x: (a.position.x + x.position.x) / 2 + 120,
564
+ y: (a.position.y + x.position.y) / 2 + 50 - 8,
565
565
  textAnchor: "middle",
566
566
  className: "text-xs fill-muted-foreground",
567
- children: o.label
567
+ children: u.label
568
568
  }
569
569
  )
570
- ] }, o.id);
570
+ ] }, u.id);
571
571
  })
572
572
  }
573
573
  ),
574
- n.map((o) => /* @__PURE__ */ e.jsxs(
574
+ m.map((u) => /* @__PURE__ */ e.jsxs(
575
575
  "div",
576
576
  {
577
- className: B(
577
+ className: oe(
578
578
  "absolute rounded-lg border-2 bg-background shadow-sm w-60 select-none",
579
- g === o.id ? "border-primary ring-2 ring-primary/20" : "border-border hover:border-primary/50"
579
+ E === u.id ? "border-primary ring-2 ring-primary/20" : "border-border hover:border-primary/50"
580
580
  ),
581
581
  style: {
582
- left: o.position.x,
583
- top: o.position.y
582
+ left: u.position.x,
583
+ top: u.position.y
584
584
  },
585
- onClick: () => R(o.id),
585
+ onClick: () => R(u.id),
586
586
  children: [
587
587
  /* @__PURE__ */ e.jsxs(
588
588
  "div",
589
589
  {
590
590
  className: "flex items-center gap-2 px-3 py-2 rounded-t-lg font-medium text-sm",
591
- style: { backgroundColor: o.color ?? "hsl(var(--primary) / 0.1)" },
591
+ style: { backgroundColor: u.color ?? "hsl(var(--primary) / 0.1)" },
592
592
  children: [
593
- /* @__PURE__ */ e.jsx(le, { className: "h-3.5 w-3.5" }),
594
- /* @__PURE__ */ e.jsx("span", { className: "truncate", children: o.label }),
595
- !i && /* @__PURE__ */ e.jsx(
593
+ /* @__PURE__ */ e.jsx(de, { className: "h-3.5 w-3.5" }),
594
+ /* @__PURE__ */ e.jsx("span", { className: "truncate", children: u.label }),
595
+ !h && /* @__PURE__ */ e.jsx(
596
596
  "button",
597
597
  {
598
- onClick: (r) => {
599
- r.stopPropagation(), S(o.id);
598
+ onClick: (a) => {
599
+ a.stopPropagation(), k(u.id);
600
600
  },
601
601
  className: "ml-auto p-0.5 rounded hover:bg-destructive/20",
602
- children: /* @__PURE__ */ e.jsx(L, { className: "h-3 w-3 text-destructive" })
602
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-3 w-3 text-destructive" })
603
603
  }
604
604
  )
605
605
  ]
606
606
  }
607
607
  ),
608
- /* @__PURE__ */ e.jsx("div", { className: "px-3 py-1 divide-y", children: o.fields.map((r) => /* @__PURE__ */ e.jsxs(
608
+ /* @__PURE__ */ e.jsx("div", { className: "px-3 py-1 divide-y", children: u.fields.map((a) => /* @__PURE__ */ e.jsxs(
609
609
  "div",
610
610
  {
611
611
  className: "flex items-center gap-2 py-1 text-xs",
612
612
  children: [
613
- /* @__PURE__ */ e.jsxs("span", { className: B("font-mono", r.primaryKey && "font-bold text-primary"), children: [
614
- r.primaryKey ? "🔑 " : "",
615
- r.name
613
+ /* @__PURE__ */ e.jsxs("span", { className: oe("font-mono", a.primaryKey && "font-bold text-primary"), children: [
614
+ a.primaryKey ? "🔑 " : "",
615
+ a.name
616
616
  ] }),
617
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground ml-auto", children: r.type }),
618
- r.required && /* @__PURE__ */ e.jsx("span", { className: "text-destructive", children: "*" })
617
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground ml-auto", children: a.type }),
618
+ a.required && /* @__PURE__ */ e.jsx("span", { className: "text-destructive", children: "*" })
619
619
  ]
620
620
  },
621
- r.name
621
+ a.name
622
622
  )) })
623
623
  ]
624
624
  },
625
- o.id
625
+ u.id
626
626
  ))
627
627
  ]
628
628
  }
629
629
  ) })
630
630
  ] }) });
631
631
  }
632
- function X(...l) {
633
- return Y(M(l));
632
+ function ie(...i) {
633
+ return Q(K(i));
634
634
  }
635
- function Ie({
636
- processName: l = "New Process",
637
- nodes: u = [],
638
- edges: p = [],
639
- lanes: w,
640
- canvas: i = { width: 1400, height: 800, showGrid: !0 },
641
- showToolbar: d = !0,
642
- readOnly: x = !1,
643
- onNodesChange: E,
644
- onEdgesChange: n,
645
- className: _
635
+ function Oe({
636
+ processName: i = "New Process",
637
+ nodes: g = [],
638
+ edges: w = [],
639
+ lanes: T,
640
+ canvas: h = { width: 1400, height: 800, showGrid: !0 },
641
+ showToolbar: b = !0,
642
+ readOnly: N = !1,
643
+ onNodesChange: c,
644
+ onEdgesChange: m,
645
+ className: l
646
646
  }) {
647
- const [b, k] = A(u), [g, R] = A(p), [v, S] = A(null), o = P(
648
- (s, T) => {
649
- if (x) return;
650
- const m = {
647
+ const [y, _] = F(g), [E, R] = F(w), [C, k] = F(null), u = D(
648
+ (o, A) => {
649
+ if (N) return;
650
+ const j = {
651
651
  id: `node-${Date.now()}`,
652
- type: s,
653
- label: T,
654
- position: { x: 200 + b.length * 160, y: 200 }
655
- }, h = [...b, m];
656
- k(h), S(m.id), E?.(h);
652
+ type: o,
653
+ label: A,
654
+ position: { x: 200 + y.length * 160, y: 200 }
655
+ }, f = [...y, j];
656
+ _(f), k(j.id), c?.(f);
657
657
  },
658
- [b, x, E]
659
- ), r = P(
660
- (s) => {
661
- if (x) return;
662
- const T = b.filter((h) => h.id !== s), m = g.filter((h) => h.source !== s && h.target !== s);
663
- k(T), R(m), v === s && S(null), E?.(T), n?.(m);
658
+ [y, N, c]
659
+ ), a = D(
660
+ (o) => {
661
+ if (N) return;
662
+ const A = y.filter((f) => f.id !== o), j = E.filter((f) => f.source !== o && f.target !== o);
663
+ _(A), R(j), C === o && k(null), c?.(A), m?.(j);
664
664
  },
665
- [b, g, v, x, E, n]
666
- ), c = (s) => {
667
- switch (s) {
665
+ [y, E, C, N, c, m]
666
+ ), x = (o) => {
667
+ switch (o) {
668
668
  case "start-event":
669
669
  return "rounded-full bg-green-100 border-green-500 text-green-700";
670
670
  case "end-event":
@@ -683,20 +683,20 @@ function Ie({
683
683
  return "rounded bg-gray-100 border-gray-500 text-gray-700";
684
684
  }
685
685
  };
686
- return /* @__PURE__ */ e.jsxs("div", { className: X("flex flex-col h-full w-full border rounded-lg overflow-hidden bg-background", _), children: [
687
- d && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20", children: [
688
- /* @__PURE__ */ e.jsx(Ne, { className: "h-4 w-4" }),
689
- /* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: l }),
686
+ return /* @__PURE__ */ e.jsxs("div", { className: ie("flex flex-col h-full w-full border rounded-lg overflow-hidden bg-background", l), children: [
687
+ b && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20", children: [
688
+ /* @__PURE__ */ e.jsx(Ee, { className: "h-4 w-4" }),
689
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: i }),
690
690
  /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
691
- !x && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
691
+ !N && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
692
692
  /* @__PURE__ */ e.jsxs(
693
693
  "button",
694
694
  {
695
- onClick: () => o("start-event", "Start"),
695
+ onClick: () => u("start-event", "Start"),
696
696
  className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
697
697
  title: "Add Start Event",
698
698
  children: [
699
- /* @__PURE__ */ e.jsx(Ee, { className: "h-3 w-3 text-green-600" }),
699
+ /* @__PURE__ */ e.jsx(Se, { className: "h-3 w-3 text-green-600" }),
700
700
  " Start"
701
701
  ]
702
702
  }
@@ -704,11 +704,11 @@ function Ie({
704
704
  /* @__PURE__ */ e.jsxs(
705
705
  "button",
706
706
  {
707
- onClick: () => o("user-task", "User Task"),
707
+ onClick: () => u("user-task", "User Task"),
708
708
  className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
709
709
  title: "Add User Task",
710
710
  children: [
711
- /* @__PURE__ */ e.jsx(oe, { className: "h-3 w-3 text-blue-600" }),
711
+ /* @__PURE__ */ e.jsx(ce, { className: "h-3 w-3 text-blue-600" }),
712
712
  " Task"
713
713
  ]
714
714
  }
@@ -716,11 +716,11 @@ function Ie({
716
716
  /* @__PURE__ */ e.jsxs(
717
717
  "button",
718
718
  {
719
- onClick: () => o("exclusive-gateway", "Decision"),
719
+ onClick: () => u("exclusive-gateway", "Decision"),
720
720
  className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
721
721
  title: "Add Gateway",
722
722
  children: [
723
- /* @__PURE__ */ e.jsx(ke, { className: "h-3 w-3 text-yellow-600" }),
723
+ /* @__PURE__ */ e.jsx(Ce, { className: "h-3 w-3 text-yellow-600" }),
724
724
  " Gateway"
725
725
  ]
726
726
  }
@@ -728,11 +728,11 @@ function Ie({
728
728
  /* @__PURE__ */ e.jsxs(
729
729
  "button",
730
730
  {
731
- onClick: () => o("end-event", "End"),
731
+ onClick: () => u("end-event", "End"),
732
732
  className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
733
733
  title: "Add End Event",
734
734
  children: [
735
- /* @__PURE__ */ e.jsx(oe, { className: "h-3 w-3 text-red-600" }),
735
+ /* @__PURE__ */ e.jsx(ce, { className: "h-3 w-3 text-red-600" }),
736
736
  " End"
737
737
  ]
738
738
  }
@@ -744,18 +744,18 @@ function Ie({
744
744
  {
745
745
  className: "relative",
746
746
  style: {
747
- width: i.width,
748
- minHeight: i.height,
749
- backgroundImage: i.showGrid ? "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)" : void 0,
750
- backgroundSize: i.showGrid ? "20px 20px" : void 0
747
+ width: h.width,
748
+ minHeight: h.height,
749
+ backgroundImage: h.showGrid ? "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)" : void 0,
750
+ backgroundSize: h.showGrid ? "20px 20px" : void 0
751
751
  },
752
752
  children: [
753
753
  /* @__PURE__ */ e.jsxs(
754
754
  "svg",
755
755
  {
756
756
  className: "absolute inset-0 pointer-events-none",
757
- width: i.width,
758
- height: i.height,
757
+ width: h.width,
758
+ height: h.height,
759
759
  children: [
760
760
  /* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx(
761
761
  "marker",
@@ -769,126 +769,126 @@ function Ie({
769
769
  children: /* @__PURE__ */ e.jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: "hsl(var(--foreground))" })
770
770
  }
771
771
  ) }),
772
- g.map((s) => {
773
- const T = b.find((h) => h.id === s.source), m = b.find((h) => h.id === s.target);
774
- return !T || !m ? null : /* @__PURE__ */ e.jsx(
772
+ E.map((o) => {
773
+ const A = y.find((f) => f.id === o.source), j = y.find((f) => f.id === o.target);
774
+ return !A || !j ? null : /* @__PURE__ */ e.jsx(
775
775
  "line",
776
776
  {
777
- x1: T.position.x + 60,
778
- y1: T.position.y + 25,
779
- x2: m.position.x,
780
- y2: m.position.y + 25,
777
+ x1: A.position.x + 60,
778
+ y1: A.position.y + 25,
779
+ x2: j.position.x,
780
+ y2: j.position.y + 25,
781
781
  stroke: "hsl(var(--foreground) / 0.5)",
782
782
  strokeWidth: "2",
783
783
  markerEnd: "url(#arrowhead)"
784
784
  },
785
- s.id
785
+ o.id
786
786
  );
787
787
  })
788
788
  ]
789
789
  }
790
790
  ),
791
- b.map((s) => /* @__PURE__ */ e.jsxs(
791
+ y.map((o) => /* @__PURE__ */ e.jsxs(
792
792
  "div",
793
793
  {
794
794
  className: "absolute select-none",
795
795
  style: {
796
- left: s.position.x,
797
- top: s.position.y
796
+ left: o.position.x,
797
+ top: o.position.y
798
798
  },
799
- onClick: () => S(s.id),
799
+ onClick: () => k(o.id),
800
800
  children: [
801
801
  /* @__PURE__ */ e.jsx(
802
802
  "div",
803
803
  {
804
- className: X(
804
+ className: ie(
805
805
  "flex items-center justify-center border-2 min-w-[120px] min-h-[50px] px-3 py-2",
806
- c(s.type),
807
- v === s.id && "ring-2 ring-primary shadow-md"
806
+ x(o.type),
807
+ C === o.id && "ring-2 ring-primary shadow-md"
808
808
  ),
809
- children: /* @__PURE__ */ e.jsx("span", { className: X(
809
+ children: /* @__PURE__ */ e.jsx("span", { className: ie(
810
810
  "text-xs font-medium",
811
- (s.type === "exclusive-gateway" || s.type === "parallel-gateway") && "-rotate-45"
812
- ), children: s.label })
811
+ (o.type === "exclusive-gateway" || o.type === "parallel-gateway") && "-rotate-45"
812
+ ), children: o.label })
813
813
  }
814
814
  ),
815
- !x && v === s.id && /* @__PURE__ */ e.jsx(
815
+ !N && C === o.id && /* @__PURE__ */ e.jsx(
816
816
  "button",
817
817
  {
818
- onClick: (T) => {
819
- T.stopPropagation(), r(s.id);
818
+ onClick: (A) => {
819
+ A.stopPropagation(), a(o.id);
820
820
  },
821
821
  className: "absolute -top-2 -right-2 p-0.5 rounded-full bg-destructive text-destructive-foreground shadow",
822
- children: /* @__PURE__ */ e.jsx(L, { className: "h-3 w-3" })
822
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-3 w-3" })
823
823
  }
824
824
  )
825
825
  ]
826
826
  },
827
- s.id
827
+ o.id
828
828
  ))
829
829
  ]
830
830
  }
831
831
  ) })
832
832
  ] });
833
833
  }
834
- function ce(...l) {
835
- return Y(M(l));
834
+ function pe(...i) {
835
+ return Q(K(i));
836
836
  }
837
- const Fe = {
837
+ const et = {
838
838
  A4: { width: 595, height: 842 },
839
839
  A3: { width: 842, height: 1191 },
840
840
  Letter: { width: 612, height: 792 },
841
841
  Legal: { width: 612, height: 1008 },
842
842
  Tabloid: { width: 792, height: 1224 }
843
843
  };
844
- function Ge({
845
- reportName: l = "Untitled Report",
846
- objectName: u,
847
- pageSize: p = "A4",
848
- orientation: w = "portrait",
849
- margins: i = { top: 40, right: 40, bottom: 40, left: 40 },
850
- sections: d = [],
851
- showToolbar: x = !0,
852
- showPropertyPanel: E = !0,
853
- readOnly: n = !1,
854
- onSectionsChange: _,
855
- className: b
844
+ function tt({
845
+ reportName: i = "Untitled Report",
846
+ objectName: g,
847
+ pageSize: w = "A4",
848
+ orientation: T = "portrait",
849
+ margins: h = { top: 40, right: 40, bottom: 40, left: 40 },
850
+ sections: b = [],
851
+ showToolbar: N = !0,
852
+ showPropertyPanel: c = !0,
853
+ readOnly: m = !1,
854
+ onSectionsChange: l,
855
+ className: y
856
856
  }) {
857
- const [k, g] = A(
858
- d.length > 0 ? d : [
857
+ const [_, E] = F(
858
+ b.length > 0 ? b : [
859
859
  { type: "header", height: 80, elements: [] },
860
860
  { type: "detail", height: 400, elements: [], repeat: !0 },
861
861
  { type: "footer", height: 60, elements: [] }
862
862
  ]
863
- ), [R, v] = A(null), S = Fe[p], o = w === "landscape" ? S.height : S.width, r = w === "landscape" ? S.width : S.height, c = P(
864
- (m, h) => {
865
- if (n) return;
866
- const f = {
863
+ ), [R, C] = F(null), k = et[w], u = T === "landscape" ? k.height : k.width, a = T === "landscape" ? k.width : k.height, x = D(
864
+ (j, f) => {
865
+ if (m) return;
866
+ const p = {
867
867
  id: `elem-${Date.now()}`,
868
- type: h,
869
- position: { x: i.left, y: 10, width: 200, height: 30 },
868
+ type: f,
869
+ position: { x: h.left, y: 10, width: 200, height: 30 },
870
870
  properties: {
871
- text: h === "text" ? "New Text" : void 0,
872
- field: h === "field" ? "field_name" : void 0
871
+ text: f === "text" ? "New Text" : void 0,
872
+ field: f === "field" ? "field_name" : void 0
873
873
  }
874
- }, C = k.map(
875
- (D, V) => V === m ? { ...D, elements: [...D.elements, f] } : D
874
+ }, V = _.map(
875
+ ($, L) => L === j ? { ...$, elements: [...$.elements, p] } : $
876
876
  );
877
- g(C), v(f.id), _?.(C);
877
+ E(V), C(p.id), l?.(V);
878
878
  },
879
- [k, i.left, n, _]
880
- ), s = P(
881
- (m) => {
882
- if (n) return;
883
- const h = k.map((f) => ({
884
- ...f,
885
- elements: f.elements.filter((C) => C.id !== m)
879
+ [_, h.left, m, l]
880
+ ), o = D(
881
+ (j) => {
882
+ if (m) return;
883
+ const f = _.map((p) => ({
884
+ ...p,
885
+ elements: p.elements.filter((V) => V.id !== j)
886
886
  }));
887
- g(h), R === m && v(null), _?.(h);
887
+ E(f), R === j && C(null), l?.(f);
888
888
  },
889
- [k, R, n, _]
890
- ), T = (m) => {
891
- switch (m) {
889
+ [_, R, m, l]
890
+ ), A = (j) => {
891
+ switch (j) {
892
892
  case "header":
893
893
  return "Report Header";
894
894
  case "page-header":
@@ -904,24 +904,24 @@ function Ge({
904
904
  case "footer":
905
905
  return "Report Footer";
906
906
  default:
907
- return m;
907
+ return j;
908
908
  }
909
909
  };
910
- return /* @__PURE__ */ e.jsxs("div", { className: ce("flex h-full w-full border rounded-lg overflow-hidden bg-background", b), children: [
910
+ return /* @__PURE__ */ e.jsxs("div", { className: pe("flex h-full w-full border rounded-lg overflow-hidden bg-background", y), children: [
911
911
  /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex flex-col", children: [
912
- x && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20", children: [
913
- /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4" }),
914
- /* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: l }),
915
- u && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
912
+ N && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20", children: [
913
+ /* @__PURE__ */ e.jsx(Te, { className: "h-4 w-4" }),
914
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: i }),
915
+ g && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
916
916
  "(",
917
- u,
917
+ g,
918
918
  ")"
919
919
  ] }),
920
920
  /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
921
921
  /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
922
- p,
922
+ w,
923
923
  " ",
924
- w
924
+ T
925
925
  ] })
926
926
  ] }),
927
927
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-auto bg-muted/10 p-4 flex justify-center", children: /* @__PURE__ */ e.jsx(
@@ -929,42 +929,42 @@ function Ge({
929
929
  {
930
930
  className: "bg-white shadow-lg border",
931
931
  style: {
932
- width: o,
933
- minHeight: r
932
+ width: u,
933
+ minHeight: a
934
934
  },
935
- children: k.map((m, h) => /* @__PURE__ */ e.jsxs(
935
+ children: _.map((j, f) => /* @__PURE__ */ e.jsxs(
936
936
  "div",
937
937
  {
938
938
  className: "relative border-b border-dashed border-gray-300",
939
- style: { minHeight: m.height },
939
+ style: { minHeight: j.height },
940
940
  children: [
941
941
  /* @__PURE__ */ e.jsxs("div", { className: "absolute left-0 top-0 px-2 py-0.5 bg-muted text-xs text-muted-foreground border-r border-b rounded-br", children: [
942
- T(m.type),
943
- m.repeat && " ↻"
942
+ A(j.type),
943
+ j.repeat && " ↻"
944
944
  ] }),
945
- !n && /* @__PURE__ */ e.jsxs("div", { className: "absolute right-1 top-0 flex items-center gap-0.5", children: [
945
+ !m && /* @__PURE__ */ e.jsxs("div", { className: "absolute right-1 top-0 flex items-center gap-0.5", children: [
946
946
  /* @__PURE__ */ e.jsx(
947
947
  "button",
948
948
  {
949
- onClick: () => c(h, "text"),
949
+ onClick: () => x(f, "text"),
950
950
  className: "p-0.5 rounded hover:bg-accent",
951
951
  title: "Add Text",
952
- children: /* @__PURE__ */ e.jsx(Te, { className: "h-3 w-3" })
952
+ children: /* @__PURE__ */ e.jsx(Re, { className: "h-3 w-3" })
953
953
  }
954
954
  ),
955
955
  /* @__PURE__ */ e.jsx(
956
956
  "button",
957
957
  {
958
- onClick: () => c(h, "field"),
958
+ onClick: () => x(f, "field"),
959
959
  className: "p-0.5 rounded hover:bg-accent",
960
960
  title: "Add Field",
961
- children: /* @__PURE__ */ e.jsx(K, { className: "h-3 w-3" })
961
+ children: /* @__PURE__ */ e.jsx(Y, { className: "h-3 w-3" })
962
962
  }
963
963
  ),
964
964
  /* @__PURE__ */ e.jsx(
965
965
  "button",
966
966
  {
967
- onClick: () => c(h, "image"),
967
+ onClick: () => x(f, "image"),
968
968
  className: "p-0.5 rounded hover:bg-accent",
969
969
  title: "Add Image",
970
970
  children: /* @__PURE__ */ e.jsx(_e, { className: "h-3 w-3" })
@@ -973,66 +973,66 @@ function Ge({
973
973
  /* @__PURE__ */ e.jsx(
974
974
  "button",
975
975
  {
976
- onClick: () => c(h, "chart"),
976
+ onClick: () => x(f, "chart"),
977
977
  className: "p-0.5 rounded hover:bg-accent",
978
978
  title: "Add Chart",
979
- children: /* @__PURE__ */ e.jsx(Se, { className: "h-3 w-3" })
979
+ children: /* @__PURE__ */ e.jsx(Ae, { className: "h-3 w-3" })
980
980
  }
981
981
  ),
982
982
  /* @__PURE__ */ e.jsx(
983
983
  "button",
984
984
  {
985
- onClick: () => c(h, "table"),
985
+ onClick: () => x(f, "table"),
986
986
  className: "p-0.5 rounded hover:bg-accent",
987
987
  title: "Add Table",
988
- children: /* @__PURE__ */ e.jsx(Ae, { className: "h-3 w-3" })
988
+ children: /* @__PURE__ */ e.jsx(Pe, { className: "h-3 w-3" })
989
989
  }
990
990
  )
991
991
  ] }),
992
- /* @__PURE__ */ e.jsx("div", { className: "relative", style: { minHeight: m.height, paddingTop: 24 }, children: m.elements.map((f) => /* @__PURE__ */ e.jsxs(
992
+ /* @__PURE__ */ e.jsx("div", { className: "relative", style: { minHeight: j.height, paddingTop: 24 }, children: j.elements.map((p) => /* @__PURE__ */ e.jsxs(
993
993
  "div",
994
994
  {
995
- className: ce(
995
+ className: pe(
996
996
  "absolute border rounded px-2 py-1 text-xs cursor-pointer",
997
- R === f.id ? "border-primary ring-1 ring-primary/30 bg-primary/5" : "border-dashed border-gray-400 hover:border-primary/50"
997
+ R === p.id ? "border-primary ring-1 ring-primary/30 bg-primary/5" : "border-dashed border-gray-400 hover:border-primary/50"
998
998
  ),
999
999
  style: {
1000
- left: f.position.x,
1001
- top: (typeof f.position.y == "number" ? f.position.y : 0) + 24,
1002
- width: f.position.width,
1003
- height: f.position.height
1000
+ left: p.position.x,
1001
+ top: (typeof p.position.y == "number" ? p.position.y : 0) + 24,
1002
+ width: p.position.width,
1003
+ height: p.position.height
1004
1004
  },
1005
- onClick: () => v(f.id),
1005
+ onClick: () => C(p.id),
1006
1006
  children: [
1007
1007
  /* @__PURE__ */ e.jsxs("span", { className: "text-muted-foreground", children: [
1008
- f.type === "text" && (f.properties.text ?? "Text"),
1009
- f.type === "field" && `{${f.properties.field ?? "field"}}`,
1010
- f.type === "image" && "🖼 Image",
1011
- f.type === "chart" && "📊 Chart",
1012
- f.type === "table" && "📋 Table"
1008
+ p.type === "text" && (p.properties.text ?? "Text"),
1009
+ p.type === "field" && `{${p.properties.field ?? "field"}}`,
1010
+ p.type === "image" && "🖼 Image",
1011
+ p.type === "chart" && "📊 Chart",
1012
+ p.type === "table" && "📋 Table"
1013
1013
  ] }),
1014
- !n && R === f.id && /* @__PURE__ */ e.jsx(
1014
+ !m && R === p.id && /* @__PURE__ */ e.jsx(
1015
1015
  "button",
1016
1016
  {
1017
- onClick: (C) => {
1018
- C.stopPropagation(), s(f.id);
1017
+ onClick: (V) => {
1018
+ V.stopPropagation(), o(p.id);
1019
1019
  },
1020
1020
  className: "absolute -top-2 -right-2 p-0.5 rounded-full bg-destructive text-destructive-foreground shadow",
1021
- children: /* @__PURE__ */ e.jsx(L, { className: "h-2.5 w-2.5" })
1021
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-2.5 w-2.5" })
1022
1022
  }
1023
1023
  )
1024
1024
  ]
1025
1025
  },
1026
- f.id
1026
+ p.id
1027
1027
  )) })
1028
1028
  ]
1029
1029
  },
1030
- `${m.type}-${h}`
1030
+ `${j.type}-${f}`
1031
1031
  ))
1032
1032
  }
1033
1033
  ) })
1034
1034
  ] }),
1035
- E && /* @__PURE__ */ e.jsxs("div", { className: "w-56 border-l bg-muted/30 flex flex-col", children: [
1035
+ c && /* @__PURE__ */ e.jsxs("div", { className: "w-56 border-l bg-muted/30 flex flex-col", children: [
1036
1036
  /* @__PURE__ */ e.jsx("div", { className: "p-3 border-b font-medium text-sm", children: "Properties" }),
1037
1037
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-3", children: R ? /* @__PURE__ */ e.jsx("div", { className: "space-y-2 text-xs", children: /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground", children: [
1038
1038
  "Element ID: ",
@@ -1041,47 +1041,47 @@ function Ge({
1041
1041
  ] })
1042
1042
  ] });
1043
1043
  }
1044
- const ue = fe(null);
1045
- ue.displayName = "CollaborationContext";
1046
- function qe({
1047
- config: l,
1048
- user: u,
1049
- onOperation: p,
1050
- children: w
1044
+ const fe = je(null);
1045
+ fe.displayName = "CollaborationContext";
1046
+ function ct({
1047
+ config: i,
1048
+ user: g,
1049
+ onOperation: w,
1050
+ children: T
1051
1051
  }) {
1052
- const i = Z(() => !l.enabled || !u ? [] : [{
1053
- userId: u.id,
1054
- userName: u.name,
1055
- avatar: u.avatar,
1056
- color: Le(u.id),
1052
+ const h = ae(() => !i.enabled || !g ? [] : [{
1053
+ userId: g.id,
1054
+ userName: g.name,
1055
+ avatar: g.avatar,
1056
+ color: rt(g.id),
1057
1057
  status: "active",
1058
1058
  lastActivity: (/* @__PURE__ */ new Date()).toISOString()
1059
- }], [l.enabled, u]), d = l.enabled && !!u, x = P(
1060
- (n) => {
1061
- if (!d || !u) return;
1062
- const _ = {
1063
- ...n,
1059
+ }], [i.enabled, g]), b = i.enabled && !!g, N = D(
1060
+ (m) => {
1061
+ if (!b || !g) return;
1062
+ const l = {
1063
+ ...m,
1064
1064
  id: `op-${Date.now()}`,
1065
- userId: u.id,
1065
+ userId: g.id,
1066
1066
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1067
1067
  version: Date.now()
1068
1068
  };
1069
- p?.(_);
1069
+ w?.(l);
1070
1070
  },
1071
- [d, u, p]
1072
- ), E = Z(
1071
+ [b, g, w]
1072
+ ), c = ae(
1073
1073
  () => ({
1074
- users: i,
1075
- isConnected: d,
1076
- sendOperation: x,
1077
- currentUserId: u?.id
1074
+ users: h,
1075
+ isConnected: b,
1076
+ sendOperation: N,
1077
+ currentUserId: g?.id
1078
1078
  }),
1079
- [i, d, x, u?.id]
1079
+ [h, b, N, g?.id]
1080
1080
  );
1081
- return /* @__PURE__ */ e.jsx(ue.Provider, { value: E, children: w });
1081
+ return /* @__PURE__ */ e.jsx(fe.Provider, { value: c, children: T });
1082
1082
  }
1083
- function Le(l) {
1084
- const u = [
1083
+ function rt(i) {
1084
+ const g = [
1085
1085
  "#3b82f6",
1086
1086
  "#ef4444",
1087
1087
  "#22c55e",
@@ -1091,14 +1091,620 @@ function Le(l) {
1091
1091
  "#06b6d4",
1092
1092
  "#f97316"
1093
1093
  ];
1094
- let p = 0;
1095
- for (let w = 0; w < l.length; w++)
1096
- p = (p << 5) - p + l.charCodeAt(w) | 0;
1097
- return u[Math.abs(p) % u.length];
1094
+ let w = 0;
1095
+ for (let T = 0; T < i.length; T++)
1096
+ w = (w << 5) - w + i.charCodeAt(T) | 0;
1097
+ return g[Math.abs(w) % g.length];
1098
+ }
1099
+ function se(...i) {
1100
+ return Q(K(i));
1101
+ }
1102
+ const he = [
1103
+ { type: "grid", label: "Grid", icon: Ie },
1104
+ { type: "kanban", label: "Kanban", icon: Ve },
1105
+ { type: "gallery", label: "Gallery", icon: Le },
1106
+ { type: "calendar", label: "Calendar", icon: ze },
1107
+ { type: "timeline", label: "Timeline", icon: Ge },
1108
+ { type: "gantt", label: "Gantt", icon: Me },
1109
+ { type: "map", label: "Map", icon: Ye }
1110
+ ], st = [
1111
+ { value: "equals", label: "=" },
1112
+ { value: "contains", label: "Contains" },
1113
+ { value: "startsWith", label: "Starts with" },
1114
+ { value: "gt", label: ">" },
1115
+ { value: "lt", label: "<" },
1116
+ { value: "gte", label: ">=" },
1117
+ { value: "lte", label: "<=" },
1118
+ { value: "ne", label: "!=" }
1119
+ ];
1120
+ function at({
1121
+ objectName: i,
1122
+ viewId: g,
1123
+ viewLabel: w = "",
1124
+ viewType: T = "grid",
1125
+ columns: h = [],
1126
+ filters: b = [],
1127
+ sort: N = [],
1128
+ availableFields: c = [],
1129
+ options: m = {},
1130
+ readOnly: l = !1,
1131
+ onSave: y,
1132
+ onCancel: _,
1133
+ className: E
1134
+ }) {
1135
+ const [R, C] = F(w), [k, u] = F(T), [a, x] = F(h), [o, A] = F(b), [j, f] = F(N), [p, V] = F(m), [$, L] = F(null), [z, U] = F("columns"), W = ae(() => {
1136
+ const t = new Set(a.map((n) => n.field));
1137
+ return c.filter((n) => !t.has(n.name));
1138
+ }, [c, a]), le = D(
1139
+ (t) => {
1140
+ if (l) return;
1141
+ const n = c.find((v) => v.name === t), s = {
1142
+ field: t,
1143
+ label: n?.label ?? t,
1144
+ visible: !0,
1145
+ order: a.length
1146
+ };
1147
+ x((v) => [...v, s]);
1148
+ },
1149
+ [c, a.length, l]
1150
+ ), q = D(
1151
+ (t) => {
1152
+ l || (x((n) => n.filter((s, v) => v !== t)), $ === t && L(null));
1153
+ },
1154
+ [l, $]
1155
+ ), O = D(
1156
+ (t) => {
1157
+ l || x(
1158
+ (n) => n.map((s, v) => v === t ? { ...s, visible: !s.visible } : s)
1159
+ );
1160
+ },
1161
+ [l]
1162
+ ), H = D(
1163
+ (t, n) => {
1164
+ if (l) return;
1165
+ const s = n === "up" ? t - 1 : t + 1;
1166
+ s < 0 || s >= a.length || (x((v) => {
1167
+ const I = [...v], B = I[t];
1168
+ return I[t] = I[s], I[s] = B, I;
1169
+ }), L(s));
1170
+ },
1171
+ [l, a.length]
1172
+ ), ee = D(() => {
1173
+ l || c.length === 0 || A((t) => [
1174
+ ...t,
1175
+ { field: c[0].name, operator: "equals", value: "" }
1176
+ ]);
1177
+ }, [l, c]), te = D(
1178
+ (t) => {
1179
+ l || A((n) => n.filter((s, v) => v !== t));
1180
+ },
1181
+ [l]
1182
+ ), M = D(
1183
+ (t, n) => {
1184
+ l || A(
1185
+ (s) => s.map((v, I) => I === t ? { ...v, ...n } : v)
1186
+ );
1187
+ },
1188
+ [l]
1189
+ ), r = D(() => {
1190
+ l || c.length === 0 || f((t) => [
1191
+ ...t,
1192
+ { field: c[0].name, direction: "asc" }
1193
+ ]);
1194
+ }, [l, c]), d = D(
1195
+ (t) => {
1196
+ l || f((n) => n.filter((s, v) => v !== t));
1197
+ },
1198
+ [l]
1199
+ ), S = D(
1200
+ (t, n) => {
1201
+ l || f(
1202
+ (s) => s.map((v, I) => I === t ? { ...v, ...n } : v)
1203
+ );
1204
+ },
1205
+ [l]
1206
+ ), P = D(() => {
1207
+ y?.({
1208
+ viewId: g,
1209
+ viewLabel: R || `${i} View`,
1210
+ viewType: k,
1211
+ columns: a,
1212
+ filters: o,
1213
+ sort: j,
1214
+ options: p
1215
+ });
1216
+ }, [y, g, R, i, k, a, o, j, p]);
1217
+ return /* @__PURE__ */ e.jsxs("div", { className: se("flex flex-col h-full w-full border rounded-lg overflow-hidden bg-background", E), children: [
1218
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 p-2 border-b bg-muted/20 shrink-0", children: [
1219
+ /* @__PURE__ */ e.jsx(De, { className: "h-4 w-4 text-muted-foreground" }),
1220
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: "View Designer" }),
1221
+ /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
1222
+ "— ",
1223
+ i
1224
+ ] }),
1225
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
1226
+ !l && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1227
+ _ && /* @__PURE__ */ e.jsxs(
1228
+ "button",
1229
+ {
1230
+ onClick: _,
1231
+ className: "flex items-center gap-1 px-3 py-1.5 text-xs rounded border border-border hover:bg-accent",
1232
+ "data-testid": "view-designer-cancel",
1233
+ children: [
1234
+ /* @__PURE__ */ e.jsx(Fe, { className: "h-3 w-3" }),
1235
+ " Cancel"
1236
+ ]
1237
+ }
1238
+ ),
1239
+ /* @__PURE__ */ e.jsxs(
1240
+ "button",
1241
+ {
1242
+ onClick: P,
1243
+ className: "flex items-center gap-1 px-3 py-1.5 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90",
1244
+ "data-testid": "view-designer-save",
1245
+ children: [
1246
+ /* @__PURE__ */ e.jsx($e, { className: "h-3 w-3" }),
1247
+ " Save View"
1248
+ ]
1249
+ }
1250
+ )
1251
+ ] })
1252
+ ] }),
1253
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
1254
+ !l && /* @__PURE__ */ e.jsxs("div", { className: "w-56 border-r bg-muted/30 flex flex-col shrink-0", children: [
1255
+ /* @__PURE__ */ e.jsx("div", { className: "p-3 border-b font-medium text-sm", children: "Available Fields" }),
1256
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: W.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "text-xs text-muted-foreground text-center py-4", children: "All fields added" }) : W.map((t) => /* @__PURE__ */ e.jsxs(
1257
+ "button",
1258
+ {
1259
+ onClick: () => le(t.name),
1260
+ className: "w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded hover:bg-accent text-left",
1261
+ "data-testid": `field-${t.name}`,
1262
+ children: [
1263
+ /* @__PURE__ */ e.jsx(Y, { className: "h-3 w-3 text-muted-foreground" }),
1264
+ /* @__PURE__ */ e.jsx("span", { className: "truncate", children: t.label || t.name }),
1265
+ /* @__PURE__ */ e.jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: t.type })
1266
+ ]
1267
+ },
1268
+ t.name
1269
+ )) })
1270
+ ] }),
1271
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
1272
+ /* @__PURE__ */ e.jsxs("div", { className: "p-3 border-b space-y-3 shrink-0 bg-muted/10", children: [
1273
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1274
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs font-semibold text-foreground", children: "View Type" }),
1275
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 flex-wrap", children: he.map(({ type: t, label: n, icon: s }) => /* @__PURE__ */ e.jsxs(
1276
+ "button",
1277
+ {
1278
+ onClick: () => !l && u(t),
1279
+ className: se(
1280
+ "flex items-center gap-2 px-3 py-2 text-sm rounded-md border-2 transition-all font-medium",
1281
+ k === t ? "border-primary bg-primary text-primary-foreground shadow-sm" : "border-border bg-background hover:border-primary/50 hover:bg-accent"
1282
+ ),
1283
+ "data-testid": `view-type-${t}`,
1284
+ children: [
1285
+ /* @__PURE__ */ e.jsx(s, { className: "h-4 w-4" }),
1286
+ n
1287
+ ]
1288
+ },
1289
+ t
1290
+ )) })
1291
+ ] }),
1292
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1293
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs font-semibold text-foreground", children: "View Name" }),
1294
+ /* @__PURE__ */ e.jsx(
1295
+ "input",
1296
+ {
1297
+ type: "text",
1298
+ value: R,
1299
+ onChange: (t) => !l && C(t.target.value),
1300
+ placeholder: "Enter view name...",
1301
+ className: "px-3 py-2 text-sm border-2 rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary",
1302
+ readOnly: l,
1303
+ "data-testid": "view-label-input"
1304
+ }
1305
+ )
1306
+ ] })
1307
+ ] }),
1308
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-auto p-3", children: a.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center h-full text-sm text-muted-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
1309
+ /* @__PURE__ */ e.jsx(Ue, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
1310
+ /* @__PURE__ */ e.jsx("p", { children: "No columns added yet" }),
1311
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs mt-1", children: "Add fields from the left panel to design your view" })
1312
+ ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
1313
+ /* @__PURE__ */ e.jsxs("div", { className: "text-xs font-medium text-muted-foreground mb-2", children: [
1314
+ "Columns (",
1315
+ a.length,
1316
+ ")"
1317
+ ] }),
1318
+ a.map((t, n) => /* @__PURE__ */ e.jsxs(
1319
+ "div",
1320
+ {
1321
+ className: se(
1322
+ "flex items-center gap-2 px-3 py-2 rounded border transition-colors cursor-pointer",
1323
+ $ === n ? "border-primary bg-primary/5 ring-1 ring-primary/20" : "border-border hover:border-primary/50",
1324
+ !t.visible && "opacity-50"
1325
+ ),
1326
+ onClick: () => L(n),
1327
+ "data-testid": `column-${t.field}`,
1328
+ children: [
1329
+ /* @__PURE__ */ e.jsx(ge, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
1330
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium truncate flex-1", children: t.label || t.field }),
1331
+ /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: t.field }),
1332
+ !l && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [
1333
+ /* @__PURE__ */ e.jsx(
1334
+ "button",
1335
+ {
1336
+ onClick: (s) => {
1337
+ s.stopPropagation(), H(n, "up");
1338
+ },
1339
+ disabled: n === 0,
1340
+ className: "p-0.5 rounded hover:bg-accent disabled:opacity-30",
1341
+ title: "Move up",
1342
+ children: /* @__PURE__ */ e.jsx(We, { className: "h-3 w-3" })
1343
+ }
1344
+ ),
1345
+ /* @__PURE__ */ e.jsx(
1346
+ "button",
1347
+ {
1348
+ onClick: (s) => {
1349
+ s.stopPropagation(), H(n, "down");
1350
+ },
1351
+ disabled: n === a.length - 1,
1352
+ className: "p-0.5 rounded hover:bg-accent disabled:opacity-30",
1353
+ title: "Move down",
1354
+ children: /* @__PURE__ */ e.jsx(qe, { className: "h-3 w-3" })
1355
+ }
1356
+ ),
1357
+ /* @__PURE__ */ e.jsx(
1358
+ "button",
1359
+ {
1360
+ onClick: (s) => {
1361
+ s.stopPropagation(), O(n);
1362
+ },
1363
+ className: "p-0.5 rounded hover:bg-accent",
1364
+ title: t.visible !== !1 ? "Hide column" : "Show column",
1365
+ children: t.visible !== !1 ? /* @__PURE__ */ e.jsx(be, { className: "h-3 w-3" }) : /* @__PURE__ */ e.jsx(He, { className: "h-3 w-3" })
1366
+ }
1367
+ ),
1368
+ /* @__PURE__ */ e.jsx(
1369
+ "button",
1370
+ {
1371
+ onClick: (s) => {
1372
+ s.stopPropagation(), q(n);
1373
+ },
1374
+ className: "p-0.5 rounded hover:bg-destructive/10",
1375
+ title: "Remove column",
1376
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-3 w-3 text-destructive" })
1377
+ }
1378
+ )
1379
+ ] })
1380
+ ]
1381
+ },
1382
+ `${t.field}-${n}`
1383
+ ))
1384
+ ] }) })
1385
+ ] }),
1386
+ /* @__PURE__ */ e.jsxs("div", { className: "w-64 border-l bg-muted/30 flex flex-col shrink-0", children: [
1387
+ /* @__PURE__ */ e.jsx("div", { className: "flex border-b shrink-0", children: ["columns", "filters", "sort", "options"].map((t) => /* @__PURE__ */ e.jsx(
1388
+ "button",
1389
+ {
1390
+ onClick: () => U(t),
1391
+ className: se(
1392
+ "flex-1 px-2 py-2 text-xs font-medium capitalize transition-colors",
1393
+ z === t ? "border-b-2 border-primary text-primary" : "text-muted-foreground hover:text-foreground"
1394
+ ),
1395
+ children: t
1396
+ },
1397
+ t
1398
+ )) }),
1399
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 overflow-y-auto p-3", children: [
1400
+ z === "columns" && /* @__PURE__ */ e.jsx("div", { children: $ !== null && a[$] ? /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
1401
+ /* @__PURE__ */ e.jsx("div", { className: "text-xs font-medium", children: "Column Properties" }),
1402
+ /* @__PURE__ */ e.jsxs("div", { children: [
1403
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Label" }),
1404
+ /* @__PURE__ */ e.jsx(
1405
+ "input",
1406
+ {
1407
+ type: "text",
1408
+ value: a[$].label ?? "",
1409
+ onChange: (t) => {
1410
+ if (l) return;
1411
+ const n = $;
1412
+ x(
1413
+ (s) => s.map((v, I) => I === n ? { ...v, label: t.target.value } : v)
1414
+ );
1415
+ },
1416
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1417
+ readOnly: l,
1418
+ "data-testid": "column-label-input"
1419
+ }
1420
+ )
1421
+ ] }),
1422
+ /* @__PURE__ */ e.jsxs("div", { children: [
1423
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Width" }),
1424
+ /* @__PURE__ */ e.jsx(
1425
+ "input",
1426
+ {
1427
+ type: "text",
1428
+ value: a[$].width ?? "",
1429
+ onChange: (t) => {
1430
+ if (l) return;
1431
+ const n = $, s = t.target.value;
1432
+ x(
1433
+ (v) => v.map(
1434
+ (I, B) => B === n ? { ...I, width: /^\d+$/.test(s) ? Number(s) : s } : I
1435
+ )
1436
+ );
1437
+ },
1438
+ placeholder: "auto",
1439
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1440
+ readOnly: l,
1441
+ "data-testid": "column-width-input"
1442
+ }
1443
+ )
1444
+ ] }),
1445
+ /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-muted-foreground", children: [
1446
+ "Field: ",
1447
+ /* @__PURE__ */ e.jsx("span", { className: "font-mono", children: a[$].field })
1448
+ ] })
1449
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "text-xs text-muted-foreground text-center py-4", children: "Select a column to edit its properties" }) }),
1450
+ z === "filters" && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
1451
+ o.map((t, n) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-1 p-2 border rounded bg-background", "data-testid": `filter-${n}`, children: [
1452
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
1453
+ /* @__PURE__ */ e.jsx(
1454
+ "select",
1455
+ {
1456
+ value: t.field,
1457
+ onChange: (s) => M(n, { field: s.target.value }),
1458
+ className: "flex-1 px-1 py-0.5 text-xs border rounded bg-background",
1459
+ disabled: l,
1460
+ children: c.map((s) => /* @__PURE__ */ e.jsx("option", { value: s.name, children: s.label || s.name }, s.name))
1461
+ }
1462
+ ),
1463
+ !l && /* @__PURE__ */ e.jsx(
1464
+ "button",
1465
+ {
1466
+ onClick: () => te(n),
1467
+ className: "p-0.5 rounded hover:bg-destructive/10",
1468
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-3 w-3 text-destructive" })
1469
+ }
1470
+ )
1471
+ ] }),
1472
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
1473
+ /* @__PURE__ */ e.jsx(
1474
+ "select",
1475
+ {
1476
+ value: t.operator,
1477
+ onChange: (s) => M(n, { operator: s.target.value }),
1478
+ className: "w-24 px-1 py-0.5 text-xs border rounded bg-background",
1479
+ disabled: l,
1480
+ children: st.map((s) => /* @__PURE__ */ e.jsx("option", { value: s.value, children: s.label }, s.value))
1481
+ }
1482
+ ),
1483
+ /* @__PURE__ */ e.jsx(
1484
+ "input",
1485
+ {
1486
+ type: "text",
1487
+ value: t.value ?? "",
1488
+ onChange: (s) => M(n, { value: s.target.value }),
1489
+ placeholder: "Value",
1490
+ className: "flex-1 px-1 py-0.5 text-xs border rounded bg-background",
1491
+ readOnly: l
1492
+ }
1493
+ )
1494
+ ] })
1495
+ ] }, n)),
1496
+ !l && /* @__PURE__ */ e.jsxs(
1497
+ "button",
1498
+ {
1499
+ onClick: ee,
1500
+ className: "w-full flex items-center justify-center gap-1 px-2 py-1.5 text-xs rounded border border-dashed border-border hover:bg-accent",
1501
+ "data-testid": "add-filter",
1502
+ children: [
1503
+ /* @__PURE__ */ e.jsx(Y, { className: "h-3 w-3" }),
1504
+ " Add Filter"
1505
+ ]
1506
+ }
1507
+ )
1508
+ ] }),
1509
+ z === "sort" && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
1510
+ j.map((t, n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 p-2 border rounded bg-background", "data-testid": `sort-${n}`, children: [
1511
+ /* @__PURE__ */ e.jsx(
1512
+ "select",
1513
+ {
1514
+ value: t.field,
1515
+ onChange: (s) => S(n, { field: s.target.value }),
1516
+ className: "flex-1 px-1 py-0.5 text-xs border rounded bg-background",
1517
+ disabled: l,
1518
+ children: c.map((s) => /* @__PURE__ */ e.jsx("option", { value: s.name, children: s.label || s.name }, s.name))
1519
+ }
1520
+ ),
1521
+ /* @__PURE__ */ e.jsxs(
1522
+ "select",
1523
+ {
1524
+ value: t.direction,
1525
+ onChange: (s) => S(n, { direction: s.target.value }),
1526
+ className: "w-16 px-1 py-0.5 text-xs border rounded bg-background",
1527
+ disabled: l,
1528
+ children: [
1529
+ /* @__PURE__ */ e.jsx("option", { value: "asc", children: "Asc" }),
1530
+ /* @__PURE__ */ e.jsx("option", { value: "desc", children: "Desc" })
1531
+ ]
1532
+ }
1533
+ ),
1534
+ !l && /* @__PURE__ */ e.jsx(
1535
+ "button",
1536
+ {
1537
+ onClick: () => d(n),
1538
+ className: "p-0.5 rounded hover:bg-destructive/10",
1539
+ children: /* @__PURE__ */ e.jsx(G, { className: "h-3 w-3 text-destructive" })
1540
+ }
1541
+ )
1542
+ ] }, n)),
1543
+ !l && /* @__PURE__ */ e.jsxs(
1544
+ "button",
1545
+ {
1546
+ onClick: r,
1547
+ className: "w-full flex items-center justify-center gap-1 px-2 py-1.5 text-xs rounded border border-dashed border-border hover:bg-accent",
1548
+ "data-testid": "add-sort",
1549
+ children: [
1550
+ /* @__PURE__ */ e.jsx(Y, { className: "h-3 w-3" }),
1551
+ " Add Sort"
1552
+ ]
1553
+ }
1554
+ )
1555
+ ] }),
1556
+ z === "options" && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
1557
+ /* @__PURE__ */ e.jsxs("div", { className: "text-xs font-medium", children: [
1558
+ he.find((t) => t.type === k)?.label ?? k,
1559
+ " Options"
1560
+ ] }),
1561
+ k === "kanban" && /* @__PURE__ */ e.jsxs("div", { children: [
1562
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Group By Field" }),
1563
+ /* @__PURE__ */ e.jsxs(
1564
+ "select",
1565
+ {
1566
+ value: p.groupBy ?? "",
1567
+ onChange: (t) => !l && V((n) => ({ ...n, groupBy: t.target.value })),
1568
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1569
+ disabled: l,
1570
+ "data-testid": "kanban-group-by",
1571
+ children: [
1572
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1573
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1574
+ ]
1575
+ }
1576
+ )
1577
+ ] }),
1578
+ k === "calendar" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1579
+ /* @__PURE__ */ e.jsxs("div", { children: [
1580
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Start Date Field" }),
1581
+ /* @__PURE__ */ e.jsxs(
1582
+ "select",
1583
+ {
1584
+ value: p.startDateField ?? "",
1585
+ onChange: (t) => !l && V((n) => ({ ...n, startDateField: t.target.value })),
1586
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1587
+ disabled: l,
1588
+ "data-testid": "calendar-start-date",
1589
+ children: [
1590
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1591
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1592
+ ]
1593
+ }
1594
+ )
1595
+ ] }),
1596
+ /* @__PURE__ */ e.jsxs("div", { children: [
1597
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Title Field" }),
1598
+ /* @__PURE__ */ e.jsxs(
1599
+ "select",
1600
+ {
1601
+ value: p.titleField ?? "",
1602
+ onChange: (t) => !l && V((n) => ({ ...n, titleField: t.target.value })),
1603
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1604
+ disabled: l,
1605
+ "data-testid": "calendar-title-field",
1606
+ children: [
1607
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1608
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1609
+ ]
1610
+ }
1611
+ )
1612
+ ] })
1613
+ ] }),
1614
+ k === "map" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1615
+ /* @__PURE__ */ e.jsxs("div", { children: [
1616
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Latitude Field" }),
1617
+ /* @__PURE__ */ e.jsxs(
1618
+ "select",
1619
+ {
1620
+ value: p.latitudeField ?? "",
1621
+ onChange: (t) => !l && V((n) => ({ ...n, latitudeField: t.target.value })),
1622
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1623
+ disabled: l,
1624
+ children: [
1625
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1626
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1627
+ ]
1628
+ }
1629
+ )
1630
+ ] }),
1631
+ /* @__PURE__ */ e.jsxs("div", { children: [
1632
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Longitude Field" }),
1633
+ /* @__PURE__ */ e.jsxs(
1634
+ "select",
1635
+ {
1636
+ value: p.longitudeField ?? "",
1637
+ onChange: (t) => !l && V((n) => ({ ...n, longitudeField: t.target.value })),
1638
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1639
+ disabled: l,
1640
+ children: [
1641
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1642
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1643
+ ]
1644
+ }
1645
+ )
1646
+ ] })
1647
+ ] }),
1648
+ k === "gallery" && /* @__PURE__ */ e.jsxs("div", { children: [
1649
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Image Field" }),
1650
+ /* @__PURE__ */ e.jsxs(
1651
+ "select",
1652
+ {
1653
+ value: p.imageField ?? "",
1654
+ onChange: (t) => !l && V((n) => ({ ...n, imageField: t.target.value })),
1655
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1656
+ disabled: l,
1657
+ children: [
1658
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1659
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1660
+ ]
1661
+ }
1662
+ )
1663
+ ] }),
1664
+ (k === "timeline" || k === "gantt") && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1665
+ /* @__PURE__ */ e.jsxs("div", { children: [
1666
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Date Field" }),
1667
+ /* @__PURE__ */ e.jsxs(
1668
+ "select",
1669
+ {
1670
+ value: p.dateField ?? p.startDateField ?? "",
1671
+ onChange: (t) => !l && V((n) => ({ ...n, dateField: t.target.value, startDateField: t.target.value })),
1672
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1673
+ disabled: l,
1674
+ children: [
1675
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1676
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1677
+ ]
1678
+ }
1679
+ )
1680
+ ] }),
1681
+ /* @__PURE__ */ e.jsxs("div", { children: [
1682
+ /* @__PURE__ */ e.jsx("label", { className: "text-xs text-muted-foreground", children: "Title Field" }),
1683
+ /* @__PURE__ */ e.jsxs(
1684
+ "select",
1685
+ {
1686
+ value: p.titleField ?? "",
1687
+ onChange: (t) => !l && V((n) => ({ ...n, titleField: t.target.value })),
1688
+ className: "w-full px-2 py-1 text-sm border rounded bg-background mt-1",
1689
+ disabled: l,
1690
+ children: [
1691
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select field..." }),
1692
+ c.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.name, children: t.label || t.name }, t.name))
1693
+ ]
1694
+ }
1695
+ )
1696
+ ] })
1697
+ ] }),
1698
+ k === "grid" && /* @__PURE__ */ e.jsx("div", { className: "text-xs text-muted-foreground text-center py-2", children: "Grid view uses the columns configured above." })
1699
+ ] })
1700
+ ] })
1701
+ ] })
1702
+ ] })
1703
+ ] });
1098
1704
  }
1099
- G.register(
1705
+ Z.register(
1100
1706
  "page-designer",
1101
- Oe,
1707
+ Ze,
1102
1708
  {
1103
1709
  label: "Page Designer",
1104
1710
  category: "Designer",
@@ -1111,9 +1717,9 @@ G.register(
1111
1717
  ]
1112
1718
  }
1113
1719
  );
1114
- G.register(
1720
+ Z.register(
1115
1721
  "data-model-designer",
1116
- ze,
1722
+ Qe,
1117
1723
  {
1118
1724
  label: "Data Model Designer",
1119
1725
  category: "Designer",
@@ -1125,9 +1731,9 @@ G.register(
1125
1731
  ]
1126
1732
  }
1127
1733
  );
1128
- G.register(
1734
+ Z.register(
1129
1735
  "process-designer",
1130
- Ie,
1736
+ Oe,
1131
1737
  {
1132
1738
  label: "Process Designer (BPMN)",
1133
1739
  category: "Designer",
@@ -1141,9 +1747,9 @@ G.register(
1141
1747
  ]
1142
1748
  }
1143
1749
  );
1144
- G.register(
1750
+ Z.register(
1145
1751
  "report-designer",
1146
- Ge,
1752
+ tt,
1147
1753
  {
1148
1754
  label: "Report Designer",
1149
1755
  category: "Designer",
@@ -1157,10 +1763,26 @@ G.register(
1157
1763
  ]
1158
1764
  }
1159
1765
  );
1766
+ Z.register(
1767
+ "view-designer",
1768
+ at,
1769
+ {
1770
+ label: "View Designer",
1771
+ category: "Designer",
1772
+ inputs: [
1773
+ { name: "objectName", type: "string", label: "Object Name" },
1774
+ { name: "viewId", type: "string", label: "View ID" },
1775
+ { name: "viewLabel", type: "string", label: "View Label" },
1776
+ { name: "viewType", type: "string", label: "View Type", defaultValue: "grid" },
1777
+ { name: "readOnly", type: "boolean", label: "Read Only", defaultValue: !1 }
1778
+ ]
1779
+ }
1780
+ );
1160
1781
  export {
1161
- qe as CollaborationProvider,
1162
- ze as DataModelDesigner,
1163
- Oe as PageDesigner,
1164
- Ie as ProcessDesigner,
1165
- Ge as ReportDesigner
1782
+ ct as CollaborationProvider,
1783
+ Qe as DataModelDesigner,
1784
+ Ze as PageDesigner,
1785
+ Oe as ProcessDesigner,
1786
+ tt as ReportDesigner,
1787
+ at as ViewDesigner
1166
1788
  };