oasis-editor 0.0.403 → 0.0.405

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.
@@ -20,6 +20,7 @@ export interface UseEditorSurfaceEventsProps {
20
20
  /** Called after the final pointer selection has been committed to EditorState. */
21
21
  onSelectionFinalized?: () => void;
22
22
  clearPreferredColumn: () => void;
23
+ scrollToLinkedParagraph?: (paragraphId: string) => void;
23
24
  resetTransactionGrouping: () => void;
24
25
  focusInputAfterPointerSelection: () => void;
25
26
  /** Synchronous focus, required for touch to raise the on-screen keyboard. */
@@ -9422,9 +9422,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
9422
9422
  const T = ot(lt(it(e, Qe, "textDirection"), "val"));
9423
9423
  T && (r.textDirection = T);
9424
9424
  const I = lt(it(e, Qe, "outlineLvl"), "val");
9425
- if (void 0 !== I) {
9425
+ if (null != I && /^[0-9]$/.test(I.trim())) {
9426
9426
  const e = Number(I);
9427
- Number.isFinite(e) && e >= 0 && e <= 8 && (r.outlineLevel = e);
9427
+ Number.isInteger(e) && e >= 0 && e <= 9 && (r.outlineLevel = e);
9428
9428
  }
9429
9429
  const _ = pt(e, "suppressLineNumbers");
9430
9430
  void 0 !== _ && (r.suppressLineNumbers = _);
@@ -0,0 +1,5 @@
1
+ import { EditorState } from '../model.js';
2
+ /** Resolve a flat TOC entry to one certified main-story bookmark target.
3
+ * The returned state changes only navigation/selection, never document data.
4
+ */
5
+ export declare function resolveTocLinkNavigation(state: EditorState, paragraphId: string, offset: number): EditorState | undefined;
@@ -0,0 +1,20 @@
1
+ import { EditorState, EditorLayoutDocument } from '../model.js';
2
+ import { TocPaginate, TocConvergenceResult } from './tocConvergence.js';
3
+ export interface TocLinkResult {
4
+ state: EditorState;
5
+ status: "updated" | "unchanged" | "unsupported" | "unresolved";
6
+ layout?: EditorLayoutDocument;
7
+ }
8
+ /** Qualify an already-current flat TOC before adding internal links.
9
+ * Preserve paragraph/run identities and text offsets. Re-measure after adding
10
+ * links; do not publish a candidate whose page labels no longer match.
11
+ * This is an opt-in staging API, not a Ribbon command or automatic refresh.
12
+ */
13
+ export declare function linkQualifiedTableOfContents(original: EditorState, paginate?: TocPaginate): TocLinkResult;
14
+ /** Regenerate owned flat linked TOCs transactionally.
15
+ * First accept a certified current cache; otherwise remove only owned links
16
+ * on a provisional snapshot, converge plain labels, then reattach targets
17
+ * and remeasure. No intermediate state enters history. Foreign/ambiguous
18
+ * links and ranges anchored in replaced entries are not rewritten.
19
+ */
20
+ export declare function refreshLinkedTableOfContents(original: EditorState, paginate?: TocPaginate): TocConvergenceResult;
@@ -0,0 +1,5 @@
1
+ import { EditorDocument, EditorParagraphNode } from '../model.js';
2
+ /** Return a 1-based TOC level, null for body text, or undefined when the
3
+ * source style graph cannot certify the level. Unlike the general rendering
4
+ * cascade this bounded lookup never recurses on a malformed basedOn graph. */
5
+ export declare function createTocOutlineResolver(document: EditorDocument): (p: EditorParagraphNode) => number | null | undefined;