@stoa-dev/kit 1.1.1 → 1.2.1
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 +2 -2
- package/dist/i18n/locales/at.json.js +9 -3
- package/dist/i18n/locales/at.json.js.map +1 -1
- package/dist/i18n/locales/de.json.js +12 -6
- package/dist/i18n/locales/de.json.js.map +1 -1
- package/dist/i18n/locales/en.json.js +16 -10
- package/dist/i18n/locales/en.json.js.map +1 -1
- package/dist/i18n/locales/it.json.js +9 -3
- package/dist/i18n/locales/it.json.js.map +1 -1
- package/dist/kit.css +1 -1
- package/dist/shell/ScrollToTop/index.js +80 -0
- package/dist/shell/ScrollToTop/index.js.map +1 -0
- package/dist/shell/index.js +34 -32
- package/dist/shell/index.js.map +1 -1
- package/dist/types/i18n/index.d.ts +128 -0
- package/dist/types/i18n/index.d.ts.map +1 -1
- package/dist/types/shell/ScrollToTop/index.d.ts +17 -0
- package/dist/types/shell/ScrollToTop/index.d.ts.map +1 -0
- package/dist/types/shell/index.d.ts +1 -0
- package/dist/types/shell/index.d.ts.map +1 -1
- package/dist/types/ui/audio-player/index.d.ts +30 -0
- package/dist/types/ui/audio-player/index.d.ts.map +1 -0
- package/dist/types/ui/combobox/index.d.ts +41 -0
- package/dist/types/ui/combobox/index.d.ts.map +1 -0
- package/dist/types/ui/file-viewer/index.d.ts +31 -0
- package/dist/types/ui/file-viewer/index.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +3 -0
- package/dist/types/ui/index.d.ts.map +1 -1
- package/dist/types/ui/input/index.d.ts.map +1 -1
- package/dist/ui/audio-player/AudioPlayer.module.scss.js +60 -0
- package/dist/ui/audio-player/AudioPlayer.module.scss.js.map +1 -0
- package/dist/ui/audio-player/index.js +323 -0
- package/dist/ui/audio-player/index.js.map +1 -0
- package/dist/ui/combobox/index.js +178 -0
- package/dist/ui/combobox/index.js.map +1 -0
- package/dist/ui/file-viewer/FileViewer.module.scss.js +56 -0
- package/dist/ui/file-viewer/FileViewer.module.scss.js.map +1 -0
- package/dist/ui/file-viewer/index.js +251 -0
- package/dist/ui/file-viewer/index.js.map +1 -0
- package/dist/ui/index.js +124 -115
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input/index.js +22 -21
- package/dist/ui/input/index.js.map +1 -1
- package/dist/ui/textarea/index.js +1 -1
- package/dist/ui/textarea/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/instrument.css +40 -2
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { jsxs as s, jsx as a, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { RotateCcw as Z, Pause as ee, Play as ae, RotateCw as te, Repeat as re } from "lucide-react";
|
|
3
|
+
import { useId as ne, useRef as ie, useState as h, useEffect as se } from "react";
|
|
4
|
+
import { useTranslation as oe } from "react-i18next";
|
|
5
|
+
import { STOA_NS as le } from "../../i18n/namespace.js";
|
|
6
|
+
import { cn as S } from "../../utils/cn.js";
|
|
7
|
+
import { getRuntimeLocale as ce } from "../../utils/dates.js";
|
|
8
|
+
import t from "./AudioPlayer.module.scss.js";
|
|
9
|
+
const n = 160, P = 118, _ = 2 * Math.PI * P, K = 41;
|
|
10
|
+
function k(i, c) {
|
|
11
|
+
const d = (i - 90) * Math.PI / 180;
|
|
12
|
+
return {
|
|
13
|
+
x: n + Math.cos(d) * c,
|
|
14
|
+
y: n + Math.sin(d) * c
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const de = Array.from({ length: 60 }, (i, c) => {
|
|
18
|
+
const d = c * 6, C = c % 5 === 0, l = k(d, C ? 121 : 125), T = k(d, 130);
|
|
19
|
+
return { degrees: d, major: C, x1: l.x, y1: l.y, x2: T.x, y2: T.y };
|
|
20
|
+
});
|
|
21
|
+
function x(i) {
|
|
22
|
+
if (!Number.isFinite(i)) return "–:––";
|
|
23
|
+
const c = Math.max(0, Math.floor(i));
|
|
24
|
+
return `${Math.floor(c / 60)}:${String(c % 60).padStart(2, "0")}`;
|
|
25
|
+
}
|
|
26
|
+
function be({
|
|
27
|
+
src: i,
|
|
28
|
+
title: c,
|
|
29
|
+
description: d,
|
|
30
|
+
speeds: C = [0.5, 0.75, 1, 1.25],
|
|
31
|
+
skipSeconds: l = 5,
|
|
32
|
+
defaultSpeed: T = 1,
|
|
33
|
+
defaultLoop: U = !1,
|
|
34
|
+
autoFocus: O = !1,
|
|
35
|
+
errorMessage: B,
|
|
36
|
+
footer: $,
|
|
37
|
+
onError: q,
|
|
38
|
+
className: z
|
|
39
|
+
}) {
|
|
40
|
+
const { t: o } = oe(le), v = ne(), N = ie(null), [M, I] = h(!1), [R, y] = h(!1), [u, A] = h(0), [m, D] = h(Number.NaN), [w, G] = h(T), [F, H] = h(U), [J, Q] = h(i);
|
|
41
|
+
i !== J && (Q(i), I(!1), y(!1), A(0), D(Number.NaN)), se(() => {
|
|
42
|
+
N.current && (N.current.playbackRate = w);
|
|
43
|
+
}, [w]);
|
|
44
|
+
const f = Number.isFinite(m) && m > 0, g = i !== null && !M, E = f ? Math.min(1, u / m) : 0, V = E * 360;
|
|
45
|
+
function L() {
|
|
46
|
+
I(!0), y(!1), q?.();
|
|
47
|
+
}
|
|
48
|
+
function j() {
|
|
49
|
+
const e = N.current;
|
|
50
|
+
if (!(!e || !g)) {
|
|
51
|
+
if (!e.paused) {
|
|
52
|
+
e.pause();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
e.play().catch((r) => {
|
|
56
|
+
const p = r instanceof DOMException ? r.name : "";
|
|
57
|
+
p === "NotAllowedError" || p === "AbortError" ? y(!1) : L();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function b(e) {
|
|
62
|
+
const r = N.current;
|
|
63
|
+
!r || !Number.isFinite(r.duration) || (r.currentTime = Math.min(r.duration, Math.max(0, e)), A(r.currentTime));
|
|
64
|
+
}
|
|
65
|
+
function W(e) {
|
|
66
|
+
const r = e.target;
|
|
67
|
+
r.closest('input[type="text"], textarea, select') || (e.key === " " && !r.closest("button") ? (e.preventDefault(), j()) : e.key === "ArrowLeft" && !r.closest("input") ? (e.preventDefault(), b(u - l)) : e.key === "ArrowRight" && !r.closest("input") && (e.preventDefault(), b(u + l)));
|
|
68
|
+
}
|
|
69
|
+
const X = new Intl.NumberFormat(ce(), {
|
|
70
|
+
maximumFractionDigits: 2
|
|
71
|
+
});
|
|
72
|
+
return /* @__PURE__ */ s(
|
|
73
|
+
"section",
|
|
74
|
+
{
|
|
75
|
+
className: S(t.player, z),
|
|
76
|
+
"data-slot": "audio-player",
|
|
77
|
+
"data-state": M ? "error" : R ? "playing" : "paused",
|
|
78
|
+
"aria-labelledby": `${v}-title`,
|
|
79
|
+
onKeyDown: W,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ s("header", { className: t.header, children: [
|
|
82
|
+
/* @__PURE__ */ a(
|
|
83
|
+
"h2",
|
|
84
|
+
{
|
|
85
|
+
id: `${v}-title`,
|
|
86
|
+
className: "truncate font-heading text-2xl leading-snug font-semibold tracking-tight",
|
|
87
|
+
children: c ?? o("audioPlayer.title")
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
d && /* @__PURE__ */ a("p", { className: t.caption, children: d })
|
|
91
|
+
] }),
|
|
92
|
+
i && // biome-ignore lint/a11y/useMediaCaption: practice recordings come without captions.
|
|
93
|
+
/* @__PURE__ */ a(
|
|
94
|
+
"audio",
|
|
95
|
+
{
|
|
96
|
+
ref: N,
|
|
97
|
+
src: i,
|
|
98
|
+
loop: F,
|
|
99
|
+
preload: "metadata",
|
|
100
|
+
onLoadedMetadata: (e) => {
|
|
101
|
+
D(e.currentTarget.duration), e.currentTarget.playbackRate = w;
|
|
102
|
+
},
|
|
103
|
+
onDurationChange: (e) => D(e.currentTarget.duration),
|
|
104
|
+
onTimeUpdate: (e) => A(e.currentTarget.currentTime),
|
|
105
|
+
onPlay: () => y(!0),
|
|
106
|
+
onPause: () => y(!1),
|
|
107
|
+
onEnded: () => y(!1),
|
|
108
|
+
onError: L
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
M ? /* @__PURE__ */ a("p", { className: t.error, role: "alert", children: B ?? o("audioPlayer.error") }) : /* @__PURE__ */ s(Y, { children: [
|
|
112
|
+
/* @__PURE__ */ s("div", { className: t.dial, "aria-hidden": "true", children: [
|
|
113
|
+
/* @__PURE__ */ s("svg", { viewBox: "0 0 320 320", "aria-hidden": "true", children: [
|
|
114
|
+
/* @__PURE__ */ a(
|
|
115
|
+
"line",
|
|
116
|
+
{
|
|
117
|
+
x1: 4,
|
|
118
|
+
y1: n,
|
|
119
|
+
x2: n - P - 16,
|
|
120
|
+
y2: n,
|
|
121
|
+
className: t.guide
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ a(
|
|
125
|
+
"line",
|
|
126
|
+
{
|
|
127
|
+
x1: n + P + 16,
|
|
128
|
+
y1: n,
|
|
129
|
+
x2: 316,
|
|
130
|
+
y2: n,
|
|
131
|
+
className: t.guide
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ a(
|
|
135
|
+
"rect",
|
|
136
|
+
{
|
|
137
|
+
x: 0,
|
|
138
|
+
y: n - 3,
|
|
139
|
+
width: 6,
|
|
140
|
+
height: 6,
|
|
141
|
+
className: t.guideEnd
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ a(
|
|
145
|
+
"rect",
|
|
146
|
+
{
|
|
147
|
+
x: 314,
|
|
148
|
+
y: n - 3,
|
|
149
|
+
width: 6,
|
|
150
|
+
height: 6,
|
|
151
|
+
className: t.guideEnd
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ a(
|
|
155
|
+
"circle",
|
|
156
|
+
{
|
|
157
|
+
cx: n,
|
|
158
|
+
cy: n,
|
|
159
|
+
r: P,
|
|
160
|
+
className: t.track
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
de.map(({ degrees: e, major: r, ...p }) => /* @__PURE__ */ a(
|
|
164
|
+
"line",
|
|
165
|
+
{
|
|
166
|
+
...p,
|
|
167
|
+
className: S(
|
|
168
|
+
r ? t.majorTick : t.tick,
|
|
169
|
+
e <= V && f && t.passed
|
|
170
|
+
)
|
|
171
|
+
},
|
|
172
|
+
e
|
|
173
|
+
)),
|
|
174
|
+
/* @__PURE__ */ a(
|
|
175
|
+
"circle",
|
|
176
|
+
{
|
|
177
|
+
cx: n,
|
|
178
|
+
cy: n,
|
|
179
|
+
r: P,
|
|
180
|
+
className: t.progress,
|
|
181
|
+
strokeDasharray: _,
|
|
182
|
+
strokeDashoffset: _ * (1 - E),
|
|
183
|
+
transform: `rotate(-90 ${n} ${n})`
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ a(
|
|
187
|
+
"circle",
|
|
188
|
+
{
|
|
189
|
+
cx: n,
|
|
190
|
+
cy: n,
|
|
191
|
+
r: 104,
|
|
192
|
+
className: t.innerTrack
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
[0, 90, 180, 270].map((e) => {
|
|
196
|
+
const r = k(e, 100), p = k(e, 92);
|
|
197
|
+
return /* @__PURE__ */ a(
|
|
198
|
+
"line",
|
|
199
|
+
{
|
|
200
|
+
x1: r.x,
|
|
201
|
+
y1: r.y,
|
|
202
|
+
x2: p.x,
|
|
203
|
+
y2: p.y,
|
|
204
|
+
className: t.crosshair
|
|
205
|
+
},
|
|
206
|
+
e
|
|
207
|
+
);
|
|
208
|
+
})
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ s("div", { className: t.center, children: [
|
|
211
|
+
/* @__PURE__ */ a("strong", { "data-slot": "audio-player-time", children: x(u) }),
|
|
212
|
+
/* @__PURE__ */ a("span", { children: i === null ? o("audioPlayer.loading") : `${o("audioPlayer.remaining")} −${x(f ? m - u : Number.NaN)}` })
|
|
213
|
+
] })
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ s("div", { className: t.scale, children: [
|
|
216
|
+
/* @__PURE__ */ a(
|
|
217
|
+
"input",
|
|
218
|
+
{
|
|
219
|
+
className: t.scrubber,
|
|
220
|
+
type: "range",
|
|
221
|
+
min: 0,
|
|
222
|
+
max: f ? m : 0,
|
|
223
|
+
step: 0.1,
|
|
224
|
+
value: u,
|
|
225
|
+
disabled: !g || !f,
|
|
226
|
+
"aria-label": o("audioPlayer.position"),
|
|
227
|
+
"aria-valuetext": `${x(u)} / ${x(m)}`,
|
|
228
|
+
style: { "--progress": `${E * 100}%` },
|
|
229
|
+
onChange: (e) => b(e.currentTarget.valueAsNumber)
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ a("div", { className: t.ruler, "aria-hidden": "true", children: Array.from({ length: K }, (e, r) => /* @__PURE__ */ a(
|
|
233
|
+
"i",
|
|
234
|
+
{
|
|
235
|
+
"data-major": r % 5 === 0 || void 0,
|
|
236
|
+
"data-passed": f && r / (K - 1) <= E ? "" : void 0
|
|
237
|
+
},
|
|
238
|
+
r
|
|
239
|
+
)) }),
|
|
240
|
+
/* @__PURE__ */ s("div", { className: t.scaleLabels, "aria-hidden": "true", children: [
|
|
241
|
+
/* @__PURE__ */ a("span", { children: "0:00" }),
|
|
242
|
+
/* @__PURE__ */ a("span", { children: x(m) })
|
|
243
|
+
] })
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ s("div", { className: t.transport, children: [
|
|
246
|
+
/* @__PURE__ */ a(
|
|
247
|
+
"button",
|
|
248
|
+
{
|
|
249
|
+
type: "button",
|
|
250
|
+
className: t.skip,
|
|
251
|
+
disabled: !g,
|
|
252
|
+
"aria-label": o("audioPlayer.back", { seconds: l }),
|
|
253
|
+
title: o("audioPlayer.back", { seconds: l }),
|
|
254
|
+
onClick: () => b(u - l),
|
|
255
|
+
children: /* @__PURE__ */ a(Z, {})
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ a(
|
|
259
|
+
"button",
|
|
260
|
+
{
|
|
261
|
+
type: "button",
|
|
262
|
+
className: t.play,
|
|
263
|
+
disabled: !g,
|
|
264
|
+
autoFocus: O,
|
|
265
|
+
"aria-label": o(R ? "audioPlayer.pause" : "audioPlayer.play"),
|
|
266
|
+
onClick: j,
|
|
267
|
+
children: R ? /* @__PURE__ */ a(ee, {}) : /* @__PURE__ */ a(ae, { className: t.playIcon })
|
|
268
|
+
}
|
|
269
|
+
),
|
|
270
|
+
/* @__PURE__ */ a(
|
|
271
|
+
"button",
|
|
272
|
+
{
|
|
273
|
+
type: "button",
|
|
274
|
+
className: t.skip,
|
|
275
|
+
disabled: !g,
|
|
276
|
+
"aria-label": o("audioPlayer.forward", { seconds: l }),
|
|
277
|
+
title: o("audioPlayer.forward", { seconds: l }),
|
|
278
|
+
onClick: () => b(u + l),
|
|
279
|
+
children: /* @__PURE__ */ a(te, {})
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
] }),
|
|
283
|
+
/* @__PURE__ */ s("div", { className: t.options, children: [
|
|
284
|
+
/* @__PURE__ */ s("fieldset", { className: t.speeds, children: [
|
|
285
|
+
/* @__PURE__ */ a("legend", { className: t.caption, children: o("audioPlayer.speed") }),
|
|
286
|
+
/* @__PURE__ */ a("div", { children: C.map((e) => /* @__PURE__ */ s(
|
|
287
|
+
"button",
|
|
288
|
+
{
|
|
289
|
+
type: "button",
|
|
290
|
+
"aria-pressed": w === e,
|
|
291
|
+
onClick: () => G(e),
|
|
292
|
+
children: [
|
|
293
|
+
X.format(e),
|
|
294
|
+
"×"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
e
|
|
298
|
+
)) })
|
|
299
|
+
] }),
|
|
300
|
+
/* @__PURE__ */ s(
|
|
301
|
+
"button",
|
|
302
|
+
{
|
|
303
|
+
type: "button",
|
|
304
|
+
className: t.loop,
|
|
305
|
+
"aria-pressed": F,
|
|
306
|
+
onClick: () => H((e) => !e),
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ a(re, { "aria-hidden": "true" }),
|
|
309
|
+
o("audioPlayer.loop")
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
] })
|
|
314
|
+
] }),
|
|
315
|
+
$ && /* @__PURE__ */ a("footer", { className: t.footer, children: $ })
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
export {
|
|
321
|
+
be as AudioPlayer
|
|
322
|
+
};
|
|
323
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/ui/audio-player/index.tsx"],"sourcesContent":["'use client'\n\nimport { Pause, Play, Repeat, RotateCcw, RotateCw } from 'lucide-react'\nimport {\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { STOA_NS } from '../../i18n/namespace'\nimport { cn } from '../../utils/cn'\nimport { getRuntimeLocale } from '../../utils/dates'\nimport styles from './AudioPlayer.module.scss'\n\nexport interface AudioPlayerProps {\n\t/** Audio URL; `null` while the app is still resolving the file. */\n\tsrc: string | null\n\t/** Heading, e.g. the file name. Defaults to \"Audio instrument\". */\n\ttitle?: ReactNode\n\t/** Caption under the heading, e.g. file type and size. */\n\tdescription?: ReactNode\n\t/** Selectable playback rates. */\n\tspeeds?: readonly number[]\n\t/** Seconds for the back/forward buttons and the arrow keys. */\n\tskipSeconds?: number\n\tdefaultSpeed?: number\n\tdefaultLoop?: boolean\n\t/** Focus the play button on mount, e.g. inside a dialog. */\n\tautoFocus?: boolean\n\t/** Shown instead of the default message when the file cannot be played. */\n\terrorMessage?: ReactNode\n\t/** Extra actions below the controls, e.g. \"open in default app\". */\n\tfooter?: ReactNode\n\tonError?: () => void\n\tclassName?: string\n}\n\nconst CENTER = 160\nconst RADIUS = 118\nconst CIRCUMFERENCE = 2 * Math.PI * RADIUS\n/** Ticks on the straight position scale (major every fifth). */\nconst SCALE_TICKS = 41\n\nfunction ringPoint(degrees: number, radius: number) {\n\tconst radians = ((degrees - 90) * Math.PI) / 180\n\treturn {\n\t\tx: CENTER + Math.cos(radians) * radius,\n\t\ty: CENTER + Math.sin(radians) * radius,\n\t}\n}\n\nconst TICKS = Array.from({ length: 60 }, (_, index) => {\n\tconst degrees = index * 6\n\tconst major = index % 5 === 0\n\tconst start = ringPoint(degrees, major ? 121 : 125)\n\tconst end = ringPoint(degrees, 130)\n\treturn { degrees, major, x1: start.x, y1: start.y, x2: end.x, y2: end.y }\n})\n\nfunction formatTime(seconds: number) {\n\tif (!Number.isFinite(seconds)) return '–:––'\n\tconst whole = Math.max(0, Math.floor(seconds))\n\tconst minutes = Math.floor(whole / 60)\n\treturn `${minutes}:${String(whole % 60).padStart(2, '0')}`\n}\n\n/**\n * Practice-friendly audio player in the style of the color instrument: a\n * straight position scale to scrub, a decorative dial that mirrors the\n * progress, skip buttons, playback speed and repeat.\n */\nexport function AudioPlayer({\n\tsrc,\n\ttitle,\n\tdescription,\n\tspeeds = [0.5, 0.75, 1, 1.25],\n\tskipSeconds = 5,\n\tdefaultSpeed = 1,\n\tdefaultLoop = false,\n\tautoFocus = false,\n\terrorMessage,\n\tfooter,\n\tonError,\n\tclassName,\n}: AudioPlayerProps) {\n\tconst { t } = useTranslation(STOA_NS)\n\tconst id = useId()\n\tconst audio = useRef<HTMLAudioElement>(null)\n\tconst [failed, setFailed] = useState(false)\n\tconst [playing, setPlaying] = useState(false)\n\tconst [current, setCurrent] = useState(0)\n\tconst [duration, setDuration] = useState(Number.NaN)\n\tconst [speed, setSpeed] = useState(defaultSpeed)\n\tconst [loop, setLoop] = useState(defaultLoop)\n\n\t// A new file starts from the beginning (reset during render, no extra effect).\n\tconst [previousSrc, setPreviousSrc] = useState(src)\n\tif (src !== previousSrc) {\n\t\tsetPreviousSrc(src)\n\t\tsetFailed(false)\n\t\tsetPlaying(false)\n\t\tsetCurrent(0)\n\t\tsetDuration(Number.NaN)\n\t}\n\n\tuseEffect(() => {\n\t\tif (audio.current) audio.current.playbackRate = speed\n\t}, [speed])\n\n\tconst known = Number.isFinite(duration) && duration > 0\n\tconst ready = src !== null && !failed\n\tconst share = known ? Math.min(1, current / duration) : 0\n\tconst degrees = share * 360\n\n\tfunction fail() {\n\t\tsetFailed(true)\n\t\tsetPlaying(false)\n\t\tonError?.()\n\t}\n\n\tfunction toggle() {\n\t\tconst element = audio.current\n\t\tif (!element || !ready) return\n\t\tif (!element.paused) {\n\t\t\telement.pause()\n\t\t\treturn\n\t\t}\n\t\telement.play().catch((error: unknown) => {\n\t\t\t// A blocked or interrupted start (autoplay policy, quick pause) is not a broken file.\n\t\t\tconst name = error instanceof DOMException ? error.name : ''\n\t\t\tif (name === 'NotAllowedError' || name === 'AbortError') setPlaying(false)\n\t\t\telse fail()\n\t\t})\n\t}\n\n\tfunction seek(seconds: number) {\n\t\tconst element = audio.current\n\t\tif (!element || !Number.isFinite(element.duration)) return\n\t\telement.currentTime = Math.min(element.duration, Math.max(0, seconds))\n\t\tsetCurrent(element.currentTime)\n\t}\n\n\tfunction onKeyDown(event: KeyboardEvent) {\n\t\tconst target = event.target as HTMLElement\n\t\tif (target.closest('input[type=\"text\"], textarea, select')) return\n\t\tif (event.key === ' ' && !target.closest('button')) {\n\t\t\tevent.preventDefault()\n\t\t\ttoggle()\n\t\t} else if (event.key === 'ArrowLeft' && !target.closest('input')) {\n\t\t\tevent.preventDefault()\n\t\t\tseek(current - skipSeconds)\n\t\t} else if (event.key === 'ArrowRight' && !target.closest('input')) {\n\t\t\tevent.preventDefault()\n\t\t\tseek(current + skipSeconds)\n\t\t}\n\t}\n\n\tconst number = new Intl.NumberFormat(getRuntimeLocale(), {\n\t\tmaximumFractionDigits: 2,\n\t})\n\n\treturn (\n\t\t<section\n\t\t\tclassName={cn(styles.player, className)}\n\t\t\tdata-slot='audio-player'\n\t\t\tdata-state={failed ? 'error' : playing ? 'playing' : 'paused'}\n\t\t\taria-labelledby={`${id}-title`}\n\t\t\tonKeyDown={onKeyDown}\n\t\t>\n\t\t\t<header className={styles.header}>\n\t\t\t\t<h2\n\t\t\t\t\tid={`${id}-title`}\n\t\t\t\t\tclassName='truncate font-heading text-2xl leading-snug font-semibold tracking-tight'\n\t\t\t\t>\n\t\t\t\t\t{title ?? t('audioPlayer.title')}\n\t\t\t\t</h2>\n\t\t\t\t{description && <p className={styles.caption}>{description}</p>}\n\t\t\t</header>\n\n\t\t\t{src && (\n\t\t\t\t// biome-ignore lint/a11y/useMediaCaption: practice recordings come without captions.\n\t\t\t\t<audio\n\t\t\t\t\tref={audio}\n\t\t\t\t\tsrc={src}\n\t\t\t\t\tloop={loop}\n\t\t\t\t\tpreload='metadata'\n\t\t\t\t\tonLoadedMetadata={(event) => {\n\t\t\t\t\t\tsetDuration(event.currentTarget.duration)\n\t\t\t\t\t\tevent.currentTarget.playbackRate = speed\n\t\t\t\t\t}}\n\t\t\t\t\tonDurationChange={(event) =>\n\t\t\t\t\t\tsetDuration(event.currentTarget.duration)\n\t\t\t\t\t}\n\t\t\t\t\tonTimeUpdate={(event) => setCurrent(event.currentTarget.currentTime)}\n\t\t\t\t\tonPlay={() => setPlaying(true)}\n\t\t\t\t\tonPause={() => setPlaying(false)}\n\t\t\t\t\tonEnded={() => setPlaying(false)}\n\t\t\t\t\tonError={fail}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{failed ? (\n\t\t\t\t<p className={styles.error} role='alert'>\n\t\t\t\t\t{errorMessage ?? t('audioPlayer.error')}\n\t\t\t\t</p>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{/* Decoration only: the dial mirrors the position, the scale below controls it. */}\n\t\t\t\t\t<div className={styles.dial} aria-hidden='true'>\n\t\t\t\t\t\t<svg viewBox='0 0 320 320' aria-hidden='true'>\n\t\t\t\t\t\t\t{/* Guide line from both edges to the ring, kept clear of the readout. */}\n\t\t\t\t\t\t\t<line\n\t\t\t\t\t\t\t\tx1={4}\n\t\t\t\t\t\t\t\ty1={CENTER}\n\t\t\t\t\t\t\t\tx2={CENTER - RADIUS - 16}\n\t\t\t\t\t\t\t\ty2={CENTER}\n\t\t\t\t\t\t\t\tclassName={styles.guide}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<line\n\t\t\t\t\t\t\t\tx1={CENTER + RADIUS + 16}\n\t\t\t\t\t\t\t\ty1={CENTER}\n\t\t\t\t\t\t\t\tx2={316}\n\t\t\t\t\t\t\t\ty2={CENTER}\n\t\t\t\t\t\t\t\tclassName={styles.guide}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={0}\n\t\t\t\t\t\t\t\ty={CENTER - 3}\n\t\t\t\t\t\t\t\twidth={6}\n\t\t\t\t\t\t\t\theight={6}\n\t\t\t\t\t\t\t\tclassName={styles.guideEnd}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={314}\n\t\t\t\t\t\t\t\ty={CENTER - 3}\n\t\t\t\t\t\t\t\twidth={6}\n\t\t\t\t\t\t\t\theight={6}\n\t\t\t\t\t\t\t\tclassName={styles.guideEnd}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\tcx={CENTER}\n\t\t\t\t\t\t\t\tcy={CENTER}\n\t\t\t\t\t\t\t\tr={RADIUS}\n\t\t\t\t\t\t\t\tclassName={styles.track}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{TICKS.map(({ degrees: tick, major, ...line }) => (\n\t\t\t\t\t\t\t\t<line\n\t\t\t\t\t\t\t\t\tkey={tick}\n\t\t\t\t\t\t\t\t\t{...line}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\tmajor ? styles.majorTick : styles.tick,\n\t\t\t\t\t\t\t\t\t\ttick <= degrees && known && styles.passed,\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\tcx={CENTER}\n\t\t\t\t\t\t\t\tcy={CENTER}\n\t\t\t\t\t\t\t\tr={RADIUS}\n\t\t\t\t\t\t\t\tclassName={styles.progress}\n\t\t\t\t\t\t\t\tstrokeDasharray={CIRCUMFERENCE}\n\t\t\t\t\t\t\t\tstrokeDashoffset={CIRCUMFERENCE * (1 - share)}\n\t\t\t\t\t\t\t\ttransform={`rotate(-90 ${CENTER} ${CENTER})`}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\tcx={CENTER}\n\t\t\t\t\t\t\t\tcy={CENTER}\n\t\t\t\t\t\t\t\tr={104}\n\t\t\t\t\t\t\t\tclassName={styles.innerTrack}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{[0, 90, 180, 270].map((mark) => {\n\t\t\t\t\t\t\t\tconst outer = ringPoint(mark, 100)\n\t\t\t\t\t\t\t\tconst inner = ringPoint(mark, 92)\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<line\n\t\t\t\t\t\t\t\t\t\tkey={mark}\n\t\t\t\t\t\t\t\t\t\tx1={outer.x}\n\t\t\t\t\t\t\t\t\t\ty1={outer.y}\n\t\t\t\t\t\t\t\t\t\tx2={inner.x}\n\t\t\t\t\t\t\t\t\t\ty2={inner.y}\n\t\t\t\t\t\t\t\t\t\tclassName={styles.crosshair}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<div className={styles.center}>\n\t\t\t\t\t\t\t<strong data-slot='audio-player-time'>\n\t\t\t\t\t\t\t\t{formatTime(current)}\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t{src === null\n\t\t\t\t\t\t\t\t\t? t('audioPlayer.loading')\n\t\t\t\t\t\t\t\t\t: `${t('audioPlayer.remaining')} −${formatTime(known ? duration - current : Number.NaN)}`}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className={styles.scale}>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName={styles.scrubber}\n\t\t\t\t\t\t\ttype='range'\n\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\tmax={known ? duration : 0}\n\t\t\t\t\t\t\tstep={0.1}\n\t\t\t\t\t\t\tvalue={current}\n\t\t\t\t\t\t\tdisabled={!ready || !known}\n\t\t\t\t\t\t\taria-label={t('audioPlayer.position')}\n\t\t\t\t\t\t\taria-valuetext={`${formatTime(current)} / ${formatTime(duration)}`}\n\t\t\t\t\t\t\tstyle={{ '--progress': `${share * 100}%` } as CSSProperties}\n\t\t\t\t\t\t\tonChange={(event) => seek(event.currentTarget.valueAsNumber)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div className={styles.ruler} aria-hidden='true'>\n\t\t\t\t\t\t\t{Array.from({ length: SCALE_TICKS }, (_, index) => (\n\t\t\t\t\t\t\t\t<i\n\t\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: static scale\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\tdata-major={index % 5 === 0 || undefined}\n\t\t\t\t\t\t\t\t\tdata-passed={\n\t\t\t\t\t\t\t\t\t\tknown && index / (SCALE_TICKS - 1) <= share ? '' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className={styles.scaleLabels} aria-hidden='true'>\n\t\t\t\t\t\t\t<span>0:00</span>\n\t\t\t\t\t\t\t<span>{formatTime(duration)}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className={styles.transport}>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.skip}\n\t\t\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\t\t\taria-label={t('audioPlayer.back', { seconds: skipSeconds })}\n\t\t\t\t\t\t\ttitle={t('audioPlayer.back', { seconds: skipSeconds })}\n\t\t\t\t\t\t\tonClick={() => seek(current - skipSeconds)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RotateCcw />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.play}\n\t\t\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\t\t\t// biome-ignore lint/a11y/noAutofocus: opt-in for dialogs\n\t\t\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\t\t\taria-label={t(playing ? 'audioPlayer.pause' : 'audioPlayer.play')}\n\t\t\t\t\t\t\tonClick={toggle}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{playing ? <Pause /> : <Play className={styles.playIcon} />}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.skip}\n\t\t\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\t\t\taria-label={t('audioPlayer.forward', { seconds: skipSeconds })}\n\t\t\t\t\t\t\ttitle={t('audioPlayer.forward', { seconds: skipSeconds })}\n\t\t\t\t\t\t\tonClick={() => seek(current + skipSeconds)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RotateCw />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className={styles.options}>\n\t\t\t\t\t\t<fieldset className={styles.speeds}>\n\t\t\t\t\t\t\t<legend className={styles.caption}>\n\t\t\t\t\t\t\t\t{t('audioPlayer.speed')}\n\t\t\t\t\t\t\t</legend>\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t{speeds.map((value) => (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\t\t\t\taria-pressed={speed === value}\n\t\t\t\t\t\t\t\t\t\tonClick={() => setSpeed(value)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{number.format(value)}×\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.loop}\n\t\t\t\t\t\t\taria-pressed={loop}\n\t\t\t\t\t\t\tonClick={() => setLoop((value) => !value)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Repeat aria-hidden='true' />\n\t\t\t\t\t\t\t{t('audioPlayer.loop')}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{footer && <footer className={styles.footer}>{footer}</footer>}\n\t\t</section>\n\t)\n}\n"],"names":["CENTER","RADIUS","CIRCUMFERENCE","SCALE_TICKS","ringPoint","degrees","radius","radians","TICKS","_","index","major","start","end","formatTime","seconds","whole","AudioPlayer","src","title","description","speeds","skipSeconds","defaultSpeed","defaultLoop","autoFocus","errorMessage","footer","onError","className","t","useTranslation","STOA_NS","id","useId","audio","useRef","failed","setFailed","useState","playing","setPlaying","current","setCurrent","duration","setDuration","speed","setSpeed","loop","setLoop","previousSrc","setPreviousSrc","useEffect","known","ready","share","fail","toggle","element","error","name","seek","onKeyDown","event","target","number","getRuntimeLocale","jsxs","cn","styles","jsx","Fragment","tick","line","mark","outer","inner","RotateCcw","Pause","Play","RotateCw","value","Repeat"],"mappings":";;;;;;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BAExC,UAAA;AAAA,kBAAA,gBAAAX,EAACY,IAAA,EAAO,eAAY,OAAA,CAAO;AAAA,kBAC1BpD,EAAE,kBAAkB;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACtB,EAAA,CACD;AAAA,QAAA,GACD;AAAA,QAGAH,KAAU,gBAAA2C,EAAC,UAAA,EAAO,WAAWD,EAAO,QAAS,UAAA1C,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGxD;"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsxs as N, jsx as a, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useId as T, useState as E, useRef as F, useMemo as j, useEffect as L } from "react";
|
|
3
|
+
import { useTranslation as K } from "react-i18next";
|
|
4
|
+
import { STOA_NS as q } from "../../i18n/namespace.js";
|
|
5
|
+
import { cn as B } from "../../utils/cn.js";
|
|
6
|
+
import { Input as H } from "../input/index.js";
|
|
7
|
+
import { Popover as U, PopoverAnchor as _, PopoverContent as G } from "../popover/index.js";
|
|
8
|
+
function y(t) {
|
|
9
|
+
return t.normalize("NFD").replace(/[̀-ͯ]/g, "").trim().toLocaleLowerCase().replace(/\s+/g, " ");
|
|
10
|
+
}
|
|
11
|
+
function J(t) {
|
|
12
|
+
return typeof t == "string" ? { value: t } : t;
|
|
13
|
+
}
|
|
14
|
+
function Q(t, d) {
|
|
15
|
+
const n = y(d), i = t.map(J);
|
|
16
|
+
if (!n) return i.map(({ value: c, hint: f }) => ({ value: c, hint: f }));
|
|
17
|
+
const h = [], b = [], x = [];
|
|
18
|
+
for (const { value: c, hint: f, synonyms: v = [] } of i) {
|
|
19
|
+
const p = c.normalize("NFD").replace(/[̀-ͯ]/g, "").toLocaleLowerCase().indexOf(n);
|
|
20
|
+
if (p === 0) h.push({ value: c, hint: f, range: [0, n.length] });
|
|
21
|
+
else if (p > 0)
|
|
22
|
+
b.push({ value: c, hint: f, range: [p, p + n.length] });
|
|
23
|
+
else {
|
|
24
|
+
const r = v.find(
|
|
25
|
+
(D) => y(D).includes(n)
|
|
26
|
+
);
|
|
27
|
+
r && x.push({ value: c, hint: f, via: r });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return [...h, ...b, ...x];
|
|
31
|
+
}
|
|
32
|
+
function R({
|
|
33
|
+
value: t,
|
|
34
|
+
range: d
|
|
35
|
+
}) {
|
|
36
|
+
if (!d || t.normalize("NFD").length !== t.length)
|
|
37
|
+
return /* @__PURE__ */ a(I, { children: t });
|
|
38
|
+
const [n, i] = d;
|
|
39
|
+
return /* @__PURE__ */ N(I, { children: [
|
|
40
|
+
t.slice(0, n),
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "combobox-match",
|
|
45
|
+
className: "underline decoration-current/45 underline-offset-[3px]",
|
|
46
|
+
children: t.slice(n, i)
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
t.slice(i)
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
function oe({
|
|
53
|
+
value: t,
|
|
54
|
+
onValueChange: d,
|
|
55
|
+
options: n,
|
|
56
|
+
match: i = Q,
|
|
57
|
+
maxResults: h = 50,
|
|
58
|
+
onKeyDown: b,
|
|
59
|
+
onBlur: x,
|
|
60
|
+
className: c,
|
|
61
|
+
...f
|
|
62
|
+
}) {
|
|
63
|
+
const { t: v } = K(q), g = T(), [p, r] = E(!1), [D, w] = E(0), k = F(null), O = F(null), l = j(
|
|
64
|
+
() => i(n, t).slice(0, h),
|
|
65
|
+
[i, n, t, h]
|
|
66
|
+
), M = l.length === 1 && y(l[0].value) === y(t), s = p && l.length > 0 && !M, u = Math.min(D, Math.max(0, l.length - 1));
|
|
67
|
+
L(() => {
|
|
68
|
+
s && O.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({ block: "nearest" });
|
|
69
|
+
}, [u, s]), L(() => {
|
|
70
|
+
if (!s) return;
|
|
71
|
+
function e(o) {
|
|
72
|
+
o.key !== "Escape" || o.target !== k.current || (o.preventDefault(), o.stopPropagation(), r(!1));
|
|
73
|
+
}
|
|
74
|
+
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
75
|
+
}, [s]);
|
|
76
|
+
function A(e) {
|
|
77
|
+
const o = l[e];
|
|
78
|
+
o && (d(o.value), r(!1));
|
|
79
|
+
}
|
|
80
|
+
function P(e) {
|
|
81
|
+
if (b?.(e), !e.defaultPrevented)
|
|
82
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
83
|
+
if (e.preventDefault(), !s) {
|
|
84
|
+
r(!0), w(0);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const o = e.key === "ArrowDown" ? 1 : -1;
|
|
88
|
+
w((u + o + l.length) % l.length);
|
|
89
|
+
} else e.key === "Enter" && s && (e.preventDefault(), A(u));
|
|
90
|
+
}
|
|
91
|
+
const $ = s ? `${g}-${u}` : void 0;
|
|
92
|
+
return /* @__PURE__ */ N(U, { open: s, onOpenChange: r, children: [
|
|
93
|
+
/* @__PURE__ */ a(_, { asChild: !0, children: /* @__PURE__ */ a("div", { className: "min-w-0", children: /* @__PURE__ */ a(
|
|
94
|
+
H,
|
|
95
|
+
{
|
|
96
|
+
...f,
|
|
97
|
+
ref: k,
|
|
98
|
+
role: "combobox",
|
|
99
|
+
autoComplete: "off",
|
|
100
|
+
"aria-autocomplete": "list",
|
|
101
|
+
"aria-expanded": s,
|
|
102
|
+
"aria-controls": s ? g : void 0,
|
|
103
|
+
"aria-activedescendant": $,
|
|
104
|
+
className: c,
|
|
105
|
+
value: t,
|
|
106
|
+
onChange: (e) => {
|
|
107
|
+
d(e.target.value), w(0), r(!0);
|
|
108
|
+
},
|
|
109
|
+
onClick: () => r(!0),
|
|
110
|
+
onKeyDown: P,
|
|
111
|
+
onBlur: (e) => {
|
|
112
|
+
r(!1), x?.(e);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
) }) }),
|
|
116
|
+
/* @__PURE__ */ a(
|
|
117
|
+
G,
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "combobox-content",
|
|
120
|
+
align: "start",
|
|
121
|
+
sideOffset: 6,
|
|
122
|
+
className: "w-(--radix-popover-trigger-width) gap-0 p-1",
|
|
123
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
124
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
125
|
+
onInteractOutside: (e) => {
|
|
126
|
+
k.current?.contains(e.target) && e.preventDefault();
|
|
127
|
+
},
|
|
128
|
+
children: /* @__PURE__ */ a(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref: O,
|
|
132
|
+
id: g,
|
|
133
|
+
role: "listbox",
|
|
134
|
+
className: "max-h-64 overflow-y-auto",
|
|
135
|
+
children: l.map(({ value: e, hint: o, via: C, range: z }, m) => /* @__PURE__ */ N(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
id: `${g}-${m}`,
|
|
139
|
+
"data-index": m,
|
|
140
|
+
"data-slot": "combobox-option",
|
|
141
|
+
"data-highlighted": m === u ? "" : void 0,
|
|
142
|
+
role: "option",
|
|
143
|
+
"aria-selected": m === u,
|
|
144
|
+
tabIndex: -1,
|
|
145
|
+
className: B(
|
|
146
|
+
"flex cursor-pointer items-baseline gap-2 rounded-md px-2.5 py-1.5 text-sm",
|
|
147
|
+
m === u && "bg-muted"
|
|
148
|
+
),
|
|
149
|
+
onMouseDown: (S) => {
|
|
150
|
+
S.preventDefault(), A(m);
|
|
151
|
+
},
|
|
152
|
+
onMouseMove: () => w(m),
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ a("span", { className: "font-medium", children: /* @__PURE__ */ a(R, { value: e, range: z }) }),
|
|
155
|
+
(C || o) && /* @__PURE__ */ a(
|
|
156
|
+
"span",
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "combobox-hint",
|
|
159
|
+
className: "truncate text-xs text-muted-foreground",
|
|
160
|
+
children: C ? v("combobox.via", { name: C }) : o
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
e
|
|
166
|
+
))
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] });
|
|
172
|
+
}
|
|
173
|
+
export {
|
|
174
|
+
oe as Combobox,
|
|
175
|
+
Q as matchComboboxOptions,
|
|
176
|
+
y as normalizeComboboxText
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/ui/combobox/index.tsx"],"sourcesContent":["'use client'\n\nimport {\n\ttype ComponentProps,\n\ttype KeyboardEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { STOA_NS } from '../../i18n/namespace'\nimport { cn } from '../../utils/cn'\nimport { Input } from '../input'\nimport { Popover, PopoverAnchor, PopoverContent } from '../popover'\n\nexport type ComboboxOption =\n\t| string\n\t| {\n\t\t\tvalue: string\n\t\t\t/** Other names that also find this option, e.g. in other languages. */\n\t\t\tsynonyms?: readonly string[]\n\t\t\t/** Quiet extra text after the value. */\n\t\t\thint?: ReactNode\n\t }\n\nexport type ComboboxMatch = {\n\tvalue: string\n\thint?: ReactNode\n\t/** The synonym that matched, when the value itself did not. */\n\tvia?: string\n\t/** Matched range in the value, for highlighting. */\n\trange?: [number, number]\n}\n\nexport type ComboboxProps = Omit<\n\tComponentProps<typeof Input>,\n\t'value' | 'onChange' | 'list' | 'suggestions'\n> & {\n\tvalue: string\n\tonValueChange: (value: string) => void\n\toptions: readonly ComboboxOption[]\n\t/** Replaces the default search (prefix, then contains, then synonyms). */\n\tmatch?: (options: readonly ComboboxOption[], query: string) => ComboboxMatch[]\n\t/** Upper bound of suggestions shown at once. */\n\tmaxResults?: number\n}\n\n/** Case- and accent-insensitive key: \"Flöte \" → \"flote\". */\nexport function normalizeComboboxText(text: string) {\n\treturn text\n\t\t.normalize('NFD')\n\t\t.replace(/[̀-ͯ]/g, '')\n\t\t.trim()\n\t\t.toLocaleLowerCase()\n\t\t.replace(/\\s+/g, ' ')\n}\n\nfunction toOption(option: ComboboxOption) {\n\treturn typeof option === 'string' ? { value: option } : option\n}\n\n/**\n * Default search: values starting with the query first, then values\n * containing it, then options found through a synonym. An empty query\n * returns every option.\n */\nexport function matchComboboxOptions(\n\toptions: readonly ComboboxOption[],\n\tquery: string,\n): ComboboxMatch[] {\n\tconst needle = normalizeComboboxText(query)\n\tconst all = options.map(toOption)\n\tif (!needle) return all.map(({ value, hint }) => ({ value, hint }))\n\tconst starts: ComboboxMatch[] = []\n\tconst contains: ComboboxMatch[] = []\n\tconst synonyms: ComboboxMatch[] = []\n\tfor (const { value, hint, synonyms: names = [] } of all) {\n\t\t// Accent stripping keeps one character per letter here, so indices line up.\n\t\tconst key = value.normalize('NFD').replace(/[̀-ͯ]/g, '').toLocaleLowerCase()\n\t\tconst at = key.indexOf(needle)\n\t\tif (at === 0) starts.push({ value, hint, range: [0, needle.length] })\n\t\telse if (at > 0)\n\t\t\tcontains.push({ value, hint, range: [at, at + needle.length] })\n\t\telse {\n\t\t\tconst via = names.find((name) =>\n\t\t\t\tnormalizeComboboxText(name).includes(needle),\n\t\t\t)\n\t\t\tif (via) synonyms.push({ value, hint, via })\n\t\t}\n\t}\n\treturn [...starts, ...contains, ...synonyms]\n}\n\nfunction Highlighted({\n\tvalue,\n\trange,\n}: {\n\tvalue: string\n\trange?: [number, number]\n}) {\n\tif (!range || value.normalize('NFD').length !== value.length)\n\t\treturn <>{value}</>\n\tconst [start, end] = range\n\treturn (\n\t\t<>\n\t\t\t{value.slice(0, start)}\n\t\t\t<span\n\t\t\t\tdata-slot='combobox-match'\n\t\t\t\tclassName='underline decoration-current/45 underline-offset-[3px]'\n\t\t\t>\n\t\t\t\t{value.slice(start, end)}\n\t\t\t</span>\n\t\t\t{value.slice(end)}\n\t\t</>\n\t)\n}\n\n/**\n * Free text field with a suggestion list. Unlike a native datalist the list\n * follows the kit style, finds options through synonyms (\"Pianoforte\" →\n * \"Klavier\") and says how it found them.\n */\nexport function Combobox({\n\tvalue,\n\tonValueChange,\n\toptions,\n\tmatch = matchComboboxOptions,\n\tmaxResults = 50,\n\tonKeyDown,\n\tonBlur,\n\tclassName,\n\t...props\n}: ComboboxProps) {\n\tconst { t } = useTranslation(STOA_NS)\n\tconst listId = useId()\n\tconst [open, setOpen] = useState(false)\n\tconst [active, setActive] = useState(0)\n\tconst input = useRef<HTMLInputElement>(null)\n\tconst list = useRef<HTMLDivElement>(null)\n\n\tconst matches = useMemo(\n\t\t() => match(options, value).slice(0, maxResults),\n\t\t[match, options, value, maxResults],\n\t)\n\t// Nothing to suggest once the field holds exactly the only match.\n\tconst exact =\n\t\tmatches.length === 1 &&\n\t\tnormalizeComboboxText(matches[0].value) === normalizeComboboxText(value)\n\tconst shown = open && matches.length > 0 && !exact\n\tconst current = Math.min(active, Math.max(0, matches.length - 1))\n\n\tuseEffect(() => {\n\t\tif (!shown) return\n\t\tlist.current\n\t\t\t?.querySelector(`[data-index=\"${current}\"]`)\n\t\t\t?.scrollIntoView({ block: 'nearest' })\n\t}, [current, shown])\n\n\t// Escape closes the list only. Dialogs listen on the document in the\n\t// capture phase, so the key is caught earlier, on the window.\n\tuseEffect(() => {\n\t\tif (!shown) return\n\t\tfunction onEscape(event: globalThis.KeyboardEvent) {\n\t\t\tif (event.key !== 'Escape' || event.target !== input.current) return\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\tsetOpen(false)\n\t\t}\n\t\twindow.addEventListener('keydown', onEscape, true)\n\t\treturn () => window.removeEventListener('keydown', onEscape, true)\n\t}, [shown])\n\n\tfunction choose(index: number) {\n\t\tconst chosen = matches[index]\n\t\tif (!chosen) return\n\t\tonValueChange(chosen.value)\n\t\tsetOpen(false)\n\t}\n\n\tfunction handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {\n\t\tonKeyDown?.(event)\n\t\tif (event.defaultPrevented) return\n\t\tif (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n\t\t\tevent.preventDefault()\n\t\t\tif (!shown) {\n\t\t\t\tsetOpen(true)\n\t\t\t\tsetActive(0)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst step = event.key === 'ArrowDown' ? 1 : -1\n\t\t\tsetActive((current + step + matches.length) % matches.length)\n\t\t} else if (event.key === 'Enter' && shown) {\n\t\t\tevent.preventDefault()\n\t\t\tchoose(current)\n\t\t}\n\t}\n\n\tconst activeId = shown ? `${listId}-${current}` : undefined\n\n\treturn (\n\t\t<Popover open={shown} onOpenChange={setOpen}>\n\t\t\t<PopoverAnchor asChild>\n\t\t\t\t<div className='min-w-0'>\n\t\t\t\t\t<Input\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\tref={input}\n\t\t\t\t\t\trole='combobox'\n\t\t\t\t\t\tautoComplete='off'\n\t\t\t\t\t\taria-autocomplete='list'\n\t\t\t\t\t\taria-expanded={shown}\n\t\t\t\t\t\taria-controls={shown ? listId : undefined}\n\t\t\t\t\t\taria-activedescendant={activeId}\n\t\t\t\t\t\tclassName={className}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\tonValueChange(event.target.value)\n\t\t\t\t\t\t\tsetActive(0)\n\t\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonClick={() => setOpen(true)}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tonBlur={(event) => {\n\t\t\t\t\t\t\tsetOpen(false)\n\t\t\t\t\t\t\tonBlur?.(event)\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</PopoverAnchor>\n\t\t\t<PopoverContent\n\t\t\t\tdata-slot='combobox-content'\n\t\t\t\talign='start'\n\t\t\t\tsideOffset={6}\n\t\t\t\tclassName='w-(--radix-popover-trigger-width) gap-0 p-1'\n\t\t\t\tonOpenAutoFocus={(event) => event.preventDefault()}\n\t\t\t\tonCloseAutoFocus={(event) => event.preventDefault()}\n\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\tif (input.current?.contains(event.target as Node))\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={list}\n\t\t\t\t\tid={listId}\n\t\t\t\t\trole='listbox'\n\t\t\t\t\tclassName='max-h-64 overflow-y-auto'\n\t\t\t\t>\n\t\t\t\t\t{matches.map(({ value: option, hint, via, range }, index) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={option}\n\t\t\t\t\t\t\tid={`${listId}-${index}`}\n\t\t\t\t\t\t\tdata-index={index}\n\t\t\t\t\t\t\tdata-slot='combobox-option'\n\t\t\t\t\t\t\tdata-highlighted={index === current ? '' : undefined}\n\t\t\t\t\t\t\trole='option'\n\t\t\t\t\t\t\taria-selected={index === current}\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'flex cursor-pointer items-baseline gap-2 rounded-md px-2.5 py-1.5 text-sm',\n\t\t\t\t\t\t\t\tindex === current && 'bg-muted',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t// Choose on mouse down, so the focus stays in the input.\n\t\t\t\t\t\t\tonMouseDown={(event) => {\n\t\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\t\tchoose(index)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonMouseMove={() => setActive(index)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className='font-medium'>\n\t\t\t\t\t\t\t\t<Highlighted value={option} range={range} />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{(via || hint) && (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tdata-slot='combobox-hint'\n\t\t\t\t\t\t\t\t\tclassName='truncate text-xs text-muted-foreground'\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{via ? t('combobox.via', { name: via }) : hint}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t)\n}\n"],"names":["normalizeComboboxText","text","toOption","option","matchComboboxOptions","options","query","needle","all","value","hint","starts","contains","synonyms","names","at","via","name","Highlighted","range","start","end","jsxs","Fragment","jsx","Combobox","onValueChange","match","maxResults","onKeyDown","onBlur","className","props","t","useTranslation","STOA_NS","listId","useId","open","setOpen","useState","active","setActive","input","useRef","list","matches","useMemo","exact","shown","current","useEffect","onEscape","event","choose","index","chosen","handleKeyDown","step","activeId","Popover","PopoverAnchor","Input","PopoverContent","cn"],"mappings":";;;;;;;AAmDO,SAASA,EAAsBC,GAAc;AACnD,SAAOA,EACL,UAAU,KAAK,EACf,QAAQ,UAAU,EAAE,EACpB,KAAA,EACA,kBAAA,EACA,QAAQ,QAAQ,GAAG;AACtB;AAEA,SAASC,EAASC,GAAwB;AACzC,SAAO,OAAOA,KAAW,WAAW,EAAE,OAAOA,MAAWA;AACzD;AAOO,SAASC,EACfC,GACAC,GACkB;AAClB,QAAMC,IAASP,EAAsBM,CAAK,GACpCE,IAAMH,EAAQ,IAAIH,CAAQ;AAChC,MAAI,CAACK,EAAQ,QAAOC,EAAI,IAAI,CAAC,EAAE,OAAAC,GAAO,MAAAC,SAAY,EAAE,OAAAD,GAAO,MAAAC,IAAO;AAClE,QAAMC,IAA0B,CAAA,GAC1BC,IAA4B,CAAA,GAC5BC,IAA4B,CAAA;AAClC,aAAW,EAAE,OAAAJ,GAAO,MAAAC,GAAM,UAAUI,IAAQ,C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AAA;AAAA,sBACA,aAAU;AAAA,sBACV,WAAU;AAAA,sBAET,cAAMS,EAAE,gBAAgB,EAAE,MAAMjB,EAAA,CAAK,IAAIN;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC3C;AAAA,cAAA;AAAA,cA5BIP;AAAA,YAAA,CA+BN;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACD,GACD;AAEF;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const e = "stoa-FileViewer-viewer-6zng", o = "stoa-FileViewer-caption-58ez", i = "stoa-FileViewer-readout-dyok", t = "stoa-FileViewer-fit-1qr3", s = "stoa-FileViewer-counter-bxp2", r = "stoa-FileViewer-loading-1nv0", a = "stoa-FileViewer-header-aqms", n = "stoa-FileViewer-heading-98xp", c = "stoa-FileViewer-index-122q", l = "stoa-FileViewer-stage-6nse", w = "stoa-FileViewer-marks-318s", d = "stoa-FileViewer-viewport-14sz", F = "stoa-FileViewer-canvas-1wwo", V = "stoa-FileViewer-image-11dj", g = "stoa-FileViewer-pdf-1qr3", p = "stoa-FileViewer-error-1z01", u = "stoa-FileViewer-controls-bmz0", m = "stoa-FileViewer-round-617v", v = "stoa-FileViewer-paging-410d", f = "stoa-FileViewer-dots-rhso", z = "stoa-FileViewer-zoom-ri6p", h = "stoa-FileViewer-scale-6cxq", x = "stoa-FileViewer-slider-5m85", q = "stoa-FileViewer-ruler-64uw", k = "stoa-FileViewer-footer-1yji", y = {
|
|
2
|
+
viewer: e,
|
|
3
|
+
caption: o,
|
|
4
|
+
readout: i,
|
|
5
|
+
fit: t,
|
|
6
|
+
counter: s,
|
|
7
|
+
loading: r,
|
|
8
|
+
header: a,
|
|
9
|
+
heading: n,
|
|
10
|
+
index: c,
|
|
11
|
+
stage: l,
|
|
12
|
+
marks: w,
|
|
13
|
+
viewport: d,
|
|
14
|
+
canvas: F,
|
|
15
|
+
image: V,
|
|
16
|
+
pdf: g,
|
|
17
|
+
error: p,
|
|
18
|
+
controls: u,
|
|
19
|
+
round: m,
|
|
20
|
+
paging: v,
|
|
21
|
+
dots: f,
|
|
22
|
+
zoom: z,
|
|
23
|
+
scale: h,
|
|
24
|
+
slider: x,
|
|
25
|
+
ruler: q,
|
|
26
|
+
footer: k
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
F as canvas,
|
|
30
|
+
o as caption,
|
|
31
|
+
u as controls,
|
|
32
|
+
s as counter,
|
|
33
|
+
y as default,
|
|
34
|
+
f as dots,
|
|
35
|
+
p as error,
|
|
36
|
+
t as fit,
|
|
37
|
+
k as footer,
|
|
38
|
+
a as header,
|
|
39
|
+
n as heading,
|
|
40
|
+
V as image,
|
|
41
|
+
c as index,
|
|
42
|
+
r as loading,
|
|
43
|
+
w as marks,
|
|
44
|
+
v as paging,
|
|
45
|
+
g as pdf,
|
|
46
|
+
i as readout,
|
|
47
|
+
m as round,
|
|
48
|
+
q as ruler,
|
|
49
|
+
h as scale,
|
|
50
|
+
x as slider,
|
|
51
|
+
l as stage,
|
|
52
|
+
e as viewer,
|
|
53
|
+
d as viewport,
|
|
54
|
+
z as zoom
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=FileViewer.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileViewer.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|