@signalsafe/slide-editor-react 0.1.0 → 0.1.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/CHANGELOG.md +7 -0
- package/dist/SpeechControls.js +10 -6
- package/dist/source-manifest.json +6 -5
- package/dist/styles.d.ts +2 -0
- package/dist/useCanvasOverflow.js +2 -2
- package/dist/usePlayback.js +27 -23
- package/docs/current-state-summary.md +15 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## @signalsafe/slide-editor-react 0.1.2
|
|
4
|
+
|
|
5
|
+
- Fix the npm publication archive path. The 0.1.1 tag is retained as an unpublished release attempt.
|
|
6
|
+
- Preserve playback completion, narration sessions, seeking, visibility handling and overflow behavior under the React Hooks 7 rules.
|
|
7
|
+
- Adopt Content Editor 0.1.5 and the merged dependency updates.
|
|
8
|
+
- Support TypeScript 6 CSS declarations while retaining all four 100% coverage gates.
|
|
9
|
+
|
|
3
10
|
## @signalsafe/slide-editor-react 0.1.0
|
|
4
11
|
|
|
5
12
|
- Extract reusable typed deck operations, controlled editing and read-only playback.
|
package/dist/SpeechControls.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
4
4
|
import { narrationStart } from './narration.js';
|
|
5
5
|
function narrationStatus(supported, enabled, status) {
|
|
6
6
|
if (!supported)
|
|
@@ -61,7 +61,6 @@ function beginNarration(session, synth, next, renderedText, segment, nextIndex,
|
|
|
61
61
|
if (current.current?.utterance !== next)
|
|
62
62
|
return;
|
|
63
63
|
current.current = null;
|
|
64
|
-
setSpokenText('');
|
|
65
64
|
processed.current = nextIndex - 1;
|
|
66
65
|
onBusyChange(false);
|
|
67
66
|
const explanation = `Narration could not play: ${message}. Disable Narration to continue silently.`;
|
|
@@ -100,8 +99,16 @@ export function SpeechControls({ settings, onSettingsChange, segments, contextKe
|
|
|
100
99
|
const speechPaused = useRef(false);
|
|
101
100
|
const processed = useRef(-1);
|
|
102
101
|
const latestTime = useRef(timeMs);
|
|
103
|
-
latestTime.current = timeMs;
|
|
102
|
+
useLayoutEffect(() => { latestTime.current = timeMs; }, [timeMs]);
|
|
104
103
|
const signature = JSON.stringify(segments);
|
|
104
|
+
const session = [contextKey, signature, segments, enabled, voice, speed, volume, supported, onBusyChange];
|
|
105
|
+
const [previousSession, setPreviousSession] = useState(session);
|
|
106
|
+
if (session.some((value, index) => !Object.is(value, previousSession[index]))) {
|
|
107
|
+
setPreviousSession(session);
|
|
108
|
+
setSpokenText('');
|
|
109
|
+
setStatus('Ready');
|
|
110
|
+
setError('');
|
|
111
|
+
}
|
|
105
112
|
useEffect(() => {
|
|
106
113
|
if (!supported)
|
|
107
114
|
return;
|
|
@@ -113,14 +120,11 @@ export function SpeechControls({ settings, onSettingsChange, segments, contextKe
|
|
|
113
120
|
}, [supported]);
|
|
114
121
|
useEffect(() => {
|
|
115
122
|
current.current = null;
|
|
116
|
-
setSpokenText('');
|
|
117
123
|
speechPaused.current = false;
|
|
118
124
|
processed.current = narrationStart(segments, latestTime.current) - 1;
|
|
119
125
|
if (supported)
|
|
120
126
|
window.speechSynthesis.cancel();
|
|
121
127
|
onBusyChange(false);
|
|
122
|
-
setStatus('Ready');
|
|
123
|
-
setError('');
|
|
124
128
|
return () => {
|
|
125
129
|
current.current = null;
|
|
126
130
|
if (supported)
|
|
@@ -6,16 +6,17 @@
|
|
|
6
6
|
"src/SlideOverview.tsx": "bc69f5813071ad7d2b4d8fe2b47c19b72556a4a7242897a3ff7f5e9fd10e82aa",
|
|
7
7
|
"src/SlidePlaybackControls.tsx": "d69fdf5646b9b72dc79df3d694c41f02a58b84b05dbf560142c30a8ef53a1eee",
|
|
8
8
|
"src/SlidePlayer.tsx": "8ad893667c8661d2dd805a112f54017d6fd5e3da7f6a170607abae107a8af158",
|
|
9
|
-
"src/SpeechControls.tsx": "
|
|
9
|
+
"src/SpeechControls.tsx": "e76ef5a6ddf8d2da1ab7ba5a8258e269523820b266d93cedf6d5cc19a6801226",
|
|
10
10
|
"src/deck.ts": "116360eaec4fa6dd44d5ffb859e4a3b64c2e85e33e89649fd4c1ab5346885b87",
|
|
11
11
|
"src/narration.ts": "9d299bfb41ddd7fad3a37f75b84229a7e14d21485e61dff8b4f63a2cdb82f4c8",
|
|
12
12
|
"src/narrationDom.ts": "63dc17012fe6208f78a6ad941efc953331a78d4e31dbfbe33a6f3577eafcd000",
|
|
13
13
|
"src/slide-editor.css": "b1783a0bbedd679c05c2cf33fe06ef1098002d6d0b1649dcabca48d156067bdd",
|
|
14
|
+
"src/styles.d.ts": "92928288338e79b01c9489616dd824dcddf1f22cb6a520056c8f516a69ea46cd",
|
|
14
15
|
"src/thumbnailObservers.ts": "07f2e0efb338d0826076bef72963b491b44894c3658d5425cfe0799f73794750",
|
|
15
|
-
"src/useCanvasOverflow.ts": "
|
|
16
|
-
"src/usePlayback.ts": "
|
|
16
|
+
"src/useCanvasOverflow.ts": "0d0bce25398b0441ac6761a0070d7bc93eb91e4f3025cd4ccb3be39550c16dc6",
|
|
17
|
+
"src/usePlayback.ts": "832e37693e73013f6dd37ed7f26c3432ff69a68cf2c1c541fe1f16f2e9ba20ae",
|
|
17
18
|
"src/validationIssueRows.ts": "9aefc967eddbb5878ece976f54c364b346142855e65e4a3c6d8c5c6c6c482c9c",
|
|
18
|
-
"package.json": "
|
|
19
|
+
"package.json": "22c4f2a0da5137578feb3a3340a819496554be234fa936bca46f0fb8bd6febf2",
|
|
19
20
|
"tsconfig.json": "d0afb06c670b0c2aafbbd4809e34d79bb65a82073561efe96b6e86736fffb71e",
|
|
20
|
-
"scripts/build.mjs": "
|
|
21
|
+
"scripts/build.mjs": "c3451e4cb3222d84cb41640d7392b20b93cfbb0b78d31c2a275a009a8da142ba"
|
|
21
22
|
}
|
package/dist/styles.d.ts
ADDED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
2
|
/** Measure authored leaf content, not the intentionally scrollable viewport or device shell. */
|
|
3
3
|
export function useCanvasOverflow(canvas, blocks, enabled, width, onChange) {
|
|
4
4
|
const callback = useRef(onChange);
|
|
5
|
-
callback.current = onChange;
|
|
5
|
+
useLayoutEffect(() => { callback.current = onChange; }, [onChange]);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
const element = canvas.current;
|
|
8
8
|
if (!enabled || !element) {
|
package/dist/usePlayback.js
CHANGED
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
2
|
export function usePlayback(durationMs, slideId, narrationBusy = false, onComplete) {
|
|
3
3
|
const [timeMs, setTimeMs] = useState(0);
|
|
4
|
-
const [
|
|
4
|
+
const [requestedPlaying, setPlaying] = useState(false);
|
|
5
|
+
const [completed, setCompleted] = useState(false);
|
|
5
6
|
const [speed, setSpeed] = useState(1);
|
|
6
|
-
const [revision, setRevision] = useState(
|
|
7
|
+
const [revision, setRevision] = useState(1);
|
|
8
|
+
const [context, setContext] = useState({ durationMs, slideId });
|
|
9
|
+
const contextChanged = !Object.is(context.durationMs, durationMs) || context.slideId !== slideId;
|
|
10
|
+
if (contextChanged) {
|
|
11
|
+
setContext({ durationMs, slideId });
|
|
12
|
+
setTimeMs(0);
|
|
13
|
+
setPlaying(false);
|
|
14
|
+
setCompleted(false);
|
|
15
|
+
setRevision(current => current + 1);
|
|
16
|
+
}
|
|
17
|
+
const playing = requestedPlaying && !completed;
|
|
18
|
+
if (!contextChanged && playing && timeMs >= durationMs && !narrationBusy)
|
|
19
|
+
setCompleted(true);
|
|
7
20
|
const complete = useRef(onComplete);
|
|
8
|
-
|
|
21
|
+
const position = useRef({ timeMs, narrationBusy });
|
|
9
22
|
const anchor = useRef(null);
|
|
23
|
+
useLayoutEffect(() => {
|
|
24
|
+
complete.current = onComplete;
|
|
25
|
+
position.current = { timeMs, narrationBusy };
|
|
26
|
+
}, [onComplete, timeMs, narrationBusy]);
|
|
27
|
+
useLayoutEffect(() => { anchor.current = null; }, [slideId, durationMs]);
|
|
10
28
|
const pause = useCallback(() => {
|
|
11
29
|
setPlaying(false);
|
|
12
30
|
anchor.current = null;
|
|
13
31
|
}, []);
|
|
14
32
|
const seek = useCallback((next) => {
|
|
15
33
|
setPlaying(false);
|
|
34
|
+
setCompleted(false);
|
|
16
35
|
setTimeMs(Math.max(0, Math.min(durationMs, next)));
|
|
17
36
|
setRevision((current) => current + 1);
|
|
18
37
|
anchor.current = null;
|
|
19
38
|
}, [durationMs]);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
seek(0);
|
|
22
|
-
}, [slideId, seek]);
|
|
23
39
|
useEffect(() => {
|
|
24
40
|
const visibility = () => {
|
|
25
41
|
if (document.hidden)
|
|
@@ -45,26 +61,14 @@ export function usePlayback(durationMs, slideId, narrationBusy = false, onComple
|
|
|
45
61
|
};
|
|
46
62
|
}, [durationMs, playing, speed]);
|
|
47
63
|
useEffect(() => {
|
|
48
|
-
if (
|
|
49
|
-
pause();
|
|
64
|
+
if (completed)
|
|
50
65
|
complete.current?.();
|
|
51
|
-
|
|
52
|
-
}, [timeMs, durationMs, narrationBusy, playing, pause]);
|
|
53
|
-
const position = useRef({ timeMs, narrationBusy });
|
|
54
|
-
position.current = { timeMs, narrationBusy };
|
|
66
|
+
}, [completed]);
|
|
55
67
|
const play = useCallback(() => {
|
|
56
68
|
if (position.current.timeMs >= durationMs && !position.current.narrationBusy)
|
|
57
69
|
seek(0);
|
|
70
|
+
setCompleted(false);
|
|
58
71
|
setPlaying(true);
|
|
59
72
|
}, [durationMs, seek]);
|
|
60
|
-
return {
|
|
61
|
-
timeMs,
|
|
62
|
-
playing,
|
|
63
|
-
speed,
|
|
64
|
-
revision,
|
|
65
|
-
pause,
|
|
66
|
-
seek,
|
|
67
|
-
setSpeed,
|
|
68
|
-
play,
|
|
69
|
-
};
|
|
73
|
+
return { timeMs, playing, speed, revision, pause, seek, setSpeed, play };
|
|
70
74
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# slide-editor-react current state
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Initial release 0.1.0
|
|
4
4
|
|
|
5
5
|
This is the first distribution under `@signalsafe/slide-editor-react`. Its predecessor
|
|
6
6
|
repository history is retained; new releases use `slide-editor-v0.1.0` rather than
|
|
@@ -32,3 +32,17 @@ are separate results and must be verified after their workflows complete. The
|
|
|
32
32
|
repository retains its private visibility; npm provenance is not generated from
|
|
33
33
|
private GitHub repositories. Archive integrity and source commit receipts remain
|
|
34
34
|
required. Do not claim hosted checks from local results.
|
|
35
|
+
|
|
36
|
+
## Verified publication
|
|
37
|
+
|
|
38
|
+
The repository rename and release migration merged through [PR #34](https://github.com/SignalSafeSoftware/slide-editor-react/pull/34), with all required checks and Sonar passing. The initial npm publication of `@signalsafe/slide-editor-react@0.1.0` succeeded. Its public registry tarball is byte-identical to the CI-verified archive (SHA-512 `kq8cbkcof65Bwzn3oVMvBpVaxWtMSVOrjbm0ML8H3ipV77f+wQvo3FLvfX80ppENCyo0xQgzpnROkfC8ZsQp5Q==`).
|
|
39
|
+
|
|
40
|
+
The release tag is `slide-editor-v0.1.0`. The package-specific GitHub trusted publisher is bound to this repository and `release.yml`. The first version used authenticated bootstrap publication; later versions use the workflow. Repository visibility is preserved, so no npm provenance attestation is claimed for this private source repository.
|
|
41
|
+
|
|
42
|
+
[Pages deployment 46209150587](https://github.com/SignalSafeSoftware/slide-editor-react/actions/runs/46209150587) succeeded. The public demo returned HTTP 200 and rendered the slide editor, playback controls and the updated GitHub, documentation and npm links. DeliveryPlus adopts the published registry archive only after this verification.
|
|
43
|
+
|
|
44
|
+
## Release 0.1.2
|
|
45
|
+
|
|
46
|
+
The current patch release adopts Content Editor 0.1.5 and the merged dependency updates, including React Hooks 7 and TypeScript 6. Playback completion, narration sessions, seeking and visibility behavior remain covered by all 51 tests with 100% statements, branches, functions and lines. Strict types, lint, package boundaries and both portable and showcase builds pass. The release uses `slide-editor-v0.1.2`; DeliveryPlus validates the exact registry archive and source fingerprints before adoption.
|
|
47
|
+
|
|
48
|
+
The 0.1.1 verification passed, but npm interpreted its workflow archive path as a GitHub shorthand and publication failed before upload. The tag is preserved; 0.1.2 fixes the path and carries the same tested runtime changes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalsafe/slide-editor-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Reusable controlled slide decks, editing navigation, narration and presentation playback.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"showcase:check": "node showcase/check-build.mjs"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@signalsafe/content-editor-react": "0.1.
|
|
94
|
+
"@signalsafe/content-editor-react": "0.1.5",
|
|
95
95
|
"zod": "4.6.7"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
@@ -101,28 +101,28 @@
|
|
|
101
101
|
"react-dom": "^18.3.1"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@eslint/js": "^
|
|
104
|
+
"@eslint/js": "^10.0.1",
|
|
105
105
|
"@testing-library/dom": "^10.4.0",
|
|
106
106
|
"@testing-library/jest-dom": "^8.0.0",
|
|
107
107
|
"@testing-library/react": "^16.0.1",
|
|
108
|
-
"@types/node": "^26.6.
|
|
108
|
+
"@types/node": "^26.6.11",
|
|
109
109
|
"@types/react": "^18.2.66",
|
|
110
110
|
"@types/react-dom": "^18.2.22",
|
|
111
111
|
"@vitejs/plugin-react": "^5.2.0",
|
|
112
|
-
"@vitest/coverage-v8": "
|
|
112
|
+
"@vitest/coverage-v8": "5.1.2",
|
|
113
113
|
"bootstrap": "^5.3.3",
|
|
114
114
|
"eslint": "^9.17.0",
|
|
115
115
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
116
|
-
"eslint-plugin-react-hooks": "^
|
|
116
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
117
117
|
"globals": "^17.14.0",
|
|
118
118
|
"jsdom": "31.0.1",
|
|
119
119
|
"react": "^18.3.1",
|
|
120
120
|
"react-bootstrap": "^2.10.2",
|
|
121
121
|
"react-dom": "^18.3.1",
|
|
122
|
-
"typescript": "
|
|
123
|
-
"typescript-eslint": "^8.
|
|
122
|
+
"typescript": "6.0.3",
|
|
123
|
+
"typescript-eslint": "^8.74.0",
|
|
124
124
|
"vite": "^6.4.4",
|
|
125
|
-
"vitest": "
|
|
125
|
+
"vitest": "5.1.2"
|
|
126
126
|
},
|
|
127
127
|
"publishConfig": {
|
|
128
128
|
"access": "public",
|