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