@coveo/atomic 3.35.0-pre.df6792920f → 3.35.0-pre.e9982a2757
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/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-recs-interface.js +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-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/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-955092ed.entry.js → p-01096d1c.entry.js} +2 -2
- package/dist/atomic/p-01096d1c.entry.js.map +1 -0
- package/dist/atomic/{p-82cd6398.entry.js → p-154cbbfe.entry.js} +2 -2
- package/dist/atomic/{p-82cd6398.entry.js.map → p-154cbbfe.entry.js.map} +1 -1
- package/dist/atomic/{p-db3b11ca.entry.js → p-2033533c.entry.js} +2 -2
- package/dist/atomic/{p-db3b11ca.entry.js.map → p-2033533c.entry.js.map} +1 -1
- 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-8d5228da.entry.js → p-42fffab2.entry.js} +2 -2
- package/dist/atomic/p-42fffab2.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-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
- package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
- package/dist/atomic/{p-15547bd5.entry.js → p-61b3f5ce.entry.js} +2 -2
- package/dist/atomic/p-61b3f5ce.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-df8d38ca.entry.js → p-7015679e.entry.js} +2 -2
- package/dist/atomic/p-7015679e.entry.js.map +1 -0
- package/dist/atomic/{p-dea22a8d.entry.js → p-886b184f.entry.js} +2 -2
- package/dist/atomic/p-886b184f.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-182f9112.entry.js → p-a413f820.entry.js} +2 -2
- package/dist/atomic/p-a413f820.entry.js.map +1 -0
- package/dist/atomic/{p-1a5ff6af.entry.js → p-a7c39901.entry.js} +2 -2
- package/dist/atomic/{p-5cab535b.entry.js → p-c5bd7f8d.entry.js} +2 -2
- package/dist/atomic/p-c5bd7f8d.entry.js.map +1 -0
- 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-c5164dbf.entry.js → p-cee86cff.entry.js} +2 -2
- package/dist/atomic/p-cee86cff.entry.js.map +1 -0
- package/dist/atomic/{p-4cb91ee7.entry.js → p-d5402772.entry.js} +2 -2
- package/dist/atomic/p-d5402772.entry.js.map +1 -0
- package/dist/atomic/{p-e6dc9de7.entry.js → p-da141605.entry.js} +2 -2
- package/dist/atomic/p-da141605.entry.js.map +1 -0
- package/dist/atomic/{p-a1798150.entry.js → p-dd258eaa.entry.js} +2 -2
- package/dist/atomic/p-dd258eaa.entry.js.map +1 -0
- 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-448091f7.entry.js → p-ecd3c0a9.entry.js} +2 -2
- package/dist/atomic/p-ecd3c0a9.entry.js.map +1 -0
- package/dist/atomic/{p-c2a5dac0.entry.js → p-f2c4209d.entry.js} +2 -2
- package/dist/atomic/{p-57049cd2.entry.js → p-f2c89d7c.entry.js} +2 -2
- package/dist/atomic/p-f2c89d7c.entry.js.map +1 -0
- package/dist/atomic/p-f800678c.entry.js.map +1 -1
- package/dist/cjs/_index.cjs.js +20 -20
- 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-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 +1 -1
- package/dist/esm/_index.js +19 -19
- 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-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 +1 -1
- package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
- 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/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 +1 -1
- 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-15547bd5.entry.js.map +0 -1
- package/dist/atomic/p-182f9112.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-4069d801.entry.js.map +0 -1
- package/dist/atomic/p-448091f7.entry.js.map +0 -1
- package/dist/atomic/p-4cb91ee7.entry.js.map +0 -1
- package/dist/atomic/p-57049cd2.entry.js.map +0 -1
- package/dist/atomic/p-5cab535b.entry.js.map +0 -1
- package/dist/atomic/p-78427c6a.entry.js.map +0 -1
- package/dist/atomic/p-852cc16d.entry.js.map +0 -1
- package/dist/atomic/p-8d5228da.entry.js.map +0 -1
- package/dist/atomic/p-945ddd53.entry.js.map +0 -1
- package/dist/atomic/p-955092ed.entry.js.map +0 -1
- package/dist/atomic/p-a1798150.entry.js.map +0 -1
- package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
- package/dist/atomic/p-c5164dbf.entry.js.map +0 -1
- package/dist/atomic/p-dea22a8d.entry.js.map +0 -1
- package/dist/atomic/p-df8d38ca.entry.js.map +0 -1
- package/dist/atomic/p-e6dc9de7.entry.js.map +0 -1
- package/dist/atomic/p-e9dc8e90.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-1a5ff6af.entry.js.map → p-a7c39901.entry.js.map} +0 -0
- /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"file":"index.cjs.js","mappings":";;;;;;;;;;;;;;;;;
|
1
|
+
{"file":"index.cjs.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,GAAGA,2BAAgB,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,CAACC,gBAAO,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,OAAOC,iCAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;;;;;;;;;;;","names":["buildCustomEvent","closest","itemContext"],"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}
|
@@ -10,6 +10,8 @@ const stencilItemDecorators = require('./stencil-item-decorators-43a96f33.js');
|
|
10
10
|
* @ResultContext() private result!: Result;
|
11
11
|
*
|
12
12
|
* For more information and examples, view the "Utilities" section of the readme.
|
13
|
+
*
|
14
|
+
* @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
|
13
15
|
*/
|
14
16
|
function ResultContext(opts = { folded: false }) {
|
15
17
|
return stencilItemDecorators.ItemContext({ parentName: 'atomic-result', folded: opts.folded });
|
@@ -24,8 +26,10 @@ function InteractiveResultContext() {
|
|
24
26
|
*
|
25
27
|
* 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).
|
26
28
|
*
|
27
|
-
* @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
|
29
|
+
* @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result" element.
|
28
30
|
* @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
|
31
|
+
*
|
32
|
+
* @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
|
29
33
|
*/
|
30
34
|
function resultContext(element) {
|
31
35
|
return stencilItemDecorators.itemContext(element, 'atomic-result');
|
@@ -35,4 +39,4 @@ exports.InteractiveResultContext = InteractiveResultContext;
|
|
35
39
|
exports.ResultContext = ResultContext;
|
36
40
|
exports.resultContext = resultContext;
|
37
41
|
|
38
|
-
//# sourceMappingURL=result-template-decorators-
|
42
|
+
//# sourceMappingURL=stencil-result-template-decorators-28b05aaf.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"stencil-result-template-decorators-28b05aaf.js","mappings":";;;;AASA;;;;;;;;;;;SAWgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAOA,iCAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAOC,4CAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;;;SAYgB,aAAa,CAC3B,OAAgB;IAEhB,OAAOC,iCAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;;;","names":["ItemContext","InteractiveItemContext","itemContext"],"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/cjs/version.cjs.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
module.exports.headlessVersion = '3.31.2';
|
2
|
-
module.exports.atomicVersion = '3.35.0-pre.
|
2
|
+
module.exports.atomicVersion = '3.35.0-pre.e9982a2757';
|
package/dist/esm/_index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
+
import { c as closest } from './dom-utils-f6086cd3.js';
|
2
|
+
import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
|
1
3
|
import { i as itemContext } from './stencil-item-decorators-6c453c11.js';
|
2
4
|
export { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events-b7a6f007.js';
|
3
5
|
export { e as elementHasNoQuery, a as elementHasQuery } from './suggestions-utils-591559a0.js';
|
4
|
-
export { r as resultContext } from './result-template-decorators-
|
5
|
-
import { c as closest } from './dom-utils-f6086cd3.js';
|
6
|
-
import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
|
6
|
+
export { r as resultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
7
7
|
export { i as initializeBindings } from './initialization-utils-ffbc4136.js';
|
8
8
|
export { b as bindLogDocumentOpenOnResult } from './result-utils-7e9b6b5c.js';
|
9
9
|
export { M as MissingInterfaceParentError } from './initialization-lit-stencil-common-utils-804fe146.js';
|
@@ -11,22 +11,6 @@ import './index-3f35faca.js';
|
|
11
11
|
import './init-queue-fbe942c3.js';
|
12
12
|
import '@coveo/headless';
|
13
13
|
|
14
|
-
/**
|
15
|
-
* Retrieves `Product` on a rendered `atomic-product`.
|
16
|
-
*
|
17
|
-
* 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.
|
18
|
-
*
|
19
|
-
* 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).
|
20
|
-
*
|
21
|
-
* @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
|
22
|
-
* @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
|
23
|
-
*
|
24
|
-
* @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/decorators/commerce/product-template-decorators.ts
|
25
|
-
*/
|
26
|
-
function productContext(element) {
|
27
|
-
return itemContext(element, 'atomic-product');
|
28
|
-
}
|
29
|
-
|
30
14
|
class MissingParentError extends Error {
|
31
15
|
constructor(elementName, parentName) {
|
32
16
|
super(`The "${elementName}" element must be the child of an "${parentName}" element.`);
|
@@ -60,6 +44,22 @@ function fetchProductContext(element) {
|
|
60
44
|
return fetchItemContext(element, 'atomic-product');
|
61
45
|
}
|
62
46
|
|
47
|
+
/**
|
48
|
+
* Retrieves `Product` on a rendered `atomic-product`.
|
49
|
+
*
|
50
|
+
* 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.
|
51
|
+
*
|
52
|
+
* 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).
|
53
|
+
*
|
54
|
+
* @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
|
55
|
+
* @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
|
56
|
+
*
|
57
|
+
* @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
|
58
|
+
*/
|
59
|
+
function productContext(element) {
|
60
|
+
return itemContext(element, 'atomic-product');
|
61
|
+
}
|
62
|
+
|
63
63
|
export { fetchProductContext, productContext };
|
64
64
|
|
65
65
|
//# sourceMappingURL=index.js.map
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
|
|
2
2
|
import { ResultTemplatesHelpers } from '@coveo/headless';
|
3
3
|
import { M as MapProp } from './props-utils-6040b5d2.js';
|
4
4
|
import { m as makeMatchConditions } from './result-template-common-47799c7c.js';
|
5
|
-
import { R as ResultContext } from './result-template-decorators-
|
5
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
6
6
|
import '@coveo/bueno';
|
7
7
|
import './utils-6400ebde.js';
|
8
8
|
import './purify-c7ebd240.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-field-condition.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wCAAwC,CAAC;AACzE,mCAAe,uBAAuB;;;;;;;;;;;;MCuBzB,oBAAoB;;;;;;;QAgBO,cAAS,GAC7C,EAAE,CAAC;;;;;QAMiC,iBAAY,GAChD,EAAE,CAAC;QAEG,eAAU,GAA8B,EAAE,CAAC;QAC3C,oBAAe,GAAG,KAAK,CAAC;;;yBAV9B,EAAE;4BAOF,EAAE;;IAOG,iBAAiB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,sBAAsB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CACvD,CAAC;SACH;QAED,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,sBAAsB,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAC1D,CAAC;SACH;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAC1D,CAAC;KACH;IAEM,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;YACjE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,OAAO,eAAQ,CAAC;KACjB;IAEM,gBAAgB;QACrB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;KAC5C;;;AA9CqC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;uDAChC;AAMiC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;0DAChC;AAKoB;IAAxB,aAAa,EAAE;oDAAyB;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.pcss?tag=atomic-field-condition","src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.tsx"],"sourcesContent":["atomic-field-condition {\n max-width: 100%;\n}\n","import {\n Result,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Prop, h, Element} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {makeMatchConditions} from '../../../common/result-templates/result-template-common';\nimport {ResultContext} from '
|
1
|
+
{"file":"atomic-field-condition.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wCAAwC,CAAC;AACzE,mCAAe,uBAAuB;;;;;;;;;;;;MCuBzB,oBAAoB;;;;;;;QAgBO,cAAS,GAC7C,EAAE,CAAC;;;;;QAMiC,iBAAY,GAChD,EAAE,CAAC;QAEG,eAAU,GAA8B,EAAE,CAAC;QAC3C,oBAAe,GAAG,KAAK,CAAC;;;yBAV9B,EAAE;4BAOF,EAAE;;IAOG,iBAAiB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,sBAAsB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CACvD,CAAC;SACH;QAED,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,sBAAsB,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAC1D,CAAC;SACH;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAC1D,CAAC;KACH;IAEM,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;YACjE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,OAAO,eAAQ,CAAC;KACjB;IAEM,gBAAgB;QACrB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;KAC5C;;;AA9CqC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;uDAChC;AAMiC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;0DAChC;AAKoB;IAAxB,aAAa,EAAE;oDAAyB;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.pcss?tag=atomic-field-condition","src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.tsx"],"sourcesContent":["atomic-field-condition {\n max-width: 100%;\n}\n","import {\n Result,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Prop, h, Element} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {makeMatchConditions} from '../../../common/result-templates/result-template-common';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.\n * The condition properties can be based on any top-level result property of the `result` object, not restricted to fields (e.g., `isRecommendation`).\n *\n * @slot default - The content to display if the conditions are met.\n *\n * @MapProp name: mustMatch;attr: must-match;docs: The field and values that define which result items the condition must be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`;type: Record<string, string[]> ;default: {}\n * @MapProp name: mustNotMatch;attr: must-not-match;docs: The field and values that define which result items the condition must not be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\";type: Record<string, string[]> ;default: {}\n */\n@Component({\n tag: 'atomic-field-condition',\n styleUrl: 'atomic-field-condition.pcss',\n shadow: false,\n})\nexport class AtomicFieldCondition {\n @Element() host!: HTMLElement;\n\n /**\n * Verifies whether the specified fields are defined.\n */\n @Prop({reflect: true}) ifDefined?: string;\n /**\n * Verifies whether the specified fields are not defined.\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * Verifies whether the specified fields match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustMatch: Record<string, string[]> =\n {};\n\n /**\n * Verifies whether the specified fields do not match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustNotMatch: Record<string, string[]> =\n {};\n\n private conditions: ResultTemplateCondition[] = [];\n private shouldBeRemoved = false;\n\n @ResultContext() private result!: Result;\n\n public componentWillLoad() {\n if (this.ifDefined) {\n const fieldNames = this.ifDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames)\n );\n }\n\n if (this.ifNotDefined) {\n const fieldNames = this.ifNotDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames)\n );\n }\n\n this.conditions.push(\n ...makeMatchConditions(this.mustMatch, this.mustNotMatch)\n );\n }\n\n public render() {\n if (!this.conditions.every((condition) => condition(this.result))) {\n this.shouldBeRemoved = true;\n return '';\n }\n\n return <slot />;\n }\n\n public componentDidLoad() {\n this.shouldBeRemoved && this.host.remove();\n }\n}\n"],"version":3}
|
@@ -4,7 +4,7 @@ import { A as AttachIcon } from './attach-81bb8872.js';
|
|
4
4
|
import { Q as QuickviewIcon } from './preview-bb7e7a89.js';
|
5
5
|
import { I as InitializeBindings } from './initialization-utils-ffbc4136.js';
|
6
6
|
import { I as IconButton } from './stencil-iconButton-ba40899c.js';
|
7
|
-
import { R as ResultContext } from './result-template-decorators-
|
7
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
8
8
|
import './dom-utils-f6086cd3.js';
|
9
9
|
import './event-utils-8de63ec3.js';
|
10
10
|
import './init-queue-fbe942c3.js';
|
@@ -120,7 +120,7 @@ const AtomicInsightResultAction = class {
|
|
120
120
|
}
|
121
121
|
}
|
122
122
|
render() {
|
123
|
-
return (h(IconButton, { key: '
|
123
|
+
return (h(IconButton, { key: 'd5c5574abd87823727ec04b21d30068c6e5440f7', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.tooltip, onClick: () => this.onClick() }));
|
124
124
|
}
|
125
125
|
};
|
126
126
|
__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-action.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,4BAA4B,GAAG,mwjEAAmwjE,CAAC;AACzyjE,wCAAe,4BAA4B;;;;;;;;;;;;ACuB3C,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,8CAAmC,CAAA;IACnC,wCAA6B,CAAA;IAC7B,kCAAuB,CAAA;IACvB,oCAAyB,CAAA;IACzB,sCAA2B,CAAA;AAC7B,CAAC,EANW,OAAO,KAAP,OAAO,QAMlB;MASY,yBAAyB;;;;;;;QAkBN,SAAI,GAAG,EAAE,CAAC;;;;QAKV,YAAO,GAAG,EAAE,CAAC;;;;QAKb,mBAAc,GAAG,EAAE,CAAC;;;;QAKpB,WAAM,GAAqB,EAAE,CAAC;;oBAfvB,EAAE;uBAKC,EAAE;8BAKK,EAAE;sBAKQ,EAAE;;IAIpD,UAAU;QACf,IAAI,CAAC,OAAO,GAAG,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClE;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC;YACrC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC;YACnC,UAAU,CAAC;gBACT,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC;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,OAAO,aAAa,CAAC;SACxB;KACF;IAEM,MAAM;QACX,QACE,EAAC,UAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;AApG4B;IAA5B,kBAAkB,EAAE;2DAAmC;AAC/B;IAAxB,aAAa,EAAE;yDAAyB;;;;;","names":[],"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 '
|
1
|
+
{"file":"atomic-insight-result-action.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,4BAA4B,GAAG,mwjEAAmwjE,CAAC;AACzyjE,wCAAe,4BAA4B;;;;;;;;;;;;ACuB3C,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,8CAAmC,CAAA;IACnC,wCAA6B,CAAA;IAC7B,kCAAuB,CAAA;IACvB,oCAAyB,CAAA;IACzB,sCAA2B,CAAA;AAC7B,CAAC,EANW,OAA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SACT;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;KACrE;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO,IAAI,CAAC,IAAI,CAAC;SAClB;QAED,QAAQ,IAAI,CAAC,MAAM;YACjB,KAAK,OAAO,CAAC,eAAe;gBAC1B,OAAO,QAAQ,CAAC;YAClB,KAAK,OAAO,CAAC,YAAY;gBACvB,OAAO,UAAU,CAAC;YACpB,KAAK,OAAO,CAAC,SAAS;gBACpB,OAAO,aAAa,CAAC;YACvB,KAAK,OAAO,CAAC,UAAU;gBACrB,OAAO,QAAQ,CAAC;YAClB,KAAK,OAAO,CAAC,WAAW;gBACtB,OAAO,SAAS,CAAC;YACnB;gBACE,OAAO,aAAa,CAAC;SACxB;KACF;IAEM,MAAM;QACX,QACE,EAAC,UAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;AApG4B;IAA5B,kBAAkB,EAAE;2DAAmC;AAC/B;IAAxB,aAAa,EAAE;yDAAyB;;;;;","names":[],"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 '@/src/components/search/result-template-component-utils/context/stencil-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"],"version":3}
|
@@ -3,7 +3,7 @@ import { buildAttachToCase } from '@coveo/headless/insight';
|
|
3
3
|
import { A as AttachIcon } from './attach-81bb8872.js';
|
4
4
|
import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ffbc4136.js';
|
5
5
|
import { I as IconButton } from './stencil-iconButton-ba40899c.js';
|
6
|
-
import { R as ResultContext } from './result-template-decorators-
|
6
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
7
7
|
import './dom-utils-f6086cd3.js';
|
8
8
|
import './event-utils-8de63ec3.js';
|
9
9
|
import './init-queue-fbe942c3.js';
|
@@ -70,7 +70,7 @@ const AtomicInsightResultAttachToCaseAction = class {
|
|
70
70
|
: this.bindings.i18n.t('attach-to-case');
|
71
71
|
}
|
72
72
|
render() {
|
73
|
-
return (h(IconButton, { key: '
|
73
|
+
return (h(IconButton, { key: 'e1c89295cfce20a53f7fb4ee0c6bb749c9512969', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.getTooltip(), onClick: () => this.onClick() }));
|
74
74
|
}
|
75
75
|
get host() { return getElement(this); }
|
76
76
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-attach-to-case-action.entry.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,wCAAwC,GAAG,0ljEAA0ljE,CAAC;AAC5ojE,oDAAe,wCAAwC;;;;;;;;;;;;MC4B1C,qCAAqC;;;;;;;;IA+BzC,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;KACF;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,UAAU,GAAG,UAAU,CAAC;KACjE;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;cACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;cACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;KAC5C;IAEM,MAAM;QACX,QACE,EAAC,UAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;;AAzE4B;IAA5B,kBAAkB,EAAE;uEAAmC;AAC/B;IAAxB,aAAa,EAAE;qEAAyB;AASlC;IAFN,qBAAqB,CAAC,cAAc,CAAC;gFAER;;;;;","names":[],"sources":["src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.pcss?tag=atomic-insight-result-attach-to-case-action","src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, Event, State, h, Element, EventEmitter} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport DetachIcon from '../../../images/detach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '
|
1
|
+
{"file":"atomic-insight-result-attach-to-case-action.entry.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,wCAAwC,GAAG,0ljEAA0ljE,CAAC;AAC5ojE,oDAAe,wCAAwC;;;;;;;;;;;;MC4B1C,qCAAqC;;;;;;;;IA+BzC,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,iB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ight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.pcss?tag=atomic-insight-result-attach-to-case-action","src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, Event, State, h, Element, EventEmitter} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport DetachIcon from '../../../images/detach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultAttachToCaseEvent {\n callback: () => void;\n result: Result;\n}\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-action` component can be nested inside a `atomic-insight-result-actions` to render an interactive button that will emit an `atomic/insight/attachToCase/attach` or `atomic/insight/attachToCase/detach` JavaScript event, based on its current state, when clicked.\n *\n * @part result-action-container - The result action container\n * @part result-action-button - The result action button\n * @part result-action-icon - The result action icon\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-action',\n styleUrl: 'atomic-insight-result-attach-to-case-action.pcss',\n})\nexport class AtomicInsightResultAttachToCaseAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n @Event({\n eventName: 'atomic/insight/attachToCase/attach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private attach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n @Event({\n eventName: 'atomic/insight/attachToCase/detach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private detach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n private onClick() {\n if (this.attachToCase.isAttached()) {\n this.detach.emit({\n callback: this.attachToCase.detach,\n result: this.result,\n });\n } else {\n this.attach.emit({\n callback: this.attachToCase.attach,\n result: this.result,\n });\n }\n }\n\n private getIcon() {\n return this.attachToCase.isAttached() ? DetachIcon : AttachIcon;\n }\n\n private getTooltip() {\n return this.attachToCase.isAttached()\n ? this.bindings.i18n.t('detach-from-case')\n : this.bindings.i18n.t('attach-to-case');\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.getTooltip()}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"version":3}
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
|
|
2
2
|
import { buildAttachToCase } from '@coveo/headless/insight';
|
3
3
|
import { A as AttachIcon } from './attach-81bb8872.js';
|
4
4
|
import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ffbc4136.js';
|
5
|
-
import { R as ResultContext } from './result-template-decorators-
|
5
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
6
6
|
import './dom-utils-f6086cd3.js';
|
7
7
|
import './event-utils-8de63ec3.js';
|
8
8
|
import './init-queue-fbe942c3.js';
|
@@ -39,7 +39,7 @@ const AtomicInsightResultAttachToCaseIndicator = class {
|
|
39
39
|
}
|
40
40
|
render() {
|
41
41
|
if (this.attachToCase.isAttached()) {
|
42
|
-
return (h("atomic-icon", { key: '
|
42
|
+
return (h("atomic-icon", { key: 'ba05b4a5586e7d21e3f5e2657b410a2514183874', part: "icon", class: "flex w-5 justify-center", icon: AttachIcon, title: this.bindings.i18n.t('result-is-attached') }));
|
43
43
|
}
|
44
44
|
}
|
45
45
|
get host() { return getElement(this); }
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-attach-to-case-indicator.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,2CAA2C,GAAG,0ljEAA0ljE,CAAC;AAC/ojE,uDAAe,2CAA2C;;;;;;;;;;;;MCoB7C,wCAAwC;;;;;;IAe5C,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,QACE,oEACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,GACpC,EACf;SACH;KACF;;;AAlC4B;IAA5B,kBAAkB,EAAE;0EAAmC;AAC/B;IAAxB,aAAa,EAAE;wEAAyB;AASlC;IAFN,qBAAqB,CAAC,cAAc,CAAC;mFAER;;;;;","names":[],"sources":["src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.pcss?tag=atomic-insight-result-attach-to-case-indicator","src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, State, h, Element} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {ResultContext} from '
|
1
|
+
{"file":"atomic-insight-result-attach-to-case-indicator.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,2CAA2C,GAAG,0ljEAA0ljE,CAAC;AAC/ojE,uDAAe,2CAA2C;;;;;;;;;;;;MCoB7C,wCAAwC;;;;;;IAe5C,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,QACE,oEACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,GACpC,EACf;SACH;KACF;;;AAlC4B;IAA5B,kBAAkB,EAAE;0EAAmC;AAC/B;IAAxB,aAAa,EAAE;wEAAyB;AASlC;IAFN,qBAAqB,CAAC,cAAc,CAAC;mFAER;;;;;","names":[],"sources":["src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.pcss?tag=atomic-insight-result-attach-to-case-indicator","src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, State, h, Element} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-indicator` component can be included inside a result template to indicate whether a result is attached to the current case.\n *\n * @part icon The icon that indicates whether the result is attached to the case.\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-indicator',\n styleUrl: 'atomic-insight-result-attach-to-case-indicator.pcss',\n})\nexport class AtomicInsightResultAttachToCaseIndicator\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n public render() {\n if (this.attachToCase.isAttached()) {\n return (\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={AttachIcon}\n title={this.bindings.i18n.t('result-is-attached')}\n ></atomic-icon>\n );\n }\n }\n}\n"],"version":3}
|
@@ -5,7 +5,7 @@ import { Q as QuickviewIcon } from './preview-bb7e7a89.js';
|
|
5
5
|
import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ffbc4136.js';
|
6
6
|
import { A as AriaLiveRegion, F as FocusTargetController } from './stencil-accessibility-utils-ae75044b.js';
|
7
7
|
import { I as IconButton } from './stencil-iconButton-ba40899c.js';
|
8
|
-
import { R as ResultContext } from './result-template-decorators-
|
8
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
9
9
|
import './dom-utils-f6086cd3.js';
|
10
10
|
import './event-utils-8de63ec3.js';
|
11
11
|
import './init-queue-fbe942c3.js';
|
@@ -114,7 +114,7 @@ const AtomicInsightResultQuickviewAction = class {
|
|
114
114
|
this.addQuickviewModalIfNeeded();
|
115
115
|
this.updateModalContent();
|
116
116
|
if (this.shouldRenderQuickview) {
|
117
|
-
return (h(IconButton, { key: '
|
117
|
+
return (h(IconButton, { key: 'e23b1775e764f5304d2247fe30cb090811abf86f', partPrefix: "result-action", style: "outline-neutral", ref: this.focusTarget.setTarget, icon: QuickviewIcon, title: this.bindings.i18n.t('quickview'), onClick: () => this.onClick() }));
|
118
118
|
}
|
119
119
|
}
|
120
120
|
get host() { return getElement(this); }
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-quickview-action.entry.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,qCAAqC,GAAG,0ljEAA0ljE,CAAC;AACzojE,iDAAe,qCAAqC;;;;;;;;;;;;MC4BvC,kCAAkC;;;;;;;;;;;;;;QA6BtC,YAAO,GAAG,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAM/D,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;KAC/B;IAEM,UAAU;QACf,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpD,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;SAC/B,CAAC,CAAC;QACH,IAAI,MAAM,CA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css?tag=atomic-insight-result-quickview-action","src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n buildQuickview,\n QuickviewState,\n Quickview,\n Result,\n} from '@coveo/headless';\nimport {Component, Listen, Prop, State, h, Element} from '@stencil/core';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../utils/stencil-accessibility-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {Bindings} from '../../search/atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '
|
1
|
+
{"file":"atomic-insight-result-quickview-action.entry.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,qCAAqC,GAAG,0ljEAA0ljE,CAAC;AACzojE,iDAAe,qCAAqC;;;;;;;;;;;;MC4BvC,kCAAkC;;;;;;;;;;;;;;QA6BtC,YAAO,GAAG,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAM/D,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;KAC/B;IAEM,UAAU;QACf,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpD,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cAAc,CAAC,WAAW,CAAC;gFACY;;;;;","names":[],"sources":["src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.pcss?tag=atomic-insight-result-quickview-action","src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n buildQuickview,\n QuickviewState,\n Quickview,\n Result,\n} from '@coveo/headless';\nimport {Component, Listen, Prop, State, h, Element} from '@stencil/core';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../utils/stencil-accessibility-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {Bindings} from '../../search/atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-quickview-action',\n styleUrl: 'atomic-insight-result-quickview-action.pcss',\n})\nexport class AtomicInsightResultQuickviewAction\n implements InitializableComponent\n{\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n private buttonFocusTarget?: FocusTargetController;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop()\n public sandbox = 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n private get shouldRenderQuickview() {\n return this.quickviewState.resultHasPreview;\n }\n\n public render() {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n if (this.shouldRenderQuickview) {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n ref={this.focusTarget.setTarget}\n icon={QuickviewIcon}\n title={this.bindings.i18n.t('quickview')}\n onClick={() => this.onClick()}\n />\n );\n }\n }\n}\n"],"version":3}
|
@@ -7,7 +7,7 @@ import { a as buildStringTemplateFromResult } from './result-utils-7e9b6b5c.js';
|
|
7
7
|
import { a as getDefaultSlotFromHost } from './slot-utils-dcf4fc27.js';
|
8
8
|
import { g as getAttributesFromLinkSlot } from './attributes-slot-cb60f29b.js';
|
9
9
|
import { L as LinkWithItemAnalytics } from './stencil-item-link-5a3f8f23.js';
|
10
|
-
import { R as ResultContext, I as InteractiveResultContext } from './result-template-decorators-
|
10
|
+
import { R as ResultContext, I as InteractiveResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
11
11
|
import './dom-utils-f6086cd3.js';
|
12
12
|
import './init-queue-fbe942c3.js';
|
13
13
|
import './initialization-lit-stencil-common-utils-804fe146.js';
|
@@ -55,7 +55,7 @@ const AtomicIPXResultLink = class {
|
|
55
55
|
const href = isUndefined(this.hrefTemplate)
|
56
56
|
? this.result.clickUri
|
57
57
|
: buildStringTemplateFromResult(this.hrefTemplate, this.result, this.bindings);
|
58
|
-
return (h(LinkWithItemAnalytics, { key: '
|
58
|
+
return (h(LinkWithItemAnalytics, { key: 'dce9d569cd2ad2a03e89e5d86365dbfb3ca78deb', href: href, onSelect: () => this.onSelect(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (h("slot", null)) : (h("atomic-result-text", { field: "title", default: "no-title" }))));
|
59
59
|
}
|
60
60
|
get host() { return getElement(this); }
|
61
61
|
};
|
@@ -1 +1 @@
|
|
1
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E,EAAC,qBAAqB,qDACpB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EACvE,qBAAqB,EAAE,MACrB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,IAEpC,IAAI,CAAC,cAAc,IAClB,eAAQ,KAER,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,GACE,CACvB,CACqB,EACxB;KACH;;;AAxF4B;IAA5B,kBAAkB,EAAE;qDAAgC;AAG5B;IAAxB,aAAa,EAAE;mDAAkC;AACd;IAAnC,wBAAwB,EAAE;8DAA+C;;;;;","names":[],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@reference '../../../utils/tailwind-utilities/link-style.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} 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 {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\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I,CAAC,QAAQ,CACd,CAAC;QAEN,QACE,EAAC,qBAAqB,qDACpB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EACvE,qBAAqB,EAAE,MACrB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,IAEpC,IAAI,CAAC,cAAc,IAClB,eAAQ,KAER,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,GACE,CACvB,CACqB,EACxB;KACH;;;AAxF4B;IAA5B,kBAAkB,EAAE;qDAAgC;AAG5B;IAAxB,aAAa,EAAE;mDAAkC;AACd;IAAnC,wBAAwB,EAAE;8DAA+C;;;;;","names":[],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@reference '../../../utils/tailwind-utilities/link-style.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} 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 {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\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 * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\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-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\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 async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\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.onSelect()}\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"],"version":3}
|
@@ -586,7 +586,7 @@ const AtomicQuickviewModal = class {
|
|
586
586
|
});
|
587
587
|
}
|
588
588
|
render() {
|
589
|
-
return (h("atomic-modal", { key: '
|
589
|
+
return (h("atomic-modal", { key: 'a99d0aa49ca1f74b0894dd9764e2c02498b848eb', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
|
590
590
|
}
|
591
591
|
static get watchers() { return {
|
592
592
|
"highlightKeywords": ["watchHighlightKeywords"]
|
@@ -5,7 +5,7 @@ import { Q as QuickviewIcon } from './quickview-398dce04.js';
|
|
5
5
|
import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ffbc4136.js';
|
6
6
|
import { A as AriaLiveRegion, F as FocusTargetController } from './stencil-accessibility-utils-ae75044b.js';
|
7
7
|
import { B as Button } from './stencil-button-1a29a5df.js';
|
8
|
-
import { R as ResultContext } from './result-template-decorators-
|
8
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
9
9
|
import './dom-utils-f6086cd3.js';
|
10
10
|
import './event-utils-8de63ec3.js';
|
11
11
|
import './init-queue-fbe942c3.js';
|
@@ -112,7 +112,7 @@ const AtomicQuickview = class {
|
|
112
112
|
}
|
113
113
|
render() {
|
114
114
|
if (this.quickviewState.resultHasPreview) {
|
115
|
-
return (h(Button, { key: '
|
115
|
+
return (h(Button, { key: '812c28d91ada60004a79baf65b805c0974c506ad', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, h("atomic-icon", { key: 'b2c17750551b3c893b5b6e1f22a5969bbc76ecab', part: "icon", class: "flex w-5 justify-center", icon: QuickviewIcon })));
|
116
116
|
}
|
117
117
|
}
|
118
118
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-quickview.entry.js","mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,0ljEAA0ljE,CAAC;AACtnjE,8BAAe,kBAAkB;;;;;;;;;;;;MCoCpB,eAAe;;;;;;;;;;;;;;QAwBX,YAAO,GACpB,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAMhD,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;SAC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K,EAAC,yBAAyB,EAC/B,IAAI,EAAE,aAAa,GACN,CACR,EACT;SACH;KACF;;AA/H4B;IAA5B,kBAAkB,EAAE;iDAA4B;AACxB;IAAxB,aAAa,EAAE;+CAAyB;AASlC;IAFN,qBAAqB,CAAC,WAAW,CAAC;uDAEI;AAiB7B;IADT,cAAc,CAAC,WAAW,CAAC;6DACY;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-quickview/atomic-quickview.pcss?tag=atomic-quickview&encapsulation=shadow","src/components/search/result-template-components/atomic-quickview/atomic-quickview.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n Result,\n buildQuickview,\n Quickview,\n QuickviewState,\n} from '@coveo/headless';\nimport {Component, h, Listen, Prop, State} from '@stencil/core';\nimport QuickviewIcon from '../../../../images/quickview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {Button} from '../../../common/stencil-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '
|
1
|
+
{"file":"atomic-quickview.entry.js","mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,0ljEAA0ljE,CAAC;AACtnjE,8BAAe,kBAAkB;;;;;;;;;;;;MCoCpB,eAAe;;;;;;;;;;;;;;QAwBX,YAAO,GACpB,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAMhD,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IA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OAAO,CAAC,KAAK,CAAC,EACvC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,IAE/B,oEACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAE,aAAa,GACN,CACR,EACT;SACH;KACF;;AA/H4B;IAA5B,kBAAkB,EAAE;iDAA4B;AACxB;IAAxB,aAAa,EAAE;+CAAyB;AASlC;IAFN,qBAAqB,CAAC,WAAW,CAAC;uDAEI;AAiB7B;IADT,cAAc,CAAC,WAAW,CAAC;6DACY;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-quickview/atomic-quickview.pcss?tag=atomic-quickview&encapsulation=shadow","src/components/search/result-template-components/atomic-quickview/atomic-quickview.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n Result,\n buildQuickview,\n Quickview,\n QuickviewState,\n} from '@coveo/headless';\nimport {Component, h, Listen, Prop, State} from '@stencil/core';\nimport QuickviewIcon from '../../../../images/quickview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {Button} from '../../../common/stencil-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-quickview` component renders a button which the end user can click to open a modal box containing a preview\n * about a result.\n *\n * The `atomic-quickview` is not meant to replace the `atomic-result-link` to access an item in a result template; it has certain limitations (e.g., custom styles and embedded\n * images/links may not work as expected in an `atomic-quickview`).\n *\n * @part button - The button that opens the quickview modal on click.\n * @part icon - The icon for the quickview button.\n */\n@Component({\n tag: 'atomic-quickview',\n styleUrl: 'atomic-quickview.pcss',\n shadow: true,\n})\nexport class AtomicQuickview implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n private buttonFocusTarget?: FocusTargetController;\n\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop() public sandbox =\n 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n componentWillUpdate(): void {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n }\n\n public render() {\n if (this.quickviewState.resultHasPreview) {\n return (\n <Button\n part=\"button\"\n title={this.bindings.i18n.t('quickview')}\n style=\"outline-primary\"\n class=\"p-2\"\n onClick={(event) => this.onClick(event)}\n ref={this.focusTarget.setTarget}\n >\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={QuickviewIcon}\n ></atomic-icon>\n </Button>\n );\n }\n }\n}\n"],"version":3}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
|
2
2
|
import { ResultTemplatesHelpers } from '@coveo/headless';
|
3
|
-
import { R as ResultContext } from './result-template-decorators-
|
3
|
+
import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
|
4
4
|
import './stencil-item-decorators-6c453c11.js';
|
5
5
|
import './dom-utils-f6086cd3.js';
|
6
6
|
import './event-utils-8de63ec3.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-result-badge.entry.js","mappings":";;;;;;;AAAA,MAAM,oBAAoB,GAAG,stjEAAstjE,CAAC;AACpvjE,gCAAe,oBAAoB;;;;;;;;;;;;MC2CtB,iBAAiB;;;;;;;IA2BpB,UAAU;QAChB,QACE,mBACE,IAAI,EAAC,mBAAmB,EACxB,IAAI,EAAE,IAAI,CAAC,IAAK,EAChB,KAAK,EAAC,sBAAsB,GACf,EACf;KACH;IAEO,cAAc;QACpB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAO,0BAAoB,KAAK,EAAE,IAAI,CAAC,KAAK,GAAuB,CAAC;SACrE;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAO,mBAAa,KAAK,EAAE,IAAI,CAAC,KAAK,GAAgB,CAAC;SACvD;QACD,OAAO,eAAa,CAAC;KACtB;IAEO,UAAU;QAChB,OAAO,YAAM,IAAI,EAAC,oBAAoB,IAAE,IAAI,CAAC,cAAc,EAAE,CAAQ,CAAC;KACvE;IAEO,WAAW;QACjB,QACE,WACE,IAAI,EAAC,sBAAsB,EAC3B,KAAK,EAAC,wGAAwG,IAE7G,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,EAC9B,IAAI,CAAC,UAAU,EAAE,CACd,EACN;KACH;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,QAAQ,GACZ,sBAAsB,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;gBACjE,IAAI,CAAC;YACP,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;aACpB;SACF;KACF;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;KAC3B;;;AA3EwB;IAAxB,aAAa,EAAE;iDAAyB;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.pcss?tag=atomic-result-badge&encapsulation=shadow","src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\n:host {\n display: inline-flex;\n place-items: center;\n height: var(--row-height, auto);\n word-break: break-word;\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h} from '@stencil/core';\nimport {ResultContext} from '
|
1
|
+
{"file":"atomic-result-badge.entry.js","mappings":";;;;;;;AAAA,MAAM,oBAAoB,GAAG,stjEAAstjE,CAAC;AACpvjE,gCAAe,oBAAoB;;;;;;;;;;;;MC2CtB,iBAAiB;;;;;;;IA2BpB,UAAU;QAChB,QACE,mBACE,IAAI,EAAC,mBAAmB,EACxB,IAAI,EAAE,IAAI,CAAC,IAAK,EAChB,KAAK,EAAC,sBAAsB,GACf,EACf;KACH;IAEO,cAAc;QACpB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAO,0BAAoB,KAAK,EAAE,IAAI,CAAC,KAAK,GAAuB,CAAC;SACrE;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAO,mBAAa,KAAK,EAAE,IAAI,CAAC,KAAK,GAAgB,CAAC;SACvD;QACD,OAAO,eAAa,CAAC;KACtB;IAEO,UAAU;QAChB,OAAO,YAAM,IAAI,EAAC,oBAAoB,IAAE,IAAI,CAAC,cAAc,EAAE,CAAQ,CAAC;KACvE;IAEO,WAAW;QACjB,QACE,WACE,IAAI,EAAC,sBAAsB,EAC3B,KAAK,EAAC,wGAAwG,IAE7G,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,EAC9B,IAAI,CAAC,UAAU,EAAE,CACd,EACN;KACH;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,QAAQ,GACZ,sBAAsB,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;gBACjE,IAAI,CAAC;YACP,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;aACpB;SACF;KACF;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;KAC3B;;;AA3EwB;IAAxB,aAAa,EAAE;iDAAyB;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.pcss?tag=atomic-result-badge&encapsulation=shadow","src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\n:host {\n display: inline-flex;\n place-items: center;\n height: var(--row-height, auto);\n word-break: break-word;\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h} from '@stencil/core';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-badge` element renders a badge to highlight special features of a result.\n *\n * A badge can either display:\n * * Text:\n * ```html\n * <atomic-result-badge label=\"trending\"></atomic-result-badge>\n * ```\n * * The contents of a single-value field:\n * ```html\n * <atomic-result-badge field=\"objecttype\"></atomic-result-badge>\n * ```\n * * An icon:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/star.svg\"></atomic-result-badge>\n * ```\n * * Slotted elements:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/stopwatch.svg\">\n * Deal ends in <my-dynamic-countdown></my-dynamic-countdown>\n * </atomic-result-badge>\n * ```\n *\n * The contents of a multi-value field can be displayed as in the following example:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/language.svg\">\n * <atomic-result-multi-value-text field=\"language\"></atomic-result-multi-value-text>\n * </atomic-result-badge>\n * ```\n *\n * @part result-badge-element - The decorative outer-most element with the background color and text color.\n * @part result-badge-icon - The icon displayed at the left-end of the badge, if present.\n * @part result-badge-label - The wrapper around the contents at the right-end of the badge. This may be text, a field or slotted elements depending on which was configured.\n * @slot default - The element(s) to display inside the badge, instead of a field or label.\n */\n@Component({\n tag: 'atomic-result-badge',\n styleUrl: 'atomic-result-badge.pcss',\n shadow: true,\n})\nexport class AtomicResultBadge {\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n /**\n * The field to display in the badge.\n *\n * Not compatible with `label`, slotted elements nor multi-value fields.\n */\n @Prop({reflect: true}) public field?: string;\n\n /**\n * The text to display in the badge.\n *\n * Not compatible with `field` nor slotted elements.\n */\n @Prop({reflect: true}) public label?: string;\n\n /**\n * Specifies an icon to display at the left-end of the badge.\n * This can be used in conjunction with `field`, `label` or slotted elements.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly\n */\n @Prop({reflect: true}) public icon?: string;\n\n private renderIcon() {\n return (\n <atomic-icon\n part=\"result-badge-icon\"\n icon={this.icon!}\n class=\"h-3 w-3 fill-current\"\n ></atomic-icon>\n );\n }\n\n private getTextContent() {\n if (this.field !== undefined) {\n return <atomic-result-text field={this.field}></atomic-result-text>;\n }\n if (this.label !== undefined) {\n return <atomic-text value={this.label}></atomic-text>;\n }\n return <slot></slot>;\n }\n\n private renderText() {\n return <span part=\"result-badge-label\">{this.getTextContent()}</span>;\n }\n\n private renderBadge() {\n return (\n <div\n part=\"result-badge-element\"\n class=\"bg-neutral-light text-neutral-dark inline-flex h-full place-items-center space-x-1.5 rounded-full px-3\"\n >\n {this.icon && this.renderIcon()}\n {this.renderText()}\n </div>\n );\n }\n\n componentWillRender() {\n if (this.field) {\n const hasValue =\n ResultTemplatesHelpers.getResultProperty(this.result, this.field) !==\n null;\n if (!hasValue) {\n this.host.remove();\n }\n }\n }\n\n render() {\n return this.renderBadge();\n }\n}\n"],"version":3}
|