@bendyline/squisq 1.5.1 → 2.0.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/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-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-2OIBZYKP.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-TEEEILMP.js → chunk-66QO7XFB.js} +19 -292
- package/dist/chunk-66QO7XFB.js.map +1 -0
- package/dist/{chunk-KKNUBQ6Y.js → chunk-6PJRB2CF.js} +156 -91
- package/dist/chunk-6PJRB2CF.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-FVJUUTEM.js +74 -0
- package/dist/chunk-FVJUUTEM.js.map +1 -0
- package/dist/{chunk-LH7I6SH7.js → chunk-GF3BVNLU.js} +6360 -5723
- package/dist/chunk-GF3BVNLU.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-LYNJEOAC.js} +10 -73
- package/dist/chunk-LYNJEOAC.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-T5UK6YOB.js → chunk-QTSJOY54.js} +60 -17
- package/dist/chunk-QTSJOY54.js.map +1 -0
- package/dist/chunk-QVANWDPH.js +2358 -0
- package/dist/chunk-QVANWDPH.js.map +1 -0
- package/dist/{chunk-6ATE2PSM.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-T3TI7GSZ.js +884 -0
- package/dist/chunk-T3TI7GSZ.js.map +1 -0
- package/dist/{chunk-RUDYOTA6.js → chunk-TUWMK62B.js} +110 -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/doc/index.d.ts +2334 -5
- package/dist/doc/index.js +134 -34
- 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 +253 -81
- 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__/coverBlock.test.ts +33 -2
- package/src/__tests__/customTemplatesFrontmatter.test.ts +0 -15
- 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 +41 -0
- package/src/__tests__/markdownToDoc.test.ts +5 -2
- 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 +49 -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 +126 -39
- package/src/doc/index.ts +76 -4
- package/src/doc/markdownToDoc.ts +135 -1
- 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/coverBlock.ts +49 -13
- package/src/doc/templates/diagramBlock.ts +237 -38
- package/src/doc/templates/drawingBlock.ts +2 -2
- 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/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 +157 -7
- 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/convert.ts +11 -1
- 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/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-2OIBZYKP.js.map +0 -1
- package/dist/chunk-6ATE2PSM.js.map +0 -1
- package/dist/chunk-A4O7GIWE.js.map +0 -1
- package/dist/chunk-DLXZMS5K.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-LH7I6SH7.js.map +0 -1
- package/dist/chunk-RUDYOTA6.js.map +0 -1
- package/dist/chunk-T5UK6YOB.js.map +0 -1
- package/dist/chunk-TEEEILMP.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 -1777
- package/dist/story/index.js +0 -273
- package/src/doc/getLayers.ts +0 -195
- /package/dist/{story → narration}/index.js.map +0 -0
package/dist/jsonForm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../types-
|
|
1
|
+
import { aC as Theme, as as SurfaceScheme } from '../Doc-ylqWKDc_.js';
|
|
2
|
+
import '../types-BwMPl2CB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* JSON Form types — Squisq's hint vocabulary layered on JSON Schema.
|
|
@@ -159,8 +159,12 @@ declare function resolveFlag(flag: boolean | SquisqWhen | undefined, rootData: u
|
|
|
159
159
|
* `/user/role`. `$ref` resolution is local-only (`#/$defs/Foo`).
|
|
160
160
|
*/
|
|
161
161
|
|
|
162
|
+
/** Escape one object-member name for use as an RFC 6901 pointer segment. */
|
|
163
|
+
declare function escapePointerSegment(segment: string): string;
|
|
162
164
|
/** Normalize a path to a JSON Pointer string. Accepts both forms. */
|
|
163
165
|
declare function toPointer(path: string): string;
|
|
166
|
+
/** Append one member name to a dotted path or validated JSON Pointer. */
|
|
167
|
+
declare function appendPointer(base: string, segment: string): string;
|
|
164
168
|
/** Split a JSON Pointer into decoded segments. Empty string → []. */
|
|
165
169
|
declare function pointerSegments(pointer: string): string[];
|
|
166
170
|
/** Read a value from data by path (dotted or pointer). Returns undefined if missing. */
|
|
@@ -229,4 +233,4 @@ declare function buildJsonFormTokens(theme: Theme | undefined, surface: SurfaceS
|
|
|
229
233
|
*/
|
|
230
234
|
declare function resolveJsonFormTheme(theme: Theme | undefined, surface: SurfaceScheme | undefined): Theme;
|
|
231
235
|
|
|
232
|
-
export { type BuildJsonFormTokensOptions, type ControlKind, type InferSchemaOptions, type JsonFormValidationError, type JsonFormValidator, type SquisqAnnotatedSchema, type SquisqHints, type SquisqWhen, arrayItemKind, buildJsonFormTokens, chooseControl, evaluateWhen, getByPointer, inferSchema, pointerSegments, primaryType, resolveFlag, resolveJsonFormTheme, resolveRef, setByPointer, toPointer };
|
|
236
|
+
export { type BuildJsonFormTokensOptions, type ControlKind, type InferSchemaOptions, type JsonFormValidationError, type JsonFormValidator, type SquisqAnnotatedSchema, type SquisqHints, type SquisqWhen, appendPointer, arrayItemKind, buildJsonFormTokens, chooseControl, escapePointerSegment, evaluateWhen, getByPointer, inferSchema, pointerSegments, primaryType, resolveFlag, resolveJsonFormTheme, resolveRef, setByPointer, toPointer };
|
package/dist/jsonForm/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
appendPointer,
|
|
2
3
|
arrayItemKind,
|
|
3
4
|
buildJsonFormTokens,
|
|
4
5
|
chooseControl,
|
|
6
|
+
escapePointerSegment,
|
|
5
7
|
evaluateWhen,
|
|
6
8
|
getByPointer,
|
|
7
9
|
inferSchema,
|
|
@@ -12,15 +14,18 @@ import {
|
|
|
12
14
|
resolveRef,
|
|
13
15
|
setByPointer,
|
|
14
16
|
toPointer
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-QTSJOY54.js";
|
|
18
|
+
import "../chunk-LYNJEOAC.js";
|
|
19
|
+
import "../chunk-FVJUUTEM.js";
|
|
20
|
+
import "../chunk-6PJRB2CF.js";
|
|
21
|
+
import "../chunk-5J4HKRJF.js";
|
|
19
22
|
import "../chunk-QE7TWGVT.js";
|
|
20
23
|
export {
|
|
24
|
+
appendPointer,
|
|
21
25
|
arrayItemKind,
|
|
22
26
|
buildJsonFormTokens,
|
|
23
27
|
chooseControl,
|
|
28
|
+
escapePointerSegment,
|
|
24
29
|
evaluateWhen,
|
|
25
30
|
getByPointer,
|
|
26
31
|
inferSchema,
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { V as ParseOptions, m as MarkdownDocument, W as StringifyOptions, H as HeadingAttributes, d as HtmlNode, I as MarkdownNode } from '../types-
|
|
2
|
-
export { a as HeadingTemplateAnnotation, b as HtmlComment, c as HtmlElement, e as HtmlText, M as MarkdownBlockNode, f as MarkdownBlockquote, g as MarkdownBreak, h as MarkdownCodeBlock, i as MarkdownContainerDirective, j as MarkdownDefinitionDescription, k as MarkdownDefinitionList, l as MarkdownDefinitionTerm, n as MarkdownEmphasis, o as MarkdownFootnoteDefinition, p as MarkdownFootnoteReference, q as MarkdownHeading, r as MarkdownHtmlBlock, s as MarkdownImage, t as MarkdownImageReference, u as MarkdownInlineCode, v as MarkdownInlineHtml, w as MarkdownInlineMath, x as MarkdownInlineNode, y as MarkdownLeafDirective, z as MarkdownLink, A as MarkdownLinkDefinition, B as MarkdownLinkReference, C as MarkdownList, E as MarkdownListItem, F as MarkdownMathBlock, G as MarkdownMention, J as MarkdownParagraph, K as MarkdownPoint, L as MarkdownSourcePosition, N as MarkdownStrikethrough, O as MarkdownStrong, P as MarkdownTable, Q as MarkdownTableCell, R as MarkdownTableRow, S as MarkdownText, T as MarkdownTextDirective, U as MarkdownThematicBreak } from '../types-
|
|
1
|
+
import { V as ParseOptions, m as MarkdownDocument, W as StringifyOptions, H as HeadingAttributes, d as HtmlNode, I as MarkdownNode } from '../types-BwMPl2CB.js';
|
|
2
|
+
export { a as HeadingTemplateAnnotation, b as HtmlComment, c as HtmlElement, e as HtmlText, M as MarkdownBlockNode, f as MarkdownBlockquote, g as MarkdownBreak, h as MarkdownCodeBlock, i as MarkdownContainerDirective, j as MarkdownDefinitionDescription, k as MarkdownDefinitionList, l as MarkdownDefinitionTerm, n as MarkdownEmphasis, o as MarkdownFootnoteDefinition, p as MarkdownFootnoteReference, q as MarkdownHeading, r as MarkdownHtmlBlock, s as MarkdownImage, t as MarkdownImageReference, u as MarkdownInlineCode, v as MarkdownInlineHtml, w as MarkdownInlineMath, x as MarkdownInlineNode, y as MarkdownLeafDirective, z as MarkdownLink, A as MarkdownLinkDefinition, B as MarkdownLinkReference, C as MarkdownList, E as MarkdownListItem, F as MarkdownMathBlock, G as MarkdownMention, J as MarkdownParagraph, K as MarkdownPoint, L as MarkdownSourcePosition, N as MarkdownStrikethrough, O as MarkdownStrong, P as MarkdownTable, Q as MarkdownTableCell, R as MarkdownTableRow, S as MarkdownText, T as MarkdownTextDirective, U as MarkdownThematicBreak } from '../types-BwMPl2CB.js';
|
|
3
|
+
export { B as BLOCK_META_KEY_DESCRIPTORS, a as BlockMetaKeyDescriptor, K as KNOWN_BLOCK_META_KEYS, b as KnownBlockMetaKey, p as parseTimeSeconds } from '../annotationCoercion-Dr_DY9Hx.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Markdown → JSON Parser
|
|
@@ -244,73 +245,6 @@ declare function needsQuoting(value: string): boolean;
|
|
|
244
245
|
*/
|
|
245
246
|
declare function quoteAttrValue(value: string): string;
|
|
246
247
|
|
|
247
|
-
/**
|
|
248
|
-
* Heading-attribute value coercion.
|
|
249
|
-
*
|
|
250
|
-
* The Pandoc-style heading attribute block `{#id .class key=value}` parses
|
|
251
|
-
* to a flat `Record<string, string>` of `key → raw value`. This module
|
|
252
|
-
* coerces a known subset of keys to typed values (numbers, time-in-seconds,
|
|
253
|
-
* `BlockConnection[]`) so downstream consumers don't have to re-parse them.
|
|
254
|
-
*
|
|
255
|
-
* Unknown keys are returned in `metadata` as raw strings. Malformed known-key
|
|
256
|
-
* values are dropped from the typed result and reported via `warnings` (the
|
|
257
|
-
* raw string is preserved in `params` upstream for lossless round-tripping —
|
|
258
|
-
* coercion failures do not corrupt the source).
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Registry of known block-meta keys and their coercion strategies.
|
|
263
|
-
*
|
|
264
|
-
* Adding a new typed key: add an entry here, add the typed field to
|
|
265
|
-
* `HeadingAttributes.blockMeta` in `types.ts`, and apply the coerced value
|
|
266
|
-
* in `markdownToDoc.ts`.
|
|
267
|
-
*/
|
|
268
|
-
declare const KNOWN_BLOCK_META_KEYS: {
|
|
269
|
-
readonly x: "number";
|
|
270
|
-
readonly y: "number";
|
|
271
|
-
readonly startTime: "time";
|
|
272
|
-
readonly duration: "time";
|
|
273
|
-
readonly connectsTo: "connectionList";
|
|
274
|
-
readonly transition: "transition";
|
|
275
|
-
readonly transitionDuration: "time";
|
|
276
|
-
readonly transitionDirection: "transitionDirection";
|
|
277
|
-
};
|
|
278
|
-
type KnownBlockMetaKey = keyof typeof KNOWN_BLOCK_META_KEYS;
|
|
279
|
-
/**
|
|
280
|
-
* Editor-facing description of a known block-meta key: what it does, and
|
|
281
|
-
* either its closed set of valid values or a free-form format hint. This is
|
|
282
|
-
* the single source the markdown editor's `{[name key=value]}` attribute
|
|
283
|
-
* autocomplete reads from, so the suggestion list stays in lockstep with
|
|
284
|
-
* `KNOWN_BLOCK_META_KEYS` and the transition vocabulary rather than drifting
|
|
285
|
-
* in a hand-maintained copy. `values`/`valueHint` are mutually exclusive: a
|
|
286
|
-
* key has a closed enum (`values`) or a format hint (`valueHint`), not both.
|
|
287
|
-
*/
|
|
288
|
-
interface BlockMetaKeyDescriptor {
|
|
289
|
-
key: KnownBlockMetaKey;
|
|
290
|
-
/** One-line description, shown as the completion item's detail. */
|
|
291
|
-
description: string;
|
|
292
|
-
/** Closed set of valid values, for keys backed by an enum. */
|
|
293
|
-
values?: readonly string[];
|
|
294
|
-
/** Format hint shown when the value is free-form (no closed set). */
|
|
295
|
-
valueHint?: string;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Ordered descriptors for every key in `KNOWN_BLOCK_META_KEYS`. Order is the
|
|
299
|
-
* suggestion display order: the transition family first (the most common
|
|
300
|
-
* authoring case), then timeline timing, then diagram geometry/links.
|
|
301
|
-
*/
|
|
302
|
-
declare const BLOCK_META_KEY_DESCRIPTORS: readonly BlockMetaKeyDescriptor[];
|
|
303
|
-
/**
|
|
304
|
-
* Parse a time value to seconds. Accepts:
|
|
305
|
-
* - bare number: `5` → 5, `5.5` → 5.5
|
|
306
|
-
* - `mm:ss`: `01:30` → 90
|
|
307
|
-
* - `mm:ss.ms`: `01:30.500` → 90.5
|
|
308
|
-
* - `1500ms` → 1.5
|
|
309
|
-
*
|
|
310
|
-
* Returns null on malformed input.
|
|
311
|
-
*/
|
|
312
|
-
declare function parseTimeSeconds(raw: string): number | null;
|
|
313
|
-
|
|
314
248
|
/**
|
|
315
249
|
* HTML ↔ HtmlNode Conversion
|
|
316
250
|
*
|
|
@@ -442,6 +376,8 @@ declare function parseFrontmatter(yaml: string): Record<string, unknown> | null;
|
|
|
442
376
|
* blank (no trailing whitespace) so the output diffs cleanly.
|
|
443
377
|
*/
|
|
444
378
|
declare function formatBlockScalar(value: string): string;
|
|
379
|
+
/** Quote a frontmatter scalar so it round-trips cleanly through `parseFrontmatter`. */
|
|
380
|
+
declare function formatFrontmatterValue(value: string | number | boolean): string;
|
|
445
381
|
/**
|
|
446
382
|
* Update a markdown source string's YAML frontmatter block, applying the
|
|
447
383
|
* given key/value updates. A `null` or `undefined` value removes the key.
|
|
@@ -499,4 +435,4 @@ declare function readFrontmatterThemeId(frontmatter: Record<string, unknown> | u
|
|
|
499
435
|
*/
|
|
500
436
|
declare function plainTextFromInlineHtml(html: string): string;
|
|
501
437
|
|
|
502
|
-
export {
|
|
438
|
+
export { HeadingAttributes, HtmlNode, type HtmlPolicy, MarkdownDocument, MarkdownNode, ParseOptions, type SanitizeUrlOptions, StringifyOptions, type TrailingAnnotationMatch, type UrlKind, countNodes, createDocument, extractPlainText, findNodesByType, formatBlockScalar, formatFrontmatterValue, fromMdast, getChildren, inferDocumentTitle, matchTrailingPandocAttr, matchTrailingTemplateAnnotation, needsQuoting, parseFrontmatter, parseHtmlToNodes, parseMarkdown, parsePandocAttrTokens, plainTextFromInlineHtml, quoteAttrValue, readFrontmatterThemeId, sanitizeHtmlNodes, sanitizeUrl, serializePandocAttributes, setFrontmatterValues, splitKeyValueToken, stringifyHtmlNodes, stringifyMarkdown, toMdast, tokenizeAttrTokens, unquoteAttrValue, walkMarkdownTree };
|
package/dist/markdown/index.js
CHANGED
|
@@ -2,30 +2,34 @@ import {
|
|
|
2
2
|
sanitizeHtmlNodes,
|
|
3
3
|
sanitizeUrl,
|
|
4
4
|
stringifyMarkdown
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-R2GC6RLD.js";
|
|
6
|
+
import {
|
|
7
|
+
fromMdast,
|
|
8
|
+
parseMarkdown,
|
|
9
|
+
parsePandocAttrTokens,
|
|
10
|
+
serializePandocAttributes,
|
|
11
|
+
toMdast
|
|
12
|
+
} from "../chunk-66QO7XFB.js";
|
|
6
13
|
import {
|
|
7
14
|
BLOCK_META_KEY_DESCRIPTORS,
|
|
8
15
|
KNOWN_BLOCK_META_KEYS,
|
|
9
|
-
fromMdast,
|
|
10
16
|
matchTrailingPandocAttr,
|
|
11
17
|
matchTrailingTemplateAnnotation,
|
|
12
18
|
needsQuoting,
|
|
13
|
-
parseMarkdown,
|
|
14
|
-
parsePandocAttrTokens,
|
|
15
19
|
parseTimeSeconds,
|
|
16
20
|
quoteAttrValue,
|
|
17
|
-
serializePandocAttributes,
|
|
18
21
|
splitKeyValueToken,
|
|
19
|
-
toMdast,
|
|
20
22
|
tokenizeAttrTokens,
|
|
21
23
|
unquoteAttrValue
|
|
22
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-R2YZTCLO.js";
|
|
25
|
+
import "../chunk-DBS6RIFL.js";
|
|
23
26
|
import {
|
|
24
27
|
countNodes,
|
|
25
28
|
createDocument,
|
|
26
29
|
extractPlainText,
|
|
27
30
|
findNodesByType,
|
|
28
31
|
formatBlockScalar,
|
|
32
|
+
formatFrontmatterValue,
|
|
29
33
|
getChildren,
|
|
30
34
|
inferDocumentTitle,
|
|
31
35
|
parseFrontmatter,
|
|
@@ -35,8 +39,7 @@ import {
|
|
|
35
39
|
setFrontmatterValues,
|
|
36
40
|
stringifyHtmlNodes,
|
|
37
41
|
walkMarkdownTree
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-DBS6RIFL.js";
|
|
42
|
+
} from "../chunk-AMIR72JP.js";
|
|
40
43
|
import "../chunk-QE7TWGVT.js";
|
|
41
44
|
export {
|
|
42
45
|
BLOCK_META_KEY_DESCRIPTORS,
|
|
@@ -46,6 +49,7 @@ export {
|
|
|
46
49
|
extractPlainText,
|
|
47
50
|
findNodesByType,
|
|
48
51
|
formatBlockScalar,
|
|
52
|
+
formatFrontmatterValue,
|
|
49
53
|
fromMdast,
|
|
50
54
|
getChildren,
|
|
51
55
|
inferDocumentTitle,
|