oasis-editor 0.0.379 → 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-DYS_j7dp.js +1 -0
- package/dist/core/document/fieldMutation.d.ts +16 -0
- package/dist/core/document/fieldStoryGraph.d.ts +49 -0
- package/dist/core/document/paragraphRunEdit.d.ts +9 -0
- package/dist/{defaultToolbar-B4GpCSDP.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
- package/dist/OasisEditorApp-Bllds8vV.js +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EditorParagraphNode, EditorState, EditorTextRun } from '../model.js';
|
|
2
|
+
export declare const hasFieldMarkers: (p: EditorParagraphNode) => boolean;
|
|
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. */
|
|
6
|
+
export declare function protectedFieldRanges(p: EditorParagraphNode): Array<{
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
}> | undefined;
|
|
10
|
+
export declare function fieldRangeProtected(p: EditorParagraphNode, start: number, end: number): boolean;
|
|
11
|
+
export declare function hasUnresolvedFieldStory(state: EditorState): boolean;
|
|
12
|
+
export declare function fieldSelectionProtected(state: EditorState): boolean;
|
|
13
|
+
/** Rebuild a range without ever sending invisible controls to a text mapper.
|
|
14
|
+
* Unlike sliceRuns (clipboard/visible selection), every zero-width run is
|
|
15
|
+
* visited exactly once. The mapper is called only for visible intersections. */
|
|
16
|
+
export declare function mapFieldAdjacentRuns(p: EditorParagraphNode, start: number, end: number, mapper: (r: EditorTextRun) => EditorTextRun | null): EditorTextRun[];
|
|
@@ -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;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { EditorParagraphNode, EditorTextRun } from '../model.js';
|
|
2
2
|
export declare function insertRunsAtOffset(paragraph: EditorParagraphNode, offset: number, textRuns: EditorTextRun[]): EditorParagraphNode;
|
|
3
|
+
/** Preserve the zero-width field stream during a single-paragraph insertion.
|
|
4
|
+
* At ambiguous exact boundaries preserve marker order and insert after the
|
|
5
|
+
* encountered markers (before subsequent visible text). General selection
|
|
6
|
+
* deletion, multi-paragraph splits and field-range semantics require a
|
|
7
|
+
* story-aware field span model; this is not that model. */
|
|
8
|
+
export declare function splitForFieldAdjacentInsertion(paragraph: EditorParagraphNode, offset: number): {
|
|
9
|
+
beforeRuns: EditorTextRun[];
|
|
10
|
+
afterRuns: EditorTextRun[];
|
|
11
|
+
};
|