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