ryugi-artifacts 1.51.1 → 1.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +4 -4
- package/dist/server.cjs +1 -1
- package/dist/viewer/{ArtboardLayout-BZVGyDSM.js → ArtboardLayout-C5W1_hsL.js} +1 -1
- package/dist/viewer/Canvas-Cv06--ID.js +1 -0
- package/dist/viewer/{PreviewLayout-VfoLatHx.js → PreviewLayout-a_8RK85I.js} +2 -2
- package/dist/viewer/index.js +2 -2
- package/dist/viewer/preview.html +1 -1
- package/dist/viewer/preview.js +1 -1
- package/dist/viewer-lib/Canvas-K9UeSg4j.js +1371 -0
- package/dist/viewer-lib/{PreviewView-C4H6LbEb.js → PreviewView-cwr1vkQ0.js} +1 -1
- package/dist/viewer-lib/core.js +1 -1
- package/dist/viewer-lib/index.js +21 -21
- package/package.json +1 -1
- package/dist/viewer/Canvas-m5zHdW7S.js +0 -1
- package/dist/viewer-lib/Canvas-DOK6z2BX.js +0 -568
|
@@ -1,568 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-5HNE8Q1r.js";
|
|
2
|
-
import { O as t, d as n } from "./PreviewView-C4H6LbEb.js";
|
|
3
|
-
import { a as r } from "./i18n-B_9P4TsB.js";
|
|
4
|
-
import { t as i } from "./tokens.stylex-CuqOcC9Y.js";
|
|
5
|
-
import { memo as a, useEffect as o, useId as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
|
|
6
|
-
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
-
import { Maximize2 as m, Repeat as h } from "lucide-react";
|
|
8
|
-
import { motion as g } from "motion/react";
|
|
9
|
-
//#region src/viewer/lib/play.ts
|
|
10
|
-
function _(e, t) {
|
|
11
|
-
let n = new Set(e);
|
|
12
|
-
return n.delete(t) || n.add(t), n;
|
|
13
|
-
}
|
|
14
|
-
var v = (e, t) => (e[t] ?? 0) > 0, y = (e, t) => e.interactive === !0 && v(t, e.file), b = (e, t, n, r) => `${e}${t}?v=${n}${r > 0 ? `&r=${r}` : ""}`, x = 160, S = [
|
|
15
|
-
1,
|
|
16
|
-
1.5,
|
|
17
|
-
2,
|
|
18
|
-
.5
|
|
19
|
-
], C = (e) => {
|
|
20
|
-
let t = Math.max(0, Math.floor(Number.isFinite(e) ? e : 0));
|
|
21
|
-
return `${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
|
|
22
|
-
};
|
|
23
|
-
function w({ playing: e }) {
|
|
24
|
-
return /* @__PURE__ */ f("svg", {
|
|
25
|
-
"aria-hidden": "true",
|
|
26
|
-
fill: "currentColor",
|
|
27
|
-
height: "16",
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
width: "16",
|
|
30
|
-
children: [!1, !0].map((t) => /* @__PURE__ */ f(g.g, {
|
|
31
|
-
initial: !1,
|
|
32
|
-
style: { transformOrigin: "12px 12px" },
|
|
33
|
-
transition: {
|
|
34
|
-
type: "spring",
|
|
35
|
-
duration: .3,
|
|
36
|
-
bounce: 0
|
|
37
|
-
},
|
|
38
|
-
animate: {
|
|
39
|
-
opacity: +(e === t),
|
|
40
|
-
scale: e === t ? 1 : .25,
|
|
41
|
-
filter: e === t ? "blur(0px)" : "blur(4px)"
|
|
42
|
-
},
|
|
43
|
-
children: t ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("rect", {
|
|
44
|
-
height: "16",
|
|
45
|
-
rx: "1",
|
|
46
|
-
width: "4",
|
|
47
|
-
x: "6",
|
|
48
|
-
y: "4"
|
|
49
|
-
}), /* @__PURE__ */ f("rect", {
|
|
50
|
-
height: "16",
|
|
51
|
-
rx: "1",
|
|
52
|
-
width: "4",
|
|
53
|
-
x: "14",
|
|
54
|
-
y: "4"
|
|
55
|
-
})] }) : /* @__PURE__ */ f("path", { d: "M8 4.6c-.9-.5-2 .1-2 1.1v12.6c0 1 1.1 1.6 2 1.1l11-6.3c.9-.5.9-1.7 0-2.2Z" })
|
|
56
|
-
}, String(t)))
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function T({ src: e, title: t, barScale: n, barWidth: i, onExpand: a }) {
|
|
60
|
-
let { t: s } = r(), c = l(null), g = l(null), [_, v] = u(!1), [y, b] = u(0), [T, E] = u(0), [D, O] = u(1), [k, A] = u(!1), [j, M] = u(!1);
|
|
61
|
-
o(() => {
|
|
62
|
-
let e = c.current;
|
|
63
|
-
if (!e) return;
|
|
64
|
-
let t = () => {
|
|
65
|
-
M(!1), b(e.currentTime), E(e.duration), v(!e.paused);
|
|
66
|
-
}, n = [
|
|
67
|
-
"loadedmetadata",
|
|
68
|
-
"timeupdate",
|
|
69
|
-
"play",
|
|
70
|
-
"pause",
|
|
71
|
-
"ended",
|
|
72
|
-
"seeked"
|
|
73
|
-
], r = () => M(!0);
|
|
74
|
-
for (let r of n) e.addEventListener(r, t);
|
|
75
|
-
return e.addEventListener("error", r), () => {
|
|
76
|
-
for (let r of n) e.removeEventListener(r, t);
|
|
77
|
-
e.removeEventListener("error", r);
|
|
78
|
-
};
|
|
79
|
-
}, []);
|
|
80
|
-
let N = () => {
|
|
81
|
-
let e = c.current;
|
|
82
|
-
e && (e.paused ? e.play().catch(() => v(!e.paused)) : e.pause());
|
|
83
|
-
}, P = () => {
|
|
84
|
-
let e = S[(S.indexOf(D) + 1) % S.length];
|
|
85
|
-
c.current && (c.current.playbackRate = e), O(e);
|
|
86
|
-
}, F = () => {
|
|
87
|
-
c.current && (c.current.loop = !k), A(!k);
|
|
88
|
-
}, I = (e) => {
|
|
89
|
-
let t = c.current;
|
|
90
|
-
if (!t || !Number.isFinite(t.duration) || t.duration <= 0) return;
|
|
91
|
-
let n = e.currentTarget.getBoundingClientRect();
|
|
92
|
-
t.currentTime = Math.min(1, Math.max(0, (e.clientX - n.left) / n.width)) * t.duration, b(t.currentTime);
|
|
93
|
-
};
|
|
94
|
-
return /* @__PURE__ */ p(d, { children: [
|
|
95
|
-
/* @__PURE__ */ f("video", {
|
|
96
|
-
muted: !0,
|
|
97
|
-
playsInline: !0,
|
|
98
|
-
preload: "metadata",
|
|
99
|
-
ref: c,
|
|
100
|
-
src: e,
|
|
101
|
-
title: t,
|
|
102
|
-
className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x19kjcj4 x1hpxl24 x47corl"
|
|
103
|
-
}),
|
|
104
|
-
/* @__PURE__ */ f("button", {
|
|
105
|
-
"data-video-surface": !0,
|
|
106
|
-
"aria-label": s(_ ? "video.pauseTitle" : "video.playTitle", { title: t }),
|
|
107
|
-
type: "button",
|
|
108
|
-
onClick: (e) => {
|
|
109
|
-
(!e.detail || !g.current || Math.hypot(e.clientX - g.current.x, e.clientY - g.current.y) < 4) && N(), g.current = null;
|
|
110
|
-
},
|
|
111
|
-
onKeyDown: (e) => {
|
|
112
|
-
(e.key === " " || e.key === "Enter") && e.stopPropagation();
|
|
113
|
-
},
|
|
114
|
-
onPointerDown: (e) => {
|
|
115
|
-
g.current = {
|
|
116
|
-
x: e.clientX,
|
|
117
|
-
y: e.clientY
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1717udv xc342km xjbqb8w x1ypdohk x1t137rt x9v5kkp x1de99jn x1af67cj x1v57pqu"
|
|
121
|
-
}),
|
|
122
|
-
j && /* @__PURE__ */ f("div", {
|
|
123
|
-
className: "x10l6tqk x10a8y8t xrvj5dj x1ku5rj1 x1tamke2 x193dt0t xyxeb8y xqfszdh x4z9k3i x2b8uid x47corl",
|
|
124
|
-
children: s("video.failed")
|
|
125
|
-
}),
|
|
126
|
-
i >= x && /* @__PURE__ */ p("div", {
|
|
127
|
-
"data-chrome": "video-controls",
|
|
128
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
129
|
-
className: "x10l6tqk xu96u03 xdsb8wn xc9qbxq x9f619 x78zum5 x6s0dn4 x1v2ro7d xaope02 x1hj3fc7 x193dt0t x178xt8z x13fuv20 xyky8oz x1fh8tye x1fao0z8 x1j6dyjg x67bb7w xt0e3qv x87ps6o",
|
|
130
|
-
style: {
|
|
131
|
-
width: i,
|
|
132
|
-
transform: `scale(${n})`
|
|
133
|
-
},
|
|
134
|
-
children: [
|
|
135
|
-
/* @__PURE__ */ f("button", {
|
|
136
|
-
"aria-label": s(_ ? "video.pause" : "video.play"),
|
|
137
|
-
type: "button",
|
|
138
|
-
onClick: N,
|
|
139
|
-
className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk",
|
|
140
|
-
children: /* @__PURE__ */ f(w, { playing: _ })
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ p("span", {
|
|
143
|
-
className: "x2lah0s xss6m8b",
|
|
144
|
-
children: [
|
|
145
|
-
C(y),
|
|
146
|
-
" / ",
|
|
147
|
-
C(T)
|
|
148
|
-
]
|
|
149
|
-
}),
|
|
150
|
-
/* @__PURE__ */ p("div", {
|
|
151
|
-
"aria-label": s("video.progress"),
|
|
152
|
-
"aria-valuemax": Math.round(T || 0),
|
|
153
|
-
"aria-valuemin": 0,
|
|
154
|
-
"aria-valuenow": Math.round(y),
|
|
155
|
-
role: "slider",
|
|
156
|
-
tabIndex: 0,
|
|
157
|
-
onPointerDown: (e) => {
|
|
158
|
-
e.currentTarget.setPointerCapture?.(e.pointerId), I(e);
|
|
159
|
-
},
|
|
160
|
-
onPointerMove: (e) => {
|
|
161
|
-
e.buttons === 1 && I(e);
|
|
162
|
-
},
|
|
163
|
-
className: "x1n2onr6 x98rzlu x1v9usgg x78zum5 x6s0dn4 x1ypdohk",
|
|
164
|
-
children: [/* @__PURE__ */ f("span", { className: "x10l6tqk xu96u03 x3m8u43 xuoj239 x1q6ipvf" }), /* @__PURE__ */ f("span", {
|
|
165
|
-
className: "x10l6tqk xu96u03 xuoj239 x1l2ivya",
|
|
166
|
-
style: { width: `${T > 0 ? y / T * 100 : 0}%` }
|
|
167
|
-
})]
|
|
168
|
-
}),
|
|
169
|
-
/* @__PURE__ */ p("button", {
|
|
170
|
-
"aria-label": s("video.speed"),
|
|
171
|
-
type: "button",
|
|
172
|
-
onClick: P,
|
|
173
|
-
className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk x17s4nb9 x1s688f",
|
|
174
|
-
children: [D, "×"]
|
|
175
|
-
}),
|
|
176
|
-
/* @__PURE__ */ f("button", {
|
|
177
|
-
"aria-label": s("video.loop"),
|
|
178
|
-
"aria-pressed": k,
|
|
179
|
-
type: "button",
|
|
180
|
-
onClick: F,
|
|
181
|
-
...{
|
|
182
|
-
0: { className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk" },
|
|
183
|
-
1: { className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xjb2p0i x1j6dyjg x1ypdohk xymxiyj x1p2l8fb" }
|
|
184
|
-
}[!k | 0],
|
|
185
|
-
children: /* @__PURE__ */ f(h, { size: 14 })
|
|
186
|
-
}),
|
|
187
|
-
a && /* @__PURE__ */ f("button", {
|
|
188
|
-
"aria-label": s("video.expand"),
|
|
189
|
-
type: "button",
|
|
190
|
-
onClick: a,
|
|
191
|
-
className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk",
|
|
192
|
-
children: /* @__PURE__ */ f(m, { size: 13 })
|
|
193
|
-
})
|
|
194
|
-
]
|
|
195
|
-
})
|
|
196
|
-
] });
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region src/viewer/components/MediaBoard.tsx
|
|
200
|
-
function E({ id: e, board: t, src: n, zoom: r, onExpand: i }) {
|
|
201
|
-
return t.type === "video" ? /* @__PURE__ */ f(T, {
|
|
202
|
-
barScale: 1 / r,
|
|
203
|
-
barWidth: t.w * r,
|
|
204
|
-
src: n,
|
|
205
|
-
title: t.title ?? e,
|
|
206
|
-
onExpand: i
|
|
207
|
-
}) : /* @__PURE__ */ f("img", {
|
|
208
|
-
alt: t.title ?? e,
|
|
209
|
-
draggable: !1,
|
|
210
|
-
src: n,
|
|
211
|
-
className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x19kjcj4 x1l2ivya x47corl"
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/shared/inspector.ts
|
|
216
|
-
var D = [
|
|
217
|
-
"width",
|
|
218
|
-
"height",
|
|
219
|
-
"position",
|
|
220
|
-
"flex-grow",
|
|
221
|
-
"display",
|
|
222
|
-
"flex-direction",
|
|
223
|
-
"align-items",
|
|
224
|
-
"gap",
|
|
225
|
-
"padding",
|
|
226
|
-
"background-color",
|
|
227
|
-
"opacity",
|
|
228
|
-
"border-radius",
|
|
229
|
-
"border-style",
|
|
230
|
-
"font-size",
|
|
231
|
-
"color",
|
|
232
|
-
"box-shadow"
|
|
233
|
-
], O = "#0D99FF", k = "M6.2 3.6C5 2.7 3.4 3.6 3.6 5.1L6 22.7C6.2 24.3 8.2 24.8 9.1 23.5L13 18.3C13.4 17.8 14 17.5 14.6 17.5L21.1 17.3C22.7 17.2 23.4 15.2 22.2 14.3Z", A = "M13 3a9 9 0 0 1 0 18H4.5A1.5 1.5 0 0 1 3 19.5V13A10 10 0 0 1 13 3z", j = (e, t, n) => `url("data:image/svg+xml,${encodeURIComponent(e)}") ${t}, ${n}`, M = j(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 28 28'><path d='${k}' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/><path d='${k}' fill='${O}'/></svg>`, "3 3", "default"), N = j(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='${A}' fill='none' stroke='white' stroke-width='3' stroke-linejoin='round'/><path d='${A}' fill='${O}'/><path d='M13 8.2v7.6M9.2 12h7.6' stroke='white' stroke-width='2.2' stroke-linecap='round'/></svg>`, "3 21", "crosshair");
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region src/viewer/lib/cursorMotion.ts
|
|
236
|
-
function P(e, t) {
|
|
237
|
-
let n = e;
|
|
238
|
-
for (; n.length > 1;) n = n.slice(0, -1).map((e, r) => ({
|
|
239
|
-
x: e.x + (n[r + 1].x - e.x) * t,
|
|
240
|
-
y: e.y + (n[r + 1].y - e.y) * t
|
|
241
|
-
}));
|
|
242
|
-
return n[0];
|
|
243
|
-
}
|
|
244
|
-
function F(e, t, n) {
|
|
245
|
-
let r = t.x - e.x, i = t.y - e.y, a = -i, o = r;
|
|
246
|
-
a < 0 && (a = -a, o = -o);
|
|
247
|
-
let s = (t, n) => ({
|
|
248
|
-
x: e.x + r * t + a * n,
|
|
249
|
-
y: e.y + i * t + o * n
|
|
250
|
-
}), c = [
|
|
251
|
-
e,
|
|
252
|
-
s(.2, 0),
|
|
253
|
-
s(.3, -.5),
|
|
254
|
-
s(1.55, 1.25),
|
|
255
|
-
s(1.35, .1),
|
|
256
|
-
t
|
|
257
|
-
];
|
|
258
|
-
if (n !== void 0) {
|
|
259
|
-
let t = (n - 135) * Math.PI / 180, a = Math.hypot(r, i) * .2;
|
|
260
|
-
c[1] = {
|
|
261
|
-
x: e.x + Math.cos(t) * a,
|
|
262
|
-
y: e.y + Math.sin(t) * a
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
let l = c.slice(0, -1).map((e, t) => ({
|
|
266
|
-
x: 5 * (c[t + 1].x - e.x),
|
|
267
|
-
y: 5 * (c[t + 1].y - e.y)
|
|
268
|
-
})), u = [0], d = e;
|
|
269
|
-
for (let e = 1; e <= 600; e++) {
|
|
270
|
-
let t = P(c, e / 600);
|
|
271
|
-
u.push(u[e - 1] + Math.hypot(t.x - d.x, t.y - d.y)), d = t;
|
|
272
|
-
}
|
|
273
|
-
let f = u[600];
|
|
274
|
-
return {
|
|
275
|
-
length: f,
|
|
276
|
-
at(e) {
|
|
277
|
-
let t = Math.max(0, Math.min(1, e)) * f, n = 0, r = 600;
|
|
278
|
-
for (; r - n > 1;) {
|
|
279
|
-
let e = n + r >> 1;
|
|
280
|
-
u[e] < t ? n = e : r = e;
|
|
281
|
-
}
|
|
282
|
-
let i = u[r] - u[n], a = (n + (i ? (t - u[n]) / i : 0)) / 600, o = P(l, a);
|
|
283
|
-
return {
|
|
284
|
-
...P(c, a),
|
|
285
|
-
angle: Math.atan2(o.y, o.x) * 180 / Math.PI + 135
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/viewer/components/WritingCursor.tsx
|
|
292
|
-
function I({ x: e, y: t, zoom: n, agent: r, title: a }) {
|
|
293
|
-
let o = `agent-${s().replaceAll(/[^\w-]/g, "")}`, u = l(null), d = l(null), m = l(null), h = l(!1), g = l(n), _ = (e) => `translate(${e.x}px, ${e.y}px) scale(${1 / g.current})`, v = (e) => `translate(-3.43px, -3.43px) rotate(${e}deg)`, y = (e) => {
|
|
294
|
-
m.current = e, u.current && (u.current.style.transform = _(e)), d.current && (d.current.style.transform = v(e.angle));
|
|
295
|
-
};
|
|
296
|
-
c(() => {
|
|
297
|
-
g.current = n, m.current && y(m.current);
|
|
298
|
-
}, [n]), c(() => {
|
|
299
|
-
let n = matchMedia("(prefers-reduced-motion: reduce)"), r = m.current, i = 0, a = () => {
|
|
300
|
-
cancelAnimationFrame(i), i = 0, h.current = !1, y({
|
|
301
|
-
x: e,
|
|
302
|
-
y: t,
|
|
303
|
-
angle: m.current?.angle ?? 0
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
if (!r || n.matches || Math.hypot(e - r.x, t - r.y) * g.current < 2) a();
|
|
307
|
-
else {
|
|
308
|
-
let n = F(r, {
|
|
309
|
-
x: e,
|
|
310
|
-
y: t
|
|
311
|
-
}, h.current ? r.angle : void 0), a = Math.min(1800, 900 + n.length * g.current * 1.2), o = performance.now(), s = o;
|
|
312
|
-
h.current = !0;
|
|
313
|
-
let c = (e) => {
|
|
314
|
-
let t = Math.min(1, Math.max(0, (e - o) / a)), r = n.at(t ** 3 * (t * (t * 6 - 15) + 10)), l = m.current.angle;
|
|
315
|
-
r.angle = l + (((r.angle - l) % 360 + 540) % 360 - 180) * (1 - Math.exp(-(e - s) / 80)), s = e, h.current = t < 1, y(r), i = t < 1 ? requestAnimationFrame(c) : 0;
|
|
316
|
-
};
|
|
317
|
-
i = requestAnimationFrame(c);
|
|
318
|
-
}
|
|
319
|
-
let o = () => {
|
|
320
|
-
n.matches && a();
|
|
321
|
-
};
|
|
322
|
-
return n.addEventListener("change", o), () => {
|
|
323
|
-
cancelAnimationFrame(i), n.removeEventListener("change", o);
|
|
324
|
-
};
|
|
325
|
-
}, [e, t]);
|
|
326
|
-
let b = m.current ?? {
|
|
327
|
-
x: e,
|
|
328
|
-
y: t,
|
|
329
|
-
angle: 0
|
|
330
|
-
};
|
|
331
|
-
return /* @__PURE__ */ p("div", {
|
|
332
|
-
"aria-label": `${r} last worked on ${a}`,
|
|
333
|
-
ref: u,
|
|
334
|
-
role: "status",
|
|
335
|
-
className: "x10l6tqk xu96u03 x13vifvy x1u8a7rm x47corl x1hj3fc7",
|
|
336
|
-
style: { transform: _(b) },
|
|
337
|
-
children: [/* @__PURE__ */ p("svg", {
|
|
338
|
-
"aria-hidden": "true",
|
|
339
|
-
height: "24",
|
|
340
|
-
ref: d,
|
|
341
|
-
viewBox: "0 0 28 28",
|
|
342
|
-
width: "24",
|
|
343
|
-
className: "x1lliihq xqqlr9g x1gtfylx",
|
|
344
|
-
style: { transform: v(b.angle) },
|
|
345
|
-
children: [
|
|
346
|
-
/* @__PURE__ */ f("path", {
|
|
347
|
-
d: k,
|
|
348
|
-
fill: "none",
|
|
349
|
-
stroke: i.white,
|
|
350
|
-
strokeLinejoin: "round",
|
|
351
|
-
strokeWidth: "4"
|
|
352
|
-
}),
|
|
353
|
-
/* @__PURE__ */ f("defs", { children: /* @__PURE__ */ p("linearGradient", {
|
|
354
|
-
id: o,
|
|
355
|
-
x1: "0",
|
|
356
|
-
x2: "1",
|
|
357
|
-
y1: "0",
|
|
358
|
-
y2: "1",
|
|
359
|
-
children: [/* @__PURE__ */ f("stop", {
|
|
360
|
-
offset: "0",
|
|
361
|
-
stopColor: i.selection
|
|
362
|
-
}), /* @__PURE__ */ f("stop", {
|
|
363
|
-
offset: "1",
|
|
364
|
-
stopColor: i.agent
|
|
365
|
-
})]
|
|
366
|
-
}) }),
|
|
367
|
-
/* @__PURE__ */ f("path", {
|
|
368
|
-
d: k,
|
|
369
|
-
fill: `url(#${o})`
|
|
370
|
-
})
|
|
371
|
-
]
|
|
372
|
-
}), /* @__PURE__ */ f("span", {
|
|
373
|
-
className: "x10l6tqk x1trqr8e xv4lvxq x78zum5 x6s0dn4 x1219o5k x1w2h69v x25sj25 x1bjonze xdocmp1 xgs1500 x828b17 x1bqy6mi xqxj4xa x8r4el6 x1j6dyjg x1s688f x152skdk xuxw1ft xmj57et",
|
|
374
|
-
children: r
|
|
375
|
-
})]
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region src/viewer/components/Canvas.tsx
|
|
380
|
-
var L = /* @__PURE__ */ e({ Canvas: () => G });
|
|
381
|
-
function R(e) {
|
|
382
|
-
if (!e) return {
|
|
383
|
-
backgroundColor: i.paperWarm,
|
|
384
|
-
color: i.inkWarm
|
|
385
|
-
};
|
|
386
|
-
let t = e.length === 4 ? e.slice(1).split("").map((e) => e + e).join("") : e.slice(1), [n, r, a] = [
|
|
387
|
-
0,
|
|
388
|
-
2,
|
|
389
|
-
4
|
|
390
|
-
].map((e) => {
|
|
391
|
-
let n = parseInt(t.slice(e, e + 2), 16) / 255;
|
|
392
|
-
return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
|
|
393
|
-
});
|
|
394
|
-
return {
|
|
395
|
-
backgroundColor: e,
|
|
396
|
-
color: .2126 * n + .7152 * r + .0722 * a > .179 ? i.black : i.white
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
var z = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set();
|
|
400
|
-
function H(e, t, n, r = !1) {
|
|
401
|
-
return {
|
|
402
|
-
left: e.x,
|
|
403
|
-
top: e.y,
|
|
404
|
-
width: e.w,
|
|
405
|
-
height: e.h,
|
|
406
|
-
...t ? { outlineWidth: "calc(2px / var(--zoom, 1))" } : {},
|
|
407
|
-
...n ? r ? { visibility: "hidden" } : { display: "none" } : {}
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
var U = a(function({ boardBase: e, boards: n, boardSandbox: r = "allow-scripts", contentBase: i, culled: a = V, frameLoaded: o, frameRef: s, gesturing: c = !1, images: l = B, inspecting: u, pending: d, phases: m = z, playing: h, replays: g, versions: _, writing: x }) {
|
|
411
|
-
return n.map(([n, S]) => {
|
|
412
|
-
if (t(S)) return null;
|
|
413
|
-
let C = v(_, S.file) && !d.has(n), w = m.get(n) ?? "mounted", T = l.get(n) ?? null, E = !!T && (w === "unloaded" || w === "restoring"), D = C && (w !== "unloaded" || !T), O = n === x;
|
|
414
|
-
return /* @__PURE__ */ p("div", {
|
|
415
|
-
"aria-busy": O || void 0,
|
|
416
|
-
"data-board": n,
|
|
417
|
-
...{
|
|
418
|
-
0: { className: "x10l6tqk" },
|
|
419
|
-
2: { className: "x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg xaatb59 x1tjb3dp x47corl" },
|
|
420
|
-
1: { className: "x10l6tqk xaatb59 x7vaw5c xsvltah" },
|
|
421
|
-
3: { className: "x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg x47corl xaatb59 x7vaw5c xsvltah" }
|
|
422
|
-
}[!C << 1 | !!O],
|
|
423
|
-
style: H(S, O, a.has(n), w === "capturing"),
|
|
424
|
-
children: [
|
|
425
|
-
D && /* @__PURE__ */ f("iframe", {
|
|
426
|
-
ref: s(n),
|
|
427
|
-
sandbox: r,
|
|
428
|
-
style: c ? { pointerEvents: "none" } : void 0,
|
|
429
|
-
title: S.title ?? n,
|
|
430
|
-
src: b(e ?? i, S.file, _[S.file] ?? 0, g[n] ?? 0),
|
|
431
|
-
onLoad: () => o(n),
|
|
432
|
-
...{
|
|
433
|
-
0: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x47corl x1qgsegg xaatb59 x1tjb3dp" },
|
|
434
|
-
4: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp x67bb7w" },
|
|
435
|
-
2: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x67bb7w x1de99jn x7vaw5c" },
|
|
436
|
-
6: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x67bb7w x1de99jn x7vaw5c" },
|
|
437
|
-
1: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp x47corl" },
|
|
438
|
-
5: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp x47corl" },
|
|
439
|
-
3: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x1de99jn x7vaw5c x47corl" },
|
|
440
|
-
7: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x1de99jn x7vaw5c x47corl" }
|
|
441
|
-
}[!!u << 2 | !!(y(S, _) && h.has(n)) << 1 | !!c]
|
|
442
|
-
}),
|
|
443
|
-
E && /* @__PURE__ */ f("img", {
|
|
444
|
-
alt: "",
|
|
445
|
-
decoding: "async",
|
|
446
|
-
draggable: !1,
|
|
447
|
-
src: T,
|
|
448
|
-
className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x47corl"
|
|
449
|
-
}),
|
|
450
|
-
!C && /* @__PURE__ */ f("span", {
|
|
451
|
-
className: "x1bo0w0s xqfszdh xfifm61",
|
|
452
|
-
children: O ? "Drawing…" : "Waiting…"
|
|
453
|
-
})
|
|
454
|
-
]
|
|
455
|
-
}, n);
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
function W({ boards: e, contentBase: n, culled: r = V, pending: i, versions: a, writing: o, zoom: s, onExpand: c }) {
|
|
459
|
-
return e.map(([e, l]) => {
|
|
460
|
-
if (!t(l)) return null;
|
|
461
|
-
let u = v(a, l.file) && !i.has(e), d = e === o;
|
|
462
|
-
return /* @__PURE__ */ f("div", {
|
|
463
|
-
"aria-busy": d || void 0,
|
|
464
|
-
"data-board": e,
|
|
465
|
-
...{
|
|
466
|
-
0: { className: "x10l6tqk" },
|
|
467
|
-
2: { className: "x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg xaatb59 x1tjb3dp x47corl" },
|
|
468
|
-
1: { className: "x10l6tqk xaatb59 x7vaw5c xsvltah" },
|
|
469
|
-
3: { className: "x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg x47corl xaatb59 x7vaw5c xsvltah" }
|
|
470
|
-
}[!u << 1 | !!d],
|
|
471
|
-
style: H(l, d, r.has(e)),
|
|
472
|
-
children: u ? /* @__PURE__ */ f(E, {
|
|
473
|
-
board: l,
|
|
474
|
-
id: e,
|
|
475
|
-
src: b(n, l.file, a[l.file] ?? 0, 0),
|
|
476
|
-
zoom: s,
|
|
477
|
-
onExpand: c && (() => c(e))
|
|
478
|
-
}) : /* @__PURE__ */ f("span", {
|
|
479
|
-
className: "x1bo0w0s xqfszdh xfifm61",
|
|
480
|
-
children: d ? "Drawing…" : "Waiting…"
|
|
481
|
-
})
|
|
482
|
-
}, e);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
function G({ boardBase: e, boardSandbox: r, view: i, worldRef: a, phases: o, images: s, culled: c, gesturing: l, boards: u, notes: d, contentBase: m, versions: h, pending: g, playing: _, replays: v, inspecting: y, frameRef: b, frameLoaded: x, live: S, writing: C, agent: w, onExpand: T }) {
|
|
486
|
-
let E = C;
|
|
487
|
-
if (S) {
|
|
488
|
-
E = void 0;
|
|
489
|
-
let e = 0;
|
|
490
|
-
for (let [n, r] of u) {
|
|
491
|
-
let i = h[r.file] ?? 0;
|
|
492
|
-
t(r) || g.has(n) || i <= e || (E = n, e = i);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
let D = u.find(([e]) => e === E)?.[1];
|
|
496
|
-
return /* @__PURE__ */ p("div", {
|
|
497
|
-
ref: a,
|
|
498
|
-
className: "x10l6tqk xu96u03 x13vifvy x1hj3fc7",
|
|
499
|
-
style: a ? void 0 : {
|
|
500
|
-
transform: `translate(${i.x}px, ${i.y}px) scale(${i.k})`,
|
|
501
|
-
"--zoom": i.k
|
|
502
|
-
},
|
|
503
|
-
children: [
|
|
504
|
-
/* @__PURE__ */ f(U, {
|
|
505
|
-
boardBase: e,
|
|
506
|
-
boardSandbox: r,
|
|
507
|
-
boards: u,
|
|
508
|
-
contentBase: m,
|
|
509
|
-
culled: c,
|
|
510
|
-
frameLoaded: x,
|
|
511
|
-
frameRef: b,
|
|
512
|
-
gesturing: l,
|
|
513
|
-
images: s,
|
|
514
|
-
inspecting: y,
|
|
515
|
-
pending: g,
|
|
516
|
-
phases: o,
|
|
517
|
-
playing: _,
|
|
518
|
-
replays: v,
|
|
519
|
-
versions: h,
|
|
520
|
-
writing: C,
|
|
521
|
-
onExpand: T
|
|
522
|
-
}),
|
|
523
|
-
/* @__PURE__ */ f(W, {
|
|
524
|
-
boards: u,
|
|
525
|
-
contentBase: m,
|
|
526
|
-
culled: c,
|
|
527
|
-
pending: g,
|
|
528
|
-
versions: h,
|
|
529
|
-
writing: C,
|
|
530
|
-
zoom: i.k,
|
|
531
|
-
onExpand: T
|
|
532
|
-
}),
|
|
533
|
-
d.map(([e, t]) => t.kind === "title" ? /* @__PURE__ */ f("h2", {
|
|
534
|
-
className: "x10l6tqk x1ghz6dp x1xlr1w8 x1uo3zyz xjat59b xo2rkog x1bd091l",
|
|
535
|
-
style: {
|
|
536
|
-
left: t.x,
|
|
537
|
-
top: t.y,
|
|
538
|
-
width: t.w,
|
|
539
|
-
whiteSpace: t.w === void 0 ? "nowrap" : "normal",
|
|
540
|
-
fontSize: t.size ?? 96,
|
|
541
|
-
transform: `scale(${n(t.size ?? 96, i.k)})`
|
|
542
|
-
},
|
|
543
|
-
children: t.text
|
|
544
|
-
}, e) : /* @__PURE__ */ f("div", {
|
|
545
|
-
className: "x10l6tqk x12oqio5 x126k92a xj0a0fe x1pmbvsm",
|
|
546
|
-
style: {
|
|
547
|
-
left: t.x,
|
|
548
|
-
top: t.y,
|
|
549
|
-
width: t.w ?? 240,
|
|
550
|
-
padding: 16,
|
|
551
|
-
fontSize: 18,
|
|
552
|
-
lineHeight: "27px",
|
|
553
|
-
...R(t.color)
|
|
554
|
-
},
|
|
555
|
-
children: t.text
|
|
556
|
-
}, e)),
|
|
557
|
-
D && /* @__PURE__ */ f(I, {
|
|
558
|
-
agent: w ?? "Agent",
|
|
559
|
-
title: D.title ?? E,
|
|
560
|
-
x: D.x + Math.min(64, D.w * .15),
|
|
561
|
-
y: D.y + Math.min(80, D.h * .2),
|
|
562
|
-
zoom: i.k
|
|
563
|
-
})
|
|
564
|
-
]
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
//#endregion
|
|
568
|
-
export { M as a, v as c, D as i, y as l, L as n, E as o, N as r, T as s, G as t, _ as u };
|