@floegence/floe-webapp-core 0.36.16 → 0.36.17
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 +79 -71
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/pointerSession.d.ts +35 -0
- package/dist/components/ui/pointerSession.js +85 -0
- package/dist/components/workbench/WorkbenchFilterBar.js +119 -117
- package/dist/components/workbench/WorkbenchWidget.js +118 -115
- package/dist/full.js +71 -69
- package/dist/ui.js +26 -24
- package/package.json +1 -1
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { startHotInteraction as
|
|
4
|
-
import { X as
|
|
5
|
-
import { CANVAS_WHEEL_INTERACTIVE_ATTR as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { spread as H, mergeProps as et, insert as l, createComponent as c, memo as it, template as B, use as nt, delegateEvents as ot } from "solid-js/web";
|
|
2
|
+
import { createSignal as L, onCleanup as at, untrack as S, createMemo as _ } from "solid-js";
|
|
3
|
+
import { startHotInteraction as O } from "../../utils/hotInteraction.js";
|
|
4
|
+
import { X as F, Minus as N, Maximize as A, GripVertical as rt } from "../icons/index.js";
|
|
5
|
+
import { CANVAS_WHEEL_INTERACTIVE_ATTR as dt, WORKBENCH_WIDGET_SHELL_ATTR as lt, resolveWorkbenchWidgetEventOwnership as ct } from "../ui/localInteractionSurface.js";
|
|
6
|
+
import { startPointerSession as j } from "../ui/pointerSession.js";
|
|
7
|
+
import { createWorkbenchWidgetSurfaceMetrics as st } from "./workbenchHelpers.js";
|
|
8
|
+
var wt = /* @__PURE__ */ B('<article class=workbench-widget data-floe-dialog-surface-host=true><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>'), gt = /* @__PURE__ */ B('<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">');
|
|
9
|
+
const ht = 220, ut = 160, _t = '[data-floe-canvas-interactive="true"]', ft = '[data-floe-canvas-pan-surface="true"]';
|
|
10
|
+
function xt(t) {
|
|
11
|
+
const [f, I] = L(null), [b, x] = L(null);
|
|
12
|
+
let g, h, u;
|
|
13
|
+
at(() => {
|
|
14
|
+
g?.stop({
|
|
15
|
+
reason: "manual_stop",
|
|
16
|
+
commit: !1
|
|
17
|
+
}), g = void 0, h?.stop({
|
|
18
|
+
reason: "manual_stop",
|
|
19
|
+
commit: !1
|
|
20
|
+
}), h = void 0, S(f)?.stopInteraction(), S(b)?.stopInteraction();
|
|
14
21
|
});
|
|
15
|
-
const
|
|
22
|
+
const C = () => f() !== null, W = () => b() !== null, E = (e) => ct({
|
|
16
23
|
target: e,
|
|
17
|
-
widgetRoot:
|
|
18
|
-
interactiveSelector:
|
|
19
|
-
panSurfaceSelector:
|
|
20
|
-
}),
|
|
21
|
-
e.button === 0 && (t.onSelect(t.widgetId), t.onCommitFront(t.widgetId),
|
|
24
|
+
widgetRoot: u ?? null,
|
|
25
|
+
interactiveSelector: _t,
|
|
26
|
+
panSurfaceSelector: ft
|
|
27
|
+
}), V = (e) => {
|
|
28
|
+
e.button === 0 && (t.onSelect(t.widgetId), t.onCommitFront(t.widgetId), E(e.target) === "widget_shell" && u?.focus({
|
|
22
29
|
preventScroll: !0
|
|
23
30
|
}));
|
|
24
|
-
},
|
|
25
|
-
const e =
|
|
31
|
+
}, m = _(() => {
|
|
32
|
+
const e = f();
|
|
26
33
|
return e ? {
|
|
27
34
|
x: e.worldX,
|
|
28
35
|
y: e.worldY
|
|
@@ -30,8 +37,8 @@ function kt(t) {
|
|
|
30
37
|
x: t.x,
|
|
31
38
|
y: t.y
|
|
32
39
|
};
|
|
33
|
-
}),
|
|
34
|
-
const e =
|
|
40
|
+
}), v = _(() => {
|
|
41
|
+
const e = b();
|
|
35
42
|
return e ? {
|
|
36
43
|
width: e.width,
|
|
37
44
|
height: e.height
|
|
@@ -39,34 +46,34 @@ function kt(t) {
|
|
|
39
46
|
width: t.width,
|
|
40
47
|
height: t.height
|
|
41
48
|
};
|
|
42
|
-
}),
|
|
49
|
+
}), R = _(() => {
|
|
43
50
|
if (!(t.layoutMode !== "projected_surface" || !t.projectedViewport))
|
|
44
|
-
return
|
|
51
|
+
return st({
|
|
45
52
|
widgetId: t.widgetId,
|
|
46
|
-
worldX:
|
|
47
|
-
worldY:
|
|
48
|
-
worldWidth:
|
|
49
|
-
worldHeight:
|
|
53
|
+
worldX: m().x,
|
|
54
|
+
worldY: m().y,
|
|
55
|
+
worldWidth: v().width,
|
|
56
|
+
worldHeight: v().height,
|
|
50
57
|
viewport: t.projectedViewport,
|
|
51
58
|
ready: t.surfaceReady ?? !0
|
|
52
59
|
});
|
|
53
|
-
}),
|
|
60
|
+
}), G = _(() => {
|
|
54
61
|
const e = t.itemSnapshot().z_index, i = Number.isFinite(e) ? Math.max(1, Math.min(99, Math.round(e))) : 1;
|
|
55
62
|
return String(i).padStart(2, "0");
|
|
56
|
-
}),
|
|
63
|
+
}), z = (e) => {
|
|
57
64
|
e.preventDefault(), e.stopPropagation(), t.onRequestOverview(t.itemSnapshot());
|
|
58
65
|
}, T = (e) => {
|
|
59
66
|
e.preventDefault(), e.stopPropagation(), t.onRequestFit(t.itemSnapshot());
|
|
60
|
-
},
|
|
67
|
+
}, D = (e) => {
|
|
61
68
|
e.preventDefault(), e.stopPropagation(), t.onRequestDelete(t.widgetId);
|
|
62
|
-
},
|
|
69
|
+
}, Z = _(() => {
|
|
63
70
|
const e = {
|
|
64
|
-
width: `${
|
|
65
|
-
height: `${
|
|
66
|
-
"z-index":
|
|
71
|
+
width: `${v().width}px`,
|
|
72
|
+
height: `${v().height}px`,
|
|
73
|
+
"z-index": C() || W() || t.optimisticFront ? `${t.topRenderLayer + 1}` : `${t.renderLayer}`
|
|
67
74
|
};
|
|
68
75
|
if (t.layoutMode === "projected_surface") {
|
|
69
|
-
const i =
|
|
76
|
+
const i = R()?.rect;
|
|
70
77
|
return {
|
|
71
78
|
...e,
|
|
72
79
|
left: `${i?.screenX ?? 0}px`,
|
|
@@ -76,10 +83,10 @@ function kt(t) {
|
|
|
76
83
|
}
|
|
77
84
|
return {
|
|
78
85
|
...e,
|
|
79
|
-
transform: `translate(${
|
|
86
|
+
transform: `translate(${m().x}px, ${m().y}px)`
|
|
80
87
|
};
|
|
81
|
-
}),
|
|
82
|
-
const i =
|
|
88
|
+
}), q = (e) => {
|
|
89
|
+
const i = S(f);
|
|
83
90
|
if (!i) return;
|
|
84
91
|
const d = {
|
|
85
92
|
x: i.worldX,
|
|
@@ -87,18 +94,21 @@ function kt(t) {
|
|
|
87
94
|
}, r = {
|
|
88
95
|
x: i.startWorldX,
|
|
89
96
|
y: i.startWorldY
|
|
90
|
-
},
|
|
91
|
-
t.onCommitFront(t.widgetId),
|
|
92
|
-
},
|
|
97
|
+
}, a = e && (Math.abs(d.x - r.x) > 1 || Math.abs(d.y - r.y) > 1);
|
|
98
|
+
t.onCommitFront(t.widgetId), a && t.onCommitMove(t.widgetId, d), i.stopInteraction(), I(null), g = void 0;
|
|
99
|
+
}, X = (e) => {
|
|
93
100
|
if (e.button !== 0 || t.locked) return;
|
|
94
|
-
e.preventDefault(), e.stopPropagation(),
|
|
101
|
+
e.preventDefault(), e.stopPropagation(), g?.stop({
|
|
102
|
+
reason: "manual_stop",
|
|
103
|
+
commit: !1
|
|
104
|
+
}), t.onSelect(t.widgetId), u?.focus({
|
|
95
105
|
preventScroll: !0
|
|
96
106
|
}), t.onStartOptimisticFront(t.widgetId);
|
|
97
|
-
const i =
|
|
107
|
+
const i = O({
|
|
98
108
|
kind: "drag",
|
|
99
109
|
cursor: "grabbing"
|
|
100
110
|
}), d = Math.max(t.viewportScale, 1e-3);
|
|
101
|
-
|
|
111
|
+
I({
|
|
102
112
|
pointerId: e.pointerId,
|
|
103
113
|
startClientX: e.clientX,
|
|
104
114
|
startClientY: e.clientY,
|
|
@@ -111,46 +121,44 @@ function kt(t) {
|
|
|
111
121
|
stopInteraction: i
|
|
112
122
|
});
|
|
113
123
|
const r = (a) => {
|
|
114
|
-
|
|
124
|
+
I((n) => {
|
|
115
125
|
if (!n || n.pointerId !== a.pointerId) return n;
|
|
116
|
-
const
|
|
126
|
+
const w = n.startWorldX + (a.clientX - n.startClientX) / n.scale, s = n.startWorldY + (a.clientY - n.startClientY) / n.scale;
|
|
117
127
|
return {
|
|
118
128
|
...n,
|
|
119
|
-
worldX:
|
|
120
|
-
worldY:
|
|
121
|
-
moved: n.moved || Math.abs(
|
|
129
|
+
worldX: w,
|
|
130
|
+
worldY: s,
|
|
131
|
+
moved: n.moved || Math.abs(w - n.startWorldX) > 2 || Math.abs(s - n.startWorldY) > 2
|
|
122
132
|
};
|
|
123
133
|
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
once: !0,
|
|
133
|
-
signal: l.signal
|
|
134
|
-
}), window.addEventListener("pointercancel", g, {
|
|
135
|
-
once: !0,
|
|
136
|
-
signal: l.signal
|
|
134
|
+
};
|
|
135
|
+
g = j({
|
|
136
|
+
pointerEvent: e,
|
|
137
|
+
captureEl: e.currentTarget,
|
|
138
|
+
onMove: r,
|
|
139
|
+
onEnd: ({
|
|
140
|
+
commit: a
|
|
141
|
+
}) => q(a)
|
|
137
142
|
});
|
|
138
|
-
},
|
|
139
|
-
const i =
|
|
143
|
+
}, K = (e) => {
|
|
144
|
+
const i = S(b);
|
|
140
145
|
if (!i) return;
|
|
141
146
|
const d = {
|
|
142
147
|
width: i.width,
|
|
143
148
|
height: i.height
|
|
144
149
|
}, r = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
|
|
145
|
-
e && r && t.onCommitResize(t.widgetId, d), i.stopInteraction(),
|
|
150
|
+
e && r && t.onCommitResize(t.widgetId, d), i.stopInteraction(), x(null), h = void 0;
|
|
146
151
|
}, U = (e) => {
|
|
147
152
|
if (e.button !== 0 || t.locked) return;
|
|
148
|
-
e.preventDefault(), e.stopPropagation(),
|
|
149
|
-
|
|
153
|
+
e.preventDefault(), e.stopPropagation(), h?.stop({
|
|
154
|
+
reason: "manual_stop",
|
|
155
|
+
commit: !1
|
|
156
|
+
}), t.onStartOptimisticFront(t.widgetId);
|
|
157
|
+
const i = O({
|
|
150
158
|
kind: "drag",
|
|
151
159
|
cursor: "nwse-resize"
|
|
152
160
|
}), d = Math.max(t.viewportScale, 1e-3);
|
|
153
|
-
|
|
161
|
+
x({
|
|
154
162
|
pointerId: e.pointerId,
|
|
155
163
|
startClientX: e.clientX,
|
|
156
164
|
startClientY: e.clientY,
|
|
@@ -162,38 +170,33 @@ function kt(t) {
|
|
|
162
170
|
stopInteraction: i
|
|
163
171
|
});
|
|
164
172
|
const r = (a) => {
|
|
165
|
-
|
|
173
|
+
x((n) => {
|
|
166
174
|
if (!n || n.pointerId !== a.pointerId) return n;
|
|
167
|
-
const
|
|
175
|
+
const w = Math.max(ht, n.startWidth + (a.clientX - n.startClientX) / n.scale), s = Math.max(ut, n.startHeight + (a.clientY - n.startClientY) / n.scale);
|
|
168
176
|
return {
|
|
169
177
|
...n,
|
|
170
|
-
width:
|
|
171
|
-
height:
|
|
178
|
+
width: w,
|
|
179
|
+
height: s
|
|
172
180
|
};
|
|
173
181
|
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
once: !0,
|
|
183
|
-
signal: l.signal
|
|
184
|
-
}), window.addEventListener("pointercancel", g, {
|
|
185
|
-
once: !0,
|
|
186
|
-
signal: l.signal
|
|
182
|
+
};
|
|
183
|
+
h = j({
|
|
184
|
+
pointerEvent: e,
|
|
185
|
+
captureEl: e.currentTarget,
|
|
186
|
+
onMove: r,
|
|
187
|
+
onEnd: ({
|
|
188
|
+
commit: a
|
|
189
|
+
}) => K(a)
|
|
187
190
|
});
|
|
188
191
|
};
|
|
189
192
|
return (() => {
|
|
190
|
-
var e =
|
|
191
|
-
return typeof
|
|
193
|
+
var e = wt(), i = e.firstChild, d = i.firstChild, r = d.firstChild, a = r.nextSibling, n = a.nextSibling, w = d.nextSibling, s = w.nextSibling, M = s.nextSibling, J = M.firstChild, p = J.nextSibling, Q = M.nextSibling, $ = Q.firstChild, k = $.nextSibling, y = k.nextSibling, tt = i.nextSibling, P = u;
|
|
194
|
+
return typeof P == "function" ? nt(P, e) : u = e, H(e, et({
|
|
192
195
|
get classList() {
|
|
193
196
|
return {
|
|
194
197
|
"is-selected": t.selected,
|
|
195
|
-
"is-dragging":
|
|
196
|
-
"is-resizing":
|
|
198
|
+
"is-dragging": C(),
|
|
199
|
+
"is-resizing": W(),
|
|
197
200
|
"is-filtered-out": t.filtered,
|
|
198
201
|
"is-projected-surface": t.layoutMode === "projected_surface",
|
|
199
202
|
"is-locked": t.locked
|
|
@@ -209,49 +212,49 @@ function kt(t) {
|
|
|
209
212
|
return t.layoutMode ?? "canvas_scaled";
|
|
210
213
|
}
|
|
211
214
|
}, () => ({
|
|
212
|
-
[
|
|
215
|
+
[dt]: t.selected ? "true" : void 0
|
|
213
216
|
}), {
|
|
214
217
|
tabIndex: 0,
|
|
215
|
-
onPointerDown:
|
|
218
|
+
onPointerDown: V,
|
|
216
219
|
onFocus: () => {
|
|
217
220
|
t.onSelect(t.widgetId);
|
|
218
221
|
},
|
|
219
222
|
onContextMenu: (o) => {
|
|
220
|
-
|
|
223
|
+
E(o.target) === "widget_shell" && (o.preventDefault(), o.stopPropagation(), t.onContextMenu(o, t.itemSnapshot()));
|
|
221
224
|
},
|
|
222
225
|
get style() {
|
|
223
|
-
return
|
|
226
|
+
return Z();
|
|
224
227
|
}
|
|
225
|
-
}), !1, !0), i.$$pointerdown =
|
|
226
|
-
[
|
|
227
|
-
}, !1, !0), r.$$click =
|
|
228
|
+
}), !1, !0), i.$$pointerdown = X, H(i, {
|
|
229
|
+
[lt]: "true"
|
|
230
|
+
}, !1, !0), r.$$click = D, r.$$pointerdown = (o) => o.stopPropagation(), l(r, c(F, {
|
|
228
231
|
class: "workbench-widget__traffic-icon",
|
|
229
232
|
"aria-hidden": "true"
|
|
230
|
-
})),
|
|
233
|
+
})), a.$$click = z, a.$$pointerdown = (o) => o.stopPropagation(), l(a, c(N, {
|
|
231
234
|
class: "workbench-widget__traffic-icon",
|
|
232
235
|
"aria-hidden": "true"
|
|
233
|
-
})),
|
|
236
|
+
})), n.$$click = T, n.$$pointerdown = (o) => o.stopPropagation(), l(n, c(A, {
|
|
234
237
|
class: "workbench-widget__traffic-icon",
|
|
235
238
|
"aria-hidden": "true"
|
|
236
|
-
})),
|
|
239
|
+
})), l(w, G), s.$$pointerdown = X, l(s, c(rt, {
|
|
237
240
|
class: "w-3.5 h-3.5"
|
|
238
|
-
})),
|
|
241
|
+
})), l(M, () => {
|
|
239
242
|
const o = t.definition.icon;
|
|
240
|
-
return
|
|
243
|
+
return c(o, {
|
|
241
244
|
class: "w-3.5 h-3.5"
|
|
242
245
|
});
|
|
243
|
-
},
|
|
246
|
+
}, p), l(p, () => t.widgetTitle), $.$$click = z, $.$$pointerdown = (o) => o.stopPropagation(), l($, c(N, {
|
|
244
247
|
class: "workbench-widget__window-control-icon",
|
|
245
248
|
"aria-hidden": "true"
|
|
246
|
-
})),
|
|
249
|
+
})), k.$$click = T, k.$$pointerdown = (o) => o.stopPropagation(), l(k, c(A, {
|
|
247
250
|
class: "workbench-widget__window-control-icon",
|
|
248
251
|
"aria-hidden": "true"
|
|
249
|
-
})),
|
|
252
|
+
})), y.$$click = D, y.$$pointerdown = (o) => o.stopPropagation(), l(y, c(F, {
|
|
250
253
|
class: "workbench-widget__window-control-icon",
|
|
251
254
|
"aria-hidden": "true"
|
|
252
|
-
})),
|
|
255
|
+
})), l(tt, () => {
|
|
253
256
|
const o = t.definition.body;
|
|
254
|
-
return
|
|
257
|
+
return c(o, {
|
|
255
258
|
get widgetId() {
|
|
256
259
|
return t.widgetId;
|
|
257
260
|
},
|
|
@@ -262,19 +265,19 @@ function kt(t) {
|
|
|
262
265
|
return t.widgetType;
|
|
263
266
|
},
|
|
264
267
|
get surfaceMetrics() {
|
|
265
|
-
return
|
|
268
|
+
return R();
|
|
266
269
|
}
|
|
267
270
|
});
|
|
268
|
-
}),
|
|
269
|
-
var o =
|
|
271
|
+
}), l(e, (() => {
|
|
272
|
+
var o = it(() => !!t.locked);
|
|
270
273
|
return () => o() ? null : (() => {
|
|
271
|
-
var
|
|
272
|
-
return
|
|
274
|
+
var Y = gt();
|
|
275
|
+
return Y.$$pointerdown = U, Y;
|
|
273
276
|
})();
|
|
274
277
|
})(), null), e;
|
|
275
278
|
})();
|
|
276
279
|
}
|
|
277
|
-
|
|
280
|
+
ot(["pointerdown", "click"]);
|
|
278
281
|
export {
|
|
279
|
-
|
|
282
|
+
xt as WorkbenchWidget
|
|
280
283
|
};
|