@epam/ai-dial-attachment-canvas 1.1.0-dev.99 → 1.2.0-dev.1
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 +166 -0
- package/PdfContent-DhfjgYL-.js +260 -0
- package/PdfContent.css +1 -0
- package/attachment-canvas-Bp6WeQws.js +12 -0
- package/bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js +37832 -0
- package/chart-ex-B0DgG3Dt.js +1009 -0
- package/comment-occurrence-CqejEuts-7SeKCBXk.js +6 -0
- package/comment-ui-runtime-DEtgcmj7-B1G7PH4z.js +170 -0
- package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +2 -0
- package/comment-ui-runtime-lXwVOgjW-Be4RALsI.js +112 -0
- package/comments-CAn2A_Xh-CdgNAj0h.js +282 -0
- package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts +4 -0
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts +14 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/components/CodeContent/CodeContent.d.ts +11 -0
- package/components/CodeContent/CodeContent.d.ts.map +1 -1
- package/components/HtmlContent/HtmlContent.d.ts +1 -3
- package/components/HtmlContent/HtmlContent.d.ts.map +1 -1
- package/components/LazyContentBoundary/LazyContentBoundary.d.ts +73 -0
- package/components/LazyContentBoundary/LazyContentBoundary.d.ts.map +1 -0
- package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts +12 -0
- package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts.map +1 -0
- package/components/OoxmlContent/OoxmlContent.d.ts +22 -0
- package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -0
- package/components/PdfContent/PdfContent.d.ts +50 -1
- package/components/PdfContent/PdfContent.d.ts.map +1 -1
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +12 -0
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
- package/constants/file.d.ts +6 -0
- package/constants/file.d.ts.map +1 -1
- package/context/AttachmentCanvasContext.d.ts +1 -1
- package/context/AttachmentCanvasContext.d.ts.map +1 -1
- package/delimited-text-worker-host-DcHj_JZt-DWJmaPag.js +25 -0
- package/docx-B9qBTEkj.js +29822 -0
- package/hooks/useMcpAppBridge/useMcpAppBridge.d.ts +23 -0
- package/hooks/useMcpAppBridge/useMcpAppBridge.d.ts.map +1 -0
- package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +64 -0
- package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -0
- package/index.css +1 -2
- package/index.d.ts +11 -5
- package/index.d.ts.map +1 -1
- package/index.js +1072 -34844
- package/line-distribute-IsUGfHXm-DeITjLzJ.js +1234 -0
- package/line-metrics-CBbw80Ko-DoOuwYxZ.js +60 -0
- package/models/attachment-canvas.d.ts +272 -10
- package/models/attachment-canvas.d.ts.map +1 -1
- package/ooxml-highlight-surfaces-DhK1KJcR.js +294 -0
- package/package.json +19 -13
- package/pptx-dkJw0-Vx.js +9179 -0
- package/read-only-comment-decoration-BTnWEeo5-BNhbteYc.js +94 -0
- package/read-only-comment-margin-plStyGfE-mggNAMB_.js +189 -0
- package/render-worker-host-BEfLZvSL-COy91Rd8.js +7 -0
- package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +7 -0
- package/render-worker-host-C3xwtHnv-BBGHFdo9.js +7 -0
- package/renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js +10063 -0
- package/types/attachment-canvas.d.ts +19 -0
- package/types/attachment-canvas.d.ts.map +1 -1
- package/utils/content.d.ts +7 -0
- package/utils/content.d.ts.map +1 -1
- package/utils/download.d.ts.map +1 -1
- package/utils/ooxml-highlight-geometry.d.ts +157 -0
- package/utils/ooxml-highlight-geometry.d.ts.map +1 -0
- package/utils/ooxml-highlight-surfaces.d.ts +42 -0
- package/utils/ooxml-highlight-surfaces.d.ts.map +1 -0
- package/utils/visualizer.d.ts +8 -0
- package/utils/visualizer.d.ts.map +1 -0
- package/utils/vite-external-matcher.d.ts +18 -0
- package/utils/vite-external-matcher.d.ts.map +1 -0
- package/visible-index-DPoQYSDt-9lRc-2Ik.js +162 -0
- package/xlsx-BAXMTJTG.js +8585 -0
|
@@ -4,14 +4,33 @@ export declare enum AttachmentContentType {
|
|
|
4
4
|
Image = "image",
|
|
5
5
|
Audio = "audio",
|
|
6
6
|
Markdown = "markdown",
|
|
7
|
+
MarkdownTable = "markdown_table",
|
|
7
8
|
Json = "json",
|
|
8
9
|
Pdf = "pdf",
|
|
10
|
+
Ooxml = "ooxml",
|
|
9
11
|
Code = "code",
|
|
10
12
|
Html = "html",
|
|
11
13
|
Visualizer = "visualizer",
|
|
14
|
+
McpApp = "mcp_app",
|
|
12
15
|
Unsupported = "unsupported",
|
|
13
16
|
Error = "error"
|
|
14
17
|
}
|
|
18
|
+
/** Supported document formats rendered by the bundled `@silurus/ooxml` runtime. */
|
|
19
|
+
export declare enum OoxmlFileType {
|
|
20
|
+
Docx = "docx",
|
|
21
|
+
Xlsx = "xlsx",
|
|
22
|
+
Pptx = "pptx",
|
|
23
|
+
Csv = "csv"
|
|
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
|
+
}
|
|
15
34
|
/** The kind of failure that produced an `ErrorCanvasContent`. */
|
|
16
35
|
export declare enum AttachmentErrorType {
|
|
17
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,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;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"}
|
package/utils/content.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { ErrorCanvasContent, UnsupportedCanvasContent } from '../models/attachment-canvas';
|
|
2
|
+
import { OoxmlFileType } from '../types/attachment-canvas';
|
|
3
|
+
/** Resolves a format supported by the bundled `@silurus/ooxml` renderer from a MIME type or file extension. */
|
|
4
|
+
export declare const getOoxmlFileType: (name: string, mimeType?: string) => OoxmlFileType | undefined;
|
|
5
|
+
/** Returns true when a file can be rendered by the built-in `@silurus/ooxml` viewer. */
|
|
6
|
+
export declare const isOoxmlPreviewable: (name: string, mimeType?: string) => boolean;
|
|
7
|
+
/** Returns the canonical MIME type recognized from `name`'s extension or `mimeType`, or `undefined` if neither matches a supported renderer format. */
|
|
8
|
+
export declare const getOoxmlMimeType: (name: string, mimeType?: string) => string | undefined;
|
|
2
9
|
/** Returns true if the file name has an extension known to be text-previewable. */
|
|
3
10
|
export declare const isTextPreviewable: (name: string) => boolean;
|
|
4
11
|
/** Returns true if the file name has an HTML extension (`html` or `htm`). */
|
package/utils/content.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,aAAa,EACd,MAAM,4BAA4B,CAAC;AAuBpC,+GAA+G;AAC/G,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,aAAa,GAAG,SAUlB,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,OAC3B,CAAC;AAE3C,uJAAuJ;AACvJ,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,MAAM,GAAG,SAGX,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAoDF,+JAA+J;AAC/J,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAC/B,CAAC;AAE7B,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,GACzC,MAAM,MAAM,KACX,wBAGD,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC"}
|
package/utils/download.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAoB3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,OA6BjE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,IAAI,CAIhE,CAAC;AAuCF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,GACpC,SAAS,uBAAuB,EAChC,WAAW,MAAM,KAChB,IA8DF,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
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
|
+
/** Creates a canvas-backed text measurer, or `undefined` when no 2D context is available. */
|
|
103
|
+
export declare const createOoxmlTextMeasurer: () => OoxmlTextMeasurer | undefined;
|
|
104
|
+
/** Size in CSS pixels of a DOCX page whose `pageSize` is given in points. */
|
|
105
|
+
export declare const docxPageSizePx: (pageSizePt: {
|
|
106
|
+
widthPt: number;
|
|
107
|
+
heightPt: number;
|
|
108
|
+
}, scale: number) => OoxmlSurfaceSize;
|
|
109
|
+
/** Size in CSS pixels of a PPTX slide whose dimensions are given in EMU. */
|
|
110
|
+
export declare const pptxSlideSizePx: (slideWidthEmu: number, slideHeightEmu: number, scale: number) => OoxmlSurfaceSize;
|
|
111
|
+
/**
|
|
112
|
+
* Offset of one page or slide inside its scroll host's content box.
|
|
113
|
+
*
|
|
114
|
+
* This is the only place the page-stacking relationship is encoded. Every input
|
|
115
|
+
* is published by the vendor — page/slide size, the current scale, and the
|
|
116
|
+
* `gap`/padding this renderer itself passes in — but the stacking arithmetic is
|
|
117
|
+
* derived from the installed build rather than guaranteed by a public type, so
|
|
118
|
+
* a `@silurus/ooxml` upgrade can change it with no TypeScript signal. Keeping it
|
|
119
|
+
* here means such an upgrade breaks one function and one test.
|
|
120
|
+
*/
|
|
121
|
+
export declare const resolveSurfaceOffset: ({ index, sizeAt, hostClientWidth, layout, }: OoxmlSurfaceOffsetOptions) => OoxmlSurfaceOffset;
|
|
122
|
+
/**
|
|
123
|
+
* Merges rectangles that sit on one visual line and touch or overlap.
|
|
124
|
+
*
|
|
125
|
+
* A cited sentence usually spans several runs; without this it renders as a row
|
|
126
|
+
* of separate boxes instead of one band.
|
|
127
|
+
*/
|
|
128
|
+
export declare const mergeSameLineRects: (rects: readonly OoxmlHighlightRect[]) => OoxmlHighlightRect[];
|
|
129
|
+
/**
|
|
130
|
+
* Rectangles covering one DOCX range, grouped per page.
|
|
131
|
+
*
|
|
132
|
+
* Returns an empty array whenever the range cannot be resolved with confidence —
|
|
133
|
+
* no matching run, a resolved text that disagrees with the selector's own
|
|
134
|
+
* `text`, or an offset past the end of the resolved text.
|
|
135
|
+
*/
|
|
136
|
+
export declare const resolveDocxRects: ({ location, pages, measure, }: OoxmlDocxResolveOptions) => OoxmlDocxPageRects[];
|
|
137
|
+
/**
|
|
138
|
+
* Rectangles covering one PPTX range on one slide, in that slide's CSS pixel space.
|
|
139
|
+
*
|
|
140
|
+
* Returns an empty array when no run matches the shape, when the resolved text
|
|
141
|
+
* disagrees with the selector's `text`, or when the matched shape is rotated or
|
|
142
|
+
* flipped.
|
|
143
|
+
*/
|
|
144
|
+
export declare const resolvePptxRects: ({ location, runs, measure, }: OoxmlPptxResolveOptions) => OoxmlHighlightRect[];
|
|
145
|
+
/** 0-based index of the sheet a location names, or `null` when the workbook has no such sheet. */
|
|
146
|
+
export declare const resolveXlsxSheetIndex: (sheet: string, sheetNames: readonly string[]) => number | null;
|
|
147
|
+
/** A1-style reference for a 1-based cell address, for the viewer's string-keyed `scrollToCell`. */
|
|
148
|
+
export declare const toXlsxCellRef: ({ row, col }: OoxmlCellAddress) => string;
|
|
149
|
+
/**
|
|
150
|
+
* Rectangles covering one XLSX cell or same-row range, in the grid's viewport space.
|
|
151
|
+
*
|
|
152
|
+
* A cell the viewer reports as unmeasurable contributes nothing rather than a
|
|
153
|
+
* zero rectangle, which would draw a visible artefact at the grid origin.
|
|
154
|
+
*/
|
|
155
|
+
export declare const resolveXlsxRects: ({ location, getCellViewportRect, viewportWidth, }: OoxmlXlsxResolveOptions) => OoxmlHighlightRect[];
|
|
156
|
+
export {};
|
|
157
|
+
//# sourceMappingURL=ooxml-highlight-geometry.d.ts.map
|
|
@@ -0,0 +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;I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C,kBAAkB,EA8BpB,CAAC;AA0JF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,+BAI9B,uBAAuB,KAAG,kBAAkB,EA0D9C,CAAC;AAaF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,8BAI9B,uBAAuB,KAAG,kBAAkB,EA+C9C,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,qBAAqB,GAChC,OAAO,MAAM,EACb,YAAY,SAAS,MAAM,EAAE,KAC5B,MAAM,GAAG,IAMX,CAAC;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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DocxDocument } from '@silurus/ooxml/docx';
|
|
2
|
+
import { PptxPresentation } from '@silurus/ooxml/pptx';
|
|
3
|
+
import { XlsxViewer } from '@silurus/ooxml/xlsx';
|
|
4
|
+
import { OoxmlHighlight, OoxmlHighlightLocation } from '../models/attachment-canvas';
|
|
5
|
+
import { OoxmlHighlightRect } from './ooxml-highlight-geometry';
|
|
6
|
+
/**
|
|
7
|
+
* One rectangle to draw, tagged with the highlight it belongs to. Kept in
|
|
8
|
+
* this dynamically-loaded module (not `OoxmlContent.tsx`) alongside the
|
|
9
|
+
* factories that produce it, so importing the type costs nothing in the
|
|
10
|
+
* eager entry — see the bundle-size budget test in
|
|
11
|
+
* `tests/package-boundary/bundle-budgets.spec.ts`.
|
|
12
|
+
*/
|
|
13
|
+
export interface TaggedHighlightRect extends OoxmlHighlightRect {
|
|
14
|
+
/** Id of the `OoxmlHighlight` this rectangle came from. */
|
|
15
|
+
highlightId: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Per-format glue between document coordinates and the overlay.
|
|
19
|
+
*
|
|
20
|
+
* Created alongside the viewer so both read the same parse, and discarded with
|
|
21
|
+
* it. `measure` returns rectangles in the overlay's coordinate space, which is
|
|
22
|
+
* the viewer container's own box.
|
|
23
|
+
*/
|
|
24
|
+
export interface OoxmlHighlightSurface {
|
|
25
|
+
/** Rectangles for every highlight that currently resolves. */
|
|
26
|
+
measure(highlights: readonly OoxmlHighlight[]): Promise<TaggedHighlightRect[]>;
|
|
27
|
+
/** Brings one cited location into view, whether or not it resolves to a rectangle. */
|
|
28
|
+
navigate(location: OoxmlHighlightLocation): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/** Creates the DOCX highlight surface over an already-loaded document. */
|
|
31
|
+
export declare const createDocxHighlightSurface: (container: HTMLElement, docxDocument: DocxDocument, viewer: {
|
|
32
|
+
getScale(): number;
|
|
33
|
+
scrollToPage(index: number): void;
|
|
34
|
+
}, isDisposed: () => boolean) => OoxmlHighlightSurface;
|
|
35
|
+
/** Creates the PPTX highlight surface over an already-loaded presentation. */
|
|
36
|
+
export declare const createPptxHighlightSurface: (container: HTMLElement, presentation: PptxPresentation, viewer: {
|
|
37
|
+
getScale(): number;
|
|
38
|
+
scrollToSlide(index: number): void;
|
|
39
|
+
}, isDisposed: () => boolean) => OoxmlHighlightSurface;
|
|
40
|
+
/** Creates the XLSX highlight surface over the self-loading viewer. */
|
|
41
|
+
export declare const createXlsxHighlightSurface: (container: HTMLElement, viewer: XlsxViewer, isDisposed: () => boolean) => OoxmlHighlightSurface;
|
|
42
|
+
//# sourceMappingURL=ooxml-highlight-surfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ooxml-highlight-surfaces.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-surfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,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list
|
|
4
|
+
* (comma-separated, case-insensitive) includes `mimeType`, or `undefined` if
|
|
5
|
+
* none match. First-match-wins when multiple entries cover the same MIME type.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findVisualizerForMime: (mimeType: string, visualizers: CustomVisualizer[]) => CustomVisualizer | undefined;
|
|
8
|
+
//# sourceMappingURL=visualizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualizer.d.ts","sourceRoot":"","sources":["../../src/utils/visualizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,aAAa,gBAAgB,EAAE,KAC9B,gBAAgB,GAAG,SASrB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package names that must never be bundled into the built package — each is
|
|
3
|
+
* declared in `package.json` as either a peer (resolved to the copy the host
|
|
4
|
+
* app already installs) or a dependency (npm installs it alongside this
|
|
5
|
+
* package), and either way the import stays external so consumers get one
|
|
6
|
+
* shared copy rather than a second one inlined here.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXTERNAL_PEER_NAMES: readonly ["react", "@epam/ai-dial-chat-shared", "@epam/ai-dial-shared", "@epam/ai-dial-sidebar", "@epam/ai-dial-ui-kit", "@epam/ai-dial-visualizer-connector", "@tabler/icons-react", "react-json-view-lite", "@epam/ai-dial-react-pdf-highlighter", "@epam/pdf-highlighter-kit", "react-syntax-highlighter", "@mcp-ui/client", "@modelcontextprotocol/sdk", "@modelcontextprotocol/ext-apps", "pdfjs-dist"];
|
|
9
|
+
/**
|
|
10
|
+
* Returns true when `id` is a bare peer package name, or is prefixed by
|
|
11
|
+
* `<peerName>/` (a deep subpath of that peer), for any name in
|
|
12
|
+
* {@link EXTERNAL_PEER_NAMES} — except when `id` ends in `.css`, since a
|
|
13
|
+
* vendor stylesheet subpath must stay locally resolved (via `resolve.alias`)
|
|
14
|
+
* so Vite can process and extract it, rather than being left as an
|
|
15
|
+
* unresolvable raw `import "…css"` statement in the output JS.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isExternalPeerImport: (id: string) => boolean;
|
|
18
|
+
//# sourceMappingURL=vite-external-matcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-external-matcher.d.ts","sourceRoot":"","sources":["../../src/utils/vite-external-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,8YAgBtB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,KAAG,OAKjD,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { $ as e, $t as t } from "./renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js";
|
|
2
|
+
import { En as n, Fn as r, In as i, Ln as a, en as o, fn as s } from "./bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js";
|
|
3
|
+
//#region ../../node_modules/@silurus/ooxml/dist/resource-measurement-CclArDRs.js
|
|
4
|
+
function c(e, t) {
|
|
5
|
+
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
6
|
+
}
|
|
7
|
+
var l = "duotone";
|
|
8
|
+
async function u(u, d, f, p, m = {}) {
|
|
9
|
+
let { offscreenFactory: h, failClosedOnDuotoneFailure: g = !1, ..._ } = m, v = f ? {
|
|
10
|
+
..._,
|
|
11
|
+
maxRetainedPixels: Math.min(_.maxRetainedPixels ?? 33554432, Math.floor(t / 4))
|
|
12
|
+
} : _, y = f ? {
|
|
13
|
+
...v,
|
|
14
|
+
targetWidthPx: void 0,
|
|
15
|
+
targetHeightPx: void 0
|
|
16
|
+
} : v, b = f ? i(p, l) : void 0, x = await r(u, d, p, y);
|
|
17
|
+
if (!f || !x) return x;
|
|
18
|
+
let S = await s(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
|
+
return n(l, `${c(S, f)}${w}${g ? "|strict" : ""}`, p, async () => {
|
|
20
|
+
let { w: t, h: n } = e(x);
|
|
21
|
+
if (t <= 0 || n <= 0) return {
|
|
22
|
+
bitmap: g ? null : x,
|
|
23
|
+
owned: !1
|
|
24
|
+
};
|
|
25
|
+
let r = await o(x, f, {
|
|
26
|
+
width: t,
|
|
27
|
+
height: n,
|
|
28
|
+
offscreenFactory: h,
|
|
29
|
+
targetWidthPx: _.targetWidthPx,
|
|
30
|
+
targetHeightPx: _.targetHeightPx
|
|
31
|
+
});
|
|
32
|
+
if (r === x) {
|
|
33
|
+
if (g) return {
|
|
34
|
+
bitmap: null,
|
|
35
|
+
owned: !1
|
|
36
|
+
};
|
|
37
|
+
if (!C) return {
|
|
38
|
+
bitmap: x,
|
|
39
|
+
owned: !1
|
|
40
|
+
};
|
|
41
|
+
if (typeof createImageBitmap > "u") throw Error("createImageBitmap is unavailable for duotone fallback resampling");
|
|
42
|
+
let e = await createImageBitmap(x, C);
|
|
43
|
+
return {
|
|
44
|
+
bitmap: e,
|
|
45
|
+
owned: e !== x
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
let i = r;
|
|
49
|
+
return {
|
|
50
|
+
bitmap: i,
|
|
51
|
+
owned: i !== x
|
|
52
|
+
};
|
|
53
|
+
}, b);
|
|
54
|
+
}
|
|
55
|
+
function d(e, t) {
|
|
56
|
+
if (!Number.isSafeInteger(e) || e < 0) throw Error(`${t} must be a non-negative safe integer`);
|
|
57
|
+
}
|
|
58
|
+
function f(e, t, n) {
|
|
59
|
+
return d(e, "resource measurement"), d(t, "resource measurement"), d(n, "resource measurement limit"), e > n || t > n || t > n - e ? n === 2 ** 53 - 1 ? n : n + 1 : e + t;
|
|
60
|
+
}
|
|
61
|
+
function p(e, t = 2 ** 53 - 1) {
|
|
62
|
+
d(t, "resource measurement limit");
|
|
63
|
+
let n = 0;
|
|
64
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
65
|
+
let i = e.charCodeAt(r), a;
|
|
66
|
+
if (i <= 127) a = 1;
|
|
67
|
+
else if (i <= 2047) a = 2;
|
|
68
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
69
|
+
let t = e.charCodeAt(r + 1);
|
|
70
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 3;
|
|
71
|
+
} else a = 3;
|
|
72
|
+
if (n = f(n, a, t), n > t) return n;
|
|
73
|
+
}
|
|
74
|
+
return n;
|
|
75
|
+
}
|
|
76
|
+
function m(e, t = 2 ** 53 - 1) {
|
|
77
|
+
d(t, "resource measurement limit");
|
|
78
|
+
let n = f(0, 2, t);
|
|
79
|
+
if (n > t) return n;
|
|
80
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
81
|
+
let i = e.charCodeAt(r), a;
|
|
82
|
+
if (i === 34 || i === 92 || i === 8 || i === 9 || i === 10 || i === 12 || i === 13) a = 2;
|
|
83
|
+
else if (i <= 31) a = 6;
|
|
84
|
+
else if (i <= 127) a = 1;
|
|
85
|
+
else if (i <= 2047) a = 2;
|
|
86
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
87
|
+
let t = e.charCodeAt(r + 1);
|
|
88
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 6;
|
|
89
|
+
} else a = i >= 55296 && i <= 57343 ? 6 : 3;
|
|
90
|
+
if (n = f(n, a, t), n > t) return n;
|
|
91
|
+
}
|
|
92
|
+
return n;
|
|
93
|
+
}
|
|
94
|
+
function h(e, t) {
|
|
95
|
+
return f(0, e, t);
|
|
96
|
+
}
|
|
97
|
+
function g(e, t = 2 ** 53 - 1, n = !1) {
|
|
98
|
+
if (d(t, "resource measurement limit"), e === null) return {
|
|
99
|
+
jsonBytes: h(4, t),
|
|
100
|
+
stringValueUtf8Bytes: 0
|
|
101
|
+
};
|
|
102
|
+
if (typeof e == "string") return {
|
|
103
|
+
jsonBytes: m(e, t),
|
|
104
|
+
stringValueUtf8Bytes: p(e, t)
|
|
105
|
+
};
|
|
106
|
+
if (typeof e == "boolean") return {
|
|
107
|
+
jsonBytes: h(e ? 4 : 5, t),
|
|
108
|
+
stringValueUtf8Bytes: 0
|
|
109
|
+
};
|
|
110
|
+
if (typeof e == "number") return {
|
|
111
|
+
jsonBytes: h((Number.isFinite(e) ? String(Object.is(e, -0) ? 0 : e) : "null").length, t),
|
|
112
|
+
stringValueUtf8Bytes: 0
|
|
113
|
+
};
|
|
114
|
+
if (typeof e == "bigint") throw TypeError("BigInt values cannot be serialized to JSON");
|
|
115
|
+
if (Array.isArray(e)) {
|
|
116
|
+
let n = h(2, t), r = 0;
|
|
117
|
+
for (let i = 0; i < e.length; i += 1) {
|
|
118
|
+
i !== 0 && (n = f(n, 1, t));
|
|
119
|
+
let a = g(e[i], t, !0);
|
|
120
|
+
n = f(n, a.jsonBytes, t), r = f(r, a.stringValueUtf8Bytes, t);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
jsonBytes: n,
|
|
124
|
+
stringValueUtf8Bytes: r
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
if (typeof e == "object") {
|
|
128
|
+
let n = h(2, t), r = 0, i = 0;
|
|
129
|
+
for (let [a, o] of Object.entries(e)) {
|
|
130
|
+
if (o === void 0 || typeof o == "function" || typeof o == "symbol") continue;
|
|
131
|
+
i++ !== 0 && (n = f(n, 1, t)), n = f(n, m(a, t), t), n = f(n, 1, t);
|
|
132
|
+
let e = g(o, t);
|
|
133
|
+
n = f(n, e.jsonBytes, t), r = f(r, e.stringValueUtf8Bytes, t);
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
jsonBytes: n,
|
|
137
|
+
stringValueUtf8Bytes: r
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
jsonBytes: n ? h(4, t) : 0,
|
|
142
|
+
stringValueUtf8Bytes: 0
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region ../../node_modules/@silurus/ooxml/dist/visible-index-DPoQYSDt.js
|
|
147
|
+
function _(e, t, n, r) {
|
|
148
|
+
for (let i = e + t; i >= 0 && i < r; i += t) if (!n(i)) return i;
|
|
149
|
+
return e;
|
|
150
|
+
}
|
|
151
|
+
function v(e, t, n) {
|
|
152
|
+
if (n === 0 || !t(e)) return e;
|
|
153
|
+
let r = _(e, 1, t, n);
|
|
154
|
+
return r === e ? _(e, -1, t, n) : r;
|
|
155
|
+
}
|
|
156
|
+
function y(e, t) {
|
|
157
|
+
let n = 0;
|
|
158
|
+
for (let r = 0; r < t; r++) e(r) || n++;
|
|
159
|
+
return n;
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { f as a, u as c, c as i, y as n, g as o, v as r, p as s, _ as t };
|