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