@floegence/floe-webapp-core 0.36.1 → 0.36.2
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/deck/DeckCell.js +4 -4
- package/dist/components/ui/Dialog.js +115 -87
- package/dist/components/ui/FloatingWindow.js +158 -144
- package/dist/components/ui/dialogSurfaceScope.d.ts +14 -0
- package/dist/components/ui/dialogSurfaceScope.js +45 -0
- package/dist/components/workbench/WorkbenchCanvas.js +54 -60
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +25 -0
- package/dist/components/workbench/WorkbenchCanvasField.js +145 -0
- package/dist/components/workbench/WorkbenchWidget.d.ts +10 -2
- package/dist/components/workbench/WorkbenchWidget.js +74 -74
- package/dist/hooks/useOverlayMask.d.ts +11 -9
- package/dist/hooks/useOverlayMask.js +54 -52
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { createComponent as s, Portal as
|
|
2
|
-
import { createUniqueId as
|
|
1
|
+
import { createComponent as s, Portal as Oe, insert as w, effect as u, setAttribute as Y, addEventListener as g, className as a, memo as Xe, setStyleProperty as I, template as E, use as Ye, delegateEvents as qe } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as Te, createSignal as x, onMount as Be, onCleanup as q, createEffect as $, Show as p, batch as Ue } from "solid-js";
|
|
3
3
|
import { cn as C } from "../../utils/cn.js";
|
|
4
|
-
import { useLayout as
|
|
4
|
+
import { useLayout as Ne } from "../../context/LayoutContext.js";
|
|
5
5
|
import { Button as ze } from "./Button.js";
|
|
6
|
-
import { Restore as
|
|
7
|
-
import { startHotInteraction as
|
|
8
|
-
import { normalizeFloatingWindowRect as
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
const
|
|
6
|
+
import { Restore as je, Maximize as Ge, X as Ve } from "../icons/index.js";
|
|
7
|
+
import { startHotInteraction as Ze } from "../../utils/hotInteraction.js";
|
|
8
|
+
import { normalizeFloatingWindowRect as pe, resolveFloatingWindowRect as Je } from "./floatingWindowGeometry.js";
|
|
9
|
+
var Ke = /* @__PURE__ */ E('<h2 class="text-sm font-medium truncate select-none">'), Qe = /* @__PURE__ */ E('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), m = /* @__PURE__ */ E("<div style=touch-action:none>"), et = /* @__PURE__ */ E('<div data-floe-geometry-surface=floating-window role=dialog tabindex=-1><div data-floe-dialog-surface-host=true data-floe-floating-window-surface=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0"></div><div class="flex items-center gap-0.5 -mr-1"></div></div><div class="flex-1 overflow-auto p-3">');
|
|
10
|
+
function dt(i) {
|
|
11
|
+
const T = () => i.resizable ?? !0, B = () => i.draggable ?? !0, M = () => i.minSize ?? {
|
|
12
12
|
width: 200,
|
|
13
13
|
height: 150
|
|
14
|
-
},
|
|
14
|
+
}, F = () => i.maxSize ?? {
|
|
15
15
|
width: 1 / 0,
|
|
16
16
|
height: 1 / 0
|
|
17
|
-
}, be = () => i.zIndex ?? 100,
|
|
17
|
+
}, be = () => i.zIndex ?? 100, Pe = Te(), Se = Ne(), b = () => Se.isMobile(), L = 16, U = () => `floating-window-${Pe}-title`, [_, Ie] = x(i.defaultPosition ?? {
|
|
18
18
|
x: 0,
|
|
19
19
|
y: 0
|
|
20
|
-
}), [
|
|
20
|
+
}), [A, $e] = x(i.defaultSize ?? {
|
|
21
21
|
width: 400,
|
|
22
22
|
height: 300
|
|
23
|
-
}), [d,
|
|
24
|
-
let
|
|
23
|
+
}), [d, N] = x(!1), [j, G] = x(!1), [V, Z] = x(!1), [Re, D] = x(!1), [Ce, Ee] = x(null);
|
|
24
|
+
let J = {
|
|
25
25
|
x: 0,
|
|
26
26
|
y: 0
|
|
27
|
-
},
|
|
27
|
+
}, K = {
|
|
28
28
|
x: 0,
|
|
29
29
|
y: 0,
|
|
30
30
|
width: 0,
|
|
31
31
|
height: 0
|
|
32
|
-
},
|
|
32
|
+
}, Q = {
|
|
33
33
|
x: 0,
|
|
34
34
|
y: 0
|
|
35
|
-
},
|
|
35
|
+
}, ee = {
|
|
36
36
|
x: 0,
|
|
37
37
|
y: 0,
|
|
38
38
|
width: 0,
|
|
39
39
|
height: 0
|
|
40
|
-
},
|
|
40
|
+
}, te = "se", r, l = null, v = null, P = {
|
|
41
41
|
x: 0,
|
|
42
42
|
y: 0
|
|
43
|
-
},
|
|
43
|
+
}, y = null, R = null, ne = !1, z = {
|
|
44
44
|
x: i.defaultPosition?.x ?? 0,
|
|
45
45
|
y: i.defaultPosition?.y ?? 0,
|
|
46
46
|
width: i.defaultSize?.width ?? 400,
|
|
47
47
|
height: i.defaultSize?.height ?? 300
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
const Me = {
|
|
50
50
|
n: "ns-resize",
|
|
51
51
|
s: "ns-resize",
|
|
52
52
|
e: "ew-resize",
|
|
@@ -55,35 +55,45 @@ function lt(i) {
|
|
|
55
55
|
nw: "nwse-resize",
|
|
56
56
|
se: "nwse-resize",
|
|
57
57
|
sw: "nesw-resize"
|
|
58
|
-
},
|
|
58
|
+
}, k = (e, n) => {
|
|
59
59
|
if (!e) {
|
|
60
60
|
R?.(), R = null;
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
R?.(), R =
|
|
63
|
+
R?.(), R = Ze({
|
|
64
64
|
kind: v === "resize" ? "resize" : "drag",
|
|
65
65
|
cursor: n,
|
|
66
66
|
lockUserSelect: !0
|
|
67
67
|
});
|
|
68
|
-
},
|
|
69
|
-
|
|
68
|
+
}, ie = (e) => {
|
|
69
|
+
z = e, r && (r.style.transform = `translate3d(${e.x}px, ${e.y}px, 0)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`);
|
|
70
70
|
}, W = () => {
|
|
71
|
-
const e =
|
|
71
|
+
const e = _(), n = A();
|
|
72
72
|
return {
|
|
73
73
|
x: e.x,
|
|
74
74
|
y: e.y,
|
|
75
75
|
width: n.width,
|
|
76
76
|
height: n.height
|
|
77
77
|
};
|
|
78
|
-
},
|
|
79
|
-
|
|
78
|
+
}, S = (e) => {
|
|
79
|
+
z = e, Ie({
|
|
80
80
|
x: e.x,
|
|
81
81
|
y: e.y
|
|
82
|
-
}),
|
|
82
|
+
}), $e({
|
|
83
83
|
width: e.width,
|
|
84
84
|
height: e.height
|
|
85
85
|
});
|
|
86
|
-
},
|
|
86
|
+
}, Fe = () => {
|
|
87
|
+
try {
|
|
88
|
+
r?.focus({
|
|
89
|
+
preventScroll: !0
|
|
90
|
+
});
|
|
91
|
+
} catch {
|
|
92
|
+
}
|
|
93
|
+
}, Le = (e) => {
|
|
94
|
+
const n = e instanceof Element ? e : null;
|
|
95
|
+
return n ? n.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
|
|
96
|
+
}, H = (e) => !!r && e instanceof Node && r.contains(e), _e = () => {
|
|
87
97
|
if (!r) return null;
|
|
88
98
|
const e = r.getBoundingClientRect();
|
|
89
99
|
return {
|
|
@@ -92,32 +102,32 @@ function lt(i) {
|
|
|
92
102
|
width: e.width,
|
|
93
103
|
height: e.height
|
|
94
104
|
};
|
|
95
|
-
},
|
|
96
|
-
i.open && (
|
|
105
|
+
}, re = () => {
|
|
106
|
+
i.open && (l === null || v === null || typeof window > "u" || ie(Je({
|
|
97
107
|
mode: v,
|
|
98
|
-
pointer:
|
|
99
|
-
dragStartPos:
|
|
100
|
-
dragStartRect:
|
|
101
|
-
resizeStartPos:
|
|
102
|
-
resizeStartRect:
|
|
103
|
-
resizeHandle:
|
|
108
|
+
pointer: P,
|
|
109
|
+
dragStartPos: J,
|
|
110
|
+
dragStartRect: K,
|
|
111
|
+
resizeStartPos: Q,
|
|
112
|
+
resizeStartRect: ee,
|
|
113
|
+
resizeHandle: te,
|
|
104
114
|
minSize: M(),
|
|
105
|
-
maxSize:
|
|
115
|
+
maxSize: F(),
|
|
106
116
|
viewport: {
|
|
107
117
|
width: window.innerWidth,
|
|
108
118
|
height: window.innerHeight
|
|
109
119
|
},
|
|
110
|
-
mobile:
|
|
111
|
-
mobilePadding:
|
|
120
|
+
mobile: b(),
|
|
121
|
+
mobilePadding: L
|
|
112
122
|
})));
|
|
113
|
-
},
|
|
123
|
+
}, O = (e) => {
|
|
114
124
|
if (typeof window > "u") return;
|
|
115
125
|
const n = {
|
|
116
126
|
width: window.innerWidth,
|
|
117
127
|
height: window.innerHeight
|
|
118
128
|
};
|
|
119
129
|
if (d()) {
|
|
120
|
-
|
|
130
|
+
S({
|
|
121
131
|
x: 0,
|
|
122
132
|
y: 0,
|
|
123
133
|
width: n.width,
|
|
@@ -125,44 +135,44 @@ function lt(i) {
|
|
|
125
135
|
});
|
|
126
136
|
return;
|
|
127
137
|
}
|
|
128
|
-
|
|
138
|
+
S(pe({
|
|
129
139
|
rect: W(),
|
|
130
140
|
minSize: M(),
|
|
131
|
-
maxSize:
|
|
141
|
+
maxSize: F(),
|
|
132
142
|
viewport: n,
|
|
133
|
-
mobile:
|
|
134
|
-
mobilePadding:
|
|
143
|
+
mobile: b(),
|
|
144
|
+
mobilePadding: L,
|
|
135
145
|
center: e?.center ?? !1
|
|
136
146
|
}));
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
const
|
|
147
|
+
}, X = (e, n = !0) => {
|
|
148
|
+
y !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(y), y = null), n && re();
|
|
149
|
+
const o = n ? _e() ?? z : null;
|
|
140
150
|
if (e !== void 0)
|
|
141
151
|
try {
|
|
142
|
-
r?.releasePointerCapture(e);
|
|
152
|
+
typeof r?.releasePointerCapture == "function" && r.releasePointerCapture(e);
|
|
143
153
|
} catch {
|
|
144
154
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}),
|
|
155
|
+
Ue(() => {
|
|
156
|
+
o && S(o), l = null, v = null, G(!1), Z(!1);
|
|
157
|
+
}), k(!1, "");
|
|
148
158
|
};
|
|
149
|
-
|
|
150
|
-
i.open ||
|
|
159
|
+
Be(() => {
|
|
160
|
+
i.open || O({
|
|
151
161
|
center: !i.defaultPosition
|
|
152
162
|
});
|
|
153
163
|
const e = () => {
|
|
154
|
-
|
|
164
|
+
l === null && O({
|
|
155
165
|
center: !1
|
|
156
166
|
});
|
|
157
167
|
};
|
|
158
|
-
window.addEventListener("resize", e),
|
|
168
|
+
window.addEventListener("resize", e), q(() => window.removeEventListener("resize", e));
|
|
159
169
|
}), $(() => {
|
|
160
170
|
if (!i.open) return;
|
|
161
|
-
|
|
162
|
-
const e = !
|
|
163
|
-
|
|
171
|
+
b();
|
|
172
|
+
const e = !ne && !i.defaultPosition, n = () => {
|
|
173
|
+
O({
|
|
164
174
|
center: e
|
|
165
|
-
}),
|
|
175
|
+
}), ne = !0;
|
|
166
176
|
};
|
|
167
177
|
if (typeof requestAnimationFrame > "u") {
|
|
168
178
|
n();
|
|
@@ -172,74 +182,76 @@ function lt(i) {
|
|
|
172
182
|
}), $(() => {
|
|
173
183
|
if (!i.open) return;
|
|
174
184
|
const e = (n) => {
|
|
175
|
-
n.key
|
|
185
|
+
if (n.key !== "Escape") return;
|
|
186
|
+
const o = typeof document < "u" ? document.activeElement : null;
|
|
187
|
+
!H(n.target) && !H(o) || (n.preventDefault(), typeof n.stopImmediatePropagation == "function" ? n.stopImmediatePropagation() : n.stopPropagation(), i.onOpenChange(!1));
|
|
176
188
|
};
|
|
177
|
-
document.addEventListener("keydown", e),
|
|
189
|
+
document.addEventListener("keydown", e, !0), q(() => document.removeEventListener("keydown", e, !0));
|
|
178
190
|
}), $(() => {
|
|
179
191
|
if (!i.open) {
|
|
180
|
-
|
|
192
|
+
D(!1), X(l ?? void 0, !1);
|
|
181
193
|
return;
|
|
182
194
|
}
|
|
183
|
-
|
|
195
|
+
D(!0);
|
|
184
196
|
}), $(() => {
|
|
185
197
|
if (!i.open) return;
|
|
186
|
-
const e = (
|
|
187
|
-
|
|
188
|
-
}, n = (
|
|
189
|
-
e(
|
|
190
|
-
},
|
|
191
|
-
e(
|
|
198
|
+
const e = (h) => {
|
|
199
|
+
D(H(h));
|
|
200
|
+
}, n = (h) => {
|
|
201
|
+
e(h.target);
|
|
202
|
+
}, o = (h) => {
|
|
203
|
+
e(h.target);
|
|
192
204
|
};
|
|
193
|
-
document.addEventListener("pointerdown", n), document.addEventListener("focusin",
|
|
194
|
-
document.removeEventListener("pointerdown", n), document.removeEventListener("focusin",
|
|
205
|
+
document.addEventListener("pointerdown", n), document.addEventListener("focusin", o), q(() => {
|
|
206
|
+
document.removeEventListener("pointerdown", n), document.removeEventListener("focusin", o);
|
|
195
207
|
});
|
|
196
208
|
}), $(() => {
|
|
197
209
|
if (!i.open) return;
|
|
198
210
|
const e = W();
|
|
199
|
-
|
|
211
|
+
l === null ? ie(e) : z = e;
|
|
200
212
|
});
|
|
201
|
-
const
|
|
202
|
-
!
|
|
213
|
+
const Ae = (e) => {
|
|
214
|
+
!B() || d() || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), l = e.pointerId, v = "drag", G(!0), J = {
|
|
203
215
|
x: e.clientX,
|
|
204
216
|
y: e.clientY
|
|
205
|
-
},
|
|
206
|
-
...
|
|
207
|
-
},
|
|
217
|
+
}, K = {
|
|
218
|
+
...z
|
|
219
|
+
}, P = {
|
|
208
220
|
x: e.clientX,
|
|
209
221
|
y: e.clientY
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
!
|
|
222
|
+
}, k(!0, "grabbing"), typeof r?.setPointerCapture == "function" && r.setPointerCapture(e.pointerId));
|
|
223
|
+
}, c = (e) => (n) => {
|
|
224
|
+
!T() || d() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), l = n.pointerId, v = "resize", Z(!0), te = e, Q = {
|
|
213
225
|
x: n.clientX,
|
|
214
226
|
y: n.clientY
|
|
215
|
-
},
|
|
216
|
-
...
|
|
217
|
-
},
|
|
227
|
+
}, ee = {
|
|
228
|
+
...z
|
|
229
|
+
}, P = {
|
|
218
230
|
x: n.clientX,
|
|
219
231
|
y: n.clientY
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
if (!(
|
|
232
|
+
}, k(!0, Me[e]), typeof r?.setPointerCapture == "function" && r.setPointerCapture(n.pointerId));
|
|
233
|
+
}, oe = () => {
|
|
234
|
+
y = null, re();
|
|
235
|
+
}, De = (e) => {
|
|
236
|
+
if (!(l === null || e.pointerId !== l) && v !== null && (P = {
|
|
225
237
|
x: e.clientX,
|
|
226
238
|
y: e.clientY
|
|
227
|
-
},
|
|
239
|
+
}, y === null)) {
|
|
228
240
|
if (typeof requestAnimationFrame > "u") {
|
|
229
|
-
|
|
241
|
+
oe();
|
|
230
242
|
return;
|
|
231
243
|
}
|
|
232
|
-
|
|
244
|
+
y = requestAnimationFrame(oe);
|
|
233
245
|
}
|
|
234
|
-
},
|
|
235
|
-
|
|
246
|
+
}, le = (e) => {
|
|
247
|
+
l === null || e.pointerId !== l || (P = {
|
|
236
248
|
x: e.clientX,
|
|
237
249
|
y: e.clientY
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
if (
|
|
241
|
-
const n =
|
|
242
|
-
n &&
|
|
250
|
+
}, X(e.pointerId));
|
|
251
|
+
}, se = () => {
|
|
252
|
+
if (l !== null && X(l, !0), d()) {
|
|
253
|
+
const n = Ce();
|
|
254
|
+
n && S(pe({
|
|
243
255
|
rect: {
|
|
244
256
|
x: n.position.x,
|
|
245
257
|
y: n.position.y,
|
|
@@ -247,19 +259,19 @@ function lt(i) {
|
|
|
247
259
|
height: n.size.height
|
|
248
260
|
},
|
|
249
261
|
minSize: M(),
|
|
250
|
-
maxSize:
|
|
262
|
+
maxSize: F(),
|
|
251
263
|
viewport: {
|
|
252
264
|
width: window.innerWidth,
|
|
253
265
|
height: window.innerHeight
|
|
254
266
|
},
|
|
255
|
-
mobile:
|
|
256
|
-
mobilePadding:
|
|
267
|
+
mobile: b(),
|
|
268
|
+
mobilePadding: L,
|
|
257
269
|
center: !1
|
|
258
|
-
})),
|
|
270
|
+
})), N(!1);
|
|
259
271
|
return;
|
|
260
272
|
}
|
|
261
273
|
const e = W();
|
|
262
|
-
|
|
274
|
+
Ee({
|
|
263
275
|
position: {
|
|
264
276
|
x: e.x,
|
|
265
277
|
y: e.y
|
|
@@ -268,15 +280,17 @@ function lt(i) {
|
|
|
268
280
|
width: e.width,
|
|
269
281
|
height: e.height
|
|
270
282
|
}
|
|
271
|
-
}),
|
|
283
|
+
}), S({
|
|
272
284
|
x: 0,
|
|
273
285
|
y: 0,
|
|
274
286
|
width: window.innerWidth,
|
|
275
287
|
height: window.innerHeight
|
|
276
|
-
}),
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
},
|
|
288
|
+
}), N(!0);
|
|
289
|
+
}, ke = () => {
|
|
290
|
+
se();
|
|
291
|
+
}, We = (e) => {
|
|
292
|
+
Le(e.target) && Fe();
|
|
293
|
+
}, f = (e) => C("absolute z-10", {
|
|
280
294
|
n: "cursor-ns-resize top-0 left-2 right-2 h-1",
|
|
281
295
|
s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
|
|
282
296
|
e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
|
|
@@ -286,52 +300,52 @@ function lt(i) {
|
|
|
286
300
|
se: "cursor-nwse-resize bottom-0 right-0 w-2 h-2",
|
|
287
301
|
sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
|
|
288
302
|
}[e]);
|
|
289
|
-
return s(
|
|
303
|
+
return s(p, {
|
|
290
304
|
get when() {
|
|
291
305
|
return i.open;
|
|
292
306
|
},
|
|
293
307
|
get children() {
|
|
294
|
-
return s(
|
|
308
|
+
return s(Oe, {
|
|
295
309
|
get children() {
|
|
296
|
-
var e =
|
|
297
|
-
e.addEventListener("pointercancel",
|
|
298
|
-
var
|
|
299
|
-
return typeof
|
|
310
|
+
var e = et(), n = e.firstChild, o = n.firstChild, h = o.firstChild, ae = h.nextSibling, He = o.nextSibling;
|
|
311
|
+
e.$$pointerdown = We, e.addEventListener("pointercancel", le), e.$$pointerup = le, e.$$pointermove = De;
|
|
312
|
+
var de = r;
|
|
313
|
+
return typeof de == "function" ? Ye(de, e) : r = e, o.$$dblclick = ke, o.$$pointerdown = Ae, w(h, s(p, {
|
|
300
314
|
get when() {
|
|
301
315
|
return i.title;
|
|
302
316
|
},
|
|
303
317
|
get children() {
|
|
304
|
-
var t =
|
|
305
|
-
return w(t, () => i.title),
|
|
318
|
+
var t = Ke();
|
|
319
|
+
return w(t, () => i.title), u(() => Y(t, "id", U())), t;
|
|
306
320
|
}
|
|
307
|
-
})), w(
|
|
321
|
+
})), w(ae, s(ze, {
|
|
308
322
|
variant: "ghost",
|
|
309
323
|
size: "icon",
|
|
310
324
|
class: "h-6 w-6",
|
|
311
325
|
onClick: (t) => {
|
|
312
|
-
t.stopPropagation(),
|
|
326
|
+
t.stopPropagation(), se();
|
|
313
327
|
},
|
|
314
328
|
get "aria-label"() {
|
|
315
329
|
return d() ? "Restore" : "Maximize";
|
|
316
330
|
},
|
|
317
331
|
get children() {
|
|
318
|
-
return s(
|
|
332
|
+
return s(p, {
|
|
319
333
|
get when() {
|
|
320
334
|
return d();
|
|
321
335
|
},
|
|
322
336
|
get fallback() {
|
|
323
|
-
return s(
|
|
337
|
+
return s(Ge, {
|
|
324
338
|
class: "w-3 h-3"
|
|
325
339
|
});
|
|
326
340
|
},
|
|
327
341
|
get children() {
|
|
328
|
-
return s(
|
|
342
|
+
return s(je, {
|
|
329
343
|
class: "w-3 h-3"
|
|
330
344
|
});
|
|
331
345
|
}
|
|
332
346
|
});
|
|
333
347
|
}
|
|
334
|
-
}), null), w(
|
|
348
|
+
}), null), w(ae, s(ze, {
|
|
335
349
|
variant: "ghost-destructive",
|
|
336
350
|
size: "icon",
|
|
337
351
|
class: "h-6 w-6",
|
|
@@ -340,59 +354,59 @@ function lt(i) {
|
|
|
340
354
|
},
|
|
341
355
|
"aria-label": "Close",
|
|
342
356
|
get children() {
|
|
343
|
-
return s(
|
|
357
|
+
return s(Ve, {
|
|
344
358
|
class: "w-3.5 h-3.5"
|
|
345
359
|
});
|
|
346
360
|
}
|
|
347
|
-
}), null), w(
|
|
361
|
+
}), null), w(He, () => i.children), w(n, s(p, {
|
|
348
362
|
get when() {
|
|
349
363
|
return i.footer;
|
|
350
364
|
},
|
|
351
365
|
get children() {
|
|
352
|
-
var t =
|
|
366
|
+
var t = Qe();
|
|
353
367
|
return w(t, () => i.footer), t;
|
|
354
368
|
}
|
|
355
|
-
}), null), w(n, s(
|
|
369
|
+
}), null), w(n, s(p, {
|
|
356
370
|
get when() {
|
|
357
|
-
return
|
|
371
|
+
return Xe(() => !!T())() && !d();
|
|
358
372
|
},
|
|
359
373
|
get children() {
|
|
360
374
|
return [(() => {
|
|
361
375
|
var t = m();
|
|
362
|
-
return g(t, "pointerdown",
|
|
376
|
+
return g(t, "pointerdown", c("n"), !0), u(() => a(t, f("n"))), t;
|
|
363
377
|
})(), (() => {
|
|
364
378
|
var t = m();
|
|
365
|
-
return g(t, "pointerdown",
|
|
366
|
-
})(), s(
|
|
379
|
+
return g(t, "pointerdown", c("s"), !0), u(() => a(t, f("s"))), t;
|
|
380
|
+
})(), s(p, {
|
|
367
381
|
get when() {
|
|
368
|
-
return !
|
|
382
|
+
return !b();
|
|
369
383
|
},
|
|
370
384
|
get children() {
|
|
371
385
|
return [(() => {
|
|
372
386
|
var t = m();
|
|
373
|
-
return g(t, "pointerdown",
|
|
387
|
+
return g(t, "pointerdown", c("e"), !0), u(() => a(t, f("e"))), t;
|
|
374
388
|
})(), (() => {
|
|
375
389
|
var t = m();
|
|
376
|
-
return g(t, "pointerdown",
|
|
390
|
+
return g(t, "pointerdown", c("w"), !0), u(() => a(t, f("w"))), t;
|
|
377
391
|
})(), (() => {
|
|
378
392
|
var t = m();
|
|
379
|
-
return g(t, "pointerdown",
|
|
393
|
+
return g(t, "pointerdown", c("ne"), !0), u(() => a(t, f("ne"))), t;
|
|
380
394
|
})(), (() => {
|
|
381
395
|
var t = m();
|
|
382
|
-
return g(t, "pointerdown",
|
|
396
|
+
return g(t, "pointerdown", c("nw"), !0), u(() => a(t, f("nw"))), t;
|
|
383
397
|
})(), (() => {
|
|
384
398
|
var t = m();
|
|
385
|
-
return g(t, "pointerdown",
|
|
399
|
+
return g(t, "pointerdown", c("se"), !0), u(() => a(t, f("se"))), t;
|
|
386
400
|
})(), (() => {
|
|
387
401
|
var t = m();
|
|
388
|
-
return g(t, "pointerdown",
|
|
402
|
+
return g(t, "pointerdown", c("sw"), !0), u(() => a(t, f("sw"))), t;
|
|
389
403
|
})()];
|
|
390
404
|
}
|
|
391
405
|
})];
|
|
392
406
|
}
|
|
393
|
-
}), null),
|
|
394
|
-
var
|
|
395
|
-
return
|
|
407
|
+
}), null), u((t) => {
|
|
408
|
+
var ue = C("fixed left-0 top-0 z-[100] flex flex-col", (j() || V()) && "select-none"), ce = `${A().width}px`, fe = `${A().height}px`, he = `translate3d(${_().x}px, ${_().y}px, 0)`, we = be(), ge = j() ? "transform" : V() ? "transform, width, height" : void 0, me = i.title ? U() : void 0, ve = Re() ? "active" : "inactive", xe = C("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "animate-in fade-in duration-150", d() && "rounded-none", i.class), ye = C("flex items-center justify-between h-9 px-3", "border-b", d() ? "rounded-none" : "rounded-t-md", B() && !d() && "cursor-move");
|
|
409
|
+
return ue !== t.e && a(e, t.e = ue), ce !== t.t && I(e, "width", t.t = ce), fe !== t.a && I(e, "height", t.a = fe), he !== t.o && I(e, "transform", t.o = he), we !== t.i && I(e, "z-index", t.i = we), ge !== t.n && I(e, "will-change", t.n = ge), me !== t.s && Y(e, "aria-labelledby", t.s = me), ve !== t.h && Y(n, "data-floe-floating-window-state", t.h = ve), xe !== t.r && a(n, t.r = xe), ye !== t.d && a(o, t.d = ye), t;
|
|
396
410
|
}, {
|
|
397
411
|
e: void 0,
|
|
398
412
|
t: void 0,
|
|
@@ -410,7 +424,7 @@ function lt(i) {
|
|
|
410
424
|
}
|
|
411
425
|
});
|
|
412
426
|
}
|
|
413
|
-
|
|
427
|
+
qe(["pointermove", "pointerup", "pointerdown", "dblclick"]);
|
|
414
428
|
export {
|
|
415
|
-
|
|
429
|
+
dt as FloatingWindow
|
|
416
430
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const DIALOG_SURFACE_HOST_ATTR = "data-floe-dialog-surface-host";
|
|
2
|
+
export declare const DIALOG_SURFACE_BOUNDARY_ATTR = "data-floe-dialog-surface-boundary";
|
|
3
|
+
export type DialogSurfaceInteractionSnapshot = Readonly<{
|
|
4
|
+
target: Element | null;
|
|
5
|
+
activeElement: Element | null;
|
|
6
|
+
recordedAt: number;
|
|
7
|
+
}>;
|
|
8
|
+
export type ResolvedDialogSurfaceHost = Readonly<{
|
|
9
|
+
host: HTMLElement | null;
|
|
10
|
+
mode: 'global' | 'surface';
|
|
11
|
+
}>;
|
|
12
|
+
export declare function ensureDialogSurfaceInteractionTracking(): void;
|
|
13
|
+
export declare function resolveDialogSurfaceHost(): ResolvedDialogSurfaceHost;
|
|
14
|
+
export declare function __resetDialogSurfaceScopeForTests(): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const a = "data-floe-dialog-surface-host", m = "data-floe-dialog-surface-boundary";
|
|
2
|
+
let o = null, t = null;
|
|
3
|
+
function d(e) {
|
|
4
|
+
return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
|
|
5
|
+
}
|
|
6
|
+
function f(e) {
|
|
7
|
+
const n = e?.activeElement;
|
|
8
|
+
return n instanceof Element ? n : null;
|
|
9
|
+
}
|
|
10
|
+
function i(e) {
|
|
11
|
+
const n = typeof document < "u" ? document : null;
|
|
12
|
+
o = {
|
|
13
|
+
target: d(e),
|
|
14
|
+
activeElement: f(n),
|
|
15
|
+
recordedAt: Date.now()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function r(e) {
|
|
19
|
+
i(e.target);
|
|
20
|
+
}
|
|
21
|
+
function u(e) {
|
|
22
|
+
i(e.target);
|
|
23
|
+
}
|
|
24
|
+
function l() {
|
|
25
|
+
typeof document > "u" || t !== document && (t && (t.removeEventListener("pointerdown", r, !0), t.removeEventListener("focusin", u, !0)), document.addEventListener("pointerdown", r, !0), document.addEventListener("focusin", u, !0), t = document);
|
|
26
|
+
}
|
|
27
|
+
function s() {
|
|
28
|
+
return !o || Date.now() - o.recordedAt > 1600 ? null : o;
|
|
29
|
+
}
|
|
30
|
+
function c(e) {
|
|
31
|
+
const n = e?.closest(`[${a}="true"]`);
|
|
32
|
+
return n instanceof HTMLElement && n.isConnected ? n : null;
|
|
33
|
+
}
|
|
34
|
+
function E() {
|
|
35
|
+
l();
|
|
36
|
+
const e = s(), n = c(e?.target ?? null) ?? c(e?.activeElement ?? null);
|
|
37
|
+
return n ? { host: n, mode: "surface" } : { host: null, mode: "global" };
|
|
38
|
+
}
|
|
39
|
+
typeof document < "u" && l();
|
|
40
|
+
export {
|
|
41
|
+
m as DIALOG_SURFACE_BOUNDARY_ATTR,
|
|
42
|
+
a as DIALOG_SURFACE_HOST_ATTR,
|
|
43
|
+
l as ensureDialogSurfaceInteractionTracking,
|
|
44
|
+
E as resolveDialogSurfaceHost
|
|
45
|
+
};
|