@docx-editor.dev/core 2.0.1 → 2.1.1
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/README.md +32 -33
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.cts +2 -2
- package/dist/automation.d.ts +2 -2
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +14 -8
- package/dist/binding.d.ts +14 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-2DTQDAN7.js +2 -0
- package/dist/chunk-3JKQE4QJ.cjs +2 -0
- package/dist/chunk-4WWEDTTE.js +2 -0
- package/dist/chunk-6WIIHJFY.js +1 -0
- package/dist/chunk-7VQ7YLW3.cjs +1 -0
- package/dist/chunk-BS554B6D.cjs +2 -0
- package/dist/chunk-BZK64YU3.cjs +10 -0
- package/dist/chunk-F2VQQW5R.cjs +12 -0
- package/dist/chunk-GQQOL4PV.js +1 -0
- package/dist/chunk-JQFDLZXQ.cjs +2 -0
- package/dist/chunk-O2WQY7IT.cjs +5 -0
- package/dist/chunk-PC76F2HR.cjs +1 -0
- package/dist/chunk-QRAUDDVY.js +2 -0
- package/dist/chunk-RKNH4ZFT.js +12 -0
- package/dist/chunk-STCITBJK.js +12 -0
- package/dist/chunk-TBBXCC7D.js +5 -0
- package/dist/chunk-TSXT537P.cjs +12 -0
- package/dist/chunk-Y7TA7TPF.js +10 -0
- package/dist/contracts/editor.d.cts +6 -6
- package/dist/contracts/editor.d.ts +6 -6
- package/dist/contracts/interaction.d.cts +6 -6
- package/dist/contracts/interaction.d.ts +6 -6
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.cts +30 -3
- package/dist/contracts/modules.d.ts +30 -3
- package/dist/contracts/modules.js +1 -1
- package/dist/{tree-package-store-DOKMtCnh.d.cts → custom-node-writes-YqISlSRl.d.cts} +181 -4
- package/dist/{tree-package-store-D5S7VKs5.d.ts → custom-node-writes-ttKuYd0M.d.ts} +181 -4
- package/dist/{editor-D0UDock4.d.cts → editor-B93PggnR.d.cts} +24 -5
- package/dist/{editor-C1QRi1v4.d.ts → editor-CFsSrxGR.d.ts} +24 -5
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1368 -279
- package/dist/editor.d.cts +19 -19
- package/dist/editor.d.ts +19 -19
- package/dist/editor.js +1 -1
- package/dist/{image-resources-BJnTpG66.d.ts → image-resources-C_YnqPhn.d.ts} +19 -11
- package/dist/{image-resources-BpIydXtU.d.cts → image-resources-DwpNnTg3.d.cts} +19 -11
- package/dist/{index-CrW-IxXt.d.cts → index-DQhDm4o0.d.cts} +34 -13
- package/dist/{index-ZqBEOrTV.d.ts → index-DTbKoFJL.d.ts} +34 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +869 -819
- package/dist/layout.d.ts +869 -819
- package/dist/layout.js +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +4 -4
- package/dist/output.d.ts +4 -4
- package/dist/output.js +1 -1
- package/dist/{protocol-oxHaWmt4.d.ts → protocol-BWVA3Q1p.d.ts} +56 -2
- package/dist/{protocol-CAkOBBGE.d.cts → protocol-FAz_nPm_.d.cts} +56 -2
- package/dist/review-reads-CsoXSvUg.d.ts +401 -0
- package/dist/review-reads-qW0jvdF1.d.cts +401 -0
- package/dist/{review-support-DS8DYX2a.d.cts → review-support-D64Wu236.d.cts} +37 -5
- package/dist/{review-support-Fy3vdIea.d.ts → review-support-nsLXC9jf.d.ts} +37 -5
- package/dist/{semantic-cell-selection-DsmHmLJ5.d.ts → semantic-cell-selection-D_8RbPII.d.ts} +2 -2
- package/dist/{semantic-cell-selection-CZjBSmMv.d.cts → semantic-cell-selection-DwLB71fF.d.cts} +2 -2
- package/dist/{semantic-interaction-Dy-dCUFF.d.ts → semantic-interaction-CXH2wFqi.d.ts} +1 -1
- package/dist/{semantic-interaction-D-Dszxrn.d.cts → semantic-interaction-DqcEonqD.d.cts} +1 -1
- package/dist/{semantic-paint-drawings-BA3z9jl8.d.ts → semantic-paint-drawings-B5Wk2so5.d.ts} +1 -1
- package/dist/{semantic-paint-drawings-D7qbB0E2.d.cts → semantic-paint-drawings-x8g44lD_.d.cts} +1 -1
- package/dist/{semantic-records-CJR3BvHs.d.cts → semantic-records-COVFW5aS.d.cts} +77 -4
- package/dist/{semantic-records-CWodBJsz.d.ts → semantic-records-zTC0_1zi.d.ts} +77 -4
- package/dist/{shaped-measurer-CNIT_svZ.d.cts → shaped-measurer-AFnFxoot.d.cts} +1 -1
- package/dist/{shaped-measurer-B-TAtcQU.d.ts → shaped-measurer-CZXL-a6v.d.ts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +223 -317
- package/dist/store.d.ts +223 -317
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-CwOeiaQ8.d.ts → tree-op-types-DWLCllG7.d.ts} +80 -25
- package/dist/{tree-op-types-DMiW6nIH.d.cts → tree-op-types-UOXlRUqQ.d.cts} +80 -25
- package/dist/{tree-session-CiUel5Kz.d.ts → tree-session-BtVFXsF6.d.ts} +45 -7
- package/dist/{tree-session-D47_imvR.d.cts → tree-session-DxIOHUOD.d.cts} +45 -7
- package/dist/{tree-store-CxifqwIv.d.cts → tree-store-B1lEkdXc.d.cts} +1 -1
- package/dist/{tree-store-hLtjeyWE.d.ts → tree-store-BscFPB7x.d.ts} +1 -1
- package/package.json +10 -5
- package/dist/chunk-5KSCB2OZ.js +0 -2
- package/dist/chunk-BSC44TIT.js +0 -5
- package/dist/chunk-DLPL5DAG.js +0 -12
- package/dist/chunk-DOEIARE2.js +0 -2
- package/dist/chunk-G7YCQBZE.cjs +0 -5
- package/dist/chunk-HR7K3W6A.js +0 -1
- package/dist/chunk-HVAV2JSN.js +0 -11
- package/dist/chunk-MYH2HCUJ.cjs +0 -2
- package/dist/chunk-NSM75TN6.cjs +0 -1
- package/dist/chunk-PHDVKUWZ.js +0 -1
- package/dist/chunk-QADYGK5L.cjs +0 -12
- package/dist/chunk-RNBHTPW7.js +0 -10
- package/dist/chunk-UD2ZXLFI.cjs +0 -2
- package/dist/chunk-VYAVK2AH.cjs +0 -1
- package/dist/chunk-YUK46A2N.cjs +0 -11
- package/dist/chunk-ZMIX42J7.cjs +0 -10
- package/dist/chunk-ZT55Q52J.cjs +0 -2
- package/dist/chunk-ZUALAR4M.js +0 -2
- package/dist/note-properties-CnmCoory.d.cts +0 -68
- package/dist/note-properties-m75hmP70.d.ts +0 -68
package/dist/store.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { e as ResourceLimits } from './image-resources-
|
|
2
|
-
export { C as CreateImageResourceCacheOptions, D as DEFAULT_IMAGE_RESOURCE_LIMITS, f as DEFAULT_LIMITS, H as HARD_CEILINGS, g as IMAGE_RESOURCE_HARD_CEILINGS, b as ImageDecodePort, c as ImageResourceLimits, h as ImageResourceLookup, I as ImageResourceState, M as MAX_SVG_SNIFF_BYTES, P as PreservedImageMime, S as SupportedImageMime, i as ValidatedRasterHeader, j as createImageResourceCache, k as hasBoundedSvgRoot, l as imageResourceLookupFor, m as liveDrawingReferenceCount, r as resolveImageResourceLimits, n as resolveLimits, s as sniffImageMime, o as validateGifHeader, p as validateJpegHeader, q as validatePngHeader, v as validateRasterHeader } from './image-resources-
|
|
1
|
+
import { e as ResourceLimits } from './image-resources-C_YnqPhn.js';
|
|
2
|
+
export { C as CreateImageResourceCacheOptions, D as DEFAULT_IMAGE_RESOURCE_LIMITS, f as DEFAULT_LIMITS, H as HARD_CEILINGS, g as IMAGE_RESOURCE_HARD_CEILINGS, b as ImageDecodePort, c as ImageResourceLimits, h as ImageResourceLookup, I as ImageResourceState, M as MAX_SVG_SNIFF_BYTES, P as PreservedImageMime, S as SupportedImageMime, i as ValidatedRasterHeader, j as createImageResourceCache, k as hasBoundedSvgRoot, l as imageResourceLookupFor, m as liveDrawingReferenceCount, r as resolveImageResourceLimits, n as resolveLimits, s as sniffImageMime, o as validateGifHeader, p as validateJpegHeader, q as validatePngHeader, v as validateRasterHeader } from './image-resources-C_YnqPhn.js';
|
|
3
3
|
import { O as OoxmlPackage, R as RelationshipRecord } from './ooxml-package-D_CtywTW.js';
|
|
4
4
|
export { C as ContentTypeError, c as ContentTypeIndex, d as ContentTypeRecords, D as DEFAULT_OOXML_PACKAGE_LIMITS, e as DEFAULT_ZIP_LIMITS, f as DefaultRecord, I as IMAGE_RELATIONSHIP_TYPE, g as ImageRelationshipResolution, h as IndexResult, N as NameRejection, i as NameResult, j as OoxmlExternalTarget, a as OoxmlPackageLimits, b as OoxmlPackageRejection, k as OoxmlPackageResult, l as OverrideRecord, m as RelationshipError, n as RelationshipSetResult, o as ResolveResult, p as ResolvedRelationship, T as TargetMode, Z as ZipLimits, q as ZipReadResult, r as ZipRejection, s as asciiFold, t as buildContentTypeIndex, u as buildRelationshipSet, v as detectDuplicateNames, w as extensionKey, x as isValidMime, y as normalizePartName, z as partNameKey, A as readOoxmlPackage, B as readZip, E as resolveContentType, F as resolveImageRelationship, G as resolveInternalTarget, H as resolveRelationship, J as validateExternalTarget, K as withPart, L as writeOoxmlPackage, M as writeZip } from './ooxml-package-D_CtywTW.js';
|
|
5
5
|
import { e as OoxmlPart, O as OoxmlNode, r as OoxmlInvariantResult, a as OoxmlElement, s as OoxmlInvariantIssue, t as OoxmlHardBreakNode, f as OoxmlParagraphNode, u as OoxmlFldCharNode, v as OoxmlFldSimpleNode, w as OoxmlInstrTextNode, x as OoxmlAttribute } from './ooxml-tree-BU0e3DVi.js';
|
|
6
6
|
export { y as OOXML_NODE_IDENTITY_RULES, z as OoxmlBodyNode, A as OoxmlBookmarkEndNode, B as OoxmlBookmarkStartNode, C as OoxmlContentControlCalendarNode, D as OoxmlContentControlCheckboxNode, E as OoxmlContentControlCheckedNode, F as OoxmlContentControlCheckedStateNode, G as OoxmlContentControlComboBoxNode, d as OoxmlContentControlContentNode, H as OoxmlContentControlDataBindingNode, I as OoxmlContentControlDateFormatNode, J as OoxmlContentControlDateNode, K as OoxmlContentControlDropDownListNode, p as OoxmlContentControlEndPropertiesNode, L as OoxmlContentControlLidNode, M as OoxmlContentControlListItemNode, b as OoxmlContentControlNode, q as OoxmlContentControlPropertiesNode, N as OoxmlContentControlStoreMappedDataAsNode, P as OoxmlContentControlTextNode, Q as OoxmlContentControlUncheckedStateNode, h as OoxmlContinuationSeparatorNode, R as OoxmlDocumentNode, i as OoxmlEndnotesNode, j as OoxmlFootnotesNode, c as OoxmlGenericElementNode, S as OoxmlGenericExtensionAttribute, T as OoxmlHyperlinkNode, U as OoxmlInvariantIssueCode, V as OoxmlKnownNodeAttribute, W as OoxmlNamespaceBinding, Y as OoxmlNodeId, Z as OoxmlNodeIdentityRules, g as OoxmlNoteNode, k as OoxmlNoteRefNode, l as OoxmlNoteReferenceNode, _ as OoxmlParagraphPropertiesNode, $ as OoxmlPartMetadata, n as OoxmlReadRejection, a0 as OoxmlReadResult, a1 as OoxmlRunNode, a2 as OoxmlRunPropertiesNode, m as OoxmlSeparatorNode, a3 as OoxmlTabNode, a4 as OoxmlTextElementNode, a5 as OoxmlTextNode, a6 as OoxmlWmlValAttribute, a7 as OoxmlXmlSpaceAttribute, a8 as WML_NAMESPACE_URI, a9 as XMLNS_NAMESPACE_URI, aa as XML_NAMESPACE_URI, X as XmlLimits, ab as XmlNode, ac as XmlRejection, ad as XmlResult, ae as childElements, af as findElement, ag as isContentRevisionKind, ah as isRangeMarkerKind, ai as readOnOffChild, aj as readOoxmlPart, ak as readXml, al as textContent } from './ooxml-tree-BU0e3DVi.js';
|
|
7
|
-
export {
|
|
7
|
+
export { e as BookmarkAnchor, B as BookmarkIndex, f as CascadeDeletedNoteReferencesOptions, g as CustomNodePayloadRead, h as CustomNodePayloadWrite, b as CustomNodeSweepOutcome, i as CustomNodeSweepResult, j as CustomNodeWriteRejection, C as CustomNodeWriteResult, k as DEFAULT_MAX_EDITABLE_STORY_PARTS, D as DocumentTrackingSettings, l as DrawingPropertyIdResult, E as EmbeddedFont, F as FontStyleKey, H as HeaderFooterLifecycleImpact, m as HeaderFooterLifecycleOp, n as HeaderFooterLifecycleRejection, o as HeaderFooterLifecycleResult, I as InsertCustomNodeWrite, L as ListKind, M as MAX_CUSTOM_NODE_LABEL_LENGTH, p as MAX_CUSTOM_NODE_PAYLOAD_LENGTH, q as MAX_NOTE_REFERENCE_PARTS, r as MAX_NOTE_REFERENCE_SCAN, N as NO_TRACKING_SETTINGS, s as NoteDiagnostic, t as NoteDiagnosticCode, u as NoteLifecycleImpact, v as NoteLifecycleOp, w as NoteLifecycleOptions, x as NoteLifecycleRejection, y as NoteLifecycleResult, z as NoteReferenceHit, G as NoteReferenceScanBudget, P as PackageTransactResult, J as ReadEmbeddedFontsOptions, K as StoryResolveResult, S as StoryScope, a as StoryTargetRejection, T as TreePackageStore, O as TreePackageStoreOptions, Q as allocateDrawingPropertyId, U as applyHeaderFooterLifecycleOp, V as applyNoteLifecycleOp, W as buildBookmarkIndex, X as cascadeDeletedNoteReferences, Y as collectNoteReferences, Z as collectPackageNoteReferences, _ as createNoteReferenceScanBudget, $ as customNodePayloadsByControl, a0 as customNodePayloadsOf, a1 as deobfuscateFont, a2 as diagnoseNoteReferences, a3 as ensureListDefinition, a4 as ensureNumberingLevel, a5 as insertCustomNodeWrite, a6 as isHeaderFooterLifecycleOp, a7 as isNoteLifecycleOp, a8 as normalNoteIds, a9 as notesPartHasId, aa as readEmbeddedFonts, ab as readTrackingSettings, ac as removeCustomNodeWrite, ad as resolveNotesPart, ae as sweepCustomNodePayloads, af as withBinaryPart, ag as withEmbeddedImage, ah as withoutUnreferencedImagePart } from './custom-node-writes-ttKuYd0M.js';
|
|
8
8
|
export { c as HeaderFooterKind, a as HeaderFooterParts, b as HeaderFooterSectionResolution, d as HeaderFooterSlotMeta, H as HeaderFooterVariant, e as collectSectionPropertyNodes, r as resolveHeaderFooterParts, f as resolveHeaderFooterPartsBySection, g as resolveHeaderFooterResolutionBySection } from './hf-references-BdjsQNE_.js';
|
|
9
9
|
export { c as collectFlowBlocks, d as contentControlContentOf, i as isContentControl, b as isContentControlContent, w as walkAllStoryParagraphs, e as walkParagraphInline, f as walkStoryBlocks } from './content-control-walk-D06GijR0.js';
|
|
10
|
-
import { T as TreeDocOp, a as TreeOpRejection, q as TreeOpResult, O as OoxmlProperty,
|
|
11
|
-
export { A as ACCEPTED_PARAGRAPH_PROPERTIES, r as ACCEPTED_RUN_PROPERTIES, s as CONTENT_CONTROL_ID_MAX, t as CONTENT_CONTROL_PROPERTY_ORDER, u as ContentControlCheckbox, v as ContentControlCheckboxState, p as ContentControlDataBinding, w as ContentControlDateFormat, x as ContentControlEntry, C as ContentControlKind, n as ContentControlLevel, y as ContentControlListItem, o as ContentControlLock, z as ContentControlProperties, c as DrawingKind, e as DrawingLocks, d as DrawingPositionInput, H as HYPERLINK_RELATIONSHIP_TYPE, B as HyperlinkKind, E as HyperlinkTarget, i as IMAGE_WRAP_TARGETS, M as MAX_CONTENT_CONTROLS_PER_PART, F as MAX_CONTENT_CONTROL_NESTING, G as OFFICE_RELATIONSHIP_NAMESPACE_URI, J as RelationshipTargetResolver, S as SourceCrop, K as TABLE_BORDER_STYLES, L as TREE_DOC_OP_KINDS, l as TableBorderStyle, N as TreeDocOpKind, P as TreeOpEffect, Q as allocateContentControlId, U as contentControlContentChildren, W as contentControlContentNodeOf, X as contentControlEndPropertiesNodeOf, Y as contentControlLevelOf, Z as contentControlPropertiesNodeOf, _ as contentControlPropertiesOf, $ as contentControlTextOf, a0 as contentControlsIn, a1 as findContentControl, a2 as flattenContentControls, a3 as hyperlinkAnchorOf, a4 as hyperlinkRelationshipIdOf, a5 as hyperlinkTargetOf, a6 as isContentControlContentNode, a7 as isContentControlNode, a8 as isContentControlWrapper, a9 as isHyperlinkNode, aa as lockForbidsEdit, ab as lockForbidsRemoval, ac as orderedContentControlProperties, ad as parseContentControlId, ae as projectDrawing, af as resolveContentControlLock } from './tree-op-types-
|
|
10
|
+
import { T as TreeDocOp, a as TreeOpRejection, q as TreeOpResult, O as OoxmlProperty, m as DrawingTreeDocOp, I as ImpactClass, b as ImageWrapTarget } from './tree-op-types-DWLCllG7.js';
|
|
11
|
+
export { A as ACCEPTED_PARAGRAPH_PROPERTIES, r as ACCEPTED_RUN_PROPERTIES, s as CONTENT_CONTROL_ID_MAX, t as CONTENT_CONTROL_PROPERTY_ORDER, u as ContentControlCheckbox, v as ContentControlCheckboxState, p as ContentControlDataBinding, w as ContentControlDateFormat, x as ContentControlEntry, C as ContentControlKind, n as ContentControlLevel, y as ContentControlListItem, o as ContentControlLock, z as ContentControlProperties, c as DrawingKind, e as DrawingLocks, d as DrawingPositionInput, H as HYPERLINK_RELATIONSHIP_TYPE, B as HyperlinkKind, E as HyperlinkTarget, i as IMAGE_WRAP_TARGETS, M as MAX_CONTENT_CONTROLS_PER_PART, F as MAX_CONTENT_CONTROL_NESTING, G as OFFICE_RELATIONSHIP_NAMESPACE_URI, J as RelationshipTargetResolver, R as RevisionAddress, S as SourceCrop, K as TABLE_BORDER_STYLES, L as TREE_DOC_OP_KINDS, l as TableBorderStyle, N as TreeDocOpKind, P as TreeOpEffect, Q as allocateContentControlId, U as contentControlContentChildren, W as contentControlContentNodeOf, X as contentControlEndPropertiesNodeOf, Y as contentControlLevelOf, Z as contentControlPropertiesNodeOf, _ as contentControlPropertiesOf, $ as contentControlTextOf, a0 as contentControlsIn, a1 as findContentControl, a2 as flattenContentControls, a3 as hyperlinkAnchorOf, a4 as hyperlinkRelationshipIdOf, a5 as hyperlinkTargetOf, a6 as isContentControlContentNode, a7 as isContentControlNode, a8 as isContentControlWrapper, a9 as isHyperlinkNode, aa as lockForbidsEdit, ab as lockForbidsRemoval, ac as orderedContentControlProperties, ad as parseContentControlId, ae as projectDrawing, af as resolveContentControlLock } from './tree-op-types-DWLCllG7.js';
|
|
12
12
|
export { A as AtomicNoteSpan, M as MAX_NOTES_PER_PART, a as NOTE_ATOM_CHAR, b as NOTE_CONTINUATION_SEPARATOR_ID, c as NOTE_ID_MAX, d as NOTE_ID_MIN, e as NOTE_SEPARATOR_ID, N as NoteKind, f as NoteType, g as allocateNoteId, h as atomicNoteSpansOf, i as customMarkFollows, j as findNoteById, k as formatNoteScopeId, l as isContinuationSeparatorNode, m as isEndnotesNode, o as isFootnotesNode, p as isNormalNote, q as isNoteAtomNode, r as isNoteNode, s as isNoteRefNode, t as isNoteReferenceNode, u as isSeparatorNode, v as noteAtomText, w as noteIdOf, x as noteKindOf, y as noteRefKindOf, z as noteReferenceKindOf, n as noteTypeOf, B as notesOf, C as parseNoteId, D as parseNoteScopeId } from './note-nodes-BPSTVDMr.js';
|
|
13
|
-
export { A as AuthoredNoteProperties, D as DEFAULT_ENDNOTE_PROPERTIES,
|
|
14
|
-
import { T as TreeModelChange, b as TreeDocumentStore } from './tree-store-
|
|
15
|
-
export { S as SelectionMark, f as TreeDocumentStoreOptions, a as TreeStoryRef, d as TreeTransactOptions, g as TreeTransactResult, c as TreeTransactionContext } from './tree-store-
|
|
13
|
+
export { A as AuthoredNoteProperties, C as CommentAnchor, b as CommentPosition, c as CommentRecord, d as CommentThreadState, D as DEFAULT_ENDNOTE_PROPERTIES, e as DEFAULT_FOOTNOTE_PROPERTIES, E as EndnotePosition, F as FootnotePosition, L as LinkableReviewItem, N as NoteNumRestart, a as ResolvedEndnoteProperties, R as ResolvedFootnoteProperties, f as ReviewCommentItem, g as ReviewItem, h as ReviewModelInput, i as ReviewPosition, j as ReviewRange, k as ReviewRevisionItem, l as ReviewRevisionKind, W as W15_NAMESPACE_URI, m as authoredDocumentEndnoteProperties, n as authoredDocumentFootnoteProperties, o as authoredEndnotePropertiesFromSectPr, q as authoredFootnotePropertiesFromSectPr, r as collectReviewItems, s as commentAnchorsOfStory, t as commentBodyText, u as commentInitials, v as commentItemsOf, w as commentsOfPart, x as deepParagraphOrderOfPart, y as firstReviewRange, z as isLegalEndnotePosition, B as isLegalFootnotePosition, G as isLegalNumRestart, H as linkRevisionReplies, p as paragraphOrderOfPart, I as parseAuthoredNoteProperties, J as resolveEndnoteProperties, K as resolveFootnoteProperties, M as reviewItemKey, O as reviewItemRanges, P as revisionItemsOf, Q as settingsPartOf, S as threadStateOfPart } from './review-reads-CsoXSvUg.js';
|
|
14
|
+
import { T as TreeModelChange, b as TreeDocumentStore } from './tree-store-BscFPB7x.js';
|
|
15
|
+
export { S as SelectionMark, f as TreeDocumentStoreOptions, a as TreeStoryRef, d as TreeTransactOptions, g as TreeTransactResult, c as TreeTransactionContext } from './tree-store-BscFPB7x.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Every kind of thing the registry gives a stable identity to.
|
|
@@ -851,6 +851,11 @@ declare function relsPartNameFor(partName: string): string;
|
|
|
851
851
|
declare function withContentTypeOverride(pkg: OoxmlPackage, partName: string, contentType: string, options?: {
|
|
852
852
|
readonly forceOverride?: boolean;
|
|
853
853
|
}): OoxmlPackage;
|
|
854
|
+
/** What {@link withoutPart} answers: `ok: false` leaves the package exactly as it was. */
|
|
855
|
+
interface WithoutPartResult {
|
|
856
|
+
readonly pkg: OoxmlPackage;
|
|
857
|
+
readonly ok: boolean;
|
|
858
|
+
}
|
|
854
859
|
/** Add or replace one relationship on a part, returning a new package. */
|
|
855
860
|
declare function withRelationship(pkg: OoxmlPackage, ownerPart: string, type: string, rawTarget: string): {
|
|
856
861
|
readonly pkg: OoxmlPackage;
|
|
@@ -1529,6 +1534,214 @@ declare function storyParagraphs(root: OoxmlNode): readonly OoxmlNode[];
|
|
|
1529
1534
|
*/
|
|
1530
1535
|
declare function collectStoryParagraphs(children: readonly OoxmlNode[], out: OoxmlNode[], sdtDepth: number): void;
|
|
1531
1536
|
|
|
1537
|
+
/** Relationship from the story to one data part. */
|
|
1538
|
+
declare const CUSTOM_XML_REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
|
|
1539
|
+
/** Relationship from a data part to the properties that carry its `ds:itemID`. */
|
|
1540
|
+
declare const CUSTOM_XML_PROPS_REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
|
|
1541
|
+
/** `itemPropsN.xml` needs an Override; `itemN.xml` rides the package's `xml` default. */
|
|
1542
|
+
declare const CUSTOM_XML_PROPS_TYPE = "application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
|
|
1543
|
+
/** The datastore namespace `ds:datastoreItem` lives in. */
|
|
1544
|
+
declare const DATASTORE_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/customXml";
|
|
1545
|
+
/** A data part located in a package: where it lives, and the GUID an SDT binds to. */
|
|
1546
|
+
interface CustomXmlDataPart {
|
|
1547
|
+
/** Canonical part name, e.g. `/customXml/item1.xml`. */
|
|
1548
|
+
readonly partName: string;
|
|
1549
|
+
/** Part name of its properties, e.g. `/customXml/itemProps1.xml`. */
|
|
1550
|
+
readonly propsPartName: string;
|
|
1551
|
+
/** `ds:itemID`, braced and upper-case, as `w:storeItemID` must spell it. */
|
|
1552
|
+
readonly itemId: string;
|
|
1553
|
+
/** Namespace URI of the payload root, which is what identifies one store among several. */
|
|
1554
|
+
readonly namespaceUri: string;
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* A `ds:itemID` derived from the seed rather than drawn at random.
|
|
1558
|
+
*
|
|
1559
|
+
* Exported so a caller that authors a store OUTSIDE a package — a template engine splicing
|
|
1560
|
+
* markup it will assemble into a `.docx` later — mints the id the same way this does, rather
|
|
1561
|
+
* than inventing a second GUID shape Word has to be tolerant of.
|
|
1562
|
+
*
|
|
1563
|
+
* The store is a pure function of what it is asked to write: the same document written twice
|
|
1564
|
+
* has to produce the same bytes, or a save/reopen/save round trip stops being a fixed point
|
|
1565
|
+
* and every digest taken over saved bytes moves. A GUID's job here is uniqueness within one
|
|
1566
|
+
* package, not unguessability, so four FNV-1a passes over a salted seed carry it.
|
|
1567
|
+
*/
|
|
1568
|
+
declare function datastoreItemIdFor(seed: string): string;
|
|
1569
|
+
/**
|
|
1570
|
+
* The data parts a story relates to, in relationship order.
|
|
1571
|
+
*
|
|
1572
|
+
* Reads the relationships rather than scanning `/customXml/` by name: a part nothing relates
|
|
1573
|
+
* to is not part of the document, and a package from a hostile sender can hold as many
|
|
1574
|
+
* plausibly-named files as it likes.
|
|
1575
|
+
*/
|
|
1576
|
+
declare function customXmlDataParts(pkg: OoxmlPackage, storyPartName: string): CustomXmlDataPart[];
|
|
1577
|
+
/** The data part carrying this namespace, or null when the document has none yet. */
|
|
1578
|
+
declare function findCustomXmlDataPart(pkg: OoxmlPackage, storyPartName: string, namespaceUri: string): CustomXmlDataPart | null;
|
|
1579
|
+
/** What {@link withCustomXmlDataPart} answers. */
|
|
1580
|
+
interface CustomXmlDataPartResult {
|
|
1581
|
+
readonly pkg: OoxmlPackage;
|
|
1582
|
+
/** Null when the part could not be authored; the package then comes back unchanged. */
|
|
1583
|
+
readonly part: CustomXmlDataPart | null;
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Ensure the document carries a data part for this namespace, creating it and everything it
|
|
1587
|
+
* needs — properties, both relationships, the properties content type — when it does not.
|
|
1588
|
+
*
|
|
1589
|
+
* Idempotent: a package that already has one for the namespace comes back untouched, so a
|
|
1590
|
+
* second node added to the same store does not author a second store.
|
|
1591
|
+
*
|
|
1592
|
+
* @param storyPartName - Whose relationships the store hangs off. Word enumerates its data
|
|
1593
|
+
* store from the MAIN DOCUMENT part, so a store authored off a header or footer is one Word
|
|
1594
|
+
* never sees.
|
|
1595
|
+
*/
|
|
1596
|
+
declare function withCustomXmlDataPart(pkg: OoxmlPackage, storyPartName: string, namespaceUri: string, rootLocalName: string): CustomXmlDataPartResult;
|
|
1597
|
+
/**
|
|
1598
|
+
* Remove a store from a document: both parts, both relationships, the Override.
|
|
1599
|
+
*
|
|
1600
|
+
* PACKAGE ONLY. It does not touch the body, so a `w:sdt` bound to the store keeps its
|
|
1601
|
+
* `w:dataBinding`, its `w:storeItemID` and its `w:tag`, and Word then opens a control bound to
|
|
1602
|
+
* a store that is not there. Stripping those is the export path's job and is not built; this
|
|
1603
|
+
* is the half that removes the payload, which is the half a caller can rely on.
|
|
1604
|
+
*
|
|
1605
|
+
* `ok: false` means nothing was removed and the package is unchanged — most often because an
|
|
1606
|
+
* owner's `.rels` was never parsed into a tree, which {@link withoutPart} refuses to work
|
|
1607
|
+
* around. A caller exporting a document has to treat that as a failure to export rather than
|
|
1608
|
+
* as a document with nothing to strip, or it ships the payload it meant to remove.
|
|
1609
|
+
*/
|
|
1610
|
+
declare function withoutCustomXmlDataPart(pkg: OoxmlPackage, storyPartName: string, namespaceUri: string): WithoutPartResult;
|
|
1611
|
+
|
|
1612
|
+
/** One node in a store: its id, the bound text, and the payload beside it. */
|
|
1613
|
+
interface CustomXmlNode {
|
|
1614
|
+
readonly id: string;
|
|
1615
|
+
/** Text a `w:dataBinding` resolves to. Untrusted file input. */
|
|
1616
|
+
readonly label: string;
|
|
1617
|
+
/** Payload as authored, JSON by convention and unparsed here. Untrusted file input. */
|
|
1618
|
+
readonly data: string;
|
|
1619
|
+
}
|
|
1620
|
+
/** Every node a store holds, in document order. */
|
|
1621
|
+
declare function customXmlNodes(pkg: OoxmlPackage, partName: string): CustomXmlNode[];
|
|
1622
|
+
/** One node by id, or null. */
|
|
1623
|
+
declare function readCustomXmlNode(pkg: OoxmlPackage, partName: string, nodeId: string): CustomXmlNode | null;
|
|
1624
|
+
/**
|
|
1625
|
+
* Write a node, replacing one that already has the id.
|
|
1626
|
+
*
|
|
1627
|
+
* Replace rather than append: a second node with the same id makes the binding xpath ambiguous,
|
|
1628
|
+
* and Word resolves an ambiguous xpath to the first match — so an "update" that appended would
|
|
1629
|
+
* leave the control showing its old text forever.
|
|
1630
|
+
*/
|
|
1631
|
+
declare function withCustomXmlNode(pkg: OoxmlPackage, partName: string, node: CustomXmlNode): OoxmlPackage;
|
|
1632
|
+
/** Drop one node by id. A store that never held it comes back unchanged. */
|
|
1633
|
+
declare function withoutCustomXmlNode(pkg: OoxmlPackage, partName: string, nodeId: string): OoxmlPackage;
|
|
1634
|
+
/**
|
|
1635
|
+
* Drop every node no longer referenced, given the ids the document still binds.
|
|
1636
|
+
*
|
|
1637
|
+
* This is the whole deletion story. Deleting a control in THIS editor can remove its node
|
|
1638
|
+
* directly, but a control deleted in Word leaves the node behind — Word has no lifecycle link
|
|
1639
|
+
* between the two and no way to run our code. Reconciling against what the story actually binds
|
|
1640
|
+
* collects both, and is the only thing that can collect the second.
|
|
1641
|
+
*
|
|
1642
|
+
* Takes the referenced ids rather than reading the story itself: the caller already walked it,
|
|
1643
|
+
* and a sweep that guessed at which controls exist would delete a payload on a mistake.
|
|
1644
|
+
*/
|
|
1645
|
+
declare function withoutOrphanCustomXmlNodes(pkg: OoxmlPackage, partName: string, referencedIds: ReadonlySet<string>): {
|
|
1646
|
+
readonly pkg: OoxmlPackage;
|
|
1647
|
+
readonly removed: readonly string[];
|
|
1648
|
+
};
|
|
1649
|
+
/**
|
|
1650
|
+
* The `w:xpath` a binding uses to reach a node's label, or null when the id cannot be addressed.
|
|
1651
|
+
*
|
|
1652
|
+
* Word needs a prefix for the payload namespace even when the store declares it as a default —
|
|
1653
|
+
* an unprefixed step in an XPath means "no namespace", so `/docxEditor/node` would match
|
|
1654
|
+
* nothing in a namespaced store. The prefix is declared in `w:prefixMappings` beside it.
|
|
1655
|
+
*/
|
|
1656
|
+
declare function customXmlLabelXPath(prefix: string, rootLocalName: string, nodeId: string): string | null;
|
|
1657
|
+
/** The `w:prefixMappings` value declaring that prefix, or null when it cannot be written.
|
|
1658
|
+
* The namespace sits inside single quotes inside a double-quoted attribute, so a namespace
|
|
1659
|
+
* carrying either quote character has no representation here. */
|
|
1660
|
+
declare function customXmlPrefixMappings(prefix: string, namespaceUri: string): string | null;
|
|
1661
|
+
|
|
1662
|
+
/** The prefix every binding this library authors declares and quotes. */
|
|
1663
|
+
declare const CUSTOM_NODE_XPATH_PREFIX = "ns0";
|
|
1664
|
+
/** The three attributes a `w:dataBinding` carries. */
|
|
1665
|
+
interface CustomNodeBinding {
|
|
1666
|
+
readonly prefixMappings: string;
|
|
1667
|
+
readonly xpath: string;
|
|
1668
|
+
readonly storeItemId: string;
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* The binding for one node in one store, or null when the id cannot be addressed by an XPath.
|
|
1672
|
+
*
|
|
1673
|
+
* Refuses rather than escapes: XPath 1.0 has no escape for a quote inside a literal, so an id
|
|
1674
|
+
* carrying one could close the predicate and append an expression of the sender's choosing.
|
|
1675
|
+
* The ids are minted by a host, so refusing is honest — see `ADDRESSABLE_ID`.
|
|
1676
|
+
*/
|
|
1677
|
+
declare function customNodeBinding(part: CustomXmlDataPart, rootLocalName: string, nodeId: string): CustomNodeBinding | null;
|
|
1678
|
+
/**
|
|
1679
|
+
* Every node id the story's controls bind to in one store, in document order.
|
|
1680
|
+
*
|
|
1681
|
+
* This is the input the orphan sweep takes: a node whose id is not in here is one no control
|
|
1682
|
+
* names, whether it was deleted in this editor or in Word. Reading it from the STORY rather than
|
|
1683
|
+
* from a host's bookkeeping is what makes the two cases one mechanism.
|
|
1684
|
+
*/
|
|
1685
|
+
declare function boundCustomXmlNodeIds(part: OoxmlPart, storeItemId: string): Set<string>;
|
|
1686
|
+
/**
|
|
1687
|
+
* Every node id ANY story in the package binds, in one store.
|
|
1688
|
+
*
|
|
1689
|
+
* THE WHOLE PACKAGE, not one story. A payload is reachable from a header as easily as from the
|
|
1690
|
+
* body — Word enumerates its data store from the main part, but nothing stops a control
|
|
1691
|
+
* elsewhere quoting the same `w:storeItemID` — and the two callers that decide what is an orphan
|
|
1692
|
+
* both destroy data when they are wrong. The sweep would collect a payload a header still paints;
|
|
1693
|
+
* the export would strip a store a header still names, which is a document Word offers to repair.
|
|
1694
|
+
*
|
|
1695
|
+
* Costs one walk per story per store, on open and on export. Neither is a keystroke.
|
|
1696
|
+
*/
|
|
1697
|
+
declare function boundCustomXmlNodeIdsInPackage(pkg: OoxmlPackage, storeItemId: string): Set<string>;
|
|
1698
|
+
/** The node id one control binds to in the named store, or null when it binds to nothing there. */
|
|
1699
|
+
declare function boundCustomXmlNodeIdOf(control: OoxmlNode, storeItemId: string): string | null;
|
|
1700
|
+
|
|
1701
|
+
/** What happens to one control when the document is exported. */
|
|
1702
|
+
type CustomNodeExportPolicy = 'keep' | 'text' | 'remove';
|
|
1703
|
+
/** How {@link withExportedCustomNodes} decides, and which stores it may tidy afterwards. */
|
|
1704
|
+
interface CustomNodeExportRequest {
|
|
1705
|
+
/** The story whose controls are policed, and whose relationships the stores hang off. */
|
|
1706
|
+
readonly storyPartName: string;
|
|
1707
|
+
/**
|
|
1708
|
+
* Payload namespaces the caller CLAIMS.
|
|
1709
|
+
*
|
|
1710
|
+
* The store cleanup runs only over these. Word's own Cover Page Properties store rides in most
|
|
1711
|
+
* templates, and an export that tidied every customXml part would be deleting from documents it
|
|
1712
|
+
* was only asked to strip its own markup from.
|
|
1713
|
+
*/
|
|
1714
|
+
readonly namespaces: readonly string[];
|
|
1715
|
+
/** The fate of a control carrying this `w:tag`. A control with no tag is never touched. */
|
|
1716
|
+
readonly decide: (tag: string) => CustomNodeExportPolicy;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* The export, or the reason there is no export.
|
|
1720
|
+
*
|
|
1721
|
+
* A refusal answers no package on purpose. "Stripping failed, here is the document anyway" is the
|
|
1722
|
+
* one outcome that must not be possible: a caller would ship the markup it asked to remove and
|
|
1723
|
+
* have been told the export succeeded.
|
|
1724
|
+
*/
|
|
1725
|
+
type CustomNodeExportResult = {
|
|
1726
|
+
readonly ok: true;
|
|
1727
|
+
readonly pkg: OoxmlPackage;
|
|
1728
|
+
/** Controls unwrapped (`text`) and controls removed (`remove`). */
|
|
1729
|
+
readonly unwrapped: number;
|
|
1730
|
+
readonly removed: number;
|
|
1731
|
+
} | {
|
|
1732
|
+
readonly ok: false;
|
|
1733
|
+
readonly reason: string;
|
|
1734
|
+
};
|
|
1735
|
+
/**
|
|
1736
|
+
* Apply the policy, then take the payloads and the stores the policy orphaned.
|
|
1737
|
+
*
|
|
1738
|
+
* Order matters and is the reverse of the write's. The BODY goes first, so the sweep that follows
|
|
1739
|
+
* sees the controls that actually survive; the stores go last, once nothing binds them. Doing it
|
|
1740
|
+
* the other way would strip a store while a control still quoted its `w:storeItemID`, which is a
|
|
1741
|
+
* document Word opens and offers to repair.
|
|
1742
|
+
*/
|
|
1743
|
+
declare function withExportedCustomNodes(pkg: OoxmlPackage, request: CustomNodeExportRequest): CustomNodeExportResult;
|
|
1744
|
+
|
|
1532
1745
|
/** One addressable unit of paragraph text: text, tab, hard break, or atomic field. */
|
|
1533
1746
|
interface Segment {
|
|
1534
1747
|
readonly runId: string;
|
|
@@ -1843,200 +2056,6 @@ interface RevisionSite {
|
|
|
1843
2056
|
*/
|
|
1844
2057
|
declare function collectRevisionSites(part: OoxmlPart): RevisionSite[];
|
|
1845
2058
|
|
|
1846
|
-
/** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
|
|
1847
|
-
declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
1848
|
-
/** A position in one story: a paragraph node id plus a UTF-16 offset inside it. */
|
|
1849
|
-
interface CommentPosition {
|
|
1850
|
-
readonly paragraphId: string;
|
|
1851
|
-
readonly offset: number;
|
|
1852
|
-
}
|
|
1853
|
-
/**
|
|
1854
|
-
* Where a comment is anchored, as a range.
|
|
1855
|
-
*
|
|
1856
|
-
* `orphaned` records that the file did not give this comment a usable range — a reference with
|
|
1857
|
-
* no range markers, or a start with no end. The comment is still listed, marked orphaned,
|
|
1858
|
-
* rather than dropped: a reviewer's remark disappearing silently is worse than one that says
|
|
1859
|
-
* it lost its text.
|
|
1860
|
-
*/
|
|
1861
|
-
interface CommentAnchor {
|
|
1862
|
-
readonly commentId: string;
|
|
1863
|
-
/** Canonical name of the part the range lives in, so a header comment is attributable. */
|
|
1864
|
-
readonly partName: string;
|
|
1865
|
-
readonly start: CommentPosition;
|
|
1866
|
-
readonly end: CommentPosition;
|
|
1867
|
-
readonly orphaned: boolean;
|
|
1868
|
-
}
|
|
1869
|
-
/** One comment as authored in `word/comments.xml`. */
|
|
1870
|
-
interface CommentRecord {
|
|
1871
|
-
readonly id: string;
|
|
1872
|
-
readonly author: string;
|
|
1873
|
-
readonly initials?: string;
|
|
1874
|
-
readonly date?: string;
|
|
1875
|
-
/** Body paragraphs, as tree nodes, so the surface renders measured text rather than a string. */
|
|
1876
|
-
readonly blocks: readonly OoxmlElement[];
|
|
1877
|
-
/** `w14:paraId` of the first body paragraph — the key thread state is stored under. */
|
|
1878
|
-
readonly paraId?: string;
|
|
1879
|
-
/** `@w16cid:parentId` — the `w:id` of the comment this replies to, when the file names it. */
|
|
1880
|
-
readonly parentCommentId?: string;
|
|
1881
|
-
}
|
|
1882
|
-
/** Thread state for one comment, read from `commentsExtended.xml`. */
|
|
1883
|
-
interface CommentThreadState {
|
|
1884
|
-
/** `@w15:paraIdParent` — the comment this one replies to, absent for a top-level comment. */
|
|
1885
|
-
readonly parentParaId?: string;
|
|
1886
|
-
readonly done: boolean;
|
|
1887
|
-
}
|
|
1888
|
-
/**
|
|
1889
|
-
* Every comment anchor in one story, in document order.
|
|
1890
|
-
*
|
|
1891
|
-
* Overlapping and nested ranges are supported because each anchor is resolved independently —
|
|
1892
|
-
* Word produces both, and a model that assumed ranges nest cleanly would mis-anchor them.
|
|
1893
|
-
*
|
|
1894
|
-
* A start with no matching end anchors to the end of its own paragraph and is reported orphaned
|
|
1895
|
-
* rather than guessed at: extending it to the next end marker would attach a reviewer's remark
|
|
1896
|
-
* to text they never saw.
|
|
1897
|
-
*/
|
|
1898
|
-
declare function commentAnchorsOfStory(part: OoxmlPart): CommentAnchor[];
|
|
1899
|
-
/**
|
|
1900
|
-
* The comments in `word/comments.xml`, in authored order.
|
|
1901
|
-
*
|
|
1902
|
-
* Every value here comes from a file an attacker fully controls, so nothing is interpreted:
|
|
1903
|
-
* author, initials and date are carried verbatim for a surface that will set them as TEXT.
|
|
1904
|
-
*/
|
|
1905
|
-
declare function commentsOfPart(part: OoxmlPart): CommentRecord[];
|
|
1906
|
-
/**
|
|
1907
|
-
* Thread state by `w14:paraId`, from `commentsExtended.xml`.
|
|
1908
|
-
*
|
|
1909
|
-
* The part being PRESENT is not evidence of threading. `issue-68-large-comments-suggestions.docx`
|
|
1910
|
-
* ships it with 212 entries carrying `@w15:done` and not one `@w15:paraIdParent`, so it records
|
|
1911
|
-
* resolved state for a flat list. Absent parent means top-level, and that is a fact about the
|
|
1912
|
-
* file rather than a default this code chose.
|
|
1913
|
-
*/
|
|
1914
|
-
declare function threadStateOfPart(part: OoxmlPart): Map<string, CommentThreadState>;
|
|
1915
|
-
|
|
1916
|
-
/** A position in the model offset space of one story. */
|
|
1917
|
-
interface ReviewPosition {
|
|
1918
|
-
readonly paragraphId: string;
|
|
1919
|
-
readonly offset: number;
|
|
1920
|
-
}
|
|
1921
|
-
/** Where an item is anchored: a range in one story. */
|
|
1922
|
-
interface ReviewRange {
|
|
1923
|
-
readonly partName: string;
|
|
1924
|
-
readonly start: ReviewPosition;
|
|
1925
|
-
readonly end: ReviewPosition;
|
|
1926
|
-
}
|
|
1927
|
-
/**
|
|
1928
|
-
* What kind of decision a revision card represents.
|
|
1929
|
-
*
|
|
1930
|
-
* Wider than the four content wrappers, because a reviewer has to be shown every pending
|
|
1931
|
-
* decision, including the ones that decorate no characters. A card the surface cannot show is
|
|
1932
|
-
* a change the reviewer never learns about — and `acceptAllRevisions` refuses if ANY revision
|
|
1933
|
-
* in the document is one the engine cannot resolve, so an invisible one makes Accept All fail
|
|
1934
|
-
* for a reason nothing on screen explains.
|
|
1935
|
-
*/
|
|
1936
|
-
type ReviewRevisionKind = 'insert' | 'delete'
|
|
1937
|
-
/**
|
|
1938
|
-
* A deletion and an insertion that are one edit: text typed over a selection.
|
|
1939
|
-
*
|
|
1940
|
-
* Word shows these as a single `Replaced "x" with "y"` card, and resolving one half
|
|
1941
|
-
* without the other is never what the reviewer meant — accepting the deletion alone
|
|
1942
|
-
* leaves the replacement text unproposed, rejecting it alone leaves both.
|
|
1943
|
-
*/
|
|
1944
|
-
| 'replace' | 'moveFrom' | 'moveTo'
|
|
1945
|
-
/** `w:rPrChange` / `w:pPrChange` — the words are unchanged, their formatting is not. */
|
|
1946
|
-
| 'format'
|
|
1947
|
-
/** `w:pPr/w:rPr/w:ins|w:del` — a paragraph split or merge. */
|
|
1948
|
-
| 'paragraphMark'
|
|
1949
|
-
/** A row, cell, section or grid revision. Supported row revisions are resolvable. */
|
|
1950
|
-
| 'structural';
|
|
1951
|
-
/** One tracked change as the store derives it, keyed per decision rather than per site. */
|
|
1952
|
-
interface ReviewRevisionItem {
|
|
1953
|
-
readonly kind: 'revision';
|
|
1954
|
-
/** Stable across renders and unique per DECISION, not per site. */
|
|
1955
|
-
readonly id: string;
|
|
1956
|
-
/** The payload `acceptRevision` / `rejectRevision` take. */
|
|
1957
|
-
readonly address: RevisionAddress;
|
|
1958
|
-
/**
|
|
1959
|
-
* EVERY address this decision covers, `address` first.
|
|
1960
|
-
*
|
|
1961
|
-
* More than one only for a replacement, whose halves a foreign editor may have written
|
|
1962
|
-
* as two independent revisions. Accept and reject walk all of them in one transaction:
|
|
1963
|
-
* resolving one half and leaving the other is a state no reviewer asked for.
|
|
1964
|
-
*/
|
|
1965
|
-
readonly addresses: readonly RevisionAddress[];
|
|
1966
|
-
/** The words a replacement removes. Empty for every other kind. */
|
|
1967
|
-
readonly replacedText: string;
|
|
1968
|
-
readonly revisionKind: ReviewRevisionKind;
|
|
1969
|
-
readonly author: string;
|
|
1970
|
-
readonly date?: string;
|
|
1971
|
-
/** Text the revision covers, for the card summary. Empty for changes with no characters. */
|
|
1972
|
-
readonly text: string;
|
|
1973
|
-
/** Every site this decision touches, in document order. */
|
|
1974
|
-
readonly ranges: readonly ReviewRange[];
|
|
1975
|
-
/**
|
|
1976
|
-
* How many leading `ranges` are the STRUCK half of a replacement.
|
|
1977
|
-
*
|
|
1978
|
-
* A replacement's card is one decision but its ranges are two colours — red over what is
|
|
1979
|
-
* going, green over what takes its place. ABSENT when the halves do not split at a single
|
|
1980
|
-
* point, which is what a file recording both under one revision id can produce; a surface
|
|
1981
|
-
* then has no basis for two colours and should paint one neutral band rather than guess.
|
|
1982
|
-
*/
|
|
1983
|
-
readonly replacedRangeCount?: number;
|
|
1984
|
-
/**
|
|
1985
|
-
* True when the engine cannot resolve this kind, so accept and reject must not be offered.
|
|
1986
|
-
*
|
|
1987
|
-
* Derived HERE rather than from a caller-supplied predicate: the refusal list is internal,
|
|
1988
|
-
* and a surface asked to compute it would have to guess. A card that offers a button the
|
|
1989
|
-
* engine will refuse is worse than one that explains why it cannot.
|
|
1990
|
-
*/
|
|
1991
|
-
readonly readOnly: boolean;
|
|
1992
|
-
/** The other half of a move, or the other side of a delete/insert replacement. */
|
|
1993
|
-
readonly pairedWith?: string;
|
|
1994
|
-
/**
|
|
1995
|
-
* Comments answering this change, in document order.
|
|
1996
|
-
*
|
|
1997
|
-
* A reply to a tracked change IS a comment: `w:ins` and `w:del` carry `(@w:id, @w:author,
|
|
1998
|
-
* @w:date)` and no body, so `replyToReviewItem` writes the text as a comment over the
|
|
1999
|
-
* revision's own range. Nothing recorded the link, so the reply came back as a separate
|
|
2000
|
-
* card — the reader saw their answer detach from the change it answered. The range is the
|
|
2001
|
-
* link, and it is the same evidence `commentItemsOf` threads coincident comments on.
|
|
2002
|
-
*/
|
|
2003
|
-
readonly replyIds: readonly string[];
|
|
2004
|
-
}
|
|
2005
|
-
/** One comment as the store derives it, with its thread links resolved. */
|
|
2006
|
-
interface ReviewCommentItem {
|
|
2007
|
-
readonly kind: 'comment';
|
|
2008
|
-
readonly id: string;
|
|
2009
|
-
readonly comment: CommentRecord;
|
|
2010
|
-
readonly range: ReviewRange | null;
|
|
2011
|
-
readonly resolved: boolean;
|
|
2012
|
-
/** The comment this replies to, absent for a top-level comment. */
|
|
2013
|
-
readonly parentId?: string;
|
|
2014
|
-
/**
|
|
2015
|
-
* The REVISION this comment answers, when it covers exactly that change's characters.
|
|
2016
|
-
*
|
|
2017
|
-
* Separate from {@link parentId} rather than folded into it: the two name different item
|
|
2018
|
-
* kinds, and a surface resolving one id against the comment index would find nothing.
|
|
2019
|
-
*/
|
|
2020
|
-
readonly parentRevisionId?: string;
|
|
2021
|
-
/** Replies to this comment, in document order. Empty for a reply or a childless comment. */
|
|
2022
|
-
readonly replyIds: readonly string[];
|
|
2023
|
-
/** True when the file gave this comment no usable range. */
|
|
2024
|
-
readonly orphaned: boolean;
|
|
2025
|
-
}
|
|
2026
|
-
/**
|
|
2027
|
-
* One pending decision as the STORE derives it: a tracked change or a comment. Discriminate on
|
|
2028
|
-
* `kind`.
|
|
2029
|
-
*
|
|
2030
|
-
* The layout layer's own `ReviewItem` widens this with the pro custom-node card, which has no
|
|
2031
|
-
* store representation.
|
|
2032
|
-
*/
|
|
2033
|
-
type ReviewItem = ReviewRevisionItem | ReviewCommentItem;
|
|
2034
|
-
/** The stable key a surface uses for the active item and for a React list. */
|
|
2035
|
-
declare function reviewItemKey(item: ReviewItem): string;
|
|
2036
|
-
/** Plain text of a comment's body, so a card never re-implements the run walk. */
|
|
2037
|
-
declare function commentBodyText(comment: CommentRecord): string;
|
|
2038
|
-
/** Author initials for an avatar, from `@w:initials` or the name. */
|
|
2039
|
-
declare function commentInitials(comment: CommentRecord): string;
|
|
2040
2059
|
/** The `w:p` a node sits inside, and the model offset it starts at within that paragraph. */
|
|
2041
2060
|
interface SiteLocation {
|
|
2042
2061
|
readonly paragraphId: string;
|
|
@@ -2054,120 +2073,7 @@ interface SiteLocation {
|
|
|
2054
2073
|
* instruction text the wrong lengths, so every card in a paragraph holding one reported a
|
|
2055
2074
|
* range the caret and the ops disagreed with.
|
|
2056
2075
|
*/
|
|
2057
|
-
declare function locateSites(part: OoxmlPart):
|
|
2058
|
-
/**
|
|
2059
|
-
* Every revision in one story, one card per DECISION.
|
|
2060
|
-
*
|
|
2061
|
-
* Sites sharing an `(id, author, date)` triple are ONE revision — a tracked row insertion is
|
|
2062
|
-
* `w:trPr/w:ins` plus `w:cellIns` on every cell — so they coalesce into one card listing every
|
|
2063
|
-
* range it touches. Keying per site would show the reviewer four decisions where there is one,
|
|
2064
|
-
* and accepting any of them would make the other three vanish.
|
|
2065
|
-
*/
|
|
2066
|
-
declare function revisionItemsOf(part: OoxmlPart): ReviewRevisionItem[];
|
|
2067
|
-
/**
|
|
2068
|
-
* Comment cards, threaded however the file says so and flat when nothing says so.
|
|
2069
|
-
*
|
|
2070
|
-
* ECMA-376 §17.13.4.2 gives `CT_Comment` no parent pointer, so threading is never something
|
|
2071
|
-
* the standard states outright. Three sources, strongest first: `@w15:paraIdParent`, then
|
|
2072
|
-
* `@w16cid:parentId` — both in namespaces outside Part 1 — and finally a COINCIDENT anchor, a
|
|
2073
|
-
* comment whose `w:commentRangeStart`/`End` cover exactly the characters an earlier comment's
|
|
2074
|
-
* cover. The ranges are Part 1's own vocabulary and the only part of a thread that survives a
|
|
2075
|
-
* producer dropping the extension parts. Coincidence is the last resort and never overrides a
|
|
2076
|
-
* stated link.
|
|
2077
|
-
*
|
|
2078
|
-
* Deliberately not containment. A remark on one word inside another remark's sentence nests
|
|
2079
|
-
* without being a reply, and reading that as a thread would bury an independent comment inside
|
|
2080
|
-
* someone else's.
|
|
2081
|
-
*/
|
|
2082
|
-
declare function commentItemsOf(comments: readonly CommentRecord[], anchors: readonly {
|
|
2083
|
-
commentId: string;
|
|
2084
|
-
partName: string;
|
|
2085
|
-
start: ReviewPosition;
|
|
2086
|
-
end: ReviewPosition;
|
|
2087
|
-
orphaned: boolean;
|
|
2088
|
-
}[], threadState: ReadonlyMap<string, CommentThreadState>): ReviewCommentItem[];
|
|
2089
|
-
/** What review derivation reads: one story part plus its comment parts. */
|
|
2090
|
-
interface ReviewModelInput {
|
|
2091
|
-
/** The story the ranges live in — the main document, a header, a note. */
|
|
2092
|
-
readonly storyPart: OoxmlPart;
|
|
2093
|
-
/**
|
|
2094
|
-
* Header/footer story parts, in section order. Their revisions and comment anchors join
|
|
2095
|
-
* the queue: a tracked change in a header is a pending decision like any other, and a
|
|
2096
|
-
* queue that only walked the body silently hid it from the rail AND from Accept All.
|
|
2097
|
-
*/
|
|
2098
|
-
readonly furnitureParts?: readonly OoxmlPart[] | undefined;
|
|
2099
|
-
/** `word/comments.xml`, absent when the package has none. */
|
|
2100
|
-
readonly commentsPart?: OoxmlPart | undefined;
|
|
2101
|
-
/** `word/commentsExtended.xml`, absent when the package has none. */
|
|
2102
|
-
readonly commentsExtendedPart?: OoxmlPart | undefined;
|
|
2103
|
-
}
|
|
2104
|
-
/**
|
|
2105
|
-
* Everything the review surface lists, in document order.
|
|
2106
|
-
*
|
|
2107
|
-
* Order is by paragraph position within the story, then by offset. A comment and the revision
|
|
2108
|
-
* it covers therefore arrive together, which is what lets a surface group them. Furniture
|
|
2109
|
-
* stories rank after the body in one merged order — their geometry (the page they first paint
|
|
2110
|
-
* on) is a layout question the queue deliberately does not answer.
|
|
2111
|
-
*/
|
|
2112
|
-
declare function collectReviewItems(input: ReviewModelInput): ReviewItem[];
|
|
2113
|
-
/**
|
|
2114
|
-
* The shape {@link linkRevisionReplies} needs, stated STRUCTURALLY.
|
|
2115
|
-
*
|
|
2116
|
-
* The store's queue is revisions and comments; the layout lane's adds a third kind for custom
|
|
2117
|
-
* nodes, and neither union is assignable to the other. Both lanes have to run this pass — the
|
|
2118
|
-
* store on the full derivation, the session on the locally patched list — so the pass is
|
|
2119
|
-
* written against the fields it actually reads rather than against either union, and hands
|
|
2120
|
-
* back the caller's own item type.
|
|
2121
|
-
*/
|
|
2122
|
-
interface LinkableReviewItem {
|
|
2123
|
-
readonly kind: string;
|
|
2124
|
-
readonly id: string;
|
|
2125
|
-
readonly ranges?: readonly ReviewRange[];
|
|
2126
|
-
readonly range?: ReviewRange | null;
|
|
2127
|
-
readonly parentId?: string;
|
|
2128
|
-
readonly parentRevisionId?: string;
|
|
2129
|
-
readonly replyIds?: readonly string[];
|
|
2130
|
-
readonly orphaned?: boolean;
|
|
2131
|
-
}
|
|
2132
|
-
/**
|
|
2133
|
-
* Attach each comment that answers a tracked change to the change it answers.
|
|
2134
|
-
*
|
|
2135
|
-
* The evidence is the RANGE, exactly as it is for a coincident comment thread: replying to a
|
|
2136
|
-
* revision writes a comment over that revision's own characters, because OOXML gives `w:ins`
|
|
2137
|
-
* and `w:del` nowhere else to put the text. Without this the reply came back as an independent
|
|
2138
|
-
* card in the rail, sitting beside the change rather than inside it, and the reader had no way
|
|
2139
|
-
* to see which change their answer belonged to.
|
|
2140
|
-
*
|
|
2141
|
-
* Three things keep it from over-claiming. A ZERO-WIDTH range is evidence of nothing — the same
|
|
2142
|
-
* rule the comment threading uses, and a format or paragraph-mark revision decorates no
|
|
2143
|
-
* characters at all. A comment already stated to be a REPLY to another comment is not claimed
|
|
2144
|
-
* directly, because a stated link always beats an inferred one. And the FIRST revision on a span
|
|
2145
|
-
* wins, so a card cannot claim a reply another card already holds.
|
|
2146
|
-
*
|
|
2147
|
-
* The WHOLE conversation moves, not its head. A change's card renders `replyIds` as a flat list,
|
|
2148
|
-
* so linking only the top comment of a thread left every answer to that answer rendered by
|
|
2149
|
-
* nobody: reply twice to one change and the second reply existed in `comments.xml` and appeared
|
|
2150
|
-
* nowhere on screen. Descendants ride along, in the order they were authored.
|
|
2151
|
-
*
|
|
2152
|
-
* IDEMPOTENT, and that is load-bearing. The session re-runs this over a list whose comments are
|
|
2153
|
-
* ALREADY linked, so a pass that only ever added links left a stale `parentRevisionId` behind
|
|
2154
|
-
* when a keystroke shifted the revision's offsets out from under it — the rail filters such a
|
|
2155
|
-
* comment out of its roots, and with no revision claiming it any more the card vanished until
|
|
2156
|
-
* the next full re-derivation. Every link is rebuilt from the ranges on every pass.
|
|
2157
|
-
*/
|
|
2158
|
-
declare function linkRevisionReplies<T extends LinkableReviewItem>(items: readonly T[]): T[];
|
|
2159
|
-
/** Paragraph node id → document position, from the TREE rather than from a layout. */
|
|
2160
|
-
declare function paragraphOrderOfPart(part: OoxmlPart): Map<string, number>;
|
|
2161
|
-
/**
|
|
2162
|
-
* Every range a decision touches. One card can cover several, in different paragraphs.
|
|
2163
|
-
*
|
|
2164
|
-
* Exported because the geometry half in the layout lane asks the same question, and a second
|
|
2165
|
-
* copy of "which ranges does this item cover" is how a card comes to be painted over one range
|
|
2166
|
-
* and activated by another.
|
|
2167
|
-
*/
|
|
2168
|
-
declare function reviewItemRanges(item: ReviewItem): readonly ReviewRange[];
|
|
2169
|
-
/** The range an item is anchored at — where its card belongs and how it sorts. */
|
|
2170
|
-
declare function firstReviewRange(item: ReviewItem): ReviewRange | null;
|
|
2076
|
+
declare function locateSites(part: OoxmlPart): ReadonlyMap<string, SiteLocation>;
|
|
2171
2077
|
|
|
2172
2078
|
/**
|
|
2173
2079
|
* Longest accepted query. A query is host input rather than file content, but the scan is
|
|
@@ -2244,4 +2150,4 @@ declare function wrapTargetToAnchorSpec(target: ImageWrapTarget): {
|
|
|
2244
2150
|
/** Whether an op is one of the drawing ops. Narrows the type. */
|
|
2245
2151
|
declare function isDrawingTreeDocOp(op: TreeDocOp): op is DrawingTreeDocOp;
|
|
2246
2152
|
|
|
2247
|
-
export { ALL_FROZEN_IDS, AUTHORABLE_PARAGRAPH_PROPERTIES, AUTHORABLE_RUN_PROPERTIES, type AddCommentRequest, type AddCommentResult, type AnchorSnapshot, type AtomicFieldSpan, type AuditPort, type AuthorizationPort, BoundedCounter, Budget, BudgetError, CANONICAL_MUTATION_ORIGINS, COMPARATORS, CancellationController, CancellationError, type CancellationPhase, type CancellationPort, type CancellationToken, type CapabilityId, type ClockPort, type
|
|
2153
|
+
export { ALL_FROZEN_IDS, AUTHORABLE_PARAGRAPH_PROPERTIES, AUTHORABLE_RUN_PROPERTIES, type AddCommentRequest, type AddCommentResult, type AnchorSnapshot, type AtomicFieldSpan, type AuditPort, type AuthorizationPort, BoundedCounter, Budget, BudgetError, CANONICAL_MUTATION_ORIGINS, COMPARATORS, CUSTOM_NODE_XPATH_PREFIX, CUSTOM_XML_PROPS_REL, CUSTOM_XML_PROPS_TYPE, CUSTOM_XML_REL, CancellationController, CancellationError, type CancellationPhase, type CancellationPort, type CancellationToken, type CapabilityId, type ClockPort, type CommentAnchorRequest, type ComparatorDescriptor, type ComparatorMode, type ComparatorName, type ComparisonResult, type ConformanceFixture, type ContentItem, type Contribution, type CustomNodeBinding, type CustomNodeExportPolicy, type CustomNodeExportRequest, type CustomNodeExportResult, type CustomXmlDataPart, type CustomXmlDataPartResult, type CustomXmlNode, DANGEROUS_KEYS, DATASTORE_NAMESPACE_URI, DEPENDENCY_KEY_IDS, DangerousKeyError, type DetectedToc, DeterministicClock, DeterministicMemoryMeter, type DigestDifference, DrawingTreeDocOp, type EditOptions, type EncodedEnvelope, type EnforcementPhase, type EnsuredHyperlinkRelationship, type ExternalResourceConsentPort, FIELD_ATOM_CHAR, type FeatureBundle, type FixtureExpectation, type FixtureOutcome, type FixtureSource, type FixtureStep, type FldCharType, type FontPort, type HardBreakKind, type HrefProjection, ID_KINDS, INERT_EXECUTABLE_KINDS, type IdKind, type IdentityPort, type ImagePort, ImageWrapTarget, ImpactClass, type InertExecutableKind, type InlineControlSpan, type Json, LIMIT_KEYS, LIMIT_SPECS, LimitExceededError, type LimitSpec, type LimitUnit, MAX_STORY_SDT_NESTING, type ModelChangeSummary, NON_CANONICAL_ORIGINS, ORIGIN_IDS, type OffsetSpan, OoxmlAttribute, type OoxmlEditResult, OoxmlElement, OoxmlFldCharNode, OoxmlFldSimpleNode, OoxmlHardBreakNode, type OoxmlIndexes, OoxmlInstrTextNode, OoxmlInvariantIssue, OoxmlInvariantResult, OoxmlNode, OoxmlPackage, OoxmlParagraphNode, OoxmlPart, OoxmlProperty, type OoxmlStoryKind, type OoxmlStoryRoot, type OperationContext, type OperationInit, PAGE_BREAK_CHAR, type PackageInvariantCode, type PackageInvariantIssue, type PackageInvariantResult, type ParagraphDigest, type ParagraphIndexEntry, type ParagraphOffsetIndex, type PersistencePort, PortRegistry, PortResolutionError, PrefixAllocator, RESULT_IDS, RUNTIME_PORT_IDS, RegistryError, type RegistryErrorCode, RelationshipRecord, type ReplacementPolicy, type ReplayOutcome, type ReplayReport, type ReplayStore, type Reservation, type ResolveOptions, type ResolvedRegistry, type ResourceAccountingPort, ResourceLimits, type RunPropertyEdit, SEARCH_MATCH_LIMIT, SEARCH_QUERY_MAX, type SchedulingPort, type ScrubResult, type Segment, type SemVer, type SemanticDigest, SequentialIdentity, type SetCommentResolvedResult, type ShapingPort, type StoryDigest, type StoryIndexEntry, type StyleIndexEntry, TOC_LEVEL_INDENT_TWIPS, TOC_MAX_BOOKMARKS_PER_REFRESH, TOC_MAX_ENTRIES, TOC_MAX_FIELD_NESTING, TOC_MAX_INSTRUCTION_CHARS, TOC_MAX_PAGE_PASSES, type TextMatchOptions, type TextOccurrence, type TextOccurrences, type TocEntryPlan, type TocInstruction, type TocOutlineHeading, type TransportPort, TreeDocOp, TreeDocumentStore, TreeModelChange, TreeOpRejection, TreeOpResult, type ValidationResult, addComment, applyEdits, applyTreeOp, assertLimitInvariants, assertValidId, assertValidQName, atomicFieldSpansOf, authorableHyperlinkTarget, authoredProperties, beginOperation, bodyStoryRoot, bookmarkPairNodes, boundCustomXmlNodeIdOf, boundCustomXmlNodeIds, boundCustomXmlNodeIdsInPackage, buildTocContentControl, buildTocEntryParagraph, canonicalOoxmlFingerprint, canonicalize, cascadeEmptiedComments, collectNodeIds, collectRevisionSites, collectStoryParagraphs, commentPartNameOf, commentsExtendedPartNameOf, compareArtifacts, compareSemVer, containsCssFetch, contentTypesPartBytes, createNodeIdAllocator, customNodeBinding, customXmlDataParts, customXmlLabelXPath, customXmlNodes, customXmlPrefixMappings, datastoreItemIdFor, deleteCommentThread, deriveOoxmlIndexes, detectBodyTocs, diffSemanticDigests, digestPart, directParagraphMarkProperties, directParagraphProperties, drawingOpImpact, endOperation, ensureHyperlinkRelationship, escapeCssString, escapeXml, fieldAtomText, fieldOnOffAttribute, findCustomXmlDataPart, findDetectedToc, findNode, findOccurrences, fingerprint, fldCharType, fldSimpleInstr, fnv1a32, foldCase, formatOwnedRunIds, hardBreakAttributes, hardBreakKind, hardBreakText, hasAnyComment, hasCommentPart, hasNode, hashAuthored, indexStyles, inlineControlEndingAt, inlineControlStartingAt, insertChildren, instrTextValue, isAuthorableRunProperty, isDangerousKey, isDrawingTreeDocOp, isEvaluableField, isFieldChrome, isFldChar, isFldCharNode, isFldSimple, isFldSimpleNode, isInertExecutable, isInstrText, isInstrTextNode, isLegalFldCharType, isPageBreakNode, isSearchableQuery, isValidId, isValidNCName, isValidParaId, isValidQName, isWholeWord, locateSites, makeLimitCounter, mergedProperties, mintParaId, mintedParagraphIdentityAttributes, normalizeParagraphIdentity, nullRecord, ooxmlTreesEqual, paraIdOf, paragraphOffsetIndex, paragraphTextOf, parentNodeOf, parseSemVer, parseTocInstruction, planTocEntries, propertyContainer, readCustomXmlNode, relationshipTargetIn, relationshipsOf, relsPartNameFor, removeNode, replaceChildren, replaceNode, replayFixture, resolve, resolveContentTypeOf, resolveTocRowHeadings, runAddressRanges, runPropertyEdits, runsCovering, sanitizeHref, satisfies, scrubExport, segmentsOf, semanticDigest, serializeOoxmlPart, setCommentResolved, stableHash, storyParagraphs, storyRootsOf, stylesPartOf, toSafeRecord, tocEntryText, tocLeftIndentTwips, usedParaIds, validateDrawingOp, validateFixture, validateOoxmlPart, validatePackageInvariants, validateTreeOp, w14RootPrefix, withContentTypeOverride, withCustomXmlDataPart, withCustomXmlNode, withExportedCustomNodes, withNewPart, withRelationship, withoutCustomXmlDataPart, withoutCustomXmlNode, withoutOrphanCustomXmlNodes, wrapTargetToAnchorSpec };
|