@floegence/floe-webapp-core 0.39.2 → 0.39.4
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/FloatingWindow.js +105 -102
- package/dist/components/ui/SurfaceFloatingLayer.js +19 -17
- package/dist/components/ui/dialogSurfaceScope.d.ts +1 -0
- package/dist/components/ui/dialogSurfaceScope.js +27 -26
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/menuUtils.d.ts +5 -0
- package/dist/components/ui/menuUtils.js +76 -54
- package/dist/components/ui/surfacePortalScope.d.ts +1 -1
- package/dist/full.js +352 -346
- package/dist/ui.js +115 -109
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { createComponent as s, Portal as
|
|
2
|
-
import { createUniqueId as
|
|
1
|
+
import { createComponent as s, Portal as Me, spread as de, mergeProps as ue, memo as ce, insert as g, effect as c, setAttribute as Te, addEventListener as m, className as f, template as d, use as De, delegateEvents as ke } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as We, createSignal as v, onMount as Oe, onCleanup as X, createEffect as b, Show as P, batch as He, untrack as Ue } from "solid-js";
|
|
3
3
|
import { cn as E } from "../../utils/cn.js";
|
|
4
|
-
import { useLayout as
|
|
4
|
+
import { useLayout as Ye } from "../../context/LayoutContext.js";
|
|
5
5
|
import { Button as fe } from "./Button.js";
|
|
6
|
-
import { Restore as
|
|
7
|
-
import { startHotInteraction as
|
|
8
|
-
import { resolveFloatingWindowViewport as he, normalizeFloatingWindowRect as we, resolveFloatingWindowRect as
|
|
6
|
+
import { Restore as Ne, Maximize as Xe, X as qe } from "../icons/index.js";
|
|
7
|
+
import { startHotInteraction as Be } from "../../utils/hotInteraction.js";
|
|
8
|
+
import { resolveFloatingWindowViewport as he, normalizeFloatingWindowRect as we, resolveFloatingWindowRect as Ge } from "./floatingWindowGeometry.js";
|
|
9
9
|
import { createFloatingPresence as je } from "./floatingPresence.js";
|
|
10
10
|
import { LOCAL_INTERACTION_SURFACE_ATTR as ge } from "./localInteractionSurface.js";
|
|
11
|
-
import { SURFACE_PORTAL_LAYER_ATTR as
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
const
|
|
11
|
+
import { SURFACE_PORTAL_LAYER_ATTR as Ve, SURFACE_FLOATING_LAYER_ATTR as Ze } from "./dialogSurfaceScope.js";
|
|
12
|
+
var Je = /* @__PURE__ */ d('<h2 class="text-sm font-medium truncate select-none">'), Ke = /* @__PURE__ */ d('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), Qe = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), et = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), tt = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), nt = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), it = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), ot = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), rt = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), lt = /* @__PURE__ */ d("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), st = /* @__PURE__ */ d('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=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">');
|
|
13
|
+
function xt(i) {
|
|
14
|
+
const q = () => i.resizable ?? !0, B = () => i.draggable ?? !0, A = () => i.minSize ?? {
|
|
15
15
|
width: 200,
|
|
16
16
|
height: 150
|
|
17
17
|
}, F = () => i.maxSize ?? {
|
|
18
18
|
width: 1 / 0,
|
|
19
19
|
height: 1 / 0
|
|
20
|
-
}, x = () => i.viewportInsets ?? {}, me = () => i.zIndex ?? 100, pe =
|
|
20
|
+
}, x = () => i.viewportInsets ?? {}, me = () => i.zIndex ?? 100, pe = We(), ve = Ye(), $ = () => ve.isMobile(), L = 16, G = () => `floating-window-${pe}-title`, [M, xe] = v(i.defaultPosition ?? {
|
|
21
21
|
x: 0,
|
|
22
22
|
y: 0
|
|
23
|
-
}), [
|
|
23
|
+
}), [T, ye] = v(i.defaultSize ?? {
|
|
24
24
|
width: 400,
|
|
25
25
|
height: 300
|
|
26
|
-
}), [
|
|
26
|
+
}), [u, j] = v(!1), [D, V] = v(!1), [k, Z] = v(!1), [ze, W] = v(!1), I = je({
|
|
27
27
|
open: () => i.open,
|
|
28
28
|
exitDurationMs: 120
|
|
29
29
|
}), [be, Pe] = v(null);
|
|
@@ -43,10 +43,10 @@ function pt(i) {
|
|
|
43
43
|
y: 0,
|
|
44
44
|
width: 0,
|
|
45
45
|
height: 0
|
|
46
|
-
}, te = "se", o,
|
|
46
|
+
}, te = "se", o, l = null, p = null, S = {
|
|
47
47
|
x: 0,
|
|
48
48
|
y: 0
|
|
49
|
-
},
|
|
49
|
+
}, y = null, R = null, O = !1, z = {
|
|
50
50
|
x: i.defaultPosition?.x ?? 0,
|
|
51
51
|
y: i.defaultPosition?.y ?? 0,
|
|
52
52
|
width: i.defaultSize?.width ?? 400,
|
|
@@ -66,15 +66,15 @@ function pt(i) {
|
|
|
66
66
|
R?.(), R = null;
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
R?.(), R =
|
|
69
|
+
R?.(), R = Be({
|
|
70
70
|
kind: p === "resize" ? "resize" : "drag",
|
|
71
71
|
cursor: t,
|
|
72
72
|
lockUserSelect: !0
|
|
73
73
|
});
|
|
74
74
|
}, ne = (e) => {
|
|
75
|
-
|
|
75
|
+
z = e, o && (o.style.transform = `translate3d(${e.x}px, ${e.y}px, 0)`, o.style.width = `${e.width}px`, o.style.height = `${e.height}px`);
|
|
76
76
|
}, U = () => {
|
|
77
|
-
const e = M(), t =
|
|
77
|
+
const e = M(), t = T();
|
|
78
78
|
return {
|
|
79
79
|
x: e.x,
|
|
80
80
|
y: e.y,
|
|
@@ -82,10 +82,10 @@ function pt(i) {
|
|
|
82
82
|
height: t.height
|
|
83
83
|
};
|
|
84
84
|
}, _ = (e) => {
|
|
85
|
-
|
|
85
|
+
z = e, xe((t) => t.x === e.x && t.y === e.y ? t : {
|
|
86
86
|
x: e.x,
|
|
87
87
|
y: e.y
|
|
88
|
-
}),
|
|
88
|
+
}), ye((t) => t.width === e.width && t.height === e.height ? t : {
|
|
89
89
|
width: e.width,
|
|
90
90
|
height: e.height
|
|
91
91
|
});
|
|
@@ -99,7 +99,10 @@ function pt(i) {
|
|
|
99
99
|
}, Se = (e) => {
|
|
100
100
|
const t = e instanceof Element ? e : null;
|
|
101
101
|
return t ? t.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
|
|
102
|
-
},
|
|
102
|
+
}, Y = (e) => !!o && e instanceof Node && o.contains(e), _e = (e) => {
|
|
103
|
+
const a = (e instanceof Element ? e : null)?.closest('[role="menu"]')?.closest(`[${Ze}="true"]`);
|
|
104
|
+
return !!(a && o?.contains(a));
|
|
105
|
+
}, Re = () => {
|
|
103
106
|
if (!o) return null;
|
|
104
107
|
const e = o.getBoundingClientRect();
|
|
105
108
|
return {
|
|
@@ -109,7 +112,7 @@ function pt(i) {
|
|
|
109
112
|
height: e.height
|
|
110
113
|
};
|
|
111
114
|
}, ie = () => {
|
|
112
|
-
i.open && (
|
|
115
|
+
i.open && (l === null || p === null || typeof window > "u" || ne(Ge({
|
|
113
116
|
mode: p,
|
|
114
117
|
pointer: S,
|
|
115
118
|
dragStartPos: J,
|
|
@@ -133,7 +136,7 @@ function pt(i) {
|
|
|
133
136
|
width: window.innerWidth,
|
|
134
137
|
height: window.innerHeight
|
|
135
138
|
};
|
|
136
|
-
if (
|
|
139
|
+
if (u()) {
|
|
137
140
|
_(he(t, x()));
|
|
138
141
|
return;
|
|
139
142
|
}
|
|
@@ -147,28 +150,28 @@ function pt(i) {
|
|
|
147
150
|
mobilePadding: L,
|
|
148
151
|
center: e?.center ?? !1
|
|
149
152
|
}));
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
+
}, N = (e, t = !0) => {
|
|
154
|
+
y !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(y), y = null), t && ie();
|
|
155
|
+
const r = t ? Re() ?? z : null;
|
|
153
156
|
if (e !== void 0)
|
|
154
157
|
try {
|
|
155
158
|
typeof o?.releasePointerCapture == "function" && o.releasePointerCapture(e);
|
|
156
159
|
} catch {
|
|
157
160
|
}
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
He(() => {
|
|
162
|
+
r && _(r), l = null, p = null, V(!1), Z(!1);
|
|
160
163
|
}), H(!1, "");
|
|
161
164
|
};
|
|
162
|
-
|
|
165
|
+
Oe(() => {
|
|
163
166
|
i.open || C({
|
|
164
167
|
center: !i.defaultPosition
|
|
165
168
|
});
|
|
166
169
|
const e = () => {
|
|
167
|
-
|
|
170
|
+
l === null && C({
|
|
168
171
|
center: !1
|
|
169
172
|
});
|
|
170
173
|
};
|
|
171
|
-
window.addEventListener("resize", e),
|
|
174
|
+
window.addEventListener("resize", e), X(() => window.removeEventListener("resize", e));
|
|
172
175
|
}), b(() => {
|
|
173
176
|
if (!i.open) return;
|
|
174
177
|
$();
|
|
@@ -183,80 +186,80 @@ function pt(i) {
|
|
|
183
186
|
}
|
|
184
187
|
requestAnimationFrame(t);
|
|
185
188
|
}), b(() => {
|
|
186
|
-
!i.open || !O ||
|
|
189
|
+
!i.open || !O || l !== null || (x(), Ue(() => C({
|
|
187
190
|
center: !1
|
|
188
191
|
})));
|
|
189
192
|
}), b(() => {
|
|
190
193
|
if (!i.open) return;
|
|
191
194
|
const e = (t) => {
|
|
192
195
|
if (t.key !== "Escape") return;
|
|
193
|
-
const
|
|
194
|
-
!
|
|
196
|
+
const r = typeof document < "u" ? document.activeElement : null;
|
|
197
|
+
!Y(t.target) && !Y(r) || _e(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), i.onOpenChange(!1));
|
|
195
198
|
};
|
|
196
|
-
document.addEventListener("keydown", e, !0),
|
|
199
|
+
document.addEventListener("keydown", e, !0), X(() => document.removeEventListener("keydown", e, !0));
|
|
197
200
|
}), b(() => {
|
|
198
201
|
if (!i.open) {
|
|
199
|
-
W(!1),
|
|
202
|
+
W(!1), N(l ?? void 0, !1);
|
|
200
203
|
return;
|
|
201
204
|
}
|
|
202
205
|
W(!0);
|
|
203
206
|
}), b(() => {
|
|
204
207
|
if (!i.open) return;
|
|
205
|
-
const e = (
|
|
206
|
-
W(
|
|
207
|
-
}, t = (
|
|
208
|
-
e(
|
|
209
|
-
},
|
|
210
|
-
e(
|
|
208
|
+
const e = (a) => {
|
|
209
|
+
W(Y(a));
|
|
210
|
+
}, t = (a) => {
|
|
211
|
+
e(a.target);
|
|
212
|
+
}, r = (a) => {
|
|
213
|
+
e(a.target);
|
|
211
214
|
};
|
|
212
|
-
document.addEventListener("pointerdown", t), document.addEventListener("focusin",
|
|
213
|
-
document.removeEventListener("pointerdown", t), document.removeEventListener("focusin",
|
|
215
|
+
document.addEventListener("pointerdown", t), document.addEventListener("focusin", r), X(() => {
|
|
216
|
+
document.removeEventListener("pointerdown", t), document.removeEventListener("focusin", r);
|
|
214
217
|
});
|
|
215
218
|
}), b(() => {
|
|
216
219
|
if (!i.open) return;
|
|
217
220
|
const e = U();
|
|
218
|
-
|
|
221
|
+
l === null ? ne(e) : z = e;
|
|
219
222
|
});
|
|
220
|
-
const
|
|
221
|
-
!B() ||
|
|
223
|
+
const Ce = (e) => {
|
|
224
|
+
!B() || u() || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), l = e.pointerId, p = "drag", V(!0), J = {
|
|
222
225
|
x: e.clientX,
|
|
223
226
|
y: e.clientY
|
|
224
227
|
}, K = {
|
|
225
|
-
...
|
|
228
|
+
...z
|
|
226
229
|
}, S = {
|
|
227
230
|
x: e.clientX,
|
|
228
231
|
y: e.clientY
|
|
229
232
|
}, H(!0, "grabbing"), typeof o?.setPointerCapture == "function" && o.setPointerCapture(e.pointerId));
|
|
230
|
-
},
|
|
231
|
-
!
|
|
233
|
+
}, h = (e) => (t) => {
|
|
234
|
+
!q() || u() || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), t.stopPropagation(), l = t.pointerId, p = "resize", Z(!0), te = e, Q = {
|
|
232
235
|
x: t.clientX,
|
|
233
236
|
y: t.clientY
|
|
234
237
|
}, ee = {
|
|
235
|
-
...
|
|
238
|
+
...z
|
|
236
239
|
}, S = {
|
|
237
240
|
x: t.clientX,
|
|
238
241
|
y: t.clientY
|
|
239
242
|
}, H(!0, $e[e]), typeof o?.setPointerCapture == "function" && o.setPointerCapture(t.pointerId));
|
|
240
243
|
}, oe = () => {
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
if (!(
|
|
244
|
+
y = null, ie();
|
|
245
|
+
}, Ee = (e) => {
|
|
246
|
+
if (!(l === null || e.pointerId !== l) && p !== null && (S = {
|
|
244
247
|
x: e.clientX,
|
|
245
248
|
y: e.clientY
|
|
246
|
-
},
|
|
249
|
+
}, y === null)) {
|
|
247
250
|
if (typeof requestAnimationFrame > "u") {
|
|
248
251
|
oe();
|
|
249
252
|
return;
|
|
250
253
|
}
|
|
251
|
-
|
|
254
|
+
y = requestAnimationFrame(oe);
|
|
252
255
|
}
|
|
253
256
|
}, re = (e) => {
|
|
254
|
-
|
|
257
|
+
l === null || e.pointerId !== l || (S = {
|
|
255
258
|
x: e.clientX,
|
|
256
259
|
y: e.clientY
|
|
257
|
-
},
|
|
260
|
+
}, N(e.pointerId));
|
|
258
261
|
}, le = () => {
|
|
259
|
-
if (
|
|
262
|
+
if (l !== null && N(l, !0), u()) {
|
|
260
263
|
const t = be();
|
|
261
264
|
t && _(we({
|
|
262
265
|
rect: {
|
|
@@ -275,7 +278,7 @@ function pt(i) {
|
|
|
275
278
|
mobile: $(),
|
|
276
279
|
mobilePadding: L,
|
|
277
280
|
center: !1
|
|
278
|
-
})),
|
|
281
|
+
})), j(!1);
|
|
279
282
|
return;
|
|
280
283
|
}
|
|
281
284
|
const e = U();
|
|
@@ -291,12 +294,12 @@ function pt(i) {
|
|
|
291
294
|
}), _(he({
|
|
292
295
|
width: window.innerWidth,
|
|
293
296
|
height: window.innerHeight
|
|
294
|
-
}, x())),
|
|
295
|
-
},
|
|
297
|
+
}, x())), j(!0);
|
|
298
|
+
}, Ae = () => {
|
|
296
299
|
le();
|
|
297
|
-
},
|
|
300
|
+
}, Fe = (e) => {
|
|
298
301
|
Se(e.target) && Ie();
|
|
299
|
-
},
|
|
302
|
+
}, w = (e) => E("absolute z-10", {
|
|
300
303
|
n: "cursor-ns-resize top-0 left-2 right-2 h-1",
|
|
301
304
|
s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
|
|
302
305
|
e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
|
|
@@ -311,9 +314,9 @@ function pt(i) {
|
|
|
311
314
|
return I.mounted();
|
|
312
315
|
},
|
|
313
316
|
get children() {
|
|
314
|
-
return s(
|
|
317
|
+
return s(Me, {
|
|
315
318
|
get children() {
|
|
316
|
-
var e =
|
|
319
|
+
var e = st(), t = e.firstChild, r = t.firstChild, a = r.firstChild, se = a.nextSibling, Le = r.nextSibling, ae = o;
|
|
317
320
|
return typeof ae == "function" ? De(ae, e) : o = e, de(e, ue({
|
|
318
321
|
get "data-floating-presence"() {
|
|
319
322
|
return I.state();
|
|
@@ -325,49 +328,49 @@ function pt(i) {
|
|
|
325
328
|
[ge]: "true"
|
|
326
329
|
}, {
|
|
327
330
|
get class() {
|
|
328
|
-
return E("fixed left-0 top-0 z-[100] flex flex-col", (
|
|
331
|
+
return E("fixed left-0 top-0 z-[100] flex flex-col", (D() || k()) && "select-none", I.exiting() && "pointer-events-none");
|
|
329
332
|
},
|
|
330
333
|
get style() {
|
|
331
334
|
return {
|
|
332
|
-
width: `${
|
|
333
|
-
height: `${
|
|
335
|
+
width: `${T().width}px`,
|
|
336
|
+
height: `${T().height}px`,
|
|
334
337
|
transform: `translate3d(${M().x}px, ${M().y}px, 0)`,
|
|
335
338
|
"z-index": me(),
|
|
336
|
-
"will-change":
|
|
339
|
+
"will-change": D() ? "transform" : k() ? "transform, width, height" : void 0
|
|
337
340
|
};
|
|
338
341
|
},
|
|
339
|
-
onPointerMove:
|
|
342
|
+
onPointerMove: Ee,
|
|
340
343
|
onPointerUp: re,
|
|
341
344
|
onPointerCancel: re,
|
|
342
345
|
role: "dialog",
|
|
343
346
|
get "aria-labelledby"() {
|
|
344
|
-
return ce(() => !!i.title)() ?
|
|
347
|
+
return ce(() => !!i.title)() ? G() : void 0;
|
|
345
348
|
},
|
|
346
349
|
tabIndex: -1,
|
|
347
|
-
onPointerDown:
|
|
350
|
+
onPointerDown: Fe
|
|
348
351
|
}), !1, !0), de(t, ue({
|
|
349
|
-
[
|
|
352
|
+
[Ve]: "true"
|
|
350
353
|
}, {
|
|
351
354
|
"data-floe-floating-window-surface": "true",
|
|
352
355
|
get "data-floe-floating-window-state"() {
|
|
353
|
-
return
|
|
356
|
+
return ze() ? "active" : "inactive";
|
|
354
357
|
}
|
|
355
358
|
}, {
|
|
356
359
|
[ge]: "true"
|
|
357
360
|
}, {
|
|
358
361
|
get class() {
|
|
359
|
-
return E("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (
|
|
362
|
+
return E("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (D() || k()) && "floe-floating-presence--suspended", u() && "rounded-none", i.class);
|
|
360
363
|
},
|
|
361
364
|
get "data-floating-presence"() {
|
|
362
365
|
return I.state();
|
|
363
366
|
}
|
|
364
|
-
}), !1, !0),
|
|
367
|
+
}), !1, !0), r.$$dblclick = Ae, r.$$pointerdown = Ce, g(a, s(P, {
|
|
365
368
|
get when() {
|
|
366
369
|
return i.title;
|
|
367
370
|
},
|
|
368
371
|
get children() {
|
|
369
|
-
var n =
|
|
370
|
-
return g(n, () => i.title),
|
|
372
|
+
var n = Je();
|
|
373
|
+
return g(n, () => i.title), c(() => Te(n, "id", G())), n;
|
|
371
374
|
}
|
|
372
375
|
})), g(se, s(fe, {
|
|
373
376
|
variant: "ghost",
|
|
@@ -377,20 +380,20 @@ function pt(i) {
|
|
|
377
380
|
n.stopPropagation(), le();
|
|
378
381
|
},
|
|
379
382
|
get "aria-label"() {
|
|
380
|
-
return
|
|
383
|
+
return u() ? "Restore" : "Maximize";
|
|
381
384
|
},
|
|
382
385
|
get children() {
|
|
383
386
|
return s(P, {
|
|
384
387
|
get when() {
|
|
385
|
-
return
|
|
388
|
+
return u();
|
|
386
389
|
},
|
|
387
390
|
get fallback() {
|
|
388
|
-
return s(
|
|
391
|
+
return s(Xe, {
|
|
389
392
|
class: "w-3 h-3"
|
|
390
393
|
});
|
|
391
394
|
},
|
|
392
395
|
get children() {
|
|
393
|
-
return s(
|
|
396
|
+
return s(Ne, {
|
|
394
397
|
class: "w-3 h-3"
|
|
395
398
|
});
|
|
396
399
|
}
|
|
@@ -409,53 +412,53 @@ function pt(i) {
|
|
|
409
412
|
class: "w-3.5 h-3.5"
|
|
410
413
|
});
|
|
411
414
|
}
|
|
412
|
-
}), null), g(
|
|
415
|
+
}), null), g(Le, () => i.children), g(t, s(P, {
|
|
413
416
|
get when() {
|
|
414
417
|
return i.footer;
|
|
415
418
|
},
|
|
416
419
|
get children() {
|
|
417
|
-
var n =
|
|
420
|
+
var n = Ke();
|
|
418
421
|
return g(n, () => i.footer), n;
|
|
419
422
|
}
|
|
420
423
|
}), null), g(t, s(P, {
|
|
421
424
|
get when() {
|
|
422
|
-
return ce(() => !!
|
|
425
|
+
return ce(() => !!q())() && !u();
|
|
423
426
|
},
|
|
424
427
|
get children() {
|
|
425
428
|
return [(() => {
|
|
426
|
-
var n =
|
|
427
|
-
return m(n, "pointerdown",
|
|
429
|
+
var n = Qe();
|
|
430
|
+
return m(n, "pointerdown", h("n"), !0), c(() => f(n, w("n"))), n;
|
|
428
431
|
})(), (() => {
|
|
429
|
-
var n =
|
|
430
|
-
return m(n, "pointerdown",
|
|
432
|
+
var n = et();
|
|
433
|
+
return m(n, "pointerdown", h("s"), !0), c(() => f(n, w("s"))), n;
|
|
431
434
|
})(), s(P, {
|
|
432
435
|
get when() {
|
|
433
436
|
return !$();
|
|
434
437
|
},
|
|
435
438
|
get children() {
|
|
436
439
|
return [(() => {
|
|
437
|
-
var n = Qe();
|
|
438
|
-
return m(n, "pointerdown", f("e"), !0), u(() => c(n, h("e"))), n;
|
|
439
|
-
})(), (() => {
|
|
440
|
-
var n = et();
|
|
441
|
-
return m(n, "pointerdown", f("w"), !0), u(() => c(n, h("w"))), n;
|
|
442
|
-
})(), (() => {
|
|
443
440
|
var n = tt();
|
|
444
|
-
return m(n, "pointerdown",
|
|
441
|
+
return m(n, "pointerdown", h("e"), !0), c(() => f(n, w("e"))), n;
|
|
445
442
|
})(), (() => {
|
|
446
443
|
var n = nt();
|
|
447
|
-
return m(n, "pointerdown",
|
|
444
|
+
return m(n, "pointerdown", h("w"), !0), c(() => f(n, w("w"))), n;
|
|
448
445
|
})(), (() => {
|
|
449
446
|
var n = it();
|
|
450
|
-
return m(n, "pointerdown",
|
|
447
|
+
return m(n, "pointerdown", h("ne"), !0), c(() => f(n, w("ne"))), n;
|
|
451
448
|
})(), (() => {
|
|
452
449
|
var n = ot();
|
|
453
|
-
return m(n, "pointerdown",
|
|
450
|
+
return m(n, "pointerdown", h("nw"), !0), c(() => f(n, w("nw"))), n;
|
|
451
|
+
})(), (() => {
|
|
452
|
+
var n = rt();
|
|
453
|
+
return m(n, "pointerdown", h("se"), !0), c(() => f(n, w("se"))), n;
|
|
454
|
+
})(), (() => {
|
|
455
|
+
var n = lt();
|
|
456
|
+
return m(n, "pointerdown", h("sw"), !0), c(() => f(n, w("sw"))), n;
|
|
454
457
|
})()];
|
|
455
458
|
}
|
|
456
459
|
})];
|
|
457
460
|
}
|
|
458
|
-
}), null),
|
|
461
|
+
}), null), c(() => f(r, E("flex items-center justify-between h-9 px-3", "border-b", u() ? "rounded-none" : "rounded-t-md", B() && !u() && "cursor-move"))), e;
|
|
459
462
|
}
|
|
460
463
|
});
|
|
461
464
|
}
|
|
@@ -463,5 +466,5 @@ function pt(i) {
|
|
|
463
466
|
}
|
|
464
467
|
ke(["pointerdown", "dblclick"]);
|
|
465
468
|
export {
|
|
466
|
-
|
|
469
|
+
xt as FloatingWindow
|
|
467
470
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createComponent as m, Portal as d, use as y, spread as S, mergeProps as P, insert as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { LOCAL_INTERACTION_SURFACE_ATTR as
|
|
5
|
-
import { clampMenuPosition as
|
|
6
|
-
import { resolveSurfacePortalHost as
|
|
7
|
-
var
|
|
8
|
-
function
|
|
1
|
+
import { createComponent as m, Portal as d, use as y, spread as S, mergeProps as P, insert as R, template as v } from "solid-js/web";
|
|
2
|
+
import { splitProps as _, createMemo as i } from "solid-js";
|
|
3
|
+
import { cn as g } from "../../utils/cn.js";
|
|
4
|
+
import { LOCAL_INTERACTION_SURFACE_ATTR as h } from "./localInteractionSurface.js";
|
|
5
|
+
import { clampMenuPosition as A } from "./menuUtils.js";
|
|
6
|
+
import { resolveSurfacePortalHost as T, SURFACE_FLOATING_LAYER_ATTR as z, resolveSurfacePortalMount as C, resolveSurfacePortalBoundaryRect as x, isSurfacePortalMode as L, projectSurfacePortalPosition as M } from "./dialogSurfaceScope.js";
|
|
7
|
+
var $ = /* @__PURE__ */ v("<div>");
|
|
8
|
+
function E() {
|
|
9
9
|
return {
|
|
10
10
|
left: 0,
|
|
11
11
|
top: 0,
|
|
@@ -15,11 +15,11 @@ function b() {
|
|
|
15
15
|
height: 0
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const [e, l] =
|
|
18
|
+
function j(n) {
|
|
19
|
+
const [e, l] = _(n, ["position", "estimatedSize", "clamp", "class", "style", "children", "layerRef"]), o = i(() => T()), r = () => L(o()), c = () => x(o()) ?? E(), u = () => e.clamp !== !1 && !!e.estimatedSize, p = i(() => {
|
|
20
20
|
const t = e.position;
|
|
21
|
-
return !u() || !e.estimatedSize ? t :
|
|
22
|
-
}), s = () =>
|
|
21
|
+
return !u() || !e.estimatedSize ? t : A(t, e.estimatedSize, c());
|
|
22
|
+
}), s = () => M(p(), o()), f = () => ({
|
|
23
23
|
...e.style ?? {},
|
|
24
24
|
left: `${s().x}px`,
|
|
25
25
|
top: `${s().y}px`
|
|
@@ -29,20 +29,22 @@ function I(n) {
|
|
|
29
29
|
return C(o());
|
|
30
30
|
},
|
|
31
31
|
get children() {
|
|
32
|
-
var t =
|
|
32
|
+
var t = $(), a = e.layerRef;
|
|
33
33
|
return typeof a == "function" ? y(a, t) : e.layerRef = t, S(t, P(l, {
|
|
34
34
|
get class() {
|
|
35
|
-
return
|
|
35
|
+
return g(r() ? "absolute z-20" : "fixed z-50", e.class);
|
|
36
36
|
},
|
|
37
37
|
get style() {
|
|
38
38
|
return f();
|
|
39
39
|
}
|
|
40
|
+
}, {
|
|
41
|
+
[z]: "true"
|
|
40
42
|
}, () => ({
|
|
41
|
-
[
|
|
42
|
-
})), !1, !0),
|
|
43
|
+
[h]: r() ? "true" : void 0
|
|
44
|
+
})), !1, !0), R(t, () => e.children), t;
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
j as SurfaceFloatingLayer
|
|
48
50
|
};
|
|
@@ -2,6 +2,7 @@ import type { SurfacePortalRect } from './surfacePortalTypes';
|
|
|
2
2
|
export declare const DIALOG_SURFACE_HOST_ATTR = "data-floe-dialog-surface-host";
|
|
3
3
|
export declare const SURFACE_PORTAL_HOST_ATTR = "data-floe-dialog-surface-host";
|
|
4
4
|
export declare const SURFACE_PORTAL_LAYER_ATTR = "data-floe-surface-portal-layer";
|
|
5
|
+
export declare const SURFACE_FLOATING_LAYER_ATTR = "data-floe-surface-floating-layer";
|
|
5
6
|
export declare const DIALOG_SURFACE_BOUNDARY_ATTR = "data-floe-dialog-surface-boundary";
|
|
6
7
|
export type DialogSurfaceInteractionSnapshot = Readonly<{
|
|
7
8
|
target: Element | null;
|