@floegence/floe-webapp-core 0.36.13 → 0.36.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,41 @@
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 z } from "solid-js";
3
- import { cn as C } from "../../utils/cn.js";
4
- import { useDeck as R } from "../../context/DeckContext.js";
5
- import { useWidgetRegistry as x } from "../../context/WidgetRegistry.js";
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 = R(), n = x(), 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;
1
+ import { spread as h, mergeProps as y, insert as u, createComponent as i, Dynamic as v, template as c } from "solid-js/web";
2
+ import { createMemo as a, Show as D } from "solid-js";
3
+ import { cn as R } from "../../utils/cn.js";
4
+ import { useDeck as S } from "../../context/DeckContext.js";
5
+ import { useWidgetRegistry as W } from "../../context/WidgetRegistry.js";
6
+ import { WidgetStateProvider as C } from "../../context/WidgetStateContext.js";
7
+ import { positionToGridArea as _ } from "../../utils/gridLayout.js";
8
+ import { WidgetFrame as b } from "./WidgetFrame.js";
9
+ import { SURFACE_PORTAL_LAYER_ATTR as k } from "../ui/dialogSurfaceScope.js";
10
+ var z = /* @__PURE__ */ c("<div data-floe-dialog-surface-host=true>"), x = /* @__PURE__ */ c('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
11
+ function j(e) {
12
+ const t = S(), g = W(), s = () => t.editMode(), n = () => e.widget.type, d = a(() => g.getWidget(n())), l = a(() => _(e.position)), m = () => t.getWidgetState(e.widget.id), f = (r, w) => {
13
+ t.updateWidgetState(e.widget.id, r, w);
14
+ }, o = () => d()?.component;
14
15
  return (() => {
15
- var i = P();
16
- return s(i, g(I, {
16
+ var r = z();
17
+ return h(r, y({
18
+ get "data-floe-deck-widget-id"() {
19
+ return e.widget.id;
20
+ }
21
+ }, {
22
+ [k]: "true"
23
+ }, {
24
+ "data-floe-geometry-surface": "deck-widget",
25
+ get class() {
26
+ return R("deck-cell relative rounded-md overflow-hidden group", "bg-card border border-border", !e.isDragging && !e.isResizing && "transition-shadow duration-150 ease-out", e.isDragging && "shadow-2xl z-50 ring-2 ring-primary/70", e.isResizing && "shadow-lg z-50 ring-2 ring-primary", !e.isDragging && !e.isResizing && "hover:ring-1 hover:ring-primary/50", "select-none", e.isDragging && "cursor-grabbing");
27
+ },
28
+ get style() {
29
+ return e.dragOverlayStyle ?? {
30
+ "grid-area": l()
31
+ };
32
+ }
33
+ }), !1, !0), u(r, i(b, {
17
34
  get widget() {
18
35
  return e.widget;
19
36
  },
20
37
  get widgetDef() {
21
- return a();
38
+ return d();
22
39
  },
23
40
  get isDragging() {
24
41
  return e.isDragging;
@@ -27,26 +44,26 @@ function B(e) {
27
44
  return e.isResizing;
28
45
  },
29
46
  get children() {
30
- return g(z, {
47
+ return i(D, {
31
48
  get when() {
32
49
  return o();
33
50
  },
34
51
  get fallback() {
35
- return g(_, {
52
+ return i(A, {
36
53
  get type() {
37
- return d();
54
+ return n();
38
55
  }
39
56
  });
40
57
  },
41
58
  get children() {
42
- return g(M, {
59
+ return i(C, {
43
60
  get widgetId() {
44
61
  return e.widget.id;
45
62
  },
46
- state: h,
47
- onStateChange: v,
63
+ state: m,
64
+ onStateChange: f,
48
65
  get children() {
49
- return g(D, {
66
+ return i(v, {
50
67
  get component() {
51
68
  return o();
52
69
  },
@@ -57,7 +74,7 @@ function B(e) {
57
74
  return e.widget.config;
58
75
  },
59
76
  get isEditMode() {
60
- return f();
77
+ return s();
61
78
  }
62
79
  });
63
80
  }
@@ -65,24 +82,15 @@ function B(e) {
65
82
  }
66
83
  });
67
84
  }
68
- })), W((t) => {
69
- var c = e.widget.id, u = C("deck-cell relative rounded-md overflow-hidden group", "bg-card border border-border", !e.isDragging && !e.isResizing && "transition-shadow duration-150 ease-out", e.isDragging && "shadow-2xl z-50 ring-2 ring-primary/70", e.isResizing && "shadow-lg z-50 ring-2 ring-primary", !e.isDragging && !e.isResizing && "hover:ring-1 hover:ring-primary/50", "select-none", e.isDragging && "cursor-grabbing"), y = e.dragOverlayStyle ?? {
70
- "grid-area": w()
71
- };
72
- 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;
73
- }, {
74
- e: void 0,
75
- t: void 0,
76
- a: void 0
77
- }), i;
85
+ })), r;
78
86
  })();
79
87
  }
80
- function _(e) {
88
+ function A(e) {
81
89
  return (() => {
82
- var r = T(), n = r.firstChild;
83
- return n.firstChild, s(n, () => e.type, null), r;
90
+ var t = x(), g = t.firstChild;
91
+ return g.firstChild, u(g, () => e.type, null), t;
84
92
  })();
85
93
  }
86
94
  export {
87
- B as DeckCell
95
+ j as DeckCell
88
96
  };
@@ -1,5 +1,5 @@
1
- import { createComponent as a, Portal as z, setAttribute as v, spread as V, mergeProps as O, insert as b, template as g, Dynamic as Q, memo as F, effect as M, className as X, use as I, delegateEvents as Y } from "solid-js/web";
2
- import { createSignal as E, createMemo as ee, createEffect as H, onCleanup as q, Show as C, For as Z } from "solid-js";
1
+ import { createComponent as a, Portal as z, setAttribute as v, spread as V, mergeProps as O, insert as b, template as g, Dynamic as Q, memo as H, effect as M, className as X, use as I, delegateEvents as Y } from "solid-js/web";
2
+ import { createSignal as E, createMemo as ee, createEffect as F, onCleanup as q, Show as C, For as Z } from "solid-js";
3
3
  import { cn as A } from "../../utils/cn.js";
4
4
  import { deferAfterPaint as te } from "../../utils/defer.js";
5
5
  import { ChevronRight as ne } from "../icons/index.js";
@@ -225,7 +225,7 @@ function J(e) {
225
225
  })
226
226
  }), P), b(P, () => e.item.label), b(d, a(C, {
227
227
  get when() {
228
- return F(() => !!e.item.shortcut)() && !f();
228
+ return H(() => !!e.item.shortcut)() && !f();
229
229
  },
230
230
  get children() {
231
231
  var r = ye();
@@ -242,7 +242,7 @@ function J(e) {
242
242
  }
243
243
  }), null), b(l, a(C, {
244
244
  get when() {
245
- return F(() => !!t())() && f();
245
+ return H(() => !!t())() && f();
246
246
  },
247
247
  get children() {
248
248
  return a(z, {
@@ -326,6 +326,8 @@ function Ve(e) {
326
326
  y: -9999
327
327
  }), c = ee(() => t.contextMenu() ? ie() : {
328
328
  host: null,
329
+ boundaryHost: null,
330
+ mountHost: null,
329
331
  mode: "global"
330
332
  }), p = {
331
333
  mount: () => ce(c()),
@@ -368,7 +370,7 @@ function Ve(e) {
368
370
  y: o.y
369
371
  }, s, p.boundaryRect());
370
372
  };
371
- H(() => {
373
+ F(() => {
372
374
  if (i || !t.contextMenu()) return;
373
375
  const o = Ee({
374
376
  ownerWindow: window,
@@ -378,7 +380,7 @@ function Ve(e) {
378
380
  q(() => {
379
381
  o();
380
382
  });
381
- }), H(() => {
383
+ }), F(() => {
382
384
  const o = t.contextMenu();
383
385
  if (!o) {
384
386
  h({
@@ -1,24 +1,26 @@
1
- import { createComponent as n, Portal as B, setAttribute as u, spread as b, mergeProps as v, memo as T, insert as l, effect as A, template as c, use as D } from "solid-js/web";
2
- import { createUniqueId as E, createMemo as M, Show as s } from "solid-js";
3
- import { cn as x } from "../../utils/cn.js";
4
- import { Button as C } from "./Button.js";
5
- import { X as p } from "../icons/index.js";
6
- import { useResolvedFloeConfig as z } from "../../context/FloeConfigContext.js";
7
- import { useOverlayMask as F } from "../../hooks/useOverlayMask.js";
8
- import { resolveSurfacePortalHost as N, DIALOG_SURFACE_BOUNDARY_ATTR as g, isSurfacePortalMode as P, resolveSurfacePortalMount as U } from "./dialogSurfaceScope.js";
9
- import { LOCAL_INTERACTION_SURFACE_ATTR as j } from "./localInteractionSurface.js";
10
- var H = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), L = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), W = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), q = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), G = /* @__PURE__ */ c('<div><div></div><div class="relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), X = /* @__PURE__ */ c("<div>");
11
- function Y(e) {
12
- const o = E(), $ = () => `dialog-${o}-title`, _ = () => `dialog-${o}-description`;
13
- let m;
14
- const w = M(() => e.open ? N() : {
1
+ import { createComponent as n, Portal as D, setAttribute as u, spread as x, mergeProps as $, memo as C, insert as l, effect as S, template as c, use as E } from "solid-js/web";
2
+ import { createUniqueId as M, createMemo as T, Show as s } from "solid-js";
3
+ import { cn as _ } from "../../utils/cn.js";
4
+ import { Button as y } from "./Button.js";
5
+ import { X as P } from "../icons/index.js";
6
+ import { useResolvedFloeConfig as j } from "../../context/FloeConfigContext.js";
7
+ import { useOverlayMask as z } from "../../hooks/useOverlayMask.js";
8
+ import { resolveSurfacePortalHost as F, projectSurfacePortalRect as H, resolveSurfacePortalBoundaryRect as N, DIALOG_SURFACE_BOUNDARY_ATTR as h, isSurfacePortalMode as U, resolveSurfacePortalMount as L } from "./dialogSurfaceScope.js";
9
+ import { LOCAL_INTERACTION_SURFACE_ATTR as W } from "./localInteractionSurface.js";
10
+ var q = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), G = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), X = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), Y = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), J = /* @__PURE__ */ c('<div><div></div><div class="relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), K = /* @__PURE__ */ c("<div>");
11
+ function Q(e) {
12
+ const o = M(), w = () => `dialog-${o}-title`, k = () => `dialog-${o}-description`;
13
+ let b;
14
+ const f = T(() => e.open ? F() : {
15
15
  host: null,
16
+ boundaryHost: null,
17
+ mountHost: null,
16
18
  mode: "global"
17
- }), f = () => `dialog-boundary-${o}`, t = () => P(w()), I = () => U(w()), S = (r) => typeof Element < "u" && r instanceof Element ? !!r.closest(`[${g}="${f()}"]`) : typeof Node < "u" && r instanceof Node ? !!r.parentElement?.closest(`[${g}="${f()}"]`) : !1;
18
- return F({
19
+ }), g = () => `dialog-boundary-${o}`, t = () => U(f()), A = () => L(f()), m = T(() => H(N(f()), f())), B = (r) => typeof Element < "u" && r instanceof Element ? !!r.closest(`[${h}="${g()}"]`) : typeof Node < "u" && r instanceof Node ? !!r.parentElement?.closest(`[${h}="${g()}"]`) : !1;
20
+ return z({
19
21
  open: () => e.open,
20
- root: () => m,
21
- containsTarget: (r) => t() && S(r),
22
+ root: () => b,
23
+ containsTarget: (r) => t() && B(r),
22
24
  onClose: () => e.onOpenChange(!1),
23
25
  lockBodyScroll: () => !t(),
24
26
  trapFocus: !0,
@@ -33,46 +35,54 @@ function Y(e) {
33
35
  return e.open;
34
36
  },
35
37
  get children() {
36
- return n(B, {
38
+ return n(D, {
37
39
  get mount() {
38
- return I();
40
+ return A();
39
41
  },
40
42
  get children() {
41
- var r = G(), h = r.firstChild, R = h.nextSibling, i = R.firstChild, y = i.firstChild;
42
- u(r, "data-floe-dialog-overlay-root", o), b(r, v({
43
+ var r = J(), v = r.firstChild, I = v.nextSibling, i = I.firstChild, p = i.firstChild;
44
+ u(r, "data-floe-dialog-overlay-root", o), x(r, $({
43
45
  get "data-floe-dialog-mode"() {
44
46
  return t() ? "surface" : "global";
45
47
  }
46
48
  }, () => ({
47
- [j]: t() ? "true" : void 0
49
+ [W]: t() ? "true" : void 0
48
50
  }), {
49
51
  get class() {
50
- return x(t() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
52
+ return _(t() ? "absolute z-20 box-border p-3" : "fixed inset-0 box-border z-50 p-4");
53
+ },
54
+ get style() {
55
+ return C(() => !!t())() ? {
56
+ left: `${m().left}px`,
57
+ top: `${m().top}px`,
58
+ width: `${m().width}px`,
59
+ height: `${m().height}px`
60
+ } : void 0;
51
61
  }
52
- }), !1, !0), u(h, "data-floe-dialog-backdrop", o), b(h, v(() => ({
53
- [g]: f()
62
+ }), !1, !0), u(v, "data-floe-dialog-backdrop", o), x(v, $(() => ({
63
+ [h]: g()
54
64
  }), {
55
65
  get class() {
56
- return x("absolute inset-0 cursor-pointer animate-in fade-in", t() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
66
+ return _("absolute inset-0 cursor-pointer animate-in fade-in", t() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
57
67
  },
58
68
  onClick: () => e.onOpenChange(!1)
59
69
  }), !1, !1);
60
- var k = m;
61
- return typeof k == "function" ? D(k, i) : m = i, u(i, "data-floe-dialog-panel", o), b(i, v(() => ({
62
- [g]: f()
70
+ var O = b;
71
+ return typeof O == "function" ? E(O, i) : b = i, u(i, "data-floe-dialog-panel", o), x(i, $(() => ({
72
+ [h]: g()
63
73
  }), {
64
74
  get class() {
65
- return x(t() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
75
+ return _(t() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
66
76
  },
67
77
  role: "dialog",
68
78
  get "aria-modal"() {
69
79
  return t() ? void 0 : "true";
70
80
  },
71
81
  get "aria-labelledby"() {
72
- return T(() => !!e.title)() ? $() : void 0;
82
+ return C(() => !!e.title)() ? w() : void 0;
73
83
  },
74
84
  get "aria-describedby"() {
75
- return T(() => !!e.description)() ? _() : void 0;
85
+ return C(() => !!e.description)() ? k() : void 0;
76
86
  },
77
87
  tabIndex: -1
78
88
  }), !1, !0), l(i, n(s, {
@@ -80,42 +90,42 @@ function Y(e) {
80
90
  return e.title || e.description;
81
91
  },
82
92
  get children() {
83
- var d = W(), O = d.firstChild;
84
- return l(O, n(s, {
93
+ var d = X(), R = d.firstChild;
94
+ return l(R, n(s, {
85
95
  get when() {
86
96
  return e.title;
87
97
  },
88
98
  get children() {
89
- var a = H();
90
- return l(a, () => e.title), A(() => u(a, "id", $())), a;
99
+ var a = q();
100
+ return l(a, () => e.title), S(() => u(a, "id", w())), a;
91
101
  }
92
- }), null), l(O, n(s, {
102
+ }), null), l(R, n(s, {
93
103
  get when() {
94
104
  return e.description;
95
105
  },
96
106
  get children() {
97
- var a = L();
98
- return l(a, () => e.description), A(() => u(a, "id", _())), a;
107
+ var a = G();
108
+ return l(a, () => e.description), S(() => u(a, "id", k())), a;
99
109
  }
100
- }), null), l(d, n(C, {
110
+ }), null), l(d, n(y, {
101
111
  variant: "ghost-destructive",
102
112
  size: "icon",
103
113
  class: "h-6 w-6 -mr-1",
104
114
  onClick: () => e.onOpenChange(!1),
105
115
  "aria-label": "Close",
106
116
  get children() {
107
- return n(p, {
117
+ return n(P, {
108
118
  class: "w-3.5 h-3.5"
109
119
  });
110
120
  }
111
121
  }), null), d;
112
122
  }
113
- }), y), l(y, () => e.children), l(i, n(s, {
123
+ }), p), l(p, () => e.children), l(i, n(s, {
114
124
  get when() {
115
125
  return e.footer;
116
126
  },
117
127
  get children() {
118
- var d = q();
128
+ var d = Y();
119
129
  return l(d, () => e.footer), d;
120
130
  }
121
131
  }), null), r;
@@ -124,9 +134,9 @@ function Y(e) {
124
134
  }
125
135
  });
126
136
  }
127
- function oe(e) {
128
- const o = z();
129
- return n(Y, {
137
+ function ae(e) {
138
+ const o = j();
139
+ return n(Q, {
130
140
  get open() {
131
141
  return e.open;
132
142
  },
@@ -140,7 +150,7 @@ function oe(e) {
140
150
  return e.description;
141
151
  },
142
152
  get footer() {
143
- return [n(C, {
153
+ return [n(y, {
144
154
  variant: "ghost",
145
155
  onClick: () => e.onOpenChange(!1),
146
156
  get disabled() {
@@ -149,7 +159,7 @@ function oe(e) {
149
159
  get children() {
150
160
  return e.cancelText ?? o.config.strings.confirmDialog.cancel;
151
161
  }
152
- }), n(C, {
162
+ }), n(y, {
153
163
  get variant() {
154
164
  return e.variant === "destructive" ? "destructive" : "primary";
155
165
  },
@@ -165,11 +175,11 @@ function oe(e) {
165
175
  })];
166
176
  },
167
177
  get children() {
168
- return e.children ?? X();
178
+ return e.children ?? K();
169
179
  }
170
180
  });
171
181
  }
172
182
  export {
173
- oe as ConfirmDialog,
174
- Y as Dialog
183
+ ae as ConfirmDialog,
184
+ Q as Dialog
175
185
  };