@floegence/floe-webapp-core 0.36.0 → 0.36.2

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 (38) hide show
  1. package/dist/components/deck/DeckCell.js +4 -4
  2. package/dist/components/layout/DisplayModePageShell.d.ts +8 -0
  3. package/dist/components/layout/DisplayModePageShell.js +22 -0
  4. package/dist/components/layout/DisplayModeSwitcher.d.ts +7 -0
  5. package/dist/components/layout/DisplayModeSwitcher.js +52 -0
  6. package/dist/components/layout/index.d.ts +2 -0
  7. package/dist/components/ui/Dialog.js +115 -87
  8. package/dist/components/ui/FloatingWindow.js +158 -144
  9. package/dist/components/ui/dialogSurfaceScope.d.ts +14 -0
  10. package/dist/components/ui/dialogSurfaceScope.js +45 -0
  11. package/dist/components/workbench/WorkbenchCanvas.d.ts +2 -1
  12. package/dist/components/workbench/WorkbenchCanvas.js +54 -56
  13. package/dist/components/workbench/WorkbenchCanvasField.d.ts +25 -0
  14. package/dist/components/workbench/WorkbenchCanvasField.js +145 -0
  15. package/dist/components/workbench/WorkbenchFilterBar.d.ts +2 -1
  16. package/dist/components/workbench/WorkbenchFilterBar.js +71 -70
  17. package/dist/components/workbench/WorkbenchSurface.d.ts +14 -1
  18. package/dist/components/workbench/WorkbenchSurface.js +73 -56
  19. package/dist/components/workbench/WorkbenchWidget.d.ts +11 -2
  20. package/dist/components/workbench/WorkbenchWidget.js +112 -103
  21. package/dist/components/workbench/index.d.ts +2 -2
  22. package/dist/components/workbench/types.d.ts +28 -11
  23. package/dist/components/workbench/types.js +2 -16
  24. package/dist/components/workbench/useWorkbenchModel.d.ts +19 -6
  25. package/dist/components/workbench/useWorkbenchModel.js +152 -127
  26. package/dist/components/workbench/widgets/widgetRegistry.d.ts +6 -5
  27. package/dist/components/workbench/widgets/widgetRegistry.js +47 -26
  28. package/dist/components/workbench/workbenchHelpers.d.ts +8 -4
  29. package/dist/components/workbench/workbenchHelpers.js +97 -134
  30. package/dist/display-mode.css +70 -0
  31. package/dist/full.js +485 -480
  32. package/dist/hooks/useOverlayMask.d.ts +11 -9
  33. package/dist/hooks/useOverlayMask.js +54 -52
  34. package/dist/layout.js +32 -27
  35. package/dist/styles.css +1 -1
  36. package/dist/tailwind.css +1 -0
  37. package/dist/workbench.js +21 -20
  38. package/package.json +1 -1
@@ -6,9 +6,9 @@ import { useWidgetRegistry as R } from "../../context/WidgetRegistry.js";
6
6
  import { WidgetStateProvider as k } from "../../context/WidgetStateContext.js";
7
7
  import { positionToGridArea as $ } from "../../utils/gridLayout.js";
8
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: ');
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
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) => {
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
12
  i.updateWidgetState(e.widget.id, t, r);
13
13
  }, s = () => a()?.component, v = d(() => {
14
14
  if (!e.isDragging || !e.pixelOffset) return {};
@@ -66,7 +66,7 @@ function q(e) {
66
66
  return e.widget.config;
67
67
  },
68
68
  get isEditMode() {
69
- return m();
69
+ return f();
70
70
  }
71
71
  });
72
72
  }
@@ -86,7 +86,7 @@ function q(e) {
86
86
  "select-none",
87
87
  e.isDragging && "cursor-grabbing"
88
88
  ), y = {
89
- "grid-area": f(),
89
+ "grid-area": m(),
90
90
  ...v()
91
91
  };
92
92
  return c !== r.e && W(t, r.e = c), r.t = S(t, y, r.t), r;
@@ -0,0 +1,8 @@
1
+ import { type Component, type JSX } from 'solid-js';
2
+ export interface DisplayModePageShellProps {
3
+ logo?: JSX.Element;
4
+ actions?: JSX.Element;
5
+ title?: string;
6
+ children: JSX.Element;
7
+ }
8
+ export declare const DisplayModePageShell: Component<DisplayModePageShellProps>;
@@ -0,0 +1,22 @@
1
+ import { insert as r, createComponent as a, template as o } from "solid-js/web";
2
+ import "solid-js";
3
+ import { TopBar as i } from "./TopBar.js";
4
+ var n = /* @__PURE__ */ o("<div class=display-mode-page-shell><main class=display-mode-page-shell__body>");
5
+ const p = (e) => (() => {
6
+ var t = n(), l = t.firstChild;
7
+ return r(t, a(i, {
8
+ get logo() {
9
+ return e.logo;
10
+ },
11
+ get title() {
12
+ return e.title;
13
+ },
14
+ get actions() {
15
+ return e.actions;
16
+ },
17
+ ariaLabel: "Display mode top bar"
18
+ }), l), r(l, () => e.children), t;
19
+ })();
20
+ export {
21
+ p as DisplayModePageShell
22
+ };
@@ -0,0 +1,7 @@
1
+ export type DisplayMode = 'activity' | 'deck' | 'workbench';
2
+ export declare function sanitizeDisplayMode(value: unknown, fallback?: DisplayMode): DisplayMode;
3
+ export interface DisplayModeSwitcherProps {
4
+ mode: DisplayMode;
5
+ onChange: (mode: DisplayMode) => void;
6
+ }
7
+ export declare function DisplayModeSwitcher(props: DisplayModeSwitcherProps): import("solid-js").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { insert as a, createComponent as m, memo as h, effect as v, setAttribute as y, template as o, delegateEvents as p } from "solid-js/web";
2
+ import { For as _ } from "solid-js";
3
+ import { Bookmark as u, LayoutDashboard as k, Grid3x3 as f } from "../icons/index.js";
4
+ var w = /* @__PURE__ */ o('<div class=display-mode-switcher role=tablist aria-label="Display mode">'), D = /* @__PURE__ */ o("<button type=button class=display-mode-switcher__pill role=tab><span class=display-mode-switcher__label>"), $ = /* @__PURE__ */ o("<span class=display-mode-switcher__pill-bg>");
5
+ const g = /* @__PURE__ */ new Set(["activity", "deck", "workbench"]);
6
+ function E(i, r = "activity") {
7
+ return typeof i == "string" && g.has(i) ? i : r;
8
+ }
9
+ const A = [{
10
+ id: "activity",
11
+ label: "Activity",
12
+ icon: u
13
+ }, {
14
+ id: "deck",
15
+ label: "Deck",
16
+ icon: k
17
+ }, {
18
+ id: "workbench",
19
+ label: "Workbench",
20
+ icon: f
21
+ }];
22
+ function L(i) {
23
+ return (() => {
24
+ var r = w();
25
+ return a(r, m(_, {
26
+ each: A,
27
+ children: (l) => {
28
+ const b = l.icon, c = () => i.mode === l.id;
29
+ return (() => {
30
+ var e = D(), s = e.firstChild;
31
+ return e.$$click = () => i.onChange(l.id), a(e, (() => {
32
+ var t = h(() => !!c());
33
+ return () => t() ? $() : null;
34
+ })(), s), a(e, m(b, {
35
+ class: "display-mode-switcher__icon"
36
+ }), s), a(s, () => l.label), v((t) => {
37
+ var n = !!c(), d = c();
38
+ return n !== t.e && e.classList.toggle("is-active", t.e = n), d !== t.t && y(e, "aria-selected", t.t = d), t;
39
+ }, {
40
+ e: void 0,
41
+ t: void 0
42
+ }), e;
43
+ })();
44
+ }
45
+ })), r;
46
+ })();
47
+ }
48
+ p(["click"]);
49
+ export {
50
+ L as DisplayModeSwitcher,
51
+ E as sanitizeDisplayMode
52
+ };
@@ -9,3 +9,5 @@ export { ResizeHandle, type ResizeHandleProps } from './ResizeHandle';
9
9
  export { SidebarPane, type SidebarPaneProps } from './SidebarPane';
10
10
  export { Panel, PanelHeader, PanelContent, type PanelProps, type PanelHeaderProps, type PanelContentProps } from './Panel';
11
11
  export { KeepAliveStack, type KeepAliveStackProps, type KeepAliveView } from './KeepAliveStack';
12
+ export { DisplayModeSwitcher, sanitizeDisplayMode, type DisplayMode, type DisplayModeSwitcherProps, } from './DisplayModeSwitcher';
13
+ export { DisplayModePageShell, type DisplayModePageShellProps } from './DisplayModePageShell';
@@ -1,98 +1,127 @@
1
- import { createComponent as n, Portal as C, insert as l, effect as g, setAttribute as u, className as $, template as o, use as k, delegateEvents as w } from "solid-js/web";
2
- import { createUniqueId as _, Show as c } from "solid-js";
3
- import { cn as y } from "../../utils/cn.js";
4
- import { Button as f } from "./Button.js";
5
- import { X as O } from "../icons/index.js";
6
- import { useResolvedFloeConfig as z } from "../../context/FloeConfigContext.js";
7
- import { useOverlayMask as D } from "../../hooks/useOverlayMask.js";
8
- var I = /* @__PURE__ */ o('<div class="fixed inset-0 z-50 bg-background/80 backdrop-blur-sm animate-in fade-in cursor-pointer">'), F = /* @__PURE__ */ o('<h2 class="text-sm font-semibold">'), T = /* @__PURE__ */ o('<p class="mt-0.5 text-xs text-muted-foreground">'), j = /* @__PURE__ */ o('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), B = /* @__PURE__ */ o('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), E = /* @__PURE__ */ o('<div role=dialog aria-modal=true tabindex=-1><div class="flex-1 overflow-auto overscroll-contain p-3">'), M = /* @__PURE__ */ o("<div>");
9
- function R(e) {
10
- const a = _(), m = () => `dialog-${a}-title`, v = () => `dialog-${a}-description`;
11
- let s;
12
- return D({
1
+ import { createComponent as n, Portal as z, setAttribute as c, spread as O, mergeProps as B, memo as D, insert as a, effect as x, className as A, template as s, use as E } from "solid-js/web";
2
+ import { createUniqueId as M, createMemo as R, Show as f } from "solid-js";
3
+ import { cn as C } from "../../utils/cn.js";
4
+ import { Button as $ } from "./Button.js";
5
+ import { X as F } from "../icons/index.js";
6
+ import { useResolvedFloeConfig as N } from "../../context/FloeConfigContext.js";
7
+ import { useOverlayMask as j } from "../../hooks/useOverlayMask.js";
8
+ import { resolveDialogSurfaceHost as H, DIALOG_SURFACE_BOUNDARY_ATTR as m } from "./dialogSurfaceScope.js";
9
+ var U = /* @__PURE__ */ s('<h2 class="text-sm font-semibold">'), P = /* @__PURE__ */ s('<p class="mt-0.5 text-xs text-muted-foreground">'), W = /* @__PURE__ */ s('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), q = /* @__PURE__ */ s('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), G = /* @__PURE__ */ s('<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">'), L = /* @__PURE__ */ s("<div>");
10
+ function X(e) {
11
+ const i = M(), _ = () => `dialog-${i}-title`, w = () => `dialog-${i}-description`;
12
+ let h;
13
+ const v = R(() => e.open ? H() : {
14
+ host: null,
15
+ mode: "global"
16
+ }), g = () => `dialog-boundary-${i}`, o = () => v().mode === "surface" && !!v().host?.isConnected, I = () => v().host ?? void 0, S = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${m}="${g()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${m}="${g()}"]`) : !1;
17
+ return j({
13
18
  open: () => e.open,
14
- root: () => s,
19
+ root: () => h,
20
+ containsTarget: (t) => o() && S(t),
15
21
  onClose: () => e.onOpenChange(!1),
16
- lockBodyScroll: !0,
22
+ lockBodyScroll: () => !o(),
17
23
  trapFocus: !0,
18
- closeOnEscape: !0,
24
+ closeOnEscape: () => o() ? "inside" : !0,
19
25
  blockHotkeys: !0,
20
26
  // Block scroll bleed outside the dialog while keeping the dialog content scrollable.
21
- blockWheel: "outside",
22
- blockTouchMove: "outside",
27
+ blockWheel: () => o() ? "none" : "outside",
28
+ blockTouchMove: () => o() ? "none" : "outside",
23
29
  restoreFocus: !0
24
- }), n(c, {
30
+ }), n(f, {
25
31
  get when() {
26
32
  return e.open;
27
33
  },
28
34
  get children() {
29
- return n(C, {
35
+ return n(z, {
36
+ get mount() {
37
+ return I();
38
+ },
30
39
  get children() {
31
- return [(() => {
32
- var r = I();
33
- return r.$$click = () => e.onOpenChange(!1), r;
34
- })(), (() => {
35
- var r = E(), h = r.firstChild, b = s;
36
- return typeof b == "function" ? k(b, r) : s = r, l(r, n(c, {
37
- get when() {
38
- return e.title || e.description;
39
- },
40
- get children() {
41
- var t = j(), d = t.firstChild;
42
- return l(d, n(c, {
43
- get when() {
44
- return e.title;
45
- },
46
- get children() {
47
- var i = F();
48
- return l(i, () => e.title), g(() => u(i, "id", m())), i;
49
- }
50
- }), null), l(d, n(c, {
51
- get when() {
52
- return e.description;
53
- },
54
- get children() {
55
- var i = T();
56
- return l(i, () => e.description), g(() => u(i, "id", v())), i;
57
- }
58
- }), null), l(t, n(f, {
59
- variant: "ghost-destructive",
60
- size: "icon",
61
- class: "h-6 w-6 -mr-1",
62
- onClick: () => e.onOpenChange(!1),
63
- "aria-label": "Close",
64
- get children() {
65
- return n(O, {
66
- class: "w-3.5 h-3.5"
67
- });
68
- }
69
- }), null), t;
70
- }
71
- }), h), l(h, () => e.children), l(r, n(c, {
72
- get when() {
73
- return e.footer;
74
- },
75
- get children() {
76
- var t = B();
77
- return l(t, () => e.footer), t;
78
- }
79
- }), null), g((t) => {
80
- var d = y("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2", "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), i = e.title ? m() : void 0, x = e.description ? v() : void 0;
81
- return d !== t.e && $(r, t.e = d), i !== t.t && u(r, "aria-labelledby", t.t = i), x !== t.a && u(r, "aria-describedby", t.a = x), t;
82
- }, {
83
- e: void 0,
84
- t: void 0,
85
- a: void 0
86
- }), r;
87
- })()];
40
+ var t = G(), b = t.firstChild, T = b.nextSibling, d = T.firstChild, y = d.firstChild;
41
+ c(t, "data-floe-dialog-overlay-root", i), c(b, "data-floe-dialog-backdrop", i), O(b, B(() => ({
42
+ [m]: g()
43
+ }), {
44
+ get class() {
45
+ return C("absolute inset-0 cursor-pointer animate-in fade-in", o() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
46
+ },
47
+ onClick: () => e.onOpenChange(!1)
48
+ }), !1, !1);
49
+ var k = h;
50
+ return typeof k == "function" ? E(k, d) : h = d, c(d, "data-floe-dialog-panel", i), O(d, B(() => ({
51
+ [m]: g()
52
+ }), {
53
+ get class() {
54
+ return C(o() ? "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);
55
+ },
56
+ role: "dialog",
57
+ get "aria-modal"() {
58
+ return o() ? void 0 : "true";
59
+ },
60
+ get "aria-labelledby"() {
61
+ return D(() => !!e.title)() ? _() : void 0;
62
+ },
63
+ get "aria-describedby"() {
64
+ return D(() => !!e.description)() ? w() : void 0;
65
+ },
66
+ tabIndex: -1
67
+ }), !1, !0), a(d, n(f, {
68
+ get when() {
69
+ return e.title || e.description;
70
+ },
71
+ get children() {
72
+ var r = W(), u = r.firstChild;
73
+ return a(u, n(f, {
74
+ get when() {
75
+ return e.title;
76
+ },
77
+ get children() {
78
+ var l = U();
79
+ return a(l, () => e.title), x(() => c(l, "id", _())), l;
80
+ }
81
+ }), null), a(u, n(f, {
82
+ get when() {
83
+ return e.description;
84
+ },
85
+ get children() {
86
+ var l = P();
87
+ return a(l, () => e.description), x(() => c(l, "id", w())), l;
88
+ }
89
+ }), null), a(r, n($, {
90
+ variant: "ghost-destructive",
91
+ size: "icon",
92
+ class: "h-6 w-6 -mr-1",
93
+ onClick: () => e.onOpenChange(!1),
94
+ "aria-label": "Close",
95
+ get children() {
96
+ return n(F, {
97
+ class: "w-3.5 h-3.5"
98
+ });
99
+ }
100
+ }), null), r;
101
+ }
102
+ }), y), a(y, () => e.children), a(d, n(f, {
103
+ get when() {
104
+ return e.footer;
105
+ },
106
+ get children() {
107
+ var r = q();
108
+ return a(r, () => e.footer), r;
109
+ }
110
+ }), null), x((r) => {
111
+ var u = o() ? "surface" : "global", l = C(o() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
112
+ return u !== r.e && c(t, "data-floe-dialog-mode", r.e = u), l !== r.t && A(t, r.t = l), r;
113
+ }, {
114
+ e: void 0,
115
+ t: void 0
116
+ }), t;
88
117
  }
89
118
  });
90
119
  }
91
120
  });
92
121
  }
93
- function W(e) {
94
- const a = z();
95
- return n(R, {
122
+ function te(e) {
123
+ const i = N();
124
+ return n(X, {
96
125
  get open() {
97
126
  return e.open;
98
127
  },
@@ -106,16 +135,16 @@ function W(e) {
106
135
  return e.description;
107
136
  },
108
137
  get footer() {
109
- return [n(f, {
138
+ return [n($, {
110
139
  variant: "ghost",
111
140
  onClick: () => e.onOpenChange(!1),
112
141
  get disabled() {
113
142
  return e.loading;
114
143
  },
115
144
  get children() {
116
- return e.cancelText ?? a.config.strings.confirmDialog.cancel;
145
+ return e.cancelText ?? i.config.strings.confirmDialog.cancel;
117
146
  }
118
- }), n(f, {
147
+ }), n($, {
119
148
  get variant() {
120
149
  return e.variant === "destructive" ? "destructive" : "primary";
121
150
  },
@@ -126,17 +155,16 @@ function W(e) {
126
155
  return e.loading;
127
156
  },
128
157
  get children() {
129
- return e.confirmText ?? a.config.strings.confirmDialog.confirm;
158
+ return e.confirmText ?? i.config.strings.confirmDialog.confirm;
130
159
  }
131
160
  })];
132
161
  },
133
162
  get children() {
134
- return e.children ?? M();
163
+ return e.children ?? L();
135
164
  }
136
165
  });
137
166
  }
138
- w(["click"]);
139
167
  export {
140
- W as ConfirmDialog,
141
- R as Dialog
168
+ te as ConfirmDialog,
169
+ X as Dialog
142
170
  };