@floegence/floe-webapp-core 0.35.58 → 0.36.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.
Files changed (55) hide show
  1. package/dist/components/deck/DeckCell.js +47 -50
  2. package/dist/components/deck/DeckContextMenu.d.ts +22 -0
  3. package/dist/components/deck/DeckContextMenu.js +73 -0
  4. package/dist/components/deck/DeckGrid.js +147 -104
  5. package/dist/components/deck/DeckTopBar.js +74 -96
  6. package/dist/components/deck/WidgetFrame.d.ts +7 -1
  7. package/dist/components/deck/WidgetFrame.js +60 -52
  8. package/dist/components/deck/index.d.ts +1 -0
  9. package/dist/components/ui/InfiniteCanvas.d.ts +2 -0
  10. package/dist/components/ui/InfiniteCanvas.js +43 -37
  11. package/dist/components/workbench/WorkbenchCanvas.d.ts +28 -0
  12. package/dist/components/workbench/WorkbenchCanvas.js +79 -0
  13. package/dist/components/workbench/WorkbenchContextMenu.d.ts +24 -0
  14. package/dist/components/workbench/WorkbenchContextMenu.js +44 -0
  15. package/dist/components/workbench/WorkbenchFilterBar.d.ts +16 -0
  16. package/dist/components/workbench/WorkbenchFilterBar.js +266 -0
  17. package/dist/components/workbench/WorkbenchHud.d.ts +6 -0
  18. package/dist/components/workbench/WorkbenchHud.js +17 -0
  19. package/dist/components/workbench/WorkbenchLockButton.d.ts +6 -0
  20. package/dist/components/workbench/WorkbenchLockButton.js +49 -0
  21. package/dist/components/workbench/WorkbenchOverlay.d.ts +18 -0
  22. package/dist/components/workbench/WorkbenchOverlay.js +107 -0
  23. package/dist/components/workbench/WorkbenchSurface.d.ts +21 -0
  24. package/dist/components/workbench/WorkbenchSurface.js +183 -0
  25. package/dist/components/workbench/WorkbenchWidget.d.ts +25 -0
  26. package/dist/components/workbench/WorkbenchWidget.js +183 -0
  27. package/dist/components/workbench/index.d.ts +7 -0
  28. package/dist/components/workbench/types.d.ts +39 -0
  29. package/dist/components/workbench/types.js +25 -0
  30. package/dist/components/workbench/useWorkbenchModel.d.ts +70 -0
  31. package/dist/components/workbench/useWorkbenchModel.js +259 -0
  32. package/dist/components/workbench/widgets/CodeEditorWidget.d.ts +1 -0
  33. package/dist/components/workbench/widgets/CodeEditorWidget.js +144 -0
  34. package/dist/components/workbench/widgets/FileBrowserWidget.d.ts +1 -0
  35. package/dist/components/workbench/widgets/FileBrowserWidget.js +142 -0
  36. package/dist/components/workbench/widgets/LogViewerWidget.d.ts +1 -0
  37. package/dist/components/workbench/widgets/LogViewerWidget.js +86 -0
  38. package/dist/components/workbench/widgets/SystemMonitorWidget.d.ts +1 -0
  39. package/dist/components/workbench/widgets/SystemMonitorWidget.js +122 -0
  40. package/dist/components/workbench/widgets/TerminalWidget.d.ts +1 -0
  41. package/dist/components/workbench/widgets/TerminalWidget.js +70 -0
  42. package/dist/components/workbench/widgets/widgetRegistry.d.ts +13 -0
  43. package/dist/components/workbench/widgets/widgetRegistry.js +50 -0
  44. package/dist/components/workbench/workbenchHelpers.d.ts +22 -0
  45. package/dist/components/workbench/workbenchHelpers.js +176 -0
  46. package/dist/deck.js +14 -12
  47. package/dist/full.js +381 -379
  48. package/dist/hooks/useDeckDrag.js +15 -15
  49. package/dist/styles.css +1 -1
  50. package/dist/tailwind.css +1 -0
  51. package/dist/ui.css +4 -0
  52. package/dist/workbench.css +1220 -0
  53. package/dist/workbench.d.ts +1 -0
  54. package/dist/workbench.js +22 -0
  55. package/package.json +5 -1
@@ -1,33 +1,33 @@
1
- import { insert as o, createComponent as g, Dynamic as C, effect as m, className as w, style as z, setAttribute as R, template as y } from "solid-js/web";
2
- import { createMemo as a, Show as k } from "solid-js";
3
- import { cn as v } from "../../utils/cn.js";
4
- import { useDeck as $ } from "../../context/DeckContext.js";
5
- import { useWidgetRegistry as M } from "../../context/WidgetRegistry.js";
6
- import { WidgetStateProvider as A } from "../../context/WidgetStateContext.js";
7
- import { positionToGridArea as _ } from "../../utils/gridLayout.js";
8
- import { WidgetFrame as I } from "./WidgetFrame.js";
9
- var h = /* @__PURE__ */ y("<div>"), O = /* @__PURE__ */ y('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
10
- function H(e) {
11
- const i = $(), d = M(), n = () => i.editMode(), s = () => e.widget.type, c = a(() => d.getWidget(s())), D = a(() => _(e.position)), x = () => i.getWidgetState(e.widget.id), b = (r, t) => {
12
- i.updateWidgetState(e.widget.id, r, t);
13
- }, l = () => c()?.component, W = a(() => {
1
+ import { insert as u, createComponent as n, Dynamic as D, effect as x, className as W, style as S, template as l } from "solid-js/web";
2
+ import { createMemo as d, Show as b } from "solid-js";
3
+ import { cn as C } from "../../utils/cn.js";
4
+ import { useDeck as z } from "../../context/DeckContext.js";
5
+ import { useWidgetRegistry as R } from "../../context/WidgetRegistry.js";
6
+ import { WidgetStateProvider as k } from "../../context/WidgetStateContext.js";
7
+ import { positionToGridArea as $ } from "../../utils/gridLayout.js";
8
+ import { WidgetFrame as M } from "./WidgetFrame.js";
9
+ var _ = /* @__PURE__ */ l("<div>"), A = /* @__PURE__ */ l('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
10
+ function q(e) {
11
+ const i = z(), g = R(), m = () => i.editMode(), o = () => e.widget.type, a = d(() => g.getWidget(o())), f = d(() => $(e.position)), w = () => i.getWidgetState(e.widget.id), h = (t, r) => {
12
+ i.updateWidgetState(e.widget.id, t, r);
13
+ }, s = () => a()?.component, v = d(() => {
14
14
  if (!e.isDragging || !e.pixelOffset) return {};
15
15
  const {
16
- x: r,
17
- y: t
16
+ x: t,
17
+ y: r
18
18
  } = e.pixelOffset;
19
- return r === 0 && t === 0 ? {} : {
20
- transform: `translate(${r}px, ${t}px)`
19
+ return t === 0 && r === 0 ? {} : {
20
+ transform: `translate(${t}px, ${r}px)`
21
21
  };
22
22
  });
23
23
  return (() => {
24
- var r = h();
25
- return o(r, g(I, {
24
+ var t = _();
25
+ return u(t, n(M, {
26
26
  get widget() {
27
27
  return e.widget;
28
28
  },
29
29
  get widgetDef() {
30
- return c();
30
+ return a();
31
31
  },
32
32
  get isDragging() {
33
33
  return e.isDragging;
@@ -36,29 +36,28 @@ function H(e) {
36
36
  return e.isResizing;
37
37
  },
38
38
  get children() {
39
- var t = h();
40
- return o(t, g(k, {
39
+ return n(b, {
41
40
  get when() {
42
- return l();
41
+ return s();
43
42
  },
44
43
  get fallback() {
45
- return g(P, {
44
+ return n(I, {
46
45
  get type() {
47
- return s();
46
+ return o();
48
47
  }
49
48
  });
50
49
  },
51
50
  get children() {
52
- return g(A, {
51
+ return n(k, {
53
52
  get widgetId() {
54
53
  return e.widget.id;
55
54
  },
56
- state: x,
57
- onStateChange: b,
55
+ state: w,
56
+ onStateChange: h,
58
57
  get children() {
59
- return g(C, {
58
+ return n(D, {
60
59
  get component() {
61
- return l();
60
+ return s();
62
61
  },
63
62
  get widgetId() {
64
63
  return e.widget.id;
@@ -67,44 +66,42 @@ function H(e) {
67
66
  return e.widget.config;
68
67
  },
69
68
  get isEditMode() {
70
- return n();
69
+ return m();
71
70
  }
72
71
  });
73
72
  }
74
73
  });
75
74
  }
76
- })), m(() => w(t, v("h-full", n() && "pointer-events-none"))), t;
75
+ });
77
76
  }
78
- })), m((t) => {
79
- var u = v(
80
- "deck-cell relative rounded-md overflow-hidden",
77
+ })), x((r) => {
78
+ var c = C(
79
+ "deck-cell relative rounded-md overflow-hidden group",
81
80
  "bg-card border border-border",
82
81
  // Smooth transition when not dragging (for snap-back animation)
83
82
  !e.isDragging && "transition-transform duration-200 ease-out",
84
83
  e.isDragging && "shadow-xl z-50 ring-2 ring-primary scale-[1.02]",
85
84
  e.isResizing && "shadow-lg z-50 ring-2 ring-primary",
86
- n() && !e.isDragging && !e.isResizing && "hover:ring-1 hover:ring-primary/50",
87
- // Edit mode: disable selection and show grab cursor
88
- n() && "select-none cursor-grab",
85
+ !e.isDragging && !e.isResizing && "hover:ring-1 hover:ring-primary/50",
86
+ "select-none",
89
87
  e.isDragging && "cursor-grabbing"
90
- ), S = {
91
- "grid-area": D(),
92
- ...W()
93
- }, f = n() ? e.widget.id : void 0;
94
- return u !== t.e && w(r, t.e = u), t.t = z(r, S, t.t), f !== t.a && R(r, "data-widget-drag-handle", t.a = f), t;
88
+ ), y = {
89
+ "grid-area": f(),
90
+ ...v()
91
+ };
92
+ return c !== r.e && W(t, r.e = c), r.t = S(t, y, r.t), r;
95
93
  }, {
96
94
  e: void 0,
97
- t: void 0,
98
- a: void 0
99
- }), r;
95
+ t: void 0
96
+ }), t;
100
97
  })();
101
98
  }
102
- function P(e) {
99
+ function I(e) {
103
100
  return (() => {
104
- var i = O(), d = i.firstChild;
105
- return d.firstChild, o(d, () => e.type, null), i;
101
+ var i = A(), g = i.firstChild;
102
+ return g.firstChild, u(g, () => e.type, null), i;
106
103
  })();
107
104
  }
108
105
  export {
109
- H as DeckCell
106
+ q as DeckCell
110
107
  };
@@ -0,0 +1,22 @@
1
+ import { type Component } from 'solid-js';
2
+ export interface DeckContextMenuItem {
3
+ type: string;
4
+ name: string;
5
+ icon?: Component<{
6
+ class?: string;
7
+ }>;
8
+ }
9
+ export interface DeckContextMenuProps {
10
+ open: boolean;
11
+ x: number;
12
+ y: number;
13
+ items: readonly DeckContextMenuItem[];
14
+ onSelect: (type: string) => void;
15
+ onDismiss: () => void;
16
+ }
17
+ /**
18
+ * Right-click context menu for the Deck grid.
19
+ * Shows when the user right-clicks empty grid space, offering to create
20
+ * a widget of any registered type at the clicked cell.
21
+ */
22
+ export declare function DeckContextMenu(props: DeckContextMenuProps): import("solid-js").JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { createComponent as l, Portal as f, insert as a, effect as g, className as h, setStyleProperty as u, template as i, delegateEvents as v } from "solid-js/web";
2
+ import { Show as c, For as p } from "solid-js";
3
+ import { cn as $ } from "../../utils/cn.js";
4
+ import { Plus as w } from "../icons/index.js";
5
+ var b = /* @__PURE__ */ i('<div class="fixed inset-0 z-[9998]">'), k = /* @__PURE__ */ i('<div role=menu><div class="px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80 flex items-center gap-1.5">Add widget here'), y = /* @__PURE__ */ i('<div class="px-3 py-3 text-xs text-muted-foreground text-center">No widgets registered'), _ = /* @__PURE__ */ i('<button type=button role=menuitem class="w-full flex items-center gap-2 px-2.5 py-1.5 rounded hover:bg-muted transition-colors text-left cursor-pointer"><span class="text-xs text-foreground">'), C = /* @__PURE__ */ i('<div class="w-4 h-4 flex-shrink-0">');
6
+ function N(r) {
7
+ return l(c, {
8
+ get when() {
9
+ return r.open;
10
+ },
11
+ get children() {
12
+ return l(f, {
13
+ get children() {
14
+ return [(() => {
15
+ var t = b();
16
+ return t.$$contextmenu = (d) => {
17
+ d.preventDefault(), r.onDismiss();
18
+ }, t.$$click = () => r.onDismiss(), t;
19
+ })(), (() => {
20
+ var t = k(), d = t.firstChild, m = d.firstChild;
21
+ return a(d, l(w, {
22
+ class: "w-2.5 h-2.5"
23
+ }), m), a(t, l(c, {
24
+ get when() {
25
+ return r.items.length > 0;
26
+ },
27
+ get fallback() {
28
+ return y();
29
+ },
30
+ get children() {
31
+ return l(p, {
32
+ get each() {
33
+ return r.items;
34
+ },
35
+ children: (e) => (() => {
36
+ var n = _(), o = n.firstChild;
37
+ return n.$$click = () => {
38
+ r.onSelect(e.type);
39
+ }, a(n, l(c, {
40
+ get when() {
41
+ return e.icon;
42
+ },
43
+ get fallback() {
44
+ return C();
45
+ },
46
+ children: (s) => {
47
+ const x = s();
48
+ return l(x, {
49
+ class: "w-4 h-4 text-muted-foreground flex-shrink-0"
50
+ });
51
+ }
52
+ }), o), a(o, () => e.name), n;
53
+ })()
54
+ });
55
+ }
56
+ }), null), g((e) => {
57
+ var n = $("fixed z-[9999] min-w-[180px] max-h-[320px] overflow-y-auto", "bg-popover border border-border rounded-md shadow-xl", "animate-in fade-in slide-in-from-top-1 duration-150", "p-1"), o = `${r.y}px`, s = `${r.x}px`;
58
+ return n !== e.e && h(t, e.e = n), o !== e.t && u(t, "top", e.t = o), s !== e.a && u(t, "left", e.a = s), e;
59
+ }, {
60
+ e: void 0,
61
+ t: void 0,
62
+ a: void 0
63
+ }), t;
64
+ })()];
65
+ }
66
+ });
67
+ }
68
+ });
69
+ }
70
+ v(["click", "contextmenu"]);
71
+ export {
72
+ N as DeckContextMenu
73
+ };
@@ -1,75 +1,102 @@
1
- import { insert as w, createComponent as m, effect as z, setStyleProperty as v, className as L, setAttribute as _, template as C, use as A } from "solid-js/web";
2
- import { createSignal as N, createEffect as T, createMemo as s, onMount as j, Show as D, For as V, onCleanup as W } from "solid-js";
3
- import { cn as Z } from "../../utils/cn.js";
4
- import { useDeck as $ } from "../../context/DeckContext.js";
5
- import { useLayout as K } from "../../context/LayoutContext.js";
6
- import { hasCollision as U } from "../../utils/gridCollision.js";
7
- import { DeckCell as q } from "./DeckCell.js";
8
- import { DropZonePreview as B } from "./DropZonePreview.js";
9
- var J = /* @__PURE__ */ C('<div class="pointer-events-none z-0"style="grid-column:1 / -1;--deck-grid-unit-x:calc((100% - 92px) / 24 + 4px);background-position:0 0, 0 0, 0 0, 0 0, 0 0, 0 0">'), Q = /* @__PURE__ */ C('<div data-grid-cols=24 data-gap=4 data-default-rows=24 style="scrollbar-gutter:stable;grid-template-columns:repeat(24, 1fr);gap:4px"><div class=pointer-events-none aria-hidden=true style="grid-column:1 / -1">');
10
- const O = 24, a = 24, x = 4, b = 20, P = 4, X = {
1
+ import { insert as h, createComponent as m, effect as F, setStyleProperty as v, className as J, setAttribute as Q, template as W, use as tt, delegateEvents as et } from "solid-js/web";
2
+ import { createSignal as O, createMemo as d, onMount as rt, Show as G, For as nt, onCleanup as ot } from "solid-js";
3
+ import { cn as it } from "../../utils/cn.js";
4
+ import { useDeck as at } from "../../context/DeckContext.js";
5
+ import { useLayout as st } from "../../context/LayoutContext.js";
6
+ import { useResolvedFloeConfig as ct } from "../../context/FloeConfigContext.js";
7
+ import { useWidgetRegistry as lt } from "../../context/WidgetRegistry.js";
8
+ import { hasCollision as dt } from "../../utils/gridCollision.js";
9
+ import { DeckCell as ut } from "./DeckCell.js";
10
+ import { DeckContextMenu as gt } from "./DeckContextMenu.js";
11
+ import { DropZonePreview as pt } from "./DropZonePreview.js";
12
+ var ft = /* @__PURE__ */ W('<div class="pointer-events-none z-0"style="grid-column:1 / -1;--deck-grid-unit-x:calc((100% - 92px) / 24 + 4px);background-position:0 0, 0 0, 0 0, 0 0, 0 0, 0 0">'), mt = /* @__PURE__ */ W('<div data-grid-cols=24 data-gap=4 data-default-rows=24 style="scrollbar-gutter:stable;grid-template-columns:repeat(24, 1fr);gap:4px"><div class=pointer-events-none aria-hidden=true style="grid-column:1 / -1">');
13
+ const T = 24, u = 24, x = 4, k = 20, L = 4, vt = {
11
14
  x: 0,
12
15
  y: 0
13
16
  };
14
- function st(d) {
15
- const c = $(), M = K();
16
- let p;
17
- const [y, I] = N(0), H = () => c.activeLayout()?.widgets ?? [], f = () => c.dragState(), k = () => c.resizeState();
18
- T(() => {
19
- M.isMobile() && c.editMode() && c.setEditMode(!1);
20
- });
21
- const G = s(() => {
22
- const r = f();
23
- if (!r) return !0;
24
- const e = c.activeLayout();
25
- return e ? !U(r.currentPosition, e.widgets, r.widgetId) : !0;
26
- }), F = s(() => {
27
- const r = H();
28
- if (r.length === 0) return a;
29
- let e = a;
30
- for (const i of r) {
31
- const t = i.position.row + i.position.rowSpan;
32
- t > e && (e = t);
17
+ function Dt(g) {
18
+ const p = at(), I = st(), A = lt(), N = ct();
19
+ let a;
20
+ const [S, D] = O(0), [w, R] = O(null), P = () => p.activeLayout()?.widgets ?? [], f = () => p.dragState(), M = () => p.resizeState(), z = () => !I.isMobile(), _ = () => (N.config.deck.presetsMode ?? "mutable") === "immutable" && !!p.activeLayout()?.isPreset, E = d(() => Array.from(A.widgets().values()).map((t) => ({
21
+ type: t.type,
22
+ name: t.name,
23
+ icon: t.icon
24
+ }))), $ = (t) => {
25
+ if (I.isMobile() || _() || t.target?.closest(".deck-cell") || !a) return;
26
+ t.preventDefault();
27
+ const n = a.getBoundingClientRect(), {
28
+ cols: e,
29
+ rowHeight: o,
30
+ gap: s
31
+ } = ht(a), c = window.getComputedStyle(a), l = parseFloat(c.paddingLeft) || 0, i = parseFloat(c.paddingTop) || 0, H = (a.clientWidth - l - (parseFloat(c.paddingRight) || 0) - s * (e - 1)) / e, V = o + s;
32
+ if (!Number.isFinite(H) || H <= 0) return;
33
+ const Z = t.clientX - n.left + a.scrollLeft - l, K = t.clientY - n.top + a.scrollTop - i, U = Math.max(0, Math.min(e - 1, Math.floor(Z / (H + s)))), q = Math.max(0, Math.floor(K / V));
34
+ R({
35
+ x: t.clientX,
36
+ y: t.clientY,
37
+ col: U,
38
+ row: q
39
+ });
40
+ }, B = (t) => {
41
+ const r = w();
42
+ R(null), r && p.addWidget(t, {
43
+ col: r.col,
44
+ row: r.row
45
+ });
46
+ }, X = d(() => {
47
+ const t = f();
48
+ if (!t) return !0;
49
+ const r = p.activeLayout();
50
+ return r ? !dt(t.currentPosition, r.widgets, t.widgetId) : !0;
51
+ }), Y = d(() => {
52
+ const t = P();
53
+ if (t.length === 0) return u;
54
+ let r = u;
55
+ for (const n of t) {
56
+ const e = n.position.row + n.position.rowSpan;
57
+ e > r && (r = e);
33
58
  }
34
- return e;
35
- }), S = s(() => {
36
- let r = F();
37
- const e = f();
38
- if (e) {
39
- const t = e.currentPosition.row + e.currentPosition.rowSpan;
40
- t > r && (r = t);
59
+ return r;
60
+ }), C = d(() => {
61
+ let t = Y();
62
+ const r = f();
63
+ if (r) {
64
+ const e = r.currentPosition.row + r.currentPosition.rowSpan;
65
+ e > t && (t = e);
41
66
  }
42
- const i = k();
43
- if (i) {
44
- const t = i.currentPosition.row + i.currentPosition.rowSpan;
45
- t > r && (r = t);
67
+ const n = M();
68
+ if (n) {
69
+ const e = n.currentPosition.row + n.currentPosition.rowSpan;
70
+ e > t && (t = e);
46
71
  }
47
- return Math.max(a, r);
48
- }), h = s(() => {
49
- const r = y();
50
- if (r <= 0) return b;
51
- const i = (r - P * 2 - (a - 1) * x) / a;
52
- return Math.max(b, i);
72
+ return Math.max(u, t);
73
+ }), b = d(() => {
74
+ const t = S();
75
+ if (t <= 0) return k;
76
+ const n = (t - L * 2 - (u - 1) * x) / u;
77
+ return Math.max(k, n);
53
78
  });
54
- j(() => {
55
- if (!p || typeof ResizeObserver > "u") return;
56
- const r = new ResizeObserver((e) => {
57
- for (const i of e)
58
- I(i.contentRect.height);
79
+ rt(() => {
80
+ if (!a || typeof ResizeObserver > "u") return;
81
+ const t = new ResizeObserver((r) => {
82
+ for (const n of r)
83
+ D(n.contentRect.height);
59
84
  });
60
- r.observe(p), I(p.clientHeight), W(() => r.disconnect());
85
+ t.observe(a), D(a.clientHeight), ot(() => t.disconnect());
61
86
  });
62
- const E = s(() => S() > a ? !0 : y() <= 0 ? !1 : a * h() + (a - 1) * x + P * 2 > y() + 1);
87
+ const j = d(() => C() > u ? !0 : S() <= 0 ? !1 : u * b() + (u - 1) * x + L * 2 > S() + 1);
63
88
  return (() => {
64
- var r = Q(), e = r.firstChild, i = p;
65
- return typeof i == "function" ? A(i, r) : p = r, w(r, m(D, {
89
+ var t = mt(), r = t.firstChild;
90
+ t.$$contextmenu = $;
91
+ var n = a;
92
+ return typeof n == "function" ? tt(n, t) : a = t, h(t, m(G, {
66
93
  get when() {
67
- return c.editMode();
94
+ return z();
68
95
  },
69
96
  get children() {
70
- var t = J();
71
- return z((n) => {
72
- var l = `1 / ${S() + 1}`, g = `${h() + x}px`, u = [
97
+ var e = ft();
98
+ return F((o) => {
99
+ var s = `1 / ${C() + 1}`, c = `${b() + x}px`, l = [
73
100
  // Fine
74
101
  "linear-gradient(to right, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px)",
75
102
  "linear-gradient(to bottom, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px)",
@@ -79,7 +106,7 @@ function st(d) {
79
106
  // Major (12)
80
107
  "linear-gradient(to right, color-mix(in srgb, var(--border) 75%, transparent) 2px, transparent 2px)",
81
108
  "linear-gradient(to bottom, color-mix(in srgb, var(--border) 75%, transparent) 2px, transparent 2px)"
82
- ].join(", "), o = [
109
+ ].join(", "), i = [
83
110
  // Fine
84
111
  "var(--deck-grid-unit-x) var(--deck-grid-unit-y)",
85
112
  "var(--deck-grid-unit-x) var(--deck-grid-unit-y)",
@@ -90,92 +117,108 @@ function st(d) {
90
117
  "calc(var(--deck-grid-unit-x) * 12) calc(var(--deck-grid-unit-y) * 12)",
91
118
  "calc(var(--deck-grid-unit-x) * 12) calc(var(--deck-grid-unit-y) * 12)"
92
119
  ].join(", ");
93
- return l !== n.e && v(t, "grid-row", n.e = l), g !== n.t && v(t, "--deck-grid-unit-y", n.t = g), u !== n.a && v(t, "background-image", n.a = u), o !== n.o && v(t, "background-size", n.o = o), n;
120
+ return s !== o.e && v(e, "grid-row", o.e = s), c !== o.t && v(e, "--deck-grid-unit-y", o.t = c), l !== o.a && v(e, "background-image", o.a = l), i !== o.o && v(e, "background-size", o.o = i), o;
94
121
  }, {
95
122
  e: void 0,
96
123
  t: void 0,
97
124
  a: void 0,
98
125
  o: void 0
99
- }), t;
126
+ }), e;
100
127
  }
101
- }), null), w(r, m(D, {
128
+ }), null), h(t, m(G, {
102
129
  get when() {
103
130
  return f();
104
131
  },
105
- children: (t) => m(B, {
132
+ children: (e) => m(pt, {
106
133
  get position() {
107
- return t().currentPosition;
134
+ return e().currentPosition;
108
135
  },
109
136
  get isValid() {
110
- return G();
137
+ return X();
111
138
  }
112
139
  })
113
- }), null), w(r, m(V, {
140
+ }), null), h(t, m(nt, {
114
141
  get each() {
115
- return H();
142
+ return P();
116
143
  },
117
- children: (t) => {
118
- const n = s(() => {
119
- const o = f();
120
- if (o && o.widgetId === t.id)
121
- return t.position;
122
- const R = k();
123
- return R && R.widgetId === t.id ? R.currentPosition : t.position;
124
- }), l = s(() => f()?.widgetId === t.id), g = s(() => k()?.widgetId === t.id), u = s(() => {
125
- const o = f();
126
- return o && o.widgetId === t.id ? o.pixelOffset : X;
144
+ children: (e) => {
145
+ const o = d(() => {
146
+ const i = f();
147
+ if (i && i.widgetId === e.id)
148
+ return e.position;
149
+ const y = M();
150
+ return y && y.widgetId === e.id ? y.currentPosition : e.position;
151
+ }), s = d(() => f()?.widgetId === e.id), c = d(() => M()?.widgetId === e.id), l = d(() => {
152
+ const i = f();
153
+ return i && i.widgetId === e.id ? i.pixelOffset : vt;
127
154
  });
128
- return m(q, {
129
- widget: t,
155
+ return m(ut, {
156
+ widget: e,
130
157
  get position() {
131
- return n();
158
+ return o();
132
159
  },
133
160
  get isDragging() {
134
- return l();
161
+ return s();
135
162
  },
136
163
  get isResizing() {
137
- return g();
164
+ return c();
138
165
  },
139
166
  get pixelOffset() {
140
- return u();
167
+ return l();
141
168
  }
142
169
  });
143
170
  }
144
- }), null), w(r, () => d.children, null), z((t) => {
145
- var n = Z(
171
+ }), null), h(t, () => g.children, null), h(t, m(gt, {
172
+ get open() {
173
+ return w() !== null;
174
+ },
175
+ get x() {
176
+ return w()?.x ?? 0;
177
+ },
178
+ get y() {
179
+ return w()?.y ?? 0;
180
+ },
181
+ get items() {
182
+ return E();
183
+ },
184
+ onSelect: B,
185
+ onDismiss: () => R(null)
186
+ }), null), F((e) => {
187
+ var o = it(
146
188
  "deck-grid relative w-full h-full overflow-x-hidden",
147
189
  // Only enable vertical scroll when content exceeds 24 rows
148
- E() ? "overflow-y-scroll" : "overflow-y-hidden",
190
+ j() ? "overflow-y-scroll" : "overflow-y-hidden",
149
191
  "grid p-1",
150
- c.editMode() && "bg-muted/20",
151
- d.class
152
- ), l = `${h()}px`, g = h(), u = `1 / ${S() + 1}`;
153
- return n !== t.e && L(r, t.e = n), l !== t.t && v(r, "grid-auto-rows", t.t = l), g !== t.a && _(r, "data-row-height", t.a = g), u !== t.o && v(e, "grid-row", t.o = u), t;
192
+ z() && "bg-muted/20",
193
+ g.class
194
+ ), s = `${b()}px`, c = b(), l = `1 / ${C() + 1}`;
195
+ return o !== e.e && J(t, e.e = o), s !== e.t && v(t, "grid-auto-rows", e.t = s), c !== e.a && Q(t, "data-row-height", e.a = c), l !== e.o && v(r, "grid-row", e.o = l), e;
154
196
  }, {
155
197
  e: void 0,
156
198
  t: void 0,
157
199
  a: void 0,
158
200
  o: void 0
159
- }), r;
201
+ }), t;
160
202
  })();
161
203
  }
162
- const ct = {
163
- cols: O,
164
- defaultRows: a,
204
+ const Pt = {
205
+ cols: T,
206
+ defaultRows: u,
165
207
  gap: x,
166
208
  // Deprecated: use getGridConfig() or read from data-row-height attribute instead
167
- rowHeight: b
209
+ rowHeight: k
168
210
  };
169
- function dt(d) {
211
+ function ht(g) {
170
212
  return {
171
- cols: parseInt(d.dataset.gridCols || String(O), 10),
172
- rowHeight: parseFloat(d.dataset.rowHeight || String(b)),
173
- gap: parseInt(d.dataset.gap || String(x), 10),
174
- defaultRows: parseInt(d.dataset.defaultRows || String(a), 10)
213
+ cols: parseInt(g.dataset.gridCols || String(T), 10),
214
+ rowHeight: parseFloat(g.dataset.rowHeight || String(k)),
215
+ gap: parseInt(g.dataset.gap || String(x), 10),
216
+ defaultRows: parseInt(g.dataset.defaultRows || String(u), 10)
175
217
  };
176
218
  }
219
+ et(["contextmenu"]);
177
220
  export {
178
- ct as DECK_GRID_CONFIG,
179
- st as DeckGrid,
180
- dt as getGridConfigFromElement
221
+ Pt as DECK_GRID_CONFIG,
222
+ Dt as DeckGrid,
223
+ ht as getGridConfigFromElement
181
224
  };