@floegence/floe-webapp-core 0.36.37 → 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.
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/localInteractionSurface.d.ts +4 -0
- package/dist/components/ui/localInteractionSurface.js +77 -60
- package/dist/components/workbench/WorkbenchWidget.js +91 -82
- package/dist/full.js +571 -568
- package/dist/styles.css +1 -1
- package/dist/ui.css +16 -0
- package/dist/ui.js +126 -123
- package/package.json +1 -1
|
@@ -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
|
|
2
|
-
const
|
|
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
|
|
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
|
|
11
|
-
return
|
|
10
|
+
const n = e.getAttribute("tabindex");
|
|
11
|
+
return n !== null && n !== "-1";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
for (;
|
|
16
|
-
if (
|
|
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
|
-
|
|
18
|
+
l = l.parentElement;
|
|
19
19
|
}
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
22
|
function d(e) {
|
|
23
23
|
const {
|
|
24
|
-
target:
|
|
25
|
-
interactiveSelector:
|
|
26
|
-
panSurfaceSelector:
|
|
27
|
-
localInteractionSurfaceSelector:
|
|
28
|
-
|
|
29
|
-
|
|
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:
|
|
34
|
-
localInteractionSurfaceSelector:
|
|
35
|
-
wheelInteractiveSelector:
|
|
36
|
-
} = e,
|
|
37
|
-
return
|
|
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
|
|
40
|
-
const
|
|
41
|
-
return
|
|
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
|
|
44
|
+
function N(e) {
|
|
44
45
|
return d(e) !== "canvas";
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function T(e) {
|
|
47
48
|
const {
|
|
48
|
-
widgetRoot:
|
|
49
|
-
shellSelector:
|
|
50
|
-
} = e,
|
|
51
|
-
return !
|
|
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:
|
|
56
|
-
shellSelector:
|
|
57
|
-
localInteractionSurfaceSelector:
|
|
58
|
-
widgetActivationSurfaceSelector:
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
76
|
+
function H(e) {
|
|
63
77
|
const {
|
|
64
|
-
widgetRoot:
|
|
65
|
-
shellSelector:
|
|
66
|
-
localInteractionSurfaceSelector:
|
|
67
|
-
widgetActivationSurfaceSelector:
|
|
68
|
-
} = e,
|
|
69
|
-
if (!
|
|
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
|
|
72
|
-
for (;
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
75
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_ as
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
v as
|
|
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
|
|
2
|
-
import { createMemo as
|
|
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,
|
|
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
|
|
8
|
-
import { resolveWorkbenchInteractionAdapter as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
const
|
|
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
|
|
16
|
+
let b, v, gt = 0, ht = 0, m = null, S;
|
|
17
17
|
const p = /* @__PURE__ */ new Map();
|
|
18
|
-
let
|
|
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
|
|
28
|
-
r || (r = !0, n(),
|
|
27
|
+
return _(() => e.onLayoutInteractionStart?.()), () => {
|
|
28
|
+
r || (r = !0, n(), _(() => e.onLayoutInteractionEnd?.()));
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
ot(() => {
|
|
32
|
-
|
|
32
|
+
b?.stop({
|
|
33
33
|
reason: "manual_stop",
|
|
34
34
|
commit: !1
|
|
35
|
-
}),
|
|
35
|
+
}), b = void 0, v?.stop({
|
|
36
36
|
reason: "manual_stop",
|
|
37
37
|
commit: !1
|
|
38
|
-
}),
|
|
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
|
-
},
|
|
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 =
|
|
58
|
+
const t = d;
|
|
59
59
|
if (!t) return;
|
|
60
60
|
const i = (a) => {
|
|
61
|
-
a.button === 0 && ft(a.pointerId,
|
|
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 =
|
|
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:
|
|
76
|
-
interactiveSelector:
|
|
77
|
-
panSurfaceSelector:
|
|
75
|
+
widgetRoot: d ?? null,
|
|
76
|
+
interactiveSelector: l().interactiveSelector,
|
|
77
|
+
panSurfaceSelector: l().panSurfaceSelector
|
|
78
78
|
}), bt = () => {
|
|
79
|
-
T(),
|
|
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 (!(!
|
|
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
|
-
|
|
98
|
+
m = {
|
|
99
99
|
token: ++gt,
|
|
100
100
|
pointerId: t,
|
|
101
101
|
target: i,
|
|
102
102
|
timestamp: Date.now()
|
|
103
103
|
};
|
|
104
|
-
const n =
|
|
104
|
+
const n = m;
|
|
105
105
|
queueMicrotask(() => {
|
|
106
106
|
const r = () => {
|
|
107
|
-
!n ||
|
|
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:
|
|
120
|
-
interactiveSelector:
|
|
121
|
-
panSurfaceSelector:
|
|
122
|
-
}) : null, o = r === "widget_local"
|
|
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:
|
|
125
|
-
interactiveSelector:
|
|
126
|
-
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(),
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
174
|
+
}), j = w(() => {
|
|
166
175
|
if (!(e.layoutMode !== "projected_surface" || !e.projectedViewport))
|
|
167
|
-
return
|
|
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 =
|
|
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
|
-
}),
|
|
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 =
|
|
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
|
-
},
|
|
256
|
+
}, Kt);
|
|
248
257
|
});
|
|
249
258
|
const xt = (t) => {
|
|
250
|
-
const i =
|
|
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),
|
|
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(),
|
|
271
|
+
t.preventDefault(), t.stopPropagation(), b?.stop({
|
|
263
272
|
reason: "manual_stop",
|
|
264
273
|
commit: !1
|
|
265
|
-
}), e.onSelect(e.widgetId),
|
|
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
|
|
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:
|
|
296
|
+
worldX: g,
|
|
288
297
|
worldY: f,
|
|
289
|
-
moved: o.moved || Math.abs(
|
|
298
|
+
moved: o.moved || Math.abs(g - o.startWorldX) > 2 || Math.abs(f - o.startWorldY) > 2
|
|
290
299
|
};
|
|
291
300
|
});
|
|
292
301
|
};
|
|
293
|
-
|
|
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 =
|
|
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),
|
|
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(),
|
|
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
|
|
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:
|
|
342
|
+
width: g,
|
|
334
343
|
height: f
|
|
335
344
|
};
|
|
336
345
|
});
|
|
337
346
|
};
|
|
338
|
-
|
|
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 =
|
|
349
|
-
return typeof et == "function" ? Rt(et, t) :
|
|
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
|
-
[
|
|
370
|
+
[l().dialogSurfaceHostAttr]: "true"
|
|
362
371
|
}), {
|
|
363
372
|
get "data-floe-workbench-widget-id"() {
|
|
364
373
|
return e.widgetId;
|
|
365
374
|
}
|
|
366
375
|
}, () => ({
|
|
367
|
-
[
|
|
376
|
+
[l().widgetRootAttr]: "true"
|
|
368
377
|
}), () => ({
|
|
369
|
-
[
|
|
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]:
|
|
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(),
|
|
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(),
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
411
|
+
})), s(f, $t), H.$$pointerdown = Q, s(H, h(Xt, {
|
|
403
412
|
class: "w-3.5 h-3.5"
|
|
404
|
-
})),
|
|
413
|
+
})), s(O, () => {
|
|
405
414
|
const c = e.definition.icon;
|
|
406
|
-
return
|
|
415
|
+
return h(c, {
|
|
407
416
|
class: "w-3.5 h-3.5"
|
|
408
417
|
});
|
|
409
|
-
}, tt),
|
|
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(),
|
|
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(),
|
|
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
|
-
})),
|
|
427
|
+
})), s(Pt, () => {
|
|
419
428
|
const c = e.definition.body;
|
|
420
|
-
return
|
|
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
|
-
}),
|
|
454
|
+
}), s(i, (() => {
|
|
446
455
|
var c = Et(() => !!e.locked);
|
|
447
456
|
return () => c() ? null : (() => {
|
|
448
|
-
var it =
|
|
457
|
+
var it = Zt();
|
|
449
458
|
return it.$$pointerdown = Mt, it;
|
|
450
459
|
})();
|
|
451
|
-
})(), null), Lt((c) => zt(i,
|
|
460
|
+
})(), null), Lt((c) => zt(i, kt(), c)), t;
|
|
452
461
|
})();
|
|
453
462
|
}
|
|
454
463
|
At(["pointerdown", "click"]);
|
|
455
464
|
export {
|
|
456
|
-
|
|
465
|
+
ae as WorkbenchWidget
|
|
457
466
|
};
|