@coveo/atomic 3.33.4 → 3.33.5-pre.0b6ca95bda

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 (74) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/components/analytics-config.js +1 -1
  3. package/dist/atomic/components/analytics-config.js.map +1 -1
  4. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.tw.css.js +1 -2
  5. package/dist/atomic/components/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.js +1 -2
  6. package/dist/atomic/components/components/commerce/atomic-commerce-facet-number-input/atomic-commerce-facet-number-input.js +1 -1
  7. package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +98 -89
  8. package/dist/atomic/components/components/commerce/atomic-commerce-layout/atomic-commerce-layout.tw.css.js +5 -1
  9. package/dist/atomic/components/components/commerce/atomic-commerce-product-list/atomic-commerce-product-list.js +1 -2
  10. package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.js +1 -1
  11. package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-list/atomic-commerce-recommendation-list.js +1 -2
  12. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +7 -2
  13. package/dist/atomic/components/components/commerce/atomic-product/atomic-product.tw.css.js +1 -2
  14. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.tw.css.js +1 -2
  15. package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +2 -1
  16. package/dist/atomic/components/components/commerce/atomic-product-section-actions/atomic-product-section-actions.js +1 -2
  17. package/dist/atomic/components/components/commerce/atomic-product-section-badges/atomic-product-section-badges.js +1 -2
  18. package/dist/atomic/components/components/commerce/atomic-product-section-bottom-metadata/atomic-product-section-bottom-metadata.js +1 -2
  19. package/dist/atomic/components/components/commerce/atomic-product-section-children/atomic-product-section-children.js +1 -2
  20. package/dist/atomic/components/components/commerce/atomic-product-section-description/atomic-product-section-description.js +1 -2
  21. package/dist/atomic/components/components/commerce/atomic-product-section-emphasized/atomic-product-section-emphasized.js +1 -2
  22. package/dist/atomic/components/components/commerce/atomic-product-section-metadata/atomic-product-section-metadata.js +1 -2
  23. package/dist/atomic/components/components/commerce/atomic-product-section-name/atomic-product-section-name.js +1 -2
  24. package/dist/atomic/components/components/commerce/atomic-product-section-visual/atomic-product-section-visual.js +1 -2
  25. package/dist/atomic/components/components/common/atomic-icon/atomic-icon.js +1 -1
  26. package/dist/atomic/components/components/common/atomic-rating/atomic-rating.tw.css.js +1 -2
  27. package/dist/atomic/components/components/common/atomic-rating/rating-utils.js +11 -0
  28. package/dist/atomic/components/components/common/atomic-rating/rating.js +0 -11
  29. package/dist/atomic/components/components/common/facets/facet-common.tw.css.js +1 -2
  30. package/dist/atomic/components/components/common/facets/facet-search/facet-search.tw.css.js +1 -2
  31. package/dist/atomic/components/components/common/facets/facet-value-box/facet-value-box.tw.css.js +1 -2
  32. package/dist/atomic/components/components/common/facets/facet-value-checkbox/facet-value-checkbox.tw.css.js +1 -2
  33. package/dist/atomic/components/components/common/item-list/styles/grid-display.tw.css.js +1 -2
  34. package/dist/atomic/components/components/common/item-list/styles/list-display.tw.css.js +1 -2
  35. package/dist/atomic/components/components/common/item-list/styles/placeholders.tw.css.js +1 -1
  36. package/dist/atomic/components/components/common/item-list/styles/table-display.tw.css.js +1 -2
  37. package/dist/atomic/components/components/search/atomic-search-layout/atomic-search-layout.tw.css.js +5 -1
  38. package/dist/atomic/components/global/environment.js +1 -1
  39. package/dist/atomic/components/index.js.map +1 -1
  40. package/dist/atomic/components/utils/coveo.tw.css.js +7 -1
  41. package/dist/atomic/components/utils/tailwind.global.tw.css.js +7 -2
  42. package/dist/atomic/index.esm.js.map +1 -1
  43. package/dist/atomic/{p-b8634400.entry.js → p-1980ff16.entry.js} +2 -2
  44. package/dist/atomic/{p-a1d7fe61.entry.js → p-4c029532.entry.js} +2 -2
  45. package/dist/atomic/{p-3dbda99d.js → p-82c1d868.js} +2 -2
  46. package/dist/atomic/{p-3dbda99d.js.map → p-82c1d868.js.map} +1 -1
  47. package/dist/atomic/{p-ae4076fc.entry.js → p-df6f872b.entry.js} +2 -2
  48. package/dist/cjs/{analytics-config-deec65cf.js → analytics-config-bfa1c9c7.js} +2 -2
  49. package/dist/cjs/analytics-config-bfa1c9c7.js.map +1 -0
  50. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  51. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  52. package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
  53. package/dist/cjs/index.cjs.js.map +1 -1
  54. package/dist/cjs/version.cjs.js +2 -2
  55. package/dist/esm/{analytics-config-b6aff736.js → analytics-config-e264ae7c.js} +2 -2
  56. package/dist/esm/analytics-config-e264ae7c.js.map +1 -0
  57. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  58. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  59. package/dist/esm/atomic-search-interface.entry.js +1 -1
  60. package/dist/esm/index.js.map +1 -1
  61. package/dist/esm/version.js +2 -2
  62. package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +20 -20
  63. package/dist/types/components/commerce/product-template-component-utils/stencil-product-template-decorators.d.ts +0 -20
  64. package/dist/types/components/common/atomic-rating/rating-utils.d.ts +1 -0
  65. package/dist/types/components/common/atomic-rating/rating.d.ts +0 -1
  66. package/docs/atomic-docs.json +1 -1
  67. package/package.json +6 -6
  68. package/dist/cjs/analytics-config-deec65cf.js.map +0 -1
  69. package/dist/esm/analytics-config-b6aff736.js.map +0 -1
  70. package/dist/types/components/commerce/product-list/stencil-product-template-provider.d.ts +0 -8
  71. package/dist/types/components/commerce/sort/stencil-option.d.ts +0 -10
  72. /package/dist/atomic/{p-b8634400.entry.js.map → p-1980ff16.entry.js.map} +0 -0
  73. /package/dist/atomic/{p-a1d7fe61.entry.js.map → p-4c029532.entry.js.map} +0 -0
  74. /package/dist/atomic/{p-ae4076fc.entry.js.map → p-df6f872b.entry.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, s as setNonce, h, H as Host, g as getElement } from './index-3f35faca.js';
2
2
  import { m as markParentAsReady } from './init-queue-fbe942c3.js';
3
3
  import { buildResultsPerPage, loadFieldActions, buildInsightEngine } from '@coveo/headless/insight';
4
- import { g as getNextAnalyticsConfig, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance } from './analytics-config-b6aff736.js';
4
+ import { g as getNextAnalyticsConfig, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance } from './analytics-config-e264ae7c.js';
5
5
  import { A as ArrayProp } from './props-utils-76e19fa7.js';
6
6
  import { D as DEFAULT_MOBILE_BREAKPOINT } from './replace-breakpoint-213367f8.js';
7
7
  import { u as unsetLoadingFlag, s as setLoadingFlag, r as registerFacet, g as getFacetElements, w as waitUntilAppLoaded, a as createBaseStore } from './store-e14e2958.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, s as setNonce, h, g as getElement } from './index-3f35faca.js';
2
2
  import { m as markParentAsReady } from './init-queue-fbe942c3.js';
3
3
  import { loadRecommendationActions, loadSearchConfigurationActions, EcommerceDefaultFieldsToInclude, loadFieldActions, buildRecommendationEngine } from '@coveo/headless/recommendation';
4
- import { g as getNextAnalyticsConfig, c as augmentAnalyticsConfigWithDocument, d as augmentAnalyticsConfigWithAtomicVersion, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-b6aff736.js';
4
+ import { g as getNextAnalyticsConfig, c as augmentAnalyticsConfigWithDocument, d as augmentAnalyticsConfigWithAtomicVersion, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-e264ae7c.js';
5
5
  import { A as ArrayProp } from './props-utils-76e19fa7.js';
6
6
  import { u as unsetLoadingFlag, s as setLoadingFlag, a as createBaseStore } from './store-e14e2958.js';
7
7
  import './dayjs.min-d04628c6.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, s as setNonce, h, g as getElement } from './index-3f35faca.js';
2
2
  import { m as markParentAsReady } from './init-queue-fbe942c3.js';
3
3
  import { loadSearchConfigurationActions, loadQueryActions, EcommerceDefaultFieldsToInclude, loadFieldActions, buildSearchEngine, buildUrlManager, buildSearchStatus } from '@coveo/headless';
4
- import { g as getNextAnalyticsConfig, d as augmentAnalyticsConfigWithAtomicVersion, c as augmentAnalyticsConfigWithDocument, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-b6aff736.js';
4
+ import { g as getNextAnalyticsConfig, d as augmentAnalyticsConfigWithAtomicVersion, c as augmentAnalyticsConfigWithDocument, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-e264ae7c.js';
5
5
  import { a as StorageItems, S as SafeStorage } from './local-storage-utils-410269e6.js';
6
6
  import { A as ArrayProp } from './props-utils-76e19fa7.js';
7
7
  import { D as DEFAULT_MOBILE_BREAKPOINT } from './replace-breakpoint-213367f8.js';
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;;;;;;AAiCA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCjCa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for product template components.\n * This allows the Stencil component to fetch the current product from its rendered parent, the `atomic-product` component.\n *\n * Example:\n * ```\n * @ProductContext() private product!: Product;\n * ```\n *\n * For more information and examples, view the [Utilities section](https://github.com/coveo/ui-kit/tree/master/packages/atomic#utilities) of the Coveo Atomic README.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `createProductContextController` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function ProductContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-product', folded: opts.folded});\n}\n\nexport function InteractiveProductContext() {\n return InteractiveItemContext();\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;AAGA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCHa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- export const headlessVersion = '4.0.0';
2
- export const atomicVersion = '3.33.4';
1
+ export const headlessVersion = '3.30.1-pre.0b6ca95bda';
2
+ export const atomicVersion = '3.33.5-pre.0b6ca95bda';
@@ -1,4 +1,4 @@
1
- import { type CommerceEngine, type CommerceEngineConfiguration, type Context, type LogLevel, type ProductListingSummaryState, type SearchSummaryState, type Summary, type UrlManager } from '@coveo/headless/commerce';
1
+ import { type CommerceEngine, type CommerceEngineConfiguration, type Context, type LogLevel, type ProductListing, type ProductListingSummaryState, type Search, type SearchSummaryState, type Summary, type UrlManager } from '@coveo/headless/commerce';
2
2
  import { type i18n } from 'i18next';
3
3
  import { type CSSResultGroup, LitElement } from 'lit';
4
4
  import type { CommonBindings } from '../../common/interface/bindings';
@@ -16,16 +16,17 @@ declare const AtomicCommerceInterface_base: typeof LitElement;
16
16
  * @slot default - The default slot where you can add child components to the interface.
17
17
  */
18
18
  export declare class AtomicCommerceInterface extends AtomicCommerceInterface_base implements BaseAtomicInterface<CommerceEngine> {
19
- urlManager: UrlManager;
20
- private searchOrListing;
21
- summary: Summary<SearchSummaryState | ProductListingSummaryState>;
19
+ bindings: CommerceBindings;
22
20
  context: Context;
21
+ error: Error;
22
+ summary: Summary<SearchSummaryState | ProductListingSummaryState>;
23
+ urlManager: UrlManager;
24
+ searchOrListing: Search | ProductListing;
23
25
  private unsubscribeUrlManager?;
24
26
  private unsubscribeSummary?;
25
27
  private initialized;
26
28
  private store;
27
29
  private interfaceController;
28
- error: Error;
29
30
  static styles: CSSResultGroup;
30
31
  /**
31
32
  * The type of the interface.
@@ -85,13 +86,6 @@ export declare class AtomicCommerceInterface extends AtomicCommerceInterface_bas
85
86
  private i18Initialized;
86
87
  constructor();
87
88
  connectedCallback(): void;
88
- toggleAnalytics(): void;
89
- updateLanguage(): void;
90
- updateIconAssetsPath(): void;
91
- disconnectedCallback(): void;
92
- private updateMobileBreakpoint;
93
- private handleInitialization;
94
- scrollToTop(): void;
95
89
  /**
96
90
  * Initializes the connection with the headless commerce engine using the specified options.
97
91
  */
@@ -106,19 +100,25 @@ export declare class AtomicCommerceInterface extends AtomicCommerceInterface_bas
106
100
  * Executes the first request after initializing connection to the headless commerce engine.
107
101
  */
108
102
  executeFirstRequest(): Promise<void>;
109
- bindings: CommerceBindings;
110
- private internalInitialization;
103
+ toggleAnalytics(): void;
104
+ updateIconAssetsPath(): void;
105
+ updateLanguage(): void;
106
+ disconnectedCallback(): void;
107
+ render(): import("lit-html").TemplateResult<1>;
108
+ private get fragment();
111
109
  private getBindings;
110
+ private handleInitialization;
111
+ private initContext;
112
112
  private initEngine;
113
- private get fragment();
114
- private initUrlManager;
113
+ private initLanguage;
115
114
  private initRequestStatus;
116
115
  private initSummary;
117
- private initContext;
118
- private initLanguage;
119
- private updateHash;
116
+ private initUrlManager;
117
+ private internalInitialization;
120
118
  private onHashChange;
121
- render(): import("lit-html").TemplateResult<1>;
119
+ scrollToTop(): void;
120
+ private updateHash;
121
+ private updateMobileBreakpoint;
122
122
  }
123
123
  declare global {
124
124
  interface HTMLElementTagNameMap {
@@ -1,24 +1,4 @@
1
1
  import { Product } from '@coveo/headless/commerce';
2
- import { InteractiveItemContextEvent, ItemContextEvent } from '../../common/item-list/stencil-item-decorators';
3
- /**
4
- * A [StencilJS property decorator](https://stenciljs.com/) to be used for product template components.
5
- * This allows the Stencil component to fetch the current product from its rendered parent, the `atomic-product` component.
6
- *
7
- * Example:
8
- * ```
9
- * @ProductContext() private product!: Product;
10
- * ```
11
- *
12
- * For more information and examples, view the [Utilities section](https://github.com/coveo/ui-kit/tree/master/packages/atomic#utilities) of the Coveo Atomic README.
13
- *
14
- * @deprecated should only be used for Stencil components. For Lit components, use `createProductContextController` from \@/src/decorators/commerce/product-template-decorators.ts
15
- */
16
- export declare function ProductContext(opts?: {
17
- folded: boolean;
18
- }): (component: import("@stencil/core").ComponentInterface, itemVariable: string) => void;
19
- export declare function InteractiveProductContext(): (component: import("@stencil/core").ComponentInterface, interactiveItemVariable: string) => void;
20
- export type ProductContextEvent<T = Product> = ItemContextEvent<T>;
21
- export type InteractiveProductContextEvent = InteractiveItemContextEvent;
22
2
  /**
23
3
  * Retrieves `Product` on a rendered `atomic-product`.
24
4
  *
@@ -0,0 +1 @@
1
+ export declare const computeNumberOfStars: (value: unknown, field: string) => number | null;
@@ -18,4 +18,3 @@ export type { RatingProps };
18
18
  * @cssprop --atomic-rating-icon-inactive-color - Color of the icon when inactive.
19
19
  */
20
20
  export declare const renderRating: FunctionalComponent<RatingProps>;
21
- export declare const computeNumberOfStars: (value: unknown, field: string) => number | null;
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-09-10T02:37:49",
2
+ "timestamp": "2025-09-17T18:31:14",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.33.4",
4
+ "version": "3.33.5-pre.0b6ca95bda",
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": {
@@ -80,13 +80,14 @@
80
80
  "validate:definitions": "tsc --noEmit --esModuleInterop --skipLibCheck ./dist/types/components.d.ts"
81
81
  },
82
82
  "dependencies": {
83
- "@coveo/bueno": "1.1.0",
84
- "@coveo/headless": "4.0.0",
83
+ "@coveo/bueno": "1.1.1-pre.0b6ca95bda",
84
+ "@coveo/headless": "3.30.1-pre.0b6ca95bda",
85
85
  "@lit/context": "1.1.6",
86
86
  "@open-wc/lit-helpers": "0.7.0",
87
87
  "@popperjs/core": "2.11.8",
88
88
  "@salesforce-ux/design-system": "2.27.2",
89
89
  "@stencil/core": "4.20.0",
90
+ "cssnano": "7.1.1",
90
91
  "dayjs": "1.11.13",
91
92
  "dompurify": "3.2.6",
92
93
  "escape-html": "1.0.3",
@@ -138,7 +139,6 @@
138
139
  "jest-cli": "29.7.0",
139
140
  "jest-environment-node": "29.7.0",
140
141
  "jest-localstorage-mock": "2.4.26",
141
- "lightningcss": "1.29.1",
142
142
  "local-web-server": "5.4.0",
143
143
  "natural-orderby": "5.0.0",
144
144
  "ora": "8.2.0",
@@ -163,8 +163,8 @@
163
163
  "wait-on": "8.0.4"
164
164
  },
165
165
  "peerDependencies": {
166
- "@coveo/bueno": "1.1.0",
167
- "@coveo/headless": "4.0.0",
166
+ "@coveo/bueno": "1.1.1-pre.0b6ca95bda",
167
+ "@coveo/headless": "3.30.1-pre.0b6ca95bda",
168
168
  "typescript": ">=5.0.0"
169
169
  },
170
170
  "peerDependenciesMeta": {