oasis-editor 0.0.385 → 0.0.387

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.
@@ -8,13 +8,9 @@ export interface InsertCrossReferenceOptions {
8
8
  }
9
9
  /** Resolve a bookmark by its Word name, or undefined. */
10
10
  export declare function findBookmarkByName(state: EditorState, name: string): EditorBookmark | undefined;
11
- /**
12
- * Resolve the text a REF field should display for a bookmark: the flattened
13
- * text of the bookmarked range (from the start paragraph offset to the end
14
- * paragraph offset, or the whole start paragraph when the bookmark is
15
- * zero-width). Falls back to "Error" style placeholder when the target
16
- * bookmark cannot be located — mirroring a broken cross-reference.
17
- */
11
+ /** Resolve only the requested bookmark range. The shared field context
12
+ * refuses unsupported story/field dependencies instead of concatenating
13
+ * unrelated paragraphs or pretending missing geometry is known. */
18
14
  export declare function resolveBookmarkReferenceText(state: EditorState, bookmark: EditorBookmark): string;
19
15
  /**
20
16
  * Insert a cross-reference field at the caret (any zone). When the target
@@ -0,0 +1,11 @@
1
+ import { EditorDocument, EditorLayoutDocument } from '../model.js';
2
+ import { FieldEvaluationContext } from './fieldEvaluation.js';
3
+ /** Index a document snapshot and its completed layout. No evaluation or cache
4
+ * mutation occurs while building the index. Rebuild for each new snapshot. */
5
+ export declare function createDocumentFieldContext(document: EditorDocument, layout?: EditorLayoutDocument): {
6
+ bookmarkText: (name: string) => string | null | undefined;
7
+ bookmarkPage: (name: string) => number | null | undefined;
8
+ pageIndexAt: (paragraphId: string, offset: number) => number | undefined;
9
+ forPage: (pageIndex: number) => FieldEvaluationContext;
10
+ forPosition: (paragraphId: string, offset: number) => FieldEvaluationContext;
11
+ };