@bendyline/squisq 1.5.2 → 2.0.1
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/README.md +63 -10
- package/dist/{Doc-BBVGq1_9.d.ts → Doc-ylqWKDc_.d.ts} +248 -37
- package/dist/{ImageEditDoc-FuyGtt6o.d.ts → ImageEditDoc-D828IXJ1.d.ts} +1 -1
- package/dist/annotationCoercion-Dr_DY9Hx.d.ts +86 -0
- package/dist/{chunk-T5UK6YOB.js → chunk-2PWOO4ZE.js} +60 -17
- package/dist/chunk-2PWOO4ZE.js.map +1 -0
- package/dist/{chunk-VWUFZ6ZG.js → chunk-3E5F2XMR.js} +2 -29
- package/dist/chunk-3E5F2XMR.js.map +1 -0
- package/dist/chunk-4X3JQXNM.js +35 -0
- package/dist/chunk-4X3JQXNM.js.map +1 -0
- package/dist/{chunk-P3K7NLHF.js → chunk-5DKBFXPY.js} +31 -121
- package/dist/chunk-5DKBFXPY.js.map +1 -0
- package/dist/{chunk-DLXZMS5K.js → chunk-5J4HKRJF.js} +51 -3
- package/dist/chunk-5J4HKRJF.js.map +1 -0
- package/dist/chunk-5UYI3RJB.js +2503 -0
- package/dist/chunk-5UYI3RJB.js.map +1 -0
- package/dist/{chunk-BEQODJWV.js → chunk-66QO7XFB.js} +11 -291
- package/dist/chunk-66QO7XFB.js.map +1 -0
- package/dist/{chunk-HWVFJAAH.js → chunk-AMIR72JP.js} +28 -10
- package/dist/chunk-AMIR72JP.js.map +1 -0
- package/dist/chunk-CY2R2VPR.js +884 -0
- package/dist/chunk-CY2R2VPR.js.map +1 -0
- package/dist/chunk-FVJUUTEM.js +74 -0
- package/dist/chunk-FVJUUTEM.js.map +1 -0
- package/dist/{chunk-Q3ROPT5H.js → chunk-GZY66SDN.js} +1 -1
- package/dist/{chunk-Q3ROPT5H.js.map → chunk-GZY66SDN.js.map} +1 -1
- package/dist/chunk-JOQYPRDZ.js +127 -0
- package/dist/chunk-JOQYPRDZ.js.map +1 -0
- package/dist/{chunk-A4O7GIWE.js → chunk-MMPBOUK7.js} +10 -73
- package/dist/chunk-MMPBOUK7.js.map +1 -0
- package/dist/{chunk-LDQ2HJIX.js → chunk-PXLVXTLW.js} +252 -54
- package/dist/chunk-PXLVXTLW.js.map +1 -0
- package/dist/{chunk-TQWLI6S2.js → chunk-Q7LROV2H.js} +4 -2
- package/dist/{chunk-TQWLI6S2.js.map → chunk-Q7LROV2H.js.map} +1 -1
- package/dist/{chunk-GPLTCSXO.js → chunk-R2GC6RLD.js} +7 -7
- package/dist/chunk-R2GC6RLD.js.map +1 -0
- package/dist/chunk-R2YZTCLO.js +292 -0
- package/dist/chunk-R2YZTCLO.js.map +1 -0
- package/dist/chunk-S7A5D7ZJ.js +174 -0
- package/dist/chunk-S7A5D7ZJ.js.map +1 -0
- package/dist/chunk-TFJVXUHH.js +2358 -0
- package/dist/chunk-TFJVXUHH.js.map +1 -0
- package/dist/{chunk-LTN6I7QW.js → chunk-TUWMK62B.js} +55 -4
- package/dist/chunk-TUWMK62B.js.map +1 -0
- package/dist/{chunk-IMSCRLLV.js → chunk-VR7UPJ7C.js} +35 -25
- package/dist/chunk-VR7UPJ7C.js.map +1 -0
- package/dist/{chunk-KKNUBQ6Y.js → chunk-W4O2TX5I.js} +157 -92
- package/dist/chunk-W4O2TX5I.js.map +1 -0
- package/dist/{chunk-5TYS5V3G.js → chunk-X6DUONGT.js} +4204 -3560
- package/dist/chunk-X6DUONGT.js.map +1 -0
- package/dist/doc/index.d.ts +2334 -5
- package/dist/doc/index.js +127 -33
- package/dist/generate/index.d.ts +7 -2
- package/dist/generate/index.js +1 -1
- package/dist/imageEdit/index.d.ts +9 -6
- package/dist/imageEdit/index.js +3 -3
- package/dist/index.d.ts +12 -10
- package/dist/index.js +246 -80
- package/dist/jsonForm/index.d.ts +7 -3
- package/dist/jsonForm/index.js +9 -4
- package/dist/markdown/index.d.ts +6 -70
- package/dist/markdown/index.js +13 -9
- package/dist/narration/index.d.ts +618 -0
- package/dist/narration/index.js +82 -0
- package/dist/recommend/index.d.ts +15 -1
- package/dist/recommend/index.js +2 -2
- package/dist/schemas/index.d.ts +28 -6
- package/dist/schemas/index.js +15 -13
- package/dist/spatial/index.d.ts +0 -1
- package/dist/spatial/index.js +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/{themeLibrary-CehcJhzz.d.ts → themeLibrary-RjVgLpUi.d.ts} +10 -11
- package/dist/timing/index.js +5 -3
- package/dist/transform/index.d.ts +35 -24
- package/dist/transform/index.js +9 -10
- package/dist/{types-DlAZ7MW4.d.ts → types-BwMPl2CB.d.ts} +1 -1
- package/dist/{types-D98li1gV.d.ts → types-C4kiRn_k.d.ts} +3 -1
- package/dist/versions/index.d.ts +2 -1
- package/dist/versions/index.js +2 -2
- package/package.json +6 -6
- package/src/__tests__/applyNarrationTiming.test.ts +190 -0
- package/src/__tests__/applyRenderStyle.test.ts +3 -3
- package/src/__tests__/asciiDiagramBattle.test.ts +246 -0
- package/src/__tests__/asciiDiagramDetect.test.ts +162 -0
- package/src/__tests__/asciiDiagramMapping.test.ts +38 -0
- package/src/__tests__/asciiDiagramParse.test.ts +233 -0
- package/src/__tests__/asciiDiagramPipeline.test.ts +273 -0
- package/src/__tests__/asciiDiagramRender.test.ts +162 -0
- package/src/__tests__/asciiDiagramRepair.test.ts +84 -0
- package/src/__tests__/asciiTimelineDetect.test.ts +157 -0
- package/src/__tests__/asciiTimelineParse.test.ts +205 -0
- package/src/__tests__/asciiTimelinePipeline.test.ts +349 -0
- package/src/__tests__/asciiTimelineRender.test.ts +376 -0
- package/src/__tests__/attrTokens.test.ts +5 -0
- package/src/__tests__/contentContainer.test.ts +43 -0
- package/src/__tests__/customTemplatesFrontmatter.test.ts +0 -15
- package/src/__tests__/customThemesFrontmatter.test.ts +1 -0
- package/src/__tests__/dataTable.test.ts +25 -15
- package/src/__tests__/diagramBlock.test.ts +3 -3
- package/src/__tests__/diagramText.test.ts +26 -0
- package/src/__tests__/docToMarkdownMedia.test.ts +83 -0
- package/src/__tests__/drawingBlock.test.ts +3 -3
- package/src/__tests__/fixtures/asciiDiagramBattle.ts +512 -0
- package/src/__tests__/fixtures/asciiDiagrams.ts +287 -0
- package/src/__tests__/fixtures/asciiTimelines.ts +35 -0
- package/src/__tests__/fixtures/treeviewFixtures.ts +243 -0
- package/src/__tests__/getLayers.test.ts +32 -18
- package/src/__tests__/getLayersFallback.test.ts +8 -8
- package/src/__tests__/imageEditVersions.test.ts +2 -0
- package/src/__tests__/jsonForm.pointer.test.ts +47 -1
- package/src/__tests__/layoutBlock.test.ts +3 -3
- package/src/__tests__/majorApiTypes.test.ts +18 -0
- package/src/__tests__/markdown.test.ts +54 -4
- package/src/__tests__/markdownSanitize.test.ts +7 -5
- package/src/__tests__/matchFontFamily.test.ts +114 -0
- package/src/__tests__/materializeBlockLayers.test.ts +135 -0
- package/src/__tests__/materializeTestUtils.ts +17 -0
- package/src/__tests__/narrationAlign.test.ts +150 -0
- package/src/__tests__/narrationFeatures.test.ts +71 -0
- package/src/__tests__/narrationNuclei.test.ts +45 -0
- package/src/__tests__/narrationPacing.test.ts +189 -0
- package/src/__tests__/narrationScript.test.ts +149 -0
- package/src/__tests__/narrationSessionRepro.test.ts +62 -0
- package/src/__tests__/narrationSidecar.test.ts +88 -0
- package/src/__tests__/narrationSyllables.test.ts +65 -0
- package/src/__tests__/narrationTestSignals.ts +167 -0
- package/src/__tests__/narrationVad.test.ts +66 -0
- package/src/__tests__/resolveDocTheme.test.ts +16 -2
- package/src/__tests__/rootExports.test.ts +18 -0
- package/src/__tests__/scopedContentContainer.test.ts +20 -0
- package/src/__tests__/shapeGeometry.test.ts +12 -0
- package/src/__tests__/templateAnnotationParse.test.ts +10 -0
- package/src/__tests__/templateInputs.test.ts +69 -0
- package/src/__tests__/templateMetadata.test.ts +2 -1
- package/src/__tests__/templates.test.ts +143 -17
- package/src/__tests__/themeCompile.test.ts +49 -22
- package/src/__tests__/transformProvenance.test.ts +160 -0
- package/src/__tests__/transformV2.test.ts +40 -14
- package/src/__tests__/treeviewBattle.test.ts +76 -0
- package/src/__tests__/treeviewDetect.test.ts +168 -0
- package/src/__tests__/treeviewParse.test.ts +118 -0
- package/src/__tests__/treeviewPipeline.test.ts +183 -0
- package/src/__tests__/treeviewRender.test.ts +91 -0
- package/src/__tests__/versions.test.ts +44 -0
- package/src/doc/applyNarrationTiming.ts +244 -0
- package/src/doc/asciiDiagram/chars.ts +210 -0
- package/src/doc/asciiDiagram/detect.ts +175 -0
- package/src/doc/asciiDiagram/index.ts +38 -0
- package/src/doc/asciiDiagram/mapping.ts +225 -0
- package/src/doc/asciiDiagram/parse.ts +1095 -0
- package/src/doc/asciiDiagram/render.ts +963 -0
- package/src/doc/asciiDiagram/repair.ts +400 -0
- package/src/doc/asciiDiagram/types.ts +65 -0
- package/src/doc/asciiTimeline/detect.ts +138 -0
- package/src/doc/asciiTimeline/index.ts +26 -0
- package/src/doc/asciiTimeline/mapping.ts +43 -0
- package/src/doc/asciiTimeline/parse.ts +870 -0
- package/src/doc/asciiTimeline/render.ts +427 -0
- package/src/doc/asciiTimeline/types.ts +73 -0
- package/src/doc/asciiTimeline/wrappedFlow.ts +427 -0
- package/src/doc/audioMapping.ts +60 -46
- package/src/doc/customTemplatesFrontmatter.ts +0 -41
- package/src/doc/docToMarkdown.ts +70 -2
- package/src/doc/index.ts +76 -4
- package/src/doc/markdownToDoc.ts +138 -2
- package/src/doc/materializeBlockLayers.ts +304 -0
- package/src/doc/mediaAnnotations.ts +20 -0
- package/src/doc/resolveDocTheme.ts +8 -7
- package/src/doc/templateInputs.ts +185 -2
- package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +22 -8
- package/src/doc/templates/__tests__/listBlock.test.ts +64 -0
- package/src/doc/templates/diagramBlock.ts +237 -38
- package/src/doc/templates/fallbackBlock.ts +1 -1
- package/src/doc/templates/index.ts +134 -279
- package/src/doc/templates/inputDescriptors.ts +20 -1
- package/src/doc/templates/listBlock.ts +88 -30
- package/src/doc/templates/metadata.ts +10 -0
- package/src/doc/templates/persistentLayers.ts +12 -126
- package/src/doc/templates/registry.ts +88 -0
- package/src/doc/templates/templateNames.ts +22 -0
- package/src/doc/templates/timelineBlock.ts +613 -0
- package/src/doc/templates/treeBlock.ts +131 -0
- package/src/doc/treeview/chars.ts +72 -0
- package/src/doc/treeview/detect.ts +145 -0
- package/src/doc/treeview/index.ts +30 -0
- package/src/doc/treeview/mapping.ts +95 -0
- package/src/doc/treeview/parse.ts +201 -0
- package/src/doc/treeview/render.ts +41 -0
- package/src/doc/treeview/types.ts +43 -0
- package/src/doc/utils/applyRenderStyle.ts +2 -9
- package/src/doc/utils/diagramText.ts +78 -0
- package/src/doc/utils/shapeGeometry.ts +67 -5
- package/src/doc/validate.ts +1 -1
- package/src/generate/templateMapper.ts +7 -0
- package/src/imageEdit/export.ts +6 -5
- package/src/imageEdit/versionPaths.ts +13 -26
- package/src/imageEdit/versions.ts +21 -100
- package/src/index.ts +1 -0
- package/src/internal/immutable.ts +58 -0
- package/src/jsonForm/index.ts +9 -1
- package/src/jsonForm/pointer.ts +68 -23
- package/src/markdown/attrTokens.ts +7 -5
- package/src/markdown/index.ts +1 -0
- package/src/markdown/stringify.ts +4 -9
- package/src/markdown/utils.ts +36 -14
- package/src/narration/align.ts +514 -0
- package/src/narration/features.ts +231 -0
- package/src/narration/index.ts +86 -0
- package/src/narration/nuclei.ts +118 -0
- package/src/narration/pacing.ts +211 -0
- package/src/narration/script.ts +239 -0
- package/src/narration/session.ts +100 -0
- package/src/narration/sidecar.ts +187 -0
- package/src/narration/syllables.ts +85 -0
- package/src/narration/trace.ts +50 -0
- package/src/narration/types.ts +299 -0
- package/src/narration/vad.ts +131 -0
- package/src/recommend/numberHighlight.ts +25 -0
- package/src/recommend/templates.ts +108 -12
- package/src/schemas/BlockTemplates.ts +156 -7
- package/src/schemas/Doc.ts +72 -9
- package/src/schemas/Media.ts +12 -2
- package/src/schemas/Theme.ts +45 -25
- package/src/schemas/Viewport.ts +2 -2
- package/src/schemas/fontStacks.ts +79 -0
- package/src/schemas/themeCompile.ts +15 -0
- package/src/schemas/themeConstants.ts +2 -0
- package/src/schemas/themeLibrary.ts +25 -19
- package/src/schemas/themeValidator.ts +1 -1
- package/src/schemas/themes/gezellig.json +1 -1
- package/src/spatial/Geohash.ts +0 -3
- package/src/storage/ContentContainer.ts +17 -9
- package/src/storage/ScopedContentContainer.ts +45 -15
- package/src/transform/applyTransform.ts +5 -5
- package/src/transform/index.ts +3 -1
- package/src/transform/registry.ts +169 -49
- package/src/transform/templateSelector.ts +21 -2
- package/src/transform/timingAllocator.ts +152 -21
- package/src/transform/types.ts +14 -1
- package/src/versions/gitignore.ts +34 -0
- package/src/versions/index.ts +2 -0
- package/src/versions/operations.ts +18 -104
- package/src/versions/paths.ts +13 -28
- package/src/versions/snapshotStore.ts +202 -0
- package/src/versions/types.ts +3 -1
- package/dist/chunk-5TYS5V3G.js.map +0 -1
- package/dist/chunk-A4O7GIWE.js.map +0 -1
- package/dist/chunk-BEQODJWV.js.map +0 -1
- package/dist/chunk-DLXZMS5K.js.map +0 -1
- package/dist/chunk-GPLTCSXO.js.map +0 -1
- package/dist/chunk-HWVFJAAH.js.map +0 -1
- package/dist/chunk-IMSCRLLV.js.map +0 -1
- package/dist/chunk-JELIRVDP.js +0 -24
- package/dist/chunk-JELIRVDP.js.map +0 -1
- package/dist/chunk-KKNUBQ6Y.js.map +0 -1
- package/dist/chunk-LDQ2HJIX.js.map +0 -1
- package/dist/chunk-LTN6I7QW.js.map +0 -1
- package/dist/chunk-P3K7NLHF.js.map +0 -1
- package/dist/chunk-T5UK6YOB.js.map +0 -1
- package/dist/chunk-UY7KGQ5R.js +0 -192
- package/dist/chunk-UY7KGQ5R.js.map +0 -1
- package/dist/chunk-VLJJHDAC.js +0 -218
- package/dist/chunk-VLJJHDAC.js.map +0 -1
- package/dist/chunk-VWUFZ6ZG.js.map +0 -1
- package/dist/story/index.d.ts +0 -1801
- package/dist/story/index.js +0 -279
- package/src/doc/getLayers.ts +0 -195
- /package/dist/{story → narration}/index.js.map +0 -0
package/dist/story/index.js
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BASE_INPUT_DESCRIPTORS,
|
|
3
|
-
CONTAINER_TEMPLATES,
|
|
4
|
-
DEFAULT_LAYOUT,
|
|
5
|
-
SHAPE_NAMES,
|
|
6
|
-
TEMPLATE_ALIASES,
|
|
7
|
-
TEMPLATE_INPUT_DESCRIPTORS,
|
|
8
|
-
TEMPLATE_METADATA,
|
|
9
|
-
adjustY,
|
|
10
|
-
applyRenderStyleToLayers,
|
|
11
|
-
buildRegistry,
|
|
12
|
-
coerceTemplateParams,
|
|
13
|
-
comparisonBar,
|
|
14
|
-
computeDiagramLayout,
|
|
15
|
-
computeDrawingLayout,
|
|
16
|
-
computeLayoutLayers,
|
|
17
|
-
countBlocks,
|
|
18
|
-
coverBlock,
|
|
19
|
-
createAccentLayers,
|
|
20
|
-
cssFilterForTreatment,
|
|
21
|
-
dataTable,
|
|
22
|
-
dateEvent,
|
|
23
|
-
decodeLayersFromFrontmatter,
|
|
24
|
-
definitionCard,
|
|
25
|
-
deriveTemplateInputs,
|
|
26
|
-
diagramBlock,
|
|
27
|
-
docToMarkdown,
|
|
28
|
-
drawingBlock,
|
|
29
|
-
encodeLayersForFrontmatter,
|
|
30
|
-
expandCoverBlock,
|
|
31
|
-
expandDocBlocks,
|
|
32
|
-
expandPersistentLayers,
|
|
33
|
-
expandTemplateBlock,
|
|
34
|
-
extractBlockquoteText,
|
|
35
|
-
extractBodyPlainText,
|
|
36
|
-
extractFirstImage,
|
|
37
|
-
extractImages,
|
|
38
|
-
extractListItems,
|
|
39
|
-
extractTableData,
|
|
40
|
-
extractTableFromContents,
|
|
41
|
-
factCard,
|
|
42
|
-
fallbackBlockLayers,
|
|
43
|
-
findFirstTable,
|
|
44
|
-
flattenBlocks,
|
|
45
|
-
flattenRenderableBlocks,
|
|
46
|
-
fullBleedQuote,
|
|
47
|
-
getAccentLayout,
|
|
48
|
-
getAnimationProgress,
|
|
49
|
-
getAnimationStyle,
|
|
50
|
-
getAvailableTemplates,
|
|
51
|
-
getBlockDepth,
|
|
52
|
-
getDefaultAnimation,
|
|
53
|
-
getDefaultAnimationDuration,
|
|
54
|
-
getDocStyleConfig,
|
|
55
|
-
getLayers,
|
|
56
|
-
getOverlayOpacity,
|
|
57
|
-
getPersistentLayersFromTheme,
|
|
58
|
-
getTemplateHint,
|
|
59
|
-
getThemeFont,
|
|
60
|
-
getTransitionClass,
|
|
61
|
-
hasTemplate,
|
|
62
|
-
imageWithCaption,
|
|
63
|
-
isContainerTemplate,
|
|
64
|
-
isDataFence,
|
|
65
|
-
isShapeName,
|
|
66
|
-
layoutBlock,
|
|
67
|
-
leftFeature,
|
|
68
|
-
lintTemplateParams,
|
|
69
|
-
listBlock,
|
|
70
|
-
mapBlock,
|
|
71
|
-
markdownToDoc,
|
|
72
|
-
normalizeShapeKind,
|
|
73
|
-
parseDataFence,
|
|
74
|
-
parseYamlSubset,
|
|
75
|
-
photoGrid,
|
|
76
|
-
pullQuote,
|
|
77
|
-
quoteBlock,
|
|
78
|
-
readCustomTemplatesFromFrontmatter,
|
|
79
|
-
readCustomThemesFromFrontmatter,
|
|
80
|
-
replaceDataFence,
|
|
81
|
-
resolveAudioMapping,
|
|
82
|
-
resolveColorScheme,
|
|
83
|
-
resolvePersistentLayers,
|
|
84
|
-
resolveTemplateName,
|
|
85
|
-
resolveThemeForDoc,
|
|
86
|
-
rightFeature,
|
|
87
|
-
scaleAnimationDuration,
|
|
88
|
-
scoreTextSimilarity,
|
|
89
|
-
sectionHeader,
|
|
90
|
-
shouldUseShadow,
|
|
91
|
-
statHighlight,
|
|
92
|
-
templateRegistry,
|
|
93
|
-
themeWantsAmbientMotion,
|
|
94
|
-
themedEntrance,
|
|
95
|
-
themedFontSize,
|
|
96
|
-
themedImageTreatment,
|
|
97
|
-
themedScrim,
|
|
98
|
-
themedSurfaceGradient,
|
|
99
|
-
titleBlock,
|
|
100
|
-
twoColumn,
|
|
101
|
-
validateMarkdownDoc,
|
|
102
|
-
validateMarkdownSource,
|
|
103
|
-
videoPullQuote,
|
|
104
|
-
videoWithCaption,
|
|
105
|
-
wrapWithPersistentLayers,
|
|
106
|
-
writeCustomTemplatesToFrontmatter,
|
|
107
|
-
writeCustomThemesToFrontmatter
|
|
108
|
-
} from "../chunk-5TYS5V3G.js";
|
|
109
|
-
import "../chunk-UY7KGQ5R.js";
|
|
110
|
-
import "../chunk-V543AI2F.js";
|
|
111
|
-
import "../chunk-FVTQSNR7.js";
|
|
112
|
-
import {
|
|
113
|
-
PATH_SHAPE_KINDS,
|
|
114
|
-
clipEndpoints,
|
|
115
|
-
clipPoint,
|
|
116
|
-
connectorPath,
|
|
117
|
-
lineStyleDasharray,
|
|
118
|
-
markerPath,
|
|
119
|
-
nearestSnapPoint,
|
|
120
|
-
shapePath,
|
|
121
|
-
snapEndpoints,
|
|
122
|
-
snapPoints
|
|
123
|
-
} from "../chunk-LTN6I7QW.js";
|
|
124
|
-
import {
|
|
125
|
-
DEFAULT_THEME,
|
|
126
|
-
FRONTMATTER_CUSTOM_TEMPLATES_KEY,
|
|
127
|
-
FRONTMATTER_CUSTOM_THEMES_KEY,
|
|
128
|
-
getAvailableThemes,
|
|
129
|
-
getThemeSummaries,
|
|
130
|
-
resolveTheme
|
|
131
|
-
} from "../chunk-KKNUBQ6Y.js";
|
|
132
|
-
import {
|
|
133
|
-
VIEWPORT_PRESETS,
|
|
134
|
-
createTemplateContext,
|
|
135
|
-
getLayoutHints,
|
|
136
|
-
getTwoColumnPositions,
|
|
137
|
-
getViewport,
|
|
138
|
-
getViewportOrientation,
|
|
139
|
-
isTemplateBlock,
|
|
140
|
-
scaledFontSize2 as scaledFontSize
|
|
141
|
-
} from "../chunk-DLXZMS5K.js";
|
|
142
|
-
import "../chunk-BEQODJWV.js";
|
|
143
|
-
import "../chunk-HWVFJAAH.js";
|
|
144
|
-
import "../chunk-DBS6RIFL.js";
|
|
145
|
-
import "../chunk-QE7TWGVT.js";
|
|
146
|
-
import "../chunk-VWUFZ6ZG.js";
|
|
147
|
-
export {
|
|
148
|
-
BASE_INPUT_DESCRIPTORS,
|
|
149
|
-
CONTAINER_TEMPLATES,
|
|
150
|
-
DEFAULT_LAYOUT,
|
|
151
|
-
DEFAULT_THEME,
|
|
152
|
-
FRONTMATTER_CUSTOM_TEMPLATES_KEY,
|
|
153
|
-
FRONTMATTER_CUSTOM_THEMES_KEY,
|
|
154
|
-
PATH_SHAPE_KINDS,
|
|
155
|
-
SHAPE_NAMES,
|
|
156
|
-
TEMPLATE_ALIASES,
|
|
157
|
-
TEMPLATE_INPUT_DESCRIPTORS,
|
|
158
|
-
TEMPLATE_METADATA,
|
|
159
|
-
VIEWPORT_PRESETS,
|
|
160
|
-
adjustY,
|
|
161
|
-
applyRenderStyleToLayers,
|
|
162
|
-
buildRegistry,
|
|
163
|
-
clipEndpoints,
|
|
164
|
-
clipPoint,
|
|
165
|
-
coerceTemplateParams,
|
|
166
|
-
comparisonBar,
|
|
167
|
-
computeDiagramLayout,
|
|
168
|
-
computeDrawingLayout,
|
|
169
|
-
computeLayoutLayers,
|
|
170
|
-
connectorPath,
|
|
171
|
-
countBlocks,
|
|
172
|
-
coverBlock,
|
|
173
|
-
createAccentLayers,
|
|
174
|
-
createTemplateContext,
|
|
175
|
-
cssFilterForTreatment,
|
|
176
|
-
dataTable,
|
|
177
|
-
dateEvent,
|
|
178
|
-
decodeLayersFromFrontmatter,
|
|
179
|
-
definitionCard,
|
|
180
|
-
deriveTemplateInputs,
|
|
181
|
-
diagramBlock,
|
|
182
|
-
docToMarkdown,
|
|
183
|
-
drawingBlock,
|
|
184
|
-
encodeLayersForFrontmatter,
|
|
185
|
-
expandCoverBlock,
|
|
186
|
-
expandDocBlocks,
|
|
187
|
-
expandPersistentLayers,
|
|
188
|
-
expandTemplateBlock,
|
|
189
|
-
extractBlockquoteText,
|
|
190
|
-
extractBodyPlainText,
|
|
191
|
-
extractFirstImage,
|
|
192
|
-
extractImages,
|
|
193
|
-
extractListItems,
|
|
194
|
-
extractTableData,
|
|
195
|
-
extractTableFromContents,
|
|
196
|
-
factCard,
|
|
197
|
-
fallbackBlockLayers,
|
|
198
|
-
findFirstTable,
|
|
199
|
-
flattenBlocks,
|
|
200
|
-
flattenRenderableBlocks,
|
|
201
|
-
fullBleedQuote,
|
|
202
|
-
getAccentLayout,
|
|
203
|
-
getAnimationProgress,
|
|
204
|
-
getAnimationStyle,
|
|
205
|
-
getAvailableTemplates,
|
|
206
|
-
getAvailableThemes,
|
|
207
|
-
getBlockDepth,
|
|
208
|
-
getDefaultAnimation,
|
|
209
|
-
getDefaultAnimationDuration,
|
|
210
|
-
getDocStyleConfig,
|
|
211
|
-
getLayers,
|
|
212
|
-
getLayoutHints,
|
|
213
|
-
getOverlayOpacity,
|
|
214
|
-
getPersistentLayersFromTheme,
|
|
215
|
-
getTemplateHint,
|
|
216
|
-
getThemeFont,
|
|
217
|
-
getThemeSummaries,
|
|
218
|
-
getTransitionClass,
|
|
219
|
-
getTwoColumnPositions,
|
|
220
|
-
getViewport,
|
|
221
|
-
getViewportOrientation,
|
|
222
|
-
hasTemplate,
|
|
223
|
-
imageWithCaption,
|
|
224
|
-
isContainerTemplate,
|
|
225
|
-
isDataFence,
|
|
226
|
-
isShapeName,
|
|
227
|
-
isTemplateBlock,
|
|
228
|
-
layoutBlock,
|
|
229
|
-
leftFeature,
|
|
230
|
-
lineStyleDasharray,
|
|
231
|
-
lintTemplateParams,
|
|
232
|
-
listBlock,
|
|
233
|
-
mapBlock,
|
|
234
|
-
markdownToDoc,
|
|
235
|
-
markerPath,
|
|
236
|
-
nearestSnapPoint,
|
|
237
|
-
normalizeShapeKind,
|
|
238
|
-
parseDataFence,
|
|
239
|
-
parseYamlSubset,
|
|
240
|
-
photoGrid,
|
|
241
|
-
pullQuote,
|
|
242
|
-
quoteBlock,
|
|
243
|
-
readCustomTemplatesFromFrontmatter,
|
|
244
|
-
readCustomThemesFromFrontmatter,
|
|
245
|
-
replaceDataFence,
|
|
246
|
-
resolveAudioMapping,
|
|
247
|
-
resolveColorScheme,
|
|
248
|
-
resolvePersistentLayers,
|
|
249
|
-
resolveTemplateName,
|
|
250
|
-
resolveTheme,
|
|
251
|
-
resolveThemeForDoc,
|
|
252
|
-
rightFeature,
|
|
253
|
-
scaleAnimationDuration,
|
|
254
|
-
scaledFontSize,
|
|
255
|
-
scoreTextSimilarity,
|
|
256
|
-
sectionHeader,
|
|
257
|
-
shapePath,
|
|
258
|
-
shouldUseShadow,
|
|
259
|
-
snapEndpoints,
|
|
260
|
-
snapPoints,
|
|
261
|
-
statHighlight,
|
|
262
|
-
templateRegistry,
|
|
263
|
-
themeWantsAmbientMotion,
|
|
264
|
-
themedEntrance,
|
|
265
|
-
themedFontSize,
|
|
266
|
-
themedImageTreatment,
|
|
267
|
-
themedScrim,
|
|
268
|
-
themedSurfaceGradient,
|
|
269
|
-
titleBlock,
|
|
270
|
-
twoColumn,
|
|
271
|
-
validateMarkdownDoc,
|
|
272
|
-
validateMarkdownSource,
|
|
273
|
-
videoPullQuote,
|
|
274
|
-
videoWithCaption,
|
|
275
|
-
wrapWithPersistentLayers,
|
|
276
|
-
writeCustomTemplatesToFrontmatter,
|
|
277
|
-
writeCustomThemesToFrontmatter
|
|
278
|
-
};
|
|
279
|
-
//# sourceMappingURL=index.js.map
|
package/src/doc/getLayers.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* getLayers — Compute visual layers for a block on demand.
|
|
3
|
-
*
|
|
4
|
-
* This is the preferred way to obtain renderable layers for a block.
|
|
5
|
-
* Instead of storing pre-computed layers on the Block object, call
|
|
6
|
-
* `getLayers(block, context)` to derive them from the block's template
|
|
7
|
-
* name, content, and the current render context (theme, viewport, etc.).
|
|
8
|
-
*
|
|
9
|
-
* For raw blocks that already carry a `layers` array, those layers are
|
|
10
|
-
* returned directly (with optional persistent layer injection).
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { getLayers } from '@bendyline/squisq/doc';
|
|
15
|
-
*
|
|
16
|
-
* const layers = getLayers(block, {
|
|
17
|
-
* theme: DEFAULT_THEME,
|
|
18
|
-
* viewport: VIEWPORT_PRESETS.landscape,
|
|
19
|
-
* blockIndex: 0,
|
|
20
|
-
* totalBlocks: 10,
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import type { Block, Layer } from '../schemas/Doc.js';
|
|
26
|
-
import type {
|
|
27
|
-
TemplateBlock,
|
|
28
|
-
TemplateContext,
|
|
29
|
-
PersistentLayerConfig,
|
|
30
|
-
DocBlock,
|
|
31
|
-
} from '../schemas/BlockTemplates.js';
|
|
32
|
-
import type { Theme } from '../schemas/Theme.js';
|
|
33
|
-
import type { ViewportConfig } from '../schemas/Viewport.js';
|
|
34
|
-
import { VIEWPORT_PRESETS } from '../schemas/Viewport.js';
|
|
35
|
-
import { createTemplateContext, isTemplateBlock } from '../schemas/BlockTemplates.js';
|
|
36
|
-
import { DEFAULT_THEME } from '../schemas/themeLibrary.js';
|
|
37
|
-
import { templateRegistry, resolveTemplateName } from './templates/index.js';
|
|
38
|
-
import { coerceTemplateParams } from './templates/inputDescriptors.js';
|
|
39
|
-
import { expandPersistentLayers, wrapWithPersistentLayers } from './templates/persistentLayers.js';
|
|
40
|
-
import { applyRenderStyleToLayers } from './utils/applyRenderStyle.js';
|
|
41
|
-
import { fallbackBlockLayers } from './templates/fallbackBlock.js';
|
|
42
|
-
|
|
43
|
-
// ============================================
|
|
44
|
-
// RenderContext
|
|
45
|
-
// ============================================
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Context needed to compute layers for a block.
|
|
49
|
-
*
|
|
50
|
-
* Captures the visual rendering parameters: theme colors, viewport
|
|
51
|
-
* configuration, persistent layers, and the block's position within
|
|
52
|
-
* the doc (for template functions that vary output by index).
|
|
53
|
-
*/
|
|
54
|
-
export interface RenderContext {
|
|
55
|
-
/** Theme for template rendering. Defaults to DEFAULT_THEME (documentary). */
|
|
56
|
-
theme?: Theme;
|
|
57
|
-
|
|
58
|
-
/** Target viewport configuration. Defaults to 16:9 landscape. */
|
|
59
|
-
viewport?: ViewportConfig;
|
|
60
|
-
|
|
61
|
-
/** Persistent layers injected behind and/or on top of all block content. */
|
|
62
|
-
persistentLayers?: PersistentLayerConfig;
|
|
63
|
-
|
|
64
|
-
/** 0-based index of this block in the sequence. Defaults to 0. */
|
|
65
|
-
blockIndex?: number;
|
|
66
|
-
|
|
67
|
-
/** Total number of blocks in the doc. Defaults to 1. */
|
|
68
|
-
totalBlocks?: number;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// ============================================
|
|
72
|
-
// getLayers
|
|
73
|
-
// ============================================
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Compute the visual layers for a block.
|
|
77
|
-
*
|
|
78
|
-
* Resolution order:
|
|
79
|
-
* 1. If the block already has a non-empty `layers` array, use it (raw block).
|
|
80
|
-
* 2. If the block has a `template` name that exists in the registry,
|
|
81
|
-
* call the template function to generate layers.
|
|
82
|
-
* 3. Otherwise return an empty array.
|
|
83
|
-
*
|
|
84
|
-
* Persistent layers (bottom/top) from the render context are injected
|
|
85
|
-
* around the result unless the block opts out via `useBottomLayer: false`
|
|
86
|
-
* or `useTopLayer: false`.
|
|
87
|
-
*
|
|
88
|
-
* @param block A Block or TemplateBlock to render.
|
|
89
|
-
* @param context Render context (theme, viewport, persistent layers, position).
|
|
90
|
-
* @returns The computed Layer[] for the block, ready for BlockRenderer.
|
|
91
|
-
*/
|
|
92
|
-
export function getLayers(block: DocBlock, context: RenderContext = {}): Layer[] {
|
|
93
|
-
const theme = context.theme ?? DEFAULT_THEME;
|
|
94
|
-
const viewport = context.viewport ?? VIEWPORT_PRESETS.landscape;
|
|
95
|
-
const blockIndex = context.blockIndex ?? 0;
|
|
96
|
-
const totalBlocks = context.totalBlocks ?? 1;
|
|
97
|
-
|
|
98
|
-
// 1. Raw block path: block already has pre-computed layers
|
|
99
|
-
const existingLayers = (block as Block).layers;
|
|
100
|
-
if (existingLayers && existingLayers.length > 0 && !isTemplateBlock(block)) {
|
|
101
|
-
return injectPersistentLayers(existingLayers, block, context);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// 2. Template path: look up and call the template function.
|
|
105
|
-
//
|
|
106
|
-
// Resolve through TEMPLATE_ALIASES so legacy ids (`titleBlock`,
|
|
107
|
-
// `quoteBlock`, `mapBlock`, `listBlock`) hit the registry by their
|
|
108
|
-
// canonical short names. Without this the block-section path renders
|
|
109
|
-
// an empty SVG card: `hasTemplate()` accepts the alias (so
|
|
110
|
-
// `isAnnotatedBlock` returns true and the card wrapper renders), but
|
|
111
|
-
// a raw `block.template in templateRegistry` check below misses it
|
|
112
|
-
// and the layer list comes back empty.
|
|
113
|
-
if (isTemplateBlock(block)) {
|
|
114
|
-
const resolved = resolveTemplateName(block.template);
|
|
115
|
-
const templateCtx = createTemplateContext(theme, blockIndex, totalBlocks, viewport);
|
|
116
|
-
if (resolved in templateRegistry) {
|
|
117
|
-
const templateName = resolved as keyof typeof templateRegistry;
|
|
118
|
-
// Aggregate templates (e.g. `diagram`) consume the block's children.
|
|
119
|
-
const maybeChildren = (block as Block).children;
|
|
120
|
-
if (maybeChildren && maybeChildren.length > 0) {
|
|
121
|
-
templateCtx.children = maybeChildren;
|
|
122
|
-
}
|
|
123
|
-
// Effective template input: the block's own fields, then structured
|
|
124
|
-
// body data (```json data fences, GFM tables), then `{[…]}` string
|
|
125
|
-
// overrides — the same merge order buildPreviewDoc uses. Inline overrides
|
|
126
|
-
// are coerced to their typed shape (`center="47.6,-122.3"` → `{lat,lng}`,
|
|
127
|
-
// `zoom=9` → `9`) so pure-inline annotations render without any change to
|
|
128
|
-
// the template functions. `block.templateOverrides` itself stays raw
|
|
129
|
-
// strings for lossless round-tripping — only this ephemeral input is coerced.
|
|
130
|
-
const { templateData, templateOverrides } = block as Block;
|
|
131
|
-
const input =
|
|
132
|
-
templateData || templateOverrides
|
|
133
|
-
? ({
|
|
134
|
-
...block,
|
|
135
|
-
...templateData,
|
|
136
|
-
...coerceTemplateParams(block.template, templateOverrides ?? {}).input,
|
|
137
|
-
} as TemplateBlock)
|
|
138
|
-
: block;
|
|
139
|
-
let layers: Layer[];
|
|
140
|
-
try {
|
|
141
|
-
// Each registry entry accepts its specific TemplateBlock variant; the
|
|
142
|
-
// discriminated union guarantees the shapes match at runtime.
|
|
143
|
-
const templateFn = templateRegistry[templateName] as (
|
|
144
|
-
input: TemplateBlock,
|
|
145
|
-
ctx: TemplateContext,
|
|
146
|
-
) => Layer[];
|
|
147
|
-
layers = templateFn(input, templateCtx);
|
|
148
|
-
if (!Array.isArray(layers)) {
|
|
149
|
-
console.warn(`Template ${templateName} did not return an array, got:`, typeof layers);
|
|
150
|
-
layers = fallbackBlockLayers(block, templateCtx, `Template "${block.template}" failed`);
|
|
151
|
-
}
|
|
152
|
-
} catch (err: unknown) {
|
|
153
|
-
console.warn(`Error expanding template ${templateName}:`, err);
|
|
154
|
-
layers = fallbackBlockLayers(block, templateCtx, `Template "${block.template}" failed`);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Theme motion defaults apply to template-generated layers only
|
|
158
|
-
// (mirrors expandDocBlocks — the two paths must agree).
|
|
159
|
-
layers = applyRenderStyleToLayers(layers, block as Block, theme);
|
|
160
|
-
|
|
161
|
-
return injectPersistentLayers(layers, block, context);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Unknown template — graceful-degradation guarantee: render the
|
|
165
|
-
// block's heading + body text as a plain card with a visible notice
|
|
166
|
-
// instead of a blank slide.
|
|
167
|
-
return injectPersistentLayers(
|
|
168
|
-
fallbackBlockLayers(block, templateCtx, `Unknown template "${block.template}"`),
|
|
169
|
-
block,
|
|
170
|
-
context,
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// 3. Fallback: no layers and no template requested
|
|
175
|
-
return injectPersistentLayers([], block, context);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// ============================================
|
|
179
|
-
// Internal helpers
|
|
180
|
-
// ============================================
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Inject persistent bottom/top layers around the block's own layers,
|
|
184
|
-
* respecting per-block opt-out flags.
|
|
185
|
-
*/
|
|
186
|
-
function injectPersistentLayers(layers: Layer[], block: DocBlock, context: RenderContext): Layer[] {
|
|
187
|
-
const { persistentLayers } = context;
|
|
188
|
-
if (!persistentLayers) return layers;
|
|
189
|
-
|
|
190
|
-
const theme = context.theme ?? DEFAULT_THEME;
|
|
191
|
-
const bottomLayers = expandPersistentLayers(persistentLayers.bottomLayers, theme);
|
|
192
|
-
const topLayers = expandPersistentLayers(persistentLayers.topLayers, theme);
|
|
193
|
-
|
|
194
|
-
return wrapWithPersistentLayers(layers, block as TemplateBlock, bottomLayers, topLayers);
|
|
195
|
-
}
|
|
File without changes
|