@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.
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/localInteractionSurface.d.ts +4 -0
- package/dist/components/ui/localInteractionSurface.js +77 -60
- package/dist/components/workbench/WorkbenchCanvas.js +38 -20
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +4 -1
- package/dist/components/workbench/WorkbenchCanvasField.js +34 -16
- package/dist/components/workbench/WorkbenchFilterBar.d.ts +4 -1
- package/dist/components/workbench/WorkbenchFilterBar.js +148 -123
- package/dist/components/workbench/WorkbenchSurface.js +25 -18
- package/dist/components/workbench/WorkbenchWidget.d.ts +3 -0
- package/dist/components/workbench/WorkbenchWidget.js +240 -203
- package/dist/components/workbench/workbenchEdgeAutoPan.d.ts +48 -0
- package/dist/components/workbench/workbenchEdgeAutoPan.js +134 -0
- package/dist/full.js +571 -568
- package/dist/styles.css +1 -1
- package/dist/ui.css +16 -0
- package/dist/ui.js +126 -123
- package/package.json +1 -1
|
@@ -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
|
|
2
|
-
const
|
|
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
|
|
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
|
|
11
|
-
return
|
|
10
|
+
const n = e.getAttribute("tabindex");
|
|
11
|
+
return n !== null && n !== "-1";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
for (;
|
|
16
|
-
if (
|
|
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
|
-
|
|
18
|
+
l = l.parentElement;
|
|
19
19
|
}
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
22
|
function d(e) {
|
|
23
23
|
const {
|
|
24
|
-
target:
|
|
25
|
-
interactiveSelector:
|
|
26
|
-
panSurfaceSelector:
|
|
27
|
-
localInteractionSurfaceSelector:
|
|
28
|
-
|
|
29
|
-
|
|
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:
|
|
34
|
-
localInteractionSurfaceSelector:
|
|
35
|
-
wheelInteractiveSelector:
|
|
36
|
-
} = e,
|
|
37
|
-
return
|
|
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
|
|
40
|
-
const
|
|
41
|
-
return
|
|
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
|
|
44
|
+
function N(e) {
|
|
44
45
|
return d(e) !== "canvas";
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function T(e) {
|
|
47
48
|
const {
|
|
48
|
-
widgetRoot:
|
|
49
|
-
shellSelector:
|
|
50
|
-
} = e,
|
|
51
|
-
return !
|
|
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:
|
|
56
|
-
shellSelector:
|
|
57
|
-
localInteractionSurfaceSelector:
|
|
58
|
-
widgetActivationSurfaceSelector:
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
76
|
+
function H(e) {
|
|
63
77
|
const {
|
|
64
|
-
widgetRoot:
|
|
65
|
-
shellSelector:
|
|
66
|
-
localInteractionSurfaceSelector:
|
|
67
|
-
widgetActivationSurfaceSelector:
|
|
68
|
-
} = e,
|
|
69
|
-
if (!
|
|
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
|
|
72
|
-
for (;
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
75
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_ as
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
v as
|
|
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
|
|
2
|
-
import { createMemo as i, Show as
|
|
3
|
-
import { resolveWorkbenchInteractionAdapter as
|
|
4
|
-
import { WorkbenchCanvasField as
|
|
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
|
|
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__ */
|
|
10
|
-
function
|
|
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(() =>
|
|
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
|
|
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
|
|
116
|
-
}).map((t) => t.id)),
|
|
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,
|
|
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(
|
|
162
|
+
overlay: (r) => a(h, {
|
|
154
163
|
get when() {
|
|
155
164
|
return m().length > 0;
|
|
156
165
|
},
|
|
157
166
|
get children() {
|
|
158
|
-
var l =
|
|
159
|
-
return
|
|
167
|
+
var l = V();
|
|
168
|
+
return w(l, a(R, {
|
|
160
169
|
get each() {
|
|
161
170
|
return m();
|
|
162
171
|
},
|
|
163
|
-
children: (
|
|
164
|
-
widgetId:
|
|
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
|
|
241
|
+
return C();
|
|
233
242
|
}
|
|
234
243
|
})
|
|
235
244
|
})), l;
|
|
236
245
|
}
|
|
237
246
|
}),
|
|
238
247
|
get children() {
|
|
239
|
-
return a(
|
|
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),
|
|
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
|
|
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
|
|
4
|
-
import { createWorkbenchRenderLayerMap as
|
|
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
|
|
7
|
-
var
|
|
8
|
-
function
|
|
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
|
-
}),
|
|
15
|
-
return
|
|
14
|
+
}), g = r(() => I(e().type, t.widgetDefinitions));
|
|
15
|
+
return d(v, {
|
|
16
16
|
get definition() {
|
|
17
|
-
return
|
|
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
|
|
101
|
-
const e = r(() =>
|
|
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 =
|
|
104
|
-
return n.firstChild, a(n,
|
|
112
|
+
var n = y();
|
|
113
|
+
return n.firstChild, a(n, d(m, {
|
|
105
114
|
get each() {
|
|
106
|
-
return
|
|
115
|
+
return g();
|
|
107
116
|
},
|
|
108
|
-
children: (u) =>
|
|
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
|
-
|
|
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;
|