@cratis/showrunner.cue.react 0.0.0-stage → 2.10.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/.storybook/main.ts +11 -0
- package/.storybook/preview.tsx +21 -0
- package/Configuration/CueConfiguration.ts +27 -0
- package/Configuration/CueProvider.tsx +64 -0
- package/Configuration/CueStageBoundary.tsx +37 -0
- package/Configuration/index.ts +6 -0
- package/Icons.tsx +36 -0
- package/Labels/CueLabels.ts +39 -0
- package/Labels/defaultCueLabels.ts +23 -0
- package/Labels/index.ts +6 -0
- package/Labels/resolveLabels.ts +12 -0
- package/Markdown/CueMarkdown.tsx +31 -0
- package/Markdown/index.ts +5 -0
- package/Markdown/safeUrl.ts +29 -0
- package/README.md +54 -2
- package/Speech/CueSpeech.ts +27 -0
- package/Speech/CueSpeechConfiguration.ts +21 -0
- package/Speech/HttpSpeechOptions.ts +37 -0
- package/Speech/createHttpSpeech.ts +135 -0
- package/Speech/index.ts +7 -0
- package/Speech/silentSpeech.ts +15 -0
- package/Speech/speechClips.ts +66 -0
- package/TourAnchor.tsx +162 -0
- package/TourAnchorSpace.ts +15 -0
- package/TourCallout.ts +22 -0
- package/TourCalloutBubble.tsx +38 -0
- package/TourCamera.ts +17 -0
- package/TourChapter.ts +24 -0
- package/TourChapterList.tsx +65 -0
- package/TourGesture.ts +30 -0
- package/TourOverlayShell.tsx +102 -0
- package/TourPointer.tsx +83 -0
- package/TourSection.ts +24 -0
- package/TourSelfPacedPanel.tsx +26 -0
- package/TourStep.ts +40 -0
- package/TourSubtitles.tsx +22 -0
- package/TourTimelineBar.tsx +127 -0
- package/Tours/index.ts +5 -0
- package/Tours/useCueTours.ts +63 -0
- package/Tours/useTourNudge.ts +37 -0
- package/cursorSvg.ts +12 -0
- package/dist/cjs/Configuration/CueConfiguration.d.ts +11 -0
- package/dist/cjs/Configuration/CueConfiguration.d.ts.map +1 -0
- package/dist/cjs/Configuration/CueProvider.d.ts +19 -0
- package/dist/cjs/Configuration/CueProvider.d.ts.map +1 -0
- package/dist/cjs/Configuration/CueProvider.js +44 -0
- package/dist/cjs/Configuration/CueProvider.js.map +1 -0
- package/dist/cjs/Configuration/CueStageBoundary.d.ts +14 -0
- package/dist/cjs/Configuration/CueStageBoundary.d.ts.map +1 -0
- package/dist/cjs/Configuration/CueStageBoundary.js +45 -0
- package/dist/cjs/Configuration/CueStageBoundary.js.map +1 -0
- package/dist/cjs/Configuration/index.d.ts +4 -0
- package/dist/cjs/Configuration/index.d.ts.map +1 -0
- package/dist/cjs/Examples/AppShell.d.ts +5 -0
- package/dist/cjs/Examples/AppShell.d.ts.map +1 -0
- package/dist/cjs/Examples/LocalizedCue.d.ts +5 -0
- package/dist/cjs/Examples/LocalizedCue.d.ts.map +1 -0
- package/dist/cjs/Examples/OrderDeskTour.d.ts +2 -0
- package/dist/cjs/Examples/OrderDeskTour.d.ts.map +1 -0
- package/dist/cjs/Examples/OwnStageGuard.d.ts +5 -0
- package/dist/cjs/Examples/OwnStageGuard.d.ts.map +1 -0
- package/dist/cjs/Examples/OwnVoice.d.ts +3 -0
- package/dist/cjs/Examples/OwnVoice.d.ts.map +1 -0
- package/dist/cjs/Icons.d.ts +19 -0
- package/dist/cjs/Icons.d.ts.map +1 -0
- package/dist/cjs/Icons.js +33 -0
- package/dist/cjs/Icons.js.map +1 -0
- package/dist/cjs/Labels/CueLabels.d.ts +18 -0
- package/dist/cjs/Labels/CueLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/defaultCueLabels.d.ts +3 -0
- package/dist/cjs/Labels/defaultCueLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/defaultCueLabels.js +24 -0
- package/dist/cjs/Labels/defaultCueLabels.js.map +1 -0
- package/dist/cjs/Labels/index.d.ts +4 -0
- package/dist/cjs/Labels/index.d.ts.map +1 -0
- package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
- package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/resolveLabels.js +17 -0
- package/dist/cjs/Labels/resolveLabels.js.map +1 -0
- package/dist/cjs/Markdown/CueMarkdown.d.ts +6 -0
- package/dist/cjs/Markdown/CueMarkdown.d.ts.map +1 -0
- package/dist/cjs/Markdown/CueMarkdown.js +34 -0
- package/dist/cjs/Markdown/CueMarkdown.js.map +1 -0
- package/dist/cjs/Markdown/index.d.ts +3 -0
- package/dist/cjs/Markdown/index.d.ts.map +1 -0
- package/dist/cjs/Markdown/safeUrl.d.ts +2 -0
- package/dist/cjs/Markdown/safeUrl.d.ts.map +1 -0
- package/dist/cjs/Markdown/safeUrl.js +34 -0
- package/dist/cjs/Markdown/safeUrl.js.map +1 -0
- package/dist/cjs/Speech/CueSpeech.d.ts +10 -0
- package/dist/cjs/Speech/CueSpeech.d.ts.map +1 -0
- package/dist/cjs/Speech/CueSpeechConfiguration.d.ts +6 -0
- package/dist/cjs/Speech/CueSpeechConfiguration.d.ts.map +1 -0
- package/dist/cjs/Speech/HttpSpeechOptions.d.ts +10 -0
- package/dist/cjs/Speech/HttpSpeechOptions.d.ts.map +1 -0
- package/dist/cjs/Speech/createHttpSpeech.d.ts +4 -0
- package/dist/cjs/Speech/createHttpSpeech.d.ts.map +1 -0
- package/dist/cjs/Speech/createHttpSpeech.js +140 -0
- package/dist/cjs/Speech/createHttpSpeech.js.map +1 -0
- package/dist/cjs/Speech/index.d.ts +5 -0
- package/dist/cjs/Speech/index.d.ts.map +1 -0
- package/dist/cjs/Speech/silentSpeech.d.ts +3 -0
- package/dist/cjs/Speech/silentSpeech.d.ts.map +1 -0
- package/dist/cjs/Speech/silentSpeech.js +16 -0
- package/dist/cjs/Speech/silentSpeech.js.map +1 -0
- package/dist/cjs/Speech/speechClips.d.ts +7 -0
- package/dist/cjs/Speech/speechClips.d.ts.map +1 -0
- package/dist/cjs/Speech/speechClips.js +60 -0
- package/dist/cjs/Speech/speechClips.js.map +1 -0
- package/dist/cjs/TourAnchor.d.ts +14 -0
- package/dist/cjs/TourAnchor.d.ts.map +1 -0
- package/dist/cjs/TourAnchor.js +150 -0
- package/dist/cjs/TourAnchor.js.map +1 -0
- package/dist/cjs/TourAnchorSpace.d.ts +2 -0
- package/dist/cjs/TourAnchorSpace.d.ts.map +1 -0
- package/dist/cjs/TourCallout.d.ts +8 -0
- package/dist/cjs/TourCallout.d.ts.map +1 -0
- package/dist/cjs/TourCalloutBubble.d.ts +9 -0
- package/dist/cjs/TourCalloutBubble.d.ts.map +1 -0
- package/dist/cjs/TourCalloutBubble.js +27 -0
- package/dist/cjs/TourCalloutBubble.js.map +1 -0
- package/dist/cjs/TourCamera.d.ts +6 -0
- package/dist/cjs/TourCamera.d.ts.map +1 -0
- package/dist/cjs/TourChapter.d.ts +8 -0
- package/dist/cjs/TourChapter.d.ts.map +1 -0
- package/dist/cjs/TourChapterList.d.ts +10 -0
- package/dist/cjs/TourChapterList.d.ts.map +1 -0
- package/dist/cjs/TourChapterList.js +68 -0
- package/dist/cjs/TourChapterList.js.map +1 -0
- package/dist/cjs/TourChapterList.stories.d.ts +21 -0
- package/dist/cjs/TourChapterList.stories.d.ts.map +1 -0
- package/dist/cjs/TourGesture.d.ts +12 -0
- package/dist/cjs/TourGesture.d.ts.map +1 -0
- package/dist/cjs/TourOverlayShell.d.ts +13 -0
- package/dist/cjs/TourOverlayShell.d.ts.map +1 -0
- package/dist/cjs/TourOverlayShell.js +77 -0
- package/dist/cjs/TourOverlayShell.js.map +1 -0
- package/dist/cjs/TourPointer.d.ts +9 -0
- package/dist/cjs/TourPointer.d.ts.map +1 -0
- package/dist/cjs/TourPointer.js +74 -0
- package/dist/cjs/TourPointer.js.map +1 -0
- package/dist/cjs/TourSection.d.ts +8 -0
- package/dist/cjs/TourSection.d.ts.map +1 -0
- package/dist/cjs/TourSelfPacedPanel.d.ts +6 -0
- package/dist/cjs/TourSelfPacedPanel.d.ts.map +1 -0
- package/dist/cjs/TourSelfPacedPanel.js +27 -0
- package/dist/cjs/TourSelfPacedPanel.js.map +1 -0
- package/dist/cjs/TourSelfPacedPanel.stories.d.ts +21 -0
- package/dist/cjs/TourSelfPacedPanel.stories.d.ts.map +1 -0
- package/dist/cjs/TourStep.d.ts +12 -0
- package/dist/cjs/TourStep.d.ts.map +1 -0
- package/dist/cjs/TourSubtitles.d.ts +5 -0
- package/dist/cjs/TourSubtitles.d.ts.map +1 -0
- package/dist/cjs/TourSubtitles.js +24 -0
- package/dist/cjs/TourSubtitles.js.map +1 -0
- package/dist/cjs/TourTimelineBar.d.ts +10 -0
- package/dist/cjs/TourTimelineBar.d.ts.map +1 -0
- package/dist/cjs/TourTimelineBar.js +134 -0
- package/dist/cjs/TourTimelineBar.js.map +1 -0
- package/dist/cjs/TourTimelineBar.stories.d.ts +24 -0
- package/dist/cjs/TourTimelineBar.stories.d.ts.map +1 -0
- package/dist/cjs/Tours/index.d.ts +3 -0
- package/dist/cjs/Tours/index.d.ts.map +1 -0
- package/dist/cjs/Tours/useCueTours.d.ts +7 -0
- package/dist/cjs/Tours/useCueTours.d.ts.map +1 -0
- package/dist/cjs/Tours/useCueTours.js +46 -0
- package/dist/cjs/Tours/useCueTours.js.map +1 -0
- package/dist/cjs/Tours/useTourNudge.d.ts +6 -0
- package/dist/cjs/Tours/useTourNudge.d.ts.map +1 -0
- package/dist/cjs/Tours/useTourNudge.js +28 -0
- package/dist/cjs/Tours/useTourNudge.js.map +1 -0
- package/dist/cjs/cursorSvg.d.ts +2 -0
- package/dist/cjs/cursorSvg.d.ts.map +1 -0
- package/dist/cjs/cursorSvg.js +15 -0
- package/dist/cjs/cursorSvg.js.map +1 -0
- package/dist/cjs/index.d.ts +41 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +72 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/tourClock.d.ts +19 -0
- package/dist/cjs/tourClock.d.ts.map +1 -0
- package/dist/cjs/tourClock.js +107 -0
- package/dist/cjs/tourClock.js.map +1 -0
- package/dist/cjs/tourGeometry.d.ts +18 -0
- package/dist/cjs/tourGeometry.d.ts.map +1 -0
- package/dist/cjs/tourGeometry.js +86 -0
- package/dist/cjs/tourGeometry.js.map +1 -0
- package/dist/cjs/tourSelfPaced.d.ts +12 -0
- package/dist/cjs/tourSelfPaced.d.ts.map +1 -0
- package/dist/cjs/tourSelfPaced.js +69 -0
- package/dist/cjs/tourSelfPaced.js.map +1 -0
- package/dist/cjs/tourTimeline.d.ts +40 -0
- package/dist/cjs/tourTimeline.d.ts.map +1 -0
- package/dist/cjs/tourTimeline.js +168 -0
- package/dist/cjs/tourTimeline.js.map +1 -0
- package/dist/cjs/useTourPlayback.d.ts +25 -0
- package/dist/cjs/useTourPlayback.d.ts.map +1 -0
- package/dist/cjs/useTourPlayback.js +245 -0
- package/dist/cjs/useTourPlayback.js.map +1 -0
- package/dist/esm/Configuration/CueConfiguration.d.ts +11 -0
- package/dist/esm/Configuration/CueConfiguration.d.ts.map +1 -0
- package/dist/esm/Configuration/CueConfiguration.js +2 -0
- package/dist/esm/Configuration/CueConfiguration.js.map +1 -0
- package/dist/esm/Configuration/CueProvider.d.ts +19 -0
- package/dist/esm/Configuration/CueProvider.d.ts.map +1 -0
- package/dist/esm/Configuration/CueProvider.js +41 -0
- package/dist/esm/Configuration/CueProvider.js.map +1 -0
- package/dist/esm/Configuration/CueStageBoundary.d.ts +14 -0
- package/dist/esm/Configuration/CueStageBoundary.d.ts.map +1 -0
- package/dist/esm/Configuration/CueStageBoundary.js +43 -0
- package/dist/esm/Configuration/CueStageBoundary.js.map +1 -0
- package/dist/esm/Configuration/index.d.ts +4 -0
- package/dist/esm/Configuration/index.d.ts.map +1 -0
- package/dist/esm/Configuration/index.js +4 -0
- package/dist/esm/Configuration/index.js.map +1 -0
- package/dist/esm/Examples/AppShell.d.ts +5 -0
- package/dist/esm/Examples/AppShell.d.ts.map +1 -0
- package/dist/esm/Examples/AppShell.js +10 -0
- package/dist/esm/Examples/AppShell.js.map +1 -0
- package/dist/esm/Examples/LocalizedCue.d.ts +5 -0
- package/dist/esm/Examples/LocalizedCue.d.ts.map +1 -0
- package/dist/esm/Examples/LocalizedCue.js +11 -0
- package/dist/esm/Examples/LocalizedCue.js.map +1 -0
- package/dist/esm/Examples/OrderDeskTour.d.ts +2 -0
- package/dist/esm/Examples/OrderDeskTour.d.ts.map +1 -0
- package/dist/esm/Examples/OrderDeskTour.js +33 -0
- package/dist/esm/Examples/OrderDeskTour.js.map +1 -0
- package/dist/esm/Examples/OwnStageGuard.d.ts +5 -0
- package/dist/esm/Examples/OwnStageGuard.d.ts.map +1 -0
- package/dist/esm/Examples/OwnStageGuard.js +17 -0
- package/dist/esm/Examples/OwnStageGuard.js.map +1 -0
- package/dist/esm/Examples/OwnVoice.d.ts +3 -0
- package/dist/esm/Examples/OwnVoice.d.ts.map +1 -0
- package/dist/esm/Examples/OwnVoice.js +35 -0
- package/dist/esm/Examples/OwnVoice.js.map +1 -0
- package/dist/esm/Icons.d.ts +19 -0
- package/dist/esm/Icons.d.ts.map +1 -0
- package/dist/esm/Icons.js +31 -0
- package/dist/esm/Icons.js.map +1 -0
- package/dist/esm/Labels/CueLabels.d.ts +18 -0
- package/dist/esm/Labels/CueLabels.d.ts.map +1 -0
- package/dist/esm/Labels/CueLabels.js +2 -0
- package/dist/esm/Labels/CueLabels.js.map +1 -0
- package/dist/esm/Labels/defaultCueLabels.d.ts +3 -0
- package/dist/esm/Labels/defaultCueLabels.d.ts.map +1 -0
- package/dist/esm/Labels/defaultCueLabels.js +22 -0
- package/dist/esm/Labels/defaultCueLabels.js.map +1 -0
- package/dist/esm/Labels/index.d.ts +4 -0
- package/dist/esm/Labels/index.d.ts.map +1 -0
- package/dist/esm/Labels/index.js +4 -0
- package/dist/esm/Labels/index.js.map +1 -0
- package/dist/esm/Labels/resolveLabels.d.ts +3 -0
- package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
- package/dist/esm/Labels/resolveLabels.js +15 -0
- package/dist/esm/Labels/resolveLabels.js.map +1 -0
- package/dist/esm/Markdown/CueMarkdown.d.ts +6 -0
- package/dist/esm/Markdown/CueMarkdown.d.ts.map +1 -0
- package/dist/esm/Markdown/CueMarkdown.js +32 -0
- package/dist/esm/Markdown/CueMarkdown.js.map +1 -0
- package/dist/esm/Markdown/index.d.ts +3 -0
- package/dist/esm/Markdown/index.d.ts.map +1 -0
- package/dist/esm/Markdown/index.js +3 -0
- package/dist/esm/Markdown/index.js.map +1 -0
- package/dist/esm/Markdown/safeUrl.d.ts +2 -0
- package/dist/esm/Markdown/safeUrl.d.ts.map +1 -0
- package/dist/esm/Markdown/safeUrl.js +32 -0
- package/dist/esm/Markdown/safeUrl.js.map +1 -0
- package/dist/esm/Speech/CueSpeech.d.ts +10 -0
- package/dist/esm/Speech/CueSpeech.d.ts.map +1 -0
- package/dist/esm/Speech/CueSpeech.js +2 -0
- package/dist/esm/Speech/CueSpeech.js.map +1 -0
- package/dist/esm/Speech/CueSpeechConfiguration.d.ts +6 -0
- package/dist/esm/Speech/CueSpeechConfiguration.d.ts.map +1 -0
- package/dist/esm/Speech/CueSpeechConfiguration.js +2 -0
- package/dist/esm/Speech/CueSpeechConfiguration.js.map +1 -0
- package/dist/esm/Speech/HttpSpeechOptions.d.ts +10 -0
- package/dist/esm/Speech/HttpSpeechOptions.d.ts.map +1 -0
- package/dist/esm/Speech/HttpSpeechOptions.js +2 -0
- package/dist/esm/Speech/HttpSpeechOptions.js.map +1 -0
- package/dist/esm/Speech/createHttpSpeech.d.ts +4 -0
- package/dist/esm/Speech/createHttpSpeech.d.ts.map +1 -0
- package/dist/esm/Speech/createHttpSpeech.js +138 -0
- package/dist/esm/Speech/createHttpSpeech.js.map +1 -0
- package/dist/esm/Speech/index.d.ts +5 -0
- package/dist/esm/Speech/index.d.ts.map +1 -0
- package/dist/esm/Speech/index.js +5 -0
- package/dist/esm/Speech/index.js.map +1 -0
- package/dist/esm/Speech/silentSpeech.d.ts +3 -0
- package/dist/esm/Speech/silentSpeech.d.ts.map +1 -0
- package/dist/esm/Speech/silentSpeech.js +14 -0
- package/dist/esm/Speech/silentSpeech.js.map +1 -0
- package/dist/esm/Speech/speechClips.d.ts +7 -0
- package/dist/esm/Speech/speechClips.d.ts.map +1 -0
- package/dist/esm/Speech/speechClips.js +58 -0
- package/dist/esm/Speech/speechClips.js.map +1 -0
- package/dist/esm/TourAnchor.d.ts +14 -0
- package/dist/esm/TourAnchor.d.ts.map +1 -0
- package/dist/esm/TourAnchor.js +148 -0
- package/dist/esm/TourAnchor.js.map +1 -0
- package/dist/esm/TourAnchorSpace.d.ts +2 -0
- package/dist/esm/TourAnchorSpace.d.ts.map +1 -0
- package/dist/esm/TourAnchorSpace.js +2 -0
- package/dist/esm/TourAnchorSpace.js.map +1 -0
- package/dist/esm/TourCallout.d.ts +8 -0
- package/dist/esm/TourCallout.d.ts.map +1 -0
- package/dist/esm/TourCallout.js +2 -0
- package/dist/esm/TourCallout.js.map +1 -0
- package/dist/esm/TourCalloutBubble.d.ts +9 -0
- package/dist/esm/TourCalloutBubble.d.ts.map +1 -0
- package/dist/esm/TourCalloutBubble.js +25 -0
- package/dist/esm/TourCalloutBubble.js.map +1 -0
- package/dist/esm/TourCamera.d.ts +6 -0
- package/dist/esm/TourCamera.d.ts.map +1 -0
- package/dist/esm/TourCamera.js +2 -0
- package/dist/esm/TourCamera.js.map +1 -0
- package/dist/esm/TourChapter.d.ts +8 -0
- package/dist/esm/TourChapter.d.ts.map +1 -0
- package/dist/esm/TourChapter.js +2 -0
- package/dist/esm/TourChapter.js.map +1 -0
- package/dist/esm/TourChapterList.d.ts +10 -0
- package/dist/esm/TourChapterList.d.ts.map +1 -0
- package/dist/esm/TourChapterList.js +66 -0
- package/dist/esm/TourChapterList.js.map +1 -0
- package/dist/esm/TourChapterList.stories.d.ts +21 -0
- package/dist/esm/TourChapterList.stories.d.ts.map +1 -0
- package/dist/esm/TourChapterList.stories.js +53 -0
- package/dist/esm/TourChapterList.stories.js.map +1 -0
- package/dist/esm/TourGesture.d.ts +12 -0
- package/dist/esm/TourGesture.d.ts.map +1 -0
- package/dist/esm/TourGesture.js +2 -0
- package/dist/esm/TourGesture.js.map +1 -0
- package/dist/esm/TourOverlayShell.d.ts +13 -0
- package/dist/esm/TourOverlayShell.d.ts.map +1 -0
- package/dist/esm/TourOverlayShell.js +75 -0
- package/dist/esm/TourOverlayShell.js.map +1 -0
- package/dist/esm/TourPointer.d.ts +9 -0
- package/dist/esm/TourPointer.d.ts.map +1 -0
- package/dist/esm/TourPointer.js +72 -0
- package/dist/esm/TourPointer.js.map +1 -0
- package/dist/esm/TourSection.d.ts +8 -0
- package/dist/esm/TourSection.d.ts.map +1 -0
- package/dist/esm/TourSection.js +2 -0
- package/dist/esm/TourSection.js.map +1 -0
- package/dist/esm/TourSelfPacedPanel.d.ts +6 -0
- package/dist/esm/TourSelfPacedPanel.d.ts.map +1 -0
- package/dist/esm/TourSelfPacedPanel.js +25 -0
- package/dist/esm/TourSelfPacedPanel.js.map +1 -0
- package/dist/esm/TourSelfPacedPanel.stories.d.ts +21 -0
- package/dist/esm/TourSelfPacedPanel.stories.d.ts.map +1 -0
- package/dist/esm/TourSelfPacedPanel.stories.js +41 -0
- package/dist/esm/TourSelfPacedPanel.stories.js.map +1 -0
- package/dist/esm/TourStep.d.ts +12 -0
- package/dist/esm/TourStep.d.ts.map +1 -0
- package/dist/esm/TourStep.js +2 -0
- package/dist/esm/TourStep.js.map +1 -0
- package/dist/esm/TourSubtitles.d.ts +5 -0
- package/dist/esm/TourSubtitles.d.ts.map +1 -0
- package/dist/esm/TourSubtitles.js +22 -0
- package/dist/esm/TourSubtitles.js.map +1 -0
- package/dist/esm/TourTimelineBar.d.ts +10 -0
- package/dist/esm/TourTimelineBar.d.ts.map +1 -0
- package/dist/esm/TourTimelineBar.js +132 -0
- package/dist/esm/TourTimelineBar.js.map +1 -0
- package/dist/esm/TourTimelineBar.stories.d.ts +24 -0
- package/dist/esm/TourTimelineBar.stories.d.ts.map +1 -0
- package/dist/esm/TourTimelineBar.stories.js +62 -0
- package/dist/esm/TourTimelineBar.stories.js.map +1 -0
- package/dist/esm/Tours/index.d.ts +3 -0
- package/dist/esm/Tours/index.d.ts.map +1 -0
- package/dist/esm/Tours/index.js +3 -0
- package/dist/esm/Tours/index.js.map +1 -0
- package/dist/esm/Tours/useCueTours.d.ts +7 -0
- package/dist/esm/Tours/useCueTours.d.ts.map +1 -0
- package/dist/esm/Tours/useCueTours.js +44 -0
- package/dist/esm/Tours/useCueTours.js.map +1 -0
- package/dist/esm/Tours/useTourNudge.d.ts +6 -0
- package/dist/esm/Tours/useTourNudge.d.ts.map +1 -0
- package/dist/esm/Tours/useTourNudge.js +26 -0
- package/dist/esm/Tours/useTourNudge.js.map +1 -0
- package/dist/esm/cursorSvg.d.ts +2 -0
- package/dist/esm/cursorSvg.d.ts.map +1 -0
- package/dist/esm/cursorSvg.js +13 -0
- package/dist/esm/cursorSvg.js.map +1 -0
- package/dist/esm/index.d.ts +41 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +24 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/tourClock.d.ts +19 -0
- package/dist/esm/tourClock.d.ts.map +1 -0
- package/dist/esm/tourClock.js +103 -0
- package/dist/esm/tourClock.js.map +1 -0
- package/dist/esm/tourGeometry.d.ts +18 -0
- package/dist/esm/tourGeometry.d.ts.map +1 -0
- package/dist/esm/tourGeometry.js +80 -0
- package/dist/esm/tourGeometry.js.map +1 -0
- package/dist/esm/tourSelfPaced.d.ts +12 -0
- package/dist/esm/tourSelfPaced.d.ts.map +1 -0
- package/dist/esm/tourSelfPaced.js +64 -0
- package/dist/esm/tourSelfPaced.js.map +1 -0
- package/dist/esm/tourTimeline.d.ts +40 -0
- package/dist/esm/tourTimeline.d.ts.map +1 -0
- package/dist/esm/tourTimeline.js +154 -0
- package/dist/esm/tourTimeline.js.map +1 -0
- package/dist/esm/useTourPlayback.d.ts +25 -0
- package/dist/esm/useTourPlayback.d.ts.map +1 -0
- package/dist/esm/useTourPlayback.js +243 -0
- package/dist/esm/useTourPlayback.js.map +1 -0
- package/index.ts +68 -0
- package/package.json +93 -4
- package/styles.css +485 -0
- package/tourClock.ts +125 -0
- package/tourGeometry.ts +95 -0
- package/tourSelfPaced.ts +93 -0
- package/tourTimeline.ts +237 -0
- package/useTourPlayback.ts +291 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { useMemo, useState, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import { useCueConfiguration } from './Configuration/CueProvider.js';
|
|
3
|
+
import { advanceTourClock } from './tourClock.js';
|
|
4
|
+
import { buildTourTimeline, stepIndexAtTime, chapterIndexAtTime, sectionIndexAtTime, narrationsAfter, chapterStartMs, previousChapterTargetMs, nextChapterTargetMs } from './tourTimeline.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
// How many steps ahead of the one being said the voice-over is requested, so each line starts the moment its step does.
|
|
9
|
+
const NARRATION_LOOKAHEAD_STEPS = 2;
|
|
10
|
+
/** How often the clock advances. Fine enough for a progress bar, coarse enough not to re-render at frame rate. */ const TICK_MS = 100;
|
|
11
|
+
/**
|
|
12
|
+
* Runs the guided tour: advances one clock, and keeps the voice-over pointed at whatever the clock says is
|
|
13
|
+
* being narrated.
|
|
14
|
+
* @param sections The scripted sections to play.
|
|
15
|
+
* @returns The {@link TourPlayback} controls and state.
|
|
16
|
+
* @remarks
|
|
17
|
+
* The clock is the single source of truth — subtitles, progress, chapter highlighting and how much of the
|
|
18
|
+
* tour's stage is showing are all read from it, so seeking anywhere is consistent by construction. Pacing
|
|
19
|
+
* follows the schedule, with two adjustments at the boundaries where the schedule and the voice disagree
|
|
20
|
+
* (see {@link advanceTourClock}): a line finishing ahead of its step's estimate skips the leftover dead air,
|
|
21
|
+
* and a line still being said as the estimate runs out holds the clock at the step's end until it finishes —
|
|
22
|
+
* bounded, so a voice that never finishes cannot stall the whole tour. Whatever is playing is always
|
|
23
|
+
* silenced the moment the step it belongs to is left, whichever direction that happens in.
|
|
24
|
+
*/ function useTourPlayback(sections) {
|
|
25
|
+
const timeline = useMemo(()=>buildTourTimeline(sections), [
|
|
26
|
+
sections
|
|
27
|
+
]);
|
|
28
|
+
const [timeMs, setTimeState] = useState(0);
|
|
29
|
+
// The clock's position, readable by the ticker without going through a state updater: an updater must not have
|
|
30
|
+
// side effects, and the tick has one - it ends playback when the tour reaches its end.
|
|
31
|
+
const timeMsRef = useRef(0);
|
|
32
|
+
const setTimeMs = useCallback((next)=>{
|
|
33
|
+
timeMsRef.current = typeof next === 'function' ? next(timeMsRef.current) : next;
|
|
34
|
+
setTimeState(timeMsRef.current);
|
|
35
|
+
}, []);
|
|
36
|
+
const [isPlaying, setIsPlaying] = useState(true);
|
|
37
|
+
const [isAudioEnabled, setIsAudioEnabled] = useState(true);
|
|
38
|
+
const [areSubtitlesEnabled, setAreSubtitlesEnabled] = useState(true);
|
|
39
|
+
const [hasNarrationFailed, setHasNarrationFailed] = useState(false);
|
|
40
|
+
const { useSpeech } = useCueConfiguration();
|
|
41
|
+
const { isAvailable: isSpeechAvailable, isPreparing, isSpeaking, hasError: hasSpeechError, speak, prefetch, stop } = useSpeech();
|
|
42
|
+
const stepIndex = stepIndexAtTime(timeline, timeMs);
|
|
43
|
+
const step = stepIndex >= 0 ? timeline.steps[stepIndex].step : undefined;
|
|
44
|
+
const chapterIndex = chapterIndexAtTime(timeline, timeMs);
|
|
45
|
+
const sectionIndex = sectionIndexAtTime(timeline, timeMs);
|
|
46
|
+
// Which step the voice has already been given. Reset to nothing whenever playback jumps or is silenced,
|
|
47
|
+
// so resuming or seeking back always speaks the line again rather than sitting through it in silence.
|
|
48
|
+
const narratedStepRef = useRef(-1);
|
|
49
|
+
// The narration currently being watched for completion: set when a line is handed to the voice, marked
|
|
50
|
+
// started once audio is actually being prepared or spoken, and cleared once it is known to have ended.
|
|
51
|
+
// Refs rather than state — nothing here needs to trigger its own render.
|
|
52
|
+
const pendingNarrationRef = useRef(null);
|
|
53
|
+
const narrationFinishedRef = useRef(null);
|
|
54
|
+
const narrationHoldRef = useRef(null);
|
|
55
|
+
useEffect(()=>{
|
|
56
|
+
if (!isPlaying) return;
|
|
57
|
+
let previous = performance.now();
|
|
58
|
+
const ticker = setInterval(()=>{
|
|
59
|
+
const now = performance.now();
|
|
60
|
+
const elapsed = now - previous;
|
|
61
|
+
previous = now;
|
|
62
|
+
const advance = advanceTourClock(timeline, timeMsRef.current, elapsed, now, {
|
|
63
|
+
pendingStepIndex: pendingNarrationRef.current?.stepIndex ?? null,
|
|
64
|
+
finished: narrationFinishedRef.current,
|
|
65
|
+
holdStartedAt: narrationHoldRef.current
|
|
66
|
+
});
|
|
67
|
+
narrationHoldRef.current = advance.holdStartedAt;
|
|
68
|
+
if (advance.finishedConsumed) {
|
|
69
|
+
narrationFinishedRef.current = null;
|
|
70
|
+
}
|
|
71
|
+
setTimeMs(advance.timeMs);
|
|
72
|
+
if (!advance.isPlaying) {
|
|
73
|
+
setIsPlaying(false);
|
|
74
|
+
}
|
|
75
|
+
}, TICK_MS);
|
|
76
|
+
return ()=>clearInterval(ticker);
|
|
77
|
+
}, [
|
|
78
|
+
isPlaying,
|
|
79
|
+
timeline,
|
|
80
|
+
setTimeMs
|
|
81
|
+
]);
|
|
82
|
+
useEffect(()=>{
|
|
83
|
+
if (!isPlaying || !isAudioEnabled || !isSpeechAvailable) {
|
|
84
|
+
narratedStepRef.current = -1;
|
|
85
|
+
pendingNarrationRef.current = null;
|
|
86
|
+
narrationFinishedRef.current = null;
|
|
87
|
+
narrationHoldRef.current = null;
|
|
88
|
+
stop();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (narratedStepRef.current === stepIndex) return;
|
|
92
|
+
narratedStepRef.current = stepIndex;
|
|
93
|
+
narrationFinishedRef.current = null;
|
|
94
|
+
const narration = stepIndex >= 0 ? timeline.steps[stepIndex].step.narration : '';
|
|
95
|
+
if (narration.length > 0) {
|
|
96
|
+
pendingNarrationRef.current = {
|
|
97
|
+
stepIndex,
|
|
98
|
+
started: false
|
|
99
|
+
};
|
|
100
|
+
// speak() tears down whatever the voice was still saying for the step just left, before
|
|
101
|
+
// starting this step's line — leaving a step always silences it, never lets it bleed forward.
|
|
102
|
+
void speak(narration);
|
|
103
|
+
} else {
|
|
104
|
+
// A silent, camera-only step — nothing to say, but anything still playing from the step before
|
|
105
|
+
// it must be cut off rather than left to talk over a scene it no longer belongs to.
|
|
106
|
+
pendingNarrationRef.current = null;
|
|
107
|
+
stop();
|
|
108
|
+
}
|
|
109
|
+
}, [
|
|
110
|
+
isPlaying,
|
|
111
|
+
isAudioEnabled,
|
|
112
|
+
isSpeechAvailable,
|
|
113
|
+
stepIndex,
|
|
114
|
+
timeline,
|
|
115
|
+
speak,
|
|
116
|
+
stop
|
|
117
|
+
]);
|
|
118
|
+
// Asks the voice for the lines still to come while the current one is being said, so each starts the moment its
|
|
119
|
+
// step does instead of waiting for the speech service. The current line goes first: nothing is requested until it
|
|
120
|
+
// is audible, so the lookahead never competes with the line the viewer is waiting for.
|
|
121
|
+
useEffect(()=>{
|
|
122
|
+
if (!isPlaying || !isAudioEnabled || !isSpeechAvailable || stepIndex < 0) return;
|
|
123
|
+
// The line being waited for has been handed to the voice but is not audible yet: ask for nothing else.
|
|
124
|
+
const pending = pendingNarrationRef.current;
|
|
125
|
+
if (pending && (!pending.started || isPreparing)) return;
|
|
126
|
+
for (const narration of narrationsAfter(timeline, stepIndex, NARRATION_LOOKAHEAD_STEPS))prefetch(narration);
|
|
127
|
+
}, [
|
|
128
|
+
isPlaying,
|
|
129
|
+
isAudioEnabled,
|
|
130
|
+
isSpeechAvailable,
|
|
131
|
+
isPreparing,
|
|
132
|
+
stepIndex,
|
|
133
|
+
timeline,
|
|
134
|
+
prefetch
|
|
135
|
+
]);
|
|
136
|
+
// Watches the voice to notice when the pending line has finished. "Finished" is a transition — the line
|
|
137
|
+
// must have been heard preparing or speaking before silence counts as its end, otherwise the quiet moment
|
|
138
|
+
// between asking for a clip and the first audio arriving would be mistaken for completion.
|
|
139
|
+
useEffect(()=>{
|
|
140
|
+
const pending = pendingNarrationRef.current;
|
|
141
|
+
if (!pending) return;
|
|
142
|
+
if (isPreparing || isSpeaking) {
|
|
143
|
+
pending.started = true;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (pending.started) {
|
|
147
|
+
pendingNarrationRef.current = null;
|
|
148
|
+
narrationFinishedRef.current = {
|
|
149
|
+
stepIndex: pending.stepIndex,
|
|
150
|
+
finishedAt: performance.now()
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}, [
|
|
154
|
+
isPreparing,
|
|
155
|
+
isSpeaking
|
|
156
|
+
]);
|
|
157
|
+
// A failing voice-over must not make the tour silently silent: switch the audio toggle off so the
|
|
158
|
+
// transport shows what happened, and make sure subtitles are on so the words still reach the viewer.
|
|
159
|
+
// The clock keeps running throughout — narration failing never stalls the tour.
|
|
160
|
+
useEffect(()=>{
|
|
161
|
+
if (!hasSpeechError || !isAudioEnabled) return;
|
|
162
|
+
setHasNarrationFailed(true);
|
|
163
|
+
setIsAudioEnabled(false);
|
|
164
|
+
setAreSubtitlesEnabled(true);
|
|
165
|
+
}, [
|
|
166
|
+
hasSpeechError,
|
|
167
|
+
isAudioEnabled
|
|
168
|
+
]);
|
|
169
|
+
const seekTo = useCallback((target)=>{
|
|
170
|
+
narratedStepRef.current = -1;
|
|
171
|
+
pendingNarrationRef.current = null;
|
|
172
|
+
narrationFinishedRef.current = null;
|
|
173
|
+
narrationHoldRef.current = null;
|
|
174
|
+
setTimeMs(Math.min(Math.max(0, target), timeline.durationMs));
|
|
175
|
+
}, [
|
|
176
|
+
timeline.durationMs,
|
|
177
|
+
setTimeMs
|
|
178
|
+
]);
|
|
179
|
+
const isPlayingRef = useRef(isPlaying);
|
|
180
|
+
isPlayingRef.current = isPlaying;
|
|
181
|
+
const togglePlay = useCallback(()=>{
|
|
182
|
+
// Pressing play at the very end starts over rather than doing nothing, which is what a finished
|
|
183
|
+
// video does and what someone reaching for the button after it ends is asking for.
|
|
184
|
+
if (!isPlayingRef.current) {
|
|
185
|
+
if (timeMsRef.current >= timeline.durationMs) setTimeMs(0);
|
|
186
|
+
narratedStepRef.current = -1;
|
|
187
|
+
}
|
|
188
|
+
setIsPlaying(!isPlayingRef.current);
|
|
189
|
+
}, [
|
|
190
|
+
timeline.durationMs,
|
|
191
|
+
setTimeMs
|
|
192
|
+
]);
|
|
193
|
+
const pause = useCallback(()=>setIsPlaying(false), []);
|
|
194
|
+
const goToChapter = useCallback((target)=>seekTo(chapterStartMs(timeline, target)), [
|
|
195
|
+
seekTo,
|
|
196
|
+
timeline
|
|
197
|
+
]);
|
|
198
|
+
const goToPreviousChapter = useCallback(()=>seekTo(previousChapterTargetMs(timeline, timeMs)), [
|
|
199
|
+
seekTo,
|
|
200
|
+
timeline,
|
|
201
|
+
timeMs
|
|
202
|
+
]);
|
|
203
|
+
const goToNextChapter = useCallback(()=>seekTo(nextChapterTargetMs(timeline, timeMs)), [
|
|
204
|
+
seekTo,
|
|
205
|
+
timeline,
|
|
206
|
+
timeMs
|
|
207
|
+
]);
|
|
208
|
+
// Turning the voice-over back on is also how a failed narration is retried, so the failure flag clears
|
|
209
|
+
// and the current line is spoken afresh.
|
|
210
|
+
const isAudioEnabledRef = useRef(isAudioEnabled);
|
|
211
|
+
isAudioEnabledRef.current = isAudioEnabled;
|
|
212
|
+
const toggleAudio = useCallback(()=>{
|
|
213
|
+
if (!isAudioEnabledRef.current) {
|
|
214
|
+
setHasNarrationFailed(false);
|
|
215
|
+
narratedStepRef.current = -1;
|
|
216
|
+
}
|
|
217
|
+
setIsAudioEnabled(!isAudioEnabledRef.current);
|
|
218
|
+
}, []);
|
|
219
|
+
const toggleSubtitles = useCallback(()=>setAreSubtitlesEnabled((current)=>!current), []);
|
|
220
|
+
return {
|
|
221
|
+
timeline,
|
|
222
|
+
timeMs,
|
|
223
|
+
isPlaying,
|
|
224
|
+
isAudioEnabled,
|
|
225
|
+
areSubtitlesEnabled,
|
|
226
|
+
isSpeechAvailable,
|
|
227
|
+
hasNarrationFailed,
|
|
228
|
+
step,
|
|
229
|
+
chapterIndex,
|
|
230
|
+
sectionIndex,
|
|
231
|
+
togglePlay,
|
|
232
|
+
pause,
|
|
233
|
+
seekTo,
|
|
234
|
+
goToChapter,
|
|
235
|
+
goToPreviousChapter,
|
|
236
|
+
goToNextChapter,
|
|
237
|
+
toggleAudio,
|
|
238
|
+
toggleSubtitles
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export { useTourPlayback };
|
|
243
|
+
//# sourceMappingURL=useTourPlayback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTourPlayback.js","sources":["../../useTourPlayback.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useCueConfiguration } from './Configuration/CueProvider.js';\nimport type { TourSection } from './TourSection.js';\nimport type { TourStep } from './TourStep.js';\nimport { advanceTourClock } from './tourClock.js';\nimport {\n type TourTimeline,\n buildTourTimeline,\n chapterIndexAtTime,\n chapterStartMs,\n narrationsAfter,\n nextChapterTargetMs,\n previousChapterTargetMs,\n sectionIndexAtTime,\n stepIndexAtTime,\n} from './tourTimeline.js';\n\n// How many steps ahead of the one being said the voice-over is requested, so each line starts the moment its step does.\nconst NARRATION_LOOKAHEAD_STEPS = 2;\n\n/** How often the clock advances. Fine enough for a progress bar, coarse enough not to re-render at frame rate. */\nconst TICK_MS = 100;\n\n/** Everything the tour's chrome needs to draw itself and drive playback. */\nexport interface TourPlayback<TStep extends TourStep = TourStep> {\n /** The whole tour laid out on one clock. */\n timeline: TourTimeline<TStep>;\n\n /** Where playback has got to, in milliseconds. */\n timeMs: number;\n\n /** Whether the tour is running. */\n isPlaying: boolean;\n\n /** Whether the voice-over is switched on. */\n isAudioEnabled: boolean;\n\n /** Whether subtitles are switched on. */\n areSubtitlesEnabled: boolean;\n\n /** Whether a voice-over service is available at all. */\n isSpeechAvailable: boolean;\n\n /** Whether the voice-over has failed and the tour is carrying on with subtitles instead. */\n hasNarrationFailed: boolean;\n\n /** The step being played, or undefined when the script is empty. */\n step: TStep | undefined;\n\n /** The chapter being played. */\n chapterIndex: number;\n\n /** The section the playing chapter belongs to. */\n sectionIndex: number;\n\n /** Starts or stops playback. */\n togglePlay(): void;\n\n /** Stops playback where it is, whatever state it was in — what switching to self-paced reading uses. */\n pause(): void;\n\n /** Moves playback to a point on the clock. */\n seekTo(timeMs: number): void;\n\n /** Moves playback to the start of a chapter. */\n goToChapter(chapterIndex: number): void;\n\n /** Restarts the current chapter, or goes back one when barely into it. */\n goToPreviousChapter(): void;\n\n /** Skips to the next chapter. */\n goToNextChapter(): void;\n\n /** Switches the voice-over on or off. */\n toggleAudio(): void;\n\n /** Switches subtitles on or off. */\n toggleSubtitles(): void;\n}\n\n/**\n * Runs the guided tour: advances one clock, and keeps the voice-over pointed at whatever the clock says is\n * being narrated.\n * @param sections The scripted sections to play.\n * @returns The {@link TourPlayback} controls and state.\n * @remarks\n * The clock is the single source of truth — subtitles, progress, chapter highlighting and how much of the\n * tour's stage is showing are all read from it, so seeking anywhere is consistent by construction. Pacing\n * follows the schedule, with two adjustments at the boundaries where the schedule and the voice disagree\n * (see {@link advanceTourClock}): a line finishing ahead of its step's estimate skips the leftover dead air,\n * and a line still being said as the estimate runs out holds the clock at the step's end until it finishes —\n * bounded, so a voice that never finishes cannot stall the whole tour. Whatever is playing is always\n * silenced the moment the step it belongs to is left, whichever direction that happens in.\n */\nexport function useTourPlayback<TStep extends TourStep>(sections: TourSection<TStep>[]): TourPlayback<TStep> {\n const timeline = useMemo(() => buildTourTimeline(sections), [sections]);\n const [timeMs, setTimeState] = useState(0);\n // The clock's position, readable by the ticker without going through a state updater: an updater must not have\n // side effects, and the tick has one - it ends playback when the tour reaches its end.\n const timeMsRef = useRef(0);\n const setTimeMs = useCallback((next: number | ((current: number) => number)) => {\n timeMsRef.current = typeof next === 'function' ? next(timeMsRef.current) : next;\n setTimeState(timeMsRef.current);\n }, []);\n const [isPlaying, setIsPlaying] = useState(true);\n const [isAudioEnabled, setIsAudioEnabled] = useState(true);\n const [areSubtitlesEnabled, setAreSubtitlesEnabled] = useState(true);\n const [hasNarrationFailed, setHasNarrationFailed] = useState(false);\n const { useSpeech } = useCueConfiguration();\n const { isAvailable: isSpeechAvailable, isPreparing, isSpeaking, hasError: hasSpeechError, speak, prefetch, stop } = useSpeech();\n\n const stepIndex = stepIndexAtTime(timeline, timeMs);\n const step = stepIndex >= 0 ? timeline.steps[stepIndex].step : undefined;\n const chapterIndex = chapterIndexAtTime(timeline, timeMs);\n const sectionIndex = sectionIndexAtTime(timeline, timeMs);\n\n // Which step the voice has already been given. Reset to nothing whenever playback jumps or is silenced,\n // so resuming or seeking back always speaks the line again rather than sitting through it in silence.\n const narratedStepRef = useRef(-1);\n\n // The narration currently being watched for completion: set when a line is handed to the voice, marked\n // started once audio is actually being prepared or spoken, and cleared once it is known to have ended.\n // Refs rather than state — nothing here needs to trigger its own render.\n const pendingNarrationRef = useRef<{ stepIndex: number; started: boolean } | null>(null);\n const narrationFinishedRef = useRef<{ stepIndex: number; finishedAt: number } | null>(null);\n const narrationHoldRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (!isPlaying) return;\n\n let previous = performance.now();\n const ticker = setInterval(() => {\n const now = performance.now();\n const elapsed = now - previous;\n previous = now;\n const advance = advanceTourClock(timeline, timeMsRef.current, elapsed, now, {\n pendingStepIndex: pendingNarrationRef.current?.stepIndex ?? null,\n finished: narrationFinishedRef.current,\n holdStartedAt: narrationHoldRef.current,\n });\n narrationHoldRef.current = advance.holdStartedAt;\n if (advance.finishedConsumed) {\n narrationFinishedRef.current = null;\n }\n\n setTimeMs(advance.timeMs);\n if (!advance.isPlaying) {\n setIsPlaying(false);\n }\n }, TICK_MS);\n\n return () => clearInterval(ticker);\n }, [isPlaying, timeline, setTimeMs]);\n\n useEffect(() => {\n if (!isPlaying || !isAudioEnabled || !isSpeechAvailable) {\n narratedStepRef.current = -1;\n pendingNarrationRef.current = null;\n narrationFinishedRef.current = null;\n narrationHoldRef.current = null;\n stop();\n return;\n }\n\n if (narratedStepRef.current === stepIndex) return;\n narratedStepRef.current = stepIndex;\n\n narrationFinishedRef.current = null;\n const narration = stepIndex >= 0 ? timeline.steps[stepIndex].step.narration : '';\n if (narration.length > 0) {\n pendingNarrationRef.current = { stepIndex, started: false };\n\n // speak() tears down whatever the voice was still saying for the step just left, before\n // starting this step's line — leaving a step always silences it, never lets it bleed forward.\n void speak(narration);\n } else {\n // A silent, camera-only step — nothing to say, but anything still playing from the step before\n // it must be cut off rather than left to talk over a scene it no longer belongs to.\n pendingNarrationRef.current = null;\n stop();\n }\n }, [isPlaying, isAudioEnabled, isSpeechAvailable, stepIndex, timeline, speak, stop]);\n\n // Asks the voice for the lines still to come while the current one is being said, so each starts the moment its\n // step does instead of waiting for the speech service. The current line goes first: nothing is requested until it\n // is audible, so the lookahead never competes with the line the viewer is waiting for.\n useEffect(() => {\n if (!isPlaying || !isAudioEnabled || !isSpeechAvailable || stepIndex < 0) return;\n\n // The line being waited for has been handed to the voice but is not audible yet: ask for nothing else.\n const pending = pendingNarrationRef.current;\n if (pending && (!pending.started || isPreparing)) return;\n\n for (const narration of narrationsAfter(timeline, stepIndex, NARRATION_LOOKAHEAD_STEPS)) prefetch(narration);\n }, [isPlaying, isAudioEnabled, isSpeechAvailable, isPreparing, stepIndex, timeline, prefetch]);\n\n // Watches the voice to notice when the pending line has finished. \"Finished\" is a transition — the line\n // must have been heard preparing or speaking before silence counts as its end, otherwise the quiet moment\n // between asking for a clip and the first audio arriving would be mistaken for completion.\n useEffect(() => {\n const pending = pendingNarrationRef.current;\n if (!pending) return;\n\n if (isPreparing || isSpeaking) {\n pending.started = true;\n return;\n }\n\n if (pending.started) {\n pendingNarrationRef.current = null;\n narrationFinishedRef.current = { stepIndex: pending.stepIndex, finishedAt: performance.now() };\n }\n }, [isPreparing, isSpeaking]);\n\n // A failing voice-over must not make the tour silently silent: switch the audio toggle off so the\n // transport shows what happened, and make sure subtitles are on so the words still reach the viewer.\n // The clock keeps running throughout — narration failing never stalls the tour.\n useEffect(() => {\n if (!hasSpeechError || !isAudioEnabled) return;\n\n setHasNarrationFailed(true);\n setIsAudioEnabled(false);\n setAreSubtitlesEnabled(true);\n }, [hasSpeechError, isAudioEnabled]);\n\n const seekTo = useCallback((target: number) => {\n narratedStepRef.current = -1;\n pendingNarrationRef.current = null;\n narrationFinishedRef.current = null;\n narrationHoldRef.current = null;\n setTimeMs(Math.min(Math.max(0, target), timeline.durationMs));\n }, [timeline.durationMs, setTimeMs]);\n\n const isPlayingRef = useRef(isPlaying);\n isPlayingRef.current = isPlaying;\n const togglePlay = useCallback(() => {\n // Pressing play at the very end starts over rather than doing nothing, which is what a finished\n // video does and what someone reaching for the button after it ends is asking for.\n if (!isPlayingRef.current) {\n if (timeMsRef.current >= timeline.durationMs) setTimeMs(0);\n narratedStepRef.current = -1;\n }\n\n setIsPlaying(!isPlayingRef.current);\n }, [timeline.durationMs, setTimeMs]);\n\n const pause = useCallback(() => setIsPlaying(false), []);\n\n const goToChapter = useCallback((target: number) => seekTo(chapterStartMs(timeline, target)), [seekTo, timeline]);\n const goToPreviousChapter = useCallback(() => seekTo(previousChapterTargetMs(timeline, timeMs)), [seekTo, timeline, timeMs]);\n const goToNextChapter = useCallback(() => seekTo(nextChapterTargetMs(timeline, timeMs)), [seekTo, timeline, timeMs]);\n\n // Turning the voice-over back on is also how a failed narration is retried, so the failure flag clears\n // and the current line is spoken afresh.\n const isAudioEnabledRef = useRef(isAudioEnabled);\n isAudioEnabledRef.current = isAudioEnabled;\n const toggleAudio = useCallback(() => {\n if (!isAudioEnabledRef.current) {\n setHasNarrationFailed(false);\n narratedStepRef.current = -1;\n }\n\n setIsAudioEnabled(!isAudioEnabledRef.current);\n }, []);\n\n const toggleSubtitles = useCallback(() => setAreSubtitlesEnabled(current => !current), []);\n\n return {\n timeline,\n timeMs,\n isPlaying,\n isAudioEnabled,\n areSubtitlesEnabled,\n isSpeechAvailable,\n hasNarrationFailed,\n step,\n chapterIndex,\n sectionIndex,\n togglePlay,\n pause,\n seekTo,\n goToChapter,\n goToPreviousChapter,\n goToNextChapter,\n toggleAudio,\n toggleSubtitles,\n };\n}\n"],"names":["NARRATION_LOOKAHEAD_STEPS","TICK_MS","useTourPlayback","sections","timeline","useMemo","buildTourTimeline","timeMs","setTimeState","useState","timeMsRef","useRef","setTimeMs","useCallback","next","current","isPlaying","setIsPlaying","isAudioEnabled","setIsAudioEnabled","areSubtitlesEnabled","setAreSubtitlesEnabled","hasNarrationFailed","setHasNarrationFailed","useSpeech","useCueConfiguration","isAvailable","isSpeechAvailable","isPreparing","isSpeaking","hasError","hasSpeechError","speak","prefetch","stop","stepIndex","stepIndexAtTime","step","steps","undefined","chapterIndex","chapterIndexAtTime","sectionIndex","sectionIndexAtTime","narratedStepRef","pendingNarrationRef","narrationFinishedRef","narrationHoldRef","useEffect","previous","performance","now","ticker","setInterval","elapsed","advance","advanceTourClock","pendingStepIndex","finished","holdStartedAt","finishedConsumed","clearInterval","narration","length","started","pending","narrationsAfter","finishedAt","seekTo","target","Math","min","max","durationMs","isPlayingRef","togglePlay","pause","goToChapter","chapterStartMs","goToPreviousChapter","previousChapterTargetMs","goToNextChapter","nextChapterTargetMs","isAudioEnabledRef","toggleAudio","toggleSubtitles"],"mappings":";;;;;AAAA;AACA;AAmBA;AACA,MAAMA,yBAAAA,GAA4B,CAAA;AAElC,mHACA,MAAMC,OAAAA,GAAU,GAAA;AA2DhB;;;;;;;;;;;;;IAcO,SAASC,eAAAA,CAAwCC,QAA8B,EAAA;AAClF,IAAA,MAAMC,QAAAA,G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A,OAAAA,GAAW,CAACA,UAAU,EAAE,CAAA;IAEzF,OAAO;AACHX,QAAAA,QAAAA;AACAG,QAAAA,MAAAA;AACAS,QAAAA,SAAAA;AACAE,QAAAA,cAAAA;AACAE,QAAAA,mBAAAA;AACAO,QAAAA,iBAAAA;AACAL,QAAAA,kBAAAA;AACAe,QAAAA,IAAAA;AACAG,QAAAA,YAAAA;AACAE,QAAAA,YAAAA;AACAiC,QAAAA,UAAAA;AACAC,QAAAA,KAAAA;AACAR,QAAAA,MAAAA;AACAS,QAAAA,WAAAA;AACAE,QAAAA,mBAAAA;AACAE,QAAAA,eAAAA;AACAG,QAAAA,WAAAA;AACAC,QAAAA;AACJ,KAAA;AACJ;;"}
|
package/index.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
export type { TourAnchorSpace } from './TourAnchorSpace.js';
|
|
5
|
+
export type { TourCallout } from './TourCallout.js';
|
|
6
|
+
export type { TourCamera } from './TourCamera.js';
|
|
7
|
+
export type { TourChapter } from './TourChapter.js';
|
|
8
|
+
export type { TourGesture } from './TourGesture.js';
|
|
9
|
+
export type { TourSection } from './TourSection.js';
|
|
10
|
+
export type { TourStep } from './TourStep.js';
|
|
11
|
+
|
|
12
|
+
export { TourAnchor } from './TourAnchor.js';
|
|
13
|
+
export type { TourAnchorProps } from './TourAnchor.js';
|
|
14
|
+
export { TourCalloutBubble } from './TourCalloutBubble.js';
|
|
15
|
+
export type { TourCalloutBubbleProps } from './TourCalloutBubble.js';
|
|
16
|
+
export { TourChapterList } from './TourChapterList.js';
|
|
17
|
+
export type { TourChapterListProps } from './TourChapterList.js';
|
|
18
|
+
export { TourOverlayShell } from './TourOverlayShell.js';
|
|
19
|
+
export type { TourOverlayShellProps } from './TourOverlayShell.js';
|
|
20
|
+
export { TourPointer } from './TourPointer.js';
|
|
21
|
+
export type { TourPointerProps } from './TourPointer.js';
|
|
22
|
+
export { TourSelfPacedPanel } from './TourSelfPacedPanel.js';
|
|
23
|
+
export type { TourSelfPacedPanelProps } from './TourSelfPacedPanel.js';
|
|
24
|
+
export { TourSubtitles } from './TourSubtitles.js';
|
|
25
|
+
export type { TourSubtitlesProps } from './TourSubtitles.js';
|
|
26
|
+
export { TourTimelineBar } from './TourTimelineBar.js';
|
|
27
|
+
export type { TourTimelineBarProps } from './TourTimelineBar.js';
|
|
28
|
+
|
|
29
|
+
export { useTourPlayback } from './useTourPlayback.js';
|
|
30
|
+
export type { TourPlayback } from './useTourPlayback.js';
|
|
31
|
+
|
|
32
|
+
export { NARRATION_ADVANCE_BEAT_MS, NARRATION_HOLD_LIMIT_MS, advanceTourClock } from './tourClock.js';
|
|
33
|
+
export type { TourClockAdvance, TourClockNarration } from './tourClock.js';
|
|
34
|
+
|
|
35
|
+
export { hasSelfPacedContent, resolveTourMedia, selfPacedMarkdownFor, selfPacedViewFor } from './tourSelfPaced.js';
|
|
36
|
+
export type { TourSelfPacedContent, TourSelfPacedView } from './tourSelfPaced.js';
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
RESTART_CHAPTER_WINDOW_MS,
|
|
40
|
+
buildTourTimeline,
|
|
41
|
+
chapterIndexAtTime,
|
|
42
|
+
chapterStartMs,
|
|
43
|
+
formatTourTime,
|
|
44
|
+
narrationDurationMs,
|
|
45
|
+
nextChapterTargetMs,
|
|
46
|
+
previousChapterTargetMs,
|
|
47
|
+
sectionIndexAtTime,
|
|
48
|
+
stepDurationMs,
|
|
49
|
+
stepIndexAtTime,
|
|
50
|
+
} from './tourTimeline.js';
|
|
51
|
+
export type { TimedTourChapter, TimedTourSection, TimedTourStep, TourTimeline } from './tourTimeline.js';
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
CHROME_INSETS,
|
|
55
|
+
projectEditorPointToScreen,
|
|
56
|
+
projectToScreen,
|
|
57
|
+
projectToolbarPointToScreen,
|
|
58
|
+
unobstructedCenter,
|
|
59
|
+
} from './tourGeometry.js';
|
|
60
|
+
export type { BoardTransform, ScreenPoint } from './tourGeometry.js';
|
|
61
|
+
|
|
62
|
+
export * from './Configuration/index.js';
|
|
63
|
+
export * from './Labels/index.js';
|
|
64
|
+
export * from './Markdown/index.js';
|
|
65
|
+
export * from './Speech/index.js';
|
|
66
|
+
export * from './Tours/index.js';
|
|
67
|
+
export { CueIcon } from './Icons.js';
|
|
68
|
+
export type { CueIconName, CueIconProps } from './Icons.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,95 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"type": "module",
|
|
3
|
+
"name": "@cratis/showrunner.cue.react",
|
|
4
|
+
"version": "2.10.1",
|
|
5
|
+
"description": "The Cue guided-tour engine for React — a scripted, narrated, video-style walkthrough with an optional written chapter for each step, a pluggable text-to-speech voice-over, and the record of which tours a person has started, built on Cratis Arc and Cratis Components.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"cratis",
|
|
8
|
+
"showrunner",
|
|
9
|
+
"cue",
|
|
10
|
+
"guided-tour",
|
|
11
|
+
"onboarding",
|
|
12
|
+
"tour",
|
|
13
|
+
"text-to-speech",
|
|
14
|
+
"arc",
|
|
15
|
+
"react",
|
|
16
|
+
"components"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://github.com/Cratis/Showrunner",
|
|
19
|
+
"author": "Cratis",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/Cratis/Showrunner.git"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"styles.css",
|
|
31
|
+
"**/*.ts",
|
|
32
|
+
"**/*.tsx",
|
|
33
|
+
"!**/for_*/**",
|
|
34
|
+
"!**/given/**",
|
|
35
|
+
"!Examples/**",
|
|
36
|
+
"!**/*.stories.tsx",
|
|
37
|
+
"!**/*.tsbuildinfo"
|
|
38
|
+
],
|
|
39
|
+
"main": "dist/cjs/index.js",
|
|
40
|
+
"module": "dist/esm/index.js",
|
|
41
|
+
"types": "dist/esm/index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
"./package.json": "./package.json",
|
|
44
|
+
".": {
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/esm/index.d.ts",
|
|
47
|
+
"default": "./dist/esm/index.js"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/cjs/index.d.ts",
|
|
51
|
+
"default": "./dist/cjs/index.js"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./styles": "./styles.css"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"prepare": "yarn g:build",
|
|
58
|
+
"clean": "yarn g:clean",
|
|
59
|
+
"compile": "yarn g:compile",
|
|
60
|
+
"build": "yarn g:build",
|
|
61
|
+
"lint": "yarn g:lint",
|
|
62
|
+
"lint:ci": "yarn g:lint:ci",
|
|
63
|
+
"test": "yarn g:test",
|
|
64
|
+
"test:watch": "yarn g:test:watch",
|
|
65
|
+
"ci": "yarn g:ci",
|
|
66
|
+
"up": "yarn g:up",
|
|
67
|
+
"storybook": "storybook dev -p 6008",
|
|
68
|
+
"build-storybook": "storybook build"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@cratis/showrunner.cue": "2.10.1",
|
|
72
|
+
"react-markdown": "10.1.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@cratis/arc": "22.185.1",
|
|
76
|
+
"@cratis/arc.react": "22.185.1",
|
|
77
|
+
"@cratis/components": "4.38.0",
|
|
78
|
+
"@cratis/fundamentals": "7.34.0",
|
|
79
|
+
"@storybook/react-vite": "^10.5.10",
|
|
80
|
+
"react": "^19.3.1",
|
|
81
|
+
"react-dom": "^19.3.1",
|
|
82
|
+
"reflect-metadata": "0.2.2",
|
|
83
|
+
"storybook": "^10.5.10"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"@cratis/arc": "^22.185.1",
|
|
87
|
+
"@cratis/arc.react": "^22.185.1",
|
|
88
|
+
"@cratis/components": "^4.38.0",
|
|
89
|
+
"@cratis/fundamentals": "^7.34.0",
|
|
90
|
+
"react": "^19.0.0"
|
|
91
|
+
},
|
|
92
|
+
"sideEffects": [
|
|
93
|
+
"*.css"
|
|
94
|
+
]
|
|
6
95
|
}
|