@owomark/core 0.1.6 → 0.1.7
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 +30 -10
- package/dist/.build-manifest.json +130 -0
- package/dist/browser.d.ts +66 -0
- package/dist/browser.js +396 -0
- package/dist/chunk-3KTK7CSS.js +82 -0
- package/dist/chunk-5JNL3LHV.js +215 -0
- package/dist/chunk-ASRCHEFF.js +0 -0
- package/dist/chunk-BKJCBEI7.js +397 -0
- package/dist/chunk-CJSBFWKS.js +549 -0
- package/dist/chunk-GA5EFGSZ.js +5820 -0
- package/dist/chunk-OOH46GIF.js +95 -0
- package/dist/chunk-ROJILHRQ.js +192 -0
- package/dist/chunk-WFPUIPWU.js +34 -0
- package/dist/chunk-WXVKSKP3.js +191 -0
- package/dist/chunk-YZYJIXGO.js +0 -0
- package/dist/editor-core-DbPhn6aI.d.ts +249 -0
- package/dist/index.d.ts +77 -87
- package/dist/index.js +127 -248
- package/dist/internal/dom-adapter.d.ts +37 -1
- package/dist/internal/dom-adapter.js +9 -2
- package/dist/public-zMo7BR9l.d.ts +469 -0
- package/dist/registry-C849sxCo.d.ts +74 -0
- package/dist/semantic/components/index.d.ts +9 -0
- package/dist/semantic/components/index.js +11 -0
- package/dist/semantic/editor/index.d.ts +9 -0
- package/dist/semantic/editor/index.js +13 -0
- package/dist/semantic/index.d.ts +7 -0
- package/dist/semantic/index.js +106 -0
- package/dist/semantic/runtime/index.d.ts +9 -0
- package/dist/semantic/runtime/index.js +13 -0
- package/dist/semantic/shared/index.d.ts +10 -0
- package/dist/semantic/shared/index.js +17 -0
- package/dist/semantic/syntax/index.d.ts +151 -0
- package/dist/semantic/syntax/index.js +63 -0
- package/dist/types-DMqYF6Zn.d.ts +83 -0
- package/package.json +29 -1
- package/dist/chunk-6CBUAORJ.js +0 -3337
- package/dist/dom-adapter-C8wuoffZ.d.ts +0 -471
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import "../chunk-YZYJIXGO.js";
|
|
2
|
+
import "../chunk-ASRCHEFF.js";
|
|
3
|
+
import {
|
|
4
|
+
getRuntimeBlockDescriptor,
|
|
5
|
+
getRuntimeBlockDescriptorByBlockType,
|
|
6
|
+
getRuntimeBlockDescriptorByPreviewKind,
|
|
7
|
+
runtimeBlockRegistry
|
|
8
|
+
} from "../chunk-ROJILHRQ.js";
|
|
9
|
+
import {
|
|
10
|
+
MATH_FENCE_RE,
|
|
11
|
+
MULTI_LINE_MATH_BLOCK_CLOSE_RE,
|
|
12
|
+
MULTI_LINE_MATH_BLOCK_OPEN_RE,
|
|
13
|
+
SIDE_ANNOTATION_RENDERER_KEY_BY_TYPE,
|
|
14
|
+
SIDE_ANNOTATION_SYMBOL_BY_KEYWORD,
|
|
15
|
+
SIDE_ANNOTATION_TAIL_RE,
|
|
16
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS,
|
|
17
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS_SORTED,
|
|
18
|
+
SIDE_ANNOTATION_TYPE_TABLE,
|
|
19
|
+
SIDE_CONTINUATION_TAIL_RE,
|
|
20
|
+
SIDE_NOTE_DEFINITION_RE,
|
|
21
|
+
SIDE_NOTE_REF_RE,
|
|
22
|
+
SINGLE_LINE_MATH_BLOCK_RE,
|
|
23
|
+
collectMathFenceNormalizationRewrites,
|
|
24
|
+
getSyntaxDescriptor,
|
|
25
|
+
isFenceOnlyMathLine,
|
|
26
|
+
isMultiLineMathBlockClose,
|
|
27
|
+
isMultiLineMathBlockOpen,
|
|
28
|
+
isSingleLineMathBlock,
|
|
29
|
+
mathSyntaxDescriptor,
|
|
30
|
+
parseInlineSideAnnotationFromText,
|
|
31
|
+
parseInlineSideAnnotationText,
|
|
32
|
+
parseSideDirectiveLabel,
|
|
33
|
+
parseSideNoteDefinitionRaw,
|
|
34
|
+
sideAnnotationSyntaxDescriptors,
|
|
35
|
+
sideAnnotationTypeDescriptors,
|
|
36
|
+
stripInlineSideAnnotationTail,
|
|
37
|
+
stripSideContinuationTail,
|
|
38
|
+
syntaxRegistry
|
|
39
|
+
} from "../chunk-BKJCBEI7.js";
|
|
40
|
+
import {
|
|
41
|
+
componentRegistry,
|
|
42
|
+
getComponentDescriptor,
|
|
43
|
+
getComponentDescriptorByDirective
|
|
44
|
+
} from "../chunk-WXVKSKP3.js";
|
|
45
|
+
import {
|
|
46
|
+
editorEntryRegistry,
|
|
47
|
+
getEditorEntryDescriptor,
|
|
48
|
+
getEditorEntryDescriptorByCommandId,
|
|
49
|
+
resolveEditorEntryPresentation
|
|
50
|
+
} from "../chunk-3KTK7CSS.js";
|
|
51
|
+
import {
|
|
52
|
+
createDescriptorRegistry,
|
|
53
|
+
requireDescriptor,
|
|
54
|
+
validateComponentDescriptors,
|
|
55
|
+
validateEditorEntryDescriptors,
|
|
56
|
+
validateRuntimeDescriptors,
|
|
57
|
+
validateSyntaxDescriptors
|
|
58
|
+
} from "../chunk-OOH46GIF.js";
|
|
59
|
+
export {
|
|
60
|
+
MATH_FENCE_RE,
|
|
61
|
+
MULTI_LINE_MATH_BLOCK_CLOSE_RE,
|
|
62
|
+
MULTI_LINE_MATH_BLOCK_OPEN_RE,
|
|
63
|
+
SIDE_ANNOTATION_RENDERER_KEY_BY_TYPE,
|
|
64
|
+
SIDE_ANNOTATION_SYMBOL_BY_KEYWORD,
|
|
65
|
+
SIDE_ANNOTATION_TAIL_RE,
|
|
66
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS,
|
|
67
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS_SORTED,
|
|
68
|
+
SIDE_ANNOTATION_TYPE_TABLE,
|
|
69
|
+
SIDE_CONTINUATION_TAIL_RE,
|
|
70
|
+
SIDE_NOTE_DEFINITION_RE,
|
|
71
|
+
SIDE_NOTE_REF_RE,
|
|
72
|
+
SINGLE_LINE_MATH_BLOCK_RE,
|
|
73
|
+
collectMathFenceNormalizationRewrites,
|
|
74
|
+
componentRegistry,
|
|
75
|
+
createDescriptorRegistry,
|
|
76
|
+
editorEntryRegistry,
|
|
77
|
+
getComponentDescriptor,
|
|
78
|
+
getComponentDescriptorByDirective,
|
|
79
|
+
getEditorEntryDescriptor,
|
|
80
|
+
getEditorEntryDescriptorByCommandId,
|
|
81
|
+
getRuntimeBlockDescriptor,
|
|
82
|
+
getRuntimeBlockDescriptorByBlockType,
|
|
83
|
+
getRuntimeBlockDescriptorByPreviewKind,
|
|
84
|
+
getSyntaxDescriptor,
|
|
85
|
+
isFenceOnlyMathLine,
|
|
86
|
+
isMultiLineMathBlockClose,
|
|
87
|
+
isMultiLineMathBlockOpen,
|
|
88
|
+
isSingleLineMathBlock,
|
|
89
|
+
mathSyntaxDescriptor,
|
|
90
|
+
parseInlineSideAnnotationFromText,
|
|
91
|
+
parseInlineSideAnnotationText,
|
|
92
|
+
parseSideDirectiveLabel,
|
|
93
|
+
parseSideNoteDefinitionRaw,
|
|
94
|
+
requireDescriptor,
|
|
95
|
+
resolveEditorEntryPresentation,
|
|
96
|
+
runtimeBlockRegistry,
|
|
97
|
+
sideAnnotationSyntaxDescriptors,
|
|
98
|
+
sideAnnotationTypeDescriptors,
|
|
99
|
+
stripInlineSideAnnotationTail,
|
|
100
|
+
stripSideContinuationTail,
|
|
101
|
+
syntaxRegistry,
|
|
102
|
+
validateComponentDescriptors,
|
|
103
|
+
validateEditorEntryDescriptors,
|
|
104
|
+
validateRuntimeDescriptors,
|
|
105
|
+
validateSyntaxDescriptors
|
|
106
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { g as OwoRuntimeBlockDescriptor, c as OwoDescriptorRegistry } from '../../registry-C849sxCo.js';
|
|
2
|
+
import '../../public-zMo7BR9l.js';
|
|
3
|
+
|
|
4
|
+
declare const runtimeBlockRegistry: OwoDescriptorRegistry<OwoRuntimeBlockDescriptor>;
|
|
5
|
+
declare function getRuntimeBlockDescriptor(key: string): OwoRuntimeBlockDescriptor;
|
|
6
|
+
declare function getRuntimeBlockDescriptorByBlockType(blockType: string): OwoRuntimeBlockDescriptor | undefined;
|
|
7
|
+
declare function getRuntimeBlockDescriptorByPreviewKind(previewKind: string): OwoRuntimeBlockDescriptor | undefined;
|
|
8
|
+
|
|
9
|
+
export { getRuntimeBlockDescriptor, getRuntimeBlockDescriptorByBlockType, getRuntimeBlockDescriptorByPreviewKind, runtimeBlockRegistry };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getRuntimeBlockDescriptor,
|
|
3
|
+
getRuntimeBlockDescriptorByBlockType,
|
|
4
|
+
getRuntimeBlockDescriptorByPreviewKind,
|
|
5
|
+
runtimeBlockRegistry
|
|
6
|
+
} from "../../chunk-ROJILHRQ.js";
|
|
7
|
+
import "../../chunk-OOH46GIF.js";
|
|
8
|
+
export {
|
|
9
|
+
getRuntimeBlockDescriptor,
|
|
10
|
+
getRuntimeBlockDescriptorByBlockType,
|
|
11
|
+
getRuntimeBlockDescriptorByPreviewKind,
|
|
12
|
+
runtimeBlockRegistry
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { O as OwoComponentDescriptor, d as OwoEditorEntryDescriptor, g as OwoRuntimeBlockDescriptor, h as OwoSyntaxDescriptor } from '../../registry-C849sxCo.js';
|
|
2
|
+
export { a as OwoComponentKind, b as OwoComponentPayloadStrategy, c as OwoDescriptorRegistry, e as OwoEditorEntryPresentation, f as OwoFeatureFlagKey, i as createDescriptorRegistry, r as requireDescriptor } from '../../registry-C849sxCo.js';
|
|
3
|
+
import '../../public-zMo7BR9l.js';
|
|
4
|
+
|
|
5
|
+
declare function validateSyntaxDescriptors(descriptors: readonly OwoSyntaxDescriptor[]): void;
|
|
6
|
+
declare function validateComponentDescriptors(descriptors: readonly OwoComponentDescriptor[]): void;
|
|
7
|
+
declare function validateRuntimeDescriptors(descriptors: readonly OwoRuntimeBlockDescriptor[]): void;
|
|
8
|
+
declare function validateEditorEntryDescriptors(descriptors: readonly OwoEditorEntryDescriptor[]): void;
|
|
9
|
+
|
|
10
|
+
export { OwoComponentDescriptor, OwoEditorEntryDescriptor, OwoRuntimeBlockDescriptor, OwoSyntaxDescriptor, validateComponentDescriptors, validateEditorEntryDescriptors, validateRuntimeDescriptors, validateSyntaxDescriptors };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../../chunk-ASRCHEFF.js";
|
|
2
|
+
import {
|
|
3
|
+
createDescriptorRegistry,
|
|
4
|
+
requireDescriptor,
|
|
5
|
+
validateComponentDescriptors,
|
|
6
|
+
validateEditorEntryDescriptors,
|
|
7
|
+
validateRuntimeDescriptors,
|
|
8
|
+
validateSyntaxDescriptors
|
|
9
|
+
} from "../../chunk-OOH46GIF.js";
|
|
10
|
+
export {
|
|
11
|
+
createDescriptorRegistry,
|
|
12
|
+
requireDescriptor,
|
|
13
|
+
validateComponentDescriptors,
|
|
14
|
+
validateEditorEntryDescriptors,
|
|
15
|
+
validateRuntimeDescriptors,
|
|
16
|
+
validateSyntaxDescriptors
|
|
17
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { h as OwoSyntaxDescriptor, c as OwoDescriptorRegistry } from '../../registry-C849sxCo.js';
|
|
2
|
+
import '../../public-zMo7BR9l.js';
|
|
3
|
+
|
|
4
|
+
/** Fence-only display math line, e.g. `$$`. */
|
|
5
|
+
declare const MATH_FENCE_RE: RegExp;
|
|
6
|
+
/** Standalone single-line display math, e.g. `$$x^2$$`. */
|
|
7
|
+
declare const SINGLE_LINE_MATH_BLOCK_RE: RegExp;
|
|
8
|
+
/** Opening line for a multi-line display math block, e.g. `$$x=`. */
|
|
9
|
+
declare const MULTI_LINE_MATH_BLOCK_OPEN_RE: RegExp;
|
|
10
|
+
/** Closing line for a multi-line display math block, e.g. `x$$` or `$$`. */
|
|
11
|
+
declare const MULTI_LINE_MATH_BLOCK_CLOSE_RE: RegExp;
|
|
12
|
+
type MathFenceNormalizationLineMapping = {
|
|
13
|
+
sourceLine: number;
|
|
14
|
+
sourceColumn: number;
|
|
15
|
+
};
|
|
16
|
+
type MathFenceNormalizationRewrite = {
|
|
17
|
+
kind: 'math-fence';
|
|
18
|
+
startLine: number;
|
|
19
|
+
endLine: number;
|
|
20
|
+
replacementLines: string[];
|
|
21
|
+
lineMappings: MathFenceNormalizationLineMapping[];
|
|
22
|
+
};
|
|
23
|
+
declare const mathSyntaxDescriptor: OwoSyntaxDescriptor;
|
|
24
|
+
declare function isFenceOnlyMathLine(line: string): boolean;
|
|
25
|
+
declare function isSingleLineMathBlock(line: string): boolean;
|
|
26
|
+
declare function isMultiLineMathBlockOpen(line: string): boolean;
|
|
27
|
+
declare function isMultiLineMathBlockClose(line: string): boolean;
|
|
28
|
+
declare function collectMathFenceNormalizationRewrites(source: string): MathFenceNormalizationRewrite[];
|
|
29
|
+
|
|
30
|
+
declare const sideAnnotationTypeDescriptors: readonly [{
|
|
31
|
+
readonly symbol: ":";
|
|
32
|
+
readonly keyword: "plain";
|
|
33
|
+
readonly rendererKey: "plain";
|
|
34
|
+
}, {
|
|
35
|
+
readonly symbol: "}";
|
|
36
|
+
readonly keyword: "brace";
|
|
37
|
+
readonly rendererKey: "brace";
|
|
38
|
+
}, {
|
|
39
|
+
readonly symbol: "{";
|
|
40
|
+
readonly keyword: "left-brace";
|
|
41
|
+
readonly rendererKey: "left-brace";
|
|
42
|
+
}, {
|
|
43
|
+
readonly symbol: "]";
|
|
44
|
+
readonly keyword: "bracket";
|
|
45
|
+
readonly rendererKey: "bracket";
|
|
46
|
+
}, {
|
|
47
|
+
readonly symbol: "[";
|
|
48
|
+
readonly keyword: "left-bracket";
|
|
49
|
+
readonly rendererKey: "left-bracket";
|
|
50
|
+
}, {
|
|
51
|
+
readonly symbol: "|";
|
|
52
|
+
readonly keyword: "line";
|
|
53
|
+
readonly rendererKey: "line";
|
|
54
|
+
}, {
|
|
55
|
+
readonly symbol: "-";
|
|
56
|
+
readonly keyword: "dash";
|
|
57
|
+
readonly rendererKey: "dash";
|
|
58
|
+
}, {
|
|
59
|
+
readonly symbol: "->";
|
|
60
|
+
readonly keyword: "arrow";
|
|
61
|
+
readonly rendererKey: "arrow";
|
|
62
|
+
}, {
|
|
63
|
+
readonly symbol: "=>";
|
|
64
|
+
readonly keyword: "fat-arrow";
|
|
65
|
+
readonly rendererKey: "fat-arrow";
|
|
66
|
+
}, {
|
|
67
|
+
readonly symbol: "~>";
|
|
68
|
+
readonly keyword: "wave-arrow";
|
|
69
|
+
readonly rendererKey: "wave-arrow";
|
|
70
|
+
}, {
|
|
71
|
+
readonly symbol: "!";
|
|
72
|
+
readonly keyword: "warning";
|
|
73
|
+
readonly rendererKey: "line";
|
|
74
|
+
}, {
|
|
75
|
+
readonly symbol: "?";
|
|
76
|
+
readonly keyword: "question";
|
|
77
|
+
readonly rendererKey: "line";
|
|
78
|
+
}, {
|
|
79
|
+
readonly symbol: "}->";
|
|
80
|
+
readonly keyword: "brace-arrow";
|
|
81
|
+
readonly rendererKey: "brace-arrow";
|
|
82
|
+
}, {
|
|
83
|
+
readonly symbol: "}=>";
|
|
84
|
+
readonly keyword: "brace-fat-arrow";
|
|
85
|
+
readonly rendererKey: "brace-fat-arrow";
|
|
86
|
+
}, {
|
|
87
|
+
readonly symbol: "]->";
|
|
88
|
+
readonly keyword: "bracket-arrow";
|
|
89
|
+
readonly rendererKey: "bracket-arrow";
|
|
90
|
+
}, {
|
|
91
|
+
readonly symbol: "]=>";
|
|
92
|
+
readonly keyword: "bracket-fat-arrow";
|
|
93
|
+
readonly rendererKey: "bracket-fat-arrow";
|
|
94
|
+
}, {
|
|
95
|
+
readonly symbol: "|->";
|
|
96
|
+
readonly keyword: "line-arrow";
|
|
97
|
+
readonly rendererKey: "line-arrow";
|
|
98
|
+
}, {
|
|
99
|
+
readonly symbol: "|=>";
|
|
100
|
+
readonly keyword: "line-fat-arrow";
|
|
101
|
+
readonly rendererKey: "line-fat-arrow";
|
|
102
|
+
}, {
|
|
103
|
+
readonly symbol: "}!";
|
|
104
|
+
readonly keyword: "brace-warning";
|
|
105
|
+
readonly rendererKey: "brace";
|
|
106
|
+
}, {
|
|
107
|
+
readonly symbol: "}?";
|
|
108
|
+
readonly keyword: "brace-question";
|
|
109
|
+
readonly rendererKey: "brace";
|
|
110
|
+
}];
|
|
111
|
+
type SideAnnotationTypeDescriptor = typeof sideAnnotationTypeDescriptors[number];
|
|
112
|
+
type SideAnnotationTypeSymbol = SideAnnotationTypeDescriptor['symbol'];
|
|
113
|
+
type SideAnnotationType = SideAnnotationTypeDescriptor['keyword'];
|
|
114
|
+
declare const SIDE_ANNOTATION_TYPE_TABLE: Readonly<Record<":" | "}" | "{" | "]" | "[" | "|" | "-" | "->" | "=>" | "~>" | "!" | "?" | "}->" | "}=>" | "]->" | "]=>" | "|->" | "|=>" | "}!" | "}?", "warning" | "plain" | "brace" | "left-brace" | "bracket" | "left-bracket" | "line" | "dash" | "arrow" | "fat-arrow" | "wave-arrow" | "question" | "brace-arrow" | "brace-fat-arrow" | "bracket-arrow" | "bracket-fat-arrow" | "line-arrow" | "line-fat-arrow" | "brace-warning" | "brace-question">>;
|
|
115
|
+
declare const SIDE_ANNOTATION_TYPE_SYMBOLS: SideAnnotationTypeSymbol[];
|
|
116
|
+
declare const SIDE_ANNOTATION_TYPE_SYMBOLS_SORTED: (":" | "}" | "{" | "]" | "[" | "|" | "-" | "->" | "=>" | "~>" | "!" | "?" | "}->" | "}=>" | "]->" | "]=>" | "|->" | "|=>" | "}!" | "}?")[];
|
|
117
|
+
declare const SIDE_ANNOTATION_SYMBOL_BY_KEYWORD: Readonly<Record<"warning" | "plain" | "brace" | "left-brace" | "bracket" | "left-bracket" | "line" | "dash" | "arrow" | "fat-arrow" | "wave-arrow" | "question" | "brace-arrow" | "brace-fat-arrow" | "bracket-arrow" | "bracket-fat-arrow" | "line-arrow" | "line-fat-arrow" | "brace-warning" | "brace-question", ":" | "}" | "{" | "]" | "[" | "|" | "-" | "->" | "=>" | "~>" | "!" | "?" | "}->" | "}=>" | "]->" | "]=>" | "|->" | "|=>" | "}!" | "}?">>;
|
|
118
|
+
declare const SIDE_ANNOTATION_RENDERER_KEY_BY_TYPE: Readonly<Record<"warning" | "plain" | "brace" | "left-brace" | "bracket" | "left-bracket" | "line" | "dash" | "arrow" | "fat-arrow" | "wave-arrow" | "question" | "brace-arrow" | "brace-fat-arrow" | "bracket-arrow" | "bracket-fat-arrow" | "line-arrow" | "line-fat-arrow" | "brace-warning" | "brace-question", string>>;
|
|
119
|
+
declare const sideAnnotationSyntaxDescriptors: readonly OwoSyntaxDescriptor[];
|
|
120
|
+
/** Matches line ending with (>type text) — a side annotation head. */
|
|
121
|
+
declare const SIDE_ANNOTATION_TAIL_RE: RegExp;
|
|
122
|
+
/** Matches line ending with (>+) — a continuation marker. */
|
|
123
|
+
declare const SIDE_CONTINUATION_TAIL_RE: RegExp;
|
|
124
|
+
/** Matches [>id] note references used by :::side [>id]. */
|
|
125
|
+
declare const SIDE_NOTE_REF_RE: RegExp;
|
|
126
|
+
/** Matches [>id]: {type=...} side note definitions. */
|
|
127
|
+
declare const SIDE_NOTE_DEFINITION_RE: RegExp;
|
|
128
|
+
type ParsedInlineSideAnnotation = {
|
|
129
|
+
sideType: SideAnnotationType;
|
|
130
|
+
sideTypeSymbol: SideAnnotationTypeSymbol;
|
|
131
|
+
content: string;
|
|
132
|
+
};
|
|
133
|
+
type ParsedSideNoteDefinition = {
|
|
134
|
+
identifier: string;
|
|
135
|
+
sideType: SideAnnotationType;
|
|
136
|
+
sideTypeSymbol: SideAnnotationTypeSymbol;
|
|
137
|
+
content: string;
|
|
138
|
+
};
|
|
139
|
+
declare function parseInlineSideAnnotationText(inner: string): ParsedInlineSideAnnotation | null;
|
|
140
|
+
declare function parseInlineSideAnnotationFromText(text: string): ParsedInlineSideAnnotation | null;
|
|
141
|
+
declare function stripInlineSideAnnotationTail(text: string): string;
|
|
142
|
+
declare function stripSideContinuationTail(text: string): string;
|
|
143
|
+
declare function parseSideDirectiveLabel(label: string): {
|
|
144
|
+
noteRef: string;
|
|
145
|
+
} | ParsedInlineSideAnnotation | null;
|
|
146
|
+
declare function parseSideNoteDefinitionRaw(raw: string): ParsedSideNoteDefinition | null;
|
|
147
|
+
|
|
148
|
+
declare const syntaxRegistry: OwoDescriptorRegistry<OwoSyntaxDescriptor>;
|
|
149
|
+
declare function getSyntaxDescriptor(key: string): OwoSyntaxDescriptor;
|
|
150
|
+
|
|
151
|
+
export { MATH_FENCE_RE, MULTI_LINE_MATH_BLOCK_CLOSE_RE, MULTI_LINE_MATH_BLOCK_OPEN_RE, type MathFenceNormalizationLineMapping, type MathFenceNormalizationRewrite, SIDE_ANNOTATION_RENDERER_KEY_BY_TYPE, SIDE_ANNOTATION_SYMBOL_BY_KEYWORD, SIDE_ANNOTATION_TAIL_RE, SIDE_ANNOTATION_TYPE_SYMBOLS, SIDE_ANNOTATION_TYPE_SYMBOLS_SORTED, SIDE_ANNOTATION_TYPE_TABLE, SIDE_CONTINUATION_TAIL_RE, SIDE_NOTE_DEFINITION_RE, SIDE_NOTE_REF_RE, SINGLE_LINE_MATH_BLOCK_RE, type SideAnnotationType, type SideAnnotationTypeDescriptor, type SideAnnotationTypeSymbol, collectMathFenceNormalizationRewrites, getSyntaxDescriptor, isFenceOnlyMathLine, isMultiLineMathBlockClose, isMultiLineMathBlockOpen, isSingleLineMathBlock, mathSyntaxDescriptor, parseInlineSideAnnotationFromText, parseInlineSideAnnotationText, parseSideDirectiveLabel, parseSideNoteDefinitionRaw, sideAnnotationSyntaxDescriptors, sideAnnotationTypeDescriptors, stripInlineSideAnnotationTail, stripSideContinuationTail, syntaxRegistry };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MATH_FENCE_RE,
|
|
3
|
+
MULTI_LINE_MATH_BLOCK_CLOSE_RE,
|
|
4
|
+
MULTI_LINE_MATH_BLOCK_OPEN_RE,
|
|
5
|
+
SIDE_ANNOTATION_RENDERER_KEY_BY_TYPE,
|
|
6
|
+
SIDE_ANNOTATION_SYMBOL_BY_KEYWORD,
|
|
7
|
+
SIDE_ANNOTATION_TAIL_RE,
|
|
8
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS,
|
|
9
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS_SORTED,
|
|
10
|
+
SIDE_ANNOTATION_TYPE_TABLE,
|
|
11
|
+
SIDE_CONTINUATION_TAIL_RE,
|
|
12
|
+
SIDE_NOTE_DEFINITION_RE,
|
|
13
|
+
SIDE_NOTE_REF_RE,
|
|
14
|
+
SINGLE_LINE_MATH_BLOCK_RE,
|
|
15
|
+
collectMathFenceNormalizationRewrites,
|
|
16
|
+
getSyntaxDescriptor,
|
|
17
|
+
isFenceOnlyMathLine,
|
|
18
|
+
isMultiLineMathBlockClose,
|
|
19
|
+
isMultiLineMathBlockOpen,
|
|
20
|
+
isSingleLineMathBlock,
|
|
21
|
+
mathSyntaxDescriptor,
|
|
22
|
+
parseInlineSideAnnotationFromText,
|
|
23
|
+
parseInlineSideAnnotationText,
|
|
24
|
+
parseSideDirectiveLabel,
|
|
25
|
+
parseSideNoteDefinitionRaw,
|
|
26
|
+
sideAnnotationSyntaxDescriptors,
|
|
27
|
+
sideAnnotationTypeDescriptors,
|
|
28
|
+
stripInlineSideAnnotationTail,
|
|
29
|
+
stripSideContinuationTail,
|
|
30
|
+
syntaxRegistry
|
|
31
|
+
} from "../../chunk-BKJCBEI7.js";
|
|
32
|
+
import "../../chunk-OOH46GIF.js";
|
|
33
|
+
export {
|
|
34
|
+
MATH_FENCE_RE,
|
|
35
|
+
MULTI_LINE_MATH_BLOCK_CLOSE_RE,
|
|
36
|
+
MULTI_LINE_MATH_BLOCK_OPEN_RE,
|
|
37
|
+
SIDE_ANNOTATION_RENDERER_KEY_BY_TYPE,
|
|
38
|
+
SIDE_ANNOTATION_SYMBOL_BY_KEYWORD,
|
|
39
|
+
SIDE_ANNOTATION_TAIL_RE,
|
|
40
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS,
|
|
41
|
+
SIDE_ANNOTATION_TYPE_SYMBOLS_SORTED,
|
|
42
|
+
SIDE_ANNOTATION_TYPE_TABLE,
|
|
43
|
+
SIDE_CONTINUATION_TAIL_RE,
|
|
44
|
+
SIDE_NOTE_DEFINITION_RE,
|
|
45
|
+
SIDE_NOTE_REF_RE,
|
|
46
|
+
SINGLE_LINE_MATH_BLOCK_RE,
|
|
47
|
+
collectMathFenceNormalizationRewrites,
|
|
48
|
+
getSyntaxDescriptor,
|
|
49
|
+
isFenceOnlyMathLine,
|
|
50
|
+
isMultiLineMathBlockClose,
|
|
51
|
+
isMultiLineMathBlockOpen,
|
|
52
|
+
isSingleLineMathBlock,
|
|
53
|
+
mathSyntaxDescriptor,
|
|
54
|
+
parseInlineSideAnnotationFromText,
|
|
55
|
+
parseInlineSideAnnotationText,
|
|
56
|
+
parseSideDirectiveLabel,
|
|
57
|
+
parseSideNoteDefinitionRaw,
|
|
58
|
+
sideAnnotationSyntaxDescriptors,
|
|
59
|
+
sideAnnotationTypeDescriptors,
|
|
60
|
+
stripInlineSideAnnotationTail,
|
|
61
|
+
stripSideContinuationTail,
|
|
62
|
+
syntaxRegistry
|
|
63
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { P as PreviewBlockKind } from './public-zMo7BR9l.js';
|
|
2
|
+
|
|
3
|
+
type ContentId = string;
|
|
4
|
+
type SourceKey = string;
|
|
5
|
+
type Geometry = {
|
|
6
|
+
top: number;
|
|
7
|
+
bottom: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
type ScrollProjectionSegmentKind = PreviewBlockKind;
|
|
11
|
+
type OwoMarkScrollProjectionSegment = {
|
|
12
|
+
contentId: ContentId;
|
|
13
|
+
sourceKey: SourceKey;
|
|
14
|
+
startLine: number;
|
|
15
|
+
endLine: number;
|
|
16
|
+
kind: ScrollProjectionSegmentKind;
|
|
17
|
+
estimatedExtent?: number;
|
|
18
|
+
};
|
|
19
|
+
type OwoMarkScrollProjectionSnapshot = {
|
|
20
|
+
documentRevision: number;
|
|
21
|
+
projectionRevision: number;
|
|
22
|
+
segments: OwoMarkScrollProjectionSegment[];
|
|
23
|
+
};
|
|
24
|
+
type OwoMarkScrollDegradedReason = 'segment-not-mounted-yet' | 'async-layout-pending' | 'host-custom-block-without-source-range' | 'projection-mismatch';
|
|
25
|
+
type OwoMarkSurfaceGeometrySegment = {
|
|
26
|
+
sourceKey: SourceKey;
|
|
27
|
+
top: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
height: number;
|
|
30
|
+
measured: boolean;
|
|
31
|
+
collapsed?: boolean;
|
|
32
|
+
degradedReason?: OwoMarkScrollDegradedReason;
|
|
33
|
+
};
|
|
34
|
+
type OwoMarkSurfaceGeometrySnapshotStatus = 'ready' | 'partial' | 'pending' | 'stale';
|
|
35
|
+
type ScrollSurface = 'editor' | 'preview';
|
|
36
|
+
type OwoMarkSurfaceGeometrySnapshot = {
|
|
37
|
+
documentRevision: number;
|
|
38
|
+
projectionRevision: number;
|
|
39
|
+
geometryRevision: number;
|
|
40
|
+
surface: ScrollSurface;
|
|
41
|
+
status: OwoMarkSurfaceGeometrySnapshotStatus;
|
|
42
|
+
segments: OwoMarkSurfaceGeometrySegment[];
|
|
43
|
+
};
|
|
44
|
+
type GlobalScrollPosition = {
|
|
45
|
+
documentRevision: number;
|
|
46
|
+
projectionRevision: number;
|
|
47
|
+
sourceKey: SourceKey;
|
|
48
|
+
blockProgress: number;
|
|
49
|
+
};
|
|
50
|
+
type ViewportMetrics = {
|
|
51
|
+
scrollTop: number;
|
|
52
|
+
clientHeight: number;
|
|
53
|
+
scrollHeight: number;
|
|
54
|
+
};
|
|
55
|
+
type ScrollToScrollPositionOptions = {
|
|
56
|
+
blockAlign?: 'start' | 'center' | 'end';
|
|
57
|
+
offsetTop?: number;
|
|
58
|
+
behavior?: 'auto' | 'smooth';
|
|
59
|
+
};
|
|
60
|
+
type ScrollResolutionResult = {
|
|
61
|
+
ok: true;
|
|
62
|
+
scrollTop: number;
|
|
63
|
+
precision: 'exact' | 'provisional';
|
|
64
|
+
} | {
|
|
65
|
+
ok: false;
|
|
66
|
+
reason: 'surface-not-bound' | 'target-geometry-pending' | 'document-revision-mismatch' | 'projection-revision-mismatch' | 'source-key-not-found';
|
|
67
|
+
};
|
|
68
|
+
type ScrollToScrollPositionResult = ScrollResolutionResult;
|
|
69
|
+
type OwoMarkScrollController = {
|
|
70
|
+
getScrollProjectionSnapshot(): OwoMarkScrollProjectionSnapshot;
|
|
71
|
+
subscribeScrollProjectionSnapshot(listener: (snapshot: OwoMarkScrollProjectionSnapshot) => void): () => void;
|
|
72
|
+
getSurfaceGeometrySnapshot(surface: ScrollSurface): OwoMarkSurfaceGeometrySnapshot | null;
|
|
73
|
+
subscribeSurfaceGeometrySnapshot(surface: ScrollSurface, listener: (snapshot: OwoMarkSurfaceGeometrySnapshot) => void): () => void;
|
|
74
|
+
scrollToScrollPosition(surface: ScrollSurface, position: GlobalScrollPosition, options?: ScrollToScrollPositionOptions): ScrollToScrollPositionResult;
|
|
75
|
+
bindSurface(surface: ScrollSurface, root: HTMLElement): void;
|
|
76
|
+
unbindSurface(surface: ScrollSurface, root?: HTMLElement | null): void;
|
|
77
|
+
measureSurface(surface: ScrollSurface): OwoMarkSurfaceGeometrySnapshot | null;
|
|
78
|
+
invalidateGeometry(surface: ScrollSurface): void;
|
|
79
|
+
resolveScrollPosition(surface: ScrollSurface, viewport: ViewportMetrics, viewportAnchorRatio?: number): GlobalScrollPosition | null;
|
|
80
|
+
resolveScrollTopFromPosition(position: GlobalScrollPosition, surface: ScrollSurface, viewportHeight: number, scrollHeight: number, viewportAnchorRatio?: number): ScrollResolutionResult;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type { ContentId as C, GlobalScrollPosition as G, OwoMarkScrollProjectionSnapshot as O, SourceKey as S, ViewportMetrics as V, OwoMarkSurfaceGeometrySnapshot as a, OwoMarkScrollController as b, OwoMarkScrollProjectionSegment as c, Geometry as d, OwoMarkScrollDegradedReason as e, OwoMarkSurfaceGeometrySegment as f, OwoMarkSurfaceGeometrySnapshotStatus as g, ScrollProjectionSegmentKind as h, ScrollResolutionResult as i, ScrollSurface as j, ScrollToScrollPositionOptions as k, ScrollToScrollPositionResult as l };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owomark/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Framework-agnostic core engine for the OwoMark editor.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,6 +20,34 @@
|
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"import": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./browser": {
|
|
24
|
+
"types": "./dist/browser.d.ts",
|
|
25
|
+
"import": "./dist/browser.js"
|
|
26
|
+
},
|
|
27
|
+
"./semantic": {
|
|
28
|
+
"types": "./dist/semantic/index.d.ts",
|
|
29
|
+
"import": "./dist/semantic/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./semantic/shared": {
|
|
32
|
+
"types": "./dist/semantic/shared/index.d.ts",
|
|
33
|
+
"import": "./dist/semantic/shared/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./semantic/syntax": {
|
|
36
|
+
"types": "./dist/semantic/syntax/index.d.ts",
|
|
37
|
+
"import": "./dist/semantic/syntax/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./semantic/components": {
|
|
40
|
+
"types": "./dist/semantic/components/index.d.ts",
|
|
41
|
+
"import": "./dist/semantic/components/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./semantic/runtime": {
|
|
44
|
+
"types": "./dist/semantic/runtime/index.d.ts",
|
|
45
|
+
"import": "./dist/semantic/runtime/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./semantic/editor": {
|
|
48
|
+
"types": "./dist/semantic/editor/index.d.ts",
|
|
49
|
+
"import": "./dist/semantic/editor/index.js"
|
|
50
|
+
},
|
|
23
51
|
"./internal/dom-adapter": {
|
|
24
52
|
"types": "./dist/internal/dom-adapter.d.ts",
|
|
25
53
|
"import": "./dist/internal/dom-adapter.js"
|