@epam/ai-dial-quotations 1.2.0-dev.3 → 1.2.0-dev.38
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/CitationDropdown/CitationDropdown.d.ts.map +1 -1
- package/context/CitationCardContext.d.ts +3 -3
- package/index.css +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +112 -80
- package/models/office-highlight.d.ts +21 -1
- package/models/office-highlight.d.ts.map +1 -1
- package/package.json +2 -2
- package/utils/annotation.d.ts +1 -1
- package/utils/annotation.d.ts.map +1 -1
- package/utils/office-table-anchor.d.ts +5 -0
- package/utils/office-table-anchor.d.ts.map +1 -0
- package/utils/useCitationCard.d.ts +14 -7
- package/utils/useCitationCard.d.ts.map +1 -1
|
@@ -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;AAG5D,OAAO,EAAE,EAAE,EAAE,SAAS,
|
|
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,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAEnE,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,CAyEtD,CAAC"}
|
|
@@ -3,10 +3,10 @@ import { useCitationCard } from '../utils/useCitationCard';
|
|
|
3
3
|
export type CitationCardHook = ReturnType<typeof useCitationCard>;
|
|
4
4
|
/** Provider that supplies `CitationCardHook` state to a citation subtree. */
|
|
5
5
|
export declare const CitationCardProvider: import('react').Provider<{
|
|
6
|
-
openPopup: (
|
|
7
|
-
closePopup: () => void;
|
|
6
|
+
openPopup: (ownerKey: string) => void;
|
|
7
|
+
closePopup: (ownerKey: string) => void;
|
|
8
8
|
setActiveIndex: (groupKey: string, index: number) => void;
|
|
9
|
-
isOpen: (
|
|
9
|
+
isOpen: (ownerKey: string) => boolean;
|
|
10
10
|
getActiveIndex: (groupKey: string) => number;
|
|
11
11
|
} | null>;
|
|
12
12
|
/** Returns the nearest `CitationCardHook` from context. Throws when used outside a `CitationCardProvider`. */
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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
|
-
/*$vite$:1
|
|
2
|
+
/*$vite$:1*/.visible{visibility:visible}.collapse{visibility:collapse}.absolute{position:absolute}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-3{margin-bottom:.75rem}.ms-1{margin-inline-start:.25rem}.line-clamp-6{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:6}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table-cell{display:table-cell}.table-row{display:table-row}.hidden{display:none}.min-h-\[3lh\]{min-height:3lh}.w-\[400px\]{width:400px}.min-w-0{min-width:0}.\!max-w-none{max-width:none!important}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.break-words{overflow-wrap:break-word}.\!rounded-none{border-radius:0!important}.rounded-lg{border-radius:.5rem}.\!border-0{border-width:0!important}.\!bg-transparent{background-color:transparent!important}.\!p-0{padding:0!important}.p-4{padding:1rem}.ps-3{padding-inline-start:.75rem}.align-middle{vertical-align:middle}.\!shadow-none{--tw-shadow:0 0 #0000!important;--tw-shadow-colored:0 0 #0000!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}.shadow-lg{--tw-shadow:0 8px 44px 0 var(--shadow-lg,#2764d914);--tw-shadow-colored:0 8px 44px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.\[text-wrap\:pretty\]{text-wrap:pretty}.last\:mb-0:last-child{margin-bottom:0}.rtl\:scale-x-\[-1\]:where([dir=rtl],[dir=rtl] *){--tw-scale-x:-1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
|
package/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { UseCitationMarkdownComponentsCallbacks } from './hooks/useCitation
|
|
|
13
13
|
export { gatherSameSourceAnnotations, groupAnnotations, groupAnnotationsByCitId, groupAnnotationsBySource, } from './utils/group-annotations-by-source';
|
|
14
14
|
export type { AnnotationGroup } from './utils/group-annotations-by-source';
|
|
15
15
|
export { annotationHighlightId, annotationsToPdfHighlights, annotationToOfficeHighlightLocations, getAnnotationPdfPage, isDocxRangeSelector, isExcelRcRangeSelector, isPptxRangeSelector, resolveMessageAnnotations, } from './utils/annotation';
|
|
16
|
-
export type { DocxOfficeHighlightLocation, ExcelOfficeHighlightLocation, OfficeHighlightLocation, PptxOfficeHighlightLocation, } from './models/office-highlight';
|
|
16
|
+
export type { DocxOfficeHighlightLocation, DocxTableRowOfficeHighlightLocation, ExcelOfficeHighlightLocation, OfficeHighlightLocation, PptxOfficeHighlightLocation, PptxTableRowOfficeHighlightLocation, } from './models/office-highlight';
|
|
17
17
|
export { injectCitationSentinels, replaceSentinelsInChildren, stripCitTagsWhileStreaming, } from './utils/citation-injection';
|
|
18
18
|
export { isReferenceOnlyAttachment, parsePdfPageReference, getReferenceAttachmentGroups, } from './utils/reference-attachment';
|
|
19
19
|
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,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,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,EACpC,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,
|
|
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,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,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,EACpC,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,2BAA2B,EAC3B,mCAAmC,EACnC,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,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
|
@@ -2,15 +2,15 @@ import { MIMEType as e, MarkdownRenderer as t, buildCssVars as n, isAnnotationSe
|
|
|
2
2
|
import { DIAL_KIT_ICON_STROKE as s, ElementSize as c, EllipsisTooltip as l, GhostIconButton as u, NeutralButton as d, PrimaryButton as f, Tooltip as p } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { IconChevronLeft as m, IconChevronRight as h } from "@tabler/icons-react";
|
|
4
4
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
5
|
-
import { createContext as y, useCallback as b, useContext as x,
|
|
6
|
-
var
|
|
5
|
+
import { createContext as y, useCallback as b, useContext as x, useId as S, useMemo as C, useState as w } from "react";
|
|
6
|
+
var T = {
|
|
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 S = r.annotations.length, C = r.annotations[a] ?? r.primaryAnnotation,
|
|
12
|
+
}, E = ({ group: r, activeIndex: a, onIndexChange: o, onPreview: d, onOpenInBrowser: p, headerIcon: g, labels: y, typography: b, colors: x }) => {
|
|
13
|
+
let S = r.annotations.length, C = r.annotations[a] ?? r.primaryAnnotation, w = S > 1, E = r.primaryAnnotation.body?.source?.attachment?.type, D = d == null || E === e.HTML || E === e.XHTML, O = b?.sourceNameClassName ?? "dial-tiny-text", k = b?.titleClassName ?? "dial-body-semi-text", A = b?.quoteClassName ?? "dial-small-text", j = b?.quoteStrongClassName ?? "dial-small-semi-text", M = b?.switcherClassName ?? "dial-tiny-text", N = n({
|
|
14
14
|
"--cc-card-bg": x?.cardBackground,
|
|
15
15
|
"--cc-quote-text": x?.quoteText,
|
|
16
16
|
"--cc-title-text": x?.titleText,
|
|
@@ -22,7 +22,7 @@ var w = {
|
|
|
22
22
|
"aria-modal": "true",
|
|
23
23
|
"aria-label": y.ariaLabel,
|
|
24
24
|
style: N,
|
|
25
|
-
className: i("flex w-[400px] flex-col gap-3 rounded-lg p-4 shadow-lg",
|
|
25
|
+
className: i("flex w-[400px] flex-col gap-3 rounded-lg p-4 shadow-lg", T.card),
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ v("div", {
|
|
28
28
|
className: "flex items-center justify-between gap-2",
|
|
@@ -30,9 +30,9 @@ var w = {
|
|
|
30
30
|
className: "flex min-w-0 items-center gap-1",
|
|
31
31
|
children: [g, /* @__PURE__ */ _(l, {
|
|
32
32
|
text: r.sourceName,
|
|
33
|
-
className: i(O, "min-w-0",
|
|
33
|
+
className: i(O, "min-w-0", T.sourceName)
|
|
34
34
|
})]
|
|
35
|
-
}),
|
|
35
|
+
}), w && /* @__PURE__ */ v("div", {
|
|
36
36
|
className: "flex shrink-0 items-center gap-1",
|
|
37
37
|
children: [
|
|
38
38
|
/* @__PURE__ */ _(u, {
|
|
@@ -46,7 +46,7 @@ var w = {
|
|
|
46
46
|
onClick: () => o((a - 1 + S) % S)
|
|
47
47
|
}),
|
|
48
48
|
/* @__PURE__ */ _("span", {
|
|
49
|
-
className: i(M,
|
|
49
|
+
className: i(M, T.switcher),
|
|
50
50
|
children: y.formatSwitcherText(a + 1, S)
|
|
51
51
|
}),
|
|
52
52
|
/* @__PURE__ */ _(u, {
|
|
@@ -62,17 +62,17 @@ var w = {
|
|
|
62
62
|
]
|
|
63
63
|
})]
|
|
64
64
|
}),
|
|
65
|
-
(C.body?.title || C.body?.quote ||
|
|
65
|
+
(C.body?.title || C.body?.quote || w) && /* @__PURE__ */ v("div", {
|
|
66
66
|
className: "flex flex-col gap-3",
|
|
67
67
|
children: [C.body?.title && /* @__PURE__ */ _("p", {
|
|
68
|
-
className: i(k,
|
|
68
|
+
className: i(k, T.title, "break-words"),
|
|
69
69
|
children: C.body.title
|
|
70
|
-
}), (C.body?.quote ||
|
|
71
|
-
className: i(A,
|
|
70
|
+
}), (C.body?.quote || w) && /* @__PURE__ */ _("div", {
|
|
71
|
+
className: i(A, T.quote, "line-clamp-6 break-words", w && "min-h-[3lh]"),
|
|
72
72
|
children: C.body?.quote && /* @__PURE__ */ _(t, {
|
|
73
73
|
content: C.body.quote,
|
|
74
74
|
classNames: {
|
|
75
|
-
p: i(A,
|
|
75
|
+
p: i(A, T.quote),
|
|
76
76
|
ul: i(A, "ps-3"),
|
|
77
77
|
ol: i(A, "ps-3"),
|
|
78
78
|
strong: j
|
|
@@ -94,7 +94,7 @@ var w = {
|
|
|
94
94
|
})
|
|
95
95
|
]
|
|
96
96
|
});
|
|
97
|
-
},
|
|
97
|
+
}, D = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: i = "dial-caption-text" }) => {
|
|
98
98
|
let a = /* @__PURE__ */ v("span", {
|
|
99
99
|
className: "flex items-center gap-1",
|
|
100
100
|
children: [n, /* @__PURE__ */ _("span", {
|
|
@@ -108,47 +108,78 @@ var w = {
|
|
|
108
108
|
"aria-label": r.ariaLabel,
|
|
109
109
|
onClick: t
|
|
110
110
|
});
|
|
111
|
-
},
|
|
112
|
-
let e = x(
|
|
111
|
+
}, O = y(null), k = O.Provider, A = () => {
|
|
112
|
+
let e = x(O);
|
|
113
113
|
if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
|
|
114
114
|
return e;
|
|
115
|
-
},
|
|
116
|
-
let u =
|
|
117
|
-
e || u.closePopup();
|
|
118
|
-
}, [u]),
|
|
119
|
-
t(e), u.closePopup();
|
|
120
|
-
} : void 0, [
|
|
115
|
+
}, j = { content: "_content_xzs0h_1" }, M = ({ group: e, onPreview: t, onOpenInBrowser: n, icon: r, headerIcon: a, cardLabels: o, markerLabels: s, cardTypography: c, markerLabelClassName: l }) => {
|
|
116
|
+
let u = A(), d = S(), f = u.isOpen(d), m = u.getActiveIndex(e.groupKey), h = b((e) => {
|
|
117
|
+
e || u.closePopup(d);
|
|
118
|
+
}, [u, d]), g = C(() => t ? (e) => {
|
|
119
|
+
t(e), u.closePopup(d);
|
|
120
|
+
} : void 0, [
|
|
121
|
+
t,
|
|
122
|
+
u,
|
|
123
|
+
d
|
|
124
|
+
]);
|
|
121
125
|
return /* @__PURE__ */ _(p, {
|
|
122
|
-
open:
|
|
123
|
-
onOpenChange:
|
|
126
|
+
open: f,
|
|
127
|
+
onOpenChange: h,
|
|
124
128
|
triggerClassName: "ms-1 inline-flex align-middle",
|
|
125
|
-
contentClassName: i("!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none",
|
|
126
|
-
tooltip: /* @__PURE__ */ _(
|
|
129
|
+
contentClassName: i("!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none", j.content),
|
|
130
|
+
tooltip: /* @__PURE__ */ _(E, {
|
|
127
131
|
group: e,
|
|
128
|
-
activeIndex:
|
|
132
|
+
activeIndex: m,
|
|
129
133
|
onIndexChange: (t) => u.setActiveIndex(e.groupKey, t),
|
|
130
|
-
onPreview:
|
|
134
|
+
onPreview: g,
|
|
131
135
|
onOpenInBrowser: n,
|
|
132
136
|
headerIcon: a,
|
|
133
137
|
labels: o,
|
|
134
138
|
typography: c
|
|
135
139
|
}),
|
|
136
|
-
children: /* @__PURE__ */ _(
|
|
140
|
+
children: /* @__PURE__ */ _(D, {
|
|
137
141
|
sourceName: e.sourceName,
|
|
138
142
|
annotationCount: e.annotations.length,
|
|
139
|
-
onOpen: () => u.openPopup(
|
|
143
|
+
onOpen: () => u.openPopup(d),
|
|
140
144
|
icon: r,
|
|
141
145
|
labels: s,
|
|
142
146
|
labelClassName: l
|
|
143
147
|
})
|
|
144
148
|
});
|
|
145
|
-
},
|
|
149
|
+
}, N = (e) => {
|
|
150
|
+
let t = e.trim();
|
|
151
|
+
if (!t.startsWith("|") || !t.endsWith("|") || /[\r\n]/.test(t)) return;
|
|
152
|
+
let n = [], r = "";
|
|
153
|
+
for (let e = 1; e < t.length; e += 1) {
|
|
154
|
+
let i = t[e], a = t[e + 1];
|
|
155
|
+
i === "\\" && a != null && /[!-/:-@[-`{-~]/.test(a) ? (r += a, e += 1) : i === "|" ? (n.push(r.trim()), r = "") : r += i;
|
|
156
|
+
}
|
|
157
|
+
if (!(r !== "" || n.length < 2 || n.every((e) => e === "" || /^:?-{3,}:?$/.test(e)))) return n;
|
|
158
|
+
}, ee = (e) => {
|
|
159
|
+
if (e.type !== "docx_text_anchor" && e.type !== "pptx_text_anchor") return;
|
|
160
|
+
let { text: t, occurrence: n, slide: r } = e;
|
|
161
|
+
if (typeof t != "string" || typeof n != "number" || !Number.isSafeInteger(n) || n < 1) return;
|
|
162
|
+
let i = N(t);
|
|
163
|
+
if (i != null) {
|
|
164
|
+
if (e.type === "docx_text_anchor") return {
|
|
165
|
+
type: "docx_text_anchor",
|
|
166
|
+
cells: i,
|
|
167
|
+
occurrence: n
|
|
168
|
+
};
|
|
169
|
+
if (!(typeof r != "number" || !Number.isSafeInteger(r) || r < 1)) return {
|
|
170
|
+
type: "pptx_text_anchor",
|
|
171
|
+
cells: i,
|
|
172
|
+
occurrence: n,
|
|
173
|
+
slide: r
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}, te = {
|
|
146
177
|
backgroundColor: "transparent",
|
|
147
178
|
borderColor: "var(--stroke-accent, #1D4ED8)",
|
|
148
179
|
borderWidth: "2px",
|
|
149
180
|
opacity: .5,
|
|
150
181
|
hoverOpacity: .5
|
|
151
|
-
},
|
|
182
|
+
}, ne = (e) => {
|
|
152
183
|
if (typeof e != "object" || !e) return;
|
|
153
184
|
let t = e, { lt: n, wh: r } = t;
|
|
154
185
|
if (Array.isArray(n) && Array.isArray(r) && n.length >= 2 && r.length >= 2) {
|
|
@@ -178,7 +209,7 @@ var w = {
|
|
|
178
209
|
x2: i,
|
|
179
210
|
y2: a
|
|
180
211
|
});
|
|
181
|
-
} else t.type === "pdf_region" && (n =
|
|
212
|
+
} else t.type === "pdf_region" && (n = ne(t.bbox));
|
|
182
213
|
if (n == null) return;
|
|
183
214
|
let i = t.page;
|
|
184
215
|
if (!(typeof i != "number" || !Number.isInteger(i) || i < 1) && [
|
|
@@ -193,7 +224,7 @@ var w = {
|
|
|
193
224
|
x2: n.x2,
|
|
194
225
|
y2: n.y2
|
|
195
226
|
};
|
|
196
|
-
},
|
|
227
|
+
}, re = (e) => e.flatMap((e, t) => {
|
|
197
228
|
let n = e.body?.selector;
|
|
198
229
|
if (n == null) return [];
|
|
199
230
|
let i = (Array.isArray(n) ? n : [n]).flatMap((e) => {
|
|
@@ -204,9 +235,9 @@ var w = {
|
|
|
204
235
|
return i.length === 0 ? [] : [{
|
|
205
236
|
id: String(e.index ?? t),
|
|
206
237
|
bboxes: i,
|
|
207
|
-
style:
|
|
238
|
+
style: te
|
|
208
239
|
}];
|
|
209
|
-
}),
|
|
240
|
+
}), ie = (e, t) => String(e.index ?? t), ae = (e) => {
|
|
210
241
|
let t = e.body?.selector;
|
|
211
242
|
if (t == null) return;
|
|
212
243
|
let n = Array.isArray(t) ? t : [t];
|
|
@@ -234,7 +265,7 @@ var w = {
|
|
|
234
265
|
if (e.type !== "excel_rc_range") return !1;
|
|
235
266
|
let t = e;
|
|
236
267
|
return typeof t.sheet == "string" && R(t.start) && (t.end === void 0 || t.end === null || R(t.end));
|
|
237
|
-
},
|
|
268
|
+
}, oe = (e) => {
|
|
238
269
|
let { story: t, path: n, start: r, end: i, text: a } = e;
|
|
239
270
|
if (!(!n.every((e) => Number.isInteger(e)) || !Number.isInteger(r) || !Number.isInteger(i) || r < 0 || i < r)) return {
|
|
240
271
|
type: "docx_text_range",
|
|
@@ -244,7 +275,7 @@ var w = {
|
|
|
244
275
|
endExclusive: i,
|
|
245
276
|
text: a
|
|
246
277
|
};
|
|
247
|
-
},
|
|
278
|
+
}, se = (e) => {
|
|
248
279
|
let { slide: t, shape_id: n, start: r, end: i, text: a } = e;
|
|
249
280
|
if (!(!Number.isInteger(t) || t < 1 || !Number.isInteger(r) || !Number.isInteger(i) || r < 0 || i < r)) return {
|
|
250
281
|
type: "pptx_text_range",
|
|
@@ -254,7 +285,7 @@ var w = {
|
|
|
254
285
|
endExclusive: i,
|
|
255
286
|
text: a
|
|
256
287
|
};
|
|
257
|
-
},
|
|
288
|
+
}, ce = (e) => {
|
|
258
289
|
let { sheet: t, start: n, end: r } = e;
|
|
259
290
|
if (!(t.length === 0 || !Number.isInteger(n.row) || !Number.isInteger(n.col) || n.row < 1 || n.col < 1)) {
|
|
260
291
|
if (r == null) return {
|
|
@@ -269,38 +300,39 @@ var w = {
|
|
|
269
300
|
end: r
|
|
270
301
|
};
|
|
271
302
|
}
|
|
272
|
-
},
|
|
303
|
+
}, le = (e) => {
|
|
273
304
|
let t = e.body?.selector;
|
|
274
305
|
return t == null ? [] : (Array.isArray(t) ? t : [t]).flatMap((e) => {
|
|
275
306
|
if (!r(e)) return [];
|
|
276
307
|
if (I(e)) {
|
|
277
|
-
let t =
|
|
308
|
+
let t = oe(e);
|
|
278
309
|
return t ? [t] : [];
|
|
279
310
|
}
|
|
280
311
|
if (L(e)) {
|
|
281
|
-
let t =
|
|
312
|
+
let t = se(e);
|
|
282
313
|
return t ? [t] : [];
|
|
283
314
|
}
|
|
284
315
|
if (z(e)) {
|
|
285
|
-
let t =
|
|
316
|
+
let t = ce(e);
|
|
286
317
|
return t ? [t] : [];
|
|
287
318
|
}
|
|
288
|
-
|
|
319
|
+
let t = ee(e);
|
|
320
|
+
return t ? [t] : [];
|
|
289
321
|
});
|
|
290
|
-
},
|
|
291
|
-
|
|
322
|
+
}, ue = (e, t) => C(() => t ? [] : F(e), [t, e]), de = {
|
|
323
|
+
openOwnerKey: null,
|
|
292
324
|
activeIndexByGroup: {}
|
|
293
|
-
},
|
|
294
|
-
let [e, t] =
|
|
325
|
+
}, B = () => {
|
|
326
|
+
let [e, t] = w(de), n = b((e) => {
|
|
295
327
|
t((t) => ({
|
|
296
328
|
...t,
|
|
297
|
-
|
|
298
|
-
}));
|
|
299
|
-
}, []), r = b(() => {
|
|
300
|
-
t((e) => ({
|
|
301
|
-
...e,
|
|
302
|
-
openGroupKey: null
|
|
329
|
+
openOwnerKey: e
|
|
303
330
|
}));
|
|
331
|
+
}, []), r = b((e) => {
|
|
332
|
+
t((t) => t.openOwnerKey === e ? {
|
|
333
|
+
...t,
|
|
334
|
+
openOwnerKey: null
|
|
335
|
+
} : t);
|
|
304
336
|
}, []), i = b((e, n) => {
|
|
305
337
|
t((t) => ({
|
|
306
338
|
...t,
|
|
@@ -310,11 +342,11 @@ var w = {
|
|
|
310
342
|
}
|
|
311
343
|
}));
|
|
312
344
|
}, []);
|
|
313
|
-
return
|
|
345
|
+
return C(() => ({
|
|
314
346
|
openPopup: n,
|
|
315
347
|
closePopup: r,
|
|
316
348
|
setActiveIndex: i,
|
|
317
|
-
isOpen: (t) => e.
|
|
349
|
+
isOpen: (t) => e.openOwnerKey === t,
|
|
318
350
|
getActiveIndex: (t) => e.activeIndexByGroup[t] ?? 0
|
|
319
351
|
}), [
|
|
320
352
|
n,
|
|
@@ -322,7 +354,7 @@ var w = {
|
|
|
322
354
|
i,
|
|
323
355
|
e
|
|
324
356
|
]);
|
|
325
|
-
},
|
|
357
|
+
}, V = /⟦C(\d+)⟧/g, H = (e, t) => {
|
|
326
358
|
let n = t.map((e, t) => ({
|
|
327
359
|
g: e,
|
|
328
360
|
idx: t
|
|
@@ -335,9 +367,9 @@ var w = {
|
|
|
335
367
|
}).sort((e, t) => t.pos - e.pos), r = e;
|
|
336
368
|
for (let { idx: e, pos: t } of n) r = `${r.slice(0, t)}⟦C${e}⟧${r.slice(t)}`;
|
|
337
369
|
return r;
|
|
338
|
-
},
|
|
370
|
+
}, fe = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>/g, pe = /^<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>$/, me = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>|<\/?cit\b[^>]*>|<\/?cit\b[^>]*$/gi, he = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), U = (e) => e.replace(me, (e) => pe.test(e) ? e : he(e)), W = (e) => U(e).replace(fe, ""), G = (e, t) => {
|
|
339
371
|
if (typeof e == "string") {
|
|
340
|
-
let n = e.split(
|
|
372
|
+
let n = e.split(V);
|
|
341
373
|
if (n.length === 1) return e;
|
|
342
374
|
let r = [];
|
|
343
375
|
return n.forEach((e, n) => {
|
|
@@ -348,30 +380,30 @@ var w = {
|
|
|
348
380
|
let n = G(e, t);
|
|
349
381
|
return Array.isArray(n) ? n : [n];
|
|
350
382
|
}) : e;
|
|
351
|
-
},
|
|
383
|
+
}, ge = (e) => {
|
|
352
384
|
let t = e.primaryAnnotation.target?.selector;
|
|
353
385
|
return t?.type === "html_tag" ? t.id : void 0;
|
|
354
|
-
},
|
|
386
|
+
}, _e = (e, t) => /* @__PURE__ */ v(g, { children: [
|
|
355
387
|
e == null ? "<cit>" : `<cit data-id="${e}">`,
|
|
356
388
|
t,
|
|
357
389
|
"</cit>"
|
|
358
|
-
] }),
|
|
359
|
-
let { onPreview: o, onOpenInBrowser: s, buildLabels: c } = n, l =
|
|
390
|
+
] }), ve = (e, t, n, r = !1, a = !1) => {
|
|
391
|
+
let { onPreview: o, onOpenInBrowser: s, buildLabels: c } = n, l = C(() => r ? W(e) : U(t.length > 0 ? H(e, t) : e), [
|
|
360
392
|
e,
|
|
361
393
|
t,
|
|
362
394
|
r
|
|
363
395
|
]), u = l.includes("<cit");
|
|
364
396
|
return {
|
|
365
397
|
processedContent: l,
|
|
366
|
-
markdownComponents:
|
|
398
|
+
markdownComponents: C(() => {
|
|
367
399
|
let e = /* @__PURE__ */ new Map();
|
|
368
400
|
for (let n of t) {
|
|
369
|
-
let t =
|
|
401
|
+
let t = ge(n);
|
|
370
402
|
t != null && e.set(t, n);
|
|
371
403
|
}
|
|
372
404
|
let n = (e) => {
|
|
373
405
|
let { cardLabels: t, markerLabels: n } = c(e);
|
|
374
|
-
return /* @__PURE__ */ _(
|
|
406
|
+
return /* @__PURE__ */ _(M, {
|
|
375
407
|
group: e,
|
|
376
408
|
onPreview: (t) => o(t, e),
|
|
377
409
|
onOpenInBrowser: s,
|
|
@@ -383,7 +415,7 @@ var w = {
|
|
|
383
415
|
return r ? n(r) : null;
|
|
384
416
|
}, l = { cit: (t) => {
|
|
385
417
|
let r = t["data-id"] == null ? void 0 : e.get(t["data-id"]);
|
|
386
|
-
return r ? n(r) :
|
|
418
|
+
return r ? n(r) : _e(t["data-id"], t.children);
|
|
387
419
|
} };
|
|
388
420
|
return t.length === 0 ? u ? l : {} : {
|
|
389
421
|
...l,
|
|
@@ -413,36 +445,36 @@ var w = {
|
|
|
413
445
|
} catch {
|
|
414
446
|
return e;
|
|
415
447
|
}
|
|
416
|
-
},
|
|
448
|
+
}, q = (e) => {
|
|
417
449
|
try {
|
|
418
450
|
let t = new URL(e);
|
|
419
451
|
return t.pathname.split("/").map((e) => K(e)).filter(Boolean).at(-1) ?? t.hostname;
|
|
420
452
|
} catch {
|
|
421
453
|
return e.split("/").map((e) => K(e)).filter(Boolean).at(-1) ?? e;
|
|
422
454
|
}
|
|
423
|
-
},
|
|
455
|
+
}, J = (e, t) => e.body?.source?.attachment?.title ?? q(t), Y = (e) => {
|
|
424
456
|
let t = e.target?.selector;
|
|
425
457
|
return t?.type === "html_tag" ? t : void 0;
|
|
426
|
-
},
|
|
458
|
+
}, ye = (e) => Y(e) != null, X = (e) => {
|
|
427
459
|
let t = /* @__PURE__ */ new Map();
|
|
428
460
|
for (let n of e) {
|
|
429
|
-
if (
|
|
461
|
+
if (ye(n)) continue;
|
|
430
462
|
let e = n.body?.source?.attachment?.url;
|
|
431
463
|
if (e == null) continue;
|
|
432
464
|
let r = t.get(e);
|
|
433
465
|
r ? r.annotations.push(n) : t.set(e, {
|
|
434
466
|
groupKey: e,
|
|
435
467
|
sourceUrl: e,
|
|
436
|
-
sourceName:
|
|
468
|
+
sourceName: J(n, e),
|
|
437
469
|
annotations: [n],
|
|
438
470
|
primaryAnnotation: n
|
|
439
471
|
});
|
|
440
472
|
}
|
|
441
473
|
return Array.from(t.values());
|
|
442
|
-
},
|
|
474
|
+
}, Z = (e) => {
|
|
443
475
|
let t = /* @__PURE__ */ new Map();
|
|
444
476
|
for (let n of e) {
|
|
445
|
-
let e =
|
|
477
|
+
let e = Y(n)?.id;
|
|
446
478
|
if (e == null) continue;
|
|
447
479
|
let r = n.body?.source?.attachment?.url;
|
|
448
480
|
if (r == null) continue;
|
|
@@ -450,22 +482,22 @@ var w = {
|
|
|
450
482
|
i ? i.annotations.push(n) : t.set(e, {
|
|
451
483
|
groupKey: `cit:${e}`,
|
|
452
484
|
sourceUrl: r,
|
|
453
|
-
sourceName:
|
|
485
|
+
sourceName: J(n, r),
|
|
454
486
|
annotations: [n],
|
|
455
487
|
primaryAnnotation: n
|
|
456
488
|
});
|
|
457
489
|
}
|
|
458
490
|
return Array.from(t.values());
|
|
459
|
-
},
|
|
491
|
+
}, be = (e) => [...Z(e), ...X(e)], xe = (e, t) => {
|
|
460
492
|
let n = e.body?.source?.attachment?.url;
|
|
461
493
|
return n == null || !t.includes(e) ? [e] : t.filter((e) => e.body?.source?.attachment?.url === n);
|
|
462
|
-
}, Q = (e) => e.url == null && e.reference_url != null,
|
|
463
|
-
let t =
|
|
494
|
+
}, Q = (e) => e.url == null && e.reference_url != null, Se = /^(.*\.pdf)(?:#page=(\d+))?$/i, $ = (e) => {
|
|
495
|
+
let t = Se.exec(e);
|
|
464
496
|
return t ? {
|
|
465
497
|
baseUrl: t[1],
|
|
466
498
|
page: t[2] == null ? null : Number(t[2])
|
|
467
499
|
} : null;
|
|
468
|
-
},
|
|
500
|
+
}, Ce = (t) => X((t ?? []).filter(Q).map((t) => {
|
|
469
501
|
let n = t.reference_url, r = $(n) != null;
|
|
470
502
|
return { body: {
|
|
471
503
|
quote: t.data,
|
|
@@ -480,4 +512,4 @@ var w = {
|
|
|
480
512
|
} };
|
|
481
513
|
}));
|
|
482
514
|
//#endregion
|
|
483
|
-
export {
|
|
515
|
+
export { E as CitationCard, k as CitationCardProvider, M as CitationDropdown, D as CitationMarker, ie as annotationHighlightId, le as annotationToOfficeHighlightLocations, re as annotationsToPdfHighlights, xe as gatherSameSourceAnnotations, ae as getAnnotationPdfPage, Ce as getReferenceAttachmentGroups, be as groupAnnotations, Z as groupAnnotationsByCitId, X as groupAnnotationsBySource, H as injectCitationSentinels, I as isDocxRangeSelector, z as isExcelRcRangeSelector, L as isPptxRangeSelector, Q as isReferenceOnlyAttachment, $ as parsePdfPageReference, G as replaceSentinelsInChildren, F as resolveMessageAnnotations, W as stripCitTagsWhileStreaming, ue as useAnnotations, B as useCitationCard, A as useCitationCardContext, ve as useCitationMarkdownComponents };
|
|
@@ -38,6 +38,26 @@ export interface PptxOfficeHighlightLocation {
|
|
|
38
38
|
/** The cited text, expected to equal the text resolved over `[start, endExclusive)`. */
|
|
39
39
|
text: string;
|
|
40
40
|
}
|
|
41
|
+
/** Temporary table-row location decoded from a DOCX text anchor. */
|
|
42
|
+
export interface DocxTableRowOfficeHighlightLocation {
|
|
43
|
+
/** Wire selector type. */
|
|
44
|
+
type: 'docx_text_anchor';
|
|
45
|
+
/** Plain text of each cell, in column order. */
|
|
46
|
+
cells: string[];
|
|
47
|
+
/** 1-based matching row in the document body. */
|
|
48
|
+
occurrence: number;
|
|
49
|
+
}
|
|
50
|
+
/** Temporary table-row location decoded from a PPTX text anchor. */
|
|
51
|
+
export interface PptxTableRowOfficeHighlightLocation {
|
|
52
|
+
/** Wire selector type. */
|
|
53
|
+
type: 'pptx_text_anchor';
|
|
54
|
+
/** Plain text of each cell, in column order. */
|
|
55
|
+
cells: string[];
|
|
56
|
+
/** 1-based matching row on the specified slide. */
|
|
57
|
+
occurrence: number;
|
|
58
|
+
/** 1-based slide number. */
|
|
59
|
+
slide: number;
|
|
60
|
+
}
|
|
41
61
|
/** A validated, normalised XLSX cell or same-row cell-range location. */
|
|
42
62
|
export interface ExcelOfficeHighlightLocation {
|
|
43
63
|
/** Discriminates this location within `OfficeHighlightLocation`. Mirrors the wire selector's `type`. */
|
|
@@ -58,5 +78,5 @@ export interface ExcelOfficeHighlightLocation {
|
|
|
58
78
|
* cycle is not permitted). `libs/chat-hooks`, which already depends on both,
|
|
59
79
|
* maps this into `OoxmlHighlight`/`OoxmlHighlightLocation`.
|
|
60
80
|
*/
|
|
61
|
-
export type OfficeHighlightLocation = DocxOfficeHighlightLocation | PptxOfficeHighlightLocation | ExcelOfficeHighlightLocation;
|
|
81
|
+
export type OfficeHighlightLocation = DocxOfficeHighlightLocation | PptxOfficeHighlightLocation | DocxTableRowOfficeHighlightLocation | PptxTableRowOfficeHighlightLocation | ExcelOfficeHighlightLocation;
|
|
62
82
|
//# sourceMappingURL=office-highlight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"office-highlight.d.ts","sourceRoot":"","sources":["../../src/models/office-highlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wGAAwG;IACxG,IAAI,EAAE,iBAAiB,CAAC;IACxB,4GAA4G;IAC5G,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wGAAwG;IACxG,IAAI,EAAE,iBAAiB,CAAC;IACxB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,4BAA4B;IAC3C,wGAAwG;IACxG,IAAI,EAAE,gBAAgB,CAAC;IACvB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,KAAK,EAAE,gBAAgB,CAAC;IACxB,iGAAiG;IACjG,GAAG,CAAC,EAAE,gBAAgB,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAC/B,2BAA2B,GAC3B,2BAA2B,GAC3B,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"office-highlight.d.ts","sourceRoot":"","sources":["../../src/models/office-highlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wGAAwG;IACxG,IAAI,EAAE,iBAAiB,CAAC;IACxB,4GAA4G;IAC5G,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wGAAwG;IACxG,IAAI,EAAE,iBAAiB,CAAC;IACxB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oEAAoE;AACpE,MAAM,WAAW,mCAAmC;IAClD,0BAA0B;IAC1B,IAAI,EAAE,kBAAkB,CAAC;IACzB,gDAAgD;IAChD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oEAAoE;AACpE,MAAM,WAAW,mCAAmC;IAClD,0BAA0B;IAC1B,IAAI,EAAE,kBAAkB,CAAC;IACzB,gDAAgD;IAChD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yEAAyE;AACzE,MAAM,WAAW,4BAA4B;IAC3C,wGAAwG;IACxG,IAAI,EAAE,gBAAgB,CAAC;IACvB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,KAAK,EAAE,gBAAgB,CAAC;IACxB,iGAAiG;IACjG,GAAG,CAAC,EAAE,gBAAgB,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAC/B,2BAA2B,GAC3B,2BAA2B,GAC3B,mCAAmC,GACnC,mCAAmC,GACnC,4BAA4B,CAAC"}
|
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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.38",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.38",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.14.2"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
package/utils/annotation.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare const isExcelRcRangeSelector: (selector: AnnotationSelector) => s
|
|
|
45
45
|
/**
|
|
46
46
|
* Converts an annotation's `body.selector` (scalar or array) to validated
|
|
47
47
|
* `OfficeHighlightLocation` entries, skipping any selector that is not a
|
|
48
|
-
* recognised Office range or that fails validation
|
|
48
|
+
* recognised Office range or temporary table-row anchor, or that fails validation.
|
|
49
49
|
*/
|
|
50
50
|
export declare const annotationToOfficeHighlightLocations: (annotation: Annotation) => OfficeHighlightLocation[];
|
|
51
51
|
//# 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,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,KAAK,EAGV,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/utils/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,KAAK,EAGV,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAsG1E;;;;;;GAMG;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;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,YAAY,UAAU,KACrB,MAAM,GAAG,SAWX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,OAAO,KAAG,UAAU,EAoBtE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,kBAAkB,KAC3B,QAAQ,IAAI,iBAWd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,kBAAkB,KAC3B,QAAQ,IAAI,iBAUd,CAAC;AAUF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,kBAAkB,KAC3B,QAAQ,IAAI,oBAQd,CAAC;AA8FF;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,GAC/C,YAAY,UAAU,KACrB,uBAAuB,EAuBzB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnnotationSelector } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { DocxTableRowOfficeHighlightLocation, PptxTableRowOfficeHighlightLocation } from '../models/office-highlight';
|
|
3
|
+
/** Returns a validated table-row location for the temporary Office anchor format. */
|
|
4
|
+
export declare const normalizeOfficeTableAnchor: (selector: AnnotationSelector) => DocxTableRowOfficeHighlightLocation | PptxTableRowOfficeHighlightLocation | undefined;
|
|
5
|
+
//# sourceMappingURL=office-table-anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"office-table-anchor.d.ts","sourceRoot":"","sources":["../../src/utils/office-table-anchor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACV,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,4BAA4B,CAAC;AAwCpC,qFAAqF;AACrF,eAAO,MAAM,0BAA0B,GACrC,UAAU,kBAAkB,KAE1B,mCAAmC,GACnC,mCAAmC,GACnC,SA2BH,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Manages open/close state and per-group active annotation index for citation
|
|
3
|
-
* cards within a single assistant message.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* cards within a single assistant message. The hook carries two distinct key
|
|
4
|
+
* spaces:
|
|
5
|
+
*
|
|
6
|
+
* - Openness (`openPopup`/`closePopup`/`isOpen`) is keyed by **occurrence
|
|
7
|
+
* owner key** — a stable per-instance id derived by the rendered
|
|
8
|
+
* `CitationDropdown` (see its `ownerKey`), not by `AnnotationGroup.groupKey`
|
|
9
|
+
* or `sourceUrl`. Two rendered occurrences resolving to the same group are
|
|
10
|
+
* therefore always independent popup owners.
|
|
11
|
+
* - The switcher index (`setActiveIndex`/`getActiveIndex`) is keyed by
|
|
12
|
+
* `groupKey`, because the index indexes into `group.annotations`, which is
|
|
13
|
+
* group data, not occurrence data.
|
|
7
14
|
*/
|
|
8
15
|
export declare const useCitationCard: () => {
|
|
9
|
-
openPopup: (
|
|
10
|
-
closePopup: () => void;
|
|
16
|
+
openPopup: (ownerKey: string) => void;
|
|
17
|
+
closePopup: (ownerKey: string) => void;
|
|
11
18
|
setActiveIndex: (groupKey: string, index: number) => void;
|
|
12
|
-
isOpen: (
|
|
19
|
+
isOpen: (ownerKey: string) => boolean;
|
|
13
20
|
getActiveIndex: (groupKey: string) => number;
|
|
14
21
|
};
|
|
15
22
|
//# sourceMappingURL=useCitationCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCitationCard.d.ts","sourceRoot":"","sources":["../../src/utils/useCitationCard.ts"],"names":[],"mappings":"AAcA
|
|
1
|
+
{"version":3,"file":"useCitationCard.d.ts","sourceRoot":"","sources":["../../src/utils/useCitationCard.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;0BAGe,MAAM;2BAIL,MAAM;+BAMF,MAAM,SAAS,MAAM;uBAY5C,MAAM;+BACE,MAAM;CAKtC,CAAC"}
|