@bendyline/squisq-react 0.1.2 → 1.0.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.
Files changed (140) hide show
  1. package/README.md +96 -0
  2. package/dist/BlockRenderer.d.ts +37 -0
  3. package/dist/BlockRenderer.d.ts.map +1 -0
  4. package/dist/BlockRenderer.js +51 -0
  5. package/dist/BlockRenderer.js.map +1 -0
  6. package/dist/CaptionOverlay.d.ts +24 -0
  7. package/dist/CaptionOverlay.d.ts.map +1 -0
  8. package/dist/CaptionOverlay.js +40 -0
  9. package/dist/CaptionOverlay.js.map +1 -0
  10. package/dist/DocControlsBottom.d.ts +28 -0
  11. package/dist/DocControlsBottom.d.ts.map +1 -0
  12. package/dist/DocControlsBottom.js +23 -0
  13. package/dist/DocControlsBottom.js.map +1 -0
  14. package/dist/DocControlsOverlay.d.ts +28 -0
  15. package/dist/DocControlsOverlay.d.ts.map +1 -0
  16. package/dist/DocControlsOverlay.js +75 -0
  17. package/dist/DocControlsOverlay.js.map +1 -0
  18. package/dist/DocControlsSidebar.d.ts +27 -0
  19. package/dist/DocControlsSidebar.d.ts.map +1 -0
  20. package/dist/DocControlsSidebar.js +6 -0
  21. package/dist/DocControlsSidebar.js.map +1 -0
  22. package/dist/DocControlsSlideshow.d.ts +20 -0
  23. package/dist/DocControlsSlideshow.d.ts.map +1 -0
  24. package/dist/DocControlsSlideshow.js +69 -0
  25. package/dist/DocControlsSlideshow.js.map +1 -0
  26. package/dist/DocPlayer.d.ts +87 -0
  27. package/dist/DocPlayer.d.ts.map +1 -0
  28. package/dist/DocPlayer.js +604 -0
  29. package/dist/DocPlayer.js.map +1 -0
  30. package/dist/DocPlayerWithSidebar.d.ts +41 -0
  31. package/dist/DocPlayerWithSidebar.d.ts.map +1 -0
  32. package/dist/DocPlayerWithSidebar.js +68 -0
  33. package/dist/DocPlayerWithSidebar.js.map +1 -0
  34. package/dist/DocProgressBar.d.ts +31 -0
  35. package/dist/DocProgressBar.d.ts.map +1 -0
  36. package/dist/DocProgressBar.js +122 -0
  37. package/dist/DocProgressBar.js.map +1 -0
  38. package/dist/LinearDocView.d.ts +47 -0
  39. package/dist/LinearDocView.d.ts.map +1 -0
  40. package/dist/LinearDocView.js +184 -0
  41. package/dist/LinearDocView.js.map +1 -0
  42. package/dist/MarkdownRenderer.d.ts +32 -0
  43. package/dist/MarkdownRenderer.d.ts.map +1 -0
  44. package/dist/MarkdownRenderer.js +133 -0
  45. package/dist/MarkdownRenderer.js.map +1 -0
  46. package/dist/__tests__/BlockRenderer.test.d.ts +2 -0
  47. package/dist/__tests__/BlockRenderer.test.d.ts.map +1 -0
  48. package/dist/__tests__/BlockRenderer.test.js +82 -0
  49. package/dist/__tests__/BlockRenderer.test.js.map +1 -0
  50. package/dist/__tests__/DocControlsSlideshow.test.d.ts +2 -0
  51. package/dist/__tests__/DocControlsSlideshow.test.d.ts.map +1 -0
  52. package/dist/__tests__/DocControlsSlideshow.test.js +88 -0
  53. package/dist/__tests__/DocControlsSlideshow.test.js.map +1 -0
  54. package/dist/__tests__/LinearDocView.test.d.ts +2 -0
  55. package/dist/__tests__/LinearDocView.test.d.ts.map +1 -0
  56. package/dist/__tests__/LinearDocView.test.js +160 -0
  57. package/dist/__tests__/LinearDocView.test.js.map +1 -0
  58. package/dist/__tests__/MarkdownRenderer.test.d.ts +2 -0
  59. package/dist/__tests__/MarkdownRenderer.test.d.ts.map +1 -0
  60. package/dist/__tests__/MarkdownRenderer.test.js +208 -0
  61. package/dist/__tests__/MarkdownRenderer.test.js.map +1 -0
  62. package/dist/__tests__/exports.test.d.ts +2 -0
  63. package/dist/__tests__/exports.test.d.ts.map +1 -0
  64. package/dist/__tests__/exports.test.js +48 -0
  65. package/dist/__tests__/exports.test.js.map +1 -0
  66. package/dist/hooks/AudioProvider.d.ts +71 -0
  67. package/dist/hooks/AudioProvider.d.ts.map +1 -0
  68. package/dist/hooks/AudioProvider.js +52 -0
  69. package/dist/hooks/AudioProvider.js.map +1 -0
  70. package/dist/hooks/MediaContext.d.ts +35 -0
  71. package/dist/hooks/MediaContext.d.ts.map +1 -0
  72. package/dist/hooks/MediaContext.js +66 -0
  73. package/dist/hooks/MediaContext.js.map +1 -0
  74. package/dist/hooks/index.d.ts +6 -0
  75. package/dist/hooks/index.d.ts.map +1 -0
  76. package/dist/hooks/index.js +5 -0
  77. package/dist/hooks/index.js.map +1 -0
  78. package/dist/hooks/useAudioSync.d.ts +18 -0
  79. package/dist/hooks/useAudioSync.d.ts.map +1 -0
  80. package/dist/hooks/useAudioSync.js +338 -0
  81. package/dist/hooks/useAudioSync.js.map +1 -0
  82. package/dist/hooks/useDocPlayback.d.ts +47 -0
  83. package/dist/hooks/useDocPlayback.d.ts.map +1 -0
  84. package/dist/hooks/useDocPlayback.js +176 -0
  85. package/dist/hooks/useDocPlayback.js.map +1 -0
  86. package/dist/hooks/useViewportOrientation.d.ts +31 -0
  87. package/dist/hooks/useViewportOrientation.d.ts.map +1 -0
  88. package/dist/hooks/useViewportOrientation.js +92 -0
  89. package/dist/hooks/useViewportOrientation.js.map +1 -0
  90. package/dist/index.d.ts +25 -563
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +26 -3179
  93. package/dist/index.js.map +1 -1
  94. package/dist/layers/ImageLayer.d.ts +23 -0
  95. package/dist/layers/ImageLayer.d.ts.map +1 -0
  96. package/dist/layers/ImageLayer.js +104 -0
  97. package/dist/layers/ImageLayer.js.map +1 -0
  98. package/dist/layers/MapLayer.d.ts +29 -0
  99. package/dist/layers/MapLayer.d.ts.map +1 -0
  100. package/dist/layers/MapLayer.js +97 -0
  101. package/dist/layers/MapLayer.js.map +1 -0
  102. package/dist/layers/ShapeLayer.d.ts +20 -0
  103. package/dist/layers/ShapeLayer.d.ts.map +1 -0
  104. package/dist/layers/ShapeLayer.js +35 -0
  105. package/dist/layers/ShapeLayer.js.map +1 -0
  106. package/dist/layers/TextLayer.d.ts +23 -0
  107. package/dist/layers/TextLayer.d.ts.map +1 -0
  108. package/dist/layers/TextLayer.js +126 -0
  109. package/dist/layers/TextLayer.js.map +1 -0
  110. package/dist/layers/VideoLayer.d.ts +40 -0
  111. package/dist/layers/VideoLayer.d.ts.map +1 -0
  112. package/dist/layers/VideoLayer.js +105 -0
  113. package/dist/layers/VideoLayer.js.map +1 -0
  114. package/dist/layers/index.d.ts +6 -0
  115. package/dist/layers/index.d.ts.map +1 -0
  116. package/dist/layers/index.js +6 -0
  117. package/dist/layers/index.js.map +1 -0
  118. package/dist/squisq-player.global.js +1 -1
  119. package/dist/standalone-entry.d.ts +61 -0
  120. package/dist/standalone-entry.d.ts.map +1 -0
  121. package/dist/standalone-entry.js +169 -0
  122. package/dist/standalone-entry.js.map +1 -0
  123. package/dist/standalone-source.js +1 -1
  124. package/dist/types.d.ts +131 -0
  125. package/dist/types.d.ts.map +1 -0
  126. package/dist/types.js +21 -0
  127. package/dist/types.js.map +1 -0
  128. package/dist/utils/animationUtils.d.ts +8 -0
  129. package/dist/utils/animationUtils.d.ts.map +1 -0
  130. package/dist/utils/animationUtils.js +8 -0
  131. package/dist/utils/animationUtils.js.map +1 -0
  132. package/dist/utils/layerUtils.d.ts +17 -0
  133. package/dist/utils/layerUtils.d.ts.map +1 -0
  134. package/dist/utils/layerUtils.js +37 -0
  135. package/dist/utils/layerUtils.js.map +1 -0
  136. package/dist/utils/mapTileUtils.d.ts +105 -0
  137. package/dist/utils/mapTileUtils.d.ts.map +1 -0
  138. package/dist/utils/mapTileUtils.js +268 -0
  139. package/dist/utils/mapTileUtils.js.map +1 -0
  140. package/package.json +5 -6
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # @bendyline/squisq-react
2
+
3
+ React component library for playing, rendering, and interacting with Squisq documents. Includes a full-featured doc player, SVG-based block renderer, media layers, and playback hooks.
4
+
5
+ Part of the [Squisq](https://github.com/bendyline/squisq) monorepo.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@bendyline/squisq-react)](https://www.npmjs.com/package/@bendyline/squisq-react)
8
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bendyline/squisq/blob/main/LICENSE)
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install @bendyline/squisq-react @bendyline/squisq
14
+ ```
15
+
16
+ **Peer dependencies:** `react` and `react-dom` (v18 or v19).
17
+
18
+ ## Quick Start
19
+
20
+ ```tsx
21
+ import { DocPlayer } from '@bendyline/squisq-react';
22
+ import '@bendyline/squisq-react/styles';
23
+
24
+ function App() {
25
+ return <DocPlayer doc={myDoc} />;
26
+ }
27
+ ```
28
+
29
+ ## Components
30
+
31
+ | Component | Description |
32
+ | ---------------------- | ------------------------------------------------------------------ |
33
+ | `DocPlayer` | Main document player with timed playback, audio sync, and controls |
34
+ | `LinearDocView` | Scroll-based linear rendering of all blocks |
35
+ | `BlockRenderer` | SVG-based renderer for a single block |
36
+ | `MarkdownRenderer` | Renders Squisq markdown as a visual document |
37
+ | `DocPlayerWithSidebar` | DocPlayer with a sidebar navigation panel |
38
+ | `CaptionOverlay` | Timed caption/subtitle overlay |
39
+ | `DocProgressBar` | Playback progress indicator |
40
+ | `DocControlsOverlay` | Floating playback controls |
41
+ | `DocControlsBottom` | Bottom-bar playback controls |
42
+ | `DocControlsSidebar` | Sidebar navigation controls |
43
+ | `DocControlsSlideshow` | Slideshow-style navigation controls |
44
+
45
+ ## Layers
46
+
47
+ Blocks are composed of typed layers rendered as SVG:
48
+
49
+ | Layer | Description |
50
+ | ------------ | ------------------------------------------ |
51
+ | `ImageLayer` | Background and foreground images |
52
+ | `TextLayer` | Styled text with positioning and animation |
53
+ | `ShapeLayer` | SVG shapes (rectangles, circles, lines) |
54
+ | `VideoLayer` | Embedded video with playback sync |
55
+ | `MapLayer` | Tile-based map rendering |
56
+
57
+ ## Hooks
58
+
59
+ | Hook | Description |
60
+ | ---------------------------------- | ------------------------------------------------------------------ |
61
+ | `useDocPlayback` | Core playback state machine — timing, block transitions, scripting |
62
+ | `useAudioSync` | Synchronizes audio playback with doc timeline |
63
+ | `useViewportOrientation` | Tracks viewport orientation for responsive layouts |
64
+ | `useMediaProvider` / `useMediaUrl` | Media URL resolution via `MediaContext` |
65
+
66
+ ## Standalone Player
67
+
68
+ A self-contained global build is available for non-React environments:
69
+
70
+ ```html
71
+ <script src="https://unpkg.com/@bendyline/squisq-react/dist/squisq-player.global.js"></script>
72
+ <div id="player"></div>
73
+ <script>
74
+ SquisqPlayer.render(document.getElementById('player'), { markdown: '# Hello' });
75
+ </script>
76
+ ```
77
+
78
+ ## Styles
79
+
80
+ Import the animation CSS for block transitions:
81
+
82
+ ```ts
83
+ import '@bendyline/squisq-react/styles';
84
+ ```
85
+
86
+ ## Related Packages
87
+
88
+ | Package | Description |
89
+ | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
90
+ | [@bendyline/squisq](https://www.npmjs.com/package/@bendyline/squisq) | Headless core — schemas, templates, spatial, markdown, storage |
91
+ | [@bendyline/squisq-formats](https://www.npmjs.com/package/@bendyline/squisq-formats) | DOCX, PDF, HTML import/export |
92
+ | [@bendyline/squisq-editor-react](https://www.npmjs.com/package/@bendyline/squisq-editor-react) | React editor with raw/WYSIWYG/preview modes |
93
+
94
+ ## License
95
+
96
+ [MIT](https://github.com/bendyline/squisq/blob/main/LICENSE)
@@ -0,0 +1,37 @@
1
+ /**
2
+ * BlockRenderer Component
3
+ *
4
+ * Renders a single block as an SVG element with all its layers.
5
+ * Each layer is rendered back-to-front (first layer is background).
6
+ * Handles positioning, animations, and transitions.
7
+ */
8
+ import type { Block } from '@bendyline/squisq/schemas';
9
+ /** Default viewport dimensions (1080p landscape) - for backwards compatibility */
10
+ export declare const VIEWPORT: {
11
+ width: number;
12
+ height: number;
13
+ };
14
+ /** Viewport configuration type */
15
+ export interface ViewportDimensions {
16
+ width: number;
17
+ height: number;
18
+ }
19
+ interface BlockRendererProps {
20
+ /** The block to render */
21
+ block: Block;
22
+ /** Current time relative to block start (seconds) */
23
+ blockTime: number;
24
+ /** Base path for resolving media URLs */
25
+ basePath: string;
26
+ /** Whether this block is entering (for transition) */
27
+ isEntering?: boolean;
28
+ /** Whether this block is exiting (for transition) */
29
+ isExiting?: boolean;
30
+ /** Viewport dimensions (defaults to 1920x1080 landscape) */
31
+ viewport?: ViewportDimensions;
32
+ /** Whether the doc is currently playing (controls video playback) */
33
+ isPlaying?: boolean;
34
+ }
35
+ export declare function BlockRenderer({ block, blockTime, basePath, isEntering, isExiting, viewport, isPlaying, }: BlockRendererProps): import("react/jsx-runtime").JSX.Element;
36
+ export default BlockRenderer;
37
+ //# sourceMappingURL=BlockRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockRenderer.d.ts","sourceRoot":"","sources":["../src/BlockRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,2BAA2B,CAAC;AAQ9D,kFAAkF;AAElF,eAAO,MAAM,QAAQ;;;CAGpB,CAAC;AAEF,kCAAkC;AAClC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,kBAAkB;IAC1B,0BAA0B;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,QAAQ,EACR,UAAkB,EAClB,SAAiB,EACjB,QAAmB,EACnB,SAAS,GACV,EAAE,kBAAkB,2CAgDpB;AA2CD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ImageLayer } from './layers/ImageLayer';
3
+ import { TextLayer } from './layers/TextLayer';
4
+ import { ShapeLayer } from './layers/ShapeLayer';
5
+ import { MapLayer } from './layers/MapLayer';
6
+ import { VideoLayer } from './layers/VideoLayer';
7
+ import { getTransitionClass } from './utils/animationUtils';
8
+ /** Default viewport dimensions (1080p landscape) - for backwards compatibility */
9
+ // eslint-disable-next-line react-refresh/only-export-components
10
+ export const VIEWPORT = {
11
+ width: 1920,
12
+ height: 1080,
13
+ };
14
+ export function BlockRenderer({ block, blockTime, basePath, isEntering = false, isExiting = false, viewport = VIEWPORT, isPlaying, }) {
15
+ // Build transition class and inline style for dynamic duration
16
+ let transitionClass = '';
17
+ const transitionStyle = {};
18
+ if (block.transition && isEntering) {
19
+ transitionClass = getTransitionClass(block.transition.type, true);
20
+ transitionStyle['--transition-duration'] = `${block.transition.duration}s`;
21
+ }
22
+ else if (block.transition && isExiting) {
23
+ transitionClass = getTransitionClass(block.transition.type, false);
24
+ transitionStyle['--transition-duration'] = `${block.transition.duration}s`;
25
+ }
26
+ // Unique clip path ID per block to avoid conflicts when multiple blocks render simultaneously
27
+ const clipId = `vb-clip-${block.id}`;
28
+ return (_jsxs("svg", { className: `block-svg ${transitionClass}`, style: transitionStyle, viewBox: `0 0 ${viewport.width} ${viewport.height}`, preserveAspectRatio: "xMidYMid meet", overflow: "hidden", "data-block-id": block.id, children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: "0", y: "0", width: viewport.width, height: viewport.height }) }) }), _jsx("g", { clipPath: `url(#${clipId})`, children: (block.layers ?? []).map((layer) => (_jsx(LayerRenderer, { layer: layer, basePath: basePath, viewport: viewport, blockTime: blockTime, isPlaying: isPlaying }, layer.id))) })] }));
29
+ }
30
+ /**
31
+ * Dispatch to the appropriate layer component based on type.
32
+ */
33
+ function LayerRenderer({ layer, basePath, viewport, blockTime, isPlaying }) {
34
+ switch (layer.type) {
35
+ case 'image':
36
+ return (_jsx(ImageLayer, { layer: layer, basePath: basePath, viewport: viewport, blockTime: blockTime }));
37
+ case 'text':
38
+ return _jsx(TextLayer, { layer: layer, viewport: viewport, blockTime: blockTime });
39
+ case 'shape':
40
+ return _jsx(ShapeLayer, { layer: layer, viewport: viewport, blockTime: blockTime });
41
+ case 'map':
42
+ return (_jsx(MapLayer, { layer: layer, basePath: basePath, viewport: viewport, blockTime: blockTime }));
43
+ case 'video':
44
+ return (_jsx(VideoLayer, { layer: layer, basePath: basePath, viewport: viewport, blockTime: blockTime, isPlaying: isPlaying }));
45
+ default:
46
+ console.warn(`Unknown layer type: ${layer.type}`);
47
+ return null;
48
+ }
49
+ }
50
+ export default BlockRenderer;
51
+ //# sourceMappingURL=BlockRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockRenderer.js","sourceRoot":"","sources":["../src/BlockRenderer.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,kFAAkF;AAClF,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;CACb,CAAC;AAyBF,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,QAAQ,EACnB,SAAS,GACU;I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CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * CaptionOverlay Component
3
+ *
4
+ * Displays closed captions synchronized with audio playback.
5
+ * Captions cross-fade smoothly using CSS transitions on a single
6
+ * persistent element (no mount/unmount flicker).
7
+ *
8
+ * The captions are generated by the postprocess-doc command based
9
+ * on article text and audio segment timing.
10
+ */
11
+ import type { CaptionTrack } from '@bendyline/squisq/schemas';
12
+ interface CaptionOverlayProps {
13
+ /** Caption track with timestamped phrases */
14
+ captions: CaptionTrack | undefined;
15
+ /** Current playback time in seconds */
16
+ currentTime: number;
17
+ /** Whether captions are enabled */
18
+ enabled?: boolean;
19
+ /** Font size in pixels (default: 16) */
20
+ fontSize?: number;
21
+ }
22
+ export declare function CaptionOverlay({ captions, currentTime, enabled, fontSize, }: CaptionOverlayProps): import("react/jsx-runtime").JSX.Element;
23
+ export default CaptionOverlay;
24
+ //# sourceMappingURL=CaptionOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaptionOverlay.d.ts","sourceRoot":"","sources":["../src/CaptionOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,UAAU,mBAAmB;IAC3B,6CAA6C;IAC7C,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,WAAW,EACX,OAAc,EACd,QAAa,GACd,EAAE,mBAAmB,2CAqDrB;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getCaptionAtTime } from '@bendyline/squisq/schemas';
3
+ export function CaptionOverlay({ captions, currentTime, enabled = true, fontSize = 16, }) {
4
+ // Derive caption directly from currentTime -- pure computation, no hooks.
5
+ // This avoids race conditions between timeupdate events and async state updates.
6
+ const phrase = enabled && captions ? getCaptionAtTime(captions, currentTime) : null;
7
+ const captionText = phrase?.text ?? null;
8
+ return (_jsx("div", { className: "caption-overlay", style: {
9
+ position: 'absolute',
10
+ top: '6px',
11
+ left: '50%',
12
+ transform: 'translateX(-50%)',
13
+ zIndex: 50,
14
+ pointerEvents: 'none',
15
+ maxWidth: '100%',
16
+ width: '100%',
17
+ textAlign: 'center',
18
+ opacity: captionText ? 1 : 0,
19
+ transition: 'opacity 0.15s ease-in-out',
20
+ padding: '0 4px',
21
+ boxSizing: 'border-box',
22
+ }, children: captionText && (_jsx("div", { style: {
23
+ display: 'inline-block',
24
+ padding: '3px 10px',
25
+ background: 'rgba(0, 0, 0, 0.65)',
26
+ borderRadius: '4px',
27
+ backdropFilter: 'blur(4px)',
28
+ }, children: _jsx("span", { style: {
29
+ color: '#ffffff',
30
+ fontSize: `${fontSize}px`,
31
+ fontFamily: "'Hanken Grotesk', system-ui, sans-serif",
32
+ fontWeight: 500,
33
+ lineHeight: 1.25,
34
+ textShadow: '0 1px 3px rgba(0,0,0,0.5)',
35
+ whiteSpace: 'pre-wrap',
36
+ wordWrap: 'break-word',
37
+ }, children: captionText }) })) }));
38
+ }
39
+ export default CaptionOverlay;
40
+ //# sourceMappingURL=CaptionOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaptionOverlay.js","sourceRoot":"","sources":["../src/CaptionOverlay.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAa7D,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,WAAW,EACX,OAAO,GAAG,IAAI,EACd,QAAQ,GAAG,EAAE,GACO;IACpB,0EAA0E;IAC1E,iFAAiF;IACjF,MAAM,MAAM,GAAG,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,MAAM,WAAW,GAAG,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC;IAEzC,OAAO,CACL,cACE,SAAS,EAAC,iBAAiB,EAC3B,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,kBAAkB;YAC7B,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,MAAM;YACrB,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,UAAU,EAAE,2BAA2B;YACvC,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,YAAY;SACxB,YAEA,WAAW,IAAI,CACd,cACE,KAAK,EAAE;gBACL,OAAO,EAAE,cAAc;gBACvB,OAAO,EAAE,UAAU;gBACnB,UAAU,EAAE,qBAAqB;gBACjC,YAAY,EAAE,KAAK;gBACnB,cAAc,EAAE,WAAW;aAC5B,YAED,eACE,KAAK,EAAE;oBACL,KAAK,EAAE,SAAS;oBAChB,QAAQ,EAAE,GAAG,QAAQ,IAAI;oBACzB,UAAU,EAAE,yCAAyC;oBACrD,UAAU,EAAE,GAAG;oBACf,UAAU,EAAE,IAAI;oBAChB,UAAU,EAAE,2BAA2B;oBACvC,UAAU,EAAE,UAAU;oBACtB,QAAQ,EAAE,YAAY;iBACvB,YAEA,WAAW,GACP,GACH,CACP,GACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * DocControlsBottom Component
3
+ *
4
+ * Horizontal control strip that renders below the doc player video.
5
+ * An alternative to the overlay for landscape mode -- controls sit in a
6
+ * separate bar below the video instead of overlapping the content.
7
+ *
8
+ * Contains: restart, play/pause, time display, progress bar, segment
9
+ * indicator, CC toggle. Same controls as the overlay but in an external bar.
10
+ *
11
+ * Related Files:
12
+ * - DocControlsOverlay.tsx -- Overlay variant (default landscape)
13
+ * - DocControlsSidebar.tsx -- Sidebar variant (portrait)
14
+ * - DocProgressBar.tsx -- Shared progress bar component
15
+ * - types.ts -- PlaybackState/PlaybackActions interfaces
16
+ */
17
+ import type { PlaybackState, PlaybackActions, BlockMarker } from './types';
18
+ import type { Block } from '@bendyline/squisq/schemas';
19
+ interface DocControlsBottomProps {
20
+ state: PlaybackState;
21
+ actions: PlaybackActions;
22
+ blockMarkers: BlockMarker[];
23
+ expandedBlocks: Block[];
24
+ getBlockTitle?: (block: Block) => string;
25
+ }
26
+ export declare function DocControlsBottom({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocControlsBottomProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
28
+ //# sourceMappingURL=DocControlsBottom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsBottom.d.ts","sourceRoot":"","sources":["../src/DocControlsBottom.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,cAAc,EAAE,KAAK,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;CAC1C;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,aAAa,GACd,EAAE,sBAAsB,2CAkExB"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * DocControlsBottom Component
4
+ *
5
+ * Horizontal control strip that renders below the doc player video.
6
+ * An alternative to the overlay for landscape mode -- controls sit in a
7
+ * separate bar below the video instead of overlapping the content.
8
+ *
9
+ * Contains: restart, play/pause, time display, progress bar, segment
10
+ * indicator, CC toggle. Same controls as the overlay but in an external bar.
11
+ *
12
+ * Related Files:
13
+ * - DocControlsOverlay.tsx -- Overlay variant (default landscape)
14
+ * - DocControlsSidebar.tsx -- Sidebar variant (portrait)
15
+ * - DocProgressBar.tsx -- Shared progress bar component
16
+ * - types.ts -- PlaybackState/PlaybackActions interfaces
17
+ */
18
+ import { DocProgressBar } from './DocProgressBar';
19
+ import { formatTime } from './types';
20
+ export function DocControlsBottom({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }) {
21
+ return (_jsxs("div", { className: "doc-controls-bottom", children: [_jsx("button", { className: "bottom-ctrl-btn", onClick: actions.restart, title: "Restart", "aria-label": "Restart from beginning", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) }) }), _jsx("button", { className: "bottom-ctrl-btn bottom-play-btn", onClick: actions.toggle, "aria-label": state.isPlaying ? 'Pause' : 'Play', children: state.isPlaying ? (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) })) : (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M8 5v14l11-7z" }) })) }), _jsxs("span", { className: "bottom-time", children: [formatTime(state.currentTime), " / ", formatTime(state.totalDuration)] }), _jsx(DocProgressBar, { state: state, actions: actions, blockMarkers: blockMarkers, expandedBlocks: expandedBlocks, getBlockTitle: getBlockTitle }), _jsxs("span", { className: "bottom-segment", children: [state.currentBlockIndex + 1, "/", state.totalBlocks] }), state.hasCaptions && (_jsx("button", { className: `bottom-ctrl-btn ${state.captionsEnabled ? 'bottom-ctrl-btn--active' : ''}`, onClick: () => actions.setCaptionsEnabled(!state.captionsEnabled), title: state.captionsEnabled ? 'Hide captions' : 'Show captions', "aria-label": state.captionsEnabled ? 'Hide captions' : 'Show captions', children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z" }) }) }))] }));
22
+ }
23
+ //# sourceMappingURL=DocControlsBottom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsBottom.js","sourceRoot":"","sources":["../src/DocControlsBottom.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAWrC,MAAM,UAAU,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,aAAa,GACU;IACvB,OAAO,CACL,eAAK,SAAS,EAAC,qBAAqB,aAElC,iBACE,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAC,SAAS,gBACJ,wBAAwB,YAEnC,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAA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CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,gBACpD,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,YAErE,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YACjE,eAAM,CAAC,EAAC,qPAAqP,GAAG,GAC5P,GACC,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * DocControlsOverlay Component
3
+ *
4
+ * The default overlay controls that render at the bottom of the doc player
5
+ * video with a gradient background. Contains all playback controls: restart,
6
+ * play/pause, time display, progress bar with block markers, segment indicator,
7
+ * and caption toggle.
8
+ *
9
+ * This is the original control layout extracted from DocPlayer. It's used
10
+ * for the 'overlay' controls layout mode (Flow mode, landscape default).
11
+ *
12
+ * Related Files:
13
+ * - DocPlayer.tsx -- Parent component
14
+ * - DocProgressBar.tsx -- Progress bar sub-component
15
+ * - types.ts -- Shared type definitions
16
+ */
17
+ import type { PlaybackState, PlaybackActions, BlockMarker } from './types';
18
+ import type { Block } from '@bendyline/squisq/schemas';
19
+ interface DocControlsOverlayProps {
20
+ state: PlaybackState;
21
+ actions: PlaybackActions;
22
+ blockMarkers: BlockMarker[];
23
+ expandedBlocks: Block[];
24
+ getBlockTitle?: (block: Block) => string;
25
+ }
26
+ export declare function DocControlsOverlay({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocControlsOverlayProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
28
+ //# sourceMappingURL=DocControlsOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsOverlay.d.ts","sourceRoot":"","sources":["../src/DocControlsOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,UAAU,uBAAuB;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,cAAc,EAAE,KAAK,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;CAC1C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,aAAa,GACd,EAAE,uBAAuB,2CA6IzB"}
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * DocControlsOverlay Component
4
+ *
5
+ * The default overlay controls that render at the bottom of the doc player
6
+ * video with a gradient background. Contains all playback controls: restart,
7
+ * play/pause, time display, progress bar with block markers, segment indicator,
8
+ * and caption toggle.
9
+ *
10
+ * This is the original control layout extracted from DocPlayer. It's used
11
+ * for the 'overlay' controls layout mode (Flow mode, landscape default).
12
+ *
13
+ * Related Files:
14
+ * - DocPlayer.tsx -- Parent component
15
+ * - DocProgressBar.tsx -- Progress bar sub-component
16
+ * - types.ts -- Shared type definitions
17
+ */
18
+ import { DocProgressBar } from './DocProgressBar';
19
+ import { formatTime } from './types';
20
+ export function DocControlsOverlay({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }) {
21
+ return (_jsxs("div", { className: "doc-player__controls", style: {
22
+ position: 'absolute',
23
+ bottom: 0,
24
+ left: 0,
25
+ right: 0,
26
+ padding: '12px 16px',
27
+ background: 'linear-gradient(transparent, rgba(0,0,0,0.8))',
28
+ display: 'flex',
29
+ alignItems: 'center',
30
+ gap: '8px',
31
+ zIndex: 100,
32
+ }, children: [_jsx("button", { onClick: actions.restart, style: {
33
+ background: 'none',
34
+ border: 'none',
35
+ color: 'rgba(255,255,255,0.7)',
36
+ cursor: 'pointer',
37
+ padding: '8px',
38
+ fontSize: '14px',
39
+ display: 'flex',
40
+ alignItems: 'center',
41
+ }, title: "Restart", "aria-label": "Restart from beginning", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) }) }), _jsx("button", { onClick: actions.toggle, style: {
42
+ background: 'rgba(255,255,255,0.2)',
43
+ border: 'none',
44
+ borderRadius: '50%',
45
+ color: 'white',
46
+ cursor: 'pointer',
47
+ padding: '10px',
48
+ fontSize: '16px',
49
+ display: 'flex',
50
+ alignItems: 'center',
51
+ justifyContent: 'center',
52
+ width: '40px',
53
+ height: '40px',
54
+ }, "aria-label": state.isPlaying ? 'Pause' : 'Play', children: state.isPlaying ? (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) })) : (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M8 5v14l11-7z" }) })) }), _jsxs("span", { style: { color: 'white', fontSize: '12px', minWidth: '80px', fontFamily: 'monospace' }, children: [formatTime(state.currentTime), " / ", formatTime(state.totalDuration)] }), _jsx(DocProgressBar, { state: state, actions: actions, blockMarkers: blockMarkers, expandedBlocks: expandedBlocks, getBlockTitle: getBlockTitle }), _jsxs("span", { style: { color: 'rgba(255,255,255,0.5)', fontSize: '11px', whiteSpace: 'nowrap' }, children: [state.currentBlockIndex + 1, "/", state.totalBlocks] }), state.hasCaptions && (_jsx("button", { onClick: () => actions.setCaptionsEnabled(!state.captionsEnabled), style: {
55
+ background: state.captionsEnabled ? 'rgba(255,255,255,0.2)' : 'none',
56
+ border: 'none',
57
+ color: state.captionsEnabled ? 'white' : 'rgba(255,255,255,0.5)',
58
+ cursor: 'pointer',
59
+ padding: '8px',
60
+ fontSize: '12px',
61
+ display: 'flex',
62
+ alignItems: 'center',
63
+ borderRadius: '4px',
64
+ }, title: state.captionsEnabled ? 'Hide captions' : 'Show captions', "aria-label": state.captionsEnabled ? 'Hide captions' : 'Show captions', children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z" }) }) })), actions.toggleFullscreen && (_jsx("button", { onClick: actions.toggleFullscreen, style: {
65
+ background: state.isFullscreen ? 'rgba(255,255,255,0.2)' : 'none',
66
+ border: 'none',
67
+ color: state.isFullscreen ? 'white' : 'rgba(255,255,255,0.5)',
68
+ cursor: 'pointer',
69
+ padding: '8px',
70
+ display: 'flex',
71
+ alignItems: 'center',
72
+ borderRadius: '4px',
73
+ }, title: state.isFullscreen ? 'Exit fullscreen (F)' : 'Fullscreen (F)', "aria-label": state.isFullscreen ? 'Exit fullscreen' : 'Enter fullscreen', children: state.isFullscreen ? (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }) })) : (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }) })) }))] }));
74
+ }
75
+ //# sourceMappingURL=DocControlsOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsOverlay.js","sourceRoot":"","sources":["../src/DocControlsOverlay.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAWrC,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,aAAa,GACW;IACxB,OAAO,CACL,eACE,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,WAAW;YACpB,UAAU,EAAE,+CAA+C;YAC3D,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,GAAG;SACZ,aAGD,iBACE,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE;oBACL,UAAU,EAAE,MAAM;oBAClB,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,uBAAuB;oBAC9B,MAAM,EAAE,SAAS;oBACjB,OAAO,EAAE,KAAK;oBACd,QAAQ,EAAE,MAAM;oBAChB,OAAO,EAAE,MAAM;oBACf,UAAU,EAAE,QAAQ;iBACrB,EACD,KAAK,EAAC,SAAS,gBACJ,wBAAwB,YAEnC,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YACjE,eAAM,CAAC,EAAC,uGAAuG,GAAG,GAC9G,GACC,EAGT,iBACE,OAAO,EAAE,OAAO,CAAC,MAAM,EACvB,KAAK,EAAE;oBACL,UAAU,EAAE,uBAAuB;oBACnC,MAAM,EAAE,M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B,YAAY,EAAE,KAAK;iBACpB,EACD,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gBAAgB,gBACxD,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,YAEtE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YACjE,eAAM,CAAC,EAAC,+EAA+E,GAAG,GACtF,CACP,CAAC,CAAC,CAAC,CACF,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YACjE,eAAM,CAAC,EAAC,gFAAgF,GAAG,GACvF,CACP,GACM,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * DocControlsSidebar Component
3
+ *
4
+ * Vertical control strip that renders alongside the doc player video.
5
+ * Used in portrait orientation to eliminate black bars -- controls sit in a
6
+ * "tab" to the right of the 9:16 video instead of overlaying it.
7
+ *
8
+ * Contains: restart, play/pause, time display, segment indicator, CC toggle.
9
+ * Does NOT contain the scrubber/progress bar (that stays in the video via
10
+ * DocPlayer's showScrubber prop).
11
+ *
12
+ * The sidebar stretches to match the full height of the video and has rounded
13
+ * corners on the right side to create a connected "tab" appearance.
14
+ *
15
+ * Related Files:
16
+ * - DocPlayerWithSidebar.tsx -- Wrapper that composes player + sidebar
17
+ * - DocPlayer.tsx -- Core player (renders with showScrubber=true)
18
+ * - types.ts -- PlaybackState/PlaybackActions interfaces
19
+ */
20
+ import type { PlaybackState, PlaybackActions } from './types';
21
+ interface DocControlsSidebarProps {
22
+ state: PlaybackState;
23
+ actions: PlaybackActions;
24
+ }
25
+ export declare function DocControlsSidebar({ state, actions }: DocControlsSidebarProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
27
+ //# sourceMappingURL=DocControlsSidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsSidebar.d.ts","sourceRoot":"","sources":["../src/DocControlsSidebar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9D,UAAU,uBAAuB;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,uBAAuB,2CA8E7E"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { formatTime } from './types';
3
+ export function DocControlsSidebar({ state, actions }) {
4
+ return (_jsxs("div", { className: "doc-controls-sidebar", children: [_jsx("button", { className: "sidebar-ctrl-btn", onClick: actions.restart, title: "Restart", "aria-label": "Restart from beginning", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) }) }), _jsx("button", { className: "sidebar-ctrl-btn sidebar-play-btn", onClick: actions.toggle, "aria-label": state.isPlaying ? 'Pause' : 'Play', children: state.isPlaying ? (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "22", height: "22", children: _jsx("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) })) : (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "22", height: "22", children: _jsx("path", { d: "M8 5v14l11-7z" }) })) }), _jsxs("div", { className: "sidebar-time", children: [_jsx("div", { children: formatTime(state.currentTime) }), _jsx("div", { className: "sidebar-time-total", children: formatTime(state.totalDuration) })] }), _jsxs("div", { className: "sidebar-segment", children: [state.currentBlockIndex + 1, "/", state.totalBlocks] }), state.hasCaptions && (_jsx("button", { className: `sidebar-ctrl-btn ${state.captionsEnabled ? 'sidebar-ctrl-btn--active' : ''}`, onClick: () => actions.setCaptionsEnabled(!state.captionsEnabled), title: state.captionsEnabled ? 'Hide captions' : 'Show captions', "aria-label": state.captionsEnabled ? 'Hide captions' : 'Show captions', children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z" }) }) })), actions.toggleFullscreen && (_jsx("button", { className: `sidebar-ctrl-btn ${state.isFullscreen ? 'sidebar-ctrl-btn--active' : ''}`, onClick: actions.toggleFullscreen, title: state.isFullscreen ? 'Exit fullscreen (F)' : 'Fullscreen (F)', "aria-label": state.isFullscreen ? 'Exit fullscreen' : 'Enter fullscreen', children: state.isFullscreen ? (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }) })) : (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: _jsx("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }) })) }))] }));
5
+ }
6
+ //# sourceMappingURL=DocControlsSidebar.js.map
@@ -0,0 +1 @@
1
+ {"version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EAAC,MAAM,EAAC,IAAI,YACjE,eAAM,CAAC,EAAC,gFAAgF,GAAG,GACvF,CACP,GACM,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * DocControlsSlideshow Component
3
+ *
4
+ * Compact slide navigation controls for the DocPlayer slideshow display mode.
5
+ * Renders in the lower-right corner with previous / slide counter / next buttons,
6
+ * similar to PowerPoint/Keynote presentation navigation.
7
+ *
8
+ * Related Files:
9
+ * - DocPlayer.tsx — Parent component (renders this when displayMode='slideshow')
10
+ * - DocControlsOverlay.tsx — Video-mode controls (overlay layout)
11
+ * - types.ts — Shared type definitions
12
+ */
13
+ import type { PlaybackState, SlideNavActions } from './types';
14
+ interface DocControlsSlideshowProps {
15
+ state: PlaybackState;
16
+ slideNav: SlideNavActions;
17
+ }
18
+ export declare function DocControlsSlideshow({ state, slideNav }: DocControlsSlideshowProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
20
+ //# sourceMappingURL=DocControlsSlideshow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsSlideshow.d.ts","sourceRoot":"","sources":["../src/DocControlsSlideshow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D,UAAU,yBAAyB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CA+GlF"}
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function DocControlsSlideshow({ state, slideNav }) {
3
+ const { currentBlockIndex, totalBlocks } = state;
4
+ const isFirst = currentBlockIndex <= 0;
5
+ const isLast = currentBlockIndex >= totalBlocks - 1;
6
+ return (_jsxs("div", { className: "doc-controls-slideshow", "data-testid": "slideshow-controls", style: {
7
+ position: 'absolute',
8
+ bottom: '16px',
9
+ right: '16px',
10
+ display: 'flex',
11
+ alignItems: 'center',
12
+ gap: '2px',
13
+ background: 'rgba(0, 0, 0, 0.65)',
14
+ borderRadius: '8px',
15
+ padding: '4px 6px',
16
+ zIndex: 100,
17
+ userSelect: 'none',
18
+ backdropFilter: 'blur(8px)',
19
+ WebkitBackdropFilter: 'blur(8px)',
20
+ }, children: [_jsx("button", { onClick: (e) => {
21
+ e.stopPropagation();
22
+ slideNav.prevSlide();
23
+ }, disabled: isFirst, "data-testid": "slide-prev", "aria-label": "Previous slide", title: "Previous slide", style: {
24
+ background: 'none',
25
+ border: 'none',
26
+ color: isFirst ? 'rgba(255,255,255,0.3)' : 'rgba(255,255,255,0.9)',
27
+ cursor: isFirst ? 'default' : 'pointer',
28
+ padding: '6px 8px',
29
+ display: 'flex',
30
+ alignItems: 'center',
31
+ justifyContent: 'center',
32
+ borderRadius: '4px',
33
+ transition: 'background 0.15s',
34
+ }, onMouseEnter: (e) => {
35
+ if (!isFirst)
36
+ e.currentTarget.style.background = 'rgba(255,255,255,0.1)';
37
+ }, onMouseLeave: (e) => {
38
+ e.currentTarget.style.background = 'none';
39
+ }, children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) }) }), _jsx("span", { "data-testid": "slide-counter", style: {
40
+ color: 'rgba(255,255,255,0.9)',
41
+ fontSize: '13px',
42
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
43
+ fontVariantNumeric: 'tabular-nums',
44
+ minWidth: '48px',
45
+ textAlign: 'center',
46
+ padding: '0 4px',
47
+ letterSpacing: '0.02em',
48
+ }, children: totalBlocks > 0 ? `${currentBlockIndex + 1} / ${totalBlocks}` : '—' }), _jsx("button", { onClick: (e) => {
49
+ e.stopPropagation();
50
+ slideNav.nextSlide();
51
+ }, disabled: isLast, "data-testid": "slide-next", "aria-label": "Next slide", title: "Next slide", style: {
52
+ background: 'none',
53
+ border: 'none',
54
+ color: isLast ? 'rgba(255,255,255,0.3)' : 'rgba(255,255,255,0.9)',
55
+ cursor: isLast ? 'default' : 'pointer',
56
+ padding: '6px 8px',
57
+ display: 'flex',
58
+ alignItems: 'center',
59
+ justifyContent: 'center',
60
+ borderRadius: '4px',
61
+ transition: 'background 0.15s',
62
+ }, onMouseEnter: (e) => {
63
+ if (!isLast)
64
+ e.currentTarget.style.background = 'rgba(255,255,255,0.1)';
65
+ }, onMouseLeave: (e) => {
66
+ e.currentTarget.style.background = 'none';
67
+ }, children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: _jsx("path", { d: "M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z" }) }) })] }));
68
+ }
69
+ //# sourceMappingURL=DocControlsSlideshow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocControlsSlideshow.js","sourceRoot":"","sources":["../src/DocControlsSlideshow.tsx"],"names":[],"mappings":";AAoBA,MAAM,UAAU,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA6B;IACjF,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,iBAAiB,IAAI,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,iBAAiB,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpD,OAAO,CACL,eACE,SAAS,EAAC,wBAAwB,iBACtB,oBAAoB,EAChC,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,KAAK;YACV,UAAU,EAAE,qBAAqB;YACjC,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE,SAAS;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