@floegence/floe-webapp-core 0.36.59 → 0.36.61
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/WorkbenchFilterBar.js +177 -172
- package/dist/components/workbench/WorkbenchLayerObjects.js +354 -354
- package/dist/components/workbench/WorkbenchWidget.js +184 -176
- package/dist/components/workbench/useWorkbenchModel.js +236 -239
- package/dist/components/workbench/workbenchHelpers.d.ts +9 -2
- package/dist/components/workbench/workbenchHelpers.js +157 -139
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { createMemo as w, createSignal as C, onCleanup as
|
|
3
|
-
import { startHotInteraction as
|
|
4
|
-
import { X as Mt, Minus as Tt, Maximize as
|
|
5
|
-
import { CANVAS_WHEEL_INTERACTIVE_ATTR as
|
|
6
|
-
import { startPointerSession as
|
|
7
|
-
import { createWorkbenchWidgetSurfaceMetrics as
|
|
8
|
-
import { createWorkbenchEdgeAutoPanController as
|
|
9
|
-
import { resolveWorkbenchInteractionAdapter as
|
|
1
|
+
import { spread as xt, mergeProps as pe, insert as f, createComponent as m, memo as me, effect as _e, style as be, template as Rt, use as ve, delegateEvents as Se } from "solid-js/web";
|
|
2
|
+
import { createMemo as w, createSignal as C, onCleanup as Wt, untrack as $, createEffect as It } from "solid-js";
|
|
3
|
+
import { startHotInteraction as ke } from "../../utils/hotInteraction.js";
|
|
4
|
+
import { X as Mt, Minus as Tt, Maximize as Ct, GripVertical as $e } from "../icons/index.js";
|
|
5
|
+
import { CANVAS_WHEEL_INTERACTIVE_ATTR as ye, WORKBENCH_WIDGET_SHELL_ATTR as Pe, resolveWorkbenchWidgetLocalTypingTarget as xe, resolveWorkbenchWidgetTextSelectionTarget as We, shouldActivateWorkbenchWidgetLocalTarget as Ie } from "../ui/localInteractionSurface.js";
|
|
6
|
+
import { startPointerSession as Et } from "../ui/pointerSession.js";
|
|
7
|
+
import { createWorkbenchWidgetSurfaceMetrics as Me, resolveWorkbenchProjectedSurfaceScaleBehavior as Te } from "./workbenchHelpers.js";
|
|
8
|
+
import { createWorkbenchEdgeAutoPanController as Ce, WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Ee, frameFromElement as Re } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
import { resolveWorkbenchInteractionAdapter as Le } from "./workbenchInteractionAdapter.js";
|
|
10
10
|
import { createOwnerSafePropAccessor as a } from "./workbenchOwnerSafeAccessors.js";
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const
|
|
11
|
+
var Ae = /* @__PURE__ */ Rt('<article class=workbench-widget><div class=workbench-widget__surface><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), ze = /* @__PURE__ */ Rt('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
|
|
12
|
+
const Xe = 220, Ye = 160, De = 160;
|
|
13
|
+
function Ke(i) {
|
|
14
|
+
const V = a(() => i.definition), g = a(() => i.widgetId), it = a(() => i.widgetTitle), rt = a(() => i.widgetType), E = a(() => i.itemSnapshot), at = a(() => i.renderLayer), Lt = a(() => i.optimisticFront), ct = a(() => i.motion ?? null), lt = a(() => i.topRenderLayer), At = a(() => i.viewport), q = a(() => i.onSelect), zt = a(() => i.onContextMenu), st = a(() => i.onStartOptimisticFront), B = a(() => i.onCommitFront), Xt = a(() => i.onCommitMove), Yt = a(() => i.onCommitResize), Dt = a(() => i.onViewportCommit), Ft = a(() => i.onViewportInteractionStart), jt = a(() => i.onRequestOverview), Ot = a(() => i.onRequestFit), Ht = a(() => i.onRequestDelete), Vt = a(() => i.onLayoutInteractionStart), qt = a(() => i.onLayoutInteractionEnd), h = w(() => Le(i.interactionAdapter)), R = a(() => i.selected), v = a(() => i.locked), N = a(() => i.filtered), b = a(() => i.layoutMode ?? "canvas_scaled"), Bt = a(() => i.projectedViewport), Nt = a(() => i.surfaceReady ?? !0), dt = a(() => ({
|
|
15
15
|
x: i.x,
|
|
16
16
|
y: i.y
|
|
17
|
-
})),
|
|
17
|
+
})), ut = a(() => ({
|
|
18
18
|
width: i.width,
|
|
19
19
|
height: i.height
|
|
20
|
-
})),
|
|
20
|
+
})), G = a(() => Math.max(i.viewportScale, 1e-3)), [y, L] = C(null), [A, Z] = C(null), [Gt, Zt] = C(), [K, U] = C(!1), [wt, z] = C({
|
|
21
21
|
enabled: !1,
|
|
22
22
|
scale: 1
|
|
23
23
|
});
|
|
24
|
-
let P, x,
|
|
25
|
-
const
|
|
24
|
+
let P, x, W, X = null, Kt = 0, Ut = 0, S = null, I;
|
|
25
|
+
const M = /* @__PURE__ */ new Map();
|
|
26
26
|
let u;
|
|
27
|
-
const
|
|
28
|
-
typeof window > "u" ||
|
|
29
|
-
},
|
|
30
|
-
const n =
|
|
27
|
+
const Y = () => {
|
|
28
|
+
typeof window > "u" || I === void 0 || (window.clearTimeout(I), I = void 0);
|
|
29
|
+
}, gt = (t, e) => {
|
|
30
|
+
const n = ke({
|
|
31
31
|
kind: t,
|
|
32
32
|
cursor: e
|
|
33
33
|
});
|
|
@@ -35,22 +35,22 @@ function Ze(i) {
|
|
|
35
35
|
return $(() => Vt()?.()), () => {
|
|
36
36
|
o || (o = !0, n(), $(() => qt()?.()));
|
|
37
37
|
};
|
|
38
|
-
},
|
|
39
|
-
|
|
38
|
+
}, ht = () => {
|
|
39
|
+
W?.stop(), W = void 0, X = null;
|
|
40
40
|
}, Jt = () => {
|
|
41
41
|
const t = At(), e = Dt(), n = Ft();
|
|
42
|
-
!t || !e || (
|
|
42
|
+
!t || !e || (X = t, W?.stop(), W = Ce({
|
|
43
43
|
readFrame: () => {
|
|
44
|
-
const o = u?.closest(
|
|
45
|
-
return o instanceof HTMLElement ?
|
|
44
|
+
const o = u?.closest(Ee);
|
|
45
|
+
return o instanceof HTMLElement ? Re(o) : null;
|
|
46
46
|
},
|
|
47
|
-
readViewport: () =>
|
|
47
|
+
readViewport: () => X ?? t,
|
|
48
48
|
commitViewport: (o) => {
|
|
49
|
-
|
|
49
|
+
X = o, e(o);
|
|
50
50
|
},
|
|
51
51
|
onPanStart: () => n?.("pan"),
|
|
52
52
|
onPan: (o) => {
|
|
53
|
-
|
|
53
|
+
L((r) => r && {
|
|
54
54
|
...r,
|
|
55
55
|
autoPanWorldX: r.autoPanWorldX + o.worldDeltaX,
|
|
56
56
|
autoPanWorldY: r.autoPanWorldY + o.worldDeltaY,
|
|
@@ -62,66 +62,74 @@ function Ze(i) {
|
|
|
62
62
|
shouldPan: () => y() !== null
|
|
63
63
|
}));
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
Wt(() => {
|
|
66
|
+
ht(), P?.stop({
|
|
67
67
|
reason: "manual_stop",
|
|
68
68
|
commit: !1
|
|
69
69
|
}), P = void 0, x?.stop({
|
|
70
70
|
reason: "manual_stop",
|
|
71
71
|
commit: !1
|
|
72
|
-
}), x = void 0, $(y)?.stopInteraction(), $(
|
|
72
|
+
}), x = void 0, $(y)?.stopInteraction(), $(A)?.stopInteraction(), Y();
|
|
73
73
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const t =
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
74
|
+
const D = () => {
|
|
75
|
+
U(!1);
|
|
76
|
+
const t = g();
|
|
77
|
+
q()(t), B()(t);
|
|
78
|
+
}, Qt = () => {
|
|
79
|
+
at() >= lt() || B()(g());
|
|
80
|
+
}, J = () => {
|
|
81
|
+
U(!1);
|
|
82
|
+
}, T = w(() => R() || K()), te = (t, e, n) => {
|
|
81
83
|
const o = {
|
|
82
84
|
token: ++Ut,
|
|
83
85
|
wasSelected: e,
|
|
84
86
|
ownership: n
|
|
85
87
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
M.set(t, o), !e && n === "widget_local" && U(!0), queueMicrotask(() => {
|
|
89
|
+
M.get(t)?.token === o.token && M.delete(t);
|
|
88
90
|
});
|
|
89
|
-
},
|
|
90
|
-
const e =
|
|
91
|
-
return e &&
|
|
91
|
+
}, ee = (t) => {
|
|
92
|
+
const e = M.get(t) ?? null;
|
|
93
|
+
return e && M.delete(t), e;
|
|
92
94
|
};
|
|
93
|
-
|
|
95
|
+
It(() => {
|
|
94
96
|
const t = u;
|
|
95
97
|
if (!t) return;
|
|
96
98
|
const e = (r) => {
|
|
97
|
-
r.button === 0 &&
|
|
99
|
+
r.button === 0 && te(r.pointerId, T(), F(r.target));
|
|
98
100
|
}, n = (r) => {
|
|
99
|
-
r.button === 0 &&
|
|
101
|
+
if (r.button === 0 && F(r.target) === "widget_local") {
|
|
102
|
+
if (K()) {
|
|
103
|
+
D();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
R() && Qt();
|
|
107
|
+
}
|
|
100
108
|
}, o = () => {
|
|
101
109
|
setTimeout(() => {
|
|
102
|
-
|
|
110
|
+
R() || J();
|
|
103
111
|
}, 0);
|
|
104
112
|
};
|
|
105
|
-
t.addEventListener("pointerdown", e, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", o), t.addEventListener("pointercancel",
|
|
106
|
-
t.removeEventListener("pointerdown", e, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel",
|
|
113
|
+
t.addEventListener("pointerdown", e, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", o), t.addEventListener("pointercancel", J), Wt(() => {
|
|
114
|
+
t.removeEventListener("pointerdown", e, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel", J);
|
|
107
115
|
});
|
|
108
116
|
});
|
|
109
|
-
const
|
|
117
|
+
const Q = () => y() !== null, tt = () => A() !== null, oe = w(() => N() || v() ? "cold" : T() ? "hot" : "warm"), F = (t) => h().resolveWidgetEventOwnership({
|
|
110
118
|
target: t,
|
|
111
119
|
widgetRoot: u ?? null,
|
|
112
|
-
interactiveSelector:
|
|
113
|
-
panSurfaceSelector:
|
|
114
|
-
}),
|
|
115
|
-
|
|
120
|
+
interactiveSelector: h().interactiveSelector,
|
|
121
|
+
panSurfaceSelector: h().panSurfaceSelector
|
|
122
|
+
}), ne = () => {
|
|
123
|
+
D(), u?.focus({
|
|
116
124
|
preventScroll: !0
|
|
117
125
|
});
|
|
118
|
-
},
|
|
126
|
+
}, ft = (t) => {
|
|
119
127
|
Zt((e) => ({
|
|
120
128
|
seq: (e?.seq ?? 0) + 1,
|
|
121
129
|
source: "local_pointer",
|
|
122
130
|
pointerType: t
|
|
123
131
|
}));
|
|
124
|
-
},
|
|
132
|
+
}, ie = (t) => {
|
|
125
133
|
if (!(!u || !t.isConnected || !u.contains(t)))
|
|
126
134
|
try {
|
|
127
135
|
t.focus({
|
|
@@ -130,7 +138,7 @@ function Ze(i) {
|
|
|
130
138
|
} catch {
|
|
131
139
|
t.focus();
|
|
132
140
|
}
|
|
133
|
-
},
|
|
141
|
+
}, re = (t, e) => {
|
|
134
142
|
S = {
|
|
135
143
|
token: ++Kt,
|
|
136
144
|
pointerId: t,
|
|
@@ -140,7 +148,7 @@ function Ze(i) {
|
|
|
140
148
|
const n = S;
|
|
141
149
|
queueMicrotask(() => {
|
|
142
150
|
const o = () => {
|
|
143
|
-
!n || S?.token !== n.token || (
|
|
151
|
+
!n || S?.token !== n.token || (ie(n.target), S = null);
|
|
144
152
|
};
|
|
145
153
|
if (typeof requestAnimationFrame == "function") {
|
|
146
154
|
requestAnimationFrame(() => o());
|
|
@@ -148,33 +156,33 @@ function Ze(i) {
|
|
|
148
156
|
}
|
|
149
157
|
o();
|
|
150
158
|
});
|
|
151
|
-
},
|
|
159
|
+
}, ae = (t) => {
|
|
152
160
|
if (t.button !== 0 || v()) return;
|
|
153
|
-
const e =
|
|
161
|
+
const e = ee(t.pointerId), n = e?.wasSelected ?? R(), o = e?.ownership ?? F(t.target), r = o === "widget_local" ? xe({
|
|
154
162
|
target: t.target,
|
|
155
163
|
widgetRoot: u ?? null,
|
|
156
|
-
interactiveSelector:
|
|
157
|
-
panSurfaceSelector:
|
|
158
|
-
}) : null, s = o === "widget_local" ?
|
|
164
|
+
interactiveSelector: h().interactiveSelector,
|
|
165
|
+
panSurfaceSelector: h().panSurfaceSelector
|
|
166
|
+
}) : null, s = o === "widget_local" ? We({
|
|
159
167
|
target: t.target,
|
|
160
168
|
widgetRoot: u ?? null,
|
|
161
|
-
interactiveSelector:
|
|
162
|
-
panSurfaceSelector:
|
|
163
|
-
}) : null, c = o === "widget_local" && !r && !s &&
|
|
169
|
+
interactiveSelector: h().interactiveSelector,
|
|
170
|
+
panSurfaceSelector: h().panSurfaceSelector
|
|
171
|
+
}) : null, c = o === "widget_local" && !r && !s && Ie({
|
|
164
172
|
target: t.target,
|
|
165
173
|
widgetRoot: u ?? null,
|
|
166
|
-
interactiveSelector:
|
|
167
|
-
panSurfaceSelector:
|
|
174
|
+
interactiveSelector: h().interactiveSelector,
|
|
175
|
+
panSurfaceSelector: h().panSurfaceSelector
|
|
168
176
|
});
|
|
169
177
|
if (o === "widget_shell") {
|
|
170
|
-
|
|
178
|
+
D(), u?.focus({
|
|
171
179
|
preventScroll: !0
|
|
172
180
|
});
|
|
173
181
|
return;
|
|
174
182
|
}
|
|
175
183
|
if (o === "widget_local") {
|
|
176
184
|
if (r) {
|
|
177
|
-
n ||
|
|
185
|
+
n || re(t.pointerId, r);
|
|
178
186
|
return;
|
|
179
187
|
}
|
|
180
188
|
if (s) {
|
|
@@ -183,41 +191,41 @@ function Ze(i) {
|
|
|
183
191
|
}
|
|
184
192
|
if (c) {
|
|
185
193
|
if (S = null, n) {
|
|
186
|
-
|
|
194
|
+
ft(t.pointerType || void 0);
|
|
187
195
|
return;
|
|
188
196
|
}
|
|
189
|
-
|
|
197
|
+
D(), ft(t.pointerType || void 0);
|
|
190
198
|
}
|
|
191
199
|
}
|
|
192
|
-
},
|
|
200
|
+
}, j = w(() => {
|
|
193
201
|
const t = y();
|
|
194
202
|
return t ? {
|
|
195
203
|
x: t.worldX,
|
|
196
204
|
y: t.worldY
|
|
197
|
-
} :
|
|
205
|
+
} : dt();
|
|
198
206
|
}), p = w(() => {
|
|
199
|
-
const t =
|
|
207
|
+
const t = A();
|
|
200
208
|
return t ? {
|
|
201
209
|
width: t.width,
|
|
202
210
|
height: t.height
|
|
203
|
-
} :
|
|
204
|
-
}),
|
|
211
|
+
} : ut();
|
|
212
|
+
}), et = w(() => {
|
|
205
213
|
const t = Bt();
|
|
206
214
|
if (!(b() !== "projected_surface" || !t))
|
|
207
|
-
return
|
|
208
|
-
widgetId:
|
|
209
|
-
worldX:
|
|
210
|
-
worldY:
|
|
215
|
+
return Me({
|
|
216
|
+
widgetId: g(),
|
|
217
|
+
worldX: j().x,
|
|
218
|
+
worldY: j().y,
|
|
211
219
|
worldWidth: p().width,
|
|
212
220
|
worldHeight: p().height,
|
|
213
221
|
viewport: t(),
|
|
214
222
|
ready: Nt()
|
|
215
223
|
});
|
|
216
|
-
}),
|
|
224
|
+
}), ot = w(() => et()?.rect.viewportScale ?? G()), pt = w(() => b() === "projected_surface" && Te(V()) === "settle_sharp_zoom"), mt = w(() => b() === "projected_surface" && pt() && wt().enabled && wt().scale > 1.001), ce = w(() => {
|
|
217
225
|
if (b() !== "projected_surface")
|
|
218
226
|
return;
|
|
219
|
-
const t =
|
|
220
|
-
return
|
|
227
|
+
const t = ot();
|
|
228
|
+
return mt() ? {
|
|
221
229
|
width: `${p().width}px`,
|
|
222
230
|
height: `${p().height}px`,
|
|
223
231
|
zoom: `${t}`
|
|
@@ -226,21 +234,21 @@ function Ze(i) {
|
|
|
226
234
|
height: "100%",
|
|
227
235
|
zoom: "1"
|
|
228
236
|
};
|
|
229
|
-
}),
|
|
237
|
+
}), le = w(() => {
|
|
230
238
|
const t = E()().z_index, e = Number.isFinite(t) ? Math.max(1, Math.min(99, Math.round(t))) : 1;
|
|
231
239
|
return String(e).padStart(2, "0");
|
|
232
|
-
}),
|
|
240
|
+
}), _t = (t) => {
|
|
233
241
|
t.preventDefault(), t.stopPropagation(), jt()(E()());
|
|
234
|
-
},
|
|
242
|
+
}, bt = (t) => {
|
|
235
243
|
t.preventDefault(), t.stopPropagation(), Ot()(E()());
|
|
236
|
-
},
|
|
237
|
-
t.preventDefault(), t.stopPropagation(), Ht()(
|
|
238
|
-
},
|
|
244
|
+
}, vt = (t) => {
|
|
245
|
+
t.preventDefault(), t.stopPropagation(), Ht()(g());
|
|
246
|
+
}, se = w(() => {
|
|
239
247
|
const t = {
|
|
240
|
-
"z-index":
|
|
248
|
+
"z-index": Q() || tt() || Lt() ? `${lt() + 1}` : `${at()}`
|
|
241
249
|
};
|
|
242
250
|
if (b() === "projected_surface") {
|
|
243
|
-
const e =
|
|
251
|
+
const e = et()?.rect, n = ot(), o = mt(), r = o ? e?.screenWidth ?? p().width * n : p().width, s = o ? e?.screenHeight ?? p().height * n : p().height;
|
|
244
252
|
return {
|
|
245
253
|
...t,
|
|
246
254
|
width: `${r}px`,
|
|
@@ -253,40 +261,40 @@ function Ze(i) {
|
|
|
253
261
|
...t,
|
|
254
262
|
width: `${p().width}px`,
|
|
255
263
|
height: `${p().height}px`,
|
|
256
|
-
transform: `translate(${
|
|
264
|
+
transform: `translate(${j().x}px, ${j().y}px)`
|
|
257
265
|
};
|
|
258
|
-
}),
|
|
259
|
-
|
|
260
|
-
if (!
|
|
261
|
-
|
|
266
|
+
}), St = w(() => ct()?.phase === "enter");
|
|
267
|
+
It(() => {
|
|
268
|
+
if (!pt()) {
|
|
269
|
+
Y(), z({
|
|
262
270
|
enabled: !1,
|
|
263
271
|
scale: 1
|
|
264
272
|
});
|
|
265
273
|
return;
|
|
266
274
|
}
|
|
267
|
-
const t =
|
|
268
|
-
if (t <= 1.001 ||
|
|
269
|
-
|
|
275
|
+
const t = ot();
|
|
276
|
+
if (t <= 1.001 || Q() || tt()) {
|
|
277
|
+
Y(), z({
|
|
270
278
|
enabled: !1,
|
|
271
279
|
scale: t
|
|
272
280
|
});
|
|
273
281
|
return;
|
|
274
282
|
}
|
|
275
|
-
if (
|
|
283
|
+
if (z({
|
|
276
284
|
enabled: !1,
|
|
277
285
|
scale: t
|
|
278
286
|
}), typeof window > "u")
|
|
279
287
|
return;
|
|
280
|
-
|
|
288
|
+
Y();
|
|
281
289
|
const e = t;
|
|
282
|
-
|
|
283
|
-
|
|
290
|
+
I = window.setTimeout(() => {
|
|
291
|
+
I = void 0, z((n) => Math.abs(n.scale - e) < 1e-3 ? {
|
|
284
292
|
enabled: !0,
|
|
285
293
|
scale: e
|
|
286
294
|
} : n);
|
|
287
|
-
},
|
|
295
|
+
}, De);
|
|
288
296
|
});
|
|
289
|
-
const
|
|
297
|
+
const de = (t) => {
|
|
290
298
|
const e = $(y);
|
|
291
299
|
if (!e) return;
|
|
292
300
|
const n = {
|
|
@@ -295,20 +303,20 @@ function Ze(i) {
|
|
|
295
303
|
}, o = {
|
|
296
304
|
x: e.startWorldX,
|
|
297
305
|
y: e.startWorldY
|
|
298
|
-
}, r = t && (Math.abs(n.x - o.x) > 1 || Math.abs(n.y - o.y) > 1), s =
|
|
299
|
-
|
|
300
|
-
},
|
|
306
|
+
}, r = t && (Math.abs(n.x - o.x) > 1 || Math.abs(n.y - o.y) > 1), s = g();
|
|
307
|
+
B()(s), r && Xt()(s, n), e.stopInteraction(), ht(), L(null), P = void 0;
|
|
308
|
+
}, kt = (t) => {
|
|
301
309
|
if (t.button !== 0 || v()) return;
|
|
302
310
|
t.preventDefault(), t.stopPropagation(), P?.stop({
|
|
303
311
|
reason: "manual_stop",
|
|
304
312
|
commit: !1
|
|
305
313
|
});
|
|
306
|
-
const e =
|
|
307
|
-
|
|
314
|
+
const e = g();
|
|
315
|
+
q()(e), u?.focus({
|
|
308
316
|
preventScroll: !0
|
|
309
|
-
}),
|
|
310
|
-
const n =
|
|
311
|
-
|
|
317
|
+
}), st()(e);
|
|
318
|
+
const n = gt("drag", "grabbing"), o = G(), r = dt();
|
|
319
|
+
L({
|
|
312
320
|
pointerId: t.pointerId,
|
|
313
321
|
startClientX: t.clientX,
|
|
314
322
|
startClientY: t.clientY,
|
|
@@ -323,7 +331,7 @@ function Ze(i) {
|
|
|
323
331
|
stopInteraction: n
|
|
324
332
|
}), Jt();
|
|
325
333
|
const s = (c) => {
|
|
326
|
-
|
|
334
|
+
W?.updatePointer(c.clientX, c.clientY), L((d) => {
|
|
327
335
|
if (!d || d.pointerId !== c.pointerId) return d;
|
|
328
336
|
const _ = d.startWorldX + (c.clientX - d.startClientX) / d.scale + d.autoPanWorldX, k = d.startWorldY + (c.clientY - d.startClientY) / d.scale + d.autoPanWorldY;
|
|
329
337
|
return {
|
|
@@ -334,30 +342,30 @@ function Ze(i) {
|
|
|
334
342
|
};
|
|
335
343
|
});
|
|
336
344
|
};
|
|
337
|
-
P =
|
|
345
|
+
P = Et({
|
|
338
346
|
pointerEvent: t,
|
|
339
347
|
captureEl: t.currentTarget,
|
|
340
348
|
onMove: s,
|
|
341
349
|
onEnd: ({
|
|
342
350
|
commit: c
|
|
343
|
-
}) =>
|
|
351
|
+
}) => de(c)
|
|
344
352
|
});
|
|
345
|
-
},
|
|
346
|
-
const e = $(
|
|
353
|
+
}, ue = (t) => {
|
|
354
|
+
const e = $(A);
|
|
347
355
|
if (!e) return;
|
|
348
356
|
const n = {
|
|
349
357
|
width: e.width,
|
|
350
358
|
height: e.height
|
|
351
359
|
}, o = Math.abs(e.width - e.startWidth) > 1 || Math.abs(e.height - e.startHeight) > 1;
|
|
352
|
-
t && o && Yt()(
|
|
353
|
-
},
|
|
360
|
+
t && o && Yt()(g(), n), e.stopInteraction(), Z(null), x = void 0;
|
|
361
|
+
}, we = (t) => {
|
|
354
362
|
if (t.button !== 0 || v()) return;
|
|
355
363
|
t.preventDefault(), t.stopPropagation(), x?.stop({
|
|
356
364
|
reason: "manual_stop",
|
|
357
365
|
commit: !1
|
|
358
|
-
}),
|
|
359
|
-
const e =
|
|
360
|
-
|
|
366
|
+
}), st()(g());
|
|
367
|
+
const e = gt("resize", "nwse-resize"), n = G(), o = ut();
|
|
368
|
+
Z({
|
|
361
369
|
pointerId: t.pointerId,
|
|
362
370
|
startClientX: t.clientX,
|
|
363
371
|
startClientY: t.clientY,
|
|
@@ -369,9 +377,9 @@ function Ze(i) {
|
|
|
369
377
|
stopInteraction: e
|
|
370
378
|
});
|
|
371
379
|
const r = (s) => {
|
|
372
|
-
|
|
380
|
+
Z((c) => {
|
|
373
381
|
if (!c || c.pointerId !== s.pointerId) return c;
|
|
374
|
-
const d = Math.max(
|
|
382
|
+
const d = Math.max(Xe, c.startWidth + (s.clientX - c.startClientX) / c.scale), _ = Math.max(Ye, c.startHeight + (s.clientY - c.startClientY) / c.scale);
|
|
375
383
|
return {
|
|
376
384
|
...c,
|
|
377
385
|
width: d,
|
|
@@ -379,130 +387,130 @@ function Ze(i) {
|
|
|
379
387
|
};
|
|
380
388
|
});
|
|
381
389
|
};
|
|
382
|
-
x =
|
|
390
|
+
x = Et({
|
|
383
391
|
pointerEvent: t,
|
|
384
392
|
captureEl: t.currentTarget,
|
|
385
393
|
onMove: r,
|
|
386
394
|
onEnd: ({
|
|
387
395
|
commit: s
|
|
388
|
-
}) =>
|
|
396
|
+
}) => ue(s)
|
|
389
397
|
});
|
|
390
398
|
};
|
|
391
399
|
return (() => {
|
|
392
|
-
var t =
|
|
393
|
-
return typeof
|
|
400
|
+
var t = Ae(), e = t.firstChild, n = e.firstChild, o = n.firstChild, r = o.firstChild, s = r.nextSibling, c = s.nextSibling, d = o.nextSibling, _ = d.nextSibling, k = _.nextSibling, ge = k.firstChild, $t = ge.nextSibling, he = k.nextSibling, O = he.firstChild, H = O.nextSibling, nt = H.nextSibling, fe = n.nextSibling, yt = u;
|
|
401
|
+
return typeof yt == "function" ? ve(yt, t) : u = t, xt(t, pe({
|
|
394
402
|
get classList() {
|
|
395
403
|
return {
|
|
396
|
-
"is-selected":
|
|
397
|
-
"is-dragging":
|
|
398
|
-
"is-resizing":
|
|
399
|
-
"is-filtered-out":
|
|
404
|
+
"is-selected": T(),
|
|
405
|
+
"is-dragging": Q(),
|
|
406
|
+
"is-resizing": tt(),
|
|
407
|
+
"is-filtered-out": N(),
|
|
400
408
|
"is-projected-surface": b() === "projected_surface",
|
|
401
409
|
"is-locked": v(),
|
|
402
|
-
"is-entering":
|
|
410
|
+
"is-entering": St()
|
|
403
411
|
};
|
|
404
412
|
}
|
|
405
413
|
}, () => ({
|
|
406
|
-
[
|
|
414
|
+
[h().dialogSurfaceHostAttr]: "true"
|
|
407
415
|
}), {
|
|
408
416
|
get "data-floe-workbench-widget-id"() {
|
|
409
|
-
return
|
|
417
|
+
return g();
|
|
410
418
|
}
|
|
411
419
|
}, () => ({
|
|
412
|
-
[
|
|
420
|
+
[h().widgetRootAttr]: "true"
|
|
413
421
|
}), () => ({
|
|
414
|
-
[
|
|
422
|
+
[h().widgetIdAttr]: g()
|
|
415
423
|
}), {
|
|
416
424
|
get "data-workbench-widget-type"() {
|
|
417
|
-
return
|
|
425
|
+
return rt();
|
|
418
426
|
},
|
|
419
427
|
get "data-floe-workbench-render-mode"() {
|
|
420
428
|
return b();
|
|
421
429
|
},
|
|
422
430
|
get "data-workbench-widget-motion"() {
|
|
423
|
-
return
|
|
431
|
+
return St() ? "enter" : void 0;
|
|
424
432
|
}
|
|
425
433
|
}, () => ({
|
|
426
|
-
[
|
|
434
|
+
[ye]: T() ? "true" : void 0
|
|
427
435
|
}), {
|
|
428
436
|
tabIndex: 0,
|
|
429
|
-
onPointerDown:
|
|
437
|
+
onPointerDown: ae,
|
|
430
438
|
onFocus: () => {
|
|
431
|
-
|
|
439
|
+
K() || q()(g());
|
|
432
440
|
},
|
|
433
441
|
onContextMenu: (l) => {
|
|
434
|
-
|
|
442
|
+
F(l.target) === "widget_shell" && (l.preventDefault(), l.stopPropagation(), zt()(l, E()()));
|
|
435
443
|
},
|
|
436
444
|
get style() {
|
|
437
|
-
return
|
|
445
|
+
return se();
|
|
438
446
|
}
|
|
439
|
-
}), !1, !0), n.$$pointerdown =
|
|
440
|
-
[
|
|
441
|
-
}, !1, !0), r.$$click =
|
|
447
|
+
}), !1, !0), n.$$pointerdown = kt, xt(n, {
|
|
448
|
+
[Pe]: "true"
|
|
449
|
+
}, !1, !0), r.$$click = vt, r.$$pointerdown = (l) => l.stopPropagation(), f(r, m(Mt, {
|
|
442
450
|
class: "workbench-widget__traffic-icon",
|
|
443
451
|
"aria-hidden": "true"
|
|
444
|
-
})), s.$$click =
|
|
452
|
+
})), s.$$click = _t, s.$$pointerdown = (l) => l.stopPropagation(), f(s, m(Tt, {
|
|
445
453
|
class: "workbench-widget__traffic-icon",
|
|
446
454
|
"aria-hidden": "true"
|
|
447
|
-
})), c.$$click =
|
|
455
|
+
})), c.$$click = bt, c.$$pointerdown = (l) => l.stopPropagation(), f(c, m(Ct, {
|
|
448
456
|
class: "workbench-widget__traffic-icon",
|
|
449
457
|
"aria-hidden": "true"
|
|
450
|
-
})),
|
|
458
|
+
})), f(d, le), _.$$pointerdown = kt, f(_, m($e, {
|
|
451
459
|
class: "w-3.5 h-3.5"
|
|
452
|
-
})),
|
|
453
|
-
const l =
|
|
460
|
+
})), f(k, () => {
|
|
461
|
+
const l = V().icon;
|
|
454
462
|
return m(l, {
|
|
455
463
|
class: "w-3.5 h-3.5"
|
|
456
464
|
});
|
|
457
|
-
},
|
|
465
|
+
}, $t), f($t, it), O.$$click = _t, O.$$pointerdown = (l) => l.stopPropagation(), f(O, m(Tt, {
|
|
458
466
|
class: "workbench-widget__window-control-icon",
|
|
459
467
|
"aria-hidden": "true"
|
|
460
|
-
})),
|
|
468
|
+
})), H.$$click = bt, H.$$pointerdown = (l) => l.stopPropagation(), f(H, m(Ct, {
|
|
461
469
|
class: "workbench-widget__window-control-icon",
|
|
462
470
|
"aria-hidden": "true"
|
|
463
|
-
})),
|
|
471
|
+
})), nt.$$click = vt, nt.$$pointerdown = (l) => l.stopPropagation(), f(nt, m(Mt, {
|
|
464
472
|
class: "workbench-widget__window-control-icon",
|
|
465
473
|
"aria-hidden": "true"
|
|
466
|
-
})),
|
|
467
|
-
const l =
|
|
474
|
+
})), f(fe, () => {
|
|
475
|
+
const l = V().body;
|
|
468
476
|
return m(l, {
|
|
469
477
|
get widgetId() {
|
|
470
|
-
return
|
|
478
|
+
return g();
|
|
471
479
|
},
|
|
472
480
|
get title() {
|
|
473
|
-
return
|
|
481
|
+
return it();
|
|
474
482
|
},
|
|
475
483
|
get type() {
|
|
476
|
-
return
|
|
484
|
+
return rt();
|
|
477
485
|
},
|
|
478
|
-
surfaceMetrics:
|
|
486
|
+
surfaceMetrics: et,
|
|
479
487
|
get activation() {
|
|
480
488
|
return Gt();
|
|
481
489
|
},
|
|
482
490
|
get lifecycle() {
|
|
483
|
-
return
|
|
491
|
+
return oe();
|
|
484
492
|
},
|
|
485
493
|
get motion() {
|
|
486
|
-
return
|
|
494
|
+
return ct();
|
|
487
495
|
},
|
|
488
496
|
get selected() {
|
|
489
|
-
return
|
|
497
|
+
return T();
|
|
490
498
|
},
|
|
491
499
|
get filtered() {
|
|
492
|
-
return
|
|
500
|
+
return N();
|
|
493
501
|
},
|
|
494
|
-
requestActivate:
|
|
502
|
+
requestActivate: ne
|
|
495
503
|
});
|
|
496
|
-
}),
|
|
497
|
-
var l =
|
|
504
|
+
}), f(e, (() => {
|
|
505
|
+
var l = me(() => !!v());
|
|
498
506
|
return () => l() ? null : (() => {
|
|
499
|
-
var
|
|
500
|
-
return
|
|
507
|
+
var Pt = ze();
|
|
508
|
+
return Pt.$$pointerdown = we, Pt;
|
|
501
509
|
})();
|
|
502
|
-
})(), null),
|
|
510
|
+
})(), null), _e((l) => be(e, ce(), l)), t;
|
|
503
511
|
})();
|
|
504
512
|
}
|
|
505
|
-
|
|
513
|
+
Se(["pointerdown", "click"]);
|
|
506
514
|
export {
|
|
507
|
-
|
|
515
|
+
Ke as WorkbenchWidget
|
|
508
516
|
};
|