@floegence/floe-webapp-core 0.36.38 → 0.36.40
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 +171 -125
- 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 +56 -0
- package/dist/components/workbench/workbenchEdgeAutoPan.js +127 -0
- package/package.json +1 -1
|
@@ -1,20 +1,45 @@
|
|
|
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
|
-
return t >= c.left && t <= c.right && l >= c.top && l <= c.bottom;
|
|
1
|
+
import { insert as _, createComponent as d, effect as M, setAttribute as I, template as X, Portal as K, setStyleProperty as N, delegateEvents as U } from "solid-js/web";
|
|
2
|
+
import { createSignal as R, onCleanup as q, createMemo as z, For as j, Show as x } from "solid-js";
|
|
3
|
+
import { Motion as D } 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 L, duration as P } from "../../utils/animations.js";
|
|
5
|
+
import { Layers as J, Plus as Q } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as Z } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as tt } from "../ui/pointerSession.js";
|
|
8
|
+
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as B, createWorkbenchEdgeAutoPanController as et, frameFromElement as nt } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
var ot = /* @__PURE__ */ X("<button type=button class=workbench-dock__item>"), rt = /* @__PURE__ */ X('<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>'), it = /* @__PURE__ */ X("<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 H = 5, at = ".workbench-dock";
|
|
11
|
+
function V() {
|
|
12
|
+
const t = document.querySelector(B);
|
|
13
|
+
return t instanceof HTMLElement ? t.getBoundingClientRect() : null;
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
15
|
+
function A(t, a, r) {
|
|
16
|
+
return t >= r.left && t <= r.right && a >= r.top && a <= r.bottom;
|
|
17
|
+
}
|
|
18
|
+
function lt(t, a) {
|
|
19
|
+
const r = V();
|
|
20
|
+
return r ? A(t, a, r) : !1;
|
|
21
|
+
}
|
|
22
|
+
function st(t, a, r, u) {
|
|
23
|
+
const o = V();
|
|
24
|
+
if (!o) return !1;
|
|
25
|
+
if (A(t, a, o) || A(r, u, o))
|
|
26
|
+
return !0;
|
|
27
|
+
const n = r - t, c = u - a;
|
|
28
|
+
let v = 0, g = 1;
|
|
29
|
+
const f = (h, E) => {
|
|
30
|
+
if (h === 0) return E >= 0;
|
|
31
|
+
const m = E / h;
|
|
32
|
+
return h < 0 ? m > g ? !1 : (m > v && (v = m), !0) : m < v ? !1 : (m < g && (g = m), !0);
|
|
33
|
+
};
|
|
34
|
+
return f(-n, t - o.left) && f(n, o.right - t) && f(-c, a - o.top) && f(c, o.bottom - a);
|
|
35
|
+
}
|
|
36
|
+
function T(t, a) {
|
|
37
|
+
if (typeof document.elementFromPoint != "function") return !1;
|
|
38
|
+
const r = document.elementFromPoint(t, a);
|
|
39
|
+
return r instanceof Element && r.closest(at) !== null;
|
|
40
|
+
}
|
|
41
|
+
function ct(t) {
|
|
42
|
+
const a = () => t.hoverOffset === -1 ? {
|
|
18
43
|
scale: 1.26,
|
|
19
44
|
y: -6,
|
|
20
45
|
x: 0
|
|
@@ -30,20 +55,20 @@ function j(t) {
|
|
|
30
55
|
scale: 1,
|
|
31
56
|
y: 0,
|
|
32
57
|
x: 0
|
|
33
|
-
},
|
|
34
|
-
|
|
58
|
+
}, r = () => t.hoverOffset === -1, u = (o) => {
|
|
59
|
+
o.button === 0 && t.onDragBegin(o, t.type, t.label, t.icon);
|
|
35
60
|
};
|
|
36
61
|
return (() => {
|
|
37
|
-
var
|
|
38
|
-
return
|
|
62
|
+
var o = ot();
|
|
63
|
+
return o.$$pointerdown = u, o.addEventListener("pointerleave", () => t.onLeave()), o.addEventListener("pointerenter", () => t.onEnter()), _(o, d(D.span, {
|
|
39
64
|
class: "workbench-dock__tile",
|
|
40
65
|
get animate() {
|
|
41
|
-
return
|
|
66
|
+
return a();
|
|
42
67
|
},
|
|
43
68
|
get transition() {
|
|
44
69
|
return {
|
|
45
|
-
duration:
|
|
46
|
-
easing:
|
|
70
|
+
duration: P.fast,
|
|
71
|
+
easing: L.easeOut
|
|
47
72
|
};
|
|
48
73
|
},
|
|
49
74
|
get children() {
|
|
@@ -54,208 +79,229 @@ function j(t) {
|
|
|
54
79
|
});
|
|
55
80
|
})();
|
|
56
81
|
}
|
|
57
|
-
}), null),
|
|
82
|
+
}), null), _(o, d(D.span, {
|
|
58
83
|
class: "workbench-dock__tooltip",
|
|
59
84
|
get animate() {
|
|
60
85
|
return {
|
|
61
|
-
opacity:
|
|
62
|
-
y:
|
|
86
|
+
opacity: r() ? 1 : 0,
|
|
87
|
+
y: r() ? -6 : 0
|
|
63
88
|
};
|
|
64
89
|
},
|
|
65
90
|
get transition() {
|
|
66
91
|
return {
|
|
67
|
-
duration:
|
|
68
|
-
easing:
|
|
92
|
+
duration: P.fast,
|
|
93
|
+
easing: L.easeOut
|
|
69
94
|
};
|
|
70
95
|
},
|
|
71
96
|
get children() {
|
|
72
97
|
return t.label;
|
|
73
98
|
}
|
|
74
|
-
}), null),
|
|
75
|
-
var
|
|
76
|
-
return
|
|
99
|
+
}), null), M((n) => {
|
|
100
|
+
var c = !!t.active, v = !!r(), g = !!t.isDragging, f = `${t.label} — click to solo, drag to canvas to create`, h = t.active;
|
|
101
|
+
return c !== n.e && o.classList.toggle("is-active", n.e = c), v !== n.t && o.classList.toggle("is-hovered", n.t = v), g !== n.a && o.classList.toggle("is-source-dragging", n.a = g), f !== n.o && I(o, "aria-label", n.o = f), h !== n.i && I(o, "aria-pressed", n.i = h), n;
|
|
77
102
|
}, {
|
|
78
103
|
e: void 0,
|
|
79
104
|
t: void 0,
|
|
80
105
|
a: void 0,
|
|
81
106
|
o: void 0,
|
|
82
107
|
i: void 0
|
|
83
|
-
}),
|
|
108
|
+
}), o;
|
|
84
109
|
})();
|
|
85
110
|
}
|
|
86
|
-
function
|
|
87
|
-
const [
|
|
88
|
-
let n;
|
|
89
|
-
|
|
90
|
-
n?.stop({
|
|
111
|
+
function _t(t) {
|
|
112
|
+
const [a, r] = R(null), [u, o] = R(null);
|
|
113
|
+
let n, c, v = null;
|
|
114
|
+
q(() => {
|
|
115
|
+
c?.stop(), n?.stop({
|
|
91
116
|
reason: "manual_stop",
|
|
92
117
|
commit: !1
|
|
93
|
-
}), n = void 0,
|
|
118
|
+
}), n = void 0, u()?.stopInteraction();
|
|
94
119
|
});
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
}, h = (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
120
|
+
const g = z(() => t.widgetDefinitions.every((e) => t.filters[e.type])), f = (e) => {
|
|
121
|
+
const i = a();
|
|
122
|
+
return i === null ? 0 : i === e ? -1 : i === e + 1 ? -2 : i === e - 1 ? 1 : 0;
|
|
123
|
+
}, h = () => {
|
|
124
|
+
c?.stop(), c = void 0, v = null;
|
|
125
|
+
}, E = () => {
|
|
126
|
+
!t.viewport || !t.onViewportCommit || (v = t.viewport, c?.stop(), c = et({
|
|
127
|
+
readFrame: () => {
|
|
128
|
+
const e = document.querySelector(B);
|
|
129
|
+
return e instanceof HTMLElement ? nt(e) : null;
|
|
130
|
+
},
|
|
131
|
+
readViewport: () => v ?? t.viewport ?? null,
|
|
132
|
+
commitViewport: (e) => {
|
|
133
|
+
v = e, t.onViewportCommit?.(e);
|
|
134
|
+
},
|
|
135
|
+
onPanStart: () => t.onViewportInteractionStart?.("pan"),
|
|
136
|
+
shouldPan: () => {
|
|
137
|
+
const e = u();
|
|
138
|
+
return !!(e?.moved && e.hasEnteredCanvas && !T(e.clientX, e.clientY));
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
}, m = (e) => {
|
|
142
|
+
const i = u();
|
|
143
|
+
if (!i) return;
|
|
144
|
+
const l = !i.moved;
|
|
145
|
+
if (i.stopInteraction(), h(), o(null), n = void 0, l) {
|
|
146
|
+
t.onSoloFilter(i.type);
|
|
104
147
|
return;
|
|
105
148
|
}
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
149
|
+
e && i.overCanvas && t.onCreateAt?.(i.type, i.clientX, i.clientY);
|
|
150
|
+
}, k = (e, i, l, C) => {
|
|
151
|
+
e.preventDefault(), n?.stop({
|
|
109
152
|
reason: "manual_stop",
|
|
110
153
|
commit: !1
|
|
111
|
-
}),
|
|
112
|
-
type:
|
|
113
|
-
label:
|
|
114
|
-
icon:
|
|
115
|
-
pointerId:
|
|
116
|
-
startClientX:
|
|
117
|
-
startClientY:
|
|
118
|
-
clientX:
|
|
119
|
-
clientY:
|
|
154
|
+
}), E(), o({
|
|
155
|
+
type: i,
|
|
156
|
+
label: l,
|
|
157
|
+
icon: C,
|
|
158
|
+
pointerId: e.pointerId,
|
|
159
|
+
startClientX: e.clientX,
|
|
160
|
+
startClientY: e.clientY,
|
|
161
|
+
clientX: e.clientX,
|
|
162
|
+
clientY: e.clientY,
|
|
120
163
|
moved: !1,
|
|
121
164
|
overCanvas: !1,
|
|
122
|
-
|
|
165
|
+
hasEnteredCanvas: !1,
|
|
166
|
+
stopInteraction: Z({
|
|
123
167
|
kind: "drag",
|
|
124
168
|
cursor: "grabbing"
|
|
125
169
|
})
|
|
126
170
|
});
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
171
|
+
const w = (s) => {
|
|
172
|
+
let F = !1;
|
|
173
|
+
o((b) => {
|
|
174
|
+
if (!b || b.pointerId !== s.pointerId) return b;
|
|
175
|
+
const G = s.clientX - b.startClientX, p = s.clientY - b.startClientY, S = b.moved || Math.abs(G) > H || Math.abs(p) > H, O = T(s.clientX, s.clientY), Y = S && lt(s.clientX, s.clientY) && !O, W = S && !O && st(b.clientX, b.clientY, s.clientX, s.clientY), $ = b.hasEnteredCanvas || Y || W;
|
|
176
|
+
return F = S && $ && !O, {
|
|
177
|
+
...b,
|
|
133
178
|
clientX: s.clientX,
|
|
134
179
|
clientY: s.clientY,
|
|
135
|
-
moved:
|
|
136
|
-
overCanvas:
|
|
180
|
+
moved: S,
|
|
181
|
+
overCanvas: Y,
|
|
182
|
+
hasEnteredCanvas: $
|
|
137
183
|
};
|
|
138
|
-
});
|
|
184
|
+
}), F && c?.updatePointer(s.clientX, s.clientY);
|
|
139
185
|
};
|
|
140
|
-
n =
|
|
141
|
-
pointerEvent:
|
|
142
|
-
captureEl:
|
|
143
|
-
onMove:
|
|
186
|
+
n = tt({
|
|
187
|
+
pointerEvent: e,
|
|
188
|
+
captureEl: e.currentTarget,
|
|
189
|
+
onMove: w,
|
|
144
190
|
onEnd: ({
|
|
145
191
|
commit: s
|
|
146
|
-
}) =>
|
|
192
|
+
}) => m(s)
|
|
147
193
|
});
|
|
148
|
-
},
|
|
194
|
+
}, y = () => u()?.type ?? null;
|
|
149
195
|
return [(() => {
|
|
150
|
-
var
|
|
151
|
-
return
|
|
196
|
+
var e = rt(), i = e.firstChild;
|
|
197
|
+
return i.nextSibling, e.addEventListener("pointerleave", () => r(null)), i.$$click = () => t.onShowAll(), i.addEventListener("pointerleave", () => r((l) => l === 0 ? null : l)), i.addEventListener("pointerenter", () => r(0)), _(i, d(D.span, {
|
|
152
198
|
class: "workbench-dock__tile",
|
|
153
199
|
get animate() {
|
|
154
200
|
return {
|
|
155
|
-
scale:
|
|
156
|
-
y:
|
|
157
|
-
x:
|
|
201
|
+
scale: a() === 0 ? 1.26 : 1,
|
|
202
|
+
y: a() === 0 ? -6 : 0,
|
|
203
|
+
x: a() === 1 ? -5 : 0
|
|
158
204
|
};
|
|
159
205
|
},
|
|
160
206
|
get transition() {
|
|
161
207
|
return {
|
|
162
|
-
duration:
|
|
163
|
-
easing:
|
|
208
|
+
duration: P.fast,
|
|
209
|
+
easing: L.easeOut
|
|
164
210
|
};
|
|
165
211
|
},
|
|
166
212
|
get children() {
|
|
167
|
-
return d(
|
|
213
|
+
return d(J, {
|
|
168
214
|
class: "workbench-dock__icon"
|
|
169
215
|
});
|
|
170
216
|
}
|
|
171
|
-
}), null),
|
|
217
|
+
}), null), _(i, d(D.span, {
|
|
172
218
|
class: "workbench-dock__tooltip",
|
|
173
219
|
get animate() {
|
|
174
220
|
return {
|
|
175
|
-
opacity:
|
|
176
|
-
y:
|
|
221
|
+
opacity: a() === 0 ? 1 : 0,
|
|
222
|
+
y: a() === 0 ? -6 : 0
|
|
177
223
|
};
|
|
178
224
|
},
|
|
179
225
|
get transition() {
|
|
180
226
|
return {
|
|
181
|
-
duration:
|
|
182
|
-
easing:
|
|
227
|
+
duration: P.fast,
|
|
228
|
+
easing: L.easeOut
|
|
183
229
|
};
|
|
184
230
|
},
|
|
185
231
|
children: "Show all widgets"
|
|
186
|
-
}), null),
|
|
232
|
+
}), null), _(e, d(j, {
|
|
187
233
|
get each() {
|
|
188
234
|
return t.widgetDefinitions;
|
|
189
235
|
},
|
|
190
|
-
children: (
|
|
191
|
-
const
|
|
192
|
-
return d(
|
|
236
|
+
children: (l, C) => {
|
|
237
|
+
const w = () => C() + 1;
|
|
238
|
+
return d(ct, {
|
|
193
239
|
get type() {
|
|
194
|
-
return
|
|
240
|
+
return l.type;
|
|
195
241
|
},
|
|
196
242
|
get label() {
|
|
197
|
-
return
|
|
243
|
+
return l.label;
|
|
198
244
|
},
|
|
199
245
|
get icon() {
|
|
200
|
-
return
|
|
246
|
+
return l.icon;
|
|
201
247
|
},
|
|
202
248
|
get active() {
|
|
203
|
-
return t.filters[
|
|
249
|
+
return t.filters[l.type];
|
|
204
250
|
},
|
|
205
251
|
get hoverOffset() {
|
|
206
|
-
return
|
|
252
|
+
return f(w());
|
|
207
253
|
},
|
|
208
254
|
get isDragging() {
|
|
209
|
-
return
|
|
255
|
+
return y() === l.type;
|
|
210
256
|
},
|
|
211
|
-
onEnter: () =>
|
|
212
|
-
onLeave: () =>
|
|
213
|
-
onSolo: () => t.onSoloFilter(
|
|
214
|
-
onDragBegin:
|
|
257
|
+
onEnter: () => r(w()),
|
|
258
|
+
onLeave: () => r((s) => s === w() ? null : s),
|
|
259
|
+
onSolo: () => t.onSoloFilter(l.type),
|
|
260
|
+
onDragBegin: k
|
|
215
261
|
});
|
|
216
262
|
}
|
|
217
|
-
}), null),
|
|
218
|
-
var
|
|
219
|
-
return
|
|
263
|
+
}), null), M((l) => {
|
|
264
|
+
var C = !!g(), w = a() === 0, s = g();
|
|
265
|
+
return C !== l.e && i.classList.toggle("is-active", l.e = C), w !== l.t && i.classList.toggle("is-hovered", l.t = w), s !== l.a && I(i, "aria-pressed", l.a = s), l;
|
|
220
266
|
}, {
|
|
221
267
|
e: void 0,
|
|
222
268
|
t: void 0,
|
|
223
269
|
a: void 0
|
|
224
|
-
}),
|
|
270
|
+
}), e;
|
|
225
271
|
})(), d(x, {
|
|
226
272
|
get when() {
|
|
227
|
-
return
|
|
273
|
+
return u()?.moved ?? !1;
|
|
228
274
|
},
|
|
229
275
|
get children() {
|
|
230
|
-
return d(
|
|
231
|
-
state:
|
|
276
|
+
return d(dt, {
|
|
277
|
+
state: u
|
|
232
278
|
});
|
|
233
279
|
}
|
|
234
280
|
})];
|
|
235
281
|
}
|
|
236
|
-
function
|
|
237
|
-
const
|
|
282
|
+
function dt(t) {
|
|
283
|
+
const a = () => {
|
|
238
284
|
const n = t.state();
|
|
239
285
|
return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
240
|
-
},
|
|
241
|
-
return d(
|
|
286
|
+
}, r = () => t.state()?.overCanvas ?? !1, u = () => t.state()?.label ?? "", o = () => t.state()?.icon;
|
|
287
|
+
return d(K, {
|
|
242
288
|
get children() {
|
|
243
|
-
var n =
|
|
244
|
-
return g
|
|
289
|
+
var n = it(), c = n.firstChild, v = c.nextSibling, g = v.firstChild, f = g.nextSibling, h = f.firstChild, E = h.nextSibling, m = E.firstChild;
|
|
290
|
+
return _(g, d(x, {
|
|
245
291
|
get when() {
|
|
246
|
-
return
|
|
292
|
+
return o();
|
|
247
293
|
},
|
|
248
|
-
children: (
|
|
249
|
-
const
|
|
250
|
-
return d(
|
|
294
|
+
children: (k) => {
|
|
295
|
+
const y = k();
|
|
296
|
+
return d(y, {
|
|
251
297
|
class: "w-4 h-4"
|
|
252
298
|
});
|
|
253
299
|
}
|
|
254
|
-
})),
|
|
300
|
+
})), _(h, u), _(E, d(Q, {
|
|
255
301
|
class: "w-3 h-3"
|
|
256
|
-
}),
|
|
257
|
-
var
|
|
258
|
-
return
|
|
302
|
+
}), m), _(m, () => r() ? "Drop to create" : "Drag onto canvas"), M((k) => {
|
|
303
|
+
var y = !!r(), e = a();
|
|
304
|
+
return y !== k.e && n.classList.toggle("is-over-canvas", k.e = y), e !== k.t && N(n, "transform", k.t = e), k;
|
|
259
305
|
}, {
|
|
260
306
|
e: void 0,
|
|
261
307
|
t: void 0
|
|
@@ -263,7 +309,7 @@ function J(t) {
|
|
|
263
309
|
}
|
|
264
310
|
});
|
|
265
311
|
}
|
|
266
|
-
|
|
312
|
+
U(["pointerdown", "click"]);
|
|
267
313
|
export {
|
|
268
|
-
|
|
314
|
+
_t as WorkbenchFilterBar
|
|
269
315
|
};
|
|
@@ -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;
|