@eigenpal/docx-editor-core 1.0.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -16
- package/dist/agent/index.d.mts +42 -7
- package/dist/agent/index.d.ts +42 -7
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-2EQGBVPV.js +2 -0
- package/dist/chunk-2XP6GLA4.mjs +1 -0
- package/dist/chunk-44FHVKSI.js +1 -0
- package/dist/{chunk-2IE6UDHJ.mjs → chunk-44JKHPGF.mjs} +1 -1
- package/dist/{chunk-ABBG4WD2.js → chunk-4QEETB7U.js} +2 -2
- package/dist/chunk-53VKL6CG.js +1 -0
- package/dist/chunk-5BLQHXWK.mjs +1 -0
- package/dist/chunk-5M7TI6TV.js +1 -0
- package/dist/chunk-6JKM7TWJ.mjs +1 -0
- package/dist/{chunk-EQVNAHL7.mjs → chunk-6Y6LON6Y.mjs} +1 -1
- package/dist/{chunk-QVEAQOMR.mjs → chunk-6ZXL3EIP.mjs} +1 -1
- package/dist/{chunk-GHQS3I2W.mjs → chunk-7BVHKWEW.mjs} +1 -1
- package/dist/chunk-7HANRHHL.js +1 -0
- package/dist/chunk-7LRR7RKE.mjs +15 -0
- package/dist/chunk-7OW3VCZE.mjs +1 -0
- package/dist/chunk-7ZN4WI5N.mjs +4 -0
- package/dist/chunk-AMB6Y77B.js +1 -0
- package/dist/{chunk-3JXR6YU4.mjs → chunk-BOOHU5EW.mjs} +1 -1
- package/dist/{chunk-XBHF5Q2F.js → chunk-BXWOLARZ.js} +1 -1
- package/dist/chunk-C45EFOVP.js +1 -0
- package/dist/chunk-CCPBNE2F.mjs +2 -0
- package/dist/{chunk-XWQB6APW.mjs → chunk-D62KS7QG.mjs} +1 -1
- package/dist/chunk-DI6CRWSW.mjs +1 -0
- package/dist/chunk-DTTWBKGN.mjs +0 -0
- package/dist/chunk-DV6GWBUJ.js +2 -0
- package/dist/{chunk-EPX7BBJD.js → chunk-E4JMCA5X.js} +2 -2
- package/dist/chunk-EQAORQC3.mjs +1 -0
- package/dist/chunk-FO6IX2DB.js +6 -0
- package/dist/chunk-FW23IMBF.mjs +1 -0
- package/dist/chunk-FYKRDDKG.js +1 -0
- package/dist/chunk-GSKMHXHG.js +1 -0
- package/dist/chunk-GUQFNJHE.mjs +1 -0
- package/dist/{chunk-D536HC5M.js → chunk-HQPWFUP5.js} +1 -1
- package/dist/chunk-ICE6NC3S.mjs +1 -0
- package/dist/chunk-IFUED5ZS.mjs +1 -0
- package/dist/chunk-ISKTBM4L.js +1 -0
- package/dist/chunk-IYKBX24M.js +1 -0
- package/dist/chunk-KOEWROYV.mjs +6 -0
- package/dist/chunk-KRN6YSR2.mjs +1 -0
- package/dist/chunk-KZXZWGFX.mjs +1 -0
- package/dist/chunk-L24C5TEX.mjs +1 -0
- package/dist/chunk-L72YAV5N.js +3 -0
- package/dist/chunk-LK6I3HMH.mjs +0 -0
- package/dist/{chunk-XBIKSAH6.js → chunk-LTHT4A4S.js} +1 -1
- package/dist/chunk-LWH66Q7Q.js +1 -0
- package/dist/chunk-MERJFGEP.mjs +59 -0
- package/dist/chunk-MJ6XZFVD.mjs +1 -0
- package/dist/chunk-MNOHUTKE.js +15 -0
- package/dist/chunk-MP4QSEO2.mjs +1 -0
- package/dist/{chunk-HL5PQT3A.mjs → chunk-OEXVWIHW.mjs} +1 -1
- package/dist/chunk-PVAVS3IU.js +1 -0
- package/dist/chunk-QEACB5VG.js +1 -0
- package/dist/{chunk-EV6W6KXG.mjs → chunk-QKLY4F2J.mjs} +1 -1
- package/dist/chunk-QYF7BRG3.js +2 -0
- package/dist/chunk-ROG4MNOR.js +4 -0
- package/dist/{chunk-D5E5TA74.js → chunk-RORPREG3.js} +1 -1
- package/dist/chunk-SORYYVJ7.js +1 -0
- package/dist/chunk-SZIOF5SG.js +59 -0
- package/dist/{chunk-SAFW7UQZ.js → chunk-THLJYXFB.js} +1 -1
- package/dist/chunk-TUIEV7Q7.js +1 -0
- package/dist/{chunk-Z4SJCSTS.js → chunk-U4WUDHDK.js} +1 -1
- package/dist/chunk-U4XMGWF7.js +1 -0
- package/dist/chunk-U67MWOPZ.mjs +1 -0
- package/dist/chunk-VMRUBLPI.js +1 -0
- package/dist/chunk-WLDI6N3B.mjs +3 -0
- package/dist/chunk-WLHNIXWC.mjs +2 -0
- package/dist/chunk-WVERBZZU.js +1 -0
- package/dist/chunk-XCKTBNKN.js +1 -0
- package/dist/chunk-XPV6VILW.mjs +1 -0
- package/dist/chunk-Z5MJYQSD.mjs +1 -0
- package/dist/chunk-ZBFNOJGY.js +1 -0
- package/dist/chunk-ZX26QZJ5.mjs +1 -0
- package/dist/content-CE-ZdMwG.d.mts +1418 -0
- package/dist/content-CYXJ2tfQ.d.ts +1418 -0
- package/dist/contentControlValues-DAwTWfgR.d.mts +187 -0
- package/dist/contentControlValues-gyVPsi6m.d.ts +187 -0
- package/dist/core-plugins.d.mts +1 -2
- package/dist/core-plugins.d.ts +1 -2
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +6 -7
- package/dist/core.d.ts +6 -7
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-Bghq9rFI.d.mts} +1 -1
- package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-C4lFC60P.d.ts} +1 -1
- package/dist/documentStyles-D87dxl18.d.mts +34 -0
- package/dist/documentStyles-DToJv9co.d.ts +34 -0
- package/dist/docx/index.d.mts +1 -2
- package/dist/docx/index.d.ts +1 -2
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +1 -2
- package/dist/docx/parser.d.ts +1 -2
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +1 -2
- package/dist/docx/rezip.d.ts +1 -2
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.d.mts +2 -3
- package/dist/docx/serializer/index.d.ts +2 -3
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-Cm02v7PO.d.ts} +63 -3
- package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-Z7pqeNvZ.d.mts} +63 -3
- package/dist/{headerFooterLayout-B5LyDpSM.d.ts → headerFooterLayout-Bd58Tum3.d.ts} +74 -2
- package/dist/{headerFooterLayout-DVFcJ832.d.mts → headerFooterLayout-CuIJiIzi.d.mts} +74 -2
- package/dist/headless.d.mts +7 -6
- package/dist/headless.d.ts +7 -6
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +4 -4
- package/dist/layout-bridge/index.d.ts +4 -4
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +4 -0
- package/dist/layout-bridge/measuring/index.d.ts +4 -0
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.d.mts +2 -1
- package/dist/layout-bridge/toFlowBlocks.d.ts +2 -1
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +4 -1
- package/dist/layout-engine/index.d.ts +4 -1
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +74 -1
- package/dist/layout-engine/types.d.ts +74 -1
- package/dist/layout-painter/index.d.mts +4 -4
- package/dist/layout-painter/index.d.ts +4 -4
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +27 -4
- package/dist/layout-painter/renderPage.d.ts +27 -4
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +1 -2
- package/dist/managers/AutoSaveManager.d.ts +1 -2
- package/dist/managers/TableSelectionManager.d.mts +1 -2
- package/dist/managers/TableSelectionManager.d.ts +1 -2
- package/dist/managers/types.d.mts +1 -2
- package/dist/managers/types.d.ts +1 -2
- package/dist/mcp-cli.mjs +23 -22
- package/dist/mcp.d.mts +1 -2
- package/dist/mcp.d.ts +1 -2
- package/dist/mcp.js +3 -3
- package/dist/mcp.mjs +1 -1
- package/dist/{nodes-D7PTUJ2N.d.ts → nodes-BNkRKBBX.d.ts} +64 -3
- package/dist/{nodes-CL8M0L-a.d.mts → nodes-Bz-UHhLE.d.mts} +64 -3
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +80 -6
- package/dist/prosemirror/commands/index.d.ts +80 -6
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -3
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -3
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +3 -4
- package/dist/prosemirror/conversion/index.d.ts +3 -4
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/editor.css +302 -95
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
- package/dist/prosemirror/index.d.mts +94 -7
- package/dist/prosemirror/index.d.ts +94 -7
- package/dist/prosemirror/index.js +3 -1
- package/dist/prosemirror/index.mjs +3 -1
- package/dist/prosemirror/plugins/index.d.mts +124 -17
- package/dist/prosemirror/plugins/index.d.ts +124 -17
- package/dist/prosemirror/plugins/index.js +1 -1
- package/dist/prosemirror/plugins/index.mjs +1 -1
- package/dist/prosemirror/schema/index.d.mts +3 -4
- package/dist/prosemirror/schema/index.d.ts +3 -4
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/styles/index.d.mts +9 -0
- package/dist/prosemirror/styles/index.d.ts +9 -0
- package/dist/prosemirror/styles/index.js +1 -1
- package/dist/prosemirror/styles/index.mjs +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +44 -22
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +44 -22
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
- package/dist/types/content.d.mts +4 -1167
- package/dist/types/content.d.ts +4 -1167
- package/dist/types/document.d.mts +2 -4
- package/dist/types/document.d.ts +2 -4
- package/dist/utils/comments.d.mts +78 -5
- package/dist/utils/comments.d.ts +78 -5
- package/dist/utils/comments.js +1 -1
- package/dist/utils/comments.mjs +1 -1
- package/dist/utils/highlightColors.js +1 -1
- package/dist/utils/highlightColors.mjs +1 -1
- package/dist/utils/index.d.mts +2 -3
- package/dist/utils/index.d.ts +2 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-C7BLz9sJ.d.mts} +1 -1
- package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-HPZbJ_gw.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-3AZWLVLC.js +0 -1
- package/dist/chunk-3NLVHZMT.js +0 -59
- package/dist/chunk-5SU4HPQS.mjs +0 -1
- package/dist/chunk-7PX32GLB.mjs +0 -1
- package/dist/chunk-AHXPHBMT.js +0 -1
- package/dist/chunk-B6LYBJ4H.mjs +0 -1
- package/dist/chunk-BFB4PRS4.mjs +0 -1
- package/dist/chunk-BRHHK4MG.mjs +0 -2
- package/dist/chunk-CP5OSG5Z.mjs +0 -1
- package/dist/chunk-CUXXRGPQ.mjs +0 -1
- package/dist/chunk-D4RPOJC7.js +0 -1
- package/dist/chunk-FWTP7BN7.mjs +0 -4
- package/dist/chunk-G7AKYAKU.mjs +0 -1
- package/dist/chunk-HAAMO2Z2.mjs +0 -1
- package/dist/chunk-ILJUDEZ5.mjs +0 -1
- package/dist/chunk-IN6IYQ2X.js +0 -1
- package/dist/chunk-IO6HZ7KR.js +0 -2
- package/dist/chunk-IP2VXNWG.js +0 -1
- package/dist/chunk-KBU6QQFU.js +0 -9
- package/dist/chunk-LBKMYD3M.mjs +0 -1
- package/dist/chunk-LDKESXXK.mjs +0 -3
- package/dist/chunk-MZOVDLYL.js +0 -1
- package/dist/chunk-N3EIZN65.js +0 -1
- package/dist/chunk-NBLJPT54.mjs +0 -1
- package/dist/chunk-NERY274X.js +0 -1
- package/dist/chunk-NNQWQOC5.mjs +0 -1
- package/dist/chunk-NO5LW2DQ.mjs +0 -1
- package/dist/chunk-OCAX2KJQ.js +0 -4
- package/dist/chunk-OTDF6PZK.js +0 -1
- package/dist/chunk-P3AXSRLG.mjs +0 -1
- package/dist/chunk-Q4CKLXWA.js +0 -1
- package/dist/chunk-QMLIXLZJ.mjs +0 -4
- package/dist/chunk-QXHL67FG.mjs +0 -1
- package/dist/chunk-TGPS3SRR.mjs +0 -1
- package/dist/chunk-TMISJEGL.js +0 -1
- package/dist/chunk-TRJWRZZD.js +0 -1
- package/dist/chunk-TRQN2SFW.mjs +0 -59
- package/dist/chunk-UGXSKZVM.js +0 -1
- package/dist/chunk-V435QKZB.js +0 -3
- package/dist/chunk-V6SWUCTS.js +0 -2
- package/dist/chunk-VQWZHPWI.mjs +0 -1
- package/dist/chunk-X3NB7STJ.js +0 -1
- package/dist/chunk-XOH7YAYL.js +0 -1
- package/dist/chunk-Y5HZAMND.mjs +0 -9
- package/dist/chunk-Y7I5QDCN.mjs +0 -1
- package/dist/chunk-YCDB5TA6.js +0 -4
- package/dist/chunk-YE357WVA.js +0 -1
- package/dist/chunk-YVYB4YCI.js +0 -1
- package/dist/lists-CvG_iVK3.d.mts +0 -148
- package/dist/lists-UTp_tk7B.d.ts +0 -148
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Document } from './types/document.mjs';
|
|
2
|
+
import { t as SdtType, u as SdtProperties, v as SdtDataBinding, c as DocumentBody, w as BlockSdt, B as BlockContent } from './content-CE-ZdMwG.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Content-control (SDT) addressing for the document model.
|
|
6
|
+
*
|
|
7
|
+
* Block-level content controls (`w:sdt`) are the natural anchor for template
|
|
8
|
+
* logic and agent edits: they survive the round trip (see the parser +
|
|
9
|
+
* serializer) and carry a stable `tag`/`alias`/`id`. This module is the
|
|
10
|
+
* read side of that contract — discover controls and read their content
|
|
11
|
+
* without a DOM or an editor instance, so server-side pipelines and AI
|
|
12
|
+
* agents can find an anchor by tag and act on it.
|
|
13
|
+
*
|
|
14
|
+
* Walks the body recursively, descending into nested controls so a control
|
|
15
|
+
* inside another control is still found. (The model places block content
|
|
16
|
+
* controls at body level or nested in other controls, not inside table
|
|
17
|
+
* cells.) The returned `path` (block indices from the body root) addresses
|
|
18
|
+
* the control unambiguously for a follow-up edit.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** Filter for {@link findContentControls}. All provided fields must match (AND). */
|
|
22
|
+
interface ContentControlFilter {
|
|
23
|
+
/** Developer identifier (`w:tag`), exact match. */
|
|
24
|
+
tag?: string;
|
|
25
|
+
/** Friendly name (`w:alias`), exact match. */
|
|
26
|
+
alias?: string;
|
|
27
|
+
/** Numeric id (`w:id`), exact match. */
|
|
28
|
+
id?: number;
|
|
29
|
+
/** Control type projection (`richText`, `dropDownList`, …). */
|
|
30
|
+
type?: SdtType;
|
|
31
|
+
}
|
|
32
|
+
/** A discovered content control plus enough context to address and edit it. */
|
|
33
|
+
interface ContentControlInfo {
|
|
34
|
+
/** Developer identifier (`w:tag`). */
|
|
35
|
+
tag?: string;
|
|
36
|
+
/** Friendly name (`w:alias`). */
|
|
37
|
+
alias?: string;
|
|
38
|
+
/** Numeric id (`w:id`). */
|
|
39
|
+
id?: number;
|
|
40
|
+
/** Control type projection. */
|
|
41
|
+
sdtType: SdtType;
|
|
42
|
+
/** Lock setting, if any. A locked control should refuse content edits. */
|
|
43
|
+
lock?: SdtProperties['lock'];
|
|
44
|
+
/** Dropdown/combobox list items, if modeled. */
|
|
45
|
+
listItems?: {
|
|
46
|
+
displayText: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}[];
|
|
49
|
+
/** Placeholder docPart reference, if any. */
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/** Whether the control is currently showing placeholder text (`w:showingPlcHdr`). */
|
|
52
|
+
showingPlaceholder?: boolean;
|
|
53
|
+
/** Checkbox state, for checkbox controls. */
|
|
54
|
+
checked?: boolean;
|
|
55
|
+
/** Date format string, for date controls. */
|
|
56
|
+
dateFormat?: string;
|
|
57
|
+
/** XML data binding (`w:dataBinding`), if the control is bound. */
|
|
58
|
+
dataBinding?: SdtDataBinding;
|
|
59
|
+
/** Plain text of the control's content (paragraphs/tables/nested controls flattened). */
|
|
60
|
+
text: string;
|
|
61
|
+
/**
|
|
62
|
+
* Block-index path from the document body to this control. Top-level
|
|
63
|
+
* controls are `[i]`; a control nested inside the i-th body block's content
|
|
64
|
+
* is `[i, j]`, and so on. Stable address for a follow-up edit.
|
|
65
|
+
*/
|
|
66
|
+
path: number[];
|
|
67
|
+
/** Nesting depth (0 = direct child of the body). */
|
|
68
|
+
depth: number;
|
|
69
|
+
}
|
|
70
|
+
/** Plain text of a control's content, descending into tables and nested SDTs. */
|
|
71
|
+
declare function getContentControlText(control: BlockSdt): string;
|
|
72
|
+
/**
|
|
73
|
+
* Find every block-level content control in the document, optionally filtered
|
|
74
|
+
* by tag/alias/id/type. Results are in document order; nested controls follow
|
|
75
|
+
* their parent. Searches the body and controls nested inside controls. Table
|
|
76
|
+
* cells are not searched (the current model/parser does not surface cell-level
|
|
77
|
+
* controls), and headers/footers live in a separate content tree.
|
|
78
|
+
*/
|
|
79
|
+
declare function findContentControls(input: Document | DocumentBody, filter?: ContentControlFilter): ContentControlInfo[];
|
|
80
|
+
/** Convenience: the first control matching `filter`, or `undefined`. */
|
|
81
|
+
declare function findContentControl(input: Document | DocumentBody, filter: ContentControlFilter): ContentControlInfo | undefined;
|
|
82
|
+
/** No control matched the filter. */
|
|
83
|
+
declare class ContentControlNotFoundError extends Error {
|
|
84
|
+
constructor(filter: ContentControlFilter);
|
|
85
|
+
}
|
|
86
|
+
/** The matched control's lock forbids the attempted edit (pass `force` to override). */
|
|
87
|
+
declare class ContentControlLockedError extends Error {
|
|
88
|
+
constructor(lock: SdtProperties['lock'], op: 'edit' | 'remove');
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The control's type doesn't support free text/block replacement (e.g. a
|
|
92
|
+
* dropdown, date, checkbox, or picture control), so writing arbitrary content
|
|
93
|
+
* would desync the type marker from its value. Use a type-specific setter, or
|
|
94
|
+
* pass `{ force: true }` to override.
|
|
95
|
+
*/
|
|
96
|
+
declare class ContentControlTypeError extends Error {
|
|
97
|
+
constructor(sdtType: SdtType);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The control is bound to a Custom XML data store (`w:dataBinding`). Writing its
|
|
101
|
+
* content won't stick — Word re-renders the control from the bound XML node — so
|
|
102
|
+
* the write is refused. Update the data store instead, or pass `{ force: true }`.
|
|
103
|
+
*/
|
|
104
|
+
declare class ContentControlBoundError extends Error {
|
|
105
|
+
constructor();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Replace the content of the first control matching `filter`. `replacement`
|
|
109
|
+
* may be a string (split into paragraphs on newlines) or block content. The
|
|
110
|
+
* control's properties, tag/alias, and lossless raw `w:sdtPr` are preserved —
|
|
111
|
+
* only the contained blocks change, so the result still round-trips.
|
|
112
|
+
*
|
|
113
|
+
* When the control was showing its placeholder (`w:showingPlcHdr`), that flag
|
|
114
|
+
* is cleared so Word doesn't render the new content as placeholder text.
|
|
115
|
+
*
|
|
116
|
+
* Throws {@link ContentControlNotFoundError} if nothing matches,
|
|
117
|
+
* {@link ContentControlLockedError} if the control's lock forbids editing, and
|
|
118
|
+
* {@link ContentControlTypeError} if the control is a typed (dropdown/date/…)
|
|
119
|
+
* control whose value shouldn't be set as free text. Pass `{ force: true }` to
|
|
120
|
+
* override the lock/type guards.
|
|
121
|
+
*/
|
|
122
|
+
declare function setContentControlContent(doc: Document, filter: ContentControlFilter, replacement: string | BlockContent[], options?: {
|
|
123
|
+
force?: boolean;
|
|
124
|
+
}): Document;
|
|
125
|
+
/**
|
|
126
|
+
* Remove the first control matching `filter` from the document. With
|
|
127
|
+
* `keepContent: true` the control's blocks are unwrapped in place (the box
|
|
128
|
+
* goes away, the content stays) — useful for "resolve this conditional
|
|
129
|
+
* section into plain content". Otherwise the whole region is deleted.
|
|
130
|
+
*
|
|
131
|
+
* Unwrapping a repeating-section (item) is refused unless `force`, since
|
|
132
|
+
* lifting its blocks out would orphan the (w15) repeating structure.
|
|
133
|
+
*
|
|
134
|
+
* Throws {@link ContentControlNotFoundError} / {@link ContentControlLockedError}
|
|
135
|
+
* as {@link setContentControlContent} does.
|
|
136
|
+
*/
|
|
137
|
+
declare function removeContentControl(doc: Document, filter: ContentControlFilter, options?: {
|
|
138
|
+
force?: boolean;
|
|
139
|
+
keepContent?: boolean;
|
|
140
|
+
}): Document;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Typed value setters for block-level content controls — set a dropdown
|
|
144
|
+
* selection, toggle a checkbox, or set a date. These produce both the visible
|
|
145
|
+
* content (the run text Word shows) and the structured state inside the
|
|
146
|
+
* captured raw `w:sdtPr` (dropdown `w:lastValue`, `w14:checked`, `w:date`'s
|
|
147
|
+
* `w:fullDate`), patched in place so the rest of the control round-trips
|
|
148
|
+
* verbatim. Use these instead of {@link setContentControlContent} for typed
|
|
149
|
+
* controls, which that function refuses by design.
|
|
150
|
+
*
|
|
151
|
+
* Raw `w:sdtPr` is patched with targeted string edits (not a full re-serialize)
|
|
152
|
+
* to preserve the `CT_SdtPr` element order and any unmodeled properties — the
|
|
153
|
+
* same capture-and-replay contract used everywhere else for SDTs.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/** A typed value to apply to a content control. */
|
|
157
|
+
type ContentControlValue = {
|
|
158
|
+
kind: 'dropdown';
|
|
159
|
+
value: string;
|
|
160
|
+
} | {
|
|
161
|
+
kind: 'checkbox';
|
|
162
|
+
checked: boolean;
|
|
163
|
+
} | {
|
|
164
|
+
kind: 'date';
|
|
165
|
+
date: string;
|
|
166
|
+
};
|
|
167
|
+
/** The control doesn't support the requested value kind, or the value is invalid. */
|
|
168
|
+
declare class ContentControlValueError extends Error {
|
|
169
|
+
constructor(message: string);
|
|
170
|
+
}
|
|
171
|
+
/** Format an ISO date (yyyy-mm-dd) with a subset of OOXML date tokens. */
|
|
172
|
+
declare function formatSdtDate(iso: string, pattern?: string): string;
|
|
173
|
+
/**
|
|
174
|
+
* Set a typed value (dropdown selection / checkbox / date) on the first control
|
|
175
|
+
* matching `filter`, returning a new {@link Document}. Updates both the visible
|
|
176
|
+
* content and the structured raw state, so the result round-trips and Word
|
|
177
|
+
* shows the new value. Throws {@link ContentControlNotFoundError} if nothing
|
|
178
|
+
* matches, {@link ContentControlLockedError} if content-locked,
|
|
179
|
+
* {@link ContentControlBoundError} if data-bound (the store would override the
|
|
180
|
+
* write), and {@link ContentControlValueError} if the value doesn't fit the
|
|
181
|
+
* control type. The lock/bound guards are overridable with `{ force: true }`.
|
|
182
|
+
*/
|
|
183
|
+
declare function setContentControlValue(doc: Document, filter: ContentControlFilter, value: ContentControlValue, options?: {
|
|
184
|
+
force?: boolean;
|
|
185
|
+
}): Document;
|
|
186
|
+
|
|
187
|
+
export { ContentControlBoundError as C, type ContentControlFilter as a, type ContentControlInfo as b, ContentControlLockedError as c, ContentControlNotFoundError as d, ContentControlTypeError as e, type ContentControlValue as f, ContentControlValueError as g, findContentControl as h, findContentControls as i, formatSdtDate as j, getContentControlText as k, setContentControlValue as l, removeContentControl as r, setContentControlContent as s };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Document } from './types/document.js';
|
|
2
|
+
import { t as SdtType, u as SdtProperties, v as SdtDataBinding, c as DocumentBody, w as BlockSdt, B as BlockContent } from './content-CYXJ2tfQ.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Content-control (SDT) addressing for the document model.
|
|
6
|
+
*
|
|
7
|
+
* Block-level content controls (`w:sdt`) are the natural anchor for template
|
|
8
|
+
* logic and agent edits: they survive the round trip (see the parser +
|
|
9
|
+
* serializer) and carry a stable `tag`/`alias`/`id`. This module is the
|
|
10
|
+
* read side of that contract — discover controls and read their content
|
|
11
|
+
* without a DOM or an editor instance, so server-side pipelines and AI
|
|
12
|
+
* agents can find an anchor by tag and act on it.
|
|
13
|
+
*
|
|
14
|
+
* Walks the body recursively, descending into nested controls so a control
|
|
15
|
+
* inside another control is still found. (The model places block content
|
|
16
|
+
* controls at body level or nested in other controls, not inside table
|
|
17
|
+
* cells.) The returned `path` (block indices from the body root) addresses
|
|
18
|
+
* the control unambiguously for a follow-up edit.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** Filter for {@link findContentControls}. All provided fields must match (AND). */
|
|
22
|
+
interface ContentControlFilter {
|
|
23
|
+
/** Developer identifier (`w:tag`), exact match. */
|
|
24
|
+
tag?: string;
|
|
25
|
+
/** Friendly name (`w:alias`), exact match. */
|
|
26
|
+
alias?: string;
|
|
27
|
+
/** Numeric id (`w:id`), exact match. */
|
|
28
|
+
id?: number;
|
|
29
|
+
/** Control type projection (`richText`, `dropDownList`, …). */
|
|
30
|
+
type?: SdtType;
|
|
31
|
+
}
|
|
32
|
+
/** A discovered content control plus enough context to address and edit it. */
|
|
33
|
+
interface ContentControlInfo {
|
|
34
|
+
/** Developer identifier (`w:tag`). */
|
|
35
|
+
tag?: string;
|
|
36
|
+
/** Friendly name (`w:alias`). */
|
|
37
|
+
alias?: string;
|
|
38
|
+
/** Numeric id (`w:id`). */
|
|
39
|
+
id?: number;
|
|
40
|
+
/** Control type projection. */
|
|
41
|
+
sdtType: SdtType;
|
|
42
|
+
/** Lock setting, if any. A locked control should refuse content edits. */
|
|
43
|
+
lock?: SdtProperties['lock'];
|
|
44
|
+
/** Dropdown/combobox list items, if modeled. */
|
|
45
|
+
listItems?: {
|
|
46
|
+
displayText: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}[];
|
|
49
|
+
/** Placeholder docPart reference, if any. */
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/** Whether the control is currently showing placeholder text (`w:showingPlcHdr`). */
|
|
52
|
+
showingPlaceholder?: boolean;
|
|
53
|
+
/** Checkbox state, for checkbox controls. */
|
|
54
|
+
checked?: boolean;
|
|
55
|
+
/** Date format string, for date controls. */
|
|
56
|
+
dateFormat?: string;
|
|
57
|
+
/** XML data binding (`w:dataBinding`), if the control is bound. */
|
|
58
|
+
dataBinding?: SdtDataBinding;
|
|
59
|
+
/** Plain text of the control's content (paragraphs/tables/nested controls flattened). */
|
|
60
|
+
text: string;
|
|
61
|
+
/**
|
|
62
|
+
* Block-index path from the document body to this control. Top-level
|
|
63
|
+
* controls are `[i]`; a control nested inside the i-th body block's content
|
|
64
|
+
* is `[i, j]`, and so on. Stable address for a follow-up edit.
|
|
65
|
+
*/
|
|
66
|
+
path: number[];
|
|
67
|
+
/** Nesting depth (0 = direct child of the body). */
|
|
68
|
+
depth: number;
|
|
69
|
+
}
|
|
70
|
+
/** Plain text of a control's content, descending into tables and nested SDTs. */
|
|
71
|
+
declare function getContentControlText(control: BlockSdt): string;
|
|
72
|
+
/**
|
|
73
|
+
* Find every block-level content control in the document, optionally filtered
|
|
74
|
+
* by tag/alias/id/type. Results are in document order; nested controls follow
|
|
75
|
+
* their parent. Searches the body and controls nested inside controls. Table
|
|
76
|
+
* cells are not searched (the current model/parser does not surface cell-level
|
|
77
|
+
* controls), and headers/footers live in a separate content tree.
|
|
78
|
+
*/
|
|
79
|
+
declare function findContentControls(input: Document | DocumentBody, filter?: ContentControlFilter): ContentControlInfo[];
|
|
80
|
+
/** Convenience: the first control matching `filter`, or `undefined`. */
|
|
81
|
+
declare function findContentControl(input: Document | DocumentBody, filter: ContentControlFilter): ContentControlInfo | undefined;
|
|
82
|
+
/** No control matched the filter. */
|
|
83
|
+
declare class ContentControlNotFoundError extends Error {
|
|
84
|
+
constructor(filter: ContentControlFilter);
|
|
85
|
+
}
|
|
86
|
+
/** The matched control's lock forbids the attempted edit (pass `force` to override). */
|
|
87
|
+
declare class ContentControlLockedError extends Error {
|
|
88
|
+
constructor(lock: SdtProperties['lock'], op: 'edit' | 'remove');
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The control's type doesn't support free text/block replacement (e.g. a
|
|
92
|
+
* dropdown, date, checkbox, or picture control), so writing arbitrary content
|
|
93
|
+
* would desync the type marker from its value. Use a type-specific setter, or
|
|
94
|
+
* pass `{ force: true }` to override.
|
|
95
|
+
*/
|
|
96
|
+
declare class ContentControlTypeError extends Error {
|
|
97
|
+
constructor(sdtType: SdtType);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The control is bound to a Custom XML data store (`w:dataBinding`). Writing its
|
|
101
|
+
* content won't stick — Word re-renders the control from the bound XML node — so
|
|
102
|
+
* the write is refused. Update the data store instead, or pass `{ force: true }`.
|
|
103
|
+
*/
|
|
104
|
+
declare class ContentControlBoundError extends Error {
|
|
105
|
+
constructor();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Replace the content of the first control matching `filter`. `replacement`
|
|
109
|
+
* may be a string (split into paragraphs on newlines) or block content. The
|
|
110
|
+
* control's properties, tag/alias, and lossless raw `w:sdtPr` are preserved —
|
|
111
|
+
* only the contained blocks change, so the result still round-trips.
|
|
112
|
+
*
|
|
113
|
+
* When the control was showing its placeholder (`w:showingPlcHdr`), that flag
|
|
114
|
+
* is cleared so Word doesn't render the new content as placeholder text.
|
|
115
|
+
*
|
|
116
|
+
* Throws {@link ContentControlNotFoundError} if nothing matches,
|
|
117
|
+
* {@link ContentControlLockedError} if the control's lock forbids editing, and
|
|
118
|
+
* {@link ContentControlTypeError} if the control is a typed (dropdown/date/…)
|
|
119
|
+
* control whose value shouldn't be set as free text. Pass `{ force: true }` to
|
|
120
|
+
* override the lock/type guards.
|
|
121
|
+
*/
|
|
122
|
+
declare function setContentControlContent(doc: Document, filter: ContentControlFilter, replacement: string | BlockContent[], options?: {
|
|
123
|
+
force?: boolean;
|
|
124
|
+
}): Document;
|
|
125
|
+
/**
|
|
126
|
+
* Remove the first control matching `filter` from the document. With
|
|
127
|
+
* `keepContent: true` the control's blocks are unwrapped in place (the box
|
|
128
|
+
* goes away, the content stays) — useful for "resolve this conditional
|
|
129
|
+
* section into plain content". Otherwise the whole region is deleted.
|
|
130
|
+
*
|
|
131
|
+
* Unwrapping a repeating-section (item) is refused unless `force`, since
|
|
132
|
+
* lifting its blocks out would orphan the (w15) repeating structure.
|
|
133
|
+
*
|
|
134
|
+
* Throws {@link ContentControlNotFoundError} / {@link ContentControlLockedError}
|
|
135
|
+
* as {@link setContentControlContent} does.
|
|
136
|
+
*/
|
|
137
|
+
declare function removeContentControl(doc: Document, filter: ContentControlFilter, options?: {
|
|
138
|
+
force?: boolean;
|
|
139
|
+
keepContent?: boolean;
|
|
140
|
+
}): Document;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Typed value setters for block-level content controls — set a dropdown
|
|
144
|
+
* selection, toggle a checkbox, or set a date. These produce both the visible
|
|
145
|
+
* content (the run text Word shows) and the structured state inside the
|
|
146
|
+
* captured raw `w:sdtPr` (dropdown `w:lastValue`, `w14:checked`, `w:date`'s
|
|
147
|
+
* `w:fullDate`), patched in place so the rest of the control round-trips
|
|
148
|
+
* verbatim. Use these instead of {@link setContentControlContent} for typed
|
|
149
|
+
* controls, which that function refuses by design.
|
|
150
|
+
*
|
|
151
|
+
* Raw `w:sdtPr` is patched with targeted string edits (not a full re-serialize)
|
|
152
|
+
* to preserve the `CT_SdtPr` element order and any unmodeled properties — the
|
|
153
|
+
* same capture-and-replay contract used everywhere else for SDTs.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/** A typed value to apply to a content control. */
|
|
157
|
+
type ContentControlValue = {
|
|
158
|
+
kind: 'dropdown';
|
|
159
|
+
value: string;
|
|
160
|
+
} | {
|
|
161
|
+
kind: 'checkbox';
|
|
162
|
+
checked: boolean;
|
|
163
|
+
} | {
|
|
164
|
+
kind: 'date';
|
|
165
|
+
date: string;
|
|
166
|
+
};
|
|
167
|
+
/** The control doesn't support the requested value kind, or the value is invalid. */
|
|
168
|
+
declare class ContentControlValueError extends Error {
|
|
169
|
+
constructor(message: string);
|
|
170
|
+
}
|
|
171
|
+
/** Format an ISO date (yyyy-mm-dd) with a subset of OOXML date tokens. */
|
|
172
|
+
declare function formatSdtDate(iso: string, pattern?: string): string;
|
|
173
|
+
/**
|
|
174
|
+
* Set a typed value (dropdown selection / checkbox / date) on the first control
|
|
175
|
+
* matching `filter`, returning a new {@link Document}. Updates both the visible
|
|
176
|
+
* content and the structured raw state, so the result round-trips and Word
|
|
177
|
+
* shows the new value. Throws {@link ContentControlNotFoundError} if nothing
|
|
178
|
+
* matches, {@link ContentControlLockedError} if content-locked,
|
|
179
|
+
* {@link ContentControlBoundError} if data-bound (the store would override the
|
|
180
|
+
* write), and {@link ContentControlValueError} if the value doesn't fit the
|
|
181
|
+
* control type. The lock/bound guards are overridable with `{ force: true }`.
|
|
182
|
+
*/
|
|
183
|
+
declare function setContentControlValue(doc: Document, filter: ContentControlFilter, value: ContentControlValue, options?: {
|
|
184
|
+
force?: boolean;
|
|
185
|
+
}): Document;
|
|
186
|
+
|
|
187
|
+
export { ContentControlBoundError as C, type ContentControlFilter as a, type ContentControlInfo as b, ContentControlLockedError as c, ContentControlNotFoundError as d, ContentControlTypeError as e, type ContentControlValue as f, ContentControlValueError as g, findContentControl as h, findContentControls as i, formatSdtDate as j, getContentControlText as k, setContentControlValue as l, removeContentControl as r, setContentControlContent as s };
|
package/dist/core-plugins.d.mts
CHANGED
|
@@ -30,8 +30,7 @@ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r
|
|
|
30
30
|
import './types/document.mjs';
|
|
31
31
|
import './colors-C3vA7HUU.mjs';
|
|
32
32
|
import './formatting-BH4hcZiq.mjs';
|
|
33
|
-
import './
|
|
34
|
-
import './types/content.mjs';
|
|
33
|
+
import './content-CE-ZdMwG.mjs';
|
|
35
34
|
import './docx/wrapTypes.mjs';
|
|
36
35
|
import './styles-EI2lxeEN.mjs';
|
|
37
36
|
import './types/agentApi.mjs';
|
package/dist/core-plugins.d.ts
CHANGED
|
@@ -30,8 +30,7 @@ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r
|
|
|
30
30
|
import './types/document.js';
|
|
31
31
|
import './colors-C3vA7HUU.js';
|
|
32
32
|
import './formatting-_OXU8gLB.js';
|
|
33
|
-
import './
|
|
34
|
-
import './types/content.js';
|
|
33
|
+
import './content-CYXJ2tfQ.js';
|
|
35
34
|
import './docx/wrapTypes.js';
|
|
36
35
|
import './styles-BBv7doYK.js';
|
|
37
36
|
import './types/agentApi.js';
|
package/dist/core-plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk4QEETB7U_js=require('./chunk-4QEETB7U.js');require('./chunk-U4UCHBZ7.js'),require('./chunk-ESI4BSBF.js');var chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js');require('./chunk-QYF7BRG3.js'),require('./chunk-ROG4MNOR.js'),require('./chunk-44FHVKSI.js'),require('./chunk-MNOHUTKE.js'),require('./chunk-E4JMCA5X.js'),require('./chunk-HQPWFUP5.js'),require('./chunk-DV6GWBUJ.js'),require('./chunk-4Q2IP5FW.js'),require('./chunk-GSKMHXHG.js'),require('./chunk-DC7S76ZX.js');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunk4QEETB7U_js.b}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunk4QEETB7U_js.a}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunk4BFNWPKW_js.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});
|
package/dist/core-plugins.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-
|
|
1
|
+
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-7BVHKWEW.mjs';import'./chunk-ARHPXIBJ.mjs';import'./chunk-CGJ6S3AH.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';import'./chunk-44JKHPGF.mjs';import'./chunk-7ZN4WI5N.mjs';import'./chunk-BOOHU5EW.mjs';import'./chunk-7LRR7RKE.mjs';import'./chunk-6ZXL3EIP.mjs';import'./chunk-OEXVWIHW.mjs';import'./chunk-WLHNIXWC.mjs';import'./chunk-VW22RZ6C.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-QYUPLKLP.mjs';
|
package/dist/core.d.mts
CHANGED
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export { parseDocx } from './docx/parser.mjs';
|
|
21
|
-
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-
|
|
21
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-Bghq9rFI.mjs';
|
|
22
22
|
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.mjs';
|
|
23
23
|
export { a as attemptSelectiveSave } from './selectiveSave-jinP_4xa.mjs';
|
|
24
24
|
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.mjs';
|
|
25
25
|
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, z as ThemeMatrixCell, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, h as createThemeColor, i as darkenColor, A as ensureHexPrefix, B as generateThemeTintShadeMatrix, j as getContrastingColor, l as getTemplateTags, D as getThemeTintShadeHex, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, r as processTemplate, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, E as resolveHighlightToCss, x as resolveShadingColor, y as validateTemplate } from './colorResolver-C6DtsoFI.mjs';
|
|
26
26
|
export { A as AgentContextOptions, D as DocumentAgent, E as ExtendedSelectionContext, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary } from './selectionContext-CoZat7QZ.mjs';
|
|
27
27
|
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.mjs';
|
|
28
|
-
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-
|
|
28
|
+
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-Z7pqeNvZ.mjs';
|
|
29
29
|
export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.mjs';
|
|
30
30
|
export { f as findParagraphByParaId, a as findStartPosForParaId } from './findParagraphByParaId-Maw_8M5D.mjs';
|
|
31
|
-
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-
|
|
31
|
+
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-C7BLz9sJ.mjs';
|
|
32
32
|
import { Document } from './types/document.mjs';
|
|
33
33
|
export { DocxPackage } from './types/document.mjs';
|
|
34
34
|
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, DeleteTextCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, Position, Range, ReplaceTextCommand, SelectionContext, SetVariableCommand, SuggestedAction } from './types/agentApi.mjs';
|
|
@@ -41,13 +41,12 @@ import { ErrorManagerSnapshot, PluginLifecycleSnapshot, PluginLifecycleConfig }
|
|
|
41
41
|
export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinates, EditorHandle, ErrorNotification, ErrorSeverity, SavedDocumentData, TableSelectionSnapshot } from './managers/types.mjs';
|
|
42
42
|
export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.mjs';
|
|
43
43
|
export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.mjs';
|
|
44
|
-
import { Run } from './
|
|
45
|
-
export { BlockContent, BookmarkEnd, BookmarkStart, Comment, CommentRangeEnd, CommentRangeStart, Deletion, DocumentBody, Endnote, Field, FooterReference, Footnote, HeaderFooter, HeaderReference, Hyperlink, Image, Insertion, MoveFrom, MoveTo, Paragraph, ParagraphContent, RunContent, SectionProperties, Shape, Table, TableCell, TableRow, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange } from './
|
|
44
|
+
import { R as Run } from './content-CE-ZdMwG.mjs';
|
|
45
|
+
export { B as BlockContent, z as BookmarkEnd, G as BookmarkStart, C as Comment, a as CommentRangeEnd, b as CommentRangeStart, D as Deletion, c as DocumentBody, E as Endnote, V as Field, Y as FooterReference, F as Footnote, y as HeaderFooter, a0 as HeaderReference, H as Hyperlink, I as Image, d as Insertion, L as ListLevel, M as MoveFrom, e as MoveTo, N as NumberingDefinitions, P as Paragraph, f as ParagraphContent, g as RunContent, S as SectionProperties, aq as Shape, T as Table, h as TableCell, i as TableRow, aB as TextBox, j as TextContent, k as TrackedChangeInfo, l as TrackedRunChange } from './content-CE-ZdMwG.mjs';
|
|
46
46
|
import { EditorView } from 'prosemirror-view';
|
|
47
47
|
export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.mjs';
|
|
48
48
|
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-BH4hcZiq.mjs';
|
|
49
|
-
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, b as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, c as StabilizeFootnoteLayoutResult, d as buildFootnoteContentMap, e as buildFootnoteRenderItems, f as calculateFootnoteReservedHeights, g as collectFootnoteRefs, h as convertHeaderFooterToContent, i as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-
|
|
50
|
-
export { L as ListLevel, N as NumberingDefinitions } from './lists-CvG_iVK3.mjs';
|
|
49
|
+
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, b as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, c as StabilizeFootnoteLayoutResult, d as buildFootnoteContentMap, e as buildFootnoteRenderItems, f as calculateFootnoteReservedHeights, g as collectFootnoteRefs, h as convertHeaderFooterToContent, i as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-CuIJiIzi.mjs';
|
|
51
50
|
export { R as Relationship, S as Style, a as StyleDefinitions, T as Theme, f as ThemeColorScheme, g as ThemeFont, h as ThemeFontScheme } from './styles-EI2lxeEN.mjs';
|
|
52
51
|
import './colors-C3vA7HUU.mjs';
|
|
53
52
|
import './docx/wrapTypes.mjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export { parseDocx } from './docx/parser.js';
|
|
21
|
-
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-
|
|
21
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-C4lFC60P.js';
|
|
22
22
|
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.js';
|
|
23
23
|
export { a as attemptSelectiveSave } from './selectiveSave-CWaPEv0B.js';
|
|
24
24
|
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.js';
|
|
25
25
|
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, z as ThemeMatrixCell, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, h as createThemeColor, i as darkenColor, A as ensureHexPrefix, B as generateThemeTintShadeMatrix, j as getContrastingColor, l as getTemplateTags, D as getThemeTintShadeHex, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, r as processTemplate, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, E as resolveHighlightToCss, x as resolveShadingColor, y as validateTemplate } from './colorResolver-BZ_yScf4.js';
|
|
26
26
|
export { A as AgentContextOptions, D as DocumentAgent, E as ExtendedSelectionContext, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary } from './selectionContext-BPAqgNgk.js';
|
|
27
27
|
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.js';
|
|
28
|
-
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-
|
|
28
|
+
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-Cm02v7PO.js';
|
|
29
29
|
export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.js';
|
|
30
30
|
export { f as findParagraphByParaId, a as findStartPosForParaId } from './findParagraphByParaId-Maw_8M5D.js';
|
|
31
|
-
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-
|
|
31
|
+
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-HPZbJ_gw.js';
|
|
32
32
|
import { Document } from './types/document.js';
|
|
33
33
|
export { DocxPackage } from './types/document.js';
|
|
34
34
|
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, DeleteTextCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, Position, Range, ReplaceTextCommand, SelectionContext, SetVariableCommand, SuggestedAction } from './types/agentApi.js';
|
|
@@ -41,13 +41,12 @@ import { ErrorManagerSnapshot, PluginLifecycleSnapshot, PluginLifecycleConfig }
|
|
|
41
41
|
export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinates, EditorHandle, ErrorNotification, ErrorSeverity, SavedDocumentData, TableSelectionSnapshot } from './managers/types.js';
|
|
42
42
|
export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.js';
|
|
43
43
|
export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.js';
|
|
44
|
-
import { Run } from './
|
|
45
|
-
export { BlockContent, BookmarkEnd, BookmarkStart, Comment, CommentRangeEnd, CommentRangeStart, Deletion, DocumentBody, Endnote, Field, FooterReference, Footnote, HeaderFooter, HeaderReference, Hyperlink, Image, Insertion, MoveFrom, MoveTo, Paragraph, ParagraphContent, RunContent, SectionProperties, Shape, Table, TableCell, TableRow, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange } from './
|
|
44
|
+
import { R as Run } from './content-CYXJ2tfQ.js';
|
|
45
|
+
export { B as BlockContent, z as BookmarkEnd, G as BookmarkStart, C as Comment, a as CommentRangeEnd, b as CommentRangeStart, D as Deletion, c as DocumentBody, E as Endnote, V as Field, Y as FooterReference, F as Footnote, y as HeaderFooter, a0 as HeaderReference, H as Hyperlink, I as Image, d as Insertion, L as ListLevel, M as MoveFrom, e as MoveTo, N as NumberingDefinitions, P as Paragraph, f as ParagraphContent, g as RunContent, S as SectionProperties, aq as Shape, T as Table, h as TableCell, i as TableRow, aB as TextBox, j as TextContent, k as TrackedChangeInfo, l as TrackedRunChange } from './content-CYXJ2tfQ.js';
|
|
46
46
|
import { EditorView } from 'prosemirror-view';
|
|
47
47
|
export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.js';
|
|
48
48
|
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-_OXU8gLB.js';
|
|
49
|
-
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, b as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, c as StabilizeFootnoteLayoutResult, d as buildFootnoteContentMap, e as buildFootnoteRenderItems, f as calculateFootnoteReservedHeights, g as collectFootnoteRefs, h as convertHeaderFooterToContent, i as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-
|
|
50
|
-
export { L as ListLevel, N as NumberingDefinitions } from './lists-UTp_tk7B.js';
|
|
49
|
+
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, b as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, c as StabilizeFootnoteLayoutResult, d as buildFootnoteContentMap, e as buildFootnoteRenderItems, f as calculateFootnoteReservedHeights, g as collectFootnoteRefs, h as convertHeaderFooterToContent, i as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-Bd58Tum3.js';
|
|
51
50
|
export { R as Relationship, S as Style, a as StyleDefinitions, T as Theme, f as ThemeColorScheme, g as ThemeFont, h as ThemeFontScheme } from './styles-BBv7doYK.js';
|
|
52
51
|
import './colors-C3vA7HUU.js';
|
|
53
52
|
import './docx/wrapTypes.js';
|