@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
@@ -1,6 +1,7 @@
1
1
  import { type Accessor } from 'solid-js';
2
2
  export type OverlayScrollBlockMode = 'none' | 'outside' | 'all';
3
3
  export type OverlayEscapeCloseMode = 'none' | 'inside' | 'always';
4
+ type MaybeAccessor<T> = T | Accessor<T>;
4
5
  export interface UseOverlayMaskOptions {
5
6
  open: Accessor<boolean>;
6
7
  root: Accessor<HTMLElement | undefined>;
@@ -10,17 +11,17 @@ export interface UseOverlayMaskOptions {
10
11
  /** Optional alternate close path for Escape pressed outside the overlay surface. */
11
12
  onEscapeOutside?: () => void;
12
13
  /** Lock `document.body` scroll while the overlay is open (default: true). */
13
- lockBodyScroll?: boolean;
14
+ lockBodyScroll?: MaybeAccessor<boolean | undefined>;
14
15
  /** Prevent scroll via wheel events (default: none). */
15
- blockWheel?: OverlayScrollBlockMode;
16
+ blockWheel?: MaybeAccessor<OverlayScrollBlockMode | undefined>;
16
17
  /** Prevent scroll via touch-move events (default: none). */
17
- blockTouchMove?: OverlayScrollBlockMode;
18
+ blockTouchMove?: MaybeAccessor<OverlayScrollBlockMode | undefined>;
18
19
  /** Keep tab focus within the overlay root (default: true). */
19
- trapFocus?: boolean;
20
+ trapFocus?: MaybeAccessor<boolean | undefined>;
20
21
  /** Close on Escape and never leak to underlying window handlers (default: always). */
21
- closeOnEscape?: boolean | OverlayEscapeCloseMode;
22
+ closeOnEscape?: MaybeAccessor<boolean | OverlayEscapeCloseMode | undefined>;
22
23
  /** Stop bubbling keydown events to window-level hotkeys (default: true). */
23
- blockHotkeys?: boolean;
24
+ blockHotkeys?: MaybeAccessor<boolean | undefined>;
24
25
  /**
25
26
  * Allow a small set of global keybinds to continue bubbling to window-level handlers
26
27
  * while the overlay is focused. This is primarily used by floating overlays that must
@@ -28,10 +29,11 @@ export interface UseOverlayMaskOptions {
28
29
  */
29
30
  allowHotkeys?: readonly string[] | Accessor<readonly string[] | undefined>;
30
31
  /** Auto-focus on open (default: true). */
31
- autoFocus?: boolean | {
32
+ autoFocus?: MaybeAccessor<boolean | {
32
33
  selector?: string;
33
- };
34
+ } | undefined>;
34
35
  /** Restore focus to the previously active element on close (default: true). */
35
- restoreFocus?: boolean;
36
+ restoreFocus?: MaybeAccessor<boolean | undefined>;
36
37
  }
37
38
  export declare function useOverlayMask(options: UseOverlayMaskOptions): void;
39
+ export {};
@@ -1,50 +1,54 @@
1
- import { createEffect as T, onCleanup as O } from "solid-js";
2
- import { lockBodyStyle as M } from "../utils/bodyStyleLock.js";
3
- import { deferAfterPaint as k } from "../utils/defer.js";
4
- import { getFocusableElements as B, getFirstFocusableElement as D } from "../utils/focus.js";
5
- import { matchKeybind as F } from "../utils/keybind.js";
6
- function b(e) {
1
+ import { createEffect as K, onCleanup as I } from "solid-js";
2
+ import { lockBodyStyle as N } from "../utils/bodyStyleLock.js";
3
+ import { deferAfterPaint as B } from "../utils/defer.js";
4
+ import { getFocusableElements as q, getFirstFocusableElement as j } from "../utils/focus.js";
5
+ import { matchKeybind as x } from "../utils/keybind.js";
6
+ function M(e) {
7
7
  return typeof Node < "u" && e instanceof Node;
8
8
  }
9
- function i(e, c, r) {
10
- return r ? r(c) : !e || !b(c) ? !1 : e.contains(c);
9
+ function h(e, o, r) {
10
+ return r ? r(o) : !e || !M(o) ? !1 : e.contains(o);
11
11
  }
12
- function p(e, c, r, u) {
13
- return r === "none" ? !1 : r === "all" ? !0 : !i(e, c, u);
12
+ function F(e, o, r, s) {
13
+ return r === "none" ? !1 : r === "all" ? !0 : !h(e, o, s);
14
14
  }
15
- function C(e) {
15
+ function z(e) {
16
16
  return typeof e == "function" ? e() ?? [] : e ?? [];
17
17
  }
18
- function P(e, c) {
19
- for (const r of C(c)) {
20
- const u = r.trim();
21
- if (u && F(e, u))
18
+ function c(e, o) {
19
+ return typeof e == "function" ? e() ?? o : e ?? o;
20
+ }
21
+ function R(e, o) {
22
+ for (const r of z(o)) {
23
+ const s = r.trim();
24
+ if (s && x(e, s))
22
25
  return !0;
23
26
  }
24
27
  return !1;
25
28
  }
26
- function N(e) {
27
- const c = () => e.lockBodyScroll !== !1, r = () => e.trapFocus !== !1, u = () => e.closeOnEscape === !1 ? "none" : e.closeOnEscape === "inside" ? "inside" : e.closeOnEscape === "none" ? "none" : "always", w = () => e.blockHotkeys !== !1, g = () => e.restoreFocus !== !1;
28
- T(() => {
29
+ function Y(e) {
30
+ const o = () => c(e.lockBodyScroll, !0), r = () => c(e.trapFocus, !0), s = () => {
31
+ const a = c(e.closeOnEscape, !0);
32
+ return a === !1 ? "none" : a === "inside" ? "inside" : a === "none" ? "none" : "always";
33
+ }, O = () => c(e.blockHotkeys, !0), C = () => c(e.restoreFocus, !0), D = () => c(e.blockWheel, "none"), S = () => c(e.blockTouchMove, "none"), H = () => c(e.autoFocus, !0);
34
+ K(() => {
29
35
  if (!e.open() || typeof document > "u") return;
30
- const s = document.activeElement instanceof HTMLElement ? document.activeElement : null, L = c() ? M({ overflow: "hidden" }) : null;
31
- k(() => {
36
+ const a = o(), p = r(), l = s(), P = O(), W = C(), d = D(), m = S(), v = H(), y = document.activeElement instanceof HTMLElement ? document.activeElement : null, A = a ? N({ overflow: "hidden" }) : null;
37
+ B(() => {
32
38
  const t = e.root();
33
- if (!t) return;
34
- const n = e.autoFocus;
35
- if (n === !1) return;
36
- const o = typeof n == "object" ? n.selector : void 0, f = (o ? t.querySelector(o) : null) ?? t.querySelector("[data-floe-autofocus]") ?? D(t) ?? t;
39
+ if (!t || v === !1) return;
40
+ const n = typeof v == "object" ? v.selector : void 0, f = (n ? t.querySelector(n) : null) ?? t.querySelector("[data-floe-autofocus]") ?? j(t) ?? t;
37
41
  try {
38
42
  f.focus();
39
43
  } catch {
40
44
  }
41
45
  });
42
- const d = (t) => {
46
+ const E = (t) => {
43
47
  if (t.key !== "Tab") return;
44
48
  const n = e.root();
45
49
  if (!n) return;
46
- const o = B(n);
47
- if (!o.length) {
50
+ const u = q(n);
51
+ if (!u.length) {
48
52
  t.preventDefault();
49
53
  try {
50
54
  n.focus();
@@ -52,29 +56,27 @@ function N(e) {
52
56
  }
53
57
  return;
54
58
  }
55
- const a = o[0], f = o[o.length - 1], l = document.activeElement instanceof HTMLElement ? document.activeElement : null;
59
+ const f = u[0], T = u[u.length - 1], i = document.activeElement instanceof HTMLElement ? document.activeElement : null;
56
60
  if (t.shiftKey) {
57
- if (l === a || !l || !n.contains(l)) {
61
+ if (i === f || !i || !n.contains(i)) {
58
62
  t.preventDefault();
59
63
  try {
60
- f.focus();
64
+ T.focus();
61
65
  } catch {
62
66
  }
63
67
  }
64
- } else if (l === f) {
68
+ } else if (i === T) {
65
69
  t.preventDefault();
66
70
  try {
67
- a.focus();
71
+ f.focus();
68
72
  } catch {
69
73
  }
70
74
  }
71
- }, m = (t) => {
72
- if (t.key !== "Escape") return;
73
- const n = u();
74
- if (n === "none") return;
75
- const o = e.root(), a = i(o, b(t.target) ? t.target : document.activeElement, e.containsTarget);
76
- if (n === "inside") {
77
- if (a) {
75
+ }, k = (t) => {
76
+ if (t.key !== "Escape" || l === "none") return;
77
+ const n = e.root(), u = h(n, M(t.target) ? t.target : document.activeElement, e.containsTarget);
78
+ if (l === "inside") {
79
+ if (u) {
78
80
  t.preventDefault(), t.stopImmediatePropagation(), e.onClose?.();
79
81
  return;
80
82
  }
@@ -82,25 +84,25 @@ function N(e) {
82
84
  return;
83
85
  }
84
86
  t.preventDefault(), t.stopImmediatePropagation(), e.onClose?.();
85
- }, v = (t) => {
87
+ }, b = (t) => {
88
+ const n = e.root();
89
+ n && P && h(n, t.target, e.containsTarget) && (R(t, e.allowHotkeys) || t.stopPropagation());
90
+ }, w = (t) => {
86
91
  const n = e.root();
87
- n && w() && i(n, t.target, e.containsTarget) && (P(t, e.allowHotkeys) || t.stopPropagation());
88
- }, y = (t) => {
89
- const n = e.blockWheel ?? "none", o = e.root();
90
- p(o, t.target, n, e.containsTarget) && t.cancelable && t.preventDefault();
91
- }, h = (t) => {
92
+ F(n, t.target, d, e.containsTarget) && t.cancelable && t.preventDefault();
93
+ }, g = (t) => {
92
94
  t.stopPropagation();
93
- }, E = (t) => {
94
- const n = e.blockTouchMove ?? "none", o = e.root();
95
- p(o, t.target, n, e.containsTarget) && t.cancelable && t.preventDefault();
95
+ }, L = (t) => {
96
+ const n = e.root();
97
+ F(n, t.target, m, e.containsTarget) && t.cancelable && t.preventDefault();
96
98
  };
97
- r() && document.addEventListener("keydown", d, !0), u() !== "none" && window.addEventListener("keydown", m, !0), document.addEventListener("keydown", v), (e.blockWheel ?? "none") !== "none" && (document.addEventListener("wheel", y, { capture: !0, passive: !1 }), document.addEventListener("wheel", h)), (e.blockTouchMove ?? "none") !== "none" && document.addEventListener("touchmove", E, { capture: !0, passive: !1 }), O(() => {
98
- r() && document.removeEventListener("keydown", d, !0), u() !== "none" && window.removeEventListener("keydown", m, !0), document.removeEventListener("keydown", v), (e.blockWheel ?? "none") !== "none" && (document.removeEventListener("wheel", y, !0), document.removeEventListener("wheel", h)), (e.blockTouchMove ?? "none") !== "none" && document.removeEventListener("touchmove", E, !0), L?.(), g() && s && s.isConnected && k(() => {
99
+ p && document.addEventListener("keydown", E, !0), l !== "none" && window.addEventListener("keydown", k, !0), document.addEventListener("keydown", b), d !== "none" && (document.addEventListener("wheel", w, { capture: !0, passive: !1 }), document.addEventListener("wheel", g)), m !== "none" && document.addEventListener("touchmove", L, { capture: !0, passive: !1 }), I(() => {
100
+ p && document.removeEventListener("keydown", E, !0), l !== "none" && window.removeEventListener("keydown", k, !0), document.removeEventListener("keydown", b), d !== "none" && (document.removeEventListener("wheel", w, !0), document.removeEventListener("wheel", g)), m !== "none" && document.removeEventListener("touchmove", L, !0), A?.(), W && y && y.isConnected && B(() => {
99
101
  if (typeof document > "u") return;
100
102
  const t = document.activeElement;
101
103
  if (!(t && t !== document.body && t !== document.documentElement))
102
104
  try {
103
- s.focus();
105
+ y.focus();
104
106
  } catch {
105
107
  }
106
108
  });
@@ -108,5 +110,5 @@ function N(e) {
108
110
  });
109
111
  }
110
112
  export {
111
- N as useOverlayMask
113
+ Y as useOverlayMask
112
114
  };
package/dist/layout.js CHANGED
@@ -1,32 +1,37 @@
1
- import { ActivityBar as o } from "./components/layout/ActivityBar.js";
2
- import { BottomBar as a, BottomBarItem as m, StatusIndicator as i } from "./components/layout/BottomBar.js";
3
- import { KeepAliveStack as n } from "./components/layout/KeepAliveStack.js";
4
- import { MobileTabBar as x } from "./components/layout/MobileTabBar.js";
5
- import { Panel as d, PanelContent as B, PanelHeader as b } from "./components/layout/Panel.js";
6
- import { ResizeHandle as c } from "./components/layout/ResizeHandle.js";
7
- import { Shell as P } from "./components/layout/Shell.js";
8
- import { Sidebar as T, SidebarContent as u, SidebarItem as v, SidebarItemList as A, SidebarSection as C } from "./components/layout/Sidebar.js";
9
- import { SidebarPane as h } from "./components/layout/SidebarPane.js";
10
- import { TopBar as y } from "./components/layout/TopBar.js";
11
- import { TopBarIconButton as K } from "./components/layout/TopBarIconButton.js";
1
+ import { ActivityBar as r } from "./components/layout/ActivityBar.js";
2
+ import { BottomBar as a, BottomBarItem as i, StatusIndicator as p } from "./components/layout/BottomBar.js";
3
+ import { DisplayModePageShell as n } from "./components/layout/DisplayModePageShell.js";
4
+ import { DisplayModeSwitcher as l, sanitizeDisplayMode as x } from "./components/layout/DisplayModeSwitcher.js";
5
+ import { KeepAliveStack as S } from "./components/layout/KeepAliveStack.js";
6
+ import { MobileTabBar as b } from "./components/layout/MobileTabBar.js";
7
+ import { Panel as c, PanelContent as I, PanelHeader as P } from "./components/layout/Panel.js";
8
+ import { ResizeHandle as M } from "./components/layout/ResizeHandle.js";
9
+ import { Shell as D } from "./components/layout/Shell.js";
10
+ import { Sidebar as u, SidebarContent as v, SidebarItem as z, SidebarItemList as A, SidebarSection as C } from "./components/layout/Sidebar.js";
11
+ import { SidebarPane as g } from "./components/layout/SidebarPane.js";
12
+ import { TopBar as w } from "./components/layout/TopBar.js";
13
+ import { TopBarIconButton as L } from "./components/layout/TopBarIconButton.js";
12
14
  export {
13
- o as ActivityBar,
15
+ r as ActivityBar,
14
16
  a as BottomBar,
15
- m as BottomBarItem,
16
- n as KeepAliveStack,
17
- x as MobileTabBar,
18
- d as Panel,
19
- B as PanelContent,
20
- b as PanelHeader,
21
- c as ResizeHandle,
22
- P as Shell,
23
- T as Sidebar,
24
- u as SidebarContent,
25
- v as SidebarItem,
17
+ i as BottomBarItem,
18
+ n as DisplayModePageShell,
19
+ l as DisplayModeSwitcher,
20
+ S as KeepAliveStack,
21
+ b as MobileTabBar,
22
+ c as Panel,
23
+ I as PanelContent,
24
+ P as PanelHeader,
25
+ M as ResizeHandle,
26
+ D as Shell,
27
+ u as Sidebar,
28
+ v as SidebarContent,
29
+ z as SidebarItem,
26
30
  A as SidebarItemList,
27
- h as SidebarPane,
31
+ g as SidebarPane,
28
32
  C as SidebarSection,
29
- i as StatusIndicator,
30
- y as TopBar,
31
- K as TopBarIconButton
33
+ p as StatusIndicator,
34
+ w as TopBar,
35
+ L as TopBarIconButton,
36
+ x as sanitizeDisplayMode
32
37
  };