oasis-editor 0.0.157 → 0.0.159

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,15 @@
1
+ declare module "./nodes.js" {
2
+ interface EditorRunBase {
3
+ /** Enclosing inline `w:sdt` content controls, outermost first. */
4
+ sdtWrappers?: EditorSdtBlockWrapper[];
5
+ }
6
+ interface EditorTableRowNode {
7
+ /** Enclosing row-level `w:sdt` content controls, outermost first. */
8
+ sdtWrappers?: EditorSdtBlockWrapper[];
9
+ }
10
+ interface EditorTableCellNode {
11
+ /** Enclosing cell-level `w:sdt` content controls, outermost first. */
12
+ sdtWrappers?: EditorSdtBlockWrapper[];
13
+ }
14
+ }
15
+ export {};
@@ -1,11 +1,3 @@
1
- /**
2
- * Re-export the refactored model module under its original path.
3
- *
4
- * The 1411-line monolithic `model.ts` was split into focused modules under
5
- * `./model/` (types, queries, styleResolution, pageGeometry, documentIndex,
6
- * editingZones, etc.). This file is now a one-liner barrel so the 43+
7
- * existing `import { ... } from "@/model.js"` sites continue to work
8
- * without any change.
9
- */
1
+
10
2
  export * from './model/index.js';
11
3
  export * from './tableStyleResolver.js';
@@ -0,0 +1,3 @@
1
+ import { EditorDocument } from '../../core/model.js';
2
+
3
+ export declare function synchronizeBoundContentControls(document: EditorDocument): number;
@@ -1,10 +1,4 @@
1
1
  import { EditorTableNode } from '../../core/model.js';
2
2
  import { SerializeTableParagraphXml } from './tableXml.js';
3
3
 
4
- /**
5
- * Serializes a table canonically and then overlays source-backed table, row and
6
- * cell property containers. Text/content stays authoritative from the editor;
7
- * source attributes, extension children and unknown property children survive
8
- * while relationship-bearing fragments continue to use the conservative path.
9
- */
10
4
  export declare function serializeTableXmlPreservingSource(table: EditorTableNode, serializeParagraphXml: SerializeTableParagraphXml): string;
@@ -0,0 +1,9 @@
1
+ import { Element as XmlElement } from '@xmldom/xmldom';
2
+ import { EditorTableNode } from '../../core/model.js';
3
+
4
+ /**
5
+ * Rebuilds row-level and cell-level `w:sdt` envelopes after canonical table
6
+ * serialization and source-property overlay have completed. Structural wrappers
7
+ * therefore do not interfere with the existing row/cell property pipeline.
8
+ */
9
+ export declare function wrapTableStructuralSdts(table: EditorTableNode, tableElement: XmlElement): void;
@@ -1,12 +1,6 @@
1
1
  import { EditorBlockNode, EditorNamedStyle, EditorParagraphNode, EditorParagraphStyle } from '../../../core/model.js';
2
2
  import { DocContext } from '../docxTypes.js';
3
3
 
4
- /**
5
- * Serialize a block run, re-wrapping any block-level `w:sdt` content controls
6
- * preserved on import. Consecutive blocks sharing an outermost wrapper `groupId`
7
- * are coalesced back into one `<w:sdt>` envelope; the wrapper is stripped before
8
- * recursing so nested content controls re-wrap from the inside out.
9
- */
10
4
  export declare function serializeBlocksXml(blocks: EditorBlockNode[], context: DocContext, styles: Record<string, EditorNamedStyle> | undefined): string;
11
5
  export declare function serializeParagraphXml(paragraph: EditorParagraphNode, context: DocContext, styles: Record<string, EditorNamedStyle> | undefined, overrides?: {
12
6
  align?: EditorParagraphStyle["align"];
@@ -0,0 +1,8 @@
1
+ import { EditorTextRun } from '../../../core/model.js';
2
+
3
+ /**
4
+ * Re-wraps inline SDTs around their edited run stream. Consecutive runs sharing
5
+ * the same outer wrapper are coalesced into one `w:sdt`; nested wrappers recurse
6
+ * after the outer wrapper is stripped from the temporary run view.
7
+ */
8
+ export declare function serializeRunsWithInlineSdts(runs: EditorTextRun[], serializeRun: (run: EditorTextRun) => string): string;
@@ -1,5 +1,5 @@
1
1
  import { Element as XmlElement } from '@xmldom/xmldom';
2
- import { EditorBlockNode, EditorTextStyle, EditorImageRunData, EditorTextBoxData, EditorMathExpression } from '../../../core/model.js';
2
+ import { EditorBlockNode, EditorTextStyle, EditorImageRunData, EditorTextBoxData, EditorMathExpression, EditorSdtBlockWrapper } from '../../../core/model.js';
3
3
 
4
4
  export type ParseNestedBlocks = (container: XmlElement) => Promise<EditorBlockNode[]>;
5
5
  /**
@@ -28,6 +28,8 @@ export interface ImportedRun {
28
28
  image?: EditorImageRunData;
29
29
  textBox?: EditorTextBoxData;
30
30
  styles?: EditorTextStyle;
31
+ /** Enclosing inline `w:sdt` wrappers, outermost first. */
32
+ sdtWrappers?: EditorSdtBlockWrapper[];
31
33
  field?: {
32
34
  type: "PAGE" | "NUMPAGES";
33
35
  };
@@ -0,0 +1,13 @@
1
+ import { Element as XmlElement } from '@xmldom/xmldom';
2
+ import { EditorSdtBlockWrapper } from '../../core/model.js';
3
+
4
+ export interface SdtWrappedWordChild {
5
+ element: XmlElement;
6
+ sdtWrappers?: EditorSdtBlockWrapper[];
7
+ }
8
+ /**
9
+ * Collects direct Word children while transparently unwrapping any intervening
10
+ * `w:sdt/w:sdtContent` containers. Wrapper metadata is returned outermost-first
11
+ * so the canonical exporter can rebuild nested structural content controls.
12
+ */
13
+ export declare function collectSdtWrappedWordChildren(container: XmlElement, localName: string): SdtWrappedWordChild[];