@epam/ai-dial-attachment-canvas 1.2.0-dev.2 → 1.2.0-dev.6
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/{LazyContentBoundary-CL7J_W9c.js → LazyContentBoundary-CRXN6PG3.js} +1 -1
- package/{PdfContent-DhfjgYL-.js → PdfContent-D71LPAe3.js} +1 -1
- package/{attachment-canvas-Bp6WeQws.js → attachment-canvas-nvhW3tKV.js} +3 -1
- package/{bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js → bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js} +1111 -1043
- package/{chart-ex-B0DgG3Dt.js → chart-ex-DsESBs97.js} +1 -1
- package/{comment-occurrence-CqejEuts-7SeKCBXk.js → comment-occurrence-C8Y2uoVr-C1cxz2TU.js} +1 -1
- package/{comment-ui-runtime-lXwVOgjW-Be4RALsI.js → comment-ui-runtime-BfE7MJZn-DhQ_eg15.js} +29 -29
- package/comment-ui-runtime-BsK8pmUT-EgWiymew.js +2 -0
- package/{comment-ui-runtime-DEtgcmj7-B1G7PH4z.js → comment-ui-runtime-DcJOYlw--B15auUq-.js} +52 -52
- package/{comments-CAn2A_Xh-CdgNAj0h.js → comments-Diid5ujN-BdQhRNjI.js} +2 -2
- package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -1
- package/{delimited-text-worker-host-DcHj_JZt-DWJmaPag.js → delimited-text-worker-host-BVY-Ecni-AimUmSn0.js} +1 -1
- package/{docx-B9qBTEkj.js → docx-B-VcIRoc.js} +4628 -4580
- package/index.js +564 -564
- package/line-distribute-Dtudnqhs--BYZNgzX.js +1237 -0
- package/{line-metrics-CBbw80Ko-DoOuwYxZ.js → line-metrics-B60C86uh-DfQUk7X1.js} +1 -1
- package/ooxml-highlight-surfaces-CaMjx8u-.js +351 -0
- package/package.json +4 -4
- package/{pptx-dkJw0-Vx.js → pptx-CnoDB8Fv.js} +955 -923
- package/{read-only-comment-decoration-BTnWEeo5-BNhbteYc.js → read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js} +1 -1
- package/{read-only-comment-margin-plStyGfE-mggNAMB_.js → read-only-comment-margin-DkgzASAl-BbDxMI5E.js} +1 -1
- package/render-worker-host-BfbnEChF-D2thMRGX.js +7 -0
- package/render-worker-host-DNL9dWRh-Bky38ZHE.js +7 -0
- package/render-worker-host-IkHrYOci-DbjyHK7U.js +7 -0
- package/{renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js → renderer-module-contract-D91rkYHH-BtfSKxb4.js} +1 -1
- package/test-setup.d.ts +10 -1
- package/test-setup.d.ts.map +1 -1
- package/types/attachment-canvas.d.ts +17 -0
- package/types/attachment-canvas.d.ts.map +1 -1
- package/utils/ooxml-highlight-geometry.d.ts +87 -3
- package/utils/ooxml-highlight-geometry.d.ts.map +1 -1
- package/utils/ooxml-highlight-surfaces.d.ts +33 -6
- package/utils/ooxml-highlight-surfaces.d.ts.map +1 -1
- package/{visible-index-DPoQYSDt-9lRc-2Ik.js → visible-index-BgiHEc1z-BOzE9X5U.js} +7 -7
- package/{xlsx-BAXMTJTG.js → xlsx-Dn0XSlTO.js} +1581 -1556
- package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +0 -2
- package/line-distribute-IsUGfHXm-DeITjLzJ.js +0 -1234
- package/ooxml-highlight-surfaces-DhK1KJcR.js +0 -294
- package/render-worker-host-BEfLZvSL-COy91Rd8.js +0 -7
- package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +0 -7
- package/render-worker-host-C3xwtHnv-BBGHFdo9.js +0 -7
|
@@ -10029,7 +10029,7 @@ function tl(e, t, n, r = p, i = 0, a, o, s, c) {
|
|
|
10029
10029
|
});
|
|
10030
10030
|
}
|
|
10031
10031
|
//#endregion
|
|
10032
|
-
//#region ../../node_modules/@silurus/ooxml/dist/renderer-module-contract-
|
|
10032
|
+
//#region ../../node_modules/@silurus/ooxml/dist/renderer-module-contract-D91rkYHH.js
|
|
10033
10033
|
var nl = "ooxml-worker-renderer-module/v1", rl = /* @__PURE__ */ new WeakMap();
|
|
10034
10034
|
function il(e, t) {
|
|
10035
10035
|
if (e === "math") {
|
package/test-setup.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Delivers a synthetic resize entry to every mock `ResizeObserver` instance
|
|
3
|
+
* currently observing `target`, mirroring how a real observer fans a single
|
|
4
|
+
* size change out to each of its observers.
|
|
5
|
+
*/
|
|
6
|
+
export declare const deliverResizeObserverEntry: (target: Element, contentRect?: Partial<DOMRectReadOnly>) => void;
|
|
7
|
+
/** Clears tracked mock `ResizeObserver` instances so they do not leak between test files. */
|
|
8
|
+
export declare const resetResizeObserverMock: () => void;
|
|
9
|
+
/** Whether any live mock `ResizeObserver` instance is currently observing `target`. */
|
|
10
|
+
export declare const isElementObservedByResizeObserver: (target: Element) => boolean;
|
|
2
11
|
//# sourceMappingURL=test-setup.d.ts.map
|
package/test-setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAwEA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,OAAO,EACf,cAAa,OAAO,CAAC,eAAe,CAAM,SAM3C,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,YAEnC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,iCAAiC,GAAI,QAAQ,OAAO,KAAG,OACW,CAAC"}
|
|
@@ -38,4 +38,21 @@ export declare enum AttachmentErrorType {
|
|
|
38
38
|
/** The file request failed with HTTP `403` — the user lacks permission to access it. */
|
|
39
39
|
Forbidden = "forbidden"
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Outcome of one `OoxmlHighlightSurface.navigate` call.
|
|
43
|
+
*
|
|
44
|
+
* Declared here rather than alongside `OoxmlHighlightSurface` in
|
|
45
|
+
* `utils/ooxml-highlight-surfaces.ts` so `OoxmlContent.tsx` can compare
|
|
46
|
+
* against it as a real value without a static import pulling that
|
|
47
|
+
* dynamically-loaded module into the eager entry closure — see
|
|
48
|
+
* `tests/package-boundary/bundle-budgets.spec.ts`.
|
|
49
|
+
*/
|
|
50
|
+
export declare enum OoxmlNavigationOutcome {
|
|
51
|
+
/** A scroll (or page/slide/sheet change) was applied for this location. */
|
|
52
|
+
Navigated = "navigated",
|
|
53
|
+
/** A newer `navigate` call started before this one could apply its scroll, or the surface was disposed meanwhile. */
|
|
54
|
+
Superseded = "superseded",
|
|
55
|
+
/** The location could not be resolved to a page, slide, sheet, or cell at all. */
|
|
56
|
+
Unresolved = "unresolved"
|
|
57
|
+
}
|
|
41
58
|
//# sourceMappingURL=attachment-canvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,aAAa,mBAAmB;IAChC,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,mFAAmF;AACnF,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,iGAAiG;AACjG,oBAAY,kBAAkB;IAC5B,2FAA2F;IAC3F,aAAa,kBAAkB;IAC/B,iEAAiE;IACjE,aAAa,kBAAkB;IAC/B,4EAA4E;IAC5E,aAAa,kBAAkB;CAChC;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB"}
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,aAAa,mBAAmB;IAChC,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,mFAAmF;AACnF,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,iGAAiG;AACjG,oBAAY,kBAAkB;IAC5B,2FAA2F;IAC3F,aAAa,kBAAkB;IAC/B,iEAAiE;IACjE,aAAa,kBAAkB;IAC/B,4EAA4E;IAC5E,aAAa,kBAAkB;CAChC;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB;AAED;;;;;;;;GAQG;AACH,oBAAY,sBAAsB;IAChC,2EAA2E;IAC3E,SAAS,cAAc;IACvB,qHAAqH;IACrH,UAAU,eAAe;IACzB,kFAAkF;IAClF,UAAU,eAAe;CAC1B"}
|
|
@@ -60,13 +60,37 @@ export interface OoxmlDocxPageRuns {
|
|
|
60
60
|
pageIndex: number;
|
|
61
61
|
/** The page's runs, in layout order. */
|
|
62
62
|
runs: readonly DocxTextRunInfo[];
|
|
63
|
+
/**
|
|
64
|
+
* The page's box in the same reference-width CSS pixel space the runs were
|
|
65
|
+
* collected at — the page's scale-1 size, from `docxPageSizePx`. Used to
|
|
66
|
+
* normalise resolved rectangles into fractions of the page box.
|
|
67
|
+
*/
|
|
68
|
+
pageBox: OoxmlSurfaceSize;
|
|
63
69
|
}
|
|
64
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* A resolved DOCX highlight rectangle, expressed as fractions of its page
|
|
72
|
+
* box rather than CSS pixels — each of `left`, `top`, `width`, and `height`
|
|
73
|
+
* is a ratio (0–1, barring a range that runs off the page) of the page's
|
|
74
|
+
* width or height. Kept distinct from `OoxmlHighlightRect` (the PPTX/XLSX
|
|
75
|
+
* absolute-pixel type) so their scale-free and scale-bound contracts cannot
|
|
76
|
+
* be confused at the type level; see `resolveDocxRects`.
|
|
77
|
+
*/
|
|
78
|
+
export interface OoxmlDocxNormalizedRect {
|
|
79
|
+
/** Left edge as a fraction of the page's width. */
|
|
80
|
+
left: number;
|
|
81
|
+
/** Top edge as a fraction of the page's height. */
|
|
82
|
+
top: number;
|
|
83
|
+
/** Width as a fraction of the page's width. */
|
|
84
|
+
width: number;
|
|
85
|
+
/** Height as a fraction of the page's height. */
|
|
86
|
+
height: number;
|
|
87
|
+
}
|
|
88
|
+
/** Rectangles resolved on one page, as fractions of that page's box. */
|
|
65
89
|
export interface OoxmlDocxPageRects {
|
|
66
90
|
/** 0-based page index the rectangles belong to. */
|
|
67
91
|
pageIndex: number;
|
|
68
92
|
/** Rectangles covering the part of the range that falls on this page. */
|
|
69
|
-
rects:
|
|
93
|
+
rects: OoxmlDocxNormalizedRect[];
|
|
70
94
|
}
|
|
71
95
|
/** Inputs `resolveDocxRects` needs to place one DOCX range. */
|
|
72
96
|
export interface OoxmlDocxResolveOptions {
|
|
@@ -119,6 +143,56 @@ export declare const pptxSlideSizePx: (slideWidthEmu: number, slideHeightEmu: nu
|
|
|
119
143
|
* here means such an upgrade breaks one function and one test.
|
|
120
144
|
*/
|
|
121
145
|
export declare const resolveSurfaceOffset: ({ index, sizeAt, hostClientWidth, layout, }: OoxmlSurfaceOffsetOptions) => OoxmlSurfaceOffset;
|
|
146
|
+
/** The scroll host's current geometry, as read directly off the live element. */
|
|
147
|
+
export interface OoxmlScrollHostBox {
|
|
148
|
+
/** Height of the host's visible (scrollable) area, in CSS pixels. */
|
|
149
|
+
clientHeight: number;
|
|
150
|
+
/** Width of the host's visible (scrollable) area, in CSS pixels. */
|
|
151
|
+
clientWidth: number;
|
|
152
|
+
/** Total scrollable height of the host's content, in CSS pixels. */
|
|
153
|
+
scrollHeight: number;
|
|
154
|
+
/** Total scrollable width of the host's content, in CSS pixels. */
|
|
155
|
+
scrollWidth: number;
|
|
156
|
+
/** The host's current horizontal scroll position, in CSS pixels. */
|
|
157
|
+
scrollLeft: number;
|
|
158
|
+
}
|
|
159
|
+
/** Inputs `resolveDocxScrollTarget` needs to place one resolved DOCX rectangle in the scroll host. */
|
|
160
|
+
export interface OoxmlDocxScrollTargetOptions {
|
|
161
|
+
/** 0-based index of the page the rectangle was resolved on. */
|
|
162
|
+
pageIndex: number;
|
|
163
|
+
/** The resolved rectangle, as a fraction of its page's box (see `OoxmlDocxNormalizedRect`). */
|
|
164
|
+
rect: OoxmlDocxNormalizedRect;
|
|
165
|
+
/** Size, in CSS pixels at the current scale, of the page/slide at an index. */
|
|
166
|
+
sizeAt: (index: number) => OoxmlSurfaceSize;
|
|
167
|
+
/** The scroll host's current geometry. */
|
|
168
|
+
host: OoxmlScrollHostBox;
|
|
169
|
+
/** Scroll-layout options passed to the viewer. */
|
|
170
|
+
layout?: OoxmlScrollLayout;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Absolute scroll position, in the scroll host's own coordinate space, that
|
|
174
|
+
* brings a resolved DOCX rectangle into view.
|
|
175
|
+
*
|
|
176
|
+
* Composes `resolveSurfaceOffset` — which already owns the page-stacking
|
|
177
|
+
* arithmetic — with the rectangle's page-box fraction and the page's live
|
|
178
|
+
* pixel size, so a vendor layout change still breaks exactly one function and
|
|
179
|
+
* one test (see the version-coupling note on `resolveSurfaceOffset`).
|
|
180
|
+
*
|
|
181
|
+
* The result is physical canvas-coordinate geometry, the same space
|
|
182
|
+
* `resolveSurfaceOffset` and the overlay already use, and it SHALL NOT be
|
|
183
|
+
* converted to logical (start/end) properties — see the physical-geometry
|
|
184
|
+
* requirement in `office-annotation-highlighting`.
|
|
185
|
+
*
|
|
186
|
+
* `top` places the rectangle's start (its top edge) `DOCX_NAVIGATION_LEAD_FRACTION`
|
|
187
|
+
* of the host's visible height below the visible top, then clamps to
|
|
188
|
+
* `[0, scrollHeight - clientHeight]` so a passage near the document's start or
|
|
189
|
+
* end scrolls as far as it can rather than not at all. `left` is left at the
|
|
190
|
+
* host's current `scrollLeft` when the rectangle already falls inside the
|
|
191
|
+
* host's horizontal viewport — which keeps a fit-width preview at
|
|
192
|
+
* `scrollLeft: 0` — and is otherwise shifted by the smallest amount that
|
|
193
|
+
* brings the rectangle's left edge into view.
|
|
194
|
+
*/
|
|
195
|
+
export declare const resolveDocxScrollTarget: ({ pageIndex, rect, sizeAt, host, layout, }: OoxmlDocxScrollTargetOptions) => OoxmlSurfaceOffset;
|
|
122
196
|
/**
|
|
123
197
|
* Merges rectangles that sit on one visual line and touch or overlap.
|
|
124
198
|
*
|
|
@@ -127,7 +201,17 @@ export declare const resolveSurfaceOffset: ({ index, sizeAt, hostClientWidth, la
|
|
|
127
201
|
*/
|
|
128
202
|
export declare const mergeSameLineRects: (rects: readonly OoxmlHighlightRect[]) => OoxmlHighlightRect[];
|
|
129
203
|
/**
|
|
130
|
-
* Rectangles covering one DOCX range, grouped per page
|
|
204
|
+
* Rectangles covering one DOCX range, grouped per page, as fractions of each
|
|
205
|
+
* page's box.
|
|
206
|
+
*
|
|
207
|
+
* Runs arrive already measured at a fixed reference width (the page's
|
|
208
|
+
* scale-1 CSS size — see `createDocxHighlightSurface`), so their `x`/`y`/`w`/`h`
|
|
209
|
+
* and the same-line merge tolerances are all in that one reference-width pixel
|
|
210
|
+
* space. Dividing the merged pixel rectangle by the page's reference box turns
|
|
211
|
+
* it into a fraction that is the same number at every render scale — the
|
|
212
|
+
* representation `@silurus/ooxml`'s own `buildDocxHighlightLayer` percent-of-page
|
|
213
|
+
* highlight layer uses, and the only way to avoid re-collecting runs on every
|
|
214
|
+
* zoom (root cause 1 of the drift this resolver used to produce).
|
|
131
215
|
*
|
|
132
216
|
* Returns an empty array whenever the range cannot be resolved with confidence —
|
|
133
217
|
* no matching run, a resolved text that disagrees with the selector's own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ooxml-highlight-geometry.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvE,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,uFAAuF;AACvF,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,0FAA0F;AAC1F,UAAU,iBAAiB;IACzB,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,sEAAsE;AACtE,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,gBAAgB,CAAC;IAC5C,mFAAmF;IACnF,eAAe,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ooxml-highlight-geometry.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC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;AAEF,mGAAmG;AACnG,eAAO,MAAM,aAAa,GAAI,cAAc,gBAAgB,KAAG,MAS9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,mDAI9B,uBAAuB,KAAG,kBAAkB,EAuB9C,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocxTextRunInfo } from '@silurus/ooxml/docx';
|
|
2
2
|
import { PptxPresentation } from '@silurus/ooxml/pptx';
|
|
3
3
|
import { XlsxViewer } from '@silurus/ooxml/xlsx';
|
|
4
4
|
import { OoxmlHighlight, OoxmlHighlightLocation } from '../models/attachment-canvas';
|
|
5
|
+
import { OoxmlNavigationOutcome } from '../types/attachment-canvas';
|
|
5
6
|
import { OoxmlHighlightRect } from './ooxml-highlight-geometry';
|
|
7
|
+
export { OoxmlNavigationOutcome };
|
|
6
8
|
/**
|
|
7
9
|
* One rectangle to draw, tagged with the highlight it belongs to. Kept in
|
|
8
10
|
* this dynamically-loaded module (not `OoxmlContent.tsx`) alongside the
|
|
@@ -24,14 +26,39 @@ export interface TaggedHighlightRect extends OoxmlHighlightRect {
|
|
|
24
26
|
export interface OoxmlHighlightSurface {
|
|
25
27
|
/** Rectangles for every highlight that currently resolves. */
|
|
26
28
|
measure(highlights: readonly OoxmlHighlight[]): Promise<TaggedHighlightRect[]>;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Brings one cited location into view, whether or not it resolves to a
|
|
31
|
+
* rectangle. See `OoxmlNavigationOutcome` for what each resolved value means.
|
|
32
|
+
*/
|
|
33
|
+
navigate(location: OoxmlHighlightLocation): Promise<OoxmlNavigationOutcome>;
|
|
29
34
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The subset of `DocxDocument` the DOCX highlight surface reads, kept as a
|
|
37
|
+
* narrow structural type rather than the concrete vendor class so a test
|
|
38
|
+
* double only needs to implement what is actually used.
|
|
39
|
+
*/
|
|
40
|
+
interface DocxHighlightDocument {
|
|
41
|
+
/** Number of pages in the current layout. Only authoritative once `waitUntilLayoutComplete` resolves. */
|
|
42
|
+
readonly pageCount: number;
|
|
43
|
+
/** Page size in points, at scale 1. */
|
|
44
|
+
pageSize(pageIndex: number): {
|
|
45
|
+
widthPt: number;
|
|
46
|
+
heightPt: number;
|
|
47
|
+
};
|
|
48
|
+
/** Collects one page's text runs at the given reference width. */
|
|
49
|
+
collectPageRuns(pageIndex: number, opts: {
|
|
50
|
+
width: number;
|
|
51
|
+
}): Promise<DocxTextRunInfo[]>;
|
|
52
|
+
/** Resolves once layout has finished publishing pages; rejects if layout failed. */
|
|
53
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
/** The subset of `DocxScrollViewer` the DOCX highlight surface reads. */
|
|
56
|
+
interface DocxHighlightViewer {
|
|
32
57
|
getScale(): number;
|
|
33
58
|
scrollToPage(index: number): void;
|
|
34
|
-
}
|
|
59
|
+
}
|
|
60
|
+
/** Creates the DOCX highlight surface over an already-loaded document. */
|
|
61
|
+
export declare const createDocxHighlightSurface: (container: HTMLElement, docxDocument: DocxHighlightDocument, viewer: DocxHighlightViewer, isDisposed: () => boolean) => OoxmlHighlightSurface;
|
|
35
62
|
/** Creates the PPTX highlight surface over an already-loaded presentation. */
|
|
36
63
|
export declare const createPptxHighlightSurface: (container: HTMLElement, presentation: PptxPresentation, viewer: {
|
|
37
64
|
getScale(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ooxml-highlight-surfaces.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-surfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ooxml-highlight-surfaces.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-surfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB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CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,cAAc,qBAAqB,EACnC,QAAQ,mBAAmB,EAC3B,YAAY,MAAM,OAAO,KACxB,qBA0NF,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,cAAc,gBAAgB,EAC9B,QAAQ;IAAE,QAAQ,IAAI,MAAM,CAAC;IAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAClE,YAAY,MAAM,OAAO,KACxB,qBAiEF,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,QAAQ,UAAU,EAClB,YAAY,MAAM,OAAO,KACxB,qBA0DD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as e, $t as t } from "./renderer-module-contract-
|
|
2
|
-
import {
|
|
3
|
-
//#region ../../node_modules/@silurus/ooxml/dist/resource-measurement-
|
|
1
|
+
import { $ as e, $t as t } from "./renderer-module-contract-D91rkYHH-BtfSKxb4.js";
|
|
2
|
+
import { Bt as n, Dt as r, In as i, Vn as a, Xt as o, pt as s } from "./bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js";
|
|
3
|
+
//#region ../../node_modules/@silurus/ooxml/dist/resource-measurement-CJsgolre.js
|
|
4
4
|
function c(e, t) {
|
|
5
5
|
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
6
6
|
}
|
|
@@ -13,16 +13,16 @@ async function u(u, d, f, p, m = {}) {
|
|
|
13
13
|
...v,
|
|
14
14
|
targetWidthPx: void 0,
|
|
15
15
|
targetHeightPx: void 0
|
|
16
|
-
} : v, b = f ?
|
|
16
|
+
} : v, b = f ? r(p, l) : void 0, x = await i(u, d, p, y);
|
|
17
17
|
if (!f || !x) return x;
|
|
18
|
-
let S = await
|
|
18
|
+
let S = await o(u, d, p, y, b, x), C = a(Number(x.width), Number(x.height), _.targetWidthPx, _.targetHeightPx), w = C ? `|resize:${C.resizeWidth}x${C.resizeHeight}` : "";
|
|
19
19
|
return n(l, `${c(S, f)}${w}${g ? "|strict" : ""}`, p, async () => {
|
|
20
20
|
let { w: t, h: n } = e(x);
|
|
21
21
|
if (t <= 0 || n <= 0) return {
|
|
22
22
|
bitmap: g ? null : x,
|
|
23
23
|
owned: !1
|
|
24
24
|
};
|
|
25
|
-
let r = await
|
|
25
|
+
let r = await s(x, f, {
|
|
26
26
|
width: t,
|
|
27
27
|
height: n,
|
|
28
28
|
offscreenFactory: h,
|
|
@@ -143,7 +143,7 @@ function g(e, t = 2 ** 53 - 1, n = !1) {
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
|
-
//#region ../../node_modules/@silurus/ooxml/dist/visible-index-
|
|
146
|
+
//#region ../../node_modules/@silurus/ooxml/dist/visible-index-BgiHEc1z.js
|
|
147
147
|
function _(e, t, n, r) {
|
|
148
148
|
for (let i = e + t; i >= 0 && i < r; i += t) if (!n(i)) return i;
|
|
149
149
|
return e;
|