@bendyline/squisq-react 2.12.3 → 2.12.5
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/{chunk-LWB4AM3W.js → chunk-4ILJDBJ7.js} +13 -3
- package/dist/{chunk-PVRZGR5J.js → chunk-5KK6I55U.js} +2 -2
- package/dist/{chunk-CZVZ6AXP.js → chunk-FI7UATA5.js} +1 -1
- package/dist/{chunk-YVQ7KEYI.js → chunk-IERUAQFK.js} +31 -3
- package/dist/{chunk-O2ZISYT3.js → chunk-OSTSRQD3.js} +1 -1
- package/dist/{chunk-M7DM4NOX.js → chunk-PFKYO6C2.js} +1 -1
- package/dist/{chunk-MTVOORBB.js → chunk-RYLHJNQX.js} +300 -136
- package/dist/diagram-pictures/index.js +33 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/json-view/index.js +2 -2
- package/dist/layers/index.js +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/page/index.js +5 -5
- package/dist/player/index.d.ts +1 -1
- package/dist/player/index.js +5 -5
- package/dist/{player-Q28R0dKx.d.ts → player-BdckuwwB.d.ts} +7 -1
- package/dist/squisq-player.full.global.js +427 -427
- package/dist/squisq-player.global.js +75 -75
- package/dist/standalone-player-full.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/dist/styles/index.css +222 -28
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlockRenderer
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-PFKYO6C2.js";
|
|
4
|
+
import "../chunk-4ILJDBJ7.js";
|
|
5
5
|
import "../chunk-EY3DUCK7.js";
|
|
6
6
|
import {
|
|
7
7
|
renderMermaidSvgForExport
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
// src/export/diagramPictures.ts
|
|
11
11
|
import { createElement } from "react";
|
|
12
|
+
import { flushSync } from "react-dom";
|
|
12
13
|
import { createRoot } from "react-dom/client";
|
|
13
14
|
import { VIEWPORT_PRESETS } from "@bendyline/squisq/schemas";
|
|
14
15
|
import {
|
|
@@ -146,10 +147,23 @@ function withExportFont(layer) {
|
|
|
146
147
|
content: { ...layer.content, style: { ...layer.content.style, fontFamily: EXPORT_FONT_STACK } }
|
|
147
148
|
};
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
+
var SETTLE_TIMEOUT_MS = 1e3;
|
|
151
|
+
async function settle(host) {
|
|
150
152
|
await document.fonts?.ready;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
let changed = true;
|
|
154
|
+
const observer = new MutationObserver(() => {
|
|
155
|
+
changed = true;
|
|
156
|
+
});
|
|
157
|
+
observer.observe(host, { subtree: true, childList: true, attributes: true, characterData: true });
|
|
158
|
+
const deadline = Date.now() + SETTLE_TIMEOUT_MS;
|
|
159
|
+
try {
|
|
160
|
+
while (changed && Date.now() < deadline) {
|
|
161
|
+
changed = false;
|
|
162
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
163
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
164
|
+
}
|
|
165
|
+
} finally {
|
|
166
|
+
observer.disconnect();
|
|
153
167
|
}
|
|
154
168
|
}
|
|
155
169
|
async function renderSquisqDiagramPicture(markdown, options = {}) {
|
|
@@ -176,19 +190,21 @@ async function renderSquisqDiagramPicture(markdown, options = {}) {
|
|
|
176
190
|
audioSegment: 0,
|
|
177
191
|
layers: kept
|
|
178
192
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
193
|
+
flushSync(() => {
|
|
194
|
+
root.render(
|
|
195
|
+
createElement(BlockRenderer, {
|
|
196
|
+
block: pictureBlock,
|
|
197
|
+
blockTime: 0,
|
|
198
|
+
basePath: "",
|
|
199
|
+
viewport,
|
|
200
|
+
animationsEnabled: false,
|
|
201
|
+
theme
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
await settle(host);
|
|
190
206
|
const svg = host.querySelector("svg.block-svg");
|
|
191
|
-
if (!svg)
|
|
207
|
+
if (!svg) throw new Error("The diagram rendered no SVG.");
|
|
192
208
|
const box = svg.getBBox();
|
|
193
209
|
if (box.width <= 0 || box.height <= 0) return null;
|
|
194
210
|
const x = box.x - PADDING;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SquisqRenderAPI, V as VideoPresentation$1, P as PipSize, a as PipShape, b as PipPosition } from './player-
|
|
2
|
-
export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, e as CaptionPosition, f as CaptionStyle, g as ControlsLayout, D as DisplayMode, h as DocControlsBottom, i as DocControlsOverlay, j as DocControlsSidebar, k as DocControlsSlideshow, l as DocPlayer, m as DocPlayerProps, n as DocPlayerWithSidebar, o as DocProgressBar, F as FlashcardFaceView, p as FlashcardFaceViewProps, q as FlashcardView, r as FlashcardViewProps, I as InlineAudioPlayer, s as InlineAudioPlayerProps, t as InlineVideoPlayer, u as InlineVideoPlayerProps, M as MediaClipLayer, v as MediaClipLayerProps, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, E as RenderVideoFrameSelector, G as SlideNavActions, H as SocialCaptionOverlay, J as formatTime } from './player-
|
|
1
|
+
import { S as SquisqRenderAPI, V as VideoPresentation$1, P as PipSize, a as PipShape, b as PipPosition } from './player-BdckuwwB.js';
|
|
2
|
+
export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, e as CaptionPosition, f as CaptionStyle, g as ControlsLayout, D as DisplayMode, h as DocControlsBottom, i as DocControlsOverlay, j as DocControlsSidebar, k as DocControlsSlideshow, l as DocPlayer, m as DocPlayerProps, n as DocPlayerWithSidebar, o as DocProgressBar, F as FlashcardFaceView, p as FlashcardFaceViewProps, q as FlashcardView, r as FlashcardViewProps, I as InlineAudioPlayer, s as InlineAudioPlayerProps, t as InlineVideoPlayer, u as InlineVideoPlayerProps, M as MediaClipLayer, v as MediaClipLayerProps, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, E as RenderVideoFrameSelector, G as SlideNavActions, H as SocialCaptionOverlay, J as formatTime } from './player-BdckuwwB.js';
|
|
3
3
|
import { Theme, VideoPresentation, VideoPipSize, VideoPipShape, VideoPipPosition, MotionSpec, Doc, ScheduledClip, MediaProvider, Block, BuildCursor } from '@bendyline/squisq/schemas';
|
|
4
4
|
import { DashboardStyleId, ViewportConfig, CoverSlideTemplate, CoverSlidePlayback } from '@bendyline/squisq/doc';
|
|
5
5
|
export { getAnimationStyle, getTransitionClass } from '@bendyline/squisq/doc';
|
package/dist/index.js
CHANGED
|
@@ -17,17 +17,17 @@ import {
|
|
|
17
17
|
resolveDocPlayerAppearance,
|
|
18
18
|
useBuildNavigation,
|
|
19
19
|
useMediaClipDurations
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RYLHJNQX.js";
|
|
21
21
|
import {
|
|
22
22
|
PaginatedDocView
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FI7UATA5.js";
|
|
24
24
|
import {
|
|
25
25
|
CanvasSection,
|
|
26
26
|
LinearDocView,
|
|
27
27
|
PageSectionView,
|
|
28
28
|
PageViewContext,
|
|
29
29
|
usePageView
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5KK6I55U.js";
|
|
31
31
|
import {
|
|
32
32
|
useModalDialog
|
|
33
33
|
} from "./chunk-JP457U6N.js";
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
JsonView,
|
|
42
42
|
createJsonFormFenceRenderer
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-OSTSRQD3.js";
|
|
44
44
|
import {
|
|
45
45
|
useAutoSurface
|
|
46
46
|
} from "./chunk-TT6ENR6T.js";
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
VideoEmbedFrame,
|
|
55
55
|
useAnimatedImage,
|
|
56
56
|
useFenceRenderers
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-IERUAQFK.js";
|
|
58
58
|
import {
|
|
59
59
|
BlockRenderer
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-PFKYO6C2.js";
|
|
61
61
|
import {
|
|
62
62
|
ImageLayer,
|
|
63
63
|
MapLayer,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
VideoLayer,
|
|
72
72
|
getAnimationStyle,
|
|
73
73
|
getTransitionClass
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-4ILJDBJ7.js";
|
|
75
75
|
import {
|
|
76
76
|
MermaidDiagram
|
|
77
77
|
} from "./chunk-EY3DUCK7.js";
|
package/dist/json-view/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JsonView,
|
|
3
3
|
createJsonFormFenceRenderer
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OSTSRQD3.js";
|
|
5
5
|
import "../chunk-TT6ENR6T.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-IERUAQFK.js";
|
|
7
7
|
import "../chunk-EY3DUCK7.js";
|
|
8
8
|
import "../chunk-JP2VHB5H.js";
|
|
9
9
|
export {
|
package/dist/layers/index.js
CHANGED
package/dist/markdown/index.js
CHANGED
package/dist/page/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PaginatedDocView
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-FI7UATA5.js";
|
|
4
4
|
import {
|
|
5
5
|
CanvasSection,
|
|
6
6
|
LinearDocView,
|
|
7
7
|
PageSectionView,
|
|
8
8
|
PageViewContext,
|
|
9
9
|
usePageView
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-5KK6I55U.js";
|
|
11
11
|
import "../chunk-TT6ENR6T.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-IERUAQFK.js";
|
|
13
|
+
import "../chunk-PFKYO6C2.js";
|
|
14
|
+
import "../chunk-4ILJDBJ7.js";
|
|
15
15
|
import "../chunk-EY3DUCK7.js";
|
|
16
16
|
import "../chunk-JP2VHB5H.js";
|
|
17
17
|
export {
|
package/dist/player/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, f as CaptionStyle, g as ControlsLayout, D as DisplayMode, h as DocControlsBottom, i as DocControlsOverlay, j as DocControlsSidebar, k as DocControlsSlideshow, l as DocPlayer, m as DocPlayerProps, n as DocPlayerWithSidebar, o as DocProgressBar, F as FlashcardFaceView, p as FlashcardFaceViewProps, q as FlashcardView, r as FlashcardViewProps, I as InlineAudioPlayer, s as InlineAudioPlayerProps, t as InlineVideoPlayer, u as InlineVideoPlayerProps, M as MediaClipLayer, v as MediaClipLayerProps, b as PipPosition, a as PipShape, P as PipSize, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, G as SlideNavActions, H as SocialCaptionOverlay, S as SquisqRenderAPI, V as VideoPresentation, J as formatTime } from '../player-
|
|
1
|
+
export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, f as CaptionStyle, g as ControlsLayout, D as DisplayMode, h as DocControlsBottom, i as DocControlsOverlay, j as DocControlsSidebar, k as DocControlsSlideshow, l as DocPlayer, m as DocPlayerProps, n as DocPlayerWithSidebar, o as DocProgressBar, F as FlashcardFaceView, p as FlashcardFaceViewProps, q as FlashcardView, r as FlashcardViewProps, I as InlineAudioPlayer, s as InlineAudioPlayerProps, t as InlineVideoPlayer, u as InlineVideoPlayerProps, M as MediaClipLayer, v as MediaClipLayerProps, b as PipPosition, a as PipShape, P as PipSize, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, G as SlideNavActions, H as SocialCaptionOverlay, S as SquisqRenderAPI, V as VideoPresentation, J as formatTime } from '../player-BdckuwwB.js';
|
|
2
2
|
export { a as CodeBlockCopyContext, C as CodeBlockCopyHandler } from '../MarkdownRenderer-C63CQ9Ca.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@bendyline/squisq/schemas';
|
package/dist/player/index.js
CHANGED
|
@@ -12,18 +12,18 @@ import {
|
|
|
12
12
|
MediaClipLayer,
|
|
13
13
|
SocialCaptionOverlay,
|
|
14
14
|
formatTime
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-RYLHJNQX.js";
|
|
16
|
+
import "../chunk-5KK6I55U.js";
|
|
17
17
|
import "../chunk-3H6QBEYX.js";
|
|
18
18
|
import "../chunk-TT6ENR6T.js";
|
|
19
19
|
import {
|
|
20
20
|
InlineAudioPlayer,
|
|
21
21
|
InlineVideoPlayer
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-IERUAQFK.js";
|
|
23
23
|
import {
|
|
24
24
|
BlockRenderer
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
} from "../chunk-PFKYO6C2.js";
|
|
26
|
+
import "../chunk-4ILJDBJ7.js";
|
|
27
27
|
import "../chunk-EY3DUCK7.js";
|
|
28
28
|
import "../chunk-JP2VHB5H.js";
|
|
29
29
|
export {
|
|
@@ -534,6 +534,12 @@ interface FlashcardViewProps {
|
|
|
534
534
|
fenceRenderers?: FenceRendererMap;
|
|
535
535
|
/** Viewport used to materialize diagrams and other spatial content. */
|
|
536
536
|
viewport?: ViewportConfig$1;
|
|
537
|
+
/**
|
|
538
|
+
* `compact` puts the title, position, and every control in one toolbar
|
|
539
|
+
* above a card with smaller type — for a deck embedded in a dialog or
|
|
540
|
+
* panel rather than given a page of its own. Default: 'comfortable'.
|
|
541
|
+
*/
|
|
542
|
+
density?: 'comfortable' | 'compact';
|
|
537
543
|
className?: string;
|
|
538
544
|
}
|
|
539
545
|
interface FlashcardFaceViewProps {
|
|
@@ -548,7 +554,7 @@ interface FlashcardFaceViewProps {
|
|
|
548
554
|
}
|
|
549
555
|
/** Rich, theme-aware renderer for one materialized flashcard face. */
|
|
550
556
|
declare function FlashcardFaceView(props: FlashcardFaceViewProps): react.JSX.Element;
|
|
551
|
-
declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, className, }: FlashcardViewProps): react.JSX.Element;
|
|
557
|
+
declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, density, className, }: FlashcardViewProps): react.JSX.Element;
|
|
552
558
|
|
|
553
559
|
interface InlineVideoPlayerProps {
|
|
554
560
|
/** Source path — resolved through MediaContext when relative. */
|