@floegence/floe-webapp-core 0.36.13 → 0.36.16
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/deck/DeckCell.js +46 -38
- package/dist/components/file-browser/FileContextMenu.js +8 -6
- package/dist/components/ui/Dialog.js +62 -52
- package/dist/components/ui/Dropdown.js +50 -48
- package/dist/components/ui/FloatingWindow.js +73 -69
- package/dist/components/ui/InfiniteCanvas.d.ts +2 -0
- package/dist/components/ui/InfiniteCanvas.js +121 -101
- package/dist/components/ui/canvasGeometry.d.ts +32 -0
- package/dist/components/ui/canvasGeometry.js +33 -0
- package/dist/components/ui/dialogSurfaceScope.d.ts +8 -8
- package/dist/components/ui/dialogSurfaceScope.js +108 -62
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/surfacePortalScope.d.ts +1 -1
- package/dist/components/ui/surfacePortalTypes.d.ts +8 -0
- package/dist/components/workbench/WorkbenchCanvas.d.ts +4 -0
- package/dist/components/workbench/WorkbenchCanvas.js +52 -26
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +2 -0
- package/dist/components/workbench/WorkbenchCanvasField.js +18 -6
- package/dist/components/workbench/WorkbenchHud.d.ts +9 -0
- package/dist/components/workbench/WorkbenchHud.js +24 -10
- package/dist/components/workbench/WorkbenchSurface.js +56 -36
- package/dist/components/workbench/WorkbenchThemeSelector.d.ts +6 -0
- package/dist/components/workbench/WorkbenchThemeSelector.js +77 -0
- package/dist/components/workbench/WorkbenchWidget.d.ts +2 -0
- package/dist/components/workbench/WorkbenchWidget.js +205 -164
- package/dist/components/workbench/index.d.ts +2 -0
- package/dist/components/workbench/types.d.ts +2 -0
- package/dist/components/workbench/useWorkbenchModel.d.ts +6 -0
- package/dist/components/workbench/useWorkbenchModel.js +115 -106
- package/dist/components/workbench/workbenchHelpers.js +53 -50
- package/dist/components/workbench/workbenchThemes.d.ts +32 -0
- package/dist/components/workbench/workbenchThemes.js +82 -0
- package/dist/full.js +611 -591
- package/dist/styles.css +1 -1
- package/dist/ui.js +120 -100
- package/dist/workbench-themes.css +1106 -0
- package/dist/workbench.css +492 -96
- package/dist/workbench.js +35 -27
- package/package.json +1 -1
|
@@ -1,163 +1,183 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createSignal as _, untrack as
|
|
1
|
+
import { spread as B, mergeProps as j, insert as T, effect as q, className as G, setStyleProperty as J, template as K, use as Q } from "solid-js/web";
|
|
2
|
+
import { createSignal as _, untrack as I, createEffect as L, onCleanup as A } from "solid-js";
|
|
3
3
|
import { cn as D } from "../../utils/cn.js";
|
|
4
|
-
import { startHotInteraction as
|
|
5
|
-
import { resolveSurfaceInteractionTargetRole as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { startHotInteraction as x } from "../../utils/hotInteraction.js";
|
|
5
|
+
import { resolveSurfaceInteractionTargetRole as ee, resolveSurfaceWheelRouting as te, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR as ne } from "./localInteractionSurface.js";
|
|
6
|
+
import { clientToCanvasLocal as Y, localToCanvasWorld as re, createViewportFromZoomAnchor as oe } from "./canvasGeometry.js";
|
|
7
|
+
import { SURFACE_PORTAL_LAYER_ATTR as ae } from "./dialogSurfaceScope.js";
|
|
8
|
+
var ie = /* @__PURE__ */ K('<div><div style="transform-origin:0 0">');
|
|
9
|
+
const ce = 1, le = 0.45, se = 2.2, ue = 14e-4, de = '[data-floe-canvas-pan-surface="true"]', R = 3;
|
|
10
|
+
function fe(t, a, u) {
|
|
11
|
+
return Math.max(a, Math.min(u, t));
|
|
10
12
|
}
|
|
11
|
-
function
|
|
13
|
+
function b(t) {
|
|
12
14
|
return {
|
|
13
|
-
x: Number.isFinite(
|
|
14
|
-
y: Number.isFinite(
|
|
15
|
-
scale: Number.isFinite(
|
|
15
|
+
x: Number.isFinite(t.x) ? t.x : 0,
|
|
16
|
+
y: Number.isFinite(t.y) ? t.y : 0,
|
|
17
|
+
scale: Number.isFinite(t.scale) && t.scale > 0 ? t.scale : ce
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
+
function me(t, a) {
|
|
21
|
+
return t.deltaMode === 1 ? t.deltaY * 16 : t.deltaMode === 2 ? t.deltaY * (a?.clientHeight ?? window.innerHeight) : t.deltaY;
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
const [a,
|
|
23
|
-
let i,
|
|
24
|
-
const
|
|
25
|
-
const e =
|
|
23
|
+
function ge(t) {
|
|
24
|
+
const [a, u] = _(I(() => b(t.viewport))), [m, S] = _(null);
|
|
25
|
+
let i, d, f = !1, l;
|
|
26
|
+
const M = () => t.interactiveSelector ?? '[data-floe-canvas-interactive="true"]', X = () => t.panSurfaceSelector ?? de, F = () => t.wheelInteractiveSelector ?? ne, V = () => t.minScale ?? le, y = () => t.maxScale ?? se, k = () => t.wheelZoomSpeed ?? ue, U = () => {
|
|
27
|
+
const e = m();
|
|
26
28
|
return e ? e.startedFromPanSurface ? e.moved : !0 : !1;
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
+
}, w = () => {
|
|
30
|
+
d !== void 0 && (window.clearTimeout(d), d = void 0);
|
|
29
31
|
}, C = () => {
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
+
f = !1, l !== void 0 && (window.clearTimeout(l), l = void 0);
|
|
33
|
+
}, N = () => {
|
|
32
34
|
if (typeof window > "u") {
|
|
33
|
-
|
|
35
|
+
f = !1;
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
38
|
l !== void 0 && window.clearTimeout(l), l = window.setTimeout(() => {
|
|
37
|
-
l = void 0,
|
|
39
|
+
l = void 0, f = !1;
|
|
38
40
|
}, 0);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
},
|
|
41
|
+
}, v = (e) => {
|
|
42
|
+
I(() => t.onViewportChange?.(e));
|
|
43
|
+
}, Z = (e) => {
|
|
42
44
|
if (typeof window > "u") {
|
|
43
|
-
|
|
45
|
+
v(e);
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
w(), d = window.setTimeout(() => {
|
|
49
|
+
d = void 0, v(e);
|
|
48
50
|
}, 90);
|
|
49
|
-
},
|
|
51
|
+
}, h = (e) => ee({
|
|
50
52
|
target: e,
|
|
51
|
-
interactiveSelector:
|
|
53
|
+
interactiveSelector: M(),
|
|
52
54
|
panSurfaceSelector: X()
|
|
53
|
-
}),
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
55
|
+
}), p = (e) => {
|
|
56
|
+
const n = m();
|
|
57
|
+
if (!n || e !== void 0 && n.pointerId !== e) return;
|
|
58
|
+
n.stopInteraction?.();
|
|
59
|
+
const r = a();
|
|
60
|
+
S(null), i && i.hasPointerCapture(n.pointerId) && i.releasePointerCapture(n.pointerId), n.startedFromPanSurface && n.moved && (f = !0, N()), v(r);
|
|
59
61
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}),
|
|
62
|
+
L(() => {
|
|
63
|
+
m() || u(b(t.viewport));
|
|
64
|
+
}), L(() => {
|
|
63
65
|
const e = i;
|
|
64
66
|
if (!e) return;
|
|
65
|
-
const
|
|
66
|
-
!
|
|
67
|
+
const n = (r) => {
|
|
68
|
+
!f || h(r.target) !== "pan_surface" || (C(), r.preventDefault(), r.stopPropagation());
|
|
67
69
|
};
|
|
68
|
-
e.addEventListener("click",
|
|
70
|
+
e.addEventListener("click", n, !0), e.addEventListener("wheel", P, {
|
|
69
71
|
passive: !1
|
|
70
72
|
}), A(() => {
|
|
71
|
-
e.removeEventListener("click",
|
|
73
|
+
e.removeEventListener("click", n, !0), e.removeEventListener("wheel", P);
|
|
72
74
|
});
|
|
73
75
|
}), A(() => {
|
|
74
|
-
|
|
76
|
+
w(), p(), C();
|
|
75
77
|
});
|
|
76
|
-
const
|
|
77
|
-
if (e.button !== 0
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const H = (e) => {
|
|
79
|
+
if (e.button !== 0) return;
|
|
80
|
+
const n = h(e.target);
|
|
81
|
+
if (n === "canvas" && t.onCanvasPointerDown?.(e), t.disablePanZoom) return;
|
|
82
|
+
const r = n === "pan_surface";
|
|
83
|
+
n !== "local_surface" && (w(), C(), r || (t.onViewportInteractionStart?.("pan"), e.preventDefault(), i?.setPointerCapture(e.pointerId)), S({
|
|
80
84
|
pointerId: e.pointerId,
|
|
81
85
|
startClientX: e.clientX,
|
|
82
86
|
startClientY: e.clientY,
|
|
83
87
|
startViewport: a(),
|
|
84
88
|
moved: !1,
|
|
85
|
-
startedFromPanSurface:
|
|
86
|
-
stopInteraction:
|
|
89
|
+
startedFromPanSurface: r,
|
|
90
|
+
stopInteraction: r ? void 0 : x({
|
|
87
91
|
kind: "drag",
|
|
88
92
|
cursor: "grabbing"
|
|
89
93
|
})
|
|
90
94
|
}));
|
|
91
95
|
}, W = (e) => {
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
94
|
-
const
|
|
95
|
-
if (!(
|
|
96
|
-
|
|
96
|
+
const n = m();
|
|
97
|
+
if (!n || n.pointerId !== e.pointerId) return;
|
|
98
|
+
const r = e.clientX - n.startClientX, o = e.clientY - n.startClientY;
|
|
99
|
+
if (!(n.moved || Math.abs(r) > R || Math.abs(o) > R)) return;
|
|
100
|
+
n.moved || (e.preventDefault(), i?.hasPointerCapture(e.pointerId) || i?.setPointerCapture(e.pointerId));
|
|
97
101
|
const s = {
|
|
98
|
-
...
|
|
99
|
-
x:
|
|
100
|
-
y:
|
|
102
|
+
...n.startViewport,
|
|
103
|
+
x: n.startViewport.x + r,
|
|
104
|
+
y: n.startViewport.y + o
|
|
101
105
|
};
|
|
102
|
-
|
|
103
|
-
...
|
|
106
|
+
n.moved || S({
|
|
107
|
+
...n,
|
|
104
108
|
moved: !0,
|
|
105
|
-
stopInteraction:
|
|
109
|
+
stopInteraction: n.stopInteraction ?? x({
|
|
106
110
|
kind: "drag",
|
|
107
111
|
cursor: "grabbing"
|
|
108
112
|
})
|
|
109
|
-
}),
|
|
113
|
+
}), u(s);
|
|
110
114
|
}, O = (e) => {
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
|
|
115
|
+
p(e.pointerId);
|
|
116
|
+
}, $ = (e) => {
|
|
117
|
+
p(e.pointerId);
|
|
114
118
|
}, P = (e) => {
|
|
115
|
-
const
|
|
116
|
-
if (!
|
|
119
|
+
const n = i?.getBoundingClientRect();
|
|
120
|
+
if (!n || te({
|
|
117
121
|
target: e.target,
|
|
118
|
-
disablePanZoom: !!
|
|
122
|
+
disablePanZoom: !!t.disablePanZoom,
|
|
119
123
|
wheelInteractiveSelector: F()
|
|
120
124
|
}).kind !== "canvas_zoom") return;
|
|
125
|
+
e.preventDefault(), t.onViewportInteractionStart?.("wheel");
|
|
126
|
+
const o = a(), c = Y(n, {
|
|
127
|
+
clientX: e.clientX,
|
|
128
|
+
clientY: e.clientY
|
|
129
|
+
}), s = me(e, i), g = fe(o.scale * Math.exp(-s * k()), V(), y());
|
|
130
|
+
if (Math.abs(g - o.scale) < 1e-4) return;
|
|
131
|
+
const E = oe({
|
|
132
|
+
viewport: o,
|
|
133
|
+
localPoint: c,
|
|
134
|
+
nextScale: g
|
|
135
|
+
});
|
|
136
|
+
u(E), Z(E);
|
|
137
|
+
}, z = (e) => {
|
|
138
|
+
if (h(e.target) !== "canvas") return;
|
|
139
|
+
const n = i?.getBoundingClientRect();
|
|
140
|
+
if (!n) return;
|
|
121
141
|
e.preventDefault();
|
|
122
|
-
const r =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
scale: u
|
|
128
|
-
};
|
|
129
|
-
d(I), H(I);
|
|
130
|
-
}, B = (e) => {
|
|
131
|
-
if (g(e.target) !== "canvas") return;
|
|
132
|
-
const t = i?.getBoundingClientRect();
|
|
133
|
-
if (!t) return;
|
|
134
|
-
e.preventDefault();
|
|
135
|
-
const o = e.clientX - t.left, r = e.clientY - t.top, c = a();
|
|
136
|
-
n.onCanvasContextMenu?.({
|
|
142
|
+
const r = Y(n, {
|
|
143
|
+
clientX: e.clientX,
|
|
144
|
+
clientY: e.clientY
|
|
145
|
+
}), o = a(), c = re(o, r);
|
|
146
|
+
t.onCanvasContextMenu?.({
|
|
137
147
|
clientX: e.clientX,
|
|
138
148
|
clientY: e.clientY,
|
|
139
|
-
localX:
|
|
140
|
-
localY: r,
|
|
141
|
-
worldX:
|
|
142
|
-
worldY:
|
|
149
|
+
localX: r.localX,
|
|
150
|
+
localY: r.localY,
|
|
151
|
+
worldX: c.worldX,
|
|
152
|
+
worldY: c.worldY
|
|
143
153
|
});
|
|
144
154
|
};
|
|
145
155
|
return (() => {
|
|
146
|
-
var e =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
var e = ie(), n = e.firstChild, r = i;
|
|
157
|
+
return typeof r == "function" ? Q(r, e) : i = e, B(e, j({
|
|
158
|
+
get class() {
|
|
159
|
+
return D("floe-infinite-canvas", U() && "is-panning", t.disablePanZoom && "is-locked", t.class);
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
[ae]: "true"
|
|
163
|
+
}, {
|
|
164
|
+
onPointerDown: H,
|
|
165
|
+
onPointerMove: W,
|
|
166
|
+
onPointerUp: O,
|
|
167
|
+
onPointerCancel: $,
|
|
168
|
+
onContextMenu: z,
|
|
169
|
+
get "aria-label"() {
|
|
170
|
+
return t.ariaLabel ?? "Infinite canvas";
|
|
171
|
+
}
|
|
172
|
+
}), !1, !0), T(n, () => t.children), T(e, () => t.overlay?.(a()), null), q((o) => {
|
|
173
|
+
var c = D("floe-infinite-canvas__viewport", t.contentClass), s = `translate(${a().x}px, ${a().y}px) scale(${a().scale})`;
|
|
174
|
+
return c !== o.e && G(n, o.e = c), s !== o.t && J(n, "transform", o.t = s), o;
|
|
152
175
|
}, {
|
|
153
176
|
e: void 0,
|
|
154
|
-
t: void 0
|
|
155
|
-
a: void 0,
|
|
156
|
-
o: void 0
|
|
177
|
+
t: void 0
|
|
157
178
|
}), e;
|
|
158
179
|
})();
|
|
159
180
|
}
|
|
160
|
-
te(["pointerdown", "pointermove", "pointerup", "contextmenu"]);
|
|
161
181
|
export {
|
|
162
|
-
|
|
182
|
+
ge as InfiniteCanvas
|
|
163
183
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface CanvasViewportLike {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
scale: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CanvasClientPoint {
|
|
7
|
+
clientX: number;
|
|
8
|
+
clientY: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CanvasLocalPoint {
|
|
11
|
+
localX: number;
|
|
12
|
+
localY: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CanvasWorldPoint {
|
|
15
|
+
worldX: number;
|
|
16
|
+
worldY: number;
|
|
17
|
+
}
|
|
18
|
+
export interface CanvasViewportRectLike {
|
|
19
|
+
left: number;
|
|
20
|
+
top: number;
|
|
21
|
+
right: number;
|
|
22
|
+
bottom: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function isPointInsideCanvasRect(rect: CanvasViewportRectLike, point: CanvasClientPoint): boolean;
|
|
25
|
+
export declare function clientToCanvasLocal(rect: Pick<CanvasViewportRectLike, 'left' | 'top'>, point: CanvasClientPoint): CanvasLocalPoint;
|
|
26
|
+
export declare function localToCanvasWorld(viewport: CanvasViewportLike, point: CanvasLocalPoint): CanvasWorldPoint;
|
|
27
|
+
export declare function clientToCanvasWorld(rect: CanvasViewportRectLike, viewport: CanvasViewportLike, point: CanvasClientPoint): CanvasWorldPoint | null;
|
|
28
|
+
export declare function createViewportFromZoomAnchor(options: {
|
|
29
|
+
viewport: CanvasViewportLike;
|
|
30
|
+
localPoint: CanvasLocalPoint;
|
|
31
|
+
nextScale: number;
|
|
32
|
+
}): CanvasViewportLike;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function e(l, c) {
|
|
2
|
+
return c.clientX >= l.left && c.clientX <= l.right && c.clientY >= l.top && c.clientY <= l.bottom;
|
|
3
|
+
}
|
|
4
|
+
function o(l, c) {
|
|
5
|
+
return {
|
|
6
|
+
localX: c.clientX - l.left,
|
|
7
|
+
localY: c.clientY - l.top
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function a(l, c) {
|
|
11
|
+
return {
|
|
12
|
+
worldX: (c.localX - l.x) / l.scale,
|
|
13
|
+
worldY: (c.localY - l.y) / l.scale
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function t(l, c, n) {
|
|
17
|
+
return e(l, n) ? a(c, o(l, n)) : null;
|
|
18
|
+
}
|
|
19
|
+
function r(l) {
|
|
20
|
+
const c = a(l.viewport, l.localPoint);
|
|
21
|
+
return {
|
|
22
|
+
x: l.localPoint.localX - c.worldX * l.nextScale,
|
|
23
|
+
y: l.localPoint.localY - c.worldY * l.nextScale,
|
|
24
|
+
scale: l.nextScale
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
o as clientToCanvasLocal,
|
|
29
|
+
t as clientToCanvasWorld,
|
|
30
|
+
r as createViewportFromZoomAnchor,
|
|
31
|
+
e as isPointInsideCanvasRect,
|
|
32
|
+
a as localToCanvasWorld
|
|
33
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { SurfacePortalRect } from './surfacePortalTypes';
|
|
1
2
|
export declare const DIALOG_SURFACE_HOST_ATTR = "data-floe-dialog-surface-host";
|
|
2
3
|
export declare const SURFACE_PORTAL_HOST_ATTR = "data-floe-dialog-surface-host";
|
|
4
|
+
export declare const SURFACE_PORTAL_LAYER_ATTR = "data-floe-surface-portal-layer";
|
|
3
5
|
export declare const DIALOG_SURFACE_BOUNDARY_ATTR = "data-floe-dialog-surface-boundary";
|
|
4
6
|
export type DialogSurfaceInteractionSnapshot = Readonly<{
|
|
5
7
|
target: Element | null;
|
|
@@ -10,17 +12,13 @@ export type SurfacePortalInteractionSnapshot = DialogSurfaceInteractionSnapshot;
|
|
|
10
12
|
export type SurfacePortalMode = 'global' | 'surface';
|
|
11
13
|
export type ResolvedDialogSurfaceHost = Readonly<{
|
|
12
14
|
host: HTMLElement | null;
|
|
15
|
+
boundaryHost: HTMLElement | null;
|
|
16
|
+
mountHost: HTMLElement | null;
|
|
13
17
|
mode: SurfacePortalMode;
|
|
14
18
|
}>;
|
|
15
19
|
export type ResolvedSurfacePortalHost = ResolvedDialogSurfaceHost;
|
|
16
|
-
export type SurfacePortalBoundaryRect =
|
|
17
|
-
|
|
18
|
-
top: number;
|
|
19
|
-
right: number;
|
|
20
|
-
bottom: number;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
}>;
|
|
20
|
+
export type SurfacePortalBoundaryRect = SurfacePortalRect;
|
|
21
|
+
export type { SurfacePortalRect };
|
|
24
22
|
export declare function ensureDialogSurfaceInteractionTracking(): void;
|
|
25
23
|
export declare function ensureSurfacePortalInteractionTracking(): void;
|
|
26
24
|
export declare function resolveDialogSurfaceHost(): ResolvedDialogSurfaceHost;
|
|
@@ -28,6 +26,7 @@ export declare function resolveSurfacePortalHost(): ResolvedSurfacePortalHost;
|
|
|
28
26
|
export declare function isSurfacePortalMode(surfaceHost: ResolvedSurfacePortalHost): boolean;
|
|
29
27
|
export declare function resolveSurfacePortalMount(surfaceHost: ResolvedSurfacePortalHost): HTMLElement | undefined;
|
|
30
28
|
export declare function resolveSurfacePortalBoundaryRect(surfaceHost: ResolvedSurfacePortalHost): SurfacePortalBoundaryRect;
|
|
29
|
+
export declare function resolveSurfacePortalMountRect(surfaceHost: ResolvedSurfacePortalHost): SurfacePortalBoundaryRect;
|
|
31
30
|
export declare function projectSurfacePortalPosition(position: Readonly<{
|
|
32
31
|
x: number;
|
|
33
32
|
y: number;
|
|
@@ -35,5 +34,6 @@ export declare function projectSurfacePortalPosition(position: Readonly<{
|
|
|
35
34
|
x: number;
|
|
36
35
|
y: number;
|
|
37
36
|
}>;
|
|
37
|
+
export declare function projectSurfacePortalRect(rect: SurfacePortalBoundaryRect, surfaceHost: ResolvedSurfacePortalHost): SurfacePortalBoundaryRect;
|
|
38
38
|
export declare function __resetDialogSurfaceScopeForTests(): void;
|
|
39
39
|
export declare function __resetSurfacePortalScopeForTests(): void;
|
|
@@ -1,51 +1,62 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
function
|
|
4
|
-
return typeof Element < "u" &&
|
|
5
|
-
}
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return
|
|
9
|
-
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
target:
|
|
14
|
-
activeElement:
|
|
1
|
+
const f = "data-floe-dialog-surface-host", y = f, m = "data-floe-surface-portal-layer", A = "data-floe-dialog-surface-boundary", p = 1600;
|
|
2
|
+
let r = null, o = null;
|
|
3
|
+
function g(t) {
|
|
4
|
+
return typeof Element < "u" && t instanceof Element ? t : typeof Node < "u" && t instanceof Node ? t.parentElement : null;
|
|
5
|
+
}
|
|
6
|
+
function E(t) {
|
|
7
|
+
const e = t?.activeElement;
|
|
8
|
+
return e instanceof Element ? e : null;
|
|
9
|
+
}
|
|
10
|
+
function d(t) {
|
|
11
|
+
const e = typeof document < "u" ? document : null;
|
|
12
|
+
r = {
|
|
13
|
+
target: g(t),
|
|
14
|
+
activeElement: E(e),
|
|
15
15
|
recordedAt: Date.now()
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
18
|
+
function i(t) {
|
|
19
|
+
d(t.target);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function l(t) {
|
|
22
|
+
d(t.target);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function a() {
|
|
25
|
+
T();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
typeof document > "u" ||
|
|
27
|
+
function T() {
|
|
28
|
+
typeof document > "u" || o !== document && (o && (o.removeEventListener("pointerdown", i, !0), o.removeEventListener("focusin", l, !0)), document.addEventListener("pointerdown", i, !0), document.addEventListener("focusin", l, !0), o = document);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return !
|
|
30
|
+
function w() {
|
|
31
|
+
return !r || Date.now() - r.recordedAt > p ? null : r;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return typeof HTMLElement > "u" ? null :
|
|
33
|
+
function c(t) {
|
|
34
|
+
const e = t?.closest(`[${f}="true"]`);
|
|
35
|
+
return typeof HTMLElement > "u" ? null : e instanceof HTMLElement && e.isConnected ? e : null;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
const e =
|
|
40
|
-
return
|
|
37
|
+
function R(t) {
|
|
38
|
+
if (!t) return null;
|
|
39
|
+
const e = t.closest(`[${m}="true"]`);
|
|
40
|
+
return typeof HTMLElement > "u" ? null : e instanceof HTMLElement && e.isConnected ? e : null;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
42
|
+
function v() {
|
|
43
|
+
a();
|
|
44
|
+
const t = w(), e = c(t?.target ?? null) ?? c(t?.activeElement ?? null);
|
|
45
|
+
return e ? {
|
|
46
|
+
host: e,
|
|
47
|
+
boundaryHost: e,
|
|
48
|
+
mountHost: R(e) ?? e,
|
|
49
|
+
mode: "surface"
|
|
50
|
+
} : { host: null, boundaryHost: null, mountHost: null, mode: "global" };
|
|
44
51
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
52
|
+
function u(t) {
|
|
53
|
+
return t.mode === "surface" && !!t.boundaryHost?.isConnected;
|
|
47
54
|
}
|
|
48
|
-
function
|
|
55
|
+
function S(t) {
|
|
56
|
+
if (u(t))
|
|
57
|
+
return t.mountHost ?? t.boundaryHost ?? void 0;
|
|
58
|
+
}
|
|
59
|
+
function s() {
|
|
49
60
|
return typeof window > "u" ? {
|
|
50
61
|
left: 0,
|
|
51
62
|
top: 0,
|
|
@@ -62,37 +73,72 @@ function p() {
|
|
|
62
73
|
height: window.innerHeight
|
|
63
74
|
};
|
|
64
75
|
}
|
|
65
|
-
function
|
|
66
|
-
if (!
|
|
67
|
-
return
|
|
68
|
-
const
|
|
76
|
+
function _(t) {
|
|
77
|
+
if (!u(t) || !t.boundaryHost)
|
|
78
|
+
return s();
|
|
79
|
+
const e = t.boundaryHost.getBoundingClientRect();
|
|
69
80
|
return {
|
|
70
|
-
left:
|
|
71
|
-
top:
|
|
72
|
-
right:
|
|
73
|
-
bottom:
|
|
74
|
-
width:
|
|
75
|
-
height:
|
|
81
|
+
left: e.left,
|
|
82
|
+
top: e.top,
|
|
83
|
+
right: e.right,
|
|
84
|
+
bottom: e.bottom,
|
|
85
|
+
width: e.width,
|
|
86
|
+
height: e.height
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function h(t) {
|
|
90
|
+
const e = S(t);
|
|
91
|
+
if (!e)
|
|
92
|
+
return s();
|
|
93
|
+
const n = e.getBoundingClientRect();
|
|
94
|
+
return {
|
|
95
|
+
left: n.left,
|
|
96
|
+
top: n.top,
|
|
97
|
+
right: n.right,
|
|
98
|
+
bottom: n.bottom,
|
|
99
|
+
width: n.width,
|
|
100
|
+
height: n.height
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function b(t, e) {
|
|
104
|
+
if (!u(e))
|
|
105
|
+
return t;
|
|
106
|
+
const n = h(e);
|
|
107
|
+
return {
|
|
108
|
+
x: t.x - n.left,
|
|
109
|
+
y: t.y - n.top
|
|
76
110
|
};
|
|
77
111
|
}
|
|
78
|
-
function
|
|
79
|
-
if (!
|
|
80
|
-
return
|
|
81
|
-
const
|
|
112
|
+
function L(t, e) {
|
|
113
|
+
if (!u(e))
|
|
114
|
+
return t;
|
|
115
|
+
const n = h(e);
|
|
82
116
|
return {
|
|
83
|
-
|
|
84
|
-
|
|
117
|
+
left: t.left - n.left,
|
|
118
|
+
top: t.top - n.top,
|
|
119
|
+
right: t.right - n.left,
|
|
120
|
+
bottom: t.bottom - n.top,
|
|
121
|
+
width: t.width,
|
|
122
|
+
height: t.height
|
|
85
123
|
};
|
|
86
124
|
}
|
|
87
|
-
|
|
125
|
+
function P() {
|
|
126
|
+
r = null;
|
|
127
|
+
}
|
|
128
|
+
typeof document < "u" && a();
|
|
88
129
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
m as
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
130
|
+
A as DIALOG_SURFACE_BOUNDARY_ATTR,
|
|
131
|
+
f as DIALOG_SURFACE_HOST_ATTR,
|
|
132
|
+
y as SURFACE_PORTAL_HOST_ATTR,
|
|
133
|
+
m as SURFACE_PORTAL_LAYER_ATTR,
|
|
134
|
+
P as __resetSurfacePortalScopeForTests,
|
|
135
|
+
a as ensureDialogSurfaceInteractionTracking,
|
|
136
|
+
T as ensureSurfacePortalInteractionTracking,
|
|
137
|
+
u as isSurfacePortalMode,
|
|
138
|
+
b as projectSurfacePortalPosition,
|
|
139
|
+
L as projectSurfacePortalRect,
|
|
140
|
+
_ as resolveSurfacePortalBoundaryRect,
|
|
141
|
+
v as resolveSurfacePortalHost,
|
|
142
|
+
S as resolveSurfacePortalMount,
|
|
143
|
+
h as resolveSurfacePortalMountRect
|
|
98
144
|
};
|
|
@@ -7,7 +7,9 @@ export { Dropdown, Select, type DropdownProps, type DropdownItem, type SelectPro
|
|
|
7
7
|
export { Tooltip, type TooltipProps } from './Tooltip';
|
|
8
8
|
export { CommandPalette } from './CommandPalette';
|
|
9
9
|
export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
|
|
10
|
+
export { clientToCanvasLocal, clientToCanvasWorld, createViewportFromZoomAnchor, isPointInsideCanvasRect, localToCanvasWorld, type CanvasClientPoint, type CanvasLocalPoint, type CanvasViewportLike, type CanvasViewportRectLike, type CanvasWorldPoint, } from './canvasGeometry';
|
|
10
11
|
export { CANVAS_WHEEL_INTERACTIVE_ATTR, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR, LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveSurfaceWheelRouting, resolveWorkbenchWidgetEventOwnership, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type SurfaceWheelLocalReason, type SurfaceWheelRoutingDecision, type SurfaceWheelRoutingOptions, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, } from './localInteractionSurface';
|
|
12
|
+
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';
|
|
11
13
|
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';
|
|
12
14
|
export { Tabs, TabPanel, type TabsProps, type TabPanelProps, type TabItem, type TabsFeatures, type TabsSlotClassNames, type TabsIndicatorMode, type TabsIndicatorColorToken, } from './Tabs';
|
|
13
15
|
export { DirectoryPicker, type DirectoryPickerProps } from './DirectoryPicker';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SURFACE_PORTAL_HOST_ATTR, ensureSurfacePortalInteractionTracking, resolveSurfacePortalHost, isSurfacePortalMode, resolveSurfacePortalMount, resolveSurfacePortalBoundaryRect, projectSurfacePortalPosition, __resetSurfacePortalScopeForTests, type SurfacePortalInteractionSnapshot, type SurfacePortalMode, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, } 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 SurfacePortalMode, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalRect, } from './dialogSurfaceScope';
|
|
@@ -14,7 +14,9 @@ export interface WorkbenchCanvasProps {
|
|
|
14
14
|
filters: Record<WorkbenchWidgetType, boolean>;
|
|
15
15
|
setCanvasFrameRef: (el: HTMLDivElement | undefined) => void;
|
|
16
16
|
onViewportCommit: (viewport: WorkbenchViewport) => void;
|
|
17
|
+
onViewportInteractionStart?: (kind: 'wheel' | 'pan') => void;
|
|
17
18
|
onCanvasContextMenu: (event: InfiniteCanvasContextMenuEvent) => void;
|
|
19
|
+
onCanvasPointerDown?: (event: PointerEvent) => void;
|
|
18
20
|
onSelectWidget: (widgetId: string) => void;
|
|
19
21
|
onWidgetContextMenu: (event: MouseEvent, item: WorkbenchWidgetItem) => void;
|
|
20
22
|
onStartOptimisticFront: (widgetId: string) => void;
|
|
@@ -27,6 +29,8 @@ export interface WorkbenchCanvasProps {
|
|
|
27
29
|
width: number;
|
|
28
30
|
height: number;
|
|
29
31
|
}) => void;
|
|
32
|
+
onRequestOverview: (item: WorkbenchWidgetItem) => void;
|
|
33
|
+
onRequestFit: (item: WorkbenchWidgetItem) => void;
|
|
30
34
|
onRequestDelete: (widgetId: string) => void;
|
|
31
35
|
}
|
|
32
36
|
export declare function WorkbenchCanvas(props: WorkbenchCanvasProps): import("solid-js").JSX.Element;
|