@objectifthunes/whiteboard 0.2.4 → 0.2.6
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/README.md +1274 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +450 -386
- package/dist/whiteboard.css +164 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as n, jsxs as d, Fragment as re } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { create as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const
|
|
2
|
+
import { useEffect as Y, useRef as S, useCallback as B, memo as Re, useId as We, useState as Se, useLayoutEffect as Xe, Component as Ye, useMemo as ye, forwardRef as me, createElement as T } from "react";
|
|
3
|
+
import { create as De } from "zustand";
|
|
4
|
+
import { createPortal as Ie } from "react-dom";
|
|
5
|
+
const D = (e = 14) => ({
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: e,
|
|
8
8
|
height: e,
|
|
@@ -14,16 +14,16 @@ const Y = (e = 14) => ({
|
|
|
14
14
|
strokeLinejoin: "round"
|
|
15
15
|
});
|
|
16
16
|
function Fe({ size: e, ...t }) {
|
|
17
|
-
return /* @__PURE__ */ n("svg", { ...
|
|
17
|
+
return /* @__PURE__ */ n("svg", { ...D(e), ...t, children: /* @__PURE__ */ n("path", { d: "M5 12h14" }) });
|
|
18
18
|
}
|
|
19
19
|
function Ge({ size: e, ...t }) {
|
|
20
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
20
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
21
21
|
/* @__PURE__ */ n("path", { d: "M5 12h14" }),
|
|
22
22
|
/* @__PURE__ */ n("path", { d: "M12 5v14" })
|
|
23
23
|
] });
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
25
|
+
function Le({ size: e, ...t }) {
|
|
26
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
27
27
|
/* @__PURE__ */ n("path", { d: "M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z", fill: "none", stroke: "none" }),
|
|
28
28
|
/* @__PURE__ */ n("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
29
29
|
/* @__PURE__ */ n("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
|
|
@@ -33,14 +33,14 @@ function Ie({ size: e, ...t }) {
|
|
|
33
33
|
/* @__PURE__ */ n("path", { d: "m16 16-1.9-1.9" })
|
|
34
34
|
] });
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
36
|
+
function Ee({ size: e, ...t }) {
|
|
37
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
38
38
|
/* @__PURE__ */ n("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
39
39
|
/* @__PURE__ */ n("path", { d: "M3 3v5h5" })
|
|
40
40
|
] });
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
42
|
+
function Ae({ size: e, ...t }) {
|
|
43
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
44
44
|
/* @__PURE__ */ n("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
45
45
|
/* @__PURE__ */ n("path", { d: "M3 9h18" }),
|
|
46
46
|
/* @__PURE__ */ n("path", { d: "M3 15h18" }),
|
|
@@ -48,38 +48,38 @@ function Ee({ size: e, ...t }) {
|
|
|
48
48
|
/* @__PURE__ */ n("path", { d: "M15 3v18" })
|
|
49
49
|
] });
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
51
|
+
function Oe({ size: e, ...t }) {
|
|
52
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
53
53
|
/* @__PURE__ */ n("polyline", { points: "15 3 21 3 21 9" }),
|
|
54
54
|
/* @__PURE__ */ n("polyline", { points: "9 21 3 21 3 15" }),
|
|
55
55
|
/* @__PURE__ */ n("line", { x1: "21", x2: "14", y1: "3", y2: "10" }),
|
|
56
56
|
/* @__PURE__ */ n("line", { x1: "3", x2: "10", y1: "21", y2: "14" })
|
|
57
57
|
] });
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return /* @__PURE__ */ n("svg", { ...
|
|
59
|
+
function pe({ size: e, ...t }) {
|
|
60
|
+
return /* @__PURE__ */ n("svg", { ...D(e), ...t, children: /* @__PURE__ */ n("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
62
|
+
function Be({ size: e, ...t }) {
|
|
63
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
64
64
|
/* @__PURE__ */ n("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
65
65
|
/* @__PURE__ */ n("path", { d: "M12 9v4" }),
|
|
66
66
|
/* @__PURE__ */ n("path", { d: "M12 17h.01" })
|
|
67
67
|
] });
|
|
68
68
|
}
|
|
69
69
|
function He({ size: e, ...t }) {
|
|
70
|
-
return /* @__PURE__ */ n("svg", { ...
|
|
70
|
+
return /* @__PURE__ */ n("svg", { ...D(e), ...t, children: /* @__PURE__ */ n("path", { d: "M20 6 9 17l-5-5" }) });
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return /* @__PURE__ */ d("svg", { ...
|
|
72
|
+
function ke({ size: e, ...t }) {
|
|
73
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
74
74
|
/* @__PURE__ */ n("path", { d: "M18 6 6 18" }),
|
|
75
75
|
/* @__PURE__ */ n("path", { d: "m6 6 12 12" })
|
|
76
76
|
] });
|
|
77
77
|
}
|
|
78
|
-
function Be({ size: e, ...t }) {
|
|
79
|
-
return /* @__PURE__ */ n("svg", { ...Y(e), ...t, children: /* @__PURE__ */ n("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
|
|
80
|
-
}
|
|
81
78
|
function $e({ size: e, ...t }) {
|
|
82
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ n("svg", { ...D(e), ...t, children: /* @__PURE__ */ n("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
|
|
80
|
+
}
|
|
81
|
+
function Ve({ size: e, ...t }) {
|
|
82
|
+
return /* @__PURE__ */ d("svg", { ...D(e), ...t, children: [
|
|
83
83
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
|
|
84
84
|
/* @__PURE__ */ n("path", { d: "M12 2v2" }),
|
|
85
85
|
/* @__PURE__ */ n("path", { d: "M12 20v2" }),
|
|
@@ -97,33 +97,33 @@ function ue(e) {
|
|
|
97
97
|
}
|
|
98
98
|
function Ne(e, t, r = 60) {
|
|
99
99
|
if (e.size === 0) return null;
|
|
100
|
-
let s = 1 / 0, a = 1 / 0, u = -1 / 0,
|
|
100
|
+
let s = 1 / 0, a = 1 / 0, u = -1 / 0, m = -1 / 0;
|
|
101
101
|
for (const v of e.values())
|
|
102
|
-
s = Math.min(s, v.x), a = Math.min(a, v.y), u = Math.max(u, v.x + v.width),
|
|
103
|
-
const f = u - s + r * 2,
|
|
102
|
+
s = Math.min(s, v.x), a = Math.min(a, v.y), u = Math.max(u, v.x + v.width), m = Math.max(m, v.y + v.height);
|
|
103
|
+
const f = u - s + r * 2, p = m - a + r * 2, b = t.width || window.innerWidth, h = t.height || window.innerHeight, k = Math.min(b / f, h / p, 1.5), M = (s + u) / 2, _ = (a + m) / 2;
|
|
104
104
|
return {
|
|
105
|
-
scale: Math.min(3, Math.max(0.2,
|
|
105
|
+
scale: Math.min(3, Math.max(0.2, k)),
|
|
106
106
|
offset: {
|
|
107
|
-
x:
|
|
108
|
-
y: h / 2 - _ *
|
|
107
|
+
x: b / 2 - M * k,
|
|
108
|
+
y: h / 2 - _ * k
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const a = t.width || window.innerWidth, u = t.height || window.innerHeight,
|
|
114
|
-
(a - r * 2) /
|
|
112
|
+
function je(e, t, r = 40, s = 1.5) {
|
|
113
|
+
const a = t.width || window.innerWidth, u = t.height || window.innerHeight, m = Math.max(1, e.width), f = Math.max(1, e.height), p = Math.min(
|
|
114
|
+
(a - r * 2) / m,
|
|
115
115
|
(u - r * 2) / f,
|
|
116
116
|
s
|
|
117
|
-
),
|
|
117
|
+
), b = Math.min(3, Math.max(0.2, p));
|
|
118
118
|
return {
|
|
119
|
-
scale:
|
|
119
|
+
scale: b,
|
|
120
120
|
offset: {
|
|
121
|
-
x: a / 2 - (e.x +
|
|
122
|
-
y: u / 2 - (e.y + f / 2) *
|
|
121
|
+
x: a / 2 - (e.x + m / 2) * b,
|
|
122
|
+
y: u / 2 - (e.y + f / 2) * b
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const g = De((e, t) => ({
|
|
127
127
|
offset: { x: 0, y: 0 },
|
|
128
128
|
scale: 1,
|
|
129
129
|
viewportSize: { width: 0, height: 0 },
|
|
@@ -153,7 +153,7 @@ const p = Xe((e, t) => ({
|
|
|
153
153
|
a && e({ scale: a.scale, offset: a.offset });
|
|
154
154
|
},
|
|
155
155
|
focusPanel: (r, s) => {
|
|
156
|
-
const { viewportSize: a } = t(), u =
|
|
156
|
+
const { viewportSize: a } = t(), u = je(
|
|
157
157
|
r,
|
|
158
158
|
a,
|
|
159
159
|
(s == null ? void 0 : s.padding) ?? 40,
|
|
@@ -164,9 +164,9 @@ const p = Xe((e, t) => ({
|
|
|
164
164
|
resetWidgets: () => {
|
|
165
165
|
for (const s of t().resetFns.values()) s();
|
|
166
166
|
const r = (s = 0) => {
|
|
167
|
-
const { panels: a, viewportSize: u } = t(),
|
|
168
|
-
if (
|
|
169
|
-
e({ scale:
|
|
167
|
+
const { panels: a, viewportSize: u } = t(), m = Ne(a, u);
|
|
168
|
+
if (m) {
|
|
169
|
+
e({ scale: m.scale, offset: m.offset });
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
s < 6 && requestAnimationFrame(() => r(s + 1));
|
|
@@ -183,17 +183,17 @@ const p = Xe((e, t) => ({
|
|
|
183
183
|
resetFns: /* @__PURE__ */ new Map()
|
|
184
184
|
})
|
|
185
185
|
}));
|
|
186
|
-
function
|
|
187
|
-
const t =
|
|
188
|
-
|
|
186
|
+
function Ue({ extraActions: e }) {
|
|
187
|
+
const t = g((h) => h.scale), r = g((h) => h.viewportSize), s = g((h) => h.snapToGrid), a = g((h) => h.setScale), u = g((h) => h.setOffset), m = g((h) => h.setSnapToGrid), f = g((h) => h.fitToContent), p = g((h) => h.resetWidgets);
|
|
188
|
+
Y(() => {
|
|
189
189
|
s && window.dispatchEvent(new Event("whiteboard-snap-now"));
|
|
190
190
|
}, [s]);
|
|
191
|
-
const
|
|
192
|
-
const
|
|
191
|
+
const b = (h) => {
|
|
192
|
+
const k = Math.min(3, Math.max(0.2, h)), M = k / t, _ = (r.width || window.innerWidth) / 2, v = (r.height || window.innerHeight) / 2;
|
|
193
193
|
u((P) => ({
|
|
194
|
-
x: _ - (_ - P.x) *
|
|
195
|
-
y: v - (v - P.y) *
|
|
196
|
-
})), a(
|
|
194
|
+
x: _ - (_ - P.x) * M,
|
|
195
|
+
y: v - (v - P.y) * M
|
|
196
|
+
})), a(k);
|
|
197
197
|
};
|
|
198
198
|
return /* @__PURE__ */ d(
|
|
199
199
|
"div",
|
|
@@ -202,23 +202,23 @@ function je({ extraActions: e }) {
|
|
|
202
202
|
onPointerDown: (h) => h.stopPropagation(),
|
|
203
203
|
onWheel: (h) => h.stopPropagation(),
|
|
204
204
|
children: [
|
|
205
|
-
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () =>
|
|
205
|
+
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () => b(t * 0.8), title: "Zoom out", "aria-label": "Zoom out", children: /* @__PURE__ */ n(Fe, { size: 14 }) }),
|
|
206
206
|
/* @__PURE__ */ d("span", { className: "zoom-bar__value", children: [
|
|
207
207
|
Math.round(t * 100),
|
|
208
208
|
"%"
|
|
209
209
|
] }),
|
|
210
|
-
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () =>
|
|
211
|
-
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: f, title: "Fit camera to all panels", "aria-label": "Fit camera to all panels", children: /* @__PURE__ */ n(
|
|
212
|
-
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick:
|
|
210
|
+
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () => b(t * 1.2), title: "Zoom in", "aria-label": "Zoom in", children: /* @__PURE__ */ n(Ge, { size: 14 }) }),
|
|
211
|
+
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: f, title: "Fit camera to all panels", "aria-label": "Fit camera to all panels", children: /* @__PURE__ */ n(Le, { size: 14 }) }),
|
|
212
|
+
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: p, title: "Reset panel positions", "aria-label": "Reset panel positions", children: /* @__PURE__ */ n(Ee, { size: 14 }) }),
|
|
213
213
|
/* @__PURE__ */ n(
|
|
214
214
|
"button",
|
|
215
215
|
{
|
|
216
216
|
type: "button",
|
|
217
217
|
className: `wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action${s ? " is-active" : ""}`,
|
|
218
|
-
onClick: () =>
|
|
218
|
+
onClick: () => m((h) => !h),
|
|
219
219
|
title: s ? "Disable snap to grid" : "Enable snap to grid",
|
|
220
220
|
"aria-label": s ? "Disable snap to grid" : "Enable snap to grid",
|
|
221
|
-
children: /* @__PURE__ */ n(
|
|
221
|
+
children: /* @__PURE__ */ n(Ae, { size: 14 })
|
|
222
222
|
}
|
|
223
223
|
),
|
|
224
224
|
e
|
|
@@ -227,49 +227,49 @@ function je({ extraActions: e }) {
|
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
229
|
const ee = 200, te = 150, de = 40, xe = 1;
|
|
230
|
-
function
|
|
231
|
-
|
|
232
|
-
const t =
|
|
230
|
+
function Ze({ loading: e = !1 }) {
|
|
231
|
+
g((i) => i.registryVersion);
|
|
232
|
+
const t = g((i) => i.offset), r = g((i) => i.scale), s = g((i) => i.viewportSize), a = g((i) => i.panels), u = g((i) => i.setOffset), m = g((i) => i.setScale), f = g((i) => i.focusPanel), p = S(null), b = S(!1), h = S(null), M = Array.from(a.entries()).filter(([, i]) => Number.isFinite(i.width) && Number.isFinite(i.height)), _ = M.map(([, i]) => i);
|
|
233
233
|
if (e || _.length === 0)
|
|
234
|
-
return /* @__PURE__ */ n("div", { className: "minimap minimap--loading", style: { width: ee, height: te }, children: /* @__PURE__ */ n("div", { className: "minimap__loading", children: /* @__PURE__ */ n(
|
|
235
|
-
const v = s.width || window.innerWidth, P = s.height || window.innerHeight, L = v / r,
|
|
236
|
-
let
|
|
237
|
-
for (const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
if (!
|
|
242
|
-
const x =
|
|
243
|
-
return { worldX:
|
|
244
|
-
}, K = (
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
x: v / 2 -
|
|
248
|
-
y: P / 2 - y *
|
|
234
|
+
return /* @__PURE__ */ n("div", { className: "minimap minimap--loading", style: { width: ee, height: te }, children: /* @__PURE__ */ n("div", { className: "minimap__loading", children: /* @__PURE__ */ n(pe, { size: 14, className: "icon-spin" }) }) });
|
|
235
|
+
const v = s.width || window.innerWidth, P = s.height || window.innerHeight, L = v / r, H = P / r, $ = -t.x / r, V = -t.y / r;
|
|
236
|
+
let I = 1 / 0, c = 1 / 0, R = -1 / 0, W = -1 / 0;
|
|
237
|
+
for (const i of _)
|
|
238
|
+
I = Math.min(I, i.x), c = Math.min(c, i.y), R = Math.max(R, i.x + i.width), W = Math.max(W, i.y + i.height);
|
|
239
|
+
I -= de, c -= de, R += de, W += de;
|
|
240
|
+
const z = Math.max(xe, R - I), O = Math.max(xe, W - c), C = Math.min(ee / z, te / O), E = z * C, U = O * C, Z = (ee - E) / 2, X = (te - U) / 2, q = (i) => Z + (i - I) * C, j = (i) => X + (i - c) * C, Q = (i, y) => {
|
|
241
|
+
if (!p.current) return;
|
|
242
|
+
const x = p.current.getBoundingClientRect(), F = Math.min(ee, Math.max(0, i - x.left)), A = Math.min(te, Math.max(0, y - x.top)), ae = Math.min(E + Z, Math.max(Z, F)), ie = Math.min(U + X, Math.max(X, A)), oe = (ae - Z) / C + I, ce = (ie - X) / C + c;
|
|
243
|
+
return { worldX: oe, worldY: ce };
|
|
244
|
+
}, K = (i, y, x) => {
|
|
245
|
+
const F = Math.min(3, Math.max(0.2, x));
|
|
246
|
+
m(F), u({
|
|
247
|
+
x: v / 2 - i * F,
|
|
248
|
+
y: P / 2 - y * F
|
|
249
249
|
});
|
|
250
|
-
}, se = (
|
|
251
|
-
const x = Q(
|
|
250
|
+
}, se = (i, y) => {
|
|
251
|
+
const x = Q(i, y);
|
|
252
252
|
x && K(x.worldX, x.worldY, r);
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
|
|
253
|
+
}, we = (i) => {
|
|
254
|
+
i.stopPropagation(), i.preventDefault(), b.current = !0, i.currentTarget.setPointerCapture(i.pointerId), se(i.clientX, i.clientY);
|
|
255
|
+
}, o = (i) => {
|
|
256
|
+
b.current && se(i.clientX, i.clientY);
|
|
257
|
+
}, w = () => {
|
|
258
|
+
b.current = !1;
|
|
259
259
|
};
|
|
260
260
|
return /* @__PURE__ */ d(
|
|
261
261
|
"div",
|
|
262
262
|
{
|
|
263
|
-
ref:
|
|
264
|
-
onPointerDown:
|
|
265
|
-
onPointerMove:
|
|
266
|
-
onPointerUp:
|
|
267
|
-
onPointerCancel:
|
|
268
|
-
onWheel: (
|
|
269
|
-
|
|
270
|
-
const y = Q(
|
|
263
|
+
ref: p,
|
|
264
|
+
onPointerDown: we,
|
|
265
|
+
onPointerMove: o,
|
|
266
|
+
onPointerUp: w,
|
|
267
|
+
onPointerCancel: w,
|
|
268
|
+
onWheel: (i) => {
|
|
269
|
+
i.preventDefault(), i.stopPropagation();
|
|
270
|
+
const y = Q(i.clientX, i.clientY);
|
|
271
271
|
if (!y) return;
|
|
272
|
-
const x =
|
|
272
|
+
const x = i.deltaY > 0 ? 0.9 : 1.1;
|
|
273
273
|
K(y.worldX, y.worldY, r * x);
|
|
274
274
|
},
|
|
275
275
|
className: "minimap",
|
|
@@ -278,7 +278,7 @@ function Ue({ loading: e = !1 }) {
|
|
|
278
278
|
height: te
|
|
279
279
|
},
|
|
280
280
|
children: [
|
|
281
|
-
|
|
281
|
+
M.map(([i, y]) => /* @__PURE__ */ n(
|
|
282
282
|
"div",
|
|
283
283
|
{
|
|
284
284
|
className: "minimap__panel",
|
|
@@ -287,12 +287,12 @@ function Ue({ loading: e = !1 }) {
|
|
|
287
287
|
},
|
|
288
288
|
onPointerUp: (x) => {
|
|
289
289
|
x.stopPropagation();
|
|
290
|
-
const
|
|
291
|
-
if (A && A.id ===
|
|
290
|
+
const F = Date.now(), A = h.current;
|
|
291
|
+
if (A && A.id === i && F - A.time < 300) {
|
|
292
292
|
x.preventDefault(), f(y, { padding: y.focusPadding, maxScale: y.focusMaxScale }), h.current = null;
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
|
-
h.current = { id:
|
|
295
|
+
h.current = { id: i, time: F };
|
|
296
296
|
},
|
|
297
297
|
onDoubleClick: (x) => {
|
|
298
298
|
x.preventDefault(), x.stopPropagation(), f(y, { padding: y.focusPadding, maxScale: y.focusMaxScale });
|
|
@@ -300,11 +300,11 @@ function Ue({ loading: e = !1 }) {
|
|
|
300
300
|
style: {
|
|
301
301
|
left: q(y.x),
|
|
302
302
|
top: j(y.y),
|
|
303
|
-
width: Math.max(1, y.width *
|
|
304
|
-
height: Math.max(1, y.height *
|
|
303
|
+
width: Math.max(1, y.width * C),
|
|
304
|
+
height: Math.max(1, y.height * C)
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
|
-
|
|
307
|
+
i
|
|
308
308
|
)),
|
|
309
309
|
/* @__PURE__ */ n(
|
|
310
310
|
"div",
|
|
@@ -313,8 +313,8 @@ function Ue({ loading: e = !1 }) {
|
|
|
313
313
|
style: {
|
|
314
314
|
left: q($),
|
|
315
315
|
top: j(V),
|
|
316
|
-
width: L *
|
|
317
|
-
height:
|
|
316
|
+
width: L * C,
|
|
317
|
+
height: H * C
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
)
|
|
@@ -323,61 +323,61 @@ function Ue({ loading: e = !1 }) {
|
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
325
|
function xt({ children: e, showMinimap: t = !0, minimapLoading: r = !1, extraActions: s }) {
|
|
326
|
-
const a =
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}, []),
|
|
326
|
+
const a = g((c) => c.offset), u = g((c) => c.scale), m = g((c) => c.registryVersion), f = g((c) => c.viewportSize), p = g((c) => c.setOffset), b = g((c) => c.setScale), h = g((c) => c.setViewportSize), k = S(null), M = S(!1), _ = S({ x: 0, y: 0 }), v = S(null), P = S(u), L = S(!1);
|
|
327
|
+
Y(() => () => {
|
|
328
|
+
g.getState().resetSession();
|
|
329
|
+
}, []), Y(() => {
|
|
330
330
|
P.current = u;
|
|
331
|
-
}, [u]),
|
|
332
|
-
const c =
|
|
331
|
+
}, [u]), Y(() => {
|
|
332
|
+
const c = k.current;
|
|
333
333
|
if (!c) return;
|
|
334
334
|
const R = () => {
|
|
335
|
-
const
|
|
335
|
+
const z = c.getBoundingClientRect();
|
|
336
336
|
h({
|
|
337
|
-
width: Math.max(0,
|
|
338
|
-
height: Math.max(0,
|
|
337
|
+
width: Math.max(0, z.width),
|
|
338
|
+
height: Math.max(0, z.height)
|
|
339
339
|
});
|
|
340
340
|
};
|
|
341
341
|
if (R(), typeof ResizeObserver > "u") return;
|
|
342
342
|
const W = new ResizeObserver(R);
|
|
343
343
|
return W.observe(c), () => W.disconnect();
|
|
344
|
-
}, [h]),
|
|
344
|
+
}, [h]), Y(() => {
|
|
345
345
|
if (L.current) return;
|
|
346
|
-
const { panels: c } =
|
|
346
|
+
const { panels: c } = g.getState();
|
|
347
347
|
c.size === 0 || f.width <= 0 || f.height <= 0 || (L.current = !0, requestAnimationFrame(() => {
|
|
348
|
-
|
|
348
|
+
g.getState().fitToContent();
|
|
349
349
|
}));
|
|
350
|
-
}, [
|
|
351
|
-
const
|
|
352
|
-
c.target === c.currentTarget && (c.button === 0 || c.button === 1) && (
|
|
353
|
-
}, []), $ =
|
|
354
|
-
if (!
|
|
350
|
+
}, [m, f]);
|
|
351
|
+
const H = B((c) => {
|
|
352
|
+
c.target === c.currentTarget && (c.button === 0 || c.button === 1) && (M.current = !0, v.current = c.pointerId, _.current = { x: c.clientX, y: c.clientY }, c.currentTarget.setPointerCapture(c.pointerId), c.preventDefault());
|
|
353
|
+
}, []), $ = B((c) => {
|
|
354
|
+
if (!M.current || v.current !== c.pointerId) return;
|
|
355
355
|
const R = c.movementX ?? c.clientX - _.current.x, W = c.movementY ?? c.clientY - _.current.y;
|
|
356
|
-
|
|
357
|
-
}, [
|
|
356
|
+
p((z) => ({ x: z.x + R, y: z.y + W })), _.current = { x: c.clientX, y: c.clientY };
|
|
357
|
+
}, [p]), V = B((c) => {
|
|
358
358
|
if (v.current !== null)
|
|
359
359
|
try {
|
|
360
360
|
c.currentTarget.releasePointerCapture(v.current);
|
|
361
361
|
} catch {
|
|
362
362
|
}
|
|
363
|
-
|
|
364
|
-
}, []),
|
|
365
|
-
const R = P.current, W = c.currentTarget.getBoundingClientRect(),
|
|
366
|
-
|
|
367
|
-
x:
|
|
368
|
-
y:
|
|
369
|
-
})),
|
|
370
|
-
}, [
|
|
363
|
+
M.current = !1, v.current = null;
|
|
364
|
+
}, []), I = B((c) => {
|
|
365
|
+
const R = P.current, W = c.currentTarget.getBoundingClientRect(), z = { x: c.clientX - W.left, y: c.clientY - W.top }, O = Math.min(3, Math.max(0.2, R * (c.deltaY > 0 ? 0.9 : 1.1))), C = O / R;
|
|
366
|
+
p((E) => ({
|
|
367
|
+
x: z.x - (z.x - E.x) * C,
|
|
368
|
+
y: z.y - (z.y - E.y) * C
|
|
369
|
+
})), b(O);
|
|
370
|
+
}, [p, b]);
|
|
371
371
|
return /* @__PURE__ */ d(re, { children: [
|
|
372
372
|
/* @__PURE__ */ n(
|
|
373
373
|
"div",
|
|
374
374
|
{
|
|
375
|
-
ref:
|
|
376
|
-
onPointerDown:
|
|
375
|
+
ref: k,
|
|
376
|
+
onPointerDown: H,
|
|
377
377
|
onPointerMove: $,
|
|
378
378
|
onPointerUp: V,
|
|
379
379
|
onPointerCancel: V,
|
|
380
|
-
onWheel:
|
|
380
|
+
onWheel: I,
|
|
381
381
|
onContextMenu: (c) => c.preventDefault(),
|
|
382
382
|
className: "whiteboard-shell",
|
|
383
383
|
children: /* @__PURE__ */ d(
|
|
@@ -393,136 +393,136 @@ function xt({ children: e, showMinimap: t = !0, minimapLoading: r = !1, extraAct
|
|
|
393
393
|
)
|
|
394
394
|
}
|
|
395
395
|
),
|
|
396
|
-
/* @__PURE__ */ n(
|
|
397
|
-
t ? /* @__PURE__ */ n(
|
|
396
|
+
/* @__PURE__ */ n(Ue, { extraActions: s }),
|
|
397
|
+
t ? /* @__PURE__ */ n(Ze, { loading: r }) : null
|
|
398
398
|
] });
|
|
399
399
|
}
|
|
400
|
-
const St =
|
|
400
|
+
const St = Re(function({
|
|
401
401
|
title: t,
|
|
402
402
|
defaultPosition: r,
|
|
403
403
|
width: s = 300,
|
|
404
404
|
className: a,
|
|
405
405
|
trackRect: u,
|
|
406
|
-
focusable:
|
|
406
|
+
focusable: m,
|
|
407
407
|
focusPadding: f = 40,
|
|
408
|
-
focusMaxScale:
|
|
409
|
-
headerActions:
|
|
408
|
+
focusMaxScale: p = 1.5,
|
|
409
|
+
headerActions: b,
|
|
410
410
|
children: h
|
|
411
411
|
}) {
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}, [$]),
|
|
416
|
-
E.current = V, U.current =
|
|
417
|
-
}, [V,
|
|
418
|
-
const
|
|
419
|
-
const
|
|
412
|
+
const k = We(), [M, _] = Se(r), v = S(!1), P = S(M), L = S(null), H = S(null), $ = g((o) => o.scale), V = g((o) => o.snapToGrid), I = g((o) => o.snapGridSize), c = g((o) => o.register), R = g((o) => o.unregister), W = g((o) => o.registerReset), z = g((o) => o.unregisterReset), O = g((o) => o.focusPanel), C = S($), E = S(!1), U = S(20), Z = S(r), X = S(null), q = S(null);
|
|
413
|
+
Y(() => {
|
|
414
|
+
C.current = $;
|
|
415
|
+
}, [$]), Y(() => {
|
|
416
|
+
E.current = V, U.current = I;
|
|
417
|
+
}, [V, I]), Y(() => {
|
|
418
|
+
const o = () => {
|
|
419
|
+
const w = U.current;
|
|
420
420
|
_((N) => {
|
|
421
|
-
const
|
|
422
|
-
x: Math.round(N.x /
|
|
423
|
-
y: Math.round(N.y /
|
|
421
|
+
const i = {
|
|
422
|
+
x: Math.round(N.x / w) * w,
|
|
423
|
+
y: Math.round(N.y / w) * w
|
|
424
424
|
};
|
|
425
|
-
return
|
|
425
|
+
return i.x === N.x && i.y === N.y ? N : i;
|
|
426
426
|
});
|
|
427
427
|
};
|
|
428
|
-
return window.addEventListener("whiteboard-snap-now",
|
|
429
|
-
}, []),
|
|
430
|
-
P.current =
|
|
431
|
-
}, [
|
|
432
|
-
const j =
|
|
433
|
-
const
|
|
434
|
-
if (!
|
|
435
|
-
const
|
|
428
|
+
return window.addEventListener("whiteboard-snap-now", o), () => window.removeEventListener("whiteboard-snap-now", o);
|
|
429
|
+
}, []), Y(() => {
|
|
430
|
+
P.current = M;
|
|
431
|
+
}, [M]);
|
|
432
|
+
const j = B(() => {
|
|
433
|
+
const o = L.current;
|
|
434
|
+
if (!o) return;
|
|
435
|
+
const w = {
|
|
436
436
|
x: P.current.x,
|
|
437
437
|
y: P.current.y,
|
|
438
|
-
width:
|
|
439
|
-
height:
|
|
438
|
+
width: o.offsetWidth,
|
|
439
|
+
height: o.offsetHeight,
|
|
440
440
|
focusPadding: f,
|
|
441
|
-
focusMaxScale:
|
|
442
|
-
}, N =
|
|
443
|
-
N && N.x ===
|
|
444
|
-
}, [
|
|
445
|
-
const
|
|
446
|
-
return
|
|
441
|
+
focusMaxScale: p
|
|
442
|
+
}, N = H.current;
|
|
443
|
+
N && N.x === w.x && N.y === w.y && N.width === w.width && N.height === w.height && N.focusPadding === w.focusPadding && N.focusMaxScale === w.focusMaxScale || (H.current = w, c(k, w), u && (u.current = w));
|
|
444
|
+
}, [p, f, k, c, u]), Q = B(() => {
|
|
445
|
+
const o = L.current;
|
|
446
|
+
return o ? {
|
|
447
447
|
x: P.current.x,
|
|
448
448
|
y: P.current.y,
|
|
449
|
-
width:
|
|
450
|
-
height:
|
|
449
|
+
width: o.offsetWidth,
|
|
450
|
+
height: o.offsetHeight,
|
|
451
451
|
focusPadding: f,
|
|
452
|
-
focusMaxScale:
|
|
452
|
+
focusMaxScale: p
|
|
453
453
|
} : null;
|
|
454
|
-
}, [
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
}, [O, f,
|
|
458
|
-
|
|
459
|
-
var
|
|
460
|
-
(
|
|
461
|
-
}), [
|
|
454
|
+
}, [p, f]), K = B(() => {
|
|
455
|
+
const o = Q();
|
|
456
|
+
o && O(o, { padding: f, maxScale: p });
|
|
457
|
+
}, [O, f, p, Q]);
|
|
458
|
+
Y(() => (W(k, () => _(Z.current)), () => {
|
|
459
|
+
var o;
|
|
460
|
+
(o = X.current) == null || o.call(X), R(k), z(k), H.current = null;
|
|
461
|
+
}), [k, W, R, z]), Xe(() => {
|
|
462
462
|
j();
|
|
463
|
-
}, [
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
466
|
-
const
|
|
463
|
+
}, [M.x, M.y, s, j]), Y(() => {
|
|
464
|
+
const o = L.current;
|
|
465
|
+
if (!o || typeof ResizeObserver > "u") return;
|
|
466
|
+
const w = new ResizeObserver(() => {
|
|
467
467
|
j();
|
|
468
468
|
});
|
|
469
|
-
return
|
|
469
|
+
return w.observe(o), () => w.disconnect();
|
|
470
470
|
}, [j]);
|
|
471
|
-
const se =
|
|
471
|
+
const se = B((o) => {
|
|
472
472
|
var ae;
|
|
473
|
-
if (
|
|
473
|
+
if (o.button !== 0) return;
|
|
474
474
|
v.current = !0;
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
const
|
|
475
|
+
const w = o.clientX, N = o.clientY, i = P.current.x, y = P.current.y, x = C.current;
|
|
476
|
+
o.preventDefault(), o.stopPropagation(), o.target.setPointerCapture(o.pointerId);
|
|
477
|
+
const F = (ie) => {
|
|
478
478
|
if (!v.current) return;
|
|
479
|
-
const
|
|
479
|
+
const oe = i + (ie.clientX - w) / x, ce = y + (ie.clientY - N) / x, le = U.current, Ce = E.current ? Math.round(oe / le) * le : oe, Te = E.current ? Math.round(ce / le) * le : ce;
|
|
480
480
|
_({
|
|
481
481
|
x: Ce,
|
|
482
|
-
y:
|
|
482
|
+
y: Te
|
|
483
483
|
});
|
|
484
484
|
}, A = () => {
|
|
485
|
-
v.current = !1, window.removeEventListener("pointermove",
|
|
485
|
+
v.current = !1, window.removeEventListener("pointermove", F), window.removeEventListener("pointerup", A), X.current = null;
|
|
486
486
|
};
|
|
487
|
-
(ae =
|
|
488
|
-
}, []),
|
|
487
|
+
(ae = X.current) == null || ae.call(X), window.addEventListener("pointermove", F), window.addEventListener("pointerup", A), X.current = A;
|
|
488
|
+
}, []), we = a ? `floating-panel ${a}` : "floating-panel";
|
|
489
489
|
return /* @__PURE__ */ d(
|
|
490
490
|
"div",
|
|
491
491
|
{
|
|
492
492
|
ref: L,
|
|
493
|
-
className:
|
|
494
|
-
style: { left:
|
|
495
|
-
onPointerDown: (
|
|
496
|
-
onPointerUp: (
|
|
493
|
+
className: we,
|
|
494
|
+
style: { left: M.x, top: M.y, width: s },
|
|
495
|
+
onPointerDown: (o) => o.stopPropagation(),
|
|
496
|
+
onPointerUp: (o) => {
|
|
497
497
|
if (v.current) return;
|
|
498
|
-
const
|
|
499
|
-
if (N &&
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
|
|
498
|
+
const w = Date.now(), N = q.current;
|
|
499
|
+
if (N && w - N.time < 300) {
|
|
500
|
+
const i = o.clientX - N.x, y = o.clientY - N.y;
|
|
501
|
+
if (i * i + y * y < 100) {
|
|
502
|
+
o.stopPropagation(), K(), q.current = null;
|
|
503
503
|
return;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
q.current = { time:
|
|
506
|
+
q.current = { time: w, x: o.clientX, y: o.clientY };
|
|
507
507
|
},
|
|
508
|
-
onWheel: (
|
|
509
|
-
onDoubleClick: (
|
|
510
|
-
|
|
508
|
+
onWheel: (o) => o.stopPropagation(),
|
|
509
|
+
onDoubleClick: (o) => {
|
|
510
|
+
o.stopPropagation(), K();
|
|
511
511
|
},
|
|
512
512
|
children: [
|
|
513
513
|
/* @__PURE__ */ d("div", { onPointerDown: se, className: "floating-panel__header", children: [
|
|
514
514
|
/* @__PURE__ */ n("strong", { className: "floating-panel__title", children: t }),
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
b,
|
|
516
|
+
m && /* @__PURE__ */ n(
|
|
517
517
|
"button",
|
|
518
518
|
{
|
|
519
519
|
type: "button",
|
|
520
520
|
className: "wb-btn wb-btn--secondary wb-btn--icon-only floating-panel__focus",
|
|
521
521
|
onClick: K,
|
|
522
|
-
onPointerDown: (
|
|
522
|
+
onPointerDown: (o) => o.stopPropagation(),
|
|
523
523
|
title: "Focus on this panel",
|
|
524
524
|
"aria-label": "Focus on this panel",
|
|
525
|
-
children: /* @__PURE__ */ n(
|
|
525
|
+
children: /* @__PURE__ */ n(Oe, { size: 14 })
|
|
526
526
|
}
|
|
527
527
|
)
|
|
528
528
|
] }),
|
|
@@ -531,10 +531,10 @@ const St = Te(function({
|
|
|
531
531
|
}
|
|
532
532
|
);
|
|
533
533
|
});
|
|
534
|
-
function
|
|
534
|
+
function kt(e) {
|
|
535
535
|
return S({ ...e, width: 0, height: 0 });
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Mt(e, t = he) {
|
|
538
538
|
return { x: e.x, y: e.y + e.height + t };
|
|
539
539
|
}
|
|
540
540
|
function _t({
|
|
@@ -544,16 +544,16 @@ function _t({
|
|
|
544
544
|
onConfirm: s,
|
|
545
545
|
onCancel: a,
|
|
546
546
|
confirmLabel: u = "Confirm",
|
|
547
|
-
loading:
|
|
547
|
+
loading: m,
|
|
548
548
|
error: f
|
|
549
549
|
}) {
|
|
550
|
-
return
|
|
550
|
+
return Y(() => {
|
|
551
551
|
if (!e) return;
|
|
552
|
-
const
|
|
553
|
-
|
|
552
|
+
const p = (b) => {
|
|
553
|
+
b.key === "Escape" && a();
|
|
554
554
|
};
|
|
555
|
-
return window.addEventListener("keydown",
|
|
556
|
-
}, [e, a]), !e || typeof document > "u" ? null :
|
|
555
|
+
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
556
|
+
}, [e, a]), !e || typeof document > "u" ? null : Ie(
|
|
557
557
|
/* @__PURE__ */ n("div", { className: "confirm-modal-overlay", onMouseDown: a, children: /* @__PURE__ */ d(
|
|
558
558
|
"div",
|
|
559
559
|
{
|
|
@@ -561,20 +561,20 @@ function _t({
|
|
|
561
561
|
role: "dialog",
|
|
562
562
|
"aria-modal": "true",
|
|
563
563
|
"aria-label": t,
|
|
564
|
-
onMouseDown: (
|
|
564
|
+
onMouseDown: (p) => p.stopPropagation(),
|
|
565
565
|
children: [
|
|
566
566
|
/* @__PURE__ */ d("div", { className: "confirm-modal__header", children: [
|
|
567
567
|
/* @__PURE__ */ d("span", { className: "confirm-modal__title", children: [
|
|
568
|
-
/* @__PURE__ */ n(
|
|
568
|
+
/* @__PURE__ */ n(Be, { size: 16 }),
|
|
569
569
|
t
|
|
570
570
|
] }),
|
|
571
|
-
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only", onClick: a, "aria-label": "Close dialog", children: /* @__PURE__ */ n(
|
|
571
|
+
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only", onClick: a, "aria-label": "Close dialog", children: /* @__PURE__ */ n(ke, { size: 14 }) })
|
|
572
572
|
] }),
|
|
573
573
|
/* @__PURE__ */ n("p", { className: "confirm-modal__message", children: r }),
|
|
574
574
|
f && /* @__PURE__ */ n("div", { className: "wb-alert wb-alert--error", children: f }),
|
|
575
575
|
/* @__PURE__ */ d("div", { className: "wb-btn-row", children: [
|
|
576
576
|
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--secondary", onClick: a, children: "Cancel" }),
|
|
577
|
-
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--danger", onClick: s, disabled:
|
|
577
|
+
/* @__PURE__ */ n("button", { type: "button", className: "wb-btn wb-btn--danger", onClick: s, disabled: m, children: m ? "Deleting..." : /* @__PURE__ */ d(re, { children: [
|
|
578
578
|
/* @__PURE__ */ n(He, { size: 14 }),
|
|
579
579
|
u
|
|
580
580
|
] }) })
|
|
@@ -585,7 +585,7 @@ function _t({
|
|
|
585
585
|
document.body
|
|
586
586
|
);
|
|
587
587
|
}
|
|
588
|
-
class Pt extends
|
|
588
|
+
class Pt extends Ye {
|
|
589
589
|
constructor() {
|
|
590
590
|
super(...arguments), this.state = { error: null };
|
|
591
591
|
}
|
|
@@ -607,7 +607,7 @@ class Pt extends De {
|
|
|
607
607
|
] }) : this.props.children;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function zt({
|
|
611
611
|
widths: e,
|
|
612
612
|
startX: t = 20,
|
|
613
613
|
y: r = 40,
|
|
@@ -615,8 +615,8 @@ function Ct({
|
|
|
615
615
|
}) {
|
|
616
616
|
const a = ye(() => {
|
|
617
617
|
const f = {};
|
|
618
|
-
for (const [
|
|
619
|
-
f[
|
|
618
|
+
for (const [p, b] of Object.entries(e))
|
|
619
|
+
f[p] = ue(b);
|
|
620
620
|
return f;
|
|
621
621
|
}, [e]), u = ye(
|
|
622
622
|
() => ({
|
|
@@ -625,52 +625,55 @@ function Ct({
|
|
|
625
625
|
gap: ue(s)
|
|
626
626
|
}),
|
|
627
627
|
[t, r, s]
|
|
628
|
-
),
|
|
628
|
+
), m = ye(() => {
|
|
629
629
|
const f = {};
|
|
630
|
-
let
|
|
631
|
-
for (const [
|
|
632
|
-
f[
|
|
630
|
+
let p = u.startX;
|
|
631
|
+
for (const [b, h] of Object.entries(a))
|
|
632
|
+
f[b] = { x: p, y: u.y }, p += h + u.gap;
|
|
633
633
|
return f;
|
|
634
634
|
}, [u.gap, u.startX, u.y, a]);
|
|
635
|
-
return { layout: u, panelWidth: a, positions:
|
|
635
|
+
return { layout: u, panelWidth: a, positions: m };
|
|
636
636
|
}
|
|
637
637
|
function l(...e) {
|
|
638
638
|
return e.filter(Boolean).join(" ");
|
|
639
639
|
}
|
|
640
|
-
const
|
|
640
|
+
const qe = {
|
|
641
641
|
error: "status-error",
|
|
642
642
|
muted: "text-sm text-muted",
|
|
643
643
|
info: "ui-alert ui-alert--info",
|
|
644
644
|
success: "ui-alert ui-alert--success"
|
|
645
645
|
};
|
|
646
|
-
function
|
|
647
|
-
return /* @__PURE__ */ n("p", { className: l(
|
|
646
|
+
function Ct({ tone: e = "info", className: t, ...r }) {
|
|
647
|
+
return /* @__PURE__ */ n("p", { className: l(qe[e], t), ...r });
|
|
648
648
|
}
|
|
649
|
-
|
|
649
|
+
function Tt({ className: e, ...t }) {
|
|
650
|
+
return /* @__PURE__ */ n("span", { className: l("avatar-badge", e), ...t });
|
|
651
|
+
}
|
|
652
|
+
const Ke = {
|
|
650
653
|
primary: "",
|
|
651
654
|
secondary: "secondary-btn",
|
|
652
655
|
danger: "danger-btn"
|
|
653
|
-
},
|
|
656
|
+
}, Me = me(function({
|
|
654
657
|
variant: t = "primary",
|
|
655
658
|
fullWidth: r = !1,
|
|
656
659
|
iconOnly: s = !1,
|
|
657
660
|
loading: a = !1,
|
|
658
661
|
disabled: u,
|
|
659
|
-
className:
|
|
662
|
+
className: m,
|
|
660
663
|
children: f,
|
|
661
|
-
loadingText:
|
|
662
|
-
...
|
|
664
|
+
loadingText: p,
|
|
665
|
+
...b
|
|
663
666
|
}, h) {
|
|
664
667
|
return /* @__PURE__ */ n(
|
|
665
668
|
"button",
|
|
666
669
|
{
|
|
667
670
|
ref: h,
|
|
668
|
-
className: l(
|
|
671
|
+
className: l(Ke[t], r && "full-width-btn", s && "icon-only-btn", m),
|
|
669
672
|
disabled: u || a,
|
|
670
|
-
...
|
|
673
|
+
...b,
|
|
671
674
|
children: a ? /* @__PURE__ */ d(re, { children: [
|
|
672
|
-
/* @__PURE__ */ n(
|
|
673
|
-
|
|
675
|
+
/* @__PURE__ */ n(pe, { size: 14, className: "icon-spin" }),
|
|
676
|
+
p || f
|
|
674
677
|
] }) : f
|
|
675
678
|
}
|
|
676
679
|
);
|
|
@@ -681,7 +684,13 @@ function Je({ as: e = "div", className: t, ...r }) {
|
|
|
681
684
|
...r
|
|
682
685
|
});
|
|
683
686
|
}
|
|
684
|
-
function
|
|
687
|
+
function Rt({ children: e, hint: t, className: r, ...s }) {
|
|
688
|
+
return /* @__PURE__ */ n("div", { className: "canvas-wrap", children: /* @__PURE__ */ d("div", { className: l("canvas-stage", r), ...s, children: [
|
|
689
|
+
e,
|
|
690
|
+
t && /* @__PURE__ */ n("p", { className: "canvas-hint", children: t })
|
|
691
|
+
] }) });
|
|
692
|
+
}
|
|
693
|
+
function Wt({ className: e, ...t }) {
|
|
685
694
|
return /* @__PURE__ */ n("span", { className: l("chip", e), ...t });
|
|
686
695
|
}
|
|
687
696
|
function Qe({ active: e = !1, className: t, ...r }) {
|
|
@@ -695,7 +704,7 @@ function Qe({ active: e = !1, className: t, ...r }) {
|
|
|
695
704
|
}
|
|
696
705
|
);
|
|
697
706
|
}
|
|
698
|
-
function
|
|
707
|
+
function fe({ as: e = "ul", reset: t = !0, className: r, ...s }) {
|
|
699
708
|
return T(e, {
|
|
700
709
|
className: l(t && "list-reset", r),
|
|
701
710
|
...s
|
|
@@ -706,7 +715,7 @@ const et = {
|
|
|
706
715
|
md: "skeleton--md",
|
|
707
716
|
pill: "skeleton--pill"
|
|
708
717
|
};
|
|
709
|
-
function
|
|
718
|
+
function G({ as: e = "div", radius: t = "sm", className: r, ...s }) {
|
|
710
719
|
return T(e, {
|
|
711
720
|
className: l("skeleton", et[t], r),
|
|
712
721
|
"aria-hidden": !0,
|
|
@@ -715,54 +724,54 @@ function I({ as: e = "div", radius: t = "sm", className: r, ...s }) {
|
|
|
715
724
|
}
|
|
716
725
|
function tt(e) {
|
|
717
726
|
const { className: t, ...r } = e;
|
|
718
|
-
return /* @__PURE__ */ n(
|
|
727
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-input", t), ...r });
|
|
719
728
|
}
|
|
720
729
|
function ve(e) {
|
|
721
730
|
const { className: t, ...r } = e;
|
|
722
|
-
return /* @__PURE__ */ n(
|
|
731
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-btn", t), ...r });
|
|
723
732
|
}
|
|
724
|
-
function
|
|
733
|
+
function Xt(e) {
|
|
725
734
|
const { className: t, ...r } = e;
|
|
726
|
-
return /* @__PURE__ */ n(
|
|
735
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-icon-btn", t), ...r });
|
|
727
736
|
}
|
|
728
737
|
function nt(e) {
|
|
729
738
|
const { className: t, ...r } = e;
|
|
730
|
-
return /* @__PURE__ */ n(
|
|
739
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-select", t), ...r });
|
|
731
740
|
}
|
|
732
|
-
function
|
|
741
|
+
function Yt(e) {
|
|
733
742
|
const { className: t, ...r } = e;
|
|
734
|
-
return /* @__PURE__ */ n(
|
|
743
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-textarea", t), ...r });
|
|
735
744
|
}
|
|
736
|
-
function
|
|
745
|
+
function _e(e) {
|
|
737
746
|
const { className: t, ...r } = e;
|
|
738
|
-
return /* @__PURE__ */ n(
|
|
747
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-thumb", t), ...r });
|
|
739
748
|
}
|
|
740
749
|
function ne(e) {
|
|
741
750
|
const { className: t, ...r } = e;
|
|
742
|
-
return /* @__PURE__ */ n(
|
|
751
|
+
return /* @__PURE__ */ n(G, { radius: "pill", className: l("skeleton-chip", t), ...r });
|
|
743
752
|
}
|
|
744
|
-
function
|
|
753
|
+
function ge(e) {
|
|
745
754
|
const { className: t, ...r } = e;
|
|
746
|
-
return /* @__PURE__ */ n(
|
|
755
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-title", t), ...r });
|
|
747
756
|
}
|
|
748
|
-
function
|
|
749
|
-
return /* @__PURE__ */ n(
|
|
757
|
+
function be({ short: e = !1, className: t, ...r }) {
|
|
758
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-line", e && "skeleton-line--short", t), ...r });
|
|
750
759
|
}
|
|
751
760
|
function rt(e) {
|
|
752
761
|
const { className: t, ...r } = e;
|
|
753
|
-
return /* @__PURE__ */ n(
|
|
762
|
+
return /* @__PURE__ */ n(G, { radius: "pill", className: l("skeleton-avatar", t), ...r });
|
|
754
763
|
}
|
|
755
764
|
function Dt(e) {
|
|
756
765
|
const { className: t, ...r } = e;
|
|
757
|
-
return /* @__PURE__ */ n(
|
|
766
|
+
return /* @__PURE__ */ n(G, { className: l("skeleton-canvas", t), ...r });
|
|
758
767
|
}
|
|
759
|
-
function
|
|
768
|
+
function It({
|
|
760
769
|
options: e,
|
|
761
770
|
value: t,
|
|
762
771
|
onChange: r,
|
|
763
772
|
className: s
|
|
764
773
|
}) {
|
|
765
|
-
return /* @__PURE__ */ n(
|
|
774
|
+
return /* @__PURE__ */ n(fe, { className: l("choice-list", s), children: e.map((a) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
766
775
|
Qe,
|
|
767
776
|
{
|
|
768
777
|
active: t === a.value,
|
|
@@ -776,16 +785,16 @@ function Xt({
|
|
|
776
785
|
}
|
|
777
786
|
) }, a.value)) });
|
|
778
787
|
}
|
|
779
|
-
function
|
|
780
|
-
return /* @__PURE__ */ n(
|
|
781
|
-
/* @__PURE__ */ n(
|
|
782
|
-
r ? /* @__PURE__ */ n(
|
|
788
|
+
function Ft({ count: e = 4, className: t, withDescription: r = !1 }) {
|
|
789
|
+
return /* @__PURE__ */ n(fe, { className: l("choice-list", t), "aria-hidden": !0, children: Array.from({ length: e }).map((s, a) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ d("div", { className: "choice-card", children: [
|
|
790
|
+
/* @__PURE__ */ n(ge, { className: l("skeleton-title--sm", !r && "skeleton-choice-label") }),
|
|
791
|
+
r ? /* @__PURE__ */ n(be, { short: !0 }) : null
|
|
783
792
|
] }) }, `choice-skeleton-${a}`)) });
|
|
784
793
|
}
|
|
785
|
-
function
|
|
794
|
+
function Gt({ className: e, ...t }) {
|
|
786
795
|
return /* @__PURE__ */ n("div", { className: l("coord-grid", e), ...t });
|
|
787
796
|
}
|
|
788
|
-
function
|
|
797
|
+
function Lt({ axis: e, className: t, ...r }) {
|
|
789
798
|
return /* @__PURE__ */ d("label", { className: l("coord-input", t), children: [
|
|
790
799
|
e,
|
|
791
800
|
" ",
|
|
@@ -814,81 +823,81 @@ function at({ as: e = "p", clamp: t = !1, className: r, ...s }) {
|
|
|
814
823
|
...s
|
|
815
824
|
});
|
|
816
825
|
}
|
|
817
|
-
function
|
|
826
|
+
function Et({ as: e = "h3", className: t, ...r }) {
|
|
818
827
|
return T(e, {
|
|
819
828
|
className: l("story-title", t),
|
|
820
829
|
...r
|
|
821
830
|
});
|
|
822
831
|
}
|
|
823
|
-
function
|
|
832
|
+
function Pe({ as: e = "p", size: t = "sm", className: r, ...s }) {
|
|
824
833
|
return T(e, {
|
|
825
834
|
className: l(st[t], "text-muted", r),
|
|
826
835
|
...s
|
|
827
836
|
});
|
|
828
837
|
}
|
|
829
|
-
function
|
|
838
|
+
function At({ as: e = "h1", className: t, ...r }) {
|
|
830
839
|
return T(e, {
|
|
831
840
|
className: l("page-title", t),
|
|
832
841
|
...r
|
|
833
842
|
});
|
|
834
843
|
}
|
|
835
|
-
function
|
|
844
|
+
function it({ as: e = "span", className: t, ...r }) {
|
|
836
845
|
return T(e, {
|
|
837
846
|
className: l("widget-section__title", t),
|
|
838
847
|
...r
|
|
839
848
|
});
|
|
840
849
|
}
|
|
841
|
-
function
|
|
850
|
+
function ot({ as: e = "p", className: t, ...r }) {
|
|
842
851
|
return T(e, {
|
|
843
852
|
className: l("widget-section__description", t),
|
|
844
853
|
...r
|
|
845
854
|
});
|
|
846
855
|
}
|
|
847
|
-
function
|
|
856
|
+
function Ot({ title: e, description: t, action: r }) {
|
|
848
857
|
return /* @__PURE__ */ d(J, { size: "sm", children: [
|
|
849
858
|
/* @__PURE__ */ n(at, { children: e }),
|
|
850
|
-
t ? /* @__PURE__ */ n(
|
|
859
|
+
t ? /* @__PURE__ */ n(Pe, { children: t }) : null,
|
|
851
860
|
r
|
|
852
861
|
] });
|
|
853
862
|
}
|
|
854
863
|
function ct({ className: e, ...t }) {
|
|
855
864
|
return /* @__PURE__ */ n("label", { className: l("widget-label", e), ...t });
|
|
856
865
|
}
|
|
857
|
-
function
|
|
866
|
+
function Bt({
|
|
858
867
|
as: e,
|
|
859
868
|
label: t,
|
|
860
869
|
htmlFor: r,
|
|
861
870
|
hint: s,
|
|
862
871
|
error: a,
|
|
863
872
|
layout: u = "stack",
|
|
864
|
-
className:
|
|
873
|
+
className: m,
|
|
865
874
|
children: f,
|
|
866
|
-
...
|
|
875
|
+
...p
|
|
867
876
|
}) {
|
|
868
877
|
return T(
|
|
869
878
|
e ?? "div",
|
|
870
879
|
{
|
|
871
|
-
className: l(u === "control" ? "widget-control" : "panel-stack-sm",
|
|
872
|
-
...
|
|
880
|
+
className: l(u === "control" ? "widget-control" : "panel-stack-sm", m),
|
|
881
|
+
...p
|
|
873
882
|
},
|
|
874
883
|
/* @__PURE__ */ d(re, { children: [
|
|
875
884
|
t ? /* @__PURE__ */ n(ct, { htmlFor: r, children: t }) : null,
|
|
876
885
|
f,
|
|
877
|
-
s ? /* @__PURE__ */ n(
|
|
886
|
+
s ? /* @__PURE__ */ n(Pe, { size: "xs", children: s }) : null,
|
|
878
887
|
a ? /* @__PURE__ */ n("p", { className: "field-error", children: a }) : null
|
|
879
888
|
] })
|
|
880
889
|
);
|
|
881
890
|
}
|
|
882
|
-
function
|
|
891
|
+
function Ht({ isGenerating: e, children: t, message: r }) {
|
|
883
892
|
return /* @__PURE__ */ d("div", { className: "generating-overlay-wrap", children: [
|
|
884
893
|
t,
|
|
885
894
|
e && /* @__PURE__ */ d("div", { className: "generating-overlay", "aria-live": "polite", children: [
|
|
886
|
-
/* @__PURE__ */ n(
|
|
895
|
+
/* @__PURE__ */ n(pe, { size: 20, className: "icon-spin" }),
|
|
887
896
|
/* @__PURE__ */ n("span", { children: r ?? "Generating, please wait…" })
|
|
888
897
|
] })
|
|
889
898
|
] });
|
|
890
899
|
}
|
|
891
|
-
function
|
|
900
|
+
function $t({ as: e = "span", icon: t, className: r, children: s, ...a }) {
|
|
892
901
|
return T(
|
|
893
902
|
e,
|
|
894
903
|
{
|
|
@@ -901,18 +910,18 @@ function Ht({ as: e = "span", icon: t, className: r, children: s, ...a }) {
|
|
|
901
910
|
] })
|
|
902
911
|
);
|
|
903
912
|
}
|
|
904
|
-
function
|
|
913
|
+
function Vt({
|
|
905
914
|
src: e,
|
|
906
915
|
alt: t,
|
|
907
916
|
placeholder: r = "No image",
|
|
908
917
|
size: s = "md",
|
|
909
918
|
fit: a = "contain",
|
|
910
919
|
onImageError: u,
|
|
911
|
-
className:
|
|
920
|
+
className: m,
|
|
912
921
|
...f
|
|
913
922
|
}) {
|
|
914
|
-
const [
|
|
915
|
-
return /* @__PURE__ */ n("div", { className:
|
|
923
|
+
const [p, b] = Se(null), h = !!(e && p === e), k = l("image-thumb", `image-thumb--${s}`, `image-thumb--fit-${a}`, m);
|
|
924
|
+
return /* @__PURE__ */ n("div", { className: k, ...f, children: e && !h ? /* @__PURE__ */ n(
|
|
916
925
|
"img",
|
|
917
926
|
{
|
|
918
927
|
src: e,
|
|
@@ -920,7 +929,7 @@ function Bt({
|
|
|
920
929
|
className: "image-thumb__img",
|
|
921
930
|
style: { objectFit: a, objectPosition: "center" },
|
|
922
931
|
onError: () => {
|
|
923
|
-
|
|
932
|
+
b(e), u == null || u();
|
|
924
933
|
}
|
|
925
934
|
}
|
|
926
935
|
) : /* @__PURE__ */ n("span", { className: "image-thumb__placeholder", children: r }) });
|
|
@@ -936,10 +945,10 @@ function lt({
|
|
|
936
945
|
...s
|
|
937
946
|
});
|
|
938
947
|
}
|
|
939
|
-
const
|
|
948
|
+
const jt = me(function({ className: t, ...r }, s) {
|
|
940
949
|
return /* @__PURE__ */ n("input", { ref: s, className: l(t), ...r });
|
|
941
950
|
});
|
|
942
|
-
function
|
|
951
|
+
function ze({ as: e = "div", className: t, ...r }) {
|
|
943
952
|
return T(e, {
|
|
944
953
|
className: l("item-card", t),
|
|
945
954
|
...r
|
|
@@ -951,35 +960,62 @@ function ut({ as: e = "div", className: t, ...r }) {
|
|
|
951
960
|
...r
|
|
952
961
|
});
|
|
953
962
|
}
|
|
954
|
-
function
|
|
963
|
+
function Ut({ label: e = "Loading...", className: t }) {
|
|
955
964
|
return /* @__PURE__ */ d("span", { className: l("status-inline", t), children: [
|
|
956
|
-
/* @__PURE__ */ n(
|
|
965
|
+
/* @__PURE__ */ n(pe, { size: 14, className: "icon-spin" }),
|
|
957
966
|
e
|
|
958
967
|
] });
|
|
959
968
|
}
|
|
960
|
-
function
|
|
969
|
+
function Zt({
|
|
970
|
+
className: e,
|
|
971
|
+
placement: t,
|
|
972
|
+
onPointerDown: r,
|
|
973
|
+
onWheel: s,
|
|
974
|
+
onContextMenu: a,
|
|
975
|
+
...u
|
|
976
|
+
}) {
|
|
977
|
+
return /* @__PURE__ */ n(
|
|
978
|
+
Me,
|
|
979
|
+
{
|
|
980
|
+
variant: "secondary",
|
|
981
|
+
iconOnly: !0,
|
|
982
|
+
className: l("overlay-icon-btn", t && `overlay-icon-btn--${t}`, e),
|
|
983
|
+
onPointerDown: (m) => {
|
|
984
|
+
m.stopPropagation(), r == null || r(m);
|
|
985
|
+
},
|
|
986
|
+
onWheel: (m) => {
|
|
987
|
+
m.stopPropagation(), s == null || s(m);
|
|
988
|
+
},
|
|
989
|
+
onContextMenu: (m) => {
|
|
990
|
+
m.stopPropagation(), a == null || a(m);
|
|
991
|
+
},
|
|
992
|
+
...u
|
|
993
|
+
}
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
function qt({ children: e, className: t, ...r }) {
|
|
961
997
|
return /* @__PURE__ */ n("main", { className: l("page-shell", t), ...r, children: e });
|
|
962
998
|
}
|
|
963
|
-
function
|
|
999
|
+
function Kt({ children: e, className: t, ...r }) {
|
|
964
1000
|
return /* @__PURE__ */ n("div", { className: l("page-card", t), ...r, children: e });
|
|
965
1001
|
}
|
|
966
|
-
function
|
|
967
|
-
return /* @__PURE__ */ d(
|
|
968
|
-
/* @__PURE__ */ n(
|
|
1002
|
+
function Jt({ onClick: e, label: t = "Close" }) {
|
|
1003
|
+
return /* @__PURE__ */ d(Me, { variant: "secondary", className: "panel-close-btn", onClick: e, children: [
|
|
1004
|
+
/* @__PURE__ */ n(ke, { size: 14 }),
|
|
969
1005
|
t
|
|
970
1006
|
] });
|
|
971
1007
|
}
|
|
972
|
-
function
|
|
1008
|
+
function Qt({ heading: e, description: t, actions: r, className: s, children: a, ...u }) {
|
|
973
1009
|
return /* @__PURE__ */ d("section", { className: l("widget-section", s), ...u, children: [
|
|
974
1010
|
e || r ? /* @__PURE__ */ d("header", { className: r ? "title-row" : void 0, children: [
|
|
975
|
-
e ? /* @__PURE__ */ n(
|
|
1011
|
+
e ? /* @__PURE__ */ n(it, { children: e }) : null,
|
|
976
1012
|
r
|
|
977
1013
|
] }) : null,
|
|
978
|
-
t ? /* @__PURE__ */ n(
|
|
1014
|
+
t ? /* @__PURE__ */ n(ot, { children: t }) : null,
|
|
979
1015
|
a
|
|
980
1016
|
] });
|
|
981
1017
|
}
|
|
982
|
-
function
|
|
1018
|
+
function en({ icon: e, label: t }) {
|
|
983
1019
|
return /* @__PURE__ */ d("span", { className: "panel-title-with-icon", children: [
|
|
984
1020
|
/* @__PURE__ */ n(e, { size: 13, className: "panel-title-icon" }),
|
|
985
1021
|
/* @__PURE__ */ n("span", { children: t })
|
|
@@ -996,8 +1032,8 @@ const ht = {
|
|
|
996
1032
|
characters: "picker-grid--characters",
|
|
997
1033
|
library: "picker-grid--library"
|
|
998
1034
|
};
|
|
999
|
-
function
|
|
1000
|
-
return /* @__PURE__ */ n(
|
|
1035
|
+
function tn({ variant: e, className: t, ...r }) {
|
|
1036
|
+
return /* @__PURE__ */ n(fe, { className: l("picker-grid", ht[e], t), ...r });
|
|
1001
1037
|
}
|
|
1002
1038
|
const mt = {
|
|
1003
1039
|
default: "",
|
|
@@ -1005,38 +1041,62 @@ const mt = {
|
|
|
1005
1041
|
warning: "warning",
|
|
1006
1042
|
danger: "danger"
|
|
1007
1043
|
};
|
|
1008
|
-
function
|
|
1044
|
+
function nn({ tone: e = "default", className: t, ...r }) {
|
|
1009
1045
|
return /* @__PURE__ */ n("span", { className: l("pill", mt[e], t), ...r });
|
|
1010
1046
|
}
|
|
1011
|
-
const
|
|
1047
|
+
const rn = me(function({ className: t, ...r }, s) {
|
|
1012
1048
|
return /* @__PURE__ */ n("select", { ref: s, className: l(t), ...r });
|
|
1013
|
-
}),
|
|
1049
|
+
}), pt = {
|
|
1014
1050
|
element: "split-layout--element",
|
|
1015
1051
|
character: "split-layout--character",
|
|
1016
1052
|
user: "split-layout--user"
|
|
1017
1053
|
};
|
|
1018
|
-
function
|
|
1019
|
-
return /* @__PURE__ */ n("div", { className: l("split-layout",
|
|
1054
|
+
function ft({ variant: e, className: t, ...r }) {
|
|
1055
|
+
return /* @__PURE__ */ n("div", { className: l("split-layout", pt[e], t), ...r });
|
|
1020
1056
|
}
|
|
1021
|
-
function
|
|
1057
|
+
function gt({ className: e, ...t }) {
|
|
1022
1058
|
return /* @__PURE__ */ n("div", { className: l("tag-row", e), ...t });
|
|
1023
1059
|
}
|
|
1024
|
-
const
|
|
1060
|
+
const sn = me(function({ className: t, ...r }, s) {
|
|
1025
1061
|
return /* @__PURE__ */ n("textarea", { ref: s, className: l(t), ...r });
|
|
1026
1062
|
});
|
|
1027
|
-
function
|
|
1028
|
-
return /* @__PURE__ */ n("button", { className: e, onClick: r, title: `Switch to ${t === "light" ? "dark" : "light"} mode`, "aria-label": "Toggle theme", children: t === "light" ? a ?? /* @__PURE__ */ n(
|
|
1063
|
+
function an({ className: e, theme: t = "light", onToggle: r, lightIcon: s, darkIcon: a }) {
|
|
1064
|
+
return /* @__PURE__ */ n("button", { className: e, onClick: r, title: `Switch to ${t === "light" ? "dark" : "light"} mode`, "aria-label": "Toggle theme", children: t === "light" ? a ?? /* @__PURE__ */ n($e, {}) : s ?? /* @__PURE__ */ n(Ve, {}) });
|
|
1029
1065
|
}
|
|
1030
|
-
function
|
|
1066
|
+
function on({ className: e, ...t }) {
|
|
1031
1067
|
return /* @__PURE__ */ n("div", { className: l("title-row", e), ...t });
|
|
1032
1068
|
}
|
|
1033
|
-
function
|
|
1069
|
+
function cn({
|
|
1070
|
+
children: e,
|
|
1071
|
+
bottom: t,
|
|
1072
|
+
position: r = "left",
|
|
1073
|
+
className: s,
|
|
1074
|
+
...a
|
|
1075
|
+
}) {
|
|
1076
|
+
return /* @__PURE__ */ d(
|
|
1077
|
+
"nav",
|
|
1078
|
+
{
|
|
1079
|
+
className: l(
|
|
1080
|
+
"vertical-toolbar",
|
|
1081
|
+
r === "right" && "vertical-toolbar--right",
|
|
1082
|
+
r === "static" && "vertical-toolbar--static",
|
|
1083
|
+
s
|
|
1084
|
+
),
|
|
1085
|
+
...a,
|
|
1086
|
+
children: [
|
|
1087
|
+
/* @__PURE__ */ n("div", { className: "vertical-toolbar__links", children: e }),
|
|
1088
|
+
t
|
|
1089
|
+
]
|
|
1090
|
+
}
|
|
1091
|
+
);
|
|
1092
|
+
}
|
|
1093
|
+
function ln({ inputs: e = 1, showButton: t = !0, className: r, ...s }) {
|
|
1034
1094
|
return /* @__PURE__ */ d(J, { className: r, ...s, children: [
|
|
1035
1095
|
Array.from({ length: e }).map((a, u) => /* @__PURE__ */ n(tt, {}, `panel-form-input-${u}`)),
|
|
1036
1096
|
t && /* @__PURE__ */ n(ve, {})
|
|
1037
1097
|
] });
|
|
1038
1098
|
}
|
|
1039
|
-
function
|
|
1099
|
+
function un() {
|
|
1040
1100
|
return /* @__PURE__ */ d("article", { className: "story-card", children: [
|
|
1041
1101
|
/* @__PURE__ */ n("div", { className: "story-cover", children: /* @__PURE__ */ n("div", { className: "story-cover__placeholder story-cover__placeholder--skeleton" }) }),
|
|
1042
1102
|
/* @__PURE__ */ n("div", { className: "story-card__overlay story-card__overlay--skeleton", children: /* @__PURE__ */ d("div", { className: "story-card__overlay-text", children: [
|
|
@@ -1044,17 +1104,17 @@ function an() {
|
|
|
1044
1104
|
/* @__PURE__ */ n(ne, {}),
|
|
1045
1105
|
/* @__PURE__ */ n(ne, {})
|
|
1046
1106
|
] }),
|
|
1047
|
-
/* @__PURE__ */ n(
|
|
1048
|
-
/* @__PURE__ */ n(
|
|
1107
|
+
/* @__PURE__ */ n(ge, {}),
|
|
1108
|
+
/* @__PURE__ */ n(be, { short: !0 })
|
|
1049
1109
|
] }) })
|
|
1050
1110
|
] });
|
|
1051
1111
|
}
|
|
1052
|
-
function
|
|
1053
|
-
return /* @__PURE__ */ n(
|
|
1112
|
+
function bt() {
|
|
1113
|
+
return /* @__PURE__ */ n(ze, { as: "li", children: /* @__PURE__ */ d(ft, { variant: "user", children: [
|
|
1054
1114
|
/* @__PURE__ */ n(rt, {}),
|
|
1055
1115
|
/* @__PURE__ */ d(J, { size: "sm", children: [
|
|
1056
|
-
/* @__PURE__ */ n(
|
|
1057
|
-
/* @__PURE__ */ n(
|
|
1116
|
+
/* @__PURE__ */ n(ge, {}),
|
|
1117
|
+
/* @__PURE__ */ n(be, { short: !0 })
|
|
1058
1118
|
] }),
|
|
1059
1119
|
/* @__PURE__ */ d(J, { size: "sm", children: [
|
|
1060
1120
|
/* @__PURE__ */ n(ne, {}),
|
|
@@ -1062,15 +1122,15 @@ function gt() {
|
|
|
1062
1122
|
] })
|
|
1063
1123
|
] }) });
|
|
1064
1124
|
}
|
|
1065
|
-
function
|
|
1066
|
-
return /* @__PURE__ */ n(ut, { as: "ul", children: Array.from({ length: e }).map((t, r) => /* @__PURE__ */ n(
|
|
1125
|
+
function dn({ count: e = 3 }) {
|
|
1126
|
+
return /* @__PURE__ */ n(ut, { as: "ul", children: Array.from({ length: e }).map((t, r) => /* @__PURE__ */ n(bt, {}, `user-skeleton-${r}`)) });
|
|
1067
1127
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return /* @__PURE__ */ d(
|
|
1128
|
+
function hn() {
|
|
1129
|
+
return /* @__PURE__ */ d(ze, { as: "li", children: [
|
|
1070
1130
|
/* @__PURE__ */ d(J, { size: "sm", children: [
|
|
1071
|
-
/* @__PURE__ */ n(
|
|
1072
|
-
/* @__PURE__ */ n(
|
|
1073
|
-
/* @__PURE__ */ d(
|
|
1131
|
+
/* @__PURE__ */ n(_e, { className: "asset-thumb" }),
|
|
1132
|
+
/* @__PURE__ */ n(ge, {}),
|
|
1133
|
+
/* @__PURE__ */ d(gt, { children: [
|
|
1074
1134
|
/* @__PURE__ */ n(ne, {}),
|
|
1075
1135
|
/* @__PURE__ */ n(ne, {})
|
|
1076
1136
|
] })
|
|
@@ -1081,86 +1141,90 @@ function cn() {
|
|
|
1081
1141
|
] })
|
|
1082
1142
|
] });
|
|
1083
1143
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return /* @__PURE__ */ n(
|
|
1086
|
-
/* @__PURE__ */ n(
|
|
1087
|
-
/* @__PURE__ */ n(
|
|
1144
|
+
function mn({ count: e = 8, gridClass: t }) {
|
|
1145
|
+
return /* @__PURE__ */ n(fe, { className: l("picker-grid", t), children: Array.from({ length: e }).map((r, s) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(dt, { as: "div", className: "picker-card--skeleton", children: /* @__PURE__ */ d(J, { size: "sm", children: [
|
|
1146
|
+
/* @__PURE__ */ n(_e, { className: "asset-thumb" }),
|
|
1147
|
+
/* @__PURE__ */ n(be, { short: !0 })
|
|
1088
1148
|
] }) }) }, `picker-skeleton-${s}`)) });
|
|
1089
1149
|
}
|
|
1090
1150
|
export {
|
|
1091
|
-
|
|
1092
|
-
|
|
1151
|
+
Ct as Alert,
|
|
1152
|
+
hn as AssetCardSkeleton,
|
|
1093
1153
|
at as AssetTitle,
|
|
1154
|
+
Tt as AvatarBadge,
|
|
1094
1155
|
rt as AvatarSkeleton,
|
|
1095
|
-
|
|
1156
|
+
Me as Button,
|
|
1096
1157
|
Je as ButtonRow,
|
|
1097
1158
|
ve as ButtonSkeleton,
|
|
1098
1159
|
Dt as CanvasSkeleton,
|
|
1099
|
-
|
|
1160
|
+
Rt as CanvasStage,
|
|
1161
|
+
Wt as Chip,
|
|
1100
1162
|
ne as ChipSkeleton,
|
|
1101
1163
|
Qe as ChoiceCard,
|
|
1102
|
-
|
|
1103
|
-
|
|
1164
|
+
It as ChoiceGroup,
|
|
1165
|
+
Ft as ChoiceGroupSkeleton,
|
|
1104
1166
|
_t as ConfirmDialog,
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1167
|
+
Gt as CoordGrid,
|
|
1168
|
+
Lt as CoordInput,
|
|
1169
|
+
Ot as EmptyState,
|
|
1170
|
+
Bt as Field,
|
|
1109
1171
|
St as FloatingPanel,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1172
|
+
Ht as GeneratingOverlay,
|
|
1173
|
+
Xt as IconButtonSkeleton,
|
|
1174
|
+
$t as IconText,
|
|
1175
|
+
Vt as ImageThumb,
|
|
1114
1176
|
lt as Inline,
|
|
1115
|
-
|
|
1177
|
+
jt as Input,
|
|
1116
1178
|
tt as InputSkeleton,
|
|
1117
|
-
|
|
1179
|
+
ze as ItemCard,
|
|
1118
1180
|
ut as ItemList,
|
|
1119
1181
|
ct as Label,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1182
|
+
be as LineSkeleton,
|
|
1183
|
+
fe as List,
|
|
1184
|
+
Ut as LoadingState,
|
|
1185
|
+
Ze as Minimap,
|
|
1186
|
+
Pe as MutedText,
|
|
1187
|
+
Zt as OverlayIconButton,
|
|
1188
|
+
Kt as PageCard,
|
|
1189
|
+
qt as PageShell,
|
|
1190
|
+
At as PageTitle,
|
|
1191
|
+
Jt as PanelCloseButton,
|
|
1129
1192
|
Pt as PanelErrorBoundary,
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1193
|
+
ln as PanelFormSkeleton,
|
|
1194
|
+
Qt as PanelSection,
|
|
1195
|
+
en as PanelTitle,
|
|
1133
1196
|
dt as PickerCard,
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1197
|
+
tn as PickerGrid,
|
|
1198
|
+
mn as PickerGridSkeleton,
|
|
1199
|
+
nn as Pill,
|
|
1200
|
+
ot as SectionDescription,
|
|
1201
|
+
it as SectionTitle,
|
|
1202
|
+
rn as Select,
|
|
1140
1203
|
nt as SelectSkeleton,
|
|
1141
|
-
|
|
1142
|
-
|
|
1204
|
+
G as Skeleton,
|
|
1205
|
+
ft as SplitLayout,
|
|
1143
1206
|
J as Stack,
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1207
|
+
un as StoryCardSkeleton,
|
|
1208
|
+
Et as StoryTitle,
|
|
1209
|
+
gt as TagRow,
|
|
1210
|
+
sn as Textarea,
|
|
1211
|
+
Yt as TextareaSkeleton,
|
|
1212
|
+
an as ThemeToggle,
|
|
1213
|
+
_e as ThumbSkeleton,
|
|
1214
|
+
on as TitleRow,
|
|
1215
|
+
ge as TitleSkeleton,
|
|
1216
|
+
bt as UserCardSkeleton,
|
|
1217
|
+
dn as UserListSkeleton,
|
|
1218
|
+
cn as VerticalToolbar,
|
|
1155
1219
|
he as WHITEBOARD_GRID,
|
|
1156
1220
|
xt as WhiteboardShell,
|
|
1157
|
-
|
|
1158
|
-
|
|
1221
|
+
Ue as ZoomBar,
|
|
1222
|
+
Mt as belowPanel,
|
|
1159
1223
|
l as cn,
|
|
1160
1224
|
Ne as computeWhiteboardFit,
|
|
1161
|
-
|
|
1225
|
+
je as computeWhiteboardRectFocus,
|
|
1162
1226
|
ue as snapToWhiteboardGrid,
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1227
|
+
kt as usePanelRect,
|
|
1228
|
+
zt as useWhiteboardLayout,
|
|
1229
|
+
g as useWhiteboardStore
|
|
1166
1230
|
};
|