@floegence/floe-webapp-core 0.36.33 → 0.36.35

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,142 +1,192 @@
1
- import { createComponent as n, Portal as D, setAttribute as u, spread as x, mergeProps as $, memo as C, insert as l, effect as S, template as c, use as E } from "solid-js/web";
2
- import { createUniqueId as M, createMemo as T, Show as s } from "solid-js";
3
- import { cn as _ } from "../../utils/cn.js";
4
- import { Button as y } from "./Button.js";
5
- import { X as P } from "../icons/index.js";
6
- import { useResolvedFloeConfig as j } from "../../context/FloeConfigContext.js";
7
- import { useOverlayMask as z } from "../../hooks/useOverlayMask.js";
8
- import { resolveSurfacePortalHost as F, projectSurfacePortalRect as H, resolveSurfacePortalBoundaryRect as N, DIALOG_SURFACE_BOUNDARY_ATTR as h, isSurfacePortalMode as U, resolveSurfacePortalMount as L } from "./dialogSurfaceScope.js";
9
- import { LOCAL_INTERACTION_SURFACE_ATTR as W } from "./localInteractionSurface.js";
10
- var q = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), G = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), X = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), Y = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), J = /* @__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">'), K = /* @__PURE__ */ c("<div>");
11
- function Q(e) {
12
- const o = M(), w = () => `dialog-${o}-title`, k = () => `dialog-${o}-description`;
13
- let b;
14
- const f = T(() => e.open ? F() : {
1
+ import { createComponent as n, use as D, setAttribute as s, style as K, Portal as W, spread as A, mergeProps as O, memo as R, insert as d, effect as E, template as u } from "solid-js/web";
2
+ import { createUniqueId as Y, createSignal as k, createMemo as I, createEffect as X, onCleanup as J, Show as g, untrack as Q } from "solid-js";
3
+ import { cn as S } from "../../utils/cn.js";
4
+ import { Button as P } from "./Button.js";
5
+ import { X as Z } from "../icons/index.js";
6
+ import { useResolvedFloeConfig as ee } from "../../context/FloeConfigContext.js";
7
+ import { useOverlayMask as te } from "../../hooks/useOverlayMask.js";
8
+ import { resolveSurfacePortalHost as re, isSurfacePortalMode as F, DIALOG_SURFACE_BOUNDARY_ATTR as x, projectSurfacePortalRect as ne, resolveSurfacePortalBoundaryRect as oe, resolveSurfacePortalMount as ie } from "./dialogSurfaceScope.js";
9
+ import { LOCAL_INTERACTION_SURFACE_ATTR as le } from "./localInteractionSurface.js";
10
+ var ae = /* @__PURE__ */ u("<span aria-hidden=true>"), de = /* @__PURE__ */ u('<h2 class="text-sm font-semibold">'), ce = /* @__PURE__ */ u('<p class="mt-0.5 text-xs text-muted-foreground">'), ue = /* @__PURE__ */ u('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), se = /* @__PURE__ */ u('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), fe = /* @__PURE__ */ u('<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">'), me = /* @__PURE__ */ u("<div>");
11
+ const ge = {
12
+ display: "none"
13
+ };
14
+ function he(e) {
15
+ if (typeof queueMicrotask == "function") {
16
+ queueMicrotask(e);
17
+ return;
18
+ }
19
+ Promise.resolve().then(e);
20
+ }
21
+ function M(e) {
22
+ return `${e.left}|${e.top}|${e.right}|${e.bottom}|${e.width}|${e.height}`;
23
+ }
24
+ function we(e) {
25
+ return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : window.setTimeout(() => e(Date.now()), 16);
26
+ }
27
+ function be(e) {
28
+ if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
29
+ window.cancelAnimationFrame(e);
30
+ return;
31
+ }
32
+ window.clearTimeout(e);
33
+ }
34
+ function ve(e) {
35
+ const o = Y(), T = () => `dialog-${o}-title`, B = () => `dialog-${o}-description`;
36
+ let p;
37
+ const [_, H] = k(null), [N, j] = k(0), [q, G] = k(0), h = () => e.open && !!_() && N() > 0, z = (t) => {
38
+ H(t), he(() => {
39
+ Q(_) === t && j((l) => l + 1);
40
+ });
41
+ }, w = I(() => h() ? re({
42
+ owner: _()
43
+ }) : {
15
44
  host: null,
16
45
  boundaryHost: null,
17
46
  mountHost: null,
18
47
  mode: "global"
19
- }), g = () => `dialog-boundary-${o}`, t = () => U(f()), A = () => L(f()), m = T(() => H(N(f()), f())), B = (r) => typeof Element < "u" && r instanceof Element ? !!r.closest(`[${h}="${g()}"]`) : typeof Node < "u" && r instanceof Node ? !!r.parentElement?.closest(`[${h}="${g()}"]`) : !1;
20
- return z({
21
- open: () => e.open,
22
- root: () => b,
23
- containsTarget: (r) => t() && B(r),
48
+ }), b = () => `dialog-boundary-${o}`, r = () => F(w()), L = () => ie(w()), C = (t) => ne(oe(t), t), U = () => C(w()), v = I(() => (q(), U())), V = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${x}="${b()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${x}="${b()}"]`) : !1;
49
+ return X(() => {
50
+ const t = w();
51
+ if (!h() || !F(t) || typeof window > "u")
52
+ return;
53
+ let l = !1, f = null, i = M(C(t));
54
+ const y = () => {
55
+ if (l || !F(t))
56
+ return;
57
+ const a = M(C(t));
58
+ a !== i && (i = a, G(($) => $ + 1));
59
+ }, m = () => {
60
+ l || (f = we(() => {
61
+ y(), m();
62
+ }));
63
+ };
64
+ m(), J(() => {
65
+ l = !0, f !== null && be(f);
66
+ });
67
+ }), te({
68
+ open: h,
69
+ root: () => p,
70
+ containsTarget: (t) => r() && V(t),
24
71
  onClose: () => e.onOpenChange(!1),
25
- lockBodyScroll: () => !t(),
72
+ lockBodyScroll: () => !r(),
26
73
  trapFocus: !0,
27
- closeOnEscape: () => t() ? "inside" : !0,
74
+ closeOnEscape: () => r() ? "inside" : !0,
28
75
  blockHotkeys: !0,
29
76
  // Block scroll bleed outside the dialog while keeping the dialog content scrollable.
30
- blockWheel: () => t() ? "none" : "outside",
31
- blockTouchMove: () => t() ? "none" : "outside",
77
+ blockWheel: () => r() ? "none" : "outside",
78
+ blockTouchMove: () => r() ? "none" : "outside",
32
79
  restoreFocus: !0
33
- }), n(s, {
80
+ }), [(() => {
81
+ var t = ae();
82
+ return D(z, t), s(t, "data-floe-dialog-owner-anchor", o), K(t, ge), t;
83
+ })(), n(g, {
34
84
  get when() {
35
- return e.open;
85
+ return h();
36
86
  },
37
87
  get children() {
38
- return n(D, {
88
+ return n(W, {
39
89
  get mount() {
40
- return A();
90
+ return L();
41
91
  },
42
92
  get children() {
43
- var r = J(), v = r.firstChild, I = v.nextSibling, i = I.firstChild, p = i.firstChild;
44
- u(r, "data-floe-dialog-overlay-root", o), x(r, $({
93
+ var t = fe(), l = t.firstChild, f = l.nextSibling, i = f.firstChild, y = i.firstChild;
94
+ s(t, "data-floe-dialog-overlay-root", o), A(t, O({
45
95
  get "data-floe-dialog-mode"() {
46
- return t() ? "surface" : "global";
96
+ return r() ? "surface" : "global";
47
97
  }
48
98
  }, () => ({
49
- [W]: t() ? "true" : void 0
99
+ [le]: r() ? "true" : void 0
50
100
  }), {
51
101
  get class() {
52
- return _(t() ? "absolute z-20 box-border p-3" : "fixed inset-0 box-border z-50 p-4");
102
+ return S(r() ? "absolute z-20 box-border p-3" : "fixed inset-0 box-border z-50 p-4");
53
103
  },
54
104
  get style() {
55
- return C(() => !!t())() ? {
56
- left: `${m().left}px`,
57
- top: `${m().top}px`,
58
- width: `${m().width}px`,
59
- height: `${m().height}px`
105
+ return R(() => !!r())() ? {
106
+ left: `${v().left}px`,
107
+ top: `${v().top}px`,
108
+ width: `${v().width}px`,
109
+ height: `${v().height}px`
60
110
  } : void 0;
61
111
  }
62
- }), !1, !0), u(v, "data-floe-dialog-backdrop", o), x(v, $(() => ({
63
- [h]: g()
112
+ }), !1, !0), s(l, "data-floe-dialog-backdrop", o), A(l, O(() => ({
113
+ [x]: b()
64
114
  }), {
65
115
  get class() {
66
- return _("absolute inset-0 cursor-pointer animate-in fade-in", t() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
116
+ return S("absolute inset-0 cursor-pointer animate-in fade-in", r() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
67
117
  },
68
118
  onClick: () => e.onOpenChange(!1)
69
119
  }), !1, !1);
70
- var O = b;
71
- return typeof O == "function" ? E(O, i) : b = i, u(i, "data-floe-dialog-panel", o), x(i, $(() => ({
72
- [h]: g()
120
+ var m = p;
121
+ return typeof m == "function" ? D(m, i) : p = i, s(i, "data-floe-dialog-panel", o), A(i, O(() => ({
122
+ [x]: b()
73
123
  }), {
74
124
  get class() {
75
- return _(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);
125
+ return S(r() ? "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);
76
126
  },
77
127
  role: "dialog",
78
128
  get "aria-modal"() {
79
- return t() ? void 0 : "true";
129
+ return r() ? void 0 : "true";
80
130
  },
81
131
  get "aria-labelledby"() {
82
- return C(() => !!e.title)() ? w() : void 0;
132
+ return R(() => !!e.title)() ? T() : void 0;
83
133
  },
84
134
  get "aria-describedby"() {
85
- return C(() => !!e.description)() ? k() : void 0;
135
+ return R(() => !!e.description)() ? B() : void 0;
86
136
  },
87
137
  tabIndex: -1
88
- }), !1, !0), l(i, n(s, {
138
+ }), !1, !0), d(i, n(g, {
89
139
  get when() {
90
140
  return e.title || e.description;
91
141
  },
92
142
  get children() {
93
- var d = X(), R = d.firstChild;
94
- return l(R, n(s, {
143
+ var a = ue(), $ = a.firstChild;
144
+ return d($, n(g, {
95
145
  get when() {
96
146
  return e.title;
97
147
  },
98
148
  get children() {
99
- var a = q();
100
- return l(a, () => e.title), S(() => u(a, "id", w())), a;
149
+ var c = de();
150
+ return d(c, () => e.title), E(() => s(c, "id", T())), c;
101
151
  }
102
- }), null), l(R, n(s, {
152
+ }), null), d($, n(g, {
103
153
  get when() {
104
154
  return e.description;
105
155
  },
106
156
  get children() {
107
- var a = G();
108
- return l(a, () => e.description), S(() => u(a, "id", k())), a;
157
+ var c = ce();
158
+ return d(c, () => e.description), E(() => s(c, "id", B())), c;
109
159
  }
110
- }), null), l(d, n(y, {
160
+ }), null), d(a, n(P, {
111
161
  variant: "ghost-destructive",
112
162
  size: "icon",
113
163
  class: "h-6 w-6 -mr-1",
114
164
  onClick: () => e.onOpenChange(!1),
115
165
  "aria-label": "Close",
116
166
  get children() {
117
- return n(P, {
167
+ return n(Z, {
118
168
  class: "w-3.5 h-3.5"
119
169
  });
120
170
  }
121
- }), null), d;
171
+ }), null), a;
122
172
  }
123
- }), p), l(p, () => e.children), l(i, n(s, {
173
+ }), y), d(y, () => e.children), d(i, n(g, {
124
174
  get when() {
125
175
  return e.footer;
126
176
  },
127
177
  get children() {
128
- var d = Y();
129
- return l(d, () => e.footer), d;
178
+ var a = se();
179
+ return d(a, () => e.footer), a;
130
180
  }
131
- }), null), r;
181
+ }), null), t;
132
182
  }
133
183
  });
134
184
  }
135
- });
185
+ })];
136
186
  }
137
- function ae(e) {
138
- const o = j();
139
- return n(Q, {
187
+ function ke(e) {
188
+ const o = ee();
189
+ return n(ve, {
140
190
  get open() {
141
191
  return e.open;
142
192
  },
@@ -150,7 +200,7 @@ function ae(e) {
150
200
  return e.description;
151
201
  },
152
202
  get footer() {
153
- return [n(y, {
203
+ return [n(P, {
154
204
  variant: "ghost",
155
205
  onClick: () => e.onOpenChange(!1),
156
206
  get disabled() {
@@ -159,7 +209,7 @@ function ae(e) {
159
209
  get children() {
160
210
  return e.cancelText ?? o.config.strings.confirmDialog.cancel;
161
211
  }
162
- }), n(y, {
212
+ }), n(P, {
163
213
  get variant() {
164
214
  return e.variant === "destructive" ? "destructive" : "primary";
165
215
  },
@@ -175,11 +225,11 @@ function ae(e) {
175
225
  })];
176
226
  },
177
227
  get children() {
178
- return e.children ?? K();
228
+ return e.children ?? me();
179
229
  }
180
230
  });
181
231
  }
182
232
  export {
183
- ae as ConfirmDialog,
184
- Q as Dialog
233
+ ke as ConfirmDialog,
234
+ ve as Dialog
185
235
  };
@@ -19,10 +19,13 @@ export type ResolvedDialogSurfaceHost = Readonly<{
19
19
  export type ResolvedSurfacePortalHost = ResolvedDialogSurfaceHost;
20
20
  export type SurfacePortalBoundaryRect = SurfacePortalRect;
21
21
  export type { SurfacePortalRect };
22
+ export type SurfacePortalHostResolutionOptions = Readonly<{
23
+ owner?: Element | null;
24
+ }>;
22
25
  export declare function ensureDialogSurfaceInteractionTracking(): void;
23
26
  export declare function ensureSurfacePortalInteractionTracking(): void;
24
- export declare function resolveDialogSurfaceHost(): ResolvedDialogSurfaceHost;
25
- export declare function resolveSurfacePortalHost(): ResolvedSurfacePortalHost;
27
+ export declare function resolveDialogSurfaceHost(options?: SurfacePortalHostResolutionOptions): ResolvedDialogSurfaceHost;
28
+ export declare function resolveSurfacePortalHost(options?: SurfacePortalHostResolutionOptions): ResolvedSurfacePortalHost;
26
29
  export declare function isSurfacePortalMode(surfaceHost: ResolvedSurfacePortalHost): boolean;
27
30
  export declare function resolveSurfacePortalMount(surfaceHost: ResolvedSurfacePortalHost): HTMLElement | undefined;
28
31
  export declare function resolveSurfacePortalBoundaryRect(surfaceHost: ResolvedSurfacePortalHost): SurfacePortalBoundaryRect;
@@ -3,52 +3,52 @@ let r = null, o = null;
3
3
  function E(t) {
4
4
  return typeof Element < "u" && t instanceof Element ? t : typeof Node < "u" && t instanceof Node ? t.parentElement : null;
5
5
  }
6
- function T(t) {
6
+ function w(t) {
7
7
  const e = t?.activeElement;
8
8
  return e instanceof Element ? e : null;
9
9
  }
10
- function i(t) {
10
+ function l(t) {
11
11
  const e = typeof document < "u" ? document : null;
12
12
  r = {
13
13
  target: E(t),
14
- activeElement: T(e),
14
+ activeElement: w(e),
15
15
  recordedAt: Date.now()
16
16
  };
17
17
  }
18
- function l(t) {
19
- i(t.target);
20
- }
21
18
  function c(t) {
22
- i(t.target);
19
+ l(t.target);
20
+ }
21
+ function f(t) {
22
+ l(t.target);
23
23
  }
24
24
  function d(t) {
25
- i(t.target);
25
+ l(t.target);
26
26
  }
27
27
  function s() {
28
- w();
28
+ T();
29
29
  }
30
- function w() {
31
- typeof document > "u" || o !== document && (o && (o.removeEventListener("pointerdown", l, !0), o.removeEventListener("focusin", c, !0), o.removeEventListener("contextmenu", d, !0)), document.addEventListener("pointerdown", l, !0), document.addEventListener("focusin", c, !0), document.addEventListener("contextmenu", d, !0), o = document);
30
+ function T() {
31
+ typeof document > "u" || o !== document && (o && (o.removeEventListener("pointerdown", c, !0), o.removeEventListener("focusin", f, !0), o.removeEventListener("contextmenu", d, !0)), document.addEventListener("pointerdown", c, !0), document.addEventListener("focusin", f, !0), document.addEventListener("contextmenu", d, !0), o = document);
32
32
  }
33
33
  function R() {
34
34
  return !r || Date.now() - r.recordedAt > g ? null : r;
35
35
  }
36
- function f(t) {
36
+ function i(t) {
37
37
  const e = t?.closest(`[${a}="true"]`);
38
- return typeof HTMLElement > "u" ? null : e instanceof HTMLElement && e.isConnected ? e : null;
38
+ return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
39
39
  }
40
40
  function S(t) {
41
41
  if (!t) return null;
42
42
  const e = t.closest(`[${p}="true"]`);
43
- return typeof HTMLElement > "u" ? null : e instanceof HTMLElement && e.isConnected ? e : null;
43
+ return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
44
44
  }
45
- function L() {
45
+ function L(t = {}) {
46
46
  s();
47
- const t = R(), e = f(t?.target ?? null) ?? f(t?.activeElement ?? null);
48
- return e ? {
49
- host: e,
50
- boundaryHost: e,
51
- mountHost: S(e) ?? e,
47
+ const e = R(), n = i(t.owner ?? null) ?? i(e?.target ?? null) ?? i(e?.activeElement ?? null);
48
+ return n ? {
49
+ host: n,
50
+ boundaryHost: n,
51
+ mountHost: S(n) ?? n,
52
52
  mode: "surface"
53
53
  } : { host: null, boundaryHost: null, mountHost: null, mode: "global" };
54
54
  }
@@ -112,7 +112,7 @@ function b(t, e) {
112
112
  y: t.y - n.top
113
113
  };
114
114
  }
115
- function C(t, e) {
115
+ function P(t, e) {
116
116
  if (!u(e))
117
117
  return t;
118
118
  const n = h(e);
@@ -125,7 +125,7 @@ function C(t, e) {
125
125
  height: t.height
126
126
  };
127
127
  }
128
- function P() {
128
+ function C() {
129
129
  r = null;
130
130
  }
131
131
  typeof document < "u" && s();
@@ -134,12 +134,12 @@ export {
134
134
  a as DIALOG_SURFACE_HOST_ATTR,
135
135
  y as SURFACE_PORTAL_HOST_ATTR,
136
136
  p as SURFACE_PORTAL_LAYER_ATTR,
137
- P as __resetSurfacePortalScopeForTests,
137
+ C as __resetSurfacePortalScopeForTests,
138
138
  s as ensureDialogSurfaceInteractionTracking,
139
- w as ensureSurfacePortalInteractionTracking,
139
+ T as ensureSurfacePortalInteractionTracking,
140
140
  u as isSurfacePortalMode,
141
141
  b as projectSurfacePortalPosition,
142
- C as projectSurfacePortalRect,
142
+ P as projectSurfacePortalRect,
143
143
  _ as resolveSurfacePortalBoundaryRect,
144
144
  L as resolveSurfacePortalHost,
145
145
  v as resolveSurfacePortalMount,
@@ -1 +1 @@
1
- export { DIALOG_SURFACE_HOST_ATTR, SURFACE_PORTAL_HOST_ATTR, SURFACE_PORTAL_LAYER_ATTR, DIALOG_SURFACE_BOUNDARY_ATTR, ensureSurfacePortalInteractionTracking, resolveSurfacePortalHost, isSurfacePortalMode, resolveSurfacePortalMount, resolveSurfacePortalBoundaryRect, resolveSurfacePortalMountRect, projectSurfacePortalPosition, projectSurfacePortalRect, __resetSurfacePortalScopeForTests, type SurfacePortalInteractionSnapshot, type SurfacePortalMode, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalRect, } from './dialogSurfaceScope';
1
+ export { DIALOG_SURFACE_HOST_ATTR, SURFACE_PORTAL_HOST_ATTR, SURFACE_PORTAL_LAYER_ATTR, DIALOG_SURFACE_BOUNDARY_ATTR, ensureSurfacePortalInteractionTracking, resolveSurfacePortalHost, isSurfacePortalMode, resolveSurfacePortalMount, resolveSurfacePortalBoundaryRect, resolveSurfacePortalMountRect, projectSurfacePortalPosition, projectSurfacePortalRect, __resetSurfacePortalScopeForTests, type SurfacePortalInteractionSnapshot, type SurfacePortalHostResolutionOptions, type SurfacePortalMode, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalRect, } from './dialogSurfaceScope';
@@ -1,4 +1,12 @@
1
- import type { WorkbenchState, WorkbenchInteractionAdapter, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
1
+ import { type WorkbenchContextMenuItem } from './WorkbenchContextMenu';
2
+ import type { WorkbenchState, WorkbenchContextMenuState, WorkbenchInteractionAdapter, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
3
+ export type WorkbenchContextMenuItemsResolver = (context: Readonly<{
4
+ menu: WorkbenchContextMenuState;
5
+ items: readonly WorkbenchContextMenuItem[];
6
+ widgets: readonly WorkbenchWidgetItem[];
7
+ widget: WorkbenchWidgetItem | null;
8
+ closeMenu: () => void;
9
+ }>) => readonly WorkbenchContextMenuItem[];
2
10
  export interface WorkbenchSurfaceApi {
3
11
  ensureWidget: (type: WorkbenchWidgetType, options?: {
4
12
  centerViewport?: boolean;
@@ -41,6 +49,7 @@ export interface WorkbenchSurfaceProps {
41
49
  widgetDefinitions?: readonly WorkbenchWidgetDefinition[];
42
50
  launcherWidgetTypes?: readonly WorkbenchWidgetType[];
43
51
  interactionAdapter?: WorkbenchInteractionAdapter;
52
+ resolveContextMenuItems?: WorkbenchContextMenuItemsResolver;
44
53
  onApiReady?: (api: WorkbenchSurfaceApi | null) => void;
45
54
  onRequestDelete?: (widgetId: string) => void;
46
55
  onLayoutInteractionStart?: () => void;
@@ -1,17 +1,18 @@
1
- import { use as T, spread as _, mergeProps as B, insert as f, createComponent as u, Portal as q, addEventListener as z, template as A, delegateEvents as $ } from "solid-js/web";
2
- import { createSignal as S, createMemo as w, untrack as h, createEffect as m, onCleanup as v, Show as V } from "solid-js";
3
- import { clientToCanvasWorld as N } from "../ui/canvasGeometry.js";
4
- import { WorkbenchCanvas as P } from "./WorkbenchCanvas.js";
5
- import { WorkbenchContextMenu as H } from "./WorkbenchContextMenu.js";
6
- import { WorkbenchFilterBar as X } from "./WorkbenchFilterBar.js";
7
- import { WorkbenchHud as Y } from "./WorkbenchHud.js";
8
- import { WorkbenchLockButton as K } from "./WorkbenchLockButton.js";
9
- import { installWorkbenchContextMenuDismissListeners as U } from "./workbenchContextMenuDismiss.js";
10
- import { useWorkbenchModel as Z } from "./useWorkbenchModel.js";
11
- import { resolveWorkbenchInteractionAdapter as G } from "./workbenchInteractionAdapter.js";
12
- var j = /* @__PURE__ */ A("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), J = /* @__PURE__ */ A("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
13
- const Q = "F1";
14
- function I(i) {
1
+ import { use as _, spread as B, mergeProps as q, insert as m, createComponent as u, Portal as N, addEventListener as z, template as A, delegateEvents as H } from "solid-js/web";
2
+ import { createSignal as M, createMemo as w, untrack as W, createEffect as v, onCleanup as h, Show as P } from "solid-js";
3
+ import { clientToCanvasWorld as X } from "../ui/canvasGeometry.js";
4
+ import { WorkbenchCanvas as $ } from "./WorkbenchCanvas.js";
5
+ import { WorkbenchContextMenu as V } from "./WorkbenchContextMenu.js";
6
+ import { WorkbenchFilterBar as Y } from "./WorkbenchFilterBar.js";
7
+ import { WorkbenchHud as K } from "./WorkbenchHud.js";
8
+ import { WorkbenchLockButton as U } from "./WorkbenchLockButton.js";
9
+ import { installWorkbenchContextMenuDismissListeners as Z } from "./workbenchContextMenuDismiss.js";
10
+ import { createContextMenuPosition as G, WORKBENCH_CONTEXT_MENU_WIDTH_PX as j, estimateContextMenuHeight as J } from "./workbenchHelpers.js";
11
+ import { useWorkbenchModel as Q } from "./useWorkbenchModel.js";
12
+ import { resolveWorkbenchInteractionAdapter as ee } from "./workbenchInteractionAdapter.js";
13
+ var te = /* @__PURE__ */ A("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), ne = /* @__PURE__ */ A("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
14
+ const re = "F1";
15
+ function x(i) {
15
16
  if (i)
16
17
  try {
17
18
  i.focus({
@@ -21,186 +22,205 @@ function I(i) {
21
22
  i.focus();
22
23
  }
23
24
  }
24
- function ge(i) {
25
- const t = Z({
25
+ function he(i) {
26
+ const t = Q({
26
27
  state: () => i.state(),
27
28
  setState: (e) => i.setState(e),
28
29
  widgetDefinitions: () => i.widgetDefinitions,
29
30
  onClose: () => {
30
31
  }
31
- }), [s, x] = S(null), a = w(() => G(i.interactionAdapter)), [p, l] = S(h(() => a().createInitialInputOwner())), W = w(() => {
32
+ }), [d, E] = M(null), s = w(() => ee(i.interactionAdapter)), [p, l] = M(W(() => s().createInitialInputOwner())), k = w(() => {
32
33
  const e = i.launcherWidgetTypes;
33
34
  return !e || e.length <= 0 ? null : new Set(e);
34
35
  }), D = w(() => {
35
- const e = t.widgetDefinitions(), r = W();
36
- return r ? e.filter((n) => r.has(n.type)) : e;
37
- }), E = w(() => {
38
- const e = t.contextMenu.items(), r = W();
39
- return r ? e.filter((n) => {
40
- if (n.kind !== "action")
36
+ const e = t.widgetDefinitions(), n = k();
37
+ return n ? e.filter((r) => n.has(r.type)) : e;
38
+ }), C = w(() => {
39
+ const e = t.contextMenu.state(), n = t.contextMenu.items(), r = k(), o = r ? n.filter((c) => {
40
+ if (c.kind !== "action")
41
41
  return !0;
42
- const o = /^add-(.+)$/.exec(String(n.id ?? ""));
43
- return o ? r.has(o[1]) : !0;
44
- }) : e;
45
- }), k = (e, r, n) => {
46
- const o = a(), c = o.findWidgetRoot(e), d = o.readWidgetId(c);
47
- if (d) {
48
- l(o.createWidgetInputOwner(d, r));
42
+ const f = /^add-(.+)$/.exec(String(c.id ?? ""));
43
+ return f ? r.has(f[1]) : !0;
44
+ }) : n;
45
+ if (!e || !i.resolveContextMenuItems)
46
+ return o;
47
+ const a = e.widgetId ? t.queries.findWidgetById(e.widgetId) : null;
48
+ return i.resolveContextMenuItems({
49
+ menu: e,
50
+ items: o,
51
+ widgets: t.widgets(),
52
+ widget: a,
53
+ closeMenu: t.contextMenu.close
54
+ });
55
+ }), b = w(() => {
56
+ const e = t.contextMenu.state();
57
+ if (!e) return;
58
+ const n = C(), r = n.filter((a) => a.kind === "action").length, o = n.filter((a) => a.kind === "separator").length;
59
+ return G({
60
+ clientX: e.clientX,
61
+ clientY: e.clientY,
62
+ menuWidth: j,
63
+ menuHeight: J(r, o)
64
+ });
65
+ }), I = (e, n, r) => {
66
+ const o = s(), a = o.findWidgetRoot(e), c = o.readWidgetId(a);
67
+ if (c) {
68
+ l(o.createWidgetInputOwner(c, n));
49
69
  return;
50
70
  }
51
- const y = s();
52
- y && e instanceof Node && y.contains(e) && l(o.createCanvasInputOwner(n));
53
- }, b = (e = "selection_cleared") => {
54
- const r = a(), n = s();
55
- t.selection.clear(), l(r.createCanvasInputOwner(e)), queueMicrotask(() => {
56
- if (!n || typeof document > "u") return;
71
+ const f = d();
72
+ f && e instanceof Node && f.contains(e) && l(o.createCanvasInputOwner(r));
73
+ }, y = (e = "selection_cleared") => {
74
+ const n = s(), r = d();
75
+ t.selection.clear(), l(n.createCanvasInputOwner(e)), queueMicrotask(() => {
76
+ if (!r || typeof document > "u") return;
57
77
  const o = document.activeElement;
58
- if (!(o instanceof HTMLElement) || !n.contains(o)) {
59
- I(n);
78
+ if (!(o instanceof HTMLElement) || !r.contains(o)) {
79
+ x(r);
60
80
  return;
61
81
  }
62
- const c = r.findWidgetRoot(o);
63
- I(n), c && document.activeElement === o && o.isConnected && o.blur();
82
+ const a = n.findWidgetRoot(o);
83
+ x(r), a && document.activeElement === o && o.isConnected && o.blur();
64
84
  });
65
85
  }, R = () => {
66
- const e = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), r = t.viewport(), n = e?.getBoundingClientRect(), o = n?.width ?? 0, c = n?.height ?? 0;
86
+ const e = d()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = t.viewport(), r = e?.getBoundingClientRect(), o = r?.width ?? 0, a = r?.height ?? 0;
67
87
  return {
68
- worldX: o > 0 ? (o / 2 - r.x) / r.scale : 240,
69
- worldY: c > 0 ? (c / 2 - r.y) / r.scale : 180
88
+ worldX: o > 0 ? (o / 2 - n.x) / n.scale : 240,
89
+ worldY: a > 0 ? (a / 2 - n.y) / n.scale : 180
70
90
  };
71
91
  }, g = (e) => {
72
- const r = h(a), n = h(s);
92
+ const n = W(s), r = W(d);
73
93
  queueMicrotask(() => {
74
- r.focusWidgetElement(n, e), l(r.createWidgetInputOwner(e, "activation"));
94
+ n.focusWidgetElement(r, e), l(n.createWidgetInputOwner(e, "activation"));
75
95
  });
76
- }, M = (e) => {
77
- const r = t.navigation.fitWidget(e);
78
- g(r.id);
79
- }, L = (e) => {
80
- const r = t.navigation.overviewWidget(e);
81
- g(r.id);
96
+ }, O = (e) => {
97
+ const n = t.navigation.fitWidget(e);
98
+ g(n.id);
99
+ }, T = (e) => {
100
+ const n = t.navigation.overviewWidget(e);
101
+ g(n.id);
82
102
  };
83
- m(() => {
103
+ v(() => {
84
104
  i.onApiReady?.({
85
- ensureWidget: (e, r) => t.widgetActions.ensureWidget(e, r) ?? null,
86
- createWidget: (e, r) => {
87
- const n = R(), o = t.widgetActions.addWidgetAtCursor(e, r?.worldX ?? n.worldX, r?.worldY ?? n.worldY) ?? null;
88
- return o && r?.centerViewport !== !1 && t.navigation.centerOnWidget(o), o;
89
- },
90
- clearSelection: () => b("selection_cleared"),
91
- focusWidget: (e, r) => {
92
- const n = t.navigation.focusWidget(e, r);
93
- return g(n.id), n;
105
+ ensureWidget: (e, n) => t.widgetActions.ensureWidget(e, n) ?? null,
106
+ createWidget: (e, n) => {
107
+ const r = R(), o = t.widgetActions.addWidgetAtCursor(e, n?.worldX ?? r.worldX, n?.worldY ?? r.worldY) ?? null;
108
+ return o && n?.centerViewport !== !1 && t.navigation.centerOnWidget(o), o;
109
+ },
110
+ clearSelection: () => y("selection_cleared"),
111
+ focusWidget: (e, n) => {
112
+ const r = t.navigation.focusWidget(e, n);
113
+ return g(r.id), r;
94
114
  },
95
115
  fitWidget: (e) => {
96
- const r = t.navigation.fitWidget(e);
97
- return g(r.id), r;
116
+ const n = t.navigation.fitWidget(e);
117
+ return g(n.id), n;
98
118
  },
99
119
  overviewWidget: (e) => {
100
- const r = t.navigation.overviewWidget(e);
101
- return g(r.id), r;
120
+ const n = t.navigation.overviewWidget(e);
121
+ return g(n.id), n;
102
122
  },
103
123
  findWidgetByType: (e) => t.queries.findWidgetByType(e),
104
124
  findWidgetById: (e) => t.queries.findWidgetById(e),
105
- updateWidgetTitle: (e, r) => {
106
- const n = String(e ?? "").trim(), o = String(r ?? "").trim();
107
- !n || !o || i.setState((c) => ({
108
- ...c,
109
- widgets: c.widgets.map((d) => d.id === n && d.title !== o ? {
110
- ...d,
125
+ updateWidgetTitle: (e, n) => {
126
+ const r = String(e ?? "").trim(), o = String(n ?? "").trim();
127
+ !r || !o || i.setState((a) => ({
128
+ ...a,
129
+ widgets: a.widgets.map((c) => c.id === r && c.title !== o ? {
130
+ ...c,
111
131
  title: o
112
- } : d)
132
+ } : c)
113
133
  }));
114
134
  }
115
- }), v(() => {
135
+ }), h(() => {
116
136
  i.onApiReady?.(null);
117
137
  });
118
138
  });
119
- const C = () => i.lockShortcut === void 0 ? Q : i.lockShortcut;
120
- m(() => {
139
+ const S = () => i.lockShortcut === void 0 ? re : i.lockShortcut;
140
+ v(() => {
121
141
  if (typeof window > "u" || !t.contextMenu.state()) return;
122
- const e = U({
142
+ const e = Z({
123
143
  ownerWindow: window,
124
144
  onDismiss: t.contextMenu.close
125
145
  });
126
- v(() => e());
127
- }), m(() => {
146
+ h(() => e());
147
+ }), v(() => {
128
148
  const e = p();
129
149
  if (e.kind !== "widget") return;
130
- t.widgets().some((n) => n.id === e.widgetId) || l(a().createCanvasInputOwner("widget_removed"));
131
- }), m(() => {
132
- const e = s();
150
+ t.widgets().some((r) => r.id === e.widgetId) || l(s().createCanvasInputOwner("widget_removed"));
151
+ }), v(() => {
152
+ const e = d();
133
153
  if (!e) return;
134
- const r = (o) => {
135
- k(o.target, "pointer", "background_pointer");
136
- }, n = (o) => {
137
- k(o.target, "focus", "background_focus");
154
+ const n = (o) => {
155
+ I(o.target, "pointer", "background_pointer");
156
+ }, r = (o) => {
157
+ I(o.target, "focus", "background_focus");
138
158
  };
139
- e.addEventListener("pointerdown", r, !0), e.addEventListener("focusin", n), v(() => {
140
- e.removeEventListener("pointerdown", r, !0), e.removeEventListener("focusin", n);
159
+ e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", r), h(() => {
160
+ e.removeEventListener("pointerdown", n, !0), e.removeEventListener("focusin", r);
141
161
  });
142
- }), m(() => {
162
+ }), v(() => {
143
163
  if (i.enableKeyboard === !1 || typeof document > "u") return;
144
- const e = C(), r = (n) => {
145
- if (!(n.defaultPrevented || n.isComposing)) {
146
- if (e !== null && n.key === e) {
147
- n.preventDefault(), t.lock.toggle();
164
+ const e = S(), n = (r) => {
165
+ if (!(r.defaultPrevented || r.isComposing)) {
166
+ if (e !== null && r.key === e) {
167
+ r.preventDefault(), t.lock.toggle();
148
168
  return;
149
169
  }
150
- if (!a().shouldBypassGlobalHotkeys({
151
- root: s(),
152
- target: n.target,
170
+ if (!s().shouldBypassGlobalHotkeys({
171
+ root: d(),
172
+ target: r.target,
153
173
  owner: p(),
154
- interactiveSelector: a().interactiveSelector
174
+ interactiveSelector: s().interactiveSelector
155
175
  }))
156
- switch (n.key) {
176
+ switch (r.key) {
157
177
  case "ArrowUp":
158
- n.preventDefault(), t.navigation.handleArrowNavigation("up");
178
+ r.preventDefault(), t.navigation.handleArrowNavigation("up");
159
179
  break;
160
180
  case "ArrowDown":
161
- n.preventDefault(), t.navigation.handleArrowNavigation("down");
181
+ r.preventDefault(), t.navigation.handleArrowNavigation("down");
162
182
  break;
163
183
  case "ArrowLeft":
164
- n.preventDefault(), t.navigation.handleArrowNavigation("left");
184
+ r.preventDefault(), t.navigation.handleArrowNavigation("left");
165
185
  break;
166
186
  case "ArrowRight":
167
- n.preventDefault(), t.navigation.handleArrowNavigation("right");
187
+ r.preventDefault(), t.navigation.handleArrowNavigation("right");
168
188
  break;
169
189
  case "Delete":
170
190
  case "Backspace":
171
- t.selectedWidgetId() && (n.preventDefault(), t.widgetActions.deleteSelected());
191
+ t.selectedWidgetId() && (r.preventDefault(), t.widgetActions.deleteSelected());
172
192
  break;
173
193
  }
174
194
  }
175
195
  };
176
- document.addEventListener("keydown", r, !0), v(() => document.removeEventListener("keydown", r, !0));
196
+ document.addEventListener("keydown", n, !0), h(() => document.removeEventListener("keydown", n, !0));
177
197
  });
178
- const F = (e, r) => {
179
- const n = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
180
- if (!n) return null;
181
- const o = n.getBoundingClientRect();
182
- return N(o, t.viewport(), {
198
+ const L = (e, n) => {
199
+ const r = d()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
200
+ if (!r) return null;
201
+ const o = r.getBoundingClientRect();
202
+ return X(o, t.viewport(), {
183
203
  clientX: e,
184
- clientY: r
204
+ clientY: n
185
205
  });
186
- }, O = (e, r, n) => {
187
- const o = F(r, n);
206
+ }, F = (e, n, r) => {
207
+ const o = L(n, r);
188
208
  o && t.widgetActions.addWidgetAtCursor(e, o.worldX, o.worldY);
189
209
  };
190
210
  return (() => {
191
- var e = J(), r = e.firstChild;
192
- return T(x, e), _(e, B({
211
+ var e = ne(), n = e.firstChild;
212
+ return _(E, e), B(e, q({
193
213
  get class() {
194
214
  return `workbench-surface${i.class ? ` ${i.class}` : ""}`;
195
215
  }
196
216
  }, () => ({
197
- [a().surfaceRootAttr]: "true"
217
+ [s().surfaceRootAttr]: "true"
198
218
  }), {
199
219
  get "data-workbench-theme"() {
200
220
  return t.theme();
201
221
  },
202
222
  tabIndex: -1
203
- }), !1, !0), f(r, u(P, {
223
+ }), !1, !0), m(n, u($, {
204
224
  get widgetDefinitions() {
205
225
  return t.widgetDefinitions();
206
226
  },
@@ -226,7 +246,7 @@ function ge(i) {
226
246
  return t.filters();
227
247
  },
228
248
  get interactionAdapter() {
229
- return a();
249
+ return s();
230
250
  },
231
251
  get setCanvasFrameRef() {
232
252
  return t.setCanvasFrameRef;
@@ -240,7 +260,7 @@ function ge(i) {
240
260
  get onCanvasContextMenu() {
241
261
  return t.canvas.openCanvasContextMenu;
242
262
  },
243
- onCanvasPointerDown: () => b("background_pointer"),
263
+ onCanvasPointerDown: () => y("background_pointer"),
244
264
  get onSelectWidget() {
245
265
  return t.canvas.selectWidget;
246
266
  },
@@ -259,8 +279,8 @@ function ge(i) {
259
279
  get onCommitResize() {
260
280
  return t.canvas.commitResize;
261
281
  },
262
- onRequestOverview: L,
263
- onRequestFit: M,
282
+ onRequestOverview: T,
283
+ onRequestFit: O,
264
284
  get onRequestDelete() {
265
285
  return i.onRequestDelete ?? t.widgetActions.deleteWidget;
266
286
  },
@@ -270,7 +290,7 @@ function ge(i) {
270
290
  get onLayoutInteractionEnd() {
271
291
  return i.onLayoutInteractionEnd;
272
292
  }
273
- })), f(e, u(K, {
293
+ })), m(e, u(U, {
274
294
  get locked() {
275
295
  return t.locked();
276
296
  },
@@ -278,9 +298,9 @@ function ge(i) {
278
298
  return t.lock.toggle;
279
299
  },
280
300
  get shortcutLabel() {
281
- return C() ?? void 0;
301
+ return S() ?? void 0;
282
302
  }
283
- }), null), f(e, u(X, {
303
+ }), null), m(e, u(Y, {
284
304
  get widgetDefinitions() {
285
305
  return D();
286
306
  },
@@ -296,8 +316,8 @@ function ge(i) {
296
316
  get onShowAll() {
297
317
  return t.filter.showAll;
298
318
  },
299
- onCreateAt: O
300
- }), null), f(e, u(Y, {
319
+ onCreateAt: F
320
+ }), null), m(e, u(K, {
301
321
  get scaleLabel() {
302
322
  return t.scaleLabel();
303
323
  },
@@ -310,26 +330,26 @@ function ge(i) {
310
330
  get activeTheme() {
311
331
  return t.theme();
312
332
  },
313
- onSelectTheme: (n) => t.appearance.setTheme(n)
314
- }), null), f(e, u(V, {
333
+ onSelectTheme: (r) => t.appearance.setTheme(r)
334
+ }), null), m(e, u(P, {
315
335
  get when() {
316
336
  return t.contextMenu.state();
317
337
  },
318
338
  get children() {
319
- return u(q, {
339
+ return u(N, {
320
340
  get children() {
321
341
  return [(() => {
322
- var n = j();
323
- return z(n, "contextmenu", t.contextMenu.retarget, !0), n;
324
- })(), u(H, {
342
+ var r = te();
343
+ return z(r, "contextmenu", t.contextMenu.retarget, !0), r;
344
+ })(), u(V, {
325
345
  get x() {
326
- return t.contextMenu.position()?.left ?? 0;
346
+ return b()?.left ?? 0;
327
347
  },
328
348
  get y() {
329
- return t.contextMenu.position()?.top ?? 0;
349
+ return b()?.top ?? 0;
330
350
  },
331
351
  get items() {
332
- return E();
352
+ return C();
333
353
  }
334
354
  })];
335
355
  }
@@ -338,7 +358,7 @@ function ge(i) {
338
358
  }), null), e;
339
359
  })();
340
360
  }
341
- $(["contextmenu"]);
361
+ H(["contextmenu"]);
342
362
  export {
343
- ge as WorkbenchSurface
363
+ he as WorkbenchSurface
344
364
  };
@@ -1,5 +1,5 @@
1
1
  export { WorkbenchOverlay, type WorkbenchOverlayProps, } from './WorkbenchOverlay';
2
- export { WorkbenchSurface, type WorkbenchSurfaceApi, type WorkbenchSurfaceProps, } from './WorkbenchSurface';
2
+ export { WorkbenchSurface, type WorkbenchSurfaceApi, type WorkbenchContextMenuItemsResolver, type WorkbenchSurfaceProps, } from './WorkbenchSurface';
3
3
  export { WorkbenchContextMenu, type WorkbenchContextMenuItem, type WorkbenchContextMenuProps, } from './WorkbenchContextMenu';
4
4
  export { useWorkbenchModel, type UseWorkbenchModelOptions } from './useWorkbenchModel';
5
5
  export { WIDGET_REGISTRY, createWorkbenchFilterState, getWidgetEntry, isValidWorkbenchWidgetType, resolveWorkbenchWidgetDefinitions, type WidgetRegistryEntry, } from './widgets/widgetRegistry';
@@ -1,6 +1,6 @@
1
1
  import { createSignal as A, createMemo as r, onCleanup as Ct } from "solid-js";
2
2
  import { ArrowUp as bt, Copy as kt, Trash as Ft } from "../icons/index.js";
3
- import { getTopZIndex as It, createContextMenuPosition as Mt, createWorkbenchId as vt, createWorkbenchViewportCenteredOnWidget as K, findNearestWidget as Xt, clampScale as Yt, WORKBENCH_CANVAS_ZOOM_STEP as L, WORKBENCH_MIN_SCALE as yt, createWorkbenchViewportFitForWidget as Ot, WORKBENCH_CONTEXT_MENU_WIDTH_PX as _t, estimateContextMenuHeight as zt } from "./workbenchHelpers.js";
3
+ import { getTopZIndex as It, createContextMenuPosition as Mt, createWorkbenchId as vt, createWorkbenchViewportCenteredOnWidget as K, findNearestWidget as Xt, WORKBENCH_CONTEXT_MENU_WIDTH_PX as Yt, estimateContextMenuHeight as yt, clampScale as Ot, WORKBENCH_CANVAS_ZOOM_STEP as L, WORKBENCH_MIN_SCALE as _t, createWorkbenchViewportFitForWidget as zt } from "./workbenchHelpers.js";
4
4
  import { resolveWorkbenchWidgetDefinitions as Tt, getWidgetEntry as j, createWorkbenchFilterState as Vt } from "./widgets/widgetRegistry.js";
5
5
  function Kt(c) {
6
6
  const [x, S] = A(null), [U, N] = A(null), [D, G] = A({ width: 0, height: 0 });
@@ -107,8 +107,8 @@ function Kt(c) {
107
107
  return Mt({
108
108
  clientX: t.clientX,
109
109
  clientY: t.clientY,
110
- menuWidth: _t,
111
- menuHeight: zt(n, i)
110
+ menuWidth: Yt,
111
+ menuHeight: yt(n, i)
112
112
  });
113
113
  }), v = (t, e, n) => {
114
114
  const i = j(t, w()), o = i.singleton ? C(t) : null;
@@ -167,7 +167,7 @@ function Kt(c) {
167
167
  }, y = (t) => {
168
168
  c.setState((e) => ({ ...e, viewport: t }));
169
169
  }, q = (t) => {
170
- const e = h(), n = a(), i = (n.width / 2 - e.x) / e.scale, o = (n.height / 2 - e.y) / e.scale, s = Yt(
170
+ const e = h(), n = a(), i = (n.width / 2 - e.x) / e.scale, o = (n.height / 2 - e.y) / e.scale, s = Ot(
171
171
  t === "in" ? e.scale * L : e.scale / L
172
172
  ), u = {
173
173
  x: n.width / 2 - i * s,
@@ -232,7 +232,7 @@ function Kt(c) {
232
232
  }));
233
233
  }, Wt = (t) => {
234
234
  const e = a();
235
- e.width === 0 || e.height === 0 || _(Ot({
235
+ e.width === 0 || e.height === 0 || _(zt({
236
236
  widget: t,
237
237
  frameWidth: e.width,
238
238
  frameHeight: e.height
@@ -241,7 +241,7 @@ function Kt(c) {
241
241
  const e = a();
242
242
  e.width === 0 || e.height === 0 || _(K({
243
243
  widget: t,
244
- scale: yt,
244
+ scale: _t,
245
245
  frameWidth: e.width,
246
246
  frameHeight: e.height
247
247
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.36.33",
3
+ "version": "0.36.35",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",