@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
|
@@ -2524,15 +2524,35 @@ function parseAssetURL(url, assetPath = './assets') {
|
|
|
2524
2524
|
return null;
|
|
2525
2525
|
}
|
|
2526
2526
|
|
|
2527
|
-
function
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2527
|
+
function memoize(fn, getCacheKey, options = {}) {
|
|
2528
|
+
const cache = new Map();
|
|
2529
|
+
const { maxEntries } = options;
|
|
2530
|
+
return {
|
|
2531
|
+
fn: async (...args)=>{
|
|
2532
|
+
const key = getCacheKey(...args);
|
|
2533
|
+
if (cache.has(key)) {
|
|
2534
|
+
const cachedPromise = cache.get(key);
|
|
2535
|
+
cache.delete(key);
|
|
2536
|
+
cache.set(key, cachedPromise);
|
|
2537
|
+
return cachedPromise;
|
|
2538
|
+
}
|
|
2539
|
+
const promise = fn(...args).catch((error)=>{
|
|
2540
|
+
cache.delete(key);
|
|
2541
|
+
throw error;
|
|
2542
|
+
});
|
|
2543
|
+
cache.set(key, promise);
|
|
2544
|
+
if (void 0 !== maxEntries && cache.size > maxEntries) {
|
|
2545
|
+
const lruKey = cache.keys().next().value;
|
|
2546
|
+
if (void 0 !== lruKey) cache.delete(lruKey);
|
|
2547
|
+
}
|
|
2548
|
+
return promise;
|
|
2549
|
+
},
|
|
2550
|
+
clearCache: ()=>{
|
|
2551
|
+
cache.clear();
|
|
2552
|
+
}
|
|
2553
|
+
};
|
|
2535
2554
|
}
|
|
2555
|
+
|
|
2536
2556
|
class IconFetchError extends Error {
|
|
2537
2557
|
static fromStatusCode(url, statusCode, statusText) {
|
|
2538
2558
|
return new IconFetchError(url, `status code ${statusCode} (${statusText})`);
|
|
@@ -2544,14 +2564,30 @@ class IconFetchError extends Error {
|
|
|
2544
2564
|
super(`Could not fetch icon from ${url}, got ${errorMessage}.`), this.url = url, this.errorObject = errorObject;
|
|
2545
2565
|
}
|
|
2546
2566
|
}
|
|
2567
|
+
const fetchIconUnmemoized = async (url)=>fetch(url).catch((e)=>{
|
|
2568
|
+
throw IconFetchError.fromError(url, e);
|
|
2569
|
+
}).then((response)=>{
|
|
2570
|
+
if (200 !== response.status && 304 !== response.status) throw IconFetchError.fromStatusCode(url, response.status, response.statusText);
|
|
2571
|
+
return response.text();
|
|
2572
|
+
});
|
|
2573
|
+
const memoizedFetchIcon = memoize(fetchIconUnmemoized, (url)=>url, {
|
|
2574
|
+
maxEntries: 20
|
|
2575
|
+
});
|
|
2576
|
+
const fetchIcon = memoizedFetchIcon.fn;
|
|
2577
|
+
|
|
2578
|
+
function _ts_decorate$1G(decorators, target, key, desc) {
|
|
2579
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2580
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
2581
|
+
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;
|
|
2582
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2583
|
+
}
|
|
2584
|
+
function _ts_metadata$1w(k, v) {
|
|
2585
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
2586
|
+
}
|
|
2547
2587
|
let AtomicIcon$1 = class AtomicIcon extends LightDomMixin(InitializeBindingsMixin(lit.LitElement)) {
|
|
2548
2588
|
async fetchIcon(url) {
|
|
2549
2589
|
try {
|
|
2550
|
-
|
|
2551
|
-
throw IconFetchError.fromError(url, e);
|
|
2552
|
-
});
|
|
2553
|
-
if (200 !== response.status && 304 !== response.status) throw IconFetchError.fromStatusCode(url, response.status, response.statusText);
|
|
2554
|
-
return await response.text();
|
|
2590
|
+
return await fetchIcon(url);
|
|
2555
2591
|
} catch (e) {
|
|
2556
2592
|
this.error = e;
|
|
2557
2593
|
this.requestUpdate();
|
|
@@ -6958,7 +6994,7 @@ function getWindow$1() {
|
|
|
6958
6994
|
}
|
|
6959
6995
|
function getAtomicEnvironment(headlessVersion) {
|
|
6960
6996
|
return {
|
|
6961
|
-
version: "3.
|
|
6997
|
+
version: "3.56.0",
|
|
6962
6998
|
headlessVersion
|
|
6963
6999
|
};
|
|
6964
7000
|
}
|
|
@@ -11967,7 +12003,7 @@ const renderSearchBoxTextArea = ({ props: { textAreaRef, loading, i18n, onInput,
|
|
|
11967
12003
|
}}
|
|
11968
12004
|
@keyup=${(e)=>{
|
|
11969
12005
|
onKeyUp?.(e);
|
|
11970
|
-
if ('Enter' === e.key) return void e.preventDefault();
|
|
12006
|
+
if ('Enter' === e.key && !e.shiftKey) return void e.preventDefault();
|
|
11971
12007
|
syncTextWithReplica(textAreaRef);
|
|
11972
12008
|
}}
|
|
11973
12009
|
@blur=${(e)=>{
|
|
@@ -14496,7 +14532,7 @@ class AtomicCitation extends lit.LitElement {
|
|
|
14496
14532
|
<div class="relative">
|
|
14497
14533
|
${renderLinkWithItemAnalytics({
|
|
14498
14534
|
props: {
|
|
14499
|
-
href: this.anchorUrl(this.citation.clickUri ?? this.citation.uri, this.citation.text, this.citation.fields?.filetype),
|
|
14535
|
+
href: this.anchorUrl(this.citation.clickUri ?? this.citation.uri, this.citation.text, this.citation.filetype ?? this.citation.fields?.filetype),
|
|
14500
14536
|
ref: this.citationRef,
|
|
14501
14537
|
part: 'citation',
|
|
14502
14538
|
target: '_blank',
|
|
@@ -14966,7 +15002,7 @@ AtomicFocusTrap$1 = _ts_decorate$1q([
|
|
|
14966
15002
|
decorators_js.customElement('atomic-focus-trap')
|
|
14967
15003
|
], AtomicFocusTrap$1);
|
|
14968
15004
|
|
|
14969
|
-
const styles$b = 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)*
|
|
15005
|
+
const styles$b = 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}`;
|
|
14970
15006
|
const generated_markdown_content_tw_css = styles$b;
|
|
14971
15007
|
|
|
14972
15008
|
const styles$a = 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}`;
|
|
@@ -14975,7 +15011,7 @@ const copy_button_tw_css = styles$a;
|
|
|
14975
15011
|
const styles$9 = lit.css`.feedback-buttons [part=feedback-button]{height:2.2rem;width:2.2rem}`;
|
|
14976
15012
|
const feedback_buttons_tw_css = styles$9;
|
|
14977
15013
|
|
|
14978
|
-
const styles$8 = lit.css`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */[part=generated-text]{--font-size:var(--atomic-text-
|
|
15014
|
+
const styles$8 = 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}`;
|
|
14979
15015
|
const generated_text_tw_css = styles$8;
|
|
14980
15016
|
|
|
14981
15017
|
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}`;
|
|
@@ -33286,7 +33322,7 @@ let AtomicSearchBox$1 = class AtomicSearchBox extends lit.LitElement {
|
|
|
33286
33322
|
if (this.isSearchDisabledForEndUser) return;
|
|
33287
33323
|
switch(e.key){
|
|
33288
33324
|
case 'Enter':
|
|
33289
|
-
this.onSubmit();
|
|
33325
|
+
if (!e.shiftKey) this.onSubmit();
|
|
33290
33326
|
break;
|
|
33291
33327
|
case 'Escape':
|
|
33292
33328
|
this.suggestionManager.clearSuggestions();
|