oasis-editor 0.0.357 → 0.0.359

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.
@@ -0,0 +1,7 @@
1
+ import { EditorState } from '../model.js';
2
+ /** Returns undefined for ordinary text edits, or the resulting state when
3
+ * a keyboard deletion touches exactly one opaque replacement character.
4
+ * Ambiguous provenance, non-main stories and tracked deletion are no-ops
5
+ * until their relationship and revision semantics can be proven.
6
+ */
7
+ export declare function tryDeleteOpaqueObject(state: EditorState, direction: "backward" | "forward"): EditorState | undefined;
@@ -8,17 +8,17 @@
8
8
  */
9
9
  export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, PageNumberFormat, EditorRevision, EditorRevisionMetadata, EditorMoveRangeMarker, EditorNumberingRevision, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
10
10
  export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableFloatingLayout, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorTableConditionalType, EditorTableConditionalFlags, EditorTableCellStyle, EditorNamedStyle, } from './types/styles.js';
11
- export type { EditorRunBase, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorSdtBlockWrapper, EditorSdtPr, EditorSdtSubtype, EditorSdtListItem, EditorSdtDataBinding, EditorParagraphNode, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from './types/nodes.js';
11
+ export type { EditorRunBase, EditorOpaqueRunData, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorSdtBlockWrapper, EditorSdtPr, EditorSdtSubtype, EditorSdtListItem, EditorSdtDataBinding, EditorParagraphNode, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from './types/nodes.js';
12
12
  export type { EditorMathNode, EditorMathText, EditorMathFraction, EditorMathRadical, EditorMathScript, EditorMathDelimiter, EditorMathAccent, EditorMathNary, EditorMathLimit, EditorMathMatrix, EditorMathBox, EditorMathGroup, EditorMathRaw, EditorMathStyle, EditorMathExpression, } from './types/math.js';
13
13
  export { EMPTY_EDITOR_MATH_EXPRESSION, MATH_OBJECT_REPLACEMENT, } from './types/math.js';
14
14
  export type { RunKind, RunOfKind, RunVisitor } from './runKind.js';
15
- export { getRunKind, isInlineObjectRun, visitRun, getRunImage, getRunTextBox, getRunField, getRunFieldChar, getRunFieldInstruction, getRunFootnoteReference, getRunEndnoteReference, getRunSym, getRunMath, } from './runKind.js';
15
+ export { getRunKind, isInlineObjectRun, visitRun, getRunImage, getRunTextBox, getRunField, getRunFieldChar, getRunFieldInstruction, getRunFootnoteReference, getRunEndnoteReference, getRunSym, getRunMath, getRunOpaque, } from './runKind.js';
16
16
  export type { EditorFootnote } from './types/documentFootnotes.js';
17
17
  export type { EditorEndnote } from './types/documentEndnotes.js';
18
18
  export type { EditorBookmark, EditorBookmarkAnchor, EditorBookmarks, } from './types/documentBookmarks.js';
19
19
  export type { EditorComment, EditorCommentAnchor, EditorComments, } from './types/documentComments.js';
20
20
  export type { EditorReviewActivity, EditorReviewActivityKind, } from './types/documentReviewActivity.js';
21
- export type { EditorOpcPartKind, EditorOpcPartEncoding, EditorOpcRelationship, EditorOpcContentTypes, EditorOpcPart, EditorDocxDiagnostic, EditorDocxSourcePackage, } from './types/docxSourcePackage.js';
21
+ export type { EditorOpcPartKind, EditorOpcPartEncoding, EditorOpcRelationship, EditorOpcContentTypes, EditorOpcPart, EditorDocxDiagnostic, EditorDocxSourcePackage, EditorDocxOpaqueObject, } from './types/docxSourcePackage.js';
22
22
  export type { EditorPageMargins, EditorPageSettings, EditorColumnsSettings, EditorSection, EditorSectionBreakType, EditorSectionPropertiesSnapshot, EditorPageNumbering, EditorSectionVerticalAlign, EditorFontInfo, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocumentDesign, EditorThemeData, EditorWatermark, EditorPageBorder, EditorDocument, } from './types/document.js';
23
23
  export type { EditorPosition, EditorSelection, EditorEditingZone, } from './types/selection.js';
24
24
  export type { EditorCaretSlot, EditorLayoutFragmentChar, EditorLayoutFragment, EditorLayoutLine, EditorResolvedTab, EditorLayoutParagraph, EditorLayoutBlock, TableCellBlockPosition, EditorLayoutPage, EditorLayoutDocument, } from './types/layout.js';
@@ -1,4 +1,4 @@
1
- import { EditorTextBoxData, EditorTextRun } from './types/nodes.js';
1
+ import { EditorTextBoxData, EditorTextRun, EditorOpaqueRunData } from './types/nodes.js';
2
2
  import { EditorMathExpression } from './types/math.js';
3
3
  import { EditorFieldChar, EditorFieldData, EditorImageRunData, EditorFootnoteReferenceData, EditorEndnoteReferenceData } from './types/primitives.js';
4
4
  /**
@@ -27,7 +27,9 @@ export declare function getRunSym(run: EditorTextRun): {
27
27
  char: string;
28
28
  } | undefined;
29
29
  export declare function getRunMath(run: EditorTextRun): EditorMathExpression | undefined;
30
+ export declare function getRunOpaque(run: EditorTextRun): EditorOpaqueRunData | undefined;
30
31
  export interface RunVisitor<R> {
32
+ opaque(run: RunOfKind<"opaque">): R;
31
33
  text(run: RunOfKind<"text">): R;
32
34
  image(run: RunOfKind<"image">): R;
33
35
  textBox(run: RunOfKind<"textBox">): R;
@@ -223,6 +223,16 @@ export interface EditorDocument {
223
223
  * paths. It is the preservation source for unsupported package parts.
224
224
  */
225
225
  sourcePackage?: EditorDocxSourcePackage;
226
+ /**
227
+ * Explicit deletion intents for uniquely identified opaque main-story
228
+ * objects. Immutable state metadata travels with undo/redo snapshots;
229
+ * never mutate the shared original OPC package to record an edit.
230
+ */
231
+ opaqueDeletionIntents?: ReadonlyArray<{
232
+ ownerPath: string;
233
+ ordinal: number;
234
+ signature: string;
235
+ }>;
226
236
  /**
227
237
  * Out-of-band asset registry. Image runs reference entries here using
228
238
  * `src = "asset:<id>"`. The map itself is treated as append-only and is
@@ -1,4 +1,4 @@
1
- import { EditorBlockNode, EditorTextBoxData } from './nodes.js';
1
+ import { EditorBlockNode, EditorTextBoxData, EditorOpaqueRunData } from './nodes.js';
2
2
  import { EditorMathExpression } from './math.js';
3
3
  import { EditorPageSettings } from './document.js';
4
4
  import { EditorRevision, EditorImageRunData, EditorTabStop } from './primitives.js';
@@ -25,6 +25,7 @@ export interface EditorLayoutFragment {
25
25
  image?: EditorImageRunData;
26
26
  textBox?: EditorTextBoxData;
27
27
  math?: EditorMathExpression;
28
+ opaque?: EditorOpaqueRunData;
28
29
  revision?: EditorRevision;
29
30
  chars: EditorLayoutFragmentChar[];
30
31
  }
@@ -1,3 +1,4 @@
1
+ import { EditorDocxOpaqueObject } from './docxSourcePackage.js';
1
2
  import { EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorMoveRangeMarker, EditorParagraphListStyle, EditorNumberingRevision, EditorRevision, EditorPropertyRevision, EditorStructuralRevision, EditorTableRowHeightRule } from './primitives.js';
2
3
  import { EditorMathExpression } from './math.js';
3
4
  import { EditorParagraphStyle, EditorTableCellStyle, EditorTableStyle, EditorTableConditionalFlags, EditorTextStyle } from './styles.js';
@@ -79,7 +80,20 @@ export interface EditorRunBase {
79
80
  * missing branch is a compile error) and invalid combinations (e.g. `image` +
80
81
  * `textBox`) are unrepresentable (O1). The `kind` values mirror {@link RunKind}.
81
82
  */
83
+ /** Original XML plus conservative flow-placeholder dimensions. */
84
+ export interface EditorOpaqueRunData {
85
+ objectKind: EditorDocxOpaqueObject["kind"];
86
+ fragmentXml: string;
87
+ signature: string;
88
+ relationshipIds: string[];
89
+ width: number;
90
+ height: number;
91
+ placement?: "inline" | "anchor";
92
+ }
82
93
  export type EditorTextRun = (EditorRunBase & {
94
+ kind: "opaque";
95
+ opaque: EditorOpaqueRunData;
96
+ }) | (EditorRunBase & {
83
97
  kind: "text";
84
98
  }) | (EditorRunBase & {
85
99
  kind: "image";