@epam/ai-dial-quotations 1.1.0-dev.255 → 1.1.0-dev.256
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.
|
@@ -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;AAE5D,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;AAE1C,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,
|
|
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;AAE5D,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;AAE1C,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,CAyEtD,CAAC;;AAEF,wBAAsC"}
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MIMEType as e, MarkdownRenderer as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import {
|
|
2
|
+
import { ElementSize as i, EllipsisTooltip as a, GhostIconButton as o, NeutralButton as s, PrimaryButton as c, Tooltip as l } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { IconChevronLeft as u, IconChevronRight as d } from "@tabler/icons-react";
|
|
4
4
|
import { createContext as f, memo as p, useCallback as m, useContext as h, useMemo as g, useState as _ } from "react";
|
|
5
5
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
@@ -9,8 +9,8 @@ var b = {
|
|
|
9
9
|
title: "_title_1kph1_9",
|
|
10
10
|
switcher: "_switcher_1kph1_13",
|
|
11
11
|
sourceName: "_sourceName_1kph1_17"
|
|
12
|
-
}, x = ({ group:
|
|
13
|
-
let S =
|
|
12
|
+
}, x = ({ group: s, activeIndex: l, onIndexChange: f, onPreview: p, onOpenInBrowser: m, headerIcon: h, labels: g, typography: _, colors: x }) => {
|
|
13
|
+
let S = s.annotations.length, C = s.annotations[l] ?? s.primaryAnnotation, w = S > 1, T = s.annotations.some((e) => e.body?.title), E = s.primaryAnnotation.body?.source?.attachment?.type, D = p == null || E === e.HTML || E === e.XHTML, O = _?.sourceNameClassName ?? "dial-tiny-text", k = _?.titleClassName ?? "dial-body-semi-text", A = _?.quoteClassName ?? "dial-small-text", j = _?.switcherClassName ?? "dial-tiny-text", M = n({
|
|
14
14
|
"--cc-card-bg": x?.cardBackground,
|
|
15
15
|
"--cc-quote-text": x?.quoteText,
|
|
16
16
|
"--cc-title-text": x?.titleText,
|
|
@@ -28,34 +28,34 @@ var b = {
|
|
|
28
28
|
className: "flex items-center justify-between gap-2",
|
|
29
29
|
children: [/* @__PURE__ */ y("div", {
|
|
30
30
|
className: "flex min-w-0 items-center gap-1",
|
|
31
|
-
children: [h, /* @__PURE__ */ v(
|
|
32
|
-
text:
|
|
31
|
+
children: [h, /* @__PURE__ */ v(a, {
|
|
32
|
+
text: s.sourceName,
|
|
33
33
|
className: r(O, "min-w-0", b.sourceName)
|
|
34
34
|
})]
|
|
35
35
|
}), w && /* @__PURE__ */ y("div", {
|
|
36
36
|
className: "flex shrink-0 items-center gap-1",
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */ v(
|
|
38
|
+
/* @__PURE__ */ v(o, {
|
|
39
39
|
icon: /* @__PURE__ */ v(u, {
|
|
40
40
|
size: 14,
|
|
41
41
|
className: "rtl:scale-x-[-1]"
|
|
42
42
|
}),
|
|
43
|
-
size:
|
|
43
|
+
size: i.Small,
|
|
44
44
|
"aria-label": g.previousCitation,
|
|
45
|
-
onClick: () => f((
|
|
45
|
+
onClick: () => f((l - 1 + S) % S)
|
|
46
46
|
}),
|
|
47
47
|
/* @__PURE__ */ v("span", {
|
|
48
48
|
className: r(j, b.switcher),
|
|
49
|
-
children: g.formatSwitcherText(
|
|
49
|
+
children: g.formatSwitcherText(l + 1, S)
|
|
50
50
|
}),
|
|
51
|
-
/* @__PURE__ */ v(
|
|
51
|
+
/* @__PURE__ */ v(o, {
|
|
52
52
|
icon: /* @__PURE__ */ v(d, {
|
|
53
53
|
size: 14,
|
|
54
54
|
className: "rtl:scale-x-[-1]"
|
|
55
55
|
}),
|
|
56
|
-
size:
|
|
56
|
+
size: i.Small,
|
|
57
57
|
"aria-label": g.nextCitation,
|
|
58
|
-
onClick: () => f((
|
|
58
|
+
onClick: () => f((l + 1) % S)
|
|
59
59
|
})
|
|
60
60
|
]
|
|
61
61
|
})]
|
|
@@ -75,13 +75,13 @@ var b = {
|
|
|
75
75
|
}),
|
|
76
76
|
/* @__PURE__ */ y("div", {
|
|
77
77
|
className: "flex justify-start gap-2",
|
|
78
|
-
children: [p && /* @__PURE__ */ v(
|
|
78
|
+
children: [p && /* @__PURE__ */ v(c, {
|
|
79
79
|
label: g.preview,
|
|
80
|
-
size:
|
|
80
|
+
size: i.Small,
|
|
81
81
|
onClick: () => p(C)
|
|
82
|
-
}), /* @__PURE__ */ v(
|
|
82
|
+
}), /* @__PURE__ */ v(c, {
|
|
83
83
|
label: D ? g.openInBrowser : g.download,
|
|
84
|
-
size:
|
|
84
|
+
size: i.Small,
|
|
85
85
|
onClick: () => m(C)
|
|
86
86
|
})]
|
|
87
87
|
})
|
|
@@ -91,16 +91,16 @@ var b = {
|
|
|
91
91
|
p(x);
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/components/CitationMarker/CitationMarker.tsx
|
|
94
|
-
var S = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName:
|
|
94
|
+
var S = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: a = "dial-caption-text" }) => {
|
|
95
95
|
let o = /* @__PURE__ */ y("span", {
|
|
96
96
|
className: "flex items-center gap-1",
|
|
97
97
|
children: [n, /* @__PURE__ */ v("span", {
|
|
98
|
-
className:
|
|
98
|
+
className: a,
|
|
99
99
|
children: e > 1 ? r.labelWithOverflow : r.label
|
|
100
100
|
})]
|
|
101
101
|
});
|
|
102
|
-
return /* @__PURE__ */ v(
|
|
103
|
-
size:
|
|
102
|
+
return /* @__PURE__ */ v(s, {
|
|
103
|
+
size: i.Small,
|
|
104
104
|
label: o,
|
|
105
105
|
"aria-label": r.ariaLabel,
|
|
106
106
|
onClick: t
|
|
@@ -113,14 +113,13 @@ var C = f(null), w = C.Provider, T = () => {
|
|
|
113
113
|
let e = h(C);
|
|
114
114
|
if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
|
|
115
115
|
return e;
|
|
116
|
-
}, E = ({ group: e, onPreview: t, onOpenInBrowser: n, icon: r, headerIcon:
|
|
116
|
+
}, E = ({ group: e, onPreview: t, onOpenInBrowser: n, icon: r, headerIcon: i, cardLabels: a, markerLabels: o, cardTypography: s, markerLabelClassName: c }) => {
|
|
117
117
|
let u = T(), d = u.isOpen(e.sourceUrl), f = u.getActiveIndex(e.sourceUrl);
|
|
118
|
-
return /* @__PURE__ */ v(
|
|
118
|
+
return /* @__PURE__ */ v(l, {
|
|
119
119
|
open: d,
|
|
120
120
|
onOpenChange: m((e) => {
|
|
121
121
|
e || u.closePopup();
|
|
122
122
|
}, [u]),
|
|
123
|
-
placement: "bottom-end",
|
|
124
123
|
triggerClassName: "ms-1 inline-flex align-middle",
|
|
125
124
|
contentClassName: "!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none [&>svg]:stroke-transparent",
|
|
126
125
|
tooltip: /* @__PURE__ */ v(x, {
|
|
@@ -131,17 +130,17 @@ var C = f(null), w = C.Provider, T = () => {
|
|
|
131
130
|
t(e), u.closePopup();
|
|
132
131
|
} : void 0, [t, u]),
|
|
133
132
|
onOpenInBrowser: n,
|
|
134
|
-
headerIcon:
|
|
135
|
-
labels:
|
|
136
|
-
typography:
|
|
133
|
+
headerIcon: i,
|
|
134
|
+
labels: a,
|
|
135
|
+
typography: s
|
|
137
136
|
}),
|
|
138
137
|
children: /* @__PURE__ */ v(S, {
|
|
139
138
|
sourceName: e.sourceName,
|
|
140
139
|
annotationCount: e.annotations.length,
|
|
141
140
|
onOpen: () => u.openPopup(e.sourceUrl),
|
|
142
141
|
icon: r,
|
|
143
|
-
labels:
|
|
144
|
-
labelClassName:
|
|
142
|
+
labels: o,
|
|
143
|
+
labelClassName: c
|
|
145
144
|
})
|
|
146
145
|
});
|
|
147
146
|
};
|
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.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.256",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^19.0.0",
|
|
20
20
|
"@tabler/icons-react": "^3.0.0",
|
|
21
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
21
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.256",
|
|
22
22
|
"@epam/ai-dial-ui-kit": "*",
|
|
23
23
|
"@epam/pdf-highlighter-kit": ">=0.0.14"
|
|
24
24
|
},
|