@floegence/floe-webapp-core 0.53.4 → 0.54.0
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/InfiniteCanvas.js +111 -100
- package/dist/components/ui/SurfaceAnchoredLayer.d.ts +10 -0
- package/dist/components/ui/SurfaceAnchoredLayer.js +89 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/workbench/WorkbenchCanvas.d.ts +1 -1
- package/dist/components/workbench/WorkbenchCanvas.js +26 -24
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +1 -1
- package/dist/components/workbench/WorkbenchCanvasField.js +46 -42
- package/dist/components/workbench/WorkbenchLayerObjects.d.ts +9 -1
- package/dist/components/workbench/WorkbenchLayerObjects.js +896 -707
- package/dist/components/workbench/WorkbenchSurface.d.ts +2 -0
- package/dist/components/workbench/WorkbenchSurface.js +442 -420
- package/dist/components/workbench/index.d.ts +1 -0
- package/dist/components/workbench/types.d.ts +6 -3
- package/dist/components/workbench/useWorkbenchModel.js +53 -53
- package/dist/components/workbench/workbenchCompositionMessages.d.ts +62 -0
- package/dist/components/workbench/workbenchCompositionMessages.js +67 -0
- package/dist/components/workbench/workbenchHelpers.js +19 -6
- package/dist/components/workbench/workbenchOptions.d.ts +4 -4
- package/dist/components/workbench/workbenchOptions.js +18 -16
- package/dist/full.js +182 -180
- package/dist/input-focus.css +39 -5
- package/dist/styles.css +1 -1
- package/dist/ui.js +86 -84
- package/dist/workbench-themes.css +60 -0
- package/dist/workbench.css +332 -524
- package/dist/workbench.js +24 -22
- package/package.json +1 -1
|
@@ -1,185 +1,196 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { startHotInteraction as
|
|
5
|
-
import { resolveSurfaceInteractionTargetRole as
|
|
6
|
-
import { startPointerSession as
|
|
7
|
-
import { clientToCanvasLocal as
|
|
8
|
-
import { SURFACE_PORTAL_LAYER_ATTR as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
return Math.max(
|
|
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 b, untrack as x, createEffect as A, onCleanup as D } from "solid-js";
|
|
3
|
+
import { cn as I } from "../../utils/cn.js";
|
|
4
|
+
import { startHotInteraction as y } from "../../utils/hotInteraction.js";
|
|
5
|
+
import { resolveSurfaceInteractionTargetRole as ee, resolveSurfaceWheelRouting as te, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR as ne } from "./localInteractionSurface.js";
|
|
6
|
+
import { startPointerSession as re } from "./pointerSession.js";
|
|
7
|
+
import { clientToCanvasLocal as R, localToCanvasWorld as oe, createViewportFromZoomAnchor as ae } from "./canvasGeometry.js";
|
|
8
|
+
import { SURFACE_PORTAL_LAYER_ATTR as ie } from "./dialogSurfaceScope.js";
|
|
9
|
+
var ce = /* @__PURE__ */ K('<div><div style="transform-origin:0 0">');
|
|
10
|
+
const le = 1, se = 0.45, ue = 2.2, de = 14e-4, fe = '[data-floe-canvas-pan-surface="true"]', Y = 3;
|
|
11
|
+
function me(t, s, c) {
|
|
12
|
+
return Math.max(s, Math.min(c, t));
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function k(t) {
|
|
15
15
|
return {
|
|
16
16
|
x: Number.isFinite(t.x) ? t.x : 0,
|
|
17
17
|
y: Number.isFinite(t.y) ? t.y : 0,
|
|
18
|
-
scale: Number.isFinite(t.scale) && t.scale > 0 ? t.scale :
|
|
18
|
+
scale: Number.isFinite(t.scale) && t.scale > 0 ? t.scale : le
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return t.deltaMode === 1 ? t.deltaY * 16 : t.deltaMode === 2 ? t.deltaY * (
|
|
21
|
+
function we(t, s) {
|
|
22
|
+
return t.deltaMode === 1 ? t.deltaY * 16 : t.deltaMode === 2 ? t.deltaY * (s?.clientHeight ?? window.innerHeight) : t.deltaY;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
function Le(t) {
|
|
25
|
+
let s = !1;
|
|
26
|
+
const [c, S] = b(x(() => k(t.viewport))), [w, v] = b(null);
|
|
27
|
+
let l, d, f, m = !1, u;
|
|
28
|
+
const M = () => t.interactiveSelector ?? '[data-floe-canvas-interactive="true"]', X = () => t.panSurfaceSelector ?? fe, F = () => t.wheelInteractiveSelector ?? ne, V = () => t.minScale ?? se, N = () => t.maxScale ?? ue, H = () => t.wheelZoomSpeed ?? de, U = () => {
|
|
29
|
+
const e = w();
|
|
29
30
|
return e ? e.startedFromPanSurface ? e.moved : !0 : !1;
|
|
30
|
-
},
|
|
31
|
-
|
|
31
|
+
}, p = () => {
|
|
32
|
+
f !== void 0 && (window.clearTimeout(f), f = void 0);
|
|
32
33
|
}, g = () => {
|
|
33
|
-
m = !1,
|
|
34
|
-
},
|
|
34
|
+
m = !1, u !== void 0 && (window.clearTimeout(u), u = void 0);
|
|
35
|
+
}, W = () => {
|
|
35
36
|
if (typeof window > "u") {
|
|
36
37
|
m = !1;
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
u !== void 0 && window.clearTimeout(u), u = window.setTimeout(() => {
|
|
41
|
+
u = void 0, m = !1;
|
|
41
42
|
}, 0);
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
43
|
+
}, E = (e) => {
|
|
44
|
+
x(() => t.onViewportChange?.(e));
|
|
45
|
+
}, Z = (e) => {
|
|
45
46
|
if (typeof window > "u") {
|
|
46
|
-
|
|
47
|
+
E(e);
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
p(), f = window.setTimeout(() => {
|
|
51
|
+
f = void 0, E(e);
|
|
51
52
|
}, 90);
|
|
52
|
-
},
|
|
53
|
+
}, C = (e) => (t.resolveTargetRole ?? ee)({
|
|
53
54
|
target: e,
|
|
54
55
|
interactiveSelector: M(),
|
|
55
56
|
panSurfaceSelector: X()
|
|
56
|
-
}),
|
|
57
|
-
const e =
|
|
57
|
+
}), O = () => {
|
|
58
|
+
const e = w();
|
|
58
59
|
if (!e) return;
|
|
59
60
|
e.stopInteraction?.();
|
|
60
|
-
const n =
|
|
61
|
-
v(null),
|
|
61
|
+
const n = c();
|
|
62
|
+
v(null), d = void 0, e.startedFromPanSurface && e.moved && (m = !0, W()), E(n);
|
|
62
63
|
};
|
|
63
64
|
A(() => {
|
|
64
|
-
|
|
65
|
+
w() || S(k(t.viewport));
|
|
65
66
|
}), A(() => {
|
|
66
|
-
const e =
|
|
67
|
+
const e = l;
|
|
67
68
|
if (!e) return;
|
|
68
|
-
const n = (
|
|
69
|
-
!m ||
|
|
69
|
+
const n = (o) => {
|
|
70
|
+
!m || C(o.target) !== "pan_surface" || (g(), o.preventDefault(), o.stopPropagation());
|
|
71
|
+
}, a = (o) => {
|
|
72
|
+
o.code !== "Space" || o.isComposing || o.target instanceof Element && o.target.closest('input, textarea, select, [contenteditable="true"], [contenteditable="plaintext-only"]') || (s = !0, e.contains(o.target) && o.preventDefault());
|
|
73
|
+
}, r = () => {
|
|
74
|
+
s = !1;
|
|
75
|
+
};
|
|
76
|
+
document.addEventListener("keydown", a), document.addEventListener("keyup", r), window.addEventListener("blur", r);
|
|
77
|
+
const i = (o) => {
|
|
78
|
+
(o.button === 1 || o.button === 0 && s) && h(o);
|
|
70
79
|
};
|
|
71
|
-
e.addEventListener("click", n, !0), e.addEventListener("wheel",
|
|
80
|
+
e.addEventListener("pointerdown", i, !0), e.addEventListener("click", n, !0), e.addEventListener("wheel", P, {
|
|
72
81
|
passive: !1
|
|
73
|
-
}),
|
|
74
|
-
e.removeEventListener("click", n, !0), e.removeEventListener("wheel",
|
|
82
|
+
}), D(() => {
|
|
83
|
+
document.removeEventListener("keydown", a), document.removeEventListener("keyup", r), window.removeEventListener("blur", r), e.removeEventListener("pointerdown", i, !0), e.removeEventListener("click", n, !0), e.removeEventListener("wheel", P);
|
|
75
84
|
});
|
|
76
|
-
}),
|
|
77
|
-
|
|
85
|
+
}), D(() => {
|
|
86
|
+
p(), d?.stop({
|
|
78
87
|
reason: "manual_stop",
|
|
79
88
|
commit: !0
|
|
80
|
-
}),
|
|
89
|
+
}), d = void 0, g();
|
|
81
90
|
});
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
n
|
|
91
|
+
const h = (e) => {
|
|
92
|
+
const n = e.button === 1 || e.button === 0 && s;
|
|
93
|
+
if (e.button !== 0 && e.button !== 1) return;
|
|
94
|
+
const a = n ? "canvas" : C(e.target);
|
|
95
|
+
if (a === "canvas" && t.onCanvasPointerDown?.(e), t.disablePanZoom) return;
|
|
96
|
+
n && e.stopPropagation();
|
|
97
|
+
const r = a === "pan_surface";
|
|
98
|
+
a !== "local_surface" && (p(), g(), r || (t.onViewportInteractionStart?.("pan"), e.preventDefault()), d?.stop({
|
|
88
99
|
reason: "manual_stop",
|
|
89
100
|
commit: !0
|
|
90
101
|
}), v({
|
|
91
102
|
pointerId: e.pointerId,
|
|
92
103
|
startClientX: e.clientX,
|
|
93
104
|
startClientY: e.clientY,
|
|
94
|
-
startViewport:
|
|
105
|
+
startViewport: c(),
|
|
95
106
|
moved: !1,
|
|
96
107
|
startedFromPanSurface: r,
|
|
97
|
-
stopInteraction: r ? void 0 :
|
|
108
|
+
stopInteraction: r ? void 0 : y({
|
|
98
109
|
kind: "drag",
|
|
99
110
|
cursor: "grabbing"
|
|
100
111
|
})
|
|
101
|
-
}),
|
|
112
|
+
}), d = re({
|
|
102
113
|
pointerEvent: e,
|
|
103
|
-
captureEl:
|
|
114
|
+
captureEl: l ?? null,
|
|
104
115
|
capturePointer: !r,
|
|
105
|
-
onMove:
|
|
116
|
+
onMove: $,
|
|
106
117
|
onEnd: () => {
|
|
107
|
-
|
|
118
|
+
O();
|
|
108
119
|
}
|
|
109
120
|
}));
|
|
110
|
-
},
|
|
111
|
-
const n =
|
|
121
|
+
}, $ = (e) => {
|
|
122
|
+
const n = w();
|
|
112
123
|
if (!n || n.pointerId !== e.pointerId) return;
|
|
113
|
-
const
|
|
114
|
-
if (!(n.moved || Math.abs(
|
|
115
|
-
n.moved || (e.preventDefault(), (!
|
|
116
|
-
const
|
|
124
|
+
const a = e.clientX - n.startClientX, r = e.clientY - n.startClientY;
|
|
125
|
+
if (!(n.moved || Math.abs(a) > Y || Math.abs(r) > Y)) return;
|
|
126
|
+
n.moved || (e.preventDefault(), (!l || typeof l.hasPointerCapture != "function" || !l.hasPointerCapture(e.pointerId)) && d?.capturePointer());
|
|
127
|
+
const o = {
|
|
117
128
|
...n.startViewport,
|
|
118
|
-
x: n.startViewport.x +
|
|
119
|
-
y: n.startViewport.y +
|
|
129
|
+
x: n.startViewport.x + a,
|
|
130
|
+
y: n.startViewport.y + r
|
|
120
131
|
};
|
|
121
132
|
n.moved || v({
|
|
122
133
|
...n,
|
|
123
134
|
moved: !0,
|
|
124
|
-
stopInteraction: n.stopInteraction ??
|
|
135
|
+
stopInteraction: n.stopInteraction ?? y({
|
|
125
136
|
kind: "drag",
|
|
126
137
|
cursor: "grabbing"
|
|
127
138
|
})
|
|
128
|
-
}),
|
|
129
|
-
},
|
|
130
|
-
const n =
|
|
131
|
-
if (!n || (t.resolveWheelRouting ??
|
|
139
|
+
}), S(o);
|
|
140
|
+
}, P = (e) => {
|
|
141
|
+
const n = l?.getBoundingClientRect();
|
|
142
|
+
if (!n || (t.resolveWheelRouting ?? te)({
|
|
132
143
|
target: e.target,
|
|
133
144
|
disablePanZoom: !!t.disablePanZoom,
|
|
134
145
|
wheelInteractiveSelector: F()
|
|
135
146
|
}).kind !== "canvas_zoom") return;
|
|
136
147
|
e.preventDefault(), t.onViewportInteractionStart?.("wheel");
|
|
137
|
-
const
|
|
148
|
+
const r = c(), i = R(n, {
|
|
138
149
|
clientX: e.clientX,
|
|
139
150
|
clientY: e.clientY
|
|
140
|
-
}),
|
|
141
|
-
if (Math.abs(
|
|
142
|
-
const
|
|
143
|
-
viewport:
|
|
144
|
-
localPoint:
|
|
145
|
-
nextScale:
|
|
151
|
+
}), o = we(e, l), L = me(r.scale * Math.exp(-o * H()), V(), N());
|
|
152
|
+
if (Math.abs(L - r.scale) < 1e-4) return;
|
|
153
|
+
const _ = ae({
|
|
154
|
+
viewport: r,
|
|
155
|
+
localPoint: i,
|
|
156
|
+
nextScale: L
|
|
146
157
|
});
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
if (
|
|
150
|
-
const n =
|
|
158
|
+
S(_), Z(_);
|
|
159
|
+
}, z = (e) => {
|
|
160
|
+
if (C(e.target) !== "canvas") return;
|
|
161
|
+
const n = l?.getBoundingClientRect();
|
|
151
162
|
if (!n) return;
|
|
152
163
|
e.preventDefault();
|
|
153
|
-
const
|
|
164
|
+
const a = R(n, {
|
|
154
165
|
clientX: e.clientX,
|
|
155
166
|
clientY: e.clientY
|
|
156
|
-
}),
|
|
167
|
+
}), r = c(), i = oe(r, a);
|
|
157
168
|
t.onCanvasContextMenu?.({
|
|
158
169
|
clientX: e.clientX,
|
|
159
170
|
clientY: e.clientY,
|
|
160
|
-
localX:
|
|
161
|
-
localY:
|
|
162
|
-
worldX:
|
|
163
|
-
worldY:
|
|
171
|
+
localX: a.localX,
|
|
172
|
+
localY: a.localY,
|
|
173
|
+
worldX: i.worldX,
|
|
174
|
+
worldY: i.worldY
|
|
164
175
|
});
|
|
165
176
|
};
|
|
166
177
|
return (() => {
|
|
167
|
-
var e =
|
|
168
|
-
return typeof
|
|
178
|
+
var e = ce(), n = e.firstChild, a = l;
|
|
179
|
+
return typeof a == "function" ? Q(a, e) : l = e, B(e, j({
|
|
169
180
|
get class() {
|
|
170
|
-
return
|
|
181
|
+
return I("floe-infinite-canvas", U() && "is-panning", t.disablePanZoom && "is-locked", t.class);
|
|
171
182
|
}
|
|
172
183
|
}, {
|
|
173
|
-
[
|
|
184
|
+
[ie]: "true"
|
|
174
185
|
}, {
|
|
175
|
-
onPointerDown:
|
|
176
|
-
onContextMenu:
|
|
186
|
+
onPointerDown: h,
|
|
187
|
+
onContextMenu: z,
|
|
177
188
|
get "aria-label"() {
|
|
178
189
|
return t.ariaLabel ?? "Infinite canvas";
|
|
179
190
|
}
|
|
180
|
-
}), !1, !0),
|
|
181
|
-
var
|
|
182
|
-
return
|
|
191
|
+
}), !1, !0), T(n, () => t.children), T(e, () => t.overlay?.(c), null), q((r) => {
|
|
192
|
+
var i = I("floe-infinite-canvas__viewport", t.contentClass), o = `translate(${c().x}px, ${c().y}px) scale(${c().scale})`;
|
|
193
|
+
return i !== r.e && G(n, r.e = i), o !== r.t && J(n, "transform", r.t = o), r;
|
|
183
194
|
}, {
|
|
184
195
|
e: void 0,
|
|
185
196
|
t: void 0
|
|
@@ -187,5 +198,5 @@ function Pe(t) {
|
|
|
187
198
|
})();
|
|
188
199
|
}
|
|
189
200
|
export {
|
|
190
|
-
|
|
201
|
+
Le as InfiniteCanvas
|
|
191
202
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export interface SurfaceAnchoredLayerProps {
|
|
3
|
+
anchor: HTMLElement | undefined;
|
|
4
|
+
/** Changes when the anchor moves through a transform; no idle polling is used. */
|
|
5
|
+
revision?: unknown;
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Object-attached tools remain in screen pixels within the owning surface. */
|
|
10
|
+
export declare function SurfaceAnchoredLayer(props: SurfaceAnchoredLayerProps): JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createComponent as u, memo as L } from "solid-js/web";
|
|
2
|
+
import { createSignal as c, createEffect as p, onMount as R, onCleanup as h, Show as S } from "solid-js";
|
|
3
|
+
import { SurfaceFloatingLayer as A } from "./SurfaceFloatingLayer.js";
|
|
4
|
+
import { resolveFloatingBoundary as C } from "./surfaceFloatingBoundary.js";
|
|
5
|
+
import { resolveSurfacePortalHost as f } from "./dialogSurfaceScope.js";
|
|
6
|
+
function W(n) {
|
|
7
|
+
const [v, b] = c(!1), [w, g] = c({
|
|
8
|
+
x: 0,
|
|
9
|
+
y: 0
|
|
10
|
+
}), [y, d] = c(!1), [x, M] = c(480);
|
|
11
|
+
let s, a;
|
|
12
|
+
const E = () => {
|
|
13
|
+
a = void 0;
|
|
14
|
+
const r = n.anchor;
|
|
15
|
+
if (!r || !s) return;
|
|
16
|
+
const e = C(f({
|
|
17
|
+
owner: r
|
|
18
|
+
}));
|
|
19
|
+
if (!e) {
|
|
20
|
+
d(!1);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const t = r.getBoundingClientRect(), i = Math.max(120, e.width - 24);
|
|
24
|
+
M(i);
|
|
25
|
+
const l = s.getBoundingClientRect(), z = Math.max(e.left + 12, Math.min(t.left, e.right - l.width - 12)), m = t.top - l.height - 12, F = m >= e.top + 12 ? m : Math.max(e.top + 12, Math.min(t.bottom + 12, e.bottom - l.height - 12));
|
|
26
|
+
g({
|
|
27
|
+
x: z,
|
|
28
|
+
y: F
|
|
29
|
+
}), d(t.right > e.left && t.left < e.right && t.bottom > e.top && t.top < e.bottom);
|
|
30
|
+
}, o = () => {
|
|
31
|
+
a === void 0 && typeof requestAnimationFrame == "function" && (a = requestAnimationFrame(E));
|
|
32
|
+
};
|
|
33
|
+
return p(() => {
|
|
34
|
+
n.anchor, n.revision, o();
|
|
35
|
+
}), R(() => {
|
|
36
|
+
b(!0);
|
|
37
|
+
const r = typeof ResizeObserver == "function" ? new ResizeObserver(o) : void 0;
|
|
38
|
+
s && r?.observe(s);
|
|
39
|
+
const e = f({
|
|
40
|
+
owner: n.anchor
|
|
41
|
+
}).boundaryHost;
|
|
42
|
+
e && r?.observe(e);
|
|
43
|
+
const t = new MutationObserver(o);
|
|
44
|
+
let i = n.anchor?.parentElement;
|
|
45
|
+
for (; i && (t.observe(i, {
|
|
46
|
+
attributes: !0,
|
|
47
|
+
attributeFilter: ["style"]
|
|
48
|
+
}), i !== e); )
|
|
49
|
+
i = i.parentElement;
|
|
50
|
+
window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), o(), h(() => {
|
|
51
|
+
r?.disconnect(), t.disconnect(), window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
|
|
52
|
+
});
|
|
53
|
+
}), h(() => {
|
|
54
|
+
a !== void 0 && cancelAnimationFrame(a);
|
|
55
|
+
}), u(S, {
|
|
56
|
+
get when() {
|
|
57
|
+
return L(() => !!v())() && n.anchor;
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
return u(A, {
|
|
61
|
+
get owner() {
|
|
62
|
+
return n.anchor;
|
|
63
|
+
},
|
|
64
|
+
get position() {
|
|
65
|
+
return w();
|
|
66
|
+
},
|
|
67
|
+
get class() {
|
|
68
|
+
return n.class;
|
|
69
|
+
},
|
|
70
|
+
get style() {
|
|
71
|
+
return {
|
|
72
|
+
visibility: y() ? "visible" : "hidden",
|
|
73
|
+
"max-width": `${x()}px`,
|
|
74
|
+
"z-index": 60
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
layerRef: (r) => {
|
|
78
|
+
s = r, o();
|
|
79
|
+
},
|
|
80
|
+
get children() {
|
|
81
|
+
return n.children;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
W as SurfaceAnchoredLayer
|
|
89
|
+
};
|
|
@@ -40,3 +40,4 @@ export { Checkbox, CheckboxGroup, CheckboxList, type CheckboxProps, type Checkbo
|
|
|
40
40
|
export { Pagination, type PaginationProps, type PaginationSize, type PaginationVariant, } from './Pagination';
|
|
41
41
|
export { MobileKeyboard, type MobileKeyboardProps, type MobileKeyboardSuggestionItem, } from './MobileKeyboard';
|
|
42
42
|
export { LinearProgress, CircularProgress, SegmentedProgress, StepsProgress, type LinearProgressProps, type CircularProgressProps, type SegmentedProgressProps, type StepsProgressProps, type ProgressSize, type ProgressColor, } from './Progress';
|
|
43
|
+
export { SurfaceAnchoredLayer, type SurfaceAnchoredLayerProps } from './SurfaceAnchoredLayer';
|
|
@@ -52,7 +52,7 @@ export interface WorkbenchCanvasProps {
|
|
|
52
52
|
width: number;
|
|
53
53
|
height: number;
|
|
54
54
|
}) => void;
|
|
55
|
-
onUpdateStickyNote?: (noteId: string, patch: Partial<Pick<WorkbenchStickyNoteItem, 'body' | 'color'>>) => void;
|
|
55
|
+
onUpdateStickyNote?: (noteId: string, patch: Partial<Pick<WorkbenchStickyNoteItem, 'body' | 'color' | 'material'>>) => void;
|
|
56
56
|
onDeleteStickyNote?: (noteId: string) => void;
|
|
57
57
|
onSelectAnnotation?: (annotationId: string) => void;
|
|
58
58
|
onAnnotationContextMenu?: (event: MouseEvent, item: WorkbenchAnnotationItem) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { use as E, insert as w, createComponent as g, memo as y, effect as F, template as
|
|
1
|
+
import { use as E, insert as w, createComponent as g, memo as y, effect as F, template as B } from "solid-js/web";
|
|
2
2
|
import { createMemo as u, createSignal as _, Show as O, For as j } from "solid-js";
|
|
3
3
|
import { resolveWorkbenchInteractionAdapter as z } from "./workbenchInteractionAdapter.js";
|
|
4
|
-
import { WORKBENCH_BACKGROUND_REGION_FILTER_ID as P, WORKBENCH_TEXT_FILTER_ID as
|
|
5
|
-
import { WorkbenchCanvasField as
|
|
4
|
+
import { WORKBENCH_BACKGROUND_REGION_FILTER_ID as P, WORKBENCH_TEXT_FILTER_ID as U, WORKBENCH_STICKY_FILTER_ID as q } from "./types.js";
|
|
5
|
+
import { WorkbenchCanvasField as T } from "./WorkbenchCanvasField.js";
|
|
6
6
|
import { WorkbenchPlacementPreview as G } from "./WorkbenchPlacementPreview.js";
|
|
7
7
|
import { WorkbenchBackgroundLayerView as $, WorkbenchAnnotationLayerView as K, WorkbenchLayerControlOverlayView as H, createWorkbenchTextEditorRegistry as Z, WorkbenchStickyNote as X } from "./WorkbenchLayerObjects.js";
|
|
8
8
|
import { WorkbenchWidget as Y } from "./WorkbenchWidget.js";
|
|
@@ -10,11 +10,11 @@ import { createWorkbenchRenderLayerMap as J, resolveWorkbenchModeStrategy as Q,
|
|
|
10
10
|
import { createWorkbenchWidgetEnterMotionTracker as p } from "./workbenchMotion.js";
|
|
11
11
|
import { getWidgetEntry as R } from "./widgets/widgetRegistry.js";
|
|
12
12
|
import { InfiniteCanvas as ee } from "../ui/InfiniteCanvas.js";
|
|
13
|
-
var te = /* @__PURE__ */
|
|
13
|
+
var te = /* @__PURE__ */ B("<div class=workbench-canvas><div class=workbench-canvas__atmosphere aria-hidden=true>"), ne = /* @__PURE__ */ B("<div class=workbench-canvas__projected-layer><div class=workbench-canvas__projected-work-layer>");
|
|
14
14
|
function re(e) {
|
|
15
15
|
const a = u((c) => {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
16
|
+
const v = e.widgetById().get(e.widgetId);
|
|
17
|
+
if (v) return v;
|
|
18
18
|
if (c) return c;
|
|
19
19
|
throw new Error(`Workbench widget ${e.widgetId} is missing from the projected render map.`);
|
|
20
20
|
}), r = u(() => R(a().type, e.widgetDefinitions));
|
|
@@ -190,13 +190,13 @@ function Ce(e) {
|
|
|
190
190
|
for (const [o, d] of Object.entries(n))
|
|
191
191
|
d !== void 0 && (l[o] = d);
|
|
192
192
|
return l;
|
|
193
|
-
}),
|
|
193
|
+
}), v = u(() => new Map(e.widgets.map((n) => [n.id, n]))), x = u(() => (e.stickyNotes ?? []).map((n) => n.id)), N = u(() => new Map((e.stickyNotes ?? []).map((n) => [n.id, n]))), b = u(() => J([...e.widgets, ...e.stickyNotes ?? []])), C = Z(), [S, f] = _(null), L = u(() => Q(e.mode)), I = u(() => L().workLayerLocked), m = u(() => L().layerEditingEnabled), D = u(() => e.widgets.filter((n) => {
|
|
194
194
|
const l = R(n.type, e.widgetDefinitions);
|
|
195
195
|
return A(l) === "canvas_scaled";
|
|
196
196
|
})), h = u(() => e.widgets.filter((n) => {
|
|
197
197
|
const l = R(n.type, e.widgetDefinitions);
|
|
198
198
|
return A(l) === "projected_surface";
|
|
199
|
-
}).map((n) => n.id)), M = u(() => h().length > 0), V = u(() => M() ? [] : e.stickyNotes ?? []), W = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0,
|
|
199
|
+
}).map((n) => n.id)), M = u(() => h().length > 0), V = u(() => M() ? [] : e.stickyNotes ?? []), W = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0, s = M;
|
|
200
200
|
return (() => {
|
|
201
201
|
var n = te();
|
|
202
202
|
n.firstChild;
|
|
@@ -238,11 +238,13 @@ function Ce(e) {
|
|
|
238
238
|
},
|
|
239
239
|
overlay: (o) => [g(O, {
|
|
240
240
|
get when() {
|
|
241
|
-
return
|
|
241
|
+
return s();
|
|
242
242
|
},
|
|
243
243
|
get children() {
|
|
244
244
|
var d = ne(), k = d.firstChild;
|
|
245
245
|
return w(d, g($, {
|
|
246
|
+
textEditorRegistry: C,
|
|
247
|
+
onUpdate: (t, i) => e.onUpdateBackgroundLayer?.(t, i),
|
|
246
248
|
get items() {
|
|
247
249
|
return e.backgroundLayers ?? [];
|
|
248
250
|
},
|
|
@@ -277,14 +279,14 @@ function Ce(e) {
|
|
|
277
279
|
return y(() => !!m())() && !e.locked;
|
|
278
280
|
},
|
|
279
281
|
get filtered() {
|
|
280
|
-
return e.filters[
|
|
282
|
+
return e.filters[U] === !1;
|
|
281
283
|
},
|
|
282
284
|
projection: "screen",
|
|
283
285
|
get preview() {
|
|
284
286
|
return S();
|
|
285
287
|
},
|
|
286
288
|
onPreviewGeometry: f,
|
|
287
|
-
textEditorRegistry:
|
|
289
|
+
textEditorRegistry: C,
|
|
288
290
|
get viewport() {
|
|
289
291
|
return o();
|
|
290
292
|
},
|
|
@@ -304,7 +306,7 @@ function Ce(e) {
|
|
|
304
306
|
get canvasFrameSize() {
|
|
305
307
|
return e.canvasFrameSize;
|
|
306
308
|
},
|
|
307
|
-
widgetById:
|
|
309
|
+
widgetById: v,
|
|
308
310
|
renderLayers: b,
|
|
309
311
|
get widgetMotionById() {
|
|
310
312
|
return c();
|
|
@@ -316,7 +318,7 @@ function Ce(e) {
|
|
|
316
318
|
return e.visualFrontOwnerId;
|
|
317
319
|
},
|
|
318
320
|
get locked() {
|
|
319
|
-
return e.locked ||
|
|
321
|
+
return e.locked || I();
|
|
320
322
|
},
|
|
321
323
|
get filters() {
|
|
322
324
|
return e.filters;
|
|
@@ -376,7 +378,7 @@ function Ce(e) {
|
|
|
376
378
|
})
|
|
377
379
|
}), null), w(k, g(j, {
|
|
378
380
|
get each() {
|
|
379
|
-
return
|
|
381
|
+
return x();
|
|
380
382
|
},
|
|
381
383
|
children: (t) => g(oe, {
|
|
382
384
|
noteId: t,
|
|
@@ -390,10 +392,10 @@ function Ce(e) {
|
|
|
390
392
|
return e.visualFrontOwnerId;
|
|
391
393
|
},
|
|
392
394
|
get locked() {
|
|
393
|
-
return e.locked
|
|
395
|
+
return e.locked;
|
|
394
396
|
},
|
|
395
397
|
get filtered() {
|
|
396
|
-
return y(() => !
|
|
398
|
+
return y(() => !I())() && e.filters[q] === !1;
|
|
397
399
|
},
|
|
398
400
|
get onSelectStickyNote() {
|
|
399
401
|
return e.onSelectStickyNote;
|
|
@@ -453,7 +455,7 @@ function Ce(e) {
|
|
|
453
455
|
return S();
|
|
454
456
|
},
|
|
455
457
|
onPreviewGeometry: f,
|
|
456
|
-
textEditorRegistry:
|
|
458
|
+
textEditorRegistry: C,
|
|
457
459
|
onCommitAnnotationMove: (t, i) => e.onCommitAnnotationMove?.(t, i),
|
|
458
460
|
onCommitAnnotationResize: (t, i) => e.onCommitAnnotationResize?.(t, i),
|
|
459
461
|
onUpdateTextAnnotation: (t, i) => e.onUpdateTextAnnotation?.(t, i),
|
|
@@ -461,11 +463,11 @@ function Ce(e) {
|
|
|
461
463
|
onCommitBackgroundResize: (t, i) => e.onCommitBackgroundResize?.(t, i),
|
|
462
464
|
onUpdateBackgroundLayer: (t, i) => e.onUpdateBackgroundLayer?.(t, i),
|
|
463
465
|
onDeleteBackgroundLayer: (t) => e.onDeleteBackgroundLayer?.(t)
|
|
464
|
-
}), null), F(() => d.classList.toggle("is-work-layer-locked", !!
|
|
466
|
+
}), null), F(() => d.classList.toggle("is-work-layer-locked", !!I())), d;
|
|
465
467
|
}
|
|
466
468
|
}), g(O, {
|
|
467
469
|
get when() {
|
|
468
|
-
return y(() => !!
|
|
470
|
+
return y(() => !!s())() ? e.placementPreview : null;
|
|
469
471
|
},
|
|
470
472
|
children: (d) => g(G, {
|
|
471
473
|
get preview() {
|
|
@@ -478,7 +480,7 @@ function Ce(e) {
|
|
|
478
480
|
})
|
|
479
481
|
})],
|
|
480
482
|
get children() {
|
|
481
|
-
return g(
|
|
483
|
+
return g(T, {
|
|
482
484
|
get widgetDefinitions() {
|
|
483
485
|
return e.widgetDefinitions;
|
|
484
486
|
},
|
|
@@ -495,7 +497,7 @@ function Ce(e) {
|
|
|
495
497
|
return e.backgroundLayers ?? [];
|
|
496
498
|
},
|
|
497
499
|
get placementPreview() {
|
|
498
|
-
return y(() => !!
|
|
500
|
+
return y(() => !!s())() ? null : e.placementPreview;
|
|
499
501
|
},
|
|
500
502
|
get viewport() {
|
|
501
503
|
return e.viewport;
|
|
@@ -510,7 +512,7 @@ function Ce(e) {
|
|
|
510
512
|
return e.visualFrontOwnerId;
|
|
511
513
|
},
|
|
512
514
|
get workLayerLocked() {
|
|
513
|
-
return
|
|
515
|
+
return I();
|
|
514
516
|
},
|
|
515
517
|
get annotationLayerEditable() {
|
|
516
518
|
return m();
|
|
@@ -522,7 +524,7 @@ function Ce(e) {
|
|
|
522
524
|
return m();
|
|
523
525
|
},
|
|
524
526
|
get renderFreeformLayers() {
|
|
525
|
-
return !
|
|
527
|
+
return !s();
|
|
526
528
|
},
|
|
527
529
|
get viewportScale() {
|
|
528
530
|
return e.viewport.scale;
|
|
@@ -645,7 +647,7 @@ function Ce(e) {
|
|
|
645
647
|
return S();
|
|
646
648
|
},
|
|
647
649
|
onLayerGeometryPreview: f,
|
|
648
|
-
textEditorRegistry:
|
|
650
|
+
textEditorRegistry: C
|
|
649
651
|
});
|
|
650
652
|
}
|
|
651
653
|
}), null), F((o) => {
|
|
@@ -48,7 +48,7 @@ export interface WorkbenchCanvasFieldProps {
|
|
|
48
48
|
width: number;
|
|
49
49
|
height: number;
|
|
50
50
|
}) => void;
|
|
51
|
-
onUpdateStickyNote?: (noteId: string, patch: Partial<Pick<WorkbenchStickyNoteItem, 'body' | 'color'>>) => void;
|
|
51
|
+
onUpdateStickyNote?: (noteId: string, patch: Partial<Pick<WorkbenchStickyNoteItem, 'body' | 'color' | 'material'>>) => void;
|
|
52
52
|
onDeleteStickyNote?: (noteId: string) => void;
|
|
53
53
|
onSelectAnnotation?: (annotationId: string) => void;
|
|
54
54
|
onAnnotationContextMenu?: (event: MouseEvent, item: WorkbenchAnnotationItem) => void;
|