@epam/ai-dial-quotations 1.0.0-rc.7 → 1.0.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/components/CitationCard/CitationCard.d.ts +2 -0
- package/components/CitationCard/CitationCard.d.ts.map +1 -1
- package/components/CitationDropdown/CitationDropdown.d.ts.map +1 -1
- package/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.d.ts +41 -0
- package/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +185 -140
- package/package.json +3 -2
- package/utils/annotation.d.ts +1 -2
- package/utils/annotation.d.ts.map +1 -1
|
@@ -39,6 +39,8 @@ export interface CitationCardTypography {
|
|
|
39
39
|
titleClassName?: string;
|
|
40
40
|
/** CSS class applied to the quoted excerpt. Defaults to `'dial-small-text'`. */
|
|
41
41
|
quoteClassName?: string;
|
|
42
|
+
/** CSS class applied to bold spans inside the quoted excerpt. Defaults to `'dial-small-semi-text'` — the semibold step matching the default `quoteClassName`. */
|
|
43
|
+
quoteStrongClassName?: string;
|
|
42
44
|
/** CSS class applied to the pagination switcher text. Defaults to `'dial-tiny-text'`. */
|
|
43
45
|
switcherClassName?: string;
|
|
44
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationCard.d.ts","sourceRoot":"","sources":["../../../src/components/CitationCard/CitationCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"CitationCard.d.ts","sourceRoot":"","sources":["../../../src/components/CitationCard/CitationCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAe5D,OAAO,EAAE,EAAE,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG/E,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,2GAA2G;IAC3G,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/D,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qGAAqG;AACrG,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iKAAiK;IACjK,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,KAAK,EAAE,eAAe,CAAC;IACvB,kFAAkF;IAClF,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C,2EAA2E;IAC3E,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,4BAA4B;IAC5B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,gCAAgC;IAChC,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqJ9C,CAAC;;AAEF,wBAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/CitationDropdown/CitationDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"CitationDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/CitationDropdown/CitationDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAAE,EAAE,EAAQ,SAAS,EAAwB,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAG1C,kDAAkD;AAClD,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,KAAK,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C,uEAAuE;IACvE,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,wDAAwD;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uFAAuF;IACvF,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,+CAA+C;IAC/C,UAAU,EAAE,kBAAkB,CAAC;IAC/B,yDAAyD;IACzD,YAAY,EAAE,oBAAoB,CAAC;IACnC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,gGAAgG;IAChG,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,8HAA8H;AAC9H,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuEtD,CAAC;;AAEF,wBAAsC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Annotation } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { Components } from 'react-markdown';
|
|
3
|
+
import { CitationCardLabels } from '../../components/CitationCard/CitationCard';
|
|
4
|
+
import { CitationMarkerLabels } from '../../components/CitationMarker/CitationMarker';
|
|
5
|
+
import { AnnotationGroup } from '../../utils/group-annotations-by-source';
|
|
6
|
+
/** Host-supplied callbacks and label builder consumed by `useCitationMarkdownComponents`. */
|
|
7
|
+
export interface UseCitationMarkdownComponentsCallbacks {
|
|
8
|
+
/** Called when a citation marker's preview action is invoked, with the clicked annotation and its group. */
|
|
9
|
+
onPreview(annotation: Annotation, group: AnnotationGroup): void;
|
|
10
|
+
/** Called when a citation marker's open-in-browser action is invoked. */
|
|
11
|
+
onOpenInBrowser(annotation: Annotation): void;
|
|
12
|
+
/** Builds the translated label bundles used by a given citation group's card and marker. */
|
|
13
|
+
buildLabels(group: AnnotationGroup): {
|
|
14
|
+
cardLabels: CitationCardLabels;
|
|
15
|
+
markerLabels: CitationMarkerLabels;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds react-markdown component overrides that inject citation markers into
|
|
20
|
+
* rendered paragraph text at the character offsets stored in each annotation
|
|
21
|
+
* group's primary selector.
|
|
22
|
+
*
|
|
23
|
+
* The `p` and `li` component overrides are stable references — they only
|
|
24
|
+
* change when `groups` transitions between empty and non-empty. Citation card
|
|
25
|
+
* open/close state is provided via `CitationCardContext` so that state changes
|
|
26
|
+
* do not recreate the component functions, preventing ReactMarkdown from
|
|
27
|
+
* unmounting and remounting the paragraph subtree on every interaction.
|
|
28
|
+
*
|
|
29
|
+
* Returns both the pre-processed content string (with sentinel placeholders
|
|
30
|
+
* injected at the right offsets) and the `Components` map to pass to the
|
|
31
|
+
* markdown renderer.
|
|
32
|
+
*
|
|
33
|
+
* `isCompactTypography` drops the paragraph class one type-scale step, matching
|
|
34
|
+
* `COMPACT_MARKDOWN_CLASS_NAMES` so cited and uncited paragraphs stay the same
|
|
35
|
+
* size.
|
|
36
|
+
*/
|
|
37
|
+
export declare const useCitationMarkdownComponents: (content: string, groups: AnnotationGroup[], callbacks: UseCitationMarkdownComponentsCallbacks, isCompactTypography?: boolean) => {
|
|
38
|
+
processedContent: string;
|
|
39
|
+
markdownComponents: Components;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=useCitationMarkdownComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCitationMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAErF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAK3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE/E,6FAA6F;AAC7F,MAAM,WAAW,sCAAsC;IACrD,4GAA4G;IAC5G,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAChE,yEAAyE;IACzE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9C,4FAA4F;IAC5F,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG;QACnC,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,QAAQ,eAAe,EAAE,EACzB,WAAW,sCAAsC,EACjD,6BAA2B,KAC1B;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,UAAU,CAAA;CAsD5D,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
._card_1kph1_1{background:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc))}._quote_1kph1_5{color:var(--cc-quote-text,var(--text-secondary,#57647a))}._title_1kph1_9{color:var(--cc-title-text,var(--text-primary,#161b2d))}._switcher_1kph1_13{color:var(--cc-switcher-text,var(--text-secondary,#57647a))}._sourceName_1kph1_17{color:var(--cc-source-name-text,var(--text-primary,#161b2d))}
|
|
1
|
+
._card_1kph1_1{background:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc))}._quote_1kph1_5{color:var(--cc-quote-text,var(--text-secondary,#57647a))}._title_1kph1_9{color:var(--cc-title-text,var(--text-primary,#161b2d))}._switcher_1kph1_13{color:var(--cc-switcher-text,var(--text-secondary,#57647a))}._sourceName_1kph1_17{color:var(--cc-source-name-text,var(--text-primary,#161b2d))}._content_xzs0h_1>svg{fill:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc));stroke:#0000}
|
|
2
2
|
/*$vite$:1*/
|
package/index.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ export { CitationCardProvider, useCitationCardContext, } from './context/Citatio
|
|
|
8
8
|
export type { CitationCardHook } from './context/CitationCardContext';
|
|
9
9
|
export { useAnnotations } from './utils/useAnnotations';
|
|
10
10
|
export { useCitationCard } from './utils/useCitationCard';
|
|
11
|
+
export { useCitationMarkdownComponents } from './hooks/useCitationMarkdownComponents/useCitationMarkdownComponents';
|
|
12
|
+
export type { UseCitationMarkdownComponentsCallbacks } from './hooks/useCitationMarkdownComponents/useCitationMarkdownComponents';
|
|
11
13
|
export { groupAnnotationsBySource } from './utils/group-annotations-by-source';
|
|
12
14
|
export type { AnnotationGroup } from './utils/group-annotations-by-source';
|
|
13
15
|
export { annotationsToPdfHighlights, annotationHighlightId, normalizeRawAnnotations, resolveMessageAnnotations, } from './utils/annotation';
|
|
14
|
-
export type { AttachmentResource } from './utils/annotation';
|
|
15
16
|
export { injectCitationSentinels, replaceSentinelsInChildren, } from './utils/citation-injection';
|
|
16
17
|
export { isReferenceOnlyAttachment, parsePdfPageReference, getReferenceAttachmentGroups, } from './utils/reference-attachment';
|
|
17
18
|
export type { PdfPageReference } from './utils/reference-attachment';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,YAAY,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAG5F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,YAAY,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAG5F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,qEAAqE,CAAC;AACpH,YAAY,EAAE,sCAAsC,EAAE,MAAM,qEAAqE,CAAC;AAGlI,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,159 +1,166 @@
|
|
|
1
1
|
import { MIMEType as e, MarkdownRenderer as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import {
|
|
3
|
-
import { IconChevronLeft as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
2
|
+
import { DIAL_KIT_ICON_STROKE as i, ElementSize as a, EllipsisTooltip as o, GhostIconButton as s, NeutralButton as c, PrimaryButton as l, Tooltip as u } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconChevronLeft as d, IconChevronRight as f } from "@tabler/icons-react";
|
|
4
|
+
import { createContext as p, memo as m, useCallback as h, useContext as g, useMemo as _, useState as v } from "react";
|
|
5
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
6
|
+
var x = {
|
|
7
7
|
card: "_card_1kph1_1",
|
|
8
8
|
quote: "_quote_1kph1_5",
|
|
9
9
|
title: "_title_1kph1_9",
|
|
10
10
|
switcher: "_switcher_1kph1_13",
|
|
11
11
|
sourceName: "_sourceName_1kph1_17"
|
|
12
|
-
},
|
|
13
|
-
let
|
|
14
|
-
"--cc-card-bg":
|
|
15
|
-
"--cc-quote-text":
|
|
16
|
-
"--cc-title-text":
|
|
17
|
-
"--cc-switcher-text":
|
|
18
|
-
"--cc-source-name-text":
|
|
12
|
+
}, S = ({ group: c, activeIndex: u, onIndexChange: p, onPreview: m, onOpenInBrowser: h, headerIcon: g, labels: _, typography: v, colors: S }) => {
|
|
13
|
+
let C = c.annotations.length, w = c.annotations[u] ?? c.primaryAnnotation, T = C > 1, E = c.primaryAnnotation.body?.source?.attachment?.type, D = m == null || E === e.HTML || E === e.XHTML, O = v?.sourceNameClassName ?? "dial-tiny-text", k = v?.titleClassName ?? "dial-body-semi-text", A = v?.quoteClassName ?? "dial-small-text", j = v?.quoteStrongClassName ?? "dial-small-semi-text", M = v?.switcherClassName ?? "dial-tiny-text", N = n({
|
|
14
|
+
"--cc-card-bg": S?.cardBackground,
|
|
15
|
+
"--cc-quote-text": S?.quoteText,
|
|
16
|
+
"--cc-title-text": S?.titleText,
|
|
17
|
+
"--cc-switcher-text": S?.switcherText,
|
|
18
|
+
"--cc-source-name-text": S?.sourceNameText
|
|
19
19
|
});
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ b("div", {
|
|
21
21
|
role: "dialog",
|
|
22
22
|
"aria-modal": "true",
|
|
23
|
-
"aria-label":
|
|
24
|
-
style:
|
|
25
|
-
className: r("flex w-[400px] flex-col gap-3 rounded-lg p-4 shadow-lg",
|
|
23
|
+
"aria-label": _.ariaLabel,
|
|
24
|
+
style: N,
|
|
25
|
+
className: r("flex w-[400px] flex-col gap-3 rounded-lg p-4 shadow-lg", x.card),
|
|
26
26
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ b("div", {
|
|
28
28
|
className: "flex items-center justify-between gap-2",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ b("div", {
|
|
30
30
|
className: "flex min-w-0 items-center gap-1",
|
|
31
|
-
children: [
|
|
32
|
-
text:
|
|
33
|
-
className: r(O, "min-w-0",
|
|
31
|
+
children: [g, /* @__PURE__ */ y(o, {
|
|
32
|
+
text: c.sourceName,
|
|
33
|
+
className: r(O, "min-w-0", x.sourceName)
|
|
34
34
|
})]
|
|
35
|
-
}),
|
|
35
|
+
}), T && /* @__PURE__ */ b("div", {
|
|
36
36
|
className: "flex shrink-0 items-center gap-1",
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
icon: /* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ y(s, {
|
|
39
|
+
icon: /* @__PURE__ */ y(d, {
|
|
40
40
|
size: 14,
|
|
41
|
-
className: "rtl:scale-x-[-1]"
|
|
41
|
+
className: "rtl:scale-x-[-1]",
|
|
42
|
+
stroke: i
|
|
42
43
|
}),
|
|
43
|
-
size:
|
|
44
|
-
"aria-label":
|
|
45
|
-
onClick: () =>
|
|
44
|
+
size: a.Small,
|
|
45
|
+
"aria-label": _.previousCitation,
|
|
46
|
+
onClick: () => p((u - 1 + C) % C)
|
|
46
47
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
className: r(
|
|
49
|
-
children:
|
|
48
|
+
/* @__PURE__ */ y("span", {
|
|
49
|
+
className: r(M, x.switcher),
|
|
50
|
+
children: _.formatSwitcherText(u + 1, C)
|
|
50
51
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
icon: /* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ y(s, {
|
|
53
|
+
icon: /* @__PURE__ */ y(f, {
|
|
53
54
|
size: 14,
|
|
54
|
-
className: "rtl:scale-x-[-1]"
|
|
55
|
+
className: "rtl:scale-x-[-1]",
|
|
56
|
+
stroke: i
|
|
55
57
|
}),
|
|
56
|
-
size:
|
|
57
|
-
"aria-label":
|
|
58
|
-
onClick: () =>
|
|
58
|
+
size: a.Small,
|
|
59
|
+
"aria-label": _.nextCitation,
|
|
60
|
+
onClick: () => p((u + 1) % C)
|
|
59
61
|
})
|
|
60
62
|
]
|
|
61
63
|
})]
|
|
62
64
|
}),
|
|
63
|
-
(
|
|
65
|
+
(w.body?.title || w.body?.quote || T) && /* @__PURE__ */ b("div", {
|
|
64
66
|
className: "flex flex-col gap-3",
|
|
65
|
-
children: [
|
|
66
|
-
className: r(k,
|
|
67
|
-
children:
|
|
68
|
-
}), (
|
|
69
|
-
className: r(
|
|
70
|
-
children:
|
|
71
|
-
content:
|
|
72
|
-
classNames: {
|
|
67
|
+
children: [w.body?.title && /* @__PURE__ */ y("p", {
|
|
68
|
+
className: r(k, x.title, "break-words"),
|
|
69
|
+
children: w.body.title
|
|
70
|
+
}), (w.body?.quote || T) && /* @__PURE__ */ y("div", {
|
|
71
|
+
className: r(A, x.quote, "line-clamp-6 break-words", T && "min-h-[3lh]"),
|
|
72
|
+
children: w.body?.quote && /* @__PURE__ */ y(t, {
|
|
73
|
+
content: w.body.quote,
|
|
74
|
+
classNames: {
|
|
75
|
+
p: r(A, x.quote),
|
|
76
|
+
ul: r(A, "ps-3"),
|
|
77
|
+
ol: r(A, "ps-3"),
|
|
78
|
+
strong: j
|
|
79
|
+
}
|
|
73
80
|
})
|
|
74
81
|
})]
|
|
75
82
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ b("div", {
|
|
77
84
|
className: "flex justify-start gap-2",
|
|
78
|
-
children: [
|
|
79
|
-
label:
|
|
80
|
-
size:
|
|
81
|
-
onClick: () =>
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
label: D ?
|
|
84
|
-
size:
|
|
85
|
-
onClick: () =>
|
|
85
|
+
children: [m && /* @__PURE__ */ y(l, {
|
|
86
|
+
label: _.preview,
|
|
87
|
+
size: a.Small,
|
|
88
|
+
onClick: () => m(w)
|
|
89
|
+
}), /* @__PURE__ */ y(l, {
|
|
90
|
+
label: D ? _.openInBrowser : _.download,
|
|
91
|
+
size: a.Small,
|
|
92
|
+
onClick: () => h(w)
|
|
86
93
|
})]
|
|
87
94
|
})
|
|
88
95
|
]
|
|
89
96
|
});
|
|
90
97
|
};
|
|
91
|
-
|
|
98
|
+
m(S);
|
|
92
99
|
//#endregion
|
|
93
100
|
//#region src/components/CitationMarker/CitationMarker.tsx
|
|
94
|
-
var
|
|
95
|
-
let o = /* @__PURE__ */
|
|
101
|
+
var C = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: i = "dial-caption-text" }) => {
|
|
102
|
+
let o = /* @__PURE__ */ b("span", {
|
|
96
103
|
className: "flex items-center gap-1",
|
|
97
|
-
children: [n, /* @__PURE__ */
|
|
98
|
-
className:
|
|
104
|
+
children: [n, /* @__PURE__ */ y("span", {
|
|
105
|
+
className: i,
|
|
99
106
|
children: e > 1 ? r.labelWithOverflow : r.label
|
|
100
107
|
})]
|
|
101
108
|
});
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
size:
|
|
109
|
+
return /* @__PURE__ */ y(c, {
|
|
110
|
+
size: a.Small,
|
|
104
111
|
label: o,
|
|
105
112
|
"aria-label": r.ariaLabel,
|
|
106
113
|
onClick: t
|
|
107
114
|
});
|
|
108
115
|
};
|
|
109
|
-
|
|
116
|
+
m(C);
|
|
110
117
|
//#endregion
|
|
111
118
|
//#region src/context/CitationCardContext.tsx
|
|
112
|
-
var
|
|
113
|
-
let e =
|
|
119
|
+
var w = p(null), T = w.Provider, E = () => {
|
|
120
|
+
let e = g(w);
|
|
114
121
|
if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
|
|
115
122
|
return e;
|
|
116
|
-
},
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
}, D = { content: "_content_xzs0h_1" }, O = ({ group: e, onPreview: t, onOpenInBrowser: n, icon: i, headerIcon: a, cardLabels: o, markerLabels: s, cardTypography: c, markerLabelClassName: l }) => {
|
|
124
|
+
let d = E(), f = d.isOpen(e.sourceUrl), p = d.getActiveIndex(e.sourceUrl), m = h((e) => {
|
|
125
|
+
e || d.closePopup();
|
|
126
|
+
}, [d]), g = _(() => t ? (e) => {
|
|
127
|
+
t(e), d.closePopup();
|
|
128
|
+
} : void 0, [t, d]);
|
|
129
|
+
return /* @__PURE__ */ y(u, {
|
|
130
|
+
open: f,
|
|
131
|
+
onOpenChange: m,
|
|
123
132
|
triggerClassName: "ms-1 inline-flex align-middle",
|
|
124
|
-
contentClassName: "!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none
|
|
125
|
-
tooltip: /* @__PURE__ */
|
|
133
|
+
contentClassName: r("!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none", D.content),
|
|
134
|
+
tooltip: /* @__PURE__ */ y(S, {
|
|
126
135
|
group: e,
|
|
127
|
-
activeIndex:
|
|
128
|
-
onIndexChange: (t) =>
|
|
129
|
-
onPreview: g
|
|
130
|
-
t(e), u.closePopup();
|
|
131
|
-
} : void 0, [t, u]),
|
|
136
|
+
activeIndex: p,
|
|
137
|
+
onIndexChange: (t) => d.setActiveIndex(e.sourceUrl, t),
|
|
138
|
+
onPreview: g,
|
|
132
139
|
onOpenInBrowser: n,
|
|
133
|
-
headerIcon:
|
|
134
|
-
labels:
|
|
135
|
-
typography:
|
|
140
|
+
headerIcon: a,
|
|
141
|
+
labels: o,
|
|
142
|
+
typography: c
|
|
136
143
|
}),
|
|
137
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ y(C, {
|
|
138
145
|
sourceName: e.sourceName,
|
|
139
146
|
annotationCount: e.annotations.length,
|
|
140
|
-
onOpen: () =>
|
|
141
|
-
icon:
|
|
142
|
-
labels:
|
|
143
|
-
labelClassName:
|
|
147
|
+
onOpen: () => d.openPopup(e.sourceUrl),
|
|
148
|
+
icon: i,
|
|
149
|
+
labels: s,
|
|
150
|
+
labelClassName: l
|
|
144
151
|
})
|
|
145
152
|
});
|
|
146
153
|
};
|
|
147
|
-
|
|
154
|
+
m(O);
|
|
148
155
|
//#endregion
|
|
149
156
|
//#region src/utils/annotation.ts
|
|
150
|
-
var
|
|
157
|
+
var k = {
|
|
151
158
|
backgroundColor: "transparent",
|
|
152
159
|
borderColor: "var(--stroke-info, #124ACE)",
|
|
153
160
|
borderWidth: "2px",
|
|
154
161
|
opacity: .5,
|
|
155
162
|
hoverOpacity: .5
|
|
156
|
-
},
|
|
163
|
+
}, A = (e) => e.flatMap((e, t) => {
|
|
157
164
|
let n = e.body?.selector;
|
|
158
165
|
if (n == null) return [];
|
|
159
166
|
let r = (Array.isArray(n) ? n : [n]).flatMap((e) => {
|
|
@@ -170,38 +177,38 @@ var D = {
|
|
|
170
177
|
return r.length === 0 ? [] : [{
|
|
171
178
|
id: String(e.index ?? t),
|
|
172
179
|
bboxes: r,
|
|
173
|
-
style:
|
|
180
|
+
style: k
|
|
174
181
|
}];
|
|
175
|
-
}),
|
|
182
|
+
}), j = (e, t) => String(e.index ?? t), M = (e) => typeof e == "number" ? e : null, N = (e) => {
|
|
176
183
|
if (typeof e != "object" || !e) return null;
|
|
177
184
|
let t = e;
|
|
178
185
|
if (t.type !== "pdf_region") return null;
|
|
179
186
|
let n = t.bbox;
|
|
180
187
|
if (typeof n != "object" || !n) return null;
|
|
181
|
-
let r = n, i =
|
|
188
|
+
let r = n, i = M(r.left), a = M(r.top), o = M(r.width), s = M(r.height);
|
|
182
189
|
return i === null || a === null || o === null || s === null ? null : {
|
|
183
190
|
type: "pdf_bbox",
|
|
184
|
-
page:
|
|
191
|
+
page: M(t.page) ?? 1,
|
|
185
192
|
x1: i,
|
|
186
193
|
y1: a,
|
|
187
194
|
x2: i + o,
|
|
188
195
|
y2: a + s
|
|
189
196
|
};
|
|
190
|
-
},
|
|
197
|
+
}, P = (t, n) => t.flatMap((t) => {
|
|
191
198
|
if (typeof t != "object" || !t) return [];
|
|
192
199
|
let r = t, i = r.target;
|
|
193
200
|
if (typeof i != "object" || !i) return [];
|
|
194
201
|
let a = i, o = a.source;
|
|
195
202
|
if (typeof o != "object" || !o) return [];
|
|
196
|
-
let s =
|
|
203
|
+
let s = M(o.attachment_index);
|
|
197
204
|
if (s === null) return [];
|
|
198
205
|
let c = n.find((e) => e.index === s);
|
|
199
206
|
if (c?.url == null) return [];
|
|
200
|
-
let l =
|
|
207
|
+
let l = N(a.selector);
|
|
201
208
|
if (l === null) return [];
|
|
202
209
|
let u = r.body, d = typeof u == "object" && u ? u : {}, f = typeof d.title == "string" ? d.title : void 0, p = typeof d.quote == "string" ? d.quote : void 0;
|
|
203
210
|
return [{
|
|
204
|
-
index:
|
|
211
|
+
index: M(r.index) ?? void 0,
|
|
205
212
|
body: {
|
|
206
213
|
title: f,
|
|
207
214
|
quote: p,
|
|
@@ -216,28 +223,28 @@ var D = {
|
|
|
216
223
|
selector: l
|
|
217
224
|
}
|
|
218
225
|
}];
|
|
219
|
-
}),
|
|
226
|
+
}), F = (e) => {
|
|
220
227
|
let t = e.custom_content?.annotations;
|
|
221
228
|
if (t?.length) return t.filter((e) => e != null && e.body?.source?.attachment?.url != null);
|
|
222
229
|
let n = e.custom_fields;
|
|
223
230
|
if (typeof n != "object" || !n) return [];
|
|
224
231
|
let r = n.annotations;
|
|
225
|
-
return !Array.isArray(r) || r.length === 0 ? [] :
|
|
226
|
-
},
|
|
232
|
+
return !Array.isArray(r) || r.length === 0 ? [] : P(r, e.custom_content?.attachments ?? []);
|
|
233
|
+
}, I = (e, t) => _(() => t ? [] : F(e), [t, e]), L = {
|
|
227
234
|
openGroupSourceUrl: null,
|
|
228
235
|
activeIndexByGroup: {}
|
|
229
|
-
},
|
|
230
|
-
let [e, t] =
|
|
236
|
+
}, R = () => {
|
|
237
|
+
let [e, t] = v(L), n = h((e) => {
|
|
231
238
|
t((t) => ({
|
|
232
239
|
...t,
|
|
233
240
|
openGroupSourceUrl: e
|
|
234
241
|
}));
|
|
235
|
-
}, []), r =
|
|
242
|
+
}, []), r = h(() => {
|
|
236
243
|
t((e) => ({
|
|
237
244
|
...e,
|
|
238
245
|
openGroupSourceUrl: null
|
|
239
246
|
}));
|
|
240
|
-
}, []), i =
|
|
247
|
+
}, []), i = h((e, n) => {
|
|
241
248
|
t((t) => ({
|
|
242
249
|
...t,
|
|
243
250
|
activeIndexByGroup: {
|
|
@@ -246,7 +253,7 @@ var D = {
|
|
|
246
253
|
}
|
|
247
254
|
}));
|
|
248
255
|
}, []);
|
|
249
|
-
return
|
|
256
|
+
return _(() => ({
|
|
250
257
|
openPopup: n,
|
|
251
258
|
closePopup: r,
|
|
252
259
|
setActiveIndex: i,
|
|
@@ -258,20 +265,81 @@ var D = {
|
|
|
258
265
|
i,
|
|
259
266
|
e
|
|
260
267
|
]);
|
|
261
|
-
},
|
|
268
|
+
}, z = /⟦C(\d+)⟧/g, B = (e, t) => {
|
|
269
|
+
let n = t.map((t, n) => {
|
|
270
|
+
let r = t.primaryAnnotation.target?.selector, i = typeof r == "object" && r && "type" in r && r.type === "text_character_range" ? r.end : e.length;
|
|
271
|
+
return {
|
|
272
|
+
idx: n,
|
|
273
|
+
pos: Math.min(i, e.length)
|
|
274
|
+
};
|
|
275
|
+
}).sort((e, t) => t.pos - e.pos), r = e;
|
|
276
|
+
for (let { idx: e, pos: t } of n) r = `${r.slice(0, t)}⟦C${e}⟧${r.slice(t)}`;
|
|
277
|
+
return r;
|
|
278
|
+
}, V = (e, t) => {
|
|
279
|
+
if (typeof e == "string") {
|
|
280
|
+
let n = e.split(z);
|
|
281
|
+
if (n.length === 1) return e;
|
|
282
|
+
let r = [];
|
|
283
|
+
return n.forEach((e, n) => {
|
|
284
|
+
n % 2 == 1 ? r.push(t(parseInt(e, 10))) : e && r.push(e);
|
|
285
|
+
}), r;
|
|
286
|
+
}
|
|
287
|
+
return Array.isArray(e) ? e.flatMap((e) => {
|
|
288
|
+
let n = V(e, t);
|
|
289
|
+
return Array.isArray(n) ? n : [n];
|
|
290
|
+
}) : e;
|
|
291
|
+
}, H = (e, t, n, i = !1) => {
|
|
292
|
+
let { onPreview: a, onOpenInBrowser: o, buildLabels: s } = n;
|
|
293
|
+
return {
|
|
294
|
+
processedContent: _(() => t.length > 0 ? B(e, t) : e, [e, t]),
|
|
295
|
+
markdownComponents: _(() => {
|
|
296
|
+
if (t.length === 0) return {};
|
|
297
|
+
let e = (e) => {
|
|
298
|
+
let n = t[e];
|
|
299
|
+
if (!n) return null;
|
|
300
|
+
let { cardLabels: r, markerLabels: i } = s(n);
|
|
301
|
+
return /* @__PURE__ */ y(O, {
|
|
302
|
+
group: n,
|
|
303
|
+
onPreview: (e) => a(e, n),
|
|
304
|
+
onOpenInBrowser: o,
|
|
305
|
+
cardLabels: r,
|
|
306
|
+
markerLabels: i
|
|
307
|
+
}, `citation-${n.sourceUrl}`);
|
|
308
|
+
};
|
|
309
|
+
return {
|
|
310
|
+
p: ({ children: t, ...n }) => /* @__PURE__ */ y("p", {
|
|
311
|
+
...n,
|
|
312
|
+
className: r(i ? "dial-small-paragraph-text" : "dial-body-paragraph-text", "mb-3 [overflow-wrap:anywhere] [text-wrap:pretty] last:mb-0"),
|
|
313
|
+
children: V(t, e)
|
|
314
|
+
}),
|
|
315
|
+
li: ({ children: t, ...n }) => /* @__PURE__ */ y("li", {
|
|
316
|
+
...n,
|
|
317
|
+
className: "mb-1.5 last:mb-0",
|
|
318
|
+
children: V(t, e)
|
|
319
|
+
})
|
|
320
|
+
};
|
|
321
|
+
}, [
|
|
322
|
+
t,
|
|
323
|
+
a,
|
|
324
|
+
o,
|
|
325
|
+
s,
|
|
326
|
+
i
|
|
327
|
+
])
|
|
328
|
+
};
|
|
329
|
+
}, U = (e) => {
|
|
262
330
|
try {
|
|
263
331
|
return decodeURIComponent(e);
|
|
264
332
|
} catch {
|
|
265
333
|
return e;
|
|
266
334
|
}
|
|
267
|
-
},
|
|
335
|
+
}, W = (e) => {
|
|
268
336
|
try {
|
|
269
337
|
let t = new URL(e);
|
|
270
|
-
return t.pathname.split("/").map((e) =>
|
|
338
|
+
return t.pathname.split("/").map((e) => U(e)).filter(Boolean).at(-1) ?? t.hostname;
|
|
271
339
|
} catch {
|
|
272
|
-
return e.split("/").map((e) =>
|
|
340
|
+
return e.split("/").map((e) => U(e)).filter(Boolean).at(-1) ?? e;
|
|
273
341
|
}
|
|
274
|
-
},
|
|
342
|
+
}, G = (e) => {
|
|
275
343
|
let t = /* @__PURE__ */ new Map();
|
|
276
344
|
for (let n of e) {
|
|
277
345
|
let e = n.body?.source?.attachment?.url;
|
|
@@ -279,43 +347,20 @@ var D = {
|
|
|
279
347
|
let r = t.get(e);
|
|
280
348
|
r ? r.annotations.push(n) : t.set(e, {
|
|
281
349
|
sourceUrl: e,
|
|
282
|
-
sourceName: n.body?.source?.attachment?.title ??
|
|
350
|
+
sourceName: n.body?.source?.attachment?.title ?? W(e),
|
|
283
351
|
annotations: [n],
|
|
284
352
|
primaryAnnotation: n
|
|
285
353
|
});
|
|
286
354
|
}
|
|
287
355
|
return Array.from(t.values());
|
|
288
|
-
},
|
|
289
|
-
let
|
|
290
|
-
let r = t.primaryAnnotation.target?.selector, i = typeof r == "object" && r && "type" in r && r.type === "text_character_range" ? r.end : e.length;
|
|
291
|
-
return {
|
|
292
|
-
idx: n,
|
|
293
|
-
pos: Math.min(i, e.length)
|
|
294
|
-
};
|
|
295
|
-
}).sort((e, t) => t.pos - e.pos), r = e;
|
|
296
|
-
for (let { idx: e, pos: t } of n) r = `${r.slice(0, t)}⟦C${e}⟧${r.slice(t)}`;
|
|
297
|
-
return r;
|
|
298
|
-
}, H = (e, t) => {
|
|
299
|
-
if (typeof e == "string") {
|
|
300
|
-
let n = e.split(B);
|
|
301
|
-
if (n.length === 1) return e;
|
|
302
|
-
let r = [];
|
|
303
|
-
return n.forEach((e, n) => {
|
|
304
|
-
n % 2 == 1 ? r.push(t(parseInt(e, 10))) : e && r.push(e);
|
|
305
|
-
}), r;
|
|
306
|
-
}
|
|
307
|
-
return Array.isArray(e) ? e.flatMap((e) => {
|
|
308
|
-
let n = H(e, t);
|
|
309
|
-
return Array.isArray(n) ? n : [n];
|
|
310
|
-
}) : e;
|
|
311
|
-
}, U = (e) => e.url == null && e.reference_url != null, W = /^(.*\.pdf)(?:#page=(\d+))?$/i, G = (e) => {
|
|
312
|
-
let t = W.exec(e);
|
|
356
|
+
}, K = (e) => e.url == null && e.reference_url != null, q = /^(.*\.pdf)(?:#page=(\d+))?$/i, J = (e) => {
|
|
357
|
+
let t = q.exec(e);
|
|
313
358
|
return t ? {
|
|
314
359
|
baseUrl: t[1],
|
|
315
360
|
page: t[2] == null ? null : Number(t[2])
|
|
316
361
|
} : null;
|
|
317
|
-
},
|
|
318
|
-
let n = t.reference_url, r =
|
|
362
|
+
}, Y = (t) => G((t ?? []).filter(K).map((t) => {
|
|
363
|
+
let n = t.reference_url, r = J(n) != null;
|
|
319
364
|
return { body: {
|
|
320
365
|
quote: t.data,
|
|
321
366
|
source: {
|
|
@@ -329,4 +374,4 @@ var D = {
|
|
|
329
374
|
} };
|
|
330
375
|
}));
|
|
331
376
|
//#endregion
|
|
332
|
-
export {
|
|
377
|
+
export { S as CitationCard, T as CitationCardProvider, O as CitationDropdown, C as CitationMarker, j as annotationHighlightId, A as annotationsToPdfHighlights, Y as getReferenceAttachmentGroups, G as groupAnnotationsBySource, B as injectCitationSentinels, K as isReferenceOnlyAttachment, P as normalizeRawAnnotations, J as parsePdfPageReference, V as replaceSentinelsInChildren, F as resolveMessageAnnotations, I as useAnnotations, R as useCitationCard, E as useCitationCardContext, H as useCitationMarkdownComponents };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-quotations",
|
|
3
3
|
"description": "Citation and annotation components, hooks, and utilities for AI DIAL conversations",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^19.0.0",
|
|
20
|
+
"react-markdown": "^10.1.0",
|
|
20
21
|
"@tabler/icons-react": "^3.0.0",
|
|
21
|
-
"@epam/ai-dial-chat-shared": "1.0.
|
|
22
|
+
"@epam/ai-dial-chat-shared": "1.0.1",
|
|
22
23
|
"@epam/ai-dial-ui-kit": "*",
|
|
23
24
|
"@epam/pdf-highlighter-kit": ">=0.0.14"
|
|
24
25
|
},
|
package/utils/annotation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Annotation,
|
|
1
|
+
import { Annotation, Message, MessageAttachment } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { InputHighlightData } from '@epam/pdf-highlighter-kit';
|
|
3
3
|
/**
|
|
4
4
|
* Maps a list of annotations to `InputHighlightData` entries for the PDF viewer.
|
|
@@ -30,5 +30,4 @@ export declare const normalizeRawAnnotations: (rawAnnotations: unknown[], attach
|
|
|
30
30
|
* normalises those entries using the message's `custom_content.attachments`.
|
|
31
31
|
*/
|
|
32
32
|
export declare const resolveMessageAnnotations: (message: Message) => Annotation[];
|
|
33
|
-
export type { AttachmentResource };
|
|
34
33
|
//# sourceMappingURL=annotation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/utils/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/utils/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAUnC;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,aAAa,UAAU,EAAE,KACxB,kBAAkB,EAoBjB,CAAC;AAEL,oHAAoH;AACpH,eAAO,MAAM,qBAAqB,GAChC,YAAY,UAAU,EACtB,eAAe,MAAM,KACpB,MAAmD,CAAC;AA+BvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,GAClC,gBAAgB,OAAO,EAAE,EACzB,aAAa,iBAAiB,EAAE,KAC/B,UAAU,EAmDT,CAAC;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,OAAO,KAAG,UAAU,EAkBtE,CAAC"}
|