@floegence/floe-webapp-core 0.36.37 → 0.36.39

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.
@@ -10,7 +10,7 @@ export { CommandPalette } from './CommandPalette';
10
10
  export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
11
11
  export { startPointerSession, type PointerSessionController, type PointerSessionEndEvent, type PointerSessionEndReason, type PointerSessionSnapshot, type StartPointerSessionOptions, } from './pointerSession';
12
12
  export { clientToCanvasLocal, clientToCanvasWorld, createViewportFromZoomAnchor, isPointInsideCanvasRect, localToCanvasWorld, type CanvasClientPoint, type CanvasLocalPoint, type CanvasViewportLike, type CanvasViewportRectLike, type CanvasWorldPoint, } from './canvasGeometry';
13
- 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
+ export { CANVAS_WHEEL_INTERACTIVE_ATTR, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR, LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_TEXT_SELECTION_SURFACE_ATTR, DEFAULT_WORKBENCH_TEXT_SELECTION_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, resolveWorkbenchWidgetTextSelectionTarget, resolveWorkbenchWidgetLocalTypingTarget, shouldActivateWorkbenchWidgetLocalTarget, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type SurfaceWheelLocalReason, type SurfaceWheelRoutingDecision, type SurfaceWheelRoutingOptions, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, type WorkbenchWidgetLocalActivationTargetOptions, } from './localInteractionSurface';
14
14
  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';
15
15
  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';
16
16
  export { Tabs, TabPanel, type TabsProps, type TabPanelProps, type TabItem, type TabsFeatures, type TabsSlotClassNames, type TabsIndicatorMode, type TabsIndicatorColorToken, } from './Tabs';
@@ -6,6 +6,8 @@ export declare const WORKBENCH_WIDGET_SHELL_ATTR = "data-floe-workbench-widget-s
6
6
  export declare const DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR = "[data-floe-workbench-widget-shell=\"true\"]";
7
7
  export declare const WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR = "data-floe-workbench-widget-activation-surface";
8
8
  export declare const DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR = "[data-floe-workbench-widget-activation-surface=\"true\"]";
9
+ export declare const WORKBENCH_TEXT_SELECTION_SURFACE_ATTR = "data-floe-workbench-text-selection-surface";
10
+ export declare const DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR = "[data-floe-workbench-text-selection-surface=\"true\"]";
9
11
  export type SurfaceInteractionTargetRole = 'canvas' | 'local_surface' | 'pan_surface';
10
12
  export type SurfaceWheelLocalReason = 'typing_element' | 'local_interaction_surface' | 'wheel_interactive';
11
13
  export type SurfaceWheelRoutingDecision = {
@@ -23,6 +25,7 @@ export interface SurfaceInteractionRoutingOptions {
23
25
  interactiveSelector: string;
24
26
  panSurfaceSelector: string;
25
27
  localInteractionSurfaceSelector?: string;
28
+ textSelectionSurfaceSelector?: string;
26
29
  }
27
30
  export interface WorkbenchWidgetEventOwnershipOptions extends SurfaceInteractionRoutingOptions {
28
31
  widgetRoot: Element | EventTarget | null;
@@ -42,4 +45,5 @@ export declare function resolveSurfaceWheelRouting(options: SurfaceWheelRoutingO
42
45
  export declare function isLocalInteractionSurfaceTarget(options: SurfaceInteractionRoutingOptions): boolean;
43
46
  export declare function resolveWorkbenchWidgetEventOwnership(options: WorkbenchWidgetEventOwnershipOptions): WorkbenchWidgetEventOwnership;
44
47
  export declare function shouldActivateWorkbenchWidgetLocalTarget(options: WorkbenchWidgetLocalActivationTargetOptions): boolean;
48
+ export declare function resolveWorkbenchWidgetTextSelectionTarget(options: WorkbenchWidgetLocalActivationTargetOptions): HTMLElement | null;
45
49
  export declare function resolveWorkbenchWidgetLocalTypingTarget(options: WorkbenchWidgetLocalActivationTargetOptions): HTMLElement | null;
@@ -1,94 +1,111 @@
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"]`;
1
+ import { isTypingElement as s } from "../../utils/dom.js";
2
+ const g = "data-floe-local-interaction-surface", i = `[${g}="true"]`, A = "data-floe-canvas-wheel-interactive", R = `[${A}="true"]`, m = "data-floe-workbench-widget-shell", f = `[${m}="true"]`, L = "data-floe-workbench-widget-activation-surface", S = `[${L}="true"]`, C = "data-floe-workbench-text-selection-surface", _ = `[${C}="true"]`;
3
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 R(e) {
6
+ function h(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 t = e.getAttribute("tabindex");
11
- return t !== null && t !== "-1";
10
+ const n = e.getAttribute("tabindex");
11
+ return n !== null && n !== "-1";
12
12
  }
13
- function h(e, t) {
14
- let r = e;
15
- for (; r && r !== t; ) {
16
- if (i(r) || R(r))
13
+ function w(e, n) {
14
+ let l = e;
15
+ for (; l && l !== n; ) {
16
+ if (s(l) || h(l))
17
17
  return !0;
18
- r = r.parentElement;
18
+ l = l.parentElement;
19
19
  }
20
20
  return !1;
21
21
  }
22
22
  function d(e) {
23
23
  const {
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";
24
+ target: n,
25
+ interactiveSelector: l,
26
+ panSurfaceSelector: o,
27
+ localInteractionSurfaceSelector: r = i,
28
+ textSelectionSurfaceSelector: a = _
29
+ } = e, t = n instanceof Element ? n : null;
30
+ return t ? t.closest(o) !== null ? "pan_surface" : s(t) || t.closest(l) !== null || t.closest(r) !== null || t.closest(a) !== null ? "local_surface" : "canvas" : "canvas";
30
31
  }
31
32
  function I(e) {
32
33
  const {
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;
34
+ target: n,
35
+ localInteractionSurfaceSelector: l = i,
36
+ wheelInteractiveSelector: o = R
37
+ } = e, r = u(n);
38
+ return r ? s(r) ? "typing_element" : r.closest(l) !== null ? "local_interaction_surface" : r.closest(o) !== null ? "wheel_interactive" : null : null;
38
39
  }
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" };
40
+ function O(e) {
41
+ const n = I(e);
42
+ return n ? { kind: "local_surface", reason: n } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
42
43
  }
43
- function C(e) {
44
+ function N(e) {
44
45
  return d(e) !== "canvas";
45
46
  }
46
- function E(e) {
47
+ function T(e) {
47
48
  const {
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";
49
+ widgetRoot: n,
50
+ shellSelector: l = f
51
+ } = e, o = u(n), r = u(e.target);
52
+ return !o || !r || !o.contains(r) ? "outside_widget" : d(e) !== "canvas" ? "widget_local" : r === o || r.closest(l) !== null ? "widget_shell" : "widget_local";
53
+ }
54
+ function b(e) {
55
+ const {
56
+ widgetRoot: n,
57
+ shellSelector: l = f,
58
+ localInteractionSurfaceSelector: o = i,
59
+ widgetActivationSurfaceSelector: r = S
60
+ } = e, a = u(n), t = u(e.target);
61
+ return !a || !t || !a.contains(t) || t === a || t.closest(l) !== null || t.closest(e.panSurfaceSelector) !== null || t.closest(o) !== null || v(e) !== null ? !1 : t.closest(r) !== null ? T(e) === "widget_local" : w(t, a) ? !1 : T(e) === "widget_local";
52
62
  }
53
63
  function v(e) {
54
64
  const {
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";
65
+ widgetRoot: n,
66
+ shellSelector: l = f,
67
+ localInteractionSurfaceSelector: o = i,
68
+ widgetActivationSurfaceSelector: r = S,
69
+ textSelectionSurfaceSelector: a = _
70
+ } = e, t = u(n), c = u(e.target);
71
+ if (!t || !c || !t.contains(c) || c === t || c.closest(l) !== null || c.closest(e.panSurfaceSelector) !== null)
72
+ return null;
73
+ const E = c.closest(a);
74
+ return E instanceof HTMLElement && t.contains(E) ? E : (c.closest(o) !== null || c.closest(r) !== null, null);
61
75
  }
62
- function W(e) {
76
+ function H(e) {
63
77
  const {
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)
78
+ widgetRoot: n,
79
+ shellSelector: l = f,
80
+ localInteractionSurfaceSelector: o = i,
81
+ widgetActivationSurfaceSelector: r = S
82
+ } = e, a = u(n), t = u(e.target);
83
+ if (!a || !t || !a.contains(t) || t === a || t.closest(l) !== null || t.closest(e.panSurfaceSelector) !== null || t.closest(o) !== null || t.closest(r) !== null)
70
84
  return null;
71
- let o = n;
72
- for (; o && o !== c; ) {
73
- if (o instanceof HTMLElement && i(o))
74
- return o;
75
- o = o.parentElement;
85
+ let c = t;
86
+ for (; c && c !== a; ) {
87
+ if (c instanceof HTMLElement && s(c))
88
+ return c;
89
+ c = c.parentElement;
76
90
  }
77
91
  return null;
78
92
  }
79
93
  export {
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,
94
+ A as CANVAS_WHEEL_INTERACTIVE_ATTR,
95
+ R as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
96
+ i as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
97
+ _ as DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR,
98
+ S as DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR,
84
99
  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,
100
+ g as LOCAL_INTERACTION_SURFACE_ATTR,
101
+ C as WORKBENCH_TEXT_SELECTION_SURFACE_ATTR,
102
+ L as WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR,
103
+ m as WORKBENCH_WIDGET_SHELL_ATTR,
104
+ N as isLocalInteractionSurfaceTarget,
89
105
  d as resolveSurfaceInteractionTargetRole,
90
- w as resolveSurfaceWheelRouting,
91
- E as resolveWorkbenchWidgetEventOwnership,
92
- W as resolveWorkbenchWidgetLocalTypingTarget,
93
- v as shouldActivateWorkbenchWidgetLocalTarget
106
+ O as resolveSurfaceWheelRouting,
107
+ T as resolveWorkbenchWidgetEventOwnership,
108
+ H as resolveWorkbenchWidgetLocalTypingTarget,
109
+ v as resolveWorkbenchWidgetTextSelectionTarget,
110
+ b as shouldActivateWorkbenchWidgetLocalTarget
94
111
  };
@@ -1,13 +1,13 @@
1
- import { use as I, insert as v, createComponent as a, effect as h, template as s } from "solid-js/web";
2
- import { createMemo as i, Show as R, For as W } from "solid-js";
3
- import { resolveWorkbenchInteractionAdapter as y } from "./workbenchInteractionAdapter.js";
4
- import { WorkbenchCanvasField as S } from "./WorkbenchCanvasField.js";
1
+ import { use as I, insert as w, createComponent as a, effect as S, template as f } from "solid-js/web";
2
+ import { createMemo as i, Show as h, For as R } from "solid-js";
3
+ import { resolveWorkbenchInteractionAdapter as W } from "./workbenchInteractionAdapter.js";
4
+ import { WorkbenchCanvasField as y } from "./WorkbenchCanvasField.js";
5
5
  import { WorkbenchWidget as F } from "./WorkbenchWidget.js";
6
- import { createWorkbenchRenderLayerMap as k, resolveWorkbenchWidgetRenderMode as w } from "./workbenchHelpers.js";
6
+ import { createWorkbenchRenderLayerMap as k, resolveWorkbenchWidgetRenderMode as v } from "./workbenchHelpers.js";
7
7
  import { getWidgetEntry as c } from "./widgets/widgetRegistry.js";
8
8
  import { InfiniteCanvas as L } from "../ui/InfiniteCanvas.js";
9
- var M = /* @__PURE__ */ s("<div class=workbench-canvas><div class=workbench-canvas__atmosphere aria-hidden=true>"), b = /* @__PURE__ */ s("<div class=workbench-canvas__projected-layer>");
10
- function q(e) {
9
+ var M = /* @__PURE__ */ f("<div class=workbench-canvas><div class=workbench-canvas__atmosphere aria-hidden=true>"), V = /* @__PURE__ */ f("<div class=workbench-canvas__projected-layer>");
10
+ function b(e) {
11
11
  const n = i((d) => {
12
12
  const g = e.widgetById().get(e.widgetId);
13
13
  if (g) return g;
@@ -65,6 +65,9 @@ function q(e) {
65
65
  return e.interactionAdapter;
66
66
  },
67
67
  layoutMode: "projected_surface",
68
+ get viewport() {
69
+ return e.projectedViewport();
70
+ },
68
71
  get projectedViewport() {
69
72
  return e.projectedViewport;
70
73
  },
@@ -89,6 +92,12 @@ function q(e) {
89
92
  get onCommitResize() {
90
93
  return e.onCommitResize;
91
94
  },
95
+ get onViewportCommit() {
96
+ return e.onViewportCommit;
97
+ },
98
+ get onViewportInteractionStart() {
99
+ return e.onViewportInteractionStart;
100
+ },
92
101
  get onRequestOverview() {
93
102
  return e.onRequestOverview;
94
103
  },
@@ -107,18 +116,18 @@ function q(e) {
107
116
  });
108
117
  }
109
118
  function A(e) {
110
- const n = i(() => y(e.interactionAdapter)), u = i(() => new Map(e.widgets.map((t) => [t.id, t]))), d = i(() => k(e.widgets)), g = i(() => e.widgets.filter((t) => {
119
+ const n = i(() => W(e.interactionAdapter)), u = i(() => new Map(e.widgets.map((t) => [t.id, t]))), d = i(() => k(e.widgets)), g = i(() => e.widgets.filter((t) => {
111
120
  const o = c(t.type, e.widgetDefinitions);
112
- return w(o) === "canvas_scaled";
121
+ return v(o) === "canvas_scaled";
113
122
  })), m = i(() => e.widgets.filter((t) => {
114
123
  const o = c(t.type, e.widgetDefinitions);
115
- return w(o) === "projected_surface";
116
- }).map((t) => t.id)), f = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0;
124
+ return v(o) === "projected_surface";
125
+ }).map((t) => t.id)), C = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0;
117
126
  return (() => {
118
127
  var t = M();
119
128
  t.firstChild;
120
129
  var o = e.setCanvasFrameRef;
121
- return typeof o == "function" ? I(o, t) : e.setCanvasFrameRef = t, v(t, a(L, {
130
+ return typeof o == "function" ? I(o, t) : e.setCanvasFrameRef = t, w(t, a(L, {
122
131
  ariaLabel: "Workbench canvas",
123
132
  class: "workbench-canvas__infinite",
124
133
  get viewport() {
@@ -150,18 +159,18 @@ function A(e) {
150
159
  get disablePanZoom() {
151
160
  return e.locked;
152
161
  },
153
- overlay: (r) => a(R, {
162
+ overlay: (r) => a(h, {
154
163
  get when() {
155
164
  return m().length > 0;
156
165
  },
157
166
  get children() {
158
- var l = b();
159
- return v(l, a(W, {
167
+ var l = V();
168
+ return w(l, a(R, {
160
169
  get each() {
161
170
  return m();
162
171
  },
163
- children: (C) => a(q, {
164
- widgetId: C,
172
+ children: (s) => a(b, {
173
+ widgetId: s,
165
174
  get widgetDefinitions() {
166
175
  return e.widgetDefinitions;
167
176
  },
@@ -229,20 +238,23 @@ function A(e) {
229
238
  },
230
239
  projectedViewport: r,
231
240
  get surfaceReady() {
232
- return f();
241
+ return C();
233
242
  }
234
243
  })
235
244
  })), l;
236
245
  }
237
246
  }),
238
247
  get children() {
239
- return a(S, {
248
+ return a(y, {
240
249
  get widgetDefinitions() {
241
250
  return e.widgetDefinitions;
242
251
  },
243
252
  get widgets() {
244
253
  return g();
245
254
  },
255
+ get viewport() {
256
+ return e.viewport;
257
+ },
246
258
  get selectedWidgetId() {
247
259
  return e.selectedWidgetId;
248
260
  },
@@ -279,6 +291,12 @@ function A(e) {
279
291
  get onCommitResize() {
280
292
  return e.onCommitResize;
281
293
  },
294
+ get onViewportCommit() {
295
+ return e.onViewportCommit;
296
+ },
297
+ get onViewportInteractionStart() {
298
+ return e.onViewportInteractionStart;
299
+ },
282
300
  get onRequestOverview() {
283
301
  return e.onRequestOverview;
284
302
  },
@@ -296,7 +314,7 @@ function A(e) {
296
314
  }
297
315
  });
298
316
  }
299
- }), null), h(() => t.classList.toggle("is-locked", !!e.locked)), t;
317
+ }), null), S(() => t.classList.toggle("is-locked", !!e.locked)), t;
300
318
  })();
301
319
  }
302
320
  export {
@@ -1,8 +1,9 @@
1
1
  import { type ResolvedWorkbenchInteractionAdapter } from './workbenchInteractionAdapter';
2
- import type { WorkbenchInteractionAdapter, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
2
+ import type { WorkbenchInteractionAdapter, WorkbenchViewport, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
3
3
  export interface WorkbenchCanvasFieldProps {
4
4
  widgetDefinitions: readonly WorkbenchWidgetDefinition[];
5
5
  widgets: readonly WorkbenchWidgetItem[];
6
+ viewport: WorkbenchViewport;
6
7
  selectedWidgetId: string | null;
7
8
  optimisticFrontWidgetId: string | null;
8
9
  viewportScale: number;
@@ -21,6 +22,8 @@ export interface WorkbenchCanvasFieldProps {
21
22
  width: number;
22
23
  height: number;
23
24
  }) => void;
25
+ onViewportCommit: (viewport: WorkbenchViewport) => void;
26
+ onViewportInteractionStart?: (kind: 'pan') => void;
24
27
  onRequestOverview: (item: WorkbenchWidgetItem) => void;
25
28
  onRequestFit: (item: WorkbenchWidgetItem) => void;
26
29
  onRequestDelete: (widgetId: string) => void;
@@ -1,20 +1,20 @@
1
- import { insert as a, createComponent as g, template as c } from "solid-js/web";
1
+ import { insert as a, createComponent as d, template as c } from "solid-js/web";
2
2
  import { createMemo as r, For as m } from "solid-js";
3
- import { resolveWorkbenchInteractionAdapter as l } from "./workbenchInteractionAdapter.js";
4
- import { createWorkbenchRenderLayerMap as w } from "./workbenchHelpers.js";
3
+ import { resolveWorkbenchInteractionAdapter as w } from "./workbenchInteractionAdapter.js";
4
+ import { createWorkbenchRenderLayerMap as l } from "./workbenchHelpers.js";
5
5
  import { getWidgetEntry as I } from "./widgets/widgetRegistry.js";
6
- import { WorkbenchWidget as y } from "./WorkbenchWidget.js";
7
- var v = /* @__PURE__ */ c("<div class=workbench-canvas__field><div class=workbench-canvas__grid aria-hidden=true>");
8
- function f(t) {
6
+ import { WorkbenchWidget as v } from "./WorkbenchWidget.js";
7
+ var y = /* @__PURE__ */ c("<div class=workbench-canvas__field><div class=workbench-canvas__grid aria-hidden=true>");
8
+ function C(t) {
9
9
  const e = r((i) => {
10
10
  const o = t.widgetById().get(t.widgetId);
11
11
  if (o) return o;
12
12
  if (i) return i;
13
13
  throw new Error(`Workbench widget ${t.widgetId} is missing from the render map.`);
14
- }), d = r(() => I(e().type, t.widgetDefinitions));
15
- return g(y, {
14
+ }), g = r(() => I(e().type, t.widgetDefinitions));
15
+ return d(v, {
16
16
  get definition() {
17
- return d();
17
+ return g();
18
18
  },
19
19
  get widgetId() {
20
20
  return t.widgetId;
@@ -62,6 +62,9 @@ function f(t) {
62
62
  get interactionAdapter() {
63
63
  return t.interactionAdapter;
64
64
  },
65
+ get viewport() {
66
+ return t.viewport;
67
+ },
65
68
  get onSelect() {
66
69
  return t.onSelectWidget;
67
70
  },
@@ -80,6 +83,12 @@ function f(t) {
80
83
  get onCommitResize() {
81
84
  return t.onCommitResize;
82
85
  },
86
+ get onViewportCommit() {
87
+ return t.onViewportCommit;
88
+ },
89
+ get onViewportInteractionStart() {
90
+ return t.onViewportInteractionStart;
91
+ },
83
92
  get onRequestOverview() {
84
93
  return t.onRequestOverview;
85
94
  },
@@ -97,15 +106,15 @@ function f(t) {
97
106
  }
98
107
  });
99
108
  }
100
- function s(t) {
101
- const e = r(() => l(t.interactionAdapter)), d = r(() => t.widgets.map((n) => n.id)), i = r(() => new Map(t.widgets.map((n) => [n.id, n]))), o = r(() => w(t.widgets));
109
+ function L(t) {
110
+ const e = r(() => w(t.interactionAdapter)), g = r(() => t.widgets.map((n) => n.id)), i = r(() => new Map(t.widgets.map((n) => [n.id, n]))), o = r(() => l(t.widgets));
102
111
  return (() => {
103
- var n = v();
104
- return n.firstChild, a(n, g(m, {
112
+ var n = y();
113
+ return n.firstChild, a(n, d(m, {
105
114
  get each() {
106
- return d();
115
+ return g();
107
116
  },
108
- children: (u) => g(f, {
117
+ children: (u) => d(C, {
109
118
  widgetId: u,
110
119
  get widgetDefinitions() {
111
120
  return t.widgetDefinitions;
@@ -115,6 +124,9 @@ function s(t) {
115
124
  },
116
125
  widgetById: i,
117
126
  renderLayers: o,
127
+ get viewport() {
128
+ return t.viewport;
129
+ },
118
130
  get selectedWidgetId() {
119
131
  return t.selectedWidgetId;
120
132
  },
@@ -151,6 +163,12 @@ function s(t) {
151
163
  get onCommitResize() {
152
164
  return t.onCommitResize;
153
165
  },
166
+ get onViewportCommit() {
167
+ return t.onViewportCommit;
168
+ },
169
+ get onViewportInteractionStart() {
170
+ return t.onViewportInteractionStart;
171
+ },
154
172
  get onRequestOverview() {
155
173
  return t.onRequestOverview;
156
174
  },
@@ -171,5 +189,5 @@ function s(t) {
171
189
  })();
172
190
  }
173
191
  export {
174
- s as WorkbenchCanvasField
192
+ L as WorkbenchCanvasField
175
193
  };
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
2
+ import type { WorkbenchViewport, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
3
3
  export interface WorkbenchFilterBarProps {
4
4
  widgetDefinitions: readonly WorkbenchWidgetDefinition[];
5
5
  widgets: readonly WorkbenchWidgetItem[];
@@ -13,5 +13,8 @@ export interface WorkbenchFilterBarProps {
13
13
  * new widget of that type. Coordinates are in client space (clientX/Y).
14
14
  */
15
15
  onCreateAt?: (type: WorkbenchWidgetType, clientX: number, clientY: number) => void;
16
+ viewport?: WorkbenchViewport;
17
+ onViewportCommit?: (viewport: WorkbenchViewport) => void;
18
+ onViewportInteractionStart?: (kind: 'pan') => void;
16
19
  }
17
20
  export declare function WorkbenchFilterBar(props: WorkbenchFilterBarProps): JSX.Element;