@floegence/floe-webapp-core 0.36.8 → 0.36.10

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.
@@ -1,3 +1,4 @@
1
+ import { type JSX } from 'solid-js';
1
2
  import { type DeckWidget } from '../../context/DeckContext';
2
3
  import type { GridPosition } from '../../utils/gridCollision';
3
4
  export interface DeckCellProps {
@@ -5,13 +6,9 @@ export interface DeckCellProps {
5
6
  position: GridPosition;
6
7
  isDragging?: boolean;
7
8
  isResizing?: boolean;
8
- /** Pixel offset for smooth drag following */
9
- pixelOffset?: {
10
- x: number;
11
- y: number;
12
- };
9
+ dragOverlayStyle?: JSX.CSSProperties;
13
10
  }
14
11
  /**
15
12
  * Widget cell wrapper positioned via CSS grid-area
16
13
  */
17
- export declare function DeckCell(props: DeckCellProps): import("solid-js").JSX.Element;
14
+ export declare function DeckCell(props: DeckCellProps): JSX.Element;
@@ -1,28 +1,19 @@
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";
1
+ import { insert as s, createComponent as g, Dynamic as D, effect as W, setAttribute as b, className as S, style as k, template as m } from "solid-js/web";
2
+ import { createMemo as l, Show as C } from "solid-js";
3
+ import { cn as x } from "../../utils/cn.js";
4
4
  import { useDeck as z } from "../../context/DeckContext.js";
5
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 data-floe-dialog-surface-host=true>"), 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(), f = () => i.editMode(), o = () => e.widget.type, a = d(() => g.getWidget(o())), m = 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
- if (!e.isDragging || !e.pixelOffset) return {};
15
- const {
16
- x: t,
17
- y: r
18
- } = e.pixelOffset;
19
- return t === 0 && r === 0 ? {} : {
20
- transform: `translate(${t}px, ${r}px)`
21
- };
22
- });
6
+ import { WidgetStateProvider as M } from "../../context/WidgetStateContext.js";
7
+ import { positionToGridArea as A } from "../../utils/gridLayout.js";
8
+ import { WidgetFrame as I } from "./WidgetFrame.js";
9
+ var P = /* @__PURE__ */ m("<div data-floe-dialog-surface-host=true data-floe-geometry-surface=deck-widget>"), T = /* @__PURE__ */ m('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
10
+ function B(e) {
11
+ const r = z(), n = R(), f = () => r.editMode(), d = () => e.widget.type, a = l(() => n.getWidget(d())), w = l(() => A(e.position)), h = () => r.getWidgetState(e.widget.id), v = (i, t) => {
12
+ r.updateWidgetState(e.widget.id, i, t);
13
+ }, o = () => a()?.component;
23
14
  return (() => {
24
- var t = _();
25
- return u(t, n(M, {
15
+ var i = P();
16
+ return s(i, g(I, {
26
17
  get widget() {
27
18
  return e.widget;
28
19
  },
@@ -36,28 +27,28 @@ function q(e) {
36
27
  return e.isResizing;
37
28
  },
38
29
  get children() {
39
- return n(b, {
30
+ return g(C, {
40
31
  get when() {
41
- return s();
32
+ return o();
42
33
  },
43
34
  get fallback() {
44
- return n(I, {
35
+ return g(_, {
45
36
  get type() {
46
- return o();
37
+ return d();
47
38
  }
48
39
  });
49
40
  },
50
41
  get children() {
51
- return n(k, {
42
+ return g(M, {
52
43
  get widgetId() {
53
44
  return e.widget.id;
54
45
  },
55
- state: w,
56
- onStateChange: h,
46
+ state: h,
47
+ onStateChange: v,
57
48
  get children() {
58
- return n(D, {
49
+ return g(D, {
59
50
  get component() {
60
- return s();
51
+ return o();
61
52
  },
62
53
  get widgetId() {
63
54
  return e.widget.id;
@@ -74,34 +65,34 @@ function q(e) {
74
65
  }
75
66
  });
76
67
  }
77
- })), x((r) => {
78
- var c = C(
68
+ })), W((t) => {
69
+ var c = e.widget.id, u = x(
79
70
  "deck-cell relative rounded-md overflow-hidden group",
80
71
  "bg-card border border-border",
81
72
  // Smooth transition when not dragging (for snap-back animation)
82
73
  !e.isDragging && "transition-transform duration-200 ease-out",
83
- e.isDragging && "shadow-xl z-50 ring-2 ring-primary scale-[1.02]",
74
+ e.isDragging && "shadow-2xl z-50 ring-2 ring-primary/70",
84
75
  e.isResizing && "shadow-lg z-50 ring-2 ring-primary",
85
76
  !e.isDragging && !e.isResizing && "hover:ring-1 hover:ring-primary/50",
86
77
  "select-none",
87
78
  e.isDragging && "cursor-grabbing"
88
- ), y = {
89
- "grid-area": m(),
90
- ...v()
79
+ ), y = e.dragOverlayStyle ?? {
80
+ "grid-area": w()
91
81
  };
92
- return c !== r.e && W(t, r.e = c), r.t = S(t, y, r.t), r;
82
+ return c !== t.e && b(i, "data-floe-deck-widget-id", t.e = c), u !== t.t && S(i, t.t = u), t.a = k(i, y, t.a), t;
93
83
  }, {
94
84
  e: void 0,
95
- t: void 0
96
- }), t;
85
+ t: void 0,
86
+ a: void 0
87
+ }), i;
97
88
  })();
98
89
  }
99
- function I(e) {
90
+ function _(e) {
100
91
  return (() => {
101
- var i = A(), g = i.firstChild;
102
- return g.firstChild, u(g, () => e.type, null), i;
92
+ var r = T(), n = r.firstChild;
93
+ return n.firstChild, s(n, () => e.type, null), r;
103
94
  })();
104
95
  }
105
96
  export {
106
- q as DeckCell
97
+ B as DeckCell
107
98
  };
@@ -1,4 +1,5 @@
1
1
  import { type JSX } from 'solid-js';
2
+ import { DECK_GRID_CONFIG, getGridConfigFromElement } from './deckGridMetrics';
2
3
  export interface DeckGridProps {
3
4
  class?: string;
4
5
  children?: JSX.Element;
@@ -12,19 +13,4 @@ export interface DeckGridProps {
12
13
  * 3. Row height is calculated dynamically based on container height
13
14
  */
14
15
  export declare function DeckGrid(props: DeckGridProps): JSX.Element;
15
- export declare const DECK_GRID_CONFIG: {
16
- cols: number;
17
- defaultRows: number;
18
- gap: number;
19
- rowHeight: number;
20
- };
21
- /**
22
- * Get grid configuration from the DOM element
23
- * Use this for accurate row height during drag/resize operations
24
- */
25
- export declare function getGridConfigFromElement(gridEl: HTMLElement): {
26
- cols: number;
27
- rowHeight: number;
28
- gap: number;
29
- defaultRows: number;
30
- };
16
+ export { DECK_GRID_CONFIG, getGridConfigFromElement };
@@ -1,102 +1,105 @@
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 = {
14
- x: 0,
15
- y: 0
16
- };
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) => ({
1
+ import { setStyleProperty as u, setAttribute as D, insert as b, createComponent as h, effect as E, className as ot, template as W, use as it, delegateEvents as at } from "solid-js/web";
2
+ import { createSignal as G, createMemo as d, onMount as st, Show as L, For as ct, onCleanup as lt } from "solid-js";
3
+ import { cn as dt } from "../../utils/cn.js";
4
+ import { useDeck as ut } from "../../context/DeckContext.js";
5
+ import { useLayout as gt } from "../../context/LayoutContext.js";
6
+ import { useResolvedFloeConfig as mt } from "../../context/FloeConfigContext.js";
7
+ import { useWidgetRegistry as pt } from "../../context/WidgetRegistry.js";
8
+ import { hasCollision as ft } from "../../utils/gridCollision.js";
9
+ import { DeckCell as vt } from "./DeckCell.js";
10
+ import { DeckContextMenu as ht } from "./DeckContextMenu.js";
11
+ import { DropZonePreview as xt } from "./DropZonePreview.js";
12
+ import { DECK_DEFAULT_ROWS as g, DECK_MIN_ROW_HEIGHT as F, DECK_GAP as p, DECK_PADDING as O, DECK_GRID_COLS as M, positionToDeckPixelRect as wt, getGridConfigFromElement as bt, measureDeckGridSurface as T } from "./deckGridMetrics.js";
13
+ import { DECK_GRID_CONFIG as Tt } from "./deckGridMetrics.js";
14
+ var yt = /* @__PURE__ */ W('<div class="pointer-events-none z-0"style="grid-column:1 / -1;background-position:0 0, 0 0, 0 0, 0 0, 0 0, 0 0">'), kt = /* @__PURE__ */ W('<div style=scrollbar-gutter:stable><div class=pointer-events-none aria-hidden=true style="grid-column:1 / -1">');
15
+ const Dt = (M - 1) * p;
16
+ function Lt($) {
17
+ const m = ut(), H = gt(), A = pt(), K = mt();
18
+ let n;
19
+ const [S, I] = G(0), [N, X] = G(null), [y, C] = G(null), z = () => m.activeLayout()?.widgets ?? [], x = () => m.dragState(), Y = () => m.dragMotion(), R = () => m.resizeState(), B = () => N() ?? (n ? T(n) : null), _ = () => !H.isMobile(), j = () => (K.config.deck.presetsMode ?? "mutable") === "immutable" && !!m.activeLayout()?.isPreset, V = d(() => Array.from(A.widgets().values()).map((t) => ({
21
20
  type: t.type,
22
21
  name: t.name,
23
22
  icon: t.icon
24
- }))), $ = (t) => {
25
- if (I.isMobile() || _() || t.target?.closest(".deck-cell") || !a) return;
23
+ }))), U = (t) => {
24
+ if (H.isMobile() || j() || t.target?.closest(".deck-cell") || !n) return;
26
25
  t.preventDefault();
27
- const n = a.getBoundingClientRect(), {
26
+ const o = n.getBoundingClientRect(), {
28
27
  cols: e,
29
- rowHeight: o,
28
+ rowHeight: i,
30
29
  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({
30
+ } = bt(n), c = window.getComputedStyle(n), l = parseFloat(c.paddingLeft) || 0, a = parseFloat(c.paddingTop) || 0, f = (n.clientWidth - l - (parseFloat(c.paddingRight) || 0) - s * (e - 1)) / e, v = i + s;
31
+ if (!Number.isFinite(f) || f <= 0) return;
32
+ const tt = t.clientX - o.left + n.scrollLeft - l, et = t.clientY - o.top + n.scrollTop - a, rt = Math.max(0, Math.min(e - 1, Math.floor(tt / (f + s)))), nt = Math.max(0, Math.floor(et / v));
33
+ C({
35
34
  x: t.clientX,
36
35
  y: t.clientY,
37
- col: U,
38
- row: q
36
+ col: rt,
37
+ row: nt
39
38
  });
40
- }, B = (t) => {
41
- const r = w();
42
- R(null), r && p.addWidget(t, {
39
+ }, Z = (t) => {
40
+ const r = y();
41
+ C(null), r && m.addWidget(t, {
43
42
  col: r.col,
44
43
  row: r.row
45
44
  });
46
- }, X = d(() => {
47
- const t = f();
45
+ }, q = d(() => {
46
+ const t = x();
48
47
  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;
48
+ const r = m.activeLayout();
49
+ return r ? !ft(t.currentPosition, r.widgets, t.widgetId) : !0;
50
+ }), J = d(() => {
51
+ const t = z();
52
+ if (t.length === 0) return g;
53
+ let r = g;
54
+ for (const o of t) {
55
+ const e = o.position.row + o.position.rowSpan;
57
56
  e > r && (r = e);
58
57
  }
59
58
  return r;
60
- }), C = d(() => {
61
- let t = Y();
62
- const r = f();
59
+ }), P = d(() => {
60
+ let t = J();
61
+ const r = x();
63
62
  if (r) {
64
63
  const e = r.currentPosition.row + r.currentPosition.rowSpan;
65
64
  e > t && (t = e);
66
65
  }
67
- const n = M();
68
- if (n) {
69
- const e = n.currentPosition.row + n.currentPosition.rowSpan;
66
+ const o = R();
67
+ if (o) {
68
+ const e = o.currentPosition.row + o.currentPosition.rowSpan;
70
69
  e > t && (t = e);
71
70
  }
72
- return Math.max(u, t);
73
- }), b = d(() => {
71
+ return Math.max(g, t);
72
+ }), k = d(() => {
74
73
  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);
74
+ if (t <= 0) return F;
75
+ const o = (t - O * 2 - (g - 1) * p) / g;
76
+ return Math.max(F, o);
78
77
  });
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);
78
+ st(() => {
79
+ const t = () => {
80
+ n && (I(n.clientHeight), X(T(n)));
81
+ };
82
+ if (t(), !n || typeof ResizeObserver > "u") return;
83
+ const r = new ResizeObserver((o) => {
84
+ for (const e of o)
85
+ I(e.contentRect.height);
86
+ t();
84
87
  });
85
- t.observe(a), D(a.clientHeight), ot(() => t.disconnect());
88
+ r.observe(n), lt(() => r.disconnect());
86
89
  });
87
- const j = d(() => C() > u ? !0 : S() <= 0 ? !1 : u * b() + (u - 1) * x + L * 2 > S() + 1);
90
+ const Q = d(() => P() > g ? !0 : S() <= 0 ? !1 : g * k() + (g - 1) * p + O * 2 > S() + 1);
88
91
  return (() => {
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, {
92
+ var t = kt(), r = t.firstChild;
93
+ t.$$contextmenu = U;
94
+ var o = n;
95
+ return typeof o == "function" ? it(o, t) : n = t, u(t, "grid-template-columns", `repeat(${M}, 1fr)`), u(t, "gap", `${p}px`), D(t, "data-grid-cols", M), D(t, "data-gap", p), D(t, "data-default-rows", g), b(t, h(L, {
93
96
  get when() {
94
- return z();
97
+ return _();
95
98
  },
96
99
  get children() {
97
- var e = ft();
98
- return F((o) => {
99
- var s = `1 / ${C() + 1}`, c = `${b() + x}px`, l = [
100
+ var e = yt();
101
+ return u(e, "--deck-grid-unit-x", `calc((100% - ${Dt}px) / ${M} + ${p}px)`), E((i) => {
102
+ var s = `1 / ${P() + 1}`, c = `${k() + p}px`, l = [
100
103
  // Fine
101
104
  "linear-gradient(to right, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px)",
102
105
  "linear-gradient(to bottom, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px)",
@@ -106,7 +109,7 @@ function Dt(g) {
106
109
  // Major (12)
107
110
  "linear-gradient(to right, color-mix(in srgb, var(--border) 75%, transparent) 2px, transparent 2px)",
108
111
  "linear-gradient(to bottom, color-mix(in srgb, var(--border) 75%, transparent) 2px, transparent 2px)"
109
- ].join(", "), i = [
112
+ ].join(", "), a = [
110
113
  // Fine
111
114
  "var(--deck-grid-unit-x) var(--deck-grid-unit-y)",
112
115
  "var(--deck-grid-unit-x) var(--deck-grid-unit-y)",
@@ -117,7 +120,7 @@ function Dt(g) {
117
120
  "calc(var(--deck-grid-unit-x) * 12) calc(var(--deck-grid-unit-y) * 12)",
118
121
  "calc(var(--deck-grid-unit-x) * 12) calc(var(--deck-grid-unit-y) * 12)"
119
122
  ].join(", ");
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;
123
+ return s !== i.e && u(e, "grid-row", i.e = s), c !== i.t && u(e, "--deck-grid-unit-y", i.t = c), l !== i.a && u(e, "background-image", i.a = l), a !== i.o && u(e, "background-size", i.o = a), i;
121
124
  }, {
122
125
  e: void 0,
123
126
  t: void 0,
@@ -125,37 +128,49 @@ function Dt(g) {
125
128
  o: void 0
126
129
  }), e;
127
130
  }
128
- }), null), h(t, m(G, {
131
+ }), null), b(t, h(L, {
129
132
  get when() {
130
- return f();
133
+ return x();
131
134
  },
132
- children: (e) => m(pt, {
135
+ children: (e) => h(xt, {
133
136
  get position() {
134
137
  return e().currentPosition;
135
138
  },
136
139
  get isValid() {
137
- return X();
140
+ return q();
138
141
  }
139
142
  })
140
- }), null), h(t, m(nt, {
143
+ }), null), b(t, h(ct, {
141
144
  get each() {
142
- return P();
145
+ return z();
143
146
  },
144
147
  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;
148
+ const i = d(() => {
149
+ const a = R();
150
+ return a && a.widgetId === e.id ? a.currentPosition : e.position;
151
+ }), s = d(() => x()?.widgetId === e.id), c = d(() => R()?.widgetId === e.id), l = d(() => {
152
+ const a = x();
153
+ if (!a || a.widgetId !== e.id) return;
154
+ const w = Y();
155
+ if (!w || w.widgetId !== e.id) return;
156
+ const f = B();
157
+ if (!f) return;
158
+ const v = wt(a.originalPosition, f);
159
+ return {
160
+ position: "absolute",
161
+ left: `${v.left}px`,
162
+ top: `${v.top}px`,
163
+ width: `${v.width}px`,
164
+ height: `${v.height}px`,
165
+ transform: `translate3d(${w.deltaX}px, ${w.deltaY}px, 0) scale(0.992)`,
166
+ "transform-origin": "center center",
167
+ "will-change": "transform"
168
+ };
154
169
  });
155
- return m(ut, {
170
+ return h(vt, {
156
171
  widget: e,
157
172
  get position() {
158
- return o();
173
+ return i();
159
174
  },
160
175
  get isDragging() {
161
176
  return s();
@@ -163,36 +178,36 @@ function Dt(g) {
163
178
  get isResizing() {
164
179
  return c();
165
180
  },
166
- get pixelOffset() {
181
+ get dragOverlayStyle() {
167
182
  return l();
168
183
  }
169
184
  });
170
185
  }
171
- }), null), h(t, () => g.children, null), h(t, m(gt, {
186
+ }), null), b(t, () => $.children, null), b(t, h(ht, {
172
187
  get open() {
173
- return w() !== null;
188
+ return y() !== null;
174
189
  },
175
190
  get x() {
176
- return w()?.x ?? 0;
191
+ return y()?.x ?? 0;
177
192
  },
178
193
  get y() {
179
- return w()?.y ?? 0;
194
+ return y()?.y ?? 0;
180
195
  },
181
196
  get items() {
182
- return E();
197
+ return V();
183
198
  },
184
- onSelect: B,
185
- onDismiss: () => R(null)
186
- }), null), F((e) => {
187
- var o = it(
199
+ onSelect: Z,
200
+ onDismiss: () => C(null)
201
+ }), null), E((e) => {
202
+ var i = dt(
188
203
  "deck-grid relative w-full h-full overflow-x-hidden",
189
204
  // Only enable vertical scroll when content exceeds 24 rows
190
- j() ? "overflow-y-scroll" : "overflow-y-hidden",
205
+ Q() ? "overflow-y-scroll" : "overflow-y-hidden",
191
206
  "grid p-1",
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;
207
+ _() && "bg-muted/20",
208
+ $.class
209
+ ), s = `${k()}px`, c = k(), l = `1 / ${P() + 1}`;
210
+ return i !== e.e && ot(t, e.e = i), s !== e.t && u(t, "grid-auto-rows", e.t = s), c !== e.a && D(t, "data-row-height", e.a = c), l !== e.o && u(r, "grid-row", e.o = l), e;
196
211
  }, {
197
212
  e: void 0,
198
213
  t: void 0,
@@ -201,24 +216,9 @@ function Dt(g) {
201
216
  }), t;
202
217
  })();
203
218
  }
204
- const Pt = {
205
- cols: T,
206
- defaultRows: u,
207
- gap: x,
208
- // Deprecated: use getGridConfig() or read from data-row-height attribute instead
209
- rowHeight: k
210
- };
211
- function ht(g) {
212
- return {
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)
217
- };
218
- }
219
- et(["contextmenu"]);
219
+ at(["contextmenu"]);
220
220
  export {
221
- Pt as DECK_GRID_CONFIG,
222
- Dt as DeckGrid,
223
- ht as getGridConfigFromElement
221
+ Tt as DECK_GRID_CONFIG,
222
+ Lt as DeckGrid,
223
+ bt as getGridConfigFromElement
224
224
  };
@@ -1,25 +1,25 @@
1
- import { effect as m, className as c, setStyleProperty as i, template as b } from "solid-js/web";
2
- import { cn as f } from "../../utils/cn.js";
3
- import { positionToGridArea as g } from "../../utils/gridLayout.js";
4
- var u = /* @__PURE__ */ b('<div><div class="absolute inset-0 rounded-md">');
5
- function V(o) {
6
- const v = () => g(o.position), a = () => o.isValid !== !1 ? "--info" : "--error";
1
+ import { effect as g, className as c, setStyleProperty as n, template as f } from "solid-js/web";
2
+ import { cn as m } from "../../utils/cn.js";
3
+ import { positionToGridArea as b } from "../../utils/gridLayout.js";
4
+ var u = /* @__PURE__ */ f('<div data-floe-deck-drop-preview=true><div class="absolute inset-0 rounded-md">');
5
+ function w(i) {
6
+ const v = () => b(i.position), o = () => i.isValid !== !1 ? "--info" : "--error";
7
7
  return (() => {
8
8
  var e = u(), l = e.firstChild;
9
- return m((r) => {
10
- var n = f(
11
- "pointer-events-none rounded-md relative",
9
+ return g((r) => {
10
+ var a = m(
11
+ "pointer-events-none rounded-md relative z-20",
12
12
  "border-2 border-dashed",
13
- o.isValid !== !1 ? "border-info/50 bg-info/10" : "border-error/50 bg-error/10",
13
+ i.isValid !== !1 ? "border-info/60 bg-info/10 ring-1 ring-inset ring-info/25" : "border-error/60 bg-error/10 ring-1 ring-inset ring-error/25",
14
14
  // Subtle animation
15
15
  "animate-in fade-in duration-150"
16
- ), t = v(), d = `0 4px 16px color-mix(in srgb, var(${a()}) 18%, transparent)`, s = `linear-gradient(
16
+ ), t = v(), d = `0 4px 16px color-mix(in srgb, var(${o()}) 18%, transparent)`, s = `linear-gradient(
17
17
  135deg,
18
- color-mix(in srgb, var(${a()}) 18%, transparent) 0%,
18
+ color-mix(in srgb, var(${o()}) 18%, transparent) 0%,
19
19
  transparent 55%,
20
- color-mix(in srgb, var(${a()}) 10%, var(--card)) 100%
20
+ color-mix(in srgb, var(${o()}) 10%, var(--card)) 100%
21
21
  )`;
22
- return n !== r.e && c(e, r.e = n), t !== r.t && i(e, "grid-area", r.t = t), d !== r.a && i(e, "box-shadow", r.a = d), s !== r.o && i(l, "background", r.o = s), r;
22
+ return a !== r.e && c(e, r.e = a), t !== r.t && n(e, "grid-area", r.t = t), d !== r.a && n(e, "box-shadow", r.a = d), s !== r.o && n(l, "background", r.o = s), r;
23
23
  }, {
24
24
  e: void 0,
25
25
  t: void 0,
@@ -29,5 +29,5 @@ function V(o) {
29
29
  })();
30
30
  }
31
31
  export {
32
- V as DropZonePreview
32
+ w as DropZonePreview
33
33
  };
@@ -4,6 +4,8 @@ export interface WidgetResizeHandleProps {
4
4
  edge: ResizeState['edge'];
5
5
  }
6
6
  /**
7
- * Resize handle for a specific edge of a widget
7
+ * Resize handle for a specific edge of a widget.
8
+ * The active pointer session is owned by the shared Deck pointer-session helper,
9
+ * so pointer release remains reliable even when the cursor crosses other widgets.
8
10
  */
9
11
  export declare function WidgetResizeHandle(props: WidgetResizeHandleProps): import("solid-js").JSX.Element;