@bendyline/squisq 2.0.1 → 2.2.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/LICENSE +21 -0
- package/NOTICE.md +24 -0
- package/dist/{ContentContainer-BXUlIf18.d.ts → ContentContainer-B2w9sUoL.d.ts} +15 -0
- package/dist/{Doc-ylqWKDc_.d.ts → Doc-BubIpWsp.d.ts} +160 -3
- package/dist/{ImageEditDoc-D828IXJ1.d.ts → ImageEditDoc-CGxk5CHc.d.ts} +1 -1
- package/dist/{annotationCoercion-Dr_DY9Hx.d.ts → annotationCoercion-PtRQhk5V.d.ts} +1 -1
- package/dist/chunk-2L55443L.js +0 -0
- package/dist/chunk-2ZWIXGAC.js +214 -0
- package/dist/{chunk-2PWOO4ZE.js → chunk-32R2RZAO.js} +72 -3
- package/dist/chunk-3IGPAPQ7.js +645 -0
- package/dist/{chunk-QE7TWGVT.js → chunk-4VOD55SX.js} +0 -1
- package/dist/{chunk-3E5F2XMR.js → chunk-67L6WRJN.js} +0 -1
- package/dist/{chunk-5DKBFXPY.js → chunk-6ECMNUIP.js} +26 -18
- package/dist/{chunk-X6DUONGT.js → chunk-7ARJZYQY.js} +280 -128
- package/dist/{chunk-DBS6RIFL.js → chunk-7N4G32LG.js} +0 -1
- package/dist/{chunk-JOQYPRDZ.js → chunk-7YEZFHLS.js} +10 -8
- package/dist/{chunk-2UQOHYE2.js → chunk-7ZAAICW4.js} +0 -1
- package/dist/{chunk-66QO7XFB.js → chunk-ACZOVWX3.js} +117 -7
- package/dist/{chunk-5J4HKRJF.js → chunk-BAOV476U.js} +0 -1
- package/dist/chunk-BCCXTMN5.js +699 -0
- package/dist/{chunk-W4O2TX5I.js → chunk-C33GTPUZ.js} +579 -4
- package/dist/{chunk-MMPBOUK7.js → chunk-CB45YGAM.js} +7 -2
- package/dist/{chunk-CY2R2VPR.js → chunk-DYPMOPIW.js} +18 -2
- package/dist/{chunk-VR7UPJ7C.js → chunk-FCG3BIZN.js} +12 -1
- package/dist/{chunk-5UYI3RJB.js → chunk-FDYDYL77.js} +54 -40
- package/dist/{chunk-TFJVXUHH.js → chunk-I2O6W7DX.js} +1513 -79
- package/dist/{chunk-Q7LROV2H.js → chunk-NKNMGIIN.js} +0 -1
- package/dist/chunk-OPO5K4DZ.js +241 -0
- package/dist/{chunk-TUWMK62B.js → chunk-PUS54YU6.js} +45 -2
- package/dist/chunk-QKPXHDLR.js +0 -0
- package/dist/{chunk-GZY66SDN.js → chunk-R3KTTOMS.js} +0 -1
- package/dist/{chunk-PXLVXTLW.js → chunk-RS5AP3J4.js} +72 -15
- package/dist/chunk-WV5ARNDA.js +0 -0
- package/dist/{chunk-4X3JQXNM.js → chunk-XOFT65EX.js} +1 -2
- package/dist/{chunk-FVTQSNR7.js → chunk-XRW6P7IF.js} +13 -5
- package/dist/chunk-XWNNA3KE.js +0 -0
- package/dist/chunk-YZNGMV3G.js +0 -0
- package/dist/{chunk-R2YZTCLO.js → chunk-ZQKZSJAX.js} +1 -2
- package/dist/doc/index.d.ts +166 -12
- package/dist/doc/index.js +36 -17
- package/dist/generate/index.d.ts +2 -2
- package/dist/generate/index.js +2 -3
- package/dist/icons/index.js +3 -4
- package/dist/icons/inlineIconMarker.js +1 -2
- package/dist/imageEdit/index.d.ts +48 -17
- package/dist/imageEdit/index.js +3 -4
- package/dist/index.d.ts +13 -12
- package/dist/index.js +118 -33
- package/dist/jsonForm/index.d.ts +10 -3
- package/dist/jsonForm/index.js +8 -7
- package/dist/markdown/index.d.ts +75 -11
- package/dist/markdown/index.js +32 -7
- package/dist/materializePageSection-wSLA2A1g.d.ts +223 -0
- package/dist/narration/index.d.ts +16 -3
- package/dist/narration/index.js +13 -14
- package/dist/random/index.d.ts +11 -2
- package/dist/random/index.js +2 -3
- package/dist/recommend/index.d.ts +1 -1
- package/dist/recommend/index.js +3 -4
- package/dist/schemas/index.d.ts +31 -6
- package/dist/schemas/index.js +43 -6
- package/dist/spatial/index.d.ts +2 -1
- package/dist/spatial/index.js +1 -2
- package/dist/storage/index.d.ts +4 -2
- package/dist/storage/index.js +1 -2
- package/dist/{themeLibrary-RjVgLpUi.d.ts → themeLibrary-DU9mUmVl.d.ts} +1 -1
- package/dist/timing/index.js +3 -4
- package/dist/transform/index.d.ts +9 -10
- package/dist/transform/index.js +6 -7
- package/dist/{types-C4kiRn_k.d.ts → types-8QjefM9J.d.ts} +38 -2
- package/dist/{types-BwMPl2CB.d.ts → types-CUNc9biN.d.ts} +24 -1
- package/dist/versions/index.d.ts +14 -11
- package/dist/versions/index.js +2 -3
- package/package.json +4 -2
- package/dist/chunk-2PWOO4ZE.js.map +0 -1
- package/dist/chunk-2UQOHYE2.js.map +0 -1
- package/dist/chunk-3E5F2XMR.js.map +0 -1
- package/dist/chunk-4X3JQXNM.js.map +0 -1
- package/dist/chunk-5DKBFXPY.js.map +0 -1
- package/dist/chunk-5J4HKRJF.js.map +0 -1
- package/dist/chunk-5UYI3RJB.js.map +0 -1
- package/dist/chunk-66QO7XFB.js.map +0 -1
- package/dist/chunk-AMIR72JP.js +0 -380
- package/dist/chunk-AMIR72JP.js.map +0 -1
- package/dist/chunk-CY2R2VPR.js.map +0 -1
- package/dist/chunk-DBS6RIFL.js.map +0 -1
- package/dist/chunk-DNJKBAI7.js +0 -1
- package/dist/chunk-DNJKBAI7.js.map +0 -1
- package/dist/chunk-ET53IIEP.js +0 -1
- package/dist/chunk-ET53IIEP.js.map +0 -1
- package/dist/chunk-FVJUUTEM.js +0 -74
- package/dist/chunk-FVJUUTEM.js.map +0 -1
- package/dist/chunk-FVTQSNR7.js.map +0 -1
- package/dist/chunk-GZY66SDN.js.map +0 -1
- package/dist/chunk-JOQYPRDZ.js.map +0 -1
- package/dist/chunk-MMPBOUK7.js.map +0 -1
- package/dist/chunk-PGGGKYWG.js +0 -1
- package/dist/chunk-PGGGKYWG.js.map +0 -1
- package/dist/chunk-PXLVXTLW.js.map +0 -1
- package/dist/chunk-Q7LROV2H.js.map +0 -1
- package/dist/chunk-QE7TWGVT.js.map +0 -1
- package/dist/chunk-R2GC6RLD.js +0 -344
- package/dist/chunk-R2GC6RLD.js.map +0 -1
- package/dist/chunk-R2YZTCLO.js.map +0 -1
- package/dist/chunk-S7A5D7ZJ.js +0 -174
- package/dist/chunk-S7A5D7ZJ.js.map +0 -1
- package/dist/chunk-TFJVXUHH.js.map +0 -1
- package/dist/chunk-TUWMK62B.js.map +0 -1
- package/dist/chunk-V543AI2F.js +0 -1
- package/dist/chunk-V543AI2F.js.map +0 -1
- package/dist/chunk-VR7UPJ7C.js.map +0 -1
- package/dist/chunk-W4O2TX5I.js.map +0 -1
- package/dist/chunk-X6DUONGT.js.map +0 -1
- package/dist/chunk-ZLQKNOZQ.js +0 -1
- package/dist/chunk-ZLQKNOZQ.js.map +0 -1
- package/dist/doc/index.js.map +0 -1
- package/dist/generate/index.js.map +0 -1
- package/dist/icons/index.js.map +0 -1
- package/dist/icons/inlineIconMarker.js.map +0 -1
- package/dist/imageEdit/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jsonForm/index.js.map +0 -1
- package/dist/markdown/index.js.map +0 -1
- package/dist/narration/index.js.map +0 -1
- package/dist/random/index.js.map +0 -1
- package/dist/recommend/index.js.map +0 -1
- package/dist/schemas/index.js.map +0 -1
- package/dist/spatial/index.js.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/timing/index.js.map +0 -1
- package/dist/transform/index.js.map +0 -1
- package/dist/versions/index.js.map +0 -1
- package/src/__tests__/animationUtils.test.ts +0 -117
- package/src/__tests__/annotationCoercion.test.ts +0 -243
- package/src/__tests__/applyNarrationTiming.test.ts +0 -190
- package/src/__tests__/applyRenderStyle.test.ts +0 -146
- package/src/__tests__/asciiDiagramBattle.test.ts +0 -246
- package/src/__tests__/asciiDiagramDetect.test.ts +0 -162
- package/src/__tests__/asciiDiagramMapping.test.ts +0 -38
- package/src/__tests__/asciiDiagramParse.test.ts +0 -233
- package/src/__tests__/asciiDiagramPipeline.test.ts +0 -273
- package/src/__tests__/asciiDiagramRender.test.ts +0 -162
- package/src/__tests__/asciiDiagramRepair.test.ts +0 -84
- package/src/__tests__/asciiTimelineDetect.test.ts +0 -157
- package/src/__tests__/asciiTimelineParse.test.ts +0 -205
- package/src/__tests__/asciiTimelinePipeline.test.ts +0 -349
- package/src/__tests__/asciiTimelineRender.test.ts +0 -376
- package/src/__tests__/atmosphereLayers.test.ts +0 -108
- package/src/__tests__/attrTokens.test.ts +0 -167
- package/src/__tests__/colorUtils.test.ts +0 -112
- package/src/__tests__/contentContainer.test.ts +0 -325
- package/src/__tests__/contentExtractor.test.ts +0 -243
- package/src/__tests__/coverBlock.test.ts +0 -310
- package/src/__tests__/customTemplateSample.test.ts +0 -144
- package/src/__tests__/customTemplatesFrontmatter.test.ts +0 -221
- package/src/__tests__/customThemesFrontmatter.test.ts +0 -146
- package/src/__tests__/dataTable.test.ts +0 -145
- package/src/__tests__/diagramBlock.test.ts +0 -122
- package/src/__tests__/diagramLayout.test.ts +0 -134
- package/src/__tests__/diagramText.test.ts +0 -26
- package/src/__tests__/docToMarkdownMedia.test.ts +0 -83
- package/src/__tests__/drawing.test.ts +0 -109
- package/src/__tests__/drawingBlock.test.ts +0 -124
- package/src/__tests__/drawingLayout.test.ts +0 -171
- package/src/__tests__/fixtures/asciiDiagramBattle.ts +0 -512
- package/src/__tests__/fixtures/asciiDiagrams.ts +0 -287
- package/src/__tests__/fixtures/asciiTimelines.ts +0 -35
- package/src/__tests__/fixtures/treeviewFixtures.ts +0 -243
- package/src/__tests__/geohash.test.ts +0 -110
- package/src/__tests__/getLayers.test.ts +0 -243
- package/src/__tests__/getLayersFallback.test.ts +0 -103
- package/src/__tests__/haversine.test.ts +0 -63
- package/src/__tests__/iconResolve.test.ts +0 -122
- package/src/__tests__/imageEditExportSvg.test.ts +0 -70
- package/src/__tests__/imageEditState.test.ts +0 -74
- package/src/__tests__/imageEditVersions.test.ts +0 -243
- package/src/__tests__/inferDocumentTitle.test.ts +0 -50
- package/src/__tests__/inlineIconMarker.test.ts +0 -36
- package/src/__tests__/inputDescriptors.test.ts +0 -162
- package/src/__tests__/jsonForm.chooseControl.test.ts +0 -86
- package/src/__tests__/jsonForm.evaluateWhen.test.ts +0 -59
- package/src/__tests__/jsonForm.inferSchema.test.ts +0 -25
- package/src/__tests__/jsonForm.pointer.test.ts +0 -149
- package/src/__tests__/jsonForm.tokens.test.ts +0 -84
- package/src/__tests__/layoutBlock.test.ts +0 -83
- package/src/__tests__/layoutLayout.test.ts +0 -169
- package/src/__tests__/localForageAdapter.test.ts +0 -155
- package/src/__tests__/majorApiTypes.test.ts +0 -18
- package/src/__tests__/markdown.test.ts +0 -1009
- package/src/__tests__/markdownIcons.test.ts +0 -104
- package/src/__tests__/markdownSanitize.test.ts +0 -81
- package/src/__tests__/markdownToDoc.test.ts +0 -957
- package/src/__tests__/matchFontFamily.test.ts +0 -114
- package/src/__tests__/materializeBlockLayers.test.ts +0 -135
- package/src/__tests__/materializeTestUtils.ts +0 -17
- package/src/__tests__/mediaAnnotations.test.ts +0 -91
- package/src/__tests__/mediaSchedule.test.ts +0 -118
- package/src/__tests__/narrationAlign.test.ts +0 -150
- package/src/__tests__/narrationFeatures.test.ts +0 -71
- package/src/__tests__/narrationNuclei.test.ts +0 -45
- package/src/__tests__/narrationPacing.test.ts +0 -189
- package/src/__tests__/narrationScript.test.ts +0 -149
- package/src/__tests__/narrationSessionRepro.test.ts +0 -62
- package/src/__tests__/narrationSidecar.test.ts +0 -88
- package/src/__tests__/narrationSyllables.test.ts +0 -65
- package/src/__tests__/narrationTestSignals.ts +0 -167
- package/src/__tests__/narrationVad.test.ts +0 -66
- package/src/__tests__/pandocAttrParse.test.ts +0 -187
- package/src/__tests__/recommendTemplates.test.ts +0 -183
- package/src/__tests__/resolveDocTheme.test.ts +0 -69
- package/src/__tests__/rootExports.test.ts +0 -61
- package/src/__tests__/scopedContentContainer.test.ts +0 -109
- package/src/__tests__/seededRandom.test.ts +0 -142
- package/src/__tests__/shapeGeometry.test.ts +0 -138
- package/src/__tests__/shapeVocabulary.test.ts +0 -133
- package/src/__tests__/storage.test.ts +0 -60
- package/src/__tests__/structuredData.test.ts +0 -249
- package/src/__tests__/surface.test.ts +0 -68
- package/src/__tests__/templateAnnotationParse.test.ts +0 -160
- package/src/__tests__/templateInputs.test.ts +0 -69
- package/src/__tests__/templateMetadata.test.ts +0 -32
- package/src/__tests__/templates.test.ts +0 -710
- package/src/__tests__/themeCompile.test.ts +0 -225
- package/src/__tests__/themeValidator.test.ts +0 -131
- package/src/__tests__/timing.test.ts +0 -167
- package/src/__tests__/transformProvenance.test.ts +0 -160
- package/src/__tests__/transformV2.test.ts +0 -163
- package/src/__tests__/transitionNormalize.test.ts +0 -61
- package/src/__tests__/treeviewBattle.test.ts +0 -76
- package/src/__tests__/treeviewDetect.test.ts +0 -168
- package/src/__tests__/treeviewParse.test.ts +0 -118
- package/src/__tests__/treeviewPipeline.test.ts +0 -183
- package/src/__tests__/treeviewRender.test.ts +0 -91
- package/src/__tests__/validateDoc.test.ts +0 -260
- package/src/__tests__/versions.test.ts +0 -459
- package/src/doc/annotationBlocks.ts +0 -117
- package/src/doc/applyNarrationTiming.ts +0 -244
- package/src/doc/asciiDiagram/chars.ts +0 -210
- package/src/doc/asciiDiagram/detect.ts +0 -175
- package/src/doc/asciiDiagram/index.ts +0 -38
- package/src/doc/asciiDiagram/mapping.ts +0 -225
- package/src/doc/asciiDiagram/parse.ts +0 -1095
- package/src/doc/asciiDiagram/render.ts +0 -963
- package/src/doc/asciiDiagram/repair.ts +0 -400
- package/src/doc/asciiDiagram/types.ts +0 -65
- package/src/doc/asciiTimeline/detect.ts +0 -138
- package/src/doc/asciiTimeline/index.ts +0 -26
- package/src/doc/asciiTimeline/mapping.ts +0 -43
- package/src/doc/asciiTimeline/parse.ts +0 -870
- package/src/doc/asciiTimeline/render.ts +0 -427
- package/src/doc/asciiTimeline/types.ts +0 -73
- package/src/doc/asciiTimeline/wrappedFlow.ts +0 -427
- package/src/doc/audioMapping.ts +0 -442
- package/src/doc/customTemplatesFrontmatter.ts +0 -273
- package/src/doc/customThemesFrontmatter.ts +0 -95
- package/src/doc/docToMarkdown.ts +0 -284
- package/src/doc/index.ts +0 -127
- package/src/doc/markdownToDoc.ts +0 -1054
- package/src/doc/materializeBlockLayers.ts +0 -304
- package/src/doc/mediaAnnotations.ts +0 -120
- package/src/doc/resolveDocTheme.ts +0 -56
- package/src/doc/standaloneAnnotation.ts +0 -58
- package/src/doc/structuredData.ts +0 -301
- package/src/doc/templateInputs.ts +0 -423
- package/src/doc/templates/__tests__/customTemplate.test.ts +0 -170
- package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +0 -124
- package/src/doc/templates/__tests__/listBlock.test.ts +0 -64
- package/src/doc/templates/accentImage.ts +0 -362
- package/src/doc/templates/captionUtils.ts +0 -56
- package/src/doc/templates/comparisonBar.ts +0 -173
- package/src/doc/templates/coverBlock.ts +0 -255
- package/src/doc/templates/customTemplate.ts +0 -51
- package/src/doc/templates/dataTable.ts +0 -102
- package/src/doc/templates/dateEvent.ts +0 -147
- package/src/doc/templates/definitionCard.ts +0 -140
- package/src/doc/templates/diagramBlock.ts +0 -403
- package/src/doc/templates/diagramLayout.ts +0 -159
- package/src/doc/templates/drawingBlock.ts +0 -325
- package/src/doc/templates/drawingLayout.ts +0 -539
- package/src/doc/templates/factCard.ts +0 -146
- package/src/doc/templates/fallbackBlock.ts +0 -123
- package/src/doc/templates/featureBlock.ts +0 -209
- package/src/doc/templates/fullBleedQuote.ts +0 -83
- package/src/doc/templates/imageWithCaption.ts +0 -186
- package/src/doc/templates/index.ts +0 -642
- package/src/doc/templates/inputDescriptors.ts +0 -451
- package/src/doc/templates/layoutBlock.ts +0 -43
- package/src/doc/templates/layoutLayout.ts +0 -243
- package/src/doc/templates/listBlock.ts +0 -207
- package/src/doc/templates/mapBlock.ts +0 -138
- package/src/doc/templates/metadata.ts +0 -130
- package/src/doc/templates/persistentLayers.ts +0 -526
- package/src/doc/templates/photoGrid.ts +0 -190
- package/src/doc/templates/pullQuote.ts +0 -141
- package/src/doc/templates/quoteBlock.ts +0 -141
- package/src/doc/templates/registry.ts +0 -88
- package/src/doc/templates/sectionHeader.ts +0 -120
- package/src/doc/templates/statHighlight.ts +0 -146
- package/src/doc/templates/templateNames.ts +0 -22
- package/src/doc/templates/timelineBlock.ts +0 -613
- package/src/doc/templates/titleBlock.ts +0 -150
- package/src/doc/templates/tokens/__tests__/resolveTokens.test.ts +0 -487
- package/src/doc/templates/tokens/resolveTokens.ts +0 -453
- package/src/doc/templates/treeBlock.ts +0 -131
- package/src/doc/templates/twoColumn.ts +0 -263
- package/src/doc/templates/videoPullQuote.ts +0 -142
- package/src/doc/templates/videoWithCaption.ts +0 -135
- package/src/doc/treeview/chars.ts +0 -72
- package/src/doc/treeview/detect.ts +0 -145
- package/src/doc/treeview/index.ts +0 -30
- package/src/doc/treeview/mapping.ts +0 -95
- package/src/doc/treeview/parse.ts +0 -201
- package/src/doc/treeview/render.ts +0 -41
- package/src/doc/treeview/types.ts +0 -43
- package/src/doc/utils/animationUtils.ts +0 -399
- package/src/doc/utils/applyRenderStyle.ts +0 -106
- package/src/doc/utils/diagramText.ts +0 -78
- package/src/doc/utils/imageTreatment.ts +0 -70
- package/src/doc/utils/nearest.ts +0 -59
- package/src/doc/utils/shapeGeometry.ts +0 -614
- package/src/doc/utils/themeUtils.ts +0 -243
- package/src/doc/validate.ts +0 -575
- package/src/generate/contentExtractor.ts +0 -921
- package/src/generate/index.ts +0 -18
- package/src/generate/templateMapper.ts +0 -177
- package/src/icons/iconData.ts +0 -31
- package/src/icons/index.ts +0 -26
- package/src/icons/inlineIconMarker.ts +0 -73
- package/src/icons/resolve.ts +0 -139
- package/src/imageEdit/ImageEditVersionManager.ts +0 -73
- package/src/imageEdit/export.ts +0 -410
- package/src/imageEdit/index.ts +0 -72
- package/src/imageEdit/persistence.ts +0 -113
- package/src/imageEdit/state.ts +0 -112
- package/src/imageEdit/versionPaths.ts +0 -44
- package/src/imageEdit/versions.ts +0 -152
- package/src/index.ts +0 -15
- package/src/internal/immutable.ts +0 -58
- package/src/jsonForm/chooseControl.ts +0 -88
- package/src/jsonForm/evaluateWhen.ts +0 -59
- package/src/jsonForm/index.ts +0 -32
- package/src/jsonForm/inferSchema.ts +0 -25
- package/src/jsonForm/pointer.ts +0 -154
- package/src/jsonForm/tokens.ts +0 -78
- package/src/jsonForm/types.ts +0 -167
- package/src/markdown/annotationCoercion.ts +0 -295
- package/src/markdown/attrTokens.ts +0 -243
- package/src/markdown/convert.ts +0 -1353
- package/src/markdown/htmlParse.ts +0 -212
- package/src/markdown/index.ts +0 -152
- package/src/markdown/parse.ts +0 -103
- package/src/markdown/sanitize.ts +0 -318
- package/src/markdown/stringify.ts +0 -207
- package/src/markdown/types.ts +0 -710
- package/src/markdown/utils.ts +0 -459
- package/src/narration/align.ts +0 -514
- package/src/narration/features.ts +0 -231
- package/src/narration/index.ts +0 -86
- package/src/narration/nuclei.ts +0 -118
- package/src/narration/pacing.ts +0 -211
- package/src/narration/script.ts +0 -239
- package/src/narration/session.ts +0 -100
- package/src/narration/sidecar.ts +0 -187
- package/src/narration/syllables.ts +0 -85
- package/src/narration/trace.ts +0 -50
- package/src/narration/types.ts +0 -299
- package/src/narration/vad.ts +0 -131
- package/src/ngeohash.d.ts +0 -11
- package/src/random/SeededRandom.ts +0 -127
- package/src/random/index.ts +0 -1
- package/src/recommend/index.ts +0 -16
- package/src/recommend/numberHighlight.ts +0 -25
- package/src/recommend/templates.ts +0 -393
- package/src/schemas/BlockTemplates.ts +0 -1046
- package/src/schemas/CustomTemplates.ts +0 -126
- package/src/schemas/Doc.ts +0 -1052
- package/src/schemas/ImageEditDoc.ts +0 -102
- package/src/schemas/LayoutStrategy.ts +0 -178
- package/src/schemas/Media.ts +0 -179
- package/src/schemas/MediaProvider.ts +0 -70
- package/src/schemas/Theme.ts +0 -406
- package/src/schemas/Transitions.ts +0 -224
- package/src/schemas/Types.ts +0 -15
- package/src/schemas/Viewport.ts +0 -91
- package/src/schemas/colorUtils.ts +0 -219
- package/src/schemas/fontStacks.ts +0 -339
- package/src/schemas/index.ts +0 -29
- package/src/schemas/themeCompile.ts +0 -237
- package/src/schemas/themeConstants.ts +0 -2
- package/src/schemas/themeLibrary.ts +0 -60
- package/src/schemas/themeValidator.ts +0 -426
- package/src/schemas/themes/bold.json +0 -48
- package/src/schemas/themes/cinematic.json +0 -111
- package/src/schemas/themes/documentary.json +0 -96
- package/src/schemas/themes/gezellig.json +0 -93
- package/src/schemas/themes/index.ts +0 -53
- package/src/schemas/themes/magazine.json +0 -89
- package/src/schemas/themes/minimalist.json +0 -45
- package/src/schemas/themes/morning-light.json +0 -85
- package/src/schemas/themes/standard-dark.json +0 -85
- package/src/schemas/themes/standard.json +0 -74
- package/src/schemas/themes/tech-dark.json +0 -101
- package/src/schemas/themes/warm-earth.json +0 -50
- package/src/spatial/Geohash.ts +0 -196
- package/src/spatial/Haversine.ts +0 -59
- package/src/spatial/index.ts +0 -2
- package/src/storage/ContentContainer.ts +0 -220
- package/src/storage/LocalForageAdapter.ts +0 -103
- package/src/storage/LocalStorageAdapter.ts +0 -57
- package/src/storage/MediaProviderFromContainer.ts +0 -92
- package/src/storage/MemoryStorageAdapter.ts +0 -37
- package/src/storage/ScopedContentContainer.ts +0 -143
- package/src/storage/Storage.ts +0 -28
- package/src/storage/index.ts +0 -9
- package/src/timing/index.ts +0 -17
- package/src/timing/narrationTiming.ts +0 -220
- package/src/timing/readingTime.ts +0 -94
- package/src/transform/applyTransform.ts +0 -122
- package/src/transform/blockAnalyzer.ts +0 -181
- package/src/transform/index.ts +0 -23
- package/src/transform/registry.ts +0 -198
- package/src/transform/styles/dataDriven.ts +0 -17
- package/src/transform/styles/documentary.ts +0 -17
- package/src/transform/styles/index.ts +0 -5
- package/src/transform/styles/magazine.ts +0 -18
- package/src/transform/styles/minimal.ts +0 -17
- package/src/transform/styles/narrative.ts +0 -18
- package/src/transform/templateSelector.ts +0 -389
- package/src/transform/timingAllocator.ts +0 -257
- package/src/transform/types.ts +0 -151
- package/src/versions/DocumentVersionManager.ts +0 -70
- package/src/versions/gitignore.ts +0 -34
- package/src/versions/index.ts +0 -56
- package/src/versions/operations.ts +0 -144
- package/src/versions/paths.ts +0 -51
- package/src/versions/snapshotStore.ts +0 -202
- package/src/versions/timestamp.ts +0 -48
- package/src/versions/types.ts +0 -93
package/src/schemas/Theme.ts
DELETED
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme System
|
|
3
|
-
*
|
|
4
|
-
* A Theme bundles color palette, typography, visual style, render-style
|
|
5
|
-
* algorithm, and per-block color schemes into one JSON-serializable object.
|
|
6
|
-
*
|
|
7
|
-
* Built-in themes and customizer-authored themes share this exact schema.
|
|
8
|
-
* Customizer-authored themes additionally specify `seedColors` so the few
|
|
9
|
-
* fields the user picked can be re-edited later; built-ins typically omit
|
|
10
|
-
* `seedColors` and ship with explicit `colors` already filled in.
|
|
11
|
-
*
|
|
12
|
-
* Design principles:
|
|
13
|
-
* - Fully JSON-serializable. No functions; no raw CSS font strings.
|
|
14
|
-
* - Font families are structured `FontFamily` references resolved by
|
|
15
|
-
* `resolveFontFamily()` at render time.
|
|
16
|
-
* - Doc carries an optional `themeId`; resolution happens at render time
|
|
17
|
-
* via `resolveTheme(id)`.
|
|
18
|
-
* - `createTheme` deep-merges a base theme with partial overrides;
|
|
19
|
-
* `compileTheme` fills in defaults and derives missing color slots from
|
|
20
|
-
* `seedColors`; both produce a complete `Theme`.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import type { LayoutHints } from './LayoutStrategy.js';
|
|
24
|
-
import type { AnimationType, ImageTreatment, TransitionType } from './Doc.js';
|
|
25
|
-
import type { PersistentLayerConfig } from './BlockTemplates.js';
|
|
26
|
-
import { THEME_SCHEMA_VERSION } from './themeConstants.js';
|
|
27
|
-
import { validateTheme } from './themeValidator.js';
|
|
28
|
-
import { cloneAndFreezeData } from '../internal/immutable.js';
|
|
29
|
-
|
|
30
|
-
// ============================================
|
|
31
|
-
// Schema version
|
|
32
|
-
// ============================================
|
|
33
|
-
|
|
34
|
-
export { THEME_SCHEMA_VERSION } from './themeConstants.js';
|
|
35
|
-
export type ThemeSchemaVersion = typeof THEME_SCHEMA_VERSION;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Frontmatter key under which a document inlines its custom Theme
|
|
39
|
-
* definitions. The theme analog of `FRONTMATTER_CUSTOM_TEMPLATES_KEY`
|
|
40
|
-
* (custom block templates). See `doc/customThemesFrontmatter.ts` for the
|
|
41
|
-
* codec and `doc/resolveDocTheme.ts` for doc-scoped resolution.
|
|
42
|
-
*/
|
|
43
|
-
export const FRONTMATTER_CUSTOM_THEMES_KEY = 'squisq-custom-themes';
|
|
44
|
-
|
|
45
|
-
// ============================================
|
|
46
|
-
// Color Palette
|
|
47
|
-
// ============================================
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Core color palette for a theme. Every color is a `#rrggbb` hex string.
|
|
51
|
-
*/
|
|
52
|
-
export interface ThemeColorPalette {
|
|
53
|
-
/** Primary accent color */
|
|
54
|
-
primary: string;
|
|
55
|
-
/** Secondary accent color */
|
|
56
|
-
secondary: string;
|
|
57
|
-
/** Background color (typically dark) */
|
|
58
|
-
background: string;
|
|
59
|
-
/** Lighter background for contrast panels */
|
|
60
|
-
backgroundLight: string;
|
|
61
|
-
/** Main text color */
|
|
62
|
-
text: string;
|
|
63
|
-
/** Muted/secondary text color */
|
|
64
|
-
textMuted: string;
|
|
65
|
-
/** Highlight/emphasis color */
|
|
66
|
-
highlight: string;
|
|
67
|
-
/** Warning/alert color */
|
|
68
|
-
warning: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* A named color scheme used by templates for per-block color variation
|
|
73
|
-
* (e.g., statHighlight or sectionHeader).
|
|
74
|
-
*/
|
|
75
|
-
export interface ThemeColorScheme {
|
|
76
|
-
/** Background fill */
|
|
77
|
-
bg: string;
|
|
78
|
-
/** Primary text tint */
|
|
79
|
-
text: string;
|
|
80
|
-
/** Accent / secondary tint */
|
|
81
|
-
accent: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Optional authoring metadata. When present and `colors` is partial,
|
|
86
|
-
* `compileTheme` derives missing color slots from these seeds via OKLCh
|
|
87
|
-
* lightening / darkening. Round-trips a customizer-authored theme back
|
|
88
|
-
* into editable form.
|
|
89
|
-
*/
|
|
90
|
-
export interface ThemeSeedColors {
|
|
91
|
-
primary: string;
|
|
92
|
-
secondary?: string;
|
|
93
|
-
accent?: string;
|
|
94
|
-
background?: string;
|
|
95
|
-
text?: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ============================================
|
|
99
|
-
// Typography
|
|
100
|
-
// ============================================
|
|
101
|
-
|
|
102
|
-
/** Categorical bucket for a font family — drives default fallback. */
|
|
103
|
-
export type FontFamilyKind = 'sans' | 'serif' | 'mono' | 'display';
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Structured reference to a font family. Either a curated stack id (looked
|
|
107
|
-
* up in `AVAILABLE_FONT_STACKS`) or a custom user-supplied name with a
|
|
108
|
-
* structured fallback bucket. Themes never carry raw CSS family strings.
|
|
109
|
-
*/
|
|
110
|
-
export type FontFamily =
|
|
111
|
-
| { stackId: string }
|
|
112
|
-
| {
|
|
113
|
-
custom: {
|
|
114
|
-
name: string;
|
|
115
|
-
fallback: 'serif' | 'sans-serif' | 'monospace' | 'system-ui';
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Typography settings for a theme.
|
|
121
|
-
*/
|
|
122
|
-
export interface ThemeTypography {
|
|
123
|
-
/** Font family for body / description text */
|
|
124
|
-
bodyFont: FontFamily;
|
|
125
|
-
/** Font family for titles and headings */
|
|
126
|
-
titleFont: FontFamily;
|
|
127
|
-
/** Font family for code / monospaced text (optional) */
|
|
128
|
-
monoFont?: FontFamily;
|
|
129
|
-
/** Multiplier applied to LayoutHints.titleScale (default 1.0) */
|
|
130
|
-
titleScale?: number;
|
|
131
|
-
/** Multiplier applied to LayoutHints.bodyScale (default 1.0) */
|
|
132
|
-
bodyScale?: number;
|
|
133
|
-
/** Default body line height (default 1.4) */
|
|
134
|
-
lineHeight?: number;
|
|
135
|
-
/** Default title line height */
|
|
136
|
-
titleLineHeight?: number;
|
|
137
|
-
/** Default title font weight */
|
|
138
|
-
titleWeight?: 'normal' | 'bold';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// ============================================
|
|
142
|
-
// Visual Style
|
|
143
|
-
// ============================================
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Global visual-style knobs that templates consult.
|
|
147
|
-
*/
|
|
148
|
-
export interface ThemeStyle {
|
|
149
|
-
/** Default border radius for cards / shapes (px) */
|
|
150
|
-
borderRadius?: number;
|
|
151
|
-
/** Whether templates should default to text shadows */
|
|
152
|
-
textShadow?: boolean;
|
|
153
|
-
/** Darkness of overlay on image-backed blocks (0–1) */
|
|
154
|
-
overlayOpacity?: number;
|
|
155
|
-
/** Multiplier on all animation durations (1.0 = normal, <1 faster, >1 slower) */
|
|
156
|
-
animationSpeed?: number;
|
|
157
|
-
/** Default horizontal padding for text (percentage string, e.g. "5%") */
|
|
158
|
-
blockPadding?: string;
|
|
159
|
-
/**
|
|
160
|
-
* Photographic grade applied to template imagery (full-bleed photos,
|
|
161
|
-
* feature halves, accent strips) so photos look native to the theme.
|
|
162
|
-
* Duotone tints default to the theme primary. Blocks opt out per
|
|
163
|
-
* template via `imageTreatment: 'none'`.
|
|
164
|
-
*/
|
|
165
|
-
imageTreatment?: ImageTreatment;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// ============================================
|
|
169
|
-
// Render Style
|
|
170
|
-
// ============================================
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Render-style algorithm preset. Controls layout tweaks, default animations,
|
|
174
|
-
* transitions, and per-template behavioral hints.
|
|
175
|
-
*/
|
|
176
|
-
export interface RenderStyle {
|
|
177
|
-
/** Identifier for this algorithmic approach (e.g. "documentary", "magazine") */
|
|
178
|
-
name: string;
|
|
179
|
-
/** Partial overrides merged onto the orientation-based LayoutHints */
|
|
180
|
-
layoutOverrides?: Partial<LayoutHints>;
|
|
181
|
-
/** Default entrance animation for text layers */
|
|
182
|
-
defaultTextAnimation?: AnimationType;
|
|
183
|
-
/** Default animation for background / image layers */
|
|
184
|
-
defaultImageAnimation?: AnimationType;
|
|
185
|
-
/** Whether to apply Ken Burns ambient motion to images by default */
|
|
186
|
-
ambientMotion?: boolean;
|
|
187
|
-
/** Default block-to-block transition */
|
|
188
|
-
defaultTransition?: { type: TransitionType; duration?: number };
|
|
189
|
-
/**
|
|
190
|
-
* Per-template behavioral hints. Keys are template names, values are
|
|
191
|
-
* string/number/boolean maps that templates can read to vary their output.
|
|
192
|
-
* Templates that consume hints publish a `hintSchema` export documenting
|
|
193
|
-
* the keys they recognise.
|
|
194
|
-
*/
|
|
195
|
-
templateHints?: Record<string, Record<string, string | number | boolean>>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// ============================================
|
|
199
|
-
// Theme
|
|
200
|
-
// ============================================
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* A complete, JSON-serializable theme definition. Built-in and customizer-
|
|
204
|
-
* authored themes share this exact shape.
|
|
205
|
-
*/
|
|
206
|
-
export interface Theme {
|
|
207
|
-
/** Schema version. Always '1' for now. */
|
|
208
|
-
schemaVersion: ThemeSchemaVersion;
|
|
209
|
-
/** Unique identifier (e.g. "documentary") */
|
|
210
|
-
id: string;
|
|
211
|
-
/** Human-readable display name */
|
|
212
|
-
name: string;
|
|
213
|
-
/** Short description for theme pickers */
|
|
214
|
-
description?: string;
|
|
215
|
-
/**
|
|
216
|
-
* Id of the theme this custom theme was derived from, if any. Recorded
|
|
217
|
-
* by `compileTheme({ base })` so a customizer can re-open the theme and
|
|
218
|
-
* re-inherit the base's render style / color schemes / typography.
|
|
219
|
-
* Absent on built-ins.
|
|
220
|
-
*/
|
|
221
|
-
basedOn?: string;
|
|
222
|
-
/** Optional authoring seeds (customizer fills these; built-ins typically omit) */
|
|
223
|
-
seedColors?: ThemeSeedColors;
|
|
224
|
-
/** Color palette */
|
|
225
|
-
colors: ThemeColorPalette;
|
|
226
|
-
/** Typography settings */
|
|
227
|
-
typography: ThemeTypography;
|
|
228
|
-
/** Global visual-style knobs */
|
|
229
|
-
style: ThemeStyle;
|
|
230
|
-
/** Algorithmic render-style preset */
|
|
231
|
-
renderStyle: RenderStyle;
|
|
232
|
-
/**
|
|
233
|
-
* Named color schemes for per-block color variation.
|
|
234
|
-
* Templates reference these by name (e.g. "blue", "warm").
|
|
235
|
-
*/
|
|
236
|
-
colorSchemes: Record<string, ThemeColorScheme>;
|
|
237
|
-
/** Optional persistent layers baked into the theme */
|
|
238
|
-
persistentLayers?: PersistentLayerConfig;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// ============================================
|
|
242
|
-
// Deep-Partial helper type
|
|
243
|
-
// ============================================
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Recursively makes every property optional.
|
|
247
|
-
*/
|
|
248
|
-
export type DeepPartial<T> = {
|
|
249
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
// ============================================
|
|
253
|
-
// Helpers
|
|
254
|
-
// ============================================
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Deep-merge `source` into `target`, returning a new object.
|
|
258
|
-
* Arrays are replaced wholesale (not concatenated).
|
|
259
|
-
*/
|
|
260
|
-
function deepMerge<T extends Record<string, unknown>>(target: T, source: DeepPartial<T>): T {
|
|
261
|
-
const result = { ...target } as Record<string, unknown>;
|
|
262
|
-
for (const key of Object.keys(source)) {
|
|
263
|
-
const srcVal = (source as Record<string, unknown>)[key];
|
|
264
|
-
const tgtVal = (target as Record<string, unknown>)[key];
|
|
265
|
-
if (
|
|
266
|
-
srcVal !== null &&
|
|
267
|
-
srcVal !== undefined &&
|
|
268
|
-
typeof srcVal === 'object' &&
|
|
269
|
-
!Array.isArray(srcVal) &&
|
|
270
|
-
tgtVal !== null &&
|
|
271
|
-
tgtVal !== undefined &&
|
|
272
|
-
typeof tgtVal === 'object' &&
|
|
273
|
-
!Array.isArray(tgtVal)
|
|
274
|
-
) {
|
|
275
|
-
result[key] = deepMerge(
|
|
276
|
-
tgtVal as Record<string, unknown>,
|
|
277
|
-
srcVal as DeepPartial<Record<string, unknown>>,
|
|
278
|
-
);
|
|
279
|
-
} else if (srcVal !== undefined) {
|
|
280
|
-
result[key] = srcVal;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return result as T;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Create a new theme by deep-merging overrides onto a base theme.
|
|
288
|
-
* The returned theme gets its own `id` if one is provided in overrides,
|
|
289
|
-
* otherwise keeps the base theme's `id` suffixed with "-custom".
|
|
290
|
-
*/
|
|
291
|
-
export function createTheme(base: Theme, overrides: DeepPartial<Theme>): Theme {
|
|
292
|
-
const merged = deepMerge(
|
|
293
|
-
base as unknown as Record<string, unknown>,
|
|
294
|
-
overrides as DeepPartial<Record<string, unknown>>,
|
|
295
|
-
) as unknown as Theme;
|
|
296
|
-
if (!overrides.id && merged.id === base.id) {
|
|
297
|
-
merged.id = `${base.id}-custom`;
|
|
298
|
-
}
|
|
299
|
-
if (!merged.schemaVersion) merged.schemaVersion = THEME_SCHEMA_VERSION;
|
|
300
|
-
return merged;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// ============================================
|
|
304
|
-
// Surface Schemes — orthogonal to Theme
|
|
305
|
-
// ============================================
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* A Surface Scheme is the light/dark axis, orthogonal to the editorial
|
|
309
|
-
* identity of a Theme. A Theme chooses voice (serif vs sans, muted vs
|
|
310
|
-
* bold, documentary vs magazine); a SurfaceScheme chooses what the paper
|
|
311
|
-
* looks like. Any theme can render on either surface.
|
|
312
|
-
*/
|
|
313
|
-
export interface SurfaceScheme {
|
|
314
|
-
/** Identifier — 'light', 'dark', or a custom id. */
|
|
315
|
-
id: string;
|
|
316
|
-
background: string;
|
|
317
|
-
backgroundLight: string;
|
|
318
|
-
text: string;
|
|
319
|
-
textMuted: string;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/** Near-white paper with dark text — standard light mode. */
|
|
323
|
-
export const LIGHT_SURFACE: SurfaceScheme = {
|
|
324
|
-
id: 'light',
|
|
325
|
-
background: '#ffffff',
|
|
326
|
-
backgroundLight: '#f5f5f5',
|
|
327
|
-
text: '#1a1a1a',
|
|
328
|
-
textMuted: '#666666',
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
/** Dark charcoal paper with light text — standard dark mode. */
|
|
332
|
-
export const DARK_SURFACE: SurfaceScheme = {
|
|
333
|
-
id: 'dark',
|
|
334
|
-
background: '#1a202c',
|
|
335
|
-
backgroundLight: '#2d3748',
|
|
336
|
-
text: '#f0f0f0',
|
|
337
|
-
textMuted: '#a0aec0',
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Overlay a SurfaceScheme's surface colors onto a Theme's palette,
|
|
342
|
-
* leaving everything else (primary, highlight, warning, typography,
|
|
343
|
-
* style, renderStyle, colorSchemes) untouched.
|
|
344
|
-
*/
|
|
345
|
-
export function applySurface(theme: Theme, surface: SurfaceScheme): Theme {
|
|
346
|
-
return {
|
|
347
|
-
...theme,
|
|
348
|
-
colors: {
|
|
349
|
-
...theme.colors,
|
|
350
|
-
background: surface.background,
|
|
351
|
-
backgroundLight: surface.backgroundLight,
|
|
352
|
-
text: surface.text,
|
|
353
|
-
textMuted: surface.textMuted,
|
|
354
|
-
},
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// ============================================
|
|
359
|
-
// Caller-owned registry — for custom themes
|
|
360
|
-
// ============================================
|
|
361
|
-
|
|
362
|
-
/** A caller-owned custom-theme registry for SSR tenants, tests, and embedders. */
|
|
363
|
-
export interface ThemeRegistry {
|
|
364
|
-
register(theme: Theme): void;
|
|
365
|
-
unregister(id: string): boolean;
|
|
366
|
-
get(id: string): Theme | undefined;
|
|
367
|
-
list(): Theme[];
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
function validatedThemeSnapshot(theme: Theme): Theme {
|
|
371
|
-
const result = validateTheme(theme);
|
|
372
|
-
if (!result.valid || !result.theme) {
|
|
373
|
-
const details = result.errors
|
|
374
|
-
.slice(0, 5)
|
|
375
|
-
.map((error) => `${error.path || '<root>'}: ${error.message}`)
|
|
376
|
-
.join('; ');
|
|
377
|
-
throw new TypeError(`Cannot register invalid theme: ${details}`);
|
|
378
|
-
}
|
|
379
|
-
return cloneAndFreezeData(result.theme);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Create a registry whose state is owned by the caller rather than the
|
|
384
|
-
* process. Registered values are validated and stored as deeply frozen
|
|
385
|
-
* snapshots, so later caller mutation cannot alter resolution behavior.
|
|
386
|
-
*/
|
|
387
|
-
export function createThemeRegistry(initialThemes: readonly Theme[] = []): ThemeRegistry {
|
|
388
|
-
const themes = new Map<string, Theme>();
|
|
389
|
-
const registry: ThemeRegistry = {
|
|
390
|
-
register(theme): void {
|
|
391
|
-
const snapshot = validatedThemeSnapshot(theme);
|
|
392
|
-
themes.set(snapshot.id, snapshot);
|
|
393
|
-
},
|
|
394
|
-
unregister(id): boolean {
|
|
395
|
-
return themes.delete(id);
|
|
396
|
-
},
|
|
397
|
-
get(id): Theme | undefined {
|
|
398
|
-
return themes.get(id);
|
|
399
|
-
},
|
|
400
|
-
list(): Theme[] {
|
|
401
|
-
return Array.from(themes.values());
|
|
402
|
-
},
|
|
403
|
-
};
|
|
404
|
-
for (const theme of initialThemes) registry.register(theme);
|
|
405
|
-
return Object.freeze(registry);
|
|
406
|
-
}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared transition vocabulary for block-to-block slide changes.
|
|
3
|
-
*
|
|
4
|
-
* The canonical names are based on PowerPoint / PresentationML transition
|
|
5
|
-
* names where possible, with a few legacy renderer aliases kept so older
|
|
6
|
-
* Squisq documents continue to work.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export const DEFAULT_TRANSITION_DURATION_SECONDS = 0.7;
|
|
10
|
-
|
|
11
|
-
export const TRANSITION_TYPES = [
|
|
12
|
-
// Existing / common transitions
|
|
13
|
-
'cut',
|
|
14
|
-
'fade',
|
|
15
|
-
'dissolve',
|
|
16
|
-
'push',
|
|
17
|
-
'wipe',
|
|
18
|
-
'split',
|
|
19
|
-
'reveal',
|
|
20
|
-
'randomBars',
|
|
21
|
-
'shape',
|
|
22
|
-
'uncover',
|
|
23
|
-
'cover',
|
|
24
|
-
'zoom',
|
|
25
|
-
'pan',
|
|
26
|
-
|
|
27
|
-
// PowerPoint subtle / exciting transitions
|
|
28
|
-
'flash',
|
|
29
|
-
'fallOver',
|
|
30
|
-
'drape',
|
|
31
|
-
'curtains',
|
|
32
|
-
'wind',
|
|
33
|
-
'prestige',
|
|
34
|
-
'fracture',
|
|
35
|
-
'crush',
|
|
36
|
-
'peelOff',
|
|
37
|
-
'pageCurl',
|
|
38
|
-
'airplane',
|
|
39
|
-
'origami',
|
|
40
|
-
'checkerboard',
|
|
41
|
-
'blinds',
|
|
42
|
-
'clock',
|
|
43
|
-
'ripple',
|
|
44
|
-
'honeycomb',
|
|
45
|
-
'glitter',
|
|
46
|
-
'vortex',
|
|
47
|
-
'shred',
|
|
48
|
-
'switch',
|
|
49
|
-
'flip',
|
|
50
|
-
'gallery',
|
|
51
|
-
'cube',
|
|
52
|
-
'doors',
|
|
53
|
-
'box',
|
|
54
|
-
'ferrisWheel',
|
|
55
|
-
'conveyor',
|
|
56
|
-
'rotate',
|
|
57
|
-
'window',
|
|
58
|
-
'orbit',
|
|
59
|
-
'flyThrough',
|
|
60
|
-
'morph',
|
|
61
|
-
|
|
62
|
-
// PresentationML/Open XML precise names and legacy aliases
|
|
63
|
-
'checker',
|
|
64
|
-
'circle',
|
|
65
|
-
'comb',
|
|
66
|
-
'diamond',
|
|
67
|
-
'newsflash',
|
|
68
|
-
'plus',
|
|
69
|
-
'pull',
|
|
70
|
-
'random',
|
|
71
|
-
'randomBar',
|
|
72
|
-
'strips',
|
|
73
|
-
'wedge',
|
|
74
|
-
'wheel',
|
|
75
|
-
'prism',
|
|
76
|
-
'warp',
|
|
77
|
-
'ferris',
|
|
78
|
-
'flythrough',
|
|
79
|
-
'wheelReverse',
|
|
80
|
-
'pageCurlDouble',
|
|
81
|
-
'pageCurlSingle',
|
|
82
|
-
'slideLeft',
|
|
83
|
-
'slideRight',
|
|
84
|
-
'slideUp',
|
|
85
|
-
'slideDown',
|
|
86
|
-
] as const;
|
|
87
|
-
|
|
88
|
-
export type TransitionType = (typeof TRANSITION_TYPES)[number];
|
|
89
|
-
|
|
90
|
-
export const TRANSITION_DIRECTIONS = [
|
|
91
|
-
'left',
|
|
92
|
-
'right',
|
|
93
|
-
'up',
|
|
94
|
-
'down',
|
|
95
|
-
'in',
|
|
96
|
-
'out',
|
|
97
|
-
'horizontal',
|
|
98
|
-
'vertical',
|
|
99
|
-
] as const;
|
|
100
|
-
|
|
101
|
-
export type TransitionDirection = (typeof TRANSITION_DIRECTIONS)[number];
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Transition between blocks.
|
|
105
|
-
*
|
|
106
|
-
* A block's transition is the lead-in from the previous block. The same
|
|
107
|
-
* transition drives the entering block and the previous block's exit.
|
|
108
|
-
*/
|
|
109
|
-
export interface Transition {
|
|
110
|
-
/** Transition type */
|
|
111
|
-
type: TransitionType;
|
|
112
|
-
/** Duration in seconds. Defaults to DEFAULT_TRANSITION_DURATION_SECONDS. */
|
|
113
|
-
duration?: number;
|
|
114
|
-
/** Optional direction/variant for directional transitions. */
|
|
115
|
-
direction?: TransitionDirection;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const TRANSITION_TYPE_SET = new Set<string>(TRANSITION_TYPES);
|
|
119
|
-
|
|
120
|
-
const TRANSITION_TYPE_ALIASES: Record<string, TransitionType> = {
|
|
121
|
-
none: 'cut',
|
|
122
|
-
randombars: 'randomBars',
|
|
123
|
-
randombar: 'randomBar',
|
|
124
|
-
// Self-referential spellings (`checkerboard`, `shape`, `uncover`) are
|
|
125
|
-
// intentionally absent: an exact valid type returns early from
|
|
126
|
-
// `normalizeTransitionType`, and any case variant resolves through
|
|
127
|
-
// `NORMALIZED_TRANSITION_TYPES`. Only the *plural* aliases need an entry.
|
|
128
|
-
checkerboards: 'checkerboard',
|
|
129
|
-
shapes: 'shape',
|
|
130
|
-
ferris: 'ferrisWheel',
|
|
131
|
-
ferriswheel: 'ferrisWheel',
|
|
132
|
-
flythrough: 'flyThrough',
|
|
133
|
-
flythru: 'flyThrough',
|
|
134
|
-
pagecurl: 'pageCurl',
|
|
135
|
-
pagecurldouble: 'pageCurlDouble',
|
|
136
|
-
pagecurlsingle: 'pageCurlSingle',
|
|
137
|
-
wheelreverse: 'wheelReverse',
|
|
138
|
-
slideleft: 'slideLeft',
|
|
139
|
-
slideright: 'slideRight',
|
|
140
|
-
slideup: 'slideUp',
|
|
141
|
-
slidedown: 'slideDown',
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const NORMALIZED_TRANSITION_TYPES = new Map<string, TransitionType>(
|
|
145
|
-
TRANSITION_TYPES.map((type) => [normalizeToken(type), type]),
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
export function isTransitionType(value: string): value is TransitionType {
|
|
149
|
-
return TRANSITION_TYPE_SET.has(value);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export function normalizeTransitionType(value: string): TransitionType | null {
|
|
153
|
-
const trimmed = value.trim();
|
|
154
|
-
if (!trimmed) return null;
|
|
155
|
-
if (isTransitionType(trimmed)) return trimmed;
|
|
156
|
-
const normalized = normalizeToken(trimmed);
|
|
157
|
-
return TRANSITION_TYPE_ALIASES[normalized] ?? NORMALIZED_TRANSITION_TYPES.get(normalized) ?? null;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function normalizeTransitionDirection(value: string): TransitionDirection | null {
|
|
161
|
-
const normalized = normalizeToken(value);
|
|
162
|
-
switch (normalized) {
|
|
163
|
-
case 'left':
|
|
164
|
-
case 'l':
|
|
165
|
-
return 'left';
|
|
166
|
-
case 'right':
|
|
167
|
-
case 'r':
|
|
168
|
-
return 'right';
|
|
169
|
-
case 'up':
|
|
170
|
-
case 'u':
|
|
171
|
-
return 'up';
|
|
172
|
-
case 'down':
|
|
173
|
-
case 'd':
|
|
174
|
-
return 'down';
|
|
175
|
-
case 'in':
|
|
176
|
-
return 'in';
|
|
177
|
-
case 'out':
|
|
178
|
-
return 'out';
|
|
179
|
-
case 'horizontal':
|
|
180
|
-
case 'horz':
|
|
181
|
-
case 'h':
|
|
182
|
-
return 'horizontal';
|
|
183
|
-
case 'vertical':
|
|
184
|
-
case 'vert':
|
|
185
|
-
case 'v':
|
|
186
|
-
return 'vertical';
|
|
187
|
-
default:
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export function resolveTransitionDuration(
|
|
193
|
-
transition: Transition | undefined,
|
|
194
|
-
fallback: number = DEFAULT_TRANSITION_DURATION_SECONDS,
|
|
195
|
-
): number {
|
|
196
|
-
const duration = transition?.duration;
|
|
197
|
-
return duration != null && Number.isFinite(duration) && duration > 0 ? duration : fallback;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Resolve the effective transition for a block: the authored value wins
|
|
202
|
-
* (markdown frontmatter and transform styles both write `block.transition`
|
|
203
|
-
* upstream), then the theme's `renderStyle.defaultTransition`, then
|
|
204
|
-
* `undefined` (the player's built-in default).
|
|
205
|
-
*
|
|
206
|
-
* Block 0 never gets a theme default — an entrance transition on the first
|
|
207
|
-
* block would dim the opening frames of every exported video.
|
|
208
|
-
*
|
|
209
|
-
* The theme parameter is structural (not `Theme`) to avoid a schema import
|
|
210
|
-
* cycle; pass any resolved theme.
|
|
211
|
-
*/
|
|
212
|
-
export function resolveBlockTransition(
|
|
213
|
-
block: { transition?: Transition },
|
|
214
|
-
theme: { renderStyle: { defaultTransition?: Transition } },
|
|
215
|
-
blockIndex: number,
|
|
216
|
-
): Transition | undefined {
|
|
217
|
-
if (block.transition) return block.transition;
|
|
218
|
-
if (blockIndex === 0) return undefined;
|
|
219
|
-
return theme.renderStyle.defaultTransition;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function normalizeToken(value: string): string {
|
|
223
|
-
return value.toLowerCase().replace(/[\s_-]+/g, '');
|
|
224
|
-
}
|
package/src/schemas/Types.ts
DELETED