strata-react 2.1.17 → 2.1.18
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/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AsyncActionOptions, B as RowAction, C as useColorScheme, D as DensityName, E as Density, F as useAsyncAction, H as buttonVariants, I as Button, L as ButtonProps, M as AsyncLabels, N as FieldErrors, O as DensityProps, P as Phase, R as IconButton, S as palettes, T as useSystemColorScheme, U as ControlSize, V as RowActionProps, W as IconComponent, _ as PaletteOption, a as browserMicrophone, b as colorSchemeScript, c as COLOR_SCHEME_STORAGE_KEY, d as ColorSchemeLabels, f as ColorSchemePreference, g as PaletteChoice, h as PALETTE_STORAGE_KEY, i as MicrophoneStream, j as AsyncButton, k as AsyncAction, l as ColorScheme, m as DEFAULT_PALETTE, n as MicrophoneContext, o as explainMicrophoneError, p as ColorSchemeState, r as MicrophoneError, s as useMicrophone, t as Microphone, u as ColorSchemeChoice, v as PaletteState, w as usePalette, x as paletteScript, y as ThemeProvider, z as IconButtonProps } from "./microphone-
|
|
1
|
+
import { A as AsyncActionOptions, B as RowAction, C as useColorScheme, D as DensityName, E as Density, F as useAsyncAction, H as buttonVariants, I as Button, L as ButtonProps, M as AsyncLabels, N as FieldErrors, O as DensityProps, P as Phase, R as IconButton, S as palettes, T as useSystemColorScheme, U as ControlSize, V as RowActionProps, W as IconComponent, _ as PaletteOption, a as browserMicrophone, b as colorSchemeScript, c as COLOR_SCHEME_STORAGE_KEY, d as ColorSchemeLabels, f as ColorSchemePreference, g as PaletteChoice, h as PALETTE_STORAGE_KEY, i as MicrophoneStream, j as AsyncButton, k as AsyncAction, l as ColorScheme, m as DEFAULT_PALETTE, n as MicrophoneContext, o as explainMicrophoneError, p as ColorSchemeState, r as MicrophoneError, s as useMicrophone, t as Microphone, u as ColorSchemeChoice, v as PaletteState, w as usePalette, x as paletteScript, y as ThemeProvider, z as IconButtonProps } from "./microphone-xGKxcK6p.js";
|
|
2
2
|
import { n as geo, t as LatLng } from "./geo-DfKa9JtK.js";
|
|
3
3
|
import { $ as ChartMark, A as SpanOutcome, B as StageGuides, C as MediaSpanData, Ct as PlayerWarning, D as SpanActionsNotice, E as SpanActions, F as RateChoice, G as VolumeControlProps, H as Transport, I as SeekBar, J as KeysLegend, K as transportShortcuts, L as SeekBarProps, M as useMediaSpans, N as MediaStage, O as SpanBehaviour, P as Precision, Q as useHotkeys, R as SeekBarSpan, S as MediaProgress, St as skipAction, T as PlayerNotice, Tt as usePlayerWarnings, U as TransportProps, V as TimeReadout, W as VolumeControl, X as isTypingTarget, Y as Shortcut, Z as keyName, _ as MediaStat, _t as MediaMark, a as MediaPlayerProps, at as LineChartProps, b as mediaStatRows, bt as SkipSteps, c as MediaSource, ct as YScale, d as SPEECH_RATES, dt as CursorMapping, et as ChartSpan, f as SourceAttacher, ft as CursorOwner, g as useMediaElement, gt as useSharedCursor, h as useAttachedSource, ht as SharedCursor, i as MediaPlayer, it as LineChartGroupProps, j as SpanWords, k as SpanKind, l as MediaWindow, lt as logScale, m as StreamContext, mt as CursorScopeProps, n as MediaElementState, nt as LineChart, o as MediaProblem, ot as Point, p as StreamAttachment, pt as CursorScope, q as HotkeysOptions, r as MediaHeading, rt as LineChartGroup, s as MediaSession, st as SpanTone, t as MediaElementOptions, tt as GroupedChart, u as ResumeWords, ut as valueAt, v as MediaStats, vt as SkipAction, w as MediaSpansState, wt as PlayerWarningEvent, x as useMediaStats, xt as marksFor, y as StreamStats, yt as SkipLevel, z as SpanStrip } from "./media-player-C6j069Aa.js";
|
|
4
4
|
import { ClassValue } from "clsx";
|
package/dist/index.js
CHANGED
|
@@ -15637,14 +15637,21 @@ function speakText(text, { lang, rate = .9, onEnd }) {
|
|
|
15637
15637
|
synth.speak(utterance);
|
|
15638
15638
|
return true;
|
|
15639
15639
|
}
|
|
15640
|
-
function
|
|
15640
|
+
function loadClip(part) {
|
|
15641
|
+
const audio = new Audio();
|
|
15642
|
+
audio.preload = "auto";
|
|
15643
|
+
audio.title = part.text;
|
|
15644
|
+
audio.src = part.clip ?? "";
|
|
15645
|
+
return audio;
|
|
15646
|
+
}
|
|
15647
|
+
function playFrom(parts, i, options, loaded) {
|
|
15641
15648
|
const part = parts[i];
|
|
15642
15649
|
if (!part) {
|
|
15643
15650
|
options.onEnd?.();
|
|
15644
15651
|
return;
|
|
15645
15652
|
}
|
|
15646
|
-
const audio =
|
|
15647
|
-
|
|
15653
|
+
const audio = loaded ?? loadClip(part);
|
|
15654
|
+
const following = parts[i + 1];
|
|
15648
15655
|
let settled = false;
|
|
15649
15656
|
const settle = () => {
|
|
15650
15657
|
if (settled) return false;
|
|
@@ -15661,11 +15668,11 @@ function playFrom(parts, i, options) {
|
|
|
15661
15668
|
options.onEnd?.();
|
|
15662
15669
|
} };
|
|
15663
15670
|
playing = entry;
|
|
15671
|
+
const next = following ? loadClip(following) : void 0;
|
|
15664
15672
|
audio.onended = () => {
|
|
15665
|
-
if (settle()) playFrom(parts, i + 1, options);
|
|
15673
|
+
if (settle()) playFrom(parts, i + 1, options, next);
|
|
15666
15674
|
};
|
|
15667
15675
|
audio.onerror = fallBack;
|
|
15668
|
-
audio.src = part.clip ?? "";
|
|
15669
15676
|
audio.play()?.catch(fallBack);
|
|
15670
15677
|
}
|
|
15671
15678
|
/**
|