@betteroffice/docx 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/chunk-AEQOEQJ7.mjs +57 -0
- package/dist/chunk-AZ52IWB6.mjs +16 -0
- package/dist/{chunk-SINEY6ZF.mjs → chunk-B4IR6YP4.mjs} +1 -1
- package/dist/chunk-GGEGIQRK.mjs +1 -0
- package/dist/chunk-IFT6DUJX.mjs +1 -0
- package/dist/chunk-J7LNO6SM.mjs +1 -0
- package/dist/{chunk-H3JCIGWK.mjs → chunk-NJHOPXZW.mjs} +1 -1
- package/dist/{chunk-KXNZFTTK.mjs → chunk-WBH3SXI6.mjs} +1 -1
- package/dist/chunk-WON6K4FY.mjs +1 -0
- package/dist/chunk-Y7RUNRU2.mjs +1 -0
- package/dist/collaboration/index.d.mts +65 -0
- package/dist/collaboration/index.mjs +1 -0
- package/dist/{content-sSHuWw49.d.mts → content-MOZ6hKP4.d.mts} +357 -357
- package/dist/core.d.mts +148 -341
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-p-ijSzdh.d.mts → displayListQueries-BJlo7Jkz.d.mts} +24 -6
- package/dist/docx/index.d.mts +40 -520
- package/dist/docx/index.mjs +2 -2
- package/dist/editor/index.d.mts +36 -151
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-Bx6DK6-2.d.mts → fontLoader-aSewHMKF.d.mts} +65 -63
- package/dist/{formatting-DoL7KBSL.d.mts → formatting-D1EPSaJP.d.mts} +1 -1
- package/dist/{rustDisplayList-dqunvwxH.d.mts → frameDelta-D965X8yK.d.mts} +3 -274
- 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/index-Dx4Z3lkz.d.mts +1010 -0
- package/dist/layout/index.d.mts +19 -240
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +10 -58
- package/dist/layout/pagination/index.mjs +1 -1
- package/dist/layout/render/index.d.mts +11 -11
- package/dist/layout/render/index.mjs +1 -1
- package/dist/plugin-api/RenderedDomContext.d.mts +9 -9
- package/dist/plugin-api/index.d.mts +191 -6
- package/dist/plugin-api/resolveItemPositions.d.mts +4 -5
- package/dist/rustDisplayList-BRuZBqdL.d.mts +278 -0
- package/dist/rustMeasureSource-D1KsQvVC.d.mts +106 -0
- package/dist/selectiveSave-CVoajSKE.d.mts +56 -0
- package/dist/styles/index.d.mts +4 -39
- package/dist/styles/index.mjs +1 -1
- package/dist/{styles-VxNcXLdi.d.mts → styles-Dn_o3Vo5.d.mts} +2 -2
- package/dist/types/content.d.mts +2 -2
- package/dist/types/document.d.mts +40 -14
- package/dist/{types-DNrYr6yQ.d.mts → types-BfqUl2h_.d.mts} +3 -71
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/index.d.mts +110 -576
- package/dist/utils/index.mjs +1 -84
- package/dist/utils/stylePreview.d.mts +2 -2
- package/dist/utils/units.d.mts +33 -2
- package/dist/wasm-DO3BUV7C.mjs +1 -0
- package/dist/wasm-NWXX4H5G.mjs +1 -0
- package/dist/wasm-edit.d.mts +14 -5
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.d.mts +10 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/wasm-opc.mjs +1 -1
- package/dist/wasm-parse.mjs +1 -1
- package/dist/yrs/index.d.mts +6 -881
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +16 -139
- package/dist/Subscribable-DOz6Ohoo.d.mts +0 -33
- package/dist/agent/index.d.mts +0 -531
- package/dist/agent/index.mjs +0 -1
- package/dist/chunk-34K66SY4.mjs +0 -1
- package/dist/chunk-4RCISPPE.mjs +0 -1
- package/dist/chunk-52GB3Y42.mjs +0 -1
- package/dist/chunk-6NEKRDXF.mjs +0 -1
- package/dist/chunk-6PW4CWUG.mjs +0 -1
- package/dist/chunk-7DEIW7FL.mjs +0 -1
- package/dist/chunk-7PCO5I2O.mjs +0 -1
- package/dist/chunk-BI3B33LI.mjs +0 -1
- package/dist/chunk-BIQWVK5P.mjs +0 -2
- package/dist/chunk-CIRN3LZA.mjs +0 -1
- package/dist/chunk-DXKG3HQ5.mjs +0 -16
- package/dist/chunk-FPZBTOD6.mjs +0 -1
- package/dist/chunk-FZIA7OFY.mjs +0 -1
- package/dist/chunk-GWKJ2Y4Y.mjs +0 -1
- package/dist/chunk-HJGAQIU7.mjs +0 -2
- package/dist/chunk-I6KKMUUC.mjs +0 -1
- package/dist/chunk-IL5JZJT7.mjs +0 -1
- package/dist/chunk-JY6ILTNS.mjs +0 -1
- package/dist/chunk-KEE52TT5.mjs +0 -1
- package/dist/chunk-KVKLLTDP.mjs +0 -58
- package/dist/chunk-L5ISVQ3W.mjs +0 -1
- package/dist/chunk-LDUWIM7M.mjs +0 -1
- package/dist/chunk-N5Q3YN64.mjs +0 -1
- package/dist/chunk-NEWOMDTX.mjs +0 -1
- package/dist/chunk-O2QSE2I7.mjs +0 -1
- package/dist/chunk-OJOHXQNQ.mjs +0 -1
- package/dist/chunk-OMR3TWCD.mjs +0 -2
- package/dist/chunk-P3KDV4M2.mjs +0 -1
- package/dist/chunk-Q7PO7V73.mjs +0 -1
- package/dist/chunk-QOUFE3VX.mjs +0 -1
- package/dist/chunk-TYHI7RAD.mjs +0 -1
- package/dist/chunk-UIEJWORW.mjs +0 -1
- package/dist/chunk-VAOUFAUH.mjs +0 -1
- package/dist/chunk-VBOTMRXV.mjs +0 -1
- package/dist/chunk-VCER63GQ.mjs +0 -1
- package/dist/chunk-WAUF2UC7.mjs +0 -2
- package/dist/chunk-X4XDO3LZ.mjs +0 -1
- package/dist/chunk-XQBCCJBO.mjs +0 -9
- package/dist/chunk-XWUOLYRQ.mjs +0 -2
- package/dist/chunk-XYH6XWP3.mjs +0 -10
- package/dist/chunk-YBIM6UJV.mjs +0 -8
- package/dist/chunk-YCIH2Q3E.mjs +0 -1
- package/dist/chunk-ZOV5KL7C.mjs +0 -1
- package/dist/colorResolver-n0o7H7ep.d.mts +0 -290
- package/dist/core-plugins.d.mts +0 -37
- package/dist/core-plugins.mjs +0 -1
- package/dist/docx/parser.d.mts +0 -41
- package/dist/docx/parser.mjs +0 -1
- package/dist/docx/rezip.d.mts +0 -148
- package/dist/docx/rezip.mjs +0 -1
- package/dist/docx/serializer/index.d.mts +0 -42
- package/dist/docx/serializer/index.mjs +0 -1
- package/dist/editorTree-DO5PyDK8.d.mts +0 -37
- package/dist/executor-7O2RBJ2B.mjs +0 -1
- package/dist/headerFooterLayout-0zPT64Qc.d.mts +0 -316
- package/dist/headless.d.mts +0 -69
- package/dist/headless.mjs +0 -1
- package/dist/layout/flow/index.d.mts +0 -149
- package/dist/layout/flow/index.mjs +0 -1
- package/dist/layout/measure/index.d.mts +0 -324
- package/dist/layout/measure/index.mjs +0 -1
- package/dist/layout/pagination/types.d.mts +0 -4
- package/dist/layout/pagination/types.mjs +0 -1
- package/dist/managers/AutoSaveManager.d.mts +0 -81
- package/dist/managers/AutoSaveManager.mjs +0 -1
- package/dist/managers/TableSelectionManager.d.mts +0 -74
- package/dist/managers/TableSelectionManager.mjs +0 -1
- package/dist/managers/types.d.mts +0 -113
- package/dist/managers/types.mjs +0 -0
- package/dist/mcp-cli.mjs +0 -142
- package/dist/mcp.d.mts +0 -162
- package/dist/mcp.mjs +0 -16
- package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +0 -109
- package/dist/measuredBlock-DZwz8zhD.d.mts +0 -26
- package/dist/plugin-api/types.d.mts +0 -193
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-HDUIZFJ5.mjs +0 -1
- package/dist/registry-DMM5VTdT.d.mts +0 -165
- package/dist/rustPagination-Bj2hq013.d.mts +0 -106
- package/dist/sectionConfigs-DW3J8q0X.d.mts +0 -55
- package/dist/selectionContext-Buc9BCU1.d.mts +0 -570
- package/dist/selectiveSave-oFBJ1n71.d.mts +0 -16
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +0 -23
- package/dist/settingsParser-CcGvtmCK.d.mts +0 -33
- package/dist/types/agentApi.d.mts +0 -456
- package/dist/types/agentApi.mjs +0 -1
- package/dist/types-dYdjUZMo.d.mts +0 -311
- package/dist/units-O5Y02RKQ.d.mts +0 -34
- package/dist/utils/headingCollector.d.mts +0 -28
- package/dist/utils/headingCollector.mjs +0 -1
- package/dist/utils/highlightColors.d.mts +0 -14
- package/dist/utils/highlightColors.mjs +0 -1
- package/dist/utils/textSelection.d.mts +0 -92
- package/dist/utils/textSelection.mjs +0 -1
- package/dist/variableDetector-Borj29SF.d.mts +0 -115
- package/dist/wasm-FZQ5XB2Y.mjs +0 -1
- package/dist/wasm-SA237OSP.mjs +0 -1
- package/dist/watermarkApi-DCxjutkg.d.mts +0 -38
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { M as MeasureBlockFn } from '../../measureBlocksPipeline-Df0Bbrwy.mjs';
|
|
2
|
-
export { F as FloatPageGeometry, a as FloatingExclusionRect, b as FloatingImageZone, c as FloatingLineSegmentZone, d as clampFloatingWrapMargins, g as getFloatingMargins, m as measureBlocksWithFloats, r as rectsToFloatingZones } from '../../measureBlocksPipeline-Df0Bbrwy.mjs';
|
|
3
|
-
import { C as CompatibilityFlags } from '../../settingsParser-CcGvtmCK.mjs';
|
|
4
|
-
import { e as LayoutBlock, a1 as ParagraphBlock } from '../../types-DNrYr6yQ.mjs';
|
|
5
|
-
import '../../content-sSHuWw49.mjs';
|
|
6
|
-
import '../../formatting-DoL7KBSL.mjs';
|
|
7
|
-
import '../../docx/wrapTypes.mjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Script bucket a fallback face provides glyph coverage for. Han text is
|
|
11
|
-
* region-resolved by the caller (SC/TC/JP/KR — see `rustMeasureSource.ts`);
|
|
12
|
-
* kana, Hangul, Arabic and Hebrew detect directly.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
type FontScript = 'cjk-sc' | 'cjk-tc' | 'cjk-jp' | 'cjk-kr' | 'arabic' | 'hebrew';
|
|
17
|
-
/**
|
|
18
|
-
* Resolver for the bundled metric-compatible set (Carlito↔Calibri,
|
|
19
|
-
* Liberation↔Arial/Times/Courier, …). Returns a lazy byte loader so the
|
|
20
|
-
* (lazily fetched, same-origin) binary is only downloaded when a document
|
|
21
|
-
* actually needs the face, or `undefined` when the family has no bundled
|
|
22
|
-
* substitute.
|
|
23
|
-
*
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
interface BundledFontProvider {
|
|
27
|
-
/** Resolve a Word family to bundled metric-compatible face byte loaders, or undefined. */
|
|
28
|
-
resolve(family: string, bold: boolean, italic: boolean): (() => Promise<ArrayBuffer>) | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Optional per-script coverage fallback (Noto CJK/RTL faces). Same loader
|
|
31
|
-
* contract as {@link BundledFontProvider.resolve}; providers without
|
|
32
|
-
* script faces simply omit the method. These faces are coverage fallbacks
|
|
33
|
-
* first, metric approximations second — CJK metric compatibility is much
|
|
34
|
-
* weaker than the Carlito/Calibri class of substitutes.
|
|
35
|
-
*/
|
|
36
|
-
resolveScriptFallback?(script: FontScript, bold: boolean, italic: boolean): (() => Promise<ArrayBuffer>) | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* The always-available last-resort base face (broad-coverage Latin —
|
|
39
|
-
* Liberation Sans/Serif per serif-ness). Unlike {@link
|
|
40
|
-
* BundledFontProvider.resolve}, a conforming provider (e.g.
|
|
41
|
-
* `@betteroffice/docx-fonts`'s `resolveLastResortFace`) returns a loader for
|
|
42
|
-
* EVERY family, so the chain this registry builds is guaranteed non-empty
|
|
43
|
-
* and a run never routes to the browser measurer for want of font bytes. The
|
|
44
|
-
* face's metrics are the base font's, not the requested family's — the
|
|
45
|
-
* accepted divergence for a truly-unknown font, in exchange for staying on
|
|
46
|
-
* the native measurement path.
|
|
47
|
-
*
|
|
48
|
-
* Optional so mock/partial providers can omit it; when absent (or returning
|
|
49
|
-
* undefined) an unmapped family still yields an empty chain and the caller
|
|
50
|
-
* browser-falls-back that run — the pre-policy behavior. Same lazy loader
|
|
51
|
-
* contract as {@link BundledFontProvider.resolve}.
|
|
52
|
-
*/
|
|
53
|
-
resolveLastResort?(family: string, bold: boolean, italic: boolean): (() => Promise<ArrayBuffer>) | undefined;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* One embedded face extracted from the open document. Structurally identical
|
|
57
|
-
* to `EmbeddedFontFace` (`utils/embeddedFonts.ts`), so the output of
|
|
58
|
-
* `getEmbeddedFontFaces` feeds straight in; duplicated here so this module
|
|
59
|
-
* stays decoupled from the loader.
|
|
60
|
-
*
|
|
61
|
-
* @public
|
|
62
|
-
*/
|
|
63
|
-
interface EmbeddedFaceInput {
|
|
64
|
-
/** Word font name the face is registered under (attacker-controlled). */
|
|
65
|
-
family: string;
|
|
66
|
-
/** `'bold'` for the embedBold/embedBoldItalic slots, else `'normal'`. */
|
|
67
|
-
weight: 'normal' | 'bold';
|
|
68
|
-
/** `'italic'` for the embedItalic/embedBoldItalic slots, else `'normal'`. */
|
|
69
|
-
style: 'normal' | 'italic';
|
|
70
|
-
/** De-obfuscated OpenType/TrueType bytes. */
|
|
71
|
-
data: ArrayBuffer;
|
|
72
|
-
/** Whether the source face was subsetted (`w:subsetted`). */
|
|
73
|
-
subsetted: boolean;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The Rust measurement source — the SOLE text/layout measurement path. Every
|
|
78
|
-
* block kind is measured here: paragraphs through the wasm `docx-text` engine
|
|
79
|
-
* (Word metrics), tables/text boxes/shapes by pure recursion through the same
|
|
80
|
-
* measurer, and image/chart/break extents synthesized from declared
|
|
81
|
-
* dimensions. There is no browser `measureText` anywhere in layout.
|
|
82
|
-
*
|
|
83
|
-
* Division of labor:
|
|
84
|
-
* - {@link TextMeasureFontRegistry} (owned here) turns Word font requests
|
|
85
|
-
* into ordered engine font-id chains from embedded + bundled bytes, and
|
|
86
|
-
* resolves the shared per-script coverage fallbacks (CJK/RTL Noto faces).
|
|
87
|
-
* Resolution is deterministic: embedded faces → bundled metric-compatible
|
|
88
|
-
* face → always-available last-resort base face; never OS/local fonts.
|
|
89
|
-
* - {@link RustMeasureSource.prepareFonts} is the ONLY async step: it warms
|
|
90
|
-
* the registry for every (family, bold, italic) combo a block list uses,
|
|
91
|
-
* plus the script fallbacks for every script detected in the blocks'
|
|
92
|
-
* text — and for every request an earlier measure pass found unresolved
|
|
93
|
-
* (header/footer and footnote paragraphs reach measurement without
|
|
94
|
-
* passing through the adapters' block notifications; recording their
|
|
95
|
-
* misses here closes that gap). Call sites re-layout after it resolves.
|
|
96
|
-
* - {@link RustMeasureSource.createMeasureBlock} builds the sync
|
|
97
|
-
* `MeasureBlockFn` the float pipeline consumes. Paragraph blocks whose
|
|
98
|
-
* font chains are cached go to the engine — float-zoned blocks included,
|
|
99
|
-
* with the zones and cumulative Y passed through in the envelope.
|
|
100
|
-
*
|
|
101
|
-
* READINESS GATE (how measurement never races an unloaded face): a paragraph
|
|
102
|
-
* whose font chain (or script fallback) has not settled yet measures as a
|
|
103
|
-
* deterministic SYNTHETIC extent and records the miss;
|
|
104
|
-
* {@link RustMeasureSource.hasPendingFonts} then reports true, the adapter
|
|
105
|
-
* discards that provisional pass instead of committing it, and re-runs the
|
|
106
|
-
* pipeline when `prepareFonts` settles. Once settled, `font-unready` can
|
|
107
|
-
* never recur for those chains (the sync registry view is populated), so
|
|
108
|
-
* committed layouts are always measured against real, loaded font bytes.
|
|
109
|
-
*
|
|
110
|
-
* SELF-SUFFICIENT FONTS: every family chain the registry builds terminates in
|
|
111
|
-
* an always-available last-resort base face (broad-coverage Liberation
|
|
112
|
-
* Sans/Serif per serif-ness, supplied by the bundled provider's
|
|
113
|
-
* `resolveLastResort`), and the per-script Noto fallback is appended whenever
|
|
114
|
-
* a covered script is detected. A run whose family has no embedded/bundled
|
|
115
|
-
* match — or a character outside the family chain's coverage — still has real
|
|
116
|
-
* font bytes to measure with; the engine substitutes the terminal face's
|
|
117
|
-
* `.notdef` for genuinely uncovered characters. For a truly-unknown font the
|
|
118
|
-
* measured metrics are the base font's, not the requested family's — the
|
|
119
|
-
* accepted, deterministic substitution tradeoff.
|
|
120
|
-
*
|
|
121
|
-
* SYNTHETIC extents (deterministic pure arithmetic, no font tables, no
|
|
122
|
-
* platform state) stand in for exactly two residual cases: (a) an engine
|
|
123
|
-
* refusal — degenerate/attacker-crafted input tripping the security clamps,
|
|
124
|
-
* or a malformed payload; (b) a chain that SETTLED EMPTY, which can only
|
|
125
|
-
* happen when the host injects no bundled provider (`resolveLastResort`
|
|
126
|
-
* guarantees non-empty chains otherwise) and the document embeds nothing for
|
|
127
|
-
* the family. Both are counted in {@link RustMeasureStats}.
|
|
128
|
-
*
|
|
129
|
-
* Script fallbacks: runs are scanned for Unicode script ranges — kana → JP,
|
|
130
|
-
* Hangul → KR, Arabic → arabic, Hebrew → hebrew — and Han is region-resolved:
|
|
131
|
-
* kana in the same block wins (Japanese text), else the document's
|
|
132
|
-
* `w:themeFontLang` eastAsia hint ({@link RustMeasureSource.setScriptHints}),
|
|
133
|
-
* else Hangul in the block (hanja), else SC. The resolved script ids are
|
|
134
|
-
* appended AFTER the family faces of every chain the block uses, so the
|
|
135
|
-
* family face keeps supplying metrics/Latin glyphs and the script face only
|
|
136
|
-
* covers what the family face cannot. RTL text measures natively (the engine
|
|
137
|
-
* splits UBA level runs before shaping).
|
|
138
|
-
*
|
|
139
|
-
* @packageDocumentation
|
|
140
|
-
* @public
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Font styling properties for a short-text measurement request (the
|
|
145
|
-
* `measureTextWidthWithActiveRustSource` latch and tab-leader glyph
|
|
146
|
-
* sizing).
|
|
147
|
-
*
|
|
148
|
-
* @public
|
|
149
|
-
*/
|
|
150
|
-
interface FontStyle {
|
|
151
|
-
fontFamily?: string;
|
|
152
|
-
/** In points. */
|
|
153
|
-
fontSize?: number;
|
|
154
|
-
bold?: boolean;
|
|
155
|
-
italic?: boolean;
|
|
156
|
-
/** In pixels. */
|
|
157
|
-
letterSpacing?: number;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Thin sync facade over the wasm measure exports (`register_measure_font`,
|
|
161
|
-
* `clear_measure_fonts`, `measure_paragraph_json`). Injectable so unit tests
|
|
162
|
-
* can script responses without loading wasm.
|
|
163
|
-
*
|
|
164
|
-
* @public
|
|
165
|
-
*/
|
|
166
|
-
interface RustTextEngine {
|
|
167
|
-
/** Register raw sfnt bytes; returns the engine font id. Throws on bad bytes. */
|
|
168
|
-
registerFont(bytes: Uint8Array): number;
|
|
169
|
-
/** Drop every registered font (ids restart at 0). */
|
|
170
|
-
clearFonts(): void;
|
|
171
|
-
/**
|
|
172
|
-
* Measurement input JSON in, `ParagraphExtent` JSON out. Throws with a
|
|
173
|
-
* message starting `UNSUPPORTED:` for blocks the engine cannot measure.
|
|
174
|
-
*/
|
|
175
|
-
measureParagraphJson(input: string): string;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Lazily load the embedded wasm module and expose its measure surface as a
|
|
179
|
-
* {@link RustTextEngine}. The dynamic `import()` keeps the ~800KB base64
|
|
180
|
-
* module out of the default bundle — only callers that actually enable Rust
|
|
181
|
-
* measurement pay for it (same pattern as the display-list builder's
|
|
182
|
-
* `loadEngine`).
|
|
183
|
-
*
|
|
184
|
-
* @public
|
|
185
|
-
*/
|
|
186
|
-
declare function getRustTextEngine(): Promise<RustTextEngine>;
|
|
187
|
-
/** Counters for the debug log line (rust vs synthetic per layout pass). */
|
|
188
|
-
interface RustMeasureStats {
|
|
189
|
-
/** Paragraph blocks measured by the Rust engine (including memo hits). */
|
|
190
|
-
rustMeasured: number;
|
|
191
|
-
/** Paragraphs that measured as a synthetic extent — sum of the reasons below. */
|
|
192
|
-
syntheticFallback: number;
|
|
193
|
-
/**
|
|
194
|
-
* Synthetic extents caused by a font chain (or script fallback) not having
|
|
195
|
-
* resolved yet. Transient by construction: the miss is recorded, the
|
|
196
|
-
* adapter discards the pass (`hasPendingFonts`), and the fonts-settled
|
|
197
|
-
* re-layout measures natively — so no COMMITTED layout ever contains one,
|
|
198
|
-
* and this MUST hold constant once `prepareFonts` settles.
|
|
199
|
-
*/
|
|
200
|
-
syntheticFontUnready: number;
|
|
201
|
-
/**
|
|
202
|
-
* Synthetic extents caused by an engine glyph-coverage refusal. Dormant —
|
|
203
|
-
* chains terminate in a last-resort face whose `.notdef` the shaper
|
|
204
|
-
* substitutes — but kept so a coverage regression is categorized rather
|
|
205
|
-
* than lumped in with `non-font` refusals.
|
|
206
|
-
*/
|
|
207
|
-
syntheticUncovered: number;
|
|
208
|
-
/**
|
|
209
|
-
* Synthetic-extent counts by `LayoutBlock.kind`. The audit counter proving
|
|
210
|
-
* text-bearing block kinds (`paragraph`, `table`, `textBox`) measure
|
|
211
|
-
* natively once fonts are ready.
|
|
212
|
-
*/
|
|
213
|
-
syntheticBlockKinds: Record<string, number>;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* The selectable measurement source. Create with
|
|
217
|
-
* {@link createRustMeasureSource}; see the module doc for the contract.
|
|
218
|
-
*
|
|
219
|
-
* @public
|
|
220
|
-
*/
|
|
221
|
-
interface RustMeasureSource {
|
|
222
|
-
/** Feed the open document's embedded faces (invalidates the measure memo). */
|
|
223
|
-
setEmbeddedFaces(faces: EmbeddedFaceInput[]): void;
|
|
224
|
-
/**
|
|
225
|
-
* Thread the document's compat flags (`w:compat`) into every subsequent
|
|
226
|
-
* engine call. Pass `undefined` to reset to all-off defaults. The memo key
|
|
227
|
-
* includes the flags, so switching documents cannot serve stale extents.
|
|
228
|
-
*/
|
|
229
|
-
setCompat(flags: CompatibilityFlags | undefined): void;
|
|
230
|
-
/**
|
|
231
|
-
* Thread document-level script hints into Han region resolution: pass the
|
|
232
|
-
* `w:themeFontLang` eastAsia tag (`settingsParser` → `themeFontLang`).
|
|
233
|
-
* Without a hint (or with a non-East-Asian tag) Han-only text defaults to
|
|
234
|
-
* Simplified Chinese. Invalidates the measure memo — region choice changes
|
|
235
|
-
* the fallback face and therefore the measured extents.
|
|
236
|
-
*/
|
|
237
|
-
setScriptHints(hints: {
|
|
238
|
-
eastAsia?: string;
|
|
239
|
-
} | undefined): void;
|
|
240
|
-
/**
|
|
241
|
-
* Warm the font registry for every (family, bold, italic) combo — plus the
|
|
242
|
-
* per-family regulars and the per-script coverage fallbacks — that
|
|
243
|
-
* `blocks`' paragraphs use, AND for every request an earlier measure pass
|
|
244
|
-
* recorded as unresolved (header/footer and footnote paragraphs reach the
|
|
245
|
-
* measurer without appearing in the adapters' block lists). The only async
|
|
246
|
-
* step; per-face failures are tolerated (the chain settles without that
|
|
247
|
-
* face). Resolves `true` when at least one previously-unsettled chain or
|
|
248
|
-
* script fallback settled — even settled-empty — i.e. a re-layout would
|
|
249
|
-
* measure differently (or the deferred pass can now proceed).
|
|
250
|
-
*/
|
|
251
|
-
prepareFonts(blocks: LayoutBlock[]): Promise<boolean>;
|
|
252
|
-
/**
|
|
253
|
-
* True while a font chain (or script fallback) some measured paragraph
|
|
254
|
-
* needed is still unresolved. The adapter's readiness gate: a pass measured
|
|
255
|
-
* with pending fonts is provisional (those paragraphs carry synthetic
|
|
256
|
-
* extents) and must be discarded, not committed; `prepareFonts` settles the
|
|
257
|
-
* pending set and the fonts-ready re-layout measures natively. Self-clears
|
|
258
|
-
* once every recorded request has settled.
|
|
259
|
-
*/
|
|
260
|
-
hasPendingFonts(): boolean;
|
|
261
|
-
/**
|
|
262
|
-
* The sync measure function for the float pipeline — the sole measurement
|
|
263
|
-
* path, exhaustive over every `LayoutBlock` kind. Paragraph blocks whose
|
|
264
|
-
* chains (and detected script fallbacks) are cached go to the engine —
|
|
265
|
-
* float-zoned blocks pass their zones and cumulative Y through in the
|
|
266
|
-
* envelope (measured fresh, never memoized). Tables, text boxes and shapes
|
|
267
|
-
* recurse through the same measurer; images/charts/breaks synthesize
|
|
268
|
-
* extents from declared dimensions. Unresolved chains and engine refusals
|
|
269
|
-
* produce deterministic synthetic extents (see the module doc).
|
|
270
|
-
*/
|
|
271
|
-
createMeasureBlock(): MeasureBlockFn;
|
|
272
|
-
/**
|
|
273
|
-
* The merged, doc-wide font-id chain map for `blocks` — every
|
|
274
|
-
* `"<family lowercase>|<bold 0|1>|<italic 0|1>"` combo the blocks' paragraphs
|
|
275
|
-
* use, mapped to its cached engine font-id chain (with the per-block script
|
|
276
|
-
* fallbacks appended after the family faces, exactly as
|
|
277
|
-
* {@link RustMeasureSource.createMeasureBlock} assembles them). Only chains that
|
|
278
|
-
* are already resolved (non-empty in the sync registry cache) are included; a
|
|
279
|
-
* combo whose chain has not settled yet is simply omitted (its runs stay on
|
|
280
|
-
* the char-distributed draw path until `prepareFonts` settles and a
|
|
281
|
-
* re-layout retries). Returns an empty object when nothing is resolved.
|
|
282
|
-
*
|
|
283
|
-
* This is the map the canvas display-list builder consumes to gate GlyphRun
|
|
284
|
-
* emission: the ids reference the same measurement `FontStore` the engine
|
|
285
|
-
* registered, so the outline provider can rasterize them.
|
|
286
|
-
*/
|
|
287
|
-
getDocumentFontChains(blocks: LayoutBlock[]): Record<string, number[]>;
|
|
288
|
-
/** Drop every cached chain, registration, and memoized measure. */
|
|
289
|
-
clear(): void;
|
|
290
|
-
/** Snapshot of the rust-vs-fallback counters (never reset implicitly). */
|
|
291
|
-
getStats(): RustMeasureStats;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Build a {@link RustMeasureSource} over a loaded engine. The source owns a
|
|
295
|
-
* {@link TextMeasureFontRegistry} whose sink is `engine.registerFont`;
|
|
296
|
-
* `bundled` is the optional metric-compatible font provider (injected — core
|
|
297
|
-
* never imports a fonts package).
|
|
298
|
-
*
|
|
299
|
-
* @public
|
|
300
|
-
*/
|
|
301
|
-
declare function createRustMeasureSource(opts: {
|
|
302
|
-
engine: RustTextEngine;
|
|
303
|
-
bundled?: BundledFontProvider;
|
|
304
|
-
}): RustMeasureSource;
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Stable identity hash for a paragraph block, used as the Rust measure
|
|
308
|
-
* memo's key so blocks that would lay out identically share one measurement.
|
|
309
|
-
* Every field that can change the rendered result contributes a labelled
|
|
310
|
-
* token; the assembled token list is serialized as JSON so no separator
|
|
311
|
-
* character can leak in from content.
|
|
312
|
-
*
|
|
313
|
-
* @packageDocumentation
|
|
314
|
-
* @public
|
|
315
|
-
*/
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Build the stable identity string for a paragraph block.
|
|
319
|
-
*
|
|
320
|
-
* @public
|
|
321
|
-
*/
|
|
322
|
-
declare function hashParagraphBlock(block: ParagraphBlock): string;
|
|
323
|
-
|
|
324
|
-
export { type BundledFontProvider, type EmbeddedFaceInput, type FontScript, type FontStyle, MeasureBlockFn, type RustMeasureSource, type RustMeasureStats, type RustTextEngine, createRustMeasureSource, getRustTextEngine, hashParagraphBlock };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{h as createRustMeasureSource,e as getRustTextEngine,d as hashParagraphBlock,c as measureBlocksWithFloats}from'../../chunk-7DEIW7FL.mjs';export{g as clampFloatingWrapMargins,i as getFloatingMargins,h as rectsToFloatingZones}from'../../chunk-52GB3Y42.mjs';import'../../chunk-7PCO5I2O.mjs';import'../../chunk-X4XDO3LZ.mjs';import'../../chunk-OBQGPMPQ.mjs';import'../../chunk-3UBMCDME.mjs';import'../../chunk-TTRUPDAB.mjs';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { A as AnchoredObjectPositionInput, B as BlockExtent, f as BlockId, j as BorderStyle, k as CellBorderSpec, l as CellBorders, m as ChartBlock, n as ChartExtent, o as ChartFragment, p as ColumnBreakBlock, q as ColumnBreakExtent, C as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, r as DEFAULT_TEXTBOX_WIDTH, s as DocumentPosition, t as FieldRun, u as FloatingTablePosition, F as FootnoteContent, h as FootnoteRenderItem, v as Fragment, w as FragmentBase, H as HeaderFooterContent, x as HeaderFooterContentHeights, y as HeaderFooterLayout, z as HitTestResult, E as HyperlinkInfo, G as ImageBlock, J as ImageExtent, K as ImageFragment, I as ImageRun, M as ImageRunPosition, O as InlineSdtWidget, a as Layout, e as LayoutBlock, L as LayoutOptions, R as LineBreakRun, U as ListNumPr, V as NoteAreaContract, X as NoteLayoutItem, N as NoteSettingsContract, g as Page, d as PageBorderContract, Y as PageBreakBlock, Z as PageBreakExtent, i as PageGeometry, b as PageHeaderFooterRefs, P as PageMargins, c as PageNumberingContract, a0 as ParagraphAttrs, a1 as ParagraphBlock, a2 as ParagraphBorders, a3 as ParagraphExtent, a4 as ParagraphFragment, a5 as ParagraphIndent, a6 as ParagraphSpacing, a7 as ResolvedLine, a8 as ResolvedSegment, a9 as Run, aa as RunFontSlots, ab as RunFormatting, ac as RunLanguageSlots, ad as SdtGroup, S as SectionBreakBlock, ae as SectionBreakExtent, af as ShapeBlock, ag as ShapeBlockFill, ah as ShapeBlockStroke, ai as ShapeBlockTransform, aj as ShapeExtent, ak as ShapeFragment, al as TabAlignment, am as TabRun, an as TabStop, ao as TableBlock, ap as TableCell, aq as TableCellExtent, ar as TableExtent, as as TableFragment, at as TableRow, au as TableRowExtent, T as TextBoxBlock, av as TextBoxExtent, aw as TextBoxFragment, ax as TextRun, ay as TypesetBidiSlice, az as TypesetClusterAdvance, aA as TypesetRow, aB as TypesetRowSegment, aC as TypesetRunAdvance, W as WrapTextDirection, aD as assertExhaustiveLayoutBlock, aE as isTextWrappingFloatingImageRun, aF as pageGeometryFromPage, aG as resolveAnchoredObjectVerticalTop } from '../../types-DNrYr6yQ.mjs';
|
|
2
|
-
import '../../content-sSHuWw49.mjs';
|
|
3
|
-
import '../../formatting-DoL7KBSL.mjs';
|
|
4
|
-
import '../../docx/wrapTypes.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as DEFAULT_TEXTBOX_MARGINS,b as DEFAULT_TEXTBOX_WIDTH,c as assertExhaustiveLayoutBlock,f as isTextWrappingFloatingImageRun,d as pageGeometryFromPage,e as resolveAnchoredObjectVerticalTop}from'../../chunk-X4XDO3LZ.mjs';import'../../chunk-OBQGPMPQ.mjs';import'../../chunk-3UBMCDME.mjs';import'../../chunk-TTRUPDAB.mjs';
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { S as Subscribable } from '../Subscribable-DOz6Ohoo.mjs';
|
|
2
|
-
import { AutoSaveSnapshot, AutoSaveManagerOptions, SavedDocumentData, AutoSaveStatus } from './types.mjs';
|
|
3
|
-
import { Document } from '../types/document.mjs';
|
|
4
|
-
import '../content-sSHuWw49.mjs';
|
|
5
|
-
import '../formatting-DoL7KBSL.mjs';
|
|
6
|
-
import '../docx/wrapTypes.mjs';
|
|
7
|
-
import '../styles-VxNcXLdi.mjs';
|
|
8
|
-
import '../settingsParser-CcGvtmCK.mjs';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* AutoSaveManager
|
|
12
|
-
*
|
|
13
|
-
* Framework-agnostic class for auto-saving documents to localStorage.
|
|
14
|
-
* Extracted from the React `useAutoSave` hook.
|
|
15
|
-
*
|
|
16
|
-
* Usage with React:
|
|
17
|
-
* ```ts
|
|
18
|
-
* const snapshot = useSyncExternalStore(manager.subscribe, manager.getSnapshot);
|
|
19
|
-
* ```
|
|
20
|
-
* @packageDocumentation
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
declare class AutoSaveManager extends Subscribable<AutoSaveSnapshot> {
|
|
25
|
-
private storageKey;
|
|
26
|
-
private interval;
|
|
27
|
-
private maxAge;
|
|
28
|
-
private saveOnChange;
|
|
29
|
-
private debounceDelay;
|
|
30
|
-
private onSaveCallback?;
|
|
31
|
-
private onErrorCallback?;
|
|
32
|
-
private onRecoveryAvailableCallback?;
|
|
33
|
-
private storageAvailable;
|
|
34
|
-
private currentDocument;
|
|
35
|
-
private lastSavedJson;
|
|
36
|
-
private intervalTimer;
|
|
37
|
-
private debounceTimer;
|
|
38
|
-
private status;
|
|
39
|
-
private lastSaveTime;
|
|
40
|
-
private _hasRecoveryData;
|
|
41
|
-
private _isEnabled;
|
|
42
|
-
constructor(options?: AutoSaveManagerOptions);
|
|
43
|
-
/** Update the current document. Triggers debounced save if enabled. */
|
|
44
|
-
onDocumentChanged(document: Document | null): void;
|
|
45
|
-
/** Manually trigger a save. */
|
|
46
|
-
save(): Promise<boolean>;
|
|
47
|
-
/** Clear auto-saved data from storage. */
|
|
48
|
-
clear(): void;
|
|
49
|
-
/** Get recovery data from storage. */
|
|
50
|
-
getRecoveryData(): SavedDocumentData | null;
|
|
51
|
-
/** Accept recovery and return the document. */
|
|
52
|
-
acceptRecovery(): Document | null;
|
|
53
|
-
/** Dismiss recovery and clear saved data. */
|
|
54
|
-
dismissRecovery(): void;
|
|
55
|
-
/** Enable auto-save and start the interval timer. */
|
|
56
|
-
enable(): void;
|
|
57
|
-
/** Disable auto-save and stop all timers. */
|
|
58
|
-
disable(): void;
|
|
59
|
-
/** Start the interval timer. Call after enabling or on init. */
|
|
60
|
-
startInterval(): void;
|
|
61
|
-
/** Save synchronously on destroy (best-effort). */
|
|
62
|
-
destroy(): void;
|
|
63
|
-
private checkRecoveryData;
|
|
64
|
-
private persistToStorage;
|
|
65
|
-
private debounceSave;
|
|
66
|
-
private stopTimers;
|
|
67
|
-
private updateStatus;
|
|
68
|
-
private emitSnapshot;
|
|
69
|
-
}
|
|
70
|
-
/** Format last save time for display */
|
|
71
|
-
declare function formatLastSaveTime(date: Date | null): string;
|
|
72
|
-
/** Get auto-save status label */
|
|
73
|
-
declare function getAutoSaveStatusLabel(status: AutoSaveStatus): string;
|
|
74
|
-
/** Get storage size used by auto-save */
|
|
75
|
-
declare function getAutoSaveStorageSize(storageKey?: string): number;
|
|
76
|
-
/** Format storage size for display */
|
|
77
|
-
declare function formatStorageSize(bytes: number): string;
|
|
78
|
-
/** Check if auto-save is supported */
|
|
79
|
-
declare function isAutoSaveSupported(): boolean;
|
|
80
|
-
|
|
81
|
-
export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as AutoSaveManager,b as formatLastSaveTime,e as formatStorageSize,c as getAutoSaveStatusLabel,d as getAutoSaveStorageSize,f as isAutoSaveSupported}from'../chunk-VCER63GQ.mjs';import'../chunk-BI3B33LI.mjs';import'../chunk-TTRUPDAB.mjs';
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { S as Subscribable } from '../Subscribable-DOz6Ohoo.mjs';
|
|
2
|
-
import { TableSelectionSnapshot, CellCoordinates } from './types.mjs';
|
|
3
|
-
import { Document } from '../types/document.mjs';
|
|
4
|
-
import { T as Table } from '../content-sSHuWw49.mjs';
|
|
5
|
-
import '../formatting-DoL7KBSL.mjs';
|
|
6
|
-
import '../styles-VxNcXLdi.mjs';
|
|
7
|
-
import '../settingsParser-CcGvtmCK.mjs';
|
|
8
|
-
import '../docx/wrapTypes.mjs';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* TableSelectionManager
|
|
12
|
-
*
|
|
13
|
-
* Framework-agnostic class for managing table cell selection state.
|
|
14
|
-
* Extracted from the React `useTableSelection` hook.
|
|
15
|
-
*
|
|
16
|
-
* Handles:
|
|
17
|
-
* - Cell selection via data-attribute queries on the DOM
|
|
18
|
-
* - Table document operations (add/delete rows/columns, merge/split)
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Tagged `@internal` post-1.0 cut. Adapters bind to this class today,
|
|
22
|
-
* but consumers should reach for `useTableSelection()` (React/Vue) instead
|
|
23
|
-
* of this raw subpath. The subpath stays in `package.json` `exports` for
|
|
24
|
-
* back-compat; expect it to move behind a public surface in a future major.
|
|
25
|
-
*
|
|
26
|
-
* @packageDocumentation
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Data attributes for table elements in the rendered DOM
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
declare const TABLE_DATA_ATTRIBUTES: {
|
|
35
|
-
readonly TABLE_INDEX: "data-table-index";
|
|
36
|
-
readonly ROW_INDEX: "data-row";
|
|
37
|
-
readonly COLUMN_INDEX: "data-col";
|
|
38
|
-
readonly TABLE_CELL: "data-table-cell";
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Find table cell coordinates from a click target by walking up the DOM
|
|
42
|
-
* and reading data attributes.
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
declare function findTableFromClick(target: EventTarget | null, container?: HTMLElement | null): CellCoordinates | null;
|
|
46
|
-
/**
|
|
47
|
-
* Get a table from the document by index.
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
declare function getTableFromDocument(doc: Document, tableIndex: number): Table | null;
|
|
51
|
-
/**
|
|
52
|
-
* Update a table in the document immutably.
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
declare function updateTableInDocument(doc: Document, tableIndex: number, newTable: Table): Document;
|
|
56
|
-
/**
|
|
57
|
-
* Delete a table from the document immutably.
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
|
-
declare function deleteTableFromDocument(doc: Document, tableIndex: number): Document;
|
|
61
|
-
/** @internal */
|
|
62
|
-
declare class TableSelectionManager extends Subscribable<TableSelectionSnapshot> {
|
|
63
|
-
constructor();
|
|
64
|
-
/** Select a specific cell. */
|
|
65
|
-
selectCell(coords: CellCoordinates): void;
|
|
66
|
-
/** Clear the current selection. */
|
|
67
|
-
clearSelection(): void;
|
|
68
|
-
/** Check if a specific cell is selected. */
|
|
69
|
-
isCellSelected(tableIndex: number, rowIndex: number, columnIndex: number): boolean;
|
|
70
|
-
/** Get the currently selected cell coordinates, or null. */
|
|
71
|
-
getSelectedCell(): CellCoordinates | null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as TABLE_DATA_ATTRIBUTES,f as TableSelectionManager,e as deleteTableFromDocument,b as findTableFromClick,c as getTableFromDocument,d as updateTableInDocument}from'../chunk-JY6ILTNS.mjs';import'../chunk-BI3B33LI.mjs';import'../chunk-TTRUPDAB.mjs';
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { Document } from '../types/document.mjs';
|
|
2
|
-
import '../content-sSHuWw49.mjs';
|
|
3
|
-
import '../formatting-DoL7KBSL.mjs';
|
|
4
|
-
import '../docx/wrapTypes.mjs';
|
|
5
|
-
import '../styles-VxNcXLdi.mjs';
|
|
6
|
-
import '../settingsParser-CcGvtmCK.mjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Manager Types
|
|
10
|
-
*
|
|
11
|
-
* Framework-agnostic interfaces for the editor's manager classes.
|
|
12
|
-
* @packageDocumentation
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Framework-agnostic interface for an imperatively mounted editor instance.
|
|
18
|
-
*
|
|
19
|
-
* Returned by `renderAsync()` implementations (React, Vue, etc.).
|
|
20
|
-
* Consumers use this to interact with the editor programmatically.
|
|
21
|
-
*/
|
|
22
|
-
interface EditorHandle {
|
|
23
|
-
/** Save the document and return the DOCX as a Blob. */
|
|
24
|
-
save(): Promise<Blob | null>;
|
|
25
|
-
/** Get the current parsed document model. */
|
|
26
|
-
getDocument(): Document | null;
|
|
27
|
-
/** Focus the editor. */
|
|
28
|
-
focus(): void;
|
|
29
|
-
/** Unmount the editor and clean up. */
|
|
30
|
-
destroy(): void;
|
|
31
|
-
}
|
|
32
|
-
/** Auto-save status */
|
|
33
|
-
type AutoSaveStatus = 'idle' | 'saving' | 'saved' | 'error';
|
|
34
|
-
/** Configuration for AutoSaveManager */
|
|
35
|
-
interface AutoSaveManagerOptions {
|
|
36
|
-
/** Storage key for localStorage (default: 'docx-editor-autosave') */
|
|
37
|
-
storageKey?: string;
|
|
38
|
-
/** Save interval in milliseconds (default: 30000 - 30 seconds) */
|
|
39
|
-
interval?: number;
|
|
40
|
-
/** Maximum age of auto-save before it's considered stale (default: 24 hours) */
|
|
41
|
-
maxAge?: number;
|
|
42
|
-
/** Whether to save on document change with debounce (default: true) */
|
|
43
|
-
saveOnChange?: boolean;
|
|
44
|
-
/** Debounce delay for saveOnChange in milliseconds (default: 2000) */
|
|
45
|
-
debounceDelay?: number;
|
|
46
|
-
/** Callback when save succeeds */
|
|
47
|
-
onSave?: (timestamp: Date) => void;
|
|
48
|
-
/** Callback when save fails */
|
|
49
|
-
onError?: (error: Error) => void;
|
|
50
|
-
/** Callback when recovery data is found */
|
|
51
|
-
onRecoveryAvailable?: (savedDocument: SavedDocumentData) => void;
|
|
52
|
-
}
|
|
53
|
-
/** Saved document data structure */
|
|
54
|
-
interface SavedDocumentData {
|
|
55
|
-
/** The document JSON */
|
|
56
|
-
document: Document;
|
|
57
|
-
/** When the document was saved */
|
|
58
|
-
savedAt: string;
|
|
59
|
-
/** Version for format compatibility */
|
|
60
|
-
version: number;
|
|
61
|
-
/** Optional document identifier */
|
|
62
|
-
documentId?: string;
|
|
63
|
-
}
|
|
64
|
-
/** AutoSaveManager snapshot for UI consumption */
|
|
65
|
-
interface AutoSaveSnapshot {
|
|
66
|
-
status: AutoSaveStatus;
|
|
67
|
-
lastSaveTime: Date | null;
|
|
68
|
-
hasRecoveryData: boolean;
|
|
69
|
-
isEnabled: boolean;
|
|
70
|
-
}
|
|
71
|
-
/** Cell coordinates in a table */
|
|
72
|
-
interface CellCoordinates {
|
|
73
|
-
tableIndex: number;
|
|
74
|
-
rowIndex: number;
|
|
75
|
-
columnIndex: number;
|
|
76
|
-
}
|
|
77
|
-
/** TableSelectionManager snapshot */
|
|
78
|
-
interface TableSelectionSnapshot {
|
|
79
|
-
/** Currently selected cell, or null if no selection */
|
|
80
|
-
selectedCell: CellCoordinates | null;
|
|
81
|
-
}
|
|
82
|
-
/** Error severity levels */
|
|
83
|
-
type ErrorSeverity = 'error' | 'warning' | 'info';
|
|
84
|
-
/** Error notification */
|
|
85
|
-
interface ErrorNotification {
|
|
86
|
-
id: string;
|
|
87
|
-
message: string;
|
|
88
|
-
severity: ErrorSeverity;
|
|
89
|
-
details?: string;
|
|
90
|
-
timestamp: number;
|
|
91
|
-
dismissed?: boolean;
|
|
92
|
-
}
|
|
93
|
-
/** ErrorManager snapshot */
|
|
94
|
-
interface ErrorManagerSnapshot {
|
|
95
|
-
notifications: ErrorNotification[];
|
|
96
|
-
}
|
|
97
|
-
/** Plugin lifecycle configuration */
|
|
98
|
-
interface PluginLifecycleConfig {
|
|
99
|
-
id: string;
|
|
100
|
-
styles?: string;
|
|
101
|
-
initialize?: (editorState: unknown) => unknown;
|
|
102
|
-
onStateChange?: (editorState: unknown) => unknown;
|
|
103
|
-
destroy?: () => void;
|
|
104
|
-
}
|
|
105
|
-
/** PluginLifecycleManager snapshot */
|
|
106
|
-
interface PluginLifecycleSnapshot {
|
|
107
|
-
/** Map of plugin ID to plugin state */
|
|
108
|
-
states: Map<string, unknown>;
|
|
109
|
-
/** Version counter (incremented on any state change) */
|
|
110
|
-
version: number;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export type { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinates, EditorHandle, ErrorManagerSnapshot, ErrorNotification, ErrorSeverity, PluginLifecycleConfig, PluginLifecycleSnapshot, SavedDocumentData, TableSelectionSnapshot };
|
package/dist/managers/types.mjs
DELETED
|
File without changes
|