@docx-editor.dev/core 2.7.0 → 2.9.0
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/automation.cjs +1 -1
- package/dist/automation.d.cts +5 -6
- package/dist/automation.d.ts +5 -6
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +12 -12
- package/dist/binding.d.ts +12 -12
- package/dist/binding.js +1 -1
- package/dist/chunk-2RDMWJPF.cjs +2 -0
- package/dist/chunk-5VC5HGJA.js +2 -0
- package/dist/chunk-A2JIBG75.js +1 -0
- package/dist/chunk-DKMKH77K.cjs +5 -0
- package/dist/chunk-DTQPINIM.js +15 -0
- package/dist/chunk-HHFMXG25.js +2 -0
- package/dist/chunk-IEXDXWTA.cjs +1 -0
- package/dist/chunk-IMMAG4QP.cjs +10 -0
- package/dist/chunk-KBCC66CI.js +5 -0
- package/dist/chunk-P5YSGSYC.cjs +15 -0
- package/dist/chunk-Q66ZJFRE.js +18 -0
- package/dist/chunk-TP4EHWEX.cjs +18 -0
- package/dist/chunk-VUJGPCPU.js +10 -0
- package/dist/chunk-XMHWBL3K.cjs +2 -0
- package/dist/contracts/document.d.cts +25 -3
- package/dist/contracts/document.d.ts +25 -3
- package/dist/contracts/editor.d.cts +10 -10
- package/dist/contracts/editor.d.ts +10 -10
- package/dist/contracts/interaction.d.cts +9 -9
- package/dist/contracts/interaction.d.ts +9 -9
- package/dist/contracts/modules.d.cts +6 -5
- package/dist/contracts/modules.d.ts +6 -5
- package/dist/contracts/types.d.cts +101 -1
- package/dist/contracts/types.d.ts +101 -1
- package/dist/{custom-node-writes-BpOBjNzo.d.ts → custom-node-writes-7ERv0f_X.d.cts} +25 -11
- package/dist/{custom-node-writes-C_AlNvds.d.cts → custom-node-writes-QyVZdTUA.d.ts} +25 -11
- package/dist/{editor-CXaGlcUa.d.cts → editor-CojjwMmF.d.cts} +78 -67
- package/dist/{editor-C--WWCBA.d.ts → editor-PUlv5Pp7.d.ts} +78 -67
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +124 -14
- package/dist/editor.d.cts +68 -36
- package/dist/editor.d.ts +68 -36
- package/dist/editor.js +1 -1
- package/dist/{hf-references-BdjsQNE_.d.ts → hf-references-Dvk6De4Q.d.cts} +1 -2
- package/dist/{hf-references-CgEOSw3i.d.cts → hf-references-z5Y4N1ab.d.ts} +1 -2
- package/dist/{image-resources-Bkmu1Jei.d.cts → image-resources-DQOiwOuE.d.cts} +2 -2
- package/dist/{image-resources-BWd5u-op.d.ts → image-resources-eZqD_-vC.d.ts} +2 -2
- package/dist/{index-QsE1xXyT.d.cts → index-DGPSeLI0.d.cts} +1632 -1435
- package/dist/{index-DW0TsrYl.d.ts → index-oN-v8DQ5.d.ts} +1632 -1435
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +545 -336
- package/dist/layout.d.ts +545 -336
- package/dist/layout.js +1 -1
- package/dist/{note-nodes-BPSTVDMr.d.ts → note-nodes-BNCANoGN.d.ts} +1 -1
- package/dist/{note-nodes-C6DLxlvj.d.cts → note-nodes-DL-Au22P.d.cts} +1 -1
- package/dist/note-properties-CQlxjic_.d.cts +67 -0
- package/dist/note-properties-jvnw_DGG.d.ts +67 -0
- package/dist/omml-equation-BD-LsmWE.d.cts +84 -0
- package/dist/omml-equation-Dd3mBep-.d.ts +84 -0
- package/dist/{ooxml-tree-BU0e3DVi.d.ts → ooxml-package-CdEy9ufK.d.cts} +352 -1
- package/dist/{ooxml-tree-BU0e3DVi.d.cts → ooxml-package-CdEy9ufK.d.ts} +352 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +9 -8
- package/dist/output.d.ts +9 -8
- package/dist/output.js +1 -1
- package/dist/{protocol-CD7slqvl.d.cts → protocol-C7ahrdUx.d.ts} +28 -4
- package/dist/{protocol-DsbfgBwA.d.ts → protocol-UuZOcOp7.d.cts} +28 -4
- package/dist/{review-support-Cr2n7f1-.d.ts → review-items-D5SPFtsO.d.ts} +49 -102
- package/dist/{review-support-oQrX6Xu3.d.cts → review-items-DpsqTHio.d.cts} +49 -102
- package/dist/review-reads-B2Ji3fVU.d.ts +176 -0
- package/dist/review-reads-CP106AHp.d.cts +176 -0
- package/dist/{revision-projection-UKqvPa4-.d.ts → revision-projection-CILpvv4M.d.ts} +1 -1
- package/dist/{revision-projection-WzlQGBJx.d.cts → revision-projection-Cc4wz30g.d.cts} +1 -1
- package/dist/{semantic-cell-selection-C8RC0VnN.d.ts → semantic-cell-selection-BWhVAk5B.d.ts} +16 -4
- package/dist/{semantic-cell-selection-CQOgvtbT.d.cts → semantic-cell-selection-DJPjBWzf.d.cts} +16 -4
- package/dist/{semantic-interaction-f4GyBQ_1.d.cts → semantic-interaction-BjOcDB06.d.cts} +14 -2
- package/dist/{semantic-interaction-C45D_oG2.d.ts → semantic-interaction-Cca1-X_a.d.ts} +14 -2
- package/dist/{semantic-paint-DUkGLJ_L.d.ts → semantic-paint-CufpIQFw.d.ts} +7 -7
- package/dist/{semantic-paint-BUt0ePEW.d.cts → semantic-paint-Ur7pAINj.d.cts} +7 -7
- package/dist/{semantic-records-DoW_xNgJ.d.ts → semantic-records-C3Z76KeN.d.cts} +77 -31
- package/dist/{semantic-records-CuT3Wsd-.d.cts → semantic-records-Cc1MJrhM.d.ts} +77 -31
- package/dist/{shaped-measurer-CakZ7g1s.d.ts → shaped-measurer-CYSK20E2.d.cts} +2 -4
- package/dist/{shaped-measurer-CDcHzjhf.d.cts → shaped-measurer-CwlTPDJO.d.ts} +2 -4
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +90 -18
- package/dist/store.d.ts +90 -18
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-fZgbrR5F.d.ts → tree-op-types-B0-sCtw-.d.cts} +79 -10
- package/dist/{tree-op-types-QujrzgCz.d.cts → tree-op-types-XMVsJSpe.d.ts} +79 -10
- package/dist/{tree-session-5UWKAQ41.d.cts → tree-session-D945D43B.d.cts} +45 -19
- package/dist/{tree-session--6LDTNjR.d.ts → tree-session-DBJgmdmc.d.ts} +45 -19
- package/dist/{tree-store-Dy9FZ1pa.d.ts → tree-store-C6vc8E_2.d.cts} +14 -3
- package/dist/{tree-store-DhYIACNE.d.cts → tree-store-ClA-qng4.d.ts} +14 -3
- package/package.json +2 -2
- package/dist/chunk-32HTRN7R.js +0 -10
- package/dist/chunk-42PRWWVE.js +0 -2
- package/dist/chunk-BRBRYJKE.cjs +0 -2
- package/dist/chunk-DTR64XCS.cjs +0 -2
- package/dist/chunk-EMQSFPJO.cjs +0 -15
- package/dist/chunk-GBK7Z6F4.cjs +0 -5
- package/dist/chunk-GPJXQDHC.js +0 -2
- package/dist/chunk-JLSB6KNZ.js +0 -5
- package/dist/chunk-LEV2X47E.cjs +0 -18
- package/dist/chunk-NDTLLSG7.js +0 -1
- package/dist/chunk-O4VILLOM.cjs +0 -1
- package/dist/chunk-OB6JFVYA.js +0 -15
- package/dist/chunk-QTUZFJ4O.js +0 -18
- package/dist/chunk-UE7KTQLK.js +0 -2
- package/dist/chunk-WC3LI6FC.cjs +0 -10
- package/dist/chunk-XRDTD4X3.cjs +0 -2
- package/dist/content-control-walk-CbTqHq6O.d.cts +0 -56
- package/dist/content-control-walk-D06GijR0.d.ts +0 -56
- package/dist/ooxml-package-CR5us6ad.d.cts +0 -354
- package/dist/ooxml-package-D_CtywTW.d.ts +0 -354
- package/dist/review-reads-C5E7u-pt.d.ts +0 -432
- package/dist/review-reads-ChgUq41I.d.cts +0 -432
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParagraphTabStop } from './contracts/types.cjs';
|
|
2
|
+
import { a as OoxmlNode, b as OoxmlElement, r as OoxmlDrawingNode, p as OoxmlContentControlNode, q as OoxmlContentControlContentNode, s as OoxmlContentControlEndPropertiesNode, t as OoxmlContentControlPropertiesNode, O as OoxmlPart } from './ooxml-package-CdEy9ufK.cjs';
|
|
2
3
|
|
|
3
4
|
/** The relationship namespace `r:id` lives in. */
|
|
4
5
|
declare const OFFICE_RELATIONSHIP_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
@@ -562,7 +563,14 @@ type ContentControlValueInput = {
|
|
|
562
563
|
};
|
|
563
564
|
/** The control types an insertion may author. Picture and repeating section are deferred. */
|
|
564
565
|
declare const INSERTABLE_CONTENT_CONTROL_TYPES: readonly ["richText", "plainText", "dropDownList", "comboBox", "date"];
|
|
565
|
-
|
|
566
|
+
/**
|
|
567
|
+
* The OOXML spellings the store writes.
|
|
568
|
+
*
|
|
569
|
+
* NOT the contract's `InsertableContentControlType`, which is the same set of kinds in the
|
|
570
|
+
* READ vocabulary (`dropdown`) plus this lane's spelling of it (`dropDownList`). The editor
|
|
571
|
+
* maps between the two; the names differ so a reader can tell which vocabulary a value is in.
|
|
572
|
+
*/
|
|
573
|
+
type InsertableContentControlKind = (typeof INSERTABLE_CONTENT_CONTROL_TYPES)[number];
|
|
566
574
|
|
|
567
575
|
/** Allowlisted OOXML table border line styles — store/layout authority. */
|
|
568
576
|
declare const TABLE_BORDER_STYLES: readonly ["single", "dashed", "dotted", "double", "triple", "thick"];
|
|
@@ -618,16 +626,21 @@ interface TableBorderSpecInput {
|
|
|
618
626
|
*/
|
|
619
627
|
declare const ACCEPTED_RUN_PROPERTIES: readonly ["rFonts", "sz", "szCs", "color", "b", "bCs", "i", "iCs", "u", "strike", "dstrike", "highlight", "vertAlign", "position", "caps", "smallCaps", "spacing", "w", "kern"];
|
|
620
628
|
/** The accepted PARAGRAPH property boundary (design D8). */
|
|
621
|
-
declare const ACCEPTED_PARAGRAPH_PROPERTIES: readonly ["pStyle", "jc", "spacing", "ind", "tabs", "numPr", "keepNext", "keepLines", "widowControl", "pageBreakBefore", "shd"];
|
|
629
|
+
declare const ACCEPTED_PARAGRAPH_PROPERTIES: readonly ["pStyle", "jc", "spacing", "ind", "tabs", "numPr", "keepNext", "keepLines", "widowControl", "pageBreakBefore", "contextualSpacing", "shd"];
|
|
630
|
+
/**
|
|
631
|
+
* One tab stop an op can author: where it sits, how it aligns, and what fills the gap.
|
|
632
|
+
*
|
|
633
|
+
* An alias, not a second declaration. The contract lane already names this shape, and two
|
|
634
|
+
* public names for one shape is a trap — a caller building a stop for a read and for an op
|
|
635
|
+
* would otherwise have to name it two things.
|
|
636
|
+
*/
|
|
637
|
+
type TabStopWrite = ParagraphTabStop;
|
|
622
638
|
/**
|
|
623
639
|
* One authored property: an element name plus its `w:`-namespace attributes.
|
|
624
640
|
*
|
|
625
641
|
* Modeled as name+attributes rather than a typed record per property because that is what
|
|
626
642
|
* the tree holds, so an op maps to nodes without a lossy intermediate vocabulary. Attribute
|
|
627
643
|
* VALUES are validated as XML text; their meaning is the resolver's business.
|
|
628
|
-
*/
|
|
629
|
-
/**
|
|
630
|
-
* One property an op writes, as a name plus attributes.
|
|
631
644
|
*
|
|
632
645
|
* Deliberately structural rather than a typed union: the accepted property lists bound WHICH
|
|
633
646
|
* properties may be written, so the shape itself does not need to enumerate them.
|
|
@@ -671,6 +684,16 @@ interface RevisionAttributionInput {
|
|
|
671
684
|
* unchanged.
|
|
672
685
|
*/
|
|
673
686
|
type TreeDocOp = {
|
|
687
|
+
/**
|
|
688
|
+
* Replace one story's complete block structure with fresh plain paragraphs.
|
|
689
|
+
*
|
|
690
|
+
* Unlike a span replacement, this removes section-ending paragraphs and content-control
|
|
691
|
+
* wrappers. A body's final direct `w:sectPr` survives to retain the page setup.
|
|
692
|
+
*/
|
|
693
|
+
readonly op: 'replaceStoryBlocks';
|
|
694
|
+
readonly storyRootId: string;
|
|
695
|
+
readonly paragraphs: readonly string[];
|
|
696
|
+
} | {
|
|
674
697
|
/**
|
|
675
698
|
* Insert an SDT-wrapped TOC immediately before a body paragraph.
|
|
676
699
|
* The initial cached result and any heading bookmarks land in one undo unit.
|
|
@@ -845,6 +868,29 @@ type TreeDocOp = {
|
|
|
845
868
|
readonly paragraphId: string;
|
|
846
869
|
readonly numId: string | null;
|
|
847
870
|
readonly level?: number;
|
|
871
|
+
} | {
|
|
872
|
+
/**
|
|
873
|
+
* Replace a paragraph's custom tab stops, or clear them with an empty list.
|
|
874
|
+
*
|
|
875
|
+
* Its OWN op rather than a `w:tabs` entry in `setParagraphProperties`, because
|
|
876
|
+
* `OoxmlProperty` is flat and `w:tabs` carries its meaning in `w:tab` children — the
|
|
877
|
+
* same reason `setListNumbering` exists for `w:numPr`.
|
|
878
|
+
*/
|
|
879
|
+
readonly op: 'setParagraphTabStops';
|
|
880
|
+
readonly paragraphId: string;
|
|
881
|
+
readonly stops: readonly TabStopWrite[];
|
|
882
|
+
/**
|
|
883
|
+
* Every stop position IN FORCE when the editor read the paragraph, including the
|
|
884
|
+
* ones a style supplied.
|
|
885
|
+
*
|
|
886
|
+
* Tab stops are read through the cascade and written at the paragraph level, so a
|
|
887
|
+
* replace alone cannot remove an inherited stop — the user clears a row, the style
|
|
888
|
+
* puts it straight back, and the command reports success. A position that was in
|
|
889
|
+
* force and is not in `stops` is suppressed with `w:val="clear"`, which is what the
|
|
890
|
+
* value exists for (§17.3.1.37). Omit when the caller has no cascade to speak of;
|
|
891
|
+
* the write is then a plain paragraph-level replace.
|
|
892
|
+
*/
|
|
893
|
+
readonly inForcePositionsTwips?: readonly number[];
|
|
848
894
|
} | {
|
|
849
895
|
readonly op: 'splitParagraph';
|
|
850
896
|
readonly paragraphId: string;
|
|
@@ -979,6 +1025,20 @@ type TreeDocOp = {
|
|
|
979
1025
|
*/
|
|
980
1026
|
readonly op: 'removeHyperlink';
|
|
981
1027
|
readonly linkId: string;
|
|
1028
|
+
} | {
|
|
1029
|
+
/**
|
|
1030
|
+
* Replace one preserved `m:oMath` atom from bounded linear-math input.
|
|
1031
|
+
*
|
|
1032
|
+
* The complete equation changes as one unit. Internal OMML text never enters the
|
|
1033
|
+
* paragraph offset space, so callers cannot leave a partially edited math tree.
|
|
1034
|
+
*/
|
|
1035
|
+
readonly op: 'setMathEquation';
|
|
1036
|
+
readonly equationId: string;
|
|
1037
|
+
readonly linear: string;
|
|
1038
|
+
} | {
|
|
1039
|
+
/** Remove one complete `m:oMath` atom. */
|
|
1040
|
+
readonly op: 'removeMathEquation';
|
|
1041
|
+
readonly equationId: string;
|
|
982
1042
|
} | {
|
|
983
1043
|
/**
|
|
984
1044
|
* Insert a NEW run-level content control at a text offset: `w:sdt` with a
|
|
@@ -1261,7 +1321,7 @@ type TreeDocOp = {
|
|
|
1261
1321
|
readonly paragraphId: string;
|
|
1262
1322
|
readonly start: number;
|
|
1263
1323
|
readonly end: number;
|
|
1264
|
-
readonly type:
|
|
1324
|
+
readonly type: InsertableContentControlKind;
|
|
1265
1325
|
readonly tag?: string;
|
|
1266
1326
|
readonly alias?: string;
|
|
1267
1327
|
readonly lock?: ContentControlLock;
|
|
@@ -1370,7 +1430,7 @@ type DrawingTreeDocOp = Extract<TreeDocOp, {
|
|
|
1370
1430
|
/** Just the `op` discriminants, for dispatch tables and validation. */
|
|
1371
1431
|
type TreeDocOpKind = TreeDocOp['op'];
|
|
1372
1432
|
/** Every {@link TreeDocOpKind}, for validation and exhaustiveness checks. */
|
|
1373
|
-
declare const TREE_DOC_OP_KINDS: readonly ["insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setListLevel", "setListNumbering", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers"];
|
|
1433
|
+
declare const TREE_DOC_OP_KINDS: readonly ["replaceStoryBlocks", "insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setListLevel", "setListNumbering", "setParagraphTabStops", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setMathEquation", "removeMathEquation", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers"];
|
|
1374
1434
|
/**
|
|
1375
1435
|
* How far a committed op can reach, so layout can scope its work (task 5.2).
|
|
1376
1436
|
*
|
|
@@ -1421,7 +1481,16 @@ interface TreeOpEffect {
|
|
|
1421
1481
|
* `not-adjacent-siblings` is the notable one: a join across table cells is refused rather than
|
|
1422
1482
|
* silently merging content out of the cell that owned it.
|
|
1423
1483
|
*/
|
|
1424
|
-
type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' | 'offset-out-of-range' | 'invalid-range' | 'not-a-list-paragraph' | 'splits-surrogate-pair' | 'invalid-text' | 'unsupported-property' | 'invalid-property-value' | 'not-adjacent-siblings'
|
|
1484
|
+
type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' | 'offset-out-of-range' | 'invalid-range' | 'not-a-list-paragraph' | 'splits-surrogate-pair' | 'invalid-text' | 'unsupported-property' | 'invalid-property-value' | 'not-adjacent-siblings'
|
|
1485
|
+
/**
|
|
1486
|
+
* The addressed position is strictly inside content nothing can divide: a hyperlink, an
|
|
1487
|
+
* inline content control, a revision wrapper, or an atomic field.
|
|
1488
|
+
*
|
|
1489
|
+
* Distinct from `invalid-range`, which is an offset the paragraph does not have. This one is
|
|
1490
|
+
* a real offset that is not a PLACE — refused rather than resolved to the nearest one, so a
|
|
1491
|
+
* caller learns the node would not have landed where they asked.
|
|
1492
|
+
*/
|
|
1493
|
+
| 'indivisible-content' | 'unknown-block' | 'not-a-block' | 'block-required' | 'carries-section-mark'
|
|
1425
1494
|
/** The transaction named a part the package does not hold. */
|
|
1426
1495
|
| 'unknown-part'
|
|
1427
1496
|
/**
|
|
@@ -1496,4 +1565,4 @@ type TreeOpResult = {
|
|
|
1496
1565
|
readonly detail?: string;
|
|
1497
1566
|
};
|
|
1498
1567
|
|
|
1499
|
-
export {
|
|
1568
|
+
export { contentControlPropertiesOf as $, ACCEPTED_PARAGRAPH_PROPERTIES as A, type HyperlinkKind as B, type ContentControlKind as C, type DrawingProjection as D, type HyperlinkTarget as E, MAX_CONTENT_CONTROL_NESTING as F, OFFICE_RELATIONSHIP_NAMESPACE_URI as G, HYPERLINK_RELATIONSHIP_TYPE as H, type ImpactClass as I, type RelationshipTargetResolver as J, TABLE_BORDER_STYLES as K, TREE_DOC_OP_KINDS as L, MAX_CONTENT_CONTROLS_PER_PART as M, type TabStopWrite as N, type OoxmlProperty as O, type TreeDocOpKind as P, type TreeOpEffect as Q, type RevisionAddress as R, type SourceCrop as S, type TreeDocOp as T, allocateContentControlId as U, type VectorShapeProjection as V, contentControlContentChildren as W, contentControlContentNodeOf as X, contentControlEndPropertiesNodeOf as Y, contentControlLevelOf as Z, contentControlPropertiesNodeOf as _, type TreeOpRejection as a, contentControlTextOf as a0, contentControlsIn as a1, findContentControl as a2, flattenContentControls as a3, hyperlinkAnchorOf as a4, hyperlinkRelationshipIdOf as a5, hyperlinkTargetOf as a6, isContentControlContentNode as a7, isContentControlNode as a8, isContentControlWrapper as a9, isHyperlinkNode as aa, lockForbidsEdit as ab, lockForbidsRemoval as ac, orderedContentControlProperties as ad, parseContentControlId as ae, projectDrawing as af, resolveContentControlLock as ag, type ImageWrapTarget as b, type DrawingKind as c, type DrawingPositionInput as d, type DrawingLocks as e, type DrawingHorizontalReferenceFrame as f, type DrawingVerticalReferenceFrame as g, type DrawingTreeDocOp as h, type TreeDocColorValue as i, IMAGE_WRAP_TARGETS as j, type DrawingAccessibility as k, type DrawingTransform as l, type TableBorderStyle as m, type ContentControlLevel as n, type ContentControlLock as o, type ContentControlDataBinding as p, type TreeOpResult as q, ACCEPTED_RUN_PROPERTIES as r, CONTENT_CONTROL_ID_MAX as s, CONTENT_CONTROL_PROPERTY_ORDER as t, type ContentControlCheckbox as u, type ContentControlCheckboxState as v, type ContentControlDateFormat as w, type ContentControlEntry as x, type ContentControlListItem as y, type ContentControlProperties as z };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParagraphTabStop } from './contracts/types.js';
|
|
2
|
+
import { a as OoxmlNode, b as OoxmlElement, r as OoxmlDrawingNode, p as OoxmlContentControlNode, q as OoxmlContentControlContentNode, s as OoxmlContentControlEndPropertiesNode, t as OoxmlContentControlPropertiesNode, O as OoxmlPart } from './ooxml-package-CdEy9ufK.js';
|
|
2
3
|
|
|
3
4
|
/** The relationship namespace `r:id` lives in. */
|
|
4
5
|
declare const OFFICE_RELATIONSHIP_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
@@ -562,7 +563,14 @@ type ContentControlValueInput = {
|
|
|
562
563
|
};
|
|
563
564
|
/** The control types an insertion may author. Picture and repeating section are deferred. */
|
|
564
565
|
declare const INSERTABLE_CONTENT_CONTROL_TYPES: readonly ["richText", "plainText", "dropDownList", "comboBox", "date"];
|
|
565
|
-
|
|
566
|
+
/**
|
|
567
|
+
* The OOXML spellings the store writes.
|
|
568
|
+
*
|
|
569
|
+
* NOT the contract's `InsertableContentControlType`, which is the same set of kinds in the
|
|
570
|
+
* READ vocabulary (`dropdown`) plus this lane's spelling of it (`dropDownList`). The editor
|
|
571
|
+
* maps between the two; the names differ so a reader can tell which vocabulary a value is in.
|
|
572
|
+
*/
|
|
573
|
+
type InsertableContentControlKind = (typeof INSERTABLE_CONTENT_CONTROL_TYPES)[number];
|
|
566
574
|
|
|
567
575
|
/** Allowlisted OOXML table border line styles — store/layout authority. */
|
|
568
576
|
declare const TABLE_BORDER_STYLES: readonly ["single", "dashed", "dotted", "double", "triple", "thick"];
|
|
@@ -618,16 +626,21 @@ interface TableBorderSpecInput {
|
|
|
618
626
|
*/
|
|
619
627
|
declare const ACCEPTED_RUN_PROPERTIES: readonly ["rFonts", "sz", "szCs", "color", "b", "bCs", "i", "iCs", "u", "strike", "dstrike", "highlight", "vertAlign", "position", "caps", "smallCaps", "spacing", "w", "kern"];
|
|
620
628
|
/** The accepted PARAGRAPH property boundary (design D8). */
|
|
621
|
-
declare const ACCEPTED_PARAGRAPH_PROPERTIES: readonly ["pStyle", "jc", "spacing", "ind", "tabs", "numPr", "keepNext", "keepLines", "widowControl", "pageBreakBefore", "shd"];
|
|
629
|
+
declare const ACCEPTED_PARAGRAPH_PROPERTIES: readonly ["pStyle", "jc", "spacing", "ind", "tabs", "numPr", "keepNext", "keepLines", "widowControl", "pageBreakBefore", "contextualSpacing", "shd"];
|
|
630
|
+
/**
|
|
631
|
+
* One tab stop an op can author: where it sits, how it aligns, and what fills the gap.
|
|
632
|
+
*
|
|
633
|
+
* An alias, not a second declaration. The contract lane already names this shape, and two
|
|
634
|
+
* public names for one shape is a trap — a caller building a stop for a read and for an op
|
|
635
|
+
* would otherwise have to name it two things.
|
|
636
|
+
*/
|
|
637
|
+
type TabStopWrite = ParagraphTabStop;
|
|
622
638
|
/**
|
|
623
639
|
* One authored property: an element name plus its `w:`-namespace attributes.
|
|
624
640
|
*
|
|
625
641
|
* Modeled as name+attributes rather than a typed record per property because that is what
|
|
626
642
|
* the tree holds, so an op maps to nodes without a lossy intermediate vocabulary. Attribute
|
|
627
643
|
* VALUES are validated as XML text; their meaning is the resolver's business.
|
|
628
|
-
*/
|
|
629
|
-
/**
|
|
630
|
-
* One property an op writes, as a name plus attributes.
|
|
631
644
|
*
|
|
632
645
|
* Deliberately structural rather than a typed union: the accepted property lists bound WHICH
|
|
633
646
|
* properties may be written, so the shape itself does not need to enumerate them.
|
|
@@ -671,6 +684,16 @@ interface RevisionAttributionInput {
|
|
|
671
684
|
* unchanged.
|
|
672
685
|
*/
|
|
673
686
|
type TreeDocOp = {
|
|
687
|
+
/**
|
|
688
|
+
* Replace one story's complete block structure with fresh plain paragraphs.
|
|
689
|
+
*
|
|
690
|
+
* Unlike a span replacement, this removes section-ending paragraphs and content-control
|
|
691
|
+
* wrappers. A body's final direct `w:sectPr` survives to retain the page setup.
|
|
692
|
+
*/
|
|
693
|
+
readonly op: 'replaceStoryBlocks';
|
|
694
|
+
readonly storyRootId: string;
|
|
695
|
+
readonly paragraphs: readonly string[];
|
|
696
|
+
} | {
|
|
674
697
|
/**
|
|
675
698
|
* Insert an SDT-wrapped TOC immediately before a body paragraph.
|
|
676
699
|
* The initial cached result and any heading bookmarks land in one undo unit.
|
|
@@ -845,6 +868,29 @@ type TreeDocOp = {
|
|
|
845
868
|
readonly paragraphId: string;
|
|
846
869
|
readonly numId: string | null;
|
|
847
870
|
readonly level?: number;
|
|
871
|
+
} | {
|
|
872
|
+
/**
|
|
873
|
+
* Replace a paragraph's custom tab stops, or clear them with an empty list.
|
|
874
|
+
*
|
|
875
|
+
* Its OWN op rather than a `w:tabs` entry in `setParagraphProperties`, because
|
|
876
|
+
* `OoxmlProperty` is flat and `w:tabs` carries its meaning in `w:tab` children — the
|
|
877
|
+
* same reason `setListNumbering` exists for `w:numPr`.
|
|
878
|
+
*/
|
|
879
|
+
readonly op: 'setParagraphTabStops';
|
|
880
|
+
readonly paragraphId: string;
|
|
881
|
+
readonly stops: readonly TabStopWrite[];
|
|
882
|
+
/**
|
|
883
|
+
* Every stop position IN FORCE when the editor read the paragraph, including the
|
|
884
|
+
* ones a style supplied.
|
|
885
|
+
*
|
|
886
|
+
* Tab stops are read through the cascade and written at the paragraph level, so a
|
|
887
|
+
* replace alone cannot remove an inherited stop — the user clears a row, the style
|
|
888
|
+
* puts it straight back, and the command reports success. A position that was in
|
|
889
|
+
* force and is not in `stops` is suppressed with `w:val="clear"`, which is what the
|
|
890
|
+
* value exists for (§17.3.1.37). Omit when the caller has no cascade to speak of;
|
|
891
|
+
* the write is then a plain paragraph-level replace.
|
|
892
|
+
*/
|
|
893
|
+
readonly inForcePositionsTwips?: readonly number[];
|
|
848
894
|
} | {
|
|
849
895
|
readonly op: 'splitParagraph';
|
|
850
896
|
readonly paragraphId: string;
|
|
@@ -979,6 +1025,20 @@ type TreeDocOp = {
|
|
|
979
1025
|
*/
|
|
980
1026
|
readonly op: 'removeHyperlink';
|
|
981
1027
|
readonly linkId: string;
|
|
1028
|
+
} | {
|
|
1029
|
+
/**
|
|
1030
|
+
* Replace one preserved `m:oMath` atom from bounded linear-math input.
|
|
1031
|
+
*
|
|
1032
|
+
* The complete equation changes as one unit. Internal OMML text never enters the
|
|
1033
|
+
* paragraph offset space, so callers cannot leave a partially edited math tree.
|
|
1034
|
+
*/
|
|
1035
|
+
readonly op: 'setMathEquation';
|
|
1036
|
+
readonly equationId: string;
|
|
1037
|
+
readonly linear: string;
|
|
1038
|
+
} | {
|
|
1039
|
+
/** Remove one complete `m:oMath` atom. */
|
|
1040
|
+
readonly op: 'removeMathEquation';
|
|
1041
|
+
readonly equationId: string;
|
|
982
1042
|
} | {
|
|
983
1043
|
/**
|
|
984
1044
|
* Insert a NEW run-level content control at a text offset: `w:sdt` with a
|
|
@@ -1261,7 +1321,7 @@ type TreeDocOp = {
|
|
|
1261
1321
|
readonly paragraphId: string;
|
|
1262
1322
|
readonly start: number;
|
|
1263
1323
|
readonly end: number;
|
|
1264
|
-
readonly type:
|
|
1324
|
+
readonly type: InsertableContentControlKind;
|
|
1265
1325
|
readonly tag?: string;
|
|
1266
1326
|
readonly alias?: string;
|
|
1267
1327
|
readonly lock?: ContentControlLock;
|
|
@@ -1370,7 +1430,7 @@ type DrawingTreeDocOp = Extract<TreeDocOp, {
|
|
|
1370
1430
|
/** Just the `op` discriminants, for dispatch tables and validation. */
|
|
1371
1431
|
type TreeDocOpKind = TreeDocOp['op'];
|
|
1372
1432
|
/** Every {@link TreeDocOpKind}, for validation and exhaustiveness checks. */
|
|
1373
|
-
declare const TREE_DOC_OP_KINDS: readonly ["insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setListLevel", "setListNumbering", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers"];
|
|
1433
|
+
declare const TREE_DOC_OP_KINDS: readonly ["replaceStoryBlocks", "insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setListLevel", "setListNumbering", "setParagraphTabStops", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setMathEquation", "removeMathEquation", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers"];
|
|
1374
1434
|
/**
|
|
1375
1435
|
* How far a committed op can reach, so layout can scope its work (task 5.2).
|
|
1376
1436
|
*
|
|
@@ -1421,7 +1481,16 @@ interface TreeOpEffect {
|
|
|
1421
1481
|
* `not-adjacent-siblings` is the notable one: a join across table cells is refused rather than
|
|
1422
1482
|
* silently merging content out of the cell that owned it.
|
|
1423
1483
|
*/
|
|
1424
|
-
type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' | 'offset-out-of-range' | 'invalid-range' | 'not-a-list-paragraph' | 'splits-surrogate-pair' | 'invalid-text' | 'unsupported-property' | 'invalid-property-value' | 'not-adjacent-siblings'
|
|
1484
|
+
type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' | 'offset-out-of-range' | 'invalid-range' | 'not-a-list-paragraph' | 'splits-surrogate-pair' | 'invalid-text' | 'unsupported-property' | 'invalid-property-value' | 'not-adjacent-siblings'
|
|
1485
|
+
/**
|
|
1486
|
+
* The addressed position is strictly inside content nothing can divide: a hyperlink, an
|
|
1487
|
+
* inline content control, a revision wrapper, or an atomic field.
|
|
1488
|
+
*
|
|
1489
|
+
* Distinct from `invalid-range`, which is an offset the paragraph does not have. This one is
|
|
1490
|
+
* a real offset that is not a PLACE — refused rather than resolved to the nearest one, so a
|
|
1491
|
+
* caller learns the node would not have landed where they asked.
|
|
1492
|
+
*/
|
|
1493
|
+
| 'indivisible-content' | 'unknown-block' | 'not-a-block' | 'block-required' | 'carries-section-mark'
|
|
1425
1494
|
/** The transaction named a part the package does not hold. */
|
|
1426
1495
|
| 'unknown-part'
|
|
1427
1496
|
/**
|
|
@@ -1496,4 +1565,4 @@ type TreeOpResult = {
|
|
|
1496
1565
|
readonly detail?: string;
|
|
1497
1566
|
};
|
|
1498
1567
|
|
|
1499
|
-
export {
|
|
1568
|
+
export { contentControlPropertiesOf as $, ACCEPTED_PARAGRAPH_PROPERTIES as A, type HyperlinkKind as B, type ContentControlKind as C, type DrawingProjection as D, type HyperlinkTarget as E, MAX_CONTENT_CONTROL_NESTING as F, OFFICE_RELATIONSHIP_NAMESPACE_URI as G, HYPERLINK_RELATIONSHIP_TYPE as H, type ImpactClass as I, type RelationshipTargetResolver as J, TABLE_BORDER_STYLES as K, TREE_DOC_OP_KINDS as L, MAX_CONTENT_CONTROLS_PER_PART as M, type TabStopWrite as N, type OoxmlProperty as O, type TreeDocOpKind as P, type TreeOpEffect as Q, type RevisionAddress as R, type SourceCrop as S, type TreeDocOp as T, allocateContentControlId as U, type VectorShapeProjection as V, contentControlContentChildren as W, contentControlContentNodeOf as X, contentControlEndPropertiesNodeOf as Y, contentControlLevelOf as Z, contentControlPropertiesNodeOf as _, type TreeOpRejection as a, contentControlTextOf as a0, contentControlsIn as a1, findContentControl as a2, flattenContentControls as a3, hyperlinkAnchorOf as a4, hyperlinkRelationshipIdOf as a5, hyperlinkTargetOf as a6, isContentControlContentNode as a7, isContentControlNode as a8, isContentControlWrapper as a9, isHyperlinkNode as aa, lockForbidsEdit as ab, lockForbidsRemoval as ac, orderedContentControlProperties as ad, parseContentControlId as ae, projectDrawing as af, resolveContentControlLock as ag, type ImageWrapTarget as b, type DrawingKind as c, type DrawingPositionInput as d, type DrawingLocks as e, type DrawingHorizontalReferenceFrame as f, type DrawingVerticalReferenceFrame as g, type DrawingTreeDocOp as h, type TreeDocColorValue as i, IMAGE_WRAP_TARGETS as j, type DrawingAccessibility as k, type DrawingTransform as l, type TableBorderStyle as m, type ContentControlLevel as n, type ContentControlLock as o, type ContentControlDataBinding as p, type TreeOpResult as q, ACCEPTED_RUN_PROPERTIES as r, CONTENT_CONTROL_ID_MAX as s, CONTENT_CONTROL_PROPERTY_ORDER as t, type ContentControlCheckbox as u, type ContentControlCheckboxState as v, type ContentControlDateFormat as w, type ContentControlEntry as x, type ContentControlListItem as y, type ContentControlProperties as z };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { S as SupportedImageMime, b as ImageDecodePort } from './image-resources-
|
|
2
|
-
import { S as StoryScope, a as StoryTargetRejection, D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, b as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind, c as InsertImageInput, d as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput } from './custom-node-writes-
|
|
1
|
+
import { S as SupportedImageMime, b as ImageDecodePort } from './image-resources-DQOiwOuE.cjs';
|
|
2
|
+
import { S as StoryScope, a as StoryTargetRejection, D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, b as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind, c as InsertImageInput, d as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput } from './custom-node-writes-7ERv0f_X.cjs';
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
|
-
import { a as
|
|
4
|
+
import { O as OoxmlPart, a as OoxmlNode, c as OoxmlPackage, b as OoxmlElement, o as OoxmlPackageRejection } from './ooxml-package-CdEy9ufK.cjs';
|
|
5
|
+
import { a as HeaderFooterParts, b as HeaderFooterSectionResolution } from './hf-references-Dvk6De4Q.cjs';
|
|
6
|
+
import { S as SelectionMark, T as TreeModelChange, D as DocumentProperties } from './tree-store-C6vc8E_2.cjs';
|
|
7
|
+
import { T as TreeDocOp } from './tree-op-types-B0-sCtw-.cjs';
|
|
8
|
+
import { a as ReviewItem } from './review-items-DpsqTHio.cjs';
|
|
5
9
|
import { ReviewModuleContribution } from './contracts/modules.cjs';
|
|
6
|
-
import { e as OoxmlPart, O as OoxmlNode, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.cjs';
|
|
7
|
-
import { O as OoxmlPackage, b as OoxmlPackageRejection } from './ooxml-package-CR5us6ad.cjs';
|
|
8
|
-
import { a as HeaderFooterParts, b as HeaderFooterSectionResolution } from './hf-references-CgEOSw3i.cjs';
|
|
9
|
-
import { S as SelectionMark, T as TreeModelChange, D as DocumentProperties } from './tree-store-DhYIACNE.cjs';
|
|
10
|
-
import { T as TreeDocOp } from './tree-op-types-QujrzgCz.cjs';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Why an edited projection could not be mapped back into tree ops.
|
|
@@ -178,10 +177,36 @@ interface RunPropertyLike {
|
|
|
178
177
|
interface ParagraphAnchorIndex {
|
|
179
178
|
/** nodeId → `w14:paraId`, verbatim as authored/minted. Paragraphs without one are absent. */
|
|
180
179
|
readonly paraIdByNode: ReadonlyMap<string, string>;
|
|
181
|
-
/** UPPERCASED paraId → nodeId (matching is case-insensitive).
|
|
180
|
+
/** UPPERCASED paraId → nodeId (matching is case-insensitive). The first story to claim it. */
|
|
182
181
|
readonly nodeByParaId: ReadonlyMap<string, string>;
|
|
183
182
|
/** nodeId → reading-order ordinal, for document-ordering DocRange endpoints. */
|
|
184
183
|
readonly ordinalByNode: ReadonlyMap<string, number>;
|
|
184
|
+
/**
|
|
185
|
+
* UPPERCASED paraIds more than one story claims.
|
|
186
|
+
*
|
|
187
|
+
* Minting is unique per PART and the contract's uniqueness is per DOCUMENT, so an authored
|
|
188
|
+
* file may repeat one. Resolving such an anchor to whichever story came first would be a
|
|
189
|
+
* silent wrong answer; it is refused as ambiguous instead.
|
|
190
|
+
*/
|
|
191
|
+
readonly ambiguousParaIds: ReadonlySet<string>;
|
|
192
|
+
/**
|
|
193
|
+
* nodeId → the part it was indexed from.
|
|
194
|
+
*
|
|
195
|
+
* The index spans every story, so a caller holding one part and a node id from another reads
|
|
196
|
+
* an empty paragraph and draws a false conclusion from it. Carrying the part alongside the id
|
|
197
|
+
* is what keeps the two in step.
|
|
198
|
+
*/
|
|
199
|
+
readonly partByNode: ReadonlyMap<string, OoxmlPart>;
|
|
200
|
+
/**
|
|
201
|
+
* Every node claiming an ambiguous paraId. DIAGNOSTIC, never a way to pick one.
|
|
202
|
+
*
|
|
203
|
+
* Resolution refuses a clash outright, and this is what says which paragraphs caused it, for
|
|
204
|
+
* a reader repairing the file. Preferring one claimant by the caller's part was tried and
|
|
205
|
+
* reverted: every resolver call site passes the MAIN part, so the preference could only ever
|
|
206
|
+
* land on the body twin and answer `ok` for a header paragraph the caller meant. See
|
|
207
|
+
* `resolveDocAnchor` in `editor/anchor-resolution.ts`.
|
|
208
|
+
*/
|
|
209
|
+
readonly claimantsByParaId: ReadonlyMap<string, readonly string[]>;
|
|
185
210
|
}
|
|
186
211
|
|
|
187
212
|
/**
|
|
@@ -238,6 +263,15 @@ interface TreeDocxSessionView {
|
|
|
238
263
|
* and one undo unit without swapping the body store.
|
|
239
264
|
*/
|
|
240
265
|
applyTreeOps(ops: readonly TreeDocOp[], selectionBefore?: SelectionMark | null, selectionAfter?: SelectionMark | null, scope?: StoryScope): TreeApplyResult;
|
|
266
|
+
/**
|
|
267
|
+
* Every part that holds a story, body first, then headers, footers and note parts.
|
|
268
|
+
*
|
|
269
|
+
* A READ: parts come from the package, so this opens no story store and spends none of the
|
|
270
|
+
* 64 editable-store slots. Use it for any query that must answer about the whole document
|
|
271
|
+
* rather than about the caret — an enumeration that reads only the body reports a document
|
|
272
|
+
* the reader is not looking at.
|
|
273
|
+
*/
|
|
274
|
+
storyParts(): readonly OoxmlPart[];
|
|
241
275
|
/** Body text, paragraphs joined by newlines, read from the CANONICAL tree. */
|
|
242
276
|
bodyText(): string;
|
|
243
277
|
/** Text of a story scope, paragraphs joined by newlines. */
|
|
@@ -300,17 +334,9 @@ interface TreeDocxSessionView {
|
|
|
300
334
|
* empty paragraph — a declaration with no glyph behind it.
|
|
301
335
|
*/
|
|
302
336
|
rendersText(): boolean;
|
|
303
|
-
/**
|
|
304
|
-
* The `w:style` definitions of the styles part, validated and projected for a style
|
|
305
|
-
* picker. Memoized once: the styles part is immutable for the session's lifetime.
|
|
306
|
-
* A document without a styles part answers `[]`.
|
|
307
|
-
*/
|
|
337
|
+
/** Validated style-picker projection. A document without styles answers `[]`. */
|
|
308
338
|
documentStyles(): readonly DocumentStyleEntry[];
|
|
309
|
-
/**
|
|
310
|
-
* Root of the styles part tree, for layout's style cascade. Memoized once; `null` when
|
|
311
|
-
* the package has no styles part. Styles editing is a later slice, so this is immutable
|
|
312
|
-
* for the session.
|
|
313
|
-
*/
|
|
339
|
+
/** Current styles root for layout, or `null` when the package has no styles part. */
|
|
314
340
|
stylesRoot(): OoxmlElement | null;
|
|
315
341
|
/**
|
|
316
342
|
* The theme part's Latin typefaces, for resolving `w:rFonts` theme references in layout.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { S as SupportedImageMime, b as ImageDecodePort } from './image-resources-
|
|
2
|
-
import { S as StoryScope, a as StoryTargetRejection, D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, b as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind, c as InsertImageInput, d as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput } from './custom-node-writes-
|
|
1
|
+
import { S as SupportedImageMime, b as ImageDecodePort } from './image-resources-eZqD_-vC.js';
|
|
2
|
+
import { S as StoryScope, a as StoryTargetRejection, D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, b as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind, c as InsertImageInput, d as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput } from './custom-node-writes-QyVZdTUA.js';
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
|
-
import { a as
|
|
4
|
+
import { O as OoxmlPart, a as OoxmlNode, c as OoxmlPackage, b as OoxmlElement, o as OoxmlPackageRejection } from './ooxml-package-CdEy9ufK.js';
|
|
5
|
+
import { a as HeaderFooterParts, b as HeaderFooterSectionResolution } from './hf-references-z5Y4N1ab.js';
|
|
6
|
+
import { S as SelectionMark, T as TreeModelChange, D as DocumentProperties } from './tree-store-ClA-qng4.js';
|
|
7
|
+
import { T as TreeDocOp } from './tree-op-types-XMVsJSpe.js';
|
|
8
|
+
import { a as ReviewItem } from './review-items-D5SPFtsO.js';
|
|
5
9
|
import { ReviewModuleContribution } from './contracts/modules.js';
|
|
6
|
-
import { e as OoxmlPart, O as OoxmlNode, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.js';
|
|
7
|
-
import { O as OoxmlPackage, b as OoxmlPackageRejection } from './ooxml-package-D_CtywTW.js';
|
|
8
|
-
import { a as HeaderFooterParts, b as HeaderFooterSectionResolution } from './hf-references-BdjsQNE_.js';
|
|
9
|
-
import { S as SelectionMark, T as TreeModelChange, D as DocumentProperties } from './tree-store-Dy9FZ1pa.js';
|
|
10
|
-
import { T as TreeDocOp } from './tree-op-types-fZgbrR5F.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Why an edited projection could not be mapped back into tree ops.
|
|
@@ -178,10 +177,36 @@ interface RunPropertyLike {
|
|
|
178
177
|
interface ParagraphAnchorIndex {
|
|
179
178
|
/** nodeId → `w14:paraId`, verbatim as authored/minted. Paragraphs without one are absent. */
|
|
180
179
|
readonly paraIdByNode: ReadonlyMap<string, string>;
|
|
181
|
-
/** UPPERCASED paraId → nodeId (matching is case-insensitive).
|
|
180
|
+
/** UPPERCASED paraId → nodeId (matching is case-insensitive). The first story to claim it. */
|
|
182
181
|
readonly nodeByParaId: ReadonlyMap<string, string>;
|
|
183
182
|
/** nodeId → reading-order ordinal, for document-ordering DocRange endpoints. */
|
|
184
183
|
readonly ordinalByNode: ReadonlyMap<string, number>;
|
|
184
|
+
/**
|
|
185
|
+
* UPPERCASED paraIds more than one story claims.
|
|
186
|
+
*
|
|
187
|
+
* Minting is unique per PART and the contract's uniqueness is per DOCUMENT, so an authored
|
|
188
|
+
* file may repeat one. Resolving such an anchor to whichever story came first would be a
|
|
189
|
+
* silent wrong answer; it is refused as ambiguous instead.
|
|
190
|
+
*/
|
|
191
|
+
readonly ambiguousParaIds: ReadonlySet<string>;
|
|
192
|
+
/**
|
|
193
|
+
* nodeId → the part it was indexed from.
|
|
194
|
+
*
|
|
195
|
+
* The index spans every story, so a caller holding one part and a node id from another reads
|
|
196
|
+
* an empty paragraph and draws a false conclusion from it. Carrying the part alongside the id
|
|
197
|
+
* is what keeps the two in step.
|
|
198
|
+
*/
|
|
199
|
+
readonly partByNode: ReadonlyMap<string, OoxmlPart>;
|
|
200
|
+
/**
|
|
201
|
+
* Every node claiming an ambiguous paraId. DIAGNOSTIC, never a way to pick one.
|
|
202
|
+
*
|
|
203
|
+
* Resolution refuses a clash outright, and this is what says which paragraphs caused it, for
|
|
204
|
+
* a reader repairing the file. Preferring one claimant by the caller's part was tried and
|
|
205
|
+
* reverted: every resolver call site passes the MAIN part, so the preference could only ever
|
|
206
|
+
* land on the body twin and answer `ok` for a header paragraph the caller meant. See
|
|
207
|
+
* `resolveDocAnchor` in `editor/anchor-resolution.ts`.
|
|
208
|
+
*/
|
|
209
|
+
readonly claimantsByParaId: ReadonlyMap<string, readonly string[]>;
|
|
185
210
|
}
|
|
186
211
|
|
|
187
212
|
/**
|
|
@@ -238,6 +263,15 @@ interface TreeDocxSessionView {
|
|
|
238
263
|
* and one undo unit without swapping the body store.
|
|
239
264
|
*/
|
|
240
265
|
applyTreeOps(ops: readonly TreeDocOp[], selectionBefore?: SelectionMark | null, selectionAfter?: SelectionMark | null, scope?: StoryScope): TreeApplyResult;
|
|
266
|
+
/**
|
|
267
|
+
* Every part that holds a story, body first, then headers, footers and note parts.
|
|
268
|
+
*
|
|
269
|
+
* A READ: parts come from the package, so this opens no story store and spends none of the
|
|
270
|
+
* 64 editable-store slots. Use it for any query that must answer about the whole document
|
|
271
|
+
* rather than about the caret — an enumeration that reads only the body reports a document
|
|
272
|
+
* the reader is not looking at.
|
|
273
|
+
*/
|
|
274
|
+
storyParts(): readonly OoxmlPart[];
|
|
241
275
|
/** Body text, paragraphs joined by newlines, read from the CANONICAL tree. */
|
|
242
276
|
bodyText(): string;
|
|
243
277
|
/** Text of a story scope, paragraphs joined by newlines. */
|
|
@@ -300,17 +334,9 @@ interface TreeDocxSessionView {
|
|
|
300
334
|
* empty paragraph — a declaration with no glyph behind it.
|
|
301
335
|
*/
|
|
302
336
|
rendersText(): boolean;
|
|
303
|
-
/**
|
|
304
|
-
* The `w:style` definitions of the styles part, validated and projected for a style
|
|
305
|
-
* picker. Memoized once: the styles part is immutable for the session's lifetime.
|
|
306
|
-
* A document without a styles part answers `[]`.
|
|
307
|
-
*/
|
|
337
|
+
/** Validated style-picker projection. A document without styles answers `[]`. */
|
|
308
338
|
documentStyles(): readonly DocumentStyleEntry[];
|
|
309
|
-
/**
|
|
310
|
-
* Root of the styles part tree, for layout's style cascade. Memoized once; `null` when
|
|
311
|
-
* the package has no styles part. Styles editing is a later slice, so this is immutable
|
|
312
|
-
* for the session.
|
|
313
|
-
*/
|
|
339
|
+
/** Current styles root for layout, or `null` when the package has no styles part. */
|
|
314
340
|
stylesRoot(): OoxmlElement | null;
|
|
315
341
|
/**
|
|
316
342
|
* The theme part's Latin typefaces, for resolving `w:rFonts` theme references in layout.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-fZgbrR5F.js';
|
|
1
|
+
import { O as OoxmlPart, c as OoxmlPackage } from './ooxml-package-CdEy9ufK.cjs';
|
|
2
|
+
import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-B0-sCtw-.cjs';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* The document metadata Word's document-property fields render.
|
|
@@ -166,6 +165,16 @@ interface HistoryEntry {
|
|
|
166
165
|
interface TreeDocumentStoreOptions {
|
|
167
166
|
/** Bound on retained history entries. Oldest entries drop first. */
|
|
168
167
|
readonly historyLimit?: number;
|
|
168
|
+
/**
|
|
169
|
+
* The document's `settings.xml`, for a store built from a PART rather than a package.
|
|
170
|
+
*
|
|
171
|
+
* Forms protection lives one part up from the op, and a store built from a part gets a
|
|
172
|
+
* synthetic one-part package that cannot see it — so `w:documentProtection w:edit="forms"`
|
|
173
|
+
* was enforced in the body and nowhere else, and a header, a footer or a note accepted every
|
|
174
|
+
* write a protected document is supposed to refuse. Read through a getter, not captured: a
|
|
175
|
+
* document can gain or lose protection while its stories stay open.
|
|
176
|
+
*/
|
|
177
|
+
readonly settingsPart?: () => OoxmlPart | null | undefined;
|
|
169
178
|
}
|
|
170
179
|
/**
|
|
171
180
|
* Opaque document+history checkpoint for package-coordinator rollback.
|
|
@@ -205,6 +214,8 @@ declare class TreeDocumentStore {
|
|
|
205
214
|
private readonly redoStack;
|
|
206
215
|
private readonly subscribers;
|
|
207
216
|
private readonly historyLimit;
|
|
217
|
+
/** See {@link TreeDocumentStoreOptions.settingsPart}. */
|
|
218
|
+
private readonly settingsPartOverride;
|
|
208
219
|
/** Package-aware story tag applied to publishes (including undo/redo). */
|
|
209
220
|
private storyRef;
|
|
210
221
|
/** Open composition, if any. While set, transactions extend one entry (task 5.5). */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-QujrzgCz.cjs';
|
|
1
|
+
import { O as OoxmlPart, c as OoxmlPackage } from './ooxml-package-CdEy9ufK.js';
|
|
2
|
+
import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-XMVsJSpe.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* The document metadata Word's document-property fields render.
|
|
@@ -166,6 +165,16 @@ interface HistoryEntry {
|
|
|
166
165
|
interface TreeDocumentStoreOptions {
|
|
167
166
|
/** Bound on retained history entries. Oldest entries drop first. */
|
|
168
167
|
readonly historyLimit?: number;
|
|
168
|
+
/**
|
|
169
|
+
* The document's `settings.xml`, for a store built from a PART rather than a package.
|
|
170
|
+
*
|
|
171
|
+
* Forms protection lives one part up from the op, and a store built from a part gets a
|
|
172
|
+
* synthetic one-part package that cannot see it — so `w:documentProtection w:edit="forms"`
|
|
173
|
+
* was enforced in the body and nowhere else, and a header, a footer or a note accepted every
|
|
174
|
+
* write a protected document is supposed to refuse. Read through a getter, not captured: a
|
|
175
|
+
* document can gain or lose protection while its stories stay open.
|
|
176
|
+
*/
|
|
177
|
+
readonly settingsPart?: () => OoxmlPart | null | undefined;
|
|
169
178
|
}
|
|
170
179
|
/**
|
|
171
180
|
* Opaque document+history checkpoint for package-coordinator rollback.
|
|
@@ -205,6 +214,8 @@ declare class TreeDocumentStore {
|
|
|
205
214
|
private readonly redoStack;
|
|
206
215
|
private readonly subscribers;
|
|
207
216
|
private readonly historyLimit;
|
|
217
|
+
/** See {@link TreeDocumentStoreOptions.settingsPart}. */
|
|
218
|
+
private readonly settingsPartOverride;
|
|
208
219
|
/** Package-aware story tag applied to publishes (including undo/redo). */
|
|
209
220
|
private storyRef;
|
|
210
221
|
/** Open composition, if any. While set, transactions extend one entry (task 5.5). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docx-editor.dev/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Framework-agnostic core for docx-editor.dev: OOXML parse/serialize, the canonical document tree, layout and paint, and the Editor contract the adapters render.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"directory": "packages/core"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@docx-editor.dev/i18n": "^2.
|
|
89
|
+
"@docx-editor.dev/i18n": "^2.9.0",
|
|
90
90
|
"bidi-js": "1.0.3",
|
|
91
91
|
"emf-converter": "2.0.2",
|
|
92
92
|
"fast-xml-parser": "^5.10.1",
|