@owomark/core 0.1.5 → 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.
Files changed (38) hide show
  1. package/README.md +30 -10
  2. package/dist/.build-manifest.json +130 -0
  3. package/dist/browser.d.ts +66 -0
  4. package/dist/browser.js +396 -0
  5. package/dist/chunk-3KTK7CSS.js +82 -0
  6. package/dist/chunk-5JNL3LHV.js +215 -0
  7. package/dist/chunk-ASRCHEFF.js +0 -0
  8. package/dist/chunk-BKJCBEI7.js +397 -0
  9. package/dist/chunk-CJSBFWKS.js +549 -0
  10. package/dist/chunk-GA5EFGSZ.js +5820 -0
  11. package/dist/chunk-OOH46GIF.js +95 -0
  12. package/dist/chunk-ROJILHRQ.js +192 -0
  13. package/dist/chunk-WFPUIPWU.js +34 -0
  14. package/dist/chunk-WXVKSKP3.js +191 -0
  15. package/dist/chunk-YZYJIXGO.js +0 -0
  16. package/dist/editor-core-DbPhn6aI.d.ts +249 -0
  17. package/dist/index.d.ts +77 -86
  18. package/dist/index.js +161 -245
  19. package/dist/internal/dom-adapter.d.ts +37 -1
  20. package/dist/internal/dom-adapter.js +9 -2
  21. package/dist/public-zMo7BR9l.d.ts +469 -0
  22. package/dist/registry-C849sxCo.d.ts +74 -0
  23. package/dist/semantic/components/index.d.ts +9 -0
  24. package/dist/semantic/components/index.js +11 -0
  25. package/dist/semantic/editor/index.d.ts +9 -0
  26. package/dist/semantic/editor/index.js +13 -0
  27. package/dist/semantic/index.d.ts +7 -0
  28. package/dist/semantic/index.js +106 -0
  29. package/dist/semantic/runtime/index.d.ts +9 -0
  30. package/dist/semantic/runtime/index.js +13 -0
  31. package/dist/semantic/shared/index.d.ts +10 -0
  32. package/dist/semantic/shared/index.js +17 -0
  33. package/dist/semantic/syntax/index.d.ts +151 -0
  34. package/dist/semantic/syntax/index.js +63 -0
  35. package/dist/types-DMqYF6Zn.d.ts +83 -0
  36. package/package.json +29 -1
  37. package/dist/chunk-TRLKIMRD.js +0 -3227
  38. package/dist/dom-adapter-CTSJe5Uo.d.ts +0 -469
@@ -0,0 +1,469 @@
1
+ /** A position within a specific block. */
2
+ type VirtualPosition = {
3
+ blockId: string;
4
+ offset: number;
5
+ };
6
+ /** A selection expressed as two virtual positions. */
7
+ type VirtualSelection = {
8
+ anchor: VirtualPosition;
9
+ focus: VirtualPosition;
10
+ };
11
+ /** Convert a linear character offset to a VirtualPosition. */
12
+ declare function linearToVirtualPosition(doc: OwoMarkDocument, linearOffset: number): VirtualPosition;
13
+ /** Convert a linear OwoMarkSelection to a VirtualSelection. */
14
+ declare function linearToVirtual(doc: OwoMarkDocument, selection: OwoMarkSelection): VirtualSelection;
15
+ /** Convert a VirtualPosition to a linear character offset. */
16
+ declare function virtualPositionToLinear(doc: OwoMarkDocument, vpos: VirtualPosition): number;
17
+ /** Convert a VirtualSelection to a linear OwoMarkSelection. */
18
+ declare function virtualToLinear(doc: OwoMarkDocument, vsel: VirtualSelection): OwoMarkSelection;
19
+ /** Check if two virtual positions point to the same location. */
20
+ declare function virtualPositionsEqual(a: VirtualPosition, b: VirtualPosition): boolean;
21
+ /** Check if a virtual selection is collapsed (cursor, no range). */
22
+ declare function isVirtualSelectionCollapsed(vsel: VirtualSelection): boolean;
23
+ /** Get the block index for a VirtualPosition, or -1 if not found. */
24
+ declare function getBlockIndexForPosition(doc: OwoMarkDocument, vpos: VirtualPosition): number;
25
+
26
+ type BlockType = 'paragraph' | 'heading' | 'unordered-list' | 'ordered-list' | 'blockquote' | 'code-fence' | 'side-annotation' | 'side-note-definition' | 'directive-container' | 'custom-block' | 'thematic-break' | 'math-block' | 'table' | 'html-block' | 'reference-definition';
27
+ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
28
+ type Leaf = {
29
+ text: string;
30
+ };
31
+ type DecoratorType = InlineTokenType;
32
+ type Decorator = {
33
+ type: DecoratorType;
34
+ style?: string;
35
+ syntaxKey?: string;
36
+ leaves: Leaf[];
37
+ };
38
+ type ContainerKind = 'blockquote' | 'unordered-list' | 'ordered-list' | 'list-item';
39
+ type ContainerFrame = {
40
+ kind: ContainerKind;
41
+ depth: number;
42
+ markerRaw: string;
43
+ };
44
+ type SideAnnotationSourceKind = 'inline' | 'continuation-chain' | 'container' | 'reference-container';
45
+ type SideAnnotationMemberBlockType = 'paragraph' | 'heading' | 'unordered-list' | 'ordered-list' | 'blockquote' | 'code-fence' | 'directive-container' | 'custom-block' | 'thematic-break' | 'math-block' | 'table' | 'html-block' | 'reference-definition';
46
+ type SideAnnotationMemberBlock = {
47
+ type: SideAnnotationMemberBlockType;
48
+ raw: string;
49
+ syntaxRaw: string;
50
+ depth: number;
51
+ ancestry: ContainerFrame[];
52
+ customBlockKey?: string | null;
53
+ customBlockAttributes?: Record<string, JsonValue> | null;
54
+ headingLevel?: HeadingLevel;
55
+ language?: string | null;
56
+ directiveName?: string | null;
57
+ referenceLabel?: string | null;
58
+ referenceDestination?: string | null;
59
+ referenceTitle?: string | null;
60
+ };
61
+ type BlockBase = {
62
+ raw: string;
63
+ /**
64
+ * `syntaxRaw` strips surrounding container prefixes that belong to ancestor
65
+ * containers rather than the block's own syntax.
66
+ */
67
+ syntaxRaw: string;
68
+ id: string;
69
+ sourceKey: string;
70
+ startLine: number;
71
+ endLine: number;
72
+ depth: number;
73
+ ancestry: ContainerFrame[];
74
+ decorators: Decorator[];
75
+ tokenizationContextKey: string;
76
+ };
77
+ type BlockNode = (BlockBase & {
78
+ type: 'heading';
79
+ headingLevel: HeadingLevel;
80
+ }) | (BlockBase & {
81
+ type: 'code-fence';
82
+ language: string;
83
+ isFenceBoundary?: boolean;
84
+ }) | (BlockBase & {
85
+ type: 'side-annotation';
86
+ sideAnnotationKind: SideAnnotationSourceKind;
87
+ sideType: string;
88
+ sideTypeSymbol: string;
89
+ annotationText: string | null;
90
+ noteRef?: string | null;
91
+ orphan?: boolean;
92
+ members: SideAnnotationMemberBlock[];
93
+ }) | (BlockBase & {
94
+ type: 'side-note-definition';
95
+ sideNoteId: string;
96
+ sideType: string;
97
+ sideTypeSymbol: string;
98
+ content: string;
99
+ }) | (BlockBase & {
100
+ type: 'directive-container';
101
+ directiveName: string;
102
+ }) | (BlockBase & {
103
+ type: 'custom-block';
104
+ customBlockKey: string;
105
+ customBlockRuntime: CustomBlockRuntimeBinding;
106
+ customBlockAttributes: Record<string, JsonValue>;
107
+ }) | (BlockBase & {
108
+ type: 'reference-definition';
109
+ referenceLabel: string;
110
+ referenceDestination: string;
111
+ referenceTitle?: string | null;
112
+ }) | (BlockBase & {
113
+ type: 'math-block';
114
+ }) | (BlockBase & {
115
+ type: 'table';
116
+ }) | (BlockBase & {
117
+ type: 'html-block';
118
+ }) | (BlockBase & {
119
+ type: 'paragraph' | 'unordered-list' | 'ordered-list' | 'blockquote' | 'thematic-break';
120
+ });
121
+ type ConformanceInlineNode = {
122
+ kind: 'text';
123
+ text: string;
124
+ } | {
125
+ kind: 'strong';
126
+ children: ConformanceInlineNode[];
127
+ } | {
128
+ kind: 'emphasis';
129
+ children: ConformanceInlineNode[];
130
+ } | {
131
+ kind: 'delete';
132
+ children: ConformanceInlineNode[];
133
+ } | {
134
+ kind: 'inlineCode';
135
+ text: string;
136
+ } | {
137
+ kind: 'inlineMath';
138
+ text: string;
139
+ } | {
140
+ kind: 'html';
141
+ text: string;
142
+ } | {
143
+ kind: 'link';
144
+ children: ConformanceInlineNode[];
145
+ url: string;
146
+ } | {
147
+ kind: 'image';
148
+ alt: ConformanceInlineNode[];
149
+ url: string;
150
+ };
151
+ type ConformanceTableCell = {
152
+ inline: ConformanceInlineNode[];
153
+ };
154
+ type ConformanceTableRow = {
155
+ cells: ConformanceTableCell[];
156
+ };
157
+ type ConformanceContainerNode = {
158
+ kind: 'blockquote' | 'unordered-list' | 'ordered-list' | 'list-item';
159
+ depth: number;
160
+ };
161
+ type ConformanceBlockNode = {
162
+ kind: 'paragraph';
163
+ ancestry: ConformanceContainerNode[];
164
+ inline: ConformanceInlineNode[];
165
+ } | {
166
+ kind: 'heading';
167
+ ancestry: ConformanceContainerNode[];
168
+ depth: 1 | 2 | 3 | 4 | 5 | 6;
169
+ inline: ConformanceInlineNode[];
170
+ } | {
171
+ kind: 'blockquote';
172
+ ancestry: ConformanceContainerNode[];
173
+ depth: number;
174
+ inline: ConformanceInlineNode[];
175
+ } | {
176
+ kind: 'listItem';
177
+ ancestry: ConformanceContainerNode[];
178
+ ordered: boolean;
179
+ task: 'checked' | 'unchecked' | null;
180
+ inline: ConformanceInlineNode[];
181
+ } | {
182
+ kind: 'table';
183
+ ancestry: ConformanceContainerNode[];
184
+ rows: ConformanceTableRow[];
185
+ } | {
186
+ kind: 'codeFence';
187
+ ancestry: ConformanceContainerNode[];
188
+ language: string | null;
189
+ lines: string[];
190
+ } | {
191
+ kind: 'mathBlock';
192
+ ancestry: ConformanceContainerNode[];
193
+ lines: string[];
194
+ } | {
195
+ kind: 'htmlBlock';
196
+ ancestry: ConformanceContainerNode[];
197
+ raw: string;
198
+ } | {
199
+ kind: 'thematicBreak';
200
+ ancestry: ConformanceContainerNode[];
201
+ };
202
+ type ConformanceDocument = {
203
+ blocks: ConformanceBlockNode[];
204
+ };
205
+ type OwoMarkDocumentTrace = {
206
+ blockIds: string[];
207
+ blockTypes: BlockType[];
208
+ tokenizationContextKeys: string[];
209
+ referenceDefinitionCount: number;
210
+ };
211
+ type OwoMarkDocument = {
212
+ blocks: BlockNode[];
213
+ conformance: ConformanceDocument;
214
+ referenceDefinitions: MarkdownReferenceDefinition[];
215
+ trace: OwoMarkDocumentTrace;
216
+ previewBlocks: PreviewBlock[];
217
+ };
218
+ type OwoMarkSelection = {
219
+ anchor: number;
220
+ focus: number;
221
+ };
222
+ type CompositionState = {
223
+ active: boolean;
224
+ range: VirtualSelection | null;
225
+ };
226
+ declare const INLINE_TOKEN_TYPES: readonly ["text", "strong-marker", "strong", "emphasis-marker", "emphasis", "custom-inline-marker", "custom-inline", "code-marker", "code", "link-bracket", "link-text", "link-url", "reference-bracket", "reference-label", "image-marker", "image-alt", "image-url", "heading-marker", "list-marker", "task-marker", "task-marker-checked", "table-separator", "blockquote-marker", "fence-marker", "fence-lang", "code-block-text", "strikethrough-marker", "strikethrough", "math-marker", "math-text", "hr", "html"];
227
+ type InlineTokenType = (typeof INLINE_TOKEN_TYPES)[number];
228
+ declare const CLASSLESS_INLINE_TOKEN_TYPES: readonly ["text"];
229
+ type InlineToken = {
230
+ type: InlineTokenType;
231
+ text: string;
232
+ start: number;
233
+ end: number;
234
+ syntaxKey?: string;
235
+ };
236
+ type MarkdownReferenceDefinition = {
237
+ label: string;
238
+ destination: string;
239
+ title?: string | null;
240
+ };
241
+ type InlineScannerMatch = {
242
+ end: number;
243
+ tokens: InlineToken[];
244
+ };
245
+ type ParserExtensionScope = 'inline' | 'block' | 'container-block';
246
+ type ParserDiffScope = 'characterization' | 'reference-diff';
247
+ type ParserExtensionConsumer = 'preview' | 'editor' | 'shared-state' | 'processor';
248
+ type InlineExtensionPriority = 'before-code-span' | 'before-link' | 'before-emphasis';
249
+ type InlineExtensionHostBlockType = 'paragraph' | 'heading' | 'unordered-list' | 'ordered-list' | 'blockquote' | 'table';
250
+ type InlineSyntaxExtension = {
251
+ key: string;
252
+ scope: 'inline';
253
+ priority: InlineExtensionPriority;
254
+ canNestIn: readonly InlineExtensionHostBlockType[];
255
+ closingRule: 'matched-delimiter';
256
+ degradePolicy: 'emit-text-when-unclosed';
257
+ diffScope: ParserDiffScope;
258
+ consumerImpact: 'decorators-expose-syntax-key';
259
+ matcher: (raw: string, index: number, baseOffset: number) => InlineScannerMatch | null;
260
+ };
261
+ type ParserExtensionParent = 'root' | InlineExtensionHostBlockType | 'list-item' | 'code-fence' | 'side-annotation' | 'side-note-definition' | 'directive-container' | 'custom-block' | 'thematic-break' | 'math-block' | 'html-block' | 'reference-definition';
262
+ type ParserExtensionContext = {
263
+ lines: readonly string[];
264
+ startIndex: number;
265
+ offset: number;
266
+ line: string;
267
+ syntaxLine: string;
268
+ containerPrefix: string;
269
+ ancestry: ContainerFrame[];
270
+ parent: ParserExtensionParent;
271
+ };
272
+ type CustomBlockRuntimeBinding = {
273
+ key: string;
274
+ previewKind: 'custom';
275
+ sharedStateDirtyReason: 'custom-block-change';
276
+ processorFallback: 'render-raw' | 'skip-block' | 'unwrap-children';
277
+ attributeKeys?: readonly string[];
278
+ };
279
+ type StructuredSyntaxLine = {
280
+ raw: string;
281
+ syntax: string;
282
+ prefixLength: number;
283
+ };
284
+ type ParserCustomBlockMatch = {
285
+ raw: string;
286
+ syntaxRaw: string;
287
+ lines?: readonly StructuredSyntaxLine[];
288
+ attributes?: Record<string, JsonValue>;
289
+ };
290
+ type ParserExtensionMatch = {
291
+ nextIndex: number;
292
+ block: ParserCustomBlockMatch;
293
+ };
294
+ type BlockExtensionPriority = 'after-container-prefix' | 'before-paragraph-fallback';
295
+ type ContainerBlockExtensionPriority = 'after-container-prefix' | 'before-paragraph-fallback';
296
+ type BlockSyntaxExtension = {
297
+ key: string;
298
+ scope: 'block';
299
+ priority: BlockExtensionPriority;
300
+ canNestIn: readonly ParserExtensionParent[];
301
+ closingRule: 'single-line' | 'blank-line' | 'explicit-closer' | 'matched-delimiter';
302
+ degradePolicy: 'emit-paragraph' | 'emit-raw';
303
+ diffScope: ParserDiffScope;
304
+ consumerImpact: readonly ParserExtensionConsumer[];
305
+ runtime?: CustomBlockRuntimeBinding | null;
306
+ match: (context: ParserExtensionContext) => ParserExtensionMatch | null;
307
+ };
308
+ type ContainerBlockSyntaxExtension = {
309
+ key: string;
310
+ scope: 'container-block';
311
+ priority: ContainerBlockExtensionPriority;
312
+ canNestIn: readonly ParserExtensionParent[];
313
+ canContain: readonly BlockType[];
314
+ closingRule: 'indent-dedent' | 'blank-line' | 'explicit-closer' | 'matched-delimiter';
315
+ degradePolicy: 'emit-paragraph' | 'emit-raw' | 'unwrap-children';
316
+ diffScope: ParserDiffScope;
317
+ consumerImpact: readonly ParserExtensionConsumer[];
318
+ runtime?: CustomBlockRuntimeBinding | null;
319
+ match: (context: ParserExtensionContext) => ParserExtensionMatch | null;
320
+ };
321
+ type TokenizeInlineOptions = {
322
+ extensions?: readonly InlineSyntaxExtension[];
323
+ blockType?: InlineExtensionHostBlockType;
324
+ referenceDefinitions?: readonly MarkdownReferenceDefinition[];
325
+ };
326
+ type TokenizeBlockExtensionOptions = {
327
+ extensions?: readonly BlockSyntaxExtension[];
328
+ containerExtensions?: readonly ContainerBlockSyntaxExtension[];
329
+ };
330
+ type TokenizeBlockOptions = {
331
+ inline?: TokenizeInlineOptions;
332
+ block?: TokenizeBlockExtensionOptions;
333
+ };
334
+ type ParseMarkdownOptions = {
335
+ inline?: TokenizeInlineOptions;
336
+ block?: TokenizeBlockExtensionOptions;
337
+ };
338
+ /**
339
+ * Extended block type for host consumption.
340
+ * Derived from BlockType — remaps code-fence to code-block
341
+ * and adds empty for blank paragraphs.
342
+ */
343
+ type BlockContextType = Exclude<BlockType, 'code-fence'> | 'code-block' | 'empty';
344
+ /**
345
+ * Rich block context at the current cursor position.
346
+ * Hosts consume this instead of implementing their own block identification.
347
+ */
348
+ type BlockContext = {
349
+ /** High-level block category at cursor */
350
+ type: BlockContextType;
351
+ /** Heading level (1-6) when type is 'heading' */
352
+ headingLevel?: HeadingLevel;
353
+ /** Code fence language when type is 'code-block' */
354
+ language?: string;
355
+ /** Nesting depth (lists, blockquotes) */
356
+ depth: number;
357
+ /** Block index in document */
358
+ blockIndex: number;
359
+ /** Stable block ID */
360
+ blockId: string;
361
+ };
362
+ type BlockContextListener = (context: BlockContext) => void;
363
+ /**
364
+ * Block types that can be inserted via toolbar or command palette.
365
+ * Maps directly to dispatch command IDs.
366
+ */
367
+ type BlockInsertType = 'code-fence' | 'blockquote' | 'math' | 'table' | 'image' | 'thematic-break';
368
+ type OwoMarkCommands = {
369
+ focus(): void;
370
+ undo(): void;
371
+ redo(): void;
372
+ toggleBold(): void;
373
+ toggleItalic(): void;
374
+ insertLink(url?: string): void;
375
+ insertCodeFence(language?: string): void;
376
+ insertMath(): void;
377
+ insertSideAnnotation(type?: string): void;
378
+ getMarkdown(): string;
379
+ setMarkdown(markdown: string): void;
380
+ /** Replace markdown with explicit selection target and undo support. */
381
+ replaceMarkdown(markdown: string, selection: OwoMarkSelection): void;
382
+ };
383
+ type DirtyRange = {
384
+ startBlock: number;
385
+ endBlock: number;
386
+ };
387
+ type PreviewBlockKind = 'paragraph' | 'heading' | 'unordered-list' | 'ordered-list' | 'blockquote' | 'code-fence' | 'thematic-break' | 'table' | 'math-block' | 'html-block' | 'custom';
388
+ type JsonPrimitive = string | number | boolean | null;
389
+ type JsonValue = JsonPrimitive | JsonValue[] | {
390
+ [key: string]: JsonValue;
391
+ };
392
+ type PreviewBlock = {
393
+ /**
394
+ * Content-based identity: `{renderKey}#{occurrenceIndex}`.
395
+ * Stable across blank line edits — only changes when block content changes.
396
+ * Used as the DOM wrapper lifecycle key by the virtual preview engine.
397
+ * For line-range positional mapping (scroll sync), use startLine/endLine.
398
+ */
399
+ blockId: string;
400
+ kind: PreviewBlockKind;
401
+ raw: string;
402
+ startLine: number;
403
+ endLine: number;
404
+ renderKey: string;
405
+ language?: string | null;
406
+ headingLevel?: HeadingLevel;
407
+ attributes?: Record<string, JsonValue>;
408
+ };
409
+ /**
410
+ * A block transform enriches PreviewBlocks during projection.
411
+ *
412
+ * Transforms run in `projectToPreviewBlocks` — the single source of truth
413
+ * for both preview rendering and static build. This guarantees identical
414
+ * block output in both pipelines.
415
+ *
416
+ * Examples: image size extraction, custom block attribute injection.
417
+ */
418
+ type BlockTransform = (block: PreviewBlock) => PreviewBlock;
419
+ type PreviewDirtyReason = 'text-edit' | 'structure-edit' | 'theme-change' | 'renderer-change' | 'custom-block-change' | 'full-rebuild';
420
+ type OwoMarkSharedState = {
421
+ document: OwoMarkDocument;
422
+ previewBlocks: PreviewBlock[];
423
+ dirtyRange: DirtyRange | null;
424
+ dirtyReason: PreviewDirtyReason | null;
425
+ selection: OwoMarkSelection | null;
426
+ compositionActive: boolean;
427
+ visibleBlockIds: string[];
428
+ /** Bumps only when preview-relevant state changes. */
429
+ version: number;
430
+ /** Bumps only when markdown / preview block content changes. */
431
+ contentVersion: number;
432
+ /** Bumps only when editor UI state changes (selection/composition). */
433
+ uiVersion: number;
434
+ markdown: string;
435
+ };
436
+ type OwoMarkSharedStateStore = {
437
+ getState(): OwoMarkSharedState;
438
+ subscribe(listener: (state: OwoMarkSharedState) => void): () => void;
439
+ subscribeWithSelector<T>(selector: (state: OwoMarkSharedState) => T, listener: (selected: T, state: OwoMarkSharedState) => void, isEqual?: (prev: T, next: T) => boolean): () => void;
440
+ };
441
+ /**
442
+ * Minimal interface for connecting to shared state.
443
+ * Both OwoMarkCore and browser-host editor adapters satisfy this.
444
+ */
445
+ type OwoMarkEditorLike = {
446
+ getMarkdown(): string;
447
+ setMarkdown(markdown: string): void;
448
+ onChange(callback: (markdown: string) => void): () => void;
449
+ onSelectionChange(callback: (selection: OwoMarkSelection) => void): () => void;
450
+ onCompositionStateChange(callback: (active: boolean) => void): () => void;
451
+ };
452
+ type OwoMarkSharedStateController = OwoMarkSharedStateStore & {
453
+ setMarkdown(markdown: string): void;
454
+ updateVisibleBlockIds(ids: string[]): void;
455
+ getEditorInstance(): OwoMarkEditorLike | null;
456
+ connectEditor(instance: OwoMarkEditorLike): () => void;
457
+ /** Change theme key, re-derive all renderKeys, and emit 'theme-change'. */
458
+ setThemeKey(themeKey: string): void;
459
+ /** Signal that the host renderer pipeline changed. Invalidates all blocks. */
460
+ notifyRendererChange(): void;
461
+ /** Signal that a custom block plugin changed. Invalidates all blocks. */
462
+ notifyCustomBlockChange(): void;
463
+ };
464
+ type HistoryEntry = {
465
+ markdown: string;
466
+ selection: OwoMarkSelection;
467
+ };
468
+
469
+ export { type ParserExtensionParent as $, type ContainerKind as A, type BlockType as B, type CompositionState as C, type DirtyRange as D, type CustomBlockRuntimeBinding as E, type Decorator as F, type DecoratorType as G, type HeadingLevel as H, type InlineTokenType as I, type JsonValue as J, type HistoryEntry as K, INLINE_TOKEN_TYPES as L, type InlineExtensionHostBlockType as M, type InlineScannerMatch as N, type OwoMarkSelection as O, type PreviewBlockKind as P, type JsonPrimitive as Q, type Leaf as R, type OwoMarkCommands as S, type TokenizeInlineOptions as T, type OwoMarkDocumentTrace as U, type VirtualSelection as V, type OwoMarkEditorLike as W, type OwoMarkSharedState as X, type OwoMarkSharedStateStore as Y, type ParserDiffScope as Z, type ParserExtensionConsumer as _, type OwoMarkDocument as a, type ParserExtensionScope as a0, type PreviewDirtyReason as a1, type SideAnnotationMemberBlock as a2, type SideAnnotationMemberBlockType as a3, type SideAnnotationSourceKind as a4, type TokenizeBlockExtensionOptions as a5, type VirtualPosition as a6, getBlockIndexForPosition as a7, isVirtualSelectionCollapsed as a8, linearToVirtual as a9, linearToVirtualPosition as aa, virtualPositionToLinear as ab, virtualPositionsEqual as ac, virtualToLinear as ad, type BlockContext as b, type BlockInsertType as c, type BlockContextListener as d, type InlineToken as e, type PreviewBlock as f, type BlockNode as g, type BlockContextType as h, type ContainerBlockSyntaxExtension as i, type ParseMarkdownOptions as j, type ConformanceDocument as k, type BlockTransform as l, type OwoMarkSharedStateController as m, type InlineExtensionPriority as n, type InlineSyntaxExtension as o, type TokenizeBlockOptions as p, type BlockExtensionPriority as q, type BlockSyntaxExtension as r, CLASSLESS_INLINE_TOKEN_TYPES as s, type ConformanceBlockNode as t, type ConformanceContainerNode as u, type ConformanceInlineNode as v, type ConformanceTableCell as w, type ConformanceTableRow as x, type ContainerBlockExtensionPriority as y, type ContainerFrame as z };
@@ -0,0 +1,74 @@
1
+ import { P as PreviewBlockKind } from './public-zMo7BR9l.js';
2
+
3
+ type OwoFeatureFlagKey = 'enableSideAnnotation' | 'enableMath' | 'enableComponents';
4
+ type OwoSemanticDescriptorFamily = 'syntax' | 'component' | 'runtime' | 'editor';
5
+ type OwoDescriptorBase = {
6
+ key: string;
7
+ family: OwoSemanticDescriptorFamily;
8
+ specIds: readonly string[];
9
+ featureFlag?: OwoFeatureFlagKey | null;
10
+ };
11
+ type OwoSyntaxDescriptor = OwoDescriptorBase & {
12
+ family: 'syntax';
13
+ syntaxKind: 'block' | 'container-block' | 'inline' | 'support';
14
+ consumes: readonly ('parser' | 'processor' | 'preview' | 'rehype' | 'runtime')[];
15
+ aliases?: readonly string[];
16
+ };
17
+ type OwoComponentKind = 'block-container' | 'block-parent' | 'block-child' | 'inline-text';
18
+ type OwoComponentPayloadStrategy = 'none' | 'single-code-block' | 'code-tabs' | 'optional-summary' | 'inline-text';
19
+ type OwoComponentDescriptor = OwoDescriptorBase & {
20
+ family: 'component';
21
+ directiveName: string;
22
+ componentName: string;
23
+ componentKind: OwoComponentKind;
24
+ allowedAttrs: readonly string[];
25
+ requiredAttrs: readonly string[];
26
+ requiredParent: string | null;
27
+ allowedChildDirectives: readonly string[];
28
+ payloadStrategy: OwoComponentPayloadStrategy;
29
+ };
30
+ type OwoRuntimeProjectionStrategy = 'plain' | 'group-adjacent' | 'custom-single' | 'custom-grouped';
31
+ type OwoRuntimeBlockDescriptor = OwoDescriptorBase & {
32
+ family: 'runtime';
33
+ blockType: string;
34
+ previewKind: PreviewBlockKind;
35
+ customBlockKey?: string | null;
36
+ projectionStrategy: OwoRuntimeProjectionStrategy;
37
+ rendererMode: 'html-worker-safe' | 'dom-main-thread';
38
+ rendererPriority: 'realtime' | 'deferred';
39
+ workerRendererId?: string | null;
40
+ heavy?: boolean;
41
+ processorFallback?: 'render-raw' | 'skip-block' | 'unwrap-children' | null;
42
+ attributeKeys?: readonly string[] | null;
43
+ sharedStateDirtyReason?: 'custom-block-change' | null;
44
+ };
45
+ type OwoEditorEntryPresentation = {
46
+ label: string;
47
+ category: string;
48
+ };
49
+ type OwoEditorEntryDescriptor = OwoDescriptorBase & {
50
+ family: 'editor';
51
+ commandId: string;
52
+ entryKind: 'block' | 'insert' | 'format' | 'component';
53
+ labelKey: string;
54
+ categoryKey: string;
55
+ keywords: readonly string[];
56
+ slashMenu: boolean;
57
+ toolbarEligible: boolean;
58
+ priority?: number;
59
+ shortcut?: string;
60
+ descriptionKey?: string;
61
+ templateKey?: string | null;
62
+ };
63
+
64
+ type RegistryDescriptor = {
65
+ key: string;
66
+ };
67
+ type OwoDescriptorRegistry<TDescriptor extends RegistryDescriptor> = {
68
+ list(): readonly TDescriptor[];
69
+ get(key: string): TDescriptor | undefined;
70
+ };
71
+ declare function createDescriptorRegistry<TDescriptor extends RegistryDescriptor>(descriptors: readonly TDescriptor[], familyName: string): OwoDescriptorRegistry<TDescriptor>;
72
+ declare function requireDescriptor<TDescriptor extends RegistryDescriptor>(registry: OwoDescriptorRegistry<TDescriptor>, key: string, familyName: string): TDescriptor;
73
+
74
+ export { type OwoComponentDescriptor as O, type OwoComponentKind as a, type OwoComponentPayloadStrategy as b, type OwoDescriptorRegistry as c, type OwoEditorEntryDescriptor as d, type OwoEditorEntryPresentation as e, type OwoFeatureFlagKey as f, type OwoRuntimeBlockDescriptor as g, type OwoSyntaxDescriptor as h, createDescriptorRegistry as i, requireDescriptor as r };
@@ -0,0 +1,9 @@
1
+ import { c as OwoDescriptorRegistry, O as OwoComponentDescriptor } from '../../registry-C849sxCo.js';
2
+ export { a as OwoComponentKind, b as OwoComponentPayloadStrategy } from '../../registry-C849sxCo.js';
3
+ import '../../public-zMo7BR9l.js';
4
+
5
+ declare const componentRegistry: OwoDescriptorRegistry<OwoComponentDescriptor>;
6
+ declare function getComponentDescriptor(key: string): OwoComponentDescriptor;
7
+ declare function getComponentDescriptorByDirective(directiveName: string): OwoComponentDescriptor | undefined;
8
+
9
+ export { OwoComponentDescriptor, componentRegistry, getComponentDescriptor, getComponentDescriptorByDirective };
@@ -0,0 +1,11 @@
1
+ import {
2
+ componentRegistry,
3
+ getComponentDescriptor,
4
+ getComponentDescriptorByDirective
5
+ } from "../../chunk-WXVKSKP3.js";
6
+ import "../../chunk-OOH46GIF.js";
7
+ export {
8
+ componentRegistry,
9
+ getComponentDescriptor,
10
+ getComponentDescriptorByDirective
11
+ };
@@ -0,0 +1,9 @@
1
+ import { c as OwoDescriptorRegistry, d as OwoEditorEntryDescriptor, e as OwoEditorEntryPresentation } from '../../registry-C849sxCo.js';
2
+ import '../../public-zMo7BR9l.js';
3
+
4
+ declare const editorEntryRegistry: OwoDescriptorRegistry<OwoEditorEntryDescriptor>;
5
+ declare function getEditorEntryDescriptor(key: string): OwoEditorEntryDescriptor;
6
+ declare function getEditorEntryDescriptorByCommandId(commandId: string): OwoEditorEntryDescriptor | undefined;
7
+ declare function resolveEditorEntryPresentation(descriptor: OwoEditorEntryDescriptor): OwoEditorEntryPresentation;
8
+
9
+ export { editorEntryRegistry, getEditorEntryDescriptor, getEditorEntryDescriptorByCommandId, resolveEditorEntryPresentation };
@@ -0,0 +1,13 @@
1
+ import {
2
+ editorEntryRegistry,
3
+ getEditorEntryDescriptor,
4
+ getEditorEntryDescriptorByCommandId,
5
+ resolveEditorEntryPresentation
6
+ } from "../../chunk-3KTK7CSS.js";
7
+ import "../../chunk-OOH46GIF.js";
8
+ export {
9
+ editorEntryRegistry,
10
+ getEditorEntryDescriptor,
11
+ getEditorEntryDescriptorByCommandId,
12
+ resolveEditorEntryPresentation
13
+ };
@@ -0,0 +1,7 @@
1
+ export { O as OwoComponentDescriptor, a as OwoComponentKind, b as OwoComponentPayloadStrategy, c as OwoDescriptorRegistry, d as OwoEditorEntryDescriptor, e as OwoEditorEntryPresentation, f as OwoFeatureFlagKey, g as OwoRuntimeBlockDescriptor, h as OwoSyntaxDescriptor, i as createDescriptorRegistry, r as requireDescriptor } from '../registry-C849sxCo.js';
2
+ export { validateComponentDescriptors, validateEditorEntryDescriptors, validateRuntimeDescriptors, validateSyntaxDescriptors } from './shared/index.js';
3
+ export { MATH_FENCE_RE, MULTI_LINE_MATH_BLOCK_CLOSE_RE, MULTI_LINE_MATH_BLOCK_OPEN_RE, MathFenceNormalizationLineMapping, 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, SideAnnotationType, SideAnnotationTypeDescriptor, SideAnnotationTypeSymbol, collectMathFenceNormalizationRewrites, getSyntaxDescriptor, isFenceOnlyMathLine, isMultiLineMathBlockClose, isMultiLineMathBlockOpen, isSingleLineMathBlock, mathSyntaxDescriptor, parseInlineSideAnnotationFromText, parseInlineSideAnnotationText, parseSideDirectiveLabel, parseSideNoteDefinitionRaw, sideAnnotationSyntaxDescriptors, sideAnnotationTypeDescriptors, stripInlineSideAnnotationTail, stripSideContinuationTail, syntaxRegistry } from './syntax/index.js';
4
+ export { componentRegistry, getComponentDescriptor, getComponentDescriptorByDirective } from './components/index.js';
5
+ export { getRuntimeBlockDescriptor, getRuntimeBlockDescriptorByBlockType, getRuntimeBlockDescriptorByPreviewKind, runtimeBlockRegistry } from './runtime/index.js';
6
+ export { editorEntryRegistry, getEditorEntryDescriptor, getEditorEntryDescriptorByCommandId, resolveEditorEntryPresentation } from './editor/index.js';
7
+ import '../public-zMo7BR9l.js';