@docx-editor.dev/core 2.14.1 → 2.15.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.
Files changed (133) hide show
  1. package/README.md +42 -0
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +6 -5
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +16 -10
  7. package/dist/binding.js +1 -1
  8. package/dist/chunk-24APKZAN.cjs +11 -0
  9. package/dist/chunk-2YH4MSHX.cjs +2 -0
  10. package/dist/chunk-5Y7AADI6.js +1 -0
  11. package/dist/chunk-AREFLNUP.js +11 -0
  12. package/dist/chunk-AS7YZNQE.cjs +2 -0
  13. package/dist/chunk-AVGCKH6A.cjs +20 -0
  14. package/dist/chunk-CDYVDQRI.cjs +5 -0
  15. package/dist/chunk-FGBADUSK.cjs +1 -0
  16. package/dist/chunk-HOEWFH5U.cjs +1 -0
  17. package/dist/chunk-KFELX7CN.js +2 -0
  18. package/dist/{chunk-OKEDGR65.js → chunk-KXPVOPR5.js} +1 -1
  19. package/dist/chunk-LGFKIF4M.cjs +1 -0
  20. package/dist/chunk-M52QXFKI.js +1 -0
  21. package/dist/chunk-MNUKSXRO.js +1 -0
  22. package/dist/chunk-PBOIGBDO.js +2 -0
  23. package/dist/chunk-PMHGONET.cjs +1 -0
  24. package/dist/chunk-PXKZUTHX.cjs +2 -0
  25. package/dist/chunk-Q4AB7E4O.cjs +1 -0
  26. package/dist/chunk-QJYH6AYD.js +1 -0
  27. package/dist/chunk-QRC37MWG.cjs +20 -0
  28. package/dist/chunk-RJSB6RJ7.js +20 -0
  29. package/dist/chunk-SB54HLFJ.js +20 -0
  30. package/dist/chunk-VP7SDFCM.js +1 -0
  31. package/dist/chunk-XCESLTJL.js +2 -0
  32. package/dist/{chunk-KIAP7PFQ.cjs → chunk-YL4Q5LZP.cjs} +1 -1
  33. package/dist/chunk-Z4527AXR.js +5 -0
  34. package/dist/collaboration/replication.cjs +1 -1
  35. package/dist/collaboration/replication.d.ts +4 -3
  36. package/dist/collaboration/replication.js +1 -1
  37. package/dist/collaboration.d.ts +4 -3
  38. package/dist/contracts/editor.d.ts +7 -7
  39. package/dist/contracts/interaction.d.ts +7 -7
  40. package/dist/contracts/modules.d.ts +8 -7
  41. package/dist/{custom-node-writes-DntmaAVW.d.ts → custom-node-writes-C9ArIlJh.d.ts} +2 -2
  42. package/dist/{editor-a6VvsfYU.d.ts → editor-sRxrFJd8.d.ts} +29 -21
  43. package/dist/editor.cjs +1 -1
  44. package/dist/editor.d.ts +27 -58
  45. package/dist/editor.js +1 -1
  46. package/dist/export.cjs +2 -0
  47. package/dist/export.d.ts +337 -0
  48. package/dist/export.js +2 -0
  49. package/dist/font-resolver-BYEHQGTw.d.ts +251 -0
  50. package/dist/headless-document-view-DELC4E5v.d.ts +134 -0
  51. package/dist/hf-references-DTrHkktY.d.ts +70 -0
  52. package/dist/{index-C5ZnSRkF.d.ts → index-C3Gvq4jN.d.ts} +55 -246
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.d.ts +18 -16
  55. package/dist/index.js +1 -1
  56. package/dist/{shaped-measurer-CFPnXFs9.d.cts → layout-shaping-DoGR5cf8.d.ts} +86 -12
  57. package/dist/layout.cjs +1 -1
  58. package/dist/layout.d.ts +1106 -729
  59. package/dist/layout.js +1 -1
  60. package/dist/{note-properties-CDFiNXcD.d.ts → note-properties-DSe8igrz.d.ts} +2 -2
  61. package/dist/{omml-equation-BY49UOIF.d.ts → omml-equation-BpRmfDAf.d.ts} +1 -1
  62. package/dist/output.cjs +1 -1
  63. package/dist/output.d.ts +6 -6
  64. package/dist/output.js +1 -1
  65. package/dist/{protocol-gOY5GA8K.d.cts → protocol-DZzKxH5r.d.ts} +18 -12
  66. package/dist/{review-items-CCS1h93f.d.ts → review-items-DYRx187i.d.ts} +2 -2
  67. package/dist/{review-reads-BjZYeMd4.d.ts → review-reads-LbGUdNzn.d.ts} +22 -25
  68. package/dist/{revision-projection-BeXVrSSV.d.ts → revision-projection-DHRJH48u.d.ts} +1 -1
  69. package/dist/{semantic-cell-selection-BK91NCCG.d.ts → semantic-cell-selection-BXVWCBYm.d.ts} +4 -4
  70. package/dist/{semantic-interaction-BmQ7h2cq.d.ts → semantic-interaction-DZsDmPg5.d.ts} +1 -1
  71. package/dist/{semantic-paint-WJD2KeG1.d.ts → semantic-paint-f7SqN4oW.d.ts} +2 -2
  72. package/dist/{semantic-records-BpozY7-j.d.cts → semantic-records-EIdwId-a.d.ts} +301 -205
  73. package/dist/store.cjs +1 -1
  74. package/dist/store.d.ts +15 -65
  75. package/dist/store.js +1 -1
  76. package/dist/{tree-op-types-D6HzlPR4.d.ts → tree-op-types-egdarvH_.d.ts} +7 -3
  77. package/dist/{tree-package-fragment-CWFjgH6a.d.ts → tree-package-fragment-DjkH4ESI.d.ts} +4 -70
  78. package/dist/{tree-session-contract-B2HfGt79.d.ts → tree-session-contract-CGOOgPjW.d.ts} +29 -23
  79. package/dist/{tree-store-APgWx6qn.d.ts → tree-store-DKJB0IcA.d.ts} +2 -2
  80. package/package.json +7 -2
  81. package/dist/automation.d.cts +0 -82
  82. package/dist/binding.d.cts +0 -153
  83. package/dist/chunk-2PIHW2QM.cjs +0 -1
  84. package/dist/chunk-2QTY5S6T.js +0 -1
  85. package/dist/chunk-4Z5MODAE.cjs +0 -2
  86. package/dist/chunk-5TKAPFZT.cjs +0 -2
  87. package/dist/chunk-DRQHIQ4R.cjs +0 -1
  88. package/dist/chunk-F2K6SDHA.cjs +0 -20
  89. package/dist/chunk-FBA57EUJ.js +0 -2
  90. package/dist/chunk-KTAQ7BRQ.js +0 -20
  91. package/dist/chunk-LBAHXZCU.cjs +0 -5
  92. package/dist/chunk-MCDUQYWP.js +0 -5
  93. package/dist/chunk-MQP26KCF.js +0 -1
  94. package/dist/chunk-NDJGSR6M.cjs +0 -19
  95. package/dist/chunk-NJNFJPGB.cjs +0 -11
  96. package/dist/chunk-O5M4CR4P.cjs +0 -2
  97. package/dist/chunk-UKUOZXUD.js +0 -19
  98. package/dist/chunk-VQ4R5LTU.js +0 -2
  99. package/dist/chunk-ZBEJHJN2.js +0 -11
  100. package/dist/chunk-ZVTW7RGD.js +0 -2
  101. package/dist/collaboration/replication.d.cts +0 -216
  102. package/dist/collaboration.d.cts +0 -176
  103. package/dist/contracts/document.d.cts +0 -273
  104. package/dist/contracts/editor.d.cts +0 -10
  105. package/dist/contracts/interaction.d.cts +0 -10
  106. package/dist/contracts/modules.d.cts +0 -130
  107. package/dist/contracts/types.d.cts +0 -562
  108. package/dist/custom-node-writes-C46r3_5O.d.cts +0 -310
  109. package/dist/document-properties-D6Ahr8D6.d.cts +0 -28
  110. package/dist/document-properties-D6Ahr8D6.d.ts +0 -28
  111. package/dist/editor-AJ06hyyg.d.cts +0 -1994
  112. package/dist/editor.d.cts +0 -393
  113. package/dist/failure-BnGjoXf0.d.cts +0 -64
  114. package/dist/index-Cbw4lkOt.d.cts +0 -3391
  115. package/dist/index.d.cts +0 -23
  116. package/dist/layout.d.cts +0 -2486
  117. package/dist/note-properties-Y6qYh2Hv.d.cts +0 -67
  118. package/dist/omml-equation-DB8d-jCq.d.cts +0 -84
  119. package/dist/output.d.cts +0 -74
  120. package/dist/protocol-BsmQgblT.d.ts +0 -1358
  121. package/dist/review-items-CaAkgi5s.d.cts +0 -360
  122. package/dist/review-reads-DEsV0OOW.d.cts +0 -163
  123. package/dist/revision-projection-DXbrfNGD.d.cts +0 -156
  124. package/dist/semantic-cell-selection-BMhku3B1.d.cts +0 -451
  125. package/dist/semantic-interaction-DUAnxbgf.d.cts +0 -160
  126. package/dist/semantic-paint-DufNL1Zr.d.cts +0 -247
  127. package/dist/semantic-records-92UnKeU_.d.ts +0 -2821
  128. package/dist/shaped-measurer-BWbindlI.d.ts +0 -168
  129. package/dist/store.d.cts +0 -2500
  130. package/dist/tree-op-types-BUulYD5y.d.cts +0 -3099
  131. package/dist/tree-package-fragment-Dhyw7oPm.d.cts +0 -732
  132. package/dist/tree-session-contract-BY9xd7s_.d.cts +0 -613
  133. package/dist/tree-store-DEEQ9wz_.d.cts +0 -416
@@ -1,254 +1,22 @@
1
- import { T as TreeDocOp, C as ImageDecodePort, v as DrawingPositionInput, W as DrawingTransform, F as DrawingTreeDocOp, y as SupportedImageMime } from './tree-op-types-D6HzlPR4.js';
1
+ import { T as TreeDocOp, E as ImageDecodePort, v as DrawingPositionInput, X as DrawingTransform, F as DrawingTreeDocOp, y as SupportedImageMime } from './tree-op-types-egdarvH_.js';
2
2
  import { Unsubscribe, ExecResult, ParagraphTabStop, IndentFormatting, ParagraphFlags, ParagraphDisagreements, SelectionPin } from './contracts/types.js';
3
- import { g as ReviewRevisionKind } from './review-items-CCS1h93f.js';
3
+ import { g as ReviewRevisionKind } from './review-items-DYRx187i.js';
4
4
  import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
5
- import { k as FontSource, l as FontSourceSubstitution, m as FontFaceRequest, F as FontConfiguration, D as DocumentSource, Z as ZoomMode, E as EditorFontError, n as Editor, b as EditorCommand, C as CanResult, S as SelectedImageState, o as FormatPainterSurfaceState, e as TrackedChangePredicate, T as TrackedChangeFilterMode, V as ViewScope, I as ImageContext, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, t as TableContext } from './editor-a6VvsfYU.js';
6
- import { R as RevisionDisplayMode } from './revision-projection-BeXVrSSV.js';
7
- import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-BmQ7h2cq.js';
5
+ import { D as DocumentSource, c as FontConfiguration, Z as ZoomMode, E as EditorFontError, n as Editor, e as EditorCommand, C as CanResult, S as SelectedImageState, o as FormatPainterSurfaceState, h as TrackedChangePredicate, T as TrackedChangeFilterMode, V as ViewScope, b as FontFaceRequest, F as FontSource, I as ImageContext, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, t as TableContext } from './editor-sRxrFJd8.js';
6
+ import { R as RevisionDisplayMode } from './revision-projection-DHRJH48u.js';
7
+ import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-DZsDmPg5.js';
8
+ import { e as FontConfigurationFragment, g as FontResolver } from './font-resolver-BYEHQGTw.js';
8
9
  import { EditorCollaborationSession, CollaborationRemoteSelection, CollaborationModuleContribution } from './collaboration.js';
9
- import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-WJD2KeG1.js';
10
- import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-CDFiNXcD.js';
11
- import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-92UnKeU_.js';
12
- import { B as BookmarkIndex } from './custom-node-writes-DntmaAVW.js';
13
- import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, d as ImageIntentResult } from './tree-package-fragment-CWFjgH6a.js';
14
- import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-BK91NCCG.js';
15
- import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-B2HfGt79.js';
10
+ import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, d as DrawingPaintStrings, F as FieldShadingMode } from './semantic-paint-f7SqN4oW.js';
11
+ import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-DSe8igrz.js';
12
+ import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-EIdwId-a.js';
13
+ import { B as BookmarkIndex } from './custom-node-writes-C9ArIlJh.js';
14
+ import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, b as ImageIntentResult } from './tree-package-fragment-DjkH4ESI.js';
15
+ import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-BXVWCBYm.js';
16
+ import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CGOOgPjW.js';
16
17
  import { C as CollaborationStatus } from './failure-BnGjoXf0.js';
17
18
  import './contracts/document.js';
18
19
 
19
- /**
20
- * A partial font configuration one origin contributes: sources, substitutions, or both.
21
- * `loadDefaultFonts()` (the substitute package) and `loadFonts()` (the fetch helper) both
22
- * return this shape, so every origin composes through `composeFontConfiguration` the
23
- * same way.
24
- */
25
- interface FontConfigurationFragment {
26
- readonly sources?: readonly FontSource[];
27
- readonly substitutions?: readonly FontSourceSubstitution[];
28
- }
29
- /**
30
- * The base of a composition: everything a `FontConfiguration` carries, all optional.
31
- * Omitted fields take the documented defaults (`epoch` 0, `maxFontBytes` at the engine
32
- * hard maximum, `defaultFont` Calibri at 11pt — Word's own default face and size).
33
- */
34
- interface FontConfigurationBase extends FontConfigurationFragment {
35
- /**
36
- * Identity of this configuration's byte set. The engine uses it to tell one resolved
37
- * font set from another; leave it unset and the editor supplies the load sequence.
38
- */
39
- readonly epoch?: number;
40
- /** Per-face byte ceiling. Defaults to the engine hard maximum; lower it to tighten intake. */
41
- readonly maxFontBytes?: number;
42
- /** The face used when a run names no font. Defaults to Word's own: Calibri at 11pt. */
43
- readonly defaultFont?: FontConfiguration['defaultFont'];
44
- /** BCP-47 tag passed to the shaper for language-sensitive shaping. */
45
- readonly language?: string;
46
- }
47
- /**
48
- * What the document turned out to need, handed to an on-demand resolver.
49
- *
50
- * The families are the ones the file actually names — already name-validated and capped,
51
- * so a resolver may treat them as a list to look up, never as URLs or paths to build.
52
- */
53
- interface FontResolutionRequest {
54
- /**
55
- * Families declared anywhere in the document (body, headers/footers, styles), deduped,
56
- * sorted, and capped at {@link MAX_RESOLVER_FAMILIES}.
57
- */
58
- readonly families: readonly string[];
59
- /** The face a run naming no font resolves to, so a resolver can cover it too. */
60
- readonly defaultFamily: string;
61
- /**
62
- * Faces an EARLIER origin in the same composition can already PAINT — either because it
63
- * supplied the bytes, or because it mapped that face onto one it did supply.
64
- *
65
- * Absent, not empty, when there is nothing to report: the engine calling a resolver
66
- * directly, and the first origin of a composition.
67
- *
68
- * FACES, not families, and only faces backed by bytes. Both narrowings are load-bearing.
69
- * A family-grained list would let an origin holding only regular Arial suppress the bold
70
- * and italic a later origin would have supplied, and a list built from substitutions
71
- * alone would let an origin whose fetches all failed suppress the failover behind it,
72
- * because both shipped resolvers emit their substitution map before fetching. Together
73
- * they are what makes honouring this an OPTIMIZATION rather than a correctness
74
- * requirement: skipping a reported face cannot lose one, so a resolver that ignores this
75
- * list only spends bytes on a face first-wins composition would drop anyway.
76
- *
77
- * Match it case-insensitively. Word matches font names that way and both shipped
78
- * resolvers do.
79
- */
80
- readonly resolvedFaces?: readonly FontFaceRequest[];
81
- }
82
- /**
83
- * Resolve fonts once the document's needs are known, instead of ahead of them.
84
- *
85
- * Called once per load, AFTER the file is parsed and mounted, with the families it
86
- * declares; whatever it returns composes exactly like a statically supplied fragment.
87
- * Returning nothing is a valid answer — it means "I cover none of this", and the
88
- * document stays on the fixed measurer.
89
- *
90
- * A resolver that fetches makes opening a document perform network requests. That is a
91
- * real change in posture and it must stay the APP's decision: the engine never supplies
92
- * one, and the families here are file-derived, so a resolver must look them up in a set
93
- * it shipped rather than interpolate them into a URL.
94
- */
95
- type FontResolver = (request: FontResolutionRequest) => FontConfiguration | FontConfigurationFragment | undefined | Promise<FontConfiguration | FontConfigurationFragment | undefined>;
96
- /**
97
- * Ceiling on the families one document can put in front of a resolver.
98
- *
99
- * A resolver typically turns each family into up to four faces, and the resource snapshot
100
- * refuses more than `HARD_MAX_FONT_SOURCES` (256) sources — so 64 families is the point
101
- * past which a document could no longer be served anyway. Capping here means a file
102
- * declaring thousands of distinct `w:rFonts` cannot fan a resolver out across thousands
103
- * of lookups (or fetches) before that limit is ever reached.
104
- */
105
- declare const MAX_RESOLVER_FAMILIES = 64;
106
- /** Word's document default when nothing else says otherwise: Calibri at 11pt. */
107
- declare const WORD_DEFAULT_FONT: FontConfiguration['defaultFont'];
108
- /**
109
- * Merge a base and any number of fragments into one frozen `FontConfiguration`.
110
- *
111
- * A bare fragment IS a valid base, so the single-origin case is one argument:
112
- * `composeFontConfiguration(await loadDefaultFonts())`. Pass extra fragments to layer
113
- * origins, and set `epoch`/`maxFontBytes`/`defaultFont` on the base only when you need
114
- * something other than the documented defaults.
115
- *
116
- * - Sources dedupe first-wins by (family, weight, style), in argument order — base
117
- * before fragments, earlier fragments before later ones.
118
- * - Substitutions dedupe first-wins by their `from` face, in the same order, and every
119
- * substitution whose `from` face has a direct source anywhere in the composition is
120
- * dropped: a real face always beats a stand-in.
121
- * - The result is frozen (arrays included); the byte arrays themselves are the callers'
122
- * and are not copied here — the resource snapshot takes its own defensive copy.
123
- */
124
- declare function composeFontConfiguration(base: FontConfigurationBase, ...fragments: readonly FontConfigurationFragment[]): FontConfiguration;
125
-
126
- /**
127
- * The namespaced key carrying the type-level half of the mark, and the runtime property
128
- * name that backs it.
129
- *
130
- * A plain string rather than a symbol on purpose: `@docx-editor.dev/fonts` has no runtime
131
- * or type dependency on the engine, so it declares the same mark itself, and two
132
- * `unique symbol`s in two packages would not unify. Two identical string keys do.
133
- *
134
- * @public
135
- */
136
- declare const FONT_RESOLVER_MARK_KEY = "docx-editor.dev/font-resolver";
137
- /**
138
- * The runtime marker `defineFontResolver` sets and {@link isFontResolver} reads.
139
- *
140
- * Exported because a package mirroring the font contract structurally still has to mark
141
- * the resolvers it builds. A package in that position sets
142
- * `Symbol.for('docx-editor.dev/font-resolver')` itself; this constant is the same symbol,
143
- * named, for everyone who can import it.
144
- *
145
- * @public
146
- */
147
- declare const FONT_RESOLVER_BRAND: unique symbol;
148
- /**
149
- * The type-level half of the mark: what {@link defineFontResolver} adds to a function's
150
- * type so a `FontOrigin` list can REQUIRE it.
151
- *
152
- * Declared with a string key so `@docx-editor.dev/fonts` can declare an identical
153
- * interface and have the two unify without importing anything from the engine. Set at
154
- * runtime as well as in the type — non-enumerable, so it stays out of `Object.keys` and
155
- * out of a host's own spread.
156
- *
157
- * @public
158
- */
159
- interface FontResolverMark {
160
- /** Always `true`. Set non-enumerably by {@link defineFontResolver}. */
161
- readonly 'docx-editor.dev/font-resolver': true;
162
- }
163
- /**
164
- * A {@link FontResolver} that has been through {@link defineFontResolver}.
165
- *
166
- * This, not bare `FontResolver`, is what a `FontOrigin` list accepts. The mark is the only
167
- * thing separating a resolver from a zero-argument loader, and getting that wrong loses
168
- * every font silently, so the type asks for it up front.
169
- *
170
- * @public
171
- */
172
- type MarkedFontResolver<T extends FontResolver = FontResolver> = T & FontResolverMark;
173
- /**
174
- * Mark a function as an on-demand {@link FontResolver}.
175
- *
176
- * Wrap every resolver you put in a `fonts` list — `useFonts(...)`, `useDocxSource`'s
177
- * `fonts` option, `composeFontOrigins`. The `fonts` PROP needs no marking, because a
178
- * function there is always a resolver; a list also accepts the older zero-argument loader
179
- * form (`{ fonts: defaultFonts }`), and this is what keeps the two apart.
180
- *
181
- * Returns the same function object, mutated, so the mark survives being passed around and
182
- * a marked resolver stays `===` to itself. It does NOT survive `.bind()` or being wrapped:
183
- * both make a new function object. Re-mark the result.
184
- *
185
- * ```ts
186
- * const brandFonts = defineFontResolver(async ({ families }) => ({
187
- * sources: await loadMine(families),
188
- * }));
189
- * ```
190
- *
191
- * Throws a `TypeError` on a frozen or sealed function, which cannot take the mark. That is
192
- * deliberate: returning it unmarked would compile — the return TYPE says marked — and then
193
- * lose every font at runtime.
194
- *
195
- * @public
196
- */
197
- declare function defineFontResolver<T extends FontResolver>(resolve: T): MarkedFontResolver<T>;
198
- /**
199
- * Whether a value is a function marked by {@link defineFontResolver}.
200
- *
201
- * False for an unmarked function, which callers read as a zero-argument loader. Calling a
202
- * resolver that way reads `request.defaultFamily` off `undefined` and throws, so the
203
- * callers that make this choice say so rather than swallowing it — and the type-level mark
204
- * on {@link MarkedFontResolver} is there to stop it reaching runtime at all.
205
- *
206
- * @public
207
- */
208
- declare function isFontResolver(value: unknown): value is MarkedFontResolver;
209
- /**
210
- * ONE font origin, in the one shape every origin takes: a finished configuration, a
211
- * fragment, a promise for either, or a marked resolver that answers per document.
212
- *
213
- * The point of the union is that `packagedFonts()`, `googleFonts()`, `await defaultFonts()`
214
- * and a hand-built `{ sources }` are all the same kind of thing, so a list of them needs no
215
- * ordering rule beyond "first wins".
216
- *
217
- * The resolver arm is {@link MarkedFontResolver}, not bare `FontResolver`: a list may also
218
- * hold a zero-argument loader, and only the mark separates the two.
219
- *
220
- * @public
221
- */
222
- type FontOrigin = FontConfiguration | FontConfigurationFragment | MarkedFontResolver | Promise<FontConfiguration | FontConfigurationFragment | undefined> | undefined;
223
- /**
224
- * Resolve a list of {@link FontOrigin}s against one document's needs and merge them,
225
- * first-wins in list order.
226
- *
227
- * Origins resolve IN ORDER, one after another, and each is told which faces the ones
228
- * before it can already paint ({@link FontResolutionRequest.resolvedFaces}). Sequential
229
- * rather than a `Promise.all`, and that is a real cost — one extra origin's latency on the
230
- * critical path — bought deliberately: composition is first-wins, so a later origin's copy
231
- * of a face an earlier one supplied can never be used, and fetching it anyway spends the
232
- * bytes twice and tells a font host which families the document uses for a result that
233
- * gets thrown away. Order origins cheapest-first.
234
- *
235
- * A resolver that ignores `resolvedFaces` still composes correctly; it just spends more.
236
- *
237
- * ONE ORIGIN CANNOT SINK THE REST. An origin that throws, answers `null`, or answers
238
- * something malformed is reported and skipped whole, and the origins around it still
239
- * compose — an app that listed a flaky network origin behind a bundled one keeps the
240
- * bundled faces. Skipped WHOLE: an answer is read completely before any of it is
241
- * committed, so a half-ingested origin can never reach composition.
242
- *
243
- * The result carries NO `epoch`: it is a fragment for the engine to stamp with the load
244
- * sequence. A fixed epoch from here would label every document's byte set as the same one.
245
- * `undefined` means no origin contributed anything, which is a normal answer — the document
246
- * stays on the fixed measurer.
247
- *
248
- * @public
249
- */
250
- declare function composeFontOrigins(origins: readonly FontOrigin[], request: FontResolutionRequest): Promise<FontConfigurationFragment | undefined>;
251
-
252
20
  /**
253
21
  * A Word-faithful blank document, freshly zipped per call (the caller may hand the
254
22
  * bytes to a loader that takes ownership). Calibri 11pt and Word's Normal paragraph
@@ -675,6 +443,41 @@ interface DocxEditorInstance extends Editor {
675
443
  * author colour it will receive after commit.
676
444
  */
677
445
  getConfiguredAuthor(): string | null;
446
+ /**
447
+ * Set the author for runtime editor state.
448
+ *
449
+ * Unlike the construction-time {@link DocxEditorConfig.author}, this value applies to every
450
+ * later comment, reply, and tracked change. It does not rewrite existing revisions. The value
451
+ * survives document reloads and font remounts. An empty or whitespace value clears the author,
452
+ * after which suggesting refuses writes with its existing reason.
453
+ *
454
+ * @public
455
+ */
456
+ setAuthor(author: string | undefined): void;
457
+ /**
458
+ * Set the host editing mode without rebuilding the editor.
459
+ *
460
+ * This has the same meaning as {@link DocxEditorConfig.mode}. Passing `undefined` lets the
461
+ * document's tracking settings select the mode again. A host change clears the reader's
462
+ * toolbar choice, so a later document reload can adopt `w:trackRevisions` again.
463
+ *
464
+ * @public
465
+ */
466
+ setMode(mode: 'edit' | 'view' | 'suggesting' | undefined): void;
467
+ /**
468
+ * Set the drawing-label resolver without rebuilding the editor. Painted placeholders update
469
+ * immediately, and later surface mounts use the same resolver.
470
+ *
471
+ * @public
472
+ */
473
+ setTranslate(translate: ((key: string, params?: Record<string, string | number>) => string) | undefined): void;
474
+ /**
475
+ * Set the engine locale without rebuilding the editor. Later table-of-contents insertions use
476
+ * the resolved locale label. Unsupported and omitted locales resolve to English.
477
+ *
478
+ * @public
479
+ */
480
+ setLocale(locale: string | undefined): void;
678
481
  /**
679
482
  * The style declared for one author, whether or not the SURFACE has published them yet —
680
483
  * so review chrome can draw a card the rail is holding before the roster catches up.
@@ -1943,6 +1746,12 @@ interface PaginatedSurface {
1943
1746
  */
1944
1747
  editingMode(): SurfaceEditingMode;
1945
1748
  setEditingMode(mode: SurfaceEditingMode): void;
1749
+ /** Set the ambient author after buffered text commits under the previous author. */
1750
+ setAuthor(author: string | undefined): void;
1751
+ /** Replace localized drawing labels and repaint materialized pages. */
1752
+ setDrawingStrings(strings: DrawingPaintStrings): void;
1753
+ /** Replace the localized title used by later TOC insertions. */
1754
+ setTocLabels(labels: NonNullable<PaginatedSurfaceOptions['tocLabels']>): void;
1946
1755
  /**
1947
1756
  * Every author with a revision in the CURRENT layout, mapped to Word's colour slot by
1948
1757
  * order of first appearance. One map instance per layout, so a caller can key caches on
@@ -3388,4 +3197,4 @@ declare function runTableCommand(editor: Editor | null, command: EditorCommand):
3388
3197
  */
3389
3198
  declare function createDocxEditor(config: DocxEditorConfig): DocxEditorInstance;
3390
3199
 
3391
- export { type MarkedFontResolver as $, type AnchorFrameOrigin as A, type FontLoadFailureReason as B, CHROME_GROUPS as C, type DocxEditorInstance as D, EMU_PER_POINT as E, FONT_RESOLVER_BRAND as F, type FontMeasurementState as G, type FontOrigin as H, type FontResolutionRequest as I, type FontResolver as J, type FontResolverMark as K, type FontUrlSource as L, type HyperlinkActivation as M, type HyperlinkChromeHandlers as N, type OpenPaginatedResult as O, type PaginatedSurfaceOptions as P, type HyperlinkOps as Q, IMAGE_OVERLAY_NUDGE_PT as R, IMAGE_OVERLAY_NUDGE_SHIFT_PT as S, type TableCommandPlan as T, type ImageInteractionSession as U, type ImageOverlayScrollPort as V, type ImageResizeHandle as W, type ImageResizeResult as X, type LoadFontsRequest as Y, type LoadFontsResult as Z, MAX_RESOLVER_FAMILIES as _, type PaginatedSurface as a, layoutPointsToCssPixels as a$, type OverlayFrameRect as a0, type PaginatedSurfaceState as a1, type ParagraphPropertyEdit as a2, type RemoteCaretLabelAnchor as a3, type RemoteCaretLabelHost as a4, type ReviewWriteIntent as a5, type RunTableChromeCommandResult as a6, type SectionAnchor as a7, type SectionBreakInsertType as a8, type SelectedDrawingOverlayTarget as a9, chromeMenuSlots as aA, chromeProbeForSlot as aB, chromeSlotId as aC, chromeSlotIsToggle as aD, commandForSlot as aE, commandForSlotValue as aF, commandForTableChromeSlotValue as aG, composeFontConfiguration as aH, composeFontOrigins as aI, computeImageResizeResult as aJ, computeMovedImagePosition as aK, computeResizedImageExtentEmu as aL, createDocxEditor as aM, createFontSource as aN, createImageOverlayScrollPort as aO, cssPixelsToLayoutPoints as aP, defaultChromeGroups as aQ, defaultTableLabel as aR, defineFontResolver as aS, emuToOverlayPoints as aT, equationAtPosition as aU, executeImageCommand as aV, finalizeImageOverlayInteraction as aW, formattingBarChromeGroups as aX, isFontResolver as aY, isStaleImageInteractionCommit as aZ, isTableChromeSlot as a_, type SurfaceEquation as aa, type SurfaceFormatting as ab, type SurfaceHyperlink as ac, type SurfaceInsertImageInput as ad, type SurfaceNavigation as ae, type SurfaceOverlayCoordinates as af, type SurfaceParagraphFormat as ag, TABLE_BORDER_STYLE_OPTIONS as ah, TABLE_BORDER_TARGET_OPTIONS as ai, TABLE_BORDER_WIDTH_OPTIONS as aj, TABLE_CHROME_SLOT_IDS as ak, type TableBorderStyleOption as al, type TableBorderTargetOption as am, type TableBorderTargetValue as an, type TableBorderWidthOption as ao, type TableChromeDraft as ap, type TableChromePick as aq, type TableChromeSlotId as ar, type TableInteractionLabelKey as as, type ToolbarCommandState as at, WORD_DEFAULT_FONT as au, applyTableChromePick as av, blankDocumentBytes as aw, canExecuteImageCommand as ax, captureImageMutationPreconditions as ay, chromeControlCount as az, CHROME_MENUS as b, loadFonts as b0, overlayFrameToSheetCssPixels as b1, overlayHostOrigin as b2, pointsToEmu as b3, probeTableChromeCommand as b4, resizePreservesAspect as b5, runSave as b6, runTableChromeCommand as b7, runTableCommand as b8, runToolbarCommand as b9, selectedDrawingOverlayTargetOf as ba, selectedImageStateOf as bb, surfacePaintScale as bc, tableChromeIconPaths as bd, tableChromeLabelKeyForTarget as be, tableChromeToolbarState as bf, tableChromeVisible as bg, tableCommandToolbarState as bh, toolbarCommandState as bi, toolbarCommandStates as bj, CHROME_UNAVAILABLE_KEY as c, type ChromeControl as d, type ChromeControlId as e, type ChromeControlState as f, type ChromeGroup as g, type ChromeGroupId as h, type ChromeMenu as i, type ChromeMenuEntry as j, type ChromeMenuId as k, type ChromeMenuItemEntry as l, type ChromeMenuSeparatorEntry as m, type ChromeMenuSubmenuEntry as n, type ChromeSlotId as o, DEFAULT_TABLE_CHROME_DRAFT as p, type DocxEditorConfig as q, type DrawingSelectionIntent as r, type EquationActivation as s, type EquationChromeHandlers as t, type EquationOps as u, FONT_RESOLVER_MARK_KEY as v, type FinalizedImageOverlayInteraction as w, type FontConfigurationBase as x, type FontConfigurationFragment as y, type FontLoadFailure as z };
3200
+ export { type SelectedDrawingOverlayTarget as $, type AnchorFrameOrigin as A, type HyperlinkOps as B, CHROME_GROUPS as C, type DocxEditorInstance as D, EMU_PER_POINT as E, type FinalizedImageOverlayInteraction as F, IMAGE_OVERLAY_NUDGE_SHIFT_PT as G, type HyperlinkActivation as H, IMAGE_OVERLAY_NUDGE_PT as I, type ImageInteractionSession as J, type ImageOverlayScrollPort as K, type ImageResizeHandle as L, type ImageResizeResult as M, type LoadFontsRequest as N, type OpenPaginatedResult as O, type PaginatedSurfaceOptions as P, type LoadFontsResult as Q, type OverlayFrameRect as R, type PaginatedSurfaceState as S, type TableCommandPlan as T, type ParagraphPropertyEdit as U, type RemoteCaretLabelAnchor as V, type RemoteCaretLabelHost as W, type ReviewWriteIntent as X, type RunTableChromeCommandResult as Y, type SectionAnchor as Z, type SectionBreakInsertType as _, type PaginatedSurface as a, tableChromeLabelKeyForTarget as a$, type SurfaceEquation as a0, type SurfaceFormatting as a1, type SurfaceHyperlink as a2, type SurfaceInsertImageInput as a3, type SurfaceNavigation as a4, type SurfaceOverlayCoordinates as a5, type SurfaceParagraphFormat as a6, TABLE_BORDER_STYLE_OPTIONS as a7, TABLE_BORDER_TARGET_OPTIONS as a8, TABLE_BORDER_WIDTH_OPTIONS as a9, createFontSource as aA, createImageOverlayScrollPort as aB, cssPixelsToLayoutPoints as aC, defaultChromeGroups as aD, defaultTableLabel as aE, emuToOverlayPoints as aF, equationAtPosition as aG, executeImageCommand as aH, finalizeImageOverlayInteraction as aI, formattingBarChromeGroups as aJ, isStaleImageInteractionCommit as aK, isTableChromeSlot as aL, layoutPointsToCssPixels as aM, loadFonts as aN, overlayFrameToSheetCssPixels as aO, overlayHostOrigin as aP, pointsToEmu as aQ, probeTableChromeCommand as aR, resizePreservesAspect as aS, runSave as aT, runTableChromeCommand as aU, runTableCommand as aV, runToolbarCommand as aW, selectedDrawingOverlayTargetOf as aX, selectedImageStateOf as aY, surfacePaintScale as aZ, tableChromeIconPaths as a_, TABLE_CHROME_SLOT_IDS as aa, type TableBorderStyleOption as ab, type TableBorderTargetOption as ac, type TableBorderTargetValue as ad, type TableBorderWidthOption as ae, type TableChromeDraft as af, type TableChromePick as ag, type TableChromeSlotId as ah, type TableInteractionLabelKey as ai, type ToolbarCommandState as aj, applyTableChromePick as ak, blankDocumentBytes as al, canExecuteImageCommand as am, captureImageMutationPreconditions as an, chromeControlCount as ao, chromeMenuSlots as ap, chromeProbeForSlot as aq, chromeSlotId as ar, chromeSlotIsToggle as as, commandForSlot as at, commandForSlotValue as au, commandForTableChromeSlotValue as av, computeImageResizeResult as aw, computeMovedImagePosition as ax, computeResizedImageExtentEmu as ay, createDocxEditor as az, CHROME_MENUS as b, tableChromeToolbarState as b0, tableChromeVisible as b1, tableCommandToolbarState as b2, toolbarCommandState as b3, toolbarCommandStates as b4, CHROME_UNAVAILABLE_KEY as c, type ChromeControl as d, type ChromeControlId as e, type ChromeControlState as f, type ChromeGroup as g, type ChromeGroupId as h, type ChromeMenu as i, type ChromeMenuEntry as j, type ChromeMenuId as k, type ChromeMenuItemEntry as l, type ChromeMenuSeparatorEntry as m, type ChromeMenuSubmenuEntry as n, type ChromeSlotId as o, DEFAULT_TABLE_CHROME_DRAFT as p, type DocxEditorConfig as q, type DrawingSelectionIntent as r, type EquationActivation as s, type EquationChromeHandlers as t, type EquationOps as u, type FontLoadFailure as v, type FontLoadFailureReason as w, type FontMeasurementState as x, type FontUrlSource as y, type HyperlinkChromeHandlers as z };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkF2K6SDHA_cjs=require('./chunk-F2K6SDHA.cjs');require('./chunk-ZKWRCLT2.cjs'),require('./chunk-O5M4CR4P.cjs'),require('./chunk-NDJGSR6M.cjs'),require('./chunk-2PIHW2QM.cjs'),require('./chunk-LBAHXZCU.cjs'),require('./chunk-DRQHIQ4R.cjs'),require('./chunk-5TKAPFZT.cjs'),require('./chunk-4Z5MODAE.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-KIAP7PFQ.cjs'),require('./chunk-NJNFJPGB.cjs'),require('./chunk-OHJQ7GPZ.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.Da}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.Ha}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.i}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.h}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.f}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.m}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.Ia}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.qa}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.sa}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.g}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.l}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.Ua}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.r}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.j}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.k}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.q}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.ya}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkF2K6SDHA_cjs.ua}});
1
+ 'use strict';var chunkQRC37MWG_cjs=require('./chunk-QRC37MWG.cjs');require('./chunk-ZKWRCLT2.cjs'),require('./chunk-AS7YZNQE.cjs');var chunkHOEWFH5U_cjs=require('./chunk-HOEWFH5U.cjs');require('./chunk-AVGCKH6A.cjs'),require('./chunk-LGFKIF4M.cjs'),require('./chunk-CDYVDQRI.cjs'),require('./chunk-PMHGONET.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-PXKZUTHX.cjs'),require('./chunk-Q4AB7E4O.cjs'),require('./chunk-2YH4MSHX.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-YL4Q5LZP.cjs'),require('./chunk-24APKZAN.cjs'),require('./chunk-OHJQ7GPZ.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.ua}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.ya}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.d}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.za}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.ha}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.ja}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.La}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.i}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.h}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.pa}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkQRC37MWG_cjs.la}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.g}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.f}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.c}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.d}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.j}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.h}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkHOEWFH5U_cjs.i}});
package/dist/index.d.ts CHANGED
@@ -1,23 +1,25 @@
1
- export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from './tree-op-types-D6HzlPR4.js';
1
+ export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from './tree-op-types-egdarvH_.js';
2
2
  export { Block, ColorValue, ContainerRef, ContentControl, ContentControlFilter, ContentControlType, DocAnchor, DocAnchorRange, DocComment, DocLocation, DocRange, DocTarget, DocumentBody, DocxDocument, DocxDocumentJSON, ExecErrorCode, ExecResult, Extent, FontDefinition, HeaderFooterSet, IndentFormatting, InsertableContentControlType, NumberingRef, PageMargins, Paragraph, ParagraphDisagreements, ParagraphFlags, ParagraphFormatCommand, ParagraphTabStop, Point, Rect, Revision, RevisionType, Run, RunFormatting, Section, SectionProperties, SelectionPin, StyleDefinition, StyleDefinitions, Table, TableCell, TableRow, Theme, ThemeColorScheme, Unsubscribe, Watermark } from './contracts/types.js';
3
- export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from './review-items-CCS1h93f.js';
3
+ export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from './review-items-DYRx187i.js';
4
4
  export { CollectReviewItems, EditorModule, ReviewModuleContribution } from './contracts/modules.js';
5
- export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, b as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorScope, R as EditorSelection, a as EditorSnapshot, F as FontConfiguration, m as FontFaceRequest, k as FontSource, l as FontSourceSubstitution, U as FormatPainterLevel, W as FormatPainterMode, o as FormatPainterSurfaceState, X as FurnitureVariant, Y as HeaderFooterSlotArgs, _ as HeaderFooterState, $ as HyperlinkInfo, I as ImageContext, c as ImageCropPercent, a0 as InteractionAffinity, a1 as InteractionOutcome, a2 as InteractionOutcomeCode, a3 as NoteKind, a4 as NotePropertiesSide, a5 as NotePropertiesState, a6 as PageSetup, a7 as ResolvedNoteNumbering, a8 as ReviewActivationOptions, a9 as ReviewCommentPlacement, aa as ReviewCustomPlacement, ab as ReviewItemPlacement, ac as ReviewItemPlacementBase, ad as ReviewItemQuery, ae as ReviewRevisionPlacement, S as SelectedImageState, af as SemanticIdentity, ag as SemanticTarget, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ah as TableBorderTarget, ai as TableCellVerticalAlignment, aj as TableColumnDividerResizeTarget, ak as TableColumnOccurrenceTarget, t as TableContext, al as TableRightEdgeResizeTarget, am as TableRowOccurrenceTarget, an as TextMatch, T as TrackedChangeFilterMode, e as TrackedChangePredicate, V as ViewScope, ao as ZoomFitTarget, Z as ZoomMode } from './editor-a6VvsfYU.js';
6
- export { R as RevisionDisplayMode } from './revision-projection-BeXVrSSV.js';
7
- export { S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-BmQ7h2cq.js';
8
- export { C as CHROME_GROUPS, b as CHROME_MENUS, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, q as DocxEditorConfig, D as DocxEditorInstance, F as FONT_RESOLVER_BRAND, v as FONT_RESOLVER_MARK_KEY, x as FontConfigurationBase, y as FontConfigurationFragment, z as FontLoadFailure, B as FontLoadFailureReason, G as FontMeasurementState, H as FontOrigin, I as FontResolutionRequest, J as FontResolver, K as FontResolverMark, L as FontUrlSource, M as HyperlinkActivation, N as HyperlinkChromeHandlers, Y as LoadFontsRequest, Z as LoadFontsResult, $ as MarkedFontResolver, ac as SurfaceHyperlink, at as ToolbarCommandState, au as WORD_DEFAULT_FONT, aw as blankDocumentBytes, aA as chromeMenuSlots, aE as commandForSlot, aF as commandForSlotValue, aH as composeFontConfiguration, aI as composeFontOrigins, aM as createDocxEditor, aN as createFontSource, aS as defineFontResolver, aY as isFontResolver, b0 as loadFonts, b9 as runToolbarCommand, bi as toolbarCommandState } from './index-C5ZnSRkF.js';
5
+ export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorScope, R as EditorSelection, d as EditorSnapshot, c as FontConfiguration, b as FontFaceRequest, F as FontSource, a as FontSourceSubstitution, U as FormatPainterLevel, W as FormatPainterMode, o as FormatPainterSurfaceState, X as FurnitureVariant, Y as HeaderFooterSlotArgs, _ as HeaderFooterState, $ as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, a0 as InteractionAffinity, a1 as InteractionOutcome, a2 as InteractionOutcomeCode, a3 as NoteKind, a4 as NotePropertiesSide, a5 as NotePropertiesState, a6 as PageSetup, a7 as ResolvedNoteNumbering, a8 as ReviewActivationOptions, a9 as ReviewCommentPlacement, aa as ReviewCustomPlacement, ab as ReviewItemPlacement, ac as ReviewItemPlacementBase, ad as ReviewItemQuery, ae as ReviewRevisionPlacement, S as SelectedImageState, af as SemanticIdentity, ag as SemanticTarget, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ah as TableBorderTarget, ai as TableCellVerticalAlignment, aj as TableColumnDividerResizeTarget, ak as TableColumnOccurrenceTarget, t as TableContext, al as TableRightEdgeResizeTarget, am as TableRowOccurrenceTarget, an as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, V as ViewScope, ao as ZoomFitTarget, Z as ZoomMode } from './editor-sRxrFJd8.js';
6
+ export { R as RevisionDisplayMode } from './revision-projection-DHRJH48u.js';
7
+ export { S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-DZsDmPg5.js';
8
+ export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-BYEHQGTw.js';
9
+ export { C as CHROME_GROUPS, b as CHROME_MENUS, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, q as DocxEditorConfig, D as DocxEditorInstance, v as FontLoadFailure, w as FontLoadFailureReason, x as FontMeasurementState, y as FontUrlSource, H as HyperlinkActivation, z as HyperlinkChromeHandlers, N as LoadFontsRequest, Q as LoadFontsResult, a2 as SurfaceHyperlink, aj as ToolbarCommandState, al as blankDocumentBytes, ap as chromeMenuSlots, at as commandForSlot, au as commandForSlotValue, az as createDocxEditor, aA as createFontSource, aN as loadFonts, aW as runToolbarCommand, b3 as toolbarCommandState } from './index-C3Gvq4jN.js';
9
10
  export { ApplyResult, ContentControlSummary, DocEdit, DocEdits, DocQueries, DocQuery, DocQueryResults, ParagraphSummary } from './contracts/document.js';
10
11
  import './collaboration.js';
11
- import './tree-package-fragment-CWFjgH6a.js';
12
- import './tree-store-APgWx6qn.js';
12
+ import './tree-package-fragment-DjkH4ESI.js';
13
+ import './hf-references-DTrHkktY.js';
14
+ import './tree-store-DKJB0IcA.js';
13
15
  import './collaboration/replication.js';
14
16
  import './failure-BnGjoXf0.js';
15
- import './semantic-records-92UnKeU_.js';
16
- import './omml-equation-BY49UOIF.js';
17
- import './semantic-paint-WJD2KeG1.js';
18
- import './note-properties-CDFiNXcD.js';
19
- import './custom-node-writes-DntmaAVW.js';
20
- import './semantic-cell-selection-BK91NCCG.js';
21
- import './tree-session-contract-B2HfGt79.js';
22
- import './document-properties-D6Ahr8D6.js';
17
+ import './semantic-records-EIdwId-a.js';
18
+ import './omml-equation-BpRmfDAf.js';
19
+ import './semantic-paint-f7SqN4oW.js';
20
+ import './note-properties-DSe8igrz.js';
21
+ import './custom-node-writes-C9ArIlJh.js';
22
+ import './semantic-cell-selection-BXVWCBYm.js';
23
+ import './tree-session-contract-CGOOgPjW.js';
24
+ import './headless-document-view-DELC4E5v.js';
23
25
  import 'prosemirror-model';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Da as CHROME_GROUPS,Ha as CHROME_MENUS,i as FONT_RESOLVER_BRAND,h as FONT_RESOLVER_MARK_KEY,f as WORD_DEFAULT_FONT,m as blankDocumentBytes,Ia as chromeMenuSlots,qa as commandForSlot,sa as commandForSlotValue,g as composeFontConfiguration,l as composeFontOrigins,Ua as createDocxEditor,r as createFontSource,j as defineFontResolver,k as isFontResolver,q as loadFonts,ya as runToolbarCommand,ua as toolbarCommandState}from'./chunk-KTAQ7BRQ.js';import'./chunk-D5EHDHYV.js';import'./chunk-VQ4R5LTU.js';import'./chunk-UKUOZXUD.js';import'./chunk-RIYSCEFQ.js';import'./chunk-2QTY5S6T.js';import'./chunk-MCDUQYWP.js';import'./chunk-MQP26KCF.js';import'./chunk-ZVTW7RGD.js';import'./chunk-FBA57EUJ.js';import'./chunk-6JIJOZDW.js';import'./chunk-OKEDGR65.js';import'./chunk-ZBEJHJN2.js';import'./chunk-GOEBQ26R.js';
1
+ export{ua as CHROME_GROUPS,ya as CHROME_MENUS,d as blankDocumentBytes,za as chromeMenuSlots,ha as commandForSlot,ja as commandForSlotValue,La as createDocxEditor,i as createFontSource,h as loadFonts,pa as runToolbarCommand,la as toolbarCommandState}from'./chunk-SB54HLFJ.js';import'./chunk-D5EHDHYV.js';import'./chunk-XCESLTJL.js';export{g as FONT_RESOLVER_BRAND,f as FONT_RESOLVER_MARK_KEY,c as WORD_DEFAULT_FONT,d as composeFontConfiguration,j as composeFontOrigins,h as defineFontResolver,i as isFontResolver}from'./chunk-MNUKSXRO.js';import'./chunk-RJSB6RJ7.js';import'./chunk-RIYSCEFQ.js';import'./chunk-5Y7AADI6.js';import'./chunk-Z4527AXR.js';import'./chunk-M52QXFKI.js';import'./chunk-VP7SDFCM.js';import'./chunk-PBOIGBDO.js';import'./chunk-QJYH6AYD.js';import'./chunk-KFELX7CN.js';import'./chunk-6JIJOZDW.js';import'./chunk-KXPVOPR5.js';import'./chunk-AREFLNUP.js';import'./chunk-GOEBQ26R.js';
@@ -1,4 +1,4 @@
1
- import { F as FontResourceSnapshot, b as TextShaper, V as VersionedShapingLibrary, N as NormalizationPolicy, c as FixedPointRoundingMode, R as ResolvedRunStyle, d as ResolvedFont, T as TextMeasurer } from './semantic-records-BpozY7-j.cjs';
1
+ import { d as ShapingEnvironmentInput, e as TextShaper, R as ResolvedRunStyle, f as ResolvedFont, T as TextMeasurer, F as FontResourceSnapshot, V as VersionedShapingLibrary, N as NormalizationPolicy, g as FixedPointRoundingMode, h as FontRequest } from './semantic-records-EIdwId-a.js';
2
2
 
3
3
  /** Immutable per-operation environment. Configuration, extension, shaping, and producer changes are
4
4
  * coarse gates; resource changes are compared through CacheProvenance.resourceDependencies. */
@@ -104,6 +104,9 @@ declare class ResolvedCache<V> {
104
104
  get size(): number;
105
105
  }
106
106
 
107
+ /** Fingerprinted, operation-wide portion of every shaping call. @public */
108
+ type LayoutShapingEnvironment = Omit<ShapingEnvironmentInput, 'font' | 'direction' | 'fallbackOrder'>;
109
+
107
110
  /**
108
111
  * A fully resolved shaping bundle: fonts, shaper, and the environment they were admitted
109
112
  * under. Produced by the editor lane's font configuration (`createLayoutShaping`) and
@@ -117,16 +120,7 @@ interface LayoutShapingOptions {
117
120
  readonly family: string;
118
121
  readonly sizeHalfPoints: number;
119
122
  };
120
- readonly environment: {
121
- readonly variationAxes: Readonly<Record<string, number>>;
122
- readonly shapingLibrary: VersionedShapingLibrary;
123
- readonly unicodeDataVersion: string;
124
- readonly normalization: NormalizationPolicy;
125
- readonly language: string;
126
- readonly features: Readonly<Record<string, number>>;
127
- readonly fixedPointScale: number;
128
- readonly roundingMode: FixedPointRoundingMode;
129
- };
123
+ readonly environment: LayoutShapingEnvironment;
130
124
  readonly ligatureCaretPolicy: 'cluster-edges-only';
131
125
  readonly operation: OperationSnapshot;
132
126
  }
@@ -155,6 +149,21 @@ interface ShapedMeasurerOptions {
155
149
  /** ISO 15924 script and BCP 47 language for shaping. Latin/English by default. */
156
150
  readonly script?: string;
157
151
  readonly language?: string;
152
+ /** Optional low-level shaping controls; omitted values preserve the released defaults. */
153
+ readonly normalization?: NormalizationPolicy;
154
+ readonly features?: Readonly<Record<string, number>>;
155
+ readonly roundingMode?: FixedPointRoundingMode;
156
+ }
157
+ /** Environment-bound production options that cannot drift from layout cache identity. @public */
158
+ interface LayoutEnvironmentShapedMeasurerOptions {
159
+ /** Shaper from the same admitted layout operation. */
160
+ readonly shaper: TextShaper;
161
+ /** Resolve a run to an admitted face, or null to use the bounded fallback. */
162
+ readonly resolveFont: (style: ResolvedRunStyle) => ResolvedFont | null;
163
+ /** Bounded measurement fallback when no admitted face resolves. */
164
+ readonly fallback: TextMeasurer;
165
+ /** Fingerprinted shaping environment; all geometry-affecting controls come from here. */
166
+ readonly environment: LayoutShapingOptions['environment'];
158
167
  }
159
168
  /**
160
169
  * A {@link TextMeasurer} that measures through the shaper rather than through a canvas.
@@ -164,5 +173,70 @@ interface ShapedMeasurerOptions {
164
173
  * throwing, because a document naming a font nobody has must still lay out.
165
174
  */
166
175
  declare function createShapedMeasurer(options: ShapedMeasurerOptions): TextMeasurer;
176
+ declare function createShapedMeasurer(options: LayoutEnvironmentShapedMeasurerOptions): TextMeasurer;
177
+ /**
178
+ * Bind measurement directly to the environment whose operation identity keys layout caches.
179
+ * Production browser/server hosts use this adapter so fingerprinted and executed shaping cannot
180
+ * drift through independently forwarded fields.
181
+ * @public
182
+ */
183
+ declare function createLayoutShapedMeasurer(shaping: LayoutShapingOptions, options: Pick<ShapedMeasurerOptions, 'resolveFont' | 'fallback'>): TextMeasurer;
184
+
185
+ /** Byte-backed face accepted by neutral shaping. @public */
186
+ interface LayoutFontSource {
187
+ readonly request: FontRequest;
188
+ readonly id: string;
189
+ readonly bytes: Uint8Array;
190
+ readonly hash: string;
191
+ readonly faceIndex: number;
192
+ readonly availability?: 'available' | 'forbidden';
193
+ }
194
+ /** Explicit face substitution accepted by neutral shaping. @public */
195
+ interface LayoutFontSubstitution {
196
+ readonly from: FontRequest;
197
+ readonly to: FontRequest;
198
+ readonly lineMetrics?: {
199
+ readonly heightEm: number;
200
+ readonly baselineEm: number;
201
+ };
202
+ }
203
+ /** Structural font configuration shared by browser and server hosts. @public */
204
+ interface LayoutFontConfiguration {
205
+ readonly epoch: number;
206
+ readonly maxFontBytes: number;
207
+ readonly sources: readonly LayoutFontSource[];
208
+ readonly substitutions?: readonly LayoutFontSubstitution[];
209
+ readonly defaultFont: {
210
+ readonly family: string;
211
+ readonly sizeHalfPoints: number;
212
+ };
213
+ readonly language?: string;
214
+ }
215
+ /** Optional measurements for resource-budget tests and host diagnostics. @public */
216
+ interface LayoutShapingInstrumentation {
217
+ readonly onFontByteCopy?: () => void;
218
+ readonly onFontHash?: () => void;
219
+ readonly onFontAdmission?: () => void;
220
+ }
221
+ /** Invalid host configuration caught before any bytes reach HarfBuzz. @public */
222
+ declare class LayoutShapingConfigurationError extends Error {
223
+ readonly code: "overLimit";
224
+ constructor(message: string);
225
+ }
226
+ declare const PREPARED_LAYOUT_FONT_CONFIGURATION_BRAND: unique symbol;
227
+ /** Opaque owned configuration shared by cache identity and font admission. @public */
228
+ interface PreparedLayoutFontConfiguration {
229
+ readonly [PREPARED_LAYOUT_FONT_CONFIGURATION_BRAND]: true;
230
+ /** Stable identity of the exact owned bytes and every layout-affecting font option. */
231
+ readonly fingerprint: string;
232
+ }
233
+ /** Copy and hash each usable face once for shared cache identity and admission. @public */
234
+ declare function prepareLayoutFontConfiguration(configuration: LayoutFontConfiguration, instrumentation?: LayoutShapingInstrumentation): PreparedLayoutFontConfiguration;
235
+ /** Stable identity for every layout-affecting font configuration input. @public */
236
+ declare function layoutFontConfigurationFingerprint(configuration: LayoutFontConfiguration): string;
237
+ /** Build one shaped-layout environment without importing an editor or DOM lane. @public */
238
+ declare function createLayoutShaping(configuration: LayoutFontConfiguration | PreparedLayoutFontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<LayoutShapingOptions>;
239
+ /** Release native resources held by a shaping environment. @public */
240
+ declare function disposeLayoutShaping(shaping: LayoutShapingOptions): void;
167
241
 
168
- export { type CacheLookup as C, type LayoutShapingOptions as L, type OperationSnapshot as O, ResolvedCache as R, type ShapedMeasurerOptions as S, type CacheMiss as a, type CacheProvenance as b, type OperationSnapshotField as c, type OperationSnapshotGuard as d, type ResourceDependencyProvenance as e, captureOperationSnapshot as f, createShapedMeasurer as g, guardOperationSnapshot as h };
242
+ export { type CacheLookup as C, type LayoutShapingInstrumentation as L, type OperationSnapshot as O, type PreparedLayoutFontConfiguration as P, ResolvedCache as R, type ShapedMeasurerOptions as S, type LayoutShapingOptions as a, type CacheMiss as b, type CacheProvenance as c, disposeLayoutShaping as d, type LayoutEnvironmentShapedMeasurerOptions as e, type LayoutFontConfiguration as f, type LayoutFontSource as g, type LayoutFontSubstitution as h, LayoutShapingConfigurationError as i, type LayoutShapingEnvironment as j, type OperationSnapshotField as k, type OperationSnapshotGuard as l, type ResourceDependencyProvenance as m, captureOperationSnapshot as n, createLayoutShapedMeasurer as o, createLayoutShaping as p, createShapedMeasurer as q, guardOperationSnapshot as r, layoutFontConfigurationFingerprint as s, prepareLayoutFontConfiguration as t };