@bendyline/squisq 2.13.15 → 2.13.17

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 (38) hide show
  1. package/dist/{Doc-C_Sh49ot.d.ts → Doc-DLfTam0R.d.ts} +24 -1
  2. package/dist/{ImageEditDoc-Sqw3Tw-R.d.ts → ImageEditDoc-DdSHb6sj.d.ts} +1 -1
  3. package/dist/{chunk-L7QZORLB.js → chunk-37RLFDIT.js} +11 -4
  4. package/dist/{chunk-4HQ7QZKB.js → chunk-46QZDTMH.js} +184 -45
  5. package/dist/chunk-4R3YZTPX.js +42 -0
  6. package/dist/{chunk-DBVCSVNV.js → chunk-A4ZFYGU6.js} +13 -38
  7. package/dist/{chunk-2SRF5III.js → chunk-BVL3F64S.js} +1 -1
  8. package/dist/{chunk-FYP7GNER.js → chunk-GDJGWFTY.js} +7 -7
  9. package/dist/{chunk-2CB37BOU.js → chunk-LQCLNOCY.js} +1 -1
  10. package/dist/{chunk-JSGIWW35.js → chunk-MTIR5PWF.js} +1 -1
  11. package/dist/{chunk-DDJHIZED.js → chunk-NBDF6SQ5.js} +21 -1
  12. package/dist/{chunk-OJCAKUHW.js → chunk-RXVY5GNN.js} +12 -6
  13. package/dist/{chunk-N3FQSUVT.js → chunk-SPLTVGQY.js} +2 -2
  14. package/dist/{chunk-OFE5RZWW.js → chunk-W3CMIAHG.js} +35 -7
  15. package/dist/{chunk-Y34KYMAS.js → chunk-Z73DG6IL.js} +1 -1
  16. package/dist/doc/index.d.ts +98 -10
  17. package/dist/doc/index.js +17 -8
  18. package/dist/fence/index.d.ts +1 -1
  19. package/dist/generate/index.d.ts +1 -1
  20. package/dist/imageEdit/index.d.ts +3 -3
  21. package/dist/index.d.ts +6 -6
  22. package/dist/index.js +30 -16
  23. package/dist/jsonForm/index.d.ts +1 -1
  24. package/dist/jsonForm/index.js +5 -4
  25. package/dist/markdown/index.js +2 -2
  26. package/dist/{materializePageSection-Dmf-rf1b.d.ts → materializePageSection-HIoRYiZu.d.ts} +1 -1
  27. package/dist/mediaEdit/index.d.ts +154 -3
  28. package/dist/mediaEdit/index.js +241 -2
  29. package/dist/narration/index.d.ts +1 -1
  30. package/dist/narration/index.js +6 -4
  31. package/dist/recommend/index.js +3 -2
  32. package/dist/schemas/index.d.ts +26 -7
  33. package/dist/schemas/index.js +14 -8
  34. package/dist/{themeLibrary-B4VLovhW.d.ts → themeLibrary-B2K-aAOy.d.ts} +1 -1
  35. package/dist/timing/index.d.ts +1 -1
  36. package/dist/transform/index.d.ts +3 -3
  37. package/dist/transform/index.js +8 -6
  38. package/package.json +1 -1
@@ -5,16 +5,18 @@ import {
5
5
  } from "../chunk-NEWNNLWN.js";
6
6
  import {
7
7
  createMediaTimeMap
8
- } from "../chunk-JSGIWW35.js";
8
+ } from "../chunk-MTIR5PWF.js";
9
9
  import {
10
10
  MEDIA_EDIT_PARAMS,
11
11
  MEDIA_FX_ORDER,
12
12
  MEDIA_FX_SPECS,
13
+ canonicalMediaFx,
13
14
  formatMediaNumber,
14
15
  hasRenderableFx,
15
16
  mediaEditHtmlAttribute,
16
17
  mediaEditValuesFromAttributes,
17
18
  mediaEditValuesFromParams,
19
+ mediaRecipeHash,
18
20
  mediaRenderKey,
19
21
  normalizeMediaCrop,
20
22
  normalizeMediaCuts,
@@ -26,7 +28,7 @@ import {
26
28
  serializeMediaCuts,
27
29
  serializeMediaEdits,
28
30
  serializeMediaFx
29
- } from "../chunk-L7QZORLB.js";
31
+ } from "../chunk-37RLFDIT.js";
30
32
 
31
33
  // src/mediaEdit/renderStore.ts
32
34
  var MEDIA_RENDER_DIR = ".mediaEdits";
@@ -173,6 +175,220 @@ function selectMediaRendersForGc(index, referencedKeys, manifests, now = /* @__P
173
175
  return paths;
174
176
  }
175
177
 
178
+ // src/mediaEdit/bake.ts
179
+ var MEDIA_BAKE_ENGINE = "squisq-media-bake/1";
180
+ var MEDIA_BAKE_MANIFEST_VERSION = 1;
181
+ var MEDIA_CUT_EDGE_FADE_SEC = 0.01;
182
+ var BAKE_EXTENSIONS = /* @__PURE__ */ new Set(["mp4", "webm", "m4a", "wav"]);
183
+ function mediaBakeCuts(clip) {
184
+ return normalizeMediaCuts(
185
+ clip.edits?.cuts ?? [],
186
+ Math.max(0, clip.clipStart ?? 0),
187
+ clip.clipEnd ?? Number.POSITIVE_INFINITY
188
+ );
189
+ }
190
+ function needsMediaBake(clip) {
191
+ const edits = clip.edits;
192
+ if (!edits) return false;
193
+ return mediaBakeCuts(clip).length > 0 || hasRenderableFx(edits.fx) || Boolean(edits.gain) || Boolean(edits.fadeIn) || Boolean(edits.fadeOut) || clip.kind === "video" && edits.crop != null;
194
+ }
195
+ function canBakeMedia(clip) {
196
+ return needsMediaBake(clip) || (clip.clipStart ?? 0) > 0 || clip.clipEnd != null;
197
+ }
198
+ function mediaBakeSpec(clip) {
199
+ const edits = clip.edits;
200
+ const seconds = (value) => value ? formatMediaNumber(value) : "";
201
+ return [
202
+ MEDIA_BAKE_ENGINE,
203
+ clip.src,
204
+ clip.kind,
205
+ `trim=${seconds(clip.clipStart)}-${clip.clipEnd != null ? formatMediaNumber(clip.clipEnd) : ""}`,
206
+ `cuts=${serializeMediaCuts(mediaBakeCuts(clip))}`,
207
+ `fx=${hasRenderableFx(edits?.fx) ? canonicalMediaFx(edits.fx) : ""}`,
208
+ `gain=${edits?.gain ? formatMediaNumber(edits.gain, 2) : ""}`,
209
+ `fadeIn=${seconds(edits?.fadeIn)}`,
210
+ `fadeOut=${seconds(edits?.fadeOut)}`,
211
+ `crop=${clip.kind === "video" && edits?.crop ? serializeMediaCrop(edits.crop) : ""}`
212
+ ].join("\n");
213
+ }
214
+ function mediaBakeKey(clip) {
215
+ return mediaRecipeHash(mediaBakeSpec(clip));
216
+ }
217
+ function mediaBakeFilePath(src, key, extension) {
218
+ return `${MEDIA_RENDER_DIR}/${mediaRenderStem(src)}.${key}.baked.${extension}`;
219
+ }
220
+ function mediaBakeManifestPath(src, key) {
221
+ return `${MEDIA_RENDER_DIR}/${mediaRenderStem(src)}.${key}.baked.json`;
222
+ }
223
+ function parseMediaBakePath(path) {
224
+ const segments = path.split("/");
225
+ const dirIndex = segments.length - 2;
226
+ if (dirIndex < 0 || segments[dirIndex] !== MEDIA_RENDER_DIR) return null;
227
+ const match = segments[segments.length - 1].match(/^(.+)\.([0-9a-f]{12})\.baked\.([a-z0-9]+)$/);
228
+ if (!match) return null;
229
+ const extension = match[3];
230
+ const isManifest = extension === "json";
231
+ if (!isManifest && !BAKE_EXTENSIONS.has(extension)) return null;
232
+ return { stem: match[1], key: match[2], extension, isManifest };
233
+ }
234
+ function isMediaBakePath(path) {
235
+ return parseMediaBakePath(path) != null;
236
+ }
237
+ function buildMediaBakeIndex(entries) {
238
+ const manifests = /* @__PURE__ */ new Map();
239
+ const index = /* @__PURE__ */ new Map();
240
+ for (const entry of entries) {
241
+ const parsed = parseMediaBakePath(entry.name);
242
+ if (!parsed) continue;
243
+ if (parsed.isManifest) manifests.set(parsed.key, entry.name);
244
+ else {
245
+ index.set(parsed.key, {
246
+ key: parsed.key,
247
+ path: entry.name,
248
+ manifestPath: null,
249
+ size: entry.size
250
+ });
251
+ }
252
+ }
253
+ for (const [key, entry] of index) entry.manifestPath = manifests.get(key) ?? null;
254
+ return index;
255
+ }
256
+ function parseMediaBakeManifest(text) {
257
+ let raw;
258
+ try {
259
+ raw = JSON.parse(text);
260
+ } catch {
261
+ return null;
262
+ }
263
+ if (!raw || typeof raw !== "object") return null;
264
+ const m = raw;
265
+ const str = (v) => typeof v === "string";
266
+ const numOrNull = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
267
+ if (m.version !== MEDIA_BAKE_MANIFEST_VERSION) return null;
268
+ if (!str(m.src) || !str(m.key) || !str(m.spec) || !str(m.file) || !str(m.mimeType)) return null;
269
+ if (!str(m.engine) || !str(m.createdAt)) return null;
270
+ return {
271
+ version: MEDIA_BAKE_MANIFEST_VERSION,
272
+ src: m.src,
273
+ key: m.key,
274
+ spec: m.spec,
275
+ file: m.file,
276
+ mimeType: m.mimeType,
277
+ sourceSize: numOrNull(m.sourceSize),
278
+ duration: numOrNull(m.duration),
279
+ engine: m.engine,
280
+ createdAt: m.createdAt
281
+ };
282
+ }
283
+ function serializeMediaBakeManifest(manifest) {
284
+ return `${JSON.stringify(manifest, null, 2)}
285
+ `;
286
+ }
287
+ function isMediaBakeStale(manifest, current) {
288
+ return current.sourceSize != null && manifest.sourceSize != null && current.sourceSize !== manifest.sourceSize;
289
+ }
290
+ function selectSupersededMediaBakes(index, manifests, sources, referencedKeys) {
291
+ const paths = [];
292
+ for (const [key, entry] of index) {
293
+ if (referencedKeys.has(key)) continue;
294
+ const manifest = manifests.get(key);
295
+ if (!manifest || !sources.has(manifest.src)) continue;
296
+ paths.push(entry.path);
297
+ if (entry.manifestPath) paths.push(entry.manifestPath);
298
+ }
299
+ return paths;
300
+ }
301
+ function mediaBakeCopyName(src, extension) {
302
+ const base = src.split(/[?#]/, 1)[0].split("/").pop() || "media";
303
+ const stem = base.replace(/\.[^.]+$/, "") || "media";
304
+ return `${stem}-edited.${extension}`;
305
+ }
306
+ function mediaBakeCopyPath(src, extension) {
307
+ const path = src.split(/[?#]/, 1)[0];
308
+ const slash = path.lastIndexOf("/");
309
+ const name = mediaBakeCopyName(src, extension);
310
+ return slash < 0 ? name : `${path.slice(0, slash + 1)}${name}`;
311
+ }
312
+ function mediaBakeFrameRanges(kept, windowStart, sampleRate) {
313
+ const ranges = [];
314
+ for (const range of kept) {
315
+ const start = Math.max(0, Math.round((range.start - windowStart) * sampleRate));
316
+ const end = Math.round((range.end - windowStart) * sampleRate);
317
+ if (end > start) ranges.push([start, end]);
318
+ }
319
+ return ranges;
320
+ }
321
+ function createMediaBakeAudioStage(options) {
322
+ const { ranges, sampleRate } = options;
323
+ const gain = options.gainDb ? Math.pow(10, options.gainDb / 20) : 1;
324
+ const totalFrames = ranges.reduce((sum, [start, end]) => sum + (end - start), 0);
325
+ const fadeIn = Math.min(totalFrames, Math.round((options.fadeInSec ?? 0) * sampleRate));
326
+ const fadeOut = Math.min(totalFrames, Math.round((options.fadeOutSec ?? 0) * sampleRate));
327
+ const edge = Math.max(1, Math.round(MEDIA_CUT_EDGE_FADE_SEC * sampleRate));
328
+ const joins = [];
329
+ let cumulative = 0;
330
+ for (let i = 0; i < ranges.length - 1; i++) {
331
+ cumulative += ranges[i][1] - ranges[i][0];
332
+ joins.push(cumulative);
333
+ }
334
+ const levelAt = (frame, joinIndex2) => {
335
+ let level = gain;
336
+ if (frame < fadeIn) level *= frame / fadeIn;
337
+ if (frame >= totalFrames - fadeOut) level *= (totalFrames - frame) / fadeOut;
338
+ const join = joins[joinIndex2];
339
+ if (join !== void 0) {
340
+ const distance = frame < join ? join - 1 - frame : frame - join;
341
+ if (distance < edge) level *= distance / edge;
342
+ }
343
+ return level;
344
+ };
345
+ let fed = 0;
346
+ let played = 0;
347
+ let rangeIndex = 0;
348
+ let joinIndex = 0;
349
+ return {
350
+ totalFrames,
351
+ process(block) {
352
+ const length = block[0]?.length ?? 0;
353
+ const blockStart = fed;
354
+ const blockEnd = fed + length;
355
+ fed = blockEnd;
356
+ const slices = [];
357
+ let kept = 0;
358
+ while (rangeIndex < ranges.length) {
359
+ const [rangeStart, rangeEnd] = ranges[rangeIndex];
360
+ if (rangeStart >= blockEnd) break;
361
+ const from = Math.max(rangeStart, blockStart);
362
+ const to = Math.min(rangeEnd, blockEnd);
363
+ if (to > from) {
364
+ slices.push([from - blockStart, to - blockStart]);
365
+ kept += to - from;
366
+ }
367
+ if (rangeEnd > blockEnd) break;
368
+ rangeIndex++;
369
+ }
370
+ if (kept === 0) return null;
371
+ const out = block.map(() => new Float32Array(kept));
372
+ let at = 0;
373
+ for (const [from, to] of slices) {
374
+ for (let c = 0; c < block.length; c++) out[c].set(block[c].subarray(from, to), at);
375
+ at += to - from;
376
+ }
377
+ const first = played;
378
+ const last = played + kept;
379
+ played = last;
380
+ for (let i = 0; i < kept; i++) {
381
+ const frame = first + i;
382
+ while (joinIndex < joins.length && joins[joinIndex] + edge <= frame) joinIndex++;
383
+ const level = levelAt(frame, joinIndex);
384
+ if (level === 1) continue;
385
+ for (const channel of out) channel[i] *= level;
386
+ }
387
+ return out;
388
+ }
389
+ };
390
+ }
391
+
176
392
  // src/mediaEdit/dsp/breath.ts
177
393
  var HOP_SEC = 0.01;
178
394
  var FRAME_SEC = 0.02;
@@ -932,6 +1148,9 @@ function detectPauseCuts(frames, options = {}) {
932
1148
  return cuts;
933
1149
  }
934
1150
  export {
1151
+ MEDIA_BAKE_ENGINE,
1152
+ MEDIA_BAKE_MANIFEST_VERSION,
1153
+ MEDIA_CUT_EDGE_FADE_SEC,
935
1154
  MEDIA_EDIT_PARAMS,
936
1155
  MEDIA_FX_ENGINE,
937
1156
  MEDIA_FX_LOUDNESS_TOLERANCE,
@@ -946,13 +1165,17 @@ export {
946
1165
  analyzeMediaFx,
947
1166
  applyBreathEnvelope,
948
1167
  breathGainAt,
1168
+ buildMediaBakeIndex,
949
1169
  buildMediaRenderIndex,
1170
+ canBakeMedia,
1171
+ canonicalMediaFx,
950
1172
  collectDocMediaClips,
951
1173
  correctedLoudnessAnalysis,
952
1174
  createBreathAnalyzer,
953
1175
  createDenoiseStage,
954
1176
  createLimiter,
955
1177
  createLoudnessMeter,
1178
+ createMediaBakeAudioStage,
956
1179
  createMediaTimeMap,
957
1180
  createResampler,
958
1181
  detectBreaths,
@@ -960,19 +1183,33 @@ export {
960
1183
  formatMediaNumber,
961
1184
  hasRenderableFx,
962
1185
  integratedLoudnessFromSteps,
1186
+ isMediaBakePath,
1187
+ isMediaBakeStale,
963
1188
  isMediaRenderPath,
1189
+ mediaBakeCopyName,
1190
+ mediaBakeCopyPath,
1191
+ mediaBakeCuts,
1192
+ mediaBakeFilePath,
1193
+ mediaBakeFrameRanges,
1194
+ mediaBakeKey,
1195
+ mediaBakeManifestPath,
1196
+ mediaBakeSpec,
964
1197
  mediaClipRenderKey,
965
1198
  mediaEditHtmlAttribute,
966
1199
  mediaEditValuesFromAttributes,
967
1200
  mediaEditValuesFromParams,
1201
+ mediaRecipeHash,
968
1202
  mediaRenderFilePath,
969
1203
  mediaRenderKey,
970
1204
  mediaRenderKeyFor,
971
1205
  mediaRenderManifestPath,
972
1206
  mediaRenderStaleness,
973
1207
  mediaRenderStem,
1208
+ needsMediaBake,
974
1209
  normalizeMediaCrop,
975
1210
  normalizeMediaCuts,
1211
+ parseMediaBakeManifest,
1212
+ parseMediaBakePath,
976
1213
  parseMediaCrop,
977
1214
  parseMediaCuts,
978
1215
  parseMediaEdits,
@@ -982,6 +1219,8 @@ export {
982
1219
  referencedMediaRenderKeys,
983
1220
  renderMediaFx,
984
1221
  selectMediaRendersForGc,
1222
+ selectSupersededMediaBakes,
1223
+ serializeMediaBakeManifest,
985
1224
  serializeMediaCrop,
986
1225
  serializeMediaCuts,
987
1226
  serializeMediaEdits,
@@ -1,4 +1,4 @@
1
- import { U as Doc, bf as PresentationSlideMark, f as AudioBookmark } from '../Doc-C_Sh49ot.js';
1
+ import { U as Doc, bf as PresentationSlideMark, f as AudioBookmark } from '../Doc-DLfTam0R.js';
2
2
  import { d as BuildAdvance } from '../types-Zk8qYuaT.js';
3
3
 
4
4
  /**
@@ -31,7 +31,7 @@ import {
31
31
  traceWordPosAt,
32
32
  transcriptWordKeys,
33
33
  vadStep
34
- } from "../chunk-2CB37BOU.js";
34
+ } from "../chunk-LQCLNOCY.js";
35
35
  import "../chunk-NEWNNLWN.js";
36
36
  import {
37
37
  buildNarrationTimingJson,
@@ -45,11 +45,13 @@ import {
45
45
  wordIndexAtChar,
46
46
  wordIndexAtTime,
47
47
  wordPosAtExpectedSyllables
48
- } from "../chunk-4HQ7QZKB.js";
49
- import "../chunk-OFE5RZWW.js";
48
+ } from "../chunk-46QZDTMH.js";
49
+ import "../chunk-W3CMIAHG.js";
50
50
  import "../chunk-FUBMT6SJ.js";
51
51
  import "../chunk-JNUNNQ74.js";
52
- import "../chunk-L7QZORLB.js";
52
+ import "../chunk-4R3YZTPX.js";
53
+ import "../chunk-MTIR5PWF.js";
54
+ import "../chunk-37RLFDIT.js";
53
55
  import "../chunk-UDPPWYYM.js";
54
56
  import "../chunk-L3KSFLTP.js";
55
57
  import "../chunk-P53Z4RYC.js";
@@ -5,8 +5,9 @@ import {
5
5
  recommendTemplatesForBlock,
6
6
  shapeIsStated,
7
7
  unstatedShapeFallback
8
- } from "../chunk-OFE5RZWW.js";
9
- import "../chunk-L7QZORLB.js";
8
+ } from "../chunk-W3CMIAHG.js";
9
+ import "../chunk-4R3YZTPX.js";
10
+ import "../chunk-37RLFDIT.js";
10
11
  import "../chunk-L3KSFLTP.js";
11
12
  import "../chunk-P53Z4RYC.js";
12
13
  export {
@@ -1,10 +1,10 @@
1
1
  export { B as BUILD_EFFECTS, a as BUILD_MODES, b as BUILD_PARAM_KEYS, c as BUILD_PREVIOUS, d as BuildAdvance, e as BuildCursor, f as BuildSpec, g as BuildStep, h as BuildTiming, i as DEFAULT_TRANSITION_DURATION_SECONDS, aa as TRANSITION_DIRECTIONS, ab as TRANSITION_TYPES, ac as Transition, ad as TransitionDirection, ae as TransitionType, ah as buildSpecParams, ai as isTransitionType, aj as normalizeTransitionDirection, ak as normalizeTransitionType, al as parseBuildSpec, am as recordBuildAdvance, an as resolveBlockTransition, ap as resolveTransitionDuration } from '../types-Zk8qYuaT.js';
2
2
  export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
3
- import { U as Doc, bN as Theme, bQ as ThemePageStyle, bP as ThemeColorScheme, N as DeepPartial, bT as ThemeSeedColors, bO as ThemeColorPalette, a2 as FontFamilyKind, a1 as FontFamily } from '../Doc-C_Sh49ot.js';
4
- export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AreaChartInput, f as AudioBookmark, g as AudioSegment, h as AudioTimingData, i as AudioTrack, B as BarChartInput, j as BigTextInput, k as Block, l as BlockConnection, m as BorderStyle, n as BottomFeatureInput, C as CaptionPhrase, o as CaptionTrack, p as CaptionWord, q as CardsBlockInput, r as ChartBaseFields, s as ChartTemplateInput, t as ColorScheme, u as ColumnChartInput, v as ComparisonBarInput, w as ContentBlockInput, x as CornerBrandingConfig, y as CountUpSpec, z as CreateTemplateContextOptions, D as CustomTemplateDefinition, E as CustomTemplateLayer, F as CustomTemplateValidationError, G as CustomTemplateValidationResult, H as CycleBlockInput, I as DARK_SURFACE, J as DEFAULT_DOC_FONT, K as DEFAULT_TITLE_FONT, L as DataTableInput, M as DateEventInput, O as DefinitionCardInput, P as DiagramBlockInput, Q as DiagramEdgeAnchor, R as DiagramTemplateEdge, S as DiagramTemplateNode, T as DiagramTemplateNodeInput, V as DocBlock, W as DocDiagnostic, X as DonutChartInput, Y as DrawingBlockInput, Z as FRONTMATTER_CUSTOM_TEMPLATES_KEY, _ as FRONTMATTER_CUSTOM_THEMES_KEY, $ as FRONTMATTER_MOTION_KEY, a0 as FactCardInput, a3 as FullBleedQuoteInput, a4 as FunnelBlockInput, a5 as GradientBackgroundConfig, a6 as HubBlockInput, a7 as ImageBackgroundConfig, a8 as ImageLayer, a9 as ImageTreatment, aa as ImageWithCaptionInput, ab as LIGHT_SURFACE, ac as Layer, ad as LayerRepeat, ae as LayersBlockInput, af as LayoutHints, ag as LeftFeatureInput, ah as LineChartInput, ai as LinearGradient, aj as ListBlockInput, ak as MOTION_PROFILES, al as MapBlockInput, am as MapLayer, an as MapMarker, ao as MapTileStyle, ap as MarkerStyle, aq as MatrixBlockInput, ar as MediaClip, as as MediaCrop, at as MediaCut, au as MediaEdits, av as MediaOnlyInput, aw as MediaScheduleOptions, ax as MermaidLayer, ay as MotionEntrance, az as MotionOrigin, aA as MotionProfile, aB as MotionProfileName, aC as MotionSpec, aD as MotionState, aE as PAGE_ACCENT_STRATEGIES, aF as PAGE_BACKGROUNDS, aG as PAGE_BACKGROUND_RHYTHMS, aH as PAGE_DESIGN_FAMILIES, aI as PAGE_DIVIDERS, aJ as PAGE_EMPHASES, aK as PAGE_EYEBROWS, aL as PAGE_HEADING_CASES, aM as PAGE_HEADING_SCALES, aN as PAGE_HEADING_UNDERLINES, aO as PAGE_HERO_STYLES, aP as PAGE_IMAGE_FRAMINGS, aQ as PAGE_NUMERAL_STYLES, aR as PAGE_PATTERNS, aS as PAGE_QUOTE_MARKS, aT as PAGE_SECTION_KINDS, aU as PAGE_SECTION_SPACINGS, aV as PAGE_SHADOWS, aW as PAGE_VARIANTS, aX as PageAccentRotation, aY as PageBackground, aZ as PageDesignFamily, a_ as PageEmphasis, a$ as PageHeadingTreatment, b0 as PageSectionKind, b1 as PageSectionOverride, b2 as PageTokens, b3 as PageVariant, b4 as PathLayer, b5 as PatternBackgroundConfig, b6 as PersistentLayer, b7 as PersistentLayerConfig, b8 as PersistentLayerTemplate, b9 as PersistentLayerTemplateConfig, ba as PersistentLayerTemplateType, bb as PhotoGridInput, bc as PieChartInput, bd as PipStyle, be as Position, bf as PresentationSlideMark, bg as ProcessBlockInput, bh as ProgressIndicatorConfig, bi as PromotedBodyAnnotation, bj as PullQuoteInput, bk as PyramidBlockInput, bl as QuoteBlockInput, bm as RawLayersInput, bn as RenderStyle, bo as RightFeatureInput, bp as ScatterChartInput, bq as ScheduledClip, br as SectionHeaderInput, bs as ShapeFilter, bt as ShapeLayer, bu as ShapePattern, bv as SolidBackgroundConfig, bw as StartBlockConfig, bx as StatHighlightInput, by as StatsBlockInput, bz as SurfaceScheme, bA as SvgLayer, bB as THEME_SCHEMA_VERSION, bC as TableLayer, bD as TableLayerStyle, bE as TemplateBlock, bF as TemplateContext, bG as TemplateFunction, bH as TemplateRegistry, bI as TextFlow, bJ as TextLayer, bK as TextParagraph, bL as TextParagraphList, bM as TextStyle, bR as ThemeRegistry, bS as ThemeSchemaVersion, bU as ThemeStyle, bV as ThemeTypography, bW as TimelineBlockInput, bX as TimelineTemplateEvent, bY as TimelineTemplateLink, bZ as TimelineTemplateTrack, b_ as TitleBlockInput, b$ as TitleCaptionConfig, c0 as TopFeatureInput, c1 as TranscriptBlockInput, c2 as TreeBlockInput, c3 as TreeLayer, c4 as TreeLayerItem, c5 as TreeLayerStyle, c6 as TreeTemplateItem, c7 as TwoColumnInput, c8 as VIEWPORT_PRESETS, c9 as VennBlockInput, ca as VideoEmbedLayer, cb as VideoLayer, cc as VideoPipPosition, cd as VideoPipShape, ce as VideoPipSize, cf as VideoPlacement, cg as VideoPresentation, ch as VideoPullQuoteInput, ci as VideoWithCaptionInput, cj as ViewportConfig, ck as ViewportOrientation, cl as ViewportPreset, cm as VignetteConfig, cn as applySurface, co as calculateDuration, cp as calculateFontScale, cq as createTemplateContext, cr as createTheme, cs as createThemeRegistry, ct as getAspectRatioString, cu as getBlockAtTime, cv as getCaptionAtTime, cw as getDocPlaybackDuration, cx as getLayoutHints, cy as getSafeTextBounds, cz as getSegmentAtTime, cA as getTwoColumnPositions, cB as getViewport, cC as getViewportOrientation, cD as isCustomTemplateDefinition, cE as isMotionProfileName, cF as isPersistentLayerTemplate, cG as isTemplateBlock, cH as layoutScaledFontSize, cI as readFrontmatterMotion, cJ as resolveMediaSchedule, cK as resolveMotionForDoc, cL as resolveMotionProfile, cM as scaledFontSize, cN as scheduleMediaClip, cO as validateCustomTemplateDefinition } from '../Doc-C_Sh49ot.js';
5
- export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-B4VLovhW.js';
3
+ import { U as Doc, bN as Theme, bQ as ThemePageStyle, bP as ThemeColorScheme, N as DeepPartial, bT as ThemeSeedColors, bO as ThemeColorPalette, a2 as FontFamilyKind, a1 as FontFamily } from '../Doc-DLfTam0R.js';
4
+ export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AreaChartInput, f as AudioBookmark, g as AudioSegment, h as AudioTimingData, i as AudioTrack, B as BarChartInput, j as BigTextInput, k as Block, l as BlockConnection, m as BorderStyle, n as BottomFeatureInput, C as CaptionPhrase, o as CaptionTrack, p as CaptionWord, q as CardsBlockInput, r as ChartBaseFields, s as ChartTemplateInput, t as ColorScheme, u as ColumnChartInput, v as ComparisonBarInput, w as ContentBlockInput, x as CornerBrandingConfig, y as CountUpSpec, z as CreateTemplateContextOptions, D as CustomTemplateDefinition, E as CustomTemplateLayer, F as CustomTemplateValidationError, G as CustomTemplateValidationResult, H as CycleBlockInput, I as DARK_SURFACE, J as DEFAULT_DOC_FONT, K as DEFAULT_TITLE_FONT, L as DataTableInput, M as DateEventInput, O as DefinitionCardInput, P as DiagramBlockInput, Q as DiagramEdgeAnchor, R as DiagramTemplateEdge, S as DiagramTemplateNode, T as DiagramTemplateNodeInput, V as DocBlock, W as DocDiagnostic, X as DonutChartInput, Y as DrawingBlockInput, Z as FRONTMATTER_CUSTOM_TEMPLATES_KEY, _ as FRONTMATTER_CUSTOM_THEMES_KEY, $ as FRONTMATTER_MOTION_KEY, a0 as FactCardInput, a3 as FullBleedQuoteInput, a4 as FunnelBlockInput, a5 as GradientBackgroundConfig, a6 as HubBlockInput, a7 as ImageBackgroundConfig, a8 as ImageLayer, a9 as ImageTreatment, aa as ImageWithCaptionInput, ab as LIGHT_SURFACE, ac as Layer, ad as LayerRepeat, ae as LayersBlockInput, af as LayoutHints, ag as LeftFeatureInput, ah as LineChartInput, ai as LinearGradient, aj as ListBlockInput, ak as MOTION_PROFILES, al as MapBlockInput, am as MapLayer, an as MapMarker, ao as MapTileStyle, ap as MarkerStyle, aq as MatrixBlockInput, ar as MediaClip, as as MediaCrop, at as MediaCut, au as MediaEdits, av as MediaOnlyInput, aw as MediaScheduleOptions, ax as MermaidLayer, ay as MotionEntrance, az as MotionOrigin, aA as MotionProfile, aB as MotionProfileName, aC as MotionSpec, aD as MotionState, aE as PAGE_ACCENT_STRATEGIES, aF as PAGE_BACKGROUNDS, aG as PAGE_BACKGROUND_RHYTHMS, aH as PAGE_DESIGN_FAMILIES, aI as PAGE_DIVIDERS, aJ as PAGE_EMPHASES, aK as PAGE_EYEBROWS, aL as PAGE_HEADING_CASES, aM as PAGE_HEADING_SCALES, aN as PAGE_HEADING_UNDERLINES, aO as PAGE_HERO_STYLES, aP as PAGE_IMAGE_FRAMINGS, aQ as PAGE_NUMERAL_STYLES, aR as PAGE_PATTERNS, aS as PAGE_QUOTE_MARKS, aT as PAGE_SECTION_KINDS, aU as PAGE_SECTION_SPACINGS, aV as PAGE_SHADOWS, aW as PAGE_VARIANTS, aX as PageAccentRotation, aY as PageBackground, aZ as PageDesignFamily, a_ as PageEmphasis, a$ as PageHeadingTreatment, b0 as PageSectionKind, b1 as PageSectionOverride, b2 as PageTokens, b3 as PageVariant, b4 as PathLayer, b5 as PatternBackgroundConfig, b6 as PersistentLayer, b7 as PersistentLayerConfig, b8 as PersistentLayerTemplate, b9 as PersistentLayerTemplateConfig, ba as PersistentLayerTemplateType, bb as PhotoGridInput, bc as PieChartInput, bd as PipStyle, be as Position, bf as PresentationSlideMark, bg as ProcessBlockInput, bh as ProgressIndicatorConfig, bi as PromotedBodyAnnotation, bj as PullQuoteInput, bk as PyramidBlockInput, bl as QuoteBlockInput, bm as RawLayersInput, bn as RenderStyle, bo as RightFeatureInput, bp as ScatterChartInput, bq as ScheduledClip, br as SectionHeaderInput, bs as ShapeFilter, bt as ShapeLayer, bu as ShapePattern, bv as SolidBackgroundConfig, bw as StartBlockConfig, bx as StatHighlightInput, by as StatsBlockInput, bz as SurfaceScheme, bA as SvgLayer, bB as THEME_SCHEMA_VERSION, bC as TableLayer, bD as TableLayerStyle, bE as TemplateBlock, bF as TemplateContext, bG as TemplateFunction, bH as TemplateRegistry, bI as TextFlow, bJ as TextLayer, bK as TextParagraph, bL as TextParagraphList, bM as TextStyle, bR as ThemeRegistry, bS as ThemeSchemaVersion, bU as ThemeStyle, bV as ThemeTypography, bW as TimelineBlockInput, bX as TimelineTemplateEvent, bY as TimelineTemplateLink, bZ as TimelineTemplateTrack, b_ as TitleBlockInput, b$ as TitleCaptionConfig, c0 as TopFeatureInput, c1 as TranscriptBlockInput, c2 as TreeBlockInput, c3 as TreeLayer, c4 as TreeLayerItem, c5 as TreeLayerStyle, c6 as TreeTemplateItem, c7 as TwoColumnInput, c8 as VIEWPORT_PRESETS, c9 as VennBlockInput, ca as VideoEmbedLayer, cb as VideoLayer, cc as VideoPipPosition, cd as VideoPipShape, ce as VideoPipSize, cf as VideoPlacement, cg as VideoPresentation, ch as VideoPullQuoteInput, ci as VideoWithCaptionInput, cj as ViewportConfig, ck as ViewportOrientation, cl as ViewportPreset, cm as VignetteConfig, cn as applySurface, co as calculateDuration, cp as calculateFontScale, cq as createTemplateContext, cr as createTheme, cs as createThemeRegistry, ct as getAspectRatioString, cu as getBlockAtTime, cv as getCaptionAtTime, cw as getDocPlaybackDuration, cx as getLayoutHints, cy as getSafeTextBounds, cz as getSegmentAtTime, cA as getTwoColumnPositions, cB as getViewport, cC as getViewportOrientation, cD as isCustomTemplateDefinition, cE as isMotionProfileName, cF as isPersistentLayerTemplate, cG as isTemplateBlock, cH as layoutScaledFontSize, cI as readFrontmatterMotion, cJ as resolveMediaSchedule, cK as resolveMotionForDoc, cL as resolveMotionProfile, cM as scaledFontSize, cN as scheduleMediaClip, cO as taskMarker, cP as validateCustomTemplateDefinition } from '../Doc-DLfTam0R.js';
5
+ export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-B2K-aAOy.js';
6
6
  export { M as MediaEntry, a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
7
- export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-Sqw3Tw-R.js';
7
+ export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-DdSHb6sj.js';
8
8
 
9
9
  /**
10
10
  * Runtime validation for the canonical {@link Doc} JSON shape.
@@ -299,15 +299,34 @@ declare function deriveScale(seedHex: string, spread?: number): {
299
299
  };
300
300
 
301
301
  /**
302
- * Translate a Squisq Theme into Mermaid's `themeVariables` vocabulary.
302
+ * Translate a Squisq Theme into Mermaid's theming vocabulary: `themeVariables`,
303
+ * plus the little `themeCSS` that covers what the variables cannot express.
303
304
  *
304
305
  * This module deliberately has no Mermaid dependency. Both the editor and
305
- * read-only React renderers use the returned plain object immediately before
306
+ * read-only React renderers use the returned plain values immediately before
306
307
  * their queued Mermaid render, keeping the two surfaces visually identical.
307
308
  */
308
309
 
309
310
  type MermaidThemeVariables = Record<string, string | number | boolean>;
310
311
  /** Build complete, contrast-aware Mermaid theme variables from a Squisq theme. */
311
312
  declare function buildMermaidThemeVariables(theme: Theme): MermaidThemeVariables;
313
+ /**
314
+ * Build the CSS Mermaid needs beyond its theme variables, for the config's
315
+ * `themeCSS`. Pass it wherever `buildMermaidThemeVariables` is passed.
316
+ *
317
+ * Flowcharts, ER, block and requirement diagrams have one text color for every
318
+ * label, `nodeTextColor`, and it is chosen to read on the node fill. An edge
319
+ * label, or the caption beside an icon or image node, sits on the page
320
+ * (`edgeLabelBackground`), where that color can be the page's own: white on
321
+ * white in the Standard theme. Mermaid has no variable for it, so those labels
322
+ * are given the page's text color here.
323
+ *
324
+ * The rules name only the elements Mermaid's own rule colors (`span` for an
325
+ * HTML label, `text` for an SVG one) and carry no `!important`. A color the
326
+ * author sets (`linkStyle 0 color:red`) is written inline on those elements
327
+ * and still wins, and so does a host stylesheet that retints the labels for
328
+ * its own surface.
329
+ */
330
+ declare function buildMermaidThemeCss(theme: Theme): string;
312
331
 
313
- export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, Doc, type DocSchemaIssue, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, type MermaidThemeVariables, type PipStyleVars, STARTER_THEME, Theme, ThemeColorPalette, ThemeColorScheme, ThemePageStyle, ThemeSeedColors, type ValidationError, type ValidationResult, accentToColorScheme, assertDocSchema, assertTheme, buildGoogleFontsUrl, buildMermaidThemeVariables, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, pipStyleVars, relativeLuminance, resolveFontFamily, serializeTheme, validateDocSchema, validateTheme, withAlpha };
332
+ export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, Doc, type DocSchemaIssue, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, type MermaidThemeVariables, type PipStyleVars, STARTER_THEME, Theme, ThemeColorPalette, ThemeColorScheme, ThemePageStyle, ThemeSeedColors, type ValidationError, type ValidationResult, accentToColorScheme, assertDocSchema, assertTheme, buildGoogleFontsUrl, buildMermaidThemeCss, buildMermaidThemeVariables, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, pipStyleVars, relativeLuminance, resolveFontFamily, serializeTheme, validateDocSchema, validateTheme, withAlpha };
@@ -2,24 +2,21 @@ import {
2
2
  STARTER_THEME,
3
3
  accentToColorScheme,
4
4
  assertDocSchema,
5
+ buildMermaidThemeCss,
5
6
  buildMermaidThemeVariables,
6
- calculateDuration,
7
7
  compileTheme,
8
8
  deriveColorPalette,
9
- getBlockAtTime,
10
- getCaptionAtTime,
11
- getSegmentAtTime,
12
9
  parseTheme,
13
10
  pipStyleVars,
14
11
  serializeTheme,
15
12
  validateDocSchema
16
- } from "../chunk-DBVCSVNV.js";
13
+ } from "../chunk-A4ZFYGU6.js";
17
14
  import {
18
15
  defaultPageStyle,
19
16
  getDocPlaybackDuration,
20
17
  resolveMediaSchedule,
21
18
  scheduleMediaClip
22
- } from "../chunk-2SRF5III.js";
19
+ } from "../chunk-BVL3F64S.js";
23
20
  import {
24
21
  AVAILABLE_FONT_STACKS,
25
22
  DARK_SURFACE,
@@ -98,8 +95,15 @@ import {
98
95
  validateTheme,
99
96
  withAlpha
100
97
  } from "../chunk-JNUNNQ74.js";
101
- import "../chunk-JSGIWW35.js";
102
- import "../chunk-L7QZORLB.js";
98
+ import {
99
+ calculateDuration,
100
+ getBlockAtTime,
101
+ getCaptionAtTime,
102
+ getSegmentAtTime,
103
+ taskMarker
104
+ } from "../chunk-4R3YZTPX.js";
105
+ import "../chunk-MTIR5PWF.js";
106
+ import "../chunk-37RLFDIT.js";
103
107
  import {
104
108
  BUILD_EFFECTS,
105
109
  BUILD_MODES,
@@ -165,6 +169,7 @@ export {
165
169
  assertDocSchema,
166
170
  assertTheme,
167
171
  buildGoogleFontsUrl,
172
+ buildMermaidThemeCss,
168
173
  buildMermaidThemeVariables,
169
174
  buildSpecParams,
170
175
  calculateDuration,
@@ -223,6 +228,7 @@ export {
223
228
  scaledFontSize2 as scaledFontSize,
224
229
  scheduleMediaClip,
225
230
  serializeTheme,
231
+ taskMarker,
226
232
  validateCustomTemplateDefinition,
227
233
  validateDocSchema,
228
234
  validateTheme,
@@ -1,4 +1,4 @@
1
- import { bN as Theme, bR as ThemeRegistry } from './Doc-C_Sh49ot.js';
1
+ import { bN as Theme, bR as ThemeRegistry } from './Doc-DLfTam0R.js';
2
2
 
3
3
  /**
4
4
  * Built-in Theme Library
@@ -1,4 +1,4 @@
1
- import { g as AudioSegment, h as AudioTimingData, o as CaptionTrack, U as Doc, k as Block } from '../Doc-C_Sh49ot.js';
1
+ import { g as AudioSegment, h as AudioTimingData, o as CaptionTrack, U as Doc, k as Block } from '../Doc-DLfTam0R.js';
2
2
  import '../types-Zk8qYuaT.js';
3
3
 
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { U as Doc, t as ColorScheme, k as Block, bE as TemplateBlock } from '../Doc-C_Sh49ot.js';
2
- import { s as PageTransformHints, u as PresentationBeatExtras, w as PresentationLayout, v as PresentationBeatLayout, x as PresentationPlan, t as PresentationBeat, g as ConceptTemplateName } from '../materializePageSection-Dmf-rf1b.js';
3
- export { A as AUTHORED_PRESENTATION_LAYOUT, b as CONCEPT_TEMPLATES, P as PRESENTATION_KEY, i as PRESENTATION_LAYOUTS, j as PRESENTATION_LIMITS, E as conceptTemplate, H as parsePresentationPlan, I as presentationBeatExtras, J as presentationLayoutFits, K as presentationLayoutNeeds, L as presentationLayoutProblem, N as presentationStat, Q as serializePresentationPlan } from '../materializePageSection-Dmf-rf1b.js';
1
+ import { U as Doc, t as ColorScheme, k as Block, bE as TemplateBlock } from '../Doc-DLfTam0R.js';
2
+ import { s as PageTransformHints, u as PresentationBeatExtras, w as PresentationLayout, v as PresentationBeatLayout, x as PresentationPlan, t as PresentationBeat, g as ConceptTemplateName } from '../materializePageSection-HIoRYiZu.js';
3
+ export { A as AUTHORED_PRESENTATION_LAYOUT, b as CONCEPT_TEMPLATES, P as PRESENTATION_KEY, i as PRESENTATION_LAYOUTS, j as PRESENTATION_LIMITS, E as conceptTemplate, H as parsePresentationPlan, I as presentationBeatExtras, J as presentationLayoutFits, K as presentationLayoutNeeds, L as presentationLayoutProblem, N as presentationStat, Q as serializePresentationPlan } from '../materializePageSection-HIoRYiZu.js';
4
4
  import { d as ExtractionType, E as ExtractedElement, b as ExtractionOptions } from '../contentExtractor-BNfVJV2U.js';
5
5
  import { f as BuildSpec, M as MarkdownBlockNode } from '../types-Zk8qYuaT.js';
6
6
 
@@ -27,7 +27,7 @@ import {
27
27
  spelledNumbers,
28
28
  statedRanges,
29
29
  ungroundedNumber
30
- } from "../chunk-N3FQSUVT.js";
30
+ } from "../chunk-SPLTVGQY.js";
31
31
  import {
32
32
  DEFAULT_TRANSFORM_STYLE_ID,
33
33
  DYNAMIC_PRESENTATION_STYLE,
@@ -54,7 +54,7 @@ import {
54
54
  serializePresentationHints,
55
55
  transformNarratedSegment,
56
56
  usesDynamicPresentation
57
- } from "../chunk-OJCAKUHW.js";
57
+ } from "../chunk-RXVY5GNN.js";
58
58
  import {
59
59
  AUTHORED_PRESENTATION_LAYOUT,
60
60
  CONCEPT_TEMPLATES,
@@ -69,13 +69,15 @@ import {
69
69
  presentationLayoutProblem,
70
70
  presentationStat,
71
71
  serializePresentationPlan
72
- } from "../chunk-4HQ7QZKB.js";
73
- import "../chunk-OFE5RZWW.js";
72
+ } from "../chunk-46QZDTMH.js";
73
+ import "../chunk-W3CMIAHG.js";
74
74
  import "../chunk-SVN7T6BK.js";
75
75
  import "../chunk-FUBMT6SJ.js";
76
76
  import "../chunk-JNUNNQ74.js";
77
- import "../chunk-L7QZORLB.js";
78
- import "../chunk-DDJHIZED.js";
77
+ import "../chunk-4R3YZTPX.js";
78
+ import "../chunk-MTIR5PWF.js";
79
+ import "../chunk-37RLFDIT.js";
80
+ import "../chunk-NBDF6SQ5.js";
79
81
  import "../chunk-UDPPWYYM.js";
80
82
  import "../chunk-L3KSFLTP.js";
81
83
  import "../chunk-CZ7AUSLI.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.13.15",
3
+ "version": "2.13.17",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",