@floegence/floe-webapp-core 0.36.68 → 0.36.69

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.
@@ -1,28 +1,28 @@
1
1
  import { createComponent as s, Portal as Fe, spread as ae, mergeProps as de, memo as ue, insert as g, effect as u, setAttribute as Le, addEventListener as m, className as c, template as a, use as Me, delegateEvents as De } from "solid-js/web";
2
- import { createUniqueId as Te, createSignal as p, onMount as We, onCleanup as U, createEffect as b, Show as P, batch as ke } from "solid-js";
2
+ import { createUniqueId as ke, createSignal as p, onMount as Te, onCleanup as U, createEffect as b, Show as P, batch as We, untrack as Oe } from "solid-js";
3
3
  import { cn as C } from "../../utils/cn.js";
4
- import { useLayout as Oe } from "../../context/LayoutContext.js";
4
+ import { useLayout as He } from "../../context/LayoutContext.js";
5
5
  import { Button as ce } from "./Button.js";
6
- import { Restore as He, Maximize as Ue, X as Xe } from "../icons/index.js";
7
- import { startHotInteraction as Ye } from "../../utils/hotInteraction.js";
8
- import { resolveFloatingWindowViewport as fe, normalizeFloatingWindowRect as he, resolveFloatingWindowRect as qe } from "./floatingWindowGeometry.js";
6
+ import { Restore as Ue, Maximize as Xe, X as Ye } from "../icons/index.js";
7
+ import { startHotInteraction as qe } from "../../utils/hotInteraction.js";
8
+ import { resolveFloatingWindowViewport as fe, normalizeFloatingWindowRect as he, resolveFloatingWindowRect as Ne } from "./floatingWindowGeometry.js";
9
9
  import { LOCAL_INTERACTION_SURFACE_ATTR as we } from "./localInteractionSurface.js";
10
- import { SURFACE_PORTAL_LAYER_ATTR as Ne } from "./dialogSurfaceScope.js";
11
- var Be = /* @__PURE__ */ a('<h2 class="text-sm font-medium truncate select-none">'), je = /* @__PURE__ */ a('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), Ge = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), Ve = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), Ze = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), Je = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), Ke = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), Qe = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), et = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), tt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), nt = /* @__PURE__ */ a('<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">');
12
- function ht(i) {
10
+ import { SURFACE_PORTAL_LAYER_ATTR as Be } from "./dialogSurfaceScope.js";
11
+ var je = /* @__PURE__ */ a('<h2 class="text-sm font-medium truncate select-none">'), Ge = /* @__PURE__ */ a('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), Ve = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), Ze = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), Je = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), Ke = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), Qe = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), et = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), tt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), nt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), it = /* @__PURE__ */ a('<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">');
12
+ function wt(i) {
13
13
  const X = () => i.resizable ?? !0, Y = () => i.draggable ?? !0, E = () => i.minSize ?? {
14
14
  width: 200,
15
15
  height: 150
16
16
  }, A = () => i.maxSize ?? {
17
17
  width: 1 / 0,
18
18
  height: 1 / 0
19
- }, z = () => i.viewportInsets ?? {}, ge = () => i.zIndex ?? 100, me = Te(), ve = Oe(), $ = () => ve.isMobile(), F = 16, q = () => `floating-window-${me}-title`, [L, pe] = p(i.defaultPosition ?? {
19
+ }, x = () => i.viewportInsets ?? {}, ge = () => i.zIndex ?? 100, me = ke(), ve = He(), $ = () => ve.isMobile(), F = 16, q = () => `floating-window-${me}-title`, [L, pe] = p(i.defaultPosition ?? {
20
20
  x: 0,
21
21
  y: 0
22
- }), [M, ze] = p(i.defaultSize ?? {
22
+ }), [M, xe] = p(i.defaultSize ?? {
23
23
  width: 400,
24
24
  height: 300
25
- }), [d, N] = p(!1), [B, j] = p(!1), [G, V] = p(!1), [xe, D] = p(!1), [ye, be] = p(null);
25
+ }), [d, N] = p(!1), [B, j] = p(!1), [G, V] = p(!1), [ze, D] = p(!1), [ye, be] = p(null);
26
26
  let Z = {
27
27
  x: 0,
28
28
  y: 0
@@ -39,10 +39,10 @@ function ht(i) {
39
39
  y: 0,
40
40
  width: 0,
41
41
  height: 0
42
- }, ee = "se", r, o = null, v = null, I = {
42
+ }, ee = "se", o, r = null, v = null, I = {
43
43
  x: 0,
44
44
  y: 0
45
- }, x = null, _ = null, T = !1, y = {
45
+ }, z = null, _ = null, k = !1, y = {
46
46
  x: i.defaultPosition?.x ?? 0,
47
47
  y: i.defaultPosition?.y ?? 0,
48
48
  width: i.defaultSize?.width ?? 400,
@@ -57,19 +57,19 @@ function ht(i) {
57
57
  nw: "nwse-resize",
58
58
  se: "nwse-resize",
59
59
  sw: "nesw-resize"
60
- }, W = (e, t) => {
60
+ }, T = (e, t) => {
61
61
  if (!e) {
62
62
  _?.(), _ = null;
63
63
  return;
64
64
  }
65
- _?.(), _ = Ye({
65
+ _?.(), _ = qe({
66
66
  kind: v === "resize" ? "resize" : "drag",
67
67
  cursor: t,
68
68
  lockUserSelect: !0
69
69
  });
70
70
  }, te = (e) => {
71
- y = 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`);
72
- }, k = () => {
71
+ y = 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`);
72
+ }, W = () => {
73
73
  const e = L(), t = M();
74
74
  return {
75
75
  x: e.x,
@@ -78,16 +78,16 @@ function ht(i) {
78
78
  height: t.height
79
79
  };
80
80
  }, S = (e) => {
81
- y = e, pe({
81
+ y = e, pe((t) => t.x === e.x && t.y === e.y ? t : {
82
82
  x: e.x,
83
83
  y: e.y
84
- }), ze({
84
+ }), xe((t) => t.width === e.width && t.height === e.height ? t : {
85
85
  width: e.width,
86
86
  height: e.height
87
87
  });
88
88
  }, $e = () => {
89
89
  try {
90
- r?.focus({
90
+ o?.focus({
91
91
  preventScroll: !0
92
92
  });
93
93
  } catch {
@@ -95,9 +95,9 @@ function ht(i) {
95
95
  }, Ie = (e) => {
96
96
  const t = e instanceof Element ? e : null;
97
97
  return t ? t.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
98
- }, O = (e) => !!r && e instanceof Node && r.contains(e), Se = () => {
99
- if (!r) return null;
100
- const e = r.getBoundingClientRect();
98
+ }, O = (e) => !!o && e instanceof Node && o.contains(e), Se = () => {
99
+ if (!o) return null;
100
+ const e = o.getBoundingClientRect();
101
101
  return {
102
102
  x: e.left,
103
103
  y: e.top,
@@ -105,7 +105,7 @@ function ht(i) {
105
105
  height: e.height
106
106
  };
107
107
  }, ne = () => {
108
- i.open && (o === null || v === null || typeof window > "u" || te(qe({
108
+ i.open && (r === null || v === null || typeof window > "u" || te(Ne({
109
109
  mode: v,
110
110
  pointer: I,
111
111
  dragStartPos: Z,
@@ -119,7 +119,7 @@ function ht(i) {
119
119
  width: window.innerWidth,
120
120
  height: window.innerHeight
121
121
  },
122
- viewportInsets: z(),
122
+ viewportInsets: x(),
123
123
  mobile: $(),
124
124
  mobilePadding: F
125
125
  })));
@@ -130,37 +130,37 @@ function ht(i) {
130
130
  height: window.innerHeight
131
131
  };
132
132
  if (d()) {
133
- S(fe(t, z()));
133
+ S(fe(t, x()));
134
134
  return;
135
135
  }
136
136
  S(he({
137
- rect: k(),
137
+ rect: W(),
138
138
  minSize: E(),
139
139
  maxSize: A(),
140
140
  viewport: t,
141
- viewportInsets: z(),
141
+ viewportInsets: x(),
142
142
  mobile: $(),
143
143
  mobilePadding: F,
144
144
  center: e?.center ?? !1
145
145
  }));
146
146
  }, H = (e, t = !0) => {
147
- x !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(x), x = null), t && ne();
147
+ z !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(z), z = null), t && ne();
148
148
  const l = t ? Se() ?? y : null;
149
149
  if (e !== void 0)
150
150
  try {
151
- typeof r?.releasePointerCapture == "function" && r.releasePointerCapture(e);
151
+ typeof o?.releasePointerCapture == "function" && o.releasePointerCapture(e);
152
152
  } catch {
153
153
  }
154
- ke(() => {
155
- l && S(l), o = null, v = null, j(!1), V(!1);
156
- }), W(!1, "");
154
+ We(() => {
155
+ l && S(l), r = null, v = null, j(!1), V(!1);
156
+ }), T(!1, "");
157
157
  };
158
- We(() => {
158
+ Te(() => {
159
159
  i.open || R({
160
160
  center: !i.defaultPosition
161
161
  });
162
162
  const e = () => {
163
- o === null && R({
163
+ r === null && R({
164
164
  center: !1
165
165
  });
166
166
  };
@@ -168,10 +168,10 @@ function ht(i) {
168
168
  }), b(() => {
169
169
  if (!i.open) return;
170
170
  $();
171
- const e = !T && !i.defaultPosition, t = () => {
171
+ const e = !k && !i.defaultPosition, t = () => {
172
172
  R({
173
173
  center: e
174
- }), T = !0;
174
+ }), k = !0;
175
175
  };
176
176
  if (typeof requestAnimationFrame > "u") {
177
177
  t();
@@ -179,9 +179,9 @@ function ht(i) {
179
179
  }
180
180
  requestAnimationFrame(t);
181
181
  }), b(() => {
182
- !i.open || !T || o !== null || (z(), R({
182
+ !i.open || !k || r !== null || (x(), Oe(() => R({
183
183
  center: !1
184
- }));
184
+ })));
185
185
  }), b(() => {
186
186
  if (!i.open) return;
187
187
  const e = (t) => {
@@ -192,7 +192,7 @@ function ht(i) {
192
192
  document.addEventListener("keydown", e, !0), U(() => document.removeEventListener("keydown", e, !0));
193
193
  }), b(() => {
194
194
  if (!i.open) {
195
- D(!1), H(o ?? void 0, !1);
195
+ D(!1), H(r ?? void 0, !1);
196
196
  return;
197
197
  }
198
198
  D(!0);
@@ -210,11 +210,11 @@ function ht(i) {
210
210
  });
211
211
  }), b(() => {
212
212
  if (!i.open) return;
213
- const e = k();
214
- o === null ? te(e) : y = e;
213
+ const e = W();
214
+ r === null ? te(e) : y = e;
215
215
  });
216
216
  const _e = (e) => {
217
- !Y() || d() || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), o = e.pointerId, v = "drag", j(!0), Z = {
217
+ !Y() || d() || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), r = e.pointerId, v = "drag", j(!0), Z = {
218
218
  x: e.clientX,
219
219
  y: e.clientY
220
220
  }, J = {
@@ -222,9 +222,9 @@ function ht(i) {
222
222
  }, I = {
223
223
  x: e.clientX,
224
224
  y: e.clientY
225
- }, W(!0, "grabbing"), typeof r?.setPointerCapture == "function" && r.setPointerCapture(e.pointerId));
225
+ }, T(!0, "grabbing"), typeof o?.setPointerCapture == "function" && o.setPointerCapture(e.pointerId));
226
226
  }, f = (e) => (t) => {
227
- !X() || d() || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), t.stopPropagation(), o = t.pointerId, v = "resize", V(!0), ee = e, K = {
227
+ !X() || d() || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), t.stopPropagation(), r = t.pointerId, v = "resize", V(!0), ee = e, K = {
228
228
  x: t.clientX,
229
229
  y: t.clientY
230
230
  }, Q = {
@@ -232,27 +232,27 @@ function ht(i) {
232
232
  }, I = {
233
233
  x: t.clientX,
234
234
  y: t.clientY
235
- }, W(!0, Pe[e]), typeof r?.setPointerCapture == "function" && r.setPointerCapture(t.pointerId));
235
+ }, T(!0, Pe[e]), typeof o?.setPointerCapture == "function" && o.setPointerCapture(t.pointerId));
236
236
  }, ie = () => {
237
- x = null, ne();
237
+ z = null, ne();
238
238
  }, Re = (e) => {
239
- if (!(o === null || e.pointerId !== o) && v !== null && (I = {
239
+ if (!(r === null || e.pointerId !== r) && v !== null && (I = {
240
240
  x: e.clientX,
241
241
  y: e.clientY
242
- }, x === null)) {
242
+ }, z === null)) {
243
243
  if (typeof requestAnimationFrame > "u") {
244
244
  ie();
245
245
  return;
246
246
  }
247
- x = requestAnimationFrame(ie);
247
+ z = requestAnimationFrame(ie);
248
248
  }
249
- }, re = (e) => {
250
- o === null || e.pointerId !== o || (I = {
249
+ }, oe = (e) => {
250
+ r === null || e.pointerId !== r || (I = {
251
251
  x: e.clientX,
252
252
  y: e.clientY
253
253
  }, H(e.pointerId));
254
- }, oe = () => {
255
- if (o !== null && H(o, !0), d()) {
254
+ }, re = () => {
255
+ if (r !== null && H(r, !0), d()) {
256
256
  const t = ye();
257
257
  t && S(he({
258
258
  rect: {
@@ -267,14 +267,14 @@ function ht(i) {
267
267
  width: window.innerWidth,
268
268
  height: window.innerHeight
269
269
  },
270
- viewportInsets: z(),
270
+ viewportInsets: x(),
271
271
  mobile: $(),
272
272
  mobilePadding: F,
273
273
  center: !1
274
274
  })), N(!1);
275
275
  return;
276
276
  }
277
- const e = k();
277
+ const e = W();
278
278
  be({
279
279
  position: {
280
280
  x: e.x,
@@ -287,9 +287,9 @@ function ht(i) {
287
287
  }), S(fe({
288
288
  width: window.innerWidth,
289
289
  height: window.innerHeight
290
- }, z())), N(!0);
290
+ }, x())), N(!0);
291
291
  }, Ce = () => {
292
- oe();
292
+ re();
293
293
  }, Ee = (e) => {
294
294
  Ie(e.target) && $e();
295
295
  }, h = (e) => C("absolute z-10", {
@@ -309,8 +309,8 @@ function ht(i) {
309
309
  get children() {
310
310
  return s(Fe, {
311
311
  get children() {
312
- var e = nt(), t = e.firstChild, l = t.firstChild, w = l.firstChild, le = w.nextSibling, Ae = l.nextSibling, se = r;
313
- return typeof se == "function" ? Me(se, e) : r = e, ae(e, de({
312
+ var e = it(), t = e.firstChild, l = t.firstChild, w = l.firstChild, le = w.nextSibling, Ae = l.nextSibling, se = o;
313
+ return typeof se == "function" ? Me(se, e) : o = e, ae(e, de({
314
314
  [we]: "true"
315
315
  }, {
316
316
  get class() {
@@ -326,8 +326,8 @@ function ht(i) {
326
326
  };
327
327
  },
328
328
  onPointerMove: Re,
329
- onPointerUp: re,
330
- onPointerCancel: re,
329
+ onPointerUp: oe,
330
+ onPointerCancel: oe,
331
331
  role: "dialog",
332
332
  get "aria-labelledby"() {
333
333
  return ue(() => !!i.title)() ? q() : void 0;
@@ -335,11 +335,11 @@ function ht(i) {
335
335
  tabIndex: -1,
336
336
  onPointerDown: Ee
337
337
  }), !1, !0), ae(t, de({
338
- [Ne]: "true"
338
+ [Be]: "true"
339
339
  }, {
340
340
  "data-floe-floating-window-surface": "true",
341
341
  get "data-floe-floating-window-state"() {
342
- return xe() ? "active" : "inactive";
342
+ return ze() ? "active" : "inactive";
343
343
  }
344
344
  }, {
345
345
  [we]: "true"
@@ -352,7 +352,7 @@ function ht(i) {
352
352
  return i.title;
353
353
  },
354
354
  get children() {
355
- var n = Be();
355
+ var n = je();
356
356
  return g(n, () => i.title), u(() => Le(n, "id", q())), n;
357
357
  }
358
358
  })), g(le, s(ce, {
@@ -360,7 +360,7 @@ function ht(i) {
360
360
  size: "icon",
361
361
  class: "h-6 w-6",
362
362
  onClick: (n) => {
363
- n.stopPropagation(), oe();
363
+ n.stopPropagation(), re();
364
364
  },
365
365
  get "aria-label"() {
366
366
  return d() ? "Restore" : "Maximize";
@@ -371,12 +371,12 @@ function ht(i) {
371
371
  return d();
372
372
  },
373
373
  get fallback() {
374
- return s(Ue, {
374
+ return s(Xe, {
375
375
  class: "w-3 h-3"
376
376
  });
377
377
  },
378
378
  get children() {
379
- return s(He, {
379
+ return s(Ue, {
380
380
  class: "w-3 h-3"
381
381
  });
382
382
  }
@@ -391,7 +391,7 @@ function ht(i) {
391
391
  },
392
392
  "aria-label": "Close",
393
393
  get children() {
394
- return s(Xe, {
394
+ return s(Ye, {
395
395
  class: "w-3.5 h-3.5"
396
396
  });
397
397
  }
@@ -400,7 +400,7 @@ function ht(i) {
400
400
  return i.footer;
401
401
  },
402
402
  get children() {
403
- var n = je();
403
+ var n = Ge();
404
404
  return g(n, () => i.footer), n;
405
405
  }
406
406
  }), null), g(t, s(P, {
@@ -409,10 +409,10 @@ function ht(i) {
409
409
  },
410
410
  get children() {
411
411
  return [(() => {
412
- var n = Ge();
412
+ var n = Ve();
413
413
  return m(n, "pointerdown", f("n"), !0), u(() => c(n, h("n"))), n;
414
414
  })(), (() => {
415
- var n = Ve();
415
+ var n = Ze();
416
416
  return m(n, "pointerdown", f("s"), !0), u(() => c(n, h("s"))), n;
417
417
  })(), s(P, {
418
418
  get when() {
@@ -420,22 +420,22 @@ function ht(i) {
420
420
  },
421
421
  get children() {
422
422
  return [(() => {
423
- var n = Ze();
423
+ var n = Je();
424
424
  return m(n, "pointerdown", f("e"), !0), u(() => c(n, h("e"))), n;
425
425
  })(), (() => {
426
- var n = Je();
426
+ var n = Ke();
427
427
  return m(n, "pointerdown", f("w"), !0), u(() => c(n, h("w"))), n;
428
428
  })(), (() => {
429
- var n = Ke();
429
+ var n = Qe();
430
430
  return m(n, "pointerdown", f("ne"), !0), u(() => c(n, h("ne"))), n;
431
431
  })(), (() => {
432
- var n = Qe();
432
+ var n = et();
433
433
  return m(n, "pointerdown", f("nw"), !0), u(() => c(n, h("nw"))), n;
434
434
  })(), (() => {
435
- var n = et();
435
+ var n = tt();
436
436
  return m(n, "pointerdown", f("se"), !0), u(() => c(n, h("se"))), n;
437
437
  })(), (() => {
438
- var n = tt();
438
+ var n = nt();
439
439
  return m(n, "pointerdown", f("sw"), !0), u(() => c(n, h("sw"))), n;
440
440
  })()];
441
441
  }
@@ -449,5 +449,5 @@ function ht(i) {
449
449
  }
450
450
  De(["pointerdown", "dblclick"]);
451
451
  export {
452
- ht as FloatingWindow
452
+ wt as FloatingWindow
453
453
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.36.68",
3
+ "version": "0.36.69",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",