@bendyline/squisq 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{Doc-ylqWKDc_.d.ts → Doc-DynJleo-.d.ts} +159 -2
  2. package/dist/{ImageEditDoc-D828IXJ1.d.ts → ImageEditDoc-Ca4Tr9uN.d.ts} +1 -1
  3. package/dist/{chunk-PXLVXTLW.js → chunk-ILWDXLUK.js} +24 -6
  4. package/dist/chunk-ILWDXLUK.js.map +1 -0
  5. package/dist/{chunk-W4O2TX5I.js → chunk-JHZWYRSW.js} +569 -1
  6. package/dist/chunk-JHZWYRSW.js.map +1 -0
  7. package/dist/{chunk-X6DUONGT.js → chunk-JI77MGAK.js} +123 -10
  8. package/dist/chunk-JI77MGAK.js.map +1 -0
  9. package/dist/{chunk-TFJVXUHH.js → chunk-OTKVFVL6.js} +1403 -41
  10. package/dist/chunk-OTKVFVL6.js.map +1 -0
  11. package/dist/{chunk-MMPBOUK7.js → chunk-QUUPYOSP.js} +8 -2
  12. package/dist/chunk-QUUPYOSP.js.map +1 -0
  13. package/dist/chunk-VWCJ2WXC.js +215 -0
  14. package/dist/chunk-VWCJ2WXC.js.map +1 -0
  15. package/dist/{chunk-2PWOO4ZE.js → chunk-VYFRI7R6.js} +2 -2
  16. package/dist/{chunk-CY2R2VPR.js → chunk-XNLB57UD.js} +2 -2
  17. package/dist/doc/index.d.ts +144 -5
  18. package/dist/doc/index.js +24 -4
  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 -5
  22. package/dist/index.js +66 -8
  23. package/dist/jsonForm/index.d.ts +1 -1
  24. package/dist/jsonForm/index.js +4 -4
  25. package/dist/materializePageSection-DDzubQXo.d.ts +223 -0
  26. package/dist/narration/index.d.ts +1 -1
  27. package/dist/narration/index.js +3 -3
  28. package/dist/schemas/index.d.ts +30 -5
  29. package/dist/schemas/index.js +41 -3
  30. package/dist/{themeLibrary-RjVgLpUi.d.ts → themeLibrary-B72m0W1y.d.ts} +1 -1
  31. package/dist/transform/index.d.ts +8 -9
  32. package/dist/transform/index.js +1 -1
  33. package/package.json +1 -1
  34. package/src/__tests__/materializeBlockLayers.test.ts +32 -0
  35. package/src/__tests__/materializePageSections.test.ts +404 -0
  36. package/src/__tests__/pageStyle.test.ts +258 -0
  37. package/src/__tests__/templateAnnotationParse.test.ts +13 -0
  38. package/src/doc/index.ts +34 -0
  39. package/src/doc/materializeBlockLayers.ts +170 -9
  40. package/src/doc/page/PageSection.ts +174 -0
  41. package/src/doc/page/materializePageSection.ts +616 -0
  42. package/src/doc/page/resolvePageBlock.ts +108 -0
  43. package/src/doc/page/sectionExtractors.ts +466 -0
  44. package/src/doc/pageCss.ts +628 -0
  45. package/src/doc/templateInputs.ts +1 -0
  46. package/src/schemas/Doc.ts +22 -1
  47. package/src/schemas/PageStyle.ts +213 -0
  48. package/src/schemas/Theme.ts +7 -0
  49. package/src/schemas/index.ts +2 -0
  50. package/src/schemas/pageStyleDefaults.ts +204 -0
  51. package/src/schemas/themeCompile.ts +7 -0
  52. package/src/schemas/themeValidator.ts +183 -0
  53. package/src/schemas/themes/bold.json +29 -0
  54. package/src/schemas/themes/cinematic.json +32 -0
  55. package/src/schemas/themes/documentary.json +29 -0
  56. package/src/schemas/themes/gezellig.json +30 -0
  57. package/src/schemas/themes/magazine.json +37 -0
  58. package/src/schemas/themes/minimalist.json +29 -0
  59. package/src/schemas/themes/morning-light.json +32 -0
  60. package/src/schemas/themes/standard-dark.json +24 -0
  61. package/src/schemas/themes/standard.json +24 -0
  62. package/src/schemas/themes/tech-dark.json +42 -0
  63. package/src/schemas/themes/warm-earth.json +24 -0
  64. package/src/transform/registry.ts +19 -0
  65. package/src/transform/styles/dataDriven.ts +1 -0
  66. package/src/transform/styles/documentary.ts +1 -0
  67. package/src/transform/styles/magazine.ts +1 -0
  68. package/src/transform/styles/minimal.ts +1 -0
  69. package/src/transform/styles/narrative.ts +1 -0
  70. package/src/transform/types.ts +7 -0
  71. package/dist/chunk-FVJUUTEM.js +0 -74
  72. package/dist/chunk-FVJUUTEM.js.map +0 -1
  73. package/dist/chunk-MMPBOUK7.js.map +0 -1
  74. package/dist/chunk-PXLVXTLW.js.map +0 -1
  75. package/dist/chunk-TFJVXUHH.js.map +0 -1
  76. package/dist/chunk-W4O2TX5I.js.map +0 -1
  77. package/dist/chunk-X6DUONGT.js.map +0 -1
  78. /package/dist/{chunk-2PWOO4ZE.js.map → chunk-VYFRI7R6.js.map} +0 -0
  79. /package/dist/{chunk-CY2R2VPR.js.map → chunk-XNLB57UD.js.map} +0 -0
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  reanchorSession,
24
24
  traceWordPosAt,
25
25
  vadStep
26
- } from "./chunk-CY2R2VPR.js";
26
+ } from "./chunk-XNLB57UD.js";
27
27
  import "./chunk-ET53IIEP.js";
28
28
  import {
29
29
  DEFAULT_TRANSFORM_STYLE_ID,
@@ -34,7 +34,7 @@ import {
34
34
  getTransformStyleIds,
35
35
  getTransformStyleSummaries,
36
36
  resolveTransformStyle
37
- } from "./chunk-PXLVXTLW.js";
37
+ } from "./chunk-ILWDXLUK.js";
38
38
  import {
39
39
  extractContent,
40
40
  mapElementToBlock,
@@ -69,7 +69,7 @@ import {
69
69
  resolveRef,
70
70
  setByPointer,
71
71
  toPointer
72
- } from "./chunk-2PWOO4ZE.js";
72
+ } from "./chunk-VYFRI7R6.js";
73
73
  import {
74
74
  IMAGE_EDIT_ASSETS_PREFIX,
75
75
  IMAGE_EDIT_DEFAULT_BASENAME,
@@ -122,7 +122,7 @@ import {
122
122
  getSegmentAtTime,
123
123
  parseTheme,
124
124
  serializeTheme
125
- } from "./chunk-MMPBOUK7.js";
125
+ } from "./chunk-QUUPYOSP.js";
126
126
  import {
127
127
  calculateBearing,
128
128
  decodeGeohash,
@@ -136,7 +136,10 @@ import {
136
136
  haversineDistance
137
137
  } from "./chunk-GZY66SDN.js";
138
138
  import {
139
+ PAGE_BASE_CSS,
139
140
  applyNarrationTiming,
141
+ buildPageCss,
142
+ buildPageCssVars,
140
143
  cssFilterForTreatment,
141
144
  docToMarkdown,
142
145
  getAnimationProgress,
@@ -144,16 +147,23 @@ import {
144
147
  getDefaultAnimationDuration,
145
148
  getTransitionClass,
146
149
  isRepairableDiagram,
150
+ isTemplatedPageBlock,
151
+ materializePageSection,
152
+ materializePageSections,
153
+ pageStyleDataAttributes,
147
154
  renderAsciiDiagram,
148
155
  renderAsciiTimeline,
149
156
  renderTree,
150
157
  repairAsciiDiagram,
151
158
  resolveAudioMapping,
159
+ resolvePageBlock,
160
+ resolvePageStyle,
152
161
  resolveThemeForDoc,
153
162
  scoreTextSimilarity,
163
+ sectionExtractors,
154
164
  validateMarkdownDoc,
155
165
  validateMarkdownSource
156
- } from "./chunk-TFJVXUHH.js";
166
+ } from "./chunk-OTKVFVL6.js";
157
167
  import {
158
168
  ASCII_CHAR_H,
159
169
  ASCII_CHAR_W,
@@ -274,7 +284,7 @@ import {
274
284
  wrapWithPersistentLayers,
275
285
  writeCustomTemplatesToFrontmatter,
276
286
  writeCustomThemesToFrontmatter
277
- } from "./chunk-X6DUONGT.js";
287
+ } from "./chunk-JI77MGAK.js";
278
288
  import {
279
289
  PATH_SHAPE_KINDS,
280
290
  anchorPoint,
@@ -314,9 +324,10 @@ import {
314
324
  recommendTemplatesForBlock
315
325
  } from "./chunk-5UYI3RJB.js";
316
326
  import {
327
+ defaultPageStyle,
317
328
  getDocPlaybackDuration,
318
329
  resolveMediaSchedule
319
- } from "./chunk-FVJUUTEM.js";
330
+ } from "./chunk-VWCJ2WXC.js";
320
331
  import {
321
332
  AVAILABLE_FONT_STACKS,
322
333
  DARK_SURFACE,
@@ -326,6 +337,24 @@ import {
326
337
  FRONTMATTER_CUSTOM_TEMPLATES_KEY,
327
338
  FRONTMATTER_CUSTOM_THEMES_KEY,
328
339
  LIGHT_SURFACE,
340
+ PAGE_ACCENT_STRATEGIES,
341
+ PAGE_BACKGROUNDS,
342
+ PAGE_BACKGROUND_RHYTHMS,
343
+ PAGE_DESIGN_FAMILIES,
344
+ PAGE_DIVIDERS,
345
+ PAGE_EMPHASES,
346
+ PAGE_EYEBROWS,
347
+ PAGE_HEADING_CASES,
348
+ PAGE_HEADING_SCALES,
349
+ PAGE_HEADING_UNDERLINES,
350
+ PAGE_HERO_STYLES,
351
+ PAGE_IMAGE_FRAMINGS,
352
+ PAGE_NUMERAL_STYLES,
353
+ PAGE_PATTERNS,
354
+ PAGE_QUOTE_MARKS,
355
+ PAGE_SECTION_KINDS,
356
+ PAGE_SECTION_SPACINGS,
357
+ PAGE_SHADOWS,
329
358
  THEMES,
330
359
  THEME_SCHEMA_VERSION,
331
360
  applySurface,
@@ -352,7 +381,7 @@ import {
352
381
  resolveTheme,
353
382
  validateTheme,
354
383
  withAlpha
355
- } from "./chunk-W4O2TX5I.js";
384
+ } from "./chunk-JHZWYRSW.js";
356
385
  import {
357
386
  DEFAULT_DOC_FONT,
358
387
  DEFAULT_TITLE_FONT,
@@ -500,6 +529,25 @@ export {
500
529
  LocalStorageAdapter,
501
530
  MemoryContentContainer,
502
531
  MemoryStorageAdapter,
532
+ PAGE_ACCENT_STRATEGIES,
533
+ PAGE_BACKGROUNDS,
534
+ PAGE_BACKGROUND_RHYTHMS,
535
+ PAGE_BASE_CSS,
536
+ PAGE_DESIGN_FAMILIES,
537
+ PAGE_DIVIDERS,
538
+ PAGE_EMPHASES,
539
+ PAGE_EYEBROWS,
540
+ PAGE_HEADING_CASES,
541
+ PAGE_HEADING_SCALES,
542
+ PAGE_HEADING_UNDERLINES,
543
+ PAGE_HERO_STYLES,
544
+ PAGE_IMAGE_FRAMINGS,
545
+ PAGE_NUMERAL_STYLES,
546
+ PAGE_PATTERNS,
547
+ PAGE_QUOTE_MARKS,
548
+ PAGE_SECTION_KINDS,
549
+ PAGE_SECTION_SPACINGS,
550
+ PAGE_SHADOWS,
503
551
  PATH_SHAPE_KINDS,
504
552
  SHAPE_NAMES,
505
553
  STARTER_THEME,
@@ -539,6 +587,8 @@ export {
539
587
  buildJsonFormTokens,
540
588
  buildNarrationScript,
541
589
  buildNarrationTimingJson,
590
+ buildPageCss,
591
+ buildPageCssVars,
542
592
  buildRegistry,
543
593
  buildSvgString,
544
594
  buildVersionPath,
@@ -583,6 +633,7 @@ export {
583
633
  dataTable,
584
634
  dateEvent,
585
635
  decodeGeohash,
636
+ defaultPageStyle,
586
637
  definitionCard,
587
638
  deriveColorPalette,
588
639
  deriveScale,
@@ -701,6 +752,7 @@ export {
701
752
  isRepairableDiagram,
702
753
  isShapeName,
703
754
  isTemplateBlock,
755
+ isTemplatedPageBlock,
704
756
  isTransitionType,
705
757
  isTreeFence,
706
758
  isWrappedFlowTimelineSource,
@@ -721,6 +773,8 @@ export {
721
773
  matchTrailingPandocAttr,
722
774
  matchTrailingTemplateAnnotation,
723
775
  materializeBlockLayers,
776
+ materializePageSection,
777
+ materializePageSections,
724
778
  narrationSessionStep,
725
779
  nearestSnapPoint,
726
780
  needsQuoting,
@@ -732,6 +786,7 @@ export {
732
786
  oklchLighten,
733
787
  oklchSetChroma,
734
788
  pacingStep,
789
+ pageStyleDataAttributes,
735
790
  parseAsciiDiagram,
736
791
  parseAsciiTimeline,
737
792
  parseAsciiTimelineWithStats,
@@ -786,6 +841,8 @@ export {
786
841
  resolveIcon,
787
842
  resolveJsonFormTheme,
788
843
  resolveMediaSchedule,
844
+ resolvePageBlock,
845
+ resolvePageStyle,
789
846
  resolvePersistentLayers,
790
847
  resolveRef,
791
848
  resolveTemplateName,
@@ -804,6 +861,7 @@ export {
804
861
  scaledFontSize2 as scaledFontSize,
805
862
  scopeContainer,
806
863
  scoreTextSimilarity,
864
+ sectionExtractors,
807
865
  sectionHeader,
808
866
  serializePandocAttributes,
809
867
  serializeTheme,
@@ -1,4 +1,4 @@
1
- import { aC as Theme, as as SurfaceScheme } from '../Doc-ylqWKDc_.js';
1
+ import { b1 as Theme, aT as SurfaceScheme } from '../Doc-DynJleo-.js';
2
2
  import '../types-BwMPl2CB.js';
3
3
 
4
4
  /**
@@ -14,10 +14,10 @@ import {
14
14
  resolveRef,
15
15
  setByPointer,
16
16
  toPointer
17
- } from "../chunk-2PWOO4ZE.js";
18
- import "../chunk-MMPBOUK7.js";
19
- import "../chunk-FVJUUTEM.js";
20
- import "../chunk-W4O2TX5I.js";
17
+ } from "../chunk-VYFRI7R6.js";
18
+ import "../chunk-QUUPYOSP.js";
19
+ import "../chunk-VWCJ2WXC.js";
20
+ import "../chunk-JHZWYRSW.js";
21
21
  import "../chunk-5J4HKRJF.js";
22
22
  import "../chunk-QE7TWGVT.js";
23
23
  export {
@@ -0,0 +1,223 @@
1
+ import { B as Block, at as PageSectionKind, ar as PageEmphasis, b3 as ThemeColorScheme, ap as PageBackground, b1 as Theme, bq as ViewportConfig, p as CustomTemplateDefinition, aR as StartBlockConfig, F as Doc, b4 as ThemePageStyle } from './Doc-DynJleo-.js';
2
+ import { M as MarkdownBlockNode } from './types-BwMPl2CB.js';
3
+
4
+ /**
5
+ * PageSection — the framework-agnostic block model for Page (linear) mode.
6
+ *
7
+ * Where `materializeBlockLayers` turns a block into fixed-viewport SVG
8
+ * `Layer[]` (slides, video frames, spatial canvases), `materializePageSection`
9
+ * turns the same block into a `PageSection`: a variable-height, content-slot
10
+ * description that HTML renderers lay out reflowably. React's page view and
11
+ * any string-HTML exporter consume this same structure, so neither re-derives
12
+ * content from blocks.
13
+ *
14
+ * Inherently spatial content (diagram/tree/timeline/map/drawing/layout,
15
+ * authored layers, custom templates) stays SVG: those sections carry the
16
+ * source block in a `canvas` media slot and consumers embed the result of
17
+ * `materializeBlockLayers` responsively. Core never emits markup.
18
+ */
19
+
20
+ /**
21
+ * Rich text content for a slot. `text` is always present (plain text);
22
+ * `markdown` carries the original body nodes when the block has them, so
23
+ * renderers can show real rich text with the plain string as fallback.
24
+ */
25
+ interface PageRichText {
26
+ text: string;
27
+ markdown?: MarkdownBlockNode[];
28
+ }
29
+ /** Which spatial pipeline a canvas-embed section renders through. */
30
+ type PageSpatialKind = 'diagram' | 'tree' | 'timeline' | 'map' | 'drawing' | 'layout' | 'custom' | 'authored';
31
+ /** Media content for a section slot. */
32
+ type PageMedia = {
33
+ type: 'image';
34
+ src: string;
35
+ alt: string;
36
+ credit?: string;
37
+ license?: string;
38
+ width?: number;
39
+ height?: number;
40
+ } | {
41
+ type: 'video';
42
+ src: string;
43
+ posterSrc?: string;
44
+ alt: string;
45
+ clipStart?: number;
46
+ clipEnd?: number;
47
+ credit?: string;
48
+ license?: string;
49
+ } | {
50
+ type: 'canvas';
51
+ spatial: PageSpatialKind;
52
+ /**
53
+ * The block to pass to `materializeBlockLayers` (already merged with
54
+ * derived inputs/params for annotated blocks). Read-only reference.
55
+ */
56
+ block: Block;
57
+ /** Intrinsic aspect for the responsive embed frame. */
58
+ aspect: {
59
+ width: number;
60
+ height: number;
61
+ };
62
+ };
63
+ /** One entry in a multi-item section (stats, cards, gallery tiles, list rows). */
64
+ interface PageSectionItem {
65
+ title?: string;
66
+ body?: string;
67
+ /** Large numeral / value for stat and comparison items. */
68
+ value?: string | number;
69
+ media?: PageMedia;
70
+ /** Per-item color-scheme name (e.g. twoColumn halves). */
71
+ accentScheme?: string;
72
+ }
73
+ /** Structured diagnostics for sections that fell back (unknown template …). */
74
+ interface PageSectionDiagnostic {
75
+ code: 'unknown-template';
76
+ template: string;
77
+ message: string;
78
+ }
79
+ /** Where a section's content came from. */
80
+ type PageSectionSource = 'template' | 'prose' | 'authored' | 'custom-template' | 'cover' | 'fallback';
81
+ /**
82
+ * One variable-height page section. The `kind` selects the layout family;
83
+ * `slots` carry the content; `emphasis`/`accent`/`background` carry the
84
+ * theme's art-direction decisions for this position in the sequence.
85
+ */
86
+ interface PageSection {
87
+ kind: PageSectionKind;
88
+ /** Layout variant within the kind (e.g. quote-band: plain|display|full-bleed|editorial). */
89
+ variant?: string;
90
+ /** Source block id ('' for the synthesized cover hero). */
91
+ blockId: string;
92
+ /** Canonical source template id (post-alias); absent for prose/cover/authored. */
93
+ template?: string;
94
+ slots: {
95
+ /** Kicker text above the title (theme decides visibility/treatment). */
96
+ eyebrow?: string;
97
+ title?: string;
98
+ subtitle?: string;
99
+ body?: PageRichText;
100
+ /**
101
+ * Authored rich body nodes not consumed by the selected template. Page
102
+ * renderers place this after the template-specific layout so images,
103
+ * video/audio HTML, and Mermaid fences are never silently discarded.
104
+ */
105
+ richContent?: PageRichText;
106
+ media?: PageMedia;
107
+ items?: PageSectionItem[];
108
+ table?: {
109
+ headers: string[];
110
+ rows: string[][];
111
+ align?: (('left' | 'right' | 'center') | null)[];
112
+ };
113
+ milestone?: {
114
+ date: string;
115
+ description: string;
116
+ footer?: string;
117
+ mood?: 'neutral' | 'somber' | 'celebratory';
118
+ };
119
+ attribution?: string;
120
+ caption?: string;
121
+ /** Small print: source citation, term origin, comparison unit. */
122
+ meta?: string;
123
+ /** Heading depth for prose sections (1..6). */
124
+ headingLevel?: number;
125
+ };
126
+ emphasis: PageEmphasis;
127
+ /** Resolved accent for this section; block-level colorScheme wins over rotation. */
128
+ accent: {
129
+ schemeName?: string;
130
+ scheme?: ThemeColorScheme;
131
+ role: 'primary' | 'rotation' | 'block' | 'none';
132
+ };
133
+ background: PageBackground;
134
+ /** Pre-order position among this doc's sections. */
135
+ index: number;
136
+ totalSections: number;
137
+ /** Nesting depth of the source block (0 for top-level and the cover). */
138
+ depth: number;
139
+ source: PageSectionSource;
140
+ diagnostic?: PageSectionDiagnostic;
141
+ /** Freeform theme hints from pageStyle overrides (e.g. dropCap, frame). */
142
+ hints?: Record<string, string | number | boolean>;
143
+ }
144
+ /** Result wrapper mirroring `BlockLayerMaterialization`'s shape. */
145
+ interface PageSectionMaterialization {
146
+ section: PageSection;
147
+ /** The source block; undefined for the synthesized cover hero. */
148
+ block?: Block;
149
+ source: PageSectionSource;
150
+ diagnostic?: PageSectionDiagnostic;
151
+ }
152
+
153
+ /**
154
+ * Canonical block-to-page-section materialization — the Page (linear) mode
155
+ * sibling of `materializeBlockLayers`.
156
+ *
157
+ * `materializePageSections(doc, …)` is the primary entry point: it walks the
158
+ * block tree pre-order, extracts a `PageSection` per block (cover hero,
159
+ * typed template sections, prose, canvas embeds, visible fallbacks), and
160
+ * then applies the theme's art direction across the sequence — background
161
+ * rhythm, accent rotation, and the emphasis curve are sequence-scoped
162
+ * decisions that per-block calls cannot make.
163
+ *
164
+ * Failures are data, not console side effects: an unknown template becomes
165
+ * a visible `callout` section with a structured diagnostic (mirroring
166
+ * `materializeBlockLayers`' fallback posture).
167
+ */
168
+
169
+ /**
170
+ * Page-mode hints a transform style may carry (`TransformStyleConfig.page`).
171
+ * Defined here (not in `transform/`) so the doc pipeline stays independent
172
+ * of the transform module.
173
+ */
174
+ interface PageTransformHints {
175
+ /** Overrides `pageStyle.tokens.sectionSpacing` for this rendition. */
176
+ spacing?: 'compact' | 'comfortable' | 'generous';
177
+ /** 'front-loaded' promotes the first sections' emphasis one step. */
178
+ emphasisCurve?: 'even' | 'front-loaded';
179
+ }
180
+ /** Options shared by the per-block and doc-level entry points. */
181
+ interface MaterializePageSectionOptions {
182
+ /** Theme whose `pageStyle` art-directs the sections. */
183
+ theme?: Theme;
184
+ /** Aspect reference for canvas embeds. Defaults to the landscape preset. */
185
+ viewport?: ViewportConfig;
186
+ /** Zero-based position in the section sequence (per-block calls). */
187
+ blockIndex?: number;
188
+ /** Total sections in the sequence (per-block calls). */
189
+ totalBlocks?: number;
190
+ /** Document-scoped custom templates (render as canvas embeds). */
191
+ customTemplates?: readonly CustomTemplateDefinition[];
192
+ }
193
+ /** Doc-level options. */
194
+ interface MaterializePageSectionsOptions extends MaterializePageSectionOptions {
195
+ /**
196
+ * Cover hero: pass the doc's `startBlock` to synthesize a leading hero
197
+ * section, `false`/undefined to omit. (The caller decides — the editor's
198
+ * Cover toggle maps here.)
199
+ */
200
+ cover?: StartBlockConfig | false;
201
+ /** Page hints from the active transform style, if any. */
202
+ transformPage?: PageTransformHints;
203
+ }
204
+ /**
205
+ * Resolve the effective page style for a theme: explicit `theme.pageStyle`
206
+ * wins, else a derived default. Transform hints overlay spacing.
207
+ * Never returns undefined.
208
+ */
209
+ declare function resolvePageStyle(theme?: Theme, hints?: PageTransformHints): ThemePageStyle;
210
+ /**
211
+ * Materialize one block in isolation. Sequence-scoped art direction
212
+ * (background rhythm, accent rotation, emphasis curve) does not apply —
213
+ * use `materializePageSections` for whole-document rendering.
214
+ */
215
+ declare function materializePageSection(block: Block, options?: MaterializePageSectionOptions): PageSectionMaterialization;
216
+ /**
217
+ * Materialize a whole document into its ordered page sections, applying
218
+ * the theme's art direction across the sequence. The primary entry point
219
+ * for Page (linear) mode renderers and exporters.
220
+ */
221
+ declare function materializePageSections(doc: Doc, options?: MaterializePageSectionsOptions): PageSectionMaterialization[];
222
+
223
+ export { type MaterializePageSectionOptions as M, type PageMedia as P, type MaterializePageSectionsOptions as a, type PageRichText as b, type PageSection as c, type PageSectionDiagnostic as d, type PageSectionItem as e, type PageSectionMaterialization as f, type PageSectionSource as g, type PageSpatialKind as h, type PageTransformHints as i, materializePageSections as j, materializePageSection as m, resolvePageStyle as r };
@@ -1,4 +1,4 @@
1
- import { F as Doc, e as AudioBookmark } from '../Doc-ylqWKDc_.js';
1
+ import { F as Doc, e as AudioBookmark } from '../Doc-DynJleo-.js';
2
2
  import '../types-BwMPl2CB.js';
3
3
 
4
4
  /**
@@ -23,7 +23,7 @@ import {
23
23
  reanchorSession,
24
24
  traceWordPosAt,
25
25
  vadStep
26
- } from "../chunk-CY2R2VPR.js";
26
+ } from "../chunk-XNLB57UD.js";
27
27
  import {
28
28
  buildNarrationScript,
29
29
  buildNarrationTimingJson,
@@ -33,10 +33,10 @@ import {
33
33
  wordIndexAtChar,
34
34
  wordIndexAtTime,
35
35
  wordPosAtExpectedSyllables
36
- } from "../chunk-X6DUONGT.js";
36
+ } from "../chunk-JI77MGAK.js";
37
37
  import "../chunk-TUWMK62B.js";
38
38
  import "../chunk-5UYI3RJB.js";
39
- import "../chunk-W4O2TX5I.js";
39
+ import "../chunk-JHZWYRSW.js";
40
40
  import "../chunk-5J4HKRJF.js";
41
41
  import "../chunk-R2YZTCLO.js";
42
42
  import "../chunk-AMIR72JP.js";
@@ -1,10 +1,35 @@
1
1
  export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
2
- import { aC as Theme, aE as ThemeColorScheme, v as DeepPartial, aH as ThemeSeedColors, aD as ThemeColorPalette, N as FontFamilyKind, M as FontFamily } from '../Doc-ylqWKDc_.js';
3
- export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AudioBookmark, f as AudioSegment, g as AudioTimingData, h as AudioTrack, B as Block, i as BlockConnection, j as BorderStyle, C as CaptionPhrase, k as CaptionTrack, l as CaptionWord, m as ColorScheme, n as ComparisonBarInput, o as CornerBrandingConfig, p as CustomTemplateDefinition, q as CustomTemplateLayer, D as DARK_SURFACE, r as DEFAULT_DOC_FONT, s as DEFAULT_TITLE_FONT, t as DataTableInput, u as DateEventInput, w as DefinitionCardInput, x as DiagramBlockInput, y as DiagramEdgeAnchor, z as DiagramTemplateEdge, E as DiagramTemplateNode, F as Doc, G as DocBlock, H as DocDiagnostic, I as DrawingBlockInput, J as FRONTMATTER_CUSTOM_TEMPLATES_KEY, K as FRONTMATTER_CUSTOM_THEMES_KEY, L as FactCardInput, O as FullBleedQuoteInput, P as GradientBackgroundConfig, Q as ImageBackgroundConfig, R as ImageLayer, S as ImageTreatment, T as ImageWithCaptionInput, U as LIGHT_SURFACE, V as Layer, W as LayerRepeat, X as LayoutHints, Y as LeftFeatureInput, Z as LinearGradient, _ as ListBlockInput, $ as MapBlockInput, a0 as MapLayer, a1 as MapMarker, a2 as MapTileStyle, a3 as MarkerStyle, a4 as MediaClip, a5 as PathLayer, a6 as PatternBackgroundConfig, a7 as PersistentLayer, a8 as PersistentLayerConfig, a9 as PersistentLayerTemplate, aa as PersistentLayerTemplateConfig, ab as PersistentLayerTemplateType, ac as PhotoGridInput, ad as Position, ae as ProgressIndicatorConfig, af as PullQuoteInput, ag as QuoteBlockInput, ah as RawLayersInput, ai as RenderStyle, aj as RightFeatureInput, ak as ScheduledClip, al as SectionHeaderInput, am as ShapeFilter, an as ShapeLayer, ao as ShapePattern, ap as SolidBackgroundConfig, aq as StartBlockConfig, ar as StatHighlightInput, as as SurfaceScheme, at as THEME_SCHEMA_VERSION, au as TableLayer, av as TableLayerStyle, aw as TemplateBlock, ax as TemplateContext, ay as TemplateFunction, az as TemplateRegistry, aA as TextLayer, aB as TextStyle, aF as ThemeRegistry, aG as ThemeSchemaVersion, aI as ThemeStyle, aJ as ThemeTypography, aK as TimelineBlockInput, aL as TimelineTemplateEvent, aM as TimelineTemplateLink, aN as TimelineTemplateTrack, aO as TitleBlockInput, aP as TitleCaptionConfig, aQ as TreeBlockInput, aR as TreeLayer, aS as TreeLayerItem, aT as TreeLayerStyle, aU as TreeTemplateItem, aV as TwoColumnInput, aW as VIEWPORT_PRESETS, aX as VideoLayer, aY as VideoPullQuoteInput, aZ as VideoWithCaptionInput, a_ as ViewportConfig, a$ as ViewportOrientation, b0 as ViewportPreset, b1 as VignetteConfig, b2 as applySurface, b3 as calculateDuration, b4 as calculateFontScale, b5 as createTemplateContext, b6 as createTheme, b7 as createThemeRegistry, b8 as getAspectRatioString, b9 as getBlockAtTime, ba as getCaptionAtTime, bb as getDocPlaybackDuration, bc as getLayoutHints, bd as getSafeTextBounds, be as getSegmentAtTime, bf as getTwoColumnPositions, bg as getViewport, bh as getViewportOrientation, bi as isPersistentLayerTemplate, bj as isTemplateBlock, bk as layoutScaledFontSize, bl as resolveMediaSchedule, bm as scaledFontSize } from '../Doc-ylqWKDc_.js';
2
+ import { b1 as Theme, b4 as ThemePageStyle, b3 as ThemeColorScheme, v as DeepPartial, b7 as ThemeSeedColors, b2 as ThemeColorPalette, N as FontFamilyKind, M as FontFamily } from '../Doc-DynJleo-.js';
3
+ export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AudioBookmark, f as AudioSegment, g as AudioTimingData, h as AudioTrack, B as Block, i as BlockConnection, j as BorderStyle, C as CaptionPhrase, k as CaptionTrack, l as CaptionWord, m as ColorScheme, n as ComparisonBarInput, o as CornerBrandingConfig, p as CustomTemplateDefinition, q as CustomTemplateLayer, D as DARK_SURFACE, r as DEFAULT_DOC_FONT, s as DEFAULT_TITLE_FONT, t as DataTableInput, u as DateEventInput, w as DefinitionCardInput, x as DiagramBlockInput, y as DiagramEdgeAnchor, z as DiagramTemplateEdge, E as DiagramTemplateNode, F as Doc, G as DocBlock, H as DocDiagnostic, I as DrawingBlockInput, J as FRONTMATTER_CUSTOM_TEMPLATES_KEY, K as FRONTMATTER_CUSTOM_THEMES_KEY, L as FactCardInput, O as FullBleedQuoteInput, P as GradientBackgroundConfig, Q as ImageBackgroundConfig, R as ImageLayer, S as ImageTreatment, T as ImageWithCaptionInput, U as LIGHT_SURFACE, V as Layer, W as LayerRepeat, X as LayoutHints, Y as LeftFeatureInput, Z as LinearGradient, _ as ListBlockInput, $ as MapBlockInput, a0 as MapLayer, a1 as MapMarker, a2 as MapTileStyle, a3 as MarkerStyle, a4 as MediaClip, a5 as MermaidLayer, a6 as PAGE_ACCENT_STRATEGIES, a7 as PAGE_BACKGROUNDS, a8 as PAGE_BACKGROUND_RHYTHMS, a9 as PAGE_DESIGN_FAMILIES, aa as PAGE_DIVIDERS, ab as PAGE_EMPHASES, ac as PAGE_EYEBROWS, ad as PAGE_HEADING_CASES, ae as PAGE_HEADING_SCALES, af as PAGE_HEADING_UNDERLINES, ag as PAGE_HERO_STYLES, ah as PAGE_IMAGE_FRAMINGS, ai as PAGE_NUMERAL_STYLES, aj as PAGE_PATTERNS, ak as PAGE_QUOTE_MARKS, al as PAGE_SECTION_KINDS, am as PAGE_SECTION_SPACINGS, an as PAGE_SHADOWS, ao as PageAccentRotation, ap as PageBackground, aq as PageDesignFamily, ar as PageEmphasis, as as PageHeadingTreatment, at as PageSectionKind, au as PageSectionOverride, av as PageTokens, aw as PathLayer, ax as PatternBackgroundConfig, ay as PersistentLayer, az as PersistentLayerConfig, aA as PersistentLayerTemplate, aB as PersistentLayerTemplateConfig, aC as PersistentLayerTemplateType, aD as PhotoGridInput, aE as Position, aF as ProgressIndicatorConfig, aG as PullQuoteInput, aH as QuoteBlockInput, aI as RawLayersInput, aJ as RenderStyle, aK as RightFeatureInput, aL as ScheduledClip, aM as SectionHeaderInput, aN as ShapeFilter, aO as ShapeLayer, aP as ShapePattern, aQ as SolidBackgroundConfig, aR as StartBlockConfig, aS as StatHighlightInput, aT as SurfaceScheme, aU as THEME_SCHEMA_VERSION, aV as TableLayer, aW as TableLayerStyle, aX as TemplateBlock, aY as TemplateContext, aZ as TemplateFunction, a_ as TemplateRegistry, a$ as TextLayer, b0 as TextStyle, b5 as ThemeRegistry, b6 as ThemeSchemaVersion, b8 as ThemeStyle, b9 as ThemeTypography, ba as TimelineBlockInput, bb as TimelineTemplateEvent, bc as TimelineTemplateLink, bd as TimelineTemplateTrack, be as TitleBlockInput, bf as TitleCaptionConfig, bg as TreeBlockInput, bh as TreeLayer, bi as TreeLayerItem, bj as TreeLayerStyle, bk as TreeTemplateItem, bl as TwoColumnInput, bm as VIEWPORT_PRESETS, bn as VideoLayer, bo as VideoPullQuoteInput, bp as VideoWithCaptionInput, bq as ViewportConfig, br as ViewportOrientation, bs as ViewportPreset, bt as VignetteConfig, bu as applySurface, bv as calculateDuration, bw as calculateFontScale, bx as createTemplateContext, by as createTheme, bz as createThemeRegistry, bA as getAspectRatioString, bB as getBlockAtTime, bC as getCaptionAtTime, bD as getDocPlaybackDuration, bE as getLayoutHints, bF as getSafeTextBounds, bG as getSegmentAtTime, bH as getTwoColumnPositions, bI as getViewport, bJ as getViewportOrientation, bK as isPersistentLayerTemplate, bL as isTemplateBlock, bM as layoutScaledFontSize, bN as resolveMediaSchedule, bO as scaledFontSize } from '../Doc-DynJleo-.js';
4
4
  export { D as DEFAULT_TRANSITION_DURATION_SECONDS, X as TRANSITION_DIRECTIONS, Y as TRANSITION_TYPES, Z as Transition, _ as TransitionDirection, $ as TransitionType, a0 as isTransitionType, a1 as normalizeTransitionDirection, a2 as normalizeTransitionType, a3 as resolveBlockTransition, a4 as resolveTransitionDuration } from '../types-BwMPl2CB.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-RjVgLpUi.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-B72m0W1y.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-D828IXJ1.js';
7
+ export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-Ca4Tr9uN.js';
8
+
9
+ /**
10
+ * Page Style Defaults
11
+ *
12
+ * Derives a complete `ThemePageStyle` from a theme's existing fields so
13
+ * legacy themes, customizer themes, and file-inferred themes get a
14
+ * coherent page art direction without declaring one. Built-in themes
15
+ * ship explicit `pageStyle` blocks in their JSON; this derivation is the
16
+ * fallback used by `compileTheme` and by `resolvePageStyle` at read time.
17
+ *
18
+ * Derivation signals:
19
+ * - `renderStyle.name` → design family (documentary → documentary,
20
+ * magazine → editorial, bold → brutalist, tech-dark → terminal, …)
21
+ * - `style.borderRadius` → cornerRadius + rounded vs flush image framing
22
+ * - `style.imageTreatment` (mono/duotone) → letterboxed framing
23
+ * - `style.textShadow` → shadow language
24
+ * - `persistentLayers` patternBackground → page pattern
25
+ */
26
+
27
+ /**
28
+ * Derive a complete `ThemePageStyle` from a theme's existing fields.
29
+ * Deterministic and read-only; explicit `theme.pageStyle` always wins
30
+ * (callers check before deriving — see `resolvePageStyle`).
31
+ */
32
+ declare function defaultPageStyle(theme: Theme): ThemePageStyle;
8
33
 
9
34
  /**
10
35
  * Theme Validator
@@ -227,4 +252,4 @@ declare function deriveScale(seedHex: string, spread?: number): {
227
252
  darker2: string;
228
253
  };
229
254
 
230
- export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, STARTER_THEME, Theme, ThemeColorPalette, ThemeColorScheme, ThemeSeedColors, type ValidationError, type ValidationResult, accentToColorScheme, assertTheme, buildGoogleFontsUrl, compileTheme, contrastRatio, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, relativeLuminance, resolveFontFamily, serializeTheme, validateTheme, withAlpha };
255
+ export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, STARTER_THEME, Theme, ThemeColorPalette, ThemeColorScheme, ThemePageStyle, ThemeSeedColors, type ValidationError, type ValidationResult, accentToColorScheme, assertTheme, buildGoogleFontsUrl, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, relativeLuminance, resolveFontFamily, serializeTheme, validateTheme, withAlpha };
@@ -9,11 +9,12 @@ import {
9
9
  getSegmentAtTime,
10
10
  parseTheme,
11
11
  serializeTheme
12
- } from "../chunk-MMPBOUK7.js";
12
+ } from "../chunk-QUUPYOSP.js";
13
13
  import {
14
+ defaultPageStyle,
14
15
  getDocPlaybackDuration,
15
16
  resolveMediaSchedule
16
- } from "../chunk-FVJUUTEM.js";
17
+ } from "../chunk-VWCJ2WXC.js";
17
18
  import {
18
19
  AVAILABLE_FONT_STACKS,
19
20
  DARK_SURFACE,
@@ -23,6 +24,24 @@ import {
23
24
  FRONTMATTER_CUSTOM_TEMPLATES_KEY,
24
25
  FRONTMATTER_CUSTOM_THEMES_KEY,
25
26
  LIGHT_SURFACE,
27
+ PAGE_ACCENT_STRATEGIES,
28
+ PAGE_BACKGROUNDS,
29
+ PAGE_BACKGROUND_RHYTHMS,
30
+ PAGE_DESIGN_FAMILIES,
31
+ PAGE_DIVIDERS,
32
+ PAGE_EMPHASES,
33
+ PAGE_EYEBROWS,
34
+ PAGE_HEADING_CASES,
35
+ PAGE_HEADING_SCALES,
36
+ PAGE_HEADING_UNDERLINES,
37
+ PAGE_HERO_STYLES,
38
+ PAGE_IMAGE_FRAMINGS,
39
+ PAGE_NUMERAL_STYLES,
40
+ PAGE_PATTERNS,
41
+ PAGE_QUOTE_MARKS,
42
+ PAGE_SECTION_KINDS,
43
+ PAGE_SECTION_SPACINGS,
44
+ PAGE_SHADOWS,
26
45
  THEMES,
27
46
  THEME_SCHEMA_VERSION,
28
47
  applySurface,
@@ -49,7 +68,7 @@ import {
49
68
  resolveTheme,
50
69
  validateTheme,
51
70
  withAlpha
52
- } from "../chunk-W4O2TX5I.js";
71
+ } from "../chunk-JHZWYRSW.js";
53
72
  import {
54
73
  DEFAULT_DOC_FONT,
55
74
  DEFAULT_TITLE_FONT,
@@ -89,6 +108,24 @@ export {
89
108
  FRONTMATTER_CUSTOM_TEMPLATES_KEY,
90
109
  FRONTMATTER_CUSTOM_THEMES_KEY,
91
110
  LIGHT_SURFACE,
111
+ PAGE_ACCENT_STRATEGIES,
112
+ PAGE_BACKGROUNDS,
113
+ PAGE_BACKGROUND_RHYTHMS,
114
+ PAGE_DESIGN_FAMILIES,
115
+ PAGE_DIVIDERS,
116
+ PAGE_EMPHASES,
117
+ PAGE_EYEBROWS,
118
+ PAGE_HEADING_CASES,
119
+ PAGE_HEADING_SCALES,
120
+ PAGE_HEADING_UNDERLINES,
121
+ PAGE_HERO_STYLES,
122
+ PAGE_IMAGE_FRAMINGS,
123
+ PAGE_NUMERAL_STYLES,
124
+ PAGE_PATTERNS,
125
+ PAGE_QUOTE_MARKS,
126
+ PAGE_SECTION_KINDS,
127
+ PAGE_SECTION_SPACINGS,
128
+ PAGE_SHADOWS,
92
129
  STARTER_THEME,
93
130
  THEMES,
94
131
  THEME_SCHEMA_VERSION,
@@ -106,6 +143,7 @@ export {
106
143
  createTemplateContext,
107
144
  createTheme,
108
145
  createThemeRegistry,
146
+ defaultPageStyle,
109
147
  deriveColorPalette,
110
148
  deriveScale,
111
149
  fontStack,
@@ -1,4 +1,4 @@
1
- import { aC as Theme, aF as ThemeRegistry } from './Doc-ylqWKDc_.js';
1
+ import { b1 as Theme, b5 as ThemeRegistry } from './Doc-DynJleo-.js';
2
2
 
3
3
  /**
4
4
  * Built-in Theme Library
@@ -1,15 +1,8 @@
1
- import { m as ColorScheme, F as Doc, B as Block } from '../Doc-ylqWKDc_.js';
1
+ import { m as ColorScheme, F as Doc, B as Block } from '../Doc-DynJleo-.js';
2
+ import { i as PageTransformHints } from '../materializePageSection-DDzubQXo.js';
2
3
  import { d as ExtractionType, E as ExtractedElement, b as ExtractionOptions } from '../contentExtractor-BNfVJV2U.js';
3
4
  import '../types-BwMPl2CB.js';
4
5
 
5
- /**
6
- * Transform Types
7
- *
8
- * Defines the type system for doc block transforms — algorithms that take
9
- * an existing Doc and produce a new Doc with blocks optimized for visual
10
- * presentation. Transforms are read-only on the input and deterministic.
11
- */
12
-
13
6
  /** Identifier for a built-in or caller-registered transform style. */
14
7
  type TransformStyleId = string;
15
8
  /** Summary info for UI dropdowns (mirrors getThemeSummaries pattern). */
@@ -79,6 +72,12 @@ interface TransformStyleConfig {
79
72
  /** Target promoted blocks per minute of content (e.g. 5). */
80
73
  slidesPerMinute?: number;
81
74
  };
75
+ /**
76
+ * Page (linear) mode hints for docs produced by this style. Consumers
77
+ * pass this as `MaterializePageSectionsOptions.transformPage` so the
78
+ * summarization strategy shapes the page rendition (spacing, emphasis).
79
+ */
80
+ page?: PageTransformHints;
82
81
  }
83
82
  /** Built-in id or a call-scoped declarative style definition. */
84
83
  type TransformStyleInput = TransformStyleId | TransformStyleConfig;
@@ -7,7 +7,7 @@ import {
7
7
  getTransformStyleIds,
8
8
  getTransformStyleSummaries,
9
9
  resolveTransformStyle
10
- } from "../chunk-PXLVXTLW.js";
10
+ } from "../chunk-ILWDXLUK.js";
11
11
  import "../chunk-Q7LROV2H.js";
12
12
  import "../chunk-5J4HKRJF.js";
13
13
  import "../chunk-AMIR72JP.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",