@epam/ai-dial-quotations 1.2.0-dev.219 → 1.2.0-dev.225

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.
@@ -31,6 +31,6 @@ export interface CitationDropdownProps {
31
31
  /** Typography class forwarded to the marker's label text. Defaults to `'dial-caption-text'`. */
32
32
  markerLabelClassName?: string;
33
33
  }
34
- /** Combines `CitationMarker` and `CitationCard` into a tooltip-based dropdown. Requires a `CitationCardProvider` ancestor. */
34
+ /** Combines `CitationMarker` and `CitationCard` into a click-opened popover. Requires a `CitationCardProvider` ancestor. */
35
35
  export declare const CitationDropdown: FC<CitationDropdownProps>;
36
36
  //# sourceMappingURL=CitationDropdown.d.ts.map
@@ -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,EAA+B,MAAM,OAAO,CAAC;AAGnE,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,qHAAqH;IACrH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;IACpD,uEAAuE;IACvE,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,8JAA8J;IAC9J,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,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,CAyFtD,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,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAGnE,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,qHAAqH;IACrH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;IACpD,uEAAuE;IACvE,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,8JAA8J;IAC9J,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,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,4HAA4H;AAC5H,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAyGtD,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))}td ._trigger_3ev9j_1,th ._trigger_3ev9j_1{max-width:100%;margin-inline-start:0}td ._trigger_3ev9j_1>*,th ._trigger_3ev9j_1>*{min-width:0;max-width:100%}._content_3ev9j_10>svg{fill:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc));stroke:#0000}
2
- /*$vite$:1*/.visible{visibility:visible}.collapse{visibility:collapse}.fixed{position:fixed}.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}.max-h-\[min\(20rem\2c 50vh\)\]{max-height:min(20rem,50vh)}.min-h-\[3lh\]{min-height:3lh}.w-\[400px\]{width:400px}.w-full{width:100%}.min-w-0{min-width:0}.\!max-w-none{max-width:none!important}.max-w-\[240px\]{max-width:240px}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.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}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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))}
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))}td ._trigger_1ud83_1,th ._trigger_1ud83_1{max-width:100%;margin-inline-start:0}td ._trigger_1ud83_1>*,th ._trigger_1ud83_1>*{min-width:0;max-width:100%}
2
+ /*$vite$:1*/.visible{visibility:visible}.collapse{visibility:collapse}.fixed{position:fixed}.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}.max-h-\[min\(20rem\2c 50vh\)\]{max-height:min(20rem,50vh)}.min-h-\[3lh\]{min-height:3lh}.w-\[400px\]{width:400px}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[240px\]{max-width:240px}.max-w-full{max-width:100%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.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}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.\!rounded-none{border-radius:0!important}.rounded-lg{border-radius:.5rem}.\!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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MIMEType as e, MarkdownRenderer as t, buildCssVars as n, isAnnotationSelector as r, mergeClasses as i, normalizePersistedHtmlTagAttachmentType as a, normalizeRawAnnotations as o } from "@epam/ai-dial-chat-shared";
2
- import { DIAL_KIT_ICON_STROKE as s, DialItemType as c, ElementSize as l, EllipsisTooltip as u, FileIcon as d, GhostIconButton as f, LinkButton as p, NeutralButton as m, PrimaryButton as h, Tooltip as g } from "@epam/ai-dial-ui-kit";
2
+ import { DIAL_KIT_ICON_STROKE as s, DialItemType as c, Dropdown as l, ElementSize as u, EllipsisTooltip as d, FileIcon as f, GhostIconButton as p, LinkButton as m, NeutralButton as h, PrimaryButton as g } from "@epam/ai-dial-ui-kit";
3
3
  import { IconChevronLeft as _, IconChevronRight as v } from "@tabler/icons-react";
4
4
  import { createContext as y, useCallback as b, useContext as x, useEffect as S, useId as ee, useLayoutEffect as te, useMemo as C, useRef as ne, useState as w } from "react";
5
5
  import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
@@ -30,10 +30,10 @@ var O = {
30
30
  }, N = (e, t) => e.body?.source?.attachment?.title ?? A(t), P = (e) => {
31
31
  let t = e.target?.selector;
32
32
  return t?.type === "html_tag" ? t : void 0;
33
- }, ie = (e) => P(e) != null, F = (e) => {
33
+ }, F = (e) => P(e) != null, I = (e) => {
34
34
  let t = /* @__PURE__ */ new Map();
35
35
  for (let n of e) {
36
- if (ie(n)) continue;
36
+ if (F(n)) continue;
37
37
  let e = n.body?.source?.attachment?.url;
38
38
  if (e == null) continue;
39
39
  let r = t.get(e);
@@ -46,7 +46,7 @@ var O = {
46
46
  });
47
47
  }
48
48
  return Array.from(t.values());
49
- }, I = (e) => {
49
+ }, L = (e) => {
50
50
  let t = /* @__PURE__ */ new Map();
51
51
  for (let n of e) {
52
52
  let e = P(n)?.id;
@@ -63,78 +63,78 @@ var O = {
63
63
  });
64
64
  }
65
65
  return Array.from(t.values());
66
- }, L = (e) => [...I(e), ...F(e)], R = (e, t) => {
66
+ }, R = (e) => [...L(e), ...I(e)], z = (e, t) => {
67
67
  let n = e.body?.source?.attachment?.url;
68
68
  return n == null || !t.includes(e) ? [e] : t.filter((e) => e.body?.source?.attachment?.url === n);
69
- }, z = {
69
+ }, B = {
70
70
  card: "_card_1kph1_1",
71
71
  quote: "_quote_1kph1_5",
72
72
  title: "_title_1kph1_9",
73
73
  switcher: "_switcher_1kph1_13",
74
74
  sourceName: "_sourceName_1kph1_17"
75
- }, B = ({ group: r, activeIndex: a, onIndexChange: o, onPreview: m, onOpenInBrowser: g, headerIcon: y, labels: b, typography: x, colors: C }) => {
76
- let T = r.annotations.length, k = r.annotations[a] ?? r.primaryAnnotation, A = T > 1, j = k.body?.source?.attachment?.type, M = m == null || j === e.HTML || j === e.XHTML, N = M ? void 0 : re(k), P = N ?? r.sourceName, ie = y ?? (N == null ? void 0 : /* @__PURE__ */ E(d, {
75
+ }, V = ({ group: r, activeIndex: a, onIndexChange: o, onPreview: l, onOpenInBrowser: h, headerIcon: y, labels: b, typography: x, colors: C }) => {
76
+ let T = r.annotations.length, k = r.annotations[a] ?? r.primaryAnnotation, A = T > 1, j = k.body?.source?.attachment?.type, M = l == null || j === e.HTML || j === e.XHTML, N = M ? void 0 : re(k), P = N ?? r.sourceName, F = y ?? (N == null ? void 0 : /* @__PURE__ */ E(f, {
77
77
  type: c.File,
78
78
  name: N,
79
79
  fileExtension: N,
80
80
  size: 16,
81
81
  decorative: !0,
82
82
  className: "shrink-0"
83
- })), F = x?.sourceNameClassName ?? "dial-tiny-text", I = x?.titleClassName ?? "dial-body-semi-text", L = x?.quoteClassName ?? "dial-small-text", R = x?.quoteStrongClassName ?? "dial-small-semi-text", B = x?.switcherClassName ?? "dial-tiny-text", V = n({
83
+ })), I = x?.sourceNameClassName ?? "dial-tiny-text", L = x?.titleClassName ?? "dial-body-semi-text", R = x?.quoteClassName ?? "dial-small-text", z = x?.quoteStrongClassName ?? "dial-small-semi-text", V = x?.switcherClassName ?? "dial-tiny-text", H = n({
84
84
  "--cc-card-bg": C?.cardBackground,
85
85
  "--cc-quote-text": C?.quoteText,
86
86
  "--cc-title-text": C?.titleText,
87
87
  "--cc-switcher-text": C?.switcherText,
88
88
  "--cc-source-name-text": C?.sourceNameText
89
- }), H = k.body?.quote, U = ee(), W = ne(null), [G, K] = w(!1), [q, J] = w(!1);
89
+ }), U = k.body?.quote, W = ee(), G = ne(null), [K, q] = w(!1), [J, Y] = w(!1);
90
90
  return S(() => {
91
- K(!1);
92
- }, [a, H]), te(() => {
93
- let e = W.current;
94
- if (!e || G) return;
95
- let t = () => J(e.scrollHeight > e.clientHeight + 1);
91
+ q(!1);
92
+ }, [a, U]), te(() => {
93
+ let e = G.current;
94
+ if (!e || K) return;
95
+ let t = () => Y(e.scrollHeight > e.clientHeight + 1);
96
96
  t();
97
97
  let n = new ResizeObserver(t);
98
98
  return n.observe(e), () => n.disconnect();
99
- }, [H, G]), /* @__PURE__ */ D("div", {
99
+ }, [U, K]), /* @__PURE__ */ D("div", {
100
100
  role: "dialog",
101
101
  "aria-modal": "true",
102
102
  "aria-label": b.ariaLabel,
103
- style: V,
104
- className: i("flex w-[400px] flex-col gap-3 rounded-lg p-4 shadow-lg", z.card, O.citationCard),
103
+ style: H,
104
+ className: i("flex w-[400px] max-w-full flex-col gap-3 rounded-lg p-4 shadow-lg", B.card, O.citationCard),
105
105
  children: [
106
106
  /* @__PURE__ */ D("div", {
107
107
  className: "flex items-center justify-between gap-2",
108
108
  children: [/* @__PURE__ */ D("div", {
109
109
  className: "flex min-w-0 items-center gap-1",
110
- children: [ie, /* @__PURE__ */ E(u, {
110
+ children: [F, /* @__PURE__ */ E(d, {
111
111
  text: P,
112
- className: i(F, "min-w-0", z.sourceName)
112
+ className: i(I, "min-w-0", B.sourceName)
113
113
  })]
114
114
  }), A && /* @__PURE__ */ D("div", {
115
115
  className: "flex shrink-0 items-center gap-1",
116
116
  children: [
117
- /* @__PURE__ */ E(f, {
117
+ /* @__PURE__ */ E(p, {
118
118
  icon: /* @__PURE__ */ E(_, {
119
119
  size: 14,
120
120
  className: "rtl:scale-x-[-1]",
121
121
  stroke: s
122
122
  }),
123
- size: l.Small,
123
+ size: u.Small,
124
124
  "aria-label": b.previousCitation,
125
125
  onClick: () => o((a - 1 + T) % T)
126
126
  }),
127
127
  /* @__PURE__ */ E("span", {
128
- className: i(B, z.switcher),
128
+ className: i(V, B.switcher),
129
129
  children: b.formatSwitcherText(a + 1, T)
130
130
  }),
131
- /* @__PURE__ */ E(f, {
131
+ /* @__PURE__ */ E(p, {
132
132
  icon: /* @__PURE__ */ E(v, {
133
133
  size: 14,
134
134
  className: "rtl:scale-x-[-1]",
135
135
  stroke: s
136
136
  }),
137
- size: l.Small,
137
+ size: u.Small,
138
138
  "aria-label": b.nextCitation,
139
139
  onClick: () => o((a + 1) % T)
140
140
  })
@@ -144,49 +144,49 @@ var O = {
144
144
  (k.body?.title || k.body?.quote || A) && /* @__PURE__ */ D("div", {
145
145
  className: "flex flex-col gap-3",
146
146
  children: [k.body?.title && /* @__PURE__ */ E("p", {
147
- className: i(I, z.title, "break-words"),
147
+ className: i(L, B.title, "break-words"),
148
148
  children: k.body.title
149
- }), (H || A) && /* @__PURE__ */ D("div", {
149
+ }), (U || A) && /* @__PURE__ */ D("div", {
150
150
  className: "flex flex-col items-start gap-1",
151
151
  children: [/* @__PURE__ */ E("div", {
152
- ref: W,
153
- id: U,
154
- tabIndex: G ? 0 : void 0,
155
- className: i(L, z.quote, "w-full break-words", G ? "max-h-[min(20rem,50vh)] overflow-y-auto" : "line-clamp-6", A && "min-h-[3lh]"),
156
- children: H && /* @__PURE__ */ E(t, {
157
- content: H,
152
+ ref: G,
153
+ id: W,
154
+ tabIndex: K ? 0 : void 0,
155
+ className: i(R, B.quote, "w-full break-words", K ? "max-h-[min(20rem,50vh)] overflow-y-auto" : "line-clamp-6", A && "min-h-[3lh]"),
156
+ children: U && /* @__PURE__ */ E(t, {
157
+ content: U,
158
158
  classNames: {
159
- p: i(L, z.quote),
160
- ul: i(L, "ps-3"),
161
- ol: i(L, "ps-3"),
162
- strong: R
159
+ p: i(R, B.quote),
160
+ ul: i(R, "ps-3"),
161
+ ol: i(R, "ps-3"),
162
+ strong: z
163
163
  }
164
164
  })
165
- }), q && /* @__PURE__ */ E(p, {
166
- label: G ? b.showLess : b.showMore,
167
- size: l.Small,
168
- "aria-expanded": G,
169
- "aria-controls": U,
170
- onClick: () => K((e) => !e)
165
+ }), J && /* @__PURE__ */ E(m, {
166
+ label: K ? b.showLess : b.showMore,
167
+ size: u.Small,
168
+ "aria-expanded": K,
169
+ "aria-controls": W,
170
+ onClick: () => q((e) => !e)
171
171
  })]
172
172
  })]
173
173
  }),
174
174
  /* @__PURE__ */ D("div", {
175
175
  className: "flex justify-start gap-2",
176
- children: [m && /* @__PURE__ */ E(h, {
176
+ children: [l && /* @__PURE__ */ E(g, {
177
177
  label: b.preview,
178
- size: l.Small,
179
- onClick: () => m(k)
180
- }), M && /* @__PURE__ */ E(h, {
178
+ size: u.Small,
179
+ onClick: () => l(k)
180
+ }), M && /* @__PURE__ */ E(g, {
181
181
  label: b.openInBrowser,
182
- size: l.Small,
183
- onClick: () => g(k)
182
+ size: u.Small,
183
+ onClick: () => h(k)
184
184
  })]
185
185
  })
186
186
  ]
187
187
  });
188
- }, V = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: a = "dial-caption-text" }) => /* @__PURE__ */ E(m, {
189
- size: l.Small,
188
+ }, H = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: a = "dial-caption-text" }) => /* @__PURE__ */ E(h, {
189
+ size: u.Small,
190
190
  className: i("max-w-[240px]", O.citationMarker),
191
191
  textClassName: "min-w-0 truncate",
192
192
  iconBefore: n,
@@ -196,61 +196,70 @@ var O = {
196
196
  }),
197
197
  "aria-label": r.ariaLabel,
198
198
  onClick: t
199
- }), H = y(null), U = H.Provider, W = () => {
200
- let e = x(H);
199
+ }), U = y(null), W = U.Provider, G = () => {
200
+ let e = x(U);
201
201
  if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
202
202
  return e;
203
- }, G = {
204
- trigger: "_trigger_3ev9j_1",
205
- content: "_content_3ev9j_10"
206
- }, K = ({ group: e, onPreview: t, isPreviewable: n, onOpenInBrowser: r, isPreviewOpen: a = !1, icon: o, headerIcon: s, cardLabels: c, markerLabels: l, cardTypography: u, markerLabelClassName: d }) => {
207
- let f = W(), p = ee(), m = f.isOpen(p), h = f.getActiveIndex(e.groupKey), _ = e.annotations[h] ?? e.primaryAnnotation, v = n?.(_) ?? !0, y = b((e) => {
208
- e || f.closePopup(p);
209
- }, [f, p]), x = C(() => t && v ? (e) => {
210
- t(e), f.closePopup(p);
203
+ }, K = { trigger: "_trigger_1ud83_1" }, q = ({ group: e, onPreview: t, isPreviewable: n, onOpenInBrowser: r, isPreviewOpen: a = !1, icon: o, headerIcon: s, cardLabels: c, markerLabels: u, cardTypography: d, markerLabelClassName: f }) => {
204
+ let p = G(), m = ee(), h = p.isOpen(m), g = p.getActiveIndex(e.groupKey), _ = e.annotations[g] ?? e.primaryAnnotation, v = n?.(_) ?? !0, y = b((e) => {
205
+ e || p.closePopup(m);
206
+ }, [p, m]), x = C(() => t && v ? (e) => {
207
+ t(e), p.closePopup(m);
211
208
  } : void 0, [
212
209
  t,
213
210
  v,
214
- f,
215
- p
211
+ p,
212
+ m
216
213
  ]), S = b(() => {
217
214
  if (a && x) {
218
215
  x(_);
219
216
  return;
220
217
  }
221
- f.openPopup(p);
218
+ p.openPopup(m);
222
219
  }, [
223
220
  a,
224
221
  x,
225
222
  _,
226
- f,
227
- p
223
+ p,
224
+ m
225
+ ]), te = b(() => /* @__PURE__ */ E(V, {
226
+ group: e,
227
+ activeIndex: g,
228
+ onIndexChange: (t) => p.setActiveIndex(e.groupKey, t),
229
+ onPreview: x,
230
+ onOpenInBrowser: r,
231
+ headerIcon: s,
232
+ labels: c,
233
+ typography: d
234
+ }), [
235
+ e,
236
+ g,
237
+ p,
238
+ x,
239
+ r,
240
+ s,
241
+ c,
242
+ d
228
243
  ]);
229
- return /* @__PURE__ */ E(g, {
230
- open: m,
244
+ return /* @__PURE__ */ E(l, {
245
+ open: h,
231
246
  onOpenChange: y,
232
- triggerClassName: i("ms-1 inline-flex align-middle", G.trigger),
233
- contentClassName: i("!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none", G.content, O.citationDropdown),
234
- tooltip: /* @__PURE__ */ E(B, {
235
- group: e,
236
- activeIndex: h,
237
- onIndexChange: (t) => f.setActiveIndex(e.groupKey, t),
238
- onPreview: x,
239
- onOpenInBrowser: r,
240
- headerIcon: s,
241
- labels: c,
242
- typography: u
243
- }),
244
- children: /* @__PURE__ */ E(V, {
247
+ trigger: [],
248
+ placement: "bottom-end",
249
+ matchReferenceWidth: !1,
250
+ className: i("ms-1 inline-flex align-middle", K.trigger),
251
+ listClassName: i("!p-0 !bg-transparent !shadow-none !rounded-none", O.citationDropdown),
252
+ renderOverlay: te,
253
+ children: /* @__PURE__ */ E(H, {
245
254
  sourceName: e.sourceName,
246
255
  annotationCount: e.annotations.length,
247
256
  onOpen: S,
248
257
  icon: o,
249
- labels: l,
250
- labelClassName: d
258
+ labels: u,
259
+ labelClassName: f
251
260
  })
252
261
  });
253
- }, q = (e) => {
262
+ }, J = (e) => {
254
263
  let t = e.trim();
255
264
  if (!t.startsWith("|") || !t.endsWith("|") || /[\r\n]/.test(t)) return;
256
265
  let n = [], r = "";
@@ -259,11 +268,11 @@ var O = {
259
268
  i === "\\" && a != null && /[!-/:-@[-`{-~]/.test(a) ? (r += a, e += 1) : i === "|" ? (n.push(r.trim()), r = "") : r += i;
260
269
  }
261
270
  if (!(r !== "" || n.length < 2 || n.every((e) => e === "" || /^:?-{3,}:?$/.test(e)))) return n;
262
- }, J = (e) => {
271
+ }, Y = (e) => {
263
272
  if (e.type !== "docx_text_anchor" && e.type !== "pptx_text_anchor") return;
264
273
  let { text: t, occurrence: n, slide: r } = e;
265
274
  if (typeof t != "string" || typeof n != "number" || !Number.isSafeInteger(n) || n < 1) return;
266
- let i = q(t);
275
+ let i = J(t);
267
276
  if (i != null) {
268
277
  if (e.type === "docx_text_anchor") return {
269
278
  type: "docx_text_anchor",
@@ -277,13 +286,13 @@ var O = {
277
286
  slide: r
278
287
  };
279
288
  }
280
- }, ae = {
289
+ }, ie = {
281
290
  backgroundColor: "transparent",
282
291
  borderColor: "var(--stroke-accent, #1D4ED8)",
283
292
  borderWidth: "2px",
284
293
  opacity: .5,
285
294
  hoverOpacity: .5
286
- }, oe = (e) => {
295
+ }, ae = (e) => {
287
296
  if (typeof e != "object" || !e) return;
288
297
  let t = e, { lt: n, wh: r } = t;
289
298
  if (Array.isArray(n) && Array.isArray(r) && n.length >= 2 && r.length >= 2) {
@@ -302,7 +311,7 @@ var O = {
302
311
  x2: i + o,
303
312
  y2: a + s
304
313
  };
305
- }, Y = (e) => {
314
+ }, X = (e) => {
306
315
  if (!r(e)) return;
307
316
  let t = e, n;
308
317
  if (t.type === "pdf_bbox") {
@@ -313,7 +322,7 @@ var O = {
313
322
  x2: i,
314
323
  y2: a
315
324
  });
316
- } else t.type === "pdf_region" && (n = oe(t.bbox));
325
+ } else t.type === "pdf_region" && (n = ae(t.bbox));
317
326
  if (n == null) return;
318
327
  let i = t.page;
319
328
  if (!(typeof i != "number" || !Number.isInteger(i) || i < 1) && [
@@ -328,7 +337,13 @@ var O = {
328
337
  x2: n.x2,
329
338
  y2: n.y2
330
339
  };
331
- }, X = (e) => typeof e != "object" || !e ? String(e) : Array.isArray(e) ? `[${e.map(X).join(",")}]` : `{${Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => `${e}=${X(t)}`).join(",")}}`, se = (e) => {
340
+ }, oe = (e) => {
341
+ if (!r(e)) return;
342
+ let t = e;
343
+ if (t.type !== "pdf_bbox" && t.type !== "pdf_region") return;
344
+ let n = t.page;
345
+ return typeof n == "number" && Number.isInteger(n) && n >= 1 ? n : void 0;
346
+ }, Z = (e) => typeof e != "object" || !e ? String(e) : Array.isArray(e) ? `[${e.map(Z).join(",")}]` : `{${Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => `${e}=${Z(t)}`).join(",")}}`, se = (e) => {
332
347
  let t = 5381;
333
348
  for (let n = 0; n < e.length; n += 1) t = t * 33 + e.charCodeAt(n) | 0;
334
349
  return (t >>> 0).toString(36);
@@ -336,10 +351,10 @@ var O = {
336
351
  let t = e.body?.selector;
337
352
  if (t == null) return;
338
353
  let n = (Array.isArray(t) ? t : [t]).flatMap((e) => {
339
- let t = Y(e);
354
+ let t = X(e);
340
355
  return t == null ? [] : [t];
341
- }), r = ye(e);
342
- if (!(n.length === 0 && r.length === 0)) return X([n, r]);
356
+ }), r = be(e);
357
+ if (!(n.length === 0 && r.length === 0)) return Z([n, r]);
343
358
  }, le = (e) => {
344
359
  let t = e.target?.selector, n = t?.type === "html_tag" ? t.id : void 0, r = typeof n == "string" ? n : void 0, i = ce(e);
345
360
  if (!(r == null && i == null)) return se(`${r ?? ""}|${i ?? ""}`);
@@ -348,43 +363,47 @@ var O = {
348
363
  if (n == null) return [];
349
364
  let i = (Array.isArray(n) ? n : [n]).flatMap((e) => {
350
365
  if (!r(e)) return [];
351
- let t = Y(e);
366
+ let t = X(e);
352
367
  return t == null ? [] : [t];
353
368
  });
354
369
  return i.length === 0 ? [] : [{
355
- id: Z(e, t),
370
+ id: de(e, t),
356
371
  bboxes: i,
357
- style: ae
372
+ style: ie
358
373
  }];
359
- }), Z = (e, t) => e.index == null ? le(e) ?? String(t) : String(e.index), de = (e) => {
374
+ }), de = (e, t) => e.index == null ? le(e) ?? String(t) : String(e.index), fe = (e) => {
360
375
  let t = e.body?.selector;
361
376
  if (t == null) return;
362
377
  let n = Array.isArray(t) ? t : [t];
363
378
  for (let e of n) {
364
379
  if (!r(e)) continue;
365
- let t = Y(e);
380
+ let t = X(e);
366
381
  if (t != null) return t.page;
367
382
  }
368
- }, Q = (e) => {
383
+ for (let e of n) {
384
+ let t = oe(e);
385
+ if (t != null) return t;
386
+ }
387
+ }, pe = (e) => {
369
388
  let t = e.custom_content?.annotations;
370
389
  if (t?.length) return t.filter((e) => e != null && e.body?.source?.attachment?.url != null).map(a);
371
390
  let n = e.custom_fields;
372
391
  if (typeof n != "object" || !n) return [];
373
392
  let r = n.annotations;
374
393
  return !Array.isArray(r) || r.length === 0 ? [] : o(r, e.custom_content?.attachments ?? []).map(a);
375
- }, fe = (e) => {
394
+ }, Q = (e) => {
376
395
  if (e.type !== "docx_text_range") return !1;
377
396
  let t = e;
378
397
  return typeof t.story == "string" && Array.isArray(t.path) && t.path.every((e) => typeof e == "number") && typeof t.start == "number" && typeof t.end == "number" && typeof t.text == "string";
379
- }, pe = (e) => {
398
+ }, me = (e) => {
380
399
  if (e.type !== "pptx_text_range") return !1;
381
400
  let t = e;
382
401
  return typeof t.slide == "number" && typeof t.shape_id == "string" && typeof t.start == "number" && typeof t.end == "number" && typeof t.text == "string";
383
- }, me = (e) => typeof e == "object" && !!e && typeof e.row == "number" && typeof e.col == "number", he = (e) => {
402
+ }, he = (e) => typeof e == "object" && !!e && typeof e.row == "number" && typeof e.col == "number", ge = (e) => {
384
403
  if (e.type !== "excel_rc_range") return !1;
385
404
  let t = e;
386
- return typeof t.sheet == "string" && me(t.start) && (t.end === void 0 || t.end === null || me(t.end));
387
- }, ge = (e) => {
405
+ return typeof t.sheet == "string" && he(t.start) && (t.end === void 0 || t.end === null || he(t.end));
406
+ }, _e = (e) => {
388
407
  let { story: t, path: n, start: r, end: i, text: a } = e;
389
408
  if (!(!n.every((e) => Number.isInteger(e)) || !Number.isInteger(r) || !Number.isInteger(i) || r < 0 || i < r)) return {
390
409
  type: "docx_text_range",
@@ -394,7 +413,7 @@ var O = {
394
413
  endExclusive: i,
395
414
  text: a
396
415
  };
397
- }, _e = (e) => {
416
+ }, ve = (e) => {
398
417
  let { slide: t, shape_id: n, start: r, end: i, text: a } = e;
399
418
  if (!(!Number.isInteger(t) || t < 1 || !Number.isInteger(r) || !Number.isInteger(i) || r < 0 || i < r)) return {
400
419
  type: "pptx_text_range",
@@ -404,7 +423,7 @@ var O = {
404
423
  endExclusive: i,
405
424
  text: a
406
425
  };
407
- }, ve = (e) => {
426
+ }, ye = (e) => {
408
427
  let { sheet: t, start: n, end: r } = e;
409
428
  if (!(t.length === 0 || !Number.isInteger(n.row) || !Number.isInteger(n.col) || n.row < 1 || n.col < 1)) {
410
429
  if (r == null) return {
@@ -419,30 +438,30 @@ var O = {
419
438
  end: r
420
439
  };
421
440
  }
422
- }, ye = (e) => {
441
+ }, be = (e) => {
423
442
  let t = e.body?.selector;
424
443
  return t == null ? [] : (Array.isArray(t) ? t : [t]).flatMap((e) => {
425
444
  if (!r(e)) return [];
426
- if (fe(e)) {
427
- let t = ge(e);
428
- return t ? [t] : [];
429
- }
430
- if (pe(e)) {
445
+ if (Q(e)) {
431
446
  let t = _e(e);
432
447
  return t ? [t] : [];
433
448
  }
434
- if (he(e)) {
449
+ if (me(e)) {
435
450
  let t = ve(e);
436
451
  return t ? [t] : [];
437
452
  }
438
- let t = J(e);
453
+ if (ge(e)) {
454
+ let t = ye(e);
455
+ return t ? [t] : [];
456
+ }
457
+ let t = Y(e);
439
458
  return t ? [t] : [];
440
459
  });
441
- }, be = (e, t) => C(() => t ? [] : Q(e), [t, e]), xe = {
460
+ }, xe = (e, t) => C(() => t ? [] : pe(e), [t, e]), Se = {
442
461
  openOwnerKey: null,
443
462
  activeIndexByGroup: {}
444
- }, Se = () => {
445
- let [e, t] = w(xe), n = b((e) => {
463
+ }, Ce = () => {
464
+ let [e, t] = w(Se), n = b((e) => {
446
465
  t((t) => ({
447
466
  ...t,
448
467
  openOwnerKey: e
@@ -473,7 +492,7 @@ var O = {
473
492
  i,
474
493
  e
475
494
  ]);
476
- }, Ce = /⟦C(\d+)⟧/g, we = (e, t) => {
495
+ }, we = /⟦C(\d+)⟧/g, Te = (e, t) => {
477
496
  let n = t.map((e, t) => ({
478
497
  g: e,
479
498
  idx: t
@@ -486,9 +505,9 @@ var O = {
486
505
  }).sort((e, t) => t.pos - e.pos), r = e;
487
506
  for (let { idx: e, pos: t } of n) r = `${r.slice(0, t)}⟦C${e}⟧${r.slice(t)}`;
488
507
  return r;
489
- }, Te = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>/g, Ee = /^<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>$/, De = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>|<\/?cit\b[^>]*>|<\/?cit\b[^>]*$/gi, Oe = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ke = (e) => e.replace(De, (e) => Ee.test(e) ? e : Oe(e)), Ae = (e) => ke(e).replace(Te, ""), $ = (e, t) => {
508
+ }, Ee = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>/g, De = /^<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>$/, Oe = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>|<\/?cit\b[^>]*>|<\/?cit\b[^>]*$/gi, ke = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Ae = (e) => e.replace(Oe, (e) => De.test(e) ? e : ke(e)), je = (e) => Ae(e).replace(Ee, ""), $ = (e, t) => {
490
509
  if (typeof e == "string") {
491
- let n = e.split(Ce);
510
+ let n = e.split(we);
492
511
  if (n.length === 1) return e;
493
512
  let r = [];
494
513
  return n.forEach((e, n) => {
@@ -499,15 +518,15 @@ var O = {
499
518
  let n = $(e, t);
500
519
  return Array.isArray(n) ? n : [n];
501
520
  }) : e;
502
- }, je = {}, Me = [], Ne = (e) => {
521
+ }, Me = {}, Ne = [], Pe = (e) => {
503
522
  let t = e.primaryAnnotation.target?.selector;
504
523
  return t?.type === "html_tag" ? t.id : void 0;
505
- }, Pe = (e, t) => /* @__PURE__ */ D(T, { children: [
524
+ }, Fe = (e, t) => /* @__PURE__ */ D(T, { children: [
506
525
  e == null ? "<cit>" : `<cit data-id="${e}">`,
507
526
  t,
508
527
  "</cit>"
509
- ] }), Fe = (e, t, n, r = !1, a = !1, o = Me) => {
510
- let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, isPreviewOpen: u = !1, buildLabels: d } = n, f = C(() => r ? Ae(e) : ke(t.length > 0 ? we(e, t) : e), [
528
+ ] }), Ie = (e, t, n, r = !1, a = !1, o = Ne) => {
529
+ let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, isPreviewOpen: u = !1, buildLabels: d } = n, f = C(() => r ? je(e) : Ae(t.length > 0 ? Te(e, t) : e), [
511
530
  e,
512
531
  t,
513
532
  r
@@ -517,16 +536,16 @@ var O = {
517
536
  markdownComponents: C(() => {
518
537
  let e = /* @__PURE__ */ new Map();
519
538
  for (let t of o) {
520
- let n = Ne(t);
539
+ let n = Pe(t);
521
540
  n != null && e.set(n, t);
522
541
  }
523
542
  for (let n of t) {
524
- let t = Ne(n);
543
+ let t = Pe(n);
525
544
  t != null && e.set(t, n);
526
545
  }
527
546
  let n = (e) => {
528
547
  let { cardLabels: t, markerLabels: n } = d(e);
529
- return /* @__PURE__ */ E(K, {
548
+ return /* @__PURE__ */ E(q, {
530
549
  group: e,
531
550
  onPreview: (t) => s(t, e),
532
551
  isPreviewable: c,
@@ -540,9 +559,9 @@ var O = {
540
559
  return r ? n(r) : null;
541
560
  }, f = { cit: (t) => {
542
561
  let r = t["data-id"] == null ? void 0 : e.get(t["data-id"]);
543
- return r ? n(r) : Pe(t["data-id"], t.children);
562
+ return r ? n(r) : Fe(t["data-id"], t.children);
544
563
  } };
545
- return t.length === 0 && o.length === 0 ? p ? f : je : {
564
+ return t.length === 0 && o.length === 0 ? p ? f : Me : {
546
565
  ...f,
547
566
  p: ({ children: e, ...t }) => /* @__PURE__ */ E("p", {
548
567
  ...t,
@@ -567,14 +586,14 @@ var O = {
567
586
  p
568
587
  ])
569
588
  };
570
- }, Ie = (e) => e.url == null && e.reference_url != null, Le = /^(.*\.pdf)(?:#page=(\d+))?$/i, Re = (e) => {
571
- let t = Le.exec(e);
589
+ }, Le = (e) => e.url == null && e.reference_url != null, Re = /^(.*\.pdf)(?:#page=(\d+))?$/i, ze = (e) => {
590
+ let t = Re.exec(e);
572
591
  return t ? {
573
592
  baseUrl: t[1],
574
593
  page: t[2] == null ? null : Number(t[2])
575
594
  } : null;
576
- }, ze = (t) => F((t ?? []).filter(Ie).map((t) => {
577
- let n = t.reference_url, r = Re(n) != null;
595
+ }, Be = (t) => I((t ?? []).filter(Le).map((t) => {
596
+ let n = t.reference_url, r = ze(n) != null;
578
597
  return { body: {
579
598
  quote: t.data,
580
599
  source: {
@@ -588,4 +607,4 @@ var O = {
588
607
  } };
589
608
  }));
590
609
  //#endregion
591
- export { B as CitationCard, U as CitationCardProvider, K as CitationDropdown, V as CitationMarker, O as QUOTATIONS_CLASS, Z as annotationHighlightId, ye as annotationToOfficeHighlightLocations, ue as annotationsToPdfHighlights, R as gatherSameSourceAnnotations, de as getAnnotationPdfPage, ze as getReferenceAttachmentGroups, L as groupAnnotations, I as groupAnnotationsByCitId, F as groupAnnotationsBySource, we as injectCitationSentinels, fe as isDocxRangeSelector, he as isExcelRcRangeSelector, pe as isPptxRangeSelector, Ie as isReferenceOnlyAttachment, Re as parsePdfPageReference, $ as replaceSentinelsInChildren, Q as resolveMessageAnnotations, Ae as stripCitTagsWhileStreaming, be as useAnnotations, Se as useCitationCard, W as useCitationCardContext, Fe as useCitationMarkdownComponents };
610
+ export { V as CitationCard, W as CitationCardProvider, q as CitationDropdown, H as CitationMarker, O as QUOTATIONS_CLASS, de as annotationHighlightId, be as annotationToOfficeHighlightLocations, ue as annotationsToPdfHighlights, z as gatherSameSourceAnnotations, fe as getAnnotationPdfPage, Be as getReferenceAttachmentGroups, R as groupAnnotations, L as groupAnnotationsByCitId, I as groupAnnotationsBySource, Te as injectCitationSentinels, Q as isDocxRangeSelector, ge as isExcelRcRangeSelector, me as isPptxRangeSelector, Le as isReferenceOnlyAttachment, ze as parsePdfPageReference, $ as replaceSentinelsInChildren, pe as resolveMessageAnnotations, je as stripCitTagsWhileStreaming, xe as useAnnotations, Ce as useCitationCard, G as useCitationCardContext, Ie 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.2.0-dev.219",
4
+ "version": "1.2.0-dev.225",
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.219",
26
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.225",
27
27
  "@epam/ai-dial-ui-kit": "^0.15.0-dev.27"
28
28
  },
29
29
  "repository": {
@@ -35,10 +35,13 @@ export declare const annotationsToPdfHighlights: (annotations: Annotation[]) =>
35
35
  */
36
36
  export declare const annotationHighlightId: (annotation: Annotation, fallbackIndex: number) => string;
37
37
  /**
38
- * Returns the first positive integer PDF page in the annotation's body selectors,
39
- * or `undefined` when none exists. Recognizes `pdf_bbox` selectors and both
40
- * `pdf_region` coordinate forms; a page is returned only for a selector whose
41
- * geometry also validates (see `readPdfSelectorBox`).
38
+ * Returns the PDF page to open for the annotation, or `undefined` when none
39
+ * exists. Recognizes `pdf_bbox` selectors and both `pdf_region` coordinate
40
+ * forms. The first selector whose geometry validates wins (see
41
+ * `readPdfSelectorBox`), so the page matches the selected highlight; when no
42
+ * selector has valid geometry, the first `pdf_bbox`/`pdf_region` selector
43
+ * with a positive integer `page` is used, so a page-only selector still
44
+ * navigates without a highlight.
42
45
  */
43
46
  export declare const getAnnotationPdfPage: (annotation: Annotation) => number | undefined;
44
47
  /**
@@ -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;AAgL1E;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,aAAa,UAAU,EAAE,KACxB,kBAAkB,EAoBjB,CAAC;AAEL;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,UAAU,EACtB,eAAe,MAAM,KACpB,MAG+D,CAAC;AAEnE;;;;;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"}
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;AAmM1E;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,aAAa,UAAU,EAAE,KACxB,kBAAkB,EAoBjB,CAAC;AAEL;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,UAAU,EACtB,eAAe,MAAM,KACpB,MAG+D,CAAC;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAC/B,YAAY,UAAU,KACrB,MAAM,GAAG,SAeX,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"}