@coveo/atomic 3.34.0-pre.cf62afc8af → 3.34.0-pre.d29cb64477
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/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/_index.js +19 -19
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-field-condition.js +1 -1
- package/dist/atomic/components/atomic-field-condition.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
- package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
- package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
- package/dist/atomic/components/atomic-quickview.js +2 -2
- package/dist/atomic/components/atomic-quickview.js.map +1 -1
- package/dist/atomic/components/atomic-result-badge.js +1 -1
- package/dist/atomic/components/atomic-result-badge.js.map +1 -1
- package/dist/atomic/components/atomic-result-children.js +2 -2
- package/dist/atomic/components/atomic-result-children.js.map +1 -1
- package/dist/atomic/components/atomic-result-date.js +1 -1
- package/dist/atomic/components/atomic-result-date.js.map +1 -1
- package/dist/atomic/components/atomic-result-fields-list.js +2 -2
- package/dist/atomic/components/atomic-result-fields-list.js.map +1 -1
- package/dist/atomic/components/atomic-result-html.js +1 -1
- package/dist/atomic/components/atomic-result-html.js.map +1 -1
- package/dist/atomic/components/atomic-result-icon.js +1 -1
- package/dist/atomic/components/atomic-result-icon.js.map +1 -1
- package/dist/atomic/components/atomic-result-image.js +1 -1
- package/dist/atomic/components/atomic-result-image.js.map +1 -1
- package/dist/atomic/components/atomic-result-link.js +2 -2
- package/dist/atomic/components/atomic-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-result-localized-text.js +1 -1
- package/dist/atomic/components/atomic-result-localized-text.js.map +1 -1
- package/dist/atomic/components/atomic-result-multi-value-text.js +1 -1
- package/dist/atomic/components/atomic-result-multi-value-text.js.map +1 -1
- package/dist/atomic/components/atomic-result-number.js +1 -1
- package/dist/atomic/components/atomic-result-number.js.map +1 -1
- package/dist/atomic/components/atomic-result-printable-uri.js +1 -1
- package/dist/atomic/components/atomic-result-printable-uri.js.map +1 -1
- package/dist/atomic/components/atomic-result-rating.js +1 -1
- package/dist/atomic/components/atomic-result-rating.js.map +1 -1
- package/dist/atomic/components/atomic-result-text2.js +1 -1
- package/dist/atomic/components/atomic-result-text2.js.map +1 -1
- package/dist/atomic/components/atomic-result-timespan.js +1 -1
- package/dist/atomic/components/atomic-result-timespan.js.map +1 -1
- package/dist/atomic/components/atomic-result2.js.map +1 -1
- package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
- package/dist/atomic/components/components/commerce/atomic-product/atomic-product.js +26 -58
- package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
- package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
- package/dist/atomic/components/components/common/layout/custom-render-controller.js +37 -0
- package/dist/atomic/components/components/common/layout/item-layout-controller.js +103 -0
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
- package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
- package/dist/atomic/index.esm.js +1 -1
- package/dist/atomic/index.esm.js.map +1 -1
- package/dist/atomic/{p-0c8e7d5f.entry.js → p-0112f957.entry.js} +2 -2
- package/dist/atomic/p-0112f957.entry.js.map +1 -0
- package/dist/atomic/{p-c8eba3e5.js → p-02f6542d.js} +2 -2
- package/dist/atomic/{p-b313058c.entry.js → p-049228f2.entry.js} +2 -2
- package/dist/atomic/p-049228f2.entry.js.map +1 -0
- package/dist/atomic/{p-4f4c9a03.entry.js → p-1ff761e0.entry.js} +2 -2
- package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
- package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
- package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
- package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
- package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
- package/dist/atomic/p-4080f740.js.map +1 -0
- package/dist/atomic/{p-01511388.entry.js → p-464370f7.entry.js} +2 -2
- package/dist/atomic/p-464370f7.entry.js.map +1 -0
- package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
- package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
- package/dist/atomic/{p-2e4628bb.entry.js → p-5894d6f6.entry.js} +2 -2
- package/dist/atomic/p-5894d6f6.entry.js.map +1 -0
- package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
- package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
- package/dist/atomic/{p-fafd5042.entry.js → p-5f2abcb4.entry.js} +2 -2
- package/dist/atomic/p-5f2abcb4.entry.js.map +1 -0
- package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
- package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
- package/dist/atomic/p-6f34dd3a.entry.js.map +1 -1
- package/dist/atomic/{p-ee957926.entry.js → p-8ce6badd.entry.js} +2 -2
- package/dist/atomic/p-8ce6badd.entry.js.map +1 -0
- package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
- package/dist/atomic/p-8e964890.entry.js.map +1 -0
- package/dist/atomic/{p-dbf0c5a3.entry.js → p-9564d67d.entry.js} +2 -2
- package/dist/atomic/{p-dbf0c5a3.entry.js.map → p-9564d67d.entry.js.map} +1 -1
- package/dist/atomic/{p-bbfe727a.entry.js → p-99d3a8ce.entry.js} +2 -2
- package/dist/atomic/p-99d3a8ce.entry.js.map +1 -0
- package/dist/atomic/{p-c9f1790d.entry.js → p-acb1704c.entry.js} +2 -2
- package/dist/atomic/p-acb1704c.entry.js.map +1 -0
- package/dist/atomic/{p-013f4aeb.entry.js → p-baf5bcb7.entry.js} +2 -2
- package/dist/atomic/{p-0f39889d.entry.js → p-c34f8190.entry.js} +2 -2
- package/dist/atomic/p-c34f8190.entry.js.map +1 -0
- package/dist/atomic/{p-c25f1437.entry.js → p-c41ab197.entry.js} +2 -2
- package/dist/atomic/p-c41ab197.entry.js.map +1 -0
- package/dist/atomic/{p-93f1d551.entry.js → p-c6e2939f.entry.js} +2 -2
- package/dist/atomic/p-c6e2939f.entry.js.map +1 -0
- package/dist/atomic/{p-723f76a1.entry.js → p-ca8c87ce.entry.js} +2 -2
- package/dist/atomic/{p-723f76a1.entry.js.map → p-ca8c87ce.entry.js.map} +1 -1
- package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
- package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
- package/dist/atomic/{p-a3c83dc7.entry.js → p-d5b0a69d.entry.js} +2 -2
- package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
- package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
- package/dist/atomic/{p-7fd5b6ac.entry.js → p-e983d6cc.entry.js} +2 -2
- package/dist/atomic/p-e983d6cc.entry.js.map +1 -0
- package/dist/atomic/{p-87f69e53.entry.js → p-ed603210.entry.js} +2 -2
- package/dist/atomic/p-ed603210.entry.js.map +1 -0
- package/dist/cjs/_index.cjs.js +20 -20
- package/dist/cjs/{analytics-config-63c156a6.js → analytics-config-e9505710.js} +2 -2
- package/dist/cjs/{analytics-config-63c156a6.js.map → analytics-config-e9505710.js.map} +1 -1
- package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
- package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
- package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
- package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
- package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
- package/dist/cjs/version.cjs.js +2 -2
- package/dist/esm/_index.js +19 -19
- package/dist/esm/{analytics-config-820d73d7.js → analytics-config-35bbc9f5.js} +2 -2
- package/dist/esm/{analytics-config-820d73d7.js.map → analytics-config-35bbc9f5.js.map} +1 -1
- package/dist/esm/atomic-field-condition.entry.js +1 -1
- package/dist/esm/atomic-field-condition.entry.js.map +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-insight-result-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
- package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
- package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-quickview-modal.entry.js +1 -1
- package/dist/esm/atomic-quickview.entry.js +2 -2
- package/dist/esm/atomic-quickview.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-result-badge.entry.js +1 -1
- package/dist/esm/atomic-result-badge.entry.js.map +1 -1
- package/dist/esm/atomic-result-children.entry.js +2 -2
- package/dist/esm/atomic-result-children.entry.js.map +1 -1
- package/dist/esm/atomic-result-date.entry.js +1 -1
- package/dist/esm/atomic-result-date.entry.js.map +1 -1
- package/dist/esm/atomic-result-fields-list.entry.js +2 -2
- package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
- package/dist/esm/atomic-result-html.entry.js +1 -1
- package/dist/esm/atomic-result-html.entry.js.map +1 -1
- package/dist/esm/atomic-result-icon.entry.js +1 -1
- package/dist/esm/atomic-result-icon.entry.js.map +1 -1
- package/dist/esm/atomic-result-image.entry.js +1 -1
- package/dist/esm/atomic-result-image.entry.js.map +1 -1
- package/dist/esm/atomic-result-link.entry.js +2 -2
- package/dist/esm/atomic-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-result-localized-text.entry.js +2 -2
- package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
- package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
- package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
- package/dist/esm/atomic-result-number.entry.js +1 -1
- package/dist/esm/atomic-result-number.entry.js.map +1 -1
- package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
- package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
- package/dist/esm/atomic-result-rating.entry.js +1 -1
- package/dist/esm/atomic-result-rating.entry.js.map +1 -1
- package/dist/esm/atomic-result-text_2.entry.js +1 -1
- package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
- package/dist/esm/atomic-result-timespan.entry.js +1 -1
- package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
- package/dist/esm/atomic-result.entry.js.map +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
- package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
- package/dist/esm/version.js +2 -2
- package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +5 -17
- package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
- package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
- package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
- package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
- package/dist/types/components/common/layout/custom-render-controller.d.ts +25 -0
- package/dist/types/components/common/layout/item-layout-controller.d.ts +47 -0
- package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
- package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
- package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
- package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
- package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
- package/dist/types/components/search/{result-template-components/result-template-decorators.d.ts → result-template-component-utils/context/stencil-result-template-decorators.d.ts} +6 -2
- package/dist/types/index.d.ts +3 -3
- package/docs/atomic-docs.json +1 -1
- package/package.json +7 -7
- package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
- package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
- package/dist/atomic/components/result-template-decorators.js.map +0 -1
- package/dist/atomic/p-01511388.entry.js.map +0 -1
- package/dist/atomic/p-0c8e7d5f.entry.js.map +0 -1
- package/dist/atomic/p-0f39889d.entry.js.map +0 -1
- package/dist/atomic/p-18684d4c.js.map +0 -1
- package/dist/atomic/p-190ddaca.entry.js.map +0 -1
- package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
- package/dist/atomic/p-2e4628bb.entry.js.map +0 -1
- package/dist/atomic/p-4069d801.entry.js.map +0 -1
- package/dist/atomic/p-78427c6a.entry.js.map +0 -1
- package/dist/atomic/p-7fd5b6ac.entry.js.map +0 -1
- package/dist/atomic/p-852cc16d.entry.js.map +0 -1
- package/dist/atomic/p-87f69e53.entry.js.map +0 -1
- package/dist/atomic/p-93f1d551.entry.js.map +0 -1
- package/dist/atomic/p-945ddd53.entry.js.map +0 -1
- package/dist/atomic/p-b313058c.entry.js.map +0 -1
- package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
- package/dist/atomic/p-bbfe727a.entry.js.map +0 -1
- package/dist/atomic/p-c25f1437.entry.js.map +0 -1
- package/dist/atomic/p-c9f1790d.entry.js.map +0 -1
- package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
- package/dist/atomic/p-ee957926.entry.js.map +0 -1
- package/dist/atomic/p-fafd5042.entry.js.map +0 -1
- package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
- package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
- package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
- /package/dist/atomic/{p-c8eba3e5.js.map → p-02f6542d.js.map} +0 -0
- /package/dist/atomic/{p-4f4c9a03.entry.js.map → p-1ff761e0.entry.js.map} +0 -0
- /package/dist/atomic/{p-013f4aeb.entry.js.map → p-baf5bcb7.entry.js.map} +0 -0
- /package/dist/atomic/{p-a3c83dc7.entry.js.map → p-d5b0a69d.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-smart-snippet-source2.js","mappings":";;;;;;;;;;;;;;;;MA4Ba,wBAAwB;;;;;;;;;;;IAc5B,aAAa,CAAC,KAAiC;QACpD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3B;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,EAAC,qBAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,SAAS,EAAC,gBAAgB,EAC1B,IAAI,EAAC,YAAY,EACjB,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAEjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CACC,EACxB,EAAC,qBAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EACxB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,SAAS,EAAC,OAAO,EACjB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAElE,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GACL,CACA,CACnB,EACP;KACH;;;;;;AApD4B;IAA5B,kBAAkB,EAAE;0DAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/common/smart-snippets/atomic-smart-snippet-source.tsx"],"sourcesContent":["import {Result} from '@coveo/headless';\nimport {\n Component,\n Prop,\n h,\n Listen,\n State,\n EventEmitter,\n Event,\n Host,\n} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {
|
1
|
+
{"file":"atomic-smart-snippet-source2.js","mappings":";;;;;;;;;;;;;;;;MA4Ba,wBAAwB;;;;;;;;;;;IAc5B,aAAa,CAAC,KAAiC;QACpD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3B;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,EAAC,qBAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,SAAS,EAAC,gBAAgB,EAC1B,IAAI,EAAC,YAAY,EACjB,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAEjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CACC,EACxB,EAAC,qBAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EACxB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,SAAS,EAAC,OAAO,EACjB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAElE,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GACL,CACA,CACnB,EACP;KACH;;;;;;AApD4B;IAA5B,kBAAkB,EAAE;0DAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/common/smart-snippets/atomic-smart-snippet-source.tsx"],"sourcesContent":["import {Result} from '@coveo/headless';\nimport {\n Component,\n Prop,\n h,\n Listen,\n State,\n EventEmitter,\n Event,\n Host,\n} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {AnyBindings} from '../interface/bindings';\nimport {LinkWithItemAnalytics} from '../item-link/stencil-item-link';\nimport {ResultContextEvent} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * @part source-url\n * @part source-title\n * @internal\n */\n@Component({\n tag: 'atomic-smart-snippet-source',\n shadow: false,\n})\nexport class AtomicSmartSnippetSource\n implements InitializableComponent<AnyBindings>\n{\n @InitializeBindings() public bindings!: AnyBindings;\n @Prop({reflect: true, mutable: true}) source!: Result;\n @Prop() anchorAttributes?: Attr[];\n\n @Event() selectSource!: EventEmitter;\n @Event() beginDelayedSelectSource!: EventEmitter;\n @Event() cancelPendingSelectSource!: EventEmitter;\n\n @State() public error!: Error;\n\n @Listen('atomic/resolveResult')\n public resolveResult(event: ResultContextEvent<Result>) {\n event.preventDefault();\n event.stopPropagation();\n if (this.source) {\n event.detail(this.source);\n }\n }\n\n render() {\n return (\n <Host>\n <LinkWithItemAnalytics\n title={this.source.clickUri}\n href={this.source.clickUri}\n className=\"block truncate\"\n part=\"source-url\"\n attributes={this.anchorAttributes}\n onSelect={() => this.selectSource.emit()}\n onBeginDelayedSelect={() => this.beginDelayedSelectSource.emit()}\n onCancelPendingSelect={() => this.cancelPendingSelectSource.emit()}\n >\n {this.source.clickUri}\n </LinkWithItemAnalytics>\n <LinkWithItemAnalytics\n title={this.source.title}\n href={this.source.clickUri}\n attributes={this.anchorAttributes}\n className=\"block\"\n part=\"source-title\"\n onSelect={() => this.selectSource.emit()}\n onBeginDelayedSelect={() => this.beginDelayedSelectSource.emit()}\n onCancelPendingSelect={() => this.cancelPendingSelectSource.emit()}\n >\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n key={this.source.uniqueId}\n ></atomic-result-text>\n </LinkWithItemAnalytics>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -8,7 +8,8 @@ import { html, LitElement } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
9
9
|
import { ref } from 'lit/directives/ref.js';
|
10
10
|
import { resultComponentClass, } from "../../common/item-list/item-list-common";
|
11
|
-
import {
|
11
|
+
import { CustomRenderController } from "../../common/layout/custom-render-controller";
|
12
|
+
import { ItemLayoutController } from "../../common/layout/item-layout-controller";
|
12
13
|
import { booleanConverter } from "../../../converters/boolean-converter";
|
13
14
|
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles";
|
14
15
|
import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-complete-mixin";
|
@@ -20,7 +21,6 @@ import styles from './atomic-product.tw.css';
|
|
20
21
|
let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitElement) {
|
21
22
|
constructor() {
|
22
23
|
super(...arguments);
|
23
|
-
this.executedRenderingFunctionOnce = false;
|
24
24
|
/**
|
25
25
|
* The product link to use when the product is clicked in a grid layout.
|
26
26
|
*
|
@@ -84,11 +84,26 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
84
84
|
}
|
85
85
|
async connectedCallback() {
|
86
86
|
super.connectedCallback();
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
87
|
+
new CustomRenderController(this, {
|
88
|
+
renderingFunction: () => this.renderingFunction,
|
89
|
+
itemData: () => this.product,
|
90
|
+
rootElementRef: () => this.productRootRef,
|
91
|
+
linkContainerRef: () => this.linkContainerRef,
|
92
|
+
onRenderComplete: (element, output) => {
|
93
|
+
this.itemLayoutController.applyLayoutClassesToElement(element, output);
|
94
|
+
},
|
95
|
+
});
|
96
|
+
this.itemLayoutController = new ItemLayoutController(this, {
|
97
|
+
elementPrefix: 'atomic-product',
|
98
|
+
renderingFunction: () => this.renderingFunction,
|
99
|
+
content: () => this.content,
|
100
|
+
layoutConfig: () => ({
|
101
|
+
display: this.display,
|
102
|
+
density: this.density,
|
103
|
+
imageSize: this.imageSize,
|
104
|
+
}),
|
105
|
+
itemClasses: () => this.classes,
|
106
|
+
});
|
92
107
|
this.addEventListener('atomic/resolveResult', this.resolveProduct);
|
93
108
|
this.addEventListener('atomic/resolveInteractiveResult', this.resolveInteractiveProduct);
|
94
109
|
this.addEventListener('atomic/resolveStopPropagation', this.resolveStopPropagation);
|
@@ -105,12 +120,9 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
105
120
|
this.removeEventListener('atomic/resolveResultDisplayConfig', this.resolveProductDisplayConfig);
|
106
121
|
this.removeEventListener('click', this.handleClick);
|
107
122
|
}
|
108
|
-
get isCustomRenderFunctionMode() {
|
109
|
-
return this.renderingFunction !== undefined;
|
110
|
-
}
|
111
123
|
getContentHTML() {
|
112
124
|
if (!this.content) {
|
113
|
-
console.warn('
|
125
|
+
console.warn('atomic-product: content property is undefined. Cannot get content HTML.', this);
|
114
126
|
return '';
|
115
127
|
}
|
116
128
|
return parentNodeToString(this.content);
|
@@ -118,13 +130,8 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
118
130
|
getLinkHTML() {
|
119
131
|
return parentNodeToString(this.linkContent ?? new HTMLElement());
|
120
132
|
}
|
121
|
-
shouldExecuteRenderFunction() {
|
122
|
-
return (this.isCustomRenderFunctionMode &&
|
123
|
-
this.productRootRef &&
|
124
|
-
!this.executedRenderingFunctionOnce);
|
125
|
-
}
|
126
133
|
render() {
|
127
|
-
if (this.
|
134
|
+
if (this.renderingFunction !== undefined) {
|
128
135
|
return html `
|
129
136
|
<div class=${resultComponentClass}>
|
130
137
|
<div
|
@@ -143,16 +150,13 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
143
150
|
`;
|
144
151
|
}
|
145
152
|
// Handle case where content is undefined and layout was not created
|
146
|
-
if (!this.
|
153
|
+
if (!this.itemLayoutController.getLayout()) {
|
147
154
|
return html `<div class=${resultComponentClass}></div>`;
|
148
155
|
}
|
149
156
|
return html `
|
150
157
|
<div class=${resultComponentClass}>
|
151
158
|
<div
|
152
|
-
class="result-root ${this.
|
153
|
-
.getClasses()
|
154
|
-
.concat(this.classes)
|
155
|
-
.join(' ')}"
|
159
|
+
class="result-root ${this.itemLayoutController.getCombinedClasses().join(' ')}"
|
156
160
|
.innerHTML=${this.getContentHTML()}
|
157
161
|
></div>
|
158
162
|
<div class="link-container" .innerHTML=${this.getLinkHTML()}></div>
|
@@ -164,42 +168,6 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
164
168
|
this.store.unsetLoadingFlag(this.loadingFlag);
|
165
169
|
}
|
166
170
|
}
|
167
|
-
getCombinedClasses(additionalContent) {
|
168
|
-
const layoutClasses = this.layout
|
169
|
-
? this.layout.getClasses(additionalContent)
|
170
|
-
: [];
|
171
|
-
const extraClasses = this.classes.split(/\s+/).filter((c) => c);
|
172
|
-
return [...layoutClasses, ...extraClasses];
|
173
|
-
}
|
174
|
-
applyClassesToChildren() {
|
175
|
-
if (!this.layout) {
|
176
|
-
return;
|
177
|
-
}
|
178
|
-
const classes = this.getCombinedClasses();
|
179
|
-
const root = this.shadowRoot?.querySelector('.result-root');
|
180
|
-
if (!root) {
|
181
|
-
return;
|
182
|
-
}
|
183
|
-
root.querySelectorAll('*').forEach((el) => {
|
184
|
-
const tag = el.tagName.toLowerCase();
|
185
|
-
if (tag.startsWith('atomic-product-')) {
|
186
|
-
el.classList.add(...classes);
|
187
|
-
}
|
188
|
-
});
|
189
|
-
}
|
190
|
-
updated(_changedProperties) {
|
191
|
-
if (this.shouldExecuteRenderFunction()) {
|
192
|
-
const customRenderOutputAsString = this.renderingFunction(this.product, this.productRootRef, this.linkContainerRef);
|
193
|
-
if (this.layout) {
|
194
|
-
const classes = this.getCombinedClasses(customRenderOutputAsString);
|
195
|
-
this.productRootRef.classList.add(...classes);
|
196
|
-
}
|
197
|
-
this.executedRenderingFunctionOnce = true;
|
198
|
-
}
|
199
|
-
if (!this.isCustomRenderFunctionMode) {
|
200
|
-
this.applyClassesToChildren();
|
201
|
-
}
|
202
|
-
}
|
203
171
|
};
|
204
172
|
AtomicProduct.styles = styles;
|
205
173
|
__decorate([
|
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
|
8
8
|
import { html, LitElement, nothing } from 'lit';
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
10
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
|
10
11
|
import { bindings } from "../../../decorators/bindings";
|
11
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
|
12
12
|
import { errorGuard } from "../../../decorators/error-guard";
|
13
13
|
import { filterProtocol } from '../../../utils/xss-utils';
|
14
14
|
import { renderButton } from '../../common/button';
|
@@ -11,10 +11,10 @@ import { createRef } from 'lit/directives/ref.js';
|
|
11
11
|
import { booleanConverter } from "../../../converters/boolean-converter.js";
|
12
12
|
import { bindingGuard } from "../../../decorators/binding-guard.js";
|
13
13
|
import { bindings } from "../../../decorators/bindings.js";
|
14
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
|
15
14
|
import { errorGuard } from "../../../decorators/error-guard.js";
|
16
15
|
import { renderExpandableText, } from '../../common/expandable-text/expandable-text.js';
|
17
16
|
import '../atomic-product-text/atomic-product-text.js';
|
17
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller.js";
|
18
18
|
import { LightDomMixin } from "../../../mixins/light-dom.js";
|
19
19
|
/**
|
20
20
|
* The `atomic-product-description` component renders the description of a product.
|
package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js
CHANGED
@@ -8,10 +8,10 @@ import { Schema, StringValue } from '@coveo/bueno';
|
|
8
8
|
import { html, LitElement, nothing } from 'lit';
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
10
10
|
import { createRef } from 'lit/directives/ref.js';
|
11
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
|
11
12
|
import { booleanConverter } from "../../../converters/boolean-converter";
|
12
13
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
13
14
|
import { bindings } from "../../../decorators/bindings";
|
14
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
|
15
15
|
import { errorGuard } from "../../../decorators/error-guard";
|
16
16
|
import { renderExpandableText, } from '../../common/expandable-text/expandable-text';
|
17
17
|
import '../atomic-product-text/atomic-product-text.js';
|
@@ -6,8 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
6
6
|
};
|
7
7
|
import { html, LitElement } from 'lit';
|
8
8
|
import { customElement, property, state } from 'lit/decorators.js';
|
9
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
|
9
10
|
import { bindings } from "../../../decorators/bindings";
|
10
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
|
11
11
|
import { errorGuard } from "../../../decorators/error-guard";
|
12
12
|
import { LightDomMixin } from "../../../mixins/light-dom";
|
13
13
|
import { mapProperty } from "../../../utils/props-utils";
|
package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js
CHANGED
@@ -9,10 +9,10 @@ import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
|
|
9
9
|
import { html, LitElement, nothing } from 'lit';
|
10
10
|
import { customElement, property, state } from 'lit/decorators.js';
|
11
11
|
import { when } from 'lit/directives/when.js';
|
12
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
|
12
13
|
import { renderImageCarousel } from "../../common/image-carousel/image-carousel";
|
13
14
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
14
15
|
import { bindings } from "../../../decorators/bindings";
|
15
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
|
16
16
|
import { errorGuard } from "../../../decorators/error-guard";
|
17
17
|
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
|
18
18
|
import { filterProtocol } from "../../../utils/xss-utils";
|
package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js
CHANGED
@@ -8,15 +8,16 @@ import { isUndefined } from '@coveo/bueno';
|
|
8
8
|
import { html, LitElement } from 'lit';
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
10
10
|
import { when } from 'lit/directives/when.js';
|
11
|
+
import { createInteractiveProductContextController } from "../product-template-component-utils/context/interactive-product-context-controller.js";
|
11
12
|
import { getAttributesFromLinkSlot } from "../../common/item-link/attributes-slot";
|
12
13
|
import { renderLinkWithItemAnalytics } from "../../common/item-link/item-link";
|
13
14
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
14
15
|
import { bindings } from "../../../decorators/bindings";
|
15
|
-
import { createInteractiveProductContextController, createProductContextController, } from "../../../decorators/commerce/product-template-decorators.js";
|
16
16
|
import { errorGuard } from "../../../decorators/error-guard";
|
17
17
|
import { buildCustomEvent } from "../../../utils/event-utils";
|
18
18
|
import { buildStringTemplateFromProduct } from '../product-template-component-utils/product-utils';
|
19
19
|
import '../atomic-product-text/atomic-product-text';
|
20
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
|
20
21
|
import { LightDomMixin } from "../../../mixins/light-dom";
|
21
22
|
import { SlotsForNoShadowDOMMixin, } from "../../../mixins/slots-for-no-shadow-dom-mixin";
|
22
23
|
import styles from './atomic-product-link.tw.css';
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
import { buildProductListing, buildSearch, ProductTemplatesHelpers, } from '@coveo/headless/commerce';
|
8
8
|
import { html, LitElement, nothing } from 'lit';
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
10
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
|
10
11
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
11
12
|
import { bindings } from "../../../decorators/bindings";
|
12
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
|
13
13
|
import { errorGuard } from "../../../decorators/error-guard";
|
14
14
|
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles";
|
15
15
|
import { getFieldValueCaption } from '../../../utils/field-utils';
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
import { html, LitElement } from 'lit';
|
8
8
|
import { customElement, property, state } from 'lit/decorators.js';
|
9
9
|
import { when } from 'lit/directives/when.js';
|
10
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller.js";
|
10
11
|
import { bindingGuard } from "../../../decorators/binding-guard.js";
|
11
12
|
import { bindings } from "../../../decorators/bindings.js";
|
12
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
|
13
13
|
import { errorGuard } from "../../../decorators/error-guard.js";
|
14
14
|
import { LightDomMixin } from "../../../mixins/light-dom.js";
|
15
15
|
import { defaultNumberFormatter, } from '../../common/formats/format-common.js';
|
package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js
CHANGED
@@ -7,10 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
import { buildContext, } from '@coveo/headless/commerce';
|
8
8
|
import { css, html, LitElement } from 'lit';
|
9
9
|
import { customElement, state } from 'lit/decorators.js';
|
10
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller.js";
|
10
11
|
import { bindStateToController } from "../../../decorators/bind-state.js";
|
11
12
|
import { bindingGuard } from "../../../decorators/binding-guard.js";
|
12
13
|
import { bindings } from "../../../decorators/bindings.js";
|
13
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
|
14
14
|
import { errorGuard } from "../../../decorators/error-guard.js";
|
15
15
|
import { multiClassMap, tw } from "../../../directives/multi-class-map.js";
|
16
16
|
import { LightDomMixin } from "../../../mixins/light-dom.js";
|
package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js
CHANGED
@@ -8,11 +8,11 @@ import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
|
|
8
8
|
import { html, LitElement } from 'lit';
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
10
10
|
import { when } from 'lit/directives/when.js';
|
11
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller.js";
|
11
12
|
import ratingStyles from "../../common/atomic-rating/atomic-rating.tw.css.js";
|
12
13
|
import { computeNumberOfStars } from "../../common/atomic-rating/rating-utils.js";
|
13
14
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
14
15
|
import { bindings } from "../../../decorators/bindings.js";
|
15
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
|
16
16
|
import { errorGuard } from "../../../decorators/error-guard";
|
17
17
|
import { LightDomMixin } from "../../../mixins/light-dom";
|
18
18
|
const Star = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13\" height=\"13\" viewBox=\"0 0 13 13\">\n <path\n d=\"m 2.6226137,7.5483827 -1.73646599,-1.67659 c -0.58287,-0.56277 -0.2895686,-1.54878 0.50612799,-1.70148 l 2.630348,-0.50477 c 0.31897,-0.06121 0.58834,-0.27352 0.72239,-0.56935 l 0.84414,-1.86293 c 0.35481,-0.78302702 1.46689,-0.78302802 1.8217,0 l 0.84414,1.86293 c 0.13405,0.29583 0.40342,0.50814 0.72239,0.56935 l 2.6303203,0.50477 c 0.7957,0.1527 1.089,1.13871 0.5062,1.70148 l -1.73651,1.67659 c -0.23632,0.22817 -0.34551,0.55786 -0.2921,0.88198 l 0.45461,2.7587403 c 0.1357,0.824 -0.7386003,1.4416 -1.4698203,1.0382 l -2.087,-1.1515 c -0.30069,-0.1659 -0.66547,-0.1659 -0.96616,0 l -2.087,1.1515 c -0.73122,0.4034 -1.60555,-0.2142 -1.46978,-1.0382 l 0.45457,-2.7587403 c 0.05341,-0.32412 -0.05578,-0.65381 -0.2921,-0.88198 z\"\n stroke-width=\"0.8125\"\n />\n</svg>";
|
package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js
CHANGED
@@ -8,10 +8,10 @@ import { HighlightUtils, ProductTemplatesHelpers, } from '@coveo/headless/commer
|
|
8
8
|
import { html, LitElement, nothing } from 'lit';
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
10
10
|
import { when } from 'lit/directives/when.js';
|
11
|
+
import { createProductContextController } from "../product-template-component-utils/context/product-context-controller.js";
|
11
12
|
import { booleanConverter } from "../../../converters/boolean-converter";
|
12
13
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
13
14
|
import { bindings } from "../../../decorators/bindings";
|
14
|
-
import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
|
15
15
|
import { errorGuard } from "../../../decorators/error-guard";
|
16
16
|
import { getFieldValueCaption } from '../../../utils/field-utils';
|
17
17
|
import { renderItemTextFallback } from '../../common/item-text/item-text-fallback.js';
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
|
2
|
+
/**
|
3
|
+
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
|
4
|
+
*
|
5
|
+
* @param host - The Lit component instance
|
6
|
+
* @returns InteractiveItemContextController instance
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* ```typescript
|
10
|
+
* @customElement('my-interactive-product-component')
|
11
|
+
* export class MyInteractiveProductComponent extends LitElement {
|
12
|
+
* private interactiveProductController = createInteractiveProductContextController(this);
|
13
|
+
*
|
14
|
+
* @state() product!: Product;
|
15
|
+
*
|
16
|
+
* render() {
|
17
|
+
* this.product = this.interactiveProductController.interactiveItem;
|
18
|
+
* return html`<div>${this.product?.ec_name}</div>`;
|
19
|
+
* }
|
20
|
+
* }
|
21
|
+
* ```
|
22
|
+
*/
|
23
|
+
export function createInteractiveProductContextController(host) {
|
24
|
+
return new InteractiveItemContextController(host);
|
25
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ItemContextController, } from "../../../common/item-list/context/item-context-controller";
|
2
|
+
/**
|
3
|
+
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
|
4
|
+
*
|
5
|
+
* @param host - The Lit component instance
|
6
|
+
* @param options - Configuration options
|
7
|
+
* @returns ItemContextController instance configured for atomic-product
|
8
|
+
*
|
9
|
+
* @example
|
10
|
+
* ```typescript
|
11
|
+
* @customElement('my-product-component')
|
12
|
+
* export class MyProductComponent extends LitElement {
|
13
|
+
* private productController = createProductContextController(this);
|
14
|
+
*
|
15
|
+
* @state() product!: Product;
|
16
|
+
*
|
17
|
+
* render() {
|
18
|
+
* this.product = this.productController.item;
|
19
|
+
* return html`<div>${this.product?.ec_name}</div>`;
|
20
|
+
* }
|
21
|
+
* }
|
22
|
+
* ```
|
23
|
+
*/
|
24
|
+
export function createProductContextController(host, options = {}) {
|
25
|
+
return new ItemContextController(host, {
|
26
|
+
parentName: 'atomic-product',
|
27
|
+
folded: options.folded ?? false,
|
28
|
+
});
|
29
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/**
|
2
|
+
* A reactive controller that manages custom rendering function execution for item components.
|
3
|
+
*/
|
4
|
+
export class CustomRenderController {
|
5
|
+
constructor(host, options) {
|
6
|
+
this.hasExecutedRenderFunction = false;
|
7
|
+
this.options = {
|
8
|
+
linkContainerRef: () => undefined,
|
9
|
+
onRenderComplete: () => { },
|
10
|
+
...options,
|
11
|
+
};
|
12
|
+
host.addController(this);
|
13
|
+
}
|
14
|
+
hostConnected() {
|
15
|
+
this.resetRenderState();
|
16
|
+
}
|
17
|
+
hostUpdated() {
|
18
|
+
this.executeRenderFunction();
|
19
|
+
}
|
20
|
+
resetRenderState() {
|
21
|
+
this.hasExecutedRenderFunction = false;
|
22
|
+
}
|
23
|
+
executeRenderFunction() {
|
24
|
+
const renderingFunction = this.options.renderingFunction();
|
25
|
+
const itemData = this.options.itemData();
|
26
|
+
const rootElementRef = this.options.rootElementRef();
|
27
|
+
if (!renderingFunction ||
|
28
|
+
!itemData ||
|
29
|
+
!rootElementRef ||
|
30
|
+
this.hasExecutedRenderFunction) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
const customRenderOutput = renderingFunction(itemData, rootElementRef, this.options.linkContainerRef());
|
34
|
+
this.options.onRenderComplete(rootElementRef, customRenderOutput);
|
35
|
+
this.hasExecutedRenderFunction = true;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { ItemLayout, } from './display-options';
|
2
|
+
/**
|
3
|
+
* A reactive controller that manages layout creation and class application for item components.
|
4
|
+
*/
|
5
|
+
export class ItemLayoutController {
|
6
|
+
constructor(host, options) {
|
7
|
+
this.layoutInstance = null;
|
8
|
+
this.host = host;
|
9
|
+
this.options = {
|
10
|
+
...options,
|
11
|
+
};
|
12
|
+
host.addController(this);
|
13
|
+
}
|
14
|
+
hostConnected() {
|
15
|
+
this.createLayout();
|
16
|
+
}
|
17
|
+
hostUpdated() {
|
18
|
+
this.applyLayoutClasses();
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Gets the current layout instance
|
22
|
+
*/
|
23
|
+
getLayout() {
|
24
|
+
return this.layoutInstance;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Gets combined layout and extra classes
|
28
|
+
*/
|
29
|
+
getCombinedClasses(additionalContent) {
|
30
|
+
const layout = this.getLayout();
|
31
|
+
const layoutClasses = layout ? layout.getClasses(additionalContent) : [];
|
32
|
+
const itemClasses = this.options
|
33
|
+
.itemClasses()
|
34
|
+
.split(/\s+/)
|
35
|
+
.filter((c) => c);
|
36
|
+
return [...layoutClasses, ...itemClasses];
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Applies layout classes to a specific element (useful for custom rendering)
|
40
|
+
*/
|
41
|
+
applyLayoutClassesToElement(element, additionalContent) {
|
42
|
+
const layout = this.getLayout();
|
43
|
+
if (!layout) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
const classes = this.getCombinedClasses(additionalContent);
|
47
|
+
if (classes.length > 0) {
|
48
|
+
element.classList.add(...classes);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
applyLayoutClasses() {
|
52
|
+
const layout = this.getLayout();
|
53
|
+
if (!layout) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
const classes = this.getCombinedClasses();
|
57
|
+
const root = this.host.shadowRoot?.querySelector('.result-root');
|
58
|
+
if (!root || classes.length === 0) {
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
if (this.hasCustomRenderFunction()) {
|
62
|
+
this.observeAndApplyClasses(root, classes);
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
this.addClassesToElements(root, classes);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
createLayout() {
|
69
|
+
const content = this.options.content();
|
70
|
+
if (!content) {
|
71
|
+
console.warn(`${this.options.elementPrefix}: content property is undefined. Cannot create layout.`, this.host);
|
72
|
+
this.layoutInstance = null;
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
const config = this.options.layoutConfig();
|
76
|
+
this.layoutInstance = new ItemLayout(content.children, config.display, config.density, config.imageSize);
|
77
|
+
}
|
78
|
+
hasCustomRenderFunction() {
|
79
|
+
return this.options.renderingFunction() !== undefined;
|
80
|
+
}
|
81
|
+
addClassesToElements(root, classes) {
|
82
|
+
if (classes.length === 0) {
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
const elements = root.querySelectorAll('*');
|
86
|
+
elements.forEach((element) => {
|
87
|
+
const tagName = element.tagName.toLowerCase();
|
88
|
+
if (tagName.startsWith(`${this.options.elementPrefix}-`)) {
|
89
|
+
element.classList.add(...classes);
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
observeAndApplyClasses(root, classes) {
|
94
|
+
const observer = new MutationObserver((mutations) => {
|
95
|
+
const hasNewElements = mutations.some((mutation) => mutation.type === 'childList' && mutation.addedNodes.length > 0);
|
96
|
+
if (hasNewElements) {
|
97
|
+
this.addClassesToElements(root, classes);
|
98
|
+
observer.disconnect();
|
99
|
+
}
|
100
|
+
});
|
101
|
+
observer.observe(root, { childList: true, subtree: true });
|
102
|
+
}
|
103
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAca,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;;ACrBA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;ACZA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;;;","names":[],"sources":["src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/components/commerce/product-template-component-utils/context/fetch-product-context.ts","src/components/commerce/product-template-component-utils/context/stencil-product-template-decorators.tsx"],"sourcesContent":["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 {Product} from '@coveo/headless/commerce';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\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","import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '@/src/components/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/components/commerce/product-template-component-utils/context/fetch-product-context.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
|
@@ -8,6 +8,8 @@ import { I as ItemContext, a as InteractiveItemContext, i as itemContext } from
|
|
8
8
|
* @ResultContext() private result!: Result;
|
9
9
|
*
|
10
10
|
* For more information and examples, view the "Utilities" section of the readme.
|
11
|
+
*
|
12
|
+
* @deprecated should only be used for Stencil components. For Lit components, use `createResultContextController` from \@/src/components/search/result-template-component-utils/context/result-context-controller.ts
|
11
13
|
*/
|
12
14
|
function ResultContext(opts = { folded: false }) {
|
13
15
|
return ItemContext({ parentName: 'atomic-result', folded: opts.folded });
|
@@ -22,8 +24,10 @@ function InteractiveResultContext() {
|
|
22
24
|
*
|
23
25
|
* 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).
|
24
26
|
*
|
25
|
-
* @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
|
27
|
+
* @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result" element.
|
26
28
|
* @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
|
29
|
+
*
|
30
|
+
* @deprecated should only be used for Stencil components. For Lit components, use `fetchResultContext` from \@/src/components/search/result-template-component-utils/context/fetch-result-context.ts
|
27
31
|
*/
|
28
32
|
function resultContext(element) {
|
29
33
|
return itemContext(element, 'atomic-result');
|
@@ -31,4 +35,4 @@ function resultContext(element) {
|
|
31
35
|
|
32
36
|
export { InteractiveResultContext as I, ResultContext as R, resultContext as r };
|
33
37
|
|
34
|
-
//# sourceMappingURL=result-template-decorators.js.map
|
38
|
+
//# sourceMappingURL=stencil-result-template-decorators.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"stencil-result-template-decorators.js","mappings":";;AASA;;;;;;;;;;;SAWgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAO,WAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;;;SAYgB,aAAa,CAC3B,OAAgB;IAEhB,OAAO,WAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;","names":[],"sources":["src/components/search/result-template-component-utils/context/stencil-result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '@/src/components/common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n * \n * @deprecated should only be used for Stencil components. For Lit components, use `createResultContextController` from \\@/src/components/search/result-template-component-utils/context/result-context-controller.ts\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-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-result\" element.\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n * \n * @deprecated should only be used for Stencil components. For Lit components, use `fetchResultContext` from \\@/src/components/search/result-template-component-utils/context/fetch-result-context.ts\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"version":3}
|
package/dist/atomic/index.esm.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{c as o}from"./p-c9074946.js";import{b as t}from"./p-1580513b.js";import{i as s}from"./p-3dc06261.js";export{d as dispatchSearchBoxSuggestionsEvent}from"./p-4b7a19db.js";export{e as elementHasNoQuery,a as elementHasQuery}from"./p-0a051b8d.js";export{r as resultContext}from"./p-4080f740.js";export{i as initializeBindings}from"./p-ff2d324d.js";export{b as bindLogDocumentOpenOnResult}from"./p-c3cb3e0c.js";export{M as MissingInterfaceParentError}from"./p-cae02339.js";import"./p-dc3df5ce.js";import"./p-05de7ca3.js";import"@coveo/headless";class n extends Error{constructor(e,r){super(`The "${e}" element must be the child of an "${r}" element.`)}}const c="atomic/resolveResult";function p(e,r){return new Promise(((s,p)=>{const a=t(c,(e=>s(e)));e.dispatchEvent(a);if(!o(e,r)){p(new n(e.nodeName.toLowerCase(),r))}}))}function m(e){return p(e,"atomic-product")}function f(e){return s(e,"atomic-product")}export{m as fetchProductContext,f as productContext};
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|