@coveo/atomic 3.31.2-pre.897497238c → 3.31.2-pre.8be4e70346

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.
Files changed (107) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/atomic.esm.js.map +1 -1
  3. package/dist/atomic/components/_index.d.ts +2 -0
  4. package/dist/atomic/components/_index.js +1 -0
  5. package/dist/atomic/components/analytics-config.js +1 -1
  6. package/dist/atomic/components/atomic-product-description.d.ts +11 -0
  7. package/dist/atomic/components/atomic-product-description.js +153 -0
  8. package/dist/atomic/components/atomic-product-description.js.map +1 -0
  9. package/dist/atomic/components/components/commerce/atomic-product-template/atomic-product-template.js +0 -1
  10. package/dist/atomic/components/components/commerce/index.js +0 -1
  11. package/dist/atomic/components/components/commerce/lazy-index.js +0 -1
  12. package/dist/atomic/components/global/environment.js +1 -1
  13. package/dist/atomic/components/index.js.map +1 -1
  14. package/dist/atomic/components/plus.js +10 -0
  15. package/dist/atomic/components/plus.js.map +1 -0
  16. package/dist/atomic/components/stencil-facet-show-more-less.js +1 -7
  17. package/dist/atomic/components/stencil-facet-show-more-less.js.map +1 -1
  18. package/dist/atomic/{p-7850de51.entry.js → p-031c75d8.entry.js} +2 -2
  19. package/dist/atomic/p-0873c1b8.entry.js +2 -0
  20. package/dist/atomic/{p-e8ba8acd.entry.js.map → p-0873c1b8.entry.js.map} +1 -1
  21. package/dist/atomic/{p-d8985ada.entry.js → p-1d3750da.entry.js} +2 -2
  22. package/dist/atomic/p-3f881919.entry.js +2 -0
  23. package/dist/atomic/{p-91477908.entry.js.map → p-3f881919.entry.js.map} +1 -1
  24. package/dist/atomic/p-4e77fe24.entry.js +2 -0
  25. package/dist/atomic/{p-29c272bb.entry.js.map → p-4e77fe24.entry.js.map} +1 -1
  26. package/dist/atomic/{p-661ac76a.js → p-8a3cd647.js} +2 -2
  27. package/dist/atomic/p-8bb323e8.entry.js +2 -0
  28. package/dist/atomic/{p-1e0f2e91.entry.js.map → p-8bb323e8.entry.js.map} +1 -1
  29. package/dist/atomic/p-8f20d930.js +2 -0
  30. package/dist/atomic/p-8f20d930.js.map +1 -0
  31. package/dist/atomic/{p-57bc7712.entry.js → p-9d8a346d.entry.js} +2 -2
  32. package/dist/atomic/p-c100197d.js +2 -0
  33. package/dist/atomic/{p-417b1b64.js.map → p-c100197d.js.map} +1 -1
  34. package/dist/atomic/p-e215ba76.entry.js +2 -0
  35. package/dist/atomic/{p-44a3c052.entry.js.map → p-e215ba76.entry.js.map} +1 -1
  36. package/dist/atomic/p-f2d31b97.entry.js +2 -0
  37. package/dist/atomic/p-f2d31b97.entry.js.map +1 -0
  38. package/dist/cjs/_loader.cjs.js +1 -1
  39. package/dist/cjs/{analytics-config-4847fb9d.js → analytics-config-e0753630.js} +2 -2
  40. package/dist/cjs/{analytics-config-4847fb9d.js.map → analytics-config-e0753630.js.map} +1 -1
  41. package/dist/cjs/atomic-category-facet.cjs.entry.js +2 -1
  42. package/dist/cjs/atomic-category-facet.cjs.entry.js.map +1 -1
  43. package/dist/cjs/atomic-color-facet.cjs.entry.js +2 -1
  44. package/dist/cjs/atomic-color-facet.cjs.entry.js.map +1 -1
  45. package/dist/cjs/atomic-commerce-category-facet_4.cjs.entry.js +2 -1
  46. package/dist/cjs/atomic-commerce-category-facet_4.cjs.entry.js.map +1 -1
  47. package/dist/cjs/atomic-facet.cjs.entry.js +2 -1
  48. package/dist/cjs/atomic-facet.cjs.entry.js.map +1 -1
  49. package/dist/cjs/atomic-insight-facet.cjs.entry.js +2 -1
  50. package/dist/cjs/atomic-insight-facet.cjs.entry.js.map +1 -1
  51. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  52. package/dist/cjs/atomic-product-description.cjs.entry.js +141 -0
  53. package/dist/cjs/atomic-product-description.cjs.entry.js.map +1 -0
  54. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  55. package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
  56. package/dist/cjs/atomic.cjs.js +1 -1
  57. package/dist/cjs/index-757bc886.js +4 -0
  58. package/dist/cjs/plus-07843914.js +13 -0
  59. package/dist/cjs/plus-07843914.js.map +1 -0
  60. package/dist/cjs/{stencil-facet-show-more-less-541e1544.js → stencil-facet-show-more-less-21d22973.js} +4 -10
  61. package/dist/cjs/stencil-facet-show-more-less-21d22973.js.map +1 -0
  62. package/dist/cjs/version.cjs.js +2 -2
  63. package/dist/esm/_loader.js +1 -1
  64. package/dist/esm/{analytics-config-49f831c0.js → analytics-config-7239091b.js} +2 -2
  65. package/dist/esm/{analytics-config-49f831c0.js.map → analytics-config-7239091b.js.map} +1 -1
  66. package/dist/esm/atomic-category-facet.entry.js +2 -1
  67. package/dist/esm/atomic-category-facet.entry.js.map +1 -1
  68. package/dist/esm/atomic-color-facet.entry.js +2 -1
  69. package/dist/esm/atomic-color-facet.entry.js.map +1 -1
  70. package/dist/esm/atomic-commerce-category-facet_4.entry.js +2 -1
  71. package/dist/esm/atomic-commerce-category-facet_4.entry.js.map +1 -1
  72. package/dist/esm/atomic-facet.entry.js +2 -1
  73. package/dist/esm/atomic-facet.entry.js.map +1 -1
  74. package/dist/esm/atomic-insight-facet.entry.js +2 -1
  75. package/dist/esm/atomic-insight-facet.entry.js.map +1 -1
  76. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  77. package/dist/esm/atomic-product-description.entry.js +137 -0
  78. package/dist/esm/atomic-product-description.entry.js.map +1 -0
  79. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  80. package/dist/esm/atomic-search-interface.entry.js +1 -1
  81. package/dist/esm/atomic.js +1 -1
  82. package/dist/esm/index-3f35faca.js +4 -0
  83. package/dist/esm/plus-00840ff6.js +10 -0
  84. package/dist/esm/plus-00840ff6.js.map +1 -0
  85. package/dist/esm/{stencil-facet-show-more-less-1198472f.js → stencil-facet-show-more-less-4b023ee3.js} +2 -8
  86. package/dist/esm/stencil-facet-show-more-less-4b023ee3.js.map +1 -0
  87. package/dist/esm/version.js +2 -2
  88. package/dist/types/components/commerce/atomic-product-description/atomic-product-description.d.ts +10 -21
  89. package/dist/types/components/commerce/atomic-product-template/atomic-product-template.d.ts +0 -1
  90. package/dist/types/components/commerce/index.d.ts +0 -1
  91. package/dist/types/components.d.ts +51 -0
  92. package/docs/atomic-docs.json +124 -1
  93. package/package.json +3 -3
  94. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +0 -149
  95. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.tw.css.js +0 -3
  96. package/dist/atomic/p-1e0f2e91.entry.js +0 -2
  97. package/dist/atomic/p-29c272bb.entry.js +0 -2
  98. package/dist/atomic/p-417b1b64.js +0 -2
  99. package/dist/atomic/p-44a3c052.entry.js +0 -2
  100. package/dist/atomic/p-91477908.entry.js +0 -2
  101. package/dist/atomic/p-e8ba8acd.entry.js +0 -2
  102. package/dist/cjs/stencil-facet-show-more-less-541e1544.js.map +0 -1
  103. package/dist/esm/stencil-facet-show-more-less-1198472f.js.map +0 -1
  104. /package/dist/atomic/{p-7850de51.entry.js.map → p-031c75d8.entry.js.map} +0 -0
  105. /package/dist/atomic/{p-d8985ada.entry.js.map → p-1d3750da.entry.js.map} +0 -0
  106. /package/dist/atomic/{p-661ac76a.js.map → p-8a3cd647.js.map} +0 -0
  107. /package/dist/atomic/{p-57bc7712.entry.js.map → p-9d8a346d.entry.js.map} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { s as shouldUpdateFacetSearchComponent } from './stencil-facet-value-label-highlight-b4083ffd.js';
2
2
  import { h } from './index-3f35faca.js';
3
+ import { P as PlusIcon, M as MinusIcon } from './plus-00840ff6.js';
3
4
  import { B as Button } from './stencil-button-2a8cc429.js';
4
5
 
5
6
  function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n) {
@@ -16,13 +17,6 @@ function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n)
16
17
  });
17
18
  }
18
19
 
19
- const MinusIcon = `<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m64 208h384v96h-384z"/></svg>`;
20
-
21
- const PlusIcon = `<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
22
- <path d="M496 208H304V16h-96v192H16v96h192v192h96V304h192"/>
23
- </svg>
24
- `;
25
-
26
20
  const FacetShowMoreLess = (props) => {
27
21
  const label = props.i18n.t(props.label);
28
22
  const showMore = props.i18n.t('show-more');
@@ -49,4 +43,4 @@ const FacetShowMoreLess = (props) => {
49
43
 
50
44
  export { FacetShowMoreLess as F, announceFacetSearchResultsWithAriaLive as a };
51
45
 
52
- //# sourceMappingURL=stencil-facet-show-more-less-1198472f.js.map
46
+ //# sourceMappingURL=stencil-facet-show-more-less-4b023ee3.js.map
@@ -0,0 +1 @@
1
+ {"file":"stencil-facet-show-more-less-4b023ee3.js","mappings":";;;;;SAIgB,sCAAsC,CACpD,KAA0E,EAC1E,KAAa,EACb,WAAkC,EAClC,IAAU;IAEV,IAAI,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;IACxC,KAAK,CAAC,SAAS,CAAC;QACd,IACE,gCAAgC,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC;YACpE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAC7B;YACA,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;YAEpC,WAAW,CACT,IAAI,CAAC,CAAC,CAAC,4BAA4B,EAAE;gBACnC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM;gBAC5C,KAAK;aACN,CAAC,CACH,CAAC;SACH;KACF,CAAC,CAAC;AACL;;MCTa,iBAAiB,GAA4C,CACxE,KAAK;IAEL,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE;QACjE,KAAK;KACN,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE;QACjE,KAAK;KACN,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,sDAAsD,CAAC;IAC1E,MAAM,WAAW,GAAG,cAAc,CAAC;IACnC,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;QACxD,OAAO;KACR;IAED,QACE,WAAK,KAAK,EAAC,MAAM;QACf,EAAC,MAAM,IACL,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,WAAW,EAChB,KAAK,EAAE,GAAG,UAAU,IAAI,KAAK,CAAC,iBAAiB,GAAG,EAAE,GAAG,QAAQ,EAAE,EACjE,SAAS,EAAE,mBAAmB,EAC9B,OAAO,EAAE,MAAM,KAAK,CAAC,UAAU,EAAE,EACjC,GAAG,EAAE,KAAK,CAAC,WAAW;YAEtB,mBACE,IAAI,EAAC,qBAAqB,EAC1B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,SAAS,GACF;YACf,YAAM,KAAK,EAAC,UAAU,IAAE,QAAQ,CAAQ,CACjC;QACT,EAAC,MAAM,IACL,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,WAAW,EAChB,KAAK,EAAE,GAAG,UAAU,IAAI,KAAK,CAAC,iBAAiB,GAAG,EAAE,GAAG,QAAQ,EAAE,EACjE,SAAS,EAAE,mBAAmB,EAC9B,OAAO,EAAE,MAAM,KAAK,CAAC,UAAU,EAAE,EACjC,GAAG,EAAE,KAAK,CAAC,WAAW;YAEtB,mBACE,IAAI,EAAC,qBAAqB,EAC1B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,QAAQ,GACD;YACf,YAAM,KAAK,EAAC,UAAU,IAAE,QAAQ,CAAQ,CACjC,CACL,EACN;AACJ;;;;","names":[],"sources":["src/components/common/facets/facet-search/facet-search-aria-live.ts","src/components/common/facets/facet-show-more-less/stencil-facet-show-more-less.tsx"],"sourcesContent":["import type {Facet, FacetSearchState} from '@coveo/headless';\nimport type {i18n} from 'i18next';\nimport {shouldUpdateFacetSearchComponent} from './facet-search-utils';\n\nexport function announceFacetSearchResultsWithAriaLive(\n facet: Pick<Facet, 'subscribe'> & {state: {facetSearch: FacetSearchState}},\n label: string,\n setAriaLive: (msg: string) => void,\n i18n: i18n\n) {\n let prevState = facet.state.facetSearch;\n facet.subscribe(() => {\n if (\n shouldUpdateFacetSearchComponent(facet.state.facetSearch, prevState) &&\n facet.state.facetSearch.query\n ) {\n prevState = facet.state.facetSearch;\n\n setAriaLive(\n i18n.t('facet-search-results-count', {\n count: facet.state.facetSearch.values.length,\n label,\n })\n );\n }\n });\n}\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport MinusIcon from '../../../../images/minus.svg';\nimport PlusIcon from '../../../../images/plus.svg';\nimport {Button} from '../../stencil-button';\n\ninterface FacetShowMoreProps {\n label: string;\n i18n: i18n;\n canShowLessValues: boolean;\n canShowMoreValues: boolean;\n onShowMore(): void;\n onShowLess(): void;\n showMoreRef?: (element?: HTMLButtonElement) => void;\n showLessRef?: (element?: HTMLButtonElement) => void;\n}\n\nexport const FacetShowMoreLess: FunctionalComponent<FacetShowMoreProps> = (\n props\n) => {\n const label = props.i18n.t(props.label);\n const showMore = props.i18n.t('show-more');\n const showMoreFacetValues = props.i18n.t('show-more-facet-values', {\n label,\n });\n const showLess = props.i18n.t('show-less');\n const showLessFacetValues = props.i18n.t('show-less-facet-values', {\n label,\n });\n const btnClasses = 'flex items-baseline text-left p-2 text-sm max-w-full';\n const iconClasses = 'w-2 h-2 mr-1';\n if (!props.canShowLessValues && !props.canShowMoreValues) {\n return;\n }\n\n return (\n <div class=\"mt-2\">\n <Button\n style=\"text-primary\"\n part=\"show-less\"\n class={`${btnClasses} ${props.canShowLessValues ? '' : 'hidden'}`}\n ariaLabel={showLessFacetValues}\n onClick={() => props.onShowLess()}\n ref={props.showLessRef}\n >\n <atomic-icon\n part=\"show-more-less-icon\"\n class={iconClasses}\n icon={MinusIcon}\n ></atomic-icon>\n <span class=\"truncate\">{showLess}</span>\n </Button>\n <Button\n style=\"text-primary\"\n part=\"show-more\"\n class={`${btnClasses} ${props.canShowMoreValues ? '' : 'hidden'}`}\n ariaLabel={showMoreFacetValues}\n onClick={() => props.onShowMore()}\n ref={props.showMoreRef}\n >\n <atomic-icon\n part=\"show-more-less-icon\"\n class={iconClasses}\n icon={PlusIcon}\n ></atomic-icon>\n <span class=\"truncate\">{showMore}</span>\n </Button>\n </div>\n );\n};\n"],"version":3}
@@ -1,2 +1,2 @@
1
- export const headlessVersion = '3.27.7';
2
- export const atomicVersion = '3.31.2-pre.897497238c';
1
+ export const headlessVersion = '3.27.8-pre.8be4e70346';
2
+ export const atomicVersion = '3.31.2-pre.8be4e70346';
@@ -1,22 +1,19 @@
1
- import { LitElement } from 'lit';
2
- import type { InitializableComponent } from "../../../decorators/types.js";
3
- import { type TruncateAfter } from '../../common/expandable-text/expandable-text.js';
4
- import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface.js';
5
- import '../atomic-product-text/atomic-product-text.js';
1
+ import { InitializableComponent } from '../../../utils/initialization-utils';
2
+ import { TruncateAfter } from '../../common/expandable-text/stencil-expandable-text';
3
+ import { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
6
4
  /**
5
+ * @alpha
7
6
  * The `atomic-product-description` component renders the description of a product.
8
- *
9
- * @part expandable-text - The part that contains the product description text.
10
7
  */
11
- export declare class AtomicProductDescription extends LitElement implements InitializableComponent<CommerceBindings> {
12
- static styles: import("lit").CSSResult;
8
+ export declare class AtomicProductDescription implements InitializableComponent<CommerceBindings> {
13
9
  bindings: CommerceBindings;
10
+ private product;
11
+ hostElement: HTMLElement;
14
12
  error: Error;
15
- private productController;
16
13
  private isExpanded;
17
14
  private isTruncated;
15
+ private descriptionText;
18
16
  private resizeObserver;
19
- private descriptionRef;
20
17
  /**
21
18
  * The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
22
19
  */
@@ -29,18 +26,10 @@ export declare class AtomicProductDescription extends LitElement implements Init
29
26
  * Whether the description should be collapsible after being expanded.
30
27
  */
31
28
  isCollapsible: boolean;
32
- initialize(): void;
33
29
  constructor();
34
30
  private validateProps;
35
- updated(changedProperties: Map<string, unknown>): void;
36
- firstUpdated(): void;
31
+ componentDidLoad(): void;
37
32
  private onToggleExpand;
38
33
  disconnectedCallback(): void;
39
- private get product();
40
- render(): import("lit-html").TemplateResult<1>;
41
- }
42
- declare global {
43
- interface HTMLElementTagNameMap {
44
- 'atomic-product-description': AtomicProductDescription;
45
- }
34
+ render(): any;
46
35
  }
@@ -10,7 +10,6 @@ import '../atomic-product-children/atomic-product-children';
10
10
  import '../atomic-product-multi-value-text/atomic-product-multi-value-text';
11
11
  import '../atomic-product-price/atomic-product-price';
12
12
  import '../atomic-product-numeric-field-value/atomic-product-numeric-field-value';
13
- import '../atomic-product-description/atomic-product-description';
14
13
  /**
15
14
  * * A product template determines the format of the query results, depending on the conditions that are defined for each template.
16
15
  *
@@ -21,7 +21,6 @@ export { AtomicCommerceSortDropdown } from './atomic-commerce-sort-dropdown/atom
21
21
  export { AtomicCommerceText } from './atomic-commerce-text/atomic-commerce-text.js';
22
22
  export { AtomicProduct } from './atomic-product/atomic-product.js';
23
23
  export { AtomicProductChildren } from './atomic-product-children/atomic-product-children.js';
24
- export { AtomicProductDescription } from './atomic-product-description/atomic-product-description.js';
25
24
  export { AtomicProductExcerpt } from './atomic-product-excerpt/atomic-product-excerpt.js';
26
25
  export { AtomicProductLink } from './atomic-product-link/atomic-product-link.js';
27
26
  export { AtomicProductMultiValueText } from './atomic-product-multi-value-text/atomic-product-multi-value-text.js';
@@ -20,6 +20,7 @@ import { InsightInitializationOptions } from "./components/insight/atomic-insigh
20
20
  import { InsightStore } from "./components/insight/atomic-insight-interface/store";
21
21
  import { Actions, InsightResultActionClickedEvent } from "./components/insight/atomic-insight-result-action/atomic-insight-result-action";
22
22
  import { InsightResultAttachToCaseEvent } from "./components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action";
23
+ import { TruncateAfter } from "./components/common/expandable-text/stencil-expandable-text";
23
24
  import { ItemDisplayImageSize as ItemDisplayImageSize1 } from "./components.d";
24
25
  import { RecommendationEngine, InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "@coveo/headless/recommendation";
25
26
  import { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
@@ -46,6 +47,7 @@ export { InsightInitializationOptions } from "./components/insight/atomic-insigh
46
47
  export { InsightStore } from "./components/insight/atomic-insight-interface/store";
47
48
  export { Actions, InsightResultActionClickedEvent } from "./components/insight/atomic-insight-result-action/atomic-insight-result-action";
48
49
  export { InsightResultAttachToCaseEvent } from "./components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action";
50
+ export { TruncateAfter } from "./components/common/expandable-text/stencil-expandable-text";
49
51
  export { ItemDisplayImageSize as ItemDisplayImageSize1 } from "./components.d";
50
52
  export { RecommendationEngine, InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "@coveo/headless/recommendation";
51
53
  export { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
@@ -1591,6 +1593,23 @@ export namespace Components {
1591
1593
  */
1592
1594
  interface AtomicPopover {
1593
1595
  }
1596
+ /**
1597
+ * @alpha The `atomic-product-description` component renders the description of a product.
1598
+ */
1599
+ interface AtomicProductDescription {
1600
+ /**
1601
+ * The name of the description field to use.
1602
+ */
1603
+ "field": 'ec_description' | 'ec_shortdesc';
1604
+ /**
1605
+ * Whether the description should be collapsible after being expanded.
1606
+ */
1607
+ "isCollapsible": boolean;
1608
+ /**
1609
+ * The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
1610
+ */
1611
+ "truncateAfter": TruncateAfter;
1612
+ }
1594
1613
  /**
1595
1614
  * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
1596
1615
  * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
@@ -4096,6 +4115,15 @@ declare global {
4096
4115
  prototype: HTMLAtomicPopoverElement;
4097
4116
  new (): HTMLAtomicPopoverElement;
4098
4117
  };
4118
+ /**
4119
+ * @alpha The `atomic-product-description` component renders the description of a product.
4120
+ */
4121
+ interface HTMLAtomicProductDescriptionElement extends Components.AtomicProductDescription, HTMLStencilElement {
4122
+ }
4123
+ var HTMLAtomicProductDescriptionElement: {
4124
+ prototype: HTMLAtomicProductDescriptionElement;
4125
+ new (): HTMLAtomicProductDescriptionElement;
4126
+ };
4099
4127
  /**
4100
4128
  * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
4101
4129
  * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
@@ -5197,6 +5225,7 @@ declare global {
5197
5225
  "atomic-numeric-range": HTMLAtomicNumericRangeElement;
5198
5226
  "atomic-pager": HTMLAtomicPagerElement;
5199
5227
  "atomic-popover": HTMLAtomicPopoverElement;
5228
+ "atomic-product-description": HTMLAtomicProductDescriptionElement;
5200
5229
  "atomic-product-field-condition": HTMLAtomicProductFieldConditionElement;
5201
5230
  "atomic-product-image": HTMLAtomicProductImageElement;
5202
5231
  "atomic-product-rating": HTMLAtomicProductRatingElement;
@@ -6759,6 +6788,23 @@ declare namespace LocalJSX {
6759
6788
  */
6760
6789
  interface AtomicPopover {
6761
6790
  }
6791
+ /**
6792
+ * @alpha The `atomic-product-description` component renders the description of a product.
6793
+ */
6794
+ interface AtomicProductDescription {
6795
+ /**
6796
+ * The name of the description field to use.
6797
+ */
6798
+ "field"?: 'ec_description' | 'ec_shortdesc';
6799
+ /**
6800
+ * Whether the description should be collapsible after being expanded.
6801
+ */
6802
+ "isCollapsible"?: boolean;
6803
+ /**
6804
+ * The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
6805
+ */
6806
+ "truncateAfter"?: TruncateAfter;
6807
+ }
6762
6808
  /**
6763
6809
  * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
6764
6810
  * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
@@ -8399,6 +8445,7 @@ declare namespace LocalJSX {
8399
8445
  "atomic-numeric-range": AtomicNumericRange;
8400
8446
  "atomic-pager": AtomicPager;
8401
8447
  "atomic-popover": AtomicPopover;
8448
+ "atomic-product-description": AtomicProductDescription;
8402
8449
  "atomic-product-field-condition": AtomicProductFieldCondition;
8403
8450
  "atomic-product-image": AtomicProductImage;
8404
8451
  "atomic-product-rating": AtomicProductRating;
@@ -8716,6 +8763,10 @@ declare module "@stencil/core" {
8716
8763
  * The `atomic-popover` component displays any facet as a popover menu.
8717
8764
  */
8718
8765
  "atomic-popover": LocalJSX.AtomicPopover & JSXBase.HTMLAttributes<HTMLAtomicPopoverElement>;
8766
+ /**
8767
+ * @alpha The `atomic-product-description` component renders the description of a product.
8768
+ */
8769
+ "atomic-product-description": LocalJSX.AtomicProductDescription & JSXBase.HTMLAttributes<HTMLAtomicProductDescriptionElement>;
8719
8770
  /**
8720
8771
  * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
8721
8772
  * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-07-30T19:21:18",
2
+ "timestamp": "2025-07-31T01:21:42",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
@@ -6593,6 +6593,124 @@
6593
6593
  ]
6594
6594
  }
6595
6595
  },
6596
+ {
6597
+ "filePath": "src/components/commerce/atomic-product-description/atomic-product-description.tsx",
6598
+ "encapsulation": "none",
6599
+ "tag": "atomic-product-description",
6600
+ "docs": "",
6601
+ "docsTags": [
6602
+ {
6603
+ "name": "alpha",
6604
+ "text": "The `atomic-product-description` component renders the description of a product."
6605
+ }
6606
+ ],
6607
+ "usage": {},
6608
+ "props": [
6609
+ {
6610
+ "name": "field",
6611
+ "type": "\"ec_description\" | \"ec_shortdesc\"",
6612
+ "complexType": {
6613
+ "original": "'ec_description' | 'ec_shortdesc'",
6614
+ "resolved": "\"ec_description\" | \"ec_shortdesc\"",
6615
+ "references": {}
6616
+ },
6617
+ "mutable": false,
6618
+ "attr": "field",
6619
+ "reflectToAttr": false,
6620
+ "docs": "The name of the description field to use.",
6621
+ "docsTags": [],
6622
+ "default": "'ec_shortdesc'",
6623
+ "values": [
6624
+ {
6625
+ "value": "ec_description",
6626
+ "type": "string"
6627
+ },
6628
+ {
6629
+ "value": "ec_shortdesc",
6630
+ "type": "string"
6631
+ }
6632
+ ],
6633
+ "optional": false,
6634
+ "required": false
6635
+ },
6636
+ {
6637
+ "name": "isCollapsible",
6638
+ "type": "boolean",
6639
+ "complexType": {
6640
+ "original": "boolean",
6641
+ "resolved": "boolean",
6642
+ "references": {}
6643
+ },
6644
+ "mutable": false,
6645
+ "attr": "is-collapsible",
6646
+ "reflectToAttr": false,
6647
+ "docs": "Whether the description should be collapsible after being expanded.",
6648
+ "docsTags": [],
6649
+ "default": "true",
6650
+ "values": [
6651
+ {
6652
+ "type": "boolean"
6653
+ }
6654
+ ],
6655
+ "optional": false,
6656
+ "required": false
6657
+ },
6658
+ {
6659
+ "name": "truncateAfter",
6660
+ "type": "\"1\" | \"2\" | \"3\" | \"4\" | \"none\"",
6661
+ "complexType": {
6662
+ "original": "TruncateAfter",
6663
+ "resolved": "\"1\" | \"2\" | \"3\" | \"4\" | \"none\"",
6664
+ "references": {
6665
+ "TruncateAfter": {
6666
+ "location": "import",
6667
+ "path": "../../common/expandable-text/stencil-expandable-text",
6668
+ "id": "src/components/common/expandable-text/stencil-expandable-text.tsx::TruncateAfter"
6669
+ }
6670
+ }
6671
+ },
6672
+ "mutable": false,
6673
+ "attr": "truncate-after",
6674
+ "reflectToAttr": false,
6675
+ "docs": "The number of lines after which the product description should be truncated. A value of \"none\" will disable truncation.",
6676
+ "docsTags": [],
6677
+ "default": "'2'",
6678
+ "values": [
6679
+ {
6680
+ "value": "1",
6681
+ "type": "string"
6682
+ },
6683
+ {
6684
+ "value": "2",
6685
+ "type": "string"
6686
+ },
6687
+ {
6688
+ "value": "3",
6689
+ "type": "string"
6690
+ },
6691
+ {
6692
+ "value": "4",
6693
+ "type": "string"
6694
+ },
6695
+ {
6696
+ "value": "none",
6697
+ "type": "string"
6698
+ }
6699
+ ],
6700
+ "optional": false,
6701
+ "required": false
6702
+ }
6703
+ ],
6704
+ "methods": [],
6705
+ "events": [],
6706
+ "listeners": [],
6707
+ "styles": [],
6708
+ "slots": [],
6709
+ "parts": [],
6710
+ "dependents": [],
6711
+ "dependencies": [],
6712
+ "dependencyGraph": {}
6713
+ },
6596
6714
  {
6597
6715
  "filePath": "src/components/commerce/atomic-product-field-condition/atomic-product-field-condition.tsx",
6598
6716
  "encapsulation": "none",
@@ -17691,6 +17809,11 @@
17691
17809
  "docstring": "",
17692
17810
  "path": "src/components/common/item-list/stencil-item-list-common.tsx"
17693
17811
  },
17812
+ "src/components/common/expandable-text/stencil-expandable-text.tsx::TruncateAfter": {
17813
+ "declaration": "export type TruncateAfter = 'none' | '1' | '2' | '3' | '4';",
17814
+ "docstring": "",
17815
+ "path": "src/components/common/expandable-text/stencil-expandable-text.tsx"
17816
+ },
17694
17817
  "src/components.d.ts::ItemDisplayImageSize": {
17695
17818
  "declaration": "any",
17696
17819
  "docstring": "",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.31.2-pre.897497238c",
4
+ "version": "3.31.2-pre.8be4e70346",
5
5
  "description": "A web-component library for building modern UIs interfacing with the Coveo platform",
6
6
  "homepage": "https://docs.coveo.com/en/atomic/latest/",
7
7
  "repository": {
@@ -72,7 +72,7 @@
72
72
  "dependencies": {
73
73
  "@lit/context": "1.1.6",
74
74
  "@coveo/bueno": "1.0.24",
75
- "@coveo/headless": "3.27.7",
75
+ "@coveo/headless": "3.27.8-pre.8be4e70346",
76
76
  "@popperjs/core": "2.11.8",
77
77
  "@salesforce-ux/design-system": "2.27.2",
78
78
  "@stencil/core": "4.20.0",
@@ -158,7 +158,7 @@
158
158
  },
159
159
  "peerDependencies": {
160
160
  "@coveo/bueno": "1.0.24",
161
- "@coveo/headless": "3.27.7",
161
+ "@coveo/headless": "3.27.8-pre.8be4e70346",
162
162
  "typescript": ">=5.0.0"
163
163
  },
164
164
  "peerDependenciesMeta": {
@@ -1,149 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Schema, StringValue } from '@coveo/bueno';
8
- import { html, LitElement, nothing, unsafeCSS } from 'lit';
9
- import { customElement, property, state } from 'lit/decorators.js';
10
- import { createRef } from 'lit/directives/ref.js';
11
- import { booleanConverter } from "../../../converters/boolean-converter.js";
12
- import { bindingGuard } from "../../../decorators/binding-guard.js";
13
- import { bindings } from "../../../decorators/bindings.js";
14
- import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
15
- import { errorGuard } from "../../../decorators/error-guard.js";
16
- import { injectStylesForNoShadowDOM } from "../../../decorators/inject-styles-for-no-shadow-dom.js";
17
- import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
18
- import { renderExpandableText, } from '../../common/expandable-text/expandable-text.js';
19
- import styles from './atomic-product-description.tw.css';
20
- import '../atomic-product-text/atomic-product-text.js';
21
- /**
22
- * The `atomic-product-description` component renders the description of a product.
23
- *
24
- * @part expandable-text - The part that contains the product description text.
25
- */
26
- let AtomicProductDescription = class AtomicProductDescription extends LitElement {
27
- initialize() { }
28
- constructor() {
29
- super();
30
- this.productController = createProductContextController(this);
31
- this.isExpanded = false;
32
- this.isTruncated = false;
33
- this.descriptionRef = createRef();
34
- /**
35
- * The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
36
- */
37
- this.truncateAfter = '2';
38
- /**
39
- * The name of the description field to use.
40
- */
41
- this.field = 'ec_shortdesc';
42
- /**
43
- * Whether the description should be collapsible after being expanded.
44
- */
45
- this.isCollapsible = true;
46
- this.onToggleExpand = (e) => {
47
- if (e) {
48
- e.stopPropagation();
49
- }
50
- this.isExpanded = !this.isExpanded;
51
- };
52
- this.resizeObserver = new ResizeObserver(() => {
53
- if (this.descriptionRef.value) {
54
- this.isTruncated =
55
- this.descriptionRef.value.scrollHeight >
56
- this.descriptionRef.value.clientHeight;
57
- }
58
- });
59
- }
60
- validateProps() {
61
- new Schema({
62
- truncateAfter: new StringValue({
63
- constrainTo: ['none', '1', '2', '3', '4'],
64
- }),
65
- field: new StringValue({
66
- constrainTo: ['ec_shortdesc', 'ec_description'],
67
- }),
68
- }).validate({
69
- truncateAfter: this.truncateAfter,
70
- field: this.field,
71
- });
72
- }
73
- updated(changedProperties) {
74
- super.updated(changedProperties);
75
- if (changedProperties.has('truncateAfter') ||
76
- changedProperties.has('field')) {
77
- this.validateProps();
78
- }
79
- }
80
- firstUpdated() {
81
- if (this.descriptionRef.value) {
82
- this.resizeObserver.observe(this.descriptionRef.value);
83
- }
84
- }
85
- disconnectedCallback() {
86
- super.disconnectedCallback();
87
- this.resizeObserver.disconnect();
88
- }
89
- get product() {
90
- return this.productController.item;
91
- }
92
- render() {
93
- const productDescription = this.product?.[this.field] ?? null;
94
- if (!productDescription) {
95
- return html `${nothing}`;
96
- }
97
- return html `${renderExpandableText({
98
- props: {
99
- isExpanded: this.isExpanded,
100
- isTruncated: this.isTruncated,
101
- truncateAfter: this.truncateAfter,
102
- onToggleExpand: this.onToggleExpand,
103
- showMoreLabel: this.bindings.i18n.t('show-more'),
104
- showLessLabel: this.bindings.i18n.t('show-less'),
105
- isCollapsible: this.isCollapsible,
106
- textRef: this.descriptionRef,
107
- },
108
- })(html `
109
- <atomic-product-text field=${this.field}></atomic-product-text>
110
- `)}`;
111
- }
112
- };
113
- AtomicProductDescription.styles = unsafeCSS(styles);
114
- __decorate([
115
- state()
116
- ], AtomicProductDescription.prototype, "bindings", void 0);
117
- __decorate([
118
- state()
119
- ], AtomicProductDescription.prototype, "isExpanded", void 0);
120
- __decorate([
121
- state()
122
- ], AtomicProductDescription.prototype, "isTruncated", void 0);
123
- __decorate([
124
- property({
125
- type: String,
126
- attribute: 'truncate-after',
127
- })
128
- ], AtomicProductDescription.prototype, "truncateAfter", void 0);
129
- __decorate([
130
- property()
131
- ], AtomicProductDescription.prototype, "field", void 0);
132
- __decorate([
133
- property({
134
- type: Boolean,
135
- converter: booleanConverter,
136
- attribute: 'is-collapsible',
137
- })
138
- ], AtomicProductDescription.prototype, "isCollapsible", void 0);
139
- __decorate([
140
- errorGuard(),
141
- bindingGuard()
142
- ], AtomicProductDescription.prototype, "render", null);
143
- AtomicProductDescription = __decorate([
144
- customElement('atomic-product-description'),
145
- withTailwindStyles,
146
- injectStylesForNoShadowDOM,
147
- bindings()
148
- ], AtomicProductDescription);
149
- export { AtomicProductDescription };
@@ -1,3 +0,0 @@
1
- const css = `/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
2
- .expandable-text{line-height:var(--line-height)}.min-lines-1{min-height:calc(var(--line-height)*1)}.min-lines-2{min-height:calc(var(--line-height)*2)}.min-lines-3{min-height:calc(var(--line-height)*3)}.min-lines-4{min-height:calc(var(--line-height)*4)}`;
3
- export default [css];