@betteroffice/docx 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +41 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/agent/index.d.mts +531 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/chunk-34K66SY4.mjs +1 -0
- package/dist/chunk-3UBMCDME.mjs +1 -0
- package/dist/chunk-4RCISPPE.mjs +1 -0
- package/dist/chunk-4UD54UM5.mjs +1 -0
- package/dist/chunk-52GB3Y42.mjs +1 -0
- package/dist/chunk-6NEKRDXF.mjs +1 -0
- package/dist/chunk-6PW4CWUG.mjs +1 -0
- package/dist/chunk-7DEIW7FL.mjs +1 -0
- package/dist/chunk-7PCO5I2O.mjs +1 -0
- package/dist/chunk-BI3B33LI.mjs +1 -0
- package/dist/chunk-BIQWVK5P.mjs +2 -0
- package/dist/chunk-CIRN3LZA.mjs +1 -0
- package/dist/chunk-DXKG3HQ5.mjs +16 -0
- package/dist/chunk-EUUIJVM6.mjs +0 -0
- package/dist/chunk-FPZBTOD6.mjs +1 -0
- package/dist/chunk-FZIA7OFY.mjs +1 -0
- package/dist/chunk-GWKJ2Y4Y.mjs +1 -0
- package/dist/chunk-H3JCIGWK.mjs +1 -0
- package/dist/chunk-HJGAQIU7.mjs +2 -0
- package/dist/chunk-I6KKMUUC.mjs +1 -0
- package/dist/chunk-IL5JZJT7.mjs +1 -0
- package/dist/chunk-JY6ILTNS.mjs +1 -0
- package/dist/chunk-KEE52TT5.mjs +1 -0
- package/dist/chunk-KVKLLTDP.mjs +58 -0
- package/dist/chunk-KXNZFTTK.mjs +1 -0
- package/dist/chunk-L5ISVQ3W.mjs +1 -0
- package/dist/chunk-LDUWIM7M.mjs +1 -0
- package/dist/chunk-N5Q3YN64.mjs +1 -0
- package/dist/chunk-NEWOMDTX.mjs +1 -0
- package/dist/chunk-O2QSE2I7.mjs +1 -0
- package/dist/chunk-OBQGPMPQ.mjs +1 -0
- package/dist/chunk-OJOHXQNQ.mjs +1 -0
- package/dist/chunk-OMR3TWCD.mjs +2 -0
- package/dist/chunk-P3KDV4M2.mjs +1 -0
- package/dist/chunk-Q7PO7V73.mjs +1 -0
- package/dist/chunk-QOUFE3VX.mjs +1 -0
- package/dist/chunk-SINEY6ZF.mjs +1 -0
- package/dist/chunk-T4EZMUXM.mjs +1 -0
- package/dist/chunk-TTRUPDAB.mjs +1 -0
- package/dist/chunk-TYHI7RAD.mjs +1 -0
- package/dist/chunk-UIEJWORW.mjs +1 -0
- package/dist/chunk-VAOUFAUH.mjs +1 -0
- package/dist/chunk-VBOTMRXV.mjs +1 -0
- package/dist/chunk-VCER63GQ.mjs +1 -0
- package/dist/chunk-WAUF2UC7.mjs +2 -0
- package/dist/chunk-WRWRCBLK.mjs +1 -0
- package/dist/chunk-X4XDO3LZ.mjs +1 -0
- package/dist/chunk-XQBCCJBO.mjs +9 -0
- package/dist/chunk-XWUOLYRQ.mjs +2 -0
- package/dist/chunk-XYH6XWP3.mjs +10 -0
- package/dist/chunk-YBIM6UJV.mjs +8 -0
- package/dist/chunk-YCIH2Q3E.mjs +1 -0
- package/dist/chunk-YUOKI2HB.mjs +1 -0
- package/dist/chunk-ZOV5KL7C.mjs +1 -0
- package/dist/colorResolver-n0o7H7ep.d.mts +290 -0
- package/dist/content-sSHuWw49.d.mts +2202 -0
- package/dist/core-plugins.d.mts +37 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +451 -0
- package/dist/core.mjs +1 -0
- package/dist/displayListQueries-p-ijSzdh.d.mts +222 -0
- package/dist/docx/index.d.mts +618 -0
- package/dist/docx/index.mjs +2 -0
- package/dist/docx/parser.d.mts +41 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +148 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +42 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/editor/index.d.mts +170 -0
- package/dist/editor/index.mjs +1 -0
- package/dist/editorTree-DO5PyDK8.d.mts +37 -0
- package/dist/executor-7O2RBJ2B.mjs +1 -0
- package/dist/fontLoader-Bx6DK6-2.d.mts +327 -0
- package/dist/formatting-DoL7KBSL.d.mts +823 -0
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/headerFooterLayout-0zPT64Qc.d.mts +316 -0
- package/dist/headless.d.mts +69 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout/flow/index.d.mts +149 -0
- package/dist/layout/flow/index.mjs +1 -0
- package/dist/layout/index.d.mts +307 -0
- package/dist/layout/index.mjs +1 -0
- package/dist/layout/measure/index.d.mts +324 -0
- package/dist/layout/measure/index.mjs +1 -0
- package/dist/layout/pagination/index.d.mts +60 -0
- package/dist/layout/pagination/index.mjs +1 -0
- package/dist/layout/pagination/types.d.mts +4 -0
- package/dist/layout/pagination/types.mjs +1 -0
- package/dist/layout/render/index.d.mts +733 -0
- package/dist/layout/render/index.mjs +1 -0
- package/dist/loadWasmAsset-CMvnVkfA.d.mts +3 -0
- package/dist/managers/AutoSaveManager.d.mts +81 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +74 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +113 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/mcp-cli.mjs +142 -0
- package/dist/mcp.d.mts +162 -0
- package/dist/mcp.mjs +16 -0
- package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +109 -0
- package/dist/measuredBlock-DZwz8zhD.d.mts +26 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +114 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +7 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +39 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +193 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-HDUIZFJ5.mjs +1 -0
- package/dist/registry-DMM5VTdT.d.mts +165 -0
- package/dist/rustDisplayList-dqunvwxH.d.mts +1036 -0
- package/dist/rustPagination-Bj2hq013.d.mts +106 -0
- package/dist/sectionConfigs-DW3J8q0X.d.mts +55 -0
- package/dist/selectionContext-Buc9BCU1.d.mts +570 -0
- package/dist/selectiveSave-oFBJ1n71.d.mts +16 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/settingsParser-CcGvtmCK.d.mts +33 -0
- package/dist/styles/index.d.mts +162 -0
- package/dist/styles/index.mjs +1 -0
- package/dist/styles-VxNcXLdi.d.mts +189 -0
- package/dist/types/agentApi.d.mts +456 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +3 -0
- package/dist/types/content.mjs +1 -0
- package/dist/types/document.d.mts +117 -0
- package/dist/types/document.mjs +1 -0
- package/dist/types-DNrYr6yQ.d.mts +1754 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/units-O5Y02RKQ.d.mts +34 -0
- package/dist/utils/autoScroll.d.mts +24 -0
- package/dist/utils/autoScroll.mjs +1 -0
- package/dist/utils/cardStyles.d.mts +22 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +120 -0
- package/dist/utils/comments.mjs +4 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +28 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +956 -0
- package/dist/utils/index.mjs +84 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/stylePreview.d.mts +70 -0
- package/dist/utils/stylePreview.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +78 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-Borj29SF.d.mts +115 -0
- package/dist/wasm-FZQ5XB2Y.mjs +1 -0
- package/dist/wasm-SA237OSP.mjs +1 -0
- package/dist/wasm-edit.d.mts +473 -0
- package/dist/wasm-edit.mjs +1 -0
- package/dist/wasm-layout.d.mts +112 -0
- package/dist/wasm-layout.mjs +1 -0
- package/dist/wasm-opc.d.mts +16 -0
- package/dist/wasm-opc.mjs +1 -0
- package/dist/wasm-parse.d.mts +18 -0
- package/dist/wasm-parse.mjs +1 -0
- package/dist/watermarkApi-DCxjutkg.d.mts +38 -0
- package/dist/yrs/index.d.mts +882 -0
- package/dist/yrs/index.mjs +1 -0
- package/dist/yrs/residentEngineWorker.d.mts +2 -0
- package/dist/yrs/residentEngineWorker.mjs +1 -0
- package/package.json +365 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { P as ParagraphFormatting, T as TextFormatting, p as TableLook } from '../formatting-DoL7KBSL.mjs';
|
|
2
|
+
import { a as StyleDefinitions, S as Style, D as DocDefaults } from '../styles-VxNcXLdi.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Style Resolver for ProseMirror Editor
|
|
6
|
+
*
|
|
7
|
+
* Resolves OOXML style definitions to final paragraph and run properties.
|
|
8
|
+
* Handles the cascade:
|
|
9
|
+
* 1. Document defaults (docDefaults)
|
|
10
|
+
* 2. Normal style (if no explicit styleId)
|
|
11
|
+
* 3. Style chain (basedOn inheritance - already resolved by styleParser)
|
|
12
|
+
* 4. Inline properties
|
|
13
|
+
*
|
|
14
|
+
* Based on ECMA-376 style cascade rules.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Resolved style properties ready for rendering
|
|
19
|
+
*/
|
|
20
|
+
interface ResolvedParagraphStyle {
|
|
21
|
+
/** Paragraph formatting (alignment, spacing, indentation, etc.) */
|
|
22
|
+
paragraphFormatting?: ParagraphFormatting;
|
|
23
|
+
/** Default run formatting from the style */
|
|
24
|
+
runFormatting?: TextFormatting;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* StyleResolver provides efficient access to resolved style properties
|
|
28
|
+
*/
|
|
29
|
+
declare class StyleResolver {
|
|
30
|
+
private readonly stylesById;
|
|
31
|
+
private readonly docDefaults;
|
|
32
|
+
private readonly defaultParagraphStyle;
|
|
33
|
+
private readonly defaultTableStyle;
|
|
34
|
+
private readonly defaultCharacterStyle;
|
|
35
|
+
constructor(styleDefinitions: StyleDefinitions | undefined);
|
|
36
|
+
/**
|
|
37
|
+
* Get a style by ID
|
|
38
|
+
*/
|
|
39
|
+
getStyle(styleId: string): Style | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Get all available paragraph styles (for toolbar dropdown)
|
|
42
|
+
*/
|
|
43
|
+
getParagraphStyles(): Style[];
|
|
44
|
+
/**
|
|
45
|
+
* Whether a paragraph style with the given id is defined in the
|
|
46
|
+
* document's `styles.xml`. Used by the agent toolkit to refuse
|
|
47
|
+
* `set_paragraph_style({ styleId: 'NoSuchStyle' })` instead of
|
|
48
|
+
* silently writing an invalid `<w:pStyle>` reference.
|
|
49
|
+
*/
|
|
50
|
+
hasParagraphStyle(styleId: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve paragraph style properties, including docDefaults cascade
|
|
53
|
+
*
|
|
54
|
+
* @param styleId - The style ID to resolve (e.g., 'Heading1', 'Normal')
|
|
55
|
+
* @returns Resolved paragraph and run formatting
|
|
56
|
+
*/
|
|
57
|
+
resolveParagraphStyle(styleId: string | undefined | null): ResolvedParagraphStyle;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the style applied to the paragraph that follows one styled with
|
|
60
|
+
* `styleId` when the user presses Enter (OOXML `w:next`, §17.7.4.10).
|
|
61
|
+
*
|
|
62
|
+
* Returns null when the style has no `w:next`, when `next` points back at
|
|
63
|
+
* the same style (the common heading-stays-heading case is handled by the
|
|
64
|
+
* caller), or when the style is unknown.
|
|
65
|
+
*/
|
|
66
|
+
getNextStyleId(styleId: string | undefined | null): string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Get all available table styles (for style gallery)
|
|
69
|
+
*/
|
|
70
|
+
getTableStyles(): Style[];
|
|
71
|
+
/**
|
|
72
|
+
* Resolve run (character) style properties
|
|
73
|
+
*
|
|
74
|
+
* @param styleId - The character style ID to resolve
|
|
75
|
+
* @returns Resolved text formatting
|
|
76
|
+
*/
|
|
77
|
+
resolveRunStyle(styleId: string | undefined | null): TextFormatting | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Get a character style's own properties WITHOUT docDefaults.
|
|
80
|
+
* Used when the caller already has docDefaults applied (e.g., from paragraph style resolution).
|
|
81
|
+
* This prevents docDefault fonts from incorrectly overriding paragraph style fonts.
|
|
82
|
+
*/
|
|
83
|
+
getRunStyleOwnProperties(styleId: string | undefined | null): TextFormatting | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Get document defaults
|
|
86
|
+
*/
|
|
87
|
+
getDocDefaults(): DocDefaults | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Get default paragraph style (usually "Normal")
|
|
90
|
+
*/
|
|
91
|
+
getDefaultParagraphStyle(): Style | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Get the default table style (the one marked `w:default="1"`).
|
|
94
|
+
*
|
|
95
|
+
* Per ECMA-376 §17.7.4.18, tables that don't specify a `w:tblStyle`
|
|
96
|
+
* inherit from this style. The styleId varies by document language
|
|
97
|
+
* ("Normal Table", "TableNormal", "Tabelanormal", etc.) — find it by
|
|
98
|
+
* the parsed `default` flag, not by name.
|
|
99
|
+
*/
|
|
100
|
+
getDefaultTableStyle(): Style | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Get the default character style (the one marked `w:default="1"`).
|
|
103
|
+
*
|
|
104
|
+
* Per ECMA-376 §17.7.4.18, runs without an explicit `w:rStyle` reference
|
|
105
|
+
* inherit from this style. The styleId varies by document language
|
|
106
|
+
* ("Default Paragraph Font", "FontePadrao", "Fontepargpadro" in
|
|
107
|
+
* Portuguese fixtures, etc.) — find it by the parsed `default` flag.
|
|
108
|
+
*/
|
|
109
|
+
getDefaultCharacterStyle(): Style | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Check if a style exists
|
|
112
|
+
*/
|
|
113
|
+
hasStyle(styleId: string): boolean;
|
|
114
|
+
private findDefaultStyle;
|
|
115
|
+
private mergeStyleIntoResult;
|
|
116
|
+
/**
|
|
117
|
+
* Merge paragraph formatting (source overrides target)
|
|
118
|
+
*/
|
|
119
|
+
private mergeParagraphFormatting;
|
|
120
|
+
private mergeTextFormatting;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Create a style resolver from document's style definitions
|
|
124
|
+
*/
|
|
125
|
+
declare function createStyleResolver(styleDefinitions: StyleDefinitions | undefined): StyleResolver;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Which table style a freshly inserted table should wear.
|
|
129
|
+
*
|
|
130
|
+
* Both insert paths (toolbar and agent) call into here so a new table picks
|
|
131
|
+
* up the document's own table look instead of a bare black grid. The
|
|
132
|
+
* document can express that look two ways, and we trust them in order of
|
|
133
|
+
* specificity: an explicit `w:defaultTableStyle` in settings.xml
|
|
134
|
+
* (§17.15.1.44) wins when it points at a real style; failing that, a table
|
|
135
|
+
* style marked `w:default="1"` (§17.7.4.18) is used — except when that
|
|
136
|
+
* default is only the formatting-free base ("Table Normal"), which every
|
|
137
|
+
* table already inherits and which would add nothing. With neither present
|
|
138
|
+
* the caller keeps its plain-border fallback.
|
|
139
|
+
*
|
|
140
|
+
* We deliberately never guess by probing for the TableGrid builtin: a
|
|
141
|
+
* document may ship that style without meaning it as its insert default,
|
|
142
|
+
* and the two spec elements above are how templates state intent.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* `tblLook` Word applies to a brand-new table (val="04A0"): style the first
|
|
147
|
+
* row and first column, enable horizontal banding, disable vertical banding.
|
|
148
|
+
* Setting this lets a resolved table style paint its header-row and banding
|
|
149
|
+
* conditional formatting on the inserted table, matching how Word renders a
|
|
150
|
+
* fresh table created with that style.
|
|
151
|
+
*/
|
|
152
|
+
declare const DEFAULT_NEW_TABLE_LOOK: TableLook;
|
|
153
|
+
/**
|
|
154
|
+
* StyleId a brand-new table should adopt, or `undefined` when the document
|
|
155
|
+
* declares nothing usable (the caller then keeps its plain-border default).
|
|
156
|
+
*
|
|
157
|
+
* @param settingsStyleId - `w:defaultTableStyle` from settings.xml
|
|
158
|
+
* @param styles - the document's style resolver (null when unavailable)
|
|
159
|
+
*/
|
|
160
|
+
declare function pickTableStyleForInsert(settingsStyleId: string | undefined | null, styles: StyleResolver | null | undefined): string | undefined;
|
|
161
|
+
|
|
162
|
+
export { DEFAULT_NEW_TABLE_LOOK, type ResolvedParagraphStyle, StyleResolver, createStyleResolver, pickTableStyleForInsert };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{d as DEFAULT_NEW_TABLE_LOOK,b as StyleResolver,c as createStyleResolver,e as pickTableStyleForInsert}from'../chunk-KXNZFTTK.mjs';import'../chunk-TTRUPDAB.mjs';
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { T as TextFormatting, P as ParagraphFormatting, o as TableFormatting, s as TableRowFormatting, n as TableCellFormatting } from './formatting-DoL7KBSL.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Styles, Theme, Font Table, Relationships & Media Types
|
|
5
|
+
*
|
|
6
|
+
* Types for document-level definitions that don't form the content tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Style type
|
|
11
|
+
*/
|
|
12
|
+
type StyleType = 'paragraph' | 'character' | 'numbering' | 'table';
|
|
13
|
+
/**
|
|
14
|
+
* Style definition from `styles.xml` — a named, reusable bundle of
|
|
15
|
+
* paragraph and/or character formatting. Word's "Heading 1", "Normal",
|
|
16
|
+
* "Title", and "List Bullet" are styles; user-defined styles look the
|
|
17
|
+
* same. `basedOn` chains styles for inheritance; `link` pairs a paragraph
|
|
18
|
+
* style with a matching character style.
|
|
19
|
+
*
|
|
20
|
+
* See ECMA-376 §17.7.4.
|
|
21
|
+
*/
|
|
22
|
+
interface Style {
|
|
23
|
+
/** Style ID */
|
|
24
|
+
styleId: string;
|
|
25
|
+
/** Style type */
|
|
26
|
+
type: StyleType;
|
|
27
|
+
/** Display name */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** Based on style ID */
|
|
30
|
+
basedOn?: string;
|
|
31
|
+
/** Next style after Enter (for paragraph styles) */
|
|
32
|
+
next?: string;
|
|
33
|
+
/** Linked style (paragraph/character pair) */
|
|
34
|
+
link?: string;
|
|
35
|
+
/** UI sort priority */
|
|
36
|
+
uiPriority?: number;
|
|
37
|
+
/** Hidden from UI */
|
|
38
|
+
hidden?: boolean;
|
|
39
|
+
/** Semi-hidden from UI */
|
|
40
|
+
semiHidden?: boolean;
|
|
41
|
+
/** Unhide when used */
|
|
42
|
+
unhideWhenUsed?: boolean;
|
|
43
|
+
/** Quick format in gallery */
|
|
44
|
+
qFormat?: boolean;
|
|
45
|
+
/** Is default style */
|
|
46
|
+
default?: boolean;
|
|
47
|
+
/** Personal style (custom) */
|
|
48
|
+
personal?: boolean;
|
|
49
|
+
/** Paragraph properties (for paragraph/table styles) */
|
|
50
|
+
pPr?: ParagraphFormatting;
|
|
51
|
+
/** Run properties */
|
|
52
|
+
rPr?: TextFormatting;
|
|
53
|
+
/** Table properties (for table styles) */
|
|
54
|
+
tblPr?: TableFormatting;
|
|
55
|
+
/** Table row properties */
|
|
56
|
+
trPr?: TableRowFormatting;
|
|
57
|
+
/** Table cell properties */
|
|
58
|
+
tcPr?: TableCellFormatting;
|
|
59
|
+
/** Conditional table style parts */
|
|
60
|
+
tblStylePr?: Array<{
|
|
61
|
+
type: 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
|
|
62
|
+
pPr?: ParagraphFormatting;
|
|
63
|
+
rPr?: TextFormatting;
|
|
64
|
+
tblPr?: TableFormatting;
|
|
65
|
+
trPr?: TableRowFormatting;
|
|
66
|
+
tcPr?: TableCellFormatting;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Document defaults (w:docDefaults)
|
|
71
|
+
*/
|
|
72
|
+
interface DocDefaults {
|
|
73
|
+
/** Default run properties */
|
|
74
|
+
rPr?: TextFormatting;
|
|
75
|
+
/** Default paragraph properties */
|
|
76
|
+
pPr?: ParagraphFormatting;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Style definitions from styles.xml
|
|
80
|
+
*/
|
|
81
|
+
interface StyleDefinitions {
|
|
82
|
+
/** Document defaults */
|
|
83
|
+
docDefaults?: DocDefaults;
|
|
84
|
+
/** Latent styles */
|
|
85
|
+
latentStyles?: {
|
|
86
|
+
defLockedState?: boolean;
|
|
87
|
+
defUIPriority?: number;
|
|
88
|
+
defSemiHidden?: boolean;
|
|
89
|
+
defUnhideWhenUsed?: boolean;
|
|
90
|
+
defQFormat?: boolean;
|
|
91
|
+
count?: number;
|
|
92
|
+
};
|
|
93
|
+
/** Style definitions */
|
|
94
|
+
styles: Style[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Font info from fontTable.xml
|
|
99
|
+
*/
|
|
100
|
+
interface FontInfo {
|
|
101
|
+
/** Font name */
|
|
102
|
+
name: string;
|
|
103
|
+
/** Alternate names */
|
|
104
|
+
altName?: string;
|
|
105
|
+
/** Panose-1 classification */
|
|
106
|
+
panose1?: string;
|
|
107
|
+
/** Character set */
|
|
108
|
+
charset?: string;
|
|
109
|
+
/** Font family type */
|
|
110
|
+
family?: 'decorative' | 'modern' | 'roman' | 'script' | 'swiss' | 'auto';
|
|
111
|
+
/** Pitch (fixed or variable) */
|
|
112
|
+
pitch?: 'default' | 'fixed' | 'variable';
|
|
113
|
+
/** Signature */
|
|
114
|
+
sig?: {
|
|
115
|
+
usb0?: string;
|
|
116
|
+
usb1?: string;
|
|
117
|
+
usb2?: string;
|
|
118
|
+
usb3?: string;
|
|
119
|
+
csb0?: string;
|
|
120
|
+
csb1?: string;
|
|
121
|
+
};
|
|
122
|
+
/** Embedded regular face (`w:embedRegular`) */
|
|
123
|
+
embedRegular?: FontEmbed;
|
|
124
|
+
/** Embedded bold face (`w:embedBold`) */
|
|
125
|
+
embedBold?: FontEmbed;
|
|
126
|
+
/** Embedded italic face (`w:embedItalic`) */
|
|
127
|
+
embedItalic?: FontEmbed;
|
|
128
|
+
/** Embedded bold-italic face (`w:embedBoldItalic`) */
|
|
129
|
+
embedBoldItalic?: FontEmbed;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* A single embedded font face referenced from `fontTable.xml`. The font binary
|
|
133
|
+
* lives at the relationship target (an obfuscated `.odttf` under `word/fonts/`)
|
|
134
|
+
* and is descrambled with `fontKey`. See `utils/fontDeobfuscation.ts`.
|
|
135
|
+
*/
|
|
136
|
+
interface FontEmbed {
|
|
137
|
+
/** Relationship ID (`r:id`) resolved via `word/_rels/fontTable.xml.rels`. */
|
|
138
|
+
relId: string;
|
|
139
|
+
/** Obfuscation key GUID (`w:fontKey`), e.g. `{XXXXXXXX-....}`. */
|
|
140
|
+
fontKey?: string;
|
|
141
|
+
/** Whether the embedded face is subsetted (`w:subsetted`). */
|
|
142
|
+
subsetted?: boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Font table from fontTable.xml
|
|
146
|
+
*/
|
|
147
|
+
interface FontTable {
|
|
148
|
+
fonts: FontInfo[];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Relationship type
|
|
152
|
+
*/
|
|
153
|
+
type RelationshipType = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData' | string;
|
|
154
|
+
/**
|
|
155
|
+
* Relationship entry
|
|
156
|
+
*/
|
|
157
|
+
interface Relationship {
|
|
158
|
+
/** Relationship ID (e.g., "rId1") */
|
|
159
|
+
id: string;
|
|
160
|
+
/** Relationship type URI */
|
|
161
|
+
type: RelationshipType;
|
|
162
|
+
/** Target path or URL */
|
|
163
|
+
target: string;
|
|
164
|
+
/** Target mode */
|
|
165
|
+
targetMode?: 'External' | 'Internal';
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Relationship map (keyed by rId)
|
|
169
|
+
*/
|
|
170
|
+
type RelationshipMap = Map<string, Relationship>;
|
|
171
|
+
/**
|
|
172
|
+
* Media file from word/media/
|
|
173
|
+
*/
|
|
174
|
+
interface MediaFile {
|
|
175
|
+
/** File path in ZIP */
|
|
176
|
+
path: string;
|
|
177
|
+
/** Original filename */
|
|
178
|
+
filename?: string;
|
|
179
|
+
/** MIME type */
|
|
180
|
+
mimeType: string;
|
|
181
|
+
/** Binary data */
|
|
182
|
+
data: ArrayBuffer;
|
|
183
|
+
/** Base64 encoded data for rendering */
|
|
184
|
+
base64?: string;
|
|
185
|
+
/** Data URL for direct use in src attributes */
|
|
186
|
+
dataUrl?: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export type { DocDefaults as D, FontTable as F, MediaFile as M, Relationship as R, Style as S, StyleDefinitions as a, RelationshipMap as b, FontEmbed as c, FontInfo as d, RelationshipType as e, StyleType as f };
|