oasis-editor 0.0.380 → 0.0.381
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/{OasisEditorApp-DPVuZiUV.js → OasisEditorApp-DYS_j7dp.js} +1 -1
- package/dist/core/document/fieldMutation.d.ts +3 -5
- package/dist/core/document/fieldStoryGraph.d.ts +49 -0
- package/dist/{defaultToolbar-NLzzqKtC.js → defaultToolbar-BicZXnkp.js} +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { EditorParagraphNode, EditorState, EditorTextRun } from '../model.js';
|
|
2
2
|
export declare const hasFieldMarkers: (p: EditorParagraphNode) => boolean;
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Balanced paragraph-local spans allow ordinary neighboring text edits.
|
|
7
|
-
*/
|
|
3
|
+
/** The paragraph-local mutation gate deliberately remains conservative.
|
|
4
|
+
* The story graph knows cross-paragraph topology, but mutation commands have
|
|
5
|
+
* not yet been qualified to operate across those spans. */
|
|
8
6
|
export declare function protectedFieldRanges(p: EditorParagraphNode): Array<{
|
|
9
7
|
start: number;
|
|
10
8
|
end: number;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EditorParagraphNode } from '../model/types/nodes.js';
|
|
2
|
+
import { EditorFieldChar } from '../model/types/primitives.js';
|
|
3
|
+
/** Coordinates in one ordered story snapshot. Run index distinguishes
|
|
4
|
+
* invisible markers sharing the same UTF-16 text offset. */
|
|
5
|
+
export interface FieldStoryPoint {
|
|
6
|
+
paragraphId: string;
|
|
7
|
+
paragraphIndex: number;
|
|
8
|
+
runId: string;
|
|
9
|
+
runIndex: number;
|
|
10
|
+
offset: number;
|
|
11
|
+
}
|
|
12
|
+
export type FieldStoryPart = {
|
|
13
|
+
kind: "instruction";
|
|
14
|
+
point: FieldStoryPoint;
|
|
15
|
+
raw: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "nested";
|
|
18
|
+
fieldIndex: number;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "run";
|
|
21
|
+
point: FieldStoryPoint;
|
|
22
|
+
};
|
|
23
|
+
export interface FieldStorySpan {
|
|
24
|
+
/** Index into the graph, not a persistent document identifier. */
|
|
25
|
+
index: number;
|
|
26
|
+
parentIndex: number | null;
|
|
27
|
+
begin: FieldStoryPoint;
|
|
28
|
+
beginMarker: EditorFieldChar;
|
|
29
|
+
separator?: FieldStoryPoint;
|
|
30
|
+
end?: FieldStoryPoint;
|
|
31
|
+
code: FieldStoryPart[];
|
|
32
|
+
result: FieldStoryPart[];
|
|
33
|
+
}
|
|
34
|
+
export interface FieldStoryDiagnostic {
|
|
35
|
+
kind: "orphan-end" | "orphan-separator" | "orphan-instruction" | "duplicate-separator" | "instruction-after-separator" | "unclosed-field";
|
|
36
|
+
point: FieldStoryPoint;
|
|
37
|
+
}
|
|
38
|
+
export interface FieldStoryGraph {
|
|
39
|
+
spans: FieldStorySpan[];
|
|
40
|
+
diagnostics: FieldStoryDiagnostic[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Read-only, iterative reconstruction of complex fields in ONE story.
|
|
44
|
+
* Caller supplies paragraphs in XML order; never concatenate different
|
|
45
|
+
* headers, notes or text boxes. No evaluation, repair or mutation occurs.
|
|
46
|
+
* Nested operands are represented in order, not flattened into outer text.
|
|
47
|
+
* Time and storage are linear in the number of runs, even for deep nesting.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildFieldStoryGraph(paragraphs: readonly EditorParagraphNode[]): FieldStoryGraph;
|