@scalemule/nextjs 0.1.47 → 0.1.48
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/audio.css +2 -1
- package/dist/audio.js +10 -1
- package/dist/audio.mjs +12 -2
- package/package.json +1 -1
package/dist/audio.css
CHANGED
package/dist/audio.js
CHANGED
|
@@ -343,6 +343,8 @@ function parseTimingsPayload(body) {
|
|
|
343
343
|
|
|
344
344
|
// src/components/audio-player.tsx
|
|
345
345
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
346
|
+
var subscribeNever = () => () => {
|
|
347
|
+
};
|
|
346
348
|
var SPEEDS = [1, 1.25, 1.5, 2, 3];
|
|
347
349
|
var PLAY_EVENT = "scalemule:audio:play";
|
|
348
350
|
var HIGHLIGHT_PREF_KEY = "scalemule:audio:highlight";
|
|
@@ -386,7 +388,14 @@ function PlayerSession({
|
|
|
386
388
|
const sliderId = (0, import_react.useId)();
|
|
387
389
|
const labelId = (0, import_react.useId)();
|
|
388
390
|
const rate = (0, import_react.useRef)(1);
|
|
389
|
-
const
|
|
391
|
+
const highlightSupported = (0, import_react.useSyncExternalStore)(
|
|
392
|
+
subscribeNever,
|
|
393
|
+
narrationHighlightSupported,
|
|
394
|
+
// The server can't detect support; render the toggle only after
|
|
395
|
+
// hydration so server and client markup always match.
|
|
396
|
+
() => false
|
|
397
|
+
);
|
|
398
|
+
const narrationOffered = !!narration && audio.has_word_timings !== false && highlightSupported;
|
|
390
399
|
const [highlightOn, setHighlightOn] = (0, import_react.useState)(false);
|
|
391
400
|
const [highlightBusy, setHighlightBusy] = (0, import_react.useState)(false);
|
|
392
401
|
const highlighter = (0, import_react.useRef)(null);
|
package/dist/audio.mjs
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
useId,
|
|
8
8
|
useMemo,
|
|
9
9
|
useRef,
|
|
10
|
-
useState
|
|
10
|
+
useState,
|
|
11
|
+
useSyncExternalStore
|
|
11
12
|
} from "react";
|
|
12
13
|
|
|
13
14
|
// src/components/narration-highlight.ts
|
|
@@ -319,6 +320,8 @@ function parseTimingsPayload(body) {
|
|
|
319
320
|
|
|
320
321
|
// src/components/audio-player.tsx
|
|
321
322
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
323
|
+
var subscribeNever = () => () => {
|
|
324
|
+
};
|
|
322
325
|
var SPEEDS = [1, 1.25, 1.5, 2, 3];
|
|
323
326
|
var PLAY_EVENT = "scalemule:audio:play";
|
|
324
327
|
var HIGHLIGHT_PREF_KEY = "scalemule:audio:highlight";
|
|
@@ -362,7 +365,14 @@ function PlayerSession({
|
|
|
362
365
|
const sliderId = useId();
|
|
363
366
|
const labelId = useId();
|
|
364
367
|
const rate = useRef(1);
|
|
365
|
-
const
|
|
368
|
+
const highlightSupported = useSyncExternalStore(
|
|
369
|
+
subscribeNever,
|
|
370
|
+
narrationHighlightSupported,
|
|
371
|
+
// The server can't detect support; render the toggle only after
|
|
372
|
+
// hydration so server and client markup always match.
|
|
373
|
+
() => false
|
|
374
|
+
);
|
|
375
|
+
const narrationOffered = !!narration && audio.has_word_timings !== false && highlightSupported;
|
|
366
376
|
const [highlightOn, setHighlightOn] = useState(false);
|
|
367
377
|
const [highlightBusy, setHighlightBusy] = useState(false);
|
|
368
378
|
const highlighter = useRef(null);
|
package/package.json
CHANGED