@coveo/atomic-react 3.11.12 → 3.11.14
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/dist/cjs/atomic-react.cjs +55 -19
- package/dist/cjs/atomic-react.cjs.map +1 -1
- package/dist/cjs/commerce/atomic-react.cjs +55 -19
- package/dist/cjs/commerce/atomic-react.cjs.map +1 -1
- package/dist/cjs/recommendation/atomic-react.cjs +55 -19
- package/dist/cjs/recommendation/atomic-react.cjs.map +1 -1
- package/package.json +3 -3
|
@@ -2415,15 +2415,35 @@ function parseAssetURL(url, assetPath = './assets') {
|
|
|
2415
2415
|
return null;
|
|
2416
2416
|
}
|
|
2417
2417
|
|
|
2418
|
-
function
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2418
|
+
function memoize(fn, getCacheKey, options = {}) {
|
|
2419
|
+
const cache = new Map();
|
|
2420
|
+
const { maxEntries } = options;
|
|
2421
|
+
return {
|
|
2422
|
+
fn: async (...args)=>{
|
|
2423
|
+
const key = getCacheKey(...args);
|
|
2424
|
+
if (cache.has(key)) {
|
|
2425
|
+
const cachedPromise = cache.get(key);
|
|
2426
|
+
cache.delete(key);
|
|
2427
|
+
cache.set(key, cachedPromise);
|
|
2428
|
+
return cachedPromise;
|
|
2429
|
+
}
|
|
2430
|
+
const promise = fn(...args).catch((error)=>{
|
|
2431
|
+
cache.delete(key);
|
|
2432
|
+
throw error;
|
|
2433
|
+
});
|
|
2434
|
+
cache.set(key, promise);
|
|
2435
|
+
if (void 0 !== maxEntries && cache.size > maxEntries) {
|
|
2436
|
+
const lruKey = cache.keys().next().value;
|
|
2437
|
+
if (void 0 !== lruKey) cache.delete(lruKey);
|
|
2438
|
+
}
|
|
2439
|
+
return promise;
|
|
2440
|
+
},
|
|
2441
|
+
clearCache: ()=>{
|
|
2442
|
+
cache.clear();
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2426
2445
|
}
|
|
2446
|
+
|
|
2427
2447
|
class IconFetchError extends Error {
|
|
2428
2448
|
static fromStatusCode(url, statusCode, statusText) {
|
|
2429
2449
|
return new IconFetchError(url, `status code ${statusCode} (${statusText})`);
|
|
@@ -2435,14 +2455,30 @@ class IconFetchError extends Error {
|
|
|
2435
2455
|
super(`Could not fetch icon from ${url}, got ${errorMessage}.`), this.url = url, this.errorObject = errorObject;
|
|
2436
2456
|
}
|
|
2437
2457
|
}
|
|
2458
|
+
const fetchIconUnmemoized = async (url)=>fetch(url).catch((e)=>{
|
|
2459
|
+
throw IconFetchError.fromError(url, e);
|
|
2460
|
+
}).then((response)=>{
|
|
2461
|
+
if (200 !== response.status && 304 !== response.status) throw IconFetchError.fromStatusCode(url, response.status, response.statusText);
|
|
2462
|
+
return response.text();
|
|
2463
|
+
});
|
|
2464
|
+
const memoizedFetchIcon = memoize(fetchIconUnmemoized, (url)=>url, {
|
|
2465
|
+
maxEntries: 20
|
|
2466
|
+
});
|
|
2467
|
+
const fetchIcon = memoizedFetchIcon.fn;
|
|
2468
|
+
|
|
2469
|
+
function _ts_decorate$1g(decorators, target, key, desc) {
|
|
2470
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2471
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
2472
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2473
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2474
|
+
}
|
|
2475
|
+
function _ts_metadata$11(k, v) {
|
|
2476
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
2477
|
+
}
|
|
2438
2478
|
let AtomicIcon$1 = class AtomicIcon extends LightDomMixin(InitializeBindingsMixin(lit.LitElement)) {
|
|
2439
2479
|
async fetchIcon(url) {
|
|
2440
2480
|
try {
|
|
2441
|
-
|
|
2442
|
-
throw IconFetchError.fromError(url, e);
|
|
2443
|
-
});
|
|
2444
|
-
if (200 !== response.status && 304 !== response.status) throw IconFetchError.fromStatusCode(url, response.status, response.statusText);
|
|
2445
|
-
return await response.text();
|
|
2481
|
+
return await fetchIcon(url);
|
|
2446
2482
|
} catch (e) {
|
|
2447
2483
|
this.error = e;
|
|
2448
2484
|
this.requestUpdate();
|
|
@@ -8420,7 +8456,7 @@ function getWindow$1() {
|
|
|
8420
8456
|
}
|
|
8421
8457
|
function getAtomicEnvironment(headlessVersion) {
|
|
8422
8458
|
return {
|
|
8423
|
-
version: "3.
|
|
8459
|
+
version: "3.56.0",
|
|
8424
8460
|
headlessVersion
|
|
8425
8461
|
};
|
|
8426
8462
|
}
|
|
@@ -16596,7 +16632,7 @@ const renderSearchBoxTextArea = ({ props: { textAreaRef, loading, i18n, onInput,
|
|
|
16596
16632
|
}}
|
|
16597
16633
|
@keyup=${(e)=>{
|
|
16598
16634
|
onKeyUp?.(e);
|
|
16599
|
-
if ('Enter' === e.key) return void e.preventDefault();
|
|
16635
|
+
if ('Enter' === e.key && !e.shiftKey) return void e.preventDefault();
|
|
16600
16636
|
syncTextWithReplica(textAreaRef);
|
|
16601
16637
|
}}
|
|
16602
16638
|
@blur=${(e)=>{
|
|
@@ -17752,7 +17788,7 @@ let AtomicCommerceSearchBox$1 = class AtomicCommerceSearchBox extends lit.LitEle
|
|
|
17752
17788
|
if (this.isSearchDisabledForEndUser) return;
|
|
17753
17789
|
switch(e.key){
|
|
17754
17790
|
case 'Enter':
|
|
17755
|
-
this.onSubmit();
|
|
17791
|
+
if (!e.shiftKey) this.onSubmit();
|
|
17756
17792
|
break;
|
|
17757
17793
|
case 'Escape':
|
|
17758
17794
|
this.suggestionManager.clearSuggestions();
|
|
@@ -21109,7 +21145,7 @@ class AtomicCitation extends lit.LitElement {
|
|
|
21109
21145
|
<div class="relative">
|
|
21110
21146
|
${renderLinkWithItemAnalytics({
|
|
21111
21147
|
props: {
|
|
21112
|
-
href: this.anchorUrl(this.citation.clickUri ?? this.citation.uri, this.citation.text, this.citation.fields?.filetype),
|
|
21148
|
+
href: this.anchorUrl(this.citation.clickUri ?? this.citation.uri, this.citation.text, this.citation.filetype ?? this.citation.fields?.filetype),
|
|
21113
21149
|
ref: this.citationRef,
|
|
21114
21150
|
part: 'citation',
|
|
21115
21151
|
target: '_blank',
|
|
@@ -21579,7 +21615,7 @@ AtomicFocusTrap$1 = _ts_decorate$f([
|
|
|
21579
21615
|
decorators_js.customElement('atomic-focus-trap')
|
|
21580
21616
|
], AtomicFocusTrap$1);
|
|
21581
21617
|
|
|
21582
|
-
const styles$4 = lit.css`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-font-weight:initial;--tw-leading:initial;--tw-border-style:solid}}}[part=generated-text] [part=answer-heading-1]{font-size:var(--atomic-text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height,1.33333))}[part=generated-text] [part=answer-heading-2]{font-size:var(--atomic-text-xl);line-height:var(--tw-leading,var(--text-xl--line-height,1.4))}[part=generated-text] [part=answer-heading-3],[part=generated-text] [part=answer-heading-4],[part=generated-text] [part=answer-heading-5],[part=generated-text] [part=answer-heading-6]{font-size:var(--atomic-text-lg);line-height:var(--tw-leading,var(--text-lg--line-height,1.55556))}[part=generated-text] [part=answer-heading-1],[part=generated-text] [part=answer-heading-2],[part=generated-text] [part=answer-heading-3],[part=generated-text] [part=answer-heading-4],[part=generated-text] [part=answer-heading-5],[part=generated-text] [part=answer-heading-6]{margin-bottom:calc(var(--spacing,.25rem)*2);margin-top:calc(var(--spacing,.25rem)*
|
|
21618
|
+
const styles$4 = lit.css`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-font-weight:initial;--tw-leading:initial;--tw-border-style:solid}}}[part=generated-text] [part=answer-heading-1]{font-size:var(--atomic-text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height,1.33333))}[part=generated-text] [part=answer-heading-2]{font-size:var(--atomic-text-xl);line-height:var(--tw-leading,var(--text-xl--line-height,1.4))}[part=generated-text] [part=answer-heading-3],[part=generated-text] [part=answer-heading-4],[part=generated-text] [part=answer-heading-5],[part=generated-text] [part=answer-heading-6]{font-size:var(--atomic-text-lg);line-height:var(--tw-leading,var(--text-lg--line-height,1.55556))}[part=generated-text] [part=answer-heading-1],[part=generated-text] [part=answer-heading-2],[part=generated-text] [part=answer-heading-3],[part=generated-text] [part=answer-heading-4],[part=generated-text] [part=answer-heading-5],[part=generated-text] [part=answer-heading-6]{margin-bottom:calc(var(--spacing,.25rem)*2);margin-top:calc(var(--spacing,.25rem)*3);--tw-font-weight:var(--atomic-font-bold);font-weight:var(--atomic-font-bold)}[part=generated-text] [part=answer-paragraph]{margin-bottom:calc(var(--spacing,.25rem)*3)}[part=generated-text] [part=answer-list-item],[part=generated-text] [part=answer-paragraph],[part=generated-text] [part=answer-quote-block],[part=generated-text] [part=answer-table-content],[part=generated-text] [part=answer-table-header]{--tw-leading:calc(var(--spacing,.25rem)*5);line-height:calc(var(--spacing,.25rem)*5)}[part=generated-text] [part=answer-strong]{--tw-font-weight:var(--atomic-font-bold);font-weight:var(--atomic-font-bold)}[part=generated-text] [part=answer-ordered-list]{list-style-type:decimal;margin-bottom:calc(var(--spacing,.25rem)*2);padding-inline-start:calc(var(--spacing,.25rem)*8)}[part=generated-text] [part=answer-unordered-list]{list-style-type:disc;margin-bottom:calc(var(--spacing,.25rem)*2);padding-inline-start:calc(var(--spacing,.25rem)*8)}[part=generated-text] [part=answer-inline-code]{border-color:var(--atomic-neutral);border-radius:var(--atomic-border-radius);border-style:solid;border-width:1px;color:var(--atomic-inline-code);padding-block:calc(var(--spacing,.25rem)*.5);padding-inline:calc(var(--spacing,.25rem)*1)}[part=generated-text] [part=answer-code-block],[part=generated-text] [part=answer-inline-code]{--tw-border-style:solid;background-color:var(--atomic-neutral-light);font-size:var(--atomic-text-sm);line-height:var(--tw-leading,var(--text-sm--line-height,1.42857))}[part=generated-text] [part=answer-code-block]{border-color:var(--atomic-neutral);border-radius:var(--atomic-border-radius-md);border-style:solid;border-width:1px;color:var(--atomic-on-background);margin-block:calc(var(--spacing,.25rem)*4);max-height:calc(var(--spacing,.25rem)*96);overflow:auto;padding:calc(var(--spacing,.25rem)*2);scrollbar-color:var(--atomic-neutral)}[part=generated-text] [part=answer-quote-block]{font-style:italic;margin-inline:calc(var(--spacing,.25rem)*16)}[part=generated-text] [part=answer-table-container]{border-radius:var(--atomic-border-radius-md);margin-bottom:calc(var(--spacing,.25rem)*6);max-height:calc(var(--spacing,.25rem)*96);--tw-border-style:solid;border-color:var(--atomic-neutral-dim);border-style:solid;border-width:1px;display:inline-block;max-width:100%;overflow:auto}[part=generated-text] [part=answer-table-container] [part=answer-table-header]{position:sticky;top:calc(var(--spacing,.25rem)*0)}[part=generated-text] [part=answer-table]{font-size:var(--atomic-text-base);line-height:var(--tw-leading,var(--text-base--line-height,1.5))}[part=generated-text] [part=answer-table] thead [part=answer-table-header]{background-color:var(--atomic-neutral);border-bottom-color:var(--atomic-neutral-dim);border-left-color:var(--atomic-neutral-dim);padding:calc(var(--spacing,.25rem)*4);text-align:left;--tw-font-weight:var(--atomic-font-bold);font-weight:var(--atomic-font-bold)}[part=generated-text] [part=answer-table] thead [part=answer-table-header]:first-of-type{border-left:none}[part=generated-text] [part=answer-table] tbody tr:nth-child(2n){background-color:var(--atomic-neutral-light)}[part=generated-text] [part=answer-table] tbody tr [part=answer-table-content]{border-bottom-color:var(--atomic-neutral-dim);border-left-color:var(--atomic-neutral-dim);border-style:var(--tw-border-style);border-width:1px;padding:calc(var(--spacing,.25rem)*4)}[part=generated-text] [part=answer-table] tbody tr [part=answer-table-content]:first-of-type{border-left:none}[part=generated-text] [part=answer-table] tbody tr:last-of-type [part=answer-table-content]{border-bottom:unset}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}`;
|
|
21583
21619
|
const generated_markdown_content_tw_css = styles$4;
|
|
21584
21620
|
|
|
21585
21621
|
const styles$3 = lit.css`[part=copy-button] .icon-container atomic-icon:hover{color:var(--atomic-primary)}[part=copy-button].copied .icon-container atomic-icon{color:var(--atomic-success)}[part=copy-button].error .icon-container atomic-icon{color:var(--atomic-error)}[part=copy-button] .icon-container{line-height:0}`;
|
|
@@ -21588,7 +21624,7 @@ const copy_button_tw_css = styles$3;
|
|
|
21588
21624
|
const styles$2 = lit.css`.feedback-buttons [part=feedback-button]{height:2.2rem;width:2.2rem}`;
|
|
21589
21625
|
const feedback_buttons_tw_css = styles$2;
|
|
21590
21626
|
|
|
21591
|
-
const styles$1 = lit.css`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */[part=generated-text]{--font-size:var(--atomic-text-
|
|
21627
|
+
const styles$1 = lit.css`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */[part=generated-text]{--font-size:var(--atomic-text-base);font-size:var(--font-size);--line-height:calc(var(--font-size)*var(--atomic-line-height-ratio));line-height:var(--line-height)}[part=generated-text].cursor:after{animation:cursor-blink 1.5s steps(2) infinite;background-color:var(--atomic-neutral-dark);content:"";display:inline-block;height:1em;margin-left:.1em;vertical-align:text-bottom;width:8px}`;
|
|
21592
21628
|
const generated_text_tw_css = styles$1;
|
|
21593
21629
|
|
|
21594
21630
|
const baseStyle = lit.css`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@keyframes cursor-blink{0%{opacity:0}}@keyframes generation-steps-rolodex{0%{opacity:.75;transform:translateY(105%)rotateX(-82deg)}to{opacity:1;transform:translateY(0)rotateX(0)}}[part=container]{contain:layout;container-type:inline-size}.footer{display:flex}.footer .source-citations{margin-right:calc(var(--spacing,.25rem)*2)}@container (max-width:37.5rem){.footer{flex-direction:column;gap:calc(var(--spacing,.25rem)*4)}.footer .source-citations{margin-right:calc(var(--spacing,.25rem)*0)}[part=generated-answer-footer]{flex-direction:column;gap:calc(var(--spacing,.25rem)*1)}}@media not all and (min-width:768px){.footer{flex-direction:column;gap:calc(var(--spacing,.25rem)*4)}.footer .source-citations{margin-right:calc(var(--spacing,.25rem)*0)}[part=generated-answer-footer]{flex-direction:column;gap:calc(var(--spacing,.25rem)*1)}}@container (max-width:25rem){.footer{margin-top:calc(var(--spacing,.25rem)*4)}.footer .feedback-buttons{position:relative;right:calc(var(--spacing,.25rem)*0);top:calc(var(--spacing,.25rem)*0)}}.is-collapsible{justify-content:space-between}.is-collapsible [part=answer-show-button]{display:flex}[part=header-icon]{color:var(--atomic-primary)}[part=feedback-and-copy-buttons]{min-width:var(--atomic-generated-answer-actions-reserved-width,8rem)}[part=header-icon] svg,[part=header-icon] svg *{fill:currentColor;stroke:currentColor}.generating-label-visible [part=is-generating]{display:flex}[part=agent-generation-status] .generation-steps-container{display:inline-flex;overflow:hidden;perspective:700px}[part=agent-generation-status] .generation-steps-value{animation:generation-steps-rolodex 1s cubic-bezier(.22,.9,.26,1) both;backface-visibility:hidden;display:inline-block;transform-origin:50% 100%;white-space:nowrap;will-change:transform}[part=generated-container].answer-collapsed{max-height:var(--atomic-crga-collapsed-height,16rem);overflow:hidden;position:relative}[part=generated-container].answer-collapsed:before{background:linear-gradient(transparent calc(var(--atomic-crga-collapsed-height,16rem)*.7),var(--atomic-background));content:"";height:100%;left:calc(var(--spacing,.25rem)*0);position:absolute;top:calc(var(--spacing,.25rem)*0);width:100%}[part=generated-container].answer-collapsed .feedback-buttons{display:none}[part=generated-content-container] .agent-scrollable{height:var(--atomic-generated-answer-content-fixed-height,50vh);overflow-y:auto}.query-text{-webkit-line-clamp:3;text-overflow:ellipsis;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}`;
|