@owomark/core 0.1.8 → 0.1.9

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/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OwoMarkSelection, a as OwoMarkDocument, D as DirtyRange, I as InlineTokenType, e as InlineToken, f as PreviewBlock } from './public-cCK3rvQc.js';
2
- import { O as OwoMarkScrollProjectionSnapshot, a as OwoMarkSurfaceGeometrySnapshot, b as OwoMarkScrollController } from './types-BdOo-u1R.js';
1
+ import { O as OwoMarkSelection, a as OwoMarkDocument, D as DirtyRange, I as InlineTokenType, e as InlineToken, f as ContainerFrame, g as PreviewBlock } from './public-BjF6yWIR.js';
2
+ import { O as OwoMarkScrollProjectionSnapshot, a as OwoMarkSurfaceGeometrySnapshot, b as OwoMarkScrollController } from './types-0QKyuzQy.js';
3
3
 
4
4
  declare function invalidateBlockCache(root: HTMLElement): void;
5
5
 
@@ -41,12 +41,12 @@ declare function detectAndRenderDirty(root: HTMLElement, oldDoc: OwoMarkDocument
41
41
  declare const TOKEN_CLASS_EXEMPTIONS: Set<"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">;
42
42
  declare const TOKEN_TO_CLASS: Record<InlineTokenType, string>;
43
43
  declare const BLOCK_TYPE_TO_CLASS: Record<string, string>;
44
- declare function createBlockElement(doc: Document, tokens: InlineToken[], blockIndex: number, blockType: string, headingLevel?: number, depth?: number): HTMLDivElement;
44
+ declare function createBlockElement(doc: Document, tokens: InlineToken[], blockIndex: number, blockType: string, headingLevel?: number, depth?: number, ancestry?: readonly ContainerFrame[]): HTMLDivElement;
45
45
  /**
46
46
  * Update an existing block element's content with new tokens.
47
47
  * Returns true if the block was modified.
48
48
  */
49
- declare function updateBlockElement(doc: Document, existing: HTMLDivElement, tokens: InlineToken[], blockType: string, headingLevel?: number, depth?: number): boolean;
49
+ declare function updateBlockElement(doc: Document, existing: HTMLDivElement, tokens: InlineToken[], blockType: string, headingLevel?: number, depth?: number, ancestry?: readonly ContainerFrame[]): boolean;
50
50
 
51
51
  declare const BQ_STEP: number;
52
52
  /**
@@ -54,6 +54,10 @@ declare const BQ_STEP: number;
54
54
  * Returns null when depth <= 1 (no extra bars needed — the first bar is
55
55
  * rendered by the block's own border/class styling).
56
56
  */
57
+ declare function getBlockquoteDepthFromAncestry(ancestry: readonly {
58
+ kind: string;
59
+ depth: number;
60
+ }[]): number;
57
61
  declare function buildBlockquoteBarsBoxShadow(depth: number): string | null;
58
62
 
59
63
  declare function measureEditorSurfaceGeometry(projection: OwoMarkScrollProjectionSnapshot, editorRoot: HTMLElement, _body?: string): OwoMarkSurfaceGeometrySnapshot;
@@ -63,4 +67,4 @@ declare function createScrollController(): OwoMarkScrollController & {
63
67
  updateProjection(previewBlocks: readonly PreviewBlock[], documentRevision: number): void;
64
68
  };
65
69
 
66
- export { BLOCK_TYPE_TO_CLASS, BQ_STEP, TOKEN_CLASS_EXEMPTIONS, TOKEN_TO_CLASS, buildBlockquoteBarsBoxShadow, createBlockElement, createScrollController, detectAndRenderDirty, domRangeToOffset, fullRender, invalidateBlockCache, measureEditorSurfaceGeometry, measurePreviewSurfaceGeometry, offsetToDomRange, patchDirtyBlocks, readSelection, restoreSelection, updateBlockElement };
70
+ export { BLOCK_TYPE_TO_CLASS, BQ_STEP, TOKEN_CLASS_EXEMPTIONS, TOKEN_TO_CLASS, buildBlockquoteBarsBoxShadow, createBlockElement, createScrollController, detectAndRenderDirty, domRangeToOffset, fullRender, getBlockquoteDepthFromAncestry, invalidateBlockCache, measureEditorSurfaceGeometry, measurePreviewSurfaceGeometry, offsetToDomRange, patchDirtyBlocks, readSelection, restoreSelection, updateBlockElement };
package/dist/browser.js CHANGED
@@ -14,13 +14,14 @@ import {
14
14
  detectAndRenderDirty,
15
15
  domRangeToOffset,
16
16
  fullRender,
17
+ getBlockquoteDepthFromAncestry,
17
18
  invalidateBlockCache,
18
19
  offsetToDomRange,
19
20
  patchDirtyBlocks,
20
21
  readSelection,
21
22
  restoreSelection,
22
23
  updateBlockElement
23
- } from "./chunk-CJSBFWKS.js";
24
+ } from "./chunk-YS3HGP3M.js";
24
25
  import {
25
26
  deriveSourceKey
26
27
  } from "./chunk-WFPUIPWU.js";
@@ -385,6 +386,7 @@ export {
385
386
  detectAndRenderDirty,
386
387
  domRangeToOffset,
387
388
  fullRender,
389
+ getBlockquoteDepthFromAncestry,
388
390
  invalidateBlockCache,
389
391
  measureEditorSurfaceGeometry,
390
392
  measurePreviewSurfaceGeometry,
@@ -470,6 +470,25 @@ function matchDelimitedRange(raw, index, baseOffset, delimiter, markerType, cont
470
470
  ]
471
471
  };
472
472
  }
473
+ function matchDisplayMathInline(raw, index, baseOffset) {
474
+ if (raw[index] !== "$" || raw[index + 1] !== "$" || isEscaped(raw, index)) return null;
475
+ const contentStart = index + 2;
476
+ if (contentStart >= raw.length) return null;
477
+ for (let cursor = contentStart; cursor < raw.length - 1; cursor += 1) {
478
+ if (raw[cursor] === "$" && raw[cursor + 1] === "$" && !isEscaped(raw, cursor)) {
479
+ if (cursor === contentStart) return null;
480
+ return {
481
+ end: cursor + 2,
482
+ tokens: [
483
+ tok("math-marker", "$$", baseOffset + index),
484
+ tok("math-text", raw.slice(contentStart, cursor), baseOffset + contentStart),
485
+ tok("math-marker", "$$", baseOffset + cursor)
486
+ ]
487
+ };
488
+ }
489
+ }
490
+ return null;
491
+ }
473
492
  function matchInlineMath(raw, index, baseOffset) {
474
493
  if (raw[index] !== "$" || isEscaped(raw, index)) return null;
475
494
  if (raw[index + 1] === "$") return null;
@@ -565,7 +584,7 @@ function tryMatch(raw, index, baseOffset, extensions, options) {
565
584
  return match;
566
585
  }
567
586
  }
568
- return matchCodeSpan(raw, index, baseOffset) ?? resolvePriorityMatch(raw, index, baseOffset, extensions, "before-link", blockType) ?? matchLinkLike(raw, index, baseOffset, true, options) ?? matchLinkLike(raw, index, baseOffset, false, options) ?? matchDelimitedRange(raw, index, baseOffset, "~~", "strikethrough-marker", "strikethrough") ?? matchInlineMath(raw, index, baseOffset) ?? matchHtml(raw, index, baseOffset) ?? resolvePriorityMatch(raw, index, baseOffset, extensions, "before-emphasis", blockType) ?? matchStrong(raw, index, baseOffset) ?? matchEmphasis(raw, index, baseOffset);
587
+ return matchCodeSpan(raw, index, baseOffset) ?? resolvePriorityMatch(raw, index, baseOffset, extensions, "before-link", blockType) ?? matchLinkLike(raw, index, baseOffset, true, options) ?? matchLinkLike(raw, index, baseOffset, false, options) ?? matchDelimitedRange(raw, index, baseOffset, "~~", "strikethrough-marker", "strikethrough") ?? matchDisplayMathInline(raw, index, baseOffset) ?? matchInlineMath(raw, index, baseOffset) ?? matchHtml(raw, index, baseOffset) ?? resolvePriorityMatch(raw, index, baseOffset, extensions, "before-emphasis", blockType) ?? matchStrong(raw, index, baseOffset) ?? matchEmphasis(raw, index, baseOffset);
569
588
  }
570
589
  function resolvePriorityMatch(raw, index, baseOffset, extensions, priority, blockType) {
571
590
  for (const matcher of resolveExtensionMatchers(extensions, priority, blockType)) {
@@ -1861,7 +1880,39 @@ function tokensToDecorators(tokens, raw, baseOffset) {
1861
1880
  }
1862
1881
  return decorators;
1863
1882
  }
1864
- function buildStructuredDecorators(lines, blockType, baseOffset, options) {
1883
+ function emitPrefixTokens(prefixText, start, ancestry) {
1884
+ if (!prefixText) return [];
1885
+ const hasBqAncestry = ancestry.some((f) => f.kind === "blockquote");
1886
+ if (hasBqAncestry) {
1887
+ const bqMatch = prefixText.match(/^((?:>\s?)+)/);
1888
+ if (bqMatch) {
1889
+ const markerText = bqMatch[1];
1890
+ const tokens = [{
1891
+ type: "blockquote-marker",
1892
+ text: markerText,
1893
+ start,
1894
+ end: start + markerText.length
1895
+ }];
1896
+ if (markerText.length < prefixText.length) {
1897
+ const rest = prefixText.slice(markerText.length);
1898
+ tokens.push({
1899
+ type: "text",
1900
+ text: rest,
1901
+ start: start + markerText.length,
1902
+ end: start + prefixText.length
1903
+ });
1904
+ }
1905
+ return tokens;
1906
+ }
1907
+ }
1908
+ return [{
1909
+ type: "text",
1910
+ text: prefixText,
1911
+ start,
1912
+ end: start + prefixText.length
1913
+ }];
1914
+ }
1915
+ function buildStructuredDecorators(lines, blockType, baseOffset, options, ancestry = []) {
1865
1916
  if (lines.length === 1 && lines[0].prefixLength === 0 && lines[0].raw === lines[0].syntax) {
1866
1917
  return tokensToDecorators(tokenizeBlock(lines[0].raw, blockType, baseOffset, options), lines[0].raw, baseOffset);
1867
1918
  }
@@ -1875,12 +1926,7 @@ function buildStructuredDecorators(lines, blockType, baseOffset, options) {
1875
1926
  rawCursor += 1;
1876
1927
  }
1877
1928
  if (line.prefixLength > 0) {
1878
- tokens.push({
1879
- type: "text",
1880
- text: line.raw.slice(0, line.prefixLength),
1881
- start: rawCursor,
1882
- end: rawCursor + line.prefixLength
1883
- });
1929
+ tokens.push(...emitPrefixTokens(line.raw.slice(0, line.prefixLength), rawCursor, ancestry));
1884
1930
  }
1885
1931
  const syntaxOffset = rawCursor + line.prefixLength;
1886
1932
  if (index === 0) {
@@ -1934,12 +1980,7 @@ function buildStructuredDecorators(lines, blockType, baseOffset, options) {
1934
1980
  rawCursor += 1;
1935
1981
  }
1936
1982
  if (line.prefixLength > 0) {
1937
- tokens.push({
1938
- type: "text",
1939
- text: line.raw.slice(0, line.prefixLength),
1940
- start: rawCursor,
1941
- end: rawCursor + line.prefixLength
1942
- });
1983
+ tokens.push(...emitPrefixTokens(line.raw.slice(0, line.prefixLength), rawCursor, ancestry));
1943
1984
  }
1944
1985
  const syntaxOffset = rawCursor + line.prefixLength;
1945
1986
  tokens.push(...tokenizeBlock(line.syntax, blockType, syntaxOffset, options));
@@ -1979,7 +2020,8 @@ function createBlock(input) {
1979
2020
  input.lines ?? [{ raw: input.raw, syntax: input.syntaxRaw, prefixLength: input.raw.length - input.syntaxRaw.length }],
1980
2021
  input.type,
1981
2022
  input.offset,
1982
- input.tokenizeOptions ?? {}
2023
+ input.tokenizeOptions ?? {},
2024
+ input.ancestry
1983
2025
  );
1984
2026
  const base = {
1985
2027
  raw: input.raw,
@@ -250,6 +250,15 @@ function readSelection(root) {
250
250
  var BQ_BAR_WIDTH = 3;
251
251
  var BQ_GAP = 12;
252
252
  var BQ_STEP = BQ_BAR_WIDTH + BQ_GAP;
253
+ function getBlockquoteDepthFromAncestry(ancestry) {
254
+ let maxDepth = 0;
255
+ for (const frame of ancestry) {
256
+ if (frame.kind === "blockquote" && frame.depth > maxDepth) {
257
+ maxDepth = frame.depth;
258
+ }
259
+ }
260
+ return maxDepth;
261
+ }
253
262
  function buildBlockquoteBarsBoxShadow(depth) {
254
263
  if (depth <= 1) return null;
255
264
  const shadows = [];
@@ -269,6 +278,20 @@ function applyBlockquoteBarsStyle(el, depth) {
269
278
  el.style.paddingLeft = `${depth * BQ_STEP}px`;
270
279
  el.style.boxShadow = shadow;
271
280
  }
281
+ function applyBlockquoteVisuals(el, blockType, depth, ancestry) {
282
+ const bqDepth = blockType === "blockquote" ? depth && depth > 0 ? depth : 0 : ancestry ? getBlockquoteDepthFromAncestry(ancestry) : 0;
283
+ if (bqDepth > 0) {
284
+ el.setAttribute("data-owo-depth", String(bqDepth));
285
+ if (blockType !== "blockquote") {
286
+ el.className += " owo-block-blockquote";
287
+ }
288
+ applyBlockquoteBarsStyle(el, bqDepth);
289
+ } else {
290
+ el.removeAttribute("data-owo-depth");
291
+ el.style.paddingLeft = "";
292
+ el.style.boxShadow = "";
293
+ }
294
+ }
272
295
  var TOKEN_TO_CLASS = {
273
296
  "text": "",
274
297
  "strong-marker": "owo-syntax-marker",
@@ -318,17 +341,14 @@ var BLOCK_TYPE_TO_CLASS = {
318
341
  "math-block": "owo-block-math",
319
342
  "table": "owo-block-table"
320
343
  };
321
- function createBlockElement(doc, tokens, blockIndex, blockType, headingLevel, depth) {
344
+ function createBlockElement(doc, tokens, blockIndex, blockType, headingLevel, depth, ancestry) {
322
345
  const div = doc.createElement("div");
323
346
  div.setAttribute("data-owo-block", String(blockIndex));
324
347
  div.className = BLOCK_TYPE_TO_CLASS[blockType] || "owo-block-paragraph";
325
348
  if (blockType === "heading" && headingLevel) {
326
349
  div.setAttribute("data-owo-heading", String(headingLevel));
327
350
  }
328
- if (blockType === "blockquote" && depth && depth > 0) {
329
- div.setAttribute("data-owo-depth", String(depth));
330
- applyBlockquoteBarsStyle(div, depth);
331
- }
351
+ applyBlockquoteVisuals(div, blockType, depth, ancestry);
332
352
  renderTokensInto(doc, div, tokens);
333
353
  return div;
334
354
  }
@@ -399,60 +419,37 @@ function renderDecoratorsInto(doc, container, decorators) {
399
419
  container.appendChild(doc.createElement("br"));
400
420
  }
401
421
  }
402
- function createBlockElementFromDecorators(doc, decorators, blockIndex, blockType, headingLevel, depth) {
422
+ function createBlockElementFromDecorators(doc, decorators, blockIndex, blockType, headingLevel, depth, ancestry) {
403
423
  const div = doc.createElement("div");
404
424
  div.setAttribute("data-owo-block", String(blockIndex));
405
425
  div.className = BLOCK_TYPE_TO_CLASS[blockType] || "owo-block-paragraph";
406
426
  if (blockType === "heading" && headingLevel) {
407
427
  div.setAttribute("data-owo-heading", String(headingLevel));
408
428
  }
409
- if (blockType === "blockquote" && depth && depth > 0) {
410
- div.setAttribute("data-owo-depth", String(depth));
411
- applyBlockquoteBarsStyle(div, depth);
412
- }
429
+ applyBlockquoteVisuals(div, blockType, depth, ancestry);
413
430
  renderDecoratorsInto(doc, div, decorators);
414
431
  return div;
415
432
  }
416
- function updateBlockElementFromDecorators(doc, existing, decorators, blockType, headingLevel, depth) {
417
- const newClass = BLOCK_TYPE_TO_CLASS[blockType] || "owo-block-paragraph";
418
- if (existing.className !== newClass) {
419
- existing.className = newClass;
420
- }
433
+ function updateBlockElementFromDecorators(doc, existing, decorators, blockType, headingLevel, depth, ancestry) {
434
+ existing.className = BLOCK_TYPE_TO_CLASS[blockType] || "owo-block-paragraph";
421
435
  if (blockType === "heading" && headingLevel) {
422
436
  existing.setAttribute("data-owo-heading", String(headingLevel));
423
437
  } else {
424
438
  existing.removeAttribute("data-owo-heading");
425
439
  }
426
- if (blockType === "blockquote" && depth && depth > 0) {
427
- existing.setAttribute("data-owo-depth", String(depth));
428
- applyBlockquoteBarsStyle(existing, depth);
429
- } else {
430
- existing.removeAttribute("data-owo-depth");
431
- existing.style.paddingLeft = "";
432
- existing.style.boxShadow = "";
433
- }
440
+ applyBlockquoteVisuals(existing, blockType, depth, ancestry);
434
441
  existing.textContent = "";
435
442
  renderDecoratorsInto(doc, existing, decorators);
436
443
  return true;
437
444
  }
438
- function updateBlockElement(doc, existing, tokens, blockType, headingLevel, depth) {
439
- const newClass = BLOCK_TYPE_TO_CLASS[blockType] || "owo-block-paragraph";
440
- if (existing.className !== newClass) {
441
- existing.className = newClass;
442
- }
445
+ function updateBlockElement(doc, existing, tokens, blockType, headingLevel, depth, ancestry) {
446
+ existing.className = BLOCK_TYPE_TO_CLASS[blockType] || "owo-block-paragraph";
443
447
  if (blockType === "heading" && headingLevel) {
444
448
  existing.setAttribute("data-owo-heading", String(headingLevel));
445
449
  } else {
446
450
  existing.removeAttribute("data-owo-heading");
447
451
  }
448
- if (blockType === "blockquote" && depth && depth > 0) {
449
- existing.setAttribute("data-owo-depth", String(depth));
450
- applyBlockquoteBarsStyle(existing, depth);
451
- } else {
452
- existing.removeAttribute("data-owo-depth");
453
- existing.style.paddingLeft = "";
454
- existing.style.boxShadow = "";
455
- }
452
+ applyBlockquoteVisuals(existing, blockType, depth, ancestry);
456
453
  existing.textContent = "";
457
454
  renderTokensInto(doc, existing, tokens);
458
455
  return true;
@@ -471,7 +468,8 @@ function fullRender(root, doc) {
471
468
  i,
472
469
  block.type,
473
470
  block.type === "heading" ? block.headingLevel : void 0,
474
- block.depth
471
+ block.depth,
472
+ block.ancestry
475
473
  );
476
474
  root.appendChild(el);
477
475
  offset += block.raw.length + 1;
@@ -495,7 +493,8 @@ function patchDirtyBlocks(root, doc, dirty) {
495
493
  block.decorators,
496
494
  block.type,
497
495
  block.type === "heading" ? block.headingLevel : void 0,
498
- block.depth
496
+ block.depth,
497
+ block.ancestry
499
498
  );
500
499
  }
501
500
  }
@@ -537,6 +536,7 @@ export {
537
536
  restoreSelection,
538
537
  readSelection,
539
538
  BQ_STEP,
539
+ getBlockquoteDepthFromAncestry,
540
540
  buildBlockquoteBarsBoxShadow,
541
541
  TOKEN_CLASS_EXEMPTIONS,
542
542
  TOKEN_TO_CLASS,
@@ -1,4 +1,4 @@
1
- import { a as OwoMarkDocument, O as OwoMarkSelection, V as VirtualSelection, C as CompositionState, B as BlockType, b as BlockContext, c as BlockInsertType, d as BlockContextListener } from './public-cCK3rvQc.js';
1
+ import { a as OwoMarkDocument, O as OwoMarkSelection, V as VirtualSelection, C as CompositionState, B as BlockType, b as BlockContext, c as BlockInsertType, d as BlockContextListener } from './public-BjF6yWIR.js';
2
2
 
3
3
  type CoreSelectionSnapshot = {
4
4
  linear: OwoMarkSelection | null;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CoreStateSnapshot, S as SlashState, a as CommandRegistry } from './editor-core-BSoeizSI.js';
2
- export { B as BeforeInputIntent, b as CommandContext, c as CommandDefinition, d as CoreApplyAction, e as CoreApplyResult, f as CoreSelectionSnapshot, g as CreateOwoMarkCoreOptions, D as DocumentChangeCallback, I as IndentMode, h as IndentResult, K as KeyDownIntent, O as OwoMarkCore, P as PasteIntent, i as SlashStateListener, j as SlashTriggerInfo, k as applyMarkdownIndent, l as createOwoMarkCore, r as resolveIndentSize } from './editor-core-BSoeizSI.js';
3
- import { g as BlockNode, h as BlockContextType, O as OwoMarkSelection, i as ContainerBlockSyntaxExtension, J as JsonValue, j as ParseMarkdownOptions, a as OwoMarkDocument, k as ConformanceDocument, D as DirtyRange, P as PreviewBlockKind, f as PreviewBlock, l as BlockTransform, m as OwoMarkSharedStateController, n as InlineExtensionPriority, o as InlineSyntaxExtension, T as TokenizeInlineOptions, e as InlineToken, p as TokenizeBlockOptions } from './public-cCK3rvQc.js';
4
- export { b as BlockContext, d as BlockContextListener, q as BlockExtensionPriority, c as BlockInsertType, r as BlockSyntaxExtension, B as BlockType, s as CLASSLESS_INLINE_TOKEN_TYPES, C as CompositionState, t as ConformanceBlockNode, u as ConformanceContainerNode, v as ConformanceInlineNode, w as ConformanceTableCell, x as ConformanceTableRow, y as ContainerBlockExtensionPriority, z as ContainerFrame, A as ContainerKind, E as CustomBlockRuntimeBinding, F as Decorator, G as DecoratorType, H as HeadingLevel, K as HistoryEntry, L as INLINE_TOKEN_TYPES, M as InlineExtensionHostBlockType, N as InlineScannerMatch, I as InlineTokenType, Q as JsonPrimitive, R as Leaf, S as OwoMarkCommands, U as OwoMarkDocumentTrace, W as OwoMarkEditorLike, X as OwoMarkSharedState, Y as OwoMarkSharedStateStore, Z as ParserDiffScope, _ as ParserExtensionConsumer, $ as ParserExtensionParent, a0 as ParserExtensionScope, a1 as PreviewDirtyReason, a2 as SideAnnotationMemberBlock, a3 as SideAnnotationMemberBlockType, a4 as SideAnnotationSourceKind, a5 as TokenizeBlockExtensionOptions, a6 as VirtualPosition, V as VirtualSelection, a7 as getBlockIndexForPosition, a8 as isVirtualSelectionCollapsed, a9 as linearToVirtual, aa as linearToVirtualPosition, ab as virtualPositionToLinear, ac as virtualPositionsEqual, ad as virtualToLinear } from './public-cCK3rvQc.js';
5
- export { O as OwoComponentDescriptor, d as OwoEditorEntryDescriptor, f as OwoFeatureFlagKey, g as OwoRuntimeBlockDescriptor, h as OwoSyntaxDescriptor } from './registry-6IkGJsLt.js';
1
+ import { C as CoreStateSnapshot, S as SlashState, a as CommandRegistry } from './editor-core-edBvPqBi.js';
2
+ export { B as BeforeInputIntent, b as CommandContext, c as CommandDefinition, d as CoreApplyAction, e as CoreApplyResult, f as CoreSelectionSnapshot, g as CreateOwoMarkCoreOptions, D as DocumentChangeCallback, I as IndentMode, h as IndentResult, K as KeyDownIntent, O as OwoMarkCore, P as PasteIntent, i as SlashStateListener, j as SlashTriggerInfo, k as applyMarkdownIndent, l as createOwoMarkCore, r as resolveIndentSize } from './editor-core-edBvPqBi.js';
3
+ import { h as BlockNode, i as BlockContextType, O as OwoMarkSelection, j as ContainerBlockSyntaxExtension, J as JsonValue, k as ParseMarkdownOptions, a as OwoMarkDocument, l as ConformanceDocument, D as DirtyRange, P as PreviewBlockKind, g as PreviewBlock, m as BlockTransform, n as OwoMarkSharedStateController, o as InlineExtensionPriority, p as InlineSyntaxExtension, T as TokenizeInlineOptions, e as InlineToken, q as TokenizeBlockOptions } from './public-BjF6yWIR.js';
4
+ export { b as BlockContext, d as BlockContextListener, r as BlockExtensionPriority, c as BlockInsertType, s as BlockSyntaxExtension, B as BlockType, t as CLASSLESS_INLINE_TOKEN_TYPES, C as CompositionState, u as ConformanceBlockNode, v as ConformanceContainerNode, w as ConformanceInlineNode, x as ConformanceTableCell, y as ConformanceTableRow, z as ContainerBlockExtensionPriority, f as ContainerFrame, A as ContainerKind, E as CustomBlockRuntimeBinding, F as Decorator, G as DecoratorType, H as HeadingLevel, K as HistoryEntry, L as INLINE_TOKEN_TYPES, M as InlineExtensionHostBlockType, N as InlineScannerMatch, I as InlineTokenType, Q as JsonPrimitive, R as Leaf, S as OwoMarkCommands, U as OwoMarkDocumentTrace, W as OwoMarkEditorLike, X as OwoMarkSharedState, Y as OwoMarkSharedStateStore, Z as ParserDiffScope, _ as ParserExtensionConsumer, $ as ParserExtensionParent, a0 as ParserExtensionScope, a1 as PreviewDirtyReason, a2 as SideAnnotationMemberBlock, a3 as SideAnnotationMemberBlockType, a4 as SideAnnotationSourceKind, a5 as TokenizeBlockExtensionOptions, a6 as VirtualPosition, V as VirtualSelection, a7 as getBlockIndexForPosition, a8 as isVirtualSelectionCollapsed, a9 as linearToVirtual, aa as linearToVirtualPosition, ab as virtualPositionToLinear, ac as virtualPositionsEqual, ad as virtualToLinear } from './public-BjF6yWIR.js';
5
+ export { O as OwoComponentDescriptor, d as OwoEditorEntryDescriptor, f as OwoFeatureFlagKey, g as OwoRuntimeBlockDescriptor, h as OwoSyntaxDescriptor } from './registry-DI94xf3v.js';
6
6
  export { getSyntaxDescriptor, parseInlineSideAnnotationFromText, stripInlineSideAnnotationTail, stripSideContinuationTail, syntaxRegistry } from './semantic/syntax/index.js';
7
7
  export { componentRegistry, getComponentDescriptor, getComponentDescriptorByDirective } from './semantic/components/index.js';
8
8
  export { getRuntimeBlockDescriptor, getRuntimeBlockDescriptorByBlockType, getRuntimeBlockDescriptorByPreviewKind, runtimeBlockRegistry } from './semantic/runtime/index.js';
@@ -10,8 +10,8 @@ export { editorEntryRegistry, getEditorEntryDescriptor, getEditorEntryDescriptor
10
10
  export { WordBoundaryResult, deleteToLineEnd, deleteToLineStart, deleteWordBackward, deleteWordForward } from './internal/commands/word-boundary.js';
11
11
  export { normalizeMarkdownPaste } from './internal/clipboard/paste.js';
12
12
  export { enableMapSet, produce } from 'immer';
13
- import { O as OwoMarkScrollProjectionSnapshot, c as OwoMarkScrollProjectionSegment, S as SourceKey, a as OwoMarkSurfaceGeometrySnapshot, V as ViewportMetrics, G as GlobalScrollPosition } from './types-BdOo-u1R.js';
14
- export { C as ContentId, d as Geometry, b as OwoMarkScrollController, e as OwoMarkScrollDegradedReason, f as OwoMarkSurfaceGeometrySegment, g as OwoMarkSurfaceGeometrySnapshotStatus, h as ScrollProjectionSegmentKind, i as ScrollResolutionResult, j as ScrollSurface, k as ScrollToScrollPositionOptions, l as ScrollToScrollPositionResult } from './types-BdOo-u1R.js';
13
+ import { O as OwoMarkScrollProjectionSnapshot, c as OwoMarkScrollProjectionSegment, S as SourceKey, a as OwoMarkSurfaceGeometrySnapshot, V as ViewportMetrics, G as GlobalScrollPosition } from './types-0QKyuzQy.js';
14
+ export { C as ContentId, d as Geometry, b as OwoMarkScrollController, e as OwoMarkScrollDegradedReason, f as OwoMarkSurfaceGeometrySegment, g as OwoMarkSurfaceGeometrySnapshotStatus, h as ScrollProjectionSegmentKind, i as ScrollResolutionResult, j as ScrollSurface, k as ScrollToScrollPositionOptions, l as ScrollToScrollPositionResult } from './types-0QKyuzQy.js';
15
15
 
16
16
  /**
17
17
  * Resolve the extended BlockContextType from a BlockNode.
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ import {
53
53
  virtualPositionToLinear,
54
54
  virtualPositionsEqual,
55
55
  virtualToLinear
56
- } from "./chunk-WVGCRIJO.js";
56
+ } from "./chunk-WV2K5MNU.js";
57
57
  import {
58
58
  deriveBlockId,
59
59
  deriveSourceKey,
@@ -1,6 +1,6 @@
1
- import { O as OwoMarkSelection, a as OwoMarkDocument, V as VirtualSelection } from '../public-cCK3rvQc.js';
2
- import { O as OwoMarkCore } from '../editor-core-BSoeizSI.js';
3
- export { D as DocumentChangeCallback } from '../editor-core-BSoeizSI.js';
1
+ import { O as OwoMarkSelection, a as OwoMarkDocument, V as VirtualSelection } from '../public-BjF6yWIR.js';
2
+ import { O as OwoMarkCore } from '../editor-core-edBvPqBi.js';
3
+ export { D as DocumentChangeCallback } from '../editor-core-edBvPqBi.js';
4
4
 
5
5
  type OwoMarkEditorInstance = {
6
6
  mount(root: HTMLElement): void;
@@ -3,10 +3,10 @@ import {
3
3
  fullRender,
4
4
  readSelection,
5
5
  restoreSelection
6
- } from "../chunk-CJSBFWKS.js";
6
+ } from "../chunk-YS3HGP3M.js";
7
7
  import {
8
8
  createOwoMarkCore
9
- } from "../chunk-WVGCRIJO.js";
9
+ } from "../chunk-WV2K5MNU.js";
10
10
  import "../chunk-WFPUIPWU.js";
11
11
  import "../chunk-ROJILHRQ.js";
12
12
  import "../chunk-BKJCBEI7.js";
@@ -470,4 +470,4 @@ type HistoryEntry = {
470
470
  selection: OwoMarkSelection;
471
471
  };
472
472
 
473
- 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 };
473
+ 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 ContainerFrame as f, type PreviewBlock as g, type BlockNode as h, type BlockContextType as i, type ContainerBlockSyntaxExtension as j, type ParseMarkdownOptions as k, type ConformanceDocument as l, type BlockTransform as m, type OwoMarkSharedStateController as n, type InlineExtensionPriority as o, type InlineSyntaxExtension as p, type TokenizeBlockOptions as q, type BlockExtensionPriority as r, type BlockSyntaxExtension as s, CLASSLESS_INLINE_TOKEN_TYPES as t, type ConformanceBlockNode as u, type ConformanceContainerNode as v, type ConformanceInlineNode as w, type ConformanceTableCell as x, type ConformanceTableRow as y, type ContainerBlockExtensionPriority as z };
@@ -1,4 +1,4 @@
1
- import { P as PreviewBlockKind } from './public-cCK3rvQc.js';
1
+ import { P as PreviewBlockKind } from './public-BjF6yWIR.js';
2
2
 
3
3
  type OwoFeatureFlagKey = 'enableSideAnnotation' | 'enableMath' | 'enableComponents';
4
4
  type OwoSemanticDescriptorFamily = 'syntax' | 'component' | 'runtime' | 'editor';
@@ -1,6 +1,6 @@
1
- import { c as OwoDescriptorRegistry, O as OwoComponentDescriptor } from '../../registry-6IkGJsLt.js';
2
- export { a as OwoComponentKind, b as OwoComponentPayloadStrategy } from '../../registry-6IkGJsLt.js';
3
- import '../../public-cCK3rvQc.js';
1
+ import { c as OwoDescriptorRegistry, O as OwoComponentDescriptor } from '../../registry-DI94xf3v.js';
2
+ export { a as OwoComponentKind, b as OwoComponentPayloadStrategy } from '../../registry-DI94xf3v.js';
3
+ import '../../public-BjF6yWIR.js';
4
4
 
5
5
  declare const componentRegistry: OwoDescriptorRegistry<OwoComponentDescriptor>;
6
6
  declare function getComponentDescriptor(key: string): OwoComponentDescriptor;
@@ -1,5 +1,5 @@
1
- import { c as OwoDescriptorRegistry, d as OwoEditorEntryDescriptor, e as OwoEditorEntryPresentation } from '../../registry-6IkGJsLt.js';
2
- import '../../public-cCK3rvQc.js';
1
+ import { c as OwoDescriptorRegistry, d as OwoEditorEntryDescriptor, e as OwoEditorEntryPresentation } from '../../registry-DI94xf3v.js';
2
+ import '../../public-BjF6yWIR.js';
3
3
 
4
4
  declare const editorEntryRegistry: OwoDescriptorRegistry<OwoEditorEntryDescriptor>;
5
5
  declare function getEditorEntryDescriptor(key: string): OwoEditorEntryDescriptor;
@@ -1,7 +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-6IkGJsLt.js';
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-DI94xf3v.js';
2
2
  export { validateComponentDescriptors, validateEditorEntryDescriptors, validateRuntimeDescriptors, validateSyntaxDescriptors } from './shared/index.js';
3
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
4
  export { componentRegistry, getComponentDescriptor, getComponentDescriptorByDirective } from './components/index.js';
5
5
  export { getRuntimeBlockDescriptor, getRuntimeBlockDescriptorByBlockType, getRuntimeBlockDescriptorByPreviewKind, runtimeBlockRegistry } from './runtime/index.js';
6
6
  export { editorEntryRegistry, getEditorEntryDescriptor, getEditorEntryDescriptorByCommandId, resolveEditorEntryPresentation } from './editor/index.js';
7
- import '../public-cCK3rvQc.js';
7
+ import '../public-BjF6yWIR.js';
@@ -1,5 +1,5 @@
1
- import { g as OwoRuntimeBlockDescriptor, c as OwoDescriptorRegistry } from '../../registry-6IkGJsLt.js';
2
- import '../../public-cCK3rvQc.js';
1
+ import { g as OwoRuntimeBlockDescriptor, c as OwoDescriptorRegistry } from '../../registry-DI94xf3v.js';
2
+ import '../../public-BjF6yWIR.js';
3
3
 
4
4
  declare const runtimeBlockRegistry: OwoDescriptorRegistry<OwoRuntimeBlockDescriptor>;
5
5
  declare function getRuntimeBlockDescriptor(key: string): OwoRuntimeBlockDescriptor;
@@ -1,6 +1,6 @@
1
- import { O as OwoComponentDescriptor, d as OwoEditorEntryDescriptor, g as OwoRuntimeBlockDescriptor, h as OwoSyntaxDescriptor } from '../../registry-6IkGJsLt.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-6IkGJsLt.js';
3
- import '../../public-cCK3rvQc.js';
1
+ import { O as OwoComponentDescriptor, d as OwoEditorEntryDescriptor, g as OwoRuntimeBlockDescriptor, h as OwoSyntaxDescriptor } from '../../registry-DI94xf3v.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-DI94xf3v.js';
3
+ import '../../public-BjF6yWIR.js';
4
4
 
5
5
  declare function validateSyntaxDescriptors(descriptors: readonly OwoSyntaxDescriptor[]): void;
6
6
  declare function validateComponentDescriptors(descriptors: readonly OwoComponentDescriptor[]): void;
@@ -1,5 +1,5 @@
1
- import { h as OwoSyntaxDescriptor, c as OwoDescriptorRegistry } from '../../registry-6IkGJsLt.js';
2
- import '../../public-cCK3rvQc.js';
1
+ import { h as OwoSyntaxDescriptor, c as OwoDescriptorRegistry } from '../../registry-DI94xf3v.js';
2
+ import '../../public-BjF6yWIR.js';
3
3
 
4
4
  /** Fence-only display math line, e.g. `$$`. */
5
5
  declare const MATH_FENCE_RE: RegExp;
@@ -1,4 +1,4 @@
1
- import { P as PreviewBlockKind } from './public-cCK3rvQc.js';
1
+ import { P as PreviewBlockKind } from './public-BjF6yWIR.js';
2
2
 
3
3
  type ContentId = string;
4
4
  type SourceKey = string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owomark/core",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Framework-agnostic core engine for the OwoMark editor.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",