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