@bendyline/squisq-react 2.0.1 → 2.2.0
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/LICENSE +21 -0
- package/NOTICE.md +20 -0
- package/README.md +6 -0
- package/dist/index.d.ts +101 -96
- package/dist/index.js +1483 -782
- package/dist/squisq-player.full.global.js +4165 -0
- package/dist/squisq-player.global.js +561 -168
- package/dist/standalone-source.d.ts +1 -0
- package/dist/standalone-source.js +1 -1
- package/dist/styles/index.css +64 -0
- package/package.json +8 -4
- package/dist/index.js.map +0 -1
- package/dist/squisq-player.css +0 -2
- package/dist/squisq-player.css.map +0 -1
- package/dist/squisq-player.global.js.map +0 -1
- package/src/BlockRenderer.tsx +0 -194
- package/src/CaptionOverlay.tsx +0 -111
- package/src/DocControlsBottom.tsx +0 -109
- package/src/DocControlsOverlay.tsx +0 -190
- package/src/DocControlsSidebar.tsx +0 -113
- package/src/DocControlsSlideshow.tsx +0 -360
- package/src/DocPlayer.tsx +0 -1528
- package/src/DocPlayerWithSidebar.tsx +0 -155
- package/src/DocProgressBar.tsx +0 -257
- package/src/InlineAudioPlayer.tsx +0 -46
- package/src/InlineVideoPlayer.tsx +0 -70
- package/src/LinearDocView.tsx +0 -569
- package/src/MarkdownRenderer.tsx +0 -624
- package/src/MediaClipLayer.tsx +0 -145
- package/src/SocialCaptionOverlay.tsx +0 -255
- package/src/__tests__/BlockRenderer.test.tsx +0 -235
- package/src/__tests__/DocControlsSlideshow.test.tsx +0 -221
- package/src/__tests__/DocPlayer.test.tsx +0 -635
- package/src/__tests__/DocPlayerStylesSentinel.test.tsx +0 -41
- package/src/__tests__/DocProgressBar.test.tsx +0 -102
- package/src/__tests__/JsonView.test.tsx +0 -111
- package/src/__tests__/LinearDocView.test.tsx +0 -426
- package/src/__tests__/MapLayer.test.tsx +0 -63
- package/src/__tests__/MarkdownRenderer.test.tsx +0 -357
- package/src/__tests__/MediaClipLayer.test.tsx +0 -70
- package/src/__tests__/MediaContext.test.tsx +0 -51
- package/src/__tests__/PathLayer.test.tsx +0 -84
- package/src/__tests__/TableLayer.test.tsx +0 -142
- package/src/__tests__/VideoLayer.test.tsx +0 -94
- package/src/__tests__/exports.test.ts +0 -55
- package/src/__tests__/fillStyle.test.tsx +0 -160
- package/src/__tests__/standaloneEntry.test.tsx +0 -103
- package/src/__tests__/transitionStyles.test.ts +0 -125
- package/src/__tests__/useAudioSync.test.ts +0 -49
- package/src/__tests__/useDocPlayback.transition.test.ts +0 -113
- package/src/__tests__/useJsonViewTokens.test.ts +0 -41
- package/src/__tests__/useSlideSwipe.test.ts +0 -81
- package/src/__tests__/useViewportOrientation.test.ts +0 -22
- package/src/hooks/AudioController.ts +0 -114
- package/src/hooks/MediaContext.tsx +0 -97
- package/src/hooks/index.ts +0 -11
- package/src/hooks/useAudioSync.ts +0 -456
- package/src/hooks/useAutoSurface.ts +0 -33
- package/src/hooks/useDocPlayback.ts +0 -265
- package/src/hooks/useMediaSchedule.ts +0 -39
- package/src/hooks/useSlideSwipe.ts +0 -265
- package/src/hooks/useViewportOrientation.ts +0 -115
- package/src/index.ts +0 -70
- package/src/jsonView/JsonView.tsx +0 -51
- package/src/jsonView/RenderNode.tsx +0 -51
- package/src/jsonView/index.ts +0 -2
- package/src/jsonView/json-view.css +0 -206
- package/src/jsonView/useJsonViewTokens.ts +0 -32
- package/src/jsonView/viewers.tsx +0 -343
- package/src/layers/ImageLayer.tsx +0 -297
- package/src/layers/MapLayer.tsx +0 -185
- package/src/layers/PathLayer.tsx +0 -155
- package/src/layers/ShapeLayer.tsx +0 -158
- package/src/layers/TableLayer.tsx +0 -129
- package/src/layers/TextLayer.tsx +0 -571
- package/src/layers/TreeLayer.tsx +0 -167
- package/src/layers/VideoLayer.tsx +0 -171
- package/src/layers/index.ts +0 -6
- package/src/standalone-entry.tsx +0 -337
- package/src/standalone-source.d.ts +0 -10
- package/src/styles/doc-animations.css +0 -2431
- package/src/styles/index.css +0 -7
- package/src/types.ts +0 -183
- package/src/utils/animationUtils.ts +0 -13
- package/src/utils/fillStyle.tsx +0 -148
- package/src/utils/layerUtils.ts +0 -42
- package/src/utils/mapTileUtils.ts +0 -375
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bendyline LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Third-Party Notices for @bendyline/squisq-react
|
|
2
|
+
|
|
3
|
+
This notice applies to the `@bendyline/squisq-react` npm package.
|
|
4
|
+
Squisq-authored code is licensed under the MIT license in `LICENSE`.
|
|
5
|
+
Third-party components remain under their respective license terms.
|
|
6
|
+
|
|
7
|
+
## Runtime, peer, and bundled dependencies
|
|
8
|
+
|
|
9
|
+
| Package | Version | License | Repository |
|
|
10
|
+
| ------------------ | --------- | ------- | ------------------------------------- |
|
|
11
|
+
| @bendyline/squisq | 2.1.0 | MIT | https://github.com/bendyline/squisq |
|
|
12
|
+
| mermaid | 11.16.0 | MIT | https://github.com/mermaid-js/mermaid |
|
|
13
|
+
| preact | 10.29.0 | MIT | https://github.com/preactjs/preact |
|
|
14
|
+
| react _(peer)_ | ^18 / ^19 | MIT | https://github.com/facebook/react |
|
|
15
|
+
| react-dom _(peer)_ | ^18 / ^19 | MIT | https://github.com/facebook/react |
|
|
16
|
+
|
|
17
|
+
Mermaid is Copyright (c) 2014-2022 Knut Sveidqvist and is distributed under
|
|
18
|
+
the MIT License. Preact is used by the standalone browser bundles. Copyright
|
|
19
|
+
and complete license texts for these dependencies are included in their
|
|
20
|
+
respective distributions and source repositories.
|
package/README.md
CHANGED
|
@@ -95,6 +95,12 @@ A self-contained global build is available for non-React environments. It
|
|
|
95
95
|
exposes a `SquisqPlayer` global with `mount`, `getHandle`, `unmount`, and
|
|
96
96
|
`version`. `mount` returns an instance handle.
|
|
97
97
|
|
|
98
|
+
The default build is the light player and omits Mermaid's multi-megabyte parser
|
|
99
|
+
and layout engines. Documents that contain Mermaid fences should use the full
|
|
100
|
+
variant at `dist/squisq-player.full.global.js` (also exported as
|
|
101
|
+
`@bendyline/squisq-react/standalone/full`). Other diagrams are supported by
|
|
102
|
+
both variants.
|
|
103
|
+
|
|
98
104
|
The former `mountStatic()` shortcut was removed; pass `mode: 'static'` to
|
|
99
105
|
`mount()`. Render methods are instance-scoped and are no longer copied to
|
|
100
106
|
top-level `window.seekTo` / `window.getDuration` properties.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Block, Doc, Theme, SurfaceScheme, Transition, CaptionTrack, ViewportConfig as ViewportConfig$1, ImageLayer as ImageLayer$1, TextLayer as TextLayer$1, ShapeLayer as ShapeLayer$1, PathLayer as PathLayer$1, VideoLayer as VideoLayer$1, TableLayer as TableLayer$1, TreeLayer as TreeLayer$1, MapLayer as MapLayer$1, ScheduledClip, AudioTrack, MediaProvider } from '@bendyline/squisq/schemas';
|
|
3
|
-
import { ViewportConfig, ViewportOrientation } from '@bendyline/squisq/doc';
|
|
2
|
+
import { Block, Doc, Theme, SurfaceScheme, Transition, CaptionTrack, ViewportConfig as ViewportConfig$1, ThemePageStyle, ImageLayer as ImageLayer$1, TextLayer as TextLayer$1, ShapeLayer as ShapeLayer$1, PathLayer as PathLayer$1, VideoLayer as VideoLayer$1, TableLayer as TableLayer$1, TreeLayer as TreeLayer$1, MapLayer as MapLayer$1, MermaidLayer as MermaidLayer$1, ScheduledClip, AudioTrack, MediaProvider } from '@bendyline/squisq/schemas';
|
|
3
|
+
import { ViewportConfig, PageTransformHints, PageSectionMaterialization, PageSection, MaterializeBlockLayersOptions, ViewportOrientation } from '@bendyline/squisq/doc';
|
|
4
4
|
export { getAnimationStyle, getTransitionClass } from '@bendyline/squisq/doc';
|
|
5
|
-
import { MarkdownBlockNode, HtmlPolicy } from '@bendyline/squisq/markdown';
|
|
5
|
+
import { MarkdownBlockNode, HtmlPolicy, ResourcePolicy } from '@bendyline/squisq/markdown';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import { RefObject } from 'react';
|
|
8
8
|
import { SquisqAnnotatedSchema } from '@bendyline/squisq/jsonForm';
|
|
@@ -216,116 +216,50 @@ interface SquisqRenderAPI {
|
|
|
216
216
|
declare function formatTime(seconds: number): string;
|
|
217
217
|
|
|
218
218
|
interface DocPlayerProps {
|
|
219
|
-
/**
|
|
220
|
-
* The Doc to play. Wins over `markdown` when both are provided.
|
|
221
|
-
* When neither `doc` nor `markdown` is given, the player renders a
|
|
222
|
-
* minimal themed empty state instead of crashing.
|
|
223
|
-
*/
|
|
219
|
+
/** The Doc to play. Wins over `markdown` when both are provided. */
|
|
224
220
|
doc?: Doc;
|
|
225
|
-
/**
|
|
226
|
-
* Markdown source to play. When `doc` is absent, the markdown is parsed
|
|
227
|
-
* and converted to a Doc via `markdownToDoc(parseMarkdown(markdown))`.
|
|
228
|
-
* Ignored when `doc` is provided.
|
|
229
|
-
*/
|
|
221
|
+
/** Markdown source to convert when `doc` is absent. */
|
|
230
222
|
markdown?: string;
|
|
231
|
-
/** Base path for resolving media URLs (default: `'.'`) */
|
|
223
|
+
/** Base path for resolving media URLs (default: `'.'`). */
|
|
232
224
|
basePath?: string;
|
|
233
|
-
/** Render mode for video capture
|
|
225
|
+
/** Render mode for deterministic video capture. */
|
|
234
226
|
renderMode?: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* Whether to render slide transitions and per-layer animations (default: true).
|
|
237
|
-
* Set to false for static slide changes while preserving timeline and media
|
|
238
|
-
* playback.
|
|
239
|
-
*/
|
|
227
|
+
/** Render slide transitions and per-layer animations (default: true). */
|
|
240
228
|
animationsEnabled?: boolean;
|
|
241
|
-
/**
|
|
242
|
-
* Receives this player's instance-scoped render API, and `null` on cleanup.
|
|
243
|
-
* The API is created in render mode and `?debug=true` mode only.
|
|
244
|
-
*/
|
|
229
|
+
/** Receives the instance-scoped render API, and `null` on cleanup. */
|
|
245
230
|
onRenderAPIReady?: (api: SquisqRenderAPI | null) => void;
|
|
246
|
-
/** Auto-play when loaded */
|
|
247
231
|
autoPlay?: boolean;
|
|
248
|
-
/** Callback when playback ends */
|
|
249
232
|
onEnded?: () => void;
|
|
250
|
-
/** Callback for time updates */
|
|
251
233
|
onTimeUpdate?: (time: number) => void;
|
|
252
|
-
/** Optional audio controller
|
|
234
|
+
/** Optional host-owned audio controller. */
|
|
253
235
|
audioController?: AudioController;
|
|
254
|
-
/**
|
|
236
|
+
/** Explicit synthetic clock for timed documents that intentionally have no audio asset. */
|
|
237
|
+
audioMode?: 'media' | 'synthetic';
|
|
255
238
|
showControls?: boolean;
|
|
256
|
-
/** Show only the progress bar/scrubber at bottom (no other controls).
|
|
257
|
-
* Only takes effect when showControls is false. Allows external controls
|
|
258
|
-
* while keeping the scrubber in-video. */
|
|
259
239
|
showScrubber?: boolean;
|
|
260
|
-
/** Mute audio (default: false) */
|
|
261
240
|
muted?: boolean;
|
|
262
|
-
/** Enable captions (default: true) */
|
|
263
241
|
captionsEnabled?: boolean;
|
|
264
|
-
/** Callback when captions enabled state is toggled */
|
|
265
242
|
onCaptionsToggle?: (enabled: boolean) => void;
|
|
266
|
-
/** Callback for playback state changes (for external controls) */
|
|
267
243
|
onPlaybackStateChange?: (state: PlaybackState$1) => void;
|
|
268
|
-
/** Callback when playback controls are ready (for external controls) */
|
|
269
244
|
onControlsReady?: (controls: PlaybackActions$1 & {
|
|
270
245
|
play: () => void;
|
|
271
246
|
pause: () => void;
|
|
272
247
|
}) => void;
|
|
273
|
-
/** Whether the player is currently in fullscreen mode */
|
|
274
248
|
isFullscreen?: boolean;
|
|
275
|
-
/** Callback to toggle fullscreen mode */
|
|
276
249
|
onFullscreenToggle?: () => void;
|
|
277
|
-
/** Callback when block markers are computed (for external progress bars) */
|
|
278
250
|
onBlockMarkers?: (markers: BlockMarker[]) => void;
|
|
279
|
-
/** Force a specific viewport preset, bypassing window-based orientation detection.
|
|
280
|
-
* Used when the player is rendered in a constrained container (e.g., map overlay panel)
|
|
281
|
-
* whose shape differs from the window's. */
|
|
282
251
|
forceViewport?: ViewportConfig;
|
|
283
|
-
/** Theme to use for rendering (default: DEFAULT_THEME from the theme library) */
|
|
284
252
|
theme?: Theme;
|
|
285
|
-
/**
|
|
286
|
-
* Optional surface scheme (light / dark paper) overlaid on top of the
|
|
287
|
-
* theme's colors. Passed through to the underlying LinearDocView when
|
|
288
|
-
* `displayMode === 'linear'`; otherwise overlaid onto the theme that
|
|
289
|
-
* renders the player's SVG blocks.
|
|
290
|
-
*/
|
|
291
253
|
surface?: SurfaceScheme | 'auto';
|
|
292
|
-
/**
|
|
293
|
-
* Display mode for the player.
|
|
294
|
-
* - `'video'` (default) — Traditional video playback with play/pause, scrub bar, auto-advance.
|
|
295
|
-
* - `'slideshow'` — PowerPoint-style with prev/next buttons. Blocks are static slides
|
|
296
|
-
* that only change on user click. No auto-advance, no scrub bar.
|
|
297
|
-
* - `'linear'` — Long-scrolling document view. Renders markdown as readable HTML with
|
|
298
|
-
* template-annotated sections as inline SVG cards. No audio, no timeline.
|
|
299
|
-
*/
|
|
254
|
+
/** Video, manual slideshow, or long-scrolling linear rendition. */
|
|
300
255
|
displayMode?: DisplayMode;
|
|
301
|
-
/**
|
|
302
|
-
* Whether to synthesize and show the managed cover slide from
|
|
303
|
-
* `doc.startBlock`. Defaults to true for existing documents.
|
|
304
|
-
*/
|
|
305
256
|
showCoverSlide?: boolean;
|
|
306
|
-
/**
|
|
307
|
-
* Optional controlled cover visibility. Intended for synchronized audience
|
|
308
|
-
* mirrors that follow another DocPlayer's visual cursor. When omitted, the
|
|
309
|
-
* player owns its normal cover lifecycle.
|
|
310
|
-
*/
|
|
311
257
|
coverVisible?: boolean;
|
|
312
|
-
/** Caption display style (default: 'standard').
|
|
313
|
-
* 'social' shows large centered words with the active word highlighted. */
|
|
314
258
|
captionStyle?: CaptionStyle;
|
|
315
|
-
/**
|
|
316
|
-
* Enable drag-to-swipe slide navigation in slideshow mode (default: true).
|
|
317
|
-
* When enabled, press-and-drag on a slide advances/rewinds on release past a
|
|
318
|
-
* threshold (or a quick flick), and snaps back otherwise. Only applies when
|
|
319
|
-
* `displayMode === 'slideshow'` and not in render/headless mode.
|
|
320
|
-
*/
|
|
321
259
|
enableSwipe?: boolean;
|
|
322
|
-
/**
|
|
323
|
-
* Listen for playback/navigation shortcuts at the document level instead of
|
|
324
|
-
* requiring this player to hold focus. Intended for a primary preview or
|
|
325
|
-
* standalone presentation; leave disabled when several players share a page.
|
|
326
|
-
*/
|
|
327
260
|
globalKeyboardShortcuts?: boolean;
|
|
328
261
|
}
|
|
262
|
+
|
|
329
263
|
/**
|
|
330
264
|
* Front-door component: resolves the `doc` / `markdown` props into a Doc
|
|
331
265
|
* and renders a themed empty state when neither is provided. The playback
|
|
@@ -578,6 +512,14 @@ interface MarkdownRendererProps {
|
|
|
578
512
|
*/
|
|
579
513
|
declare function MarkdownRenderer({ nodes, className, htmlPolicy, linkSchemes, }: MarkdownRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
580
514
|
|
|
515
|
+
interface MermaidDiagramProps {
|
|
516
|
+
source: string;
|
|
517
|
+
className?: string;
|
|
518
|
+
ariaLabel?: string;
|
|
519
|
+
}
|
|
520
|
+
/** Read-only Mermaid rendering for page bodies and slide layers. */
|
|
521
|
+
declare function MermaidDiagram({ source, className, ariaLabel, }: MermaidDiagramProps): react_jsx_runtime.JSX.Element;
|
|
522
|
+
|
|
581
523
|
interface LinearDocViewProps {
|
|
582
524
|
/**
|
|
583
525
|
* The Doc to render. Wins over `markdown` when both are provided.
|
|
@@ -592,13 +534,13 @@ interface LinearDocViewProps {
|
|
|
592
534
|
markdown?: string;
|
|
593
535
|
/** Base path for resolving media URLs (images, etc.) */
|
|
594
536
|
basePath?: string;
|
|
595
|
-
/** Viewport config for SVG
|
|
537
|
+
/** Viewport config for embedded SVG canvas sections (default: landscape) */
|
|
596
538
|
viewport?: ViewportConfig$1;
|
|
597
539
|
/** Optional CSS class for the outer container */
|
|
598
540
|
className?: string;
|
|
599
541
|
/** Theme to use for rendering (default: DEFAULT_THEME from the theme library) */
|
|
600
542
|
theme?: Theme;
|
|
601
|
-
/** Whether
|
|
543
|
+
/** Whether embedded canvas sections render their layer animations (default: true). */
|
|
602
544
|
animationsEnabled?: boolean;
|
|
603
545
|
/**
|
|
604
546
|
* Optional surface scheme (light / dark paper) overlaid on top of the
|
|
@@ -609,12 +551,10 @@ interface LinearDocViewProps {
|
|
|
609
551
|
*/
|
|
610
552
|
surface?: SurfaceScheme | 'auto';
|
|
611
553
|
/**
|
|
612
|
-
* Use tight padding + a
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* minimal padding and no max-width cap so the content hugs its
|
|
617
|
-
* container.
|
|
554
|
+
* Use tight padding + a hugging layout. The default layout is a full
|
|
555
|
+
* page with themed section bands. Short conversational snippets like
|
|
556
|
+
* chat replies benefit from a much tighter layout. Set to `true` to
|
|
557
|
+
* render with minimal padding so the content hugs its container.
|
|
618
558
|
*/
|
|
619
559
|
thinMargins?: boolean;
|
|
620
560
|
/**
|
|
@@ -630,21 +570,54 @@ interface LinearDocViewProps {
|
|
|
630
570
|
* currently hold focus. Intended for a primary document preview.
|
|
631
571
|
*/
|
|
632
572
|
globalKeyboardShortcuts?: boolean;
|
|
573
|
+
/**
|
|
574
|
+
* Synthesize a hero section from `doc.startBlock` at the top of the
|
|
575
|
+
* page (default: true). The editor's Cover toggle maps here.
|
|
576
|
+
*/
|
|
577
|
+
showCover?: boolean;
|
|
578
|
+
/**
|
|
579
|
+
* Page hints from the active transform (Summarize) style — spacing and
|
|
580
|
+
* emphasis-curve adjustments defined by `TransformStyleConfig.page`.
|
|
581
|
+
*/
|
|
582
|
+
transformPage?: PageTransformHints;
|
|
633
583
|
}
|
|
634
584
|
type ImageDisplayMode = 'inline' | 'thumbnail';
|
|
635
585
|
/**
|
|
636
|
-
* Renders a Doc as a
|
|
637
|
-
*
|
|
638
|
-
* Non-annotated blocks are rendered as HTML text (headings, paragraphs,
|
|
639
|
-
* lists, etc.) via MarkdownRenderer. Template-annotated blocks are
|
|
640
|
-
* rendered as inline SVG visual cards via BlockRenderer.
|
|
586
|
+
* Renders a Doc as a scrolling, theme-art-directed page.
|
|
641
587
|
*
|
|
642
588
|
* @example
|
|
643
589
|
* ```tsx
|
|
644
590
|
* <LinearDocView doc={doc} basePath="/media/" />
|
|
645
591
|
* ```
|
|
646
592
|
*/
|
|
647
|
-
declare function LinearDocView({ doc, markdown, basePath, viewport, className, theme, surface, animationsEnabled, thinMargins, imageDisplayMode, globalKeyboardShortcuts, }: LinearDocViewProps): react_jsx_runtime.JSX.Element;
|
|
593
|
+
declare function LinearDocView({ doc, markdown, basePath, viewport, className, theme, surface, animationsEnabled, thinMargins, imageDisplayMode, globalKeyboardShortcuts, showCover, transformPage, }: LinearDocViewProps): react_jsx_runtime.JSX.Element;
|
|
594
|
+
|
|
595
|
+
interface PageSectionViewProps {
|
|
596
|
+
entry: PageSectionMaterialization;
|
|
597
|
+
/** Alternation flip for feature-split sections (theme `alternate` hint). */
|
|
598
|
+
featureFlip?: boolean;
|
|
599
|
+
/** True when this is the doc's lead prose section (drop-cap target). */
|
|
600
|
+
isLeadProse?: boolean;
|
|
601
|
+
}
|
|
602
|
+
declare function PageSectionView({ entry, featureFlip, isLeadProse }: PageSectionViewProps): react_jsx_runtime.JSX.Element;
|
|
603
|
+
|
|
604
|
+
interface CanvasSectionProps {
|
|
605
|
+
section: PageSection;
|
|
606
|
+
}
|
|
607
|
+
declare function CanvasSection({ section }: CanvasSectionProps): react_jsx_runtime.JSX.Element | null;
|
|
608
|
+
|
|
609
|
+
interface PageViewContextValue {
|
|
610
|
+
theme: Theme;
|
|
611
|
+
pageStyle: ThemePageStyle;
|
|
612
|
+
basePath: string;
|
|
613
|
+
viewport: ViewportConfig$1;
|
|
614
|
+
/** Options for `materializeBlockLayers` inside canvas embeds. */
|
|
615
|
+
renderContext: MaterializeBlockLayersOptions;
|
|
616
|
+
animationsEnabled: boolean;
|
|
617
|
+
imageDisplayMode: ImageDisplayMode;
|
|
618
|
+
}
|
|
619
|
+
declare const PageViewContext: react.Context<PageViewContextValue>;
|
|
620
|
+
declare function usePageView(): PageViewContextValue;
|
|
648
621
|
|
|
649
622
|
interface InlineVideoPlayerProps {
|
|
650
623
|
/** Source path — resolved through MediaContext when relative. */
|
|
@@ -788,6 +761,17 @@ interface MapLayerProps {
|
|
|
788
761
|
}
|
|
789
762
|
declare function MapLayer({ layer, basePath, viewport, blockTime }: MapLayerProps): react_jsx_runtime.JSX.Element;
|
|
790
763
|
|
|
764
|
+
interface MermaidLayerProps {
|
|
765
|
+
layer: MermaidLayer$1;
|
|
766
|
+
viewport: {
|
|
767
|
+
width: number;
|
|
768
|
+
height: number;
|
|
769
|
+
};
|
|
770
|
+
blockTime: number;
|
|
771
|
+
}
|
|
772
|
+
/** Mermaid diagram hosted in HTML inside the slide SVG. */
|
|
773
|
+
declare function MermaidLayer({ layer, viewport, blockTime }: MermaidLayerProps): react_jsx_runtime.JSX.Element;
|
|
774
|
+
|
|
791
775
|
interface MediaClipLayerProps {
|
|
792
776
|
schedule: ScheduledClip[];
|
|
793
777
|
currentTime: number;
|
|
@@ -813,7 +797,21 @@ declare function MediaClipLayer({ schedule, currentTime, isPlaying, basePath, re
|
|
|
813
797
|
* can supply their own AudioController to DocPlayer instead of this hook.
|
|
814
798
|
*/
|
|
815
799
|
|
|
816
|
-
|
|
800
|
+
type AudioSyncMode = 'media' | 'synthetic';
|
|
801
|
+
declare function useAudioSync(audioRef: RefObject<HTMLAudioElement>, audioTrack: AudioTrack | undefined, basePath?: string, enabled?: boolean, mode?: AudioSyncMode): AudioController;
|
|
802
|
+
|
|
803
|
+
interface ModalDialogOptions {
|
|
804
|
+
/** The backdrop/portal root. Siblings of this branch are made inert. */
|
|
805
|
+
rootRef: RefObject<HTMLElement | null>;
|
|
806
|
+
/** The element with `role="dialog"`; focus is trapped within it. */
|
|
807
|
+
dialogRef: RefObject<HTMLElement | null>;
|
|
808
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
809
|
+
/** Explicit opener/owner to restore after unmount (important when a child uses autofocus). */
|
|
810
|
+
returnFocusRef?: RefObject<HTMLElement | null>;
|
|
811
|
+
onClose: () => void;
|
|
812
|
+
}
|
|
813
|
+
/** Shared focus, keyboard, background-isolation, and restoration behavior for modal dialogs. */
|
|
814
|
+
declare function useModalDialog({ rootRef, dialogRef, initialFocusRef, returnFocusRef, onClose, }: ModalDialogOptions): void;
|
|
817
815
|
|
|
818
816
|
/**
|
|
819
817
|
* useMediaSchedule
|
|
@@ -930,6 +928,13 @@ declare function useViewportOrientation(): UseViewportOrientationResult;
|
|
|
930
928
|
* React context holding the current MediaProvider (or null if none provided).
|
|
931
929
|
*/
|
|
932
930
|
declare const MediaContext: react.Context<MediaProvider | null>;
|
|
931
|
+
/**
|
|
932
|
+
* Policy for document-controlled media URLs. Hosts rendering untrusted
|
|
933
|
+
* documents can provide `LOCAL_ONLY_RESOURCE_POLICY` or an explicit host
|
|
934
|
+
* allow-list without changing their MediaProvider.
|
|
935
|
+
*/
|
|
936
|
+
declare const ResourcePolicyContext: react.Context<ResourcePolicy>;
|
|
937
|
+
declare function useResourcePolicy(): ResourcePolicy;
|
|
933
938
|
/**
|
|
934
939
|
* Hook to access the current MediaProvider from context.
|
|
935
940
|
* Returns null if no provider is set.
|
|
@@ -972,4 +977,4 @@ interface JsonViewProps {
|
|
|
972
977
|
}
|
|
973
978
|
declare function JsonView(props: JsonViewProps): react_jsx_runtime.JSX.Element;
|
|
974
979
|
|
|
975
|
-
export { type AudioActions, type AudioController, type AudioState, type BlockMarker, BlockRenderer, type CaptionMode, CaptionOverlay, type CaptionStyle, type ControlsLayout, type DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, type DocPlayerProps, DocPlayerWithSidebar, DocProgressBar, type ImageDisplayMode, ImageLayer, InlineAudioPlayer, type InlineAudioPlayerProps, InlineVideoPlayer, type InlineVideoPlayerProps, JsonView, type JsonViewProps, LinearDocView, type LinearDocViewProps, MapLayer, MarkdownRenderer, MediaClipLayer, type MediaClipLayerProps, MediaContext, type MediaScheduleController, type MountOptions, PathLayer, type PlaybackActions$1 as PlaybackActions, type PlaybackState$1 as PlaybackState, type RenderAudioSegmentInfo, type RenderBlockInfo, type RenderCaptionInfo, type RenderChapterInfo, ShapeLayer, type SlideNavActions, SocialCaptionOverlay, type SquisqPlayerHandle, type SquisqRenderAPI, TableLayer, TextLayer, TreeLayer, type UseDocPlaybackOptions, VideoLayer, formatTime, useAudioSync, useAutoSurface, useDocPlayback, useMediaProvider, useMediaSchedule, useMediaUrl, useViewportOrientation };
|
|
980
|
+
export { type AudioActions, type AudioController, type AudioState, type BlockMarker, BlockRenderer, CanvasSection, type CanvasSectionProps, type CaptionMode, CaptionOverlay, type CaptionStyle, type ControlsLayout, type DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, type DocPlayerProps, DocPlayerWithSidebar, DocProgressBar, type ImageDisplayMode, ImageLayer, InlineAudioPlayer, type InlineAudioPlayerProps, InlineVideoPlayer, type InlineVideoPlayerProps, JsonView, type JsonViewProps, LinearDocView, type LinearDocViewProps, MapLayer, MarkdownRenderer, MediaClipLayer, type MediaClipLayerProps, MediaContext, type MediaScheduleController, MermaidDiagram, type MermaidDiagramProps, MermaidLayer, type ModalDialogOptions, type MountOptions, PageSectionView, type PageSectionViewProps, PageViewContext, type PageViewContextValue, PathLayer, type PlaybackActions$1 as PlaybackActions, type PlaybackState$1 as PlaybackState, type RenderAudioSegmentInfo, type RenderBlockInfo, type RenderCaptionInfo, type RenderChapterInfo, ResourcePolicyContext, ShapeLayer, type SlideNavActions, SocialCaptionOverlay, type SquisqPlayerHandle, type SquisqRenderAPI, TableLayer, TextLayer, TreeLayer, type UseDocPlaybackOptions, VideoLayer, formatTime, useAudioSync, useAutoSurface, useDocPlayback, useMediaProvider, useMediaSchedule, useMediaUrl, useModalDialog, usePageView, useResourcePolicy, useViewportOrientation };
|