@floegence/floe-webapp-core 0.36.38 → 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/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 +229 -201
- package/dist/components/workbench/workbenchEdgeAutoPan.d.ts +48 -0
- package/dist/components/workbench/workbenchEdgeAutoPan.js +134 -0
- package/package.json +1 -1
|
@@ -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;
|