@epam/ai-dial-attachment-canvas 1.1.0-dev.433 → 1.1.0-dev.438

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.
@@ -4,7 +4,7 @@ import { InputHighlightData } from '@epam/pdf-highlighter-kit';
4
4
  import { McpUiHostContext } from '@mcp-ui/client';
5
5
  import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
6
6
  import { CSSProperties } from 'react';
7
- import { AttachmentContentType, AttachmentErrorType, OoxmlFileType } from '../types/attachment-canvas';
7
+ import { AttachmentContentType, AttachmentErrorType, OoxmlFileType, OoxmlHighlightKind } from '../types/attachment-canvas';
8
8
  /** Content payload for plain-text attachments. */
9
9
  export interface PlainTextCanvasContent {
10
10
  /** Discriminates the content type to select the correct renderer. */
@@ -53,6 +53,63 @@ export interface PdfCanvasContent {
53
53
  /** 1-based page to navigate to on initial load, independent of highlight geometry. */
54
54
  page?: number;
55
55
  }
56
+ /** A cited character range inside a DOCX story, addressed by story name and source-tree path. */
57
+ export interface OoxmlDocxHighlightLocation {
58
+ /** Discriminates this location within `OoxmlHighlightLocation`. */
59
+ kind: OoxmlHighlightKind.DocxTextRange;
60
+ /** Name of the DOCX story the range lives in, as an opaque string (only `'body'` is confirmed upstream). */
61
+ story: string;
62
+ /** Source-tree element indices identifying the paragraph, matched element-wise. */
63
+ path: number[];
64
+ /** Inclusive start character offset within the story's matched text. */
65
+ start: number;
66
+ /** Exclusive end character offset, already converted from the wire's inclusive `end`. */
67
+ endExclusive: number;
68
+ /** The cited text, compared against the text resolved over `[start, endExclusive)`. */
69
+ text: string;
70
+ }
71
+ /** A cited character range inside a single shape on one PPTX slide. */
72
+ export interface OoxmlPptxHighlightLocation {
73
+ /** Discriminates this location within `OoxmlHighlightLocation`. */
74
+ kind: OoxmlHighlightKind.PptxTextRange;
75
+ /** 1-based slide number. */
76
+ slide: number;
77
+ /** Shape identifier, compared as a string against the run's own `shapeId`. */
78
+ shapeId: string;
79
+ /** Inclusive start character offset within the shape's matched text. */
80
+ start: number;
81
+ /** Exclusive end character offset, already converted from the wire's inclusive `end`. */
82
+ endExclusive: number;
83
+ /** The cited text, compared against the text resolved over `[start, endExclusive)`. */
84
+ text: string;
85
+ }
86
+ /** A 1-based cell address, matching `@silurus/ooxml`'s own `CellAddress`. */
87
+ export interface OoxmlCellAddress {
88
+ /** 1-based row number. */
89
+ row: number;
90
+ /** 1-based column number. */
91
+ col: number;
92
+ }
93
+ /** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
94
+ export interface OoxmlXlsxHighlightLocation {
95
+ /** Discriminates this location within `OoxmlHighlightLocation`. */
96
+ kind: OoxmlHighlightKind.XlsxCellRange;
97
+ /** Sheet name, matched exactly against the workbook's own sheet names. */
98
+ sheet: string;
99
+ /** First cell of the range. 1-based, passed to the viewer unconverted. */
100
+ start: OoxmlCellAddress;
101
+ /** Last cell of the range, on the same row as `start`. Omitted for a single cell. */
102
+ end?: OoxmlCellAddress;
103
+ }
104
+ /** A cited location inside an Office document, in document coordinates. */
105
+ export type OoxmlHighlightLocation = OoxmlDocxHighlightLocation | OoxmlPptxHighlightLocation | OoxmlXlsxHighlightLocation;
106
+ /** One citation's highlight: the locations it resolved to, under a stable id. */
107
+ export interface OoxmlHighlight {
108
+ /** Stable id, used to mark exactly one highlight selected. */
109
+ id: string;
110
+ /** One or more locations — a single citation may carry several selectors. */
111
+ locations: OoxmlHighlightLocation[];
112
+ }
56
113
  /** Content payload for OOXML document and CSV spreadsheet attachments. */
57
114
  export interface OoxmlCanvasContent {
58
115
  /** Discriminates the content type to select the correct renderer. */
@@ -61,6 +118,10 @@ export interface OoxmlCanvasContent {
61
118
  url: string;
62
119
  /** The document format used to select and configure the format-specific renderer. */
63
120
  format: OoxmlFileType;
121
+ /** Cited locations to draw over the document. Omitted, never `[]`, when there is nothing to highlight. */
122
+ highlights?: OoxmlHighlight[];
123
+ /** Id of the highlight to navigate to and emphasise. Omitted when the clicked citation resolved to no location. */
124
+ selectedHighlightId?: string;
64
125
  }
65
126
  /** Content payload for audio file attachments. */
66
127
  export interface AudioCanvasContent {
@@ -187,6 +248,10 @@ export interface AttachmentCanvasColors {
187
248
  ooxmlFormulaBackground?: string;
188
249
  /** Text color of the XLSX formula panel. Defaults to `--text-primary`. */
189
250
  ooxmlFormulaText?: string;
251
+ /** Border color of a cited-location highlight rectangle. Defaults to `--stroke-accent`. */
252
+ ooxmlHighlightBorder?: string;
253
+ /** Fill color of a cited-location highlight rectangle. Defaults to `transparent`, so the cited text keeps its own contrast. */
254
+ ooxmlHighlightBackground?: string;
190
255
  /** Text color of the collapsed-content ellipsis. Defaults to `--text-secondary`. */
191
256
  jsonCollapsedText?: string;
192
257
  /** Background color of the collapsed-content ellipsis. Defaults to `--bg-layer-raised`. */
@@ -241,6 +306,8 @@ export interface AttachmentCanvasLabels {
241
306
  ariaLabel: string;
242
307
  /** Accessible label for the close button. Defaults to `'Close'`. */
243
308
  closeLabel?: string;
309
+ /** Accessible label for the panel's drag-to-resize handle. Defaults to `'Resize panel'`. */
310
+ resizeLabel?: string;
244
311
  /** Message shown in the canvas body when the content type is `Unsupported`. Defaults to `'Preview is not supported for this file'`. */
245
312
  unsupportedLabel?: string;
246
313
  /** Message shown in the canvas body when content type is `Error` with `errorType: LoadFailed`. Defaults to `'Failed to load file'`. */
@@ -305,6 +372,10 @@ export interface AttachmentCanvasLabels {
305
372
  tableCopiedLabel?: string;
306
373
  /** Label for downloading a Markdown table as CSV. */
307
374
  tableDownloadCsvLabel?: string;
375
+ /** Accessible name for the OOXML citation-highlights overlay region. Defaults to `'Cited locations'`. */
376
+ ooxmlHighlightsLabel?: string;
377
+ /** Status announced once navigation to the selected OOXML citation highlight completes. Defaults to `'Scrolled to the cited location'`. */
378
+ ooxmlHighlightNavigatedLabel?: string;
308
379
  }
309
380
  /** Props for the AttachmentCanvas component. */
310
381
  export interface AttachmentCanvasProps {
@@ -364,7 +435,7 @@ export interface AttachmentCanvasProps {
364
435
  configurePdfWorker?: () => void | Promise<void>;
365
436
  }
366
437
  /** User-visible strings for `AttachmentCanvasBody`'s content states. */
367
- export type AttachmentCanvasBodyLabels = Pick<AttachmentCanvasLabels, 'unsupportedLabel' | 'loadErrorLabel' | 'forbiddenErrorLabel' | 'visualizerErrorLabel' | 'htmlFrameBlockedLabel' | 'htmlOpenInNewTabLabel' | 'pdfThumbnailsLabel' | 'pdfShowThumbnailsLabel' | 'pdfHideThumbnailsLabel' | 'pdfPageNumberLabel' | 'pdfContentLoadingLabel' | 'pdfContentErrorLabel' | 'pdfContentRetryLabel' | 'xlsxFormulaLabel' | 'codeContentLoadingLabel' | 'codeContentErrorLabel' | 'codeContentRetryLabel' | 'tableCopyCsvLabel' | 'tableCopyTxtLabel' | 'tableCopyMarkdownLabel' | 'tableCopiedLabel' | 'tableDownloadCsvLabel'>;
438
+ export type AttachmentCanvasBodyLabels = Pick<AttachmentCanvasLabels, 'unsupportedLabel' | 'loadErrorLabel' | 'forbiddenErrorLabel' | 'visualizerErrorLabel' | 'htmlFrameBlockedLabel' | 'htmlOpenInNewTabLabel' | 'pdfThumbnailsLabel' | 'pdfShowThumbnailsLabel' | 'pdfHideThumbnailsLabel' | 'pdfPageNumberLabel' | 'pdfContentLoadingLabel' | 'pdfContentErrorLabel' | 'pdfContentRetryLabel' | 'xlsxFormulaLabel' | 'codeContentLoadingLabel' | 'codeContentErrorLabel' | 'codeContentRetryLabel' | 'tableCopyCsvLabel' | 'tableCopyTxtLabel' | 'tableCopyMarkdownLabel' | 'tableCopiedLabel' | 'tableDownloadCsvLabel' | 'ooxmlHighlightsLabel' | 'ooxmlHighlightNavigatedLabel'>;
368
439
  /** Props for the `AttachmentCanvasBody` component. */
369
440
  export interface AttachmentCanvasBodyProps {
370
441
  /** The attachment content to render. */
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/models/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc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cAAc,CAAC;IAChC,wJAAwJ;IACxJ,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
1
+ {"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/models/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAEpC,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IACtC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC;IAClC,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qDAAqD;AACrD,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,IAAI,EAAE,qBA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}
@@ -0,0 +1,294 @@
1
+ import { i as e } from "./attachment-canvas-Bp6WeQws.js";
2
+ //#region src/utils/ooxml-highlight-geometry.ts
3
+ var t = 4 / 3, n = 9525, r = 2, i = 1, a = 0, o = () => {
4
+ let e = document.createElement("canvas").getContext("2d");
5
+ if (e != null) return (t, n) => (e.font !== t && (e.font = t), e.measureText(n).width);
6
+ }, s = (e, n) => ({
7
+ width: e.widthPt * t * n,
8
+ height: e.heightPt * t * n
9
+ }), c = (e, t, r) => ({
10
+ width: e / n * r,
11
+ height: t / n * r
12
+ }), l = ({ index: e, sizeAt: t, hostClientWidth: n, layout: r }) => {
13
+ let i = r?.gap ?? 16, a = r?.paddingTop ?? i, o = r?.paddingLeft ?? i, s = a + e * i;
14
+ for (let n = 0; n < e; n += 1) s += t(n).height;
15
+ let { width: c } = t(e);
16
+ return {
17
+ left: Math.max(o, (n - c) / 2),
18
+ top: s
19
+ };
20
+ }, u = (e) => {
21
+ let t = [...e].sort((e, t) => e.top - t.top || e.left - t.left), n = [];
22
+ for (let e of t) {
23
+ let t = n.at(-1), a = t != null && Math.abs(t.top - e.top) <= r && Math.abs(t.height - e.height) <= r, o = t != null && e.left <= t.left + t.width + i;
24
+ if (a && o) {
25
+ t.width = Math.max(t.left + t.width, e.left + e.width) - t.left, t.height = Math.max(t.height, e.height);
26
+ continue;
27
+ }
28
+ n.push({ ...e });
29
+ }
30
+ return n;
31
+ }, d = (e, t, n) => Math.min(Math.max(e, t), n), f = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), p = (e, t, n) => {
32
+ if (!e) return 1;
33
+ let r = n();
34
+ return !(r > 0) || t >= r ? 1 : t / r;
35
+ }, m = (e, t, n, r, i, a, o, s) => {
36
+ if (o <= a) return null;
37
+ if (a <= 0 && o >= e.length) return {
38
+ left: t.x,
39
+ top: t.y,
40
+ width: t.width,
41
+ height: t.height
42
+ };
43
+ if (s == null) return null;
44
+ let c = (e) => s(n, e), l = a <= 0 ? 0 : c(e.slice(0, a)), u = o >= e.length ? c(e) : c(e.slice(0, o)), d = [...e.slice(0, a)].length, f = [...e.slice(a, o)].length, m = p(i, t.width, () => c(e)), h = (l + d * r) * m, g = (Math.max(0, u - l) + Math.max(0, f - 1) * r) * m;
45
+ return g <= 0 ? null : {
46
+ left: t.x + h,
47
+ top: t.y,
48
+ width: g,
49
+ height: t.height
50
+ };
51
+ }, h = (e, t, n, r, i, a, o) => {
52
+ let s = /* @__PURE__ */ new Map();
53
+ if (!Number.isInteger(n) || !Number.isInteger(r) || n < 0 || r <= n || r > t.length || t.slice(n, r) !== i) return s;
54
+ for (let t of e) {
55
+ if (t.end <= n || t.start >= r || a(t.run)) continue;
56
+ let e = d(n - t.start, 0, t.end - t.start), i = o(t, e, d(r - t.start, e, t.end - t.start));
57
+ if (i == null) continue;
58
+ let c = s.get(t.surfaceIndex);
59
+ if (c == null) {
60
+ s.set(t.surfaceIndex, [i]);
61
+ continue;
62
+ }
63
+ c.push(i);
64
+ }
65
+ for (let [e, t] of s) s.set(e, u(t));
66
+ return s;
67
+ }, g = ({ location: e, pages: t, measure: n }) => {
68
+ let r = [], i = "";
69
+ for (let { pageIndex: n, runs: a } of t) for (let t of a) {
70
+ if (t.source == null || t.sourceRunIndex == null || t.source.story !== e.story || !f(t.source.path, e.path)) continue;
71
+ let a = t.highlightBounds, o = a == null ? {
72
+ x: t.x,
73
+ y: t.y,
74
+ width: t.w,
75
+ height: t.h
76
+ } : {
77
+ x: a.x,
78
+ y: a.y,
79
+ width: a.width,
80
+ height: a.height
81
+ };
82
+ r.push({
83
+ run: t,
84
+ box: o,
85
+ start: i.length,
86
+ end: i.length + t.text.length,
87
+ surfaceIndex: n
88
+ }), i += t.text;
89
+ }
90
+ return [...h(r, i, e.start, e.endExclusive, e.text, (e) => e.transform != null, ({ run: e, box: t }, r, i) => m(e.text, t, e.font, e.letterSpacingPx ?? 0, e.eastAsianVert === !0, r, i, n))].sort(([e], [t]) => e - t).map(([e, t]) => ({
91
+ pageIndex: e,
92
+ rects: t
93
+ }));
94
+ }, _ = (e) => e.rotation !== 0 || (e.textBodyRotation ?? 0) !== 0 || e.shapeFlipH === !0 || e.shapeFlipV === !0, v = ({ location: e, runs: t, measure: n }) => {
95
+ let r = [], i = "";
96
+ for (let n of t) n.shapeId != null && String(n.shapeId) === e.shapeId && (n.origin === "master" || n.origin === "layout" || (r.push({
97
+ run: n,
98
+ box: {
99
+ x: n.shapeX + n.inShapeX,
100
+ y: n.shapeY + n.inShapeY,
101
+ width: n.w,
102
+ height: n.h
103
+ },
104
+ start: i.length,
105
+ end: i.length + n.text.length,
106
+ surfaceIndex: a
107
+ }), i += n.text));
108
+ return h(r, i, e.start, e.endExclusive, e.text, _, ({ run: e, box: t }, r, i) => m(e.text, t, e.font, 0, !1, r, i, n)).get(a) ?? [];
109
+ }, y = (e, t) => {
110
+ let n = t.indexOf(e);
111
+ return n === -1 ? null : n;
112
+ }, b = ({ row: e, col: t }) => {
113
+ let n = "", r = t;
114
+ for (; r > 0;) {
115
+ let e = (r - 1) % 26;
116
+ n = String.fromCharCode(65 + e) + n, r = Math.floor((r - 1) / 26);
117
+ }
118
+ return `${n}${e}`;
119
+ }, x = ({ location: e, getCellViewportRect: t, viewportWidth: n }) => {
120
+ let { start: r, end: i } = e, a = i == null ? r.col : i.col;
121
+ if (i != null && (i.row !== r.row || i.col < r.col)) return [];
122
+ let o = [];
123
+ for (let e = r.col; e <= a; e += 1) {
124
+ let n = t({
125
+ row: r.row,
126
+ col: e
127
+ });
128
+ n != null && o.push(n);
129
+ }
130
+ if (o.length === 0) return [];
131
+ let s = u(o);
132
+ if (n == null || s.length !== 1) return s;
133
+ let [c] = s, l = Math.min(c.width, n - c.left);
134
+ return l >= c.width ? s : [{
135
+ ...c,
136
+ width: Math.max(0, l),
137
+ isClippedAtEnd: !0
138
+ }];
139
+ }, S = (e) => {
140
+ for (let t of e.querySelectorAll("div")) if (t.style.overflow === "auto") return t;
141
+ return null;
142
+ }, C = (e) => {
143
+ let t = e.querySelector("canvas");
144
+ if (t == null) return {
145
+ left: 0,
146
+ top: 0
147
+ };
148
+ let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
149
+ return {
150
+ left: n.left - r.left,
151
+ top: n.top - r.top
152
+ };
153
+ }, w = (e, t) => {
154
+ let n = Math.min(e.length, t.length);
155
+ for (let r = 0; r < n; r += 1) if (e[r] !== t[r]) return e[r] - t[r];
156
+ return e.length - t.length;
157
+ }, T = (t, n, r, i) => {
158
+ let a = o(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = (e) => s(n.pageSize(e), r.getScale()), f = async (e) => {
159
+ let t = c.get(e);
160
+ if (t != null) return t;
161
+ let r = await n.collectPageRuns(e, { width: d(e).width });
162
+ return i() ? [] : (c.set(e, r), r);
163
+ }, p = async (e) => {
164
+ let t = [];
165
+ for (let r = 0; r < n.pageCount; r += 1) {
166
+ let n = await f(r);
167
+ if (i()) return [];
168
+ let a = n.filter((t) => t.source != null && t.source.story === e.story);
169
+ if (a.some((t) => t.source != null && w(t.source.path, e.path) === 0)) {
170
+ t.push({
171
+ pageIndex: r,
172
+ runs: n
173
+ });
174
+ continue;
175
+ }
176
+ let o = a.length > 0 && a.every((t) => t.source != null && w(t.source.path, e.path) > 0);
177
+ if (t.length > 0 || o) break;
178
+ }
179
+ return t;
180
+ };
181
+ return {
182
+ measure: async (n) => {
183
+ let r = S(t);
184
+ if (r == null) return [];
185
+ let o = [];
186
+ for (let t of n) for (let n of t.locations) {
187
+ if (n.kind !== e.DocxTextRange) continue;
188
+ let s = await p(n);
189
+ if (i()) return [];
190
+ let c = s.at(0);
191
+ c != null && u.set(n, c.pageIndex);
192
+ for (let { pageIndex: e, rects: i } of g({
193
+ location: n,
194
+ pages: s,
195
+ measure: a
196
+ })) {
197
+ let n = l({
198
+ index: e,
199
+ sizeAt: d,
200
+ hostClientWidth: r.clientWidth
201
+ });
202
+ for (let e of i) o.push({
203
+ ...e,
204
+ left: n.left + e.left - r.scrollLeft,
205
+ top: n.top + e.top - r.scrollTop,
206
+ highlightId: t.id
207
+ });
208
+ }
209
+ }
210
+ return o;
211
+ },
212
+ navigate: async (t) => {
213
+ if (t.kind !== e.DocxTextRange) return;
214
+ let n = u.get(t);
215
+ if (n != null) {
216
+ r.scrollToPage(n);
217
+ return;
218
+ }
219
+ let a = await p(t);
220
+ i() || r.scrollToPage(a.at(0)?.pageIndex ?? 0);
221
+ }
222
+ };
223
+ }, E = (t, n, r, i) => {
224
+ let a = o(), s = () => c(n.slideWidth, n.slideHeight, r.getScale()), u = (e) => e < 1 || e > n.slideCount ? null : e - 1;
225
+ return {
226
+ measure: async (r) => {
227
+ let o = S(t);
228
+ if (o == null) return [];
229
+ let c = [];
230
+ for (let t of r) for (let r of t.locations) {
231
+ if (r.kind !== e.PptxTextRange) continue;
232
+ let d = u(r.slide);
233
+ if (d == null) continue;
234
+ let f = await n.collectSlideRuns(d, s().width);
235
+ if (i()) return [];
236
+ let p = l({
237
+ index: d,
238
+ sizeAt: s,
239
+ hostClientWidth: o.clientWidth
240
+ });
241
+ for (let e of v({
242
+ location: r,
243
+ runs: f,
244
+ measure: a
245
+ })) c.push({
246
+ ...e,
247
+ left: p.left + e.left - o.scrollLeft,
248
+ top: p.top + e.top - o.scrollTop,
249
+ highlightId: t.id
250
+ });
251
+ }
252
+ return c;
253
+ },
254
+ navigate: async (t) => {
255
+ if (t.kind !== e.PptxTextRange) return;
256
+ let n = u(t.slide);
257
+ n != null && r.scrollToSlide(n);
258
+ }
259
+ };
260
+ }, D = (t, n, r) => ({
261
+ measure: async (r) => {
262
+ let i = C(t), a = t.clientWidth - i.left, o = [];
263
+ for (let t of r) for (let r of t.locations) {
264
+ if (r.kind !== e.XlsxCellRange) continue;
265
+ let s = y(r.sheet, n.sheetNames);
266
+ if (!(s == null || s !== n.sheetIndex)) for (let e of x({
267
+ location: r,
268
+ getCellViewportRect: (e) => {
269
+ let t = n.getCellViewportRect(e);
270
+ return t == null ? null : {
271
+ left: t.x,
272
+ top: t.y,
273
+ width: t.width,
274
+ height: t.height
275
+ };
276
+ },
277
+ viewportWidth: a
278
+ })) o.push({
279
+ ...e,
280
+ left: i.left + e.left,
281
+ top: i.top + e.top,
282
+ highlightId: t.id
283
+ });
284
+ }
285
+ return o;
286
+ },
287
+ navigate: async (t) => {
288
+ if (t.kind !== e.XlsxCellRange) return;
289
+ let i = y(t.sheet, n.sheetNames);
290
+ i != null && (i !== n.sheetIndex && (await n.goToSheet(i), r()) || await n.scrollToCell(b(t.start), { align: "center" }));
291
+ }
292
+ });
293
+ //#endregion
294
+ export { T as createDocxHighlightSurface, E as createPptxHighlightSurface, D as createXlsxHighlightSurface };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-attachment-canvas",
3
3
  "description": "Canvas viewer for rendering attachment content — images, PDFs, Office documents, CSV, JSON, markdown, and plain text",
4
- "version": "1.1.0-dev.433",
4
+ "version": "1.1.0-dev.438",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,10 +17,10 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@epam/ai-dial-chat-shared": "1.1.0-dev.433",
20
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.438",
21
21
  "@epam/ai-dial-react-pdf-highlighter": "^0.2.0-dev.28",
22
22
  "@epam/ai-dial-shared": "0.48.0",
23
- "@epam/ai-dial-sidebar": "1.1.0-dev.433",
23
+ "@epam/ai-dial-sidebar": "1.1.0-dev.438",
24
24
  "@epam/ai-dial-visualizer-connector": "0.48.0",
25
25
  "@epam/ai-dial-ui-kit": "^0.14.0-dev.15",
26
26
  "@epam/pdf-highlighter-kit": "^0.0.18",
@@ -22,6 +22,15 @@ export declare enum OoxmlFileType {
22
22
  Pptx = "pptx",
23
23
  Csv = "csv"
24
24
  }
25
+ /** Discriminates the Office highlight location descriptors an `OoxmlCanvasContent` can carry. */
26
+ export declare enum OoxmlHighlightKind {
27
+ /** A character range inside a DOCX story, addressed by story name and source-tree path. */
28
+ DocxTextRange = "docxTextRange",
29
+ /** A character range inside a single PPTX shape on one slide. */
30
+ PptxTextRange = "pptxTextRange",
31
+ /** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
32
+ XlsxCellRange = "xlsxCellRange"
33
+ }
25
34
  /** The kind of failure that produced an `ErrorCanvasContent`. */
26
35
  export declare enum AttachmentErrorType {
27
36
  /** The file failed to load (network error or a non-`403` non-OK response). */
@@ -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,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"}
@@ -0,0 +1,158 @@
1
+ import { DocxTextRunInfo } from '@silurus/ooxml/docx';
2
+ import { PptxTextRunInfo } from '@silurus/ooxml/pptx';
3
+ import { OoxmlCellAddress, OoxmlDocxHighlightLocation, OoxmlPptxHighlightLocation, OoxmlXlsxHighlightLocation } from '../models/attachment-canvas';
4
+ /** A resolved highlight rectangle, in the coordinate space of the surface it is drawn over. */
5
+ export interface OoxmlHighlightRect {
6
+ /** Distance from the surface's physical left edge, in CSS pixels. */
7
+ left: number;
8
+ /** Distance from the surface's physical top edge, in CSS pixels. */
9
+ top: number;
10
+ /** Width in CSS pixels. */
11
+ width: number;
12
+ /** Height in CSS pixels. */
13
+ height: number;
14
+ /**
15
+ * Whether the rectangle was cut short by the viewport rather than by the end
16
+ * of the cited range, so the renderer can leave that edge open instead of
17
+ * implying the range stops there.
18
+ */
19
+ isClippedAtEnd?: boolean;
20
+ }
21
+ /** Width of `text` rendered in the CSS shorthand `font`, in CSS pixels. */
22
+ export type OoxmlTextMeasurer = (font: string, text: string) => number;
23
+ /** Size of one page or slide, in CSS pixels at the current scale. */
24
+ export interface OoxmlSurfaceSize {
25
+ /** Width in CSS pixels. */
26
+ width: number;
27
+ /** Height in CSS pixels. */
28
+ height: number;
29
+ }
30
+ /** Offset of one page or slide within its scroll host's content box, in CSS pixels. */
31
+ export interface OoxmlSurfaceOffset {
32
+ /** Distance from the content box's physical left edge. */
33
+ left: number;
34
+ /** Distance from the content box's physical top edge. */
35
+ top: number;
36
+ }
37
+ /** The scroll-layout options this renderer passes to a `@silurus/ooxml` scroll viewer. */
38
+ export interface OoxmlScrollLayout {
39
+ /** Vertical space between pages/slides. Defaults to `OOXML_SCROLL_GAP_DEFAULT`. */
40
+ gap?: number;
41
+ /** Space above the first page/slide. Defaults to `gap`. */
42
+ paddingTop?: number;
43
+ /** Minimum space left of a page/slide. Defaults to `gap`. */
44
+ paddingLeft?: number;
45
+ }
46
+ /** Inputs `resolveSurfaceOffset` needs to place one page or slide. */
47
+ export interface OoxmlSurfaceOffsetOptions {
48
+ /** 0-based page or slide index. */
49
+ index: number;
50
+ /** Size, in CSS pixels at the current scale, of the page/slide at an index. */
51
+ sizeAt: (index: number) => OoxmlSurfaceSize;
52
+ /** `clientWidth` of the scroll host — the reference the vendor centres against. */
53
+ hostClientWidth: number;
54
+ /** Scroll-layout options passed to the viewer. */
55
+ layout?: OoxmlScrollLayout;
56
+ }
57
+ /** Runs one page contributed, as `DocxDocument.collectPageRuns` returned them. */
58
+ export interface OoxmlDocxPageRuns {
59
+ /** 0-based page index the runs came from. */
60
+ pageIndex: number;
61
+ /** The page's runs, in layout order. */
62
+ runs: readonly DocxTextRunInfo[];
63
+ }
64
+ /** Rectangles resolved on one page, in that page's own CSS pixel space. */
65
+ export interface OoxmlDocxPageRects {
66
+ /** 0-based page index the rectangles belong to. */
67
+ pageIndex: number;
68
+ /** Rectangles covering the part of the range that falls on this page. */
69
+ rects: OoxmlHighlightRect[];
70
+ }
71
+ /** Inputs `resolveDocxRects` needs to place one DOCX range. */
72
+ export interface OoxmlDocxResolveOptions {
73
+ /** The cited range, with offsets already exclusive at the upper bound. */
74
+ location: OoxmlDocxHighlightLocation;
75
+ /**
76
+ * Consecutive pages' runs, in page order. A range may span a page boundary,
77
+ * so the story's text is accumulated across every page supplied and the
78
+ * result is grouped back per page.
79
+ */
80
+ pages: readonly OoxmlDocxPageRuns[];
81
+ /** Text measurer used for partially covered runs. Without one, partial runs yield no rectangle. */
82
+ measure?: OoxmlTextMeasurer;
83
+ }
84
+ /** Inputs `resolvePptxRects` needs to place one PPTX range on one slide. */
85
+ export interface OoxmlPptxResolveOptions {
86
+ /** The cited range, with offsets already exclusive at the upper bound. */
87
+ location: OoxmlPptxHighlightLocation;
88
+ /** Runs `PptxPresentation.collectSlideRuns` returned for the slide, in layout order. */
89
+ runs: readonly PptxTextRunInfo[];
90
+ /** Text measurer used for partially covered runs. Without one, partial runs yield no rectangle. */
91
+ measure?: OoxmlTextMeasurer;
92
+ }
93
+ /** Inputs `resolveXlsxRects` needs to place one XLSX cell range. */
94
+ export interface OoxmlXlsxResolveOptions {
95
+ /** The cited cell or same-row cell range. */
96
+ location: OoxmlXlsxHighlightLocation;
97
+ /** The viewer's own `getCellViewportRect`, which returns `null` for a cell it cannot measure. */
98
+ getCellViewportRect: (cell: OoxmlCellAddress) => OoxmlHighlightRect | null;
99
+ /** Width of the grid viewport, used to clip a range wider than the screen. */
100
+ viewportWidth?: number;
101
+ }
102
+ /** `@silurus/ooxml`'s default `gap`, and its default for every padding option. */
103
+ export declare const OOXML_SCROLL_GAP_DEFAULT = 16;
104
+ /** Creates a canvas-backed text measurer, or `undefined` when no 2D context is available. */
105
+ export declare const createOoxmlTextMeasurer: () => OoxmlTextMeasurer | undefined;
106
+ /** Size in CSS pixels of a DOCX page whose `pageSize` is given in points. */
107
+ export declare const docxPageSizePx: (pageSizePt: {
108
+ widthPt: number;
109
+ heightPt: number;
110
+ }, scale: number) => OoxmlSurfaceSize;
111
+ /** Size in CSS pixels of a PPTX slide whose dimensions are given in EMU. */
112
+ export declare const pptxSlideSizePx: (slideWidthEmu: number, slideHeightEmu: number, scale: number) => OoxmlSurfaceSize;
113
+ /**
114
+ * Offset of one page or slide inside its scroll host's content box.
115
+ *
116
+ * This is the only place the page-stacking relationship is encoded. Every input
117
+ * is published by the vendor — page/slide size, the current scale, and the
118
+ * `gap`/padding this renderer itself passes in — but the stacking arithmetic is
119
+ * derived from the installed build rather than guaranteed by a public type, so
120
+ * a `@silurus/ooxml` upgrade can change it with no TypeScript signal. Keeping it
121
+ * here means such an upgrade breaks one function and one test.
122
+ */
123
+ export declare const resolveSurfaceOffset: ({ index, sizeAt, hostClientWidth, layout, }: OoxmlSurfaceOffsetOptions) => OoxmlSurfaceOffset;
124
+ /**
125
+ * Merges rectangles that sit on one visual line and touch or overlap.
126
+ *
127
+ * A cited sentence usually spans several runs; without this it renders as a row
128
+ * of separate boxes instead of one band.
129
+ */
130
+ export declare const mergeSameLineRects: (rects: readonly OoxmlHighlightRect[]) => OoxmlHighlightRect[];
131
+ /**
132
+ * Rectangles covering one DOCX range, grouped per page.
133
+ *
134
+ * Returns an empty array whenever the range cannot be resolved with confidence —
135
+ * no matching run, a resolved text that disagrees with the selector's own
136
+ * `text`, or an offset past the end of the resolved text.
137
+ */
138
+ export declare const resolveDocxRects: ({ location, pages, measure, }: OoxmlDocxResolveOptions) => OoxmlDocxPageRects[];
139
+ /**
140
+ * Rectangles covering one PPTX range on one slide, in that slide's CSS pixel space.
141
+ *
142
+ * Returns an empty array when no run matches the shape, when the resolved text
143
+ * disagrees with the selector's `text`, or when the matched shape is rotated or
144
+ * flipped.
145
+ */
146
+ export declare const resolvePptxRects: ({ location, runs, measure, }: OoxmlPptxResolveOptions) => OoxmlHighlightRect[];
147
+ /** 0-based index of the sheet a location names, or `null` when the workbook has no such sheet. */
148
+ export declare const resolveXlsxSheetIndex: (sheet: string, sheetNames: readonly string[]) => number | null;
149
+ /** A1-style reference for a 1-based cell address, for the viewer's string-keyed `scrollToCell`. */
150
+ export declare const toXlsxCellRef: ({ row, col }: OoxmlCellAddress) => string;
151
+ /**
152
+ * Rectangles covering one XLSX cell or same-row range, in the grid's viewport space.
153
+ *
154
+ * A cell the viewer reports as unmeasurable contributes nothing rather than a
155
+ * zero rectangle, which would draw a visible artefact at the grid origin.
156
+ */
157
+ export declare const resolveXlsxRects: ({ location, getCellViewportRect, viewportWidth, }: OoxmlXlsxResolveOptions) => OoxmlHighlightRect[];
158
+ //# sourceMappingURL=ooxml-highlight-geometry.d.ts.map