@objectifthunes/whiteboard 0.3.0 → 0.5.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/README.md +18 -1
- package/dist/index.d.ts +132 -0
- package/dist/index.js +999 -753
- package/dist/whiteboard.css +316 -0
- package/package.json +7 -6
- package/LICENSE +0 -21
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { create as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as d, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as F, useRef as P, useCallback as j, memo as Re, useId as De, useState as we, useLayoutEffect as Ie, Component as Xe, useMemo as be, forwardRef as de, createElement as I } from "react";
|
|
3
|
+
import { create as Ye } from "zustand";
|
|
4
|
+
import { createPortal as Fe } from "react-dom";
|
|
5
|
+
const E = (e = 14) => ({
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
7
|
+
width: e,
|
|
8
|
+
height: e,
|
|
9
9
|
viewBox: "0 0 24 24",
|
|
10
10
|
fill: "none",
|
|
11
11
|
stroke: "currentColor",
|
|
@@ -13,17 +13,17 @@ const D = (t = 14) => ({
|
|
|
13
13
|
strokeLinecap: "round",
|
|
14
14
|
strokeLinejoin: "round"
|
|
15
15
|
});
|
|
16
|
-
function
|
|
17
|
-
return /* @__PURE__ */ r("svg", { ...
|
|
16
|
+
function We({ size: e, ...t }) {
|
|
17
|
+
return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M5 12h14" }) });
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
function Ge({ size: e, ...t }) {
|
|
20
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
21
21
|
/* @__PURE__ */ r("path", { d: "M5 12h14" }),
|
|
22
22
|
/* @__PURE__ */ r("path", { d: "M12 5v14" })
|
|
23
23
|
] });
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
function Ee({ size: e, ...t }) {
|
|
26
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
27
27
|
/* @__PURE__ */ r("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
28
28
|
/* @__PURE__ */ r("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
|
|
29
29
|
/* @__PURE__ */ r("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
|
|
@@ -32,14 +32,14 @@ function Ft({ size: t, ...e }) {
|
|
|
32
32
|
/* @__PURE__ */ r("path", { d: "m16 16-1.9-1.9" })
|
|
33
33
|
] });
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */
|
|
35
|
+
function Le({ size: e, ...t }) {
|
|
36
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
37
37
|
/* @__PURE__ */ r("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
38
38
|
/* @__PURE__ */ r("path", { d: "M3 3v5h5" })
|
|
39
39
|
] });
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */
|
|
41
|
+
function Oe({ size: e, ...t }) {
|
|
42
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
43
43
|
/* @__PURE__ */ r("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
44
44
|
/* @__PURE__ */ r("path", { d: "M3 9h18" }),
|
|
45
45
|
/* @__PURE__ */ r("path", { d: "M3 15h18" }),
|
|
@@ -47,38 +47,38 @@ function Et({ size: t, ...e }) {
|
|
|
47
47
|
/* @__PURE__ */ r("path", { d: "M15 3v18" })
|
|
48
48
|
] });
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
return /* @__PURE__ */
|
|
50
|
+
function $e({ size: e, ...t }) {
|
|
51
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
52
52
|
/* @__PURE__ */ r("polyline", { points: "15 3 21 3 21 9" }),
|
|
53
53
|
/* @__PURE__ */ r("polyline", { points: "9 21 3 21 3 15" }),
|
|
54
54
|
/* @__PURE__ */ r("line", { x1: "21", x2: "14", y1: "3", y2: "10" }),
|
|
55
55
|
/* @__PURE__ */ r("line", { x1: "3", x2: "10", y1: "21", y2: "14" })
|
|
56
56
|
] });
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */ r("svg", { ...
|
|
58
|
+
function he({ size: e, ...t }) {
|
|
59
|
+
return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
function Ae({ size: e, ...t }) {
|
|
62
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
63
63
|
/* @__PURE__ */ r("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" }),
|
|
64
64
|
/* @__PURE__ */ r("path", { d: "M12 9v4" }),
|
|
65
65
|
/* @__PURE__ */ r("path", { d: "M12 17h.01" })
|
|
66
66
|
] });
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */ r("svg", { ...
|
|
68
|
+
function Be({ size: e, ...t }) {
|
|
69
|
+
return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5" }) });
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return /* @__PURE__ */
|
|
71
|
+
function Se({ size: e, ...t }) {
|
|
72
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
73
73
|
/* @__PURE__ */ r("path", { d: "M18 6 6 18" }),
|
|
74
74
|
/* @__PURE__ */ r("path", { d: "m6 6 12 12" })
|
|
75
75
|
] });
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */ r("svg", { ...
|
|
77
|
+
function He({ size: e, ...t }) {
|
|
78
|
+
return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return /* @__PURE__ */
|
|
80
|
+
function Ve({ size: e, ...t }) {
|
|
81
|
+
return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
|
|
82
82
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "4" }),
|
|
83
83
|
/* @__PURE__ */ r("path", { d: "M12 2v2" }),
|
|
84
84
|
/* @__PURE__ */ r("path", { d: "M12 20v2" }),
|
|
@@ -90,89 +90,89 @@ function Bt({ size: t, ...e }) {
|
|
|
90
90
|
/* @__PURE__ */ r("path", { d: "m19.07 4.93-1.41 1.41" })
|
|
91
91
|
] });
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
function
|
|
95
|
-
return Math.round(
|
|
93
|
+
const G = 20;
|
|
94
|
+
function le(e) {
|
|
95
|
+
return Math.round(e / G) * G;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
99
|
-
let
|
|
100
|
-
for (const
|
|
101
|
-
|
|
102
|
-
const
|
|
97
|
+
function ve(e, t, n = 60) {
|
|
98
|
+
if (e.size === 0) return null;
|
|
99
|
+
let a = 1 / 0, s = 1 / 0, c = -1 / 0, m = -1 / 0;
|
|
100
|
+
for (const x of e.values())
|
|
101
|
+
a = Math.min(a, x.x), s = Math.min(s, x.y), c = Math.max(c, x.x + x.width), m = Math.max(m, x.y + x.height);
|
|
102
|
+
const p = c - a + n * 2, f = m - s + n * 2, b = t.width || window.innerWidth, h = t.height || window.innerHeight, w = Math.min(b / p, h / f, 1.5), y = (a + c) / 2, z = (s + m) / 2;
|
|
103
103
|
return {
|
|
104
|
-
scale: Math.min(3, Math.max(0.2,
|
|
104
|
+
scale: Math.min(3, Math.max(0.2, w)),
|
|
105
105
|
offset: {
|
|
106
|
-
x:
|
|
107
|
-
y:
|
|
106
|
+
x: b / 2 - y * w,
|
|
107
|
+
y: h / 2 - z * w
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
(
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
-
),
|
|
111
|
+
function je(e, t, n = 40, a = 1.5) {
|
|
112
|
+
const s = t.width || window.innerWidth, c = t.height || window.innerHeight, m = Math.max(1, e.width), p = Math.max(1, e.height), f = Math.min(
|
|
113
|
+
(s - n * 2) / m,
|
|
114
|
+
(c - n * 2) / p,
|
|
115
|
+
a
|
|
116
|
+
), b = Math.min(3, Math.max(0.2, f));
|
|
117
117
|
return {
|
|
118
|
-
scale:
|
|
118
|
+
scale: b,
|
|
119
119
|
offset: {
|
|
120
|
-
x:
|
|
121
|
-
y:
|
|
120
|
+
x: s / 2 - (e.x + m / 2) * b,
|
|
121
|
+
y: c / 2 - (e.y + p / 2) * b
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const g = Ye((e, t) => ({
|
|
126
126
|
offset: { x: 0, y: 0 },
|
|
127
127
|
scale: 1,
|
|
128
128
|
viewportSize: { width: 0, height: 0 },
|
|
129
129
|
snapToGrid: !1,
|
|
130
|
-
snapGridSize:
|
|
130
|
+
snapGridSize: G,
|
|
131
131
|
panels: /* @__PURE__ */ new Map(),
|
|
132
132
|
resetFns: /* @__PURE__ */ new Map(),
|
|
133
133
|
registryVersion: 0,
|
|
134
|
-
setOffset: (n) =>
|
|
135
|
-
setScale: (n) =>
|
|
136
|
-
setViewportSize: (n) =>
|
|
137
|
-
setSnapToGrid: (n) =>
|
|
138
|
-
register: (n,
|
|
139
|
-
|
|
134
|
+
setOffset: (n) => e((a) => ({ offset: typeof n == "function" ? n(a.offset) : n })),
|
|
135
|
+
setScale: (n) => e((a) => ({ scale: typeof n == "function" ? n(a.scale) : n })),
|
|
136
|
+
setViewportSize: (n) => e({ viewportSize: n }),
|
|
137
|
+
setSnapToGrid: (n) => e((a) => ({ snapToGrid: typeof n == "function" ? n(a.snapToGrid) : n })),
|
|
138
|
+
register: (n, a) => {
|
|
139
|
+
t().panels.set(n, a), e((s) => ({ registryVersion: s.registryVersion + 1 }));
|
|
140
140
|
},
|
|
141
141
|
unregister: (n) => {
|
|
142
|
-
|
|
142
|
+
t().panels.delete(n), e((a) => ({ registryVersion: a.registryVersion + 1 }));
|
|
143
143
|
},
|
|
144
|
-
registerReset: (n,
|
|
145
|
-
|
|
144
|
+
registerReset: (n, a) => {
|
|
145
|
+
t().resetFns.set(n, a);
|
|
146
146
|
},
|
|
147
147
|
unregisterReset: (n) => {
|
|
148
|
-
|
|
148
|
+
t().resetFns.delete(n);
|
|
149
149
|
},
|
|
150
150
|
fitToContent: () => {
|
|
151
|
-
const { panels: n, viewportSize:
|
|
152
|
-
|
|
151
|
+
const { panels: n, viewportSize: a } = t(), s = ve(n, a);
|
|
152
|
+
s && e({ scale: s.scale, offset: s.offset });
|
|
153
153
|
},
|
|
154
|
-
focusPanel: (n,
|
|
155
|
-
const { viewportSize:
|
|
154
|
+
focusPanel: (n, a) => {
|
|
155
|
+
const { viewportSize: s } = t(), c = je(
|
|
156
156
|
n,
|
|
157
|
-
|
|
158
|
-
(
|
|
159
|
-
(
|
|
157
|
+
s,
|
|
158
|
+
(a == null ? void 0 : a.padding) ?? 40,
|
|
159
|
+
(a == null ? void 0 : a.maxScale) ?? 1.5
|
|
160
160
|
);
|
|
161
|
-
|
|
161
|
+
e({ scale: c.scale, offset: c.offset });
|
|
162
162
|
},
|
|
163
163
|
resetWidgets: () => {
|
|
164
|
-
for (const
|
|
165
|
-
const n = (
|
|
166
|
-
const { panels:
|
|
167
|
-
if (
|
|
168
|
-
|
|
164
|
+
for (const a of t().resetFns.values()) a();
|
|
165
|
+
const n = (a = 0) => {
|
|
166
|
+
const { panels: s, viewportSize: c } = t(), m = ve(s, c);
|
|
167
|
+
if (m) {
|
|
168
|
+
e({ scale: m.scale, offset: m.offset });
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
a < 6 && requestAnimationFrame(() => n(a + 1));
|
|
172
172
|
};
|
|
173
173
|
requestAnimationFrame(() => requestAnimationFrame(() => n()));
|
|
174
174
|
},
|
|
175
|
-
resetSession: () =>
|
|
175
|
+
resetSession: () => e({
|
|
176
176
|
offset: { x: 0, y: 0 },
|
|
177
177
|
scale: 1,
|
|
178
178
|
viewportSize: { width: 0, height: 0 },
|
|
@@ -182,138 +182,138 @@ const b = Xt((t, e) => ({
|
|
|
182
182
|
resetFns: /* @__PURE__ */ new Map()
|
|
183
183
|
})
|
|
184
184
|
}));
|
|
185
|
-
function
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}, [
|
|
190
|
-
const
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
x:
|
|
194
|
-
y:
|
|
195
|
-
})),
|
|
185
|
+
function Ze({ extraActions: e }) {
|
|
186
|
+
const t = g((h) => h.scale), n = g((h) => h.viewportSize), a = g((h) => h.snapToGrid), s = g((h) => h.setScale), c = g((h) => h.setOffset), m = g((h) => h.setSnapToGrid), p = g((h) => h.fitToContent), f = g((h) => h.resetWidgets);
|
|
187
|
+
F(() => {
|
|
188
|
+
a && window.dispatchEvent(new Event("whiteboard-snap-now"));
|
|
189
|
+
}, [a]);
|
|
190
|
+
const b = (h) => {
|
|
191
|
+
const w = Math.min(3, Math.max(0.2, h)), y = w / t, z = (n.width || window.innerWidth) / 2, x = (n.height || window.innerHeight) / 2;
|
|
192
|
+
c((C) => ({
|
|
193
|
+
x: z - (z - C.x) * y,
|
|
194
|
+
y: x - (x - C.y) * y
|
|
195
|
+
})), s(w);
|
|
196
196
|
};
|
|
197
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ d(
|
|
198
198
|
"div",
|
|
199
199
|
{
|
|
200
200
|
className: "zoom-bar",
|
|
201
|
-
onPointerDown: (
|
|
202
|
-
onWheel: (
|
|
201
|
+
onPointerDown: (h) => h.stopPropagation(),
|
|
202
|
+
onWheel: (h) => h.stopPropagation(),
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () =>
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
Math.round(
|
|
204
|
+
/* @__PURE__ */ r("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__ */ r(We, { size: 14 }) }),
|
|
205
|
+
/* @__PURE__ */ d("span", { className: "zoom-bar__value", children: [
|
|
206
|
+
Math.round(t * 100),
|
|
207
207
|
"%"
|
|
208
208
|
] }),
|
|
209
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () =>
|
|
210
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick:
|
|
211
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick:
|
|
209
|
+
/* @__PURE__ */ r("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__ */ r(Ge, { size: 14 }) }),
|
|
210
|
+
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: p, title: "Fit camera to all panels", "aria-label": "Fit camera to all panels", children: /* @__PURE__ */ r(Ee, { size: 14 }) }),
|
|
211
|
+
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: f, title: "Reset panel positions", "aria-label": "Reset panel positions", children: /* @__PURE__ */ r(Le, { size: 14 }) }),
|
|
212
212
|
/* @__PURE__ */ r(
|
|
213
213
|
"button",
|
|
214
214
|
{
|
|
215
215
|
type: "button",
|
|
216
|
-
className: `wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action${
|
|
217
|
-
onClick: () =>
|
|
218
|
-
title:
|
|
219
|
-
"aria-label":
|
|
220
|
-
children: /* @__PURE__ */ r(
|
|
216
|
+
className: `wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action${a ? " is-active" : ""}`,
|
|
217
|
+
onClick: () => m((h) => !h),
|
|
218
|
+
title: a ? "Disable snap to grid" : "Enable snap to grid",
|
|
219
|
+
"aria-label": a ? "Disable snap to grid" : "Enable snap to grid",
|
|
220
|
+
children: /* @__PURE__ */ r(Oe, { size: 14 })
|
|
221
221
|
}
|
|
222
222
|
),
|
|
223
|
-
|
|
223
|
+
e
|
|
224
224
|
]
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
return /* @__PURE__ */ r("div", { className: "minimap minimap--loading", style: { width:
|
|
234
|
-
const
|
|
235
|
-
let
|
|
236
|
-
for (const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
if (!
|
|
241
|
-
const
|
|
242
|
-
return { worldX:
|
|
243
|
-
}, K = (
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
x:
|
|
247
|
-
y:
|
|
228
|
+
const ee = 200, te = 150, ue = 40, Ne = 1;
|
|
229
|
+
function Ue({ loading: e = !1 }) {
|
|
230
|
+
g((o) => o.registryVersion);
|
|
231
|
+
const t = g((o) => o.offset), n = g((o) => o.scale), a = g((o) => o.viewportSize), s = g((o) => o.panels), c = g((o) => o.setOffset), m = g((o) => o.setScale), p = g((o) => o.focusPanel), f = P(null), b = P(!1), h = P(null), y = Array.from(s.entries()).filter(([, o]) => Number.isFinite(o.width) && Number.isFinite(o.height)), z = y.map(([, o]) => o);
|
|
232
|
+
if (e || z.length === 0)
|
|
233
|
+
return /* @__PURE__ */ r("div", { className: "minimap minimap--loading", style: { width: ee, height: te }, children: /* @__PURE__ */ r("div", { className: "minimap__loading", children: /* @__PURE__ */ r(he, { size: 14, className: "icon-spin" }) }) });
|
|
234
|
+
const x = a.width || window.innerWidth, C = a.height || window.innerHeight, L = x / n, N = C / n, v = -t.x / n, T = -t.y / n;
|
|
235
|
+
let O = 1 / 0, u = 1 / 0, X = -1 / 0, Y = -1 / 0;
|
|
236
|
+
for (const o of z)
|
|
237
|
+
O = Math.min(O, o.x), u = Math.min(u, o.y), X = Math.max(X, o.x + o.width), Y = Math.max(Y, o.y + o.height);
|
|
238
|
+
O -= ue, u -= ue, X += ue, Y += ue;
|
|
239
|
+
const R = Math.max(Ne, X - O), V = Math.max(Ne, Y - u), D = Math.min(ee / R, te / V), B = R * D, U = V * D, q = (ee - B) / 2, W = (te - U) / 2, J = (o) => q + (o - O) * D, Z = (o) => W + (o - u) * D, Q = (o, k) => {
|
|
240
|
+
if (!f.current) return;
|
|
241
|
+
const _ = f.current.getBoundingClientRect(), $ = Math.min(ee, Math.max(0, o - _.left)), H = Math.min(te, Math.max(0, k - _.top)), ae = Math.min(B + q, Math.max(q, $)), se = Math.min(U + W, Math.max(W, H)), oe = (ae - q) / D + O, ie = (se - W) / D + u;
|
|
242
|
+
return { worldX: oe, worldY: ie };
|
|
243
|
+
}, K = (o, k, _) => {
|
|
244
|
+
const $ = Math.min(3, Math.max(0.2, _));
|
|
245
|
+
m($), c({
|
|
246
|
+
x: x / 2 - o * $,
|
|
247
|
+
y: C / 2 - k * $
|
|
248
248
|
});
|
|
249
|
-
},
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
},
|
|
257
|
-
|
|
249
|
+
}, re = (o, k) => {
|
|
250
|
+
const _ = Q(o, k);
|
|
251
|
+
_ && K(_.worldX, _.worldY, n);
|
|
252
|
+
}, pe = (o) => {
|
|
253
|
+
o.stopPropagation(), o.preventDefault(), b.current = !0, o.currentTarget.setPointerCapture(o.pointerId), re(o.clientX, o.clientY);
|
|
254
|
+
}, l = (o) => {
|
|
255
|
+
b.current && re(o.clientX, o.clientY);
|
|
256
|
+
}, S = () => {
|
|
257
|
+
b.current = !1;
|
|
258
258
|
};
|
|
259
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ d(
|
|
260
260
|
"div",
|
|
261
261
|
{
|
|
262
|
-
ref:
|
|
263
|
-
onPointerDown:
|
|
264
|
-
onPointerMove:
|
|
265
|
-
onPointerUp:
|
|
266
|
-
onPointerCancel:
|
|
267
|
-
onWheel: (
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
if (!
|
|
271
|
-
const
|
|
272
|
-
K(
|
|
262
|
+
ref: f,
|
|
263
|
+
onPointerDown: pe,
|
|
264
|
+
onPointerMove: l,
|
|
265
|
+
onPointerUp: S,
|
|
266
|
+
onPointerCancel: S,
|
|
267
|
+
onWheel: (o) => {
|
|
268
|
+
o.preventDefault(), o.stopPropagation();
|
|
269
|
+
const k = Q(o.clientX, o.clientY);
|
|
270
|
+
if (!k) return;
|
|
271
|
+
const _ = o.deltaY > 0 ? 0.9 : 1.1;
|
|
272
|
+
K(k.worldX, k.worldY, n * _);
|
|
273
273
|
},
|
|
274
274
|
className: "minimap",
|
|
275
275
|
style: {
|
|
276
|
-
width:
|
|
277
|
-
height:
|
|
276
|
+
width: ee,
|
|
277
|
+
height: te
|
|
278
278
|
},
|
|
279
279
|
children: [
|
|
280
|
-
|
|
280
|
+
y.map(([o, k]) => /* @__PURE__ */ r(
|
|
281
281
|
"div",
|
|
282
282
|
{
|
|
283
283
|
className: "minimap__panel",
|
|
284
|
-
onPointerDown: (
|
|
285
|
-
|
|
284
|
+
onPointerDown: (_) => {
|
|
285
|
+
_.stopPropagation();
|
|
286
286
|
},
|
|
287
|
-
onPointerUp: (
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
|
|
287
|
+
onPointerUp: (_) => {
|
|
288
|
+
_.stopPropagation();
|
|
289
|
+
const $ = Date.now(), H = h.current;
|
|
290
|
+
if (H && H.id === o && $ - H.time < 300) {
|
|
291
|
+
_.preventDefault(), p(k, { padding: k.focusPadding, maxScale: k.focusMaxScale }), h.current = null;
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
|
-
|
|
294
|
+
h.current = { id: o, time: $ };
|
|
295
295
|
},
|
|
296
|
-
onDoubleClick: (
|
|
297
|
-
|
|
296
|
+
onDoubleClick: (_) => {
|
|
297
|
+
_.preventDefault(), _.stopPropagation(), p(k, { padding: k.focusPadding, maxScale: k.focusMaxScale });
|
|
298
298
|
},
|
|
299
299
|
style: {
|
|
300
|
-
left:
|
|
301
|
-
top:
|
|
302
|
-
width: Math.max(1,
|
|
303
|
-
height: Math.max(1,
|
|
300
|
+
left: J(k.x),
|
|
301
|
+
top: Z(k.y),
|
|
302
|
+
width: Math.max(1, k.width * D),
|
|
303
|
+
height: Math.max(1, k.height * D)
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
|
-
|
|
306
|
+
o
|
|
307
307
|
)),
|
|
308
308
|
/* @__PURE__ */ r(
|
|
309
309
|
"div",
|
|
310
310
|
{
|
|
311
311
|
className: "minimap__viewport",
|
|
312
312
|
style: {
|
|
313
|
-
left:
|
|
314
|
-
top:
|
|
315
|
-
width:
|
|
316
|
-
height:
|
|
313
|
+
left: J(v),
|
|
314
|
+
top: Z(T),
|
|
315
|
+
width: L * D,
|
|
316
|
+
height: N * D
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
)
|
|
@@ -321,262 +321,262 @@ function jt({ loading: t = !1 }) {
|
|
|
321
321
|
}
|
|
322
322
|
);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}, []),
|
|
329
|
-
|
|
330
|
-
}, [
|
|
331
|
-
const
|
|
332
|
-
if (!
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
width: Math.max(0,
|
|
337
|
-
height: Math.max(0,
|
|
324
|
+
function vt({ children: e, showMinimap: t = !0, minimapLoading: n = !1, extraActions: a }) {
|
|
325
|
+
const s = g((u) => u.offset), c = g((u) => u.scale), m = g((u) => u.registryVersion), p = g((u) => u.viewportSize), f = g((u) => u.setOffset), b = g((u) => u.setScale), h = g((u) => u.setViewportSize), w = P(null), y = P(!1), z = P({ x: 0, y: 0 }), x = P(null), C = P(c), L = P(!1);
|
|
326
|
+
F(() => () => {
|
|
327
|
+
g.getState().resetSession();
|
|
328
|
+
}, []), F(() => {
|
|
329
|
+
C.current = c;
|
|
330
|
+
}, [c]), F(() => {
|
|
331
|
+
const u = w.current;
|
|
332
|
+
if (!u) return;
|
|
333
|
+
const X = () => {
|
|
334
|
+
const R = u.getBoundingClientRect();
|
|
335
|
+
h({
|
|
336
|
+
width: Math.max(0, R.width),
|
|
337
|
+
height: Math.max(0, R.height)
|
|
338
338
|
});
|
|
339
339
|
};
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
342
|
-
return
|
|
343
|
-
}, [
|
|
344
|
-
if (
|
|
345
|
-
const { panels:
|
|
346
|
-
|
|
347
|
-
|
|
340
|
+
if (X(), typeof ResizeObserver > "u") return;
|
|
341
|
+
const Y = new ResizeObserver(X);
|
|
342
|
+
return Y.observe(u), () => Y.disconnect();
|
|
343
|
+
}, [h]), F(() => {
|
|
344
|
+
if (L.current) return;
|
|
345
|
+
const { panels: u } = g.getState();
|
|
346
|
+
u.size === 0 || p.width <= 0 || p.height <= 0 || (L.current = !0, requestAnimationFrame(() => {
|
|
347
|
+
g.getState().fitToContent();
|
|
348
348
|
}));
|
|
349
|
-
}, [
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
}, []),
|
|
353
|
-
if (!
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
}, [
|
|
357
|
-
if (
|
|
349
|
+
}, [m, p]);
|
|
350
|
+
const N = j((u) => {
|
|
351
|
+
u.target === u.currentTarget && (u.button === 0 || u.button === 1) && (y.current = !0, x.current = u.pointerId, z.current = { x: u.clientX, y: u.clientY }, u.currentTarget.setPointerCapture(u.pointerId), u.preventDefault());
|
|
352
|
+
}, []), v = j((u) => {
|
|
353
|
+
if (!y.current || x.current !== u.pointerId) return;
|
|
354
|
+
const X = u.movementX ?? u.clientX - z.current.x, Y = u.movementY ?? u.clientY - z.current.y;
|
|
355
|
+
f((R) => ({ x: R.x + X, y: R.y + Y })), z.current = { x: u.clientX, y: u.clientY };
|
|
356
|
+
}, [f]), T = j((u) => {
|
|
357
|
+
if (x.current !== null)
|
|
358
358
|
try {
|
|
359
|
-
|
|
359
|
+
u.currentTarget.releasePointerCapture(x.current);
|
|
360
360
|
} catch {
|
|
361
361
|
}
|
|
362
|
-
|
|
363
|
-
}, []),
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
x:
|
|
367
|
-
y:
|
|
368
|
-
})),
|
|
369
|
-
}, [
|
|
370
|
-
return /* @__PURE__ */
|
|
362
|
+
y.current = !1, x.current = null;
|
|
363
|
+
}, []), O = j((u) => {
|
|
364
|
+
const X = C.current, Y = u.currentTarget.getBoundingClientRect(), R = { x: u.clientX - Y.left, y: u.clientY - Y.top }, V = Math.min(3, Math.max(0.2, X * (u.deltaY > 0 ? 0.9 : 1.1))), D = V / X;
|
|
365
|
+
f((B) => ({
|
|
366
|
+
x: R.x - (R.x - B.x) * D,
|
|
367
|
+
y: R.y - (R.y - B.y) * D
|
|
368
|
+
})), b(V);
|
|
369
|
+
}, [f, b]);
|
|
370
|
+
return /* @__PURE__ */ d(ne, { children: [
|
|
371
371
|
/* @__PURE__ */ r(
|
|
372
372
|
"div",
|
|
373
373
|
{
|
|
374
|
-
ref:
|
|
375
|
-
onPointerDown:
|
|
376
|
-
onPointerMove:
|
|
377
|
-
onPointerUp:
|
|
378
|
-
onPointerCancel:
|
|
379
|
-
onWheel:
|
|
380
|
-
onContextMenu: (
|
|
374
|
+
ref: w,
|
|
375
|
+
onPointerDown: N,
|
|
376
|
+
onPointerMove: v,
|
|
377
|
+
onPointerUp: T,
|
|
378
|
+
onPointerCancel: T,
|
|
379
|
+
onWheel: O,
|
|
380
|
+
onContextMenu: (u) => u.preventDefault(),
|
|
381
381
|
className: "whiteboard-shell",
|
|
382
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ d(
|
|
383
383
|
"div",
|
|
384
384
|
{
|
|
385
385
|
className: "whiteboard-canvas",
|
|
386
|
-
style: { transform: `translate(${
|
|
386
|
+
style: { transform: `translate(${s.x}px, ${s.y}px) scale(${c})` },
|
|
387
387
|
children: [
|
|
388
388
|
/* @__PURE__ */ r("div", { className: "whiteboard-grid", "aria-hidden": !0 }),
|
|
389
|
-
|
|
389
|
+
e
|
|
390
390
|
]
|
|
391
391
|
}
|
|
392
392
|
)
|
|
393
393
|
}
|
|
394
394
|
),
|
|
395
|
-
/* @__PURE__ */ r(
|
|
396
|
-
|
|
395
|
+
/* @__PURE__ */ r(Ze, { extraActions: a }),
|
|
396
|
+
t ? /* @__PURE__ */ r(Ue, { loading: n }) : null
|
|
397
397
|
] });
|
|
398
398
|
}
|
|
399
|
-
const
|
|
400
|
-
title:
|
|
399
|
+
const Nt = Re(function({
|
|
400
|
+
title: t,
|
|
401
401
|
defaultPosition: n,
|
|
402
|
-
width:
|
|
403
|
-
className:
|
|
404
|
-
trackRect:
|
|
405
|
-
focusable:
|
|
406
|
-
focusPadding:
|
|
407
|
-
focusMaxScale:
|
|
408
|
-
headerActions:
|
|
409
|
-
children:
|
|
402
|
+
width: a = 300,
|
|
403
|
+
className: s,
|
|
404
|
+
trackRect: c,
|
|
405
|
+
focusable: m,
|
|
406
|
+
focusPadding: p = 40,
|
|
407
|
+
focusMaxScale: f = 1.5,
|
|
408
|
+
headerActions: b,
|
|
409
|
+
children: h
|
|
410
410
|
}) {
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}, [
|
|
415
|
-
|
|
416
|
-
}, [
|
|
417
|
-
const
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
x: Math.round(
|
|
422
|
-
y: Math.round(
|
|
411
|
+
const w = De(), [y, z] = we(n), x = P(!1), C = P(y), L = P(null), N = P(null), v = g((l) => l.scale), T = g((l) => l.snapToGrid), O = g((l) => l.snapGridSize), u = g((l) => l.register), X = g((l) => l.unregister), Y = g((l) => l.registerReset), R = g((l) => l.unregisterReset), V = g((l) => l.focusPanel), D = P(v), B = P(!1), U = P(20), q = P(n), W = P(null), J = P(null);
|
|
412
|
+
F(() => {
|
|
413
|
+
D.current = v;
|
|
414
|
+
}, [v]), F(() => {
|
|
415
|
+
B.current = T, U.current = O;
|
|
416
|
+
}, [T, O]), F(() => {
|
|
417
|
+
const l = () => {
|
|
418
|
+
const S = U.current;
|
|
419
|
+
z((M) => {
|
|
420
|
+
const o = {
|
|
421
|
+
x: Math.round(M.x / S) * S,
|
|
422
|
+
y: Math.round(M.y / S) * S
|
|
423
423
|
};
|
|
424
|
-
return
|
|
424
|
+
return o.x === M.x && o.y === M.y ? M : o;
|
|
425
425
|
});
|
|
426
426
|
};
|
|
427
|
-
return window.addEventListener("whiteboard-snap-now",
|
|
428
|
-
}, []),
|
|
429
|
-
|
|
430
|
-
}, [
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
if (!
|
|
434
|
-
const
|
|
435
|
-
x:
|
|
436
|
-
y:
|
|
437
|
-
width:
|
|
438
|
-
height:
|
|
439
|
-
focusPadding:
|
|
440
|
-
focusMaxScale:
|
|
441
|
-
},
|
|
442
|
-
|
|
443
|
-
}, [p,
|
|
444
|
-
const
|
|
445
|
-
return
|
|
446
|
-
x:
|
|
447
|
-
y:
|
|
448
|
-
width:
|
|
449
|
-
height:
|
|
450
|
-
focusPadding:
|
|
451
|
-
focusMaxScale:
|
|
427
|
+
return window.addEventListener("whiteboard-snap-now", l), () => window.removeEventListener("whiteboard-snap-now", l);
|
|
428
|
+
}, []), F(() => {
|
|
429
|
+
C.current = y;
|
|
430
|
+
}, [y]);
|
|
431
|
+
const Z = j(() => {
|
|
432
|
+
const l = L.current;
|
|
433
|
+
if (!l) return;
|
|
434
|
+
const S = {
|
|
435
|
+
x: C.current.x,
|
|
436
|
+
y: C.current.y,
|
|
437
|
+
width: l.offsetWidth,
|
|
438
|
+
height: l.offsetHeight,
|
|
439
|
+
focusPadding: p,
|
|
440
|
+
focusMaxScale: f
|
|
441
|
+
}, M = N.current;
|
|
442
|
+
M && M.x === S.x && M.y === S.y && M.width === S.width && M.height === S.height && M.focusPadding === S.focusPadding && M.focusMaxScale === S.focusMaxScale || (N.current = S, u(w, S), c && (c.current = S));
|
|
443
|
+
}, [f, p, w, u, c]), Q = j(() => {
|
|
444
|
+
const l = L.current;
|
|
445
|
+
return l ? {
|
|
446
|
+
x: C.current.x,
|
|
447
|
+
y: C.current.y,
|
|
448
|
+
width: l.offsetWidth,
|
|
449
|
+
height: l.offsetHeight,
|
|
450
|
+
focusPadding: p,
|
|
451
|
+
focusMaxScale: f
|
|
452
452
|
} : null;
|
|
453
|
-
}, [
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
}, [
|
|
457
|
-
|
|
458
|
-
var
|
|
459
|
-
(
|
|
460
|
-
}), [
|
|
461
|
-
|
|
462
|
-
}, [
|
|
463
|
-
const
|
|
464
|
-
if (!
|
|
465
|
-
const
|
|
466
|
-
|
|
453
|
+
}, [f, p]), K = j(() => {
|
|
454
|
+
const l = Q();
|
|
455
|
+
l && V(l, { padding: p, maxScale: f });
|
|
456
|
+
}, [V, p, f, Q]);
|
|
457
|
+
F(() => (Y(w, () => z(q.current)), () => {
|
|
458
|
+
var l;
|
|
459
|
+
(l = W.current) == null || l.call(W), X(w), R(w), N.current = null;
|
|
460
|
+
}), [w, Y, X, R]), Ie(() => {
|
|
461
|
+
Z();
|
|
462
|
+
}, [y.x, y.y, a, Z]), F(() => {
|
|
463
|
+
const l = L.current;
|
|
464
|
+
if (!l || typeof ResizeObserver > "u") return;
|
|
465
|
+
const S = new ResizeObserver(() => {
|
|
466
|
+
Z();
|
|
467
467
|
});
|
|
468
|
-
return
|
|
469
|
-
}, [
|
|
470
|
-
const
|
|
471
|
-
var
|
|
472
|
-
if (
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
const
|
|
477
|
-
if (!
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
x:
|
|
481
|
-
y:
|
|
468
|
+
return S.observe(l), () => S.disconnect();
|
|
469
|
+
}, [Z]);
|
|
470
|
+
const re = j((l) => {
|
|
471
|
+
var ae;
|
|
472
|
+
if (l.button !== 0) return;
|
|
473
|
+
x.current = !0;
|
|
474
|
+
const S = l.clientX, M = l.clientY, o = C.current.x, k = C.current.y, _ = D.current;
|
|
475
|
+
l.preventDefault(), l.stopPropagation(), l.target.setPointerCapture(l.pointerId);
|
|
476
|
+
const $ = (se) => {
|
|
477
|
+
if (!x.current) return;
|
|
478
|
+
const oe = o + (se.clientX - S) / _, ie = k + (se.clientY - M) / _, ce = U.current, ze = B.current ? Math.round(oe / ce) * ce : oe, Te = B.current ? Math.round(ie / ce) * ce : ie;
|
|
479
|
+
z({
|
|
480
|
+
x: ze,
|
|
481
|
+
y: Te
|
|
482
482
|
});
|
|
483
|
-
},
|
|
484
|
-
|
|
483
|
+
}, H = () => {
|
|
484
|
+
x.current = !1, window.removeEventListener("pointermove", $), window.removeEventListener("pointerup", H), W.current = null;
|
|
485
485
|
};
|
|
486
|
-
(
|
|
487
|
-
}, []),
|
|
488
|
-
return /* @__PURE__ */
|
|
486
|
+
(ae = W.current) == null || ae.call(W), window.addEventListener("pointermove", $), window.addEventListener("pointerup", H), W.current = H;
|
|
487
|
+
}, []), pe = s ? `floating-panel ${s}` : "floating-panel";
|
|
488
|
+
return /* @__PURE__ */ d(
|
|
489
489
|
"div",
|
|
490
490
|
{
|
|
491
|
-
ref:
|
|
492
|
-
className:
|
|
493
|
-
style: { left:
|
|
494
|
-
onPointerDown: (
|
|
495
|
-
onPointerUp: (
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
498
|
-
if (
|
|
499
|
-
const
|
|
500
|
-
if (
|
|
501
|
-
|
|
491
|
+
ref: L,
|
|
492
|
+
className: pe,
|
|
493
|
+
style: { left: y.x, top: y.y, width: a },
|
|
494
|
+
onPointerDown: (l) => l.stopPropagation(),
|
|
495
|
+
onPointerUp: (l) => {
|
|
496
|
+
if (x.current) return;
|
|
497
|
+
const S = Date.now(), M = J.current;
|
|
498
|
+
if (M && S - M.time < 300) {
|
|
499
|
+
const o = l.clientX - M.x, k = l.clientY - M.y;
|
|
500
|
+
if (o * o + k * k < 100) {
|
|
501
|
+
l.stopPropagation(), K(), J.current = null;
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
|
|
505
|
+
J.current = { time: S, x: l.clientX, y: l.clientY };
|
|
506
506
|
},
|
|
507
|
-
onWheel: (
|
|
508
|
-
onDoubleClick: (
|
|
509
|
-
|
|
507
|
+
onWheel: (l) => l.stopPropagation(),
|
|
508
|
+
onDoubleClick: (l) => {
|
|
509
|
+
l.stopPropagation(), K();
|
|
510
510
|
},
|
|
511
511
|
children: [
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
/* @__PURE__ */ r("strong", { className: "floating-panel__title", children:
|
|
514
|
-
|
|
515
|
-
|
|
512
|
+
/* @__PURE__ */ d("div", { onPointerDown: re, className: "floating-panel__header", children: [
|
|
513
|
+
/* @__PURE__ */ r("strong", { className: "floating-panel__title", children: t }),
|
|
514
|
+
b,
|
|
515
|
+
m && /* @__PURE__ */ r(
|
|
516
516
|
"button",
|
|
517
517
|
{
|
|
518
518
|
type: "button",
|
|
519
519
|
className: "wb-btn wb-btn--secondary wb-btn--icon-only floating-panel__focus",
|
|
520
520
|
onClick: K,
|
|
521
|
-
onPointerDown: (
|
|
521
|
+
onPointerDown: (l) => l.stopPropagation(),
|
|
522
522
|
title: "Focus on this panel",
|
|
523
523
|
"aria-label": "Focus on this panel",
|
|
524
|
-
children: /* @__PURE__ */ r(
|
|
524
|
+
children: /* @__PURE__ */ r($e, { size: 14 })
|
|
525
525
|
}
|
|
526
526
|
)
|
|
527
527
|
] }),
|
|
528
|
-
/* @__PURE__ */ r("div", { className: "floating-panel__body", children:
|
|
528
|
+
/* @__PURE__ */ r("div", { className: "floating-panel__body", children: h })
|
|
529
529
|
]
|
|
530
530
|
}
|
|
531
531
|
);
|
|
532
532
|
});
|
|
533
|
-
function
|
|
534
|
-
return
|
|
533
|
+
function xt(e) {
|
|
534
|
+
return P({ ...e, width: 0, height: 0 });
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
return { x:
|
|
536
|
+
function St(e, t = G) {
|
|
537
|
+
return { x: e.x, y: e.y + e.height + t };
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
open:
|
|
541
|
-
title:
|
|
539
|
+
function kt({
|
|
540
|
+
open: e,
|
|
541
|
+
title: t,
|
|
542
542
|
message: n,
|
|
543
|
-
onConfirm:
|
|
544
|
-
onCancel:
|
|
545
|
-
confirmLabel:
|
|
546
|
-
loadingLabel:
|
|
547
|
-
loading:
|
|
548
|
-
error:
|
|
543
|
+
onConfirm: a,
|
|
544
|
+
onCancel: s,
|
|
545
|
+
confirmLabel: c = "Confirm",
|
|
546
|
+
loadingLabel: m,
|
|
547
|
+
loading: p,
|
|
548
|
+
error: f
|
|
549
549
|
}) {
|
|
550
|
-
return
|
|
551
|
-
if (!
|
|
552
|
-
const
|
|
553
|
-
|
|
550
|
+
return F(() => {
|
|
551
|
+
if (!e) return;
|
|
552
|
+
const b = (h) => {
|
|
553
|
+
h.key === "Escape" && s();
|
|
554
554
|
};
|
|
555
|
-
return window.addEventListener("keydown",
|
|
556
|
-
}, [
|
|
557
|
-
/* @__PURE__ */ r("div", { className: "confirm-modal-overlay", onMouseDown:
|
|
555
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
556
|
+
}, [e, s]), !e || typeof document > "u" ? null : Fe(
|
|
557
|
+
/* @__PURE__ */ r("div", { className: "confirm-modal-overlay", onMouseDown: s, children: /* @__PURE__ */ d(
|
|
558
558
|
"div",
|
|
559
559
|
{
|
|
560
560
|
className: "confirm-modal",
|
|
561
561
|
role: "dialog",
|
|
562
562
|
"aria-modal": "true",
|
|
563
|
-
"aria-label":
|
|
564
|
-
onMouseDown: (
|
|
563
|
+
"aria-label": t,
|
|
564
|
+
onMouseDown: (b) => b.stopPropagation(),
|
|
565
565
|
children: [
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */ r(
|
|
569
|
-
|
|
566
|
+
/* @__PURE__ */ d("div", { className: "confirm-modal__header", children: [
|
|
567
|
+
/* @__PURE__ */ d("span", { className: "confirm-modal__title", children: [
|
|
568
|
+
/* @__PURE__ */ r(Ae, { size: 16 }),
|
|
569
|
+
t
|
|
570
570
|
] }),
|
|
571
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only", onClick:
|
|
571
|
+
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only", onClick: s, "aria-label": "Close dialog", children: /* @__PURE__ */ r(Se, { size: 14 }) })
|
|
572
572
|
] }),
|
|
573
573
|
/* @__PURE__ */ r("p", { className: "confirm-modal__message", children: n }),
|
|
574
|
-
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary", onClick:
|
|
577
|
-
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--danger", onClick:
|
|
578
|
-
/* @__PURE__ */ r(
|
|
579
|
-
|
|
574
|
+
f && /* @__PURE__ */ r("div", { className: "wb-alert wb-alert--error", children: f }),
|
|
575
|
+
/* @__PURE__ */ d("div", { className: "wb-btn-row", children: [
|
|
576
|
+
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary", onClick: s, children: "Cancel" }),
|
|
577
|
+
/* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--danger", onClick: a, disabled: p, children: p ? m ?? `${c}…` : /* @__PURE__ */ d(ne, { children: [
|
|
578
|
+
/* @__PURE__ */ r(Be, { size: 14 }),
|
|
579
|
+
c
|
|
580
580
|
] }) })
|
|
581
581
|
] })
|
|
582
582
|
]
|
|
@@ -585,15 +585,15 @@ function ye({
|
|
|
585
585
|
document.body
|
|
586
586
|
);
|
|
587
587
|
}
|
|
588
|
-
class
|
|
588
|
+
class Mt extends Xe {
|
|
589
589
|
constructor() {
|
|
590
590
|
super(...arguments), this.state = { error: null };
|
|
591
591
|
}
|
|
592
|
-
static getDerivedStateFromError(
|
|
593
|
-
return { error:
|
|
592
|
+
static getDerivedStateFromError(t) {
|
|
593
|
+
return { error: t };
|
|
594
594
|
}
|
|
595
595
|
render() {
|
|
596
|
-
return this.state.error ? /* @__PURE__ */
|
|
596
|
+
return this.state.error ? /* @__PURE__ */ d("div", { className: "wb-stack wb-stack--sm", children: [
|
|
597
597
|
/* @__PURE__ */ r("div", { className: "wb-alert wb-alert--error", children: this.props.fallbackMessage ?? "This panel crashed." }),
|
|
598
598
|
/* @__PURE__ */ r(
|
|
599
599
|
"button",
|
|
@@ -607,604 +607,850 @@ class ve extends Wt {
|
|
|
607
607
|
] }) : this.props.children;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
widths:
|
|
612
|
-
startX:
|
|
610
|
+
function _t({
|
|
611
|
+
widths: e,
|
|
612
|
+
startX: t = 20,
|
|
613
613
|
y: n = 40,
|
|
614
|
-
gap:
|
|
614
|
+
gap: a = 20
|
|
615
615
|
}) {
|
|
616
|
-
const
|
|
617
|
-
const
|
|
618
|
-
for (const [
|
|
619
|
-
f
|
|
620
|
-
return
|
|
621
|
-
}, [
|
|
616
|
+
const s = be(() => {
|
|
617
|
+
const p = {};
|
|
618
|
+
for (const [f, b] of Object.entries(e))
|
|
619
|
+
p[f] = le(b);
|
|
620
|
+
return p;
|
|
621
|
+
}, [e]), c = be(
|
|
622
622
|
() => ({
|
|
623
|
-
startX:
|
|
624
|
-
y:
|
|
625
|
-
gap:
|
|
623
|
+
startX: le(t),
|
|
624
|
+
y: le(n),
|
|
625
|
+
gap: le(a)
|
|
626
626
|
}),
|
|
627
|
-
[
|
|
628
|
-
),
|
|
629
|
-
const
|
|
630
|
-
let
|
|
631
|
-
for (const [
|
|
632
|
-
|
|
633
|
-
return
|
|
634
|
-
}, [
|
|
635
|
-
return { layout:
|
|
636
|
-
}
|
|
637
|
-
function
|
|
638
|
-
return
|
|
639
|
-
}
|
|
640
|
-
const
|
|
627
|
+
[t, n, a]
|
|
628
|
+
), m = be(() => {
|
|
629
|
+
const p = {};
|
|
630
|
+
let f = c.startX;
|
|
631
|
+
for (const [b, h] of Object.entries(s))
|
|
632
|
+
p[b] = { x: f, y: c.y }, f += h + c.gap;
|
|
633
|
+
return p;
|
|
634
|
+
}, [c.gap, c.startX, c.y, s]);
|
|
635
|
+
return { layout: c, panelWidth: s, positions: m };
|
|
636
|
+
}
|
|
637
|
+
function i(...e) {
|
|
638
|
+
return e.filter(Boolean).join(" ");
|
|
639
|
+
}
|
|
640
|
+
const qe = {
|
|
641
641
|
error: "wb-alert wb-alert--error",
|
|
642
642
|
muted: "wb-alert wb-alert--muted",
|
|
643
643
|
info: "wb-alert wb-alert--info",
|
|
644
644
|
success: "wb-alert wb-alert--success"
|
|
645
645
|
};
|
|
646
|
-
function
|
|
647
|
-
return /* @__PURE__ */ r("p", { className:
|
|
646
|
+
function Pt({ tone: e = "info", className: t, ...n }) {
|
|
647
|
+
return /* @__PURE__ */ r("p", { className: i(qe[e], t), ...n });
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
return /* @__PURE__ */ r("span", { className:
|
|
649
|
+
function Ct({ className: e, ...t }) {
|
|
650
|
+
return /* @__PURE__ */ r("span", { className: i("avatar-badge", e), ...t });
|
|
651
651
|
}
|
|
652
|
-
const
|
|
652
|
+
const Je = {
|
|
653
653
|
primary: "",
|
|
654
654
|
secondary: "wb-btn--secondary",
|
|
655
655
|
danger: "wb-btn--danger"
|
|
656
|
-
},
|
|
657
|
-
variant:
|
|
656
|
+
}, ke = de(function({
|
|
657
|
+
variant: t = "primary",
|
|
658
658
|
fullWidth: n = !1,
|
|
659
|
-
iconOnly:
|
|
660
|
-
loading:
|
|
661
|
-
type:
|
|
662
|
-
disabled:
|
|
663
|
-
className:
|
|
664
|
-
children:
|
|
665
|
-
loadingText:
|
|
666
|
-
...
|
|
667
|
-
},
|
|
659
|
+
iconOnly: a = !1,
|
|
660
|
+
loading: s = !1,
|
|
661
|
+
type: c = "button",
|
|
662
|
+
disabled: m,
|
|
663
|
+
className: p,
|
|
664
|
+
children: f,
|
|
665
|
+
loadingText: b,
|
|
666
|
+
...h
|
|
667
|
+
}, w) {
|
|
668
668
|
return /* @__PURE__ */ r(
|
|
669
669
|
"button",
|
|
670
670
|
{
|
|
671
|
-
ref:
|
|
672
|
-
type:
|
|
673
|
-
className:
|
|
674
|
-
disabled:
|
|
675
|
-
...
|
|
676
|
-
children:
|
|
677
|
-
/* @__PURE__ */ r(
|
|
678
|
-
|
|
679
|
-
] }) :
|
|
671
|
+
ref: w,
|
|
672
|
+
type: c,
|
|
673
|
+
className: i("wb-btn", Je[t], n && "wb-btn--full-width", a && "wb-btn--icon-only", p),
|
|
674
|
+
disabled: m || s,
|
|
675
|
+
...h,
|
|
676
|
+
children: s ? /* @__PURE__ */ d(ne, { children: [
|
|
677
|
+
/* @__PURE__ */ r(he, { size: 14, className: "icon-spin" }),
|
|
678
|
+
b || f
|
|
679
|
+
] }) : f
|
|
680
680
|
}
|
|
681
681
|
);
|
|
682
682
|
});
|
|
683
|
-
function
|
|
684
|
-
return
|
|
685
|
-
className:
|
|
683
|
+
function Ke({ as: e = "div", className: t, ...n }) {
|
|
684
|
+
return I(e, {
|
|
685
|
+
className: i("button-row", t),
|
|
686
686
|
...n
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
return /* @__PURE__ */ r("div", { className: "canvas-wrap", children: /* @__PURE__ */
|
|
691
|
-
|
|
692
|
-
|
|
689
|
+
function zt({ children: e, hint: t, className: n, ...a }) {
|
|
690
|
+
return /* @__PURE__ */ r("div", { className: "canvas-wrap", children: /* @__PURE__ */ d("div", { className: i("canvas-stage", n), ...a, children: [
|
|
691
|
+
e,
|
|
692
|
+
t && /* @__PURE__ */ r("p", { className: "canvas-hint", children: t })
|
|
693
693
|
] }) });
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
return /* @__PURE__ */
|
|
695
|
+
function Tt({ label: e, hint: t, className: n, ...a }) {
|
|
696
|
+
return /* @__PURE__ */ d("label", { className: i("checkbox", n), children: [
|
|
697
|
+
/* @__PURE__ */ r("input", { type: "checkbox", className: "checkbox__input", ...a }),
|
|
698
|
+
e != null && /* @__PURE__ */ d("span", { className: "checkbox__text", children: [
|
|
699
|
+
e,
|
|
700
|
+
t != null && /* @__PURE__ */ d("span", { className: "checkbox__hint", children: [
|
|
701
|
+
" ",
|
|
702
|
+
t
|
|
703
|
+
] })
|
|
704
|
+
] })
|
|
705
|
+
] });
|
|
706
|
+
}
|
|
707
|
+
function Rt({ label: e, hint: t, className: n, ...a }) {
|
|
708
|
+
return /* @__PURE__ */ d("label", { className: i("checkbox", "switch", n), children: [
|
|
709
|
+
/* @__PURE__ */ r("input", { type: "checkbox", role: "switch", className: "switch__input", ...a }),
|
|
710
|
+
/* @__PURE__ */ r("span", { className: "switch__track", "aria-hidden": "true", children: /* @__PURE__ */ r("span", { className: "switch__thumb" }) }),
|
|
711
|
+
e != null && /* @__PURE__ */ d("span", { className: "checkbox__text", children: [
|
|
712
|
+
e,
|
|
713
|
+
t != null && /* @__PURE__ */ d("span", { className: "checkbox__hint", children: [
|
|
714
|
+
" ",
|
|
715
|
+
t
|
|
716
|
+
] })
|
|
717
|
+
] })
|
|
718
|
+
] });
|
|
719
|
+
}
|
|
720
|
+
function Dt({ className: e, ...t }) {
|
|
721
|
+
return /* @__PURE__ */ r("span", { className: i("chip", e), ...t });
|
|
697
722
|
}
|
|
698
|
-
function
|
|
723
|
+
function Qe({ active: e = !1, className: t, ...n }) {
|
|
699
724
|
return /* @__PURE__ */ r(
|
|
700
725
|
"button",
|
|
701
726
|
{
|
|
702
727
|
type: "button",
|
|
703
|
-
className:
|
|
704
|
-
"data-active":
|
|
728
|
+
className: i("choice-card", t),
|
|
729
|
+
"data-active": e,
|
|
705
730
|
...n
|
|
706
731
|
}
|
|
707
732
|
);
|
|
708
733
|
}
|
|
709
|
-
function
|
|
710
|
-
return
|
|
711
|
-
className:
|
|
712
|
-
...
|
|
734
|
+
function me({ as: e = "ul", reset: t = !0, className: n, ...a }) {
|
|
735
|
+
return I(e, {
|
|
736
|
+
className: i(t && "list-reset", n),
|
|
737
|
+
...a
|
|
713
738
|
});
|
|
714
739
|
}
|
|
715
|
-
const
|
|
740
|
+
const et = {
|
|
716
741
|
sm: "",
|
|
717
742
|
md: "skeleton--md",
|
|
718
743
|
pill: "skeleton--pill"
|
|
719
744
|
};
|
|
720
|
-
function
|
|
721
|
-
return
|
|
722
|
-
className:
|
|
745
|
+
function A({ as: e = "div", radius: t = "sm", className: n, ...a }) {
|
|
746
|
+
return I(e, {
|
|
747
|
+
className: i("skeleton", et[t], n),
|
|
723
748
|
"aria-hidden": !0,
|
|
724
|
-
...
|
|
749
|
+
...a
|
|
725
750
|
});
|
|
726
751
|
}
|
|
727
|
-
function
|
|
728
|
-
const { className:
|
|
729
|
-
return /* @__PURE__ */ r(
|
|
752
|
+
function tt(e) {
|
|
753
|
+
const { className: t, ...n } = e;
|
|
754
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-input", t), ...n });
|
|
730
755
|
}
|
|
731
|
-
function
|
|
732
|
-
const { className:
|
|
733
|
-
return /* @__PURE__ */ r(
|
|
756
|
+
function Me(e) {
|
|
757
|
+
const { className: t, ...n } = e;
|
|
758
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-btn", t), ...n });
|
|
734
759
|
}
|
|
735
|
-
function
|
|
736
|
-
const { className:
|
|
737
|
-
return /* @__PURE__ */ r(
|
|
760
|
+
function It(e) {
|
|
761
|
+
const { className: t, ...n } = e;
|
|
762
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-icon-btn", t), ...n });
|
|
738
763
|
}
|
|
739
|
-
function
|
|
740
|
-
const { className:
|
|
741
|
-
return /* @__PURE__ */ r(
|
|
764
|
+
function Xt(e) {
|
|
765
|
+
const { className: t, ...n } = e;
|
|
766
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-select", t), ...n });
|
|
742
767
|
}
|
|
743
|
-
function
|
|
744
|
-
const { className:
|
|
745
|
-
return /* @__PURE__ */ r(
|
|
768
|
+
function Yt(e) {
|
|
769
|
+
const { className: t, ...n } = e;
|
|
770
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-textarea", t), ...n });
|
|
746
771
|
}
|
|
747
|
-
function
|
|
748
|
-
const { className:
|
|
749
|
-
return /* @__PURE__ */ r(
|
|
772
|
+
function _e(e) {
|
|
773
|
+
const { className: t, ...n } = e;
|
|
774
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-thumb", t), ...n });
|
|
750
775
|
}
|
|
751
|
-
function
|
|
752
|
-
const { className:
|
|
753
|
-
return /* @__PURE__ */ r(
|
|
776
|
+
function nt(e) {
|
|
777
|
+
const { className: t, ...n } = e;
|
|
778
|
+
return /* @__PURE__ */ r(A, { radius: "pill", className: i("skeleton-chip", t), ...n });
|
|
754
779
|
}
|
|
755
|
-
function
|
|
756
|
-
const { className:
|
|
757
|
-
return /* @__PURE__ */ r(
|
|
780
|
+
function Pe(e) {
|
|
781
|
+
const { className: t, ...n } = e;
|
|
782
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-title", t), ...n });
|
|
758
783
|
}
|
|
759
|
-
function
|
|
760
|
-
return /* @__PURE__ */ r(
|
|
784
|
+
function ye({ short: e = !1, className: t, ...n }) {
|
|
785
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-line", e && "skeleton-line--short", t), ...n });
|
|
761
786
|
}
|
|
762
|
-
function
|
|
763
|
-
const { className:
|
|
764
|
-
return /* @__PURE__ */ r(
|
|
787
|
+
function Ft(e) {
|
|
788
|
+
const { className: t, ...n } = e;
|
|
789
|
+
return /* @__PURE__ */ r(A, { radius: "pill", className: i("skeleton-avatar", t), ...n });
|
|
765
790
|
}
|
|
766
|
-
function
|
|
767
|
-
const { className:
|
|
768
|
-
return /* @__PURE__ */ r(
|
|
791
|
+
function Wt(e) {
|
|
792
|
+
const { className: t, ...n } = e;
|
|
793
|
+
return /* @__PURE__ */ r(A, { className: i("skeleton-canvas", t), ...n });
|
|
769
794
|
}
|
|
770
|
-
function
|
|
771
|
-
options:
|
|
772
|
-
value:
|
|
795
|
+
function Gt({
|
|
796
|
+
options: e,
|
|
797
|
+
value: t,
|
|
773
798
|
onChange: n,
|
|
774
|
-
className:
|
|
799
|
+
className: a
|
|
775
800
|
}) {
|
|
776
|
-
return /* @__PURE__ */ r(
|
|
777
|
-
|
|
801
|
+
return /* @__PURE__ */ r(me, { className: i("choice-list", a), children: e.map((s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
802
|
+
Qe,
|
|
778
803
|
{
|
|
779
|
-
active:
|
|
780
|
-
onClick: () => n(
|
|
781
|
-
disabled:
|
|
782
|
-
"data-has-description":
|
|
783
|
-
children:
|
|
784
|
-
/* @__PURE__ */ r("span", { className: "choice-card__label", children:
|
|
785
|
-
/* @__PURE__ */ r("span", { className: "choice-card__description", children:
|
|
786
|
-
] }) : /* @__PURE__ */ r("span", { className: "choice-card__label", children:
|
|
804
|
+
active: t === s.value,
|
|
805
|
+
onClick: () => n(s.value),
|
|
806
|
+
disabled: s.disabled,
|
|
807
|
+
"data-has-description": s.description ? "true" : "false",
|
|
808
|
+
children: s.description ? /* @__PURE__ */ d("span", { className: "choice-card__row", children: [
|
|
809
|
+
/* @__PURE__ */ r("span", { className: "choice-card__label", children: s.label }),
|
|
810
|
+
/* @__PURE__ */ r("span", { className: "choice-card__description", children: s.description })
|
|
811
|
+
] }) : /* @__PURE__ */ r("span", { className: "choice-card__label", children: s.label })
|
|
787
812
|
}
|
|
788
|
-
) },
|
|
813
|
+
) }, s.value)) });
|
|
789
814
|
}
|
|
790
|
-
function
|
|
791
|
-
return /* @__PURE__ */ r(
|
|
792
|
-
/* @__PURE__ */ r(
|
|
793
|
-
n ? /* @__PURE__ */ r(
|
|
794
|
-
] }) }, `choice-skeleton-${
|
|
815
|
+
function Et({ count: e = 4, className: t, withDescription: n = !1 }) {
|
|
816
|
+
return /* @__PURE__ */ r(me, { className: i("choice-list", t), "aria-hidden": !0, children: Array.from({ length: e }).map((a, s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ d("div", { className: "choice-card", children: [
|
|
817
|
+
/* @__PURE__ */ r(Pe, { className: i("skeleton-title--sm", !n && "skeleton-choice-label") }),
|
|
818
|
+
n ? /* @__PURE__ */ r(ye, { short: !0 }) : null
|
|
819
|
+
] }) }, `choice-skeleton-${s}`)) });
|
|
795
820
|
}
|
|
796
|
-
function
|
|
797
|
-
return /* @__PURE__ */ r("div", { className:
|
|
821
|
+
function Lt({ className: e, ...t }) {
|
|
822
|
+
return /* @__PURE__ */ r("div", { className: i("coord-grid", e), ...t });
|
|
798
823
|
}
|
|
799
|
-
function
|
|
800
|
-
return /* @__PURE__ */
|
|
801
|
-
|
|
824
|
+
function Ot({ axis: e, className: t, ...n }) {
|
|
825
|
+
return /* @__PURE__ */ d("label", { className: i("coord-input", t), children: [
|
|
826
|
+
e,
|
|
802
827
|
" ",
|
|
803
828
|
/* @__PURE__ */ r("input", { type: "number", step: "0.01", ...n })
|
|
804
829
|
] });
|
|
805
830
|
}
|
|
806
|
-
function
|
|
807
|
-
|
|
808
|
-
|
|
831
|
+
function $t({ orientation: e = "horizontal", className: t, ...n }) {
|
|
832
|
+
return e === "vertical" ? /* @__PURE__ */ r(
|
|
833
|
+
"span",
|
|
834
|
+
{
|
|
835
|
+
role: "separator",
|
|
836
|
+
"aria-orientation": "vertical",
|
|
837
|
+
className: i("divider", "divider--vertical", t),
|
|
838
|
+
...n
|
|
839
|
+
}
|
|
840
|
+
) : /* @__PURE__ */ r("hr", { className: i("divider", t), ...n });
|
|
841
|
+
}
|
|
842
|
+
const xe = "button, input, select, textarea, canvas, a, label, audio, video, [contenteditable], [data-wb-nodrag]", ge = /* @__PURE__ */ new Map();
|
|
843
|
+
function At() {
|
|
844
|
+
for (const e of ge.values()) e();
|
|
845
|
+
}
|
|
846
|
+
function rt({
|
|
847
|
+
id: e,
|
|
848
|
+
snap: t = !0,
|
|
849
|
+
persist: n = !0,
|
|
850
|
+
disabled: a = !1,
|
|
851
|
+
className: s,
|
|
852
|
+
style: c,
|
|
853
|
+
children: m,
|
|
854
|
+
...p
|
|
855
|
+
}) {
|
|
856
|
+
const [f, b] = we({ x: 0, y: 0 }), h = P(null), w = `wb-draggable:${e}`;
|
|
857
|
+
F(() => {
|
|
858
|
+
if (n)
|
|
859
|
+
try {
|
|
860
|
+
const N = localStorage.getItem(w);
|
|
861
|
+
if (N) {
|
|
862
|
+
const v = JSON.parse(N);
|
|
863
|
+
Number.isFinite(v == null ? void 0 : v.x) && Number.isFinite(v == null ? void 0 : v.y) && b(v);
|
|
864
|
+
}
|
|
865
|
+
} catch {
|
|
866
|
+
}
|
|
867
|
+
}, [w, n]);
|
|
868
|
+
const y = (N) => {
|
|
869
|
+
if (b(N), !!n)
|
|
870
|
+
try {
|
|
871
|
+
N.x === 0 && N.y === 0 ? localStorage.removeItem(w) : localStorage.setItem(w, JSON.stringify(N));
|
|
872
|
+
} catch {
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
F(() => {
|
|
876
|
+
const N = () => y({ x: 0, y: 0 });
|
|
877
|
+
ge.set(e, N);
|
|
878
|
+
const v = () => {
|
|
879
|
+
b((T) => ({
|
|
880
|
+
x: Math.round(T.x / G) * G,
|
|
881
|
+
y: Math.round(T.y / G) * G
|
|
882
|
+
}));
|
|
883
|
+
};
|
|
884
|
+
return window.addEventListener("whiteboard-snap-now", v), () => {
|
|
885
|
+
ge.delete(e), window.removeEventListener("whiteboard-snap-now", v);
|
|
886
|
+
};
|
|
887
|
+
}, [e, w]);
|
|
888
|
+
const z = (N) => {
|
|
889
|
+
var v, T;
|
|
890
|
+
a || N.button !== 0 || N.target.closest(xe) || (h.current = { sx: N.clientX, sy: N.clientY, bx: f.x, by: f.y }, (T = (v = N.currentTarget).setPointerCapture) == null || T.call(v, N.pointerId));
|
|
891
|
+
}, x = (N) => {
|
|
892
|
+
const v = h.current;
|
|
893
|
+
v && b({ x: v.bx + (N.clientX - v.sx), y: v.by + (N.clientY - v.sy) });
|
|
894
|
+
}, C = () => {
|
|
895
|
+
h.current && (h.current = null, b((v) => {
|
|
896
|
+
const T = t ? {
|
|
897
|
+
x: Math.round(v.x / G) * G,
|
|
898
|
+
y: Math.round(v.y / G) * G
|
|
899
|
+
} : v;
|
|
900
|
+
if (n)
|
|
901
|
+
try {
|
|
902
|
+
T.x === 0 && T.y === 0 ? localStorage.removeItem(w) : localStorage.setItem(w, JSON.stringify(T));
|
|
903
|
+
} catch {
|
|
904
|
+
}
|
|
905
|
+
return T;
|
|
906
|
+
}));
|
|
907
|
+
}, L = (N) => {
|
|
908
|
+
N.target.closest(xe) || y({ x: 0, y: 0 });
|
|
909
|
+
};
|
|
910
|
+
return /* @__PURE__ */ r(
|
|
911
|
+
"div",
|
|
912
|
+
{
|
|
913
|
+
className: i("draggable", a && "draggable--disabled", s),
|
|
914
|
+
style: {
|
|
915
|
+
...c,
|
|
916
|
+
transform: `translate(${f.x}px, ${f.y}px)`
|
|
917
|
+
},
|
|
918
|
+
onPointerDown: z,
|
|
919
|
+
onPointerMove: x,
|
|
920
|
+
onPointerUp: C,
|
|
921
|
+
onPointerCancel: C,
|
|
922
|
+
onDoubleClick: L,
|
|
923
|
+
...p,
|
|
924
|
+
children: m
|
|
925
|
+
}
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
function Bt({ padding: e = "md", className: t, ...n }) {
|
|
929
|
+
return /* @__PURE__ */ r(
|
|
930
|
+
rt,
|
|
931
|
+
{
|
|
932
|
+
className: i(
|
|
933
|
+
"surface",
|
|
934
|
+
e === "sm" && "surface--pad-sm",
|
|
935
|
+
e === "none" && "surface--pad-none",
|
|
936
|
+
t
|
|
937
|
+
),
|
|
938
|
+
...n
|
|
939
|
+
}
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
function fe({
|
|
943
|
+
as: e,
|
|
944
|
+
size: t = "md",
|
|
809
945
|
className: n,
|
|
810
|
-
...
|
|
946
|
+
...a
|
|
811
947
|
}) {
|
|
812
|
-
return
|
|
813
|
-
className:
|
|
814
|
-
...
|
|
948
|
+
return I(e ?? "div", {
|
|
949
|
+
className: i(t === "sm" ? "panel-stack-sm" : "panel-stack", n),
|
|
950
|
+
...a
|
|
815
951
|
});
|
|
816
952
|
}
|
|
817
|
-
const
|
|
953
|
+
const at = {
|
|
818
954
|
xs: "text-xs",
|
|
819
955
|
sm: "text-sm",
|
|
820
956
|
md: ""
|
|
821
957
|
};
|
|
822
|
-
function
|
|
823
|
-
return
|
|
824
|
-
className:
|
|
825
|
-
...
|
|
958
|
+
function st({ as: e = "p", clamp: t = !1, className: n, ...a }) {
|
|
959
|
+
return I(e, {
|
|
960
|
+
className: i("card-title", t && "card-title--clamp", n),
|
|
961
|
+
...a
|
|
826
962
|
});
|
|
827
963
|
}
|
|
828
|
-
function
|
|
829
|
-
return
|
|
830
|
-
className:
|
|
964
|
+
function Ht({ as: e = "h1", className: t, ...n }) {
|
|
965
|
+
return I(e, {
|
|
966
|
+
className: i("page-title", t),
|
|
831
967
|
...n
|
|
832
968
|
});
|
|
833
969
|
}
|
|
834
|
-
function
|
|
835
|
-
return
|
|
836
|
-
className:
|
|
970
|
+
function ot({ as: e = "span", className: t, ...n }) {
|
|
971
|
+
return I(e, {
|
|
972
|
+
className: i("widget-section__title", t),
|
|
837
973
|
...n
|
|
838
974
|
});
|
|
839
975
|
}
|
|
840
|
-
function
|
|
841
|
-
return
|
|
842
|
-
className:
|
|
976
|
+
function it({ as: e = "p", className: t, ...n }) {
|
|
977
|
+
return I(e, {
|
|
978
|
+
className: i("widget-section__description", t),
|
|
843
979
|
...n
|
|
844
980
|
});
|
|
845
981
|
}
|
|
846
|
-
function
|
|
847
|
-
return
|
|
848
|
-
className:
|
|
849
|
-
...
|
|
982
|
+
function Ce({ as: e = "p", size: t = "sm", className: n, ...a }) {
|
|
983
|
+
return I(e, {
|
|
984
|
+
className: i(at[t], "text-muted", n),
|
|
985
|
+
...a
|
|
850
986
|
});
|
|
851
987
|
}
|
|
852
|
-
function
|
|
853
|
-
return /* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */ r(
|
|
855
|
-
|
|
988
|
+
function Vt({ title: e, description: t, action: n }) {
|
|
989
|
+
return /* @__PURE__ */ d(fe, { size: "sm", children: [
|
|
990
|
+
/* @__PURE__ */ r(st, { children: e }),
|
|
991
|
+
t ? /* @__PURE__ */ r(Ce, { children: t }) : null,
|
|
856
992
|
n
|
|
857
993
|
] });
|
|
858
994
|
}
|
|
859
|
-
function
|
|
860
|
-
return /* @__PURE__ */ r("label", { className:
|
|
995
|
+
function ct({ className: e, ...t }) {
|
|
996
|
+
return /* @__PURE__ */ r("label", { className: i("widget-label", e), ...t });
|
|
861
997
|
}
|
|
862
|
-
function
|
|
863
|
-
as:
|
|
864
|
-
label:
|
|
998
|
+
function lt({
|
|
999
|
+
as: e,
|
|
1000
|
+
label: t,
|
|
865
1001
|
htmlFor: n,
|
|
866
|
-
hint:
|
|
867
|
-
error:
|
|
868
|
-
layout:
|
|
869
|
-
className:
|
|
870
|
-
children:
|
|
871
|
-
...
|
|
1002
|
+
hint: a,
|
|
1003
|
+
error: s,
|
|
1004
|
+
layout: c = "stack",
|
|
1005
|
+
className: m,
|
|
1006
|
+
children: p,
|
|
1007
|
+
...f
|
|
872
1008
|
}) {
|
|
873
|
-
return
|
|
874
|
-
|
|
1009
|
+
return I(
|
|
1010
|
+
e ?? "div",
|
|
875
1011
|
{
|
|
876
|
-
className:
|
|
877
|
-
...
|
|
1012
|
+
className: i(c === "control" ? "widget-control" : "panel-stack-sm", m),
|
|
1013
|
+
...f
|
|
878
1014
|
},
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
1015
|
+
/* @__PURE__ */ d(ne, { children: [
|
|
1016
|
+
t ? /* @__PURE__ */ r(ct, { htmlFor: n, children: t }) : null,
|
|
1017
|
+
p,
|
|
1018
|
+
a ? /* @__PURE__ */ r(Ce, { size: "xs", children: a }) : null,
|
|
1019
|
+
s ? /* @__PURE__ */ r("p", { className: "field-error", children: s }) : null
|
|
884
1020
|
] })
|
|
885
1021
|
);
|
|
886
1022
|
}
|
|
887
|
-
function
|
|
888
|
-
return /* @__PURE__ */
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
/* @__PURE__ */ r(
|
|
1023
|
+
function jt({ isGenerating: e, children: t, message: n }) {
|
|
1024
|
+
return /* @__PURE__ */ d("div", { className: "generating-overlay-wrap", children: [
|
|
1025
|
+
t,
|
|
1026
|
+
e && /* @__PURE__ */ d("div", { className: "generating-overlay", "aria-live": "polite", children: [
|
|
1027
|
+
/* @__PURE__ */ r(he, { size: 20, className: "icon-spin" }),
|
|
892
1028
|
/* @__PURE__ */ r("span", { children: n ?? "Generating, please wait…" })
|
|
893
1029
|
] })
|
|
894
1030
|
] });
|
|
895
1031
|
}
|
|
896
|
-
function
|
|
897
|
-
return
|
|
898
|
-
|
|
1032
|
+
function Zt({ as: e = "span", icon: t, className: n, children: a, ...s }) {
|
|
1033
|
+
return I(
|
|
1034
|
+
e,
|
|
899
1035
|
{
|
|
900
|
-
className:
|
|
901
|
-
...
|
|
1036
|
+
className: i("inline-row", n),
|
|
1037
|
+
...s
|
|
902
1038
|
},
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
|
|
905
|
-
|
|
1039
|
+
/* @__PURE__ */ d(ne, { children: [
|
|
1040
|
+
t,
|
|
1041
|
+
a
|
|
906
1042
|
] })
|
|
907
1043
|
);
|
|
908
1044
|
}
|
|
909
|
-
function
|
|
910
|
-
src:
|
|
911
|
-
alt:
|
|
1045
|
+
function Ut({
|
|
1046
|
+
src: e,
|
|
1047
|
+
alt: t,
|
|
912
1048
|
placeholder: n = "No image",
|
|
913
|
-
size:
|
|
914
|
-
fit:
|
|
915
|
-
onImageError:
|
|
916
|
-
className:
|
|
917
|
-
...
|
|
1049
|
+
size: a = "md",
|
|
1050
|
+
fit: s = "contain",
|
|
1051
|
+
onImageError: c,
|
|
1052
|
+
className: m,
|
|
1053
|
+
...p
|
|
918
1054
|
}) {
|
|
919
|
-
const [
|
|
920
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1055
|
+
const [f, b] = we(null), h = !!(e && f === e), w = i("image-thumb", `image-thumb--${a}`, `image-thumb--fit-${s}`, m);
|
|
1056
|
+
return /* @__PURE__ */ r("div", { className: w, ...p, children: e && !h ? /* @__PURE__ */ r(
|
|
921
1057
|
"img",
|
|
922
1058
|
{
|
|
923
|
-
src:
|
|
924
|
-
alt:
|
|
1059
|
+
src: e,
|
|
1060
|
+
alt: t,
|
|
925
1061
|
className: "image-thumb__img",
|
|
926
|
-
style: { objectFit:
|
|
1062
|
+
style: { objectFit: s, objectPosition: "center" },
|
|
927
1063
|
onError: () => {
|
|
928
|
-
|
|
1064
|
+
b(e), c == null || c();
|
|
929
1065
|
}
|
|
930
1066
|
}
|
|
931
1067
|
) : /* @__PURE__ */ r("span", { className: "image-thumb__placeholder", children: n }) });
|
|
932
1068
|
}
|
|
933
|
-
function
|
|
934
|
-
as:
|
|
935
|
-
justify:
|
|
1069
|
+
function qt({
|
|
1070
|
+
as: e,
|
|
1071
|
+
justify: t = "start",
|
|
936
1072
|
className: n,
|
|
937
|
-
...
|
|
1073
|
+
...a
|
|
938
1074
|
}) {
|
|
939
|
-
return
|
|
940
|
-
className:
|
|
941
|
-
...
|
|
1075
|
+
return I(e ?? "div", {
|
|
1076
|
+
className: i(t === "between" ? "space-between" : t === "end" ? "space-end" : "inline-row", n),
|
|
1077
|
+
...a
|
|
942
1078
|
});
|
|
943
1079
|
}
|
|
944
|
-
const
|
|
945
|
-
return /* @__PURE__ */ r("input", { ref:
|
|
1080
|
+
const ut = de(function({ className: t, ...n }, a) {
|
|
1081
|
+
return /* @__PURE__ */ r("input", { ref: a, className: i(t), ...n });
|
|
946
1082
|
});
|
|
947
|
-
function
|
|
948
|
-
return
|
|
949
|
-
className:
|
|
1083
|
+
function dt({ as: e = "div", className: t, ...n }) {
|
|
1084
|
+
return I(e, {
|
|
1085
|
+
className: i("item-card", t),
|
|
950
1086
|
...n
|
|
951
1087
|
});
|
|
952
1088
|
}
|
|
953
|
-
function
|
|
954
|
-
return
|
|
955
|
-
|
|
1089
|
+
function Jt({ className: e, ...t }) {
|
|
1090
|
+
return /* @__PURE__ */ r("kbd", { className: i("kbd", e), ...t });
|
|
1091
|
+
}
|
|
1092
|
+
function Kt({ as: e = "div", className: t, ...n }) {
|
|
1093
|
+
return I(e, {
|
|
1094
|
+
className: i("item-list", t),
|
|
956
1095
|
...n
|
|
957
1096
|
});
|
|
958
1097
|
}
|
|
959
|
-
function
|
|
960
|
-
return /* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */ r(
|
|
962
|
-
|
|
1098
|
+
function Qt({ label: e = "Loading...", className: t }) {
|
|
1099
|
+
return /* @__PURE__ */ d("span", { className: i("status-inline", t), children: [
|
|
1100
|
+
/* @__PURE__ */ r(he, { size: 14, className: "icon-spin" }),
|
|
1101
|
+
e
|
|
963
1102
|
] });
|
|
964
1103
|
}
|
|
965
|
-
function
|
|
966
|
-
|
|
967
|
-
|
|
1104
|
+
function en({
|
|
1105
|
+
label: e,
|
|
1106
|
+
hint: t,
|
|
1107
|
+
value: n,
|
|
1108
|
+
onChange: a,
|
|
1109
|
+
min: s,
|
|
1110
|
+
max: c,
|
|
1111
|
+
step: m,
|
|
1112
|
+
id: p,
|
|
1113
|
+
className: f,
|
|
1114
|
+
...b
|
|
1115
|
+
}) {
|
|
1116
|
+
const h = (w) => {
|
|
1117
|
+
let y = w;
|
|
1118
|
+
return s !== void 0 && (y = Math.max(Number(s), y)), c !== void 0 && (y = Math.min(Number(c), y)), y;
|
|
1119
|
+
};
|
|
1120
|
+
return /* @__PURE__ */ r(lt, { label: e, hint: t, htmlFor: p, className: i(f), children: /* @__PURE__ */ r(
|
|
1121
|
+
ut,
|
|
1122
|
+
{
|
|
1123
|
+
id: p,
|
|
1124
|
+
type: "number",
|
|
1125
|
+
inputMode: "decimal",
|
|
1126
|
+
min: s,
|
|
1127
|
+
max: c,
|
|
1128
|
+
step: m,
|
|
1129
|
+
value: n,
|
|
1130
|
+
onChange: (w) => {
|
|
1131
|
+
const y = Number(w.target.value);
|
|
1132
|
+
Number.isFinite(y) && a(h(y));
|
|
1133
|
+
},
|
|
1134
|
+
...b
|
|
1135
|
+
}
|
|
1136
|
+
) });
|
|
1137
|
+
}
|
|
1138
|
+
function tn({
|
|
1139
|
+
className: e,
|
|
1140
|
+
placement: t,
|
|
968
1141
|
onPointerDown: n,
|
|
969
|
-
onWheel:
|
|
970
|
-
onContextMenu:
|
|
971
|
-
...
|
|
1142
|
+
onWheel: a,
|
|
1143
|
+
onContextMenu: s,
|
|
1144
|
+
...c
|
|
972
1145
|
}) {
|
|
973
1146
|
return /* @__PURE__ */ r(
|
|
974
|
-
|
|
1147
|
+
ke,
|
|
975
1148
|
{
|
|
976
1149
|
variant: "secondary",
|
|
977
1150
|
iconOnly: !0,
|
|
978
|
-
className:
|
|
979
|
-
onPointerDown: (
|
|
980
|
-
|
|
1151
|
+
className: i("overlay-icon-btn", t && `overlay-icon-btn--${t}`, e),
|
|
1152
|
+
onPointerDown: (m) => {
|
|
1153
|
+
m.stopPropagation(), n == null || n(m);
|
|
981
1154
|
},
|
|
982
|
-
onWheel: (
|
|
983
|
-
|
|
1155
|
+
onWheel: (m) => {
|
|
1156
|
+
m.stopPropagation(), a == null || a(m);
|
|
984
1157
|
},
|
|
985
|
-
onContextMenu: (
|
|
986
|
-
|
|
1158
|
+
onContextMenu: (m) => {
|
|
1159
|
+
m.stopPropagation(), s == null || s(m);
|
|
987
1160
|
},
|
|
988
|
-
...
|
|
1161
|
+
...c
|
|
989
1162
|
}
|
|
990
1163
|
);
|
|
991
1164
|
}
|
|
992
|
-
function
|
|
993
|
-
return /* @__PURE__ */ r("main", { className:
|
|
1165
|
+
function nn({ children: e, className: t, ...n }) {
|
|
1166
|
+
return /* @__PURE__ */ r("main", { className: i("page-shell", t), ...n, children: e });
|
|
994
1167
|
}
|
|
995
|
-
function
|
|
996
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1168
|
+
function rn({ children: e, className: t, ...n }) {
|
|
1169
|
+
return /* @__PURE__ */ r("div", { className: i("page-card", t), ...n, children: e });
|
|
997
1170
|
}
|
|
998
|
-
function
|
|
999
|
-
return /* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */ r(
|
|
1001
|
-
|
|
1171
|
+
function an({ onClick: e, label: t = "Close" }) {
|
|
1172
|
+
return /* @__PURE__ */ d(ke, { variant: "secondary", className: "panel-close-btn", onClick: e, children: [
|
|
1173
|
+
/* @__PURE__ */ r(Se, { size: 14 }),
|
|
1174
|
+
t
|
|
1002
1175
|
] });
|
|
1003
1176
|
}
|
|
1004
|
-
function
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
-
|
|
1007
|
-
|
|
1177
|
+
function sn({ heading: e, description: t, actions: n, className: a, children: s, ...c }) {
|
|
1178
|
+
return /* @__PURE__ */ d("section", { className: i("widget-section", a), ...c, children: [
|
|
1179
|
+
e || n ? /* @__PURE__ */ d("header", { className: n ? "title-row" : void 0, children: [
|
|
1180
|
+
e ? /* @__PURE__ */ r(ot, { children: e }) : null,
|
|
1008
1181
|
n
|
|
1009
1182
|
] }) : null,
|
|
1010
|
-
|
|
1011
|
-
|
|
1183
|
+
t ? /* @__PURE__ */ r(it, { children: t }) : null,
|
|
1184
|
+
s
|
|
1012
1185
|
] });
|
|
1013
1186
|
}
|
|
1014
|
-
function
|
|
1015
|
-
return /* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */ r(
|
|
1017
|
-
/* @__PURE__ */ r("span", { children:
|
|
1187
|
+
function on({ icon: e, label: t }) {
|
|
1188
|
+
return /* @__PURE__ */ d("span", { className: "panel-title-with-icon", children: [
|
|
1189
|
+
/* @__PURE__ */ r(e, { size: 13, className: "panel-title-icon" }),
|
|
1190
|
+
/* @__PURE__ */ r("span", { children: t })
|
|
1018
1191
|
] });
|
|
1019
1192
|
}
|
|
1020
|
-
function
|
|
1021
|
-
return
|
|
1022
|
-
className:
|
|
1193
|
+
function ht({ as: e = "button", className: t, ...n }) {
|
|
1194
|
+
return I(e, {
|
|
1195
|
+
className: i("picker-card", t),
|
|
1023
1196
|
...n
|
|
1024
1197
|
});
|
|
1025
1198
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const
|
|
1028
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${
|
|
1199
|
+
function cn({ minItemWidth: e = 120, className: t, style: n, ...a }) {
|
|
1200
|
+
const s = {
|
|
1201
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${e}px, 1fr))`,
|
|
1029
1202
|
...n
|
|
1030
1203
|
};
|
|
1031
|
-
return /* @__PURE__ */ r(
|
|
1204
|
+
return /* @__PURE__ */ r(me, { className: i("picker-grid", t), style: s, ...a });
|
|
1032
1205
|
}
|
|
1033
|
-
const
|
|
1206
|
+
const mt = {
|
|
1034
1207
|
default: "",
|
|
1035
1208
|
success: "success",
|
|
1036
1209
|
warning: "warning",
|
|
1037
1210
|
danger: "danger"
|
|
1038
1211
|
};
|
|
1039
|
-
function
|
|
1040
|
-
return /* @__PURE__ */ r("span", { className:
|
|
1212
|
+
function ln({ tone: e = "default", className: t, ...n }) {
|
|
1213
|
+
return /* @__PURE__ */ r("span", { className: i("pill", mt[e], t), ...n });
|
|
1214
|
+
}
|
|
1215
|
+
const un = de(function({ className: t, ...n }, a) {
|
|
1216
|
+
return /* @__PURE__ */ r("select", { ref: a, className: i(t), ...n });
|
|
1217
|
+
});
|
|
1218
|
+
function dn({ label: e, display: t, value: n, onChange: a, className: s, ...c }) {
|
|
1219
|
+
return /* @__PURE__ */ d("div", { className: i("slider", s), children: [
|
|
1220
|
+
(e != null || t != null) && /* @__PURE__ */ d("div", { className: "slider__head", children: [
|
|
1221
|
+
/* @__PURE__ */ r("span", { className: "widget-label", children: e }),
|
|
1222
|
+
/* @__PURE__ */ r("span", { className: "slider__value", children: t ?? n })
|
|
1223
|
+
] }),
|
|
1224
|
+
/* @__PURE__ */ r(
|
|
1225
|
+
"input",
|
|
1226
|
+
{
|
|
1227
|
+
type: "range",
|
|
1228
|
+
className: "slider__input",
|
|
1229
|
+
value: n,
|
|
1230
|
+
onChange: (m) => a(Number(m.target.value)),
|
|
1231
|
+
...c
|
|
1232
|
+
}
|
|
1233
|
+
)
|
|
1234
|
+
] });
|
|
1041
1235
|
}
|
|
1042
|
-
const
|
|
1043
|
-
return /* @__PURE__ */ r("select", { ref: s, className: l(e), ...n });
|
|
1044
|
-
}), le = {
|
|
1236
|
+
const ft = {
|
|
1045
1237
|
"media-content": "split-layout--media-content",
|
|
1046
1238
|
single: "split-layout--single",
|
|
1047
1239
|
"media-content-actions": "split-layout--media-content-actions"
|
|
1048
1240
|
};
|
|
1049
|
-
function
|
|
1050
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1241
|
+
function hn({ variant: e, className: t, ...n }) {
|
|
1242
|
+
return /* @__PURE__ */ r("div", { className: i("split-layout", ft[e], t), ...n });
|
|
1243
|
+
}
|
|
1244
|
+
function mn({ as: e, padding: t = "md", className: n, ...a }) {
|
|
1245
|
+
return I(e ?? "div", {
|
|
1246
|
+
className: i(
|
|
1247
|
+
"surface",
|
|
1248
|
+
t === "sm" && "surface--pad-sm",
|
|
1249
|
+
t === "none" && "surface--pad-none",
|
|
1250
|
+
n
|
|
1251
|
+
),
|
|
1252
|
+
...a
|
|
1253
|
+
});
|
|
1051
1254
|
}
|
|
1052
|
-
function
|
|
1053
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1255
|
+
function pt({ className: e, ...t }) {
|
|
1256
|
+
return /* @__PURE__ */ r("div", { className: i("tag-row", e), ...t });
|
|
1054
1257
|
}
|
|
1055
|
-
const
|
|
1056
|
-
return /* @__PURE__ */ r("textarea", { ref:
|
|
1258
|
+
const fn = de(function({ className: t, ...n }, a) {
|
|
1259
|
+
return /* @__PURE__ */ r("textarea", { ref: a, className: i(t), ...n });
|
|
1057
1260
|
});
|
|
1058
|
-
function
|
|
1261
|
+
function pn({ className: e, theme: t = "light", onToggle: n, lightIcon: a, darkIcon: s }) {
|
|
1059
1262
|
return /* @__PURE__ */ r(
|
|
1060
1263
|
"button",
|
|
1061
1264
|
{
|
|
1062
1265
|
type: "button",
|
|
1063
|
-
className:
|
|
1266
|
+
className: i("wb-btn", "wb-btn--secondary", "wb-btn--icon-only", e),
|
|
1064
1267
|
onClick: n,
|
|
1065
|
-
title: `Switch to ${
|
|
1268
|
+
title: `Switch to ${t === "light" ? "dark" : "light"} mode`,
|
|
1066
1269
|
"aria-label": "Toggle theme",
|
|
1067
|
-
children:
|
|
1270
|
+
children: t === "light" ? s ?? /* @__PURE__ */ r(He, { size: 14 }) : a ?? /* @__PURE__ */ r(Ve, { size: 14 })
|
|
1271
|
+
}
|
|
1272
|
+
);
|
|
1273
|
+
}
|
|
1274
|
+
function bn({ children: e, end: t, position: n = "top", className: a, ...s }) {
|
|
1275
|
+
return /* @__PURE__ */ d(
|
|
1276
|
+
"nav",
|
|
1277
|
+
{
|
|
1278
|
+
className: i(
|
|
1279
|
+
"toolbar",
|
|
1280
|
+
n === "bottom" && "toolbar--bottom",
|
|
1281
|
+
n === "static" && "toolbar--static",
|
|
1282
|
+
a
|
|
1283
|
+
),
|
|
1284
|
+
...s,
|
|
1285
|
+
children: [
|
|
1286
|
+
/* @__PURE__ */ r("div", { className: "toolbar__items", children: e }),
|
|
1287
|
+
t != null && /* @__PURE__ */ r("div", { className: "toolbar__end", children: t })
|
|
1288
|
+
]
|
|
1068
1289
|
}
|
|
1069
1290
|
);
|
|
1070
1291
|
}
|
|
1071
|
-
function
|
|
1072
|
-
return /* @__PURE__ */
|
|
1292
|
+
function gn({ label: e, placement: t = "top", className: n, children: a, ...s }) {
|
|
1293
|
+
return /* @__PURE__ */ d(
|
|
1294
|
+
"span",
|
|
1295
|
+
{
|
|
1296
|
+
className: i("tooltip", t === "bottom" && "tooltip--bottom", n),
|
|
1297
|
+
...s,
|
|
1298
|
+
children: [
|
|
1299
|
+
a,
|
|
1300
|
+
/* @__PURE__ */ r("span", { role: "tooltip", className: "tooltip__bubble", children: e })
|
|
1301
|
+
]
|
|
1302
|
+
}
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
function wn({ className: e, ...t }) {
|
|
1306
|
+
return /* @__PURE__ */ r("div", { className: i("title-row", e), ...t });
|
|
1073
1307
|
}
|
|
1074
|
-
function
|
|
1075
|
-
children:
|
|
1076
|
-
bottom:
|
|
1308
|
+
function yn({
|
|
1309
|
+
children: e,
|
|
1310
|
+
bottom: t,
|
|
1077
1311
|
position: n = "left",
|
|
1078
|
-
className:
|
|
1079
|
-
...
|
|
1312
|
+
className: a,
|
|
1313
|
+
...s
|
|
1080
1314
|
}) {
|
|
1081
|
-
return /* @__PURE__ */
|
|
1315
|
+
return /* @__PURE__ */ d(
|
|
1082
1316
|
"nav",
|
|
1083
1317
|
{
|
|
1084
|
-
className:
|
|
1318
|
+
className: i(
|
|
1085
1319
|
"vertical-toolbar",
|
|
1086
1320
|
n === "right" && "vertical-toolbar--right",
|
|
1087
1321
|
n === "static" && "vertical-toolbar--static",
|
|
1088
|
-
|
|
1322
|
+
a
|
|
1089
1323
|
),
|
|
1090
|
-
...
|
|
1324
|
+
...s,
|
|
1091
1325
|
children: [
|
|
1092
|
-
/* @__PURE__ */ r("div", { className: "vertical-toolbar__links", children:
|
|
1093
|
-
|
|
1326
|
+
/* @__PURE__ */ r("div", { className: "vertical-toolbar__links", children: e }),
|
|
1327
|
+
t
|
|
1094
1328
|
]
|
|
1095
1329
|
}
|
|
1096
1330
|
);
|
|
1097
1331
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return /* @__PURE__ */
|
|
1100
|
-
Array.from({ length:
|
|
1101
|
-
|
|
1332
|
+
function vn({ inputs: e = 1, showButton: t = !0, className: n, ...a }) {
|
|
1333
|
+
return /* @__PURE__ */ d(fe, { className: n, ...a, children: [
|
|
1334
|
+
Array.from({ length: e }).map((s, c) => /* @__PURE__ */ r(tt, {}, `panel-form-input-${c}`)),
|
|
1335
|
+
t && /* @__PURE__ */ r(Me, {})
|
|
1102
1336
|
] });
|
|
1103
1337
|
}
|
|
1104
|
-
function
|
|
1105
|
-
withThumb:
|
|
1106
|
-
chipCount:
|
|
1338
|
+
function Nn({
|
|
1339
|
+
withThumb: e = !0,
|
|
1340
|
+
chipCount: t = 0,
|
|
1107
1341
|
actionCount: n = 0,
|
|
1108
|
-
className:
|
|
1109
|
-
...
|
|
1342
|
+
className: a,
|
|
1343
|
+
...s
|
|
1110
1344
|
}) {
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
/* @__PURE__ */ r(
|
|
1116
|
-
/* @__PURE__ */ r(
|
|
1345
|
+
return /* @__PURE__ */ d(dt, { as: "li", className: a, ...s, children: [
|
|
1346
|
+
/* @__PURE__ */ d(fe, { size: "sm", children: [
|
|
1347
|
+
e ? /* @__PURE__ */ r(_e, {}) : null,
|
|
1348
|
+
t > 0 ? /* @__PURE__ */ r(pt, { children: Array.from({ length: t }).map((c, m) => /* @__PURE__ */ r(nt, {}, `card-skeleton-chip-${m}`)) }) : null,
|
|
1349
|
+
/* @__PURE__ */ r(Pe, {}),
|
|
1350
|
+
/* @__PURE__ */ r(ye, { short: !0 })
|
|
1117
1351
|
] }),
|
|
1118
|
-
n > 0 ? /* @__PURE__ */ r(
|
|
1352
|
+
n > 0 ? /* @__PURE__ */ r(Ke, { children: Array.from({ length: n }).map((c, m) => /* @__PURE__ */ r(Me, {}, `card-skeleton-btn-${m}`)) }) : null
|
|
1119
1353
|
] });
|
|
1120
1354
|
}
|
|
1121
|
-
function
|
|
1355
|
+
function xn({ count: e = 8, minItemWidth: t = 120 }) {
|
|
1122
1356
|
return /* @__PURE__ */ r(
|
|
1123
|
-
|
|
1357
|
+
me,
|
|
1124
1358
|
{
|
|
1125
1359
|
className: "picker-grid",
|
|
1126
|
-
style: { gridTemplateColumns: `repeat(auto-fill, minmax(${
|
|
1127
|
-
children: Array.from({ length:
|
|
1128
|
-
/* @__PURE__ */ r(
|
|
1129
|
-
/* @__PURE__ */ r(
|
|
1130
|
-
] }) }) }, `picker-skeleton-${
|
|
1360
|
+
style: { gridTemplateColumns: `repeat(auto-fill, minmax(${t}px, 1fr))` },
|
|
1361
|
+
children: Array.from({ length: e }).map((n, a) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(ht, { as: "div", className: "picker-card--skeleton", children: /* @__PURE__ */ d(fe, { size: "sm", children: [
|
|
1362
|
+
/* @__PURE__ */ r(_e, {}),
|
|
1363
|
+
/* @__PURE__ */ r(ye, { short: !0 })
|
|
1364
|
+
] }) }) }, `picker-skeleton-${a}`))
|
|
1131
1365
|
}
|
|
1132
1366
|
);
|
|
1133
1367
|
}
|
|
1134
1368
|
export {
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1369
|
+
Pt as Alert,
|
|
1370
|
+
Ct as AvatarBadge,
|
|
1371
|
+
Ft as AvatarSkeleton,
|
|
1372
|
+
ke as Button,
|
|
1373
|
+
Ke as ButtonRow,
|
|
1374
|
+
Me as ButtonSkeleton,
|
|
1375
|
+
Wt as CanvasSkeleton,
|
|
1376
|
+
zt as CanvasStage,
|
|
1377
|
+
Nn as CardSkeleton,
|
|
1378
|
+
st as CardTitle,
|
|
1379
|
+
Tt as Checkbox,
|
|
1380
|
+
Dt as Chip,
|
|
1381
|
+
nt as ChipSkeleton,
|
|
1382
|
+
Qe as ChoiceCard,
|
|
1383
|
+
Gt as ChoiceGroup,
|
|
1384
|
+
Et as ChoiceGroupSkeleton,
|
|
1385
|
+
kt as ConfirmDialog,
|
|
1386
|
+
Lt as CoordGrid,
|
|
1387
|
+
Ot as CoordInput,
|
|
1388
|
+
$t as Divider,
|
|
1389
|
+
rt as Draggable,
|
|
1390
|
+
Bt as DraggableSurface,
|
|
1391
|
+
Vt as EmptyState,
|
|
1392
|
+
lt as Field,
|
|
1393
|
+
Nt as FloatingPanel,
|
|
1394
|
+
jt as GeneratingOverlay,
|
|
1395
|
+
It as IconButtonSkeleton,
|
|
1396
|
+
Zt as IconText,
|
|
1397
|
+
Ut as ImageThumb,
|
|
1398
|
+
qt as Inline,
|
|
1399
|
+
ut as Input,
|
|
1400
|
+
tt as InputSkeleton,
|
|
1401
|
+
dt as ItemCard,
|
|
1402
|
+
Kt as ItemList,
|
|
1403
|
+
Jt as Kbd,
|
|
1404
|
+
ct as Label,
|
|
1405
|
+
ye as LineSkeleton,
|
|
1406
|
+
me as List,
|
|
1407
|
+
Qt as LoadingState,
|
|
1408
|
+
Ue as Minimap,
|
|
1409
|
+
Ce as MutedText,
|
|
1410
|
+
en as NumberField,
|
|
1411
|
+
tn as OverlayIconButton,
|
|
1412
|
+
rn as PageCard,
|
|
1413
|
+
nn as PageShell,
|
|
1414
|
+
Ht as PageTitle,
|
|
1415
|
+
an as PanelCloseButton,
|
|
1416
|
+
Mt as PanelErrorBoundary,
|
|
1417
|
+
vn as PanelFormSkeleton,
|
|
1418
|
+
sn as PanelSection,
|
|
1419
|
+
on as PanelTitle,
|
|
1420
|
+
ht as PickerCard,
|
|
1421
|
+
cn as PickerGrid,
|
|
1422
|
+
xn as PickerGridSkeleton,
|
|
1423
|
+
ln as Pill,
|
|
1424
|
+
it as SectionDescription,
|
|
1425
|
+
ot as SectionTitle,
|
|
1426
|
+
un as Select,
|
|
1427
|
+
Xt as SelectSkeleton,
|
|
1428
|
+
A as Skeleton,
|
|
1429
|
+
dn as Slider,
|
|
1430
|
+
hn as SplitLayout,
|
|
1431
|
+
fe as Stack,
|
|
1432
|
+
mn as Surface,
|
|
1433
|
+
Rt as Switch,
|
|
1434
|
+
pt as TagRow,
|
|
1435
|
+
fn as Textarea,
|
|
1436
|
+
Yt as TextareaSkeleton,
|
|
1437
|
+
pn as ThemeToggle,
|
|
1438
|
+
_e as ThumbSkeleton,
|
|
1439
|
+
wn as TitleRow,
|
|
1440
|
+
Pe as TitleSkeleton,
|
|
1441
|
+
bn as Toolbar,
|
|
1442
|
+
gn as Tooltip,
|
|
1443
|
+
yn as VerticalToolbar,
|
|
1444
|
+
G as WHITEBOARD_GRID,
|
|
1445
|
+
vt as WhiteboardShell,
|
|
1446
|
+
Ze as ZoomBar,
|
|
1447
|
+
St as belowPanel,
|
|
1448
|
+
i as cn,
|
|
1449
|
+
ve as computeWhiteboardFit,
|
|
1450
|
+
je as computeWhiteboardRectFocus,
|
|
1451
|
+
At as resetDraggables,
|
|
1452
|
+
le as snapToWhiteboardGrid,
|
|
1453
|
+
xt as usePanelRect,
|
|
1454
|
+
_t as useWhiteboardLayout,
|
|
1455
|
+
g as useWhiteboardStore
|
|
1210
1456
|
};
|