@floegence/floe-webapp-core 0.36.36 → 0.36.38

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.
@@ -10,7 +10,7 @@ export { CommandPalette } from './CommandPalette';
10
10
  export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
11
11
  export { startPointerSession, type PointerSessionController, type PointerSessionEndEvent, type PointerSessionEndReason, type PointerSessionSnapshot, type StartPointerSessionOptions, } from './pointerSession';
12
12
  export { clientToCanvasLocal, clientToCanvasWorld, createViewportFromZoomAnchor, isPointInsideCanvasRect, localToCanvasWorld, type CanvasClientPoint, type CanvasLocalPoint, type CanvasViewportLike, type CanvasViewportRectLike, type CanvasWorldPoint, } from './canvasGeometry';
13
- export { CANVAS_WHEEL_INTERACTIVE_ATTR, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR, LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR, DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveSurfaceWheelRouting, resolveWorkbenchWidgetEventOwnership, resolveWorkbenchWidgetLocalTypingTarget, shouldActivateWorkbenchWidgetLocalTarget, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type SurfaceWheelLocalReason, type SurfaceWheelRoutingDecision, type SurfaceWheelRoutingOptions, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, type WorkbenchWidgetLocalActivationTargetOptions, } from './localInteractionSurface';
13
+ export { CANVAS_WHEEL_INTERACTIVE_ATTR, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR, LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_TEXT_SELECTION_SURFACE_ATTR, DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR, DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveSurfaceWheelRouting, resolveWorkbenchWidgetEventOwnership, resolveWorkbenchWidgetTextSelectionTarget, resolveWorkbenchWidgetLocalTypingTarget, shouldActivateWorkbenchWidgetLocalTarget, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type SurfaceWheelLocalReason, type SurfaceWheelRoutingDecision, type SurfaceWheelRoutingOptions, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, type WorkbenchWidgetLocalActivationTargetOptions, } from './localInteractionSurface';
14
14
  export { DIALOG_SURFACE_HOST_ATTR, SURFACE_PORTAL_HOST_ATTR, SURFACE_PORTAL_LAYER_ATTR, DIALOG_SURFACE_BOUNDARY_ATTR, ensureSurfacePortalInteractionTracking, isSurfacePortalMode, projectSurfacePortalPosition, projectSurfacePortalRect, resolveSurfacePortalBoundaryRect, resolveSurfacePortalHost, resolveSurfacePortalMount, resolveSurfacePortalMountRect, __resetSurfacePortalScopeForTests, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalInteractionSnapshot, type SurfacePortalMode, type SurfacePortalRect, } from './surfacePortalScope';
15
15
  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';
16
16
  export { Tabs, TabPanel, type TabsProps, type TabPanelProps, type TabItem, type TabsFeatures, type TabsSlotClassNames, type TabsIndicatorMode, type TabsIndicatorColorToken, } from './Tabs';
@@ -6,6 +6,8 @@ export declare const WORKBENCH_WIDGET_SHELL_ATTR = "data-floe-workbench-widget-s
6
6
  export declare const DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR = "[data-floe-workbench-widget-shell=\"true\"]";
7
7
  export declare const WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR = "data-floe-workbench-widget-activation-surface";
8
8
  export declare const DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR = "[data-floe-workbench-widget-activation-surface=\"true\"]";
9
+ export declare const WORKBENCH_TEXT_SELECTION_SURFACE_ATTR = "data-floe-workbench-text-selection-surface";
10
+ export declare const DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR = "[data-floe-workbench-text-selection-surface=\"true\"]";
9
11
  export type SurfaceInteractionTargetRole = 'canvas' | 'local_surface' | 'pan_surface';
10
12
  export type SurfaceWheelLocalReason = 'typing_element' | 'local_interaction_surface' | 'wheel_interactive';
11
13
  export type SurfaceWheelRoutingDecision = {
@@ -23,6 +25,7 @@ export interface SurfaceInteractionRoutingOptions {
23
25
  interactiveSelector: string;
24
26
  panSurfaceSelector: string;
25
27
  localInteractionSurfaceSelector?: string;
28
+ textSelectionSurfaceSelector?: string;
26
29
  }
27
30
  export interface WorkbenchWidgetEventOwnershipOptions extends SurfaceInteractionRoutingOptions {
28
31
  widgetRoot: Element | EventTarget | null;
@@ -42,4 +45,5 @@ export declare function resolveSurfaceWheelRouting(options: SurfaceWheelRoutingO
42
45
  export declare function isLocalInteractionSurfaceTarget(options: SurfaceInteractionRoutingOptions): boolean;
43
46
  export declare function resolveWorkbenchWidgetEventOwnership(options: WorkbenchWidgetEventOwnershipOptions): WorkbenchWidgetEventOwnership;
44
47
  export declare function shouldActivateWorkbenchWidgetLocalTarget(options: WorkbenchWidgetLocalActivationTargetOptions): boolean;
48
+ export declare function resolveWorkbenchWidgetTextSelectionTarget(options: WorkbenchWidgetLocalActivationTargetOptions): HTMLElement | null;
45
49
  export declare function resolveWorkbenchWidgetLocalTypingTarget(options: WorkbenchWidgetLocalActivationTargetOptions): HTMLElement | null;
@@ -1,94 +1,111 @@
1
- import { isTypingElement as i } from "../../utils/dom.js";
2
- const T = "data-floe-local-interaction-surface", s = `[${T}="true"]`, S = "data-floe-canvas-wheel-interactive", g = `[${S}="true"]`, A = "data-floe-workbench-widget-shell", f = `[${A}="true"]`, m = "data-floe-workbench-widget-activation-surface", _ = `[${m}="true"]`;
1
+ import { isTypingElement as s } from "../../utils/dom.js";
2
+ const g = "data-floe-local-interaction-surface", i = `[${g}="true"]`, A = "data-floe-canvas-wheel-interactive", R = `[${A}="true"]`, m = "data-floe-workbench-widget-shell", f = `[${m}="true"]`, L = "data-floe-workbench-widget-activation-surface", S = `[${L}="true"]`, C = "data-floe-workbench-text-selection-surface", _ = `[${C}="true"]`;
3
3
  function u(e) {
4
4
  return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
5
  }
6
- function R(e) {
6
+ function h(e) {
7
7
  if (!e || typeof HTMLElement > "u" || !(e instanceof HTMLElement))
8
8
  return !1;
9
9
  if (e.matches("button, input, select, textarea, summary") || e.matches("a[href], area[href]") || e.matches('iframe, [contenteditable="true"]')) return !0;
10
- const t = e.getAttribute("tabindex");
11
- return t !== null && t !== "-1";
10
+ const n = e.getAttribute("tabindex");
11
+ return n !== null && n !== "-1";
12
12
  }
13
- function h(e, t) {
14
- let r = e;
15
- for (; r && r !== t; ) {
16
- if (i(r) || R(r))
13
+ function w(e, n) {
14
+ let l = e;
15
+ for (; l && l !== n; ) {
16
+ if (s(l) || h(l))
17
17
  return !0;
18
- r = r.parentElement;
18
+ l = l.parentElement;
19
19
  }
20
20
  return !1;
21
21
  }
22
22
  function d(e) {
23
23
  const {
24
- target: t,
25
- interactiveSelector: r,
26
- panSurfaceSelector: a,
27
- localInteractionSurfaceSelector: l = s
28
- } = e, c = t instanceof Element ? t : null;
29
- return c ? c.closest(a) !== null ? "pan_surface" : i(c) || c.closest(r) !== null || c.closest(l) !== null ? "local_surface" : "canvas" : "canvas";
24
+ target: n,
25
+ interactiveSelector: l,
26
+ panSurfaceSelector: o,
27
+ localInteractionSurfaceSelector: r = i,
28
+ textSelectionSurfaceSelector: a = _
29
+ } = e, t = n instanceof Element ? n : null;
30
+ return t ? t.closest(o) !== null ? "pan_surface" : s(t) || t.closest(l) !== null || t.closest(r) !== null || t.closest(a) !== null ? "local_surface" : "canvas" : "canvas";
30
31
  }
31
32
  function I(e) {
32
33
  const {
33
- target: t,
34
- localInteractionSurfaceSelector: r = s,
35
- wheelInteractiveSelector: a = g
36
- } = e, l = u(t);
37
- return l ? i(l) ? "typing_element" : l.closest(r) !== null ? "local_interaction_surface" : l.closest(a) !== null ? "wheel_interactive" : null : null;
34
+ target: n,
35
+ localInteractionSurfaceSelector: l = i,
36
+ wheelInteractiveSelector: o = R
37
+ } = e, r = u(n);
38
+ return r ? s(r) ? "typing_element" : r.closest(l) !== null ? "local_interaction_surface" : r.closest(o) !== null ? "wheel_interactive" : null : null;
38
39
  }
39
- function w(e) {
40
- const t = I(e);
41
- return t ? { kind: "local_surface", reason: t } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
40
+ function O(e) {
41
+ const n = I(e);
42
+ return n ? { kind: "local_surface", reason: n } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
42
43
  }
43
- function C(e) {
44
+ function N(e) {
44
45
  return d(e) !== "canvas";
45
46
  }
46
- function E(e) {
47
+ function T(e) {
47
48
  const {
48
- widgetRoot: t,
49
- shellSelector: r = f
50
- } = e, a = u(t), l = u(e.target);
51
- return !a || !l || !a.contains(l) ? "outside_widget" : d(e) !== "canvas" ? "widget_local" : l === a || l.closest(r) !== null ? "widget_shell" : "widget_local";
49
+ widgetRoot: n,
50
+ shellSelector: l = f
51
+ } = e, o = u(n), r = u(e.target);
52
+ return !o || !r || !o.contains(r) ? "outside_widget" : d(e) !== "canvas" ? "widget_local" : r === o || r.closest(l) !== null ? "widget_shell" : "widget_local";
53
+ }
54
+ function b(e) {
55
+ const {
56
+ widgetRoot: n,
57
+ shellSelector: l = f,
58
+ localInteractionSurfaceSelector: o = i,
59
+ widgetActivationSurfaceSelector: r = S
60
+ } = e, a = u(n), t = u(e.target);
61
+ return !a || !t || !a.contains(t) || t === a || t.closest(l) !== null || t.closest(e.panSurfaceSelector) !== null || t.closest(o) !== null || v(e) !== null ? !1 : t.closest(r) !== null ? T(e) === "widget_local" : w(t, a) ? !1 : T(e) === "widget_local";
52
62
  }
53
63
  function v(e) {
54
64
  const {
55
- widgetRoot: t,
56
- shellSelector: r = f,
57
- localInteractionSurfaceSelector: a = s,
58
- widgetActivationSurfaceSelector: l = _
59
- } = e, c = u(t), n = u(e.target);
60
- return !c || !n || !c.contains(n) || n === c || n.closest(r) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(a) !== null ? !1 : n.closest(l) !== null ? E(e) === "widget_local" : h(n, c) ? !1 : E(e) === "widget_local";
65
+ widgetRoot: n,
66
+ shellSelector: l = f,
67
+ localInteractionSurfaceSelector: o = i,
68
+ widgetActivationSurfaceSelector: r = S,
69
+ textSelectionSurfaceSelector: a = _
70
+ } = e, t = u(n), c = u(e.target);
71
+ if (!t || !c || !t.contains(c) || c === t || c.closest(l) !== null || c.closest(e.panSurfaceSelector) !== null)
72
+ return null;
73
+ const E = c.closest(a);
74
+ return E instanceof HTMLElement && t.contains(E) ? E : (c.closest(o) !== null || c.closest(r) !== null, null);
61
75
  }
62
- function W(e) {
76
+ function H(e) {
63
77
  const {
64
- widgetRoot: t,
65
- shellSelector: r = f,
66
- localInteractionSurfaceSelector: a = s,
67
- widgetActivationSurfaceSelector: l = _
68
- } = e, c = u(t), n = u(e.target);
69
- if (!c || !n || !c.contains(n) || n === c || n.closest(r) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(a) !== null || n.closest(l) !== null)
78
+ widgetRoot: n,
79
+ shellSelector: l = f,
80
+ localInteractionSurfaceSelector: o = i,
81
+ widgetActivationSurfaceSelector: r = S
82
+ } = e, a = u(n), t = u(e.target);
83
+ if (!a || !t || !a.contains(t) || t === a || t.closest(l) !== null || t.closest(e.panSurfaceSelector) !== null || t.closest(o) !== null || t.closest(r) !== null)
70
84
  return null;
71
- let o = n;
72
- for (; o && o !== c; ) {
73
- if (o instanceof HTMLElement && i(o))
74
- return o;
75
- o = o.parentElement;
85
+ let c = t;
86
+ for (; c && c !== a; ) {
87
+ if (c instanceof HTMLElement && s(c))
88
+ return c;
89
+ c = c.parentElement;
76
90
  }
77
91
  return null;
78
92
  }
79
93
  export {
80
- S as CANVAS_WHEEL_INTERACTIVE_ATTR,
81
- g as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
82
- s as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
83
- _ as DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR,
94
+ A as CANVAS_WHEEL_INTERACTIVE_ATTR,
95
+ R as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
96
+ i as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
97
+ _ as DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR,
98
+ S as DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR,
84
99
  f as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
85
- T as LOCAL_INTERACTION_SURFACE_ATTR,
86
- m as WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR,
87
- A as WORKBENCH_WIDGET_SHELL_ATTR,
88
- C as isLocalInteractionSurfaceTarget,
100
+ g as LOCAL_INTERACTION_SURFACE_ATTR,
101
+ C as WORKBENCH_TEXT_SELECTION_SURFACE_ATTR,
102
+ L as WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR,
103
+ m as WORKBENCH_WIDGET_SHELL_ATTR,
104
+ N as isLocalInteractionSurfaceTarget,
89
105
  d as resolveSurfaceInteractionTargetRole,
90
- w as resolveSurfaceWheelRouting,
91
- E as resolveWorkbenchWidgetEventOwnership,
92
- W as resolveWorkbenchWidgetLocalTypingTarget,
93
- v as shouldActivateWorkbenchWidgetLocalTarget
106
+ O as resolveSurfaceWheelRouting,
107
+ T as resolveWorkbenchWidgetEventOwnership,
108
+ H as resolveWorkbenchWidgetLocalTypingTarget,
109
+ v as resolveWorkbenchWidgetTextSelectionTarget,
110
+ b as shouldActivateWorkbenchWidgetLocalTarget
94
111
  };
@@ -1,21 +1,21 @@
1
- import { spread as nt, mergeProps as Wt, insert as l, createComponent as g, memo as Et, effect as Lt, style as zt, template as st, use as Rt, delegateEvents as At } from "solid-js/web";
2
- import { createMemo as d, createSignal as k, onCleanup as ot, untrack as m, createEffect as rt } from "solid-js";
1
+ import { spread as nt, mergeProps as Wt, insert as s, createComponent as h, memo as Et, effect as Lt, style as zt, template as st, use as Rt, delegateEvents as At } from "solid-js/web";
2
+ import { createMemo as w, createSignal as $, onCleanup as ot, untrack as _, createEffect as rt } from "solid-js";
3
3
  import { startHotInteraction as Dt } from "../../utils/hotInteraction.js";
4
4
  import { X as at, Minus as ct, Maximize as lt, GripVertical as Xt } from "../icons/index.js";
5
- import { CANVAS_WHEEL_INTERACTIVE_ATTR as Yt, WORKBENCH_WIDGET_SHELL_ATTR as jt, resolveWorkbenchWidgetLocalTypingTarget as Ft, shouldActivateWorkbenchWidgetLocalTarget as Ht } from "../ui/localInteractionSurface.js";
5
+ import { CANVAS_WHEEL_INTERACTIVE_ATTR as Yt, WORKBENCH_WIDGET_SHELL_ATTR as jt, resolveWorkbenchWidgetLocalTypingTarget as Ft, resolveWorkbenchWidgetTextSelectionTarget as Ht, shouldActivateWorkbenchWidgetLocalTarget as Ot } from "../ui/localInteractionSurface.js";
6
6
  import { startPointerSession as dt } from "../ui/pointerSession.js";
7
- import { createWorkbenchWidgetSurfaceMetrics as Ot, resolveWorkbenchProjectedSurfaceScaleBehavior as qt } from "./workbenchHelpers.js";
8
- import { resolveWorkbenchInteractionAdapter as Bt } from "./workbenchInteractionAdapter.js";
9
- var Nt = /* @__PURE__ */ st('<article class=workbench-widget><div class=workbench-widget__surface><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), Vt = /* @__PURE__ */ st('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
10
- const Zt = 220, Gt = 160, Jt = 160;
11
- function re(e) {
12
- const w = d(() => Bt(e.interactionAdapter)), [y, L] = k(null), [x, z] = k(null), [wt, ut] = k(), [R, A] = k(!1), [B, I] = k({
7
+ import { createWorkbenchWidgetSurfaceMetrics as qt, resolveWorkbenchProjectedSurfaceScaleBehavior as Bt } from "./workbenchHelpers.js";
8
+ import { resolveWorkbenchInteractionAdapter as Nt } from "./workbenchInteractionAdapter.js";
9
+ var Vt = /* @__PURE__ */ st('<article class=workbench-widget><div class=workbench-widget__surface><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), Zt = /* @__PURE__ */ st('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
10
+ const Gt = 220, Jt = 160, Kt = 160;
11
+ function ae(e) {
12
+ const l = w(() => Nt(e.interactionAdapter)), [y, L] = $(null), [x, z] = $(null), [wt, ut] = $(), [R, A] = $(!1), [B, I] = $({
13
13
  enabled: !1,
14
14
  scale: 1
15
15
  });
16
- let _, b, gt = 0, ht = 0, v = null, S;
16
+ let b, v, gt = 0, ht = 0, m = null, S;
17
17
  const p = /* @__PURE__ */ new Map();
18
- let s;
18
+ let d;
19
19
  const M = () => {
20
20
  typeof window > "u" || S === void 0 || (window.clearTimeout(S), S = void 0);
21
21
  }, N = (t, i) => {
@@ -24,24 +24,24 @@ function re(e) {
24
24
  cursor: i
25
25
  });
26
26
  let r = !1;
27
- return m(() => e.onLayoutInteractionStart?.()), () => {
28
- r || (r = !0, n(), m(() => e.onLayoutInteractionEnd?.()));
27
+ return _(() => e.onLayoutInteractionStart?.()), () => {
28
+ r || (r = !0, n(), _(() => e.onLayoutInteractionEnd?.()));
29
29
  };
30
30
  };
31
31
  ot(() => {
32
- _?.stop({
32
+ b?.stop({
33
33
  reason: "manual_stop",
34
34
  commit: !1
35
- }), _ = void 0, b?.stop({
35
+ }), b = void 0, v?.stop({
36
36
  reason: "manual_stop",
37
37
  commit: !1
38
- }), b = void 0, m(y)?.stopInteraction(), m(x)?.stopInteraction(), M();
38
+ }), v = void 0, _(y)?.stopInteraction(), _(x)?.stopInteraction(), M();
39
39
  });
40
40
  const T = () => {
41
41
  A(!1), e.onSelect(e.widgetId), e.onCommitFront(e.widgetId);
42
42
  }, D = () => {
43
43
  A(!1);
44
- }, $ = d(() => e.selected || R()), ft = (t, i, n) => {
44
+ }, k = w(() => e.selected || R()), ft = (t, i, n) => {
45
45
  const r = {
46
46
  token: ++ht,
47
47
  wasSelected: i,
@@ -55,10 +55,10 @@ function re(e) {
55
55
  return i && p.delete(t), i;
56
56
  };
57
57
  rt(() => {
58
- const t = s;
58
+ const t = d;
59
59
  if (!t) return;
60
60
  const i = (a) => {
61
- a.button === 0 && ft(a.pointerId, $(), C(a.target));
61
+ a.button === 0 && ft(a.pointerId, k(), C(a.target));
62
62
  }, n = (a) => {
63
63
  a.button === 0 && R() && C(a.target) === "widget_local" && T();
64
64
  }, r = () => {
@@ -70,13 +70,13 @@ function re(e) {
70
70
  t.removeEventListener("pointerdown", i, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", r), t.removeEventListener("pointercancel", D);
71
71
  });
72
72
  });
73
- const X = () => y() !== null, Y = () => x() !== null, _t = d(() => e.filtered ? "cold" : $() ? "hot" : "warm"), C = (t) => w().resolveWidgetEventOwnership({
73
+ const X = () => y() !== null, Y = () => x() !== null, _t = w(() => e.filtered ? "cold" : k() ? "hot" : "warm"), C = (t) => l().resolveWidgetEventOwnership({
74
74
  target: t,
75
- widgetRoot: s ?? null,
76
- interactiveSelector: w().interactiveSelector,
77
- panSurfaceSelector: w().panSurfaceSelector
75
+ widgetRoot: d ?? null,
76
+ interactiveSelector: l().interactiveSelector,
77
+ panSurfaceSelector: l().panSurfaceSelector
78
78
  }), bt = () => {
79
- T(), s?.focus({
79
+ T(), d?.focus({
80
80
  preventScroll: !0
81
81
  });
82
82
  }, V = (t) => {
@@ -86,7 +86,7 @@ function re(e) {
86
86
  pointerType: t
87
87
  }));
88
88
  }, vt = (t) => {
89
- if (!(!s || !t.isConnected || !s.contains(t)))
89
+ if (!(!d || !t.isConnected || !d.contains(t)))
90
90
  try {
91
91
  t.focus({
92
92
  preventScroll: !0
@@ -95,16 +95,16 @@ function re(e) {
95
95
  t.focus();
96
96
  }
97
97
  }, St = (t, i) => {
98
- v = {
98
+ m = {
99
99
  token: ++gt,
100
100
  pointerId: t,
101
101
  target: i,
102
102
  timestamp: Date.now()
103
103
  };
104
- const n = v;
104
+ const n = m;
105
105
  queueMicrotask(() => {
106
106
  const r = () => {
107
- !n || v?.token !== n.token || (vt(n.target), v = null);
107
+ !n || m?.token !== n.token || (vt(n.target), m = null);
108
108
  };
109
109
  if (typeof requestAnimationFrame == "function") {
110
110
  requestAnimationFrame(() => r());
@@ -116,17 +116,22 @@ function re(e) {
116
116
  if (t.button !== 0) return;
117
117
  const i = mt(t.pointerId), n = i?.wasSelected ?? e.selected, r = i?.ownership ?? C(t.target), a = r === "widget_local" ? Ft({
118
118
  target: t.target,
119
- widgetRoot: s ?? null,
120
- interactiveSelector: w().interactiveSelector,
121
- panSurfaceSelector: w().panSurfaceSelector
122
- }) : null, o = r === "widget_local" && !a && Ht({
119
+ widgetRoot: d ?? null,
120
+ interactiveSelector: l().interactiveSelector,
121
+ panSurfaceSelector: l().panSurfaceSelector
122
+ }) : null, o = r === "widget_local" ? Ht({
123
123
  target: t.target,
124
- widgetRoot: s ?? null,
125
- interactiveSelector: w().interactiveSelector,
126
- panSurfaceSelector: w().panSurfaceSelector
124
+ widgetRoot: d ?? null,
125
+ interactiveSelector: l().interactiveSelector,
126
+ panSurfaceSelector: l().panSurfaceSelector
127
+ }) : null, g = r === "widget_local" && !a && !o && Ot({
128
+ target: t.target,
129
+ widgetRoot: d ?? null,
130
+ interactiveSelector: l().interactiveSelector,
131
+ panSurfaceSelector: l().panSurfaceSelector
127
132
  });
128
133
  if (r === "widget_shell") {
129
- T(), s?.focus({
134
+ T(), d?.focus({
130
135
  preventScroll: !0
131
136
  });
132
137
  return;
@@ -137,14 +142,18 @@ function re(e) {
137
142
  return;
138
143
  }
139
144
  if (o) {
140
- if (v = null, n) {
145
+ m = null;
146
+ return;
147
+ }
148
+ if (g) {
149
+ if (m = null, n) {
141
150
  V(t.pointerType || void 0);
142
151
  return;
143
152
  }
144
153
  T(), V(t.pointerType || void 0);
145
154
  }
146
155
  }
147
- }, P = d(() => {
156
+ }, P = w(() => {
148
157
  const t = y();
149
158
  return t ? {
150
159
  x: t.worldX,
@@ -153,7 +162,7 @@ function re(e) {
153
162
  x: e.x,
154
163
  y: e.y
155
164
  };
156
- }), u = d(() => {
165
+ }), u = w(() => {
157
166
  const t = x();
158
167
  return t ? {
159
168
  width: t.width,
@@ -162,9 +171,9 @@ function re(e) {
162
171
  width: e.width,
163
172
  height: e.height
164
173
  };
165
- }), j = d(() => {
174
+ }), j = w(() => {
166
175
  if (!(e.layoutMode !== "projected_surface" || !e.projectedViewport))
167
- return Ot({
176
+ return qt({
168
177
  widgetId: e.widgetId,
169
178
  worldX: P().x,
170
179
  worldY: P().y,
@@ -173,7 +182,7 @@ function re(e) {
173
182
  viewport: e.projectedViewport(),
174
183
  ready: e.surfaceReady ?? !0
175
184
  });
176
- }), F = d(() => j()?.rect.viewportScale ?? Math.max(e.viewportScale, 1e-3)), Z = d(() => e.layoutMode === "projected_surface" && qt(e.definition) === "settle_sharp_zoom"), G = d(() => e.layoutMode === "projected_surface" && Z() && B().enabled && B().scale > 1.001), $t = d(() => {
185
+ }), F = w(() => j()?.rect.viewportScale ?? Math.max(e.viewportScale, 1e-3)), Z = w(() => e.layoutMode === "projected_surface" && Bt(e.definition) === "settle_sharp_zoom"), G = w(() => e.layoutMode === "projected_surface" && Z() && B().enabled && B().scale > 1.001), kt = w(() => {
177
186
  if (e.layoutMode !== "projected_surface")
178
187
  return;
179
188
  const t = F();
@@ -186,7 +195,7 @@ function re(e) {
186
195
  height: "100%",
187
196
  zoom: "1"
188
197
  };
189
- }), kt = d(() => {
198
+ }), $t = w(() => {
190
199
  const t = e.itemSnapshot().z_index, i = Number.isFinite(t) ? Math.max(1, Math.min(99, Math.round(t))) : 1;
191
200
  return String(i).padStart(2, "0");
192
201
  }), J = (t) => {
@@ -195,7 +204,7 @@ function re(e) {
195
204
  t.preventDefault(), t.stopPropagation(), e.onRequestFit(e.itemSnapshot());
196
205
  }, U = (t) => {
197
206
  t.preventDefault(), t.stopPropagation(), e.onRequestDelete(e.widgetId);
198
- }, yt = d(() => {
207
+ }, yt = w(() => {
199
208
  const t = {
200
209
  "z-index": X() || Y() || e.optimisticFront ? `${e.topRenderLayer + 1}` : `${e.renderLayer}`
201
210
  };
@@ -244,10 +253,10 @@ function re(e) {
244
253
  enabled: !0,
245
254
  scale: i
246
255
  } : n);
247
- }, Jt);
256
+ }, Kt);
248
257
  });
249
258
  const xt = (t) => {
250
- const i = m(y);
259
+ const i = _(y);
251
260
  if (!i) return;
252
261
  const n = {
253
262
  x: i.worldX,
@@ -256,13 +265,13 @@ function re(e) {
256
265
  x: i.startWorldX,
257
266
  y: i.startWorldY
258
267
  }, a = t && (Math.abs(n.x - r.x) > 1 || Math.abs(n.y - r.y) > 1);
259
- e.onCommitFront(e.widgetId), a && e.onCommitMove(e.widgetId, n), i.stopInteraction(), L(null), _ = void 0;
268
+ e.onCommitFront(e.widgetId), a && e.onCommitMove(e.widgetId, n), i.stopInteraction(), L(null), b = void 0;
260
269
  }, Q = (t) => {
261
270
  if (t.button !== 0 || e.locked) return;
262
- t.preventDefault(), t.stopPropagation(), _?.stop({
271
+ t.preventDefault(), t.stopPropagation(), b?.stop({
263
272
  reason: "manual_stop",
264
273
  commit: !1
265
- }), e.onSelect(e.widgetId), s?.focus({
274
+ }), e.onSelect(e.widgetId), d?.focus({
266
275
  preventScroll: !0
267
276
  }), e.onStartOptimisticFront(e.widgetId);
268
277
  const i = N("drag", "grabbing"), n = Math.max(e.viewportScale, 1e-3);
@@ -281,16 +290,16 @@ function re(e) {
281
290
  const r = (a) => {
282
291
  L((o) => {
283
292
  if (!o || o.pointerId !== a.pointerId) return o;
284
- const h = o.startWorldX + (a.clientX - o.startClientX) / o.scale, f = o.startWorldY + (a.clientY - o.startClientY) / o.scale;
293
+ const g = o.startWorldX + (a.clientX - o.startClientX) / o.scale, f = o.startWorldY + (a.clientY - o.startClientY) / o.scale;
285
294
  return {
286
295
  ...o,
287
- worldX: h,
296
+ worldX: g,
288
297
  worldY: f,
289
- moved: o.moved || Math.abs(h - o.startWorldX) > 2 || Math.abs(f - o.startWorldY) > 2
298
+ moved: o.moved || Math.abs(g - o.startWorldX) > 2 || Math.abs(f - o.startWorldY) > 2
290
299
  };
291
300
  });
292
301
  };
293
- _ = dt({
302
+ b = dt({
294
303
  pointerEvent: t,
295
304
  captureEl: t.currentTarget,
296
305
  onMove: r,
@@ -299,16 +308,16 @@ function re(e) {
299
308
  }) => xt(a)
300
309
  });
301
310
  }, It = (t) => {
302
- const i = m(x);
311
+ const i = _(x);
303
312
  if (!i) return;
304
313
  const n = {
305
314
  width: i.width,
306
315
  height: i.height
307
316
  }, r = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
308
- t && r && e.onCommitResize(e.widgetId, n), i.stopInteraction(), z(null), b = void 0;
317
+ t && r && e.onCommitResize(e.widgetId, n), i.stopInteraction(), z(null), v = void 0;
309
318
  }, Mt = (t) => {
310
319
  if (t.button !== 0 || e.locked) return;
311
- t.preventDefault(), t.stopPropagation(), b?.stop({
320
+ t.preventDefault(), t.stopPropagation(), v?.stop({
312
321
  reason: "manual_stop",
313
322
  commit: !1
314
323
  }), e.onStartOptimisticFront(e.widgetId);
@@ -327,15 +336,15 @@ function re(e) {
327
336
  const r = (a) => {
328
337
  z((o) => {
329
338
  if (!o || o.pointerId !== a.pointerId) return o;
330
- const h = Math.max(Zt, o.startWidth + (a.clientX - o.startClientX) / o.scale), f = Math.max(Gt, o.startHeight + (a.clientY - o.startClientY) / o.scale);
339
+ const g = Math.max(Gt, o.startWidth + (a.clientX - o.startClientX) / o.scale), f = Math.max(Jt, o.startHeight + (a.clientY - o.startClientY) / o.scale);
331
340
  return {
332
341
  ...o,
333
- width: h,
342
+ width: g,
334
343
  height: f
335
344
  };
336
345
  });
337
346
  };
338
- b = dt({
347
+ v = dt({
339
348
  pointerEvent: t,
340
349
  captureEl: t.currentTarget,
341
350
  onMove: r,
@@ -345,11 +354,11 @@ function re(e) {
345
354
  });
346
355
  };
347
356
  return (() => {
348
- var t = Nt(), i = t.firstChild, n = i.firstChild, r = n.firstChild, a = r.firstChild, o = a.nextSibling, h = o.nextSibling, f = r.nextSibling, H = f.nextSibling, O = H.nextSibling, Tt = O.firstChild, tt = Tt.nextSibling, Ct = O.nextSibling, W = Ct.firstChild, E = W.nextSibling, q = E.nextSibling, Pt = n.nextSibling, et = s;
349
- return typeof et == "function" ? Rt(et, t) : s = t, nt(t, Wt({
357
+ var t = Vt(), i = t.firstChild, n = i.firstChild, r = n.firstChild, a = r.firstChild, o = a.nextSibling, g = o.nextSibling, f = r.nextSibling, H = f.nextSibling, O = H.nextSibling, Tt = O.firstChild, tt = Tt.nextSibling, Ct = O.nextSibling, W = Ct.firstChild, E = W.nextSibling, q = E.nextSibling, Pt = n.nextSibling, et = d;
358
+ return typeof et == "function" ? Rt(et, t) : d = t, nt(t, Wt({
350
359
  get classList() {
351
360
  return {
352
- "is-selected": $(),
361
+ "is-selected": k(),
353
362
  "is-dragging": X(),
354
363
  "is-resizing": Y(),
355
364
  "is-filtered-out": e.filtered,
@@ -358,15 +367,15 @@ function re(e) {
358
367
  };
359
368
  }
360
369
  }, () => ({
361
- [w().dialogSurfaceHostAttr]: "true"
370
+ [l().dialogSurfaceHostAttr]: "true"
362
371
  }), {
363
372
  get "data-floe-workbench-widget-id"() {
364
373
  return e.widgetId;
365
374
  }
366
375
  }, () => ({
367
- [w().widgetRootAttr]: "true"
376
+ [l().widgetRootAttr]: "true"
368
377
  }), () => ({
369
- [w().widgetIdAttr]: e.widgetId
378
+ [l().widgetIdAttr]: e.widgetId
370
379
  }), {
371
380
  get "data-workbench-widget-type"() {
372
381
  return e.widgetType;
@@ -375,7 +384,7 @@ function re(e) {
375
384
  return e.layoutMode ?? "canvas_scaled";
376
385
  }
377
386
  }, () => ({
378
- [Yt]: $() ? "true" : void 0
387
+ [Yt]: k() ? "true" : void 0
379
388
  }), {
380
389
  tabIndex: 0,
381
390
  onPointerDown: pt,
@@ -390,34 +399,34 @@ function re(e) {
390
399
  }
391
400
  }), !1, !0), n.$$pointerdown = Q, nt(n, {
392
401
  [jt]: "true"
393
- }, !1, !0), a.$$click = U, a.$$pointerdown = (c) => c.stopPropagation(), l(a, g(at, {
402
+ }, !1, !0), a.$$click = U, a.$$pointerdown = (c) => c.stopPropagation(), s(a, h(at, {
394
403
  class: "workbench-widget__traffic-icon",
395
404
  "aria-hidden": "true"
396
- })), o.$$click = J, o.$$pointerdown = (c) => c.stopPropagation(), l(o, g(ct, {
405
+ })), o.$$click = J, o.$$pointerdown = (c) => c.stopPropagation(), s(o, h(ct, {
397
406
  class: "workbench-widget__traffic-icon",
398
407
  "aria-hidden": "true"
399
- })), h.$$click = K, h.$$pointerdown = (c) => c.stopPropagation(), l(h, g(lt, {
408
+ })), g.$$click = K, g.$$pointerdown = (c) => c.stopPropagation(), s(g, h(lt, {
400
409
  class: "workbench-widget__traffic-icon",
401
410
  "aria-hidden": "true"
402
- })), l(f, kt), H.$$pointerdown = Q, l(H, g(Xt, {
411
+ })), s(f, $t), H.$$pointerdown = Q, s(H, h(Xt, {
403
412
  class: "w-3.5 h-3.5"
404
- })), l(O, () => {
413
+ })), s(O, () => {
405
414
  const c = e.definition.icon;
406
- return g(c, {
415
+ return h(c, {
407
416
  class: "w-3.5 h-3.5"
408
417
  });
409
- }, tt), l(tt, () => e.widgetTitle), W.$$click = J, W.$$pointerdown = (c) => c.stopPropagation(), l(W, g(ct, {
418
+ }, tt), s(tt, () => e.widgetTitle), W.$$click = J, W.$$pointerdown = (c) => c.stopPropagation(), s(W, h(ct, {
410
419
  class: "workbench-widget__window-control-icon",
411
420
  "aria-hidden": "true"
412
- })), E.$$click = K, E.$$pointerdown = (c) => c.stopPropagation(), l(E, g(lt, {
421
+ })), E.$$click = K, E.$$pointerdown = (c) => c.stopPropagation(), s(E, h(lt, {
413
422
  class: "workbench-widget__window-control-icon",
414
423
  "aria-hidden": "true"
415
- })), q.$$click = U, q.$$pointerdown = (c) => c.stopPropagation(), l(q, g(at, {
424
+ })), q.$$click = U, q.$$pointerdown = (c) => c.stopPropagation(), s(q, h(at, {
416
425
  class: "workbench-widget__window-control-icon",
417
426
  "aria-hidden": "true"
418
- })), l(Pt, () => {
427
+ })), s(Pt, () => {
419
428
  const c = e.definition.body;
420
- return g(c, {
429
+ return h(c, {
421
430
  get widgetId() {
422
431
  return e.widgetId;
423
432
  },
@@ -435,23 +444,23 @@ function re(e) {
435
444
  return _t();
436
445
  },
437
446
  get selected() {
438
- return $();
447
+ return k();
439
448
  },
440
449
  get filtered() {
441
450
  return e.filtered;
442
451
  },
443
452
  requestActivate: bt
444
453
  });
445
- }), l(i, (() => {
454
+ }), s(i, (() => {
446
455
  var c = Et(() => !!e.locked);
447
456
  return () => c() ? null : (() => {
448
- var it = Vt();
457
+ var it = Zt();
449
458
  return it.$$pointerdown = Mt, it;
450
459
  })();
451
- })(), null), Lt((c) => zt(i, $t(), c)), t;
460
+ })(), null), Lt((c) => zt(i, kt(), c)), t;
452
461
  })();
453
462
  }
454
463
  At(["pointerdown", "click"]);
455
464
  export {
456
- re as WorkbenchWidget
465
+ ae as WorkbenchWidget
457
466
  };