@epam/ai-dial-quotations 1.2.0-dev.143 → 1.2.0-dev.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CitationDropdown/CitationDropdown.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +32 -29
- package/package.json +2 -2
|
@@ -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,wDAAwD;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uFAAuF;IACvF,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,+CAA+C;IAC/C,UAAU,EAAE,kBAAkB,CAAC;IAC/B,yDAAyD;IACzD,YAAY,EAAE,oBAAoB,CAAC;IACnC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,gGAAgG;IAChG,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,8HAA8H;AAC9H,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"CitationDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/CitationDropdown/CitationDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;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,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,CAgFtD,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
._card_1kph1_1{background:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc))}._quote_1kph1_5{color:var(--cc-quote-text,var(--text-secondary,#57647a))}._title_1kph1_9{color:var(--cc-title-text,var(--text-primary,#161b2d))}._switcher_1kph1_13{color:var(--cc-switcher-text,var(--text-secondary,#57647a))}._sourceName_1kph1_17{color:var(--cc-source-name-text,var(--text-primary,#161b2d))}.
|
|
1
|
+
._card_1kph1_1{background:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc))}._quote_1kph1_5{color:var(--cc-quote-text,var(--text-secondary,#57647a))}._title_1kph1_9{color:var(--cc-title-text,var(--text-primary,#161b2d))}._switcher_1kph1_13{color:var(--cc-switcher-text,var(--text-secondary,#57647a))}._sourceName_1kph1_17{color:var(--cc-source-name-text,var(--text-primary,#161b2d))}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
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}.min-h-\[3lh\]{min-height:3lh}.w-\[400px\]{width:400px}.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}.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}.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))}
|
package/index.js
CHANGED
|
@@ -114,7 +114,10 @@ var T = {
|
|
|
114
114
|
let e = x(k);
|
|
115
115
|
if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
|
|
116
116
|
return e;
|
|
117
|
-
}, M = {
|
|
117
|
+
}, M = {
|
|
118
|
+
trigger: "_trigger_3ev9j_1",
|
|
119
|
+
content: "_content_3ev9j_10"
|
|
120
|
+
}, N = ({ group: e, onPreview: t, isPreviewable: n, onOpenInBrowser: r, icon: a, headerIcon: o, cardLabels: s, markerLabels: c, cardTypography: l, markerLabelClassName: u }) => {
|
|
118
121
|
let d = j(), f = S(), m = d.isOpen(f), h = d.getActiveIndex(e.groupKey), g = e.annotations[h] ?? e.primaryAnnotation, v = n?.(g) ?? !0, y = b((e) => {
|
|
119
122
|
e || d.closePopup(f);
|
|
120
123
|
}, [d, f]), x = C(() => t && v ? (e) => {
|
|
@@ -128,7 +131,7 @@ var T = {
|
|
|
128
131
|
return /* @__PURE__ */ _(p, {
|
|
129
132
|
open: m,
|
|
130
133
|
onOpenChange: y,
|
|
131
|
-
triggerClassName: "ms-1 inline-flex align-middle",
|
|
134
|
+
triggerClassName: i("ms-1 inline-flex align-middle", M.trigger),
|
|
132
135
|
contentClassName: i("!p-0 !bg-transparent !border-0 !shadow-none !max-w-none !rounded-none", M.content, T.citationDropdown),
|
|
133
136
|
tooltip: /* @__PURE__ */ _(D, {
|
|
134
137
|
group: e,
|
|
@@ -372,7 +375,7 @@ var T = {
|
|
|
372
375
|
i,
|
|
373
376
|
e
|
|
374
377
|
]);
|
|
375
|
-
}, me = /⟦C(\d+)⟧/g,
|
|
378
|
+
}, me = /⟦C(\d+)⟧/g, W = (e, t) => {
|
|
376
379
|
let n = t.map((e, t) => ({
|
|
377
380
|
g: e,
|
|
378
381
|
idx: t
|
|
@@ -385,7 +388,7 @@ var T = {
|
|
|
385
388
|
}).sort((e, t) => t.pos - e.pos), r = e;
|
|
386
389
|
for (let { idx: e, pos: t } of n) r = `${r.slice(0, t)}⟦C${e}⟧${r.slice(t)}`;
|
|
387
390
|
return r;
|
|
388
|
-
},
|
|
391
|
+
}, he = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>/g, ge = /^<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>$/, _e = /<cit\s+data-id=(?:"[^"]+"|'[^']+')\s*>\s*<\/cit>|<\/?cit\b[^>]*>|<\/?cit\b[^>]*$/gi, ve = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), G = (e) => e.replace(_e, (e) => ge.test(e) ? e : ve(e)), K = (e) => G(e).replace(he, ""), q = (e, t) => {
|
|
389
392
|
if (typeof e == "string") {
|
|
390
393
|
let n = e.split(me);
|
|
391
394
|
if (n.length === 1) return e;
|
|
@@ -395,18 +398,18 @@ var T = {
|
|
|
395
398
|
}), r;
|
|
396
399
|
}
|
|
397
400
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
398
|
-
let n =
|
|
401
|
+
let n = q(e, t);
|
|
399
402
|
return Array.isArray(n) ? n : [n];
|
|
400
403
|
}) : e;
|
|
401
|
-
},
|
|
404
|
+
}, ye = {}, be = [], J = (e) => {
|
|
402
405
|
let t = e.primaryAnnotation.target?.selector;
|
|
403
406
|
return t?.type === "html_tag" ? t.id : void 0;
|
|
404
|
-
},
|
|
407
|
+
}, xe = (e, t) => /* @__PURE__ */ v(g, { children: [
|
|
405
408
|
e == null ? "<cit>" : `<cit data-id="${e}">`,
|
|
406
409
|
t,
|
|
407
410
|
"</cit>"
|
|
408
|
-
] }),
|
|
409
|
-
let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, buildLabels: u } = n, d = C(() => r ?
|
|
411
|
+
] }), Se = (e, t, n, r = !1, a = !1, o = be) => {
|
|
412
|
+
let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, buildLabels: u } = n, d = C(() => r ? K(e) : G(t.length > 0 ? W(e, t) : e), [
|
|
410
413
|
e,
|
|
411
414
|
t,
|
|
412
415
|
r
|
|
@@ -416,11 +419,11 @@ var T = {
|
|
|
416
419
|
markdownComponents: C(() => {
|
|
417
420
|
let e = /* @__PURE__ */ new Map();
|
|
418
421
|
for (let t of o) {
|
|
419
|
-
let n =
|
|
422
|
+
let n = J(t);
|
|
420
423
|
n != null && e.set(n, t);
|
|
421
424
|
}
|
|
422
425
|
for (let n of t) {
|
|
423
|
-
let t =
|
|
426
|
+
let t = J(n);
|
|
424
427
|
t != null && e.set(t, n);
|
|
425
428
|
}
|
|
426
429
|
let n = (e) => {
|
|
@@ -438,19 +441,19 @@ var T = {
|
|
|
438
441
|
return r ? n(r) : null;
|
|
439
442
|
}, d = { cit: (t) => {
|
|
440
443
|
let r = t["data-id"] == null ? void 0 : e.get(t["data-id"]);
|
|
441
|
-
return r ? n(r) :
|
|
444
|
+
return r ? n(r) : xe(t["data-id"], t.children);
|
|
442
445
|
} };
|
|
443
|
-
return t.length === 0 && o.length === 0 ? f ? d :
|
|
446
|
+
return t.length === 0 && o.length === 0 ? f ? d : ye : {
|
|
444
447
|
...d,
|
|
445
448
|
p: ({ children: e, ...t }) => /* @__PURE__ */ _("p", {
|
|
446
449
|
...t,
|
|
447
450
|
className: i(a ? "dial-small-paragraph-text" : "dial-body-paragraph-text", "mb-3 [overflow-wrap:anywhere] [text-wrap:pretty] last:mb-0"),
|
|
448
|
-
children:
|
|
451
|
+
children: q(e, r)
|
|
449
452
|
}),
|
|
450
453
|
li: ({ children: e, ...t }) => /* @__PURE__ */ _("li", {
|
|
451
454
|
...t,
|
|
452
455
|
className: "mb-1.5 last:mb-0",
|
|
453
|
-
children:
|
|
456
|
+
children: q(e, r)
|
|
454
457
|
})
|
|
455
458
|
};
|
|
456
459
|
}, [
|
|
@@ -464,42 +467,42 @@ var T = {
|
|
|
464
467
|
f
|
|
465
468
|
])
|
|
466
469
|
};
|
|
467
|
-
},
|
|
470
|
+
}, Y = (e) => {
|
|
468
471
|
try {
|
|
469
472
|
return decodeURIComponent(e);
|
|
470
473
|
} catch {
|
|
471
474
|
return e;
|
|
472
475
|
}
|
|
473
|
-
},
|
|
476
|
+
}, Ce = (e) => {
|
|
474
477
|
try {
|
|
475
478
|
let t = new URL(e);
|
|
476
|
-
return t.pathname.split("/").map((e) =>
|
|
479
|
+
return t.pathname.split("/").map((e) => Y(e)).filter(Boolean).at(-1) ?? t.hostname;
|
|
477
480
|
} catch {
|
|
478
|
-
return e.split("/").map((e) =>
|
|
481
|
+
return e.split("/").map((e) => Y(e)).filter(Boolean).at(-1) ?? e;
|
|
479
482
|
}
|
|
480
|
-
},
|
|
483
|
+
}, X = (e, t) => e.body?.source?.attachment?.title ?? Ce(t), Z = (e) => {
|
|
481
484
|
let t = e.target?.selector;
|
|
482
485
|
return t?.type === "html_tag" ? t : void 0;
|
|
483
|
-
},
|
|
486
|
+
}, we = (e) => Z(e) != null, Q = (e) => {
|
|
484
487
|
let t = /* @__PURE__ */ new Map();
|
|
485
488
|
for (let n of e) {
|
|
486
|
-
if (
|
|
489
|
+
if (we(n)) continue;
|
|
487
490
|
let e = n.body?.source?.attachment?.url;
|
|
488
491
|
if (e == null) continue;
|
|
489
492
|
let r = t.get(e);
|
|
490
493
|
r ? r.annotations.push(n) : t.set(e, {
|
|
491
494
|
groupKey: e,
|
|
492
495
|
sourceUrl: e,
|
|
493
|
-
sourceName:
|
|
496
|
+
sourceName: X(n, e),
|
|
494
497
|
annotations: [n],
|
|
495
498
|
primaryAnnotation: n
|
|
496
499
|
});
|
|
497
500
|
}
|
|
498
501
|
return Array.from(t.values());
|
|
499
|
-
},
|
|
502
|
+
}, Te = (e) => {
|
|
500
503
|
let t = /* @__PURE__ */ new Map();
|
|
501
504
|
for (let n of e) {
|
|
502
|
-
let e =
|
|
505
|
+
let e = Z(n)?.id;
|
|
503
506
|
if (e == null) continue;
|
|
504
507
|
let r = n.body?.source?.attachment?.url;
|
|
505
508
|
if (r == null) continue;
|
|
@@ -507,13 +510,13 @@ var T = {
|
|
|
507
510
|
i ? i.annotations.push(n) : t.set(e, {
|
|
508
511
|
groupKey: `cit:${e}`,
|
|
509
512
|
sourceUrl: r,
|
|
510
|
-
sourceName:
|
|
513
|
+
sourceName: X(n, r),
|
|
511
514
|
annotations: [n],
|
|
512
515
|
primaryAnnotation: n
|
|
513
516
|
});
|
|
514
517
|
}
|
|
515
518
|
return Array.from(t.values());
|
|
516
|
-
}, Ee = (e) => [...
|
|
519
|
+
}, Ee = (e) => [...Te(e), ...Q(e)], De = (e, t) => {
|
|
517
520
|
let n = e.body?.source?.attachment?.url;
|
|
518
521
|
return n == null || !t.includes(e) ? [e] : t.filter((e) => e.body?.source?.attachment?.url === n);
|
|
519
522
|
}, Oe = (e) => e.url == null && e.reference_url != null, ke = /^(.*\.pdf)(?:#page=(\d+))?$/i, $ = (e) => {
|
|
@@ -522,7 +525,7 @@ var T = {
|
|
|
522
525
|
baseUrl: t[1],
|
|
523
526
|
page: t[2] == null ? null : Number(t[2])
|
|
524
527
|
} : null;
|
|
525
|
-
}, Ae = (t) =>
|
|
528
|
+
}, Ae = (t) => Q((t ?? []).filter(Oe).map((t) => {
|
|
526
529
|
let n = t.reference_url, r = $(n) != null;
|
|
527
530
|
return { body: {
|
|
528
531
|
quote: t.data,
|
|
@@ -537,4 +540,4 @@ var T = {
|
|
|
537
540
|
} };
|
|
538
541
|
}));
|
|
539
542
|
//#endregion
|
|
540
|
-
export { D as CitationCard, A as CitationCardProvider, N as CitationDropdown, O as CitationMarker, T as QUOTATIONS_CLASS, L as annotationHighlightId, U as annotationToOfficeHighlightLocations, oe as annotationsToPdfHighlights, De as gatherSameSourceAnnotations, se as getAnnotationPdfPage, Ae as getReferenceAttachmentGroups, Ee as groupAnnotations,
|
|
543
|
+
export { D as CitationCard, A as CitationCardProvider, N as CitationDropdown, O as CitationMarker, T as QUOTATIONS_CLASS, L as annotationHighlightId, U as annotationToOfficeHighlightLocations, oe as annotationsToPdfHighlights, De as gatherSameSourceAnnotations, se as getAnnotationPdfPage, Ae as getReferenceAttachmentGroups, Ee as groupAnnotations, Te as groupAnnotationsByCitId, Q as groupAnnotationsBySource, W as injectCitationSentinels, z as isDocxRangeSelector, H as isExcelRcRangeSelector, B as isPptxRangeSelector, Oe as isReferenceOnlyAttachment, $ as parsePdfPageReference, q as replaceSentinelsInChildren, R as resolveMessageAnnotations, K as stripCitTagsWhileStreaming, de as useAnnotations, pe as useCitationCard, j as useCitationCardContext, Se 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.
|
|
4
|
+
"version": "1.2.0-dev.148",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.148",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.18"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|