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