@floegence/floe-webapp-core 0.36.37 → 0.36.39
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/index.d.ts +1 -1
- package/dist/components/ui/localInteractionSurface.d.ts +4 -0
- package/dist/components/ui/localInteractionSurface.js +77 -60
- 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 +148 -123
- package/dist/components/workbench/WorkbenchSurface.js +25 -18
- package/dist/components/workbench/WorkbenchWidget.d.ts +3 -0
- package/dist/components/workbench/WorkbenchWidget.js +240 -203
- package/dist/components/workbench/workbenchEdgeAutoPan.d.ts +48 -0
- package/dist/components/workbench/workbenchEdgeAutoPan.js +134 -0
- package/dist/full.js +571 -568
- package/dist/styles.css +1 -1
- package/dist/ui.css +16 -0
- package/dist/ui.js +126 -123
- package/package.json +1 -1
|
@@ -1,92 +1,118 @@
|
|
|
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 {
|
|
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
|
-
return
|
|
28
|
-
|
|
27
|
+
let a = !1;
|
|
28
|
+
return _(() => e.onLayoutInteractionStart?.()), () => {
|
|
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,58 +120,67 @@ function re(e) {
|
|
|
94
120
|
} catch {
|
|
95
121
|
t.focus();
|
|
96
122
|
}
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
token: ++
|
|
123
|
+
}, yt = (t, i) => {
|
|
124
|
+
m = {
|
|
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:
|
|
150
|
+
widgetRoot: c ?? null,
|
|
151
|
+
interactiveSelector: d().interactiveSelector,
|
|
152
|
+
panSurfaceSelector: d().panSurfaceSelector
|
|
153
|
+
}) : null, g = a === "widget_local" && !r && !n && Nt({
|
|
154
|
+
target: t.target,
|
|
155
|
+
widgetRoot: c ?? null,
|
|
156
|
+
interactiveSelector: d().interactiveSelector,
|
|
157
|
+
panSurfaceSelector: d().panSurfaceSelector
|
|
127
158
|
});
|
|
128
|
-
if (
|
|
129
|
-
|
|
159
|
+
if (a === "widget_shell") {
|
|
160
|
+
C(), c?.focus({
|
|
130
161
|
preventScroll: !0
|
|
131
162
|
});
|
|
132
163
|
return;
|
|
133
164
|
}
|
|
134
|
-
if (
|
|
135
|
-
if (
|
|
136
|
-
|
|
165
|
+
if (a === "widget_local") {
|
|
166
|
+
if (r) {
|
|
167
|
+
o || yt(t.pointerId, r);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (n) {
|
|
171
|
+
m = null;
|
|
137
172
|
return;
|
|
138
173
|
}
|
|
139
|
-
if (
|
|
140
|
-
if (
|
|
141
|
-
|
|
174
|
+
if (g) {
|
|
175
|
+
if (m = null, o) {
|
|
176
|
+
K(t.pointerType || void 0);
|
|
142
177
|
return;
|
|
143
178
|
}
|
|
144
|
-
|
|
179
|
+
C(), K(t.pointerType || void 0);
|
|
145
180
|
}
|
|
146
181
|
}
|
|
147
|
-
},
|
|
148
|
-
const t =
|
|
182
|
+
}, L = w(() => {
|
|
183
|
+
const t = b();
|
|
149
184
|
return t ? {
|
|
150
185
|
x: t.worldX,
|
|
151
186
|
y: t.worldY
|
|
@@ -153,8 +188,8 @@ function re(e) {
|
|
|
153
188
|
x: e.x,
|
|
154
189
|
y: e.y
|
|
155
190
|
};
|
|
156
|
-
}), u =
|
|
157
|
-
const t =
|
|
191
|
+
}), u = w(() => {
|
|
192
|
+
const t = M();
|
|
158
193
|
return t ? {
|
|
159
194
|
width: t.width,
|
|
160
195
|
height: t.height
|
|
@@ -162,22 +197,22 @@ function re(e) {
|
|
|
162
197
|
width: e.width,
|
|
163
198
|
height: e.height
|
|
164
199
|
};
|
|
165
|
-
}),
|
|
200
|
+
}), H = w(() => {
|
|
166
201
|
if (!(e.layoutMode !== "projected_surface" || !e.projectedViewport))
|
|
167
|
-
return
|
|
202
|
+
return Gt({
|
|
168
203
|
widgetId: e.widgetId,
|
|
169
|
-
worldX:
|
|
170
|
-
worldY:
|
|
204
|
+
worldX: L().x,
|
|
205
|
+
worldY: L().y,
|
|
171
206
|
worldWidth: u().width,
|
|
172
207
|
worldHeight: u().height,
|
|
173
208
|
viewport: e.projectedViewport(),
|
|
174
209
|
ready: e.surfaceReady ?? !0
|
|
175
210
|
});
|
|
176
|
-
}),
|
|
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(() => {
|
|
177
212
|
if (e.layoutMode !== "projected_surface")
|
|
178
213
|
return;
|
|
179
|
-
const t =
|
|
180
|
-
return
|
|
214
|
+
const t = O();
|
|
215
|
+
return J() ? {
|
|
181
216
|
width: `${u().width}px`,
|
|
182
217
|
height: `${u().height}px`,
|
|
183
218
|
zoom: `${t}`
|
|
@@ -186,26 +221,26 @@ function re(e) {
|
|
|
186
221
|
height: "100%",
|
|
187
222
|
zoom: "1"
|
|
188
223
|
};
|
|
189
|
-
}),
|
|
224
|
+
}), Mt = w(() => {
|
|
190
225
|
const t = e.itemSnapshot().z_index, i = Number.isFinite(t) ? Math.max(1, Math.min(99, Math.round(t))) : 1;
|
|
191
226
|
return String(i).padStart(2, "0");
|
|
192
|
-
}),
|
|
227
|
+
}), Q = (t) => {
|
|
193
228
|
t.preventDefault(), t.stopPropagation(), e.onRequestOverview(e.itemSnapshot());
|
|
194
|
-
},
|
|
229
|
+
}, tt = (t) => {
|
|
195
230
|
t.preventDefault(), t.stopPropagation(), e.onRequestFit(e.itemSnapshot());
|
|
196
|
-
},
|
|
231
|
+
}, et = (t) => {
|
|
197
232
|
t.preventDefault(), t.stopPropagation(), e.onRequestDelete(e.widgetId);
|
|
198
|
-
},
|
|
233
|
+
}, xt = w(() => {
|
|
199
234
|
const t = {
|
|
200
|
-
"z-index":
|
|
235
|
+
"z-index": j() || F() || e.optimisticFront ? `${e.topRenderLayer + 1}` : `${e.renderLayer}`
|
|
201
236
|
};
|
|
202
237
|
if (e.layoutMode === "projected_surface") {
|
|
203
|
-
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;
|
|
204
239
|
return {
|
|
205
240
|
...t,
|
|
206
|
-
width: `${
|
|
207
|
-
height: `${
|
|
208
|
-
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})`,
|
|
209
244
|
zoom: "1"
|
|
210
245
|
};
|
|
211
246
|
}
|
|
@@ -213,60 +248,60 @@ function re(e) {
|
|
|
213
248
|
...t,
|
|
214
249
|
width: `${u().width}px`,
|
|
215
250
|
height: `${u().height}px`,
|
|
216
|
-
transform: `translate(${
|
|
251
|
+
transform: `translate(${L().x}px, ${L().y}px)`
|
|
217
252
|
};
|
|
218
253
|
});
|
|
219
|
-
|
|
220
|
-
if (!
|
|
221
|
-
|
|
254
|
+
ct(() => {
|
|
255
|
+
if (!U()) {
|
|
256
|
+
W(), x({
|
|
222
257
|
enabled: !1,
|
|
223
258
|
scale: 1
|
|
224
259
|
});
|
|
225
260
|
return;
|
|
226
261
|
}
|
|
227
|
-
const t =
|
|
228
|
-
if (t <= 1.001 ||
|
|
229
|
-
|
|
262
|
+
const t = O();
|
|
263
|
+
if (t <= 1.001 || j() || F()) {
|
|
264
|
+
W(), x({
|
|
230
265
|
enabled: !1,
|
|
231
266
|
scale: t
|
|
232
267
|
});
|
|
233
268
|
return;
|
|
234
269
|
}
|
|
235
|
-
if (
|
|
270
|
+
if (x({
|
|
236
271
|
enabled: !1,
|
|
237
272
|
scale: t
|
|
238
273
|
}), typeof window > "u")
|
|
239
274
|
return;
|
|
240
|
-
|
|
275
|
+
W();
|
|
241
276
|
const i = t;
|
|
242
|
-
|
|
243
|
-
|
|
277
|
+
p = window.setTimeout(() => {
|
|
278
|
+
p = void 0, x((o) => Math.abs(o.scale - i) < 1e-3 ? {
|
|
244
279
|
enabled: !0,
|
|
245
280
|
scale: i
|
|
246
|
-
} :
|
|
247
|
-
},
|
|
281
|
+
} : o);
|
|
282
|
+
}, ne);
|
|
248
283
|
});
|
|
249
|
-
const
|
|
250
|
-
const i =
|
|
284
|
+
const Tt = (t) => {
|
|
285
|
+
const i = _(b);
|
|
251
286
|
if (!i) return;
|
|
252
|
-
const
|
|
287
|
+
const o = {
|
|
253
288
|
x: i.worldX,
|
|
254
289
|
y: i.worldY
|
|
255
|
-
},
|
|
290
|
+
}, a = {
|
|
256
291
|
x: i.startWorldX,
|
|
257
292
|
y: i.startWorldY
|
|
258
|
-
},
|
|
259
|
-
e.onCommitFront(e.widgetId),
|
|
260
|
-
},
|
|
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) => {
|
|
261
296
|
if (t.button !== 0 || e.locked) return;
|
|
262
|
-
t.preventDefault(), t.stopPropagation(),
|
|
297
|
+
t.preventDefault(), t.stopPropagation(), v?.stop({
|
|
263
298
|
reason: "manual_stop",
|
|
264
299
|
commit: !1
|
|
265
|
-
}), e.onSelect(e.widgetId),
|
|
300
|
+
}), e.onSelect(e.widgetId), c?.focus({
|
|
266
301
|
preventScroll: !0
|
|
267
302
|
}), e.onStartOptimisticFront(e.widgetId);
|
|
268
|
-
const i =
|
|
269
|
-
|
|
303
|
+
const i = G("drag", "grabbing"), o = Math.max(e.viewportScale, 1e-3);
|
|
304
|
+
I({
|
|
270
305
|
pointerId: t.pointerId,
|
|
271
306
|
startClientX: t.clientX,
|
|
272
307
|
startClientY: t.clientY,
|
|
@@ -274,46 +309,48 @@ function re(e) {
|
|
|
274
309
|
startWorldY: e.y,
|
|
275
310
|
worldX: e.x,
|
|
276
311
|
worldY: e.y,
|
|
312
|
+
autoPanWorldX: 0,
|
|
313
|
+
autoPanWorldY: 0,
|
|
277
314
|
moved: !1,
|
|
278
|
-
scale:
|
|
315
|
+
scale: o,
|
|
279
316
|
stopInteraction: i
|
|
280
|
-
});
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
if (!
|
|
284
|
-
const
|
|
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;
|
|
285
322
|
return {
|
|
286
|
-
...
|
|
287
|
-
worldX:
|
|
323
|
+
...n,
|
|
324
|
+
worldX: g,
|
|
288
325
|
worldY: f,
|
|
289
|
-
moved:
|
|
326
|
+
moved: n.moved || Math.abs(g - n.startWorldX) > 2 || Math.abs(f - n.startWorldY) > 2
|
|
290
327
|
};
|
|
291
328
|
});
|
|
292
329
|
};
|
|
293
|
-
|
|
330
|
+
v = ut({
|
|
294
331
|
pointerEvent: t,
|
|
295
332
|
captureEl: t.currentTarget,
|
|
296
|
-
onMove:
|
|
333
|
+
onMove: a,
|
|
297
334
|
onEnd: ({
|
|
298
|
-
commit:
|
|
299
|
-
}) =>
|
|
335
|
+
commit: r
|
|
336
|
+
}) => Tt(r)
|
|
300
337
|
});
|
|
301
|
-
},
|
|
302
|
-
const i =
|
|
338
|
+
}, Wt = (t) => {
|
|
339
|
+
const i = _(M);
|
|
303
340
|
if (!i) return;
|
|
304
|
-
const
|
|
341
|
+
const o = {
|
|
305
342
|
width: i.width,
|
|
306
343
|
height: i.height
|
|
307
|
-
},
|
|
308
|
-
t &&
|
|
309
|
-
},
|
|
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) => {
|
|
310
347
|
if (t.button !== 0 || e.locked) return;
|
|
311
|
-
t.preventDefault(), t.stopPropagation(),
|
|
348
|
+
t.preventDefault(), t.stopPropagation(), S?.stop({
|
|
312
349
|
reason: "manual_stop",
|
|
313
350
|
commit: !1
|
|
314
351
|
}), e.onStartOptimisticFront(e.widgetId);
|
|
315
|
-
const i =
|
|
316
|
-
|
|
352
|
+
const i = G("resize", "nwse-resize"), o = Math.max(e.viewportScale, 1e-3);
|
|
353
|
+
X({
|
|
317
354
|
pointerId: t.pointerId,
|
|
318
355
|
startClientX: t.clientX,
|
|
319
356
|
startClientY: t.clientY,
|
|
@@ -321,52 +358,52 @@ function re(e) {
|
|
|
321
358
|
startHeight: e.height,
|
|
322
359
|
width: e.width,
|
|
323
360
|
height: e.height,
|
|
324
|
-
scale:
|
|
361
|
+
scale: o,
|
|
325
362
|
stopInteraction: i
|
|
326
363
|
});
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
if (!
|
|
330
|
-
const
|
|
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);
|
|
331
368
|
return {
|
|
332
|
-
...
|
|
333
|
-
width:
|
|
369
|
+
...n,
|
|
370
|
+
width: g,
|
|
334
371
|
height: f
|
|
335
372
|
};
|
|
336
373
|
});
|
|
337
374
|
};
|
|
338
|
-
|
|
375
|
+
S = ut({
|
|
339
376
|
pointerEvent: t,
|
|
340
377
|
captureEl: t.currentTarget,
|
|
341
|
-
onMove:
|
|
378
|
+
onMove: a,
|
|
342
379
|
onEnd: ({
|
|
343
|
-
commit:
|
|
344
|
-
}) =>
|
|
380
|
+
commit: r
|
|
381
|
+
}) => Wt(r)
|
|
345
382
|
});
|
|
346
383
|
};
|
|
347
384
|
return (() => {
|
|
348
|
-
var t =
|
|
349
|
-
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({
|
|
350
387
|
get classList() {
|
|
351
388
|
return {
|
|
352
|
-
"is-selected":
|
|
353
|
-
"is-dragging":
|
|
354
|
-
"is-resizing":
|
|
389
|
+
"is-selected": y(),
|
|
390
|
+
"is-dragging": j(),
|
|
391
|
+
"is-resizing": F(),
|
|
355
392
|
"is-filtered-out": e.filtered,
|
|
356
393
|
"is-projected-surface": e.layoutMode === "projected_surface",
|
|
357
394
|
"is-locked": e.locked
|
|
358
395
|
};
|
|
359
396
|
}
|
|
360
397
|
}, () => ({
|
|
361
|
-
[
|
|
398
|
+
[d().dialogSurfaceHostAttr]: "true"
|
|
362
399
|
}), {
|
|
363
400
|
get "data-floe-workbench-widget-id"() {
|
|
364
401
|
return e.widgetId;
|
|
365
402
|
}
|
|
366
403
|
}, () => ({
|
|
367
|
-
[
|
|
404
|
+
[d().widgetRootAttr]: "true"
|
|
368
405
|
}), () => ({
|
|
369
|
-
[
|
|
406
|
+
[d().widgetIdAttr]: e.widgetId
|
|
370
407
|
}), {
|
|
371
408
|
get "data-workbench-widget-type"() {
|
|
372
409
|
return e.widgetType;
|
|
@@ -375,49 +412,49 @@ function re(e) {
|
|
|
375
412
|
return e.layoutMode ?? "canvas_scaled";
|
|
376
413
|
}
|
|
377
414
|
}, () => ({
|
|
378
|
-
[
|
|
415
|
+
[Ot]: y() ? "true" : void 0
|
|
379
416
|
}), {
|
|
380
417
|
tabIndex: 0,
|
|
381
|
-
onPointerDown:
|
|
418
|
+
onPointerDown: Pt,
|
|
382
419
|
onFocus: () => {
|
|
383
|
-
|
|
420
|
+
z() || e.onSelect(e.widgetId);
|
|
384
421
|
},
|
|
385
|
-
onContextMenu: (
|
|
386
|
-
|
|
422
|
+
onContextMenu: (l) => {
|
|
423
|
+
E(l.target) === "widget_shell" && (l.preventDefault(), l.stopPropagation(), e.onContextMenu(l, e.itemSnapshot()));
|
|
387
424
|
},
|
|
388
425
|
get style() {
|
|
389
|
-
return
|
|
426
|
+
return xt();
|
|
390
427
|
}
|
|
391
|
-
}), !1, !0),
|
|
392
|
-
[
|
|
393
|
-
}, !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, {
|
|
394
431
|
class: "workbench-widget__traffic-icon",
|
|
395
432
|
"aria-hidden": "true"
|
|
396
|
-
})),
|
|
433
|
+
})), n.$$click = Q, n.$$pointerdown = (l) => l.stopPropagation(), s(n, h(st, {
|
|
397
434
|
class: "workbench-widget__traffic-icon",
|
|
398
435
|
"aria-hidden": "true"
|
|
399
|
-
})),
|
|
436
|
+
})), g.$$click = tt, g.$$pointerdown = (l) => l.stopPropagation(), s(g, h(wt, {
|
|
400
437
|
class: "workbench-widget__traffic-icon",
|
|
401
438
|
"aria-hidden": "true"
|
|
402
|
-
})),
|
|
439
|
+
})), s(f, Mt), V.$$pointerdown = it, s(V, h(Ht, {
|
|
403
440
|
class: "w-3.5 h-3.5"
|
|
404
|
-
})),
|
|
405
|
-
const
|
|
406
|
-
return
|
|
441
|
+
})), s(q, () => {
|
|
442
|
+
const l = e.definition.icon;
|
|
443
|
+
return h(l, {
|
|
407
444
|
class: "w-3.5 h-3.5"
|
|
408
445
|
});
|
|
409
|
-
},
|
|
446
|
+
}, ot), s(ot, () => e.widgetTitle), A.$$click = Q, A.$$pointerdown = (l) => l.stopPropagation(), s(A, h(st, {
|
|
410
447
|
class: "workbench-widget__window-control-icon",
|
|
411
448
|
"aria-hidden": "true"
|
|
412
|
-
})),
|
|
449
|
+
})), R.$$click = tt, R.$$pointerdown = (l) => l.stopPropagation(), s(R, h(wt, {
|
|
413
450
|
class: "workbench-widget__window-control-icon",
|
|
414
451
|
"aria-hidden": "true"
|
|
415
|
-
})),
|
|
452
|
+
})), B.$$click = et, B.$$pointerdown = (l) => l.stopPropagation(), s(B, h(dt, {
|
|
416
453
|
class: "workbench-widget__window-control-icon",
|
|
417
454
|
"aria-hidden": "true"
|
|
418
|
-
})),
|
|
419
|
-
const
|
|
420
|
-
return
|
|
455
|
+
})), s(At, () => {
|
|
456
|
+
const l = e.definition.body;
|
|
457
|
+
return h(l, {
|
|
421
458
|
get widgetId() {
|
|
422
459
|
return e.widgetId;
|
|
423
460
|
},
|
|
@@ -427,31 +464,31 @@ function re(e) {
|
|
|
427
464
|
get type() {
|
|
428
465
|
return e.widgetType;
|
|
429
466
|
},
|
|
430
|
-
surfaceMetrics:
|
|
467
|
+
surfaceMetrics: H,
|
|
431
468
|
get activation() {
|
|
432
|
-
return
|
|
469
|
+
return ht();
|
|
433
470
|
},
|
|
434
471
|
get lifecycle() {
|
|
435
|
-
return
|
|
472
|
+
return kt();
|
|
436
473
|
},
|
|
437
474
|
get selected() {
|
|
438
|
-
return
|
|
475
|
+
return y();
|
|
439
476
|
},
|
|
440
477
|
get filtered() {
|
|
441
478
|
return e.filtered;
|
|
442
479
|
},
|
|
443
|
-
requestActivate:
|
|
480
|
+
requestActivate: pt
|
|
444
481
|
});
|
|
445
|
-
}),
|
|
446
|
-
var
|
|
447
|
-
return () =>
|
|
448
|
-
var
|
|
449
|
-
return
|
|
482
|
+
}), s(i, (() => {
|
|
483
|
+
var l = Xt(() => !!e.locked);
|
|
484
|
+
return () => l() ? null : (() => {
|
|
485
|
+
var rt = ee();
|
|
486
|
+
return rt.$$pointerdown = Ct, rt;
|
|
450
487
|
})();
|
|
451
|
-
})(), null),
|
|
488
|
+
})(), null), zt((l) => Yt(i, It(), l)), t;
|
|
452
489
|
})();
|
|
453
490
|
}
|
|
454
|
-
|
|
491
|
+
jt(["pointerdown", "click"]);
|
|
455
492
|
export {
|
|
456
|
-
|
|
493
|
+
he as WorkbenchWidget
|
|
457
494
|
};
|