@bendyline/squisq 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Doc-BeSeH2iX.d.ts → Doc-BsMkmzH8.d.ts} +838 -268
- package/dist/{ImageEditDoc-BTIvw0oq.d.ts → ImageEditDoc-DvoeHMP9.d.ts} +11 -4
- package/dist/{chunk-ZTX4PFFT.js → chunk-2OIBZYKP.js} +75 -2
- package/dist/chunk-2OIBZYKP.js.map +1 -0
- package/dist/chunk-2UQOHYE2.js +45 -0
- package/dist/chunk-2UQOHYE2.js.map +1 -0
- package/dist/{chunk-B4EEON3N.js → chunk-4AKUQPEE.js} +536 -103
- package/dist/chunk-4AKUQPEE.js.map +1 -0
- package/dist/chunk-4ZFRZBU2.js +6582 -0
- package/dist/chunk-4ZFRZBU2.js.map +1 -0
- package/dist/{chunk-57CVQCFX.js → chunk-7MQGNR76.js} +79 -3
- package/dist/chunk-7MQGNR76.js.map +1 -0
- package/dist/{chunk-5WFRKURX.js → chunk-DLXZMS5K.js} +4 -2
- package/dist/chunk-DLXZMS5K.js.map +1 -0
- package/dist/{chunk-MYIH7FWD.js → chunk-FBKP5CAO.js} +1 -1
- package/dist/chunk-FBKP5CAO.js.map +1 -0
- package/dist/chunk-KZNXZ5SM.js +333 -0
- package/dist/chunk-KZNXZ5SM.js.map +1 -0
- package/dist/{chunk-WMOI7FN3.js → chunk-LRCV7N7F.js} +12 -2
- package/dist/{chunk-WMOI7FN3.js.map → chunk-LRCV7N7F.js.map} +1 -1
- package/dist/{chunk-3K5OG6KI.js → chunk-OH43RPTP.js} +403 -187
- package/dist/chunk-OH43RPTP.js.map +1 -0
- package/dist/{chunk-H3AXU4MJ.js → chunk-OKJOQXK4.js} +149 -2
- package/dist/chunk-OKJOQXK4.js.map +1 -0
- package/dist/chunk-PGGGKYWG.js +1 -0
- package/dist/chunk-PGGGKYWG.js.map +1 -0
- package/dist/{chunk-7UDSRZKG.js → chunk-Q3ROPT5H.js} +35 -14
- package/dist/chunk-Q3ROPT5H.js.map +1 -0
- package/dist/chunk-QE7TWGVT.js +178 -0
- package/dist/chunk-QE7TWGVT.js.map +1 -0
- package/dist/chunk-RUDYOTA6.js +345 -0
- package/dist/chunk-RUDYOTA6.js.map +1 -0
- package/dist/chunk-TVSGLUID.js +596 -0
- package/dist/chunk-TVSGLUID.js.map +1 -0
- package/dist/chunk-ZLQKNOZQ.js +1 -0
- package/dist/chunk-ZLQKNOZQ.js.map +1 -0
- package/dist/doc/index.d.ts +5 -10
- package/dist/doc/index.js +263 -7
- package/dist/doc/index.js.map +1 -1
- package/dist/generate/index.d.ts +106 -7
- package/dist/generate/index.js +16 -3
- package/dist/generate/index.js.map +1 -1
- package/dist/icons/index.d.ts +62 -10
- package/dist/icons/index.js +29 -9
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/inlineIconMarker.d.ts +1 -0
- package/dist/icons/inlineIconMarker.js +15 -0
- package/dist/icons/inlineIconMarker.js.map +1 -0
- package/dist/imageEdit/index.d.ts +219 -11
- package/dist/imageEdit/index.js +56 -21
- package/dist/imageEdit/index.js.map +1 -1
- package/dist/index.d.ts +24 -13
- package/dist/index.js +680 -12
- package/dist/index.js.map +1 -1
- package/dist/inlineIconMarker-CiE8Hlvz.d.ts +59 -0
- package/dist/jsonForm/index.d.ts +189 -12
- package/dist/jsonForm/index.js +26 -11
- package/dist/jsonForm/index.js.map +1 -1
- package/dist/markdown/index.d.ts +474 -19
- package/dist/markdown/index.js +72 -33
- package/dist/markdown/index.js.map +1 -1
- package/dist/random/index.d.ts +51 -2
- package/dist/random/index.js +9 -1
- package/dist/random/index.js.map +1 -1
- package/dist/recommend/index.d.ts +39 -13
- package/dist/recommend/index.js +10 -14
- package/dist/recommend/index.js.map +1 -1
- package/dist/schemas/index.d.ts +208 -15
- package/dist/schemas/index.js +150 -11
- package/dist/schemas/index.js.map +1 -1
- package/dist/spatial/index.d.ts +116 -3
- package/dist/spatial/index.js +24 -2
- package/dist/spatial/index.js.map +1 -1
- package/dist/storage/index.d.ts +159 -10
- package/dist/storage/index.js +20 -6
- package/dist/storage/index.js.map +1 -1
- package/dist/story/index.d.ts +906 -40
- package/dist/story/index.js +124 -6
- package/dist/{themeLibrary-BHjJ0Qx6.d.ts → themeLibrary-DQQKuRMx.d.ts} +1 -1
- package/dist/timing/index.d.ts +109 -4
- package/dist/timing/index.js +23 -2
- package/dist/timing/index.js.map +1 -1
- package/dist/transform/index.d.ts +213 -6
- package/dist/transform/index.js +26 -3
- package/dist/transform/index.js.map +1 -1
- package/dist/{types-BdZkdJ3z.d.ts → types-DlAZ7MW4.d.ts} +115 -1
- package/dist/versions/index.d.ts +123 -24
- package/dist/versions/index.js +34 -27
- package/dist/versions/index.js.map +1 -1
- package/package.json +6 -1
- package/src/__tests__/animationUtils.test.ts +40 -0
- package/src/__tests__/annotationCoercion.test.ts +243 -0
- package/src/__tests__/applyRenderStyle.test.ts +146 -0
- package/src/__tests__/atmosphereLayers.test.ts +108 -0
- package/src/__tests__/attrTokens.test.ts +162 -0
- package/src/__tests__/customTemplateSample.test.ts +83 -0
- package/src/__tests__/customTemplatesFrontmatter.test.ts +205 -0
- package/src/__tests__/customThemesFrontmatter.test.ts +118 -0
- package/src/__tests__/diagramBlock.test.ts +122 -0
- package/src/__tests__/diagramLayout.test.ts +134 -0
- package/src/__tests__/drawing.test.ts +109 -0
- package/src/__tests__/drawingBlock.test.ts +124 -0
- package/src/__tests__/drawingLayout.test.ts +171 -0
- package/src/__tests__/geohash.test.ts +6 -5
- package/src/__tests__/getLayers.test.ts +6 -2
- package/src/__tests__/getLayersFallback.test.ts +103 -0
- package/src/__tests__/imageEditExportSvg.test.ts +70 -0
- package/src/__tests__/imageEditVersions.test.ts +72 -0
- package/src/__tests__/inlineIconMarker.test.ts +36 -0
- package/src/__tests__/layoutBlock.test.ts +83 -0
- package/src/__tests__/layoutLayout.test.ts +169 -0
- package/src/__tests__/markdown.test.ts +23 -0
- package/src/__tests__/markdownSanitize.test.ts +64 -0
- package/src/__tests__/markdownToDoc.test.ts +223 -2
- package/src/__tests__/mediaAnnotations.test.ts +64 -0
- package/src/__tests__/mediaSchedule.test.ts +118 -0
- package/src/__tests__/pandocAttrParse.test.ts +187 -0
- package/src/__tests__/resolveDocTheme.test.ts +55 -0
- package/src/__tests__/rootExports.test.ts +43 -0
- package/src/__tests__/shapeGeometry.test.ts +89 -0
- package/src/__tests__/shapeVocabulary.test.ts +133 -0
- package/src/__tests__/structuredData.test.ts +179 -0
- package/src/__tests__/templateAnnotationParse.test.ts +108 -0
- package/src/__tests__/templateMetadata.test.ts +21 -0
- package/src/__tests__/templates.test.ts +145 -4
- package/src/__tests__/themeCompile.test.ts +42 -0
- package/src/__tests__/themeValidator.test.ts +6 -0
- package/src/__tests__/transformV2.test.ts +137 -0
- package/src/__tests__/transitionNormalize.test.ts +61 -0
- package/src/__tests__/validateDoc.test.ts +100 -0
- package/src/doc/customTemplatesFrontmatter.ts +308 -0
- package/src/doc/customThemesFrontmatter.ts +90 -0
- package/src/doc/docToMarkdown.ts +73 -4
- package/src/doc/getLayers.ts +40 -17
- package/src/doc/index.ts +35 -1
- package/src/doc/markdownToDoc.ts +333 -12
- package/src/doc/mediaAnnotations.ts +118 -0
- package/src/doc/resolveDocTheme.ts +55 -0
- package/src/doc/structuredData.ts +230 -0
- package/src/doc/templateInputs.ts +240 -0
- package/src/doc/templates/__tests__/customTemplate.test.ts +151 -0
- package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +110 -0
- package/src/doc/templates/accentImage.ts +30 -6
- package/src/doc/templates/captionUtils.ts +23 -0
- package/src/doc/templates/comparisonBar.ts +26 -18
- package/src/doc/templates/coverBlock.ts +7 -4
- package/src/doc/templates/customTemplate.ts +45 -0
- package/src/doc/templates/dataTable.ts +37 -19
- package/src/doc/templates/dateEvent.ts +41 -20
- package/src/doc/templates/definitionCard.ts +26 -18
- package/src/doc/templates/diagramBlock.ts +204 -0
- package/src/doc/templates/diagramLayout.ts +159 -0
- package/src/doc/templates/drawingBlock.ts +325 -0
- package/src/doc/templates/drawingLayout.ts +539 -0
- package/src/doc/templates/factCard.ts +51 -25
- package/src/doc/templates/fallbackBlock.ts +123 -0
- package/src/doc/templates/featureBlock.ts +20 -13
- package/src/doc/templates/fullBleedQuote.ts +18 -8
- package/src/doc/templates/imageWithCaption.ts +22 -9
- package/src/doc/templates/index.ts +215 -46
- package/src/doc/templates/layoutBlock.ts +43 -0
- package/src/doc/templates/layoutLayout.ts +243 -0
- package/src/doc/templates/listBlock.ts +56 -30
- package/src/doc/templates/mapBlock.ts +15 -12
- package/src/doc/templates/metadata.ts +120 -0
- package/src/doc/templates/persistentLayers.ts +129 -11
- package/src/doc/templates/photoGrid.ts +23 -12
- package/src/doc/templates/pullQuote.ts +30 -12
- package/src/doc/templates/quoteBlock.ts +54 -29
- package/src/doc/templates/sectionHeader.ts +25 -11
- package/src/doc/templates/statHighlight.ts +39 -22
- package/src/doc/templates/titleBlock.ts +59 -21
- package/src/doc/templates/tokens/__tests__/resolveTokens.test.ts +221 -0
- package/src/doc/templates/tokens/resolveTokens.ts +0 -0
- package/src/doc/templates/twoColumn.ts +48 -30
- package/src/doc/templates/videoPullQuote.ts +22 -12
- package/src/doc/templates/videoWithCaption.ts +13 -8
- package/src/doc/utils/animationUtils.ts +267 -3
- package/src/doc/utils/applyRenderStyle.ts +113 -0
- package/src/doc/utils/imageTreatment.ts +70 -0
- package/src/doc/utils/shapeGeometry.ts +464 -0
- package/src/doc/utils/themeUtils.ts +75 -1
- package/src/doc/validate.ts +476 -0
- package/src/generate/slideshowGenerator.ts +7 -0
- package/src/icons/index.ts +8 -0
- package/src/icons/inlineIconMarker.ts +73 -0
- package/src/imageEdit/export.ts +85 -2
- package/src/imageEdit/index.ts +1 -0
- package/src/imageEdit/persistence.ts +51 -0
- package/src/index.ts +2 -0
- package/src/markdown/annotationCoercion.ts +295 -0
- package/src/markdown/attrTokens.ts +222 -0
- package/src/markdown/convert.ts +229 -26
- package/src/markdown/index.ts +36 -0
- package/src/markdown/sanitize.ts +298 -0
- package/src/markdown/stringify.ts +84 -3
- package/src/markdown/types.ts +66 -0
- package/src/markdown/utils.ts +49 -1
- package/src/recommend/templates.ts +24 -0
- package/src/schemas/BlockTemplates.ts +133 -4
- package/src/schemas/CustomTemplates.ts +74 -0
- package/src/schemas/Doc.ts +353 -29
- package/src/schemas/ImageEditDoc.ts +11 -4
- package/src/schemas/Media.ts +169 -0
- package/src/schemas/Theme.ts +23 -1
- package/src/schemas/Transitions.ts +224 -0
- package/src/schemas/colorUtils.ts +33 -0
- package/src/schemas/fontStacks.ts +5 -2
- package/src/schemas/index.ts +3 -0
- package/src/schemas/themeCompile.ts +23 -4
- package/src/schemas/themeValidator.ts +49 -11
- package/src/schemas/themes/cinematic.json +69 -12
- package/src/schemas/themes/documentary.json +58 -11
- package/src/schemas/themes/gezellig.json +60 -11
- package/src/schemas/themes/magazine.json +54 -9
- package/src/schemas/themes/morning-light.json +52 -9
- package/src/schemas/themes/standard-dark.json +48 -13
- package/src/schemas/themes/standard.json +44 -12
- package/src/schemas/themes/tech-dark.json +65 -12
- package/src/spatial/Geohash.ts +52 -21
- package/src/transform/applyTransform.ts +43 -4
- package/src/transform/index.ts +1 -0
- package/src/transform/registry.ts +44 -13
- package/src/transform/styles/dataDriven.ts +2 -1
- package/src/transform/styles/documentary.ts +2 -1
- package/src/transform/styles/magazine.ts +3 -1
- package/src/transform/styles/minimal.ts +2 -1
- package/src/transform/styles/narrative.ts +3 -1
- package/src/transform/templateSelector.ts +87 -11
- package/src/transform/types.ts +35 -2
- package/dist/__tests__/animationUtils.test.d.ts +0 -2
- package/dist/__tests__/animationUtils.test.d.ts.map +0 -1
- package/dist/__tests__/animationUtils.test.js +0 -60
- package/dist/__tests__/animationUtils.test.js.map +0 -1
- package/dist/__tests__/colorUtils.test.d.ts +0 -2
- package/dist/__tests__/colorUtils.test.d.ts.map +0 -1
- package/dist/__tests__/colorUtils.test.js +0 -94
- package/dist/__tests__/colorUtils.test.js.map +0 -1
- package/dist/__tests__/contentContainer.test.d.ts +0 -2
- package/dist/__tests__/contentContainer.test.d.ts.map +0 -1
- package/dist/__tests__/contentContainer.test.js +0 -234
- package/dist/__tests__/contentContainer.test.js.map +0 -1
- package/dist/__tests__/contentExtractor.test.d.ts +0 -2
- package/dist/__tests__/contentExtractor.test.d.ts.map +0 -1
- package/dist/__tests__/contentExtractor.test.js +0 -151
- package/dist/__tests__/contentExtractor.test.js.map +0 -1
- package/dist/__tests__/coverBlock.test.d.ts +0 -2
- package/dist/__tests__/coverBlock.test.d.ts.map +0 -1
- package/dist/__tests__/coverBlock.test.js +0 -197
- package/dist/__tests__/coverBlock.test.js.map +0 -1
- package/dist/__tests__/dataTable.test.d.ts +0 -2
- package/dist/__tests__/dataTable.test.d.ts.map +0 -1
- package/dist/__tests__/dataTable.test.js +0 -110
- package/dist/__tests__/dataTable.test.js.map +0 -1
- package/dist/__tests__/geohash.test.d.ts +0 -2
- package/dist/__tests__/geohash.test.d.ts.map +0 -1
- package/dist/__tests__/geohash.test.js +0 -87
- package/dist/__tests__/geohash.test.js.map +0 -1
- package/dist/__tests__/getLayers.test.d.ts +0 -2
- package/dist/__tests__/getLayers.test.d.ts.map +0 -1
- package/dist/__tests__/getLayers.test.js +0 -191
- package/dist/__tests__/getLayers.test.js.map +0 -1
- package/dist/__tests__/haversine.test.d.ts +0 -2
- package/dist/__tests__/haversine.test.d.ts.map +0 -1
- package/dist/__tests__/haversine.test.js +0 -56
- package/dist/__tests__/haversine.test.js.map +0 -1
- package/dist/__tests__/iconResolve.test.d.ts +0 -2
- package/dist/__tests__/iconResolve.test.d.ts.map +0 -1
- package/dist/__tests__/iconResolve.test.js +0 -99
- package/dist/__tests__/iconResolve.test.js.map +0 -1
- package/dist/__tests__/imageEditState.test.d.ts +0 -2
- package/dist/__tests__/imageEditState.test.d.ts.map +0 -1
- package/dist/__tests__/imageEditState.test.js +0 -61
- package/dist/__tests__/imageEditState.test.js.map +0 -1
- package/dist/__tests__/imageEditVersions.test.d.ts +0 -2
- package/dist/__tests__/imageEditVersions.test.d.ts.map +0 -1
- package/dist/__tests__/imageEditVersions.test.js +0 -141
- package/dist/__tests__/imageEditVersions.test.js.map +0 -1
- package/dist/__tests__/inferDocumentTitle.test.d.ts +0 -2
- package/dist/__tests__/inferDocumentTitle.test.d.ts.map +0 -1
- package/dist/__tests__/inferDocumentTitle.test.js +0 -42
- package/dist/__tests__/inferDocumentTitle.test.js.map +0 -1
- package/dist/__tests__/jsonForm.chooseControl.test.d.ts +0 -2
- package/dist/__tests__/jsonForm.chooseControl.test.d.ts.map +0 -1
- package/dist/__tests__/jsonForm.chooseControl.test.js +0 -74
- package/dist/__tests__/jsonForm.chooseControl.test.js.map +0 -1
- package/dist/__tests__/jsonForm.evaluateWhen.test.d.ts +0 -2
- package/dist/__tests__/jsonForm.evaluateWhen.test.d.ts.map +0 -1
- package/dist/__tests__/jsonForm.evaluateWhen.test.js +0 -51
- package/dist/__tests__/jsonForm.evaluateWhen.test.js.map +0 -1
- package/dist/__tests__/jsonForm.inferSchema.test.d.ts +0 -2
- package/dist/__tests__/jsonForm.inferSchema.test.d.ts.map +0 -1
- package/dist/__tests__/jsonForm.inferSchema.test.js +0 -23
- package/dist/__tests__/jsonForm.inferSchema.test.js.map +0 -1
- package/dist/__tests__/jsonForm.pointer.test.d.ts +0 -2
- package/dist/__tests__/jsonForm.pointer.test.d.ts.map +0 -1
- package/dist/__tests__/jsonForm.pointer.test.js +0 -94
- package/dist/__tests__/jsonForm.pointer.test.js.map +0 -1
- package/dist/__tests__/localForageAdapter.test.d.ts +0 -8
- package/dist/__tests__/localForageAdapter.test.d.ts.map +0 -1
- package/dist/__tests__/localForageAdapter.test.js +0 -130
- package/dist/__tests__/localForageAdapter.test.js.map +0 -1
- package/dist/__tests__/markdown.test.d.ts +0 -2
- package/dist/__tests__/markdown.test.d.ts.map +0 -1
- package/dist/__tests__/markdown.test.js +0 -715
- package/dist/__tests__/markdown.test.js.map +0 -1
- package/dist/__tests__/markdownIcons.test.d.ts +0 -2
- package/dist/__tests__/markdownIcons.test.d.ts.map +0 -1
- package/dist/__tests__/markdownIcons.test.js +0 -93
- package/dist/__tests__/markdownIcons.test.js.map +0 -1
- package/dist/__tests__/markdownToDoc.test.d.ts +0 -2
- package/dist/__tests__/markdownToDoc.test.d.ts.map +0 -1
- package/dist/__tests__/markdownToDoc.test.js +0 -458
- package/dist/__tests__/markdownToDoc.test.js.map +0 -1
- package/dist/__tests__/recommendTemplates.test.d.ts +0 -2
- package/dist/__tests__/recommendTemplates.test.d.ts.map +0 -1
- package/dist/__tests__/recommendTemplates.test.js +0 -158
- package/dist/__tests__/recommendTemplates.test.js.map +0 -1
- package/dist/__tests__/scopedContentContainer.test.d.ts +0 -2
- package/dist/__tests__/scopedContentContainer.test.d.ts.map +0 -1
- package/dist/__tests__/scopedContentContainer.test.js +0 -74
- package/dist/__tests__/scopedContentContainer.test.js.map +0 -1
- package/dist/__tests__/seededRandom.test.d.ts +0 -2
- package/dist/__tests__/seededRandom.test.d.ts.map +0 -1
- package/dist/__tests__/seededRandom.test.js +0 -125
- package/dist/__tests__/seededRandom.test.js.map +0 -1
- package/dist/__tests__/slideshowGenerator.test.d.ts +0 -2
- package/dist/__tests__/slideshowGenerator.test.d.ts.map +0 -1
- package/dist/__tests__/slideshowGenerator.test.js +0 -114
- package/dist/__tests__/slideshowGenerator.test.js.map +0 -1
- package/dist/__tests__/storage.test.d.ts +0 -2
- package/dist/__tests__/storage.test.d.ts.map +0 -1
- package/dist/__tests__/storage.test.js +0 -51
- package/dist/__tests__/storage.test.js.map +0 -1
- package/dist/__tests__/surface.test.d.ts +0 -2
- package/dist/__tests__/surface.test.d.ts.map +0 -1
- package/dist/__tests__/surface.test.js +0 -57
- package/dist/__tests__/surface.test.js.map +0 -1
- package/dist/__tests__/templateAnnotationParse.test.d.ts +0 -2
- package/dist/__tests__/templateAnnotationParse.test.d.ts.map +0 -1
- package/dist/__tests__/templateAnnotationParse.test.js +0 -42
- package/dist/__tests__/templateAnnotationParse.test.js.map +0 -1
- package/dist/__tests__/templates.test.d.ts +0 -2
- package/dist/__tests__/templates.test.d.ts.map +0 -1
- package/dist/__tests__/templates.test.js +0 -298
- package/dist/__tests__/templates.test.js.map +0 -1
- package/dist/__tests__/themeCompile.test.d.ts +0 -2
- package/dist/__tests__/themeCompile.test.d.ts.map +0 -1
- package/dist/__tests__/themeCompile.test.js +0 -134
- package/dist/__tests__/themeCompile.test.js.map +0 -1
- package/dist/__tests__/themeValidator.test.d.ts +0 -2
- package/dist/__tests__/themeValidator.test.d.ts.map +0 -1
- package/dist/__tests__/themeValidator.test.js +0 -107
- package/dist/__tests__/themeValidator.test.js.map +0 -1
- package/dist/__tests__/timing.test.d.ts +0 -2
- package/dist/__tests__/timing.test.d.ts.map +0 -1
- package/dist/__tests__/timing.test.js +0 -131
- package/dist/__tests__/timing.test.js.map +0 -1
- package/dist/__tests__/versions.test.d.ts +0 -2
- package/dist/__tests__/versions.test.d.ts.map +0 -1
- package/dist/__tests__/versions.test.js +0 -339
- package/dist/__tests__/versions.test.js.map +0 -1
- package/dist/chunk-3K5OG6KI.js.map +0 -1
- package/dist/chunk-57CVQCFX.js.map +0 -1
- package/dist/chunk-5WFRKURX.js.map +0 -1
- package/dist/chunk-7UDSRZKG.js.map +0 -1
- package/dist/chunk-B4EEON3N.js.map +0 -1
- package/dist/chunk-H3AXU4MJ.js.map +0 -1
- package/dist/chunk-KSWJR66U.js +0 -3706
- package/dist/chunk-KSWJR66U.js.map +0 -1
- package/dist/chunk-MYIH7FWD.js.map +0 -1
- package/dist/chunk-ZTX4PFFT.js.map +0 -1
- package/dist/doc/audioMapping.d.ts +0 -36
- package/dist/doc/audioMapping.d.ts.map +0 -1
- package/dist/doc/audioMapping.js +0 -350
- package/dist/doc/audioMapping.js.map +0 -1
- package/dist/doc/docToMarkdown.d.ts +0 -41
- package/dist/doc/docToMarkdown.d.ts.map +0 -1
- package/dist/doc/docToMarkdown.js +0 -88
- package/dist/doc/docToMarkdown.js.map +0 -1
- package/dist/doc/getLayers.d.ts +0 -65
- package/dist/doc/getLayers.d.ts.map +0 -1
- package/dist/doc/getLayers.js +0 -114
- package/dist/doc/getLayers.js.map +0 -1
- package/dist/doc/index.d.ts.map +0 -1
- package/dist/doc/markdownToDoc.d.ts +0 -75
- package/dist/doc/markdownToDoc.d.ts.map +0 -1
- package/dist/doc/markdownToDoc.js +0 -432
- package/dist/doc/markdownToDoc.js.map +0 -1
- package/dist/doc/templates/accentImage.d.ts +0 -59
- package/dist/doc/templates/accentImage.d.ts.map +0 -1
- package/dist/doc/templates/accentImage.js +0 -275
- package/dist/doc/templates/accentImage.js.map +0 -1
- package/dist/doc/templates/captionUtils.d.ts +0 -20
- package/dist/doc/templates/captionUtils.d.ts.map +0 -1
- package/dist/doc/templates/captionUtils.js +0 -29
- package/dist/doc/templates/captionUtils.js.map +0 -1
- package/dist/doc/templates/comparisonBar.d.ts +0 -13
- package/dist/doc/templates/comparisonBar.d.ts.map +0 -1
- package/dist/doc/templates/comparisonBar.js +0 -145
- package/dist/doc/templates/comparisonBar.js.map +0 -1
- package/dist/doc/templates/coverBlock.d.ts +0 -51
- package/dist/doc/templates/coverBlock.d.ts.map +0 -1
- package/dist/doc/templates/coverBlock.js +0 -153
- package/dist/doc/templates/coverBlock.js.map +0 -1
- package/dist/doc/templates/dataTable.d.ts +0 -14
- package/dist/doc/templates/dataTable.d.ts.map +0 -1
- package/dist/doc/templates/dataTable.js +0 -73
- package/dist/doc/templates/dataTable.js.map +0 -1
- package/dist/doc/templates/dateEvent.d.ts +0 -15
- package/dist/doc/templates/dateEvent.d.ts.map +0 -1
- package/dist/doc/templates/dateEvent.js +0 -114
- package/dist/doc/templates/dateEvent.js.map +0 -1
- package/dist/doc/templates/definitionCard.d.ts +0 -13
- package/dist/doc/templates/definitionCard.d.ts.map +0 -1
- package/dist/doc/templates/definitionCard.js +0 -117
- package/dist/doc/templates/definitionCard.js.map +0 -1
- package/dist/doc/templates/factCard.d.ts +0 -15
- package/dist/doc/templates/factCard.d.ts.map +0 -1
- package/dist/doc/templates/factCard.js +0 -104
- package/dist/doc/templates/factCard.js.map +0 -1
- package/dist/doc/templates/featureBlock.d.ts +0 -18
- package/dist/doc/templates/featureBlock.d.ts.map +0 -1
- package/dist/doc/templates/featureBlock.js +0 -180
- package/dist/doc/templates/featureBlock.js.map +0 -1
- package/dist/doc/templates/fullBleedQuote.d.ts +0 -25
- package/dist/doc/templates/fullBleedQuote.d.ts.map +0 -1
- package/dist/doc/templates/fullBleedQuote.js +0 -67
- package/dist/doc/templates/fullBleedQuote.js.map +0 -1
- package/dist/doc/templates/imageWithCaption.d.ts +0 -13
- package/dist/doc/templates/imageWithCaption.d.ts.map +0 -1
- package/dist/doc/templates/imageWithCaption.js +0 -146
- package/dist/doc/templates/imageWithCaption.js.map +0 -1
- package/dist/doc/templates/index.d.ts +0 -129
- package/dist/doc/templates/index.d.ts.map +0 -1
- package/dist/doc/templates/index.js +0 -478
- package/dist/doc/templates/index.js.map +0 -1
- package/dist/doc/templates/listBlock.d.ts +0 -13
- package/dist/doc/templates/listBlock.d.ts.map +0 -1
- package/dist/doc/templates/listBlock.js +0 -109
- package/dist/doc/templates/listBlock.js.map +0 -1
- package/dist/doc/templates/mapBlock.d.ts +0 -17
- package/dist/doc/templates/mapBlock.d.ts.map +0 -1
- package/dist/doc/templates/mapBlock.js +0 -115
- package/dist/doc/templates/mapBlock.js.map +0 -1
- package/dist/doc/templates/persistentLayers.d.ts +0 -39
- package/dist/doc/templates/persistentLayers.d.ts.map +0 -1
- package/dist/doc/templates/persistentLayers.js +0 -447
- package/dist/doc/templates/persistentLayers.js.map +0 -1
- package/dist/doc/templates/photoGrid.d.ts +0 -20
- package/dist/doc/templates/photoGrid.d.ts.map +0 -1
- package/dist/doc/templates/photoGrid.js +0 -175
- package/dist/doc/templates/photoGrid.js.map +0 -1
- package/dist/doc/templates/pullQuote.d.ts +0 -13
- package/dist/doc/templates/pullQuote.d.ts.map +0 -1
- package/dist/doc/templates/pullQuote.js +0 -113
- package/dist/doc/templates/pullQuote.js.map +0 -1
- package/dist/doc/templates/quoteBlock.d.ts +0 -15
- package/dist/doc/templates/quoteBlock.d.ts.map +0 -1
- package/dist/doc/templates/quoteBlock.js +0 -101
- package/dist/doc/templates/quoteBlock.js.map +0 -1
- package/dist/doc/templates/sectionHeader.d.ts +0 -14
- package/dist/doc/templates/sectionHeader.d.ts.map +0 -1
- package/dist/doc/templates/sectionHeader.js +0 -97
- package/dist/doc/templates/sectionHeader.js.map +0 -1
- package/dist/doc/templates/statHighlight.d.ts +0 -27
- package/dist/doc/templates/statHighlight.d.ts.map +0 -1
- package/dist/doc/templates/statHighlight.js +0 -114
- package/dist/doc/templates/statHighlight.js.map +0 -1
- package/dist/doc/templates/titleBlock.d.ts +0 -24
- package/dist/doc/templates/titleBlock.d.ts.map +0 -1
- package/dist/doc/templates/titleBlock.js +0 -103
- package/dist/doc/templates/titleBlock.js.map +0 -1
- package/dist/doc/templates/twoColumn.d.ts +0 -15
- package/dist/doc/templates/twoColumn.d.ts.map +0 -1
- package/dist/doc/templates/twoColumn.js +0 -225
- package/dist/doc/templates/twoColumn.js.map +0 -1
- package/dist/doc/templates/videoPullQuote.d.ts +0 -20
- package/dist/doc/templates/videoPullQuote.d.ts.map +0 -1
- package/dist/doc/templates/videoPullQuote.js +0 -122
- package/dist/doc/templates/videoPullQuote.js.map +0 -1
- package/dist/doc/templates/videoWithCaption.d.ts +0 -20
- package/dist/doc/templates/videoWithCaption.d.ts.map +0 -1
- package/dist/doc/templates/videoWithCaption.js +0 -107
- package/dist/doc/templates/videoWithCaption.js.map +0 -1
- package/dist/doc/utils/animationUtils.d.ts +0 -34
- package/dist/doc/utils/animationUtils.d.ts.map +0 -1
- package/dist/doc/utils/animationUtils.js +0 -110
- package/dist/doc/utils/animationUtils.js.map +0 -1
- package/dist/doc/utils/themeUtils.d.ts +0 -64
- package/dist/doc/utils/themeUtils.d.ts.map +0 -1
- package/dist/doc/utils/themeUtils.js +0 -136
- package/dist/doc/utils/themeUtils.js.map +0 -1
- package/dist/generate/contentExtractor.d.ts +0 -112
- package/dist/generate/contentExtractor.d.ts.map +0 -1
- package/dist/generate/contentExtractor.js +0 -638
- package/dist/generate/contentExtractor.js.map +0 -1
- package/dist/generate/index.d.ts.map +0 -1
- package/dist/generate/slideshowGenerator.d.ts +0 -72
- package/dist/generate/slideshowGenerator.d.ts.map +0 -1
- package/dist/generate/slideshowGenerator.js +0 -159
- package/dist/generate/slideshowGenerator.js.map +0 -1
- package/dist/generate/templateMapper.d.ts +0 -23
- package/dist/generate/templateMapper.d.ts.map +0 -1
- package/dist/generate/templateMapper.js +0 -114
- package/dist/generate/templateMapper.js.map +0 -1
- package/dist/icons/iconData.d.ts +0 -26
- package/dist/icons/iconData.d.ts.map +0 -1
- package/dist/icons/iconData.js +0 -12
- package/dist/icons/iconData.js.map +0 -1
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/resolve.d.ts +0 -61
- package/dist/icons/resolve.d.ts.map +0 -1
- package/dist/icons/resolve.js +0 -130
- package/dist/icons/resolve.js.map +0 -1
- package/dist/imageEdit/ImageEditVersionManager.d.ts +0 -31
- package/dist/imageEdit/ImageEditVersionManager.d.ts.map +0 -1
- package/dist/imageEdit/ImageEditVersionManager.js +0 -39
- package/dist/imageEdit/ImageEditVersionManager.js.map +0 -1
- package/dist/imageEdit/export.d.ts +0 -33
- package/dist/imageEdit/export.d.ts.map +0 -1
- package/dist/imageEdit/export.js +0 -253
- package/dist/imageEdit/export.js.map +0 -1
- package/dist/imageEdit/index.d.ts.map +0 -1
- package/dist/imageEdit/persistence.d.ts +0 -15
- package/dist/imageEdit/persistence.d.ts.map +0 -1
- package/dist/imageEdit/persistence.js +0 -49
- package/dist/imageEdit/persistence.js.map +0 -1
- package/dist/imageEdit/state.d.ts +0 -42
- package/dist/imageEdit/state.d.ts.map +0 -1
- package/dist/imageEdit/state.js +0 -98
- package/dist/imageEdit/state.js.map +0 -1
- package/dist/imageEdit/versionPaths.d.ts +0 -27
- package/dist/imageEdit/versionPaths.d.ts.map +0 -1
- package/dist/imageEdit/versionPaths.js +0 -57
- package/dist/imageEdit/versionPaths.js.map +0 -1
- package/dist/imageEdit/versions.d.ts +0 -67
- package/dist/imageEdit/versions.d.ts.map +0 -1
- package/dist/imageEdit/versions.js +0 -161
- package/dist/imageEdit/versions.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsonForm/chooseControl.d.ts +0 -20
- package/dist/jsonForm/chooseControl.d.ts.map +0 -1
- package/dist/jsonForm/chooseControl.js +0 -82
- package/dist/jsonForm/chooseControl.js.map +0 -1
- package/dist/jsonForm/evaluateWhen.d.ts +0 -12
- package/dist/jsonForm/evaluateWhen.d.ts.map +0 -1
- package/dist/jsonForm/evaluateWhen.js +0 -65
- package/dist/jsonForm/evaluateWhen.js.map +0 -1
- package/dist/jsonForm/index.d.ts.map +0 -1
- package/dist/jsonForm/inferSchema.d.ts +0 -12
- package/dist/jsonForm/inferSchema.d.ts.map +0 -1
- package/dist/jsonForm/inferSchema.js +0 -15
- package/dist/jsonForm/inferSchema.js.map +0 -1
- package/dist/jsonForm/pointer.d.ts +0 -26
- package/dist/jsonForm/pointer.d.ts.map +0 -1
- package/dist/jsonForm/pointer.js +0 -102
- package/dist/jsonForm/pointer.js.map +0 -1
- package/dist/jsonForm/types.d.ts +0 -120
- package/dist/jsonForm/types.d.ts.map +0 -1
- package/dist/jsonForm/types.js +0 -10
- package/dist/jsonForm/types.js.map +0 -1
- package/dist/markdown/convert.d.ts +0 -81
- package/dist/markdown/convert.d.ts.map +0 -1
- package/dist/markdown/convert.js +0 -975
- package/dist/markdown/convert.js.map +0 -1
- package/dist/markdown/htmlParse.d.ts +0 -26
- package/dist/markdown/htmlParse.d.ts.map +0 -1
- package/dist/markdown/htmlParse.js +0 -195
- package/dist/markdown/htmlParse.js.map +0 -1
- package/dist/markdown/index.d.ts.map +0 -1
- package/dist/markdown/parse.d.ts +0 -27
- package/dist/markdown/parse.d.ts.map +0 -1
- package/dist/markdown/parse.js +0 -90
- package/dist/markdown/parse.js.map +0 -1
- package/dist/markdown/stringify.d.ts +0 -32
- package/dist/markdown/stringify.d.ts.map +0 -1
- package/dist/markdown/stringify.js +0 -108
- package/dist/markdown/stringify.js.map +0 -1
- package/dist/markdown/types.d.ts +0 -531
- package/dist/markdown/types.d.ts.map +0 -1
- package/dist/markdown/types.js +0 -17
- package/dist/markdown/types.js.map +0 -1
- package/dist/markdown/utils.d.ts +0 -118
- package/dist/markdown/utils.d.ts.map +0 -1
- package/dist/markdown/utils.js +0 -308
- package/dist/markdown/utils.js.map +0 -1
- package/dist/random/SeededRandom.d.ts +0 -50
- package/dist/random/SeededRandom.d.ts.map +0 -1
- package/dist/random/SeededRandom.js +0 -115
- package/dist/random/SeededRandom.js.map +0 -1
- package/dist/random/index.d.ts.map +0 -1
- package/dist/recommend/index.d.ts.map +0 -1
- package/dist/recommend/templates.d.ts +0 -39
- package/dist/recommend/templates.d.ts.map +0 -1
- package/dist/recommend/templates.js +0 -235
- package/dist/recommend/templates.js.map +0 -1
- package/dist/schemas/BlockTemplates.d.ts +0 -638
- package/dist/schemas/BlockTemplates.d.ts.map +0 -1
- package/dist/schemas/BlockTemplates.js +0 -72
- package/dist/schemas/BlockTemplates.js.map +0 -1
- package/dist/schemas/Doc.d.ts +0 -503
- package/dist/schemas/Doc.d.ts.map +0 -1
- package/dist/schemas/Doc.js +0 -90
- package/dist/schemas/Doc.js.map +0 -1
- package/dist/schemas/ImageEditDoc.d.ts +0 -81
- package/dist/schemas/ImageEditDoc.d.ts.map +0 -1
- package/dist/schemas/ImageEditDoc.js +0 -20
- package/dist/schemas/ImageEditDoc.js.map +0 -1
- package/dist/schemas/LayoutStrategy.d.ts +0 -84
- package/dist/schemas/LayoutStrategy.d.ts.map +0 -1
- package/dist/schemas/LayoutStrategy.js +0 -123
- package/dist/schemas/LayoutStrategy.js.map +0 -1
- package/dist/schemas/MediaProvider.d.ts +0 -65
- package/dist/schemas/MediaProvider.d.ts.map +0 -1
- package/dist/schemas/MediaProvider.js +0 -13
- package/dist/schemas/MediaProvider.js.map +0 -1
- package/dist/schemas/Theme.d.ts +0 -233
- package/dist/schemas/Theme.d.ts.map +0 -1
- package/dist/schemas/Theme.js +0 -129
- package/dist/schemas/Theme.js.map +0 -1
- package/dist/schemas/Types.d.ts +0 -14
- package/dist/schemas/Types.d.ts.map +0 -1
- package/dist/schemas/Types.js +0 -5
- package/dist/schemas/Types.js.map +0 -1
- package/dist/schemas/Viewport.d.ts +0 -74
- package/dist/schemas/Viewport.d.ts.map +0 -1
- package/dist/schemas/Viewport.js +0 -63
- package/dist/schemas/Viewport.js.map +0 -1
- package/dist/schemas/colorUtils.d.ts +0 -51
- package/dist/schemas/colorUtils.d.ts.map +0 -1
- package/dist/schemas/colorUtils.js +0 -154
- package/dist/schemas/colorUtils.js.map +0 -1
- package/dist/schemas/fontStacks.d.ts +0 -57
- package/dist/schemas/fontStacks.d.ts.map +0 -1
- package/dist/schemas/fontStacks.js +0 -227
- package/dist/schemas/fontStacks.js.map +0 -1
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/themeCompile.d.ts +0 -45
- package/dist/schemas/themeCompile.d.ts.map +0 -1
- package/dist/schemas/themeCompile.js +0 -160
- package/dist/schemas/themeCompile.js.map +0 -1
- package/dist/schemas/themeLibrary.d.ts +0 -37
- package/dist/schemas/themeLibrary.d.ts.map +0 -1
- package/dist/schemas/themeLibrary.js +0 -49
- package/dist/schemas/themeLibrary.js.map +0 -1
- package/dist/schemas/themeValidator.d.ts +0 -26
- package/dist/schemas/themeValidator.d.ts.map +0 -1
- package/dist/schemas/themeValidator.js +0 -352
- package/dist/schemas/themeValidator.js.map +0 -1
- package/dist/schemas/themes/bold.json +0 -48
- package/dist/schemas/themes/cinematic.json +0 -54
- package/dist/schemas/themes/documentary.json +0 -49
- package/dist/schemas/themes/gezellig.json +0 -44
- package/dist/schemas/themes/index.d.ts +0 -26
- package/dist/schemas/themes/index.d.ts.map +0 -1
- package/dist/schemas/themes/index.js +0 -49
- package/dist/schemas/themes/index.js.map +0 -1
- package/dist/schemas/themes/magazine.json +0 -44
- package/dist/schemas/themes/minimalist.json +0 -45
- package/dist/schemas/themes/morning-light.json +0 -42
- package/dist/schemas/themes/standard-dark.json +0 -50
- package/dist/schemas/themes/standard.json +0 -42
- package/dist/schemas/themes/tech-dark.json +0 -48
- package/dist/schemas/themes/warm-earth.json +0 -50
- package/dist/spatial/Geohash.d.ts +0 -85
- package/dist/spatial/Geohash.d.ts.map +0 -1
- package/dist/spatial/Geohash.js +0 -142
- package/dist/spatial/Geohash.js.map +0 -1
- package/dist/spatial/Haversine.d.ts +0 -24
- package/dist/spatial/Haversine.d.ts.map +0 -1
- package/dist/spatial/Haversine.js +0 -48
- package/dist/spatial/Haversine.js.map +0 -1
- package/dist/spatial/index.d.ts.map +0 -1
- package/dist/storage/ContentContainer.d.ts +0 -87
- package/dist/storage/ContentContainer.d.ts.map +0 -1
- package/dist/storage/ContentContainer.js +0 -131
- package/dist/storage/ContentContainer.js.map +0 -1
- package/dist/storage/LocalForageAdapter.d.ts +0 -36
- package/dist/storage/LocalForageAdapter.d.ts.map +0 -1
- package/dist/storage/LocalForageAdapter.js +0 -82
- package/dist/storage/LocalForageAdapter.js.map +0 -1
- package/dist/storage/LocalStorageAdapter.d.ts +0 -16
- package/dist/storage/LocalStorageAdapter.d.ts.map +0 -1
- package/dist/storage/LocalStorageAdapter.js +0 -50
- package/dist/storage/LocalStorageAdapter.js.map +0 -1
- package/dist/storage/MediaProviderFromContainer.d.ts +0 -21
- package/dist/storage/MediaProviderFromContainer.d.ts.map +0 -1
- package/dist/storage/MediaProviderFromContainer.js +0 -79
- package/dist/storage/MediaProviderFromContainer.js.map +0 -1
- package/dist/storage/MemoryStorageAdapter.d.ts +0 -15
- package/dist/storage/MemoryStorageAdapter.d.ts.map +0 -1
- package/dist/storage/MemoryStorageAdapter.js +0 -34
- package/dist/storage/MemoryStorageAdapter.js.map +0 -1
- package/dist/storage/ScopedContentContainer.d.ts +0 -44
- package/dist/storage/ScopedContentContainer.d.ts.map +0 -1
- package/dist/storage/ScopedContentContainer.js +0 -94
- package/dist/storage/ScopedContentContainer.js.map +0 -1
- package/dist/storage/Storage.d.ts +0 -23
- package/dist/storage/Storage.d.ts.map +0 -1
- package/dist/storage/Storage.js +0 -9
- package/dist/storage/Storage.js.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/timing/index.d.ts.map +0 -1
- package/dist/timing/narrationTiming.d.ts +0 -54
- package/dist/timing/narrationTiming.d.ts.map +0 -1
- package/dist/timing/narrationTiming.js +0 -190
- package/dist/timing/narrationTiming.js.map +0 -1
- package/dist/timing/readingTime.d.ts +0 -54
- package/dist/timing/readingTime.d.ts.map +0 -1
- package/dist/timing/readingTime.js +0 -49
- package/dist/timing/readingTime.js.map +0 -1
- package/dist/transform/applyTransform.d.ts +0 -22
- package/dist/transform/applyTransform.d.ts.map +0 -1
- package/dist/transform/applyTransform.js +0 -68
- package/dist/transform/applyTransform.js.map +0 -1
- package/dist/transform/blockAnalyzer.d.ts +0 -48
- package/dist/transform/blockAnalyzer.d.ts.map +0 -1
- package/dist/transform/blockAnalyzer.js +0 -135
- package/dist/transform/blockAnalyzer.js.map +0 -1
- package/dist/transform/index.d.ts.map +0 -1
- package/dist/transform/registry.d.ts +0 -19
- package/dist/transform/registry.d.ts.map +0 -1
- package/dist/transform/registry.js +0 -41
- package/dist/transform/registry.js.map +0 -1
- package/dist/transform/styles/dataDriven.d.ts +0 -4
- package/dist/transform/styles/dataDriven.d.ts.map +0 -1
- package/dist/transform/styles/dataDriven.js +0 -15
- package/dist/transform/styles/dataDriven.js.map +0 -1
- package/dist/transform/styles/documentary.d.ts +0 -4
- package/dist/transform/styles/documentary.d.ts.map +0 -1
- package/dist/transform/styles/documentary.js +0 -15
- package/dist/transform/styles/documentary.js.map +0 -1
- package/dist/transform/styles/index.d.ts +0 -6
- package/dist/transform/styles/index.d.ts.map +0 -1
- package/dist/transform/styles/index.js +0 -6
- package/dist/transform/styles/index.js.map +0 -1
- package/dist/transform/styles/magazine.d.ts +0 -4
- package/dist/transform/styles/magazine.d.ts.map +0 -1
- package/dist/transform/styles/magazine.js +0 -15
- package/dist/transform/styles/magazine.js.map +0 -1
- package/dist/transform/styles/minimal.d.ts +0 -4
- package/dist/transform/styles/minimal.d.ts.map +0 -1
- package/dist/transform/styles/minimal.js +0 -15
- package/dist/transform/styles/minimal.js.map +0 -1
- package/dist/transform/styles/narrative.d.ts +0 -4
- package/dist/transform/styles/narrative.d.ts.map +0 -1
- package/dist/transform/styles/narrative.js +0 -15
- package/dist/transform/styles/narrative.js.map +0 -1
- package/dist/transform/templateSelector.d.ts +0 -30
- package/dist/transform/templateSelector.d.ts.map +0 -1
- package/dist/transform/templateSelector.js +0 -218
- package/dist/transform/templateSelector.js.map +0 -1
- package/dist/transform/timingAllocator.d.ts +0 -21
- package/dist/transform/timingAllocator.d.ts.map +0 -1
- package/dist/transform/timingAllocator.js +0 -111
- package/dist/transform/timingAllocator.js.map +0 -1
- package/dist/transform/types.d.ts +0 -86
- package/dist/transform/types.d.ts.map +0 -1
- package/dist/transform/types.js +0 -9
- package/dist/transform/types.js.map +0 -1
- package/dist/versions/DocumentVersionManager.d.ts +0 -31
- package/dist/versions/DocumentVersionManager.d.ts.map +0 -1
- package/dist/versions/DocumentVersionManager.js +0 -33
- package/dist/versions/DocumentVersionManager.js.map +0 -1
- package/dist/versions/index.d.ts.map +0 -1
- package/dist/versions/operations.d.ts +0 -44
- package/dist/versions/operations.d.ts.map +0 -1
- package/dist/versions/operations.js +0 -190
- package/dist/versions/operations.js.map +0 -1
- package/dist/versions/paths.d.ts +0 -29
- package/dist/versions/paths.d.ts.map +0 -1
- package/dist/versions/paths.js +0 -66
- package/dist/versions/paths.js.map +0 -1
- package/dist/versions/timestamp.d.ts +0 -22
- package/dist/versions/timestamp.d.ts.map +0 -1
- package/dist/versions/timestamp.js +0 -44
- package/dist/versions/timestamp.js.map +0 -1
- package/dist/versions/types.d.ts +0 -92
- package/dist/versions/types.d.ts.map +0 -1
- package/dist/versions/types.js +0 -11
- package/dist/versions/types.js.map +0 -1
|
@@ -20,12 +20,19 @@ import type {
|
|
|
20
20
|
PersistentLayerConfig,
|
|
21
21
|
} from '../../schemas/BlockTemplates.js';
|
|
22
22
|
import type { Theme } from '../../schemas/Theme.js';
|
|
23
|
+
import type { CustomTemplateDefinition } from '../../schemas/CustomTemplates.js';
|
|
23
24
|
import { isTemplateBlock, createTemplateContext } from '../../schemas/BlockTemplates.js';
|
|
24
25
|
import { DEFAULT_THEME as defaultTheme } from '../../schemas/themeLibrary.js';
|
|
25
|
-
import { expandPersistentLayers } from './persistentLayers.js';
|
|
26
|
+
import { expandPersistentLayers, wrapWithPersistentLayers } from './persistentLayers.js';
|
|
27
|
+
import { applyRenderStyleToLayers } from '../utils/applyRenderStyle.js';
|
|
28
|
+
import { resolveBlockTransition } from '../../schemas/Transitions.js';
|
|
29
|
+
import { makeCustomTemplateFn } from './customTemplate.js';
|
|
26
30
|
import type { ViewportConfig } from '../../schemas/Viewport.js';
|
|
27
31
|
import { VIEWPORT_PRESETS } from '../../schemas/Viewport.js';
|
|
28
32
|
|
|
33
|
+
export { TEMPLATE_METADATA } from './metadata.js';
|
|
34
|
+
export type { TemplateMetadata } from './metadata.js';
|
|
35
|
+
|
|
29
36
|
// Import all template functions
|
|
30
37
|
import { titleBlock } from './titleBlock.js';
|
|
31
38
|
import { sectionHeader } from './sectionHeader.js';
|
|
@@ -46,6 +53,9 @@ import { pullQuote } from './pullQuote.js';
|
|
|
46
53
|
import { videoWithCaption } from './videoWithCaption.js';
|
|
47
54
|
import { videoPullQuote } from './videoPullQuote.js';
|
|
48
55
|
import { dataTable } from './dataTable.js';
|
|
56
|
+
import { diagramBlock } from './diagramBlock.js';
|
|
57
|
+
import { drawingBlock } from './drawingBlock.js';
|
|
58
|
+
import { layoutBlock } from './layoutBlock.js';
|
|
49
59
|
|
|
50
60
|
/**
|
|
51
61
|
* Registry mapping template ids (the strings that appear in
|
|
@@ -82,6 +92,9 @@ export const templateRegistry: TemplateRegistry = {
|
|
|
82
92
|
videoWithCaption,
|
|
83
93
|
videoPullQuote,
|
|
84
94
|
dataTable,
|
|
95
|
+
diagram: diagramBlock,
|
|
96
|
+
layout: layoutBlock,
|
|
97
|
+
drawing: drawingBlock,
|
|
85
98
|
};
|
|
86
99
|
|
|
87
100
|
/**
|
|
@@ -95,6 +108,8 @@ export const TEMPLATE_ALIASES: Readonly<Record<string, string>> = {
|
|
|
95
108
|
quoteBlock: 'quote',
|
|
96
109
|
mapBlock: 'map',
|
|
97
110
|
listBlock: 'list',
|
|
111
|
+
diagramBlock: 'diagram',
|
|
112
|
+
diagramNode: 'diagram',
|
|
98
113
|
};
|
|
99
114
|
|
|
100
115
|
/**
|
|
@@ -105,14 +120,67 @@ export function resolveTemplateName(name: string): string {
|
|
|
105
120
|
return TEMPLATE_ALIASES[name] ?? name;
|
|
106
121
|
}
|
|
107
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Container templates render their parent block by consuming the block's
|
|
125
|
+
* child headings (via `context.children`) — `diagram` draws them as nodes,
|
|
126
|
+
* `drawing` as shapes, `layout` as absolutely-positioned layers. Those
|
|
127
|
+
* children are therefore NOT independently renderable slides/sections;
|
|
128
|
+
* render paths use {@link isContainerTemplate} to skip descending into
|
|
129
|
+
* them (see `flattenRenderableBlocks`).
|
|
130
|
+
*/
|
|
131
|
+
export const CONTAINER_TEMPLATES: ReadonlySet<string> = new Set(['diagram', 'drawing', 'layout']);
|
|
132
|
+
|
|
133
|
+
/** True when `name` (or its alias) is a children-consuming container template. */
|
|
134
|
+
export function isContainerTemplate(name: string | undefined): boolean {
|
|
135
|
+
if (!name) return false;
|
|
136
|
+
return CONTAINER_TEMPLATES.has(resolveTemplateName(name));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Merge user-defined custom templates onto the built-in registry.
|
|
141
|
+
* Built-in names take precedence on collision — a user can't shadow
|
|
142
|
+
* `title` or `diagram` from a custom definition. Returns a frozen view
|
|
143
|
+
* so callers don't accidentally mutate the global registry.
|
|
144
|
+
*/
|
|
145
|
+
export type RuntimeTemplateRegistry = Record<
|
|
146
|
+
string,
|
|
147
|
+
(input: TemplateBlock, ctx: TemplateContext) => Layer[]
|
|
148
|
+
>;
|
|
149
|
+
|
|
150
|
+
export function buildRegistry(
|
|
151
|
+
custom?: readonly CustomTemplateDefinition[],
|
|
152
|
+
): RuntimeTemplateRegistry {
|
|
153
|
+
// The exported `templateRegistry` is a discriminated-union mapped type;
|
|
154
|
+
// we cast through `unknown` because each entry's `input` type is the
|
|
155
|
+
// template-specific variant, not the broad `TemplateBlock` union.
|
|
156
|
+
// The runtime contract — "given any TemplateBlock that resolves to a
|
|
157
|
+
// registered name, the function returns Layer[]" — holds because the
|
|
158
|
+
// expansion path looks up by `template` string before calling.
|
|
159
|
+
const merged: RuntimeTemplateRegistry = {
|
|
160
|
+
...(templateRegistry as unknown as RuntimeTemplateRegistry),
|
|
161
|
+
};
|
|
162
|
+
if (custom) {
|
|
163
|
+
for (const def of custom) {
|
|
164
|
+
if (merged[def.name]) continue; // built-in wins
|
|
165
|
+
merged[def.name] = makeCustomTemplateFn(def) as unknown as RuntimeTemplateRegistry[string];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return merged;
|
|
169
|
+
}
|
|
170
|
+
|
|
108
171
|
/**
|
|
109
172
|
* Expand a template block into a full Block with layers.
|
|
173
|
+
*
|
|
174
|
+
* `registry` lets callers swap in a registry that includes user-defined
|
|
175
|
+
* custom templates. Defaults to the built-in registry when omitted.
|
|
110
176
|
*/
|
|
111
|
-
export function expandTemplateBlock(
|
|
177
|
+
export function expandTemplateBlock(
|
|
178
|
+
templateBlock: TemplateBlock,
|
|
179
|
+
context: TemplateContext,
|
|
180
|
+
registry: RuntimeTemplateRegistry = templateRegistry as unknown as RuntimeTemplateRegistry,
|
|
181
|
+
): Block {
|
|
112
182
|
const resolved = resolveTemplateName(templateBlock.template);
|
|
113
|
-
const templateFn =
|
|
114
|
-
| ((input: TemplateBlock, ctx: TemplateContext) => Layer[])
|
|
115
|
-
| undefined;
|
|
183
|
+
const templateFn = registry[resolved];
|
|
116
184
|
|
|
117
185
|
if (!templateFn) {
|
|
118
186
|
console.warn(`Unknown template: ${templateBlock.template}`);
|
|
@@ -127,10 +195,19 @@ export function expandTemplateBlock(templateBlock: TemplateBlock, context: Templ
|
|
|
127
195
|
};
|
|
128
196
|
}
|
|
129
197
|
|
|
198
|
+
// Effective template input: the block's own fields, then structured
|
|
199
|
+
// body data (```json data fences / derived auto-template inputs), then
|
|
200
|
+
// `{[…]}` string overrides — the same merge order getLayers uses.
|
|
201
|
+
const { templateData, templateOverrides } = templateBlock as Block;
|
|
202
|
+
const input =
|
|
203
|
+
templateData || templateOverrides
|
|
204
|
+
? ({ ...templateBlock, ...templateData, ...templateOverrides } as TemplateBlock)
|
|
205
|
+
: templateBlock;
|
|
206
|
+
|
|
130
207
|
// Generate layers from template with error handling
|
|
131
208
|
let layers: Layer[];
|
|
132
209
|
try {
|
|
133
|
-
layers = templateFn(
|
|
210
|
+
layers = templateFn(input, context);
|
|
134
211
|
if (!Array.isArray(layers)) {
|
|
135
212
|
console.error(
|
|
136
213
|
`Template ${templateBlock.template} did not return an array, got:`,
|
|
@@ -180,6 +257,12 @@ export interface ExpandDocBlocksOptions {
|
|
|
180
257
|
* ensuring proper synchronization with audio playback.
|
|
181
258
|
*/
|
|
182
259
|
audioSegments?: AudioSegmentTiming[];
|
|
260
|
+
/**
|
|
261
|
+
* User-defined custom templates to merge onto the built-in registry
|
|
262
|
+
* before expanding blocks. Typically passed straight from
|
|
263
|
+
* `Doc.customTemplates`. Built-in names take precedence on collision.
|
|
264
|
+
*/
|
|
265
|
+
customTemplates?: readonly CustomTemplateDefinition[];
|
|
183
266
|
}
|
|
184
267
|
|
|
185
268
|
/**
|
|
@@ -193,38 +276,88 @@ export interface ExpandDocBlocksOptions {
|
|
|
193
276
|
* @param blocks - Array of template or raw blocks
|
|
194
277
|
* @param options - Expansion options including theme, viewport, and persistent layers
|
|
195
278
|
*/
|
|
279
|
+
/**
|
|
280
|
+
* Finalize an expanded block in place: apply the theme's motion post-pass
|
|
281
|
+
* to template-generated layers, wrap with persistent bottom/top layers,
|
|
282
|
+
* and fill the theme's default transition (never on block 0, never over an
|
|
283
|
+
* authored transition). Shared by every expansion path in this module.
|
|
284
|
+
*/
|
|
285
|
+
function finalizeExpandedBlock(
|
|
286
|
+
expandedBlock: Block,
|
|
287
|
+
sourceBlock: DocBlock,
|
|
288
|
+
blockIndex: number,
|
|
289
|
+
theme: Theme,
|
|
290
|
+
bottomLayers: Layer[],
|
|
291
|
+
topLayers: Layer[],
|
|
292
|
+
): void {
|
|
293
|
+
// Theme motion defaults apply only to template-generated layers —
|
|
294
|
+
// raw authored block.layers are never restyled.
|
|
295
|
+
if (isTemplateBlock(sourceBlock) && expandedBlock.layers && expandedBlock.layers.length > 0) {
|
|
296
|
+
expandedBlock.layers = applyRenderStyleToLayers(expandedBlock.layers, expandedBlock, theme);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (bottomLayers.length > 0 || topLayers.length > 0) {
|
|
300
|
+
expandedBlock.layers = wrapWithPersistentLayers(
|
|
301
|
+
expandedBlock.layers ?? [],
|
|
302
|
+
sourceBlock as TemplateBlock,
|
|
303
|
+
bottomLayers,
|
|
304
|
+
topLayers,
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const transition = resolveBlockTransition(expandedBlock, theme, blockIndex);
|
|
309
|
+
if (transition !== expandedBlock.transition) {
|
|
310
|
+
expandedBlock.transition = transition;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
196
314
|
export function expandDocBlocks(blocks: DocBlock[], options: ExpandDocBlocksOptions = {}): Block[] {
|
|
197
315
|
const opts: ExpandDocBlocksOptions = options;
|
|
198
316
|
|
|
199
317
|
const theme = opts.theme ?? defaultTheme;
|
|
200
318
|
const viewport = opts.viewport ?? VIEWPORT_PRESETS.landscape;
|
|
201
|
-
const { persistentLayers, audioSegments } = opts;
|
|
319
|
+
const { persistentLayers, audioSegments, customTemplates } = opts;
|
|
202
320
|
const totalBlocks = blocks.length;
|
|
203
|
-
|
|
204
|
-
//
|
|
205
|
-
const
|
|
206
|
-
|
|
321
|
+
// Merge user-defined templates onto the built-in registry once per
|
|
322
|
+
// call; passed into every `expandTemplateBlock` invocation below.
|
|
323
|
+
const registry: RuntimeTemplateRegistry =
|
|
324
|
+
customTemplates && customTemplates.length > 0
|
|
325
|
+
? buildRegistry(customTemplates)
|
|
326
|
+
: (templateRegistry as unknown as RuntimeTemplateRegistry);
|
|
327
|
+
|
|
328
|
+
// Pre-expand persistent layers once. Callers that pass no config inherit
|
|
329
|
+
// the theme's atmosphere (docs with their own layers pass them in and win
|
|
330
|
+
// wholesale — see resolvePersistentLayers).
|
|
331
|
+
const effectivePersistentLayers = persistentLayers ?? theme.persistentLayers;
|
|
332
|
+
const bottomLayers = expandPersistentLayers(effectivePersistentLayers?.bottomLayers, theme);
|
|
333
|
+
const topLayers = expandPersistentLayers(effectivePersistentLayers?.topLayers, theme);
|
|
207
334
|
|
|
208
335
|
// If no audio segments provided, use simple cumulative timing
|
|
209
336
|
if (!audioSegments || audioSegments.length === 0) {
|
|
210
337
|
let currentTime = 0;
|
|
211
338
|
return blocks.map((block, index) => {
|
|
212
339
|
const context = createTemplateContext(theme, index, totalBlocks, viewport);
|
|
340
|
+
const maybeChildren = (block as Block).children;
|
|
341
|
+
if (maybeChildren && maybeChildren.length > 0) {
|
|
342
|
+
context.children = maybeChildren;
|
|
343
|
+
}
|
|
344
|
+
// Expose the source block so custom templates' token resolver can
|
|
345
|
+
// see the block's title / contents / children. Only set for
|
|
346
|
+
// custom-templated blocks — built-ins ignore context.block but
|
|
347
|
+
// exposing it changes object identity which we want to avoid for
|
|
348
|
+
// the perf-sensitive built-in path.
|
|
349
|
+
if (
|
|
350
|
+
isTemplateBlock(block) &&
|
|
351
|
+
customTemplates &&
|
|
352
|
+
customTemplates.some((c) => c.name === block.template)
|
|
353
|
+
) {
|
|
354
|
+
context.block = block as Block;
|
|
355
|
+
}
|
|
213
356
|
const expandedBlock = isTemplateBlock(block)
|
|
214
|
-
? expandTemplateBlock(block, context)
|
|
357
|
+
? expandTemplateBlock(block, context, registry)
|
|
215
358
|
: (block as Block);
|
|
216
359
|
|
|
217
|
-
|
|
218
|
-
const templateBlock = block as TemplateBlock;
|
|
219
|
-
const useBottom = templateBlock.useBottomLayer !== false;
|
|
220
|
-
const useTop = templateBlock.useTopLayer !== false;
|
|
221
|
-
if (bottomLayers.length > 0 || topLayers.length > 0) {
|
|
222
|
-
expandedBlock.layers = [
|
|
223
|
-
...(useBottom ? bottomLayers : []),
|
|
224
|
-
...(expandedBlock.layers ?? []),
|
|
225
|
-
...(useTop ? topLayers : []),
|
|
226
|
-
];
|
|
227
|
-
}
|
|
360
|
+
finalizeExpandedBlock(expandedBlock, block, index, theme, bottomLayers, topLayers);
|
|
228
361
|
|
|
229
362
|
expandedBlock.startTime = currentTime;
|
|
230
363
|
currentTime += expandedBlock.duration;
|
|
@@ -252,20 +385,22 @@ export function expandDocBlocks(blocks: DocBlock[], options: ExpandDocBlocksOpti
|
|
|
252
385
|
let offsetTime = 0;
|
|
253
386
|
for (const { block, originalIndex } of segmentBlocks) {
|
|
254
387
|
const context = createTemplateContext(theme, originalIndex, totalBlocks, viewport);
|
|
388
|
+
const maybeChildren = (block as Block).children;
|
|
389
|
+
if (maybeChildren && maybeChildren.length > 0) {
|
|
390
|
+
context.children = maybeChildren;
|
|
391
|
+
}
|
|
392
|
+
if (
|
|
393
|
+
isTemplateBlock(block) &&
|
|
394
|
+
customTemplates &&
|
|
395
|
+
customTemplates.some((c) => c.name === block.template)
|
|
396
|
+
) {
|
|
397
|
+
context.block = block as Block;
|
|
398
|
+
}
|
|
255
399
|
const expandedBlock = isTemplateBlock(block)
|
|
256
|
-
? expandTemplateBlock(block, context)
|
|
400
|
+
? expandTemplateBlock(block, context, registry)
|
|
257
401
|
: (block as Block);
|
|
258
402
|
|
|
259
|
-
|
|
260
|
-
const useBottom = templateBlock.useBottomLayer !== false;
|
|
261
|
-
const useTop = templateBlock.useTopLayer !== false;
|
|
262
|
-
if (bottomLayers.length > 0 || topLayers.length > 0) {
|
|
263
|
-
expandedBlock.layers = [
|
|
264
|
-
...(useBottom ? bottomLayers : []),
|
|
265
|
-
...(expandedBlock.layers ?? []),
|
|
266
|
-
...(useTop ? topLayers : []),
|
|
267
|
-
];
|
|
268
|
-
}
|
|
403
|
+
finalizeExpandedBlock(expandedBlock, block, originalIndex, theme, bottomLayers, topLayers);
|
|
269
404
|
|
|
270
405
|
expandedBlock.startTime = offsetTime;
|
|
271
406
|
offsetTime += expandedBlock.duration;
|
|
@@ -318,21 +453,24 @@ export function expandDocBlocks(blocks: DocBlock[], options: ExpandDocBlocksOpti
|
|
|
318
453
|
|
|
319
454
|
for (const { block, originalIndex } of segmentBlocks) {
|
|
320
455
|
const context = createTemplateContext(theme, originalIndex, totalBlocks, viewport);
|
|
456
|
+
const maybeChildren = (block as Block).children;
|
|
457
|
+
if (maybeChildren && maybeChildren.length > 0) {
|
|
458
|
+
context.children = maybeChildren;
|
|
459
|
+
}
|
|
460
|
+
if (
|
|
461
|
+
isTemplateBlock(block) &&
|
|
462
|
+
customTemplates &&
|
|
463
|
+
customTemplates.some((c) => c.name === block.template)
|
|
464
|
+
) {
|
|
465
|
+
context.block = block as Block;
|
|
466
|
+
}
|
|
321
467
|
const expandedBlock = isTemplateBlock(block)
|
|
322
|
-
? expandTemplateBlock(block, context)
|
|
468
|
+
? expandTemplateBlock(block, context, registry)
|
|
323
469
|
: (block as Block);
|
|
324
470
|
|
|
325
|
-
|
|
326
|
-
const useBottom = templateBlock.useBottomLayer !== false;
|
|
327
|
-
const useTop = templateBlock.useTopLayer !== false;
|
|
328
|
-
if (bottomLayers.length > 0 || topLayers.length > 0) {
|
|
329
|
-
expandedBlock.layers = [
|
|
330
|
-
...(useBottom ? bottomLayers : []),
|
|
331
|
-
...(expandedBlock.layers ?? []),
|
|
332
|
-
...(useTop ? topLayers : []),
|
|
333
|
-
];
|
|
334
|
-
}
|
|
471
|
+
finalizeExpandedBlock(expandedBlock, block, originalIndex, theme, bottomLayers, topLayers);
|
|
335
472
|
|
|
473
|
+
const templateBlock = block as TemplateBlock;
|
|
336
474
|
expandedInfos.push({
|
|
337
475
|
block: expandedBlock,
|
|
338
476
|
originalIndex,
|
|
@@ -578,7 +716,13 @@ export type {
|
|
|
578
716
|
} from '../../schemas/Viewport.js';
|
|
579
717
|
export { getLayoutHints, getTwoColumnPositions } from '../../schemas/LayoutStrategy.js';
|
|
580
718
|
export type { LayoutHints } from '../../schemas/LayoutStrategy.js';
|
|
581
|
-
export {
|
|
719
|
+
export {
|
|
720
|
+
expandPersistentLayers,
|
|
721
|
+
getDocStyleConfig,
|
|
722
|
+
getPersistentLayersFromTheme,
|
|
723
|
+
resolvePersistentLayers,
|
|
724
|
+
wrapWithPersistentLayers,
|
|
725
|
+
} from './persistentLayers.js';
|
|
582
726
|
|
|
583
727
|
// Re-export individual templates for direct access
|
|
584
728
|
export { titleBlock } from './titleBlock.js';
|
|
@@ -602,6 +746,31 @@ export { pullQuote } from './pullQuote.js';
|
|
|
602
746
|
export { videoWithCaption } from './videoWithCaption.js';
|
|
603
747
|
export { videoPullQuote } from './videoPullQuote.js';
|
|
604
748
|
export { dataTable } from './dataTable.js';
|
|
749
|
+
export { diagramBlock } from './diagramBlock.js';
|
|
750
|
+
export { computeDiagramLayout } from './diagramLayout.js';
|
|
751
|
+
export type {
|
|
752
|
+
DiagramLayout,
|
|
753
|
+
DiagramNodePosition,
|
|
754
|
+
DiagramEdge,
|
|
755
|
+
DiagramLayoutOptions,
|
|
756
|
+
} from './diagramLayout.js';
|
|
757
|
+
export { drawingBlock } from './drawingBlock.js';
|
|
758
|
+
export {
|
|
759
|
+
computeDrawingLayout,
|
|
760
|
+
normalizeShapeKind,
|
|
761
|
+
isShapeName,
|
|
762
|
+
SHAPE_NAMES,
|
|
763
|
+
} from './drawingLayout.js';
|
|
764
|
+
export type {
|
|
765
|
+
DrawingLayout,
|
|
766
|
+
DrawingShape,
|
|
767
|
+
DrawingShapeKind,
|
|
768
|
+
DrawingConnector,
|
|
769
|
+
DrawingLayoutOptions,
|
|
770
|
+
} from './drawingLayout.js';
|
|
771
|
+
export { layoutBlock } from './layoutBlock.js';
|
|
772
|
+
export { computeLayoutLayers } from './layoutLayout.js';
|
|
773
|
+
export type { LayoutLayersResult, LayoutLayerDefaults } from './layoutLayout.js';
|
|
605
774
|
|
|
606
775
|
// Re-export accent image utilities
|
|
607
776
|
export { getAccentLayout, createAccentLayers, adjustY, DEFAULT_LAYOUT } from './accentImage.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout block template.
|
|
3
|
+
*
|
|
4
|
+
* Renders the parent block's children as free-form, **absolutely
|
|
5
|
+
* positioned** layers on a canvas (text boxes, shapes, images). Unlike
|
|
6
|
+
* `drawingBlock`, coordinates are used as-is — there is no fit-to-viewport
|
|
7
|
+
* scaling — because a layout is a fixed-canvas composition.
|
|
8
|
+
*
|
|
9
|
+
* Each child is one layer: `### {#id} {[<type> x=.. y=.. …]}`. A text box's
|
|
10
|
+
* content lives in its child body as markdown (see `computeLayoutLayers`).
|
|
11
|
+
* Children render in document order (first child = back-most layer).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { Layer, TextLayer } from '../../schemas/Doc.js';
|
|
15
|
+
import type { TemplateBlock, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
16
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
17
|
+
import { getThemeFont } from '../utils/themeUtils.js';
|
|
18
|
+
import { computeLayoutLayers } from './layoutLayout.js';
|
|
19
|
+
|
|
20
|
+
export function layoutBlock(input: TemplateBlock, context: TemplateContext): Layer[] {
|
|
21
|
+
const { theme, viewport, children = [] } = context;
|
|
22
|
+
// Theme ink for un-styled text and strokes — the fixed dark-slate
|
|
23
|
+
// default disappeared on dark themes.
|
|
24
|
+
const { layers } = computeLayoutLayers(children, viewport, { ink: theme.colors.text });
|
|
25
|
+
return layers.length > 0 ? layers : [emptyHint(input, context)];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function emptyHint(input: TemplateBlock, context: TemplateContext): TextLayer {
|
|
29
|
+
return {
|
|
30
|
+
type: 'text',
|
|
31
|
+
id: 'layout-empty',
|
|
32
|
+
content: {
|
|
33
|
+
text: (input as { title?: string }).title ?? 'Empty layout',
|
|
34
|
+
style: {
|
|
35
|
+
fontSize: scaledFontSize(36, context, true),
|
|
36
|
+
fontFamily: getThemeFont(context, 'title'),
|
|
37
|
+
color: context.theme.colors.textMuted,
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
position: { x: '50%', y: '50%', anchor: 'center' },
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout layout — pure derivation of positioned layers from a `layout`
|
|
3
|
+
* block's child sub-blocks. The layout counterpart to `drawingLayout.ts`,
|
|
4
|
+
* with two deliberate differences:
|
|
5
|
+
*
|
|
6
|
+
* - **Absolute** positioning. Each child's `x`/`y`/`width`/`height` are
|
|
7
|
+
* used as-is in viewport units (no auto-grid, no fit-to-viewport
|
|
8
|
+
* scaling). A layout is a free-form canvas; authors place things where
|
|
9
|
+
* they want them.
|
|
10
|
+
* - **Text content lives in the child body.** A `{[text …]}` child's
|
|
11
|
+
* paragraphs/lists/marks under its heading become the text — readable
|
|
12
|
+
* markdown rather than an encoded blob. (`content.html` is filled by the
|
|
13
|
+
* editor for rich on-canvas rendering; SSR uses the plain `content.text`.)
|
|
14
|
+
*
|
|
15
|
+
* Each child heading is one layer: `### {#id} {[<type> x=.. y=.. …]}`.
|
|
16
|
+
* Children are emitted in document order, so the first child is the
|
|
17
|
+
* back-most layer (painters' order).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import type { Layer, ShapeLayer, TextLayer, PathLayer, ImageLayer } from '../../schemas/Doc.js';
|
|
21
|
+
import { extractPlainText } from '../../markdown/utils.js';
|
|
22
|
+
import { normalizeShapeKind } from './drawingLayout.js';
|
|
23
|
+
import { shapePath } from '../utils/shapeGeometry.js';
|
|
24
|
+
|
|
25
|
+
export interface LayoutLayersResult {
|
|
26
|
+
layers: Layer[];
|
|
27
|
+
warnings: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface LayoutLayerDefaults {
|
|
31
|
+
/**
|
|
32
|
+
* Default ink — text color and path/line stroke — used when the author
|
|
33
|
+
* omits `color=`/`stroke=`. `layoutBlock` passes the theme text color so
|
|
34
|
+
* un-styled text stays legible on dark themes; the editor's scene canvas
|
|
35
|
+
* omits it and gets the dark-slate default that suits its fixed light
|
|
36
|
+
* surface.
|
|
37
|
+
*/
|
|
38
|
+
ink?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Fallback ink for callers that don't supply defaults (editor scene canvas). */
|
|
42
|
+
const DEFAULT_INK = '#1e293b';
|
|
43
|
+
|
|
44
|
+
/** Minimal Block shape this derivation reads (subset of `Block`). */
|
|
45
|
+
interface LayoutChildBlock {
|
|
46
|
+
id: string;
|
|
47
|
+
template?: string;
|
|
48
|
+
templateOverrides?: Record<string, string>;
|
|
49
|
+
title?: string;
|
|
50
|
+
contents?: import('../../markdown/types.js').MarkdownNode[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const DEFAULT_TEXT = { w: 300, h: 80 };
|
|
54
|
+
const DEFAULT_SHAPE = { w: 160, h: 90 };
|
|
55
|
+
const DEFAULT_IMAGE = { w: 320, h: 240 };
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Map a layout block's children → positioned layers. Pure: same children
|
|
59
|
+
* always produce the same layers.
|
|
60
|
+
*/
|
|
61
|
+
export function computeLayoutLayers(
|
|
62
|
+
children: readonly LayoutChildBlock[],
|
|
63
|
+
_viewport: { width: number; height: number },
|
|
64
|
+
defaults: LayoutLayerDefaults = {},
|
|
65
|
+
): LayoutLayersResult {
|
|
66
|
+
const ink = defaults.ink ?? DEFAULT_INK;
|
|
67
|
+
const layers: Layer[] = [];
|
|
68
|
+
const warnings: string[] = [];
|
|
69
|
+
|
|
70
|
+
for (const child of children) {
|
|
71
|
+
const params = child.templateOverrides ?? {};
|
|
72
|
+
const annotation = (child.template ?? '').toLowerCase();
|
|
73
|
+
const x = numParam(params, 'x') ?? 0;
|
|
74
|
+
const y = numParam(params, 'y') ?? 0;
|
|
75
|
+
|
|
76
|
+
if (annotation === 'image' || annotation === 'img') {
|
|
77
|
+
const src = strParam(params, 'src');
|
|
78
|
+
if (!src) {
|
|
79
|
+
warnings.push(`Layout image "${child.id}" has no src= and was skipped`);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const layer: ImageLayer = {
|
|
83
|
+
id: child.id,
|
|
84
|
+
type: 'image',
|
|
85
|
+
position: {
|
|
86
|
+
x,
|
|
87
|
+
y,
|
|
88
|
+
width: numParam(params, 'width') ?? DEFAULT_IMAGE.w,
|
|
89
|
+
height: numParam(params, 'height') ?? DEFAULT_IMAGE.h,
|
|
90
|
+
},
|
|
91
|
+
content: {
|
|
92
|
+
src,
|
|
93
|
+
alt: strParam(params, 'alt') ?? '',
|
|
94
|
+
...(strParam(params, 'fit')
|
|
95
|
+
? { fit: strParam(params, 'fit') as 'cover' | 'contain' | 'fill' }
|
|
96
|
+
: {}),
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
layers.push(layer);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const kind = normalizeShapeKind(child.template);
|
|
104
|
+
if (!kind) {
|
|
105
|
+
warnings.push(
|
|
106
|
+
`Layout child "${child.id}" is not a layer (annotation "${child.template ?? '—'}") and was skipped`,
|
|
107
|
+
);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (kind === 'text') {
|
|
112
|
+
const text = bodyText(child) || child.title || '';
|
|
113
|
+
const layer: TextLayer = {
|
|
114
|
+
id: child.id,
|
|
115
|
+
type: 'text',
|
|
116
|
+
position: {
|
|
117
|
+
x,
|
|
118
|
+
y,
|
|
119
|
+
width: numParam(params, 'width') ?? DEFAULT_TEXT.w,
|
|
120
|
+
height: numParam(params, 'height') ?? DEFAULT_TEXT.h,
|
|
121
|
+
},
|
|
122
|
+
content: { text, style: textStyleFromParams(params, ink) },
|
|
123
|
+
};
|
|
124
|
+
layers.push(layer);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const width = numParam(params, 'width') ?? numParam(params, 'w') ?? DEFAULT_SHAPE.w;
|
|
129
|
+
const height = numParam(params, 'height') ?? numParam(params, 'h') ?? DEFAULT_SHAPE.h;
|
|
130
|
+
|
|
131
|
+
if (kind === 'rect' || kind === 'circle') {
|
|
132
|
+
const shape: ShapeLayer = {
|
|
133
|
+
id: child.id,
|
|
134
|
+
type: 'shape',
|
|
135
|
+
position: { x, y, width, height },
|
|
136
|
+
content: {
|
|
137
|
+
shape: kind,
|
|
138
|
+
...(strParam(params, 'fill') ? { fill: strParam(params, 'fill') } : {}),
|
|
139
|
+
...(strParam(params, 'stroke') ? { stroke: strParam(params, 'stroke') } : {}),
|
|
140
|
+
...(numParam(params, 'strokeWidth') != null
|
|
141
|
+
? { strokeWidth: numParam(params, 'strokeWidth') }
|
|
142
|
+
: {}),
|
|
143
|
+
...(strParam(params, 'borderStyle')
|
|
144
|
+
? { borderStyle: strParam(params, 'borderStyle') as 'solid' | 'dashed' | 'dotted' }
|
|
145
|
+
: {}),
|
|
146
|
+
...(kind === 'rect' && numParam(params, 'borderRadius') != null
|
|
147
|
+
? { borderRadius: numParam(params, 'borderRadius') }
|
|
148
|
+
: {}),
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
layers.push(shape);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// line / arrow / path / named polygon → PathLayer (absolute geometry).
|
|
156
|
+
const diagonal = `M ${round(x)} ${round(y)} L ${round(x + width)} ${round(y + height)}`;
|
|
157
|
+
let d = diagonal;
|
|
158
|
+
let pathFill = 'none';
|
|
159
|
+
let endMarker: 'none' | 'arrow' = 'none';
|
|
160
|
+
if (kind === 'path') {
|
|
161
|
+
d = strParam(params, 'd') ?? diagonal;
|
|
162
|
+
pathFill = strParam(params, 'fill') ?? 'none';
|
|
163
|
+
} else if (kind === 'arrow') {
|
|
164
|
+
endMarker = 'arrow';
|
|
165
|
+
} else if (kind !== 'line') {
|
|
166
|
+
d = shapePath(kind, x, y, width, height) ?? diagonal;
|
|
167
|
+
pathFill = strParam(params, 'fill') ?? 'none';
|
|
168
|
+
}
|
|
169
|
+
const path: PathLayer = {
|
|
170
|
+
id: child.id,
|
|
171
|
+
type: 'path',
|
|
172
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
173
|
+
content: {
|
|
174
|
+
d,
|
|
175
|
+
stroke: strParam(params, 'stroke') ?? ink,
|
|
176
|
+
strokeWidth: numParam(params, 'strokeWidth') ?? 2,
|
|
177
|
+
fill: pathFill,
|
|
178
|
+
...(strParam(params, 'dasharray') ? { dasharray: strParam(params, 'dasharray') } : {}),
|
|
179
|
+
...(endMarker !== 'none' ? { endMarker } : {}),
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
layers.push(path);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return { layers, warnings };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Build a TextStyle from a text layer's annotation params. */
|
|
189
|
+
function textStyleFromParams(
|
|
190
|
+
params: Record<string, string>,
|
|
191
|
+
ink: string,
|
|
192
|
+
): TextLayer['content']['style'] {
|
|
193
|
+
const style: TextLayer['content']['style'] = {
|
|
194
|
+
fontSize: numParam(params, 'fontSize') ?? 32,
|
|
195
|
+
color: strParam(params, 'color') ?? ink,
|
|
196
|
+
};
|
|
197
|
+
const fontFamily = strParam(params, 'fontFamily');
|
|
198
|
+
if (fontFamily) style.fontFamily = fontFamily;
|
|
199
|
+
const fontWeight = strParam(params, 'fontWeight');
|
|
200
|
+
if (fontWeight === 'bold' || fontWeight === 'normal') style.fontWeight = fontWeight;
|
|
201
|
+
const fontStyle = strParam(params, 'fontStyle');
|
|
202
|
+
if (fontStyle === 'italic' || fontStyle === 'normal') style.fontStyle = fontStyle;
|
|
203
|
+
const align = strParam(params, 'align');
|
|
204
|
+
if (align === 'left' || align === 'center' || align === 'right') style.textAlign = align;
|
|
205
|
+
const valign = strParam(params, 'valign');
|
|
206
|
+
if (valign === 'top' || valign === 'middle' || valign === 'bottom') style.verticalAlign = valign;
|
|
207
|
+
const lineHeight = numParam(params, 'lineHeight');
|
|
208
|
+
if (lineHeight != null) style.lineHeight = lineHeight;
|
|
209
|
+
const padding = numParam(params, 'padding');
|
|
210
|
+
if (padding != null) style.padding = padding;
|
|
211
|
+
const background = strParam(params, 'background');
|
|
212
|
+
if (background) style.background = background;
|
|
213
|
+
return style;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Read a raw string param (trims a trailing comma — `x=21, y=25` tolerated). */
|
|
217
|
+
function strParam(params: Record<string, string>, key: string): string | undefined {
|
|
218
|
+
const raw = params[key];
|
|
219
|
+
if (raw == null) return undefined;
|
|
220
|
+
const v = raw.replace(/,\s*$/, '').trim();
|
|
221
|
+
return v.length > 0 ? v : undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Coerce a numeric param, tolerating a trailing comma. Undefined on failure. */
|
|
225
|
+
function numParam(params: Record<string, string>, key: string): number | undefined {
|
|
226
|
+
const v = strParam(params, key);
|
|
227
|
+
if (v == null) return undefined;
|
|
228
|
+
const n = Number(v);
|
|
229
|
+
return Number.isFinite(n) ? n : undefined;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** Plain text of a block's body content. */
|
|
233
|
+
function bodyText(block: LayoutChildBlock): string {
|
|
234
|
+
if (!block.contents || block.contents.length === 0) return '';
|
|
235
|
+
return block.contents
|
|
236
|
+
.map((node) => extractPlainText(node))
|
|
237
|
+
.join('\n')
|
|
238
|
+
.trim();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function round(n: number): number {
|
|
242
|
+
return Math.round(n * 100) / 100;
|
|
243
|
+
}
|