@floegence/floe-webapp-core 0.36.12 → 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
  };