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