@bendyline/squisq-react 1.3.0 → 1.3.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/dist/index.d.ts +710 -35
- package/dist/index.js +4288 -33
- package/dist/index.js.map +1 -1
- package/dist/squisq-player.global.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/package.json +3 -3
- package/src/standalone-source.d.ts +10 -0
- package/dist/BlockRenderer.d.ts +0 -37
- package/dist/BlockRenderer.d.ts.map +0 -1
- package/dist/BlockRenderer.js +0 -54
- package/dist/BlockRenderer.js.map +0 -1
- package/dist/CaptionOverlay.d.ts +0 -33
- package/dist/CaptionOverlay.d.ts.map +0 -1
- package/dist/CaptionOverlay.js +0 -44
- package/dist/CaptionOverlay.js.map +0 -1
- package/dist/DocControlsBottom.d.ts +0 -28
- package/dist/DocControlsBottom.d.ts.map +0 -1
- package/dist/DocControlsBottom.js +0 -27
- package/dist/DocControlsBottom.js.map +0 -1
- package/dist/DocControlsOverlay.d.ts +0 -28
- package/dist/DocControlsOverlay.d.ts.map +0 -1
- package/dist/DocControlsOverlay.js +0 -80
- package/dist/DocControlsOverlay.js.map +0 -1
- package/dist/DocControlsSidebar.d.ts +0 -27
- package/dist/DocControlsSidebar.d.ts.map +0 -1
- package/dist/DocControlsSidebar.js +0 -10
- package/dist/DocControlsSidebar.js.map +0 -1
- package/dist/DocControlsSlideshow.d.ts +0 -20
- package/dist/DocControlsSlideshow.d.ts.map +0 -1
- package/dist/DocControlsSlideshow.js +0 -69
- package/dist/DocControlsSlideshow.js.map +0 -1
- package/dist/DocPlayer.d.ts +0 -97
- package/dist/DocPlayer.d.ts.map +0 -1
- package/dist/DocPlayer.js +0 -657
- package/dist/DocPlayer.js.map +0 -1
- package/dist/DocPlayerWithSidebar.d.ts +0 -41
- package/dist/DocPlayerWithSidebar.d.ts.map +0 -1
- package/dist/DocPlayerWithSidebar.js +0 -69
- package/dist/DocPlayerWithSidebar.js.map +0 -1
- package/dist/DocProgressBar.d.ts +0 -31
- package/dist/DocProgressBar.d.ts.map +0 -1
- package/dist/DocProgressBar.js +0 -122
- package/dist/DocProgressBar.js.map +0 -1
- package/dist/InlineAudioPlayer.d.ts +0 -15
- package/dist/InlineAudioPlayer.d.ts.map +0 -1
- package/dist/InlineAudioPlayer.js +0 -22
- package/dist/InlineAudioPlayer.js.map +0 -1
- package/dist/InlineVideoPlayer.d.ts +0 -21
- package/dist/InlineVideoPlayer.d.ts.map +0 -1
- package/dist/InlineVideoPlayer.js +0 -29
- package/dist/InlineVideoPlayer.js.map +0 -1
- package/dist/LinearDocView.d.ts +0 -73
- package/dist/LinearDocView.d.ts.map +0 -1
- package/dist/LinearDocView.js +0 -451
- package/dist/LinearDocView.js.map +0 -1
- package/dist/MarkdownRenderer.d.ts +0 -32
- package/dist/MarkdownRenderer.d.ts.map +0 -1
- package/dist/MarkdownRenderer.js +0 -259
- package/dist/MarkdownRenderer.js.map +0 -1
- package/dist/SocialCaptionOverlay.d.ts +0 -27
- package/dist/SocialCaptionOverlay.d.ts.map +0 -1
- package/dist/SocialCaptionOverlay.js +0 -185
- package/dist/SocialCaptionOverlay.js.map +0 -1
- package/dist/__tests__/BlockRenderer.test.d.ts +0 -2
- package/dist/__tests__/BlockRenderer.test.d.ts.map +0 -1
- package/dist/__tests__/BlockRenderer.test.js +0 -82
- package/dist/__tests__/BlockRenderer.test.js.map +0 -1
- package/dist/__tests__/DocControlsSlideshow.test.d.ts +0 -2
- package/dist/__tests__/DocControlsSlideshow.test.d.ts.map +0 -1
- package/dist/__tests__/DocControlsSlideshow.test.js +0 -89
- package/dist/__tests__/DocControlsSlideshow.test.js.map +0 -1
- package/dist/__tests__/JsonView.test.d.ts +0 -2
- package/dist/__tests__/JsonView.test.d.ts.map +0 -1
- package/dist/__tests__/JsonView.test.js +0 -93
- package/dist/__tests__/JsonView.test.js.map +0 -1
- package/dist/__tests__/LinearDocView.test.d.ts +0 -2
- package/dist/__tests__/LinearDocView.test.d.ts.map +0 -1
- package/dist/__tests__/LinearDocView.test.js +0 -250
- package/dist/__tests__/LinearDocView.test.js.map +0 -1
- package/dist/__tests__/MarkdownRenderer.test.d.ts +0 -2
- package/dist/__tests__/MarkdownRenderer.test.d.ts.map +0 -1
- package/dist/__tests__/MarkdownRenderer.test.js +0 -208
- package/dist/__tests__/MarkdownRenderer.test.js.map +0 -1
- package/dist/__tests__/TableLayer.test.d.ts +0 -2
- package/dist/__tests__/TableLayer.test.d.ts.map +0 -1
- package/dist/__tests__/TableLayer.test.js +0 -121
- package/dist/__tests__/TableLayer.test.js.map +0 -1
- package/dist/__tests__/exports.test.d.ts +0 -2
- package/dist/__tests__/exports.test.d.ts.map +0 -1
- package/dist/__tests__/exports.test.js +0 -48
- package/dist/__tests__/exports.test.js.map +0 -1
- package/dist/hooks/AudioProvider.d.ts +0 -71
- package/dist/hooks/AudioProvider.d.ts.map +0 -1
- package/dist/hooks/AudioProvider.js +0 -52
- package/dist/hooks/AudioProvider.js.map +0 -1
- package/dist/hooks/MediaContext.d.ts +0 -35
- package/dist/hooks/MediaContext.d.ts.map +0 -1
- package/dist/hooks/MediaContext.js +0 -72
- package/dist/hooks/MediaContext.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -5
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useAudioSync.d.ts +0 -18
- package/dist/hooks/useAudioSync.d.ts.map +0 -1
- package/dist/hooks/useAudioSync.js +0 -340
- package/dist/hooks/useAudioSync.js.map +0 -1
- package/dist/hooks/useAutoSurface.d.ts +0 -11
- package/dist/hooks/useAutoSurface.d.ts.map +0 -1
- package/dist/hooks/useAutoSurface.js +0 -24
- package/dist/hooks/useAutoSurface.js.map +0 -1
- package/dist/hooks/useDocPlayback.d.ts +0 -47
- package/dist/hooks/useDocPlayback.d.ts.map +0 -1
- package/dist/hooks/useDocPlayback.js +0 -179
- package/dist/hooks/useDocPlayback.js.map +0 -1
- package/dist/hooks/useViewportOrientation.d.ts +0 -31
- package/dist/hooks/useViewportOrientation.d.ts.map +0 -1
- package/dist/hooks/useViewportOrientation.js +0 -92
- package/dist/hooks/useViewportOrientation.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsonView/JsonView.d.ts +0 -26
- package/dist/jsonView/JsonView.d.ts.map +0 -1
- package/dist/jsonView/JsonView.js +0 -12
- package/dist/jsonView/JsonView.js.map +0 -1
- package/dist/jsonView/RenderNode.d.ts +0 -22
- package/dist/jsonView/RenderNode.d.ts.map +0 -1
- package/dist/jsonView/RenderNode.js +0 -30
- package/dist/jsonView/RenderNode.js.map +0 -1
- package/dist/jsonView/index.d.ts +0 -3
- package/dist/jsonView/index.d.ts.map +0 -1
- package/dist/jsonView/index.js +0 -2
- package/dist/jsonView/index.js.map +0 -1
- package/dist/jsonView/useJsonViewTokens.d.ts +0 -14
- package/dist/jsonView/useJsonViewTokens.d.ts.map +0 -1
- package/dist/jsonView/useJsonViewTokens.js +0 -34
- package/dist/jsonView/useJsonViewTokens.js.map +0 -1
- package/dist/jsonView/viewers.d.ts +0 -30
- package/dist/jsonView/viewers.d.ts.map +0 -1
- package/dist/jsonView/viewers.js +0 -226
- package/dist/jsonView/viewers.js.map +0 -1
- package/dist/layers/ImageLayer.d.ts +0 -23
- package/dist/layers/ImageLayer.d.ts.map +0 -1
- package/dist/layers/ImageLayer.js +0 -104
- package/dist/layers/ImageLayer.js.map +0 -1
- package/dist/layers/MapLayer.d.ts +0 -29
- package/dist/layers/MapLayer.d.ts.map +0 -1
- package/dist/layers/MapLayer.js +0 -97
- package/dist/layers/MapLayer.js.map +0 -1
- package/dist/layers/ShapeLayer.d.ts +0 -20
- package/dist/layers/ShapeLayer.d.ts.map +0 -1
- package/dist/layers/ShapeLayer.js +0 -39
- package/dist/layers/ShapeLayer.js.map +0 -1
- package/dist/layers/TableLayer.d.ts +0 -23
- package/dist/layers/TableLayer.d.ts.map +0 -1
- package/dist/layers/TableLayer.js +0 -58
- package/dist/layers/TableLayer.js.map +0 -1
- package/dist/layers/TextLayer.d.ts +0 -23
- package/dist/layers/TextLayer.d.ts.map +0 -1
- package/dist/layers/TextLayer.js +0 -126
- package/dist/layers/TextLayer.js.map +0 -1
- package/dist/layers/VideoLayer.d.ts +0 -40
- package/dist/layers/VideoLayer.d.ts.map +0 -1
- package/dist/layers/VideoLayer.js +0 -105
- package/dist/layers/VideoLayer.js.map +0 -1
- package/dist/layers/index.d.ts +0 -6
- package/dist/layers/index.d.ts.map +0 -1
- package/dist/layers/index.js +0 -6
- package/dist/layers/index.js.map +0 -1
- package/dist/standalone-entry.d.ts +0 -69
- package/dist/standalone-entry.d.ts.map +0 -1
- package/dist/standalone-entry.js +0 -185
- package/dist/standalone-entry.js.map +0 -1
- package/dist/standalone-source.d.ts +0 -2
- package/dist/types.d.ts +0 -154
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -21
- package/dist/types.js.map +0 -1
- package/dist/utils/animationUtils.d.ts +0 -8
- package/dist/utils/animationUtils.d.ts.map +0 -1
- package/dist/utils/animationUtils.js +0 -8
- package/dist/utils/animationUtils.js.map +0 -1
- package/dist/utils/layerUtils.d.ts +0 -17
- package/dist/utils/layerUtils.d.ts.map +0 -1
- package/dist/utils/layerUtils.js +0 -37
- package/dist/utils/layerUtils.js.map +0 -1
- package/dist/utils/mapTileUtils.d.ts +0 -105
- package/dist/utils/mapTileUtils.d.ts.map +0 -1
- package/dist/utils/mapTileUtils.js +0 -268
- package/dist/utils/mapTileUtils.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,710 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Block, Doc, Theme, SurfaceScheme, CaptionTrack, ViewportConfig as ViewportConfig$1, ImageLayer as ImageLayer$1, TextLayer as TextLayer$1, ShapeLayer as ShapeLayer$1, VideoLayer as VideoLayer$1, TableLayer as TableLayer$1, MapLayer as MapLayer$1, AudioTrack, MediaProvider } from '@bendyline/squisq/schemas';
|
|
3
|
+
import { ViewportConfig, ViewportOrientation } from '@bendyline/squisq/doc';
|
|
4
|
+
export { getAnimationStyle, getTransitionClass } from '@bendyline/squisq/doc';
|
|
5
|
+
import { MarkdownBlockNode } from '@bendyline/squisq/markdown';
|
|
6
|
+
import * as react from 'react';
|
|
7
|
+
import { RefObject } from 'react';
|
|
8
|
+
import { SquisqAnnotatedSchema } from '@bendyline/squisq/jsonForm';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* AudioProvider - Abstraction for audio playback in DocPlayer
|
|
12
|
+
*
|
|
13
|
+
* This module defines an interface for audio playback operations that can have
|
|
14
|
+
* different implementations depending on the runtime environment:
|
|
15
|
+
*
|
|
16
|
+
* - Site/Browser: Uses HTML5 Audio element directly
|
|
17
|
+
* - EFB/MSFS: Routes through CompanionAPI to Electron app
|
|
18
|
+
*
|
|
19
|
+
* The DocPlayer uses this abstraction instead of directly manipulating audio,
|
|
20
|
+
* allowing the same component code to work in both environments.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
interface AudioState {
|
|
24
|
+
/** Current time in overall timeline (seconds) */
|
|
25
|
+
currentTime: number;
|
|
26
|
+
/** Whether audio is currently playing */
|
|
27
|
+
isPlaying: boolean;
|
|
28
|
+
/** Index of current audio segment */
|
|
29
|
+
currentSegment: number;
|
|
30
|
+
/** Total duration of all segments */
|
|
31
|
+
totalDuration: number;
|
|
32
|
+
/** Whether audio has finished */
|
|
33
|
+
isEnded: boolean;
|
|
34
|
+
/** Whether audio is loaded and ready to play */
|
|
35
|
+
isReady: boolean;
|
|
36
|
+
/** Whether the audio backend is available/connected */
|
|
37
|
+
isAvailable: boolean;
|
|
38
|
+
/** Message to show when not available */
|
|
39
|
+
unavailableMessage?: string;
|
|
40
|
+
}
|
|
41
|
+
interface AudioActions {
|
|
42
|
+
/** Start or resume playback */
|
|
43
|
+
play: () => Promise<void>;
|
|
44
|
+
/** Pause playback */
|
|
45
|
+
pause: () => Promise<void>;
|
|
46
|
+
/** Toggle play/pause */
|
|
47
|
+
toggle: () => Promise<void>;
|
|
48
|
+
/** Seek to specific time in timeline */
|
|
49
|
+
seekTo: (time: number) => Promise<void>;
|
|
50
|
+
/** Skip to specific segment */
|
|
51
|
+
skipToSegment: (index: number) => Promise<void>;
|
|
52
|
+
/** Restart from beginning */
|
|
53
|
+
restart: () => Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
type AudioProvider = AudioState & AudioActions;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Doc Player Control Types
|
|
59
|
+
*
|
|
60
|
+
* Shared type definitions for doc player controls across different
|
|
61
|
+
* layout modes (overlay, sidebar, bottom). These interfaces allow
|
|
62
|
+
* control components to be decoupled from the core DocPlayer.
|
|
63
|
+
*
|
|
64
|
+
* Related Files:
|
|
65
|
+
* - DocPlayer.tsx — Core player component
|
|
66
|
+
* - DocProgressBar.tsx — Extracted progress bar
|
|
67
|
+
* - DocControlsOverlay.tsx — Overlay controls (default)
|
|
68
|
+
* - DocControlsSidebar.tsx — Vertical sidebar controls
|
|
69
|
+
* - DocControlsBottom.tsx — Horizontal bottom strip controls
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
/** Layout mode for doc player controls */
|
|
73
|
+
type ControlsLayout = 'overlay' | 'sidebar' | 'bottom';
|
|
74
|
+
/**
|
|
75
|
+
* Display mode for DocPlayer.
|
|
76
|
+
*
|
|
77
|
+
* - `'video'` — Traditional video-style playback with play/pause, scrub bar,
|
|
78
|
+
* and time-based auto-advance. Default mode.
|
|
79
|
+
* - `'slideshow'` — PowerPoint-style presentation with prev/next navigation.
|
|
80
|
+
* Blocks are treated as static slides that only change on user click.
|
|
81
|
+
* No auto-advance, no scrub bar.
|
|
82
|
+
* - `'linear'` — Long-scrolling document view. Renders the full markdown as
|
|
83
|
+
* readable HTML with template-annotated sections shown as inline SVG cards.
|
|
84
|
+
* No audio, no timeline, no controls — just a scrollable page.
|
|
85
|
+
* - `'page'` — Plain semantic HTML preview matching what the
|
|
86
|
+
* `markdownDocToPlainHtml` export produces. No SquisqPlayer, no SVG
|
|
87
|
+
* cards — just `<h1>`/`<p>`/`<ul>` etc. inside a sandboxed iframe.
|
|
88
|
+
* Use when you want a WYSIWYG view of the simple HTML export.
|
|
89
|
+
*/
|
|
90
|
+
type DisplayMode = 'video' | 'slideshow' | 'linear' | 'page';
|
|
91
|
+
/**
|
|
92
|
+
* Caption display style.
|
|
93
|
+
*
|
|
94
|
+
* - `'standard'` — Traditional broadcast-style captions: small white text
|
|
95
|
+
* on a semi-transparent black badge at the top of the player.
|
|
96
|
+
* - `'social'` — Social media-style (Instagram/TikTok): large centered words
|
|
97
|
+
* showing 3-5 words at a time with the active word highlighted in the
|
|
98
|
+
* theme's primary color. Font and colors pulled from the active theme.
|
|
99
|
+
*/
|
|
100
|
+
type CaptionStyle = 'standard' | 'social';
|
|
101
|
+
/**
|
|
102
|
+
* Caption display mode — combines enable/disable with style selection.
|
|
103
|
+
* The CC button cycles through: off → standard → social → off.
|
|
104
|
+
*/
|
|
105
|
+
type CaptionMode = 'off' | 'standard' | 'social';
|
|
106
|
+
/** Slide navigation actions for slideshow display mode */
|
|
107
|
+
interface SlideNavActions {
|
|
108
|
+
/** Navigate to the next slide */
|
|
109
|
+
nextSlide: () => void;
|
|
110
|
+
/** Navigate to the previous slide */
|
|
111
|
+
prevSlide: () => void;
|
|
112
|
+
/** Navigate to a specific slide by index (0-based) */
|
|
113
|
+
goToSlide: (index: number) => void;
|
|
114
|
+
}
|
|
115
|
+
/** Playback state exposed to external control components */
|
|
116
|
+
interface PlaybackState$1 {
|
|
117
|
+
isPlaying: boolean;
|
|
118
|
+
currentTime: number;
|
|
119
|
+
totalDuration: number;
|
|
120
|
+
currentBlockIndex: number;
|
|
121
|
+
totalBlocks: number;
|
|
122
|
+
docProgress: number;
|
|
123
|
+
hasCaptions: boolean;
|
|
124
|
+
captionsEnabled: boolean;
|
|
125
|
+
/** Current caption display mode (off, standard, social). */
|
|
126
|
+
captionMode: CaptionMode;
|
|
127
|
+
isFullscreen?: boolean;
|
|
128
|
+
/** Current audio segment index (0-based) */
|
|
129
|
+
currentSegmentIndex: number;
|
|
130
|
+
/** Current audio segment name (e.g., 'intro', 'history') */
|
|
131
|
+
currentSegmentName: string | null;
|
|
132
|
+
/** Current block data (for extracting image info, etc.) */
|
|
133
|
+
currentBlock: Block | null;
|
|
134
|
+
}
|
|
135
|
+
/** Playback actions exposed to external control components */
|
|
136
|
+
interface PlaybackActions$1 {
|
|
137
|
+
toggle: () => void;
|
|
138
|
+
restart: () => void;
|
|
139
|
+
seekTo: (time: number) => void;
|
|
140
|
+
setCaptionsEnabled: (enabled: boolean) => void;
|
|
141
|
+
/** Cycle caption mode: off → standard → social → off */
|
|
142
|
+
cycleCaptionMode: () => void;
|
|
143
|
+
toggleFullscreen?: () => void;
|
|
144
|
+
}
|
|
145
|
+
/** Block marker data for the progress bar */
|
|
146
|
+
interface BlockMarker {
|
|
147
|
+
block: Block;
|
|
148
|
+
index: number;
|
|
149
|
+
position: number;
|
|
150
|
+
title: string;
|
|
151
|
+
/** True if this block is the first in a new audio segment (section boundary) */
|
|
152
|
+
isSectionStart: boolean;
|
|
153
|
+
}
|
|
154
|
+
/** Block metadata returned by SquisqRenderAPI.getBlocks() */
|
|
155
|
+
interface RenderBlockInfo {
|
|
156
|
+
id: string;
|
|
157
|
+
template: string;
|
|
158
|
+
startTime: number;
|
|
159
|
+
duration: number;
|
|
160
|
+
}
|
|
161
|
+
/** Audio segment info returned by SquisqRenderAPI.getAudioSegments() */
|
|
162
|
+
interface RenderAudioSegmentInfo {
|
|
163
|
+
src: string;
|
|
164
|
+
name: string;
|
|
165
|
+
duration: number;
|
|
166
|
+
startTime: number;
|
|
167
|
+
}
|
|
168
|
+
/** Caption phrase info returned by SquisqRenderAPI.getCaptions() */
|
|
169
|
+
interface RenderCaptionInfo {
|
|
170
|
+
text: string;
|
|
171
|
+
startTime: number;
|
|
172
|
+
endTime: number;
|
|
173
|
+
}
|
|
174
|
+
/** Chapter marker returned by SquisqRenderAPI.getChapters() */
|
|
175
|
+
interface RenderChapterInfo {
|
|
176
|
+
title: string;
|
|
177
|
+
startTime: number;
|
|
178
|
+
duration: number;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* API surface exposed on `window` in render mode and debug mode.
|
|
182
|
+
* Used by Playwright for video export and by ?debug=true for testing.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* // In Playwright:
|
|
187
|
+
* const w = window as unknown as SquisqWindow;
|
|
188
|
+
* await w.seekTo!(5.0);
|
|
189
|
+
* const blocks = w.getBlocks!();
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
interface SquisqRenderAPI {
|
|
193
|
+
seekTo: (time: number) => Promise<void>;
|
|
194
|
+
getDuration: () => number;
|
|
195
|
+
getBlocks: () => RenderBlockInfo[];
|
|
196
|
+
getAudioSegments: () => RenderAudioSegmentInfo[];
|
|
197
|
+
getCaptions: () => RenderCaptionInfo[];
|
|
198
|
+
getChapters: () => RenderChapterInfo[];
|
|
199
|
+
showCover: () => Promise<void>;
|
|
200
|
+
hideCover: () => Promise<void>;
|
|
201
|
+
hasCoverBlock: () => boolean;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Window augmented with optional SquisqRenderAPI properties.
|
|
205
|
+
* Each property is optional because they're only present in render/debug mode.
|
|
206
|
+
*/
|
|
207
|
+
type SquisqWindow = Window & typeof globalThis & Partial<SquisqRenderAPI>;
|
|
208
|
+
/** Format time in seconds to MM:SS string */
|
|
209
|
+
declare function formatTime(seconds: number): string;
|
|
210
|
+
|
|
211
|
+
interface DocPlayerProps {
|
|
212
|
+
/** Doc script to play */
|
|
213
|
+
script: Doc;
|
|
214
|
+
/** Base path for resolving media URLs */
|
|
215
|
+
basePath: string;
|
|
216
|
+
/** Render mode for video capture (hides controls, exposes seekTo) */
|
|
217
|
+
renderMode?: boolean;
|
|
218
|
+
/** Auto-play when loaded */
|
|
219
|
+
autoPlay?: boolean;
|
|
220
|
+
/** Callback when playback ends */
|
|
221
|
+
onEnded?: () => void;
|
|
222
|
+
/** Callback for time updates */
|
|
223
|
+
onTimeUpdate?: (time: number) => void;
|
|
224
|
+
/** Optional audio provider (if not provided, uses default HTML5 audio) */
|
|
225
|
+
audioProvider?: AudioProvider;
|
|
226
|
+
/** Show built-in controls (default: true). Set to false for custom controls. */
|
|
227
|
+
showControls?: boolean;
|
|
228
|
+
/** Show only the progress bar/scrubber at bottom (no other controls).
|
|
229
|
+
* Only takes effect when showControls is false. Allows external controls
|
|
230
|
+
* while keeping the scrubber in-video. */
|
|
231
|
+
showScrubber?: boolean;
|
|
232
|
+
/** Mute audio (default: false) */
|
|
233
|
+
muted?: boolean;
|
|
234
|
+
/** Enable captions (default: true) */
|
|
235
|
+
captionsEnabled?: boolean;
|
|
236
|
+
/** Callback when captions enabled state is toggled */
|
|
237
|
+
onCaptionsToggle?: (enabled: boolean) => void;
|
|
238
|
+
/** Callback for playback state changes (for external controls) */
|
|
239
|
+
onPlaybackStateChange?: (state: PlaybackState$1) => void;
|
|
240
|
+
/** Callback when playback controls are ready (for external controls) */
|
|
241
|
+
onControlsReady?: (controls: PlaybackActions$1 & {
|
|
242
|
+
play: () => void;
|
|
243
|
+
pause: () => void;
|
|
244
|
+
}) => void;
|
|
245
|
+
/** Whether the player is currently in fullscreen mode */
|
|
246
|
+
isFullscreen?: boolean;
|
|
247
|
+
/** Callback to toggle fullscreen mode */
|
|
248
|
+
onFullscreenToggle?: () => void;
|
|
249
|
+
/** Callback when block markers are computed (for external progress bars) */
|
|
250
|
+
onBlockMarkers?: (markers: BlockMarker[]) => void;
|
|
251
|
+
/** Force a specific viewport preset, bypassing window-based orientation detection.
|
|
252
|
+
* Used when the player is rendered in a constrained container (e.g., map overlay panel)
|
|
253
|
+
* whose shape differs from the window's. */
|
|
254
|
+
forceViewport?: ViewportConfig;
|
|
255
|
+
/** Theme to use for rendering (default: DEFAULT_THEME from the theme library) */
|
|
256
|
+
theme?: Theme;
|
|
257
|
+
/**
|
|
258
|
+
* Optional surface scheme (light / dark paper) overlaid on top of the
|
|
259
|
+
* theme's colors. Passed through to the underlying LinearDocView when
|
|
260
|
+
* `displayMode === 'linear'`; otherwise overlaid onto the theme that
|
|
261
|
+
* renders the player's SVG blocks.
|
|
262
|
+
*/
|
|
263
|
+
surface?: SurfaceScheme | 'auto';
|
|
264
|
+
/**
|
|
265
|
+
* Display mode for the player.
|
|
266
|
+
* - `'video'` (default) — Traditional video playback with play/pause, scrub bar, auto-advance.
|
|
267
|
+
* - `'slideshow'` — PowerPoint-style with prev/next buttons. Blocks are static slides
|
|
268
|
+
* that only change on user click. No auto-advance, no scrub bar.
|
|
269
|
+
* - `'linear'` — Long-scrolling document view. Renders markdown as readable HTML with
|
|
270
|
+
* template-annotated sections as inline SVG cards. No audio, no timeline.
|
|
271
|
+
*/
|
|
272
|
+
displayMode?: DisplayMode;
|
|
273
|
+
/** Caption display style (default: 'standard').
|
|
274
|
+
* 'social' shows large centered words with the active word highlighted. */
|
|
275
|
+
captionStyle?: CaptionStyle;
|
|
276
|
+
}
|
|
277
|
+
declare function DocPlayer({ script, basePath, renderMode, autoPlay, onEnded, onTimeUpdate, audioProvider: externalAudioProvider, showControls, showScrubber, muted, captionsEnabled: captionsEnabledProp, onCaptionsToggle, onPlaybackStateChange, onControlsReady, isFullscreen, onFullscreenToggle, onBlockMarkers, forceViewport, displayMode, theme, surface, captionStyle, }: DocPlayerProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
|
|
279
|
+
/** Default viewport dimensions (1080p landscape) - for backwards compatibility */
|
|
280
|
+
declare const VIEWPORT: {
|
|
281
|
+
width: number;
|
|
282
|
+
height: number;
|
|
283
|
+
};
|
|
284
|
+
/** Viewport configuration type */
|
|
285
|
+
interface ViewportDimensions {
|
|
286
|
+
width: number;
|
|
287
|
+
height: number;
|
|
288
|
+
}
|
|
289
|
+
interface BlockRendererProps {
|
|
290
|
+
/** The block to render */
|
|
291
|
+
block: Block;
|
|
292
|
+
/** Current time relative to block start (seconds) */
|
|
293
|
+
blockTime: number;
|
|
294
|
+
/** Base path for resolving media URLs */
|
|
295
|
+
basePath: string;
|
|
296
|
+
/** Whether this block is entering (for transition) */
|
|
297
|
+
isEntering?: boolean;
|
|
298
|
+
/** Whether this block is exiting (for transition) */
|
|
299
|
+
isExiting?: boolean;
|
|
300
|
+
/** Viewport dimensions (defaults to 1920x1080 landscape) */
|
|
301
|
+
viewport?: ViewportDimensions;
|
|
302
|
+
/** Whether the doc is currently playing (controls video playback) */
|
|
303
|
+
isPlaying?: boolean;
|
|
304
|
+
}
|
|
305
|
+
declare function BlockRenderer({ block, blockTime, basePath, isEntering, isExiting, viewport, isPlaying, }: BlockRendererProps): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
interface CaptionOverlayProps {
|
|
308
|
+
/** Caption track with timestamped phrases */
|
|
309
|
+
captions: CaptionTrack | undefined;
|
|
310
|
+
/** Current playback time in seconds */
|
|
311
|
+
currentTime: number;
|
|
312
|
+
/** Whether captions are enabled */
|
|
313
|
+
enabled?: boolean;
|
|
314
|
+
/** Font size in pixels for standard style (default: 16) */
|
|
315
|
+
fontSize?: number;
|
|
316
|
+
/** Caption display style (default: 'standard') */
|
|
317
|
+
captionStyle?: CaptionStyle;
|
|
318
|
+
/** Theme for social-style caption colors and fonts */
|
|
319
|
+
theme?: Theme;
|
|
320
|
+
/** Viewport config for social-style font scaling */
|
|
321
|
+
viewport?: ViewportConfig$1;
|
|
322
|
+
}
|
|
323
|
+
declare function CaptionOverlay({ captions, currentTime, enabled, fontSize, captionStyle, theme, viewport, }: CaptionOverlayProps): react_jsx_runtime.JSX.Element;
|
|
324
|
+
|
|
325
|
+
interface SocialCaptionOverlayProps {
|
|
326
|
+
captions: CaptionTrack | undefined;
|
|
327
|
+
currentTime: number;
|
|
328
|
+
enabled?: boolean;
|
|
329
|
+
theme?: Theme;
|
|
330
|
+
viewport?: ViewportConfig$1;
|
|
331
|
+
}
|
|
332
|
+
declare function SocialCaptionOverlay({ captions, currentTime, enabled, theme, viewport, }: SocialCaptionOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
333
|
+
|
|
334
|
+
interface DocControlsOverlayProps {
|
|
335
|
+
state: PlaybackState$1;
|
|
336
|
+
actions: PlaybackActions$1;
|
|
337
|
+
blockMarkers: BlockMarker[];
|
|
338
|
+
expandedBlocks: Block[];
|
|
339
|
+
getBlockTitle?: (block: Block) => string;
|
|
340
|
+
}
|
|
341
|
+
declare function DocControlsOverlay({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocControlsOverlayProps): react_jsx_runtime.JSX.Element;
|
|
342
|
+
|
|
343
|
+
interface DocControlsBottomProps {
|
|
344
|
+
state: PlaybackState$1;
|
|
345
|
+
actions: PlaybackActions$1;
|
|
346
|
+
blockMarkers: BlockMarker[];
|
|
347
|
+
expandedBlocks: Block[];
|
|
348
|
+
getBlockTitle?: (block: Block) => string;
|
|
349
|
+
}
|
|
350
|
+
declare function DocControlsBottom({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocControlsBottomProps): react_jsx_runtime.JSX.Element;
|
|
351
|
+
|
|
352
|
+
interface DocControlsSidebarProps {
|
|
353
|
+
state: PlaybackState$1;
|
|
354
|
+
actions: PlaybackActions$1;
|
|
355
|
+
}
|
|
356
|
+
declare function DocControlsSidebar({ state, actions }: DocControlsSidebarProps): react_jsx_runtime.JSX.Element;
|
|
357
|
+
|
|
358
|
+
interface DocControlsSlideshowProps {
|
|
359
|
+
state: PlaybackState$1;
|
|
360
|
+
slideNav: SlideNavActions;
|
|
361
|
+
}
|
|
362
|
+
declare function DocControlsSlideshow({ state, slideNav }: DocControlsSlideshowProps): react_jsx_runtime.JSX.Element;
|
|
363
|
+
|
|
364
|
+
interface DocPlayerWithSidebarProps {
|
|
365
|
+
script: Doc;
|
|
366
|
+
basePath: string;
|
|
367
|
+
autoPlay?: boolean;
|
|
368
|
+
onEnded?: () => void;
|
|
369
|
+
onTimeUpdate?: (time: number) => void;
|
|
370
|
+
audioProvider?: AudioProvider;
|
|
371
|
+
muted?: boolean;
|
|
372
|
+
captionsEnabled?: boolean;
|
|
373
|
+
isFullscreen?: boolean;
|
|
374
|
+
onFullscreenToggle?: () => void;
|
|
375
|
+
/** Force a specific viewport preset, bypassing window-based orientation detection. */
|
|
376
|
+
forceViewport?: ViewportConfig$1;
|
|
377
|
+
/** Called when playing state changes */
|
|
378
|
+
onPlayingChange?: (isPlaying: boolean) => void;
|
|
379
|
+
}
|
|
380
|
+
declare function DocPlayerWithSidebar({ script, basePath, autoPlay, onEnded, onTimeUpdate, audioProvider, muted, captionsEnabled, isFullscreen, onFullscreenToggle, forceViewport, onPlayingChange, }: DocPlayerWithSidebarProps): react_jsx_runtime.JSX.Element;
|
|
381
|
+
|
|
382
|
+
interface DocProgressBarProps {
|
|
383
|
+
state: PlaybackState$1;
|
|
384
|
+
actions: PlaybackActions$1;
|
|
385
|
+
blockMarkers: BlockMarker[];
|
|
386
|
+
/** All expanded blocks for hover lookup */
|
|
387
|
+
expandedBlocks: Block[];
|
|
388
|
+
/** Optional: get block title for hover tooltip */
|
|
389
|
+
getBlockTitle?: (block: Block) => string;
|
|
390
|
+
}
|
|
391
|
+
declare function DocProgressBar({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
392
|
+
|
|
393
|
+
interface MarkdownRendererProps {
|
|
394
|
+
/** Block-level AST nodes to render */
|
|
395
|
+
nodes: MarkdownBlockNode[];
|
|
396
|
+
/** Optional CSS class for the wrapper element */
|
|
397
|
+
className?: string;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Renders MarkdownBlockNode[] AST as React HTML elements.
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* ```tsx
|
|
404
|
+
* <MarkdownRenderer nodes={block.contents} />
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
declare function MarkdownRenderer({ nodes, className }: MarkdownRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
408
|
+
|
|
409
|
+
interface LinearDocViewProps {
|
|
410
|
+
/** The Doc to render */
|
|
411
|
+
doc: Doc;
|
|
412
|
+
/** Base path for resolving media URLs (images, etc.) */
|
|
413
|
+
basePath?: string;
|
|
414
|
+
/** Viewport config for SVG card rendering (default: landscape) */
|
|
415
|
+
viewport?: ViewportConfig$1;
|
|
416
|
+
/** Optional CSS class for the outer container */
|
|
417
|
+
className?: string;
|
|
418
|
+
/** Theme to use for rendering (default: DEFAULT_THEME from the theme library) */
|
|
419
|
+
theme?: Theme;
|
|
420
|
+
/**
|
|
421
|
+
* Optional surface scheme (light / dark paper) overlaid on top of the
|
|
422
|
+
* theme's colors. Orthogonal to `theme` — a theme picks editorial
|
|
423
|
+
* identity, a surface picks the paper. Pass `'auto'` to follow the
|
|
424
|
+
* user's OS `prefers-color-scheme`, a `SurfaceScheme` object to force a
|
|
425
|
+
* specific surface, or omit to use the theme's built-in colors.
|
|
426
|
+
*/
|
|
427
|
+
surface?: SurfaceScheme | 'auto';
|
|
428
|
+
/**
|
|
429
|
+
* Use tight padding + a wider content column. The default layout is
|
|
430
|
+
* designed for a reading surface with breathing room (720px column,
|
|
431
|
+
* 24×16px padding). Short conversational snippets like chat replies
|
|
432
|
+
* benefit from a much tighter layout. Set to `true` to render with
|
|
433
|
+
* minimal padding and no max-width cap so the content hugs its
|
|
434
|
+
* container.
|
|
435
|
+
*/
|
|
436
|
+
thinMargins?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* How images inside the doc should be sized. `'inline'` (default)
|
|
439
|
+
* flows them at natural size up to the column width; `'thumbnail'`
|
|
440
|
+
* constrains each image to a 100×100 box with aspect-preserving
|
|
441
|
+
* containment — use for chat history and other dense surfaces where
|
|
442
|
+
* full-size images would dominate the layout.
|
|
443
|
+
*/
|
|
444
|
+
imageDisplayMode?: ImageDisplayMode;
|
|
445
|
+
}
|
|
446
|
+
type ImageDisplayMode = 'inline' | 'thumbnail';
|
|
447
|
+
/**
|
|
448
|
+
* Renders a Doc as a long-scrolling, readable document.
|
|
449
|
+
*
|
|
450
|
+
* Non-annotated blocks are rendered as HTML text (headings, paragraphs,
|
|
451
|
+
* lists, etc.) via MarkdownRenderer. Template-annotated blocks are
|
|
452
|
+
* rendered as inline SVG visual cards via BlockRenderer.
|
|
453
|
+
*
|
|
454
|
+
* @example
|
|
455
|
+
* ```tsx
|
|
456
|
+
* <LinearDocView doc={doc} basePath="/media/" />
|
|
457
|
+
* ```
|
|
458
|
+
*/
|
|
459
|
+
declare function LinearDocView({ doc, basePath, viewport, className, theme, surface, thinMargins, imageDisplayMode, }: LinearDocViewProps): react_jsx_runtime.JSX.Element;
|
|
460
|
+
|
|
461
|
+
interface InlineVideoPlayerProps {
|
|
462
|
+
/** Source path — resolved through MediaContext when relative. */
|
|
463
|
+
src: string;
|
|
464
|
+
/** Base path used when no MediaProvider is in context. */
|
|
465
|
+
basePath?: string;
|
|
466
|
+
/** Optional explicit width (pixels or CSS length). */
|
|
467
|
+
width?: number | string;
|
|
468
|
+
/** Optional explicit height (pixels or CSS length). */
|
|
469
|
+
height?: number | string;
|
|
470
|
+
/** Optional poster image src — also resolved through MediaContext. */
|
|
471
|
+
poster?: string;
|
|
472
|
+
/** Whether to show native controls. Defaults to true. */
|
|
473
|
+
controls?: boolean;
|
|
474
|
+
/** `preload` attribute passthrough. Defaults to `'metadata'`. */
|
|
475
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
476
|
+
/** Extra className on the wrapper. */
|
|
477
|
+
className?: string;
|
|
478
|
+
}
|
|
479
|
+
declare function InlineVideoPlayer({ src, basePath, width, height, poster, controls, preload, className, }: InlineVideoPlayerProps): react_jsx_runtime.JSX.Element | null;
|
|
480
|
+
|
|
481
|
+
interface InlineAudioPlayerProps {
|
|
482
|
+
/** Source path — resolved through MediaContext when relative. */
|
|
483
|
+
src: string;
|
|
484
|
+
/** Base path used when no MediaProvider is in context. */
|
|
485
|
+
basePath?: string;
|
|
486
|
+
/** Whether to show native controls. Defaults to true. */
|
|
487
|
+
controls?: boolean;
|
|
488
|
+
/** `preload` attribute passthrough. Defaults to `'metadata'`. */
|
|
489
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
490
|
+
/** Extra className on the wrapper. */
|
|
491
|
+
className?: string;
|
|
492
|
+
}
|
|
493
|
+
declare function InlineAudioPlayer({ src, basePath, controls, preload, className, }: InlineAudioPlayerProps): react_jsx_runtime.JSX.Element | null;
|
|
494
|
+
|
|
495
|
+
interface ImageLayerProps {
|
|
496
|
+
layer: ImageLayer$1;
|
|
497
|
+
/** Base path for resolving relative image URLs */
|
|
498
|
+
basePath: string;
|
|
499
|
+
/** Viewport dimensions for percentage calculations */
|
|
500
|
+
viewport: {
|
|
501
|
+
width: number;
|
|
502
|
+
height: number;
|
|
503
|
+
};
|
|
504
|
+
/** Current time relative to block start (for animation timing) */
|
|
505
|
+
blockTime: number;
|
|
506
|
+
}
|
|
507
|
+
declare function ImageLayer({ layer, basePath, viewport, blockTime }: ImageLayerProps): react_jsx_runtime.JSX.Element;
|
|
508
|
+
|
|
509
|
+
interface TextLayerProps {
|
|
510
|
+
layer: TextLayer$1;
|
|
511
|
+
/** Viewport dimensions for percentage calculations */
|
|
512
|
+
viewport: {
|
|
513
|
+
width: number;
|
|
514
|
+
height: number;
|
|
515
|
+
};
|
|
516
|
+
/** Current time relative to block start */
|
|
517
|
+
blockTime: number;
|
|
518
|
+
}
|
|
519
|
+
declare function TextLayer({ layer, viewport, blockTime }: TextLayerProps): react_jsx_runtime.JSX.Element;
|
|
520
|
+
|
|
521
|
+
interface ShapeLayerProps {
|
|
522
|
+
layer: ShapeLayer$1;
|
|
523
|
+
/** Viewport dimensions for percentage calculations */
|
|
524
|
+
viewport: {
|
|
525
|
+
width: number;
|
|
526
|
+
height: number;
|
|
527
|
+
};
|
|
528
|
+
/** Current time relative to block start */
|
|
529
|
+
blockTime: number;
|
|
530
|
+
}
|
|
531
|
+
declare function ShapeLayer({ layer, viewport, blockTime }: ShapeLayerProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
533
|
+
interface VideoLayerProps {
|
|
534
|
+
layer: VideoLayer$1;
|
|
535
|
+
/** Base path for resolving relative video URLs */
|
|
536
|
+
basePath: string;
|
|
537
|
+
/** Viewport dimensions for percentage calculations */
|
|
538
|
+
viewport: {
|
|
539
|
+
width: number;
|
|
540
|
+
height: number;
|
|
541
|
+
};
|
|
542
|
+
/** Current time relative to block start (for playback sync) */
|
|
543
|
+
blockTime: number;
|
|
544
|
+
/** Whether the doc is currently playing */
|
|
545
|
+
isPlaying?: boolean;
|
|
546
|
+
}
|
|
547
|
+
declare function VideoLayer({ layer, basePath, viewport, blockTime: _blockTime, isPlaying, }: VideoLayerProps): react_jsx_runtime.JSX.Element;
|
|
548
|
+
|
|
549
|
+
interface TableLayerProps {
|
|
550
|
+
layer: TableLayer$1;
|
|
551
|
+
/** Viewport dimensions for percentage calculations */
|
|
552
|
+
viewport: {
|
|
553
|
+
width: number;
|
|
554
|
+
height: number;
|
|
555
|
+
};
|
|
556
|
+
/** Current time relative to block start (for animation) */
|
|
557
|
+
blockTime: number;
|
|
558
|
+
}
|
|
559
|
+
declare function TableLayer({ layer, viewport, blockTime }: TableLayerProps): react_jsx_runtime.JSX.Element;
|
|
560
|
+
|
|
561
|
+
interface MapLayerProps {
|
|
562
|
+
layer: MapLayer$1;
|
|
563
|
+
/** Base path for resolving relative image URLs */
|
|
564
|
+
basePath: string;
|
|
565
|
+
/** Viewport dimensions for percentage calculations */
|
|
566
|
+
viewport: {
|
|
567
|
+
width: number;
|
|
568
|
+
height: number;
|
|
569
|
+
};
|
|
570
|
+
/** Current time relative to block start (for animation timing) */
|
|
571
|
+
blockTime: number;
|
|
572
|
+
}
|
|
573
|
+
declare function MapLayer({ layer, basePath, viewport, blockTime }: MapLayerProps): react_jsx_runtime.JSX.Element;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* useAudioSync Hook
|
|
577
|
+
*
|
|
578
|
+
* Synchronizes playback state with an audio element. Provides current
|
|
579
|
+
* playback time, playing state, and methods to control audio playback.
|
|
580
|
+
*
|
|
581
|
+
* Handles multiple audio segments (MP3 files) by tracking which segment
|
|
582
|
+
* is currently playing and calculating the overall timeline position.
|
|
583
|
+
*
|
|
584
|
+
* This is the HTML5 Audio implementation of the AudioProvider interface.
|
|
585
|
+
* For EFB/MSFS environments, use useCompanionAudioSync instead.
|
|
586
|
+
*/
|
|
587
|
+
|
|
588
|
+
declare function useAudioSync(audioRef: RefObject<HTMLAudioElement>, audioTrack: AudioTrack | undefined, basePath?: string): AudioProvider;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* useDocPlayback Hook
|
|
592
|
+
*
|
|
593
|
+
* Manages the playback state for a visual doc, including which block
|
|
594
|
+
* is currently active, transition states, and synchronization with audio.
|
|
595
|
+
*
|
|
596
|
+
* This hook provides:
|
|
597
|
+
* - Current block determination based on time
|
|
598
|
+
* - Transition tracking (entering/exiting blocks)
|
|
599
|
+
* - Manual navigation (next/prev block)
|
|
600
|
+
* - Time-based seeking
|
|
601
|
+
* - Automatic expansion of template blocks
|
|
602
|
+
*/
|
|
603
|
+
|
|
604
|
+
interface PlaybackState {
|
|
605
|
+
/** Currently visible block */
|
|
606
|
+
currentBlock: Block | null;
|
|
607
|
+
/** Index of current block */
|
|
608
|
+
currentBlockIndex: number;
|
|
609
|
+
/** Previous block (for transitions) */
|
|
610
|
+
previousBlock: Block | null;
|
|
611
|
+
/** Whether current block is entering */
|
|
612
|
+
isEntering: boolean;
|
|
613
|
+
/** Whether previous block is exiting */
|
|
614
|
+
isExiting: boolean;
|
|
615
|
+
/** Time relative to current block start */
|
|
616
|
+
blockTime: number;
|
|
617
|
+
/** Progress through current block (0-1) */
|
|
618
|
+
blockProgress: number;
|
|
619
|
+
/** Overall progress through doc (0-1) */
|
|
620
|
+
docProgress: number;
|
|
621
|
+
/** Expanded blocks (templates converted to full blocks with layers) */
|
|
622
|
+
blocks: Block[];
|
|
623
|
+
}
|
|
624
|
+
interface PlaybackActions {
|
|
625
|
+
/** Go to next block */
|
|
626
|
+
nextBlock: () => void;
|
|
627
|
+
/** Go to previous block */
|
|
628
|
+
prevBlock: () => void;
|
|
629
|
+
/** Go to specific block by index */
|
|
630
|
+
goToBlock: (index: number) => void;
|
|
631
|
+
}
|
|
632
|
+
declare function useDocPlayback(script: Doc | null, currentTime: number, viewport?: ViewportConfig, renderMode?: boolean, theme?: Theme): PlaybackState & PlaybackActions;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* useViewportOrientation Hook
|
|
636
|
+
*
|
|
637
|
+
* Detects the current viewport orientation and returns the appropriate
|
|
638
|
+
* VIEWPORT_PRESET for rendering docs. Automatically updates when
|
|
639
|
+
* the window is resized.
|
|
640
|
+
*
|
|
641
|
+
* Thresholds:
|
|
642
|
+
* - Portrait: height > width * 1.2 (significantly taller than wide)
|
|
643
|
+
* - Square: width and height within 20% of each other
|
|
644
|
+
* - Landscape: width > height * 1.2 (significantly wider than tall)
|
|
645
|
+
*/
|
|
646
|
+
|
|
647
|
+
interface UseViewportOrientationResult {
|
|
648
|
+
/** Current viewport preset configuration */
|
|
649
|
+
viewport: ViewportConfig;
|
|
650
|
+
/** Current orientation name */
|
|
651
|
+
orientation: ViewportOrientation;
|
|
652
|
+
/** Current window dimensions */
|
|
653
|
+
windowSize: {
|
|
654
|
+
width: number;
|
|
655
|
+
height: number;
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Hook to detect viewport orientation and return appropriate preset.
|
|
660
|
+
* Updates automatically when window is resized.
|
|
661
|
+
*/
|
|
662
|
+
declare function useViewportOrientation(): UseViewportOrientationResult;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* React context holding the current MediaProvider (or null if none provided).
|
|
666
|
+
*/
|
|
667
|
+
declare const MediaContext: react.Context<MediaProvider | null>;
|
|
668
|
+
/**
|
|
669
|
+
* Hook to access the current MediaProvider from context.
|
|
670
|
+
* Returns null if no provider is set.
|
|
671
|
+
*/
|
|
672
|
+
declare function useMediaProvider(): MediaProvider | null;
|
|
673
|
+
/**
|
|
674
|
+
* Hook to resolve a media URL via the MediaProvider (if available),
|
|
675
|
+
* falling back to basePath-based resolution.
|
|
676
|
+
*
|
|
677
|
+
* Returns the resolved URL string. Updates when the provider or path changes.
|
|
678
|
+
*
|
|
679
|
+
* @param relativePath - Relative media path from the document (e.g., 'hero.jpg')
|
|
680
|
+
* @param basePath - Fallback base path for URL construction
|
|
681
|
+
*/
|
|
682
|
+
declare function useMediaUrl(relativePath: string, basePath: string): string;
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Live-track `prefers-color-scheme` and return a stable SurfaceScheme.
|
|
686
|
+
* `enabled: false` short-circuits to LIGHT_SURFACE (callers pass `false`
|
|
687
|
+
* when a static surface was provided so the hook never observes the
|
|
688
|
+
* media query). The `MediaQueryList` and the `subscribe`/`getSnapshot`
|
|
689
|
+
* callbacks are memoized so `useSyncExternalStore` doesn't resubscribe on
|
|
690
|
+
* every parent render.
|
|
691
|
+
*/
|
|
692
|
+
declare function useAutoSurface(enabled: boolean): SurfaceScheme;
|
|
693
|
+
|
|
694
|
+
interface JsonViewProps {
|
|
695
|
+
/** Schema describing the value's shape (with optional `squisq` UI hints). */
|
|
696
|
+
schema: SquisqAnnotatedSchema;
|
|
697
|
+
/** The value to display. */
|
|
698
|
+
value: unknown;
|
|
699
|
+
/** Optional theme. Defaults to `DEFAULT_THEME`. */
|
|
700
|
+
theme?: Theme;
|
|
701
|
+
/** Light/dark surface override; `'auto'` follows `prefers-color-scheme`. */
|
|
702
|
+
surface?: SurfaceScheme | 'auto';
|
|
703
|
+
/** Padding/gap density. Default: 'comfortable'. */
|
|
704
|
+
density?: 'comfortable' | 'compact';
|
|
705
|
+
/** Optional CSS class for the outer container. */
|
|
706
|
+
className?: string;
|
|
707
|
+
}
|
|
708
|
+
declare function JsonView(props: JsonViewProps): react_jsx_runtime.JSX.Element;
|
|
709
|
+
|
|
710
|
+
export { type AudioActions, type AudioProvider, type AudioState, type BlockMarker, BlockRenderer, type CaptionMode, CaptionOverlay, type CaptionStyle, type ControlsLayout, type DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, DocPlayerWithSidebar, DocProgressBar, type ImageDisplayMode, ImageLayer, InlineAudioPlayer, type InlineAudioPlayerProps, InlineVideoPlayer, type InlineVideoPlayerProps, JsonView, type JsonViewProps, LinearDocView, type LinearDocViewProps, MapLayer, MarkdownRenderer, MediaContext, type PlaybackActions$1 as PlaybackActions, type PlaybackState$1 as PlaybackState, type RenderAudioSegmentInfo, type RenderBlockInfo, type RenderCaptionInfo, type RenderChapterInfo, ShapeLayer, type SlideNavActions, SocialCaptionOverlay, type SquisqRenderAPI, type SquisqWindow, TableLayer, TextLayer, VIEWPORT, VideoLayer, formatTime, useAudioSync, useAutoSurface, useDocPlayback, useMediaProvider, useMediaUrl, useViewportOrientation };
|