@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
@@ -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-
|
38
|
+
//# sourceMappingURL=stencil-result-template-decorators-f989bc6b.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"stencil-result-template-decorators-f989bc6b.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/esm/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const headlessVersion = '3.31.
|
2
|
-
export const atomicVersion = '3.34.0-pre.
|
1
|
+
export const headlessVersion = '3.31.2-pre.d29cb64477';
|
2
|
+
export const atomicVersion = '3.34.0-pre.d29cb64477';
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import type { InteractiveProduct, Product } from '@coveo/headless/commerce';
|
2
2
|
import { type CSSResultGroup, LitElement } from 'lit';
|
3
|
+
import type { CommerceStore } from "../atomic-commerce-interface/store";
|
4
|
+
import type { CommerceRecommendationStore } from "../atomic-commerce-recommendation-interface/store";
|
5
|
+
import type { InteractiveProductContextEvent, ProductContextEvent } from "../product-template-component-utils/context/product-context-controller";
|
3
6
|
import type { DisplayConfig } from "../../common/item-list/context/item-display-config-context-controller";
|
4
7
|
import { type ItemRenderingFunction } from "../../common/item-list/item-list-common";
|
5
|
-
import {
|
6
|
-
import type { InteractiveProductContextEvent, ProductContextEvent } from "../../../decorators/commerce/product-template-decorators";
|
7
|
-
import type { CommerceStore } from '../atomic-commerce-interface/store';
|
8
|
-
import type { CommerceRecommendationStore } from '../atomic-commerce-recommendation-interface/store';
|
8
|
+
import type { ItemDisplayDensity, ItemDisplayImageSize, ItemDisplayLayout } from "../../common/layout/display-options";
|
9
9
|
declare const AtomicProduct_base: typeof LitElement;
|
10
10
|
/**
|
11
11
|
* The `atomic-product` component is used internally by the `atomic-commerce-product-list` and `atomic-commerce-recommendation-list` components.
|
12
12
|
*/
|
13
13
|
export declare class AtomicProduct extends AtomicProduct_base {
|
14
|
-
private layout;
|
15
14
|
private productRootRef?;
|
16
15
|
private linkContainerRef?;
|
17
|
-
private
|
16
|
+
private itemLayoutController;
|
18
17
|
static styles: CSSResultGroup;
|
19
18
|
/**
|
20
19
|
* Whether `atomic-product-link` components nested in the `atomic-product` should stop click event propagation.
|
@@ -84,25 +83,14 @@ export declare class AtomicProduct extends AtomicProduct_base {
|
|
84
83
|
clickLinkContainer: () => void;
|
85
84
|
connectedCallback(): Promise<void>;
|
86
85
|
disconnectedCallback(): void;
|
87
|
-
private get isCustomRenderFunctionMode();
|
88
86
|
private getContentHTML;
|
89
87
|
private getLinkHTML;
|
90
|
-
private shouldExecuteRenderFunction;
|
91
88
|
render(): import("lit-html").TemplateResult<1>;
|
92
89
|
firstUpdated(_changedProperties: Map<string, unknown>): void;
|
93
|
-
private getCombinedClasses;
|
94
|
-
private applyClassesToChildren;
|
95
|
-
updated(_changedProperties: Map<string, unknown>): void;
|
96
90
|
}
|
97
91
|
declare global {
|
98
92
|
interface HTMLElementTagNameMap {
|
99
93
|
'atomic-product': AtomicProduct;
|
100
94
|
}
|
101
|
-
interface HTMLElementEventMap {
|
102
|
-
'atomic/resolveResult': ProductContextEvent;
|
103
|
-
'atomic/resolveInteractiveResult': InteractiveProductContextEvent;
|
104
|
-
'atomic/resolveStopPropagation': CustomEvent;
|
105
|
-
'atomic/resolveResultDisplayConfig': ProductContextEvent<DisplayConfig>;
|
106
|
-
}
|
107
95
|
}
|
108
96
|
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { Product } from '@coveo/headless/commerce';
|
2
|
+
/**
|
3
|
+
* Retrieves `Product` on a rendered `atomic-product`.
|
4
|
+
*
|
5
|
+
* 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.
|
6
|
+
*
|
7
|
+
* 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).
|
8
|
+
*
|
9
|
+
* @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.
|
10
|
+
* @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.
|
11
|
+
*/
|
12
|
+
export declare function fetchProductContext<T extends Product>(element: Element): Promise<T>;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import type { InteractiveProduct } from '@coveo/headless/commerce';
|
2
|
+
import type { LitElement } from 'lit';
|
3
|
+
import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
+
/**
|
5
|
+
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
|
6
|
+
*
|
7
|
+
* @param host - The Lit component instance
|
8
|
+
* @returns InteractiveItemContextController instance
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```typescript
|
12
|
+
* @customElement('my-interactive-product-component')
|
13
|
+
* export class MyInteractiveProductComponent extends LitElement {
|
14
|
+
* private interactiveProductController = createInteractiveProductContextController(this);
|
15
|
+
*
|
16
|
+
* @state() product!: Product;
|
17
|
+
*
|
18
|
+
* render() {
|
19
|
+
* this.product = this.interactiveProductController.interactiveItem;
|
20
|
+
* return html`<div>${this.product?.ec_name}</div>`;
|
21
|
+
* }
|
22
|
+
* }
|
23
|
+
* ```
|
24
|
+
*/
|
25
|
+
export declare function createInteractiveProductContextController(host: LitElement & {
|
26
|
+
error: Error;
|
27
|
+
}): InteractiveItemContextController<InteractiveProduct>;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import type { InteractiveProduct, Product } from '@coveo/headless/commerce';
|
2
|
+
import type { LitElement } from 'lit';
|
3
|
+
import type { InteractiveItemContextEvent } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
+
import { ItemContextController, type ItemContextEvent } from "../../../common/item-list/context/item-context-controller";
|
5
|
+
/**
|
6
|
+
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
|
7
|
+
*
|
8
|
+
* @param host - The Lit component instance
|
9
|
+
* @param options - Configuration options
|
10
|
+
* @returns ItemContextController instance configured for atomic-product
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```typescript
|
14
|
+
* @customElement('my-product-component')
|
15
|
+
* export class MyProductComponent extends LitElement {
|
16
|
+
* private productController = createProductContextController(this);
|
17
|
+
*
|
18
|
+
* @state() product!: Product;
|
19
|
+
*
|
20
|
+
* render() {
|
21
|
+
* this.product = this.productController.item;
|
22
|
+
* return html`<div>${this.product?.ec_name}</div>`;
|
23
|
+
* }
|
24
|
+
* }
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
export declare function createProductContextController(host: LitElement & {
|
28
|
+
error: Error | null;
|
29
|
+
}, options?: {
|
30
|
+
folded?: boolean;
|
31
|
+
}): ItemContextController<Product>;
|
32
|
+
export type ProductContextEvent<T = Product> = ItemContextEvent<T>;
|
33
|
+
export type InteractiveProductContextEvent<T extends InteractiveProduct = InteractiveProduct> = InteractiveItemContextEvent<T>;
|
@@ -9,6 +9,6 @@ import { Product } from '@coveo/headless/commerce';
|
|
9
9
|
* @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
|
10
10
|
* @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
|
11
11
|
*
|
12
|
-
* @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/
|
12
|
+
* @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
|
13
13
|
*/
|
14
14
|
export declare function productContext<T extends Product>(element: Element): Promise<T>;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
+
import type { ItemRenderingFunction } from "../item-list/item-list-common";
|
3
|
+
import type { AnyItem } from "../item-list/unfolded-item";
|
4
|
+
export interface CustomRenderHost extends ReactiveControllerHost {
|
5
|
+
shadowRoot?: ShadowRoot | null;
|
6
|
+
}
|
7
|
+
export interface CustomRenderOptions {
|
8
|
+
renderingFunction: () => ItemRenderingFunction<AnyItem> | undefined;
|
9
|
+
itemData: () => AnyItem | undefined;
|
10
|
+
rootElementRef: () => HTMLElement | undefined;
|
11
|
+
linkContainerRef?: () => HTMLElement | undefined;
|
12
|
+
onRenderComplete?: (element: HTMLElement, output: string) => void;
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* A reactive controller that manages custom rendering function execution for item components.
|
16
|
+
*/
|
17
|
+
export declare class CustomRenderController implements ReactiveController {
|
18
|
+
private options;
|
19
|
+
private hasExecutedRenderFunction;
|
20
|
+
constructor(host: CustomRenderHost & LitElement, options: CustomRenderOptions);
|
21
|
+
hostConnected(): void;
|
22
|
+
hostUpdated(): void;
|
23
|
+
private resetRenderState;
|
24
|
+
private executeRenderFunction;
|
25
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
+
import type { ItemRenderingFunction } from "../item-list/item-list-common";
|
3
|
+
import type { AnyItem } from "../item-list/unfolded-item";
|
4
|
+
import { type ItemDisplayDensity, type ItemDisplayImageSize, type ItemDisplayLayout, ItemLayout } from './display-options';
|
5
|
+
export interface ItemLayoutHost extends ReactiveControllerHost {
|
6
|
+
shadowRoot?: ShadowRoot | null;
|
7
|
+
}
|
8
|
+
export interface LayoutDisplayConfig {
|
9
|
+
display: ItemDisplayLayout;
|
10
|
+
density: ItemDisplayDensity;
|
11
|
+
imageSize: ItemDisplayImageSize;
|
12
|
+
}
|
13
|
+
export interface ItemLayoutOptions {
|
14
|
+
elementPrefix: string;
|
15
|
+
renderingFunction: () => ItemRenderingFunction<AnyItem> | undefined;
|
16
|
+
content: () => ParentNode | undefined;
|
17
|
+
layoutConfig: () => LayoutDisplayConfig;
|
18
|
+
itemClasses: () => string;
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* A reactive controller that manages layout creation and class application for item components.
|
22
|
+
*/
|
23
|
+
export declare class ItemLayoutController implements ReactiveController {
|
24
|
+
private host;
|
25
|
+
private options;
|
26
|
+
private layoutInstance;
|
27
|
+
constructor(host: ItemLayoutHost & LitElement, options: ItemLayoutOptions);
|
28
|
+
hostConnected(): void;
|
29
|
+
hostUpdated(): void;
|
30
|
+
/**
|
31
|
+
* Gets the current layout instance
|
32
|
+
*/
|
33
|
+
getLayout(): ItemLayout | null;
|
34
|
+
/**
|
35
|
+
* Gets combined layout and extra classes
|
36
|
+
*/
|
37
|
+
getCombinedClasses(additionalContent?: string): string[];
|
38
|
+
/**
|
39
|
+
* Applies layout classes to a specific element (useful for custom rendering)
|
40
|
+
*/
|
41
|
+
applyLayoutClassesToElement(element: HTMLElement, additionalContent?: string): void;
|
42
|
+
private applyLayoutClasses;
|
43
|
+
private createLayout;
|
44
|
+
private hasCustomRenderFunction;
|
45
|
+
private addClassesToElements;
|
46
|
+
private observeAndApplyClasses;
|
47
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Result } from '@coveo/headless';
|
2
2
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
3
3
|
import { InitializableComponent } from '../../../utils/initialization-utils';
|
4
|
-
import { ResultContextEvent } from '../../search/result-template-components/result-template-decorators';
|
5
4
|
import { AnyBindings } from '../interface/bindings';
|
5
|
+
import { ResultContextEvent } from "../../search/result-template-component-utils/context/stencil-result-template-decorators";
|
6
6
|
/**
|
7
7
|
* @part source-url
|
8
8
|
* @part source-title
|
@@ -3,7 +3,7 @@ import { DisplayConfig } from '../../common/item-list/stencil-item-decorators';
|
|
3
3
|
import { ItemRenderingFunction } from '../../common/item-list/stencil-item-list-common';
|
4
4
|
import { ItemDisplayDensity, ItemDisplayImageSize, ItemDisplayLayout } from '../../common/layout/display-options';
|
5
5
|
import { SearchStore } from '../atomic-search-interface/store';
|
6
|
-
import { InteractiveResultContextEvent, ResultContextEvent } from
|
6
|
+
import { InteractiveResultContextEvent, ResultContextEvent } from "../result-template-component-utils/context/stencil-result-template-decorators";
|
7
7
|
/**
|
8
8
|
* The `atomic-result` component is used internally by the `atomic-result-list` component.
|
9
9
|
*/
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { FoldedResult, Result } from '@coveo/headless';
|
2
|
+
/**
|
3
|
+
* Retrieves `Result` on a rendered `atomic-result`.
|
4
|
+
*
|
5
|
+
* @param element - The element that the event is dispatched to
|
6
|
+
* @returns A promise that resolves on initialization of the parent `atomic-result` element, or rejects if missing
|
7
|
+
*/
|
8
|
+
export declare function fetchResultContext<T extends Result | FoldedResult = Result>(element: Element): Promise<T>;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { InteractiveResult } from '@coveo/headless';
|
2
|
+
import type { LitElement } from 'lit';
|
3
|
+
import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
+
/**
|
5
|
+
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive result context in result template components.
|
6
|
+
*
|
7
|
+
* @param host - The Lit component instance
|
8
|
+
* @returns InteractiveItemContextController instance
|
9
|
+
*/
|
10
|
+
export declare function createInteractiveResultContextController(host: LitElement & {
|
11
|
+
error: Error;
|
12
|
+
}): InteractiveItemContextController<InteractiveResult>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type { FoldedResult, InteractiveResult, Result } from '@coveo/headless';
|
2
|
+
import type { LitElement } from 'lit';
|
3
|
+
import type { InteractiveItemContextEvent } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
+
import { ItemContextController, type ItemContextEvent } from "../../../common/item-list/context/item-context-controller";
|
5
|
+
/**
|
6
|
+
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing result context in result template components.
|
7
|
+
*
|
8
|
+
* @param host - The Lit component instance
|
9
|
+
* @param options - Configuration options
|
10
|
+
* @returns ItemContextController instance configured for atomic-result
|
11
|
+
*/
|
12
|
+
export declare function createResultContextController(host: LitElement & {
|
13
|
+
error: Error | null;
|
14
|
+
}, options?: {
|
15
|
+
folded?: boolean;
|
16
|
+
}): ItemContextController<Result | FoldedResult>;
|
17
|
+
export type ResultContextEvent<T = Result | FoldedResult> = ItemContextEvent<T>;
|
18
|
+
export type InteractiveResultContextEvent<T extends InteractiveResult = InteractiveResult> = InteractiveItemContextEvent<T>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { FoldedResult, Result } from '@coveo/headless';
|
2
|
-
import { InteractiveItemContextEvent, ItemContextEvent } from
|
2
|
+
import { InteractiveItemContextEvent, ItemContextEvent } from "../../../common/item-list/stencil-item-decorators";
|
3
3
|
/**
|
4
4
|
* A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.
|
5
5
|
* This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.
|
@@ -8,6 +8,8 @@ import { InteractiveItemContextEvent, ItemContextEvent } from '../../common/item
|
|
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
|
export declare function ResultContext(opts?: {
|
13
15
|
folded: boolean;
|
@@ -22,7 +24,9 @@ export type InteractiveResultContextEvent = InteractiveItemContextEvent;
|
|
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
|
export declare function resultContext<T extends Result | FoldedResult = Result>(element: Element): Promise<T>;
|
package/dist/types/index.d.ts
CHANGED
@@ -2,7 +2,8 @@ export type { i18n } from 'i18next';
|
|
2
2
|
export { Components, JSX } from './components';
|
3
3
|
export { CommerceBindings } from './components/commerce/atomic-commerce-interface/atomic-commerce-interface';
|
4
4
|
export { SelectChildProductEventArgs } from './components/commerce/atomic-product-children/select-child-product-event';
|
5
|
-
export {
|
5
|
+
export { fetchProductContext } from './components/commerce/product-template-component-utils/context/fetch-product-context';
|
6
|
+
export { productContext } from './components/commerce/product-template-component-utils/context/stencil-product-template-decorators';
|
6
7
|
export { PopoverChildFacet } from './components/common/facets/popover/popover-type';
|
7
8
|
export { RedirectionPayload } from './components/common/search-box/redirection-payload';
|
8
9
|
export { dispatchSearchBoxSuggestionsEvent } from './components/common/suggestions/suggestions-events';
|
@@ -10,7 +11,6 @@ export type { SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggest
|
|
10
11
|
export { elementHasNoQuery, elementHasQuery, } from './components/common/suggestions/suggestions-utils';
|
11
12
|
export { RecsBindings } from './components/recommendations/atomic-recs-interface/atomic-recs-interface';
|
12
13
|
export { Bindings } from './components/search/atomic-search-interface/atomic-search-interface';
|
13
|
-
export { resultContext } from './components/search/result-template-
|
14
|
-
export { fetchProductContext } from './decorators/commerce/product-template-decorators';
|
14
|
+
export { resultContext } from './components/search/result-template-component-utils/context/stencil-result-template-decorators';
|
15
15
|
export { initializeBindings, MissingInterfaceParentError, } from './utils/initialization-utils';
|
16
16
|
export { bindLogDocumentOpenOnResult } from './utils/result-utils';
|
package/docs/atomic-docs.json
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@coveo/atomic",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.34.0-pre.
|
4
|
+
"version": "3.34.0-pre.d29cb64477",
|
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": {
|
@@ -47,10 +47,10 @@
|
|
47
47
|
"licenses/"
|
48
48
|
],
|
49
49
|
"scripts": {
|
50
|
-
"clean": "
|
50
|
+
"clean": "node ../../utils/ci/rm-rf.mjs dist/* dist-storybook/* www/* docs/* playwright-report/*",
|
51
51
|
"build:storybook": "storybook build -o dist-storybook",
|
52
52
|
"build:cem": "cem analyze",
|
53
|
-
"build:stencil-lit": "node --max_old_space_size=6144 ../../node_modules/@stencil/core/bin/stencil build --tsConfig tsconfig.stencil.json && node ./scripts/stencil-proxy.mjs && node ./scripts/build.mjs --config=tsconfig.lit.json && esbuild src/autoloader/index.ts --format=esm --outfile=dist/atomic/autoloader/index.esm.js && esbuild src/autoloader/index.ts --format=cjs --outfile=dist/atomic/autoloader/index.cjs.js && rollup -c rollup.config.js &&
|
53
|
+
"build:stencil-lit": "node --max_old_space_size=6144 ../../node_modules/@stencil/core/bin/stencil build --tsConfig tsconfig.stencil.json && node ./scripts/stencil-proxy.mjs && node ./scripts/build.mjs --config=tsconfig.lit.json && esbuild src/autoloader/index.ts --format=esm --outfile=dist/atomic/autoloader/index.esm.js && esbuild src/autoloader/index.ts --format=cjs --outfile=dist/atomic/autoloader/index.cjs.js && rollup -c rollup.config.js && node ../../utils/ci/rm-rf.mjs ./dist/atomic/loader/package.json && tsc --noEmit --esModuleInterop --skipLibCheck ./dist/types/components.d.ts",
|
54
54
|
"build:angular": "npx turbo gen:lit --filter=@coveo/atomic-angular-builder",
|
55
55
|
"build:react": "npx turbo gen:lit --filter=@coveo/atomic-react",
|
56
56
|
"build:locales": "node ./scripts/create-generated-folder.mjs && node ./scripts/split-locales.mjs && node ./scripts/copy-dayjs-locales.mjs",
|
@@ -80,8 +80,8 @@
|
|
80
80
|
"validate:definitions": "tsc --noEmit --esModuleInterop --skipLibCheck ./dist/types/components.d.ts"
|
81
81
|
},
|
82
82
|
"dependencies": {
|
83
|
-
"@coveo/bueno": "1.1.
|
84
|
-
"@coveo/headless": "3.31.
|
83
|
+
"@coveo/bueno": "1.1.3-pre.d29cb64477",
|
84
|
+
"@coveo/headless": "3.31.2-pre.d29cb64477",
|
85
85
|
"@lit/context": "1.1.6",
|
86
86
|
"@open-wc/lit-helpers": "0.7.0",
|
87
87
|
"@popperjs/core": "2.11.8",
|
@@ -152,8 +152,8 @@
|
|
152
152
|
"wait-on": "8.0.4"
|
153
153
|
},
|
154
154
|
"peerDependencies": {
|
155
|
-
"@coveo/bueno": "1.1.
|
156
|
-
"@coveo/headless": "3.31.
|
155
|
+
"@coveo/bueno": "1.1.3-pre.d29cb64477",
|
156
|
+
"@coveo/headless": "3.31.2-pre.d29cb64477",
|
157
157
|
"typescript": ">=5.0.0"
|
158
158
|
},
|
159
159
|
"peerDependenciesMeta": {
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { closest } from '../../../utils/dom-utils.js';
|
2
|
-
import { buildCustomEvent } from '../../../utils/event-utils.js';
|
3
|
-
import { MissingParentError } from './context/item-context-controller.js';
|
4
|
-
const itemContextEventName = 'atomic/resolveResult';
|
5
|
-
export function fetchItemContext(element, parentName) {
|
6
|
-
return new Promise((resolve, reject) => {
|
7
|
-
const event = buildCustomEvent(itemContextEventName, (item) => {
|
8
|
-
return resolve(item);
|
9
|
-
});
|
10
|
-
element.dispatchEvent(event);
|
11
|
-
if (!closest(element, parentName)) {
|
12
|
-
reject(new MissingParentError(element.nodeName.toLowerCase(), parentName));
|
13
|
-
}
|
14
|
-
});
|
15
|
-
}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { InteractiveItemContextController, } from "../../components/common/item-list/context/interactive-item-context-controller";
|
2
|
-
import { ItemContextController, } from "../../components/common/item-list/context/item-context-controller";
|
3
|
-
import { fetchItemContext } from "../../components/common/item-list/fetch-item-context";
|
4
|
-
/**
|
5
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
|
6
|
-
*
|
7
|
-
* @param host - The Lit component instance
|
8
|
-
* @param options - Configuration options
|
9
|
-
* @returns ItemContextController instance configured for atomic-product
|
10
|
-
*
|
11
|
-
* @example
|
12
|
-
* ```typescript
|
13
|
-
* @customElement('my-product-component')
|
14
|
-
* export class MyProductComponent extends LitElement {
|
15
|
-
* private productController = createProductContextController(this);
|
16
|
-
*
|
17
|
-
* @state() product!: Product;
|
18
|
-
*
|
19
|
-
* render() {
|
20
|
-
* this.product = this.productController.item;
|
21
|
-
* return html`<div>${this.product?.ec_name}</div>`;
|
22
|
-
* }
|
23
|
-
* }
|
24
|
-
* ```
|
25
|
-
*/
|
26
|
-
export function createProductContextController(host, options = {}) {
|
27
|
-
return new ItemContextController(host, {
|
28
|
-
parentName: 'atomic-product',
|
29
|
-
folded: options.folded ?? false,
|
30
|
-
});
|
31
|
-
}
|
32
|
-
/**
|
33
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
|
34
|
-
*
|
35
|
-
* @param host - The Lit component instance
|
36
|
-
* @returns InteractiveItemContextController instance
|
37
|
-
*
|
38
|
-
* @example
|
39
|
-
* ```typescript
|
40
|
-
* @customElement('my-interactive-product-component')
|
41
|
-
* export class MyInteractiveProductComponent extends LitElement {
|
42
|
-
* private interactiveProductController = createInteractiveProductContextController(this);
|
43
|
-
*
|
44
|
-
* @state() product!: Product;
|
45
|
-
*
|
46
|
-
* render() {
|
47
|
-
* this.product = this.interactiveProductController.interactiveItem;
|
48
|
-
* return html`<div>${this.product?.ec_name}</div>`;
|
49
|
-
* }
|
50
|
-
* }
|
51
|
-
* ```
|
52
|
-
*/
|
53
|
-
export function createInteractiveProductContextController(host) {
|
54
|
-
return new InteractiveItemContextController(host);
|
55
|
-
}
|
56
|
-
/**
|
57
|
-
* Retrieves `Product` on a rendered `atomic-product`.
|
58
|
-
*
|
59
|
-
* 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.
|
60
|
-
*
|
61
|
-
* 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).
|
62
|
-
*
|
63
|
-
* @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.
|
64
|
-
* @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.
|
65
|
-
*/
|
66
|
-
export function fetchProductContext(element) {
|
67
|
-
return fetchItemContext(element, 'atomic-product');
|
68
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"result-template-decorators.js","mappings":";;AASA;;;;;;;;;SASgB,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;;;;;;;;;;SAUgB,aAAa,CAC3B,OAAgB;IAEhB,OAAO,WAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;","names":[],"sources":["src/components/search/result-template-components/result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\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 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 */\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\".\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 */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultLinkCss","AtomicResultLinkStyle0","AtomicResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotFromHost","linkAttributes","getAttributesFromLinkSlot","render","href","isUndefined","hrefTemplate","result","clickUri","buildStringTemplateFromResult","bindings","h","LinkWithItemAnalytics","key","onSelect","interactiveResult","select","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/search/result-template-components/atomic-result-link/atomic-result-link.pcss?tag=atomic-result-link","src/components/search/result-template-components/atomic-result-link/atomic-result-link.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@reference '../../../../utils/tailwind-utilities/link-style.css';\natomic-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {InteractiveResult} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {\n InteractiveResultContext,\n ResultContext,\n} from '../result-template-decorators';\n\n/**\n * The `atomic-result-link` component automatically transforms a search result title into a clickable link that points to the original item.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-link',\n styleUrl: 'atomic-result-link.pcss',\n shadow: false,\n})\nexport class AtomicResultLink implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"gfAAA,MAAMA,EAAsB,qwkEAC5B,MAAAC,EAAeD,E,iXC4BFE,EAAgB,M,qDA0BpB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,I,CAMvC,iBAAAC,GACL,MAAMC,EAAW,aACjBN,KAAKO,iBAAmBC,EAAuBR,KAAKC,MACpDD,KAAKS,eAAiBC,EAA0BV,KAAKC,KAAMK,E,CAGtD,MAAAK,GACL,MAAMC,EAAOC,EAAYb,KAAKc,cAC1Bd,KAAKe,OAAOC,SACZC,EACEjB,KAAKc,aACLd,KAAKe,OACLf,KAAKkB,UAGX,OACEC,EAACC,EAAqB,CAAAC,IAAA,2CACpBT,KAAMA,EACNU,SAAU,IAAMtB,KAAKuB,kBAAkBC,SACvCC,qBAAsB,IAAMzB,KAAKuB,kBAAkBG,qBACnDC,sBAAuB,IACrB3B,KAAKuB,kBAAkBK,sBAEzBC,WAAY7B,KAAKS,eACjBL,gBAAiBJ,KAAKI,iBAErBJ,KAAKO,eACJY,EAAA,aAEAA,EAAA,sBACEW,MAAM,QACNC,QAAQ,a,6BAnEWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultMultiValueTextCss","AtomicResultMultiValueTextStyle0","AtomicResultMultiValueText","this","maxValuesToDisplay","delimiter","sortedValues","initialize","breadcrumbManager","buildBreadcrumbManager","bindings","engine","resultValues","value","ResultTemplatesHelpers","getResultProperty","result","field","Array","isArray","map","v","trim","error","Error","split","facetSelectedValues","state","facetBreadcrumbs","filter","facet","reduce","values","updateSortedValues","allValues","allValuesSet","Set","firstValues","has","from","set","add","getShouldDisplayLabel","length","getNumberOfValuesToDisplay","Math","min","renderValue","label","getFieldValueCaption","i18n","kebabValue","titleToKebab","h","key","part","name","renderSeparator","beforeValue","afterValue","class","renderMoreLabel","t","renderListItems","numberOfValuesToDisplay","nodes","i","push","componentWillRender","render","host","remove","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.pcss?tag=atomic-result-multi-value-text&encapsulation=shadow","src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.tsx"],"sourcesContent":[":host {\n > ul {\n display: flex;\n list-style: none;\n margin: 0;\n padding: 0;\n\n li {\n display: inline-block;\n }\n }\n}\n\n.separator {\n &::before {\n display: inline;\n content: ',\\00a0';\n }\n}\n","import {\n BreadcrumbManager,\n buildBreadcrumbManager,\n Result,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Element, Prop, h, State, VNode} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {titleToKebab} from '../../../../utils/utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-multi-value-text` component renders the values of a multi-value string field.\n * @part result-multi-value-text-list - The list of field values.\n * @part result-multi-value-text-separator - The separator to display between each of the field values.\n * @part result-multi-value-text-value - A field value.\n * @part result-multi-value-text-value-more - A label indicating some values were omitted.\n * @slot result-multi-value-text-value-* - A custom caption value that's specified for a given part of a multi-text field value. For example, if you want to use `Off-Campus Resident` as a caption value for `Off-campus apartment` in `Off-campus apartment;On-campus apartment`, you'd use `<span slot=\"result-multi-value-text-value-off-campus-apartment\">Off-Campus Resident</span>`). The suffix of this slot corresponds with the field value, written in kebab case.\n */\n@Component({\n tag: 'atomic-result-multi-value-text',\n styleUrl: 'atomic-result-multi-value-text.pcss',\n shadow: true,\n})\nexport class AtomicResultMultiValueText {\n public breadcrumbManager!: BreadcrumbManager;\n\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The field that the component should use.\n * The component will try to find this field in the `Result.raw` object unless it finds it in the `Result` object first.\n * Make sure this field is present in the `fieldsToInclude` property of the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum number of field values to display.\n * If there are _n_ more values than the specified maximum, the last displayed value will be \"_n_ more...\".\n */\n @Prop({reflect: true}) public maxValuesToDisplay = 3;\n\n /**\n * The delimiter used to separate values when the field isn't indexed as a multi value field.\n */\n @Prop({reflect: true}) public delimiter: string | null = null;\n\n private sortedValues: string[] | null = null;\n\n public initialize() {\n this.breadcrumbManager = buildBreadcrumbManager(this.bindings.engine);\n }\n\n private get resultValues() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n\n if (value === null) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map((v) => `${v}`.trim());\n }\n\n if (typeof value !== 'string' || value.trim() === '') {\n this.error = new Error(\n `Could not parse \"${value}\" from field \"${this.field}\" as a string array.`\n );\n return null;\n }\n\n return this.delimiter\n ? value.split(this.delimiter).map((value) => value.trim())\n : [value];\n }\n\n private get facetSelectedValues() {\n return this.breadcrumbManager.state.facetBreadcrumbs\n .filter((facet) => facet.field === this.field)\n .reduce(\n (values, facet) => [\n ...values,\n ...facet.values.map(({value}) => value.value),\n ],\n [] as string[]\n );\n }\n\n private updateSortedValues() {\n const allValues = this.resultValues;\n if (allValues === null) {\n this.sortedValues = null;\n return;\n }\n const allValuesSet = new Set(allValues);\n const firstValues = this.facetSelectedValues.filter((value) =>\n allValuesSet.has(value)\n );\n this.sortedValues = Array.from(\n allValues.reduce((set, value) => set.add(value), new Set(firstValues))\n );\n }\n\n private getShouldDisplayLabel(values: string[]) {\n return (\n this.maxValuesToDisplay > 0 && values.length > this.maxValuesToDisplay\n );\n }\n\n private getNumberOfValuesToDisplay(values: string[]) {\n return Math.min(values.length, this.maxValuesToDisplay);\n }\n\n private renderValue(value: string) {\n const label = getFieldValueCaption(this.field, value, this.bindings.i18n);\n const kebabValue = titleToKebab(value);\n return (\n <li key={value} part=\"result-multi-value-text-value\">\n <slot name={`result-multi-value-text-value-${kebabValue}`}>\n {label}\n </slot>\n </li>\n );\n }\n\n private renderSeparator(beforeValue: string, afterValue: string) {\n return (\n <li\n aria-hidden=\"true\"\n part=\"result-multi-value-text-separator\"\n key={`${beforeValue}~${afterValue}`}\n class=\"separator\"\n ></li>\n );\n }\n\n private renderMoreLabel(value: number) {\n return (\n <li key=\"more-field-values\" part=\"result-multi-value-text-value-more\">\n {this.bindings.i18n.t('n-more', {value})}\n </li>\n );\n }\n\n private renderListItems(values: string[]) {\n const numberOfValuesToDisplay = this.getNumberOfValuesToDisplay(values);\n\n const nodes: VNode[] = [];\n for (let i = 0; i < numberOfValuesToDisplay; i++) {\n if (i > 0) {\n nodes.push(this.renderSeparator(values[i - 1], values[i]));\n }\n nodes.push(this.renderValue(values[i]));\n }\n if (this.getShouldDisplayLabel(values)) {\n nodes.push(\n this.renderSeparator(\n values[numberOfValuesToDisplay - 1],\n 'more-field-values'\n )\n );\n nodes.push(this.renderMoreLabel(values.length - numberOfValuesToDisplay));\n }\n return nodes;\n }\n\n public componentWillRender() {\n this.updateSortedValues();\n }\n\n public render() {\n if (this.sortedValues === null) {\n this.host.remove();\n return;\n }\n return (\n <ul part=\"result-multi-value-text-list\">\n {...this.renderListItems(this.sortedValues)}\n </ul>\n );\n }\n}\n"],"mappings":"+bAAA,MAAMA,EAAgC,iJACtC,MAAAC,EAAeD,E,iXCyBFE,EAA0B,M,yBAqBPC,KAAAC,mBAAqB,EAKrBD,KAAAE,UAA2B,KAEjDF,KAAAG,aAAgC,K,kEAPW,E,eAKM,I,CAIlD,UAAAC,GACLJ,KAAKK,kBAAoBC,EAAuBN,KAAKO,SAASC,O,CAGhE,gBAAYC,GACV,MAAMC,EAAQC,EAAuBC,kBACnCZ,KAAKa,OACLb,KAAKc,OAGP,GAAIJ,IAAU,KAAM,CAClB,OAAO,I,CAGT,GAAIK,MAAMC,QAAQN,GAAQ,CACxB,OAAOA,EAAMO,KAAKC,GAAM,GAAGA,IAAIC,Q,CAGjC,UAAWT,IAAU,UAAYA,EAAMS,SAAW,GAAI,CACpDnB,KAAKoB,MAAQ,IAAIC,MACf,oBAAoBX,kBAAsBV,KAAKc,6BAEjD,OAAO,I,CAGT,OAAOd,KAAKE,UACRQ,EAAMY,MAAMtB,KAAKE,WAAWe,KAAKP,GAAUA,EAAMS,SACjD,CAACT,E,CAGP,uBAAYa,GACV,OAAOvB,KAAKK,kBAAkBmB,MAAMC,iBACjCC,QAAQC,GAAUA,EAAMb,QAAUd,KAAKc,QACvCc,QACC,CAACC,EAAQF,IAAU,IACdE,KACAF,EAAME,OAAOZ,KAAI,EAAEP,WAAWA,EAAMA,UAEzC,G,CAIE,kBAAAoB,GACN,MAAMC,EAAY/B,KAAKS,aACvB,GAAIsB,IAAc,KAAM,CACtB/B,KAAKG,aAAe,KACpB,M,CAEF,MAAM6B,EAAe,IAAIC,IAAIF,GAC7B,MAAMG,EAAclC,KAAKuB,oBAAoBG,QAAQhB,GACnDsB,EAAaG,IAAIzB,KAEnBV,KAAKG,aAAeY,MAAMqB,KACxBL,EAAUH,QAAO,CAACS,EAAK3B,IAAU2B,EAAIC,IAAI5B,IAAQ,IAAIuB,IAAIC,I,CAIrD,qBAAAK,CAAsBV,GAC5B,OACE7B,KAAKC,mBAAqB,GAAK4B,EAAOW,OAASxC,KAAKC,kB,CAIhD,0BAAAwC,CAA2BZ,GACjC,OAAOa,KAAKC,IAAId,EAAOW,OAAQxC,KAAKC,mB,CAG9B,WAAA2C,CAAYlC,GAClB,MAAMmC,EAAQC,EAAqB9C,KAAKc,MAAOJ,EAAOV,KAAKO,SAASwC,MACpE,MAAMC,EAAaC,EAAavC,GAChC,OACEwC,EAAA,MAAIC,IAAKzC,EAAO0C,KAAK,iCACnBF,EAAA,QAAMG,KAAM,iCAAiCL,KAC1CH,G,CAMD,eAAAS,CAAgBC,EAAqBC,GAC3C,OACEN,EAAA,oBACc,OACZE,KAAK,oCACLD,IAAK,GAAGI,KAAeC,IACvBC,MAAM,a,CAKJ,eAAAC,CAAgBhD,GACtB,OACEwC,EAAA,MAAIC,IAAI,oBAAoBC,KAAK,sCAC9BpD,KAAKO,SAASwC,KAAKY,EAAE,SAAU,CAACjD,U,CAK/B,eAAAkD,CAAgB/B,GACtB,MAAMgC,EAA0B7D,KAAKyC,2BAA2BZ,GAEhE,MAAMiC,EAAiB,GACvB,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAyBE,IAAK,CAChD,GAAIA,EAAI,EAAG,CACTD,EAAME,KAAKhE,KAAKsD,gBAAgBzB,EAAOkC,EAAI,GAAIlC,EAAOkC,I,CAExDD,EAAME,KAAKhE,KAAK4C,YAAYf,EAAOkC,I,CAErC,GAAI/D,KAAKuC,sBAAsBV,GAAS,CACtCiC,EAAME,KACJhE,KAAKsD,gBACHzB,EAAOgC,EAA0B,GACjC,sBAGJC,EAAME,KAAKhE,KAAK0D,gBAAgB7B,EAAOW,OAASqB,G,CAElD,OAAOC,C,CAGF,mBAAAG,GACLjE,KAAK8B,oB,CAGA,MAAAoC,GACL,GAAIlE,KAAKG,eAAiB,KAAM,CAC9BH,KAAKmE,KAAKC,SACV,M,CAEF,OACElB,EAAA,MAAIE,KAAK,mCACHpD,KAAK4D,gBAAgB5D,KAAKG,c,6BA9JPkE,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicInsightResultActionCss","AtomicInsightResultActionStyle0","Actions","AtomicInsightResultAction","this","icon","tooltip","tooltipOnClick","action","initialize","actions","loadInsightAnalyticsActions","bindings","engine","onClick","originalTooltip","setTimeout","CopyToClipboard","dispatch","logCopyToClipboard","result","navigator","clipboard","writeText","clickUri","PostToFeed","logFeedItemTextPost","SendAsEmail","logCaseSendEmail","actionClicked","emit","getIcon","CopyIcon","AttachToCase","AttachIcon","Quickview","QuickviewIcon","FeedIcon","EmailIcon","render","h","IconButton","key","partPrefix","style","title","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/insight/atomic-insight-result-action/atomic-insight-result-action.pcss?tag=atomic-insight-result-action","src/components/insight/atomic-insight-result-action/atomic-insight-result-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n\n:host {\n &::part(result-action-button) {\n @apply flex items-center justify-center;\n @apply h-8 w-8;\n }\n}\n","import {Result} from '@coveo/headless';\nimport {\n InsightAnalyticsActionCreators,\n loadInsightAnalyticsActions,\n} from '@coveo/headless/insight';\nimport {Component, Event, EventEmitter, Prop, State, h} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport CopyIcon from '../../../images/copy-dark.svg';\nimport EmailIcon from '../../../images/email.svg';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport FeedIcon from '../../../images/share-post.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '../../search/result-template-components/result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultActionClickedEvent {\n action: string;\n result: Result;\n}\n\nexport enum Actions {\n CopyToClipboard = 'copyToClipboard',\n AttachToCase = 'attachToCase',\n Quickview = 'quickview',\n PostToFeed = 'postToFeed',\n SendAsEmail = 'sendAsEmail',\n}\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-action',\n styleUrl: 'atomic-insight-result-action.pcss',\n})\nexport class AtomicInsightResultAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n @State() public error!: Error;\n\n @Event({\n eventName: 'atomicInsightResultActionClicked',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private actionClicked!: EventEmitter<InsightResultActionClickedEvent>;\n\n /**\n * Specify the result action icon to display.\n */\n @Prop({mutable: true}) public icon = '';\n\n /**\n * The text tooltip to show on the result action icon.\n */\n @Prop({mutable: true}) public tooltip = '';\n\n /**\n * The text tooltip to show on the result action icon for some time after clicking the button.\n */\n @Prop({mutable: true}) public tooltipOnClick = '';\n\n /**\n * The type of action to perform when the result action is clicked. This will be sent along the event fired when the button is clicked.\n */\n @Prop({mutable: true}) public action: Actions | string = '';\n\n private actions!: InsightAnalyticsActionCreators;\n\n public initialize() {\n this.actions = loadInsightAnalyticsActions(this.bindings.engine);\n }\n\n private onClick() {\n if (this.tooltipOnClick) {\n const originalTooltip = this.tooltip;\n this.tooltip = this.tooltipOnClick;\n setTimeout(() => {\n this.tooltip = originalTooltip;\n }, 1000);\n }\n\n switch (this.action) {\n case Actions.CopyToClipboard:\n this.bindings.engine.dispatch(\n this.actions.logCopyToClipboard(this.result)\n );\n navigator.clipboard.writeText(this.result?.clickUri);\n break;\n case Actions.PostToFeed:\n this.bindings.engine.dispatch(\n this.actions.logFeedItemTextPost(this.result)\n );\n break;\n case Actions.SendAsEmail:\n this.bindings.engine.dispatch(\n this.actions.logCaseSendEmail(this.result)\n );\n break;\n }\n\n this.actionClicked.emit({action: this.action, result: this.result});\n }\n\n private getIcon() {\n if (this.icon) {\n return this.icon;\n }\n\n switch (this.action) {\n case Actions.CopyToClipboard:\n return CopyIcon;\n case Actions.AttachToCase:\n return AttachIcon;\n case Actions.Quickview:\n return QuickviewIcon;\n case Actions.PostToFeed:\n return FeedIcon;\n case Actions.SendAsEmail:\n return EmailIcon;\n default:\n return QuickviewIcon;\n }\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.tooltip}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"mappings":"+qEAAA,MAAMA,EAA+B,wnjEACrC,MAAAC,EAAeD,E,2WCuBf,IAAYE,GAAZ,SAAYA,GACVA,EAAA,qCACAA,EAAA,+BACAA,EAAA,yBACAA,EAAA,2BACAA,EAAA,4BACD,EAND,CAAYA,MAAO,K,MAeNC,EAAyB,M,yFAkBNC,KAAAC,KAAO,GAKPD,KAAAE,QAAU,GAKVF,KAAAG,eAAiB,GAKjBH,KAAAI,OAA2B,G,+BAfpB,G,aAKG,G,oBAKO,G,YAKU,E,CAIlD,UAAAC,GACLL,KAAKM,QAAUC,EAA4BP,KAAKQ,SAASC,O,CAGnD,OAAAC,GACN,GAAIV,KAAKG,eAAgB,CACvB,MAAMQ,EAAkBX,KAAKE,QAC7BF,KAAKE,QAAUF,KAAKG,eACpBS,YAAW,KACTZ,KAAKE,QAAUS,CAAe,GAC7B,I,CAGL,OAAQX,KAAKI,QACX,KAAKN,EAAQe,gBACXb,KAAKQ,SAASC,OAAOK,SACnBd,KAAKM,QAAQS,mBAAmBf,KAAKgB,SAEvCC,UAAUC,UAAUC,UAAUnB,KAAKgB,QAAQI,UAC3C,MACF,KAAKtB,EAAQuB,WACXrB,KAAKQ,SAASC,OAAOK,SACnBd,KAAKM,QAAQgB,oBAAoBtB,KAAKgB,SAExC,MACF,KAAKlB,EAAQyB,YACXvB,KAAKQ,SAASC,OAAOK,SACnBd,KAAKM,QAAQkB,iBAAiBxB,KAAKgB,SAErC,MAGJhB,KAAKyB,cAAcC,KAAK,CAACtB,OAAQJ,KAAKI,OAAQY,OAAQhB,KAAKgB,Q,CAGrD,OAAAW,GACN,GAAI3B,KAAKC,KAAM,CACb,OAAOD,KAAKC,I,CAGd,OAAQD,KAAKI,QACX,KAAKN,EAAQe,gBACX,OAAOe,EACT,KAAK9B,EAAQ+B,aACX,OAAOC,EACT,KAAKhC,EAAQiC,UACX,OAAOC,EACT,KAAKlC,EAAQuB,WACX,OAAOY,EACT,KAAKnC,EAAQyB,YACX,OAAOW,EACT,QACE,OAAOF,E,CAIN,MAAAG,GACL,OACEC,EAACC,EAAU,CAAAC,IAAA,2CACTC,WAAW,gBACXC,MAAM,kBACNvC,KAAMD,KAAK2B,UACXc,MAAOzC,KAAKE,QACZQ,QAAS,IAAMV,KAAKU,W,GAjGGgC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["ResultContext","opts","folded","ItemContext","parentName","InteractiveResultContext","InteractiveItemContext","resultContext","element","itemContext"],"sources":["src/components/search/result-template-components/result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\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 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 */\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\".\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 */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"mappings":"2DAkBgBA,EAAcC,EAA0B,CAACC,OAAQ,QAC/D,OAAOC,EAAY,CAACC,WAAY,gBAAiBF,OAAQD,EAAKC,QAChE,C,SAEgBG,IACd,OAAOC,GACT,C,SAegBC,EACdC,GAEA,OAAOC,EAAeD,EAAS,gBACjC,Q","ignoreList":[]}
|