@arbidocs/blocks 0.4.101 → 0.4.103
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/chunk-6MG62I5B.cjs +272 -0
- package/dist/chunk-6MG62I5B.cjs.map +1 -0
- package/dist/{chunk-MYALCKDR.js → chunk-CVYY4X5R.js} +306 -75
- package/dist/chunk-CVYY4X5R.js.map +1 -0
- package/dist/chunk-EQB3WELX.js +269 -0
- package/dist/chunk-EQB3WELX.js.map +1 -0
- package/dist/{chunk-G5JH2YMQ.js → chunk-GQTIAATM.js} +3 -3
- package/dist/{chunk-G5JH2YMQ.js.map → chunk-GQTIAATM.js.map} +1 -1
- package/dist/{chunk-YGREW5TZ.js → chunk-H6DFXG5N.js} +3 -3
- package/dist/{chunk-YGREW5TZ.js.map → chunk-H6DFXG5N.js.map} +1 -1
- package/dist/{chunk-ZT2EBBSC.cjs → chunk-N36PWG7A.cjs} +5 -5
- package/dist/{chunk-ZT2EBBSC.cjs.map → chunk-N36PWG7A.cjs.map} +1 -1
- package/dist/{chunk-FAGQTB3D.cjs → chunk-O33EBMIX.cjs} +305 -74
- package/dist/chunk-O33EBMIX.cjs.map +1 -0
- package/dist/{chunk-Y5XW57U4.cjs → chunk-TFDU2KGS.cjs} +5 -5
- package/dist/{chunk-Y5XW57U4.cjs.map → chunk-TFDU2KGS.cjs.map} +1 -1
- package/dist/connect/docx.cjs +6 -6
- package/dist/connect/docx.js +4 -4
- package/dist/connect/index.cjs +3 -3
- package/dist/connect/index.js +2 -2
- package/dist/document-tools/AdoptSignatureDialog.d.ts +25 -0
- package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
- package/dist/document-tools/SignatureRequestBanner.d.ts +18 -0
- package/dist/document-tools/index.cjs +175 -0
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.ts +3 -1
- package/dist/document-tools/index.js +168 -3
- package/dist/document-tools/index.js.map +1 -1
- package/dist/document-tools/viewer/GuidedSigningViewer.d.ts +26 -0
- package/dist/document-tools/viewer/SignatureFieldsOverlay.d.ts +41 -0
- package/dist/document-tools/viewer/SignatureRequestEditor.d.ts +26 -0
- package/dist/document-tools/viewer/index.cjs +983 -0
- package/dist/document-tools/viewer/index.cjs.map +1 -1
- package/dist/document-tools/viewer/index.d.ts +3 -0
- package/dist/document-tools/viewer/index.js +983 -5
- package/dist/document-tools/viewer/index.js.map +1 -1
- package/dist/docx/RibbonMenu.d.ts +4 -1
- package/dist/docx/RibbonOverflow.d.ts +27 -0
- package/dist/docx/WordReferences.d.ts +3 -2
- package/dist/docx/index.cjs +35 -35
- package/dist/docx/index.js +3 -3
- package/dist/docx/noteStyles.d.ts +46 -0
- package/dist/docx/overflowPlan.d.ts +15 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +1 -1
- package/node_modules/@arbidocs/coedit/LICENSE +21 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.cjs +751 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +192 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +192 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.js +716 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +1759 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +39 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +39 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +1736 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/index.cjs +1692 -0
- package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/index.d.cts +16 -0
- package/node_modules/@arbidocs/coedit/dist/index.d.ts +16 -0
- package/node_modules/@arbidocs/coedit/dist/index.js +1664 -0
- package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/server.cjs +1852 -0
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +43 -0
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +43 -0
- package/node_modules/@arbidocs/coedit/dist/server.js +1822 -0
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.cts +82 -0
- package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.ts +82 -0
- package/node_modules/@arbidocs/coedit/dist/template.cjs +1627 -0
- package/node_modules/@arbidocs/coedit/dist/template.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/template.d.cts +125 -0
- package/node_modules/@arbidocs/coedit/dist/template.d.ts +125 -0
- package/node_modules/@arbidocs/coedit/dist/template.js +1612 -0
- package/node_modules/@arbidocs/coedit/dist/template.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.cts +8 -0
- package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.ts +8 -0
- package/node_modules/@arbidocs/coedit/package.json +68 -0
- package/node_modules/@docx-editor.dev/core/LICENSE +201 -0
- package/node_modules/@docx-editor.dev/core/README.md +125 -0
- package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +56 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +162 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +164 -0
- package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2GO5T2JU.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2RC2EPND.js +3 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +28 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +18 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-5CSUYANV.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6APGXLBB.cjs +3 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6AWEKBLB.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6EYYL7FL.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-E7BQA6UP.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ETTO6GK3.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +18 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +28 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-K5U2PLDP.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +27 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-O2AL2HSJ.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-QMLCVPCD.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +27 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-RIYSCEFQ.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-S6J4O5XP.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-SRPILEWV.cjs +5 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-TSLBZ26X.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-UKVVUHZL.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-VDNNLG6X.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-Z6WBFXJU.js +5 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ZUHOMK52.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +270 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +269 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +290 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.js +0 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +22 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +103 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.js +0 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +143 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +11 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.js +0 -0
- package/node_modules/@docx-editor.dev/core/dist/custom-node-writes-cvL5rhcD.d.ts +323 -0
- package/node_modules/@docx-editor.dev/core/dist/dist-PKZR6RSH.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/document-protection-BAGVGqaP.d.ts +20 -0
- package/node_modules/@docx-editor.dev/core/dist/editor-Ci7IZGmG.d.ts +2448 -0
- package/node_modules/@docx-editor.dev/core/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.css +15 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +1394 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/export.d.ts +391 -0
- package/node_modules/@docx-editor.dev/core/dist/export.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/failure-NS2lsya4.d.ts +115 -0
- package/node_modules/@docx-editor.dev/core/dist/font-resolver-BVQB14qT.d.ts +256 -0
- package/node_modules/@docx-editor.dev/core/dist/harfbuzz.wasm +0 -0
- package/node_modules/@docx-editor.dev/core/dist/headless-document-view-qH331moE.d.ts +143 -0
- package/node_modules/@docx-editor.dev/core/dist/image-resources-BN-hUgCn.d.ts +211 -0
- package/node_modules/@docx-editor.dev/core/dist/index-Bsg7oIKP.d.ts +3869 -0
- package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/index.d.ts +53 -0
- package/node_modules/@docx-editor.dev/core/dist/index.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/layout-shaping-BEyuiQOk.d.ts +246 -0
- package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +3151 -0
- package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/node-module-shim-TTKTT66I.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/note-properties-4Y9o6Gyk.d.ts +68 -0
- package/node_modules/@docx-editor.dev/core/dist/omml-equation-CuzBL5DD.d.ts +85 -0
- package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/output.d.ts +97 -0
- package/node_modules/@docx-editor.dev/core/dist/output.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/protocol-Bqk4Izjc.d.ts +1651 -0
- package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +128 -0
- package/node_modules/@docx-editor.dev/core/dist/review-paragraph-order-DT-n6ouC.d.ts +85 -0
- package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +242 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-cell-selection-D9D1KSXq.d.ts +464 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-interaction-CIC-PooQ.d.ts +135 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-paint-BME37OMv.d.ts +326 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-record-queries-CBlZqZNa.d.ts +177 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-records-4B3WwFAi.d.ts +3532 -0
- package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/store.d.ts +2706 -0
- package/node_modules/@docx-editor.dev/core/dist/store.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/tree-package-fragment-BeeKxDw8.d.ts +1201 -0
- package/node_modules/@docx-editor.dev/core/dist/tree-session-contract-CVbmlMlq.d.ts +664 -0
- package/node_modules/@docx-editor.dev/core/dist/types-barrel-D3xCgQX6.d.ts +4269 -0
- package/node_modules/@docx-editor.dev/core/licenses/HarfBuzz-COPYING.txt +42 -0
- package/node_modules/@docx-editor.dev/core/package.json +140 -0
- package/node_modules/@docx-editor.dev/react/LICENSE +201 -0
- package/node_modules/@docx-editor.dev/react/README.md +141 -0
- package/node_modules/@docx-editor.dev/react/THIRD_PARTY_NOTICES.md +18 -0
- package/node_modules/@docx-editor.dev/react/dist/index.d.mts +4928 -0
- package/node_modules/@docx-editor.dev/react/dist/index.d.ts +4928 -0
- package/node_modules/@docx-editor.dev/react/dist/index.js +4 -0
- package/node_modules/@docx-editor.dev/react/dist/index.mjs +4 -0
- package/node_modules/@docx-editor.dev/react/package.json +74 -0
- package/node_modules/@docx-editor.dev/react/src/styles/editor.css +6 -0
- package/node_modules/@docx-editor.dev/react/src/styles/zIndex.ts +28 -0
- package/package.json +26 -15
- package/src/docx/README.md +10 -0
- package/src/docx/styles.css +73 -5
- package/dist/chunk-FAGQTB3D.cjs.map +0 -1
- package/dist/chunk-MYALCKDR.js.map +0 -1
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import { S as StoryScope, g as SelectionMark, h as TransactOptions, a as StoryTargetRejection, e as TreeModelChange, H as HeaderFooterParts, b as HeaderFooterSectionResolution, I as InsertImageInput, i as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput, F as FragmentPasteInput, j as FragmentPasteResult } from './tree-package-fragment-BeeKxDw8.js';
|
|
2
|
+
import { W as TreeDocOp, O as OoxmlPart, N as OoxmlNode, Q as OoxmlPackage, Z as OoxmlElement, a as ReviewItem, aa as RevisionAttributionInput } from './types-barrel-D3xCgQX6.js';
|
|
3
|
+
import { S as SupportedImageMime, a as ImageDecodePort } from './image-resources-BN-hUgCn.js';
|
|
4
|
+
import { D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, a as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind } from './custom-node-writes-cvL5rhcD.js';
|
|
5
|
+
import { H as HeadlessDocumentView, D as DocumentProperties } from './headless-document-view-qH331moE.js';
|
|
6
|
+
import { Node } from 'prosemirror-model';
|
|
7
|
+
import { CollaborationDocumentPort } from './collaboration/replication.js';
|
|
8
|
+
import { V as ViewScope } from './editor-scope-OHPwVQ5l.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Why an edited projection could not be mapped back into tree ops.
|
|
12
|
+
*
|
|
13
|
+
* A refusal, not a fallback. The reverse direction never RECONSTRUCTS the tree from the
|
|
14
|
+
* projection — it explains a difference — so a shape it cannot explain is rejected outright.
|
|
15
|
+
* A silently-dropped edit is worse than a refused one, because only the refusal can be
|
|
16
|
+
* reconciled.
|
|
17
|
+
*/
|
|
18
|
+
type TreeBindingRejection = 'paragraph-count-unexplained' | 'paragraph-reordered' | 'unknown-paragraph-id' | 'unknown-content-moved' | 'unsupported-node' | 'split-not-clean' | 'join-not-clean';
|
|
19
|
+
/**
|
|
20
|
+
* The ops explaining one edit, or the reason it could not be explained.
|
|
21
|
+
*
|
|
22
|
+
* `ops` is the SMALLEST set that accounts for the difference, so anything the projection does not
|
|
23
|
+
* model — unknown nodes, lexical form, node identities — stays carried by the tree rather than
|
|
24
|
+
* round-tripping through the editor.
|
|
25
|
+
*/
|
|
26
|
+
type MapResult = {
|
|
27
|
+
readonly ok: true;
|
|
28
|
+
readonly ops: readonly TreeDocOp[];
|
|
29
|
+
} | {
|
|
30
|
+
readonly ok: false;
|
|
31
|
+
readonly reason: TreeBindingRejection;
|
|
32
|
+
readonly detail?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Body paragraphs of a part, in document order. */
|
|
35
|
+
declare function bodyParagraphs(part: OoxmlPart): OoxmlNode[];
|
|
36
|
+
/** Project one tree revision into a ProseMirror doc (task 6.1). */
|
|
37
|
+
declare function treeToDoc(part: OoxmlPart): Node;
|
|
38
|
+
/**
|
|
39
|
+
* Map an edited ProseMirror doc back into typed tree ops (task 6.2), or refuse (6.3).
|
|
40
|
+
*
|
|
41
|
+
* Handles a paragraph count delta of 0 (in-place edits), +1 (a clean split) and -1 (a clean
|
|
42
|
+
* join). Anything else — a reorder, a multi-paragraph paste, a structural change combined
|
|
43
|
+
* with an edit elsewhere — is refused rather than approximated, because the approximation
|
|
44
|
+
* is what silently loses content.
|
|
45
|
+
*/
|
|
46
|
+
declare function docToTreeOps(part: OoxmlPart, doc: Node): MapResult;
|
|
47
|
+
/** Whether a tree node id is still present, for reconciliation checks. */
|
|
48
|
+
declare function partHasNode(part: OoxmlPart, nodeId: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Rebuild a projected doc from a new tree revision, reusing untouched paragraphs (task 6.4).
|
|
51
|
+
*
|
|
52
|
+
* A full reprojection is always CORRECT, so this only ever narrows the work: paragraphs the
|
|
53
|
+
* change did not name are carried over by reference, which lets ProseMirror keep their node
|
|
54
|
+
* identity and redraw nothing. When the change is structural — a paragraph created, deleted,
|
|
55
|
+
* split or joined — positions shift in ways a per-paragraph patch cannot express, so it
|
|
56
|
+
* falls back to a full projection rather than guessing.
|
|
57
|
+
*
|
|
58
|
+
* Passing `null` means "no evidence available", which also takes the full path. Reconciling
|
|
59
|
+
* on partial evidence is how a projection silently diverges from the model.
|
|
60
|
+
*/
|
|
61
|
+
declare function reconcileDoc(previousDoc: Node, part: OoxmlPart, change: {
|
|
62
|
+
readonly dirty: readonly string[];
|
|
63
|
+
readonly created: readonly string[];
|
|
64
|
+
readonly deleted: readonly string[];
|
|
65
|
+
readonly splitJoin: readonly unknown[];
|
|
66
|
+
} | null): Node;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The faces a theme's font scheme offers, per script slot.
|
|
70
|
+
*
|
|
71
|
+
* Structurally satisfied by both lanes' theme-font shapes (`DocumentThemeFonts`,
|
|
72
|
+
* layout's `ThemeFonts`). The East Asian faces are optional so callers that have not
|
|
73
|
+
* harvested them yet still type-check; an absent face resolves to null, which every
|
|
74
|
+
* caller already treats as "fall back to the explicit attribute".
|
|
75
|
+
*/
|
|
76
|
+
interface ThemeSchemeFaces {
|
|
77
|
+
/** `a:majorFont` latin typeface — headings. */
|
|
78
|
+
readonly major: string | null;
|
|
79
|
+
/** `a:minorFont` latin typeface — body text. */
|
|
80
|
+
readonly minor: string | null;
|
|
81
|
+
/** `a:majorFont` east asian typeface (`a:ea`). */
|
|
82
|
+
readonly majorEastAsia?: string | null;
|
|
83
|
+
/** `a:minorFont` east asian typeface (`a:ea`). */
|
|
84
|
+
readonly minorEastAsia?: string | null;
|
|
85
|
+
/** Complex-script heading and body faces (`a:cs`). */
|
|
86
|
+
readonly majorBidi?: string | null;
|
|
87
|
+
readonly minorBidi?: string | null;
|
|
88
|
+
/** Language-specific theme faces, keyed by ISO 15924 script. */
|
|
89
|
+
readonly majorSupplemental?: Readonly<Record<string, string>>;
|
|
90
|
+
readonly minorSupplemental?: Readonly<Record<string, string>>;
|
|
91
|
+
/** Lower-cased font table names that declare a Chinese character set. */
|
|
92
|
+
readonly chineseFontTableFaces?: readonly string[];
|
|
93
|
+
}
|
|
94
|
+
/** The theme's font slots, fully resolved, for resolving `w:rFonts` theme attributes. */
|
|
95
|
+
interface DocumentThemeFonts extends ThemeSchemeFaces {
|
|
96
|
+
/** `a:majorFont` latin typeface — headings. */
|
|
97
|
+
readonly major: string | null;
|
|
98
|
+
/** `a:minorFont` latin typeface — body text. */
|
|
99
|
+
readonly minor: string | null;
|
|
100
|
+
/** `a:majorFont` east asian typeface (`a:ea`) — headings. */
|
|
101
|
+
readonly majorEastAsia: string | null;
|
|
102
|
+
/** `a:minorFont` east asian typeface (`a:ea`) — body text. */
|
|
103
|
+
readonly minorEastAsia: string | null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* How a style LOOKS, for a picker to preview it in its own face — Word shows the gallery
|
|
108
|
+
* that way, and a list of identical rows makes the user apply a style to find out what it
|
|
109
|
+
* is. PRESENTATION ONLY: these are the few properties a one-line preview can show, not the
|
|
110
|
+
* cascade layout resolves. Every value is already bounded here (the family against the same
|
|
111
|
+
* shape the CSS sink enforces, the colour against six hex digits), because a picker renders
|
|
112
|
+
* them into a style attribute and they come from an attacker-controlled `styles.xml`.
|
|
113
|
+
*/
|
|
114
|
+
interface DocumentStylePreview {
|
|
115
|
+
readonly fontFamily: string | null;
|
|
116
|
+
/** Points, already halved from `w:sz`. Null when the style states no size. */
|
|
117
|
+
readonly fontSizePt: number | null;
|
|
118
|
+
readonly bold: boolean;
|
|
119
|
+
readonly italic: boolean;
|
|
120
|
+
/** RRGGBB, or null for inherited/automatic — theme colours are not resolved here. */
|
|
121
|
+
readonly color: string | null;
|
|
122
|
+
}
|
|
123
|
+
/** One `w:style` definition, projected for a style picker. */
|
|
124
|
+
interface DocumentStyleEntry {
|
|
125
|
+
readonly styleId: string;
|
|
126
|
+
readonly name: string;
|
|
127
|
+
readonly type: string;
|
|
128
|
+
readonly preview: DocumentStylePreview;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The scheme slots the picker shows, in Word's column order.
|
|
133
|
+
*
|
|
134
|
+
* Assumes the default `w:clrSchemeMapping` (bg1→lt1, t1→dk1, ...); a settings part
|
|
135
|
+
* that remaps them is rare and a follow-up.
|
|
136
|
+
*/
|
|
137
|
+
declare const PICKER_SLOTS: readonly ['lt1', 'dk1', 'lt2', 'dk2', 'accent1', 'accent2', 'accent3', 'accent4', 'accent5', 'accent6'];
|
|
138
|
+
type ThemeColorSlot = (typeof PICKER_SLOTS)[number];
|
|
139
|
+
/** One theme colour: the scheme slot and its resolved six-digit hex (no '#'). */
|
|
140
|
+
interface DocumentThemeColorEntry {
|
|
141
|
+
readonly slot: ThemeColorSlot;
|
|
142
|
+
readonly hex: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** One heading of the outline, in document order. `level` is 0-based (Heading 1 = 0). */
|
|
146
|
+
interface DocumentOutlineEntry {
|
|
147
|
+
/** The paragraph's text, control characters flattened, bounded to 200 characters. */
|
|
148
|
+
readonly text: string;
|
|
149
|
+
/** 0-based outline level: `heading 1` / `outlineLvl 0` → 0. */
|
|
150
|
+
readonly level: number;
|
|
151
|
+
/** The paragraph's canonical node id — the address `setSelection` navigates to. */
|
|
152
|
+
readonly blockId: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** How a search is narrowed. Both flags default to off, matching Word's initial state. */
|
|
156
|
+
interface DocumentSearchOptions {
|
|
157
|
+
readonly matchCase?: boolean;
|
|
158
|
+
readonly wholeWord?: boolean;
|
|
159
|
+
/** Override the default {@link SEARCH_MATCH_LIMIT}. Clamped to it; never raised past it. */
|
|
160
|
+
readonly limit?: number;
|
|
161
|
+
/** Stories the facade can navigate in its current mode. */
|
|
162
|
+
readonly stories?: 'all' | 'body';
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* One occurrence of a query in an editable document story.
|
|
166
|
+
*
|
|
167
|
+
* Carries the engine's own address (`blockId` + `start`) and the positional one a find UI
|
|
168
|
+
* needs (`paragraphIndex` / `runIndex` / `runOffset`), both derived from the SAME walk —
|
|
169
|
+
* a caller reconstructing run boundaries itself is where an off-by-one would come from.
|
|
170
|
+
* A match can span runs when formatting changes mid-word; the run address is where it
|
|
171
|
+
* STARTS.
|
|
172
|
+
*/
|
|
173
|
+
interface DocumentSearchMatch {
|
|
174
|
+
readonly blockId: string;
|
|
175
|
+
readonly start: number;
|
|
176
|
+
readonly length: number;
|
|
177
|
+
readonly paragraphIndex: number;
|
|
178
|
+
readonly runIndex: number;
|
|
179
|
+
readonly runOffset: number;
|
|
180
|
+
/** Story containing the match. Omitted for the body. */
|
|
181
|
+
readonly scope?: ViewScope;
|
|
182
|
+
/** The matched text as it appears in the document, control characters flattened. */
|
|
183
|
+
readonly text: string;
|
|
184
|
+
/** Paragraph text immediately before the match, bounded and flattened. */
|
|
185
|
+
readonly contextBefore: string;
|
|
186
|
+
/** Paragraph text immediately after the match, bounded and flattened. */
|
|
187
|
+
readonly contextAfter: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* What one search answers with.
|
|
191
|
+
*
|
|
192
|
+
* `truncated` says the scan stopped at the cap with matches still ahead of it, so a caller
|
|
193
|
+
* can show "2000+" honestly instead of claiming an exact total it does not have.
|
|
194
|
+
*/
|
|
195
|
+
interface DocumentSearchResult {
|
|
196
|
+
readonly matches: readonly DocumentSearchMatch[];
|
|
197
|
+
readonly truncated: boolean;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface ParagraphAnchorIndex {
|
|
201
|
+
/** nodeId → `w14:paraId`, verbatim as authored/minted. Paragraphs without one are absent. */
|
|
202
|
+
readonly paraIdByNode: ReadonlyMap<string, string>;
|
|
203
|
+
/** UPPERCASED paraId → nodeId (matching is case-insensitive). The first story to claim it. */
|
|
204
|
+
readonly nodeByParaId: ReadonlyMap<string, string>;
|
|
205
|
+
/** nodeId → reading-order ordinal, for document-ordering DocRange endpoints. */
|
|
206
|
+
readonly ordinalByNode: ReadonlyMap<string, number>;
|
|
207
|
+
/**
|
|
208
|
+
* UPPERCASED paraIds more than one story claims.
|
|
209
|
+
*
|
|
210
|
+
* Minting is unique per PART and the contract's uniqueness is per DOCUMENT, so an authored
|
|
211
|
+
* file may repeat one. Resolving such an anchor to whichever story came first would be a
|
|
212
|
+
* silent wrong answer; it is refused as ambiguous instead.
|
|
213
|
+
*/
|
|
214
|
+
readonly ambiguousParaIds: ReadonlySet<string>;
|
|
215
|
+
/**
|
|
216
|
+
* nodeId → the part it was indexed from.
|
|
217
|
+
*
|
|
218
|
+
* The index spans every story, so a caller holding one part and a node id from another reads
|
|
219
|
+
* an empty paragraph and draws a false conclusion from it. Carrying the part alongside the id
|
|
220
|
+
* is what keeps the two in step.
|
|
221
|
+
*/
|
|
222
|
+
readonly partByNode: ReadonlyMap<string, OoxmlPart>;
|
|
223
|
+
/**
|
|
224
|
+
* Every node claiming an ambiguous paraId. DIAGNOSTIC, never a way to pick one.
|
|
225
|
+
*
|
|
226
|
+
* Resolution refuses a clash outright, and this is what says which paragraphs caused it, for
|
|
227
|
+
* a reader repairing the file. Preferring one claimant by the caller's part was tried and
|
|
228
|
+
* reverted: every resolver call site passes the MAIN part, so the preference could only ever
|
|
229
|
+
* land on the body twin and answer `ok` for a header paragraph the caller meant. See
|
|
230
|
+
* `resolveDocAnchor` in `editor/anchor-resolution.ts`.
|
|
231
|
+
*/
|
|
232
|
+
readonly claimantsByParaId: ReadonlyMap<string, readonly string[]>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** What a run inherits at one point of the chain — null means "nothing authored". */
|
|
236
|
+
interface StyleRunDefaults {
|
|
237
|
+
readonly fontFamily: string | null;
|
|
238
|
+
readonly fontSizeHalfPoints: number | null;
|
|
239
|
+
}
|
|
240
|
+
/** One run property as the layout records carry it (structurally SurfaceProperty). */
|
|
241
|
+
interface RunPropertyLike {
|
|
242
|
+
readonly localName: string;
|
|
243
|
+
readonly attributes?: Record<string, string>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* What applying ops produced: whether it committed, and why not when it did not.
|
|
248
|
+
*
|
|
249
|
+
* `committed` and `rejected` are separate flags because they are not opposites — a batch of zero
|
|
250
|
+
* ops neither commits nor is rejected.
|
|
251
|
+
*/
|
|
252
|
+
interface TreeApplyResult {
|
|
253
|
+
readonly committed: boolean;
|
|
254
|
+
readonly rejected: boolean;
|
|
255
|
+
readonly opCount: number;
|
|
256
|
+
/** Present when the edit was refused, so a host can report WHY rather than a silent no-op. */
|
|
257
|
+
readonly reason?: TreeBindingRejection | StoryTargetRejection | string;
|
|
258
|
+
}
|
|
259
|
+
/** Optional collaboration attribution and history grouping for a direct tree-op transaction. */
|
|
260
|
+
type TreeApplyOptions = Pick<TransactOptions, 'origin' | 'actorId' | 'operationId' | 'recordsHistory' | 'historyGroup'> & {
|
|
261
|
+
/** Package resources committed in the same transaction as the tree operations. */
|
|
262
|
+
readonly packageEdits?: readonly ((pkg: OoxmlPackage) => OoxmlPackage)[];
|
|
263
|
+
/** Canonical operations on related package parts, committed in the same undo unit. */
|
|
264
|
+
readonly partOps?: readonly {
|
|
265
|
+
readonly partName: string;
|
|
266
|
+
readonly ops: readonly TreeDocOp[];
|
|
267
|
+
}[];
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* One open document: the canonical tree, and the only write path into it.
|
|
271
|
+
*
|
|
272
|
+
* `applyTreeOps` is that path. Every mutation is a `TreeDocOp` addressed by node id plus UTF-16
|
|
273
|
+
* offset, applied in one transaction, which is what makes cell and nested paragraphs ordinary
|
|
274
|
+
* rather than special cases.
|
|
275
|
+
*
|
|
276
|
+
* Holds the whole package, not just the body — headers, footers, notes, comments and styles are
|
|
277
|
+
* all reachable through it, and parts the engine does not model are preserved verbatim.
|
|
278
|
+
*/
|
|
279
|
+
interface TreeDocxSessionView extends HeadlessDocumentView {
|
|
280
|
+
/** Whether the body holds at least one editable paragraph. */
|
|
281
|
+
readonly editable: boolean;
|
|
282
|
+
/** Canonical node ids of the body paragraphs, in order. */
|
|
283
|
+
paragraphIds(): string[];
|
|
284
|
+
/**
|
|
285
|
+
* Canonical node ids of paragraphs in a story scope. Defaults to the body.
|
|
286
|
+
* Header/footer scopes address the part `EditorScope { kind: 'headerFooter'; rId }` names.
|
|
287
|
+
*/
|
|
288
|
+
paragraphIdsIn(scope?: StoryScope): string[];
|
|
289
|
+
/** The current canonical BODY part — what layout reads for the main story. */
|
|
290
|
+
part(): OoxmlPart;
|
|
291
|
+
/** The current part for a story scope, or null when the target is refused. */
|
|
292
|
+
partFor(scope: StoryScope): OoxmlPart | null;
|
|
293
|
+
/**
|
|
294
|
+
* The current package with every opened story store merged in. Authority for layout
|
|
295
|
+
* resolution and save — never a swapped single-part view.
|
|
296
|
+
*/
|
|
297
|
+
currentPackage(): OoxmlPackage;
|
|
298
|
+
/**
|
|
299
|
+
* Commit typed tree ops directly, as ONE transaction.
|
|
300
|
+
*
|
|
301
|
+
* The paginated surface has no ProseMirror doc to diff, so it addresses the model the way
|
|
302
|
+
* the ops already do — by node id and offset — rather than round-tripping an edit through
|
|
303
|
+
* a projection just to have it diffed back out.
|
|
304
|
+
*
|
|
305
|
+
* `scope` defaults to the body. Pass `{ kind: 'headerFooter', rId }` to target an existing
|
|
306
|
+
* header/footer part; the transaction publishes one ModelChange (HF → `global` impact)
|
|
307
|
+
* and one undo unit without swapping the body store.
|
|
308
|
+
*/
|
|
309
|
+
applyTreeOps(ops: readonly TreeDocOp[], selectionBefore?: SelectionMark | null, selectionAfter?: SelectionMark | null, scope?: StoryScope, options?: TreeApplyOptions): TreeApplyResult;
|
|
310
|
+
/**
|
|
311
|
+
* Commit several stories' ops as ONE transaction and ONE undo unit.
|
|
312
|
+
*
|
|
313
|
+
* `applyTreeOps` addresses one story; a write that must land in the body AND note parts
|
|
314
|
+
* together — the save-time field-result refresh — needs all-or-nothing semantics, or a
|
|
315
|
+
* mid-sequence refusal exports a file mixing refreshed and stale values and a single undo
|
|
316
|
+
* restores only the last part. Any refusal rolls every group back. Lifecycle ops refuse.
|
|
317
|
+
*/
|
|
318
|
+
applyTreeOpsAtomic(groups: readonly {
|
|
319
|
+
readonly scope: StoryScope;
|
|
320
|
+
readonly ops: readonly TreeDocOp[];
|
|
321
|
+
}[], options?: TreeApplyOptions): TreeApplyResult;
|
|
322
|
+
/**
|
|
323
|
+
* Every part that holds a story, body first, then headers, footers and note parts.
|
|
324
|
+
*
|
|
325
|
+
* A READ: parts come from the package, so this opens no story store and spends none of the
|
|
326
|
+
* 64 editable-store slots. Use it for any query that must answer about the whole document
|
|
327
|
+
* rather than about the caret — an enumeration that reads only the body reports a document
|
|
328
|
+
* the reader is not looking at.
|
|
329
|
+
*/
|
|
330
|
+
storyParts(): readonly OoxmlPart[];
|
|
331
|
+
/** Body text, paragraphs joined by newlines, read from the CANONICAL tree. */
|
|
332
|
+
bodyText(): string;
|
|
333
|
+
/** Text of a story scope, paragraphs joined by newlines. */
|
|
334
|
+
storyText(scope: StoryScope): string | null;
|
|
335
|
+
/** Body-store revision (independent of header/footer store revisions). */
|
|
336
|
+
revision(): number;
|
|
337
|
+
/** Per-story revision, or null when the target is refused. */
|
|
338
|
+
revisionFor(scope: StoryScope): number | null;
|
|
339
|
+
/** Package-wide revision — bumps on any story commit (body or HF). */
|
|
340
|
+
packageRevision(): number;
|
|
341
|
+
canUndo(): boolean;
|
|
342
|
+
canRedo(): boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Undo the last entry, returning the selection to restore.
|
|
345
|
+
*
|
|
346
|
+
* The selection is part of the entry, not something a host can recompute: after undoing a
|
|
347
|
+
* split the caret belongs where the user was typing, and offsets in the reverted tree do
|
|
348
|
+
* not correspond to offsets in the one that replaced it. `null` means nothing was undone
|
|
349
|
+
* or the entry recorded no selection.
|
|
350
|
+
*/
|
|
351
|
+
undo(): SelectionMark | null;
|
|
352
|
+
redo(): SelectionMark | null;
|
|
353
|
+
beginComposition(scope?: StoryScope): void;
|
|
354
|
+
endComposition(): void;
|
|
355
|
+
subscribe(onChange: (change: TreeModelChange) => void): () => void;
|
|
356
|
+
/** Narrow provider-neutral attachment over this session's canonical package store. */
|
|
357
|
+
collaborationPort(documentId: string): CollaborationDocumentPort;
|
|
358
|
+
/** Serialize the whole package back to DOCX bytes. */
|
|
359
|
+
save(): Uint8Array;
|
|
360
|
+
/**
|
|
361
|
+
* The resolved header/footer parts of the section, by variant (phase 2).
|
|
362
|
+
*
|
|
363
|
+
* Returns the FINAL section's effective parts after OOXML inheritance. Prefer
|
|
364
|
+
* `headerFooterPartsBySection` for multi-section pagination.
|
|
365
|
+
*
|
|
366
|
+
* Re-resolved after any package revision so an edited shared part is visible everywhere
|
|
367
|
+
* it is attached.
|
|
368
|
+
*/
|
|
369
|
+
headerFooterParts(): HeaderFooterParts;
|
|
370
|
+
/**
|
|
371
|
+
* Per-section header/footer parts after OOXML inheritance, index-aligned with
|
|
372
|
+
* `enumerateDocumentSections`.
|
|
373
|
+
*/
|
|
374
|
+
headerFooterPartsBySection(): readonly HeaderFooterParts[];
|
|
375
|
+
/**
|
|
376
|
+
* Per-section resolution with declared-vs-inherited metadata for "Same as previous"
|
|
377
|
+
* chrome. Index-aligned with `headerFooterPartsBySection`.
|
|
378
|
+
*/
|
|
379
|
+
headerFooterResolutionBySection(): readonly HeaderFooterSectionResolution[];
|
|
380
|
+
/**
|
|
381
|
+
* Font family names the document uses, from every `w:rFonts` in the CURRENT main
|
|
382
|
+
* part plus the styles and header/footer parts — validated, deduplicated, sorted.
|
|
383
|
+
* Memoized per package revision.
|
|
384
|
+
*/
|
|
385
|
+
documentFonts(): readonly string[];
|
|
386
|
+
/**
|
|
387
|
+
* Font families the document's RENDERED text resolves to, over the story roots only:
|
|
388
|
+
* direct run `w:rFonts` of text-bearing runs plus the style chains those runs,
|
|
389
|
+
* paragraphs and tables actually reference — never a declaration in an unused style.
|
|
390
|
+
* Memoized per package revision.
|
|
391
|
+
*
|
|
392
|
+
* The font-substitution notice reads this one: `documentFonts` reports what the
|
|
393
|
+
* document DECLARES, and Word writes latent styles (Balloon Text naming Segoe UI)
|
|
394
|
+
* into documents that never render a character in them.
|
|
395
|
+
*/
|
|
396
|
+
renderedFontFamilies(): readonly string[];
|
|
397
|
+
/**
|
|
398
|
+
* Font families named by a `w:sym/@w:font`, over the same roots
|
|
399
|
+
* {@link TreeDocxSessionView.documentFonts} reads. Memoized per package revision.
|
|
400
|
+
*
|
|
401
|
+
* Separate from both other answers on purpose. It is not a DECLARATION, so it does not
|
|
402
|
+
* join `documentFonts`, and it is not a face TEXT renders in, so the substitution notice
|
|
403
|
+
* must not report it — but a font resolver has to hear about it, or an app cannot supply
|
|
404
|
+
* the face a private-use glyph needs.
|
|
405
|
+
*/
|
|
406
|
+
symbolFontFamilies(): readonly string[];
|
|
407
|
+
/**
|
|
408
|
+
* Whether the document puts any literal character on a page, over the same roots
|
|
409
|
+
* {@link TreeDocxSessionView.documentFonts} reads. Memoized per package revision.
|
|
410
|
+
*
|
|
411
|
+
* The font-substitution notice needs it: `documentFonts` reports what the document
|
|
412
|
+
* DECLARES, and a brand-new document declares Word's Calibri default over a single
|
|
413
|
+
* empty paragraph — a declaration with no glyph behind it.
|
|
414
|
+
*/
|
|
415
|
+
rendersText(): boolean;
|
|
416
|
+
/** Validated style-picker projection. A document without styles answers `[]`. */
|
|
417
|
+
documentStyles(): readonly DocumentStyleEntry[];
|
|
418
|
+
/** Current styles root for layout, or `null` when the package has no styles part. */
|
|
419
|
+
stylesRoot(): OoxmlElement | null;
|
|
420
|
+
/**
|
|
421
|
+
* The theme part's Latin typefaces, for resolving `w:rFonts` theme references in layout.
|
|
422
|
+
*
|
|
423
|
+
* Memoized once: theme editing is a later slice. A document with no theme part answers
|
|
424
|
+
* `{ major: null, minor: null }`, which leaves every theme reference on the explicit
|
|
425
|
+
* font name beside it.
|
|
426
|
+
*/
|
|
427
|
+
documentThemeFonts(): DocumentThemeFonts;
|
|
428
|
+
/**
|
|
429
|
+
* Root of the numbering part tree (`w:numbering`), for list layout. Memoized once;
|
|
430
|
+
* `null` when the package has no numbering part. Numbering editing is a later slice.
|
|
431
|
+
*/
|
|
432
|
+
numberingRoot(): OoxmlElement | null;
|
|
433
|
+
/**
|
|
434
|
+
* Root of the settings part tree (`w:settings`), for document-wide layout constants such
|
|
435
|
+
* as `w:defaultTabStop`. Memoized once; `null` when the package has no settings part.
|
|
436
|
+
* Settings editing is a later slice, so this is immutable for the session.
|
|
437
|
+
*/
|
|
438
|
+
settingsRoot(): OoxmlElement | null;
|
|
439
|
+
/**
|
|
440
|
+
* The document's own metadata from `docProps/core.xml` and `docProps/app.xml`, for
|
|
441
|
+
* document-property fields (TITLE, AUTHOR, SUBJECT, KEYWORDS, LASTSAVEDBY, COMMENTS). Read
|
|
442
|
+
* once per package revision; an empty object when the parts are absent.
|
|
443
|
+
*/
|
|
444
|
+
documentProperties(): DocumentProperties;
|
|
445
|
+
/**
|
|
446
|
+
* What `settings.xml` says about tracking — `w:trackRevisions`, the tracked-changes
|
|
447
|
+
* protection, and the two do-not-track switches.
|
|
448
|
+
*
|
|
449
|
+
* Read from the document rather than assumed, because Word records the tracking state on
|
|
450
|
+
* the FILE: a package that asks to be edited as tracked changes, presented as an ordinary
|
|
451
|
+
* editable one, takes its first keystroke as an untracked edit.
|
|
452
|
+
*/
|
|
453
|
+
trackingSettings(): DocumentTrackingSettings;
|
|
454
|
+
/**
|
|
455
|
+
* The theme's ten picker colours (`a:clrScheme`), in Word's column order, or `[]`
|
|
456
|
+
* when the package has no complete scheme. Memoized once: the theme part is
|
|
457
|
+
* immutable for the session's lifetime.
|
|
458
|
+
*/
|
|
459
|
+
documentThemeColors(): readonly DocumentThemeColorEntry[];
|
|
460
|
+
/**
|
|
461
|
+
* The run formatting a paragraph's content INHERITS when it authors none: the
|
|
462
|
+
* paragraph style's `basedOn` chain, then `w:docDefaults`, with theme `rFonts`
|
|
463
|
+
* attributes resolved through the font scheme. `runProperties` (the span's own
|
|
464
|
+
* authored properties) lets a theme-only run-level `w:rFonts` resolve too. This is
|
|
465
|
+
* what lets a toolbar always show the effective font, the way Word does.
|
|
466
|
+
*/
|
|
467
|
+
effectiveRunDefaults(paragraphId: string, runProperties?: readonly RunPropertyLike[]): StyleRunDefaults;
|
|
468
|
+
/**
|
|
469
|
+
* The heading outline of the BODY story, in document order: paragraphs whose
|
|
470
|
+
* `w:pStyle` resolves to a heading through the styles part (built-in `heading N`
|
|
471
|
+
* name, or the style's own `w:outlineLvl` 0..8). Memoized per main-part revision —
|
|
472
|
+
* an edit can retitle, add or remove a heading, but the styles part cannot change
|
|
473
|
+
* in-session.
|
|
474
|
+
*/
|
|
475
|
+
documentOutline(): readonly DocumentOutlineEntry[];
|
|
476
|
+
/**
|
|
477
|
+
* Every pending review decision in the document, memoized per revision.
|
|
478
|
+
*
|
|
479
|
+
* Derived from the canonical TREE — the queue is a property of the document, and one derived
|
|
480
|
+
* from laid-out spans empties by half whenever the reader switches to a resolved view.
|
|
481
|
+
*/
|
|
482
|
+
reviewItems(): readonly ReviewItem[];
|
|
483
|
+
/**
|
|
484
|
+
* Whether the document carries review content — tracked changes or comment
|
|
485
|
+
* anchors — regardless of any review module. Derived from store vocabulary
|
|
486
|
+
* only (never the review model), memoized per revision: it is the free
|
|
487
|
+
* tier's honest "this document has more than you are seeing" signal.
|
|
488
|
+
*/
|
|
489
|
+
hasReviewContent(): boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Reply to a comment, or add one over a revision's range. Returns the new comment's id.
|
|
492
|
+
*
|
|
493
|
+
* `scope` names the story the anchor lives in and defaults to the body. A header or
|
|
494
|
+
* footer anchor written against the body store addresses a paragraph that store has
|
|
495
|
+
* never heard of, so the transaction is refused and the reply is lost — which is what
|
|
496
|
+
* replying to a header card did.
|
|
497
|
+
*/
|
|
498
|
+
replyToComment(parentCommentId: string | null, anchor: {
|
|
499
|
+
paragraphId: string;
|
|
500
|
+
start: number;
|
|
501
|
+
end: number;
|
|
502
|
+
endParagraphId?: string;
|
|
503
|
+
}, text: string, author: string,
|
|
504
|
+
/** ISO-8601. Omitted writes no `@w:date`, because inventing one is a content change. */
|
|
505
|
+
date?: string, scope?: StoryScope,
|
|
506
|
+
/** Binds id allocation to one actor, so two peers cannot mint the same comment id. */
|
|
507
|
+
actorId?: string): string | null;
|
|
508
|
+
/**
|
|
509
|
+
* Resolve a comment thread, or reopen it. False when the document holds no such comment.
|
|
510
|
+
*
|
|
511
|
+
* The same package transaction shape as a reply, and for the same reason: `@w15:done` lives in
|
|
512
|
+
* `commentsExtended.xml`, a part a document with no thread does not have, so the state and the
|
|
513
|
+
* part that records it commit together.
|
|
514
|
+
*/
|
|
515
|
+
setCommentResolved(commentId: string, resolved: boolean): boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Delete a comment thread outright — body, thread state and story markers.
|
|
518
|
+
*
|
|
519
|
+
* A THREAD, like resolving one: a reply whose parent is gone has nothing left to answer.
|
|
520
|
+
* `scope` names the owning story and defaults to the body; `noteId` names one note inside a
|
|
521
|
+
* shared notes part. False when the document holds no such comment, or when the removal was
|
|
522
|
+
* refused.
|
|
523
|
+
*/
|
|
524
|
+
deleteComment(commentId: string, scope?: StoryScope, noteId?: number): boolean;
|
|
525
|
+
/**
|
|
526
|
+
* Delete several comment objects as one package transaction and one undo unit.
|
|
527
|
+
*
|
|
528
|
+
* A root removes its thread; a reply removes only itself and reparents any foreign nested
|
|
529
|
+
* descendants to its parent. Marker stripping is scoped to `scope` / `noteId`.
|
|
530
|
+
*/
|
|
531
|
+
deleteComments(comments: readonly {
|
|
532
|
+
readonly commentId: string;
|
|
533
|
+
readonly parentCommentId?: string;
|
|
534
|
+
}[], scope?: StoryScope, noteId?: number): boolean;
|
|
535
|
+
/**
|
|
536
|
+
* Insert a custom node, with the payload it carries, as ONE transaction.
|
|
537
|
+
*
|
|
538
|
+
* A package write reaching through the body store, exactly as a comment is: the customXml data
|
|
539
|
+
* part, the node inside it and the bound `w:sdt` commit together or not at all. A control bound
|
|
540
|
+
* to a store that was never written is a document Word offers to repair.
|
|
541
|
+
*
|
|
542
|
+
* Omitting the payload authors the ordinary tagged control, which is what a node small enough
|
|
543
|
+
* to live in its `w:tag` needs.
|
|
544
|
+
*/
|
|
545
|
+
/** `scope` names the story the paragraph is in, and defaults to the body. */
|
|
546
|
+
insertCustomNode(write: InsertCustomNodeWrite, scope?: StoryScope): CustomNodeWriteResult;
|
|
547
|
+
/**
|
|
548
|
+
* Remove a custom node and, in the same transaction, the payload it bound.
|
|
549
|
+
*
|
|
550
|
+
* The sweep would collect the payload on the next open regardless; doing it here means a
|
|
551
|
+
* document saved between the deletion and that open does not carry a payload for a chip that
|
|
552
|
+
* is gone.
|
|
553
|
+
*/
|
|
554
|
+
/**
|
|
555
|
+
* Remove a custom node and the payload it bound. `scope` names the story holding it and
|
|
556
|
+
* defaults to the body; a chip in a header is refused against the body store.
|
|
557
|
+
*/
|
|
558
|
+
removeCustomNode(controlNodeId: string, scope?: StoryScope): CustomNodeWriteResult;
|
|
559
|
+
/**
|
|
560
|
+
* Drop every payload no control binds, in the stores whose namespaces a module claims.
|
|
561
|
+
*
|
|
562
|
+
* Called ON OPEN and nowhere else — see `sweepCustomNodePayloads`. Answers the ids collected,
|
|
563
|
+
* so a host can report what a document arrived carrying.
|
|
564
|
+
*/
|
|
565
|
+
sweepCustomNodePayloads(namespaces: readonly string[]): CustomNodeSweepOutcome;
|
|
566
|
+
/**
|
|
567
|
+
* Every occurrence of `query` across editable stories, in navigation order. Each match uses
|
|
568
|
+
* the same offset vocabulary as tree operations and surface selections.
|
|
569
|
+
*
|
|
570
|
+
* Memoized one deep, keyed on the package revision AND the question asked: a find panel asks the
|
|
571
|
+
* same question on every tick, and a different query replaces the entry rather than
|
|
572
|
+
* growing a cache the session would have to bound.
|
|
573
|
+
*/
|
|
574
|
+
findText(query: string, options?: DocumentSearchOptions): DocumentSearchResult;
|
|
575
|
+
/** Many queries in one walk of the document, one result per query in the same order. */
|
|
576
|
+
findText(queries: readonly string[], options?: DocumentSearchOptions): readonly DocumentSearchResult[];
|
|
577
|
+
/**
|
|
578
|
+
* The faces the package EMBEDS (`word/fontTable.xml` embed relationships),
|
|
579
|
+
* deobfuscated — the only font source that needs neither a substitute nor a network.
|
|
580
|
+
* Extraction asserts nothing about validity; admitting a face is the font resource
|
|
581
|
+
* lane's job. Memoized once: the font table and font parts are immutable in-session.
|
|
582
|
+
*/
|
|
583
|
+
embeddedFonts(): readonly EmbeddedFont[];
|
|
584
|
+
/**
|
|
585
|
+
* The `w:numId` of a bullet or numbered list definition, creating one where the document
|
|
586
|
+
* has none — including `numbering.xml` itself, its relationship and its content type.
|
|
587
|
+
*
|
|
588
|
+
* A document Word has never numbered carries no numbering part at all, so the first
|
|
589
|
+
* bullet a user asks for has to bring the whole definition with it. An existing
|
|
590
|
+
* definition of the same kind is reused rather than duplicated.
|
|
591
|
+
*/
|
|
592
|
+
/**
|
|
593
|
+
* What the owning part's relationships answer for one `r:id` under `scope` (default:
|
|
594
|
+
* body): the authored target and whether it is external. `null` for an id the part does
|
|
595
|
+
* not declare, or when the scoped part is not open.
|
|
596
|
+
*
|
|
597
|
+
* Live rather than memoized: inserting a link mints a relationship mid-session, and a
|
|
598
|
+
* cached resolver would report the link this session just created as dangling.
|
|
599
|
+
*/
|
|
600
|
+
relationshipTarget(relationshipId: string, scope?: StoryScope): {
|
|
601
|
+
readonly target: string;
|
|
602
|
+
readonly external: boolean;
|
|
603
|
+
} | null;
|
|
604
|
+
/**
|
|
605
|
+
* `bookmarkName -> { paragraphId, offset }` over the main part, memoized per revision.
|
|
606
|
+
*
|
|
607
|
+
* What an internal hyperlink's `w:anchor` resolves through. Keyed on the store revision
|
|
608
|
+
* because an edit can move, split or delete the paragraph a bookmark sits in.
|
|
609
|
+
*/
|
|
610
|
+
bookmarks(): BookmarkIndex;
|
|
611
|
+
/**
|
|
612
|
+
* The relationship id for an external hyperlink target on the part owning `scope`
|
|
613
|
+
* (default: body), minting one if that part has none, or `null` when the URL is refused
|
|
614
|
+
* or the scoped part cannot be resolved.
|
|
615
|
+
*
|
|
616
|
+
* Lives on the PACKAGE, outside `store.transact`, like the numbering definitions: the
|
|
617
|
+
* undoable half is the tree op that names the id. An unreferenced relationship left
|
|
618
|
+
* behind by an undo is inert and is what Word writes anyway. Scoped inserts mint onto
|
|
619
|
+
* the story's own `.rels` so a header/footer or note link never creates a stray body
|
|
620
|
+
* relationship.
|
|
621
|
+
*/
|
|
622
|
+
ensureHyperlinkRelationship(url: string, scope?: StoryScope): string | null;
|
|
623
|
+
ensureListDefinition(kind: ListKind): string | null;
|
|
624
|
+
/**
|
|
625
|
+
* Declare `level` in the list definition `numId` names, with Word's default format for
|
|
626
|
+
* that depth, or answer false.
|
|
627
|
+
*
|
|
628
|
+
* Word never greys Increase Indent out on a list item: demoting past the deepest level
|
|
629
|
+
* a definition declares makes Word define the level, cycling its stock bullets and
|
|
630
|
+
* number formats. An already-declared level answers true without changing anything.
|
|
631
|
+
*
|
|
632
|
+
* The declaration lives on the PACKAGE, outside the store's history — undoing the edit
|
|
633
|
+
* that needed it restores the paragraph but leaves the level declared, which is
|
|
634
|
+
* harmless: an unreferenced level renders nothing and Word writes files full of them.
|
|
635
|
+
*/
|
|
636
|
+
ensureNumberingLevel(numId: string, level: number, kind: ListKind): boolean;
|
|
637
|
+
/**
|
|
638
|
+
* The `w14:paraId` ↔ node-id index over the full editable set of the MAIN part,
|
|
639
|
+
* memoized per revision. Every editable paragraph carries a valid, part-unique id
|
|
640
|
+
* (established at open, maintained by the split appliers), so every paragraph is
|
|
641
|
+
* mapped. Header/footer paragraphs become addressable through `partFor` once their
|
|
642
|
+
* story store is open.
|
|
643
|
+
*/
|
|
644
|
+
paragraphAnchors(): ParagraphAnchorIndex;
|
|
645
|
+
/** `w14:paraId` of a canonical paragraph node id, verbatim, or null. */
|
|
646
|
+
paraIdOf(nodeId: string): string | null;
|
|
647
|
+
/** Canonical node id for a `w14:paraId`, matched case-insensitively, or null. */
|
|
648
|
+
nodeIdOf(paraId: string): string | null;
|
|
649
|
+
/** Insert a validated raster image as one package undo unit (task 12). */
|
|
650
|
+
insertImage(scope: StoryScope, input: InsertImageInput): Promise<ImageIntentResult>;
|
|
651
|
+
/** Replace a picture drawing's embedded media in one package undo unit. */
|
|
652
|
+
replaceImage(scope: StoryScope, drawingNodeId: string, bytes: Uint8Array, mime: SupportedImageMime, decodePort: ImageDecodePort, options: ReplaceImageOptions): Promise<ImageIntentResult>;
|
|
653
|
+
/** Delete a picture drawing and collect orphaned media in one package undo unit. */
|
|
654
|
+
deleteImage(scope: StoryScope, drawingNodeId: string): ImageIntentResult;
|
|
655
|
+
/** Propose the drawing's deletion as a tracked change (`w:del`); media stays untouched. */
|
|
656
|
+
deleteImageTracked(scope: StoryScope, drawingNodeId: string, revision: RevisionAttributionInput): ImageIntentResult;
|
|
657
|
+
/** Apply image property tree ops plus hyperlink relationship wiring atomically. */
|
|
658
|
+
applyImageProperties(scope: StoryScope, input: ApplyImagePropertiesInput): ImageIntentResult;
|
|
659
|
+
/** Land a clipboard fragment (resource merge + blocks) as one package undo unit. */
|
|
660
|
+
applyFragmentPaste(scope: StoryScope, input: FragmentPasteInput): FragmentPasteResult;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export { bodyParagraphs as d, docToTreeOps as e, partHasNode as p, reconcileDoc as r, treeToDoc as t };
|
|
664
|
+
export type { DocumentStyleEntry as D, MapResult as M, TreeDocxSessionView as T, TreeApplyResult as a, TreeApplyOptions as b, TreeBindingRejection as c, DocumentThemeColorEntry as f };
|