@floegence/floe-webapp-core 0.36.2 → 0.36.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.
@@ -1,127 +1,132 @@
1
- import { createComponent as n, Portal as z, setAttribute as c, spread as O, mergeProps as B, memo as D, insert as a, effect as x, className as A, template as s, use as E } from "solid-js/web";
2
- import { createUniqueId as M, createMemo as R, Show as f } from "solid-js";
3
- import { cn as C } from "../../utils/cn.js";
1
+ import { createComponent as n, Portal as R, setAttribute as s, spread as v, mergeProps as C, memo as T, insert as l, effect as A, template as c, use as E } from "solid-js/web";
2
+ import { createUniqueId as S, createMemo as p, Show as u } from "solid-js";
3
+ import { cn as x } from "../../utils/cn.js";
4
4
  import { Button as $ } from "./Button.js";
5
- import { X as F } from "../icons/index.js";
6
- import { useResolvedFloeConfig as N } from "../../context/FloeConfigContext.js";
7
- import { useOverlayMask as j } from "../../hooks/useOverlayMask.js";
8
- import { resolveDialogSurfaceHost as H, DIALOG_SURFACE_BOUNDARY_ATTR as m } from "./dialogSurfaceScope.js";
9
- var U = /* @__PURE__ */ s('<h2 class="text-sm font-semibold">'), P = /* @__PURE__ */ s('<p class="mt-0.5 text-xs text-muted-foreground">'), W = /* @__PURE__ */ s('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), q = /* @__PURE__ */ s('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), G = /* @__PURE__ */ s('<div><div></div><div class="relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), L = /* @__PURE__ */ s("<div>");
10
- function X(e) {
11
- const i = M(), _ = () => `dialog-${i}-title`, w = () => `dialog-${i}-description`;
12
- let h;
13
- const v = R(() => e.open ? H() : {
5
+ import { X as z } from "../icons/index.js";
6
+ import { useResolvedFloeConfig as F } from "../../context/FloeConfigContext.js";
7
+ import { useOverlayMask as M } from "../../hooks/useOverlayMask.js";
8
+ import { resolveDialogSurfaceHost as N, DIALOG_SURFACE_BOUNDARY_ATTR as g } from "./dialogSurfaceScope.js";
9
+ import { LOCAL_INTERACTION_SURFACE_ATTR as U } from "./localInteractionSurface.js";
10
+ var j = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), H = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), L = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), P = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), W = /* @__PURE__ */ c('<div><div></div><div class="relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), q = /* @__PURE__ */ c("<div>");
11
+ function G(e) {
12
+ const o = S(), _ = () => `dialog-${o}-title`, w = () => `dialog-${o}-description`;
13
+ let m;
14
+ const h = p(() => e.open ? N() : {
14
15
  host: null,
15
16
  mode: "global"
16
- }), g = () => `dialog-boundary-${i}`, o = () => v().mode === "surface" && !!v().host?.isConnected, I = () => v().host ?? void 0, S = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${m}="${g()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${m}="${g()}"]`) : !1;
17
- return j({
17
+ }), f = () => `dialog-boundary-${o}`, t = () => h().mode === "surface" && !!h().host?.isConnected, I = () => h().host ?? void 0, B = (r) => typeof Element < "u" && r instanceof Element ? !!r.closest(`[${g}="${f()}"]`) : typeof Node < "u" && r instanceof Node ? !!r.parentElement?.closest(`[${g}="${f()}"]`) : !1;
18
+ return M({
18
19
  open: () => e.open,
19
- root: () => h,
20
- containsTarget: (t) => o() && S(t),
20
+ root: () => m,
21
+ containsTarget: (r) => t() && B(r),
21
22
  onClose: () => e.onOpenChange(!1),
22
- lockBodyScroll: () => !o(),
23
+ lockBodyScroll: () => !t(),
23
24
  trapFocus: !0,
24
- closeOnEscape: () => o() ? "inside" : !0,
25
+ closeOnEscape: () => t() ? "inside" : !0,
25
26
  blockHotkeys: !0,
26
27
  // Block scroll bleed outside the dialog while keeping the dialog content scrollable.
27
- blockWheel: () => o() ? "none" : "outside",
28
- blockTouchMove: () => o() ? "none" : "outside",
28
+ blockWheel: () => t() ? "none" : "outside",
29
+ blockTouchMove: () => t() ? "none" : "outside",
29
30
  restoreFocus: !0
30
- }), n(f, {
31
+ }), n(u, {
31
32
  get when() {
32
33
  return e.open;
33
34
  },
34
35
  get children() {
35
- return n(z, {
36
+ return n(R, {
36
37
  get mount() {
37
38
  return I();
38
39
  },
39
40
  get children() {
40
- var t = G(), b = t.firstChild, T = b.nextSibling, d = T.firstChild, y = d.firstChild;
41
- c(t, "data-floe-dialog-overlay-root", i), c(b, "data-floe-dialog-backdrop", i), O(b, B(() => ({
42
- [m]: g()
41
+ var r = W(), b = r.firstChild, D = b.nextSibling, i = D.firstChild, y = i.firstChild;
42
+ s(r, "data-floe-dialog-overlay-root", o), v(r, C({
43
+ get "data-floe-dialog-mode"() {
44
+ return t() ? "surface" : "global";
45
+ }
46
+ }, () => ({
47
+ [U]: t() ? "true" : void 0
48
+ }), {
49
+ get class() {
50
+ return x(t() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
51
+ }
52
+ }), !1, !0), s(b, "data-floe-dialog-backdrop", o), v(b, C(() => ({
53
+ [g]: f()
43
54
  }), {
44
55
  get class() {
45
- return C("absolute inset-0 cursor-pointer animate-in fade-in", o() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
56
+ return x("absolute inset-0 cursor-pointer animate-in fade-in", t() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
46
57
  },
47
58
  onClick: () => e.onOpenChange(!1)
48
59
  }), !1, !1);
49
- var k = h;
50
- return typeof k == "function" ? E(k, d) : h = d, c(d, "data-floe-dialog-panel", i), O(d, B(() => ({
51
- [m]: g()
60
+ var k = m;
61
+ return typeof k == "function" ? E(k, i) : m = i, s(i, "data-floe-dialog-panel", o), v(i, C(() => ({
62
+ [g]: f()
52
63
  }), {
53
64
  get class() {
54
- return C(o() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
65
+ return x(t() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
55
66
  },
56
67
  role: "dialog",
57
68
  get "aria-modal"() {
58
- return o() ? void 0 : "true";
69
+ return t() ? void 0 : "true";
59
70
  },
60
71
  get "aria-labelledby"() {
61
- return D(() => !!e.title)() ? _() : void 0;
72
+ return T(() => !!e.title)() ? _() : void 0;
62
73
  },
63
74
  get "aria-describedby"() {
64
- return D(() => !!e.description)() ? w() : void 0;
75
+ return T(() => !!e.description)() ? w() : void 0;
65
76
  },
66
77
  tabIndex: -1
67
- }), !1, !0), a(d, n(f, {
78
+ }), !1, !0), l(i, n(u, {
68
79
  get when() {
69
80
  return e.title || e.description;
70
81
  },
71
82
  get children() {
72
- var r = W(), u = r.firstChild;
73
- return a(u, n(f, {
83
+ var d = L(), O = d.firstChild;
84
+ return l(O, n(u, {
74
85
  get when() {
75
86
  return e.title;
76
87
  },
77
88
  get children() {
78
- var l = U();
79
- return a(l, () => e.title), x(() => c(l, "id", _())), l;
89
+ var a = j();
90
+ return l(a, () => e.title), A(() => s(a, "id", _())), a;
80
91
  }
81
- }), null), a(u, n(f, {
92
+ }), null), l(O, n(u, {
82
93
  get when() {
83
94
  return e.description;
84
95
  },
85
96
  get children() {
86
- var l = P();
87
- return a(l, () => e.description), x(() => c(l, "id", w())), l;
97
+ var a = H();
98
+ return l(a, () => e.description), A(() => s(a, "id", w())), a;
88
99
  }
89
- }), null), a(r, n($, {
100
+ }), null), l(d, n($, {
90
101
  variant: "ghost-destructive",
91
102
  size: "icon",
92
103
  class: "h-6 w-6 -mr-1",
93
104
  onClick: () => e.onOpenChange(!1),
94
105
  "aria-label": "Close",
95
106
  get children() {
96
- return n(F, {
107
+ return n(z, {
97
108
  class: "w-3.5 h-3.5"
98
109
  });
99
110
  }
100
- }), null), r;
111
+ }), null), d;
101
112
  }
102
- }), y), a(y, () => e.children), a(d, n(f, {
113
+ }), y), l(y, () => e.children), l(i, n(u, {
103
114
  get when() {
104
115
  return e.footer;
105
116
  },
106
117
  get children() {
107
- var r = q();
108
- return a(r, () => e.footer), r;
118
+ var d = P();
119
+ return l(d, () => e.footer), d;
109
120
  }
110
- }), null), x((r) => {
111
- var u = o() ? "surface" : "global", l = C(o() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
112
- return u !== r.e && c(t, "data-floe-dialog-mode", r.e = u), l !== r.t && A(t, r.t = l), r;
113
- }, {
114
- e: void 0,
115
- t: void 0
116
- }), t;
121
+ }), null), r;
117
122
  }
118
123
  });
119
124
  }
120
125
  });
121
126
  }
122
- function te(e) {
123
- const i = N();
124
- return n(X, {
127
+ function re(e) {
128
+ const o = F();
129
+ return n(G, {
125
130
  get open() {
126
131
  return e.open;
127
132
  },
@@ -142,7 +147,7 @@ function te(e) {
142
147
  return e.loading;
143
148
  },
144
149
  get children() {
145
- return e.cancelText ?? i.config.strings.confirmDialog.cancel;
150
+ return e.cancelText ?? o.config.strings.confirmDialog.cancel;
146
151
  }
147
152
  }), n($, {
148
153
  get variant() {
@@ -155,16 +160,16 @@ function te(e) {
155
160
  return e.loading;
156
161
  },
157
162
  get children() {
158
- return e.confirmText ?? i.config.strings.confirmDialog.confirm;
163
+ return e.confirmText ?? o.config.strings.confirmDialog.confirm;
159
164
  }
160
165
  })];
161
166
  },
162
167
  get children() {
163
- return e.children ?? L();
168
+ return e.children ?? q();
164
169
  }
165
170
  });
166
171
  }
167
172
  export {
168
- te as ConfirmDialog,
169
- X as Dialog
173
+ re as ConfirmDialog,
174
+ G as Dialog
170
175
  };
@@ -1,34 +1,34 @@
1
- import { insert as q, effect as G, className as T, setAttribute as J, setStyleProperty as K, template as Q, use as ee, delegateEvents as te } from "solid-js/web";
2
- import { createSignal as D, untrack as L, createEffect as b, onCleanup as y } from "solid-js";
3
- import { cn as Y } from "../../utils/cn.js";
4
- import { isTypingElement as _ } from "../../utils/dom.js";
5
- import { startHotInteraction as A } from "../../utils/hotInteraction.js";
6
- var ne = /* @__PURE__ */ Q('<div><div style="transform-origin:0 0">');
7
- const re = 1, ie = 0.45, oe = 2.2, ae = 14e-4, ce = '[data-floe-canvas-pan-surface="true"]', M = 3;
8
- function le(n, a, d) {
9
- return Math.max(a, Math.min(d, n));
1
+ import { insert as j, effect as q, className as I, setAttribute as G, setStyleProperty as J, template as K, use as Q, delegateEvents as ee } from "solid-js/web";
2
+ import { createSignal as T, untrack as L, createEffect as _, onCleanup as b } from "solid-js";
3
+ import { cn as D } from "../../utils/cn.js";
4
+ import { startHotInteraction as Y } from "../../utils/hotInteraction.js";
5
+ import { resolveSurfaceInteractionTargetRole as te } from "./localInteractionSurface.js";
6
+ var ne = /* @__PURE__ */ K('<div><div style="transform-origin:0 0">');
7
+ const re = 1, oe = 0.45, ae = 2.2, ie = 14e-4, ce = '[data-floe-canvas-pan-surface="true"]', y = 3;
8
+ function le(n, i, d) {
9
+ return Math.max(i, Math.min(d, n));
10
10
  }
11
- function X(n) {
11
+ function A(n) {
12
12
  return {
13
13
  x: Number.isFinite(n.x) ? n.x : 0,
14
14
  y: Number.isFinite(n.y) ? n.y : 0,
15
15
  scale: Number.isFinite(n.scale) && n.scale > 0 ? n.scale : re
16
16
  };
17
17
  }
18
- function se(n, a) {
19
- return n.deltaMode === 1 ? n.deltaY * 16 : n.deltaMode === 2 ? n.deltaY * (a?.clientHeight ?? window.innerHeight) : n.deltaY;
18
+ function se(n, i) {
19
+ return n.deltaMode === 1 ? n.deltaY * 16 : n.deltaMode === 2 ? n.deltaY * (i?.clientHeight ?? window.innerHeight) : n.deltaY;
20
20
  }
21
- function we(n) {
22
- const [a, d] = D(L(() => X(n.viewport))), [p, S] = D(null);
23
- let o, f, m = !1, l;
24
- const F = () => n.interactiveSelector ?? '[data-floe-canvas-interactive="true"]', k = () => n.panSurfaceSelector ?? ce, $ = () => n.minScale ?? ie, V = () => n.maxScale ?? oe, R = () => n.wheelZoomSpeed ?? ae, N = () => {
21
+ function ve(n) {
22
+ const [i, d] = T(L(() => A(n.viewport))), [p, w] = T(null);
23
+ let a, f, m = !1, l;
24
+ const M = () => n.interactiveSelector ?? '[data-floe-canvas-interactive="true"]', X = () => n.panSurfaceSelector ?? ce, R = () => n.minScale ?? oe, F = () => n.maxScale ?? ae, k = () => n.wheelZoomSpeed ?? ie, $ = () => {
25
25
  const e = p();
26
26
  return e ? e.startedFromPanSurface ? e.moved : !0 : !1;
27
- }, v = () => {
28
- f !== void 0 && (window.clearTimeout(f), f = void 0);
29
27
  }, C = () => {
28
+ f !== void 0 && (window.clearTimeout(f), f = void 0);
29
+ }, g = () => {
30
30
  m = !1, l !== void 0 && (window.clearTimeout(l), l = void 0);
31
- }, U = () => {
31
+ }, V = () => {
32
32
  if (typeof window > "u") {
33
33
  m = !1;
34
34
  return;
@@ -38,113 +38,116 @@ function we(n) {
38
38
  }, 0);
39
39
  }, h = (e) => {
40
40
  L(() => n.onViewportChange?.(e));
41
- }, H = (e) => {
41
+ }, N = (e) => {
42
42
  if (typeof window > "u") {
43
43
  h(e);
44
44
  return;
45
45
  }
46
- v(), f = window.setTimeout(() => {
46
+ C(), f = window.setTimeout(() => {
47
47
  f = void 0, h(e);
48
48
  }, 90);
49
- }, E = (e) => e instanceof Element ? e.closest(F()) ? !0 : _(e) : !1, P = (e) => e instanceof Element ? e.closest(k()) !== null : !1, g = (e) => {
49
+ }, v = (e) => te({
50
+ target: e,
51
+ interactiveSelector: M(),
52
+ panSurfaceSelector: X()
53
+ }), P = (e) => {
50
54
  const t = p();
51
55
  if (!t || e !== void 0 && t.pointerId !== e) return;
52
56
  t.stopInteraction?.();
53
- const r = a();
54
- S(null), o && o.hasPointerCapture(t.pointerId) && o.releasePointerCapture(t.pointerId), t.startedFromPanSurface && t.moved && (m = !0, U()), h(r);
57
+ const r = i();
58
+ w(null), a && a.hasPointerCapture(t.pointerId) && a.releasePointerCapture(t.pointerId), t.startedFromPanSurface && t.moved && (m = !0, V()), h(r);
55
59
  };
56
- b(() => {
57
- p() || d(X(n.viewport));
58
- }), b(() => {
59
- const e = o;
60
+ _(() => {
61
+ p() || d(A(n.viewport));
62
+ }), _(() => {
63
+ const e = a;
60
64
  if (!e) return;
61
65
  const t = (r) => {
62
- !m || !P(r.target) || (C(), r.preventDefault(), r.stopPropagation());
66
+ !m || v(r.target) !== "pan_surface" || (g(), r.preventDefault(), r.stopPropagation());
63
67
  };
64
68
  e.addEventListener("click", t, !0), e.addEventListener("wheel", x, {
65
69
  passive: !1
66
- }), y(() => {
70
+ }), b(() => {
67
71
  e.removeEventListener("click", t, !0), e.removeEventListener("wheel", x);
68
72
  });
69
- }), y(() => {
70
- v(), g(), C();
73
+ }), b(() => {
74
+ C(), P(), g();
71
75
  });
72
- const Z = (e) => {
73
- if (e.button !== 0 || _(e.target) || n.disablePanZoom) return;
74
- const t = P(e.target);
75
- E(e.target) && !t || (v(), C(), t || (e.preventDefault(), o?.setPointerCapture(e.pointerId)), S({
76
+ const U = (e) => {
77
+ if (e.button !== 0 || n.disablePanZoom) return;
78
+ const t = v(e.target), r = t === "pan_surface";
79
+ t !== "local_surface" && (C(), g(), r || (e.preventDefault(), a?.setPointerCapture(e.pointerId)), w({
76
80
  pointerId: e.pointerId,
77
81
  startClientX: e.clientX,
78
82
  startClientY: e.clientY,
79
- startViewport: a(),
83
+ startViewport: i(),
80
84
  moved: !1,
81
- startedFromPanSurface: t,
82
- stopInteraction: t ? void 0 : A({
85
+ startedFromPanSurface: r,
86
+ stopInteraction: r ? void 0 : Y({
83
87
  kind: "drag",
84
88
  cursor: "grabbing"
85
89
  })
86
90
  }));
87
- }, O = (e) => {
91
+ }, H = (e) => {
88
92
  const t = p();
89
93
  if (!t || t.pointerId !== e.pointerId) return;
90
- const r = e.clientX - t.startClientX, i = e.clientY - t.startClientY;
91
- if (!(t.moved || Math.abs(r) > M || Math.abs(i) > M)) return;
92
- t.moved || (e.preventDefault(), o?.hasPointerCapture(e.pointerId) || o?.setPointerCapture(e.pointerId));
93
- const u = {
94
+ const r = e.clientX - t.startClientX, o = e.clientY - t.startClientY;
95
+ if (!(t.moved || Math.abs(r) > y || Math.abs(o) > y)) return;
96
+ t.moved || (e.preventDefault(), a?.hasPointerCapture(e.pointerId) || a?.setPointerCapture(e.pointerId));
97
+ const s = {
94
98
  ...t.startViewport,
95
99
  x: t.startViewport.x + r,
96
- y: t.startViewport.y + i
100
+ y: t.startViewport.y + o
97
101
  };
98
- t.moved || S({
102
+ t.moved || w({
99
103
  ...t,
100
104
  moved: !0,
101
- stopInteraction: t.stopInteraction ?? A({
105
+ stopInteraction: t.stopInteraction ?? Y({
102
106
  kind: "drag",
103
107
  cursor: "grabbing"
104
108
  })
105
- }), d(u);
106
- }, W = (e) => {
107
- g(e.pointerId);
108
- }, B = (e) => {
109
- g(e.pointerId);
109
+ }), d(s);
110
+ }, Z = (e) => {
111
+ P(e.pointerId);
112
+ }, O = (e) => {
113
+ P(e.pointerId);
110
114
  }, x = (e) => {
111
- const t = o?.getBoundingClientRect();
112
- if (!t) return;
113
- if (n.disablePanZoom) {
114
- e.preventDefault();
115
+ if (v(e.target) !== "canvas")
116
+ return;
117
+ const r = a?.getBoundingClientRect();
118
+ if (!r || n.disablePanZoom)
115
119
  return;
116
- }
117
120
  e.preventDefault();
118
- const r = a(), i = e.clientX - t.left, c = e.clientY - t.top, u = se(e, o), s = le(r.scale * Math.exp(-u * R()), $(), V());
119
- if (Math.abs(s - r.scale) < 1e-4) return;
120
- const w = (i - r.x) / r.scale, j = (c - r.y) / r.scale, I = {
121
- x: i - w * s,
122
- y: c - j * s,
123
- scale: s
121
+ const o = i(), c = e.clientX - r.left, s = e.clientY - r.top, S = se(e, a), u = le(o.scale * Math.exp(-S * k()), R(), F());
122
+ if (Math.abs(u - o.scale) < 1e-4) return;
123
+ const B = (c - o.x) / o.scale, z = (s - o.y) / o.scale, E = {
124
+ x: c - B * u,
125
+ y: s - z * u,
126
+ scale: u
124
127
  };
125
- d(I), H(I);
126
- }, z = (e) => {
127
- if (E(e.target)) return;
128
- const t = o?.getBoundingClientRect();
128
+ d(E), N(E);
129
+ }, W = (e) => {
130
+ if (v(e.target) !== "canvas") return;
131
+ const t = a?.getBoundingClientRect();
129
132
  if (!t) return;
130
133
  e.preventDefault();
131
- const r = e.clientX - t.left, i = e.clientY - t.top, c = a();
134
+ const r = e.clientX - t.left, o = e.clientY - t.top, c = i();
132
135
  n.onCanvasContextMenu?.({
133
136
  clientX: e.clientX,
134
137
  clientY: e.clientY,
135
138
  localX: r,
136
- localY: i,
139
+ localY: o,
137
140
  worldX: (r - c.x) / c.scale,
138
- worldY: (i - c.y) / c.scale
141
+ worldY: (o - c.y) / c.scale
139
142
  });
140
143
  };
141
144
  return (() => {
142
145
  var e = ne(), t = e.firstChild;
143
- e.$$contextmenu = z, e.addEventListener("pointercancel", B), e.$$pointerup = W, e.$$pointermove = O, e.$$pointerdown = Z;
144
- var r = o;
145
- return typeof r == "function" ? ee(r, e) : o = e, q(t, () => n.children), G((i) => {
146
- var c = Y("floe-infinite-canvas", N() && "is-panning", n.disablePanZoom && "is-locked", n.class), u = n.ariaLabel ?? "Infinite canvas", s = Y("floe-infinite-canvas__viewport", n.contentClass), w = `translate(${a().x}px, ${a().y}px) scale(${a().scale})`;
147
- return c !== i.e && T(e, i.e = c), u !== i.t && J(e, "aria-label", i.t = u), s !== i.a && T(t, i.a = s), w !== i.o && K(t, "transform", i.o = w), i;
146
+ e.$$contextmenu = W, e.addEventListener("pointercancel", O), e.$$pointerup = Z, e.$$pointermove = H, e.$$pointerdown = U;
147
+ var r = a;
148
+ return typeof r == "function" ? Q(r, e) : a = e, j(t, () => n.children), q((o) => {
149
+ var c = D("floe-infinite-canvas", $() && "is-panning", n.disablePanZoom && "is-locked", n.class), s = n.ariaLabel ?? "Infinite canvas", S = D("floe-infinite-canvas__viewport", n.contentClass), u = `translate(${i().x}px, ${i().y}px) scale(${i().scale})`;
150
+ return c !== o.e && I(e, o.e = c), s !== o.t && G(e, "aria-label", o.t = s), S !== o.a && I(t, o.a = S), u !== o.o && J(t, "transform", o.o = u), o;
148
151
  }, {
149
152
  e: void 0,
150
153
  t: void 0,
@@ -153,7 +156,7 @@ function we(n) {
153
156
  }), e;
154
157
  })();
155
158
  }
156
- te(["pointerdown", "pointermove", "pointerup", "contextmenu"]);
159
+ ee(["pointerdown", "pointermove", "pointerup", "contextmenu"]);
157
160
  export {
158
- we as InfiniteCanvas
161
+ ve as InfiniteCanvas
159
162
  };
@@ -7,6 +7,7 @@ export { Dropdown, Select, type DropdownProps, type DropdownItem, type SelectPro
7
7
  export { Tooltip, type TooltipProps } from './Tooltip';
8
8
  export { CommandPalette } from './CommandPalette';
9
9
  export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
10
+ export { LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveWorkbenchWidgetEventOwnership, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, } from './localInteractionSurface';
10
11
  export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Interactive3DCard, AnimatedBorderCard, NeonCard, MorphCard, type CardProps, type CardVariant, type CardHeaderProps, type CardTitleProps, type CardDescriptionProps, type CardContentProps, type CardFooterProps, type Interactive3DCardProps, type AnimatedBorderCardProps, type NeonCardProps, type MorphCardProps, } from './Card';
11
12
  export { Tabs, TabPanel, type TabsProps, type TabPanelProps, type TabItem, type TabsFeatures, type TabsSlotClassNames, type TabsIndicatorMode, type TabsIndicatorColorToken, } from './Tabs';
12
13
  export { DirectoryPicker, type DirectoryPickerProps } from './DirectoryPicker';
@@ -0,0 +1,19 @@
1
+ export declare const LOCAL_INTERACTION_SURFACE_ATTR = "data-floe-local-interaction-surface";
2
+ export declare const DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR = "[data-floe-local-interaction-surface=\"true\"]";
3
+ export declare const WORKBENCH_WIDGET_SHELL_ATTR = "data-floe-workbench-widget-shell";
4
+ export declare const DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR = "[data-floe-workbench-widget-shell=\"true\"]";
5
+ export type SurfaceInteractionTargetRole = 'canvas' | 'local_surface' | 'pan_surface';
6
+ export type WorkbenchWidgetEventOwnership = 'outside_widget' | 'widget_local' | 'widget_shell';
7
+ export interface SurfaceInteractionRoutingOptions {
8
+ target: EventTarget | null;
9
+ interactiveSelector: string;
10
+ panSurfaceSelector: string;
11
+ localInteractionSurfaceSelector?: string;
12
+ }
13
+ export interface WorkbenchWidgetEventOwnershipOptions extends SurfaceInteractionRoutingOptions {
14
+ widgetRoot: Element | EventTarget | null;
15
+ shellSelector?: string;
16
+ }
17
+ export declare function resolveSurfaceInteractionTargetRole(options: SurfaceInteractionRoutingOptions): SurfaceInteractionTargetRole;
18
+ export declare function isLocalInteractionSurfaceTarget(options: SurfaceInteractionRoutingOptions): boolean;
19
+ export declare function resolveWorkbenchWidgetEventOwnership(options: WorkbenchWidgetEventOwnershipOptions): WorkbenchWidgetEventOwnership;
@@ -0,0 +1,33 @@
1
+ import { isTypingElement as i } from "../../utils/dom.js";
2
+ const s = "data-floe-local-interaction-surface", u = `[${s}="true"]`, f = "data-floe-workbench-widget-shell", E = `[${f}="true"]`;
3
+ function o(e) {
4
+ return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
+ }
6
+ function a(e) {
7
+ const {
8
+ target: l,
9
+ interactiveSelector: c,
10
+ panSurfaceSelector: n,
11
+ localInteractionSurfaceSelector: t = u
12
+ } = e, r = l instanceof Element ? l : null;
13
+ return r ? r.closest(n) !== null ? "pan_surface" : i(r) || r.closest(c) !== null || r.closest(t) !== null ? "local_surface" : "canvas" : "canvas";
14
+ }
15
+ function d(e) {
16
+ return a(e) !== "canvas";
17
+ }
18
+ function T(e) {
19
+ const {
20
+ widgetRoot: l,
21
+ shellSelector: c = E
22
+ } = e, n = o(l), t = o(e.target);
23
+ return !n || !t || !n.contains(t) ? "outside_widget" : a(e) !== "canvas" ? "widget_local" : t === n || t.closest(c) !== null ? "widget_shell" : "widget_local";
24
+ }
25
+ export {
26
+ u as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
27
+ E as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
28
+ s as LOCAL_INTERACTION_SURFACE_ATTR,
29
+ f as WORKBENCH_WIDGET_SHELL_ATTR,
30
+ d as isLocalInteractionSurfaceTarget,
31
+ a as resolveSurfaceInteractionTargetRole,
32
+ T as resolveWorkbenchWidgetEventOwnership
33
+ };
@@ -6,7 +6,6 @@ export interface WorkbenchCanvasProps {
6
6
  viewport: WorkbenchViewport;
7
7
  selectedWidgetId: string | null;
8
8
  optimisticFrontWidgetId: string | null;
9
- topZIndex: number;
10
9
  locked: boolean;
11
10
  filters: Record<WorkbenchWidgetType, boolean>;
12
11
  setCanvasFrameRef: (el: HTMLDivElement | undefined) => void;
@@ -1,11 +1,11 @@
1
1
  import { use as r, insert as o, createComponent as i, effect as a, template as g } from "solid-js/web";
2
2
  import { WorkbenchCanvasField as c } from "./WorkbenchCanvasField.js";
3
- import { InfiniteCanvas as u } from "../ui/InfiniteCanvas.js";
4
- var m = /* @__PURE__ */ g("<div class=workbench-canvas>");
5
- function C(e) {
3
+ import { InfiniteCanvas as m } from "../ui/InfiniteCanvas.js";
4
+ var u = /* @__PURE__ */ g("<div class=workbench-canvas>");
5
+ function v(e) {
6
6
  return (() => {
7
- var t = m(), n = e.setCanvasFrameRef;
8
- return typeof n == "function" ? r(n, t) : e.setCanvasFrameRef = t, o(t, i(u, {
7
+ var t = u(), n = e.setCanvasFrameRef;
8
+ return typeof n == "function" ? r(n, t) : e.setCanvasFrameRef = t, o(t, i(m, {
9
9
  ariaLabel: "Workbench canvas",
10
10
  class: "workbench-canvas__infinite",
11
11
  get viewport() {
@@ -34,9 +34,6 @@ function C(e) {
34
34
  get optimisticFrontWidgetId() {
35
35
  return e.optimisticFrontWidgetId;
36
36
  },
37
- get topZIndex() {
38
- return e.topZIndex;
39
- },
40
37
  get viewportScale() {
41
38
  return e.viewport.scale;
42
39
  },
@@ -73,5 +70,5 @@ function C(e) {
73
70
  })();
74
71
  }
75
72
  export {
76
- C as WorkbenchCanvas
73
+ v as WorkbenchCanvas
77
74
  };
@@ -4,7 +4,6 @@ export interface WorkbenchCanvasFieldProps {
4
4
  widgets: readonly WorkbenchWidgetItem[];
5
5
  selectedWidgetId: string | null;
6
6
  optimisticFrontWidgetId: string | null;
7
- topZIndex: number;
8
7
  viewportScale: number;
9
8
  locked: boolean;
10
9
  filters: Record<WorkbenchWidgetType, boolean>;