@epam/ai-dial-quotations 1.2.0-dev.28 → 1.2.0-dev.284

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.
@@ -17,6 +17,10 @@ export interface CitationCardLabels {
17
17
  openInBrowser: string;
18
18
  /** Label for the "Download" button. */
19
19
  download: string;
20
+ /** Label for the toggle that expands a quote cut off at the collapsed height. */
21
+ showMore: string;
22
+ /** Label for the toggle that collapses an expanded quote. */
23
+ showLess: string;
20
24
  }
21
25
  /** Color overrides for `CitationCard`, applied as CSS custom properties with app theme fallbacks. */
22
26
  export interface CitationCardColors {
@@ -60,7 +64,13 @@ export interface CitationCardProps {
60
64
  onPreview?: (annotation: Annotation) => void;
61
65
  /** Called when the user clicks the "Open in browser"/"Download" button. */
62
66
  onOpenInBrowser: (annotation: Annotation) => void;
63
- /** Optional icon rendered before the source name in the card header. */
67
+ /** Whether a previewable file shows the "Download" button. Web links keep "Open in browser" regardless. Defaults to `true`. */
68
+ isDownloadEnabled?: boolean;
69
+ /**
70
+ * Optional icon rendered before the header text (the file extension for a
71
+ * previewable file, otherwise the source name). When omitted, a previewable
72
+ * file gets the UI kit's `FileIcon` glyph for its extension.
73
+ */
64
74
  headerIcon?: ReactNode;
65
75
  /** User-visible strings. */
66
76
  labels: CitationCardLabels;
@@ -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;AAe5D,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtC,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,CA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DropdownProps {
12
12
  * group has nothing previewable — the "Preview" button is hidden.
13
13
  */
14
14
  onPreview?: (annotation: Annotation) => void;
15
+ /** Whether the host can preview the active annotation. Defaults to allowing preview when `onPreview` is provided. */
16
+ isPreviewable?: (annotation: Annotation) => boolean;
15
17
  /** Called when the user clicks "Open in browser" for an annotation. */
16
18
  onOpenInBrowser: (annotation: Annotation) => void;
19
+ /** Whether the card shows the "Download" button for a previewable file. Defaults to `true`. */
20
+ isDownloadEnabled?: boolean;
21
+ /** Whether the host's preview panel is open; a marker click then previews the active annotation directly instead of showing the card. Defaults to `false`. */
22
+ isPreviewOpen?: boolean;
17
23
  /** Optional icon rendered before the marker's label. */
18
24
  icon?: ReactNode;
19
25
  /** Optional icon rendered in the card header. When absent, no header icon is shown. */
@@ -27,6 +33,6 @@ export interface CitationDropdownProps {
27
33
  /** Typography class forwarded to the marker's label text. Defaults to `'dial-caption-text'`. */
28
34
  markerLabelClassName?: string;
29
35
  }
30
- /** Combines `CitationMarker` and `CitationCard` into a tooltip-based dropdown. Requires a `CitationCardProvider` ancestor. */
36
+ /** Combines `CitationMarker` and `CitationCard` into a click-opened popover. Requires a `CitationCardProvider` ancestor. */
31
37
  export declare const CitationDropdown: FC<CitationDropdownProps>;
32
38
  //# 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;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"}
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,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,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,CA4GtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CitationMarker.d.ts","sourceRoot":"","sources":["../../../src/components/CitationMarker/CitationMarker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtC,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4BAA4B;IAC5B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,sEAAsE;AACtE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAwBlD,CAAC"}
1
+ {"version":3,"file":"CitationMarker.d.ts","sourceRoot":"","sources":["../../../src/components/CitationMarker/CitationMarker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtC,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4BAA4B;IAC5B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,sEAAsE;AACtE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA6BlD,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const QUOTATIONS_CLASS: {
2
+ /** The citation card's `role="dialog"` root, which carries the themed CSS variables. */
3
+ readonly citationCard: "dial-quotations-citation-card";
4
+ /** The floating panel a `CitationDropdown` reveals, which holds the card. */
5
+ readonly citationDropdown: "dial-quotations-citation-dropdown";
6
+ /**
7
+ * The marker pill that opens a citation, additive to the
8
+ * `dial-kit-base-button` that `@epam/ai-dial-ui-kit` draws. The pill caps its
9
+ * own width and ellipsises a long source name, so a host widening it should
10
+ * override `max-inline-size` here rather than unset the truncation.
11
+ */
12
+ readonly citationMarker: "dial-quotations-citation-marker";
13
+ };
14
+ //# sourceMappingURL=public-class-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB;IAC3B,wFAAwF;;IAExF,6EAA6E;;IAE7E;;;;;OAKG;;CAEK,CAAC"}
@@ -7,8 +7,14 @@ import { AnnotationGroup } from '../../utils/group-annotations-by-source';
7
7
  export interface UseCitationMarkdownComponentsCallbacks {
8
8
  /** Called when a citation marker's preview action is invoked, with the clicked annotation and its group. */
9
9
  onPreview(annotation: Annotation, group: AnnotationGroup): void;
10
+ /** Whether the host can preview an annotation. Defaults to allowing preview. */
11
+ isPreviewable?(annotation: Annotation): boolean;
10
12
  /** Called when a citation marker's open-in-browser action is invoked. */
11
13
  onOpenInBrowser(annotation: Annotation): void;
14
+ /** Whether citation cards show the "Download" button for a previewable file. Defaults to `true`. */
15
+ isDownloadEnabled?: boolean;
16
+ /** Whether the host's preview panel is open; a marker click then previews directly instead of showing the card. Defaults to `false`. */
17
+ isPreviewOpen?: boolean;
12
18
  /** Builds the translated label bundles used by a given citation group's card and marker. */
13
19
  buildLabels(group: AnnotationGroup): {
14
20
  cardLabels: CitationCardLabels;
@@ -40,8 +46,14 @@ export interface UseCitationMarkdownComponentsCallbacks {
40
46
  * `isCompactTypography` drops the paragraph class one type-scale step, matching
41
47
  * `COMPACT_MARKDOWN_CLASS_NAMES` so cited and uncited paragraphs stay the same
42
48
  * size.
49
+ *
50
+ * `fallbackGroups` is an optional pool of groups that do not belong to this
51
+ * message, consulted only to resolve a `<cit data-id="…">` element the
52
+ * message's own `groups` do not cover. It never affects sentinel injection or
53
+ * `processedContent`, so a foreign group cannot shift a marker position in
54
+ * this message's text; a colliding id is always resolved from `groups`.
43
55
  */
44
- export declare const useCitationMarkdownComponents: (content: string, groups: AnnotationGroup[], callbacks: UseCitationMarkdownComponentsCallbacks, isStreaming?: boolean, isCompactTypography?: boolean) => {
56
+ export declare const useCitationMarkdownComponents: (content: string, groups: AnnotationGroup[], callbacks: UseCitationMarkdownComponentsCallbacks, isStreaming?: boolean, isCompactTypography?: boolean, fallbackGroups?: AnnotationGroup[]) => {
45
57
  processedContent: string;
46
58
  markdownComponents: Components;
47
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useCitationMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,2BAA2B,CAAC;AAEnC,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;AAO3F,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;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,QAAQ,eAAe,EAAE,EACzB,WAAW,sCAAsC,EACjD,qBAAmB,EACnB,6BAA2B,KAC1B;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,UAAU,CAAA;CA8F5D,CAAC"}
1
+ {"version":3,"file":"useCitationMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,2BAA2B,CAAC;AAEnC,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;AAO3F,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,gFAAgF;IAChF,aAAa,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAChD,yEAAyE;IACzE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9C,oGAAoG;IACpG,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wIAAwI;IACxI,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4FAA4F;IAC5F,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG;QACnC,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CACH;AAwCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,QAAQ,eAAe,EAAE,EACzB,WAAW,sCAAsC,EACjD,qBAAmB,EACnB,6BAA2B,EAC3B,iBAAgB,eAAe,EAA0B,KACxD;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,UAAU,CAAA;CAoH5D,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))}._content_xzs0h_1>svg{fill:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc));stroke:#0000}
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}.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))}
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\.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)}.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-\[1\.5em\]{padding-inline-start:1.5em}.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,8 +13,9 @@ 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';
20
+ export { QUOTATIONS_CLASS } from './constants/public-class-names';
20
21
  //# sourceMappingURL=index.d.ts.map
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,EAA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AC"}
package/index.js CHANGED
@@ -1,158 +1,300 @@
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, 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
- import { IconChevronLeft as m, IconChevronRight as h } from "@tabler/icons-react";
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, useId as S, useMemo as C, useState as w } from "react";
6
- var T = {
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
+ import { IconChevronLeft as _, IconChevronRight as v } from "@tabler/icons-react";
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 w, useState as T } from "react";
5
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
6
+ //#region src/constants/public-class-names.ts
7
+ var k = {
8
+ citationCard: "dial-quotations-citation-card",
9
+ citationDropdown: "dial-quotations-citation-dropdown",
10
+ citationMarker: "dial-quotations-citation-marker"
11
+ }, A = (e) => {
12
+ try {
13
+ return decodeURIComponent(e);
14
+ } catch {
15
+ return e;
16
+ }
17
+ }, j = (e) => {
18
+ try {
19
+ let t = new URL(e);
20
+ return t.pathname.split("/").map((e) => A(e)).filter(Boolean).at(-1) ?? t.hostname;
21
+ } catch {
22
+ return e.split("/").map((e) => A(e)).filter(Boolean).at(-1) ?? e;
23
+ }
24
+ }, M = /\.([a-z0-9]{1,10})$/i, N = (e) => {
25
+ let t = e == null ? null : M.exec(e.trim());
26
+ return t == null ? void 0 : `.${t[1].toLowerCase()}`;
27
+ }, ne = (e) => {
28
+ let t = e.body?.source?.attachment, n = t?.url;
29
+ return (n == null ? void 0 : N(j(n))) ?? N(t?.title);
30
+ }, P = (e, t) => e.body?.source?.attachment?.title ?? j(t), F = (e) => {
31
+ let t = e.target?.selector;
32
+ return t?.type === "html_tag" ? t : void 0;
33
+ }, re = (e) => F(e) != null, I = (e) => {
34
+ let t = /* @__PURE__ */ new Map();
35
+ for (let n of e) {
36
+ if (re(n)) continue;
37
+ let e = n.body?.source?.attachment?.url;
38
+ if (e == null) continue;
39
+ let r = t.get(e);
40
+ r ? r.annotations.push(n) : t.set(e, {
41
+ groupKey: e,
42
+ sourceUrl: e,
43
+ sourceName: P(n, e),
44
+ annotations: [n],
45
+ primaryAnnotation: n
46
+ });
47
+ }
48
+ return Array.from(t.values());
49
+ }, L = (e) => {
50
+ let t = /* @__PURE__ */ new Map();
51
+ for (let n of e) {
52
+ let e = F(n)?.id;
53
+ if (e == null) continue;
54
+ let r = n.body?.source?.attachment?.url;
55
+ if (r == null) continue;
56
+ let i = t.get(e);
57
+ i ? i.annotations.push(n) : t.set(e, {
58
+ groupKey: `cit:${e}`,
59
+ sourceUrl: r,
60
+ sourceName: P(n, r),
61
+ annotations: [n],
62
+ primaryAnnotation: n
63
+ });
64
+ }
65
+ return Array.from(t.values());
66
+ }, ie = (e) => [...L(e), ...I(e)], R = (e, t) => {
67
+ let n = e.body?.source?.attachment?.url;
68
+ return n == null || !t.includes(e) ? [e] : t.filter((e) => e.body?.source?.attachment?.url === n);
69
+ }, z = {
7
70
  card: "_card_1kph1_1",
8
71
  quote: "_quote_1kph1_5",
9
72
  title: "_title_1kph1_9",
10
73
  switcher: "_switcher_1kph1_13",
11
74
  sourceName: "_sourceName_1kph1_17"
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
- "--cc-card-bg": x?.cardBackground,
15
- "--cc-quote-text": x?.quoteText,
16
- "--cc-title-text": x?.titleText,
17
- "--cc-switcher-text": x?.switcherText,
18
- "--cc-source-name-text": x?.sourceNameText
19
- });
20
- return /* @__PURE__ */ v("div", {
75
+ }, B = ({ group: r, activeIndex: a, onIndexChange: o, onPreview: l, onOpenInBrowser: h, isDownloadEnabled: y = !0, headerIcon: b, labels: x, typography: C, colors: E }) => {
76
+ let A = r.annotations.length, j = r.annotations[a] ?? r.primaryAnnotation, M = A > 1, N = j.body?.source?.attachment?.type, P = l == null || N === e.HTML || N === e.XHTML, F = P ? void 0 : ne(j), re = F ?? r.sourceName, I = b ?? (F == null ? void 0 : /* @__PURE__ */ D(f, {
77
+ type: c.File,
78
+ name: F,
79
+ fileExtension: F,
80
+ size: 16,
81
+ decorative: !0,
82
+ className: "shrink-0"
83
+ })), L = C?.sourceNameClassName ?? "dial-tiny-text", ie = C?.titleClassName ?? "dial-body-semi-text", R = C?.quoteClassName ?? "dial-small-text", B = C?.quoteStrongClassName ?? "dial-small-semi-text", V = C?.switcherClassName ?? "dial-tiny-text", H = n({
84
+ "--cc-card-bg": E?.cardBackground,
85
+ "--cc-quote-text": E?.quoteText,
86
+ "--cc-title-text": E?.titleText,
87
+ "--cc-switcher-text": E?.switcherText,
88
+ "--cc-source-name-text": E?.sourceNameText
89
+ }), U = j.body?.quote, W = ee(), G = w(null), [K, q] = T(!1), [J, Y] = T(!1);
90
+ return S(() => {
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
+ t();
97
+ let n = new ResizeObserver(t);
98
+ return n.observe(e), () => n.disconnect();
99
+ }, [U, K]), /* @__PURE__ */ O("div", {
21
100
  role: "dialog",
22
101
  "aria-modal": "true",
23
- "aria-label": y.ariaLabel,
24
- style: N,
25
- className: i("flex w-[400px] flex-col gap-3 rounded-lg p-4 shadow-lg", T.card),
102
+ "aria-label": x.ariaLabel,
103
+ style: H,
104
+ className: i("flex w-[400px] max-w-full flex-col gap-3 rounded-lg p-4 shadow-lg", z.card, k.citationCard),
26
105
  children: [
27
- /* @__PURE__ */ v("div", {
106
+ /* @__PURE__ */ O("div", {
28
107
  className: "flex items-center justify-between gap-2",
29
- children: [/* @__PURE__ */ v("div", {
108
+ children: [/* @__PURE__ */ O("div", {
30
109
  className: "flex min-w-0 items-center gap-1",
31
- children: [g, /* @__PURE__ */ _(l, {
32
- text: r.sourceName,
33
- className: i(O, "min-w-0", T.sourceName)
110
+ children: [I, /* @__PURE__ */ D(d, {
111
+ text: re,
112
+ className: i(L, "min-w-0", z.sourceName)
34
113
  })]
35
- }), w && /* @__PURE__ */ v("div", {
114
+ }), M && /* @__PURE__ */ O("div", {
36
115
  className: "flex shrink-0 items-center gap-1",
37
116
  children: [
38
- /* @__PURE__ */ _(u, {
39
- icon: /* @__PURE__ */ _(m, {
117
+ /* @__PURE__ */ D(p, {
118
+ icon: /* @__PURE__ */ D(_, {
40
119
  size: 14,
41
120
  className: "rtl:scale-x-[-1]",
42
121
  stroke: s
43
122
  }),
44
- size: c.Small,
45
- "aria-label": y.previousCitation,
46
- onClick: () => o((a - 1 + S) % S)
123
+ size: u.Small,
124
+ "aria-label": x.previousCitation,
125
+ onClick: () => o((a - 1 + A) % A)
47
126
  }),
48
- /* @__PURE__ */ _("span", {
49
- className: i(M, T.switcher),
50
- children: y.formatSwitcherText(a + 1, S)
127
+ /* @__PURE__ */ D("span", {
128
+ className: i(V, z.switcher),
129
+ children: x.formatSwitcherText(a + 1, A)
51
130
  }),
52
- /* @__PURE__ */ _(u, {
53
- icon: /* @__PURE__ */ _(h, {
131
+ /* @__PURE__ */ D(p, {
132
+ icon: /* @__PURE__ */ D(v, {
54
133
  size: 14,
55
134
  className: "rtl:scale-x-[-1]",
56
135
  stroke: s
57
136
  }),
58
- size: c.Small,
59
- "aria-label": y.nextCitation,
60
- onClick: () => o((a + 1) % S)
137
+ size: u.Small,
138
+ "aria-label": x.nextCitation,
139
+ onClick: () => o((a + 1) % A)
61
140
  })
62
141
  ]
63
142
  })]
64
143
  }),
65
- (C.body?.title || C.body?.quote || w) && /* @__PURE__ */ v("div", {
144
+ (j.body?.title || j.body?.quote || M) && /* @__PURE__ */ O("div", {
66
145
  className: "flex flex-col gap-3",
67
- children: [C.body?.title && /* @__PURE__ */ _("p", {
68
- className: i(k, T.title, "break-words"),
69
- children: C.body.title
70
- }), (C.body?.quote || w) && /* @__PURE__ */ _("div", {
71
- className: i(A, T.quote, "line-clamp-6 break-words", w && "min-h-[3lh]"),
72
- children: C.body?.quote && /* @__PURE__ */ _(t, {
73
- content: C.body.quote,
74
- classNames: {
75
- p: i(A, T.quote),
76
- ul: i(A, "ps-3"),
77
- ol: i(A, "ps-3"),
78
- strong: j
79
- }
80
- })
146
+ children: [j.body?.title && /* @__PURE__ */ D("p", {
147
+ className: i(ie, z.title, "break-words"),
148
+ children: j.body.title
149
+ }), (U || M) && /* @__PURE__ */ O("div", {
150
+ className: "flex flex-col items-start gap-1",
151
+ children: [/* @__PURE__ */ D("div", {
152
+ ref: G,
153
+ id: W,
154
+ tabIndex: K ? 0 : void 0,
155
+ className: i(R, z.quote, "w-full break-words", K ? "max-h-[min(20rem,50vh)] overflow-y-auto" : "line-clamp-6"),
156
+ children: U && /* @__PURE__ */ D(t, {
157
+ content: U,
158
+ classNames: {
159
+ p: i(R, z.quote),
160
+ ul: i(R, "ps-[1.5em]"),
161
+ ol: R,
162
+ strong: B
163
+ }
164
+ })
165
+ }), J && /* @__PURE__ */ D(m, {
166
+ label: K ? x.showLess : x.showMore,
167
+ size: u.Small,
168
+ "aria-expanded": K,
169
+ "aria-controls": W,
170
+ onClick: () => q((e) => !e)
171
+ })]
81
172
  })]
82
173
  }),
83
- /* @__PURE__ */ v("div", {
174
+ /* @__PURE__ */ O("div", {
84
175
  className: "flex justify-start gap-2",
85
- children: [d && /* @__PURE__ */ _(f, {
86
- label: y.preview,
87
- size: c.Small,
88
- onClick: () => d(C)
89
- }), /* @__PURE__ */ _(f, {
90
- label: D ? y.openInBrowser : y.download,
91
- size: c.Small,
92
- onClick: () => p(C)
176
+ children: [l && /* @__PURE__ */ D(g, {
177
+ label: x.preview,
178
+ size: u.Small,
179
+ onClick: () => l(j)
180
+ }), (P || y) && /* @__PURE__ */ D(g, {
181
+ label: P ? x.openInBrowser : x.download,
182
+ size: u.Small,
183
+ onClick: () => h(j)
93
184
  })]
94
185
  })
95
186
  ]
96
187
  });
97
- }, D = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: i = "dial-caption-text" }) => {
98
- let a = /* @__PURE__ */ v("span", {
99
- className: "flex items-center gap-1",
100
- children: [n, /* @__PURE__ */ _("span", {
101
- className: i,
102
- children: e > 1 ? r.labelWithOverflow : r.label
103
- })]
104
- });
105
- return /* @__PURE__ */ _(d, {
106
- size: c.Small,
107
- label: a,
108
- "aria-label": r.ariaLabel,
109
- onClick: t
110
- });
111
- }, O = y(null), k = O.Provider, A = () => {
112
- let e = x(O);
188
+ }, V = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: a = "dial-caption-text" }) => /* @__PURE__ */ D(h, {
189
+ size: u.Small,
190
+ className: i("max-w-[240px]", k.citationMarker),
191
+ textClassName: "min-w-0 truncate",
192
+ iconBefore: n,
193
+ label: /* @__PURE__ */ D("span", {
194
+ className: a,
195
+ children: e > 1 ? r.labelWithOverflow : r.label
196
+ }),
197
+ "aria-label": r.ariaLabel,
198
+ onClick: t
199
+ }), H = y(null), U = H.Provider, W = () => {
200
+ let e = x(H);
113
201
  if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
114
202
  return e;
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);
203
+ }, G = { trigger: "_trigger_1ud83_1" }, K = ({ group: e, onPreview: t, isPreviewable: n, onOpenInBrowser: r, isDownloadEnabled: a = !0, isPreviewOpen: o = !1, icon: s, headerIcon: c, cardLabels: u, markerLabels: d, cardTypography: f, markerLabelClassName: p }) => {
204
+ let m = W(), h = ee(), g = m.isOpen(h), _ = m.getActiveIndex(e.groupKey), v = e.annotations[_] ?? e.primaryAnnotation, y = n?.(v) ?? !0, x = b((e) => {
205
+ e || m.closePopup(h);
206
+ }, [m, h]), S = C(() => t && y ? (e) => {
207
+ t(e), m.closePopup(h);
120
208
  } : void 0, [
121
209
  t,
210
+ y,
211
+ m,
212
+ h
213
+ ]), te = b(() => {
214
+ if (o && S) {
215
+ S(v);
216
+ return;
217
+ }
218
+ m.openPopup(h);
219
+ }, [
220
+ o,
221
+ S,
222
+ v,
223
+ m,
224
+ h
225
+ ]), w = b(() => /* @__PURE__ */ D(B, {
226
+ group: e,
227
+ activeIndex: _,
228
+ onIndexChange: (t) => m.setActiveIndex(e.groupKey, t),
229
+ onPreview: S,
230
+ onOpenInBrowser: r,
231
+ isDownloadEnabled: a,
232
+ headerIcon: c,
233
+ labels: u,
234
+ typography: f
235
+ }), [
236
+ e,
237
+ _,
238
+ m,
239
+ S,
240
+ r,
241
+ a,
242
+ c,
122
243
  u,
123
- d
244
+ f
124
245
  ]);
125
- return /* @__PURE__ */ _(p, {
126
- open: f,
127
- onOpenChange: h,
128
- triggerClassName: "ms-1 inline-flex align-middle",
129
- contentClassName: i("!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none", j.content),
130
- tooltip: /* @__PURE__ */ _(E, {
131
- group: e,
132
- activeIndex: m,
133
- onIndexChange: (t) => u.setActiveIndex(e.groupKey, t),
134
- onPreview: g,
135
- onOpenInBrowser: n,
136
- headerIcon: a,
137
- labels: o,
138
- typography: c
139
- }),
140
- children: /* @__PURE__ */ _(D, {
246
+ return /* @__PURE__ */ D(l, {
247
+ open: g,
248
+ onOpenChange: x,
249
+ trigger: [],
250
+ placement: "bottom-end",
251
+ matchReferenceWidth: !1,
252
+ className: i("ms-1 inline-flex align-middle", G.trigger),
253
+ listClassName: i("!p-0 !bg-transparent !shadow-none !rounded-none", k.citationDropdown),
254
+ renderOverlay: w,
255
+ children: /* @__PURE__ */ D(V, {
141
256
  sourceName: e.sourceName,
142
257
  annotationCount: e.annotations.length,
143
- onOpen: () => u.openPopup(d),
144
- icon: r,
145
- labels: s,
146
- labelClassName: l
258
+ onOpen: te,
259
+ icon: s,
260
+ labels: d,
261
+ labelClassName: p
147
262
  })
148
263
  });
149
- }, N = {
264
+ }, q = (e) => {
265
+ let t = e.trim();
266
+ if (!t.startsWith("|") || !t.endsWith("|") || /[\r\n]/.test(t)) return;
267
+ let n = [], r = "";
268
+ for (let e = 1; e < t.length; e += 1) {
269
+ let i = t[e], a = t[e + 1];
270
+ i === "\\" && a != null && /[!-/:-@[-`{-~]/.test(a) ? (r += a, e += 1) : i === "|" ? (n.push(r.trim()), r = "") : r += i;
271
+ }
272
+ if (!(r !== "" || n.length < 2 || n.every((e) => e === "" || /^:?-{3,}:?$/.test(e)))) return n;
273
+ }, J = (e) => {
274
+ if (e.type !== "docx_text_anchor" && e.type !== "pptx_text_anchor") return;
275
+ let { text: t, occurrence: n, slide: r } = e;
276
+ if (typeof t != "string" || typeof n != "number" || !Number.isSafeInteger(n) || n < 1) return;
277
+ let i = q(t);
278
+ if (i != null) {
279
+ if (e.type === "docx_text_anchor") return {
280
+ type: "docx_text_anchor",
281
+ cells: i,
282
+ occurrence: n
283
+ };
284
+ if (!(typeof r != "number" || !Number.isSafeInteger(r) || r < 1)) return {
285
+ type: "pptx_text_anchor",
286
+ cells: i,
287
+ occurrence: n,
288
+ slide: r
289
+ };
290
+ }
291
+ }, Y = {
150
292
  backgroundColor: "transparent",
151
293
  borderColor: "var(--stroke-accent, #1D4ED8)",
152
294
  borderWidth: "2px",
153
295
  opacity: .5,
154
296
  hoverOpacity: .5
155
- }, ee = (e) => {
297
+ }, ae = (e) => {
156
298
  if (typeof e != "object" || !e) return;
157
299
  let t = e, { lt: n, wh: r } = t;
158
300
  if (Array.isArray(n) && Array.isArray(r) && n.length >= 2 && r.length >= 2) {
@@ -171,7 +313,7 @@ var T = {
171
313
  x2: i + o,
172
314
  y2: a + s
173
315
  };
174
- }, P = (e) => {
316
+ }, X = (e) => {
175
317
  if (!r(e)) return;
176
318
  let t = e, n;
177
319
  if (t.type === "pdf_bbox") {
@@ -182,7 +324,7 @@ var T = {
182
324
  x2: i,
183
325
  y2: a
184
326
  });
185
- } else t.type === "pdf_region" && (n = ee(t.bbox));
327
+ } else t.type === "pdf_region" && (n = ae(t.bbox));
186
328
  if (n == null) return;
187
329
  let i = t.page;
188
330
  if (!(typeof i != "number" || !Number.isInteger(i) || i < 1) && [
@@ -197,48 +339,73 @@ var T = {
197
339
  x2: n.x2,
198
340
  y2: n.y2
199
341
  };
200
- }, F = (e) => e.flatMap((e, t) => {
342
+ }, oe = (e) => {
343
+ if (!r(e)) return;
344
+ let t = e;
345
+ if (t.type !== "pdf_bbox" && t.type !== "pdf_region") return;
346
+ let n = t.page;
347
+ return typeof n == "number" && Number.isInteger(n) && n >= 1 ? n : void 0;
348
+ }, 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) => {
349
+ let t = 5381;
350
+ for (let n = 0; n < e.length; n += 1) t = t * 33 + e.charCodeAt(n) | 0;
351
+ return (t >>> 0).toString(36);
352
+ }, ce = (e) => {
353
+ let t = e.body?.selector;
354
+ if (t == null) return;
355
+ let n = (Array.isArray(t) ? t : [t]).flatMap((e) => {
356
+ let t = X(e);
357
+ return t == null ? [] : [t];
358
+ }), r = xe(e);
359
+ if (!(n.length === 0 && r.length === 0)) return Z([n, r]);
360
+ }, le = (e) => {
361
+ let t = e.target?.selector, n = t?.type === "html_tag" ? t.id : void 0, r = typeof n == "string" ? n : void 0, i = ce(e);
362
+ if (!(r == null && i == null)) return se(`${r ?? ""}|${i ?? ""}`);
363
+ }, ue = (e) => e.flatMap((e, t) => {
201
364
  let n = e.body?.selector;
202
365
  if (n == null) return [];
203
366
  let i = (Array.isArray(n) ? n : [n]).flatMap((e) => {
204
367
  if (!r(e)) return [];
205
- let t = P(e);
368
+ let t = X(e);
206
369
  return t == null ? [] : [t];
207
370
  });
208
371
  return i.length === 0 ? [] : [{
209
- id: String(e.index ?? t),
372
+ id: de(e, t),
210
373
  bboxes: i,
211
- style: N
374
+ style: Y
212
375
  }];
213
- }), te = (e, t) => String(e.index ?? t), ne = (e) => {
376
+ }), de = (e, t) => e.index == null ? le(e) ?? String(t) : String(e.index), fe = (e) => {
214
377
  let t = e.body?.selector;
215
378
  if (t == null) return;
216
379
  let n = Array.isArray(t) ? t : [t];
217
380
  for (let e of n) {
218
381
  if (!r(e)) continue;
219
- let t = P(e);
382
+ let t = X(e);
220
383
  if (t != null) return t.page;
221
384
  }
222
- }, I = (e) => {
385
+ for (let e of n) {
386
+ let t = oe(e);
387
+ if (t != null) return t;
388
+ }
389
+ }, pe = (e) => {
223
390
  let t = e.custom_content?.annotations;
224
391
  if (t?.length) return t.filter((e) => e != null && e.body?.source?.attachment?.url != null).map(a);
225
392
  let n = e.custom_fields;
226
393
  if (typeof n != "object" || !n) return [];
227
394
  let r = n.annotations;
228
395
  return !Array.isArray(r) || r.length === 0 ? [] : o(r, e.custom_content?.attachments ?? []).map(a);
229
- }, L = (e) => {
396
+ }, me = (e) => {
230
397
  if (e.type !== "docx_text_range") return !1;
231
398
  let t = e;
232
399
  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";
233
- }, R = (e) => {
400
+ }, he = (e) => {
234
401
  if (e.type !== "pptx_text_range") return !1;
235
402
  let t = e;
236
403
  return typeof t.slide == "number" && typeof t.shape_id == "string" && typeof t.start == "number" && typeof t.end == "number" && typeof t.text == "string";
237
- }, z = (e) => typeof e == "object" && !!e && typeof e.row == "number" && typeof e.col == "number", B = (e) => {
404
+ }, ge = (e) => typeof e == "object" && !!e && typeof e.row == "number" && typeof e.col == "number", _e = (e) => {
238
405
  if (e.type !== "excel_rc_range") return !1;
239
406
  let t = e;
240
- return typeof t.sheet == "string" && z(t.start) && (t.end === void 0 || t.end === null || z(t.end));
241
- }, re = (e) => {
407
+ return typeof t.sheet == "string" && ge(t.start) && (t.end === void 0 || t.end === null || ge(t.end));
408
+ }, ve = (e) => {
242
409
  let { story: t, path: n, start: r, end: i, text: a } = e;
243
410
  if (!(!n.every((e) => Number.isInteger(e)) || !Number.isInteger(r) || !Number.isInteger(i) || r < 0 || i < r)) return {
244
411
  type: "docx_text_range",
@@ -248,7 +415,7 @@ var T = {
248
415
  endExclusive: i,
249
416
  text: a
250
417
  };
251
- }, ie = (e) => {
418
+ }, ye = (e) => {
252
419
  let { slide: t, shape_id: n, start: r, end: i, text: a } = e;
253
420
  if (!(!Number.isInteger(t) || t < 1 || !Number.isInteger(r) || !Number.isInteger(i) || r < 0 || i < r)) return {
254
421
  type: "pptx_text_range",
@@ -258,7 +425,7 @@ var T = {
258
425
  endExclusive: i,
259
426
  text: a
260
427
  };
261
- }, ae = (e) => {
428
+ }, be = (e) => {
262
429
  let { sheet: t, start: n, end: r } = e;
263
430
  if (!(t.length === 0 || !Number.isInteger(n.row) || !Number.isInteger(n.col) || n.row < 1 || n.col < 1)) {
264
431
  if (r == null) return {
@@ -273,29 +440,30 @@ var T = {
273
440
  end: r
274
441
  };
275
442
  }
276
- }, oe = (e) => {
443
+ }, xe = (e) => {
277
444
  let t = e.body?.selector;
278
445
  return t == null ? [] : (Array.isArray(t) ? t : [t]).flatMap((e) => {
279
446
  if (!r(e)) return [];
280
- if (L(e)) {
281
- let t = re(e);
447
+ if (me(e)) {
448
+ let t = ve(e);
282
449
  return t ? [t] : [];
283
450
  }
284
- if (R(e)) {
285
- let t = ie(e);
451
+ if (he(e)) {
452
+ let t = ye(e);
286
453
  return t ? [t] : [];
287
454
  }
288
- if (B(e)) {
289
- let t = ae(e);
455
+ if (_e(e)) {
456
+ let t = be(e);
290
457
  return t ? [t] : [];
291
458
  }
292
- return [];
459
+ let t = J(e);
460
+ return t ? [t] : [];
293
461
  });
294
- }, se = (e, t) => C(() => t ? [] : I(e), [t, e]), ce = {
462
+ }, Se = (e, t) => C(() => t ? [] : pe(e), [t, e]), Ce = {
295
463
  openOwnerKey: null,
296
464
  activeIndexByGroup: {}
297
- }, le = () => {
298
- let [e, t] = w(ce), n = b((e) => {
465
+ }, we = () => {
466
+ let [e, t] = T(Ce), n = b((e) => {
299
467
  t((t) => ({
300
468
  ...t,
301
469
  openOwnerKey: e
@@ -326,7 +494,7 @@ var T = {
326
494
  i,
327
495
  e
328
496
  ]);
329
- }, V = /⟦C(\d+)⟧/g, H = (e, t) => {
497
+ }, Te = /⟦C(\d+)⟧/g, Ee = (e, t) => {
330
498
  let n = t.map((e, t) => ({
331
499
  g: e,
332
500
  idx: t
@@ -339,9 +507,9 @@ var T = {
339
507
  }).sort((e, t) => t.pos - e.pos), r = e;
340
508
  for (let { idx: e, pos: t } of n) r = `${r.slice(0, t)}⟦C${e}⟧${r.slice(t)}`;
341
509
  return r;
342
- }, U = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>/g, ue = /^<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>$/, de = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>|<\/?cit\b[^>]*>|<\/?cit\b[^>]*$/gi, fe = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), W = (e) => e.replace(de, (e) => ue.test(e) ? e : fe(e)), G = (e) => W(e).replace(U, ""), K = (e, t) => {
510
+ }, De = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>/g, Oe = /^<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>$/, ke = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>|<\/?cit\b[^>]*>|<\/?cit\b[^>]*$/gi, Ae = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), je = (e) => e.replace(ke, (e) => Oe.test(e) ? e : Ae(e)), Me = (e) => je(e).replace(De, ""), Q = (e, t) => {
343
511
  if (typeof e == "string") {
344
- let n = e.split(V);
512
+ let n = e.split(Te);
345
513
  if (n.length === 1) return e;
346
514
  let r = [];
347
515
  return n.forEach((e, n) => {
@@ -349,57 +517,64 @@ var T = {
349
517
  }), r;
350
518
  }
351
519
  return Array.isArray(e) ? e.flatMap((e) => {
352
- let n = K(e, t);
520
+ let n = Q(e, t);
353
521
  return Array.isArray(n) ? n : [n];
354
522
  }) : e;
355
- }, pe = (e) => {
523
+ }, Ne = {}, Pe = [], $ = (e) => {
356
524
  let t = e.primaryAnnotation.target?.selector;
357
525
  return t?.type === "html_tag" ? t.id : void 0;
358
- }, me = (e, t) => /* @__PURE__ */ v(g, { children: [
526
+ }, Fe = (e, t) => /* @__PURE__ */ O(E, { children: [
359
527
  e == null ? "<cit>" : `<cit data-id="${e}">`,
360
528
  t,
361
529
  "</cit>"
362
- ] }), he = (e, t, n, r = !1, a = !1) => {
363
- let { onPreview: o, onOpenInBrowser: s, buildLabels: c } = n, l = C(() => r ? G(e) : W(t.length > 0 ? H(e, t) : e), [
530
+ ] }), Ie = (e, t, n, r = !1, a = !1, o = Pe) => {
531
+ let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, isDownloadEnabled: u = !0, isPreviewOpen: d = !1, buildLabels: f } = n, p = C(() => r ? Me(e) : je(t.length > 0 ? Ee(e, t) : e), [
364
532
  e,
365
533
  t,
366
534
  r
367
- ]), u = l.includes("<cit");
535
+ ]), m = p.includes("<cit");
368
536
  return {
369
- processedContent: l,
537
+ processedContent: p,
370
538
  markdownComponents: C(() => {
371
539
  let e = /* @__PURE__ */ new Map();
540
+ for (let t of o) {
541
+ let n = $(t);
542
+ n != null && e.set(n, t);
543
+ }
372
544
  for (let n of t) {
373
- let t = pe(n);
545
+ let t = $(n);
374
546
  t != null && e.set(t, n);
375
547
  }
376
548
  let n = (e) => {
377
- let { cardLabels: t, markerLabels: n } = c(e);
378
- return /* @__PURE__ */ _(M, {
549
+ let { cardLabels: t, markerLabels: n } = f(e);
550
+ return /* @__PURE__ */ D(K, {
379
551
  group: e,
380
- onPreview: (t) => o(t, e),
381
- onOpenInBrowser: s,
552
+ onPreview: (t) => s(t, e),
553
+ isPreviewable: c,
554
+ onOpenInBrowser: l,
555
+ isDownloadEnabled: u,
556
+ isPreviewOpen: d,
382
557
  cardLabels: t,
383
558
  markerLabels: n
384
559
  }, `citation-${e.groupKey}`);
385
560
  }, r = (e) => {
386
561
  let r = t[e];
387
562
  return r ? n(r) : null;
388
- }, l = { cit: (t) => {
563
+ }, p = { cit: (t) => {
389
564
  let r = t["data-id"] == null ? void 0 : e.get(t["data-id"]);
390
- return r ? n(r) : me(t["data-id"], t.children);
565
+ return r ? n(r) : Fe(t["data-id"], t.children);
391
566
  } };
392
- return t.length === 0 ? u ? l : {} : {
393
- ...l,
394
- p: ({ children: e, ...t }) => /* @__PURE__ */ _("p", {
567
+ return t.length === 0 && o.length === 0 ? m ? p : Ne : {
568
+ ...p,
569
+ p: ({ children: e, ...t }) => /* @__PURE__ */ D("p", {
395
570
  ...t,
396
571
  className: i(a ? "dial-small-paragraph-text" : "dial-body-paragraph-text", "mb-3 [overflow-wrap:anywhere] [text-wrap:pretty] last:mb-0"),
397
- children: K(e, r)
572
+ children: Q(e, r)
398
573
  }),
399
- li: ({ children: e, ...t }) => /* @__PURE__ */ _("li", {
574
+ li: ({ children: e, ...t }) => /* @__PURE__ */ D("li", {
400
575
  ...t,
401
576
  className: "mb-1.5 last:mb-0",
402
- children: K(e, r)
577
+ children: Q(e, r)
403
578
  })
404
579
  };
405
580
  }, [
@@ -407,70 +582,22 @@ var T = {
407
582
  o,
408
583
  s,
409
584
  c,
585
+ l,
586
+ u,
587
+ d,
588
+ f,
410
589
  a,
411
- u
590
+ m
412
591
  ])
413
592
  };
414
- }, q = (e) => {
415
- try {
416
- return decodeURIComponent(e);
417
- } catch {
418
- return e;
419
- }
420
- }, ge = (e) => {
421
- try {
422
- let t = new URL(e);
423
- return t.pathname.split("/").map((e) => q(e)).filter(Boolean).at(-1) ?? t.hostname;
424
- } catch {
425
- return e.split("/").map((e) => q(e)).filter(Boolean).at(-1) ?? e;
426
- }
427
- }, J = (e, t) => e.body?.source?.attachment?.title ?? ge(t), Y = (e) => {
428
- let t = e.target?.selector;
429
- return t?.type === "html_tag" ? t : void 0;
430
- }, _e = (e) => Y(e) != null, X = (e) => {
431
- let t = /* @__PURE__ */ new Map();
432
- for (let n of e) {
433
- if (_e(n)) continue;
434
- let e = n.body?.source?.attachment?.url;
435
- if (e == null) continue;
436
- let r = t.get(e);
437
- r ? r.annotations.push(n) : t.set(e, {
438
- groupKey: e,
439
- sourceUrl: e,
440
- sourceName: J(n, e),
441
- annotations: [n],
442
- primaryAnnotation: n
443
- });
444
- }
445
- return Array.from(t.values());
446
- }, Z = (e) => {
447
- let t = /* @__PURE__ */ new Map();
448
- for (let n of e) {
449
- let e = Y(n)?.id;
450
- if (e == null) continue;
451
- let r = n.body?.source?.attachment?.url;
452
- if (r == null) continue;
453
- let i = t.get(e);
454
- i ? i.annotations.push(n) : t.set(e, {
455
- groupKey: `cit:${e}`,
456
- sourceUrl: r,
457
- sourceName: J(n, r),
458
- annotations: [n],
459
- primaryAnnotation: n
460
- });
461
- }
462
- return Array.from(t.values());
463
- }, ve = (e) => [...Z(e), ...X(e)], ye = (e, t) => {
464
- let n = e.body?.source?.attachment?.url;
465
- return n == null || !t.includes(e) ? [e] : t.filter((e) => e.body?.source?.attachment?.url === n);
466
- }, Q = (e) => e.url == null && e.reference_url != null, be = /^(.*\.pdf)(?:#page=(\d+))?$/i, $ = (e) => {
467
- let t = be.exec(e);
593
+ }, Le = (e) => e.url == null && e.reference_url != null, Re = /^(.*\.pdf)(?:#page=(\d+))?$/i, ze = (e) => {
594
+ let t = Re.exec(e);
468
595
  return t ? {
469
596
  baseUrl: t[1],
470
597
  page: t[2] == null ? null : Number(t[2])
471
598
  } : null;
472
- }, xe = (t) => X((t ?? []).filter(Q).map((t) => {
473
- let n = t.reference_url, r = $(n) != null;
599
+ }, Be = (t) => I((t ?? []).filter(Le).map((t) => {
600
+ let n = t.reference_url, r = ze(n) != null;
474
601
  return { body: {
475
602
  quote: t.data,
476
603
  source: {
@@ -484,4 +611,4 @@ var T = {
484
611
  } };
485
612
  }));
486
613
  //#endregion
487
- export { E as CitationCard, k as CitationCardProvider, M as CitationDropdown, D as CitationMarker, te as annotationHighlightId, oe as annotationToOfficeHighlightLocations, F as annotationsToPdfHighlights, ye as gatherSameSourceAnnotations, ne as getAnnotationPdfPage, xe as getReferenceAttachmentGroups, ve as groupAnnotations, Z as groupAnnotationsByCitId, X as groupAnnotationsBySource, H as injectCitationSentinels, L as isDocxRangeSelector, B as isExcelRcRangeSelector, R as isPptxRangeSelector, Q as isReferenceOnlyAttachment, $ as parsePdfPageReference, K as replaceSentinelsInChildren, I as resolveMessageAnnotations, G as stripCitTagsWhileStreaming, se as useAnnotations, le as useCitationCard, A as useCitationCardContext, he as useCitationMarkdownComponents };
614
+ export { B as CitationCard, U as CitationCardProvider, K as CitationDropdown, V as CitationMarker, k as QUOTATIONS_CLASS, de as annotationHighlightId, xe as annotationToOfficeHighlightLocations, ue as annotationsToPdfHighlights, R as gatherSameSourceAnnotations, fe as getAnnotationPdfPage, Be as getReferenceAttachmentGroups, ie as groupAnnotations, L as groupAnnotationsByCitId, I as groupAnnotationsBySource, Ee as injectCitationSentinels, me as isDocxRangeSelector, _e as isExcelRcRangeSelector, he as isPptxRangeSelector, Le as isReferenceOnlyAttachment, ze as parsePdfPageReference, Q as replaceSentinelsInChildren, pe as resolveMessageAnnotations, Me as stripCitTagsWhileStreaming, Se as useAnnotations, we as useCitationCard, W as useCitationCardContext, Ie 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.28",
4
+ "version": "1.2.0-dev.284",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": "^19.2.8",
26
- "@epam/ai-dial-chat-shared": "1.2.0-dev.28",
27
- "@epam/ai-dial-ui-kit": "^0.14.2"
26
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.284",
27
+ "@epam/ai-dial-ui-kit": "^0.15.0-dev.36"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -5,17 +5,43 @@ import { OfficeHighlightLocation } from '../models/office-highlight';
5
5
  * Maps a list of annotations to `InputHighlightData` entries for the PDF viewer.
6
6
  * Recognizes `pdf_bbox` selectors and both `pdf_region` coordinate forms
7
7
  * (`lt`/`wh` and legacy `left`/`top`/`width`/`height`); annotations whose
8
- * `body.selector` contains none of these are skipped. The highlight `id` is
9
- * `annotation.index` when present, otherwise the position in the input array.
8
+ * `body.selector` contains none of these are skipped. The highlight `id` comes
9
+ * from `annotationHighlightId`, so it identifies the annotation itself rather
10
+ * than its position in this particular input list.
10
11
  */
11
12
  export declare const annotationsToPdfHighlights: (annotations: Annotation[]) => InputHighlightData[];
12
- /** Returns a stable string ID for a given annotation, matching the IDs produced by `annotationsToPdfHighlights`. */
13
+ /**
14
+ * Returns a stable string ID for a given annotation, matching the IDs
15
+ * `annotationsToPdfHighlights` produces (it calls this function) and the ones
16
+ * the Office highlight path assigns.
17
+ *
18
+ * Resolved in order:
19
+ * 1. `annotation.index` when the wire supplied one — already unique within the
20
+ * message, and short.
21
+ * 2. Otherwise an id derived from the annotation's own identity: its `cit` tag
22
+ * id plus a digest of its selectors. Two annotations differing in either
23
+ * part get different ids; two agreeing in both describe the same cited
24
+ * region and may share one.
25
+ * 3. Otherwise `fallbackIndex` — the annotation's position in the caller's
26
+ * list, for an annotation carrying neither an index, a `cit` id, nor a
27
+ * recognised selector.
28
+ *
29
+ * The id is opaque: compare it, never parse it. A position-derived id is not
30
+ * unique beyond the list it came from, which is why it is the last resort — a
31
+ * caller gathering one citation group at a time would otherwise give every
32
+ * single-annotation group the same id, and the canvas could not tell two
33
+ * citations of one document apart (issue #8907). Ids are never persisted and
34
+ * never sent over the wire.
35
+ */
13
36
  export declare const annotationHighlightId: (annotation: Annotation, fallbackIndex: number) => string;
14
37
  /**
15
- * Returns the first positive integer PDF page in the annotation's body selectors,
16
- * or `undefined` when none exists. Recognizes `pdf_bbox` selectors and both
17
- * `pdf_region` coordinate forms; a page is returned only for a selector whose
18
- * 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.
19
45
  */
20
46
  export declare const getAnnotationPdfPage: (annotation: Annotation) => number | undefined;
21
47
  /**
@@ -45,7 +71,7 @@ export declare const isExcelRcRangeSelector: (selector: AnnotationSelector) => s
45
71
  /**
46
72
  * Converts an annotation's `body.selector` (scalar or array) to validated
47
73
  * `OfficeHighlightLocation` entries, skipping any selector that is not a
48
- * recognised Office range or that fails validation — never throwing.
74
+ * recognised Office range or temporary table-row anchor, or that fails validation.
49
75
  */
50
76
  export declare const annotationToOfficeHighlightLocations: (annotation: Annotation) => OfficeHighlightLocation[];
51
77
  //# 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;AAqG1E;;;;;;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,GAC9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Qd,CAAC;AA8FF;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,GAC/C,YAAY,UAAU,KACrB,uBAAuB,EAuBzB,CAAC"}
@@ -8,7 +8,7 @@ export interface AnnotationGroup {
8
8
  * cit ids citing the same document never share popup state.
9
9
  */
10
10
  groupKey: string;
11
- /** The cited attachment's URL — used for Preview/Download. */
11
+ /** The cited attachment's URL — used for Preview/Open in browser. */
12
12
  sourceUrl: string;
13
13
  /**
14
14
  * Human-readable name derived from the URL: the last non-empty path segment
@@ -20,6 +20,8 @@ export interface AnnotationGroup {
20
20
  /** The first annotation in the group — used for the inline citation marker position. */
21
21
  primaryAnnotation: Annotation;
22
22
  }
23
+ /** Returns the cited file's extension with a leading dot (e.g. `'.pdf'`), read from its URL and then its title, or `undefined` when neither carries one. */
24
+ export declare const getSourceFileExtension: (annotation: Annotation) => string | undefined;
23
25
  /**
24
26
  * Groups annotations by their source attachment URL. Annotations without a
25
27
  * `body.source.attachment.url` are excluded, as are `html_tag`-selector
@@ -1 +1 @@
1
- {"version":3,"file":"group-annotations-by-source.d.ts","sourceRoot":"","sources":["../../src/utils/group-annotations-by-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,2BAA2B,CAAC;AAE7E,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,wFAAwF;IACxF,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAkDD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,aAAa,UAAU,EAAE,KACxB,eAAe,EAuBjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,UAAU,EAAE,KACxB,eAAe,EAwBjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,UAAU,EAAE,KACxB,eAAe,EAGjB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,UAAU,EACnB,aAAa,UAAU,EAAE,KACxB,UAAU,EAKZ,CAAC"}
1
+ {"version":3,"file":"group-annotations-by-source.d.ts","sourceRoot":"","sources":["../../src/utils/group-annotations-by-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,2BAA2B,CAAC;AAE7E,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,wFAAwF;IACxF,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAkCD,4JAA4J;AAC5J,eAAO,MAAM,sBAAsB,GACjC,YAAY,UAAU,KACrB,MAAM,GAAG,SAOX,CAAC;AAyBF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,aAAa,UAAU,EAAE,KACxB,eAAe,EAuBjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,UAAU,EAAE,KACxB,eAAe,EAwBjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,UAAU,EAAE,KACxB,eAAe,EAGjB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,UAAU,EACnB,aAAa,UAAU,EAAE,KACxB,UAAU,EAKZ,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"}