@floegence/floe-webapp-core 0.36.23 → 0.36.25

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.
@@ -9,7 +9,7 @@ export { CommandPalette } from './CommandPalette';
9
9
  export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
10
10
  export { startPointerSession, type PointerSessionController, type PointerSessionEndEvent, type PointerSessionEndReason, type PointerSessionSnapshot, type StartPointerSessionOptions, } from './pointerSession';
11
11
  export { clientToCanvasLocal, clientToCanvasWorld, createViewportFromZoomAnchor, isPointInsideCanvasRect, localToCanvasWorld, type CanvasClientPoint, type CanvasLocalPoint, type CanvasViewportLike, type CanvasViewportRectLike, type CanvasWorldPoint, } from './canvasGeometry';
12
- export { CANVAS_WHEEL_INTERACTIVE_ATTR, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR, LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveSurfaceWheelRouting, resolveWorkbenchWidgetEventOwnership, shouldActivateWorkbenchWidgetLocalTarget, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type SurfaceWheelLocalReason, type SurfaceWheelRoutingDecision, type SurfaceWheelRoutingOptions, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, type WorkbenchWidgetLocalActivationTargetOptions, } from './localInteractionSurface';
12
+ export { CANVAS_WHEEL_INTERACTIVE_ATTR, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR, LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR, DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveSurfaceWheelRouting, resolveWorkbenchWidgetEventOwnership, resolveWorkbenchWidgetLocalTypingTarget, shouldActivateWorkbenchWidgetLocalTarget, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type SurfaceWheelLocalReason, type SurfaceWheelRoutingDecision, type SurfaceWheelRoutingOptions, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, type WorkbenchWidgetLocalActivationTargetOptions, } from './localInteractionSurface';
13
13
  export { DIALOG_SURFACE_HOST_ATTR, SURFACE_PORTAL_HOST_ATTR, SURFACE_PORTAL_LAYER_ATTR, DIALOG_SURFACE_BOUNDARY_ATTR, ensureSurfacePortalInteractionTracking, isSurfacePortalMode, projectSurfacePortalPosition, projectSurfacePortalRect, resolveSurfacePortalBoundaryRect, resolveSurfacePortalHost, resolveSurfacePortalMount, resolveSurfacePortalMountRect, __resetSurfacePortalScopeForTests, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalInteractionSnapshot, type SurfacePortalMode, type SurfacePortalRect, } from './surfacePortalScope';
14
14
  export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Interactive3DCard, AnimatedBorderCard, NeonCard, MorphCard, type CardProps, type CardVariant, type CardHeaderProps, type CardTitleProps, type CardDescriptionProps, type CardContentProps, type CardFooterProps, type Interactive3DCardProps, type AnimatedBorderCardProps, type NeonCardProps, type MorphCardProps, } from './Card';
15
15
  export { Tabs, TabPanel, type TabsProps, type TabPanelProps, type TabItem, type TabsFeatures, type TabsSlotClassNames, type TabsIndicatorMode, type TabsIndicatorColorToken, } from './Tabs';
@@ -4,6 +4,8 @@ export declare const CANVAS_WHEEL_INTERACTIVE_ATTR = "data-floe-canvas-wheel-int
4
4
  export declare const DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR = "[data-floe-canvas-wheel-interactive=\"true\"]";
5
5
  export declare const WORKBENCH_WIDGET_SHELL_ATTR = "data-floe-workbench-widget-shell";
6
6
  export declare const DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR = "[data-floe-workbench-widget-shell=\"true\"]";
7
+ export declare const WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR = "data-floe-workbench-widget-activation-surface";
8
+ export declare const DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR = "[data-floe-workbench-widget-activation-surface=\"true\"]";
7
9
  export type SurfaceInteractionTargetRole = 'canvas' | 'local_surface' | 'pan_surface';
8
10
  export type SurfaceWheelLocalReason = 'typing_element' | 'local_interaction_surface' | 'wheel_interactive';
9
11
  export type SurfaceWheelRoutingDecision = {
@@ -26,7 +28,9 @@ export interface WorkbenchWidgetEventOwnershipOptions extends SurfaceInteraction
26
28
  widgetRoot: Element | EventTarget | null;
27
29
  shellSelector?: string;
28
30
  }
29
- export type WorkbenchWidgetLocalActivationTargetOptions = WorkbenchWidgetEventOwnershipOptions;
31
+ export interface WorkbenchWidgetLocalActivationTargetOptions extends WorkbenchWidgetEventOwnershipOptions {
32
+ widgetActivationSurfaceSelector?: string;
33
+ }
30
34
  export interface SurfaceWheelRoutingOptions {
31
35
  target: EventTarget | null;
32
36
  disablePanZoom: boolean;
@@ -1,90 +1,94 @@
1
- import { isTypingElement as u } from "../../utils/dom.js";
2
- const E = "data-floe-local-interaction-surface", i = `[${E}="true"]`, d = "data-floe-canvas-wheel-interactive", _ = `[${d}="true"]`, g = "data-floe-workbench-widget-shell", s = `[${g}="true"]`;
3
- function o(e) {
1
+ import { isTypingElement as i } from "../../utils/dom.js";
2
+ const T = "data-floe-local-interaction-surface", s = `[${T}="true"]`, S = "data-floe-canvas-wheel-interactive", g = `[${S}="true"]`, A = "data-floe-workbench-widget-shell", f = `[${A}="true"]`, m = "data-floe-workbench-widget-activation-surface", _ = `[${m}="true"]`;
3
+ function u(e) {
4
4
  return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
5
  }
6
- function T(e) {
6
+ function R(e) {
7
7
  if (!e || typeof HTMLElement > "u" || !(e instanceof HTMLElement))
8
8
  return !1;
9
9
  if (e.matches("button, input, select, textarea, summary") || e.matches("a[href], area[href]") || e.matches('iframe, [contenteditable="true"]')) return !0;
10
- const r = e.getAttribute("tabindex");
11
- return r !== null && r !== "-1";
10
+ const t = e.getAttribute("tabindex");
11
+ return t !== null && t !== "-1";
12
12
  }
13
- function S(e, r) {
14
- let l = e;
15
- for (; l && l !== r; ) {
16
- if (u(l) || T(l))
13
+ function h(e, t) {
14
+ let r = e;
15
+ for (; r && r !== t; ) {
16
+ if (i(r) || R(r))
17
17
  return !0;
18
- l = l.parentElement;
18
+ r = r.parentElement;
19
19
  }
20
20
  return !1;
21
21
  }
22
- function f(e) {
22
+ function d(e) {
23
23
  const {
24
- target: r,
25
- interactiveSelector: l,
26
- panSurfaceSelector: c,
27
- localInteractionSurfaceSelector: t = i
28
- } = e, n = r instanceof Element ? r : null;
29
- return n ? n.closest(c) !== null ? "pan_surface" : u(n) || n.closest(l) !== null || n.closest(t) !== null ? "local_surface" : "canvas" : "canvas";
24
+ target: t,
25
+ interactiveSelector: r,
26
+ panSurfaceSelector: a,
27
+ localInteractionSurfaceSelector: l = s
28
+ } = e, c = t instanceof Element ? t : null;
29
+ return c ? c.closest(a) !== null ? "pan_surface" : i(c) || c.closest(r) !== null || c.closest(l) !== null ? "local_surface" : "canvas" : "canvas";
30
30
  }
31
- function m(e) {
31
+ function I(e) {
32
32
  const {
33
- target: r,
34
- localInteractionSurfaceSelector: l = i,
35
- wheelInteractiveSelector: c = _
36
- } = e, t = o(r);
37
- return t ? u(t) ? "typing_element" : t.closest(l) !== null ? "local_interaction_surface" : t.closest(c) !== null ? "wheel_interactive" : null : null;
33
+ target: t,
34
+ localInteractionSurfaceSelector: r = s,
35
+ wheelInteractiveSelector: a = g
36
+ } = e, l = u(t);
37
+ return l ? i(l) ? "typing_element" : l.closest(r) !== null ? "local_interaction_surface" : l.closest(a) !== null ? "wheel_interactive" : null : null;
38
38
  }
39
- function R(e) {
40
- const r = m(e);
41
- return r ? { kind: "local_surface", reason: r } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
39
+ function w(e) {
40
+ const t = I(e);
41
+ return t ? { kind: "local_surface", reason: t } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
42
42
  }
43
- function A(e) {
44
- return f(e) !== "canvas";
43
+ function C(e) {
44
+ return d(e) !== "canvas";
45
45
  }
46
- function h(e) {
46
+ function E(e) {
47
47
  const {
48
- widgetRoot: r,
49
- shellSelector: l = s
50
- } = e, c = o(r), t = o(e.target);
51
- return !c || !t || !c.contains(t) ? "outside_widget" : f(e) !== "canvas" ? "widget_local" : t === c || t.closest(l) !== null ? "widget_shell" : "widget_local";
48
+ widgetRoot: t,
49
+ shellSelector: r = f
50
+ } = e, a = u(t), l = u(e.target);
51
+ return !a || !l || !a.contains(l) ? "outside_widget" : d(e) !== "canvas" ? "widget_local" : l === a || l.closest(r) !== null ? "widget_shell" : "widget_local";
52
52
  }
53
- function w(e) {
53
+ function v(e) {
54
54
  const {
55
- widgetRoot: r,
56
- shellSelector: l = s,
57
- localInteractionSurfaceSelector: c = i
58
- } = e, t = o(r), n = o(e.target);
59
- return !t || !n || !t.contains(n) || n === t || n.closest(l) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(c) !== null || S(n, t) ? !1 : h(e) === "widget_local";
55
+ widgetRoot: t,
56
+ shellSelector: r = f,
57
+ localInteractionSurfaceSelector: a = s,
58
+ widgetActivationSurfaceSelector: l = _
59
+ } = e, c = u(t), n = u(e.target);
60
+ return !c || !n || !c.contains(n) || n === c || n.closest(r) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(a) !== null ? !1 : n.closest(l) !== null ? E(e) === "widget_local" : h(n, c) ? !1 : E(e) === "widget_local";
60
61
  }
61
- function I(e) {
62
+ function W(e) {
62
63
  const {
63
- widgetRoot: r,
64
- shellSelector: l = s,
65
- localInteractionSurfaceSelector: c = i
66
- } = e, t = o(r), n = o(e.target);
67
- if (!t || !n || !t.contains(n) || n === t || n.closest(l) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(c) !== null)
64
+ widgetRoot: t,
65
+ shellSelector: r = f,
66
+ localInteractionSurfaceSelector: a = s,
67
+ widgetActivationSurfaceSelector: l = _
68
+ } = e, c = u(t), n = u(e.target);
69
+ if (!c || !n || !c.contains(n) || n === c || n.closest(r) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(a) !== null || n.closest(l) !== null)
68
70
  return null;
69
- let a = n;
70
- for (; a && a !== t; ) {
71
- if (a instanceof HTMLElement && u(a))
72
- return a;
73
- a = a.parentElement;
71
+ let o = n;
72
+ for (; o && o !== c; ) {
73
+ if (o instanceof HTMLElement && i(o))
74
+ return o;
75
+ o = o.parentElement;
74
76
  }
75
77
  return null;
76
78
  }
77
79
  export {
78
- d as CANVAS_WHEEL_INTERACTIVE_ATTR,
79
- _ as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
80
- i as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
81
- s as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
82
- E as LOCAL_INTERACTION_SURFACE_ATTR,
83
- g as WORKBENCH_WIDGET_SHELL_ATTR,
84
- A as isLocalInteractionSurfaceTarget,
85
- f as resolveSurfaceInteractionTargetRole,
86
- R as resolveSurfaceWheelRouting,
87
- h as resolveWorkbenchWidgetEventOwnership,
88
- I as resolveWorkbenchWidgetLocalTypingTarget,
89
- w as shouldActivateWorkbenchWidgetLocalTarget
80
+ S as CANVAS_WHEEL_INTERACTIVE_ATTR,
81
+ g as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
82
+ s as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
83
+ _ as DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR,
84
+ f as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
85
+ T as LOCAL_INTERACTION_SURFACE_ATTR,
86
+ m as WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR,
87
+ A as WORKBENCH_WIDGET_SHELL_ATTR,
88
+ C as isLocalInteractionSurfaceTarget,
89
+ d as resolveSurfaceInteractionTargetRole,
90
+ w as resolveSurfaceWheelRouting,
91
+ E as resolveWorkbenchWidgetEventOwnership,
92
+ W as resolveWorkbenchWidgetLocalTypingTarget,
93
+ v as shouldActivateWorkbenchWidgetLocalTarget
90
94
  };
@@ -1,173 +1,195 @@
1
- import { use as L, spread as O, mergeProps as T, insert as g, createComponent as d, Portal as _, addEventListener as B, template as S, delegateEvents as q } from "solid-js/web";
2
- import { createSignal as y, createMemo as m, untrack as h, createEffect as f, onCleanup as v, Show as z } from "solid-js";
3
- import { clientToCanvasWorld as $ } from "../ui/canvasGeometry.js";
4
- import { WorkbenchCanvas as V } from "./WorkbenchCanvas.js";
5
- import { WorkbenchContextMenu as N } from "./WorkbenchContextMenu.js";
6
- import { WorkbenchFilterBar as P } from "./WorkbenchFilterBar.js";
7
- import { WorkbenchHud as X } from "./WorkbenchHud.js";
8
- import { WorkbenchLockButton as Y } from "./WorkbenchLockButton.js";
9
- import { installWorkbenchContextMenuDismissListeners as H } from "./workbenchContextMenuDismiss.js";
10
- import { useWorkbenchModel as K } from "./useWorkbenchModel.js";
11
- import { resolveWorkbenchInteractionAdapter as U } from "./workbenchInteractionAdapter.js";
12
- var Z = /* @__PURE__ */ S("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), G = /* @__PURE__ */ S("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
13
- const j = "F1";
14
- function ue(i) {
15
- const t = K({
1
+ import { use as T, spread as _, mergeProps as B, insert as f, createComponent as u, Portal as q, addEventListener as z, template as A, delegateEvents as $ } from "solid-js/web";
2
+ import { createSignal as S, createMemo as w, untrack as h, createEffect as m, onCleanup as v, Show as V } from "solid-js";
3
+ import { clientToCanvasWorld as N } from "../ui/canvasGeometry.js";
4
+ import { WorkbenchCanvas as P } from "./WorkbenchCanvas.js";
5
+ import { WorkbenchContextMenu as H } from "./WorkbenchContextMenu.js";
6
+ import { WorkbenchFilterBar as X } from "./WorkbenchFilterBar.js";
7
+ import { WorkbenchHud as Y } from "./WorkbenchHud.js";
8
+ import { WorkbenchLockButton as K } from "./WorkbenchLockButton.js";
9
+ import { installWorkbenchContextMenuDismissListeners as U } from "./workbenchContextMenuDismiss.js";
10
+ import { useWorkbenchModel as Z } from "./useWorkbenchModel.js";
11
+ import { resolveWorkbenchInteractionAdapter as G } from "./workbenchInteractionAdapter.js";
12
+ var j = /* @__PURE__ */ A("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), J = /* @__PURE__ */ A("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
13
+ const Q = "F1";
14
+ function I(i) {
15
+ if (i)
16
+ try {
17
+ i.focus({
18
+ preventScroll: !0
19
+ });
20
+ } catch {
21
+ i.focus();
22
+ }
23
+ }
24
+ function ge(i) {
25
+ const t = Z({
16
26
  state: () => i.state(),
17
27
  setState: (e) => i.setState(e),
18
28
  widgetDefinitions: () => i.widgetDefinitions,
19
29
  onClose: () => {
20
30
  }
21
- }), [u, A] = y(null), a = m(() => U(i.interactionAdapter)), [W, w] = y(h(() => a().createInitialInputOwner())), p = m(() => {
31
+ }), [s, x] = S(null), a = w(() => G(i.interactionAdapter)), [p, l] = S(h(() => a().createInitialInputOwner())), W = w(() => {
22
32
  const e = i.launcherWidgetTypes;
23
33
  return !e || e.length <= 0 ? null : new Set(e);
24
- }), I = m(() => {
25
- const e = t.widgetDefinitions(), n = p();
26
- return n ? e.filter((r) => n.has(r.type)) : e;
27
- }), D = m(() => {
28
- const e = t.contextMenu.items(), n = p();
29
- return n ? e.filter((r) => {
30
- if (r.kind !== "action")
34
+ }), D = w(() => {
35
+ const e = t.widgetDefinitions(), r = W();
36
+ return r ? e.filter((n) => r.has(n.type)) : e;
37
+ }), E = w(() => {
38
+ const e = t.contextMenu.items(), r = W();
39
+ return r ? e.filter((n) => {
40
+ if (n.kind !== "action")
31
41
  return !0;
32
- const o = /^add-(.+)$/.exec(String(r.id ?? ""));
33
- return o ? n.has(o[1]) : !0;
42
+ const o = /^add-(.+)$/.exec(String(n.id ?? ""));
43
+ return o ? r.has(o[1]) : !0;
34
44
  }) : e;
35
- }), k = (e, n, r) => {
36
- const o = a(), c = o.findWidgetRoot(e), s = o.readWidgetId(c);
37
- if (s) {
38
- w(o.createWidgetInputOwner(s, n));
45
+ }), k = (e, r, n) => {
46
+ const o = a(), c = o.findWidgetRoot(e), d = o.readWidgetId(c);
47
+ if (d) {
48
+ l(o.createWidgetInputOwner(d, r));
39
49
  return;
40
50
  }
41
- const b = u();
42
- b && e instanceof Node && b.contains(e) && w(o.createCanvasInputOwner(r));
43
- }, x = () => {
44
- const e = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = t.viewport(), r = e?.getBoundingClientRect(), o = r?.width ?? 0, c = r?.height ?? 0;
51
+ const y = s();
52
+ y && e instanceof Node && y.contains(e) && l(o.createCanvasInputOwner(n));
53
+ }, b = (e = "selection_cleared") => {
54
+ const r = a(), n = s();
55
+ t.selection.clear(), l(r.createCanvasInputOwner(e)), queueMicrotask(() => {
56
+ if (!n || typeof document > "u") return;
57
+ const o = document.activeElement;
58
+ if (!(o instanceof HTMLElement) || !n.contains(o)) {
59
+ I(n);
60
+ return;
61
+ }
62
+ const c = r.findWidgetRoot(o);
63
+ I(n), c && document.activeElement === o && o.isConnected && o.blur();
64
+ });
65
+ }, R = () => {
66
+ const e = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), r = t.viewport(), n = e?.getBoundingClientRect(), o = n?.width ?? 0, c = n?.height ?? 0;
45
67
  return {
46
- worldX: o > 0 ? (o / 2 - n.x) / n.scale : 240,
47
- worldY: c > 0 ? (c / 2 - n.y) / n.scale : 180
68
+ worldX: o > 0 ? (o / 2 - r.x) / r.scale : 240,
69
+ worldY: c > 0 ? (c / 2 - r.y) / r.scale : 180
48
70
  };
49
- }, l = (e) => {
50
- const n = h(a), r = h(u);
71
+ }, g = (e) => {
72
+ const r = h(a), n = h(s);
51
73
  queueMicrotask(() => {
52
- n.focusWidgetElement(r, e), w(n.createWidgetInputOwner(e, "activation"));
74
+ r.focusWidgetElement(n, e), l(r.createWidgetInputOwner(e, "activation"));
53
75
  });
54
76
  }, M = (e) => {
55
- const n = t.navigation.fitWidget(e);
56
- l(n.id);
57
- }, R = (e) => {
58
- const n = t.navigation.overviewWidget(e);
59
- l(n.id);
77
+ const r = t.navigation.fitWidget(e);
78
+ g(r.id);
79
+ }, L = (e) => {
80
+ const r = t.navigation.overviewWidget(e);
81
+ g(r.id);
60
82
  };
61
- f(() => {
83
+ m(() => {
62
84
  i.onApiReady?.({
63
- ensureWidget: (e, n) => t.widgetActions.ensureWidget(e, n) ?? null,
64
- createWidget: (e, n) => {
65
- const r = x(), o = t.widgetActions.addWidgetAtCursor(e, n?.worldX ?? r.worldX, n?.worldY ?? r.worldY) ?? null;
66
- return o && n?.centerViewport !== !1 && t.navigation.centerOnWidget(o), o;
85
+ ensureWidget: (e, r) => t.widgetActions.ensureWidget(e, r) ?? null,
86
+ createWidget: (e, r) => {
87
+ const n = R(), o = t.widgetActions.addWidgetAtCursor(e, r?.worldX ?? n.worldX, r?.worldY ?? n.worldY) ?? null;
88
+ return o && r?.centerViewport !== !1 && t.navigation.centerOnWidget(o), o;
67
89
  },
68
- clearSelection: () => t.selection.clear(),
69
- focusWidget: (e, n) => {
70
- const r = t.navigation.focusWidget(e, n);
71
- return l(r.id), r;
90
+ clearSelection: () => b("selection_cleared"),
91
+ focusWidget: (e, r) => {
92
+ const n = t.navigation.focusWidget(e, r);
93
+ return g(n.id), n;
72
94
  },
73
95
  fitWidget: (e) => {
74
- const n = t.navigation.fitWidget(e);
75
- return l(n.id), n;
96
+ const r = t.navigation.fitWidget(e);
97
+ return g(r.id), r;
76
98
  },
77
99
  overviewWidget: (e) => {
78
- const n = t.navigation.overviewWidget(e);
79
- return l(n.id), n;
100
+ const r = t.navigation.overviewWidget(e);
101
+ return g(r.id), r;
80
102
  },
81
103
  findWidgetByType: (e) => t.queries.findWidgetByType(e),
82
104
  findWidgetById: (e) => t.queries.findWidgetById(e),
83
- updateWidgetTitle: (e, n) => {
84
- const r = String(e ?? "").trim(), o = String(n ?? "").trim();
85
- !r || !o || i.setState((c) => ({
105
+ updateWidgetTitle: (e, r) => {
106
+ const n = String(e ?? "").trim(), o = String(r ?? "").trim();
107
+ !n || !o || i.setState((c) => ({
86
108
  ...c,
87
- widgets: c.widgets.map((s) => s.id === r && s.title !== o ? {
88
- ...s,
109
+ widgets: c.widgets.map((d) => d.id === n && d.title !== o ? {
110
+ ...d,
89
111
  title: o
90
- } : s)
112
+ } : d)
91
113
  }));
92
114
  }
93
115
  }), v(() => {
94
116
  i.onApiReady?.(null);
95
117
  });
96
118
  });
97
- const C = () => i.lockShortcut === void 0 ? j : i.lockShortcut;
98
- f(() => {
119
+ const C = () => i.lockShortcut === void 0 ? Q : i.lockShortcut;
120
+ m(() => {
99
121
  if (typeof window > "u" || !t.contextMenu.state()) return;
100
- const e = H({
122
+ const e = U({
101
123
  ownerWindow: window,
102
124
  onDismiss: t.contextMenu.close
103
125
  });
104
126
  v(() => e());
105
- }), f(() => {
106
- const e = W();
127
+ }), m(() => {
128
+ const e = p();
107
129
  if (e.kind !== "widget") return;
108
- t.widgets().some((r) => r.id === e.widgetId) || w(a().createCanvasInputOwner("widget_removed"));
109
- }), f(() => {
110
- const e = u();
130
+ t.widgets().some((n) => n.id === e.widgetId) || l(a().createCanvasInputOwner("widget_removed"));
131
+ }), m(() => {
132
+ const e = s();
111
133
  if (!e) return;
112
- const n = (o) => {
134
+ const r = (o) => {
113
135
  k(o.target, "pointer", "background_pointer");
114
- }, r = (o) => {
136
+ }, n = (o) => {
115
137
  k(o.target, "focus", "background_focus");
116
138
  };
117
- e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", r), v(() => {
118
- e.removeEventListener("pointerdown", n, !0), e.removeEventListener("focusin", r);
139
+ e.addEventListener("pointerdown", r, !0), e.addEventListener("focusin", n), v(() => {
140
+ e.removeEventListener("pointerdown", r, !0), e.removeEventListener("focusin", n);
119
141
  });
120
- }), f(() => {
142
+ }), m(() => {
121
143
  if (i.enableKeyboard === !1 || typeof document > "u") return;
122
- const e = C(), n = (r) => {
123
- if (!(r.defaultPrevented || r.isComposing)) {
124
- if (e !== null && r.key === e) {
125
- r.preventDefault(), t.lock.toggle();
144
+ const e = C(), r = (n) => {
145
+ if (!(n.defaultPrevented || n.isComposing)) {
146
+ if (e !== null && n.key === e) {
147
+ n.preventDefault(), t.lock.toggle();
126
148
  return;
127
149
  }
128
150
  if (!a().shouldBypassGlobalHotkeys({
129
- root: u(),
130
- target: r.target,
131
- owner: W(),
151
+ root: s(),
152
+ target: n.target,
153
+ owner: p(),
132
154
  interactiveSelector: a().interactiveSelector
133
155
  }))
134
- switch (r.key) {
156
+ switch (n.key) {
135
157
  case "ArrowUp":
136
- r.preventDefault(), t.navigation.handleArrowNavigation("up");
158
+ n.preventDefault(), t.navigation.handleArrowNavigation("up");
137
159
  break;
138
160
  case "ArrowDown":
139
- r.preventDefault(), t.navigation.handleArrowNavigation("down");
161
+ n.preventDefault(), t.navigation.handleArrowNavigation("down");
140
162
  break;
141
163
  case "ArrowLeft":
142
- r.preventDefault(), t.navigation.handleArrowNavigation("left");
164
+ n.preventDefault(), t.navigation.handleArrowNavigation("left");
143
165
  break;
144
166
  case "ArrowRight":
145
- r.preventDefault(), t.navigation.handleArrowNavigation("right");
167
+ n.preventDefault(), t.navigation.handleArrowNavigation("right");
146
168
  break;
147
169
  case "Delete":
148
170
  case "Backspace":
149
- t.selectedWidgetId() && (r.preventDefault(), t.widgetActions.deleteSelected());
171
+ t.selectedWidgetId() && (n.preventDefault(), t.widgetActions.deleteSelected());
150
172
  break;
151
173
  }
152
174
  }
153
175
  };
154
- document.addEventListener("keydown", n, !0), v(() => document.removeEventListener("keydown", n, !0));
176
+ document.addEventListener("keydown", r, !0), v(() => document.removeEventListener("keydown", r, !0));
155
177
  });
156
- const E = (e, n) => {
157
- const r = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
158
- if (!r) return null;
159
- const o = r.getBoundingClientRect();
160
- return $(o, t.viewport(), {
178
+ const F = (e, r) => {
179
+ const n = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
180
+ if (!n) return null;
181
+ const o = n.getBoundingClientRect();
182
+ return N(o, t.viewport(), {
161
183
  clientX: e,
162
- clientY: n
184
+ clientY: r
163
185
  });
164
- }, F = (e, n, r) => {
165
- const o = E(n, r);
186
+ }, O = (e, r, n) => {
187
+ const o = F(r, n);
166
188
  o && t.widgetActions.addWidgetAtCursor(e, o.worldX, o.worldY);
167
189
  };
168
190
  return (() => {
169
- var e = G(), n = e.firstChild;
170
- return L(A, e), O(e, T({
191
+ var e = J(), r = e.firstChild;
192
+ return T(x, e), _(e, B({
171
193
  get class() {
172
194
  return `workbench-surface${i.class ? ` ${i.class}` : ""}`;
173
195
  }
@@ -176,8 +198,9 @@ function ue(i) {
176
198
  }), {
177
199
  get "data-workbench-theme"() {
178
200
  return t.theme();
179
- }
180
- }), !1, !0), g(n, d(V, {
201
+ },
202
+ tabIndex: -1
203
+ }), !1, !0), f(r, u(P, {
181
204
  get widgetDefinitions() {
182
205
  return t.widgetDefinitions();
183
206
  },
@@ -217,9 +240,7 @@ function ue(i) {
217
240
  get onCanvasContextMenu() {
218
241
  return t.canvas.openCanvasContextMenu;
219
242
  },
220
- get onCanvasPointerDown() {
221
- return t.selection.clear;
222
- },
243
+ onCanvasPointerDown: () => b("background_pointer"),
223
244
  get onSelectWidget() {
224
245
  return t.canvas.selectWidget;
225
246
  },
@@ -238,7 +259,7 @@ function ue(i) {
238
259
  get onCommitResize() {
239
260
  return t.canvas.commitResize;
240
261
  },
241
- onRequestOverview: R,
262
+ onRequestOverview: L,
242
263
  onRequestFit: M,
243
264
  get onRequestDelete() {
244
265
  return i.onRequestDelete ?? t.widgetActions.deleteWidget;
@@ -249,7 +270,7 @@ function ue(i) {
249
270
  get onLayoutInteractionEnd() {
250
271
  return i.onLayoutInteractionEnd;
251
272
  }
252
- })), g(e, d(Y, {
273
+ })), f(e, u(K, {
253
274
  get locked() {
254
275
  return t.locked();
255
276
  },
@@ -259,9 +280,9 @@ function ue(i) {
259
280
  get shortcutLabel() {
260
281
  return C() ?? void 0;
261
282
  }
262
- }), null), g(e, d(P, {
283
+ }), null), f(e, u(X, {
263
284
  get widgetDefinitions() {
264
- return I();
285
+ return D();
265
286
  },
266
287
  get widgets() {
267
288
  return t.widgets();
@@ -275,8 +296,8 @@ function ue(i) {
275
296
  get onShowAll() {
276
297
  return t.filter.showAll;
277
298
  },
278
- onCreateAt: F
279
- }), null), g(e, d(X, {
299
+ onCreateAt: O
300
+ }), null), f(e, u(Y, {
280
301
  get scaleLabel() {
281
302
  return t.scaleLabel();
282
303
  },
@@ -289,18 +310,18 @@ function ue(i) {
289
310
  get activeTheme() {
290
311
  return t.theme();
291
312
  },
292
- onSelectTheme: (r) => t.appearance.setTheme(r)
293
- }), null), g(e, d(z, {
313
+ onSelectTheme: (n) => t.appearance.setTheme(n)
314
+ }), null), f(e, u(V, {
294
315
  get when() {
295
316
  return t.contextMenu.state();
296
317
  },
297
318
  get children() {
298
- return d(_, {
319
+ return u(q, {
299
320
  get children() {
300
321
  return [(() => {
301
- var r = Z();
302
- return B(r, "contextmenu", t.contextMenu.retarget, !0), r;
303
- })(), d(N, {
322
+ var n = j();
323
+ return z(n, "contextmenu", t.contextMenu.retarget, !0), n;
324
+ })(), u(H, {
304
325
  get x() {
305
326
  return t.contextMenu.position()?.left ?? 0;
306
327
  },
@@ -308,7 +329,7 @@ function ue(i) {
308
329
  return t.contextMenu.position()?.top ?? 0;
309
330
  },
310
331
  get items() {
311
- return D();
332
+ return E();
312
333
  }
313
334
  })];
314
335
  }
@@ -317,7 +338,7 @@ function ue(i) {
317
338
  }), null), e;
318
339
  })();
319
340
  }
320
- q(["contextmenu"]);
341
+ $(["contextmenu"]);
321
342
  export {
322
- ue as WorkbenchSurface
343
+ ge as WorkbenchSurface
323
344
  };