@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,20 +1,26 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { Motion as
|
|
4
|
-
import { easing as
|
|
5
|
-
import { Layers as
|
|
6
|
-
import { startHotInteraction as
|
|
7
|
-
import { startPointerSession as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { insert as f, createComponent as d, effect as O, setAttribute as P, template as A, Portal as R, setStyleProperty as B, delegateEvents as V } from "solid-js/web";
|
|
2
|
+
import { createSignal as $, onCleanup as G, createMemo as p, For as W, Show as M } from "solid-js";
|
|
3
|
+
import { Motion as S } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
4
|
+
import { easing as D, duration as L } from "../../utils/animations.js";
|
|
5
|
+
import { Layers as q, Plus as K } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as N } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as U } from "../ui/pointerSession.js";
|
|
8
|
+
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as H, createWorkbenchEdgeAutoPanController as z, frameFromElement as j } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
var J = /* @__PURE__ */ A("<button type=button class=workbench-dock__item>"), Q = /* @__PURE__ */ A('<div class=workbench-dock data-floe-canvas-interactive=true><button type=button class=workbench-dock__item aria-label="Show all widgets"></button><span class=workbench-dock__divider aria-hidden=true>'), Z = /* @__PURE__ */ A("<div class=workbench-dock-ghost aria-hidden=true><div class=workbench-dock-ghost__halo></div><div class=workbench-dock-ghost__card><div class=workbench-dock-ghost__icon></div><div class=workbench-dock-ghost__copy><div class=workbench-dock-ghost__title></div><div class=workbench-dock-ghost__hint><span>");
|
|
10
|
+
const F = 5, tt = ".workbench-dock";
|
|
11
|
+
function et(t, s) {
|
|
12
|
+
const l = document.querySelector(H);
|
|
13
|
+
if (!(l instanceof HTMLElement)) return !1;
|
|
14
|
+
const c = l.getBoundingClientRect();
|
|
15
|
+
return t >= c.left && t <= c.right && s >= c.top && s <= c.bottom;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
17
|
+
function nt(t, s) {
|
|
18
|
+
if (typeof document.elementFromPoint != "function") return !1;
|
|
19
|
+
const l = document.elementFromPoint(t, s);
|
|
20
|
+
return l instanceof Element && l.closest(tt) !== null;
|
|
21
|
+
}
|
|
22
|
+
function ot(t) {
|
|
23
|
+
const s = () => t.hoverOffset === -1 ? {
|
|
18
24
|
scale: 1.26,
|
|
19
25
|
y: -6,
|
|
20
26
|
x: 0
|
|
@@ -30,20 +36,20 @@ function j(t) {
|
|
|
30
36
|
scale: 1,
|
|
31
37
|
y: 0,
|
|
32
38
|
x: 0
|
|
33
|
-
},
|
|
39
|
+
}, l = () => t.hoverOffset === -1, c = (i) => {
|
|
34
40
|
i.button === 0 && t.onDragBegin(i, t.type, t.label, t.icon);
|
|
35
41
|
};
|
|
36
42
|
return (() => {
|
|
37
|
-
var i =
|
|
38
|
-
return i.$$pointerdown = c, i.addEventListener("pointerleave", () => t.onLeave()), i.addEventListener("pointerenter", () => t.onEnter()),
|
|
43
|
+
var i = J();
|
|
44
|
+
return i.$$pointerdown = c, i.addEventListener("pointerleave", () => t.onLeave()), i.addEventListener("pointerenter", () => t.onEnter()), f(i, d(S.span, {
|
|
39
45
|
class: "workbench-dock__tile",
|
|
40
46
|
get animate() {
|
|
41
|
-
return
|
|
47
|
+
return s();
|
|
42
48
|
},
|
|
43
49
|
get transition() {
|
|
44
50
|
return {
|
|
45
|
-
duration:
|
|
46
|
-
easing:
|
|
51
|
+
duration: L.fast,
|
|
52
|
+
easing: D.easeOut
|
|
47
53
|
};
|
|
48
54
|
},
|
|
49
55
|
get children() {
|
|
@@ -54,26 +60,26 @@ function j(t) {
|
|
|
54
60
|
});
|
|
55
61
|
})();
|
|
56
62
|
}
|
|
57
|
-
}), null),
|
|
63
|
+
}), null), f(i, d(S.span, {
|
|
58
64
|
class: "workbench-dock__tooltip",
|
|
59
65
|
get animate() {
|
|
60
66
|
return {
|
|
61
|
-
opacity:
|
|
62
|
-
y:
|
|
67
|
+
opacity: l() ? 1 : 0,
|
|
68
|
+
y: l() ? -6 : 0
|
|
63
69
|
};
|
|
64
70
|
},
|
|
65
71
|
get transition() {
|
|
66
72
|
return {
|
|
67
|
-
duration:
|
|
68
|
-
easing:
|
|
73
|
+
duration: L.fast,
|
|
74
|
+
easing: D.easeOut
|
|
69
75
|
};
|
|
70
76
|
},
|
|
71
77
|
get children() {
|
|
72
78
|
return t.label;
|
|
73
79
|
}
|
|
74
|
-
}), null),
|
|
75
|
-
var
|
|
76
|
-
return
|
|
80
|
+
}), null), O((n) => {
|
|
81
|
+
var u = !!t.active, v = !!l(), h = !!t.isDragging, _ = `${t.label} — click to solo, drag to canvas to create`, b = t.active;
|
|
82
|
+
return u !== n.e && i.classList.toggle("is-active", n.e = u), v !== n.t && i.classList.toggle("is-hovered", n.t = v), h !== n.a && i.classList.toggle("is-source-dragging", n.a = h), _ !== n.o && P(i, "aria-label", n.o = _), b !== n.i && P(i, "aria-pressed", n.i = b), n;
|
|
77
83
|
}, {
|
|
78
84
|
e: void 0,
|
|
79
85
|
t: void 0,
|
|
@@ -83,179 +89,198 @@ function j(t) {
|
|
|
83
89
|
}), i;
|
|
84
90
|
})();
|
|
85
91
|
}
|
|
86
|
-
function
|
|
87
|
-
const [
|
|
88
|
-
let n;
|
|
89
|
-
|
|
90
|
-
n?.stop({
|
|
92
|
+
function gt(t) {
|
|
93
|
+
const [s, l] = $(null), [c, i] = $(null);
|
|
94
|
+
let n, u, v = null;
|
|
95
|
+
G(() => {
|
|
96
|
+
u?.stop(), n?.stop({
|
|
91
97
|
reason: "manual_stop",
|
|
92
98
|
commit: !1
|
|
93
99
|
}), n = void 0, c()?.stopInteraction();
|
|
94
100
|
});
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
const h = p(() => t.widgetDefinitions.every((e) => t.filters[e.type])), _ = (e) => {
|
|
102
|
+
const o = s();
|
|
103
|
+
return o === null ? 0 : o === e ? -1 : o === e + 1 ? -2 : o === e - 1 ? 1 : 0;
|
|
104
|
+
}, b = () => {
|
|
105
|
+
u?.stop(), u = void 0, v = null;
|
|
106
|
+
}, E = () => {
|
|
107
|
+
!t.viewport || !t.onViewportCommit || (v = t.viewport, u?.stop(), u = z({
|
|
108
|
+
readFrame: () => {
|
|
109
|
+
const e = document.querySelector(H);
|
|
110
|
+
return e instanceof HTMLElement ? j(e) : null;
|
|
111
|
+
},
|
|
112
|
+
readViewport: () => v ?? t.viewport ?? null,
|
|
113
|
+
commitViewport: (e) => {
|
|
114
|
+
v = e, t.onViewportCommit?.(e);
|
|
115
|
+
},
|
|
116
|
+
onPanStart: () => t.onViewportInteractionStart?.("pan"),
|
|
117
|
+
shouldPan: () => {
|
|
118
|
+
const e = c();
|
|
119
|
+
return !!(e?.moved && e.overCanvas);
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
122
|
+
}, y = (e) => {
|
|
123
|
+
const o = c();
|
|
124
|
+
if (!o) return;
|
|
125
|
+
const r = !o.moved;
|
|
126
|
+
if (o.stopInteraction(), b(), i(null), n = void 0, r) {
|
|
127
|
+
t.onSoloFilter(o.type);
|
|
104
128
|
return;
|
|
105
129
|
}
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
130
|
+
e && o.overCanvas && t.onCreateAt?.(o.type, o.clientX, o.clientY);
|
|
131
|
+
}, g = (e, o, r, C) => {
|
|
132
|
+
e.preventDefault(), n?.stop({
|
|
109
133
|
reason: "manual_stop",
|
|
110
134
|
commit: !1
|
|
111
|
-
}), i({
|
|
112
|
-
type:
|
|
113
|
-
label:
|
|
114
|
-
icon:
|
|
115
|
-
pointerId:
|
|
116
|
-
startClientX:
|
|
117
|
-
startClientY:
|
|
118
|
-
clientX:
|
|
119
|
-
clientY:
|
|
135
|
+
}), E(), i({
|
|
136
|
+
type: o,
|
|
137
|
+
label: r,
|
|
138
|
+
icon: C,
|
|
139
|
+
pointerId: e.pointerId,
|
|
140
|
+
startClientX: e.clientX,
|
|
141
|
+
startClientY: e.clientY,
|
|
142
|
+
clientX: e.clientX,
|
|
143
|
+
clientY: e.clientY,
|
|
120
144
|
moved: !1,
|
|
121
145
|
overCanvas: !1,
|
|
122
|
-
stopInteraction:
|
|
146
|
+
stopInteraction: N({
|
|
123
147
|
kind: "drag",
|
|
124
148
|
cursor: "grabbing"
|
|
125
149
|
})
|
|
126
150
|
});
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
151
|
+
const m = (a) => {
|
|
152
|
+
let I = !1;
|
|
153
|
+
i((k) => {
|
|
154
|
+
if (!k || k.pointerId !== a.pointerId) return k;
|
|
155
|
+
const T = a.clientX - k.startClientX, x = a.clientY - k.startClientY, X = k.moved || Math.abs(T) > F || Math.abs(x) > F, Y = X && et(a.clientX, a.clientY) && !nt(a.clientX, a.clientY);
|
|
156
|
+
return I = Y, {
|
|
157
|
+
...k,
|
|
158
|
+
clientX: a.clientX,
|
|
159
|
+
clientY: a.clientY,
|
|
160
|
+
moved: X,
|
|
161
|
+
overCanvas: Y
|
|
137
162
|
};
|
|
138
|
-
});
|
|
163
|
+
}), I && u?.updatePointer(a.clientX, a.clientY);
|
|
139
164
|
};
|
|
140
|
-
n =
|
|
141
|
-
pointerEvent:
|
|
142
|
-
captureEl:
|
|
143
|
-
onMove:
|
|
165
|
+
n = U({
|
|
166
|
+
pointerEvent: e,
|
|
167
|
+
captureEl: e.currentTarget,
|
|
168
|
+
onMove: m,
|
|
144
169
|
onEnd: ({
|
|
145
|
-
commit:
|
|
146
|
-
}) =>
|
|
170
|
+
commit: a
|
|
171
|
+
}) => y(a)
|
|
147
172
|
});
|
|
148
|
-
},
|
|
173
|
+
}, w = () => c()?.type ?? null;
|
|
149
174
|
return [(() => {
|
|
150
|
-
var
|
|
151
|
-
return
|
|
175
|
+
var e = Q(), o = e.firstChild;
|
|
176
|
+
return o.nextSibling, e.addEventListener("pointerleave", () => l(null)), o.$$click = () => t.onShowAll(), o.addEventListener("pointerleave", () => l((r) => r === 0 ? null : r)), o.addEventListener("pointerenter", () => l(0)), f(o, d(S.span, {
|
|
152
177
|
class: "workbench-dock__tile",
|
|
153
178
|
get animate() {
|
|
154
179
|
return {
|
|
155
|
-
scale:
|
|
156
|
-
y:
|
|
157
|
-
x:
|
|
180
|
+
scale: s() === 0 ? 1.26 : 1,
|
|
181
|
+
y: s() === 0 ? -6 : 0,
|
|
182
|
+
x: s() === 1 ? -5 : 0
|
|
158
183
|
};
|
|
159
184
|
},
|
|
160
185
|
get transition() {
|
|
161
186
|
return {
|
|
162
|
-
duration:
|
|
163
|
-
easing:
|
|
187
|
+
duration: L.fast,
|
|
188
|
+
easing: D.easeOut
|
|
164
189
|
};
|
|
165
190
|
},
|
|
166
191
|
get children() {
|
|
167
|
-
return d(
|
|
192
|
+
return d(q, {
|
|
168
193
|
class: "workbench-dock__icon"
|
|
169
194
|
});
|
|
170
195
|
}
|
|
171
|
-
}), null),
|
|
196
|
+
}), null), f(o, d(S.span, {
|
|
172
197
|
class: "workbench-dock__tooltip",
|
|
173
198
|
get animate() {
|
|
174
199
|
return {
|
|
175
|
-
opacity:
|
|
176
|
-
y:
|
|
200
|
+
opacity: s() === 0 ? 1 : 0,
|
|
201
|
+
y: s() === 0 ? -6 : 0
|
|
177
202
|
};
|
|
178
203
|
},
|
|
179
204
|
get transition() {
|
|
180
205
|
return {
|
|
181
|
-
duration:
|
|
182
|
-
easing:
|
|
206
|
+
duration: L.fast,
|
|
207
|
+
easing: D.easeOut
|
|
183
208
|
};
|
|
184
209
|
},
|
|
185
210
|
children: "Show all widgets"
|
|
186
|
-
}), null),
|
|
211
|
+
}), null), f(e, d(W, {
|
|
187
212
|
get each() {
|
|
188
213
|
return t.widgetDefinitions;
|
|
189
214
|
},
|
|
190
|
-
children: (
|
|
191
|
-
const
|
|
192
|
-
return d(
|
|
215
|
+
children: (r, C) => {
|
|
216
|
+
const m = () => C() + 1;
|
|
217
|
+
return d(ot, {
|
|
193
218
|
get type() {
|
|
194
|
-
return
|
|
219
|
+
return r.type;
|
|
195
220
|
},
|
|
196
221
|
get label() {
|
|
197
|
-
return
|
|
222
|
+
return r.label;
|
|
198
223
|
},
|
|
199
224
|
get icon() {
|
|
200
|
-
return
|
|
225
|
+
return r.icon;
|
|
201
226
|
},
|
|
202
227
|
get active() {
|
|
203
|
-
return t.filters[
|
|
228
|
+
return t.filters[r.type];
|
|
204
229
|
},
|
|
205
230
|
get hoverOffset() {
|
|
206
|
-
return
|
|
231
|
+
return _(m());
|
|
207
232
|
},
|
|
208
233
|
get isDragging() {
|
|
209
|
-
return
|
|
234
|
+
return w() === r.type;
|
|
210
235
|
},
|
|
211
|
-
onEnter: () =>
|
|
212
|
-
onLeave: () =>
|
|
213
|
-
onSolo: () => t.onSoloFilter(
|
|
214
|
-
onDragBegin:
|
|
236
|
+
onEnter: () => l(m()),
|
|
237
|
+
onLeave: () => l((a) => a === m() ? null : a),
|
|
238
|
+
onSolo: () => t.onSoloFilter(r.type),
|
|
239
|
+
onDragBegin: g
|
|
215
240
|
});
|
|
216
241
|
}
|
|
217
|
-
}), null),
|
|
218
|
-
var
|
|
219
|
-
return
|
|
242
|
+
}), null), O((r) => {
|
|
243
|
+
var C = !!h(), m = s() === 0, a = h();
|
|
244
|
+
return C !== r.e && o.classList.toggle("is-active", r.e = C), m !== r.t && o.classList.toggle("is-hovered", r.t = m), a !== r.a && P(o, "aria-pressed", r.a = a), r;
|
|
220
245
|
}, {
|
|
221
246
|
e: void 0,
|
|
222
247
|
t: void 0,
|
|
223
248
|
a: void 0
|
|
224
|
-
}),
|
|
225
|
-
})(), d(
|
|
249
|
+
}), e;
|
|
250
|
+
})(), d(M, {
|
|
226
251
|
get when() {
|
|
227
252
|
return c()?.moved ?? !1;
|
|
228
253
|
},
|
|
229
254
|
get children() {
|
|
230
|
-
return d(
|
|
255
|
+
return d(rt, {
|
|
231
256
|
state: c
|
|
232
257
|
});
|
|
233
258
|
}
|
|
234
259
|
})];
|
|
235
260
|
}
|
|
236
|
-
function
|
|
237
|
-
const
|
|
261
|
+
function rt(t) {
|
|
262
|
+
const s = () => {
|
|
238
263
|
const n = t.state();
|
|
239
264
|
return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
240
|
-
},
|
|
241
|
-
return d(
|
|
265
|
+
}, l = () => t.state()?.overCanvas ?? !1, c = () => t.state()?.label ?? "", i = () => t.state()?.icon;
|
|
266
|
+
return d(R, {
|
|
242
267
|
get children() {
|
|
243
|
-
var n =
|
|
244
|
-
return
|
|
268
|
+
var n = Z(), u = n.firstChild, v = u.nextSibling, h = v.firstChild, _ = h.nextSibling, b = _.firstChild, E = b.nextSibling, y = E.firstChild;
|
|
269
|
+
return f(h, d(M, {
|
|
245
270
|
get when() {
|
|
246
271
|
return i();
|
|
247
272
|
},
|
|
248
|
-
children: (
|
|
249
|
-
const
|
|
250
|
-
return d(
|
|
273
|
+
children: (g) => {
|
|
274
|
+
const w = g();
|
|
275
|
+
return d(w, {
|
|
251
276
|
class: "w-4 h-4"
|
|
252
277
|
});
|
|
253
278
|
}
|
|
254
|
-
})),
|
|
279
|
+
})), f(b, c), f(E, d(K, {
|
|
255
280
|
class: "w-3 h-3"
|
|
256
|
-
}),
|
|
257
|
-
var
|
|
258
|
-
return
|
|
281
|
+
}), y), f(y, () => l() ? "Drop to create" : "Drag onto canvas"), O((g) => {
|
|
282
|
+
var w = !!l(), e = s();
|
|
283
|
+
return w !== g.e && n.classList.toggle("is-over-canvas", g.e = w), e !== g.t && B(n, "transform", g.t = e), g;
|
|
259
284
|
}, {
|
|
260
285
|
e: void 0,
|
|
261
286
|
t: void 0
|
|
@@ -263,7 +288,7 @@ function J(t) {
|
|
|
263
288
|
}
|
|
264
289
|
});
|
|
265
290
|
}
|
|
266
|
-
|
|
291
|
+
V(["pointerdown", "click"]);
|
|
267
292
|
export {
|
|
268
|
-
|
|
293
|
+
gt as WorkbenchFilterBar
|
|
269
294
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { use as _, spread as B, mergeProps as q, insert as m, createComponent as u, Portal as
|
|
2
|
-
import { createSignal as M, createMemo as w, untrack as W, createEffect as v, onCleanup as h, Show as
|
|
3
|
-
import { clientToCanvasWorld as
|
|
4
|
-
import { WorkbenchCanvas as
|
|
5
|
-
import { WorkbenchContextMenu as
|
|
1
|
+
import { use as _, spread as B, mergeProps as q, insert as m, createComponent as u, Portal as V, addEventListener as N, template as A, delegateEvents as z } from "solid-js/web";
|
|
2
|
+
import { createSignal as M, createMemo as w, untrack as W, createEffect as v, onCleanup as h, Show as H } from "solid-js";
|
|
3
|
+
import { clientToCanvasWorld as P } from "../ui/canvasGeometry.js";
|
|
4
|
+
import { WorkbenchCanvas as X } from "./WorkbenchCanvas.js";
|
|
5
|
+
import { WorkbenchContextMenu as $ } from "./WorkbenchContextMenu.js";
|
|
6
6
|
import { WorkbenchFilterBar as Y } from "./WorkbenchFilterBar.js";
|
|
7
7
|
import { WorkbenchHud as K } from "./WorkbenchHud.js";
|
|
8
8
|
import { WorkbenchLockButton as U } from "./WorkbenchLockButton.js";
|
|
@@ -52,7 +52,7 @@ function he(i) {
|
|
|
52
52
|
widget: a,
|
|
53
53
|
closeMenu: t.contextMenu.close
|
|
54
54
|
});
|
|
55
|
-
}),
|
|
55
|
+
}), I = w(() => {
|
|
56
56
|
const e = t.contextMenu.state();
|
|
57
57
|
if (!e) return;
|
|
58
58
|
const n = C(), r = n.filter((a) => a.kind === "action").length, o = n.filter((a) => a.kind === "separator").length;
|
|
@@ -62,7 +62,7 @@ function he(i) {
|
|
|
62
62
|
menuWidth: j,
|
|
63
63
|
menuHeight: J(r, o)
|
|
64
64
|
});
|
|
65
|
-
}),
|
|
65
|
+
}), b = (e, n, r) => {
|
|
66
66
|
const o = s(), a = o.findWidgetRoot(e), c = o.readWidgetId(a);
|
|
67
67
|
if (c) {
|
|
68
68
|
l(o.createWidgetInputOwner(c, n));
|
|
@@ -152,9 +152,9 @@ function he(i) {
|
|
|
152
152
|
const e = d();
|
|
153
153
|
if (!e) return;
|
|
154
154
|
const n = (o) => {
|
|
155
|
-
|
|
155
|
+
b(o.target, "pointer", "background_pointer");
|
|
156
156
|
}, r = (o) => {
|
|
157
|
-
|
|
157
|
+
b(o.target, "focus", "background_focus");
|
|
158
158
|
};
|
|
159
159
|
e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", r), h(() => {
|
|
160
160
|
e.removeEventListener("pointerdown", n, !0), e.removeEventListener("focusin", r);
|
|
@@ -199,7 +199,7 @@ function he(i) {
|
|
|
199
199
|
const r = d()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
|
|
200
200
|
if (!r) return null;
|
|
201
201
|
const o = r.getBoundingClientRect();
|
|
202
|
-
return
|
|
202
|
+
return P(o, t.viewport(), {
|
|
203
203
|
clientX: e,
|
|
204
204
|
clientY: n
|
|
205
205
|
});
|
|
@@ -220,7 +220,7 @@ function he(i) {
|
|
|
220
220
|
return t.theme();
|
|
221
221
|
},
|
|
222
222
|
tabIndex: -1
|
|
223
|
-
}), !1, !0), m(n, u(
|
|
223
|
+
}), !1, !0), m(n, u(X, {
|
|
224
224
|
get widgetDefinitions() {
|
|
225
225
|
return t.widgetDefinitions();
|
|
226
226
|
},
|
|
@@ -310,12 +310,19 @@ function he(i) {
|
|
|
310
310
|
get filters() {
|
|
311
311
|
return t.filters();
|
|
312
312
|
},
|
|
313
|
+
get viewport() {
|
|
314
|
+
return t.viewport();
|
|
315
|
+
},
|
|
313
316
|
get onSoloFilter() {
|
|
314
317
|
return t.filter.solo;
|
|
315
318
|
},
|
|
316
319
|
get onShowAll() {
|
|
317
320
|
return t.filter.showAll;
|
|
318
321
|
},
|
|
322
|
+
get onViewportCommit() {
|
|
323
|
+
return t.canvas.commitViewport;
|
|
324
|
+
},
|
|
325
|
+
onViewportInteractionStart: () => t.canvas.cancelViewportNavigation(),
|
|
319
326
|
onCreateAt: F
|
|
320
327
|
}), null), m(e, u(K, {
|
|
321
328
|
get scaleLabel() {
|
|
@@ -331,22 +338,22 @@ function he(i) {
|
|
|
331
338
|
return t.theme();
|
|
332
339
|
},
|
|
333
340
|
onSelectTheme: (r) => t.appearance.setTheme(r)
|
|
334
|
-
}), null), m(e, u(
|
|
341
|
+
}), null), m(e, u(H, {
|
|
335
342
|
get when() {
|
|
336
343
|
return t.contextMenu.state();
|
|
337
344
|
},
|
|
338
345
|
get children() {
|
|
339
|
-
return u(
|
|
346
|
+
return u(V, {
|
|
340
347
|
get children() {
|
|
341
348
|
return [(() => {
|
|
342
349
|
var r = te();
|
|
343
|
-
return
|
|
344
|
-
})(), u(
|
|
350
|
+
return N(r, "contextmenu", t.contextMenu.retarget, !0), r;
|
|
351
|
+
})(), u($, {
|
|
345
352
|
get x() {
|
|
346
|
-
return
|
|
353
|
+
return I()?.left ?? 0;
|
|
347
354
|
},
|
|
348
355
|
get y() {
|
|
349
|
-
return
|
|
356
|
+
return I()?.top ?? 0;
|
|
350
357
|
},
|
|
351
358
|
get items() {
|
|
352
359
|
return C();
|
|
@@ -358,7 +365,7 @@ function he(i) {
|
|
|
358
365
|
}), null), e;
|
|
359
366
|
})();
|
|
360
367
|
}
|
|
361
|
-
|
|
368
|
+
z(["contextmenu"]);
|
|
362
369
|
export {
|
|
363
370
|
he as WorkbenchSurface
|
|
364
371
|
};
|
|
@@ -22,6 +22,7 @@ export interface WorkbenchWidgetProps {
|
|
|
22
22
|
projectedViewport?: Accessor<WorkbenchViewport>;
|
|
23
23
|
surfaceReady?: boolean;
|
|
24
24
|
interactionAdapter?: WorkbenchInteractionAdapter | ResolvedWorkbenchInteractionAdapter;
|
|
25
|
+
viewport?: WorkbenchViewport;
|
|
25
26
|
onSelect: (widgetId: string) => void;
|
|
26
27
|
onContextMenu: (event: MouseEvent, item: WorkbenchWidgetItem) => void;
|
|
27
28
|
onStartOptimisticFront: (widgetId: string) => void;
|
|
@@ -34,6 +35,8 @@ export interface WorkbenchWidgetProps {
|
|
|
34
35
|
width: number;
|
|
35
36
|
height: number;
|
|
36
37
|
}) => void;
|
|
38
|
+
onViewportCommit?: (viewport: WorkbenchViewport) => void;
|
|
39
|
+
onViewportInteractionStart?: (kind: 'pan') => void;
|
|
37
40
|
onRequestOverview: (item: WorkbenchWidgetItem) => void;
|
|
38
41
|
onRequestFit: (item: WorkbenchWidgetItem) => void;
|
|
39
42
|
onRequestDelete: (widgetId: string) => void;
|