@betteroffice/docx 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -6
- package/dist/chunk-47Q2FMFF.mjs +1 -0
- package/dist/chunk-6LQJAKOC.mjs +1 -0
- package/dist/chunk-ACGKK7IB.mjs +1 -0
- package/dist/{chunk-PI2I3TO5.mjs → chunk-AFMVSI4Z.mjs} +2 -2
- package/dist/chunk-GD4VNJ64.mjs +1 -0
- package/dist/{chunk-BUZ2X5CT.mjs → chunk-JHJLG4I6.mjs} +1 -1
- package/dist/chunk-PGMXWI5X.mjs +1 -0
- package/dist/{chunk-VRGUAKOC.mjs → chunk-WTFRNX5K.mjs} +1 -1
- package/dist/collaboration/index.d.mts +6 -6
- package/dist/{content-DrqzbIr7.d.mts → content-CvEtPl0c.d.mts} +59 -6
- package/dist/core.d.mts +7 -7
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-DGDR-OWc.d.mts → displayListQueries-DF8F6fMl.d.mts} +2 -2
- package/dist/docx/index.d.mts +3 -3
- package/dist/docx/index.mjs +1 -1
- package/dist/editor/index.d.mts +20 -11
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-DnixuYST.d.mts → fontLoader-b8eicJKV.d.mts} +1 -1
- package/dist/{formatting-BqrFPeev.d.mts → formatting-7zKCTu5a.d.mts} +3 -2
- package/dist/{frameDelta-DMgR8n13.d.mts → frameDelta-pA4jrQ1G.d.mts} +3 -2
- 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-ImoMd0Ju.d.mts → index-CHl2zLJ7.d.mts} +117 -15
- package/dist/layout/index.d.mts +4 -4
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +4 -4
- package/dist/layout/pagination/index.mjs +1 -1
- package/dist/layout/render/index.d.mts +10 -10
- package/dist/layout/render/index.mjs +1 -1
- package/dist/plugin-api/RenderedDomContext.d.mts +7 -7
- package/dist/plugin-api/index.d.mts +3 -3
- package/dist/plugin-api/resolveItemPositions.d.mts +3 -3
- package/dist/{rustDisplayList-B9dQoLHI.d.mts → rustDisplayList-BJqaN9tt.d.mts} +2 -2
- package/dist/styles/index.d.mts +5 -9
- package/dist/styles/index.mjs +1 -1
- package/dist/{styles-CMybYYHS.d.mts → styles-7e-mq3c-.d.mts} +1 -1
- package/dist/types/content.d.mts +2 -2
- package/dist/types/document.d.mts +7 -6
- package/dist/{types-CXLxVF1t.d.mts → types-C4A8mWjU.d.mts} +19 -3
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/index.d.mts +4 -4
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/stylePreview.d.mts +2 -2
- package/dist/wasm-7SOSHNGP.mjs +1 -0
- package/dist/{wasm-T2CRCO7S.mjs → wasm-ZQAVP7P2.mjs} +1 -1
- package/dist/wasm-edit.d.mts +35 -27
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/wasm-parse.d.mts +2 -1
- package/dist/wasm-parse.mjs +1 -1
- package/dist/yrs/index.d.mts +5 -5
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-24DL53QL.mjs +0 -1
- package/dist/chunk-GHEHBYQK.mjs +0 -1
- package/dist/chunk-HTDNSQ44.mjs +0 -1
- package/dist/chunk-TMHG7OAZ.mjs +0 -1
- package/dist/chunk-WBH3SXI6.mjs +0 -1
- package/dist/wasm-CJHQHBDE.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from './types/document.mjs';
|
|
2
|
-
import { R as RetainedFrame } from './frameDelta-
|
|
2
|
+
import { R as RetainedFrame } from './frameDelta-pA4jrQ1G.mjs';
|
|
3
3
|
|
|
4
4
|
type CollaborationUpdateOrigin = 'local' | 'remote';
|
|
5
5
|
interface CollaborationReplica {
|
|
@@ -134,6 +134,91 @@ declare function residentCaretDeviceRect(rect: Pick<YrsResidentCaretRect, 'x' |
|
|
|
134
134
|
};
|
|
135
135
|
declare function residentCaretSnapshotForFrame(snapshot: YrsResidentCaretSnapshot, frame: RetainedFrame): YrsResidentCaretSnapshot | null;
|
|
136
136
|
|
|
137
|
+
type ResidentEngineWorkerRequest = {
|
|
138
|
+
id: number;
|
|
139
|
+
type: 'bootstrap';
|
|
140
|
+
snapshot: YrsResidentWorkerSnapshot;
|
|
141
|
+
extras: string;
|
|
142
|
+
expectedFrameEpoch: number;
|
|
143
|
+
} | {
|
|
144
|
+
id: number;
|
|
145
|
+
type: 'sync';
|
|
146
|
+
snapshot: YrsResidentWorkerSnapshot;
|
|
147
|
+
extras: string;
|
|
148
|
+
expectedFrameEpoch: number;
|
|
149
|
+
paintCaret: boolean;
|
|
150
|
+
} | {
|
|
151
|
+
id: number;
|
|
152
|
+
type: 'buildFrame';
|
|
153
|
+
extras: string;
|
|
154
|
+
expectedFrameEpoch: number;
|
|
155
|
+
paintCaret: boolean;
|
|
156
|
+
} | {
|
|
157
|
+
id: number;
|
|
158
|
+
type: 'applyInput';
|
|
159
|
+
text: string;
|
|
160
|
+
selection: YrsSelection;
|
|
161
|
+
expectedFrameEpoch: number;
|
|
162
|
+
profile: boolean;
|
|
163
|
+
paintCaret: boolean;
|
|
164
|
+
} | {
|
|
165
|
+
id: number;
|
|
166
|
+
type: 'applyDelete';
|
|
167
|
+
direction: 'backward' | 'forward';
|
|
168
|
+
selection: YrsSelection;
|
|
169
|
+
expectedFrameEpoch: number;
|
|
170
|
+
profile: boolean;
|
|
171
|
+
paintCaret: boolean;
|
|
172
|
+
} | {
|
|
173
|
+
id: number;
|
|
174
|
+
type: 'applyUpdate';
|
|
175
|
+
update: Uint8Array;
|
|
176
|
+
selection: YrsSelection | null;
|
|
177
|
+
} | {
|
|
178
|
+
id: number;
|
|
179
|
+
type: 'attachCanvases';
|
|
180
|
+
pages: Array<{
|
|
181
|
+
pageId: string;
|
|
182
|
+
canvas: OffscreenCanvas;
|
|
183
|
+
}>;
|
|
184
|
+
activePageIds: string[];
|
|
185
|
+
devicePixelRatio: number;
|
|
186
|
+
zoom: number;
|
|
187
|
+
caretStyle: ResidentCaretPaintStyle;
|
|
188
|
+
} | {
|
|
189
|
+
id: number;
|
|
190
|
+
type: 'eraseCaret';
|
|
191
|
+
} | {
|
|
192
|
+
id: number;
|
|
193
|
+
type: 'destroy';
|
|
194
|
+
};
|
|
195
|
+
type ResidentEngineWorkerResponse = {
|
|
196
|
+
id: number;
|
|
197
|
+
ok: true;
|
|
198
|
+
frame?: ArrayBuffer;
|
|
199
|
+
updates?: ArrayBuffer[];
|
|
200
|
+
engineMs?: number;
|
|
201
|
+
workerTotalMs?: number;
|
|
202
|
+
engineProfile?: YrsEngineApplyProfile;
|
|
203
|
+
caret?: YrsResidentCaretSnapshot;
|
|
204
|
+
selection?: YrsSelection | null;
|
|
205
|
+
/** The presented frame carries the worker-painted caret line. */
|
|
206
|
+
caretPainted?: boolean;
|
|
207
|
+
replayMs?: number;
|
|
208
|
+
replayedPages?: number;
|
|
209
|
+
layoutRevision?: number;
|
|
210
|
+
/** The worker replica's yrs state vector after this operation, so the
|
|
211
|
+
* next sync can ship a diff instead of the whole document state. */
|
|
212
|
+
stateVector?: ArrayBuffer;
|
|
213
|
+
} | {
|
|
214
|
+
id: number;
|
|
215
|
+
ok: false;
|
|
216
|
+
error: string;
|
|
217
|
+
residentUnavailable?: boolean;
|
|
218
|
+
/** A wasm trap poisoned the worker; it refuses every later request. */
|
|
219
|
+
terminal?: boolean;
|
|
220
|
+
};
|
|
221
|
+
|
|
137
222
|
interface ResidentEngineWorkerFrame {
|
|
138
223
|
frame: Uint8Array;
|
|
139
224
|
updates: Uint8Array[];
|
|
@@ -155,17 +240,24 @@ interface ResidentEngineOffscreenPage {
|
|
|
155
240
|
interface ResidentEngineWorkerApplyResult extends ResidentEngineWorkerFrame {
|
|
156
241
|
applied: true;
|
|
157
242
|
}
|
|
243
|
+
interface ResidentEngineWorkerPort {
|
|
244
|
+
onmessage: ((event: MessageEvent<ResidentEngineWorkerResponse>) => void) | null;
|
|
245
|
+
onerror: ((event: ErrorEvent) => void) | null;
|
|
246
|
+
onmessageerror: ((event: MessageEvent) => void) | null;
|
|
247
|
+
postMessage(message: ResidentEngineWorkerRequest, transfer?: Transferable[]): void;
|
|
248
|
+
terminate(): void;
|
|
249
|
+
}
|
|
158
250
|
/** Dedicated-worker owner for resident input, pagination, and FrameDelta output. */
|
|
159
251
|
declare class ResidentEngineWorkerClient {
|
|
160
252
|
private readonly worker;
|
|
161
253
|
private readonly pending;
|
|
162
254
|
private nextId;
|
|
163
|
-
private
|
|
255
|
+
private terminalError;
|
|
164
256
|
private ready;
|
|
165
257
|
private revision;
|
|
166
258
|
private remoteVector;
|
|
167
259
|
private appliedFontsRevision;
|
|
168
|
-
constructor();
|
|
260
|
+
constructor(worker?: ResidentEngineWorkerPort);
|
|
169
261
|
isReady(): boolean;
|
|
170
262
|
layoutRevision(): number;
|
|
171
263
|
/** The worker replica's last reported yrs state vector (null before any). */
|
|
@@ -191,7 +283,10 @@ declare class ResidentEngineWorkerClient {
|
|
|
191
283
|
/** Record a successfully applied bootstrap/sync payload's fonts revision.
|
|
192
284
|
* The state vector is tracked centrally in `onmessage`. */
|
|
193
285
|
private recordSync;
|
|
194
|
-
private
|
|
286
|
+
private fail;
|
|
287
|
+
}
|
|
288
|
+
/** The worker itself failed (crash, timeout, torn-down, corrupt reply). */
|
|
289
|
+
declare class ResidentWorkerFailureError extends Error {
|
|
195
290
|
}
|
|
196
291
|
declare function canUseResidentEngineWorker(): boolean;
|
|
197
292
|
|
|
@@ -546,6 +641,9 @@ type YrsRawOp = {
|
|
|
546
641
|
};
|
|
547
642
|
/** Host context for {@link YrsSession.yrsBlocksForStory} (theme + list numbering). */
|
|
548
643
|
interface YrsRenderEnv {
|
|
644
|
+
tocStyleIds?: string[];
|
|
645
|
+
paragraphSpacingLinePx?: number;
|
|
646
|
+
defaultParagraphStyleId?: string;
|
|
549
647
|
/** Theme color name → hex (`accent1` → `4472C4`), for theme-color resolution. */
|
|
550
648
|
themeColors?: Record<string, string>;
|
|
551
649
|
/** The document default tab stop in twips. */
|
|
@@ -554,6 +652,8 @@ interface YrsRenderEnv {
|
|
|
554
652
|
pageContentHeight?: number | null;
|
|
555
653
|
/** yrs revision/paragraph id → dense numeric layout id (list markers, revisions). */
|
|
556
654
|
numericIds?: Record<string, number>;
|
|
655
|
+
/** Include hidden text in visible layout without changing the document. */
|
|
656
|
+
showHiddenText?: boolean;
|
|
557
657
|
}
|
|
558
658
|
/** Receipt of {@link YrsSession.addComment}. */
|
|
559
659
|
interface YrsCommentReceipt {
|
|
@@ -801,6 +901,11 @@ interface YrsSession extends CollaborationReplica {
|
|
|
801
901
|
layoutFontRequirementsJson(input: string): string;
|
|
802
902
|
/** Paginate and compose section/page regions in the resident engine. */
|
|
803
903
|
layoutDocumentWithRegionsJson(input: string): string;
|
|
904
|
+
/** Same pass, but the reply omits the measured arena (fetch it on demand
|
|
905
|
+
* through {@link YrsSession.retainedKernelInputsJson}). */
|
|
906
|
+
layoutDocumentWithRegionsRetainedJson(input: string): string;
|
|
907
|
+
/** Retained `{ measured, options }` for the main-thread display fallback. */
|
|
908
|
+
retainedKernelInputsJson(expectedLayoutRevision: number): string;
|
|
804
909
|
/** Build display primitives against the session's resident font store. */
|
|
805
910
|
buildDisplayListJson(input: string): string;
|
|
806
911
|
/** Build a binary FrameDelta v1 against the last host-applied frame. */
|
|
@@ -858,7 +963,7 @@ interface YrsSession extends CollaborationReplica {
|
|
|
858
963
|
/** Applies a remote/incremental yrs v1 update. */
|
|
859
964
|
applyUpdate(update: Uint8Array): CollaborationTextInsertion | null;
|
|
860
965
|
/** Apply a same-user worker update under the local undo origin. @internal */
|
|
861
|
-
applyLocalUpdate(update: Uint8Array
|
|
966
|
+
applyLocalUpdate(update: Uint8Array): void;
|
|
862
967
|
/**
|
|
863
968
|
* Subscribes to every committed transaction's v1 update (local AND
|
|
864
969
|
* applied-remote). Returns an unsubscribe function.
|
|
@@ -880,20 +985,15 @@ interface YrsSession extends CollaborationReplica {
|
|
|
880
985
|
setCellSelection(range: YrsTableRange): void;
|
|
881
986
|
/** Resolve the current sticky cell selection, or null before initialization. */
|
|
882
987
|
cellSelection(): YrsTableRange | null;
|
|
883
|
-
/**
|
|
884
|
-
beginUndoCapture(
|
|
885
|
-
/**
|
|
886
|
-
|
|
887
|
-
/** Coalesce the stack entries added since `startDepth` into one host undo intent. */
|
|
888
|
-
markUndoGroup(startDepth: number): void;
|
|
988
|
+
/** Begin local-origin undo capture once import/seeding has completed. */
|
|
989
|
+
beginUndoCapture(): void;
|
|
990
|
+
/** Stories changed by the latest undo or redo, sorted. */
|
|
991
|
+
historyStories(): string[];
|
|
889
992
|
/** Undo/redo only local-origin direct operations (never remote/system transactions). */
|
|
890
993
|
undo(): boolean;
|
|
891
994
|
redo(): boolean;
|
|
892
995
|
canUndo(): boolean;
|
|
893
996
|
canRedo(): boolean;
|
|
894
|
-
/** Current local undo/redo stack sizes (zero before tracking starts). */
|
|
895
|
-
undoDepth(): number;
|
|
896
|
-
redoDepth(): number;
|
|
897
997
|
/** Adds a story with one paragraph; the receipt carries its paraId. */
|
|
898
998
|
createStory(storyId: string, initialText: string, pStyle?: string, alignment?: string): YrsParagraphReceipt;
|
|
899
999
|
/** Removes a complete story (including an unreachable table-cell story). */
|
|
@@ -979,6 +1079,8 @@ interface YrsSession extends CollaborationReplica {
|
|
|
979
1079
|
insertWatermark(at: YrsLoc, watermark: YrsWatermark): void;
|
|
980
1080
|
/** Applies raw story operations in one transaction. */
|
|
981
1081
|
applyRawOps(story: string, ops: readonly YrsRawOp[]): void;
|
|
1082
|
+
/** Applies seed raw operations with deterministic item ordering. */
|
|
1083
|
+
applySeedRawOps(story: string, ops: readonly YrsRawOp[]): void;
|
|
982
1084
|
/** Sets one paragraph property (any JSON value). `paraId` is reserved. */
|
|
983
1085
|
setParagraphAttr(paraId: string, key: string, value: unknown): void;
|
|
984
1086
|
/** Adds a sticky-anchored comment over one or more ranges. */
|
|
@@ -1037,4 +1139,4 @@ interface CreateYrsSessionOptions {
|
|
|
1037
1139
|
*/
|
|
1038
1140
|
declare function createYrsSession(options?: CreateYrsSessionOptions): Promise<YrsSession>;
|
|
1039
1141
|
|
|
1040
|
-
export { type
|
|
1142
|
+
export { type YrsParagraphSpan as $, type ResidentEngineWorkerFrame as A, ResidentWorkerFailureError as B, type CollaborationReplica as C, type YrsAuthor as D, type YrsCellBorder as E, type YrsCellBorders as F, type YrsCellLoc as G, type YrsChangeTarget as H, type YrsCommentReceipt as I, type YrsContentControlValue as J, type YrsDocxHost as K, type YrsEngineApplyProfile as L, type YrsHyperlinkAttrs as M, type YrsImageGeometry as N, type YrsInlineFormatDelta as O, type YrsInputParagraphSeed as P, type YrsInputParagraphSpan as Q, type ResidentCaretPaintStyle as R, type YrsInputPositionMap as S, type YrsNumberingProperties as T, type YrsParaOffset as U, type YrsParagraph as V, type YrsParagraphAttrs as W, type YrsParagraphLength as X, type YrsSession as Y, type YrsParagraphReceipt as Z, type YrsParagraphSeed as _, type YrsRenderEnv as a, type YrsParagraphTabStop as a0, type YrsRawOp as a1, type YrsResidentCaretRect as a2, type YrsResidentCaretSnapshot as a3, type YrsResidentWorkerSnapshot as a4, type YrsResidentWorkerSyncOptions as a5, type YrsResolveReceipt as a6, type YrsResolvedCommentAnchor as a7, type YrsRevisionReceipt as a8, type YrsRunMark as a9, type YrsSelectionContext as aa, type YrsSplitReceipt as ab, type YrsStickyPosition as ac, type YrsStoryRange as ad, type YrsStorySeed as ae, type YrsStorySegment as af, type YrsTableLoc as ag, type YrsTableRange as ah, type YrsTableReceipt as ai, type YrsTextColor as aj, type YrsTriState as ak, type YrsWatermark as al, canUseResidentEngineWorker as am, compareYrsLocs as an, createYrsInputPositionMap as ao, createYrsSession as ap, displayPositionToYrsLoc as aq, documentToYrs as ar, residentCaretDeviceRect as as, residentCaretSnapshotForFrame as at, sameYrsSelection as au, yrsLocToDisplayPosition as av, yrsToDocument as aw, type CollaborationTransport as b, type CollaborationProviderOptions as c, type CollaborationStatus as d, type CollaborationPeer as e, type CollaborationCursor as f, type CollaborationPeerListener as g, type CollaborationStatusListener as h, type CollaborationErrorListener as i, type YrsSelection as j, type CollaborationAwarenessState as k, CollaborationError as l, type CollaborationErrorCode as m, type CollaborationPresence as n, type CollaborationResolvedUser as o, type CollaborationStatusChange as p, type CollaborationTextInsertion as q, type CollaborationTransportEvent as r, type CollaborationUpdateOrigin as s, type CollaborationUser as t, type YrsLoc as u, type YrsRevisionInfo as v, type CreateYrsSessionOptions as w, type ResidentEngineOffscreenPage as x, type ResidentEngineWorkerApplyResult as y, ResidentEngineWorkerClient as z };
|
package/dist/layout/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { B as BundledFontProvider } from '../rustMeasureSource-C0EZB055.mjs';
|
|
2
2
|
export { a as BundledFontProviderSource, E as EmbeddedFaceInput, F as FontScript, b as ResidentFontRequirement, R as ResidentMeasurementConfig, c as RustMeasureSource, d as RustTextEngine, e as createRustMeasureSource, g as getRustTextEngine } from '../rustMeasureSource-C0EZB055.mjs';
|
|
3
|
-
import {
|
|
4
|
-
export { D as DrawingScene, V as DrawingSceneNode,
|
|
3
|
+
import { f as SectionProperties, H as HeaderFooter } from '../content-CvEtPl0c.mjs';
|
|
4
|
+
export { D as DrawingScene, V as DrawingSceneNode, b as ShapeEffect, aX as ShapeFillPaint, aY as ShapeStrokePaint, c as ShapeTextBodyProperties } from '../content-CvEtPl0c.mjs';
|
|
5
5
|
import { Document } from '../types/document.mjs';
|
|
6
|
-
import '../formatting-
|
|
6
|
+
import '../formatting-7zKCTu5a.mjs';
|
|
7
7
|
import '../docx/wrapTypes.mjs';
|
|
8
|
-
import '../styles-
|
|
8
|
+
import '../styles-7e-mq3c-.mjs';
|
|
9
9
|
|
|
10
10
|
/** Opt-in bundled-font provider resolution. @packageDocumentation */
|
|
11
11
|
|
package/dist/layout/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,e,g as g$1,c,f,b as b$1}from'../chunk-TTRUPDAB.mjs';var I={},R;function L(s){if(s===void 0)return;let e=typeof s=="string"?s:s.href,t=typeof location>"u"?void 0:location.href;try{return new URL(e,t)}catch{throw new TypeError(`configureDefaultFonts baseUrl must be absolute when no browser location exists: ${e}`)}}function U(){return I.fonts!==void 0||I.load!==void 0}function H(s){I={...s,baseUrl:L(s.baseUrl)},R=void 0,I.baseUrl!==void 0&&!U()&&console.warn("[configureDefaultFonts] a baseUrl on its own loads nothing \u2014 the face manifest lives in @betteroffice/fonts. Pass the module too: configureDefaultFonts({ fonts, baseUrl }).");}async function K(){let{baseUrl:s,fonts:e,load:t}=I;try{return (e??await t()).createFontProvider(s===void 0?void 0:{baseUrl:s})}catch(r){console.warn("[configureDefaultFonts] the configured font source failed to load",r);return}}function M(){if(!U())return Promise.resolve(void 0);if(R===void 0){let s=K();s.then(e=>{e===void 0&&R===s&&(R=void 0);}),R=s;}return R}function $(s){return s.trim().toLowerCase()}function C(s,e,t){return `${$(s)}|${e?1:0}|${t?1:0}`}function k(s,e,t,r){t.then(n=>{r(n)&&s.get(e)===t&&s.delete(e);},()=>{s.get(e)===t&&s.delete(e);});}var x=class{constructor(e,t){b$1(this,"sink");b$1(this,"bundledSource");b$1(this,"bundledPromise");b$1(this,"warnedFallback",false);b$1(this,"facesByFamily",new Map);b$1(this,"faceIds",new WeakMap);b$1(this,"bundledIds",new Map);b$1(this,"lastResortIds",new Map);b$1(this,"bufferIds",new WeakMap);b$1(this,"scriptIds",new Map);b$1(this,"scriptResults",new Map);b$1(this,"chains",new Map);b$1(this,"chainResults",new Map);b$1(this,"generation",0);this.sink=e,this.bundledSource=t?.bundled;}bundled(){if(this.bundledPromise===void 0){let e=this.bundledSource,t=Promise.resolve().then(()=>typeof e=="function"?e():e).catch(()=>{});t.then(r=>{r===void 0&&this.bundledPromise===t&&(this.bundledPromise=void 0);}),this.bundledPromise=t;}return this.bundledPromise}setEmbeddedFaces(e){this.generation++,this.facesByFamily=new Map;for(let t of e){let r=$(t.family),n=this.facesByFamily.get(r);n?n.push(t):this.facesByFamily.set(r,[t]);}this.chains=new Map,this.chainResults=new Map;}getFontIdChain(e,t,r){let n=C(e,t,r),o=this.chains.get(n);if(!o){let i=this.chains,a=this.chainResults,f=this.generation,u=this.resolveChain(e,t,r);u.then(l=>{f===this.generation&&(a.set(n,l),l.retryable&&i.get(n)===u&&i.delete(n));},()=>{i.get(n)===u&&i.delete(n);}),i.set(n,u),o=u;}return o.then(i=>i.ids)}getCachedFontIdChain(e,t,r){let n=C(e,t,r),o=this.chainResults.get(n);if(o?.retryable){let i=this.chainResults;queueMicrotask(()=>{i.get(n)===o&&i.delete(n);});}return o?.ids}getScriptFallbackIds(e){let t=[...new Set(e)];return Promise.all(t.map(r=>this.resolveScript(r))).then(r=>{let n=[];for(let{id:o}of r)o!==null&&!n.includes(o)&&n.push(o);return n})}getCachedScriptFallbackIds(e){let t=this.scriptResults,r=[];for(let o of e){let i=t.get(o);if(!i)return;r.push([o,i]);}let n=[];for(let[o,i]of r){let{id:a}=i;a!==null&&!n.includes(a)&&n.push(a),i.retryable&&queueMicrotask(()=>{t.get(o)===i&&t.delete(o);});}return n}clear(){this.generation++,this.bundledPromise=void 0,this.faceIds=new WeakMap,this.bundledIds=new Map,this.lastResortIds=new Map,this.bufferIds=new WeakMap,this.scriptIds=new Map,this.scriptResults=new Map,this.chains=new Map,this.chainResults=new Map;}async resolveChain(e,t,r){let n=C(e,t,r),o=[],i=false,a=this.pickEmbeddedFace(e,t,r);if(a){let d=await this.registerFace(a);d!==null?o.push(d):i=true;}let f=await this.bundled();f===void 0&&typeof this.bundledSource=="function"&&(i=true);let u;try{u=f?.resolve(e,t,r);}catch(d){i=true,console.warn(`[fontRegistry] bundled face resolver for "${e}" failed; falling back: ${d instanceof Error?d.message:String(d)}`);}if(u){let d=await this.registerBundled(n,u,e);d!==null&&!o.includes(d)&&o.push(d),d===null&&(i=true);}let l;try{l=f?.resolveLastResort?.(e,t,r);}catch(d){i=true,console.warn(`[fontRegistry] last-resort resolver for "${e}" failed; falling back: ${d instanceof Error?d.message:String(d)}`);}if(l){let d=await this.registerLastResort(n,l,e);d!==null&&!o.includes(d)&&o.push(d),d===null&&(i=true);}return o.length===0&&this.warnFallback(e,f!==void 0,u!==void 0||l!==void 0),{ids:o,retryable:i}}warnFallback(e,t,r){if(this.warnedFallback)return;this.warnedFallback=true;let n="Native measurement is unsupported; browser hosts fall back to measureText and may use different OS fonts, so pagination can vary. Reported once per registry.";console.warn(r?`[fontRegistry] no font bytes for "${e}" \u2014 the font provider resolved but every matching face failed to load. ${n} If a bundler inlined @betteroffice/fonts, mark it external so its asset URLs resolve.`:t?`[fontRegistry] no font bytes for "${e}" \u2014 the configured font provider has no matching face. Add coverage for this family. ${n}`:`[fontRegistry] no font bytes for "${e}" \u2014 no font provider is configured. Install @betteroffice/fonts and pass it with configureDefaultFonts({ fonts }). `+n);}pickEmbeddedFace(e,t,r){let n=this.facesByFamily.get($(e));if(!n)return;let o=t?"bold":"normal",i=r?"italic":"normal";return n.find(a=>a.weight===o&&a.style===i)??n.find(a=>a.weight==="normal"&&a.style==="normal")}registerBuffer(e){let t=this.bufferIds.get(e);if(!t){let r=this.bufferIds;t=Promise.resolve().then(()=>this.sink.registerFont(new Uint8Array(e))),k(r,e,t,()=>false),r.set(e,t);}return t}registerFace(e){let t=this.faceIds.get(e);if(!t){let r=this.faceIds;t=(async()=>{try{return await this.registerBuffer(e.data)}catch{return console.warn(`[fontRegistry] embedded face "${e.family}" (${e.weight} ${e.style}) was rejected by the text engine; falling back`),null}})(),k(r,e,t,n=>n===null),r.set(e,t);}return t}registerBundled(e,t,r){let n=this.bundledIds.get(e);if(!n){let o=this.bundledIds;n=(async()=>{try{let i=await t();return await this.registerBuffer(i)}catch(i){return console.warn(`[fontRegistry] bundled face for "${r}" failed to load or register; falling back: ${i instanceof Error?i.message:String(i)}`),null}})(),k(o,e,n,i=>i===null),o.set(e,n);}return n}registerLastResort(e,t,r){let n=this.lastResortIds.get(e);if(!n){let o=this.lastResortIds;n=(async()=>{try{let i=await t();return await this.registerBuffer(i)}catch{return console.warn(`[fontRegistry] last-resort base face for "${r}" failed to load or register; falling back`),null}})(),k(o,e,n,i=>i===null),o.set(e,n);}return n}resolveScript(e){let t=this.scriptIds.get(e);if(!t){let r=this.scriptIds,n=this.scriptResults;t=(async()=>{let o=null,i=false,a=await this.bundled();a===void 0&&typeof this.bundledSource=="function"&&(i=true);let f;try{f=a?.resolveScriptFallback?.(e,!1,!1);}catch(l){i=true,console.warn(`[fontRegistry] script-fallback resolver for "${e}" failed; falling back: ${l instanceof Error?l.message:String(l)}`);}if(f)try{let l=await f();o=await this.registerBuffer(l);}catch(l){i=true,console.warn(`[fontRegistry] script-fallback face for "${e}" failed to load or register; falling back: ${l instanceof Error?l.message:String(l)}`);}let u={id:o,retryable:i};return n.set(e,u),u})(),k(r,e,t,o=>o.retryable),r.set(e,t);}return t}};var q=null;function j(){return q??(q=import('../wasm-T2CRCO7S.mjs').then(async s=>(await s.preloadLayoutWasm(),{registerFont:s.registerMeasureFont,clearFonts:s.clearMeasureFonts}))),q}function V(s){let e=new x({registerFont:r=>s.engine.registerFont(r)},{bundled:s.bundled??M}),t;return {setEmbeddedFaces(r){e.setEmbeddedFaces(r);},setCompat(r){t=r;},async prepareFontRequirements(r){return (await Promise.all(r.flatMap(o=>[(async()=>{try{return e.getCachedFontIdChain(o.family,o.bold,o.italic)!==void 0?!1:(await e.getFontIdChain(o.family,o.bold,o.italic),!0)}catch{return false}})(),...Array.from(new Set(o.scripts??[]),async i=>{try{return e.getCachedScriptFallbackIds([i])!==void 0?!1:(await e.getScriptFallbackIds([i]),!0)}catch{return false}})]))).some(Boolean)},measurementConfigForRequirements(r){let n={};for(let o of r){let i=e.getCachedFontIdChain(o.family,o.bold,o.italic),a=e.getCachedScriptFallbackIds(o.scripts??[]);if(i===void 0||a===void 0)return;let f=Array.from(i);for(let u of a)f.includes(u)||f.push(u);f.length>0&&(n[o.key]=f);}return {fontChains:n,defaults:{fontSize:11,fontFamily:"Calibri"},compat:{noLeading:t?.noLeading??false,doNotExpandShiftReturn:t?.doNotExpandShiftReturn??false},authoritativeShaping:true}},clear(){e.clear();}}}var _=1056;function G(s,e){let t=s?.package.headers,r=s?.package.footers,n=e?.headerReferences?.find(F=>F.type==="default"),o=e?.headerReferences?.find(F=>F.type==="first"),i=e?.footerReferences?.find(F=>F.type==="default"),a=e?.footerReferences?.find(F=>F.type==="first"),f=n?t?.get(n.rId)??null:null,u=i?r?.get(i.rId)??null:null,l=o?t?.get(o.rId)??null:null,d=a?r?.get(a.rId)??null:null;return e?.titlePg||(f??(f=l),u??(u=d)),{header:f,footer:u,firstHeader:l,firstFooter:d}}var g,b,m,y,w,B,T,A=class{constructor(){d(this,B);d(this,g,0);d(this,b,0);d(this,m,false);d(this,y,false);d(this,w,new Set);}setStateSeq(e$1){e(this,g,e$1);}incrementStateSeq(){return ++g$1(this,g)._}getStateSeq(){return c(this,g)}getRenderSeq(){return c(this,b)}onLayoutStart(){e(this,m,true);}onLayoutComplete(e$1){e(this,b,e$1),e(this,m,false),c(this,y)&&this.isSafeToRender()&&(e(this,y,false),f(this,B,T).call(this));}isSafeToRender(){return !c(this,m)&&c(this,b)>=c(this,g)}requestRender(){this.isSafeToRender()?f(this,B,T).call(this):e(this,y,true);}onRender(e){return c(this,w).add(e),()=>c(this,w).delete(e)}reset(){e(this,g,0),e(this,b,0),e(this,m,false),e(this,y,false);}getDebugInfo(){return {stateSeq:c(this,g),renderSeq:c(this,b),layoutUpdating:c(this,m),hasPendingRender:c(this,y),isSafe:this.isSafeToRender()}}};g=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakMap,B=new WeakSet,T=function(){for(let e of c(this,w))try{e();}catch(t){console.error("LayoutSelectionGate: render callback error",t);}};export{_ as DEFAULT_PAGE_HEIGHT_PX,A as LayoutSelectionGate,H as configureDefaultFonts,V as createRustMeasureSource,j as getRustTextEngine,M as resolveDefaultFontProvider,G as resolveHeaderFooter};
|
|
1
|
+
import {d,e,g as g$1,c,f,b as b$1}from'../chunk-TTRUPDAB.mjs';var I={},R;function q(s){if(s===void 0)return;let e=typeof s=="string"?s:s.href,t=typeof location>"u"?void 0:location.href;try{return new URL(e,t)}catch{throw new TypeError(`configureDefaultFonts baseUrl must be absolute when no browser location exists: ${e}`)}}function U(){return I.fonts!==void 0||I.load!==void 0}function H(s){I={...s,baseUrl:q(s.baseUrl)},R=void 0,I.baseUrl!==void 0&&!U()&&console.warn("[configureDefaultFonts] a baseUrl on its own loads nothing \u2014 the face manifest lives in @betteroffice/fonts. Pass the module too: configureDefaultFonts({ fonts, baseUrl }).");}async function K(){let{baseUrl:s,fonts:e,load:t}=I;try{return (e??await t()).createFontProvider(s===void 0?void 0:{baseUrl:s})}catch(r){console.warn("[configureDefaultFonts] the configured font source failed to load",r);return}}function M(){if(!U())return Promise.resolve(void 0);if(R===void 0){let s=K();s.then(e=>{e===void 0&&R===s&&(R=void 0);}),R=s;}return R}function $(s){return s.trim().toLowerCase()}function C(s,e,t){return `${$(s)}|${e?1:0}|${t?1:0}`}function k(s,e,t,r){t.then(o=>{r(o)&&s.get(e)===t&&s.delete(e);},()=>{s.get(e)===t&&s.delete(e);});}var x=class{constructor(e,t){b$1(this,"sink");b$1(this,"bundledSource");b$1(this,"bundledPromise");b$1(this,"warnedFallback",false);b$1(this,"facesByFamily",new Map);b$1(this,"faceIds",new WeakMap);b$1(this,"bundledIds",new Map);b$1(this,"lastResortIds",new Map);b$1(this,"bufferIds",new WeakMap);b$1(this,"scriptIds",new Map);b$1(this,"scriptResults",new Map);b$1(this,"chains",new Map);b$1(this,"chainResults",new Map);b$1(this,"generation",0);this.sink=e,this.bundledSource=t?.bundled;}bundled(){if(this.bundledPromise===void 0){let e=this.bundledSource,t=Promise.resolve().then(()=>typeof e=="function"?e():e).catch(()=>{});t.then(r=>{r===void 0&&this.bundledPromise===t&&(this.bundledPromise=void 0);}),this.bundledPromise=t;}return this.bundledPromise}setEmbeddedFaces(e){this.generation++,this.facesByFamily=new Map;for(let t of e){let r=$(t.family),o=this.facesByFamily.get(r);o?o.push(t):this.facesByFamily.set(r,[t]);}this.chains=new Map,this.chainResults=new Map;}getFontIdChain(e,t,r){let o=C(e,t,r),i=this.chains.get(o);if(!i){let n=this.chains,a=this.chainResults,f=this.generation,u=this.resolveChain(e,t,r);u.then(d=>{f===this.generation&&(a.set(o,d),d.retryable&&n.get(o)===u&&n.delete(o));},()=>{n.get(o)===u&&n.delete(o);}),n.set(o,u),i=u;}return i.then(n=>n.ids)}getCachedFontIdChain(e,t,r,o=true){let i=C(e,t,r),n=this.chainResults.get(i);if(o&&n?.retryable){let a=this.chainResults;queueMicrotask(()=>{a.get(i)===n&&a.delete(i);});}return n?.ids}getScriptFallbackIds(e){let t=[...new Set(e)];return Promise.all(t.map(r=>this.resolveScript(r))).then(r=>{let o=[];for(let{id:i}of r)i!==null&&!o.includes(i)&&o.push(i);return o})}getCachedScriptFallbackIds(e,t=true){let r=this.scriptResults,o=[];for(let n of e){let a=r.get(n);if(!a)return;o.push([n,a]);}let i=[];for(let[n,a]of o){let{id:f}=a;f!==null&&!i.includes(f)&&i.push(f),t&&a.retryable&&queueMicrotask(()=>{r.get(n)===a&&r.delete(n);});}return i}clear(){this.generation++,this.bundledPromise=void 0,this.faceIds=new WeakMap,this.bundledIds=new Map,this.lastResortIds=new Map,this.bufferIds=new WeakMap,this.scriptIds=new Map,this.scriptResults=new Map,this.chains=new Map,this.chainResults=new Map;}async resolveChain(e,t,r){let o=C(e,t,r),i=[],n=false,a=this.pickEmbeddedFace(e,t,r);if(a){let l=await this.registerFace(a);l!==null?i.push(l):n=true;}let f=await this.bundled();f===void 0&&typeof this.bundledSource=="function"&&(n=true);let u;try{u=f?.resolve(e,t,r);}catch(l){n=true,console.warn(`[fontRegistry] bundled face resolver for "${e}" failed; falling back: ${l instanceof Error?l.message:String(l)}`);}if(u){let l=await this.registerBundled(o,u,e);l!==null&&!i.includes(l)&&i.push(l),l===null&&(n=true);}let d;try{d=f?.resolveLastResort?.(e,t,r);}catch(l){n=true,console.warn(`[fontRegistry] last-resort resolver for "${e}" failed; falling back: ${l instanceof Error?l.message:String(l)}`);}if(d){let l=await this.registerLastResort(o,d,e);l!==null&&!i.includes(l)&&i.push(l),l===null&&(n=true);}return i.length===0&&this.warnFallback(e,f!==void 0,u!==void 0||d!==void 0),{ids:i,retryable:n}}warnFallback(e,t,r){if(this.warnedFallback)return;this.warnedFallback=true;let o="Native measurement is unsupported; browser hosts fall back to measureText and may use different OS fonts, so pagination can vary. Reported once per registry.";console.warn(r?`[fontRegistry] no font bytes for "${e}" \u2014 the font provider resolved but every matching face failed to load. ${o} If a bundler inlined @betteroffice/fonts, mark it external so its asset URLs resolve.`:t?`[fontRegistry] no font bytes for "${e}" \u2014 the configured font provider has no matching face. Add coverage for this family. ${o}`:`[fontRegistry] no font bytes for "${e}" \u2014 no font provider is configured. Install @betteroffice/fonts and pass it with configureDefaultFonts({ fonts }). `+o);}pickEmbeddedFace(e,t,r){let o=this.facesByFamily.get($(e));if(!o)return;let i=t?"bold":"normal",n=r?"italic":"normal";return o.find(a=>a.weight===i&&a.style===n)??o.find(a=>a.weight==="normal"&&a.style==="normal")}registerBuffer(e){let t=this.bufferIds.get(e);if(!t){let r=this.bufferIds;t=Promise.resolve().then(()=>this.sink.registerFont(new Uint8Array(e))),k(r,e,t,()=>false),r.set(e,t);}return t}registerFace(e){let t=this.faceIds.get(e);if(!t){let r=this.faceIds;t=(async()=>{try{return await this.registerBuffer(e.data)}catch{return console.warn(`[fontRegistry] embedded face "${e.family}" (${e.weight} ${e.style}) was rejected by the text engine; falling back`),null}})(),k(r,e,t,o=>o===null),r.set(e,t);}return t}registerBundled(e,t,r){let o=this.bundledIds.get(e);if(!o){let i=this.bundledIds;o=(async()=>{try{let n=await t();return await this.registerBuffer(n)}catch(n){return console.warn(`[fontRegistry] bundled face for "${r}" failed to load or register; falling back: ${n instanceof Error?n.message:String(n)}`),null}})(),k(i,e,o,n=>n===null),i.set(e,o);}return o}registerLastResort(e,t,r){let o=this.lastResortIds.get(e);if(!o){let i=this.lastResortIds;o=(async()=>{try{let n=await t();return await this.registerBuffer(n)}catch{return console.warn(`[fontRegistry] last-resort base face for "${r}" failed to load or register; falling back`),null}})(),k(i,e,o,n=>n===null),i.set(e,o);}return o}resolveScript(e){let t=this.scriptIds.get(e);if(!t){let r=this.scriptIds,o=this.scriptResults;t=(async()=>{let i=null,n=false,a=await this.bundled();a===void 0&&typeof this.bundledSource=="function"&&(n=true);let f;try{f=a?.resolveScriptFallback?.(e,!1,!1);}catch(d){n=true,console.warn(`[fontRegistry] script-fallback resolver for "${e}" failed; falling back: ${d instanceof Error?d.message:String(d)}`);}if(f)try{let d=await f();i=await this.registerBuffer(d);}catch(d){n=true,console.warn(`[fontRegistry] script-fallback face for "${e}" failed to load or register; falling back: ${d instanceof Error?d.message:String(d)}`);}let u={id:i,retryable:n};return o.set(e,u),u})(),k(r,e,t,i=>i.retryable),r.set(e,t);}return t}};var L=null;function j(){return L??(L=import('../wasm-ZQAVP7P2.mjs').then(async s=>(await s.preloadLayoutWasm(),{registerFont:s.registerMeasureFont,clearFonts:s.clearMeasureFonts}))),L}function V(s){let e=new x({registerFont:r=>s.engine.registerFont(r)},{bundled:s.bundled??M}),t;return {setEmbeddedFaces(r){e.setEmbeddedFaces(r);},setCompat(r){t=r;},async prepareFontRequirements(r){return (await Promise.all(r.flatMap(i=>[(async()=>{try{return e.getCachedFontIdChain(i.family,i.bold,i.italic,!1)!==void 0?!1:(await e.getFontIdChain(i.family,i.bold,i.italic),!0)}catch{return false}})(),...Array.from(new Set(i.scripts??[]),async n=>{try{return e.getCachedScriptFallbackIds([n],!1)!==void 0?!1:(await e.getScriptFallbackIds([n]),!0)}catch{return false}})]))).some(Boolean)},measurementConfigForRequirements(r){let o=r.map(n=>({requirement:n,familyIds:e.getCachedFontIdChain(n.family,n.bold,n.italic,false),scriptIds:e.getCachedScriptFallbackIds(n.scripts??[],false)}));if(o.some(({familyIds:n,scriptIds:a})=>n===void 0||a===void 0))return;let i={};for(let{requirement:n}of o){let a=e.getCachedFontIdChain(n.family,n.bold,n.italic),f=e.getCachedScriptFallbackIds(n.scripts??[]);if(a===void 0||f===void 0)return;let u=Array.from(a);for(let d of f)u.includes(d)||u.push(d);u.length>0&&(i[n.key]=u);}return {fontChains:i,defaults:{fontSize:11,fontFamily:"Calibri"},compat:{noLeading:t?.noLeading??false,doNotExpandShiftReturn:t?.doNotExpandShiftReturn??false},authoritativeShaping:true}},clear(){e.clear();}}}var _=1056;function G(s,e){let t=s?.package.headers,r=s?.package.footers,o=e?.headerReferences?.find(F=>F.type==="default"),i=e?.headerReferences?.find(F=>F.type==="first"),n=e?.footerReferences?.find(F=>F.type==="default"),a=e?.footerReferences?.find(F=>F.type==="first"),f=o?t?.get(o.rId)??null:null,u=n?r?.get(n.rId)??null:null,d=i?t?.get(i.rId)??null:null,l=a?r?.get(a.rId)??null:null;return e?.titlePg||(f??(f=d),u??(u=l)),{header:f,footer:u,firstHeader:d,firstFooter:l}}var g,b,m,y,w,B,T,A=class{constructor(){d(this,B);d(this,g,0);d(this,b,0);d(this,m,false);d(this,y,false);d(this,w,new Set);}setStateSeq(e$1){e(this,g,e$1);}incrementStateSeq(){return ++g$1(this,g)._}getStateSeq(){return c(this,g)}getRenderSeq(){return c(this,b)}onLayoutStart(){e(this,m,true);}onLayoutComplete(e$1){e(this,b,e$1),e(this,m,false),c(this,y)&&this.isSafeToRender()&&(e(this,y,false),f(this,B,T).call(this));}isSafeToRender(){return !c(this,m)&&c(this,b)>=c(this,g)}requestRender(){this.isSafeToRender()?f(this,B,T).call(this):e(this,y,true);}onRender(e){return c(this,w).add(e),()=>c(this,w).delete(e)}reset(){e(this,g,0),e(this,b,0),e(this,m,false),e(this,y,false);}getDebugInfo(){return {stateSeq:c(this,g),renderSeq:c(this,b),layoutUpdating:c(this,m),hasPendingRender:c(this,y),isSafe:this.isSafeToRender()}}};g=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakMap,B=new WeakSet,T=function(){for(let e of c(this,w))try{e();}catch(t){console.error("LayoutSelectionGate: render callback error",t);}};export{_ as DEFAULT_PAGE_HEIGHT_PX,A as LayoutSelectionGate,H as configureDefaultFonts,V as createRustMeasureSource,j as getRustTextEngine,M as resolveDefaultFontProvider,G as resolveHeaderFooter};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AnchoredObjectPositionInput, d as BlockId, e as BorderStyle, C as CellBorderSpec, f as CellBorders, g as ChartBlock, h as ChartExtent, i as ChartFragment, j as ColumnBreakBlock, k as ColumnBreakExtent, l as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, m as DEFAULT_TEXTBOX_WIDTH, n as DocumentPosition, o as FieldRun, p as FloatingTablePosition, F as FootnoteContent, q as FootnoteRenderItem, r as Fragment, s as FragmentBase, H as HeaderFooterContent, t as HeaderFooterContentHeights, u as HeaderFooterLayout, v as HitTestResult, w as HyperlinkInfo, I as ImageBlock, x as ImageExtent, y as ImageFragment, z as ImageRun, E as ImageRunPosition, G as InlineSdtWidget,
|
|
3
|
-
import '../../content-
|
|
4
|
-
import '../../formatting-
|
|
1
|
+
import { b as LayoutBlock, B as BlockExtent } from '../../types-C4A8mWjU.mjs';
|
|
2
|
+
export { A as AnchoredObjectPositionInput, d as BlockId, e as BorderStyle, C as CellBorderSpec, f as CellBorders, g as ChartBlock, h as ChartExtent, i as ChartFragment, j as ColumnBreakBlock, k as ColumnBreakExtent, l as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, m as DEFAULT_TEXTBOX_WIDTH, n as DocumentPosition, o as FieldRun, p as FloatingTablePosition, F as FootnoteContent, q as FootnoteRenderItem, r as Fragment, s as FragmentBase, H as HeaderFooterContent, t as HeaderFooterContentHeights, u as HeaderFooterLayout, v as HitTestResult, w as HyperlinkInfo, I as ImageBlock, x as ImageExtent, y as ImageFragment, z as ImageRun, E as ImageRunPosition, G as InlineSdtWidget, L as Layout, a as LayoutOptions, J as LineBreakRun, K as ListNumPr, N as NoteAreaContract, M as NoteLayoutItem, O as NoteSettingsContract, P as Page, Q as PageBorderContract, S as PageBreakBlock, T as PageBreakExtent, U as PageGeometry, V as PageHeaderFooterRefs, W as PageMargins, X as PageNumberingContract, Y as ParagraphAttrs, Z as ParagraphBlock, _ as ParagraphBorders, $ as ParagraphExtent, a0 as ParagraphFragment, a1 as ParagraphIndent, a2 as ParagraphSpacing, R as ResolvedLine, c as ResolvedSegment, a3 as Run, a4 as RunFontSlots, a5 as RunFormatting, a6 as RunLanguageSlots, a7 as SdtGroup, a8 as SectionBreakBlock, a9 as SectionBreakExtent, aa as ShapeBlock, ab as ShapeBlockFill, ac as ShapeBlockStroke, ad as ShapeBlockTransform, ae as ShapeExtent, af as ShapeFragment, ag as TabAlignment, ah as TabRun, ai as TabStop, aj as TableBlock, ak as TableCell, al as TableCellExtent, am as TableExtent, an as TableFragment, ao as TableRow, ap as TableRowExtent, aq as TextBoxBlock, ar as TextBoxExtent, as as TextBoxFragment, at as TextRun, au as TypesetBidiSlice, av as TypesetClusterAdvance, aw as TypesetRow, ax as TypesetRowSegment, ay as TypesetRunAdvance, az as WrapTextDirection, aA as assertExhaustiveLayoutBlock, aB as isTextWrappingFloatingImageRun, aC as pageGeometryFromPage, aD as resolveAnchoredObjectVerticalTop } from '../../types-C4A8mWjU.mjs';
|
|
3
|
+
import '../../content-CvEtPl0c.mjs';
|
|
4
|
+
import '../../formatting-7zKCTu5a.mjs';
|
|
5
5
|
import '../../docx/wrapTypes.mjs';
|
|
6
6
|
|
|
7
7
|
interface MeasuredBlock {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b as b$2,c as c$1}from'../../chunk-OBQGPMPQ.mjs';import {b as b$1}from'../../chunk-CTBUQRYQ.mjs';import'../../chunk-TTRUPDAB.mjs';var c={top:4,bottom:4,left:7,right:7},h=200;function y(e,r){let o=e.kind??"<unknown>";throw new Error(`${r}: unhandled LayoutBlock kind "${o}". Add the case alongside the other LayoutBlock switches (see types.ts).`)}function
|
|
1
|
+
import {b as b$2,c as c$1}from'../../chunk-OBQGPMPQ.mjs';import {b as b$1}from'../../chunk-CTBUQRYQ.mjs';import'../../chunk-TTRUPDAB.mjs';var c={top:4,bottom:4,left:7,right:7},h=200;function y(e,r){let o=e.kind??"<unknown>";throw new Error(`${r}: unhandled LayoutBlock kind "${o}". Add the case alongside the other LayoutBlock switches (see types.ts).`)}function f(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function x(e,r,o){return p(e,r,o)}function p(e,r,o){let n=e.position?.vertical;if(!n)return r;let t=b(n.relativeTo,r,o);return n.align==="top"?t.base:n.align==="center"?t.size?t.base+(t.size-e.height)/2:r:n.align==="bottom"?t.size?t.base+t.size-e.height:r:n.posOffset!==void 0?t.base+b$1(n.posOffset):n.relativeTo==="paragraph"||n.relativeTo==="line"?r:t.base}function b(e,r,o){let n=o?.pageHeight??0,t=o?.marginTop??0,a=o?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:r,size:0};case "page":return {base:-t,size:n};case "topMargin":return {base:-t,size:t};case "bottomMargin":return {base:a,size:t};default:return {base:0,size:a}}}function k(e){return b$2(e.wrapType)||e.wrapType==="topAndBottom"?false:c$1(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}export{c as DEFAULT_TEXTBOX_MARGINS,h as DEFAULT_TEXTBOX_WIDTH,y as assertExhaustiveLayoutBlock,k as isTextWrappingFloatingImageRun,f as pageGeometryFromPage,x as resolveAnchoredObjectVerticalTop};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as DisplayPage, b as DisplayPrimitive, D as DisplayList, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive } from '../../frameDelta-
|
|
2
|
-
export { c as DecodedFrameDelta, d as DecorationPrimitive, e as DisplayBounds, f as DocAttrs, F as FRAME_DELTA_HEADER_BYTES, g as FRAME_DELTA_PAGE_OP_BYTES, h as FRAME_DELTA_VERSION, i as FrameDeltaError, j as FrameDeltaErrorCode, k as FramePageOperation, H as HfRegion, I as ImagePrimitive, P as PositionedGlyph, l as RectPrimitive, R as RetainedFrame, m as RetainedFramePage, n as TableCellRef, o as applyFrameDelta, p as applyFrameDeltaOwned, q as decodeFrameDelta } from '../../frameDelta-
|
|
3
|
-
export { a as DisplayListBuildInputs, D as DisplayListHeadersFooters, b as DisplayListHfVariant, c as DisplayListPictureWatermark, d as DisplayListTextWatermark, e as DisplayListWatermark, f as RustDisplayFrameResult, g as RustDisplayListEngine, R as RustDisplayListQueryEngine, h as RustDisplayListSourceError, i as RustDisplayListSourceErrorStage, j as buildRustDisplayFrame, k as buildRustDisplayList, l as encodeDisplayListFrameExtras, m as loadRustDisplayListQueryEngine } from '../../rustDisplayList-
|
|
4
|
-
import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-
|
|
5
|
-
export { c as DisplayListHitRegion, d as DisplayListHoverTarget, e as DisplayListImageGeometry, f as DisplayListImageRegion, g as DisplayListParagraphGeometry, h as DisplayListQuerySourceState, i as DisplayListVerticalMove, j as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, k as captureInlinePositionEmuFromDisplayList, l as createDisplayListQueries, m as findImagePrimitiveAtPoint, n as findImagePrimitiveByDocPos, o as isDisplayListQuerySourceDead, p as onDisplayListQuerySourceFailure } from '../../displayListQueries-
|
|
6
|
-
import { u as YrsLoc, Y as YrsSession, v as YrsRevisionInfo } from '../../index-
|
|
1
|
+
import { a as DisplayPage, b as DisplayPrimitive, D as DisplayList, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive } from '../../frameDelta-pA4jrQ1G.mjs';
|
|
2
|
+
export { c as DecodedFrameDelta, d as DecorationPrimitive, e as DisplayBounds, f as DocAttrs, F as FRAME_DELTA_HEADER_BYTES, g as FRAME_DELTA_PAGE_OP_BYTES, h as FRAME_DELTA_VERSION, i as FrameDeltaError, j as FrameDeltaErrorCode, k as FramePageOperation, H as HfRegion, I as ImagePrimitive, P as PositionedGlyph, l as RectPrimitive, R as RetainedFrame, m as RetainedFramePage, n as TableCellRef, o as applyFrameDelta, p as applyFrameDeltaOwned, q as decodeFrameDelta } from '../../frameDelta-pA4jrQ1G.mjs';
|
|
3
|
+
export { a as DisplayListBuildInputs, D as DisplayListHeadersFooters, b as DisplayListHfVariant, c as DisplayListPictureWatermark, d as DisplayListTextWatermark, e as DisplayListWatermark, f as RustDisplayFrameResult, g as RustDisplayListEngine, R as RustDisplayListQueryEngine, h as RustDisplayListSourceError, i as RustDisplayListSourceErrorStage, j as buildRustDisplayFrame, k as buildRustDisplayList, l as encodeDisplayListFrameExtras, m as loadRustDisplayListQueryEngine } from '../../rustDisplayList-BJqaN9tt.mjs';
|
|
4
|
+
import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-DF8F6fMl.mjs';
|
|
5
|
+
export { c as DisplayListHitRegion, d as DisplayListHoverTarget, e as DisplayListImageGeometry, f as DisplayListImageRegion, g as DisplayListParagraphGeometry, h as DisplayListQuerySourceState, i as DisplayListVerticalMove, j as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, k as captureInlinePositionEmuFromDisplayList, l as createDisplayListQueries, m as findImagePrimitiveAtPoint, n as findImagePrimitiveByDocPos, o as isDisplayListQuerySourceDead, p as onDisplayListQuerySourceFailure } from '../../displayListQueries-DF8F6fMl.mjs';
|
|
6
|
+
import { u as YrsLoc, Y as YrsSession, v as YrsRevisionInfo } from '../../index-CHl2zLJ7.mjs';
|
|
7
7
|
import { TrackedChangeEntry } from '../../utils/comments.mjs';
|
|
8
|
-
import '../../formatting-
|
|
9
|
-
import '../../content-
|
|
8
|
+
import '../../formatting-7zKCTu5a.mjs';
|
|
9
|
+
import '../../content-CvEtPl0c.mjs';
|
|
10
10
|
import '../../docx/wrapTypes.mjs';
|
|
11
|
-
import '../../types-
|
|
11
|
+
import '../../types-C4A8mWjU.mjs';
|
|
12
12
|
import '../pagination/index.mjs';
|
|
13
13
|
import '../../types/document.mjs';
|
|
14
|
-
import '../../styles-
|
|
14
|
+
import '../../styles-7e-mq3c-.mjs';
|
|
15
15
|
|
|
16
16
|
/** a cached glyph: its outline path (font units) plus the font's units-per-em. */
|
|
17
17
|
interface GlyphOutline {
|