@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
|
@@ -1,715 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { parseMarkdown, stringifyMarkdown, parseHtmlToNodes, stringifyHtmlNodes, getChildren, walkMarkdownTree, findNodesByType, extractPlainText, countNodes, createDocument, parseFrontmatter, } from '../markdown/index';
|
|
3
|
-
// ============================================
|
|
4
|
-
// Helper: strip positions for cleaner assertions
|
|
5
|
-
// ============================================
|
|
6
|
-
function stripPositions(obj) {
|
|
7
|
-
if (obj === null || obj === undefined)
|
|
8
|
-
return obj;
|
|
9
|
-
if (typeof obj !== 'object')
|
|
10
|
-
return obj;
|
|
11
|
-
if (Array.isArray(obj))
|
|
12
|
-
return obj.map(stripPositions);
|
|
13
|
-
const result = {};
|
|
14
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
15
|
-
if (key === 'position')
|
|
16
|
-
continue;
|
|
17
|
-
result[key] = stripPositions(value);
|
|
18
|
-
}
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Parse, strip positions, and return the tree.
|
|
23
|
-
*/
|
|
24
|
-
function parse(md) {
|
|
25
|
-
return stripPositions(parseMarkdown(md));
|
|
26
|
-
}
|
|
27
|
-
// ============================================
|
|
28
|
-
// CommonMark Basics
|
|
29
|
-
// ============================================
|
|
30
|
-
describe('parseMarkdown / stringifyMarkdown', () => {
|
|
31
|
-
describe('CommonMark basics', () => {
|
|
32
|
-
it('parses headings', () => {
|
|
33
|
-
const doc = parse('# H1\n\n## H2\n\n### H3');
|
|
34
|
-
expect(doc.children).toHaveLength(3);
|
|
35
|
-
const h1 = doc.children[0];
|
|
36
|
-
expect(h1.type).toBe('heading');
|
|
37
|
-
expect(h1.depth).toBe(1);
|
|
38
|
-
expect(h1.children[0]).toEqual({ type: 'text', value: 'H1' });
|
|
39
|
-
const h2 = doc.children[1];
|
|
40
|
-
expect(h2.depth).toBe(2);
|
|
41
|
-
const h3 = doc.children[2];
|
|
42
|
-
expect(h3.depth).toBe(3);
|
|
43
|
-
});
|
|
44
|
-
it('parses paragraphs with inline formatting', () => {
|
|
45
|
-
const doc = parse('Hello **bold** and *italic* text');
|
|
46
|
-
const p = doc.children[0];
|
|
47
|
-
expect(p.type).toBe('paragraph');
|
|
48
|
-
expect(p.children).toHaveLength(5);
|
|
49
|
-
expect(p.children[0]).toEqual({ type: 'text', value: 'Hello ' });
|
|
50
|
-
expect(p.children[1]).toEqual({
|
|
51
|
-
type: 'strong',
|
|
52
|
-
children: [{ type: 'text', value: 'bold' }],
|
|
53
|
-
});
|
|
54
|
-
expect(p.children[2]).toEqual({ type: 'text', value: ' and ' });
|
|
55
|
-
expect(p.children[3]).toEqual({
|
|
56
|
-
type: 'emphasis',
|
|
57
|
-
children: [{ type: 'text', value: 'italic' }],
|
|
58
|
-
});
|
|
59
|
-
expect(p.children[4]).toEqual({ type: 'text', value: ' text' });
|
|
60
|
-
});
|
|
61
|
-
it('parses unordered lists', () => {
|
|
62
|
-
const doc = parse('- Item 1\n- Item 2\n- Item 3');
|
|
63
|
-
const list = doc.children[0];
|
|
64
|
-
expect(list.type).toBe('list');
|
|
65
|
-
expect(list.ordered).toBe(false);
|
|
66
|
-
expect(list.children).toHaveLength(3);
|
|
67
|
-
const item = list.children[0];
|
|
68
|
-
expect(item.type).toBe('listItem');
|
|
69
|
-
const itemP = item.children[0];
|
|
70
|
-
expect(itemP.children[0]).toEqual({ type: 'text', value: 'Item 1' });
|
|
71
|
-
});
|
|
72
|
-
it('parses ordered lists', () => {
|
|
73
|
-
const doc = parse('1. First\n2. Second\n3. Third');
|
|
74
|
-
const list = doc.children[0];
|
|
75
|
-
expect(list.ordered).toBe(true);
|
|
76
|
-
expect(list.start).toBe(1);
|
|
77
|
-
expect(list.children).toHaveLength(3);
|
|
78
|
-
});
|
|
79
|
-
it('parses code blocks', () => {
|
|
80
|
-
const doc = parse('```typescript\nconst x = 1;\n```');
|
|
81
|
-
const code = doc.children[0];
|
|
82
|
-
expect(code.type).toBe('code');
|
|
83
|
-
expect(code.lang).toBe('typescript');
|
|
84
|
-
expect(code.value).toBe('const x = 1;');
|
|
85
|
-
});
|
|
86
|
-
it('parses blockquotes', () => {
|
|
87
|
-
const doc = parse('> This is a quote\n>\n> With two paragraphs');
|
|
88
|
-
const bq = doc.children[0];
|
|
89
|
-
expect(bq.type).toBe('blockquote');
|
|
90
|
-
expect(bq.children).toHaveLength(2);
|
|
91
|
-
});
|
|
92
|
-
it('parses inline code', () => {
|
|
93
|
-
const doc = parse('Use `console.log()` for debugging');
|
|
94
|
-
const p = doc.children[0];
|
|
95
|
-
expect(p.children[1]).toEqual({ type: 'inlineCode', value: 'console.log()' });
|
|
96
|
-
});
|
|
97
|
-
it('parses links', () => {
|
|
98
|
-
const doc = parse('[Click here](https://example.com "Title")');
|
|
99
|
-
const p = doc.children[0];
|
|
100
|
-
const link = p.children[0];
|
|
101
|
-
expect(link.type).toBe('link');
|
|
102
|
-
expect(link.url).toBe('https://example.com');
|
|
103
|
-
expect(link.title).toBe('Title');
|
|
104
|
-
expect(link.children[0]).toEqual({ type: 'text', value: 'Click here' });
|
|
105
|
-
});
|
|
106
|
-
it('parses mentions from @[Name](scheme:id)', () => {
|
|
107
|
-
const doc = parse('Hey @[Leo](gezel:leo), take a look.');
|
|
108
|
-
const p = doc.children[0];
|
|
109
|
-
const text0 = p.children[0];
|
|
110
|
-
expect(text0).toEqual({ type: 'text', value: 'Hey ' });
|
|
111
|
-
const mention = p.children[1];
|
|
112
|
-
expect(mention).toEqual({
|
|
113
|
-
type: 'mention',
|
|
114
|
-
targetKind: 'gezel',
|
|
115
|
-
targetId: 'leo',
|
|
116
|
-
displayName: 'Leo',
|
|
117
|
-
});
|
|
118
|
-
const text2 = p.children[2];
|
|
119
|
-
expect(text2.value).toBe(', take a look.');
|
|
120
|
-
});
|
|
121
|
-
it('round-trips a mention back to markdown', () => {
|
|
122
|
-
// remark-stringify escapes `:` in link URLs that follow an `@` (to
|
|
123
|
-
// disambiguate from autolink syntax). The escape is idempotent —
|
|
124
|
-
// re-parsing `\:` produces the unescaped url, so the round-trip
|
|
125
|
-
// preserves the mention semantically even if the raw text changes
|
|
126
|
-
// on the first pass.
|
|
127
|
-
const input = 'Hey @[Leo](gezel:leo), ping @[Tess](gezel:tess) too.\n';
|
|
128
|
-
const once = stringifyMarkdown(parseMarkdown(input));
|
|
129
|
-
const twice = stringifyMarkdown(parseMarkdown(once));
|
|
130
|
-
expect(twice).toBe(once);
|
|
131
|
-
// Semantics are preserved: re-parsing yields mentions.
|
|
132
|
-
const doc = parseMarkdown(once);
|
|
133
|
-
const p = doc.children[0];
|
|
134
|
-
const m1 = p.children.find((c) => c.type === 'mention');
|
|
135
|
-
expect(m1.targetKind).toBe('gezel');
|
|
136
|
-
expect(m1.targetId).toBe('leo');
|
|
137
|
-
expect(m1.displayName).toBe('Leo');
|
|
138
|
-
});
|
|
139
|
-
it('does not collapse @ + link when the url has no scheme', () => {
|
|
140
|
-
const doc = parse('Cost @[100]($100)');
|
|
141
|
-
const p = doc.children[0];
|
|
142
|
-
// "$100" doesn't match scheme:id because $ isn't a scheme character
|
|
143
|
-
// → stays as text("Cost @") + link
|
|
144
|
-
expect(p.children[1].type).toBe('link');
|
|
145
|
-
});
|
|
146
|
-
it('parses images', () => {
|
|
147
|
-
const doc = parse('');
|
|
148
|
-
const p = doc.children[0];
|
|
149
|
-
const img = p.children[0];
|
|
150
|
-
expect(img.type).toBe('image');
|
|
151
|
-
expect(img.url).toBe('image.png');
|
|
152
|
-
expect(img.alt).toBe('Alt text');
|
|
153
|
-
expect(img.title).toBe('Image title');
|
|
154
|
-
});
|
|
155
|
-
it('parses thematic breaks', () => {
|
|
156
|
-
const doc = parse('Before\n\n---\n\nAfter');
|
|
157
|
-
expect(doc.children).toHaveLength(3);
|
|
158
|
-
expect(doc.children[1].type).toBe('thematicBreak');
|
|
159
|
-
});
|
|
160
|
-
it('parses hard line breaks', () => {
|
|
161
|
-
const doc = parse('Line one \nLine two');
|
|
162
|
-
const p = doc.children[0];
|
|
163
|
-
expect(p.children).toHaveLength(3);
|
|
164
|
-
expect(p.children[1].type).toBe('break');
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
// ============================================
|
|
168
|
-
// GFM Extensions
|
|
169
|
-
// ============================================
|
|
170
|
-
describe('GFM extensions', () => {
|
|
171
|
-
it('parses tables', () => {
|
|
172
|
-
const md = '| Name | Age |\n| --- | --- |\n| Alice | 30 |\n| Bob | 25 |';
|
|
173
|
-
const doc = parse(md);
|
|
174
|
-
const table = doc.children[0];
|
|
175
|
-
expect(table.type).toBe('table');
|
|
176
|
-
expect(table.children).toHaveLength(3); // header + 2 data rows
|
|
177
|
-
// Header row
|
|
178
|
-
const headerRow = table.children[0];
|
|
179
|
-
expect(headerRow.children[0].isHeader).toBe(true);
|
|
180
|
-
expect(headerRow.children[0].children[0]).toEqual({ type: 'text', value: 'Name' });
|
|
181
|
-
// Data row
|
|
182
|
-
const dataRow = table.children[1];
|
|
183
|
-
expect(dataRow.children[0].isHeader).toBeUndefined();
|
|
184
|
-
});
|
|
185
|
-
it('parses strikethrough', () => {
|
|
186
|
-
const doc = parse('This is ~~deleted~~ text');
|
|
187
|
-
const p = doc.children[0];
|
|
188
|
-
const del = p.children[1];
|
|
189
|
-
expect(del.type).toBe('delete');
|
|
190
|
-
expect(del.children[0]).toEqual({ type: 'text', value: 'deleted' });
|
|
191
|
-
});
|
|
192
|
-
it('parses task lists', () => {
|
|
193
|
-
const doc = parse('- [x] Done\n- [ ] Todo\n- Regular');
|
|
194
|
-
const list = doc.children[0];
|
|
195
|
-
expect(list.children[0].checked).toBe(true);
|
|
196
|
-
expect(list.children[1].checked).toBe(false);
|
|
197
|
-
// Regular item has no checked property
|
|
198
|
-
expect(list.children[2].checked).toBeUndefined();
|
|
199
|
-
});
|
|
200
|
-
it('parses footnotes', () => {
|
|
201
|
-
const md = 'Text with a footnote[^1].\n\n[^1]: This is the footnote content.';
|
|
202
|
-
const doc = parse(md);
|
|
203
|
-
// Find footnote reference in the paragraph
|
|
204
|
-
const p = doc.children[0];
|
|
205
|
-
const ref = p.children.find((c) => c.type === 'footnoteReference');
|
|
206
|
-
expect(ref).toBeDefined();
|
|
207
|
-
expect(ref.identifier).toBe('1');
|
|
208
|
-
// Find footnote definition
|
|
209
|
-
const fnDef = doc.children.find((c) => c.type === 'footnoteDefinition');
|
|
210
|
-
expect(fnDef).toBeDefined();
|
|
211
|
-
expect(fnDef.identifier).toBe('1');
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
// ============================================
|
|
215
|
-
// Math Extensions
|
|
216
|
-
// ============================================
|
|
217
|
-
describe('Math extensions', () => {
|
|
218
|
-
it('parses inline math', () => {
|
|
219
|
-
const doc = parse('The equation $E = mc^2$ is famous');
|
|
220
|
-
const p = doc.children[0];
|
|
221
|
-
const math = p.children.find((c) => c.type === 'inlineMath');
|
|
222
|
-
expect(math).toBeDefined();
|
|
223
|
-
expect(math.value).toBe('E = mc^2');
|
|
224
|
-
});
|
|
225
|
-
it('parses display math blocks', () => {
|
|
226
|
-
const doc = parse('$$\nx = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}\n$$');
|
|
227
|
-
const math = doc.children[0];
|
|
228
|
-
expect(math.type).toBe('math');
|
|
229
|
-
expect(math.value).toContain('\\frac{-b');
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
// ============================================
|
|
233
|
-
// Link/Image References
|
|
234
|
-
// ============================================
|
|
235
|
-
describe('Reference links', () => {
|
|
236
|
-
it('parses link reference definitions', () => {
|
|
237
|
-
const md = '[example]: https://example.com "Example"\n\nSee [example].';
|
|
238
|
-
const doc = parse(md);
|
|
239
|
-
const def = doc.children.find((c) => c.type === 'definition');
|
|
240
|
-
expect(def).toBeDefined();
|
|
241
|
-
expect(def.identifier).toBe('example');
|
|
242
|
-
expect(def.url).toBe('https://example.com');
|
|
243
|
-
expect(def.title).toBe('Example');
|
|
244
|
-
});
|
|
245
|
-
it('parses link references', () => {
|
|
246
|
-
const md = '[Click here][ref]\n\n[ref]: https://example.com';
|
|
247
|
-
const doc = parse(md);
|
|
248
|
-
const p = doc.children[0];
|
|
249
|
-
const ref = p.children[0];
|
|
250
|
-
expect(ref.type).toBe('linkReference');
|
|
251
|
-
expect(ref.identifier).toBe('ref');
|
|
252
|
-
expect(ref.referenceType).toBe('full');
|
|
253
|
-
});
|
|
254
|
-
it('parses image references', () => {
|
|
255
|
-
const md = '![Alt text][img]\n\n[img]: image.png';
|
|
256
|
-
const doc = parse(md);
|
|
257
|
-
const p = doc.children[0];
|
|
258
|
-
const ref = p.children[0];
|
|
259
|
-
expect(ref.type).toBe('imageReference');
|
|
260
|
-
expect(ref.identifier).toBe('img');
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
// ============================================
|
|
264
|
-
// HTML Handling
|
|
265
|
-
// ============================================
|
|
266
|
-
describe('HTML handling', () => {
|
|
267
|
-
it('parses block-level HTML', () => {
|
|
268
|
-
const doc = parse('<div class="container">\n <p>Hello</p>\n</div>');
|
|
269
|
-
const html = doc.children[0];
|
|
270
|
-
expect(html.type).toBe('htmlBlock');
|
|
271
|
-
expect(html.rawHtml).toContain('<div');
|
|
272
|
-
expect(html.htmlChildren.length).toBeGreaterThan(0);
|
|
273
|
-
});
|
|
274
|
-
it('parses inline HTML', () => {
|
|
275
|
-
const doc = parse('Text with <em>emphasis</em> inline');
|
|
276
|
-
const p = doc.children[0];
|
|
277
|
-
const htmlNodes = p.children.filter((c) => c.type === 'htmlInline');
|
|
278
|
-
expect(htmlNodes.length).toBeGreaterThan(0);
|
|
279
|
-
});
|
|
280
|
-
it('preserves rawHtml for round-tripping', () => {
|
|
281
|
-
const input = '<div class="test">content</div>';
|
|
282
|
-
const doc = parse(input);
|
|
283
|
-
const html = doc.children[0];
|
|
284
|
-
expect(html.rawHtml).toBe(input);
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
// ============================================
|
|
288
|
-
// Nested Structures
|
|
289
|
-
// ============================================
|
|
290
|
-
describe('Nested structures', () => {
|
|
291
|
-
it('handles blockquote containing list', () => {
|
|
292
|
-
const md = '> - Item 1\n> - Item 2';
|
|
293
|
-
const doc = parse(md);
|
|
294
|
-
const bq = doc.children[0];
|
|
295
|
-
expect(bq.type).toBe('blockquote');
|
|
296
|
-
const list = bq.children[0];
|
|
297
|
-
expect(list.type).toBe('list');
|
|
298
|
-
expect(list.children).toHaveLength(2);
|
|
299
|
-
});
|
|
300
|
-
it('handles nested lists', () => {
|
|
301
|
-
const md = '- Outer\n - Inner 1\n - Inner 2';
|
|
302
|
-
const doc = parse(md);
|
|
303
|
-
const outerList = doc.children[0];
|
|
304
|
-
const firstItem = outerList.children[0];
|
|
305
|
-
// First item should have a paragraph and a nested list
|
|
306
|
-
expect(firstItem.children.length).toBeGreaterThanOrEqual(2);
|
|
307
|
-
const nestedList = firstItem.children.find((c) => c.type === 'list');
|
|
308
|
-
expect(nestedList).toBeDefined();
|
|
309
|
-
expect(nestedList.children).toHaveLength(2);
|
|
310
|
-
});
|
|
311
|
-
it('handles emphasis inside links', () => {
|
|
312
|
-
const md = '[**Bold link**](https://example.com)';
|
|
313
|
-
const doc = parse(md);
|
|
314
|
-
const p = doc.children[0];
|
|
315
|
-
const link = p.children[0];
|
|
316
|
-
expect(link.type).toBe('link');
|
|
317
|
-
expect(link.children[0].type).toBe('strong');
|
|
318
|
-
});
|
|
319
|
-
});
|
|
320
|
-
// ============================================
|
|
321
|
-
// Round-Trip Tests
|
|
322
|
-
// ============================================
|
|
323
|
-
describe('Round-trip (parse → stringify → parse)', () => {
|
|
324
|
-
function roundTrip(md) {
|
|
325
|
-
const doc1 = parseMarkdown(md);
|
|
326
|
-
const output = stringifyMarkdown(doc1);
|
|
327
|
-
const doc2 = parseMarkdown(output);
|
|
328
|
-
// Strip positions before comparing (positions will differ between parse runs)
|
|
329
|
-
expect(stripPositions(doc2)).toEqual(stripPositions(doc1));
|
|
330
|
-
}
|
|
331
|
-
it('round-trips headings', () => {
|
|
332
|
-
roundTrip('# Heading 1\n\n## Heading 2\n\n### Heading 3\n');
|
|
333
|
-
});
|
|
334
|
-
it('round-trips paragraphs with inline formatting', () => {
|
|
335
|
-
roundTrip('Hello **bold** and *italic* text\n');
|
|
336
|
-
});
|
|
337
|
-
it('round-trips unordered lists', () => {
|
|
338
|
-
roundTrip('- Item 1\n- Item 2\n- Item 3\n');
|
|
339
|
-
});
|
|
340
|
-
it('round-trips ordered lists', () => {
|
|
341
|
-
roundTrip('1. First\n2. Second\n3. Third\n');
|
|
342
|
-
});
|
|
343
|
-
it('round-trips code blocks', () => {
|
|
344
|
-
roundTrip('```js\nconst x = 1;\n```\n');
|
|
345
|
-
});
|
|
346
|
-
it('round-trips blockquotes', () => {
|
|
347
|
-
roundTrip('> A quote\n>\n> Second paragraph\n');
|
|
348
|
-
});
|
|
349
|
-
it('round-trips links and images', () => {
|
|
350
|
-
roundTrip('[Link](https://example.com)\n');
|
|
351
|
-
roundTrip('\n');
|
|
352
|
-
});
|
|
353
|
-
it('round-trips thematic breaks', () => {
|
|
354
|
-
roundTrip('---\n');
|
|
355
|
-
});
|
|
356
|
-
it('round-trips tables', () => {
|
|
357
|
-
roundTrip('| A | B |\n| - | - |\n| 1 | 2 |\n');
|
|
358
|
-
});
|
|
359
|
-
it('round-trips task lists', () => {
|
|
360
|
-
roundTrip('- [x] Done\n- [ ] Todo\n');
|
|
361
|
-
});
|
|
362
|
-
it('round-trips inline math', () => {
|
|
363
|
-
roundTrip('The formula $E = mc^2$ is famous.\n');
|
|
364
|
-
});
|
|
365
|
-
it('round-trips display math', () => {
|
|
366
|
-
roundTrip('$$\nx^2 + y^2 = z^2\n$$\n');
|
|
367
|
-
});
|
|
368
|
-
it('round-trips strikethrough', () => {
|
|
369
|
-
roundTrip('This is ~~deleted~~ text.\n');
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
// ============================================
|
|
373
|
-
// Edge Cases
|
|
374
|
-
// ============================================
|
|
375
|
-
describe('Edge cases', () => {
|
|
376
|
-
it('handles empty document', () => {
|
|
377
|
-
const doc = parse('');
|
|
378
|
-
expect(doc.type).toBe('document');
|
|
379
|
-
expect(doc.children).toHaveLength(0);
|
|
380
|
-
});
|
|
381
|
-
it('handles single text paragraph', () => {
|
|
382
|
-
const doc = parse('Hello');
|
|
383
|
-
expect(doc.children).toHaveLength(1);
|
|
384
|
-
const p = doc.children[0];
|
|
385
|
-
expect(p.type).toBe('paragraph');
|
|
386
|
-
expect(p.children[0]).toEqual({ type: 'text', value: 'Hello' });
|
|
387
|
-
});
|
|
388
|
-
it('handles deeply nested blockquotes', () => {
|
|
389
|
-
const doc = parse('> > > Deep');
|
|
390
|
-
expect(doc.children[0].type).toBe('blockquote');
|
|
391
|
-
const bq1 = doc.children[0];
|
|
392
|
-
const bq2 = bq1.children[0];
|
|
393
|
-
const bq3 = bq2.children[0];
|
|
394
|
-
expect(bq3.type).toBe('blockquote');
|
|
395
|
-
});
|
|
396
|
-
it('preserves source positions when parsing', () => {
|
|
397
|
-
const doc = parseMarkdown('# Hello\n\nWorld');
|
|
398
|
-
expect(doc.position).toBeDefined();
|
|
399
|
-
expect(doc.children[0].position).toBeDefined();
|
|
400
|
-
expect(doc.children[0].position.start.line).toBe(1);
|
|
401
|
-
expect(doc.children[1].position.start.line).toBe(3);
|
|
402
|
-
});
|
|
403
|
-
it('handles parseHtml: false option', () => {
|
|
404
|
-
const doc = parseMarkdown('<div>content</div>', { parseHtml: false });
|
|
405
|
-
const html = doc.children[0];
|
|
406
|
-
expect(html.rawHtml).toBe('<div>content</div>');
|
|
407
|
-
expect(html.htmlChildren).toEqual([]);
|
|
408
|
-
});
|
|
409
|
-
});
|
|
410
|
-
});
|
|
411
|
-
// ============================================
|
|
412
|
-
// HTML Sub-DOM Tests
|
|
413
|
-
// ============================================
|
|
414
|
-
describe('HTML sub-DOM (parseHtmlToNodes / stringifyHtmlNodes)', () => {
|
|
415
|
-
it('parses a simple element', () => {
|
|
416
|
-
const nodes = parseHtmlToNodes('<b>bold</b>');
|
|
417
|
-
expect(nodes).toHaveLength(1);
|
|
418
|
-
expect(nodes[0].type).toBe('htmlElement');
|
|
419
|
-
const el = nodes[0];
|
|
420
|
-
expect(el.tagName).toBe('b');
|
|
421
|
-
expect(el.children).toHaveLength(1);
|
|
422
|
-
expect(el.children[0]).toEqual({ type: 'htmlText', value: 'bold' });
|
|
423
|
-
});
|
|
424
|
-
it('parses attributes', () => {
|
|
425
|
-
const nodes = parseHtmlToNodes('<div class="foo" id="bar">content</div>');
|
|
426
|
-
const el = nodes[0];
|
|
427
|
-
expect(el.attributes.class).toBe('foo');
|
|
428
|
-
expect(el.attributes.id).toBe('bar');
|
|
429
|
-
});
|
|
430
|
-
it('handles self-closing elements', () => {
|
|
431
|
-
const nodes = parseHtmlToNodes('<br>');
|
|
432
|
-
const el = nodes[0];
|
|
433
|
-
expect(el.tagName).toBe('br');
|
|
434
|
-
expect(el.selfClosing).toBe(true);
|
|
435
|
-
});
|
|
436
|
-
it('handles nested elements', () => {
|
|
437
|
-
const nodes = parseHtmlToNodes('<div><span>inner</span></div>');
|
|
438
|
-
const outer = nodes[0];
|
|
439
|
-
expect(outer.tagName).toBe('div');
|
|
440
|
-
const inner = outer.children[0];
|
|
441
|
-
expect(inner.tagName).toBe('span');
|
|
442
|
-
expect(inner.children[0]).toEqual({ type: 'htmlText', value: 'inner' });
|
|
443
|
-
});
|
|
444
|
-
it('handles empty input', () => {
|
|
445
|
-
expect(parseHtmlToNodes('')).toEqual([]);
|
|
446
|
-
expect(parseHtmlToNodes(' ')).toEqual([]);
|
|
447
|
-
});
|
|
448
|
-
it('stringifies nodes back to HTML', () => {
|
|
449
|
-
const nodes = parseHtmlToNodes('<b>bold</b>');
|
|
450
|
-
const html = stringifyHtmlNodes(nodes);
|
|
451
|
-
expect(html).toBe('<b>bold</b>');
|
|
452
|
-
});
|
|
453
|
-
it('stringifies void elements', () => {
|
|
454
|
-
const nodes = parseHtmlToNodes('<br>');
|
|
455
|
-
const html = stringifyHtmlNodes(nodes);
|
|
456
|
-
expect(html).toBe('<br>');
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
// ============================================
|
|
460
|
-
// Tree Utility Tests
|
|
461
|
-
// ============================================
|
|
462
|
-
describe('Tree utilities', () => {
|
|
463
|
-
const doc = {
|
|
464
|
-
type: 'document',
|
|
465
|
-
children: [
|
|
466
|
-
{
|
|
467
|
-
type: 'heading',
|
|
468
|
-
depth: 1,
|
|
469
|
-
children: [{ type: 'text', value: 'Title' }],
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
type: 'paragraph',
|
|
473
|
-
children: [
|
|
474
|
-
{ type: 'text', value: 'Hello ' },
|
|
475
|
-
{
|
|
476
|
-
type: 'link',
|
|
477
|
-
url: 'https://example.com',
|
|
478
|
-
children: [{ type: 'text', value: 'world' }],
|
|
479
|
-
},
|
|
480
|
-
],
|
|
481
|
-
},
|
|
482
|
-
],
|
|
483
|
-
};
|
|
484
|
-
it('getChildren returns children for parent nodes', () => {
|
|
485
|
-
expect(getChildren(doc)).toEqual(doc.children);
|
|
486
|
-
});
|
|
487
|
-
it('getChildren returns empty array for leaf nodes', () => {
|
|
488
|
-
expect(getChildren({ type: 'text', value: 'hi' })).toEqual([]);
|
|
489
|
-
});
|
|
490
|
-
it('walkMarkdownTree visits all nodes', () => {
|
|
491
|
-
const types = [];
|
|
492
|
-
walkMarkdownTree(doc, (node) => {
|
|
493
|
-
types.push(node.type);
|
|
494
|
-
});
|
|
495
|
-
expect(types).toEqual(['document', 'heading', 'text', 'paragraph', 'text', 'link', 'text']);
|
|
496
|
-
});
|
|
497
|
-
it('walkMarkdownTree supports pruning', () => {
|
|
498
|
-
const types = [];
|
|
499
|
-
walkMarkdownTree(doc, (node) => {
|
|
500
|
-
types.push(node.type);
|
|
501
|
-
if (node.type === 'paragraph')
|
|
502
|
-
return true; // skip children
|
|
503
|
-
});
|
|
504
|
-
expect(types).toEqual(['document', 'heading', 'text', 'paragraph']);
|
|
505
|
-
});
|
|
506
|
-
it('findNodesByType finds matching nodes', () => {
|
|
507
|
-
const headings = findNodesByType(doc, 'heading');
|
|
508
|
-
expect(headings).toHaveLength(1);
|
|
509
|
-
expect(headings[0].depth).toBe(1);
|
|
510
|
-
const texts = findNodesByType(doc, 'text');
|
|
511
|
-
expect(texts).toHaveLength(3);
|
|
512
|
-
});
|
|
513
|
-
it('extractPlainText extracts all text', () => {
|
|
514
|
-
expect(extractPlainText(doc)).toBe('TitleHello world');
|
|
515
|
-
});
|
|
516
|
-
it('extractPlainText preserves list item boundaries', () => {
|
|
517
|
-
const list = {
|
|
518
|
-
type: 'list',
|
|
519
|
-
ordered: false,
|
|
520
|
-
children: [
|
|
521
|
-
{
|
|
522
|
-
type: 'listItem',
|
|
523
|
-
children: [{ type: 'paragraph', children: [{ type: 'text', value: 'Apple' }] }],
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
type: 'listItem',
|
|
527
|
-
children: [{ type: 'paragraph', children: [{ type: 'text', value: 'Banana' }] }],
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
type: 'listItem',
|
|
531
|
-
children: [{ type: 'paragraph', children: [{ type: 'text', value: 'Cherry' }] }],
|
|
532
|
-
},
|
|
533
|
-
],
|
|
534
|
-
};
|
|
535
|
-
expect(extractPlainText(list)).toBe('Apple\nBanana\nCherry');
|
|
536
|
-
});
|
|
537
|
-
it('countNodes counts all nodes', () => {
|
|
538
|
-
expect(countNodes(doc)).toBe(7); // document + heading + text + paragraph + text + link + text
|
|
539
|
-
});
|
|
540
|
-
it('createDocument creates a minimal document', () => {
|
|
541
|
-
const d = createDocument({ type: 'paragraph', children: [{ type: 'text', value: 'Hello' }] });
|
|
542
|
-
expect(d.type).toBe('document');
|
|
543
|
-
expect(d.children).toHaveLength(1);
|
|
544
|
-
});
|
|
545
|
-
});
|
|
546
|
-
// ============================================
|
|
547
|
-
// AST Stability Test
|
|
548
|
-
// ============================================
|
|
549
|
-
describe('AST stability', () => {
|
|
550
|
-
it('parse(stringify(parse(input))) === parse(input)', () => {
|
|
551
|
-
const input = `# Hello World
|
|
552
|
-
|
|
553
|
-
This is a **bold** and *italic* paragraph with \`code\`.
|
|
554
|
-
|
|
555
|
-
- Item 1
|
|
556
|
-
- Item 2
|
|
557
|
-
- Nested
|
|
558
|
-
|
|
559
|
-
> A blockquote
|
|
560
|
-
|
|
561
|
-
\`\`\`js
|
|
562
|
-
const x = 1;
|
|
563
|
-
\`\`\`
|
|
564
|
-
|
|
565
|
-
| A | B |
|
|
566
|
-
| - | - |
|
|
567
|
-
| 1 | 2 |
|
|
568
|
-
|
|
569
|
-
---
|
|
570
|
-
|
|
571
|
-
[Link](https://example.com)
|
|
572
|
-
|
|
573
|
-

|
|
574
|
-
`;
|
|
575
|
-
const doc1 = parseMarkdown(input);
|
|
576
|
-
const output = stringifyMarkdown(doc1);
|
|
577
|
-
const doc2 = parseMarkdown(output);
|
|
578
|
-
const output2 = stringifyMarkdown(doc2);
|
|
579
|
-
const doc3 = parseMarkdown(output2);
|
|
580
|
-
// After one round-trip, the AST should be stable
|
|
581
|
-
expect(stripPositions(doc3)).toEqual(stripPositions(doc2));
|
|
582
|
-
});
|
|
583
|
-
});
|
|
584
|
-
// ============================================
|
|
585
|
-
// Template Annotation on Headings
|
|
586
|
-
// ============================================
|
|
587
|
-
describe('heading template annotation', () => {
|
|
588
|
-
it('parses {[templateName]} from heading text', () => {
|
|
589
|
-
const doc = parseMarkdown('### Report Data {[chart]}');
|
|
590
|
-
const heading = doc.children[0];
|
|
591
|
-
expect(heading.type).toBe('heading');
|
|
592
|
-
expect(heading.depth).toBe(3);
|
|
593
|
-
expect(heading.templateAnnotation).toEqual({ template: 'chart' });
|
|
594
|
-
// The annotation text should be stripped from children
|
|
595
|
-
expect(heading.children).toHaveLength(1);
|
|
596
|
-
expect(heading.children[0].type).toBe('text');
|
|
597
|
-
expect(heading.children[0].value).toBe('Report Data');
|
|
598
|
-
});
|
|
599
|
-
it('parses template name with key=value params', () => {
|
|
600
|
-
const doc = parseMarkdown('## Data {[statHighlight colorScheme=blue size=large]}');
|
|
601
|
-
const heading = doc.children[0];
|
|
602
|
-
expect(heading.templateAnnotation).toEqual({
|
|
603
|
-
template: 'statHighlight',
|
|
604
|
-
params: { colorScheme: 'blue', size: 'large' },
|
|
605
|
-
});
|
|
606
|
-
expect(heading.children[0].value).toBe('Data');
|
|
607
|
-
});
|
|
608
|
-
it('returns no annotation for plain headings', () => {
|
|
609
|
-
const doc = parseMarkdown('# Just a title');
|
|
610
|
-
const heading = doc.children[0];
|
|
611
|
-
expect(heading.templateAnnotation).toBeUndefined();
|
|
612
|
-
expect(heading.children[0].value).toBe('Just a title');
|
|
613
|
-
});
|
|
614
|
-
it('does not match incomplete bracket syntax', () => {
|
|
615
|
-
const doc = parseMarkdown('## Title {chart}');
|
|
616
|
-
const heading = doc.children[0];
|
|
617
|
-
// Regular curly braces should not trigger annotation parsing
|
|
618
|
-
expect(heading.templateAnnotation).toBeUndefined();
|
|
619
|
-
});
|
|
620
|
-
it('does not match {[...]} in the middle of heading text', () => {
|
|
621
|
-
// The annotation must be trailing
|
|
622
|
-
const doc = parseMarkdown('## The {[chart]} section');
|
|
623
|
-
const heading = doc.children[0];
|
|
624
|
-
// remark may split this into multiple text nodes or keep as one;
|
|
625
|
-
// either way, no trailing annotation should be extracted
|
|
626
|
-
expect(heading.templateAnnotation).toBeUndefined();
|
|
627
|
-
});
|
|
628
|
-
it('round-trips annotation through parse → stringify → parse', () => {
|
|
629
|
-
const input = '### My Section {[factCard colorScheme=warm]}';
|
|
630
|
-
const doc1 = parseMarkdown(input);
|
|
631
|
-
const output = stringifyMarkdown(doc1);
|
|
632
|
-
const doc2 = parseMarkdown(output);
|
|
633
|
-
const h1 = doc1.children[0];
|
|
634
|
-
const h2 = doc2.children[0];
|
|
635
|
-
expect(h2.templateAnnotation).toEqual(h1.templateAnnotation);
|
|
636
|
-
expect(stripPositions(h2.children)).toEqual(stripPositions(h1.children));
|
|
637
|
-
});
|
|
638
|
-
it('handles heading with only annotation (no display text)', () => {
|
|
639
|
-
const doc = parseMarkdown('## {[chart]}');
|
|
640
|
-
const heading = doc.children[0];
|
|
641
|
-
expect(heading.templateAnnotation).toEqual({ template: 'chart' });
|
|
642
|
-
// Children should be empty after stripping the annotation
|
|
643
|
-
expect(heading.children).toHaveLength(0);
|
|
644
|
-
});
|
|
645
|
-
it('handles heading with bold text before annotation', () => {
|
|
646
|
-
const doc = parseMarkdown('## **Bold Title** {[quoteBlock]}');
|
|
647
|
-
const heading = doc.children[0];
|
|
648
|
-
expect(heading.templateAnnotation).toEqual({ template: 'quoteBlock' });
|
|
649
|
-
// The bold node should remain, trailing text stripped
|
|
650
|
-
const types = heading.children.map((c) => c.type);
|
|
651
|
-
expect(types).toContain('strong');
|
|
652
|
-
});
|
|
653
|
-
it('preserves annotation through stringify', () => {
|
|
654
|
-
const input = '## Section {[chart]}';
|
|
655
|
-
const doc = parseMarkdown(input);
|
|
656
|
-
const output = stringifyMarkdown(doc);
|
|
657
|
-
// Output should contain the annotation
|
|
658
|
-
expect(output).toContain('{[chart]}');
|
|
659
|
-
// The heading text should be there too
|
|
660
|
-
expect(output).toContain('Section');
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
// ============================================
|
|
664
|
-
// YAML Frontmatter
|
|
665
|
-
// ============================================
|
|
666
|
-
describe('parseFrontmatter', () => {
|
|
667
|
-
it('parses simple key-value pairs', () => {
|
|
668
|
-
const result = parseFrontmatter('title: My Doc\nauthor: Jane');
|
|
669
|
-
expect(result).toEqual({ title: 'My Doc', author: 'Jane' });
|
|
670
|
-
});
|
|
671
|
-
it('parses booleans and numbers', () => {
|
|
672
|
-
const result = parseFrontmatter('draft: true\ncount: 42\nratio: 3.14');
|
|
673
|
-
expect(result).toEqual({ draft: true, count: 42, ratio: 3.14 });
|
|
674
|
-
});
|
|
675
|
-
it('strips surrounding quotes', () => {
|
|
676
|
-
const result = parseFrontmatter('title: "Hello World"\nname: \'Jane\'');
|
|
677
|
-
expect(result).toEqual({ title: 'Hello World', name: 'Jane' });
|
|
678
|
-
});
|
|
679
|
-
it('skips comment lines and blank lines', () => {
|
|
680
|
-
const result = parseFrontmatter('# comment\n\ntitle: Test');
|
|
681
|
-
expect(result).toEqual({ title: 'Test' });
|
|
682
|
-
});
|
|
683
|
-
it('returns null for empty input', () => {
|
|
684
|
-
expect(parseFrontmatter('')).toBeNull();
|
|
685
|
-
expect(parseFrontmatter(' \n ')).toBeNull();
|
|
686
|
-
});
|
|
687
|
-
});
|
|
688
|
-
describe('frontmatter in parseMarkdown', () => {
|
|
689
|
-
it('extracts frontmatter from markdown with YAML header', () => {
|
|
690
|
-
const md = '---\ndocument-render-as: landscape\ntitle: Test\n---\n\n# Hello';
|
|
691
|
-
const doc = parseMarkdown(md);
|
|
692
|
-
expect(doc.frontmatter).toEqual({ 'document-render-as': 'landscape', title: 'Test' });
|
|
693
|
-
// The heading should still be there
|
|
694
|
-
expect(doc.children.length).toBeGreaterThanOrEqual(1);
|
|
695
|
-
expect(doc.children[0].type).toBe('heading');
|
|
696
|
-
});
|
|
697
|
-
it('has no frontmatter when YAML header is absent', () => {
|
|
698
|
-
const doc = parseMarkdown('# Just a heading');
|
|
699
|
-
expect(doc.frontmatter).toBeUndefined();
|
|
700
|
-
});
|
|
701
|
-
it('round-trips frontmatter through stringify', () => {
|
|
702
|
-
const md = '---\ndocument-render-as: portrait\n---\n\n# Test';
|
|
703
|
-
const doc = parseMarkdown(md);
|
|
704
|
-
const output = stringifyMarkdown(doc);
|
|
705
|
-
expect(output).toContain('---');
|
|
706
|
-
expect(output).toContain('document-render-as: portrait');
|
|
707
|
-
expect(output).toContain('# Test');
|
|
708
|
-
});
|
|
709
|
-
it('can disable frontmatter parsing', () => {
|
|
710
|
-
const md = '---\ntitle: Disabled\n---\n\n# Hello';
|
|
711
|
-
const doc = parseMarkdown(md, { frontmatter: false });
|
|
712
|
-
expect(doc.frontmatter).toBeUndefined();
|
|
713
|
-
});
|
|
714
|
-
});
|
|
715
|
-
//# sourceMappingURL=markdown.test.js.map
|