@coveo/atomic 3.33.9-pre.99566f9dae → 3.33.9-pre.a3f403762b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/_index.js +19 -19
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-field-condition.js +1 -1
- package/dist/atomic/components/atomic-field-condition.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
- package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
- package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
- package/dist/atomic/components/atomic-quickview.js +2 -2
- package/dist/atomic/components/atomic-quickview.js.map +1 -1
- package/dist/atomic/components/atomic-result-badge.js +1 -1
- package/dist/atomic/components/atomic-result-badge.js.map +1 -1
- package/dist/atomic/components/atomic-result-children.js +2 -2
- package/dist/atomic/components/atomic-result-children.js.map +1 -1
- package/dist/atomic/components/atomic-result-date.js +1 -1
- package/dist/atomic/components/atomic-result-date.js.map +1 -1
- package/dist/atomic/components/atomic-result-fields-list.js +2 -2
- package/dist/atomic/components/atomic-result-fields-list.js.map +1 -1
- package/dist/atomic/components/atomic-result-html.js +1 -1
- package/dist/atomic/components/atomic-result-html.js.map +1 -1
- package/dist/atomic/components/atomic-result-icon.js +1 -1
- package/dist/atomic/components/atomic-result-icon.js.map +1 -1
- package/dist/atomic/components/atomic-result-image.js +1 -1
- package/dist/atomic/components/atomic-result-image.js.map +1 -1
- package/dist/atomic/components/atomic-result-link.js +2 -2
- package/dist/atomic/components/atomic-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-result-localized-text.js +1 -1
- package/dist/atomic/components/atomic-result-localized-text.js.map +1 -1
- package/dist/atomic/components/atomic-result-multi-value-text.js +1 -1
- package/dist/atomic/components/atomic-result-multi-value-text.js.map +1 -1
- package/dist/atomic/components/atomic-result-number.js +1 -1
- package/dist/atomic/components/atomic-result-number.js.map +1 -1
- package/dist/atomic/components/atomic-result-printable-uri.js +1 -1
- package/dist/atomic/components/atomic-result-printable-uri.js.map +1 -1
- package/dist/atomic/components/atomic-result-rating.js +1 -1
- package/dist/atomic/components/atomic-result-rating.js.map +1 -1
- package/dist/atomic/components/atomic-result-text2.js +1 -1
- package/dist/atomic/components/atomic-result-text2.js.map +1 -1
- package/dist/atomic/components/atomic-result-timespan.js +1 -1
- package/dist/atomic/components/atomic-result-timespan.js.map +1 -1
- package/dist/atomic/components/atomic-result2.js.map +1 -1
- package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-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 +1 -2
- 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/common/item-list/fetch-item-context.js +15 -0
- package/dist/atomic/components/decorators/commerce/product-template-decorators.js +68 -0
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/{stencil-result-template-decorators.js → result-template-decorators.js} +2 -6
- package/dist/atomic/components/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-0112f957.entry.js → p-0c8e7d5f.entry.js} +2 -2
- package/dist/atomic/p-0c8e7d5f.entry.js.map +1 -0
- package/dist/atomic/{p-c34f8190.entry.js → p-0f39889d.entry.js} +2 -2
- package/dist/atomic/p-0f39889d.entry.js.map +1 -0
- package/dist/atomic/{p-4080f740.js → p-18684d4c.js} +1 -1
- package/dist/atomic/p-18684d4c.js.map +1 -0
- package/dist/atomic/{p-4cf97b0a.entry.js → p-190ddaca.entry.js} +2 -2
- package/dist/atomic/p-190ddaca.entry.js.map +1 -0
- package/dist/atomic/{p-6a3b139f.entry.js → p-1ff7a9da.entry.js} +2 -2
- package/dist/atomic/p-1ff7a9da.entry.js.map +1 -0
- package/dist/atomic/{p-9c3cabca.entry.js → p-20019654.entry.js} +2 -2
- package/dist/atomic/p-20019654.entry.js.map +1 -0
- package/dist/atomic/{p-5894d6f6.entry.js → p-2e4628bb.entry.js} +2 -2
- package/dist/atomic/p-2e4628bb.entry.js.map +1 -0
- package/dist/atomic/{p-a5355f5d.entry.js → p-3ba27d6a.entry.js} +2 -2
- package/dist/atomic/{p-48d78fc6.entry.js → p-3e38aea6.entry.js} +2 -2
- package/dist/atomic/{p-268ce7ca.entry.js → p-4069d801.entry.js} +2 -2
- package/dist/atomic/p-4069d801.entry.js.map +1 -0
- package/dist/atomic/{p-bc94258c.entry.js → p-44ef70b6.entry.js} +2 -2
- package/dist/atomic/p-44ef70b6.entry.js.map +1 -0
- package/dist/atomic/{p-42617c90.entry.js → p-62afcf79.entry.js} +2 -2
- package/dist/atomic/p-62afcf79.entry.js.map +1 -0
- package/dist/atomic/{p-68896e7d.js → p-63dd5e46.js} +2 -2
- package/dist/atomic/{p-ca8c87ce.entry.js → p-723f76a1.entry.js} +2 -2
- package/dist/atomic/{p-ca8c87ce.entry.js.map → p-723f76a1.entry.js.map} +1 -1
- package/dist/atomic/{p-5a9460ab.entry.js → p-78427c6a.entry.js} +2 -2
- package/dist/atomic/p-78427c6a.entry.js.map +1 -0
- package/dist/atomic/{p-e1ab844f.entry.js → p-7b1cd0b5.entry.js} +2 -2
- package/dist/atomic/{p-cacb7fd8.entry.js → p-852cc16d.entry.js} +2 -2
- package/dist/atomic/p-852cc16d.entry.js.map +1 -0
- package/dist/atomic/p-93da1f4e.entry.js.map +1 -1
- package/dist/atomic/{p-c6e2939f.entry.js → p-93f1d551.entry.js} +2 -2
- package/dist/atomic/p-93f1d551.entry.js.map +1 -0
- package/dist/atomic/{p-e1dbe31d.entry.js → p-945ddd53.entry.js} +2 -2
- package/dist/atomic/p-945ddd53.entry.js.map +1 -0
- package/dist/atomic/{p-037de646.entry.js → p-a4d277c7.entry.js} +2 -2
- package/dist/atomic/p-a4d277c7.entry.js.map +1 -0
- package/dist/atomic/{p-8e964890.entry.js → p-b3f6561d.entry.js} +2 -2
- package/dist/atomic/p-b3f6561d.entry.js.map +1 -0
- package/dist/atomic/{p-c41ab197.entry.js → p-c25f1437.entry.js} +2 -2
- package/dist/atomic/p-c25f1437.entry.js.map +1 -0
- package/dist/atomic/{p-acb1704c.entry.js → p-c9f1790d.entry.js} +2 -2
- package/dist/atomic/p-c9f1790d.entry.js.map +1 -0
- package/dist/atomic/{p-9564d67d.entry.js → p-dbf0c5a3.entry.js} +2 -2
- package/dist/atomic/{p-9564d67d.entry.js.map → p-dbf0c5a3.entry.js.map} +1 -1
- package/dist/atomic/{p-beee63e4.entry.js → p-df1d50c8.entry.js} +2 -2
- package/dist/atomic/p-df1d50c8.entry.js.map +1 -0
- package/dist/atomic/{p-3ec45f9c.entry.js → p-e9dc8e90.entry.js} +2 -2
- package/dist/atomic/p-e9dc8e90.entry.js.map +1 -0
- package/dist/atomic/{p-8ce6badd.entry.js → p-ee957926.entry.js} +2 -2
- package/dist/atomic/p-ee957926.entry.js.map +1 -0
- package/dist/atomic/{p-5f2abcb4.entry.js → p-fafd5042.entry.js} +2 -2
- package/dist/atomic/p-fafd5042.entry.js.map +1 -0
- package/dist/cjs/_index.cjs.js +20 -20
- package/dist/cjs/{analytics-config-0af59f0d.js → analytics-config-9c9d5e75.js} +2 -2
- package/dist/cjs/{analytics-config-0af59f0d.js.map → analytics-config-9c9d5e75.js.map} +1 -1
- package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
- package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
- package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
- package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{stencil-result-template-decorators-28b05aaf.js → result-template-decorators-432d11a9.js} +2 -6
- package/dist/cjs/result-template-decorators-432d11a9.js.map +1 -0
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_index.js +19 -19
- package/dist/esm/{analytics-config-67197f4c.js → analytics-config-a3308fef.js} +2 -2
- package/dist/esm/{analytics-config-67197f4c.js.map → analytics-config-a3308fef.js.map} +1 -1
- package/dist/esm/atomic-field-condition.entry.js +1 -1
- package/dist/esm/atomic-field-condition.entry.js.map +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-insight-result-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
- package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
- package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-quickview-modal.entry.js +1 -1
- package/dist/esm/atomic-quickview.entry.js +2 -2
- package/dist/esm/atomic-quickview.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-result-badge.entry.js +1 -1
- package/dist/esm/atomic-result-badge.entry.js.map +1 -1
- package/dist/esm/atomic-result-children.entry.js +2 -2
- package/dist/esm/atomic-result-children.entry.js.map +1 -1
- package/dist/esm/atomic-result-date.entry.js +1 -1
- package/dist/esm/atomic-result-date.entry.js.map +1 -1
- package/dist/esm/atomic-result-fields-list.entry.js +2 -2
- package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
- package/dist/esm/atomic-result-html.entry.js +1 -1
- package/dist/esm/atomic-result-html.entry.js.map +1 -1
- package/dist/esm/atomic-result-icon.entry.js +1 -1
- package/dist/esm/atomic-result-icon.entry.js.map +1 -1
- package/dist/esm/atomic-result-image.entry.js +1 -1
- package/dist/esm/atomic-result-image.entry.js.map +1 -1
- package/dist/esm/atomic-result-link.entry.js +2 -2
- package/dist/esm/atomic-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-result-localized-text.entry.js +2 -2
- package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
- package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
- package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
- package/dist/esm/atomic-result-number.entry.js +1 -1
- package/dist/esm/atomic-result-number.entry.js.map +1 -1
- package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
- package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
- package/dist/esm/atomic-result-rating.entry.js +1 -1
- package/dist/esm/atomic-result-rating.entry.js.map +1 -1
- package/dist/esm/atomic-result-text_2.entry.js +1 -1
- package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
- package/dist/esm/atomic-result-timespan.entry.js +1 -1
- package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
- package/dist/esm/atomic-result.entry.js.map +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{stencil-result-template-decorators-f989bc6b.js → result-template-decorators-2ed76ea9.js} +2 -6
- package/dist/esm/result-template-decorators-2ed76ea9.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/stencil-product-template-decorators.d.ts → 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/stencil-result-template-decorators.d.ts → result-template-components/result-template-decorators.d.ts} +2 -6
- package/dist/types/decorators/commerce/product-template-decorators.d.ts +68 -0
- 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/commerce/product-template-component-utils/context/interactive-product-context-controller.js +0 -25
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +0 -29
- package/dist/atomic/components/stencil-result-template-decorators.js.map +0 -1
- package/dist/atomic/p-0112f957.entry.js.map +0 -1
- package/dist/atomic/p-037de646.entry.js.map +0 -1
- package/dist/atomic/p-268ce7ca.entry.js.map +0 -1
- package/dist/atomic/p-3ec45f9c.entry.js.map +0 -1
- package/dist/atomic/p-4080f740.js.map +0 -1
- package/dist/atomic/p-42617c90.entry.js.map +0 -1
- package/dist/atomic/p-4cf97b0a.entry.js.map +0 -1
- package/dist/atomic/p-5894d6f6.entry.js.map +0 -1
- package/dist/atomic/p-5a9460ab.entry.js.map +0 -1
- package/dist/atomic/p-5f2abcb4.entry.js.map +0 -1
- package/dist/atomic/p-6a3b139f.entry.js.map +0 -1
- package/dist/atomic/p-8ce6badd.entry.js.map +0 -1
- package/dist/atomic/p-8e964890.entry.js.map +0 -1
- package/dist/atomic/p-9c3cabca.entry.js.map +0 -1
- package/dist/atomic/p-acb1704c.entry.js.map +0 -1
- package/dist/atomic/p-bc94258c.entry.js.map +0 -1
- package/dist/atomic/p-beee63e4.entry.js.map +0 -1
- package/dist/atomic/p-c34f8190.entry.js.map +0 -1
- package/dist/atomic/p-c41ab197.entry.js.map +0 -1
- package/dist/atomic/p-c6e2939f.entry.js.map +0 -1
- package/dist/atomic/p-cacb7fd8.entry.js.map +0 -1
- package/dist/atomic/p-e1dbe31d.entry.js.map +0 -1
- package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +0 -1
- package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +0 -1
- package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +0 -12
- package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +0 -27
- package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +0 -33
- package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +0 -8
- package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +0 -12
- package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +0 -18
- /package/dist/atomic/{p-a5355f5d.entry.js.map → p-3ba27d6a.entry.js.map} +0 -0
- /package/dist/atomic/{p-48d78fc6.entry.js.map → p-3e38aea6.entry.js.map} +0 -0
- /package/dist/atomic/{p-68896e7d.js.map → p-63dd5e46.js.map} +0 -0
- /package/dist/atomic/{p-e1ab844f.entry.js.map → p-7b1cd0b5.entry.js.map} +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["AtomicResultLocalizedText","this","field","render","bindings","i18n","t","localeKey","parseFieldValues","parseFieldCount","ret","Object","keys","length","entries","forEach","fieldName","i18nParameter","fieldValueRaw","ResultTemplatesHelpers","getResultProperty","result","isNullOrUndefined","fieldCount","count","__decorate","InitializeBindings","ResultContext","MapProp"],"sources":["src/components/search/result-template-components/atomic-result-localized-text/atomic-result-localized-text.ts"],"sourcesContent":["import {isNullOrUndefined} from '@coveo/bueno';\nimport {type Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, State} from '@stencil/core';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {\n type InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {MapProp} from '../../../../utils/props-utils';\nimport type {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-result-localized-text` component renders a target i18n localized string using the values of a target field.\n *\n * Given this i18n configuration:\n * ```\n * searchInterface.i18n.addResourceBundle('en', 'translation', {\n * classic_book_advert: 'Classic book from {{name}}',\n * });\n * ```\n *\n * The component could be configured in such a way to replace `{{name}}` with the `author` field value from the result item:\n * ```\n * <atomic-result-localized-text locale-key=\"classic_book_advert\" field-author=\"name\"></atomic-result-localized-text>\n * ```\n *\n * @MapProp name: field;attr: field;docs: The field from which to extract the target string and the variable used to map it to the target i18n parameter. For example, the following configuration extracts the value of `author` from a result, and assign it to the i18n parameter `name`: `field-author=\"name\"`;type: Record<string, string> ;default: {}\n */\n@Component({\n tag: 'atomic-result-localized-text',\n})\nexport class AtomicResultLocalizedText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @State() public error!: Error;\n\n @ResultContext() private result!: Result;\n /**\n * The i18n translation key.\n */\n @Prop() localeKey!: string;\n /**\n * The field value to dynamically evaluate.\n */\n @Prop() @MapProp() field: Record<string, string> = {};\n /**\n * The numerical field value used to determine whether to use the singular or plural value of a translation.\n * */\n @Prop() fieldCount?: string;\n\n render() {\n return this.bindings.i18n.t(this.localeKey, {\n ...this.parseFieldValues(),\n ...this.parseFieldCount(),\n });\n }\n\n private parseFieldValues() {\n const ret: Record<string, unknown> = {};\n if (Object.keys(this.field).length === 0) {\n return ret;\n }\n Object.entries(this.field).forEach(([fieldName, i18nParameter]) => {\n const fieldValueRaw = ResultTemplatesHelpers.getResultProperty(\n this.result,\n fieldName\n );\n if (!isNullOrUndefined(fieldValueRaw)) {\n ret[i18nParameter] = fieldValueRaw;\n }\n });\n\n return ret;\n }\n\n private parseFieldCount() {\n if (!this.fieldCount) {\n return {};\n }\n return {\n count:\n (ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.fieldCount!\n ) as number) ?? 1,\n };\n }\n}\n"],"mappings":"2yBA+BaA,EAAyB,M,yBAYjBC,KAAAC,MAAgC,G,yDAAA,G,0BAMnD,MAAAC,GACE,OAAOF,KAAKG,SAASC,KAAKC,EAAEL,KAAKM,UAAW,IACvCN,KAAKO,sBACLP,KAAKQ,mB,CAIJ,gBAAAD,GACN,MAAME,EAA+B,GACrC,GAAIC,OAAOC,KAAKX,KAAKC,OAAOW,SAAW,EAAG,CACxC,OAAOH,C,CAETC,OAAOG,QAAQb,KAAKC,OAAOa,SAAQ,EAAEC,EAAWC,MAC9C,MAAMC,EAAgBC,EAAuBC,kBAC3CnB,KAAKoB,OACLL,GAEF,IAAKM,EAAkBJ,GAAgB,CACrCR,EAAIO,GAAiBC,C,KAIzB,OAAOR,C,CAGD,eAAAD,GACN,IAAKR,KAAKsB,WAAY,CACpB,MAAO,E,CAET,MAAO,CACLC,MACGL,EAAuBC,kBACtBnB,KAAKoB,OACLpB,KAAKsB,aACS,E,GAnDOE,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BAQkBF,EAAA,CAAVG,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultLinkCss","AtomicResultLinkStyle0","AtomicResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotFromHost","linkAttributes","getAttributesFromLinkSlot","render","href","isUndefined","hrefTemplate","result","clickUri","buildStringTemplateFromResult","bindings","h","LinkWithItemAnalytics","key","onSelect","interactiveResult","select","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/search/result-template-components/atomic-result-link/atomic-result-link.pcss?tag=atomic-result-link","src/components/search/result-template-components/atomic-result-link/atomic-result-link.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@reference '../../../../utils/tailwind-utilities/link-style.css';\natomic-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {InteractiveResult} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {\n InteractiveResultContext,\n ResultContext,\n} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-link` component automatically transforms a search result title into a clickable link that points to the original item.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-link',\n styleUrl: 'atomic-result-link.pcss',\n shadow: false,\n})\nexport class AtomicResultLink implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"gfAAA,MAAMA,EAAsB,qwkEAC5B,MAAAC,EAAeD,E,iXC4BFE,EAAgB,M,qDA0BpB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,I,CAMvC,iBAAAC,GACL,MAAMC,EAAW,aACjBN,KAAKO,iBAAmBC,EAAuBR,KAAKC,MACpDD,KAAKS,eAAiBC,EAA0BV,KAAKC,KAAMK,E,CAGtD,MAAAK,GACL,MAAMC,EAAOC,EAAYb,KAAKc,cAC1Bd,KAAKe,OAAOC,SACZC,EACEjB,KAAKc,aACLd,KAAKe,OACLf,KAAKkB,UAGX,OACEC,EAACC,EAAqB,CAAAC,IAAA,2CACpBT,KAAMA,EACNU,SAAU,IAAMtB,KAAKuB,kBAAkBC,SACvCC,qBAAsB,IAAMzB,KAAKuB,kBAAkBG,qBACnDC,sBAAuB,IACrB3B,KAAKuB,kBAAkBK,sBAEzBC,WAAY7B,KAAKS,eACjBL,gBAAiBJ,KAAKI,iBAErBJ,KAAKO,eACJY,EAAA,aAEAA,EAAA,sBACEW,MAAM,QACNC,QAAQ,a,6BAnEWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultFieldsListCss","AtomicResultFieldsListStyle0","AtomicResultFieldsList","constructor","hostRef","this","updatingChildren","rows","connectedCallback","window","ResizeObserver","resizeObserver","update","observe","host","parentElement","disconnectedCallback","disconnect","componentDidRender","showDividers","showChildren","hideChildrenToFit","hideDividersAtEndOfRows","hostChildren","Array","from","children","isOverflowing","scrollWidth","clientWidth","scrollHeight","clientHeight","getSortedChildrenBySize","sort","a","b","offsetWidth","hide","element","style","display","show","isChildHidden","setHideDivider","hideDivider","classList","toggle","forEach","child","i","length","previousChild","filter","row","offsetTop","indexOf","push","render","h","Host","key","__decorate","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-fields-list/atomic-result-fields-list.pcss?tag=atomic-result-fields-list","src/components/search/result-template-components/atomic-result-fields-list/atomic-result-fields-list.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\natomic-result-fields-list {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n height: 100%;\n\n > * {\n &::after {\n display: block;\n content: ' ';\n width: 1px;\n height: 1rem;\n margin: 0 1rem;\n @apply bg-neutral;\n vertical-align: middle;\n }\n\n &.hide-divider::after {\n visibility: hidden;\n }\n }\n}\n","import {Result} from '@coveo/headless';\nimport {Component, h, Element, Host} from '@stencil/core';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-fields-list` component selectively renders its children to ensure they fit the parent element and adds dividers between them.\n * @slot default - The children to render.\n */\n@Component({\n tag: 'atomic-result-fields-list',\n styleUrl: 'atomic-result-fields-list.pcss',\n shadow: false,\n})\nexport class AtomicResultFieldsList {\n @ResultContext()\n protected result!: Result;\n\n private resizeObserver?: ResizeObserver;\n\n private updatingChildren = false;\n private rows: number[] = [];\n @Element() private host!: HTMLElement;\n\n public connectedCallback() {\n if (window.ResizeObserver) {\n this.resizeObserver = new ResizeObserver(() => this.update());\n this.resizeObserver.observe(this.host.parentElement!);\n }\n }\n\n public disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n public componentDidRender() {\n this.update();\n }\n\n public update() {\n if (this.updatingChildren) {\n return;\n }\n this.updatingChildren = true;\n this.showDividers();\n this.showChildren();\n this.hideChildrenToFit();\n this.hideDividersAtEndOfRows();\n this.updatingChildren = false;\n }\n\n private get hostChildren() {\n return Array.from(this.host.children) as HTMLElement[];\n }\n\n private get isOverflowing() {\n return (\n this.host.scrollWidth > this.host.clientWidth ||\n this.host.scrollHeight > this.host.clientHeight\n );\n }\n\n private getSortedChildrenBySize() {\n return this.hostChildren.sort((a, b) => a.offsetWidth - b.offsetWidth);\n }\n\n private hide(element: HTMLElement) {\n element.style.display = 'none';\n }\n\n private show(element: HTMLElement) {\n element.style.display = '';\n }\n\n private isChildHidden(element: HTMLElement) {\n return element.style.display === 'none';\n }\n\n private setHideDivider(element: HTMLElement, hideDivider: boolean) {\n element.classList.toggle('hide-divider', hideDivider);\n }\n\n private showChildren() {\n this.hostChildren.forEach((child) => this.show(child));\n }\n\n private showDividers() {\n this.hostChildren.forEach((child) => this.setHideDivider(child, false));\n }\n\n private hideChildrenToFit() {\n const children = this.getSortedChildrenBySize();\n for (let i = children.length - 1; this.isOverflowing && i >= 0; i--) {\n this.hide(children[i]);\n }\n }\n\n private hideDividersAtEndOfRows() {\n this.rows = [];\n let previousChild: HTMLElement | null = null;\n this.hostChildren\n .filter((child) => !this.isChildHidden(child))\n .forEach((child) => {\n const row = child.offsetTop;\n if (this.rows.indexOf(row) === -1) {\n this.rows.push(row);\n if (previousChild) {\n this.setHideDivider(previousChild, true);\n }\n }\n previousChild = child;\n });\n if (previousChild) {\n this.setHideDivider(previousChild, true);\n }\n }\n\n render() {\n return <Host></Host>;\n }\n}\n"],"mappings":"qKAAA,MAAMA,EAA4B,g1jEAClC,MAAAC,EAAeD,E,iXCYFE,EAAsB,MALnC,WAAAC,CAAAC,G,UAWUC,KAAAC,iBAAmB,MACnBD,KAAAE,KAAiB,E,CAGlB,iBAAAC,GACL,GAAIC,OAAOC,eAAgB,CACzBL,KAAKM,eAAiB,IAAID,gBAAe,IAAML,KAAKO,WACpDP,KAAKM,eAAeE,QAAQR,KAAKS,KAAKC,c,EAInC,oBAAAC,GACLX,KAAKM,gBAAgBM,Y,CAGhB,kBAAAC,GACLb,KAAKO,Q,CAGA,MAAAA,GACL,GAAIP,KAAKC,iBAAkB,CACzB,M,CAEFD,KAAKC,iBAAmB,KACxBD,KAAKc,eACLd,KAAKe,eACLf,KAAKgB,oBACLhB,KAAKiB,0BACLjB,KAAKC,iBAAmB,K,CAG1B,gBAAYiB,GACV,OAAOC,MAAMC,KAAKpB,KAAKS,KAAKY,S,CAG9B,iBAAYC,GACV,OACEtB,KAAKS,KAAKc,YAAcvB,KAAKS,KAAKe,aAClCxB,KAAKS,KAAKgB,aAAezB,KAAKS,KAAKiB,Y,CAI/B,uBAAAC,GACN,OAAO3B,KAAKkB,aAAaU,MAAK,CAACC,EAAGC,IAAMD,EAAEE,YAAcD,EAAEC,a,CAGpD,IAAAC,CAAKC,GACXA,EAAQC,MAAMC,QAAU,M,CAGlB,IAAAC,CAAKH,GACXA,EAAQC,MAAMC,QAAU,E,CAGlB,aAAAE,CAAcJ,GACpB,OAAOA,EAAQC,MAAMC,UAAY,M,CAG3B,cAAAG,CAAeL,EAAsBM,GAC3CN,EAAQO,UAAUC,OAAO,eAAgBF,E,CAGnC,YAAAxB,GACNf,KAAKkB,aAAawB,SAASC,GAAU3C,KAAKoC,KAAKO,I,CAGzC,YAAA7B,GACNd,KAAKkB,aAAawB,SAASC,GAAU3C,KAAKsC,eAAeK,EAAO,Q,CAG1D,iBAAA3B,GACN,MAAMK,EAAWrB,KAAK2B,0BACtB,IAAK,IAAIiB,EAAIvB,EAASwB,OAAS,EAAG7C,KAAKsB,eAAiBsB,GAAK,EAAGA,IAAK,CACnE5C,KAAKgC,KAAKX,EAASuB,G,EAIf,uBAAA3B,GACNjB,KAAKE,KAAO,GACZ,IAAI4C,EAAoC,KACxC9C,KAAKkB,aACF6B,QAAQJ,IAAW3C,KAAKqC,cAAcM,KACtCD,SAASC,IACR,MAAMK,EAAML,EAAMM,UAClB,GAAIjD,KAAKE,KAAKgD,QAAQF,MAAU,EAAG,CACjChD,KAAKE,KAAKiD,KAAKH,GACf,GAAIF,EAAe,CACjB9C,KAAKsC,eAAeQ,EAAe,K,EAGvCA,EAAgBH,CAAK,IAEzB,GAAIG,EAAe,CACjB9C,KAAKsC,eAAeQ,EAAe,K,EAIvC,MAAAM,GACE,OAAOC,EAACC,EAAI,CAAAC,IAAA,4C,6BAtGJC,EAAA,CADTC,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicInsightResultActionCss","AtomicInsightResultActionStyle0","Actions","AtomicInsightResultAction","this","icon","tooltip","tooltipOnClick","action","initialize","actions","loadInsightAnalyticsActions","bindings","engine","onClick","originalTooltip","setTimeout","CopyToClipboard","dispatch","logCopyToClipboard","result","navigator","clipboard","writeText","clickUri","PostToFeed","logFeedItemTextPost","SendAsEmail","logCaseSendEmail","actionClicked","emit","getIcon","CopyIcon","AttachToCase","AttachIcon","Quickview","QuickviewIcon","FeedIcon","EmailIcon","render","h","IconButton","key","partPrefix","style","title","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/insight/atomic-insight-result-action/atomic-insight-result-action.pcss?tag=atomic-insight-result-action","src/components/insight/atomic-insight-result-action/atomic-insight-result-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n\n:host {\n &::part(result-action-button) {\n @apply flex items-center justify-center;\n @apply h-8 w-8;\n }\n}\n","import {Result} from '@coveo/headless';\nimport {\n InsightAnalyticsActionCreators,\n loadInsightAnalyticsActions,\n} from '@coveo/headless/insight';\nimport {Component, Event, EventEmitter, Prop, State, h} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport CopyIcon from '../../../images/copy-dark.svg';\nimport EmailIcon from '../../../images/email.svg';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport FeedIcon from '../../../images/share-post.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '@/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"],"mappings":"+qEAAA,MAAMA,EAA+B,wnjEACrC,MAAAC,EAAeD,E,2WCuBf,IAAYE,GAAZ,SAAYA,GACVA,EAAA,qCACAA,EAAA,+BACAA,EAAA,yBACAA,EAAA,2BACAA,EAAA,4BACD,EAND,CAAYA,MAAO,K,MAeNC,EAAyB,M,yFAkBNC,KAAAC,KAAO,GAKPD,KAAAE,QAAU,GAKVF,KAAAG,eAAiB,GAKjBH,KAAAI,OAA2B,G,+BAfpB,G,aAKG,G,oBAKO,G,YAKU,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ableUri","this","listExpanded","maxNumberOfParts","focusTarget","expandedPartFocus","FocusTargetController","connectedCallback","Schema","NumberValue","min","validate","error","slotName","linkAttributes","getAttributesFromLinkSlot","host","initialize","interactiveResult","buildInteractiveResult","bindings","engine","options","result","getIndexOfEllipsis","parentsCount","valuesToHide","Math","max","valuesToShowBeforeEllipsis","renderEllipsis","h","i18n","t","onClick","e","stopPropagation","focusOnNextTarget","renderSeparator","allParents","parentsXml","parseXML","raw","parents","Array","from","getElementsByTagName","ellipsisIndex","length","map","parent","i","name","getAttribute","uri","renderLink","class","icon","Arrow","role","renderParents","slice","content","shouldSetTarget","LinkWithItemAnalytics","href","title","undefined","onSelect","select","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","ref","el","setTarget","render","field","clickUri","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-printable-uri/atomic-result-printable-uri.pcss?tag=atomic-result-printable-uri","src/components/search/result-template-components/atomic-result-printable-uri/atomic-result-printable-uri.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\natomic-result-printable-uri {\n max-width: 100%;\n word-break: break-word;\n\n a,\n button {\n @apply text-primary;\n\n &:hover,\n &:focus-visible {\n text-decoration: underline;\n @apply text-primary;\n }\n\n &:focus {\n outline: none;\n }\n\n &:visited {\n @apply text-visited;\n }\n }\n\n ul {\n display: flex;\n flex-wrap: wrap;\n }\n\n li {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n\n a {\n display: inline-block;\n vertical-align: middle;\n max-width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n white-space: nowrap;\n &:last-child {\n white-space: normal;\n\n &::after {\n content: none;\n }\n }\n\n .result-printable-uri-separator {\n display: inline-block;\n margin: 0 0.5rem;\n vertical-align: middle;\n width: 0.75rem;\n height: 0.75rem;\n @apply text-neutral-dark;\n }\n }\n}\n","import {Schema, NumberValue} from '@coveo/bueno';\nimport {\n buildInteractiveResult,\n InteractiveResult,\n Result,\n} from '@coveo/headless';\nimport {Component, Element, h, Prop, State, VNode} from '@stencil/core';\nimport Arrow from '../../../../images/arrow-right.svg';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {parseXML} from '../../../../utils/utils';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-printable-uri` component displays the URI, or path, to access a result.\n *\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to anchor elements, overriding other attributes.\n * To be used exclusively in anchor elements, such as: `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-printable-uri',\n styleUrl: 'atomic-result-printable-uri.pcss',\n shadow: false,\n})\nexport class AtomicResultPrintableUri {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() public host!: HTMLElement;\n\n @State() listExpanded = false;\n @State() error!: Error;\n\n /**\n * The maximum number of Uri parts to display. This has to be over the minimum of `3` in order to be effective. Putting `Infinity` will disable the ellipsis.\n */\n @Prop({reflect: true}) maxNumberOfParts = 5;\n\n private expandedPartFocus?: FocusTargetController;\n\n private interactiveResult!: InteractiveResult;\n private linkAttributes?: Attr[];\n\n private get focusTarget() {\n if (!this.expandedPartFocus) {\n this.expandedPartFocus = new FocusTargetController(this);\n }\n return this.expandedPartFocus;\n }\n\n public connectedCallback() {\n try {\n new Schema({\n maxNumberOfParts: new NumberValue({min: 3}),\n }).validate({maxNumberOfParts: this.maxNumberOfParts});\n } catch (error) {\n this.error = error as Error;\n }\n const slotName = 'attributes';\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public initialize() {\n this.interactiveResult = buildInteractiveResult(this.bindings.engine, {\n options: {result: this.result},\n });\n }\n\n private getIndexOfEllipsis(parentsCount: number) {\n const valuesToHide = Math.max(2, parentsCount - this.maxNumberOfParts);\n const valuesToShowBeforeEllipsis = parentsCount - valuesToHide - 1;\n return valuesToShowBeforeEllipsis;\n }\n\n private renderEllipsis() {\n return (\n <li>\n <button\n aria-label={this.bindings.i18n.t('collapsed-uri-parts')}\n onClick={(e) => {\n e.stopPropagation();\n this.focusTarget.focusOnNextTarget();\n this.listExpanded = true;\n }}\n >\n ...\n </button>\n {this.renderSeparator()}\n </li>\n );\n }\n\n private get allParents() {\n const parentsXml = parseXML(`${this.result.raw.parents}`);\n const parents = Array.from(parentsXml.getElementsByTagName('parent'));\n const ellipsisIndex = this.getIndexOfEllipsis(parents.length);\n return parents.map((parent, i) => {\n const name = parent.getAttribute('name');\n const uri = parent.getAttribute('uri')!;\n return (\n <li>\n {this.renderLink(name, uri, i === ellipsisIndex)}\n {i === parents.length - 1 ? null : this.renderSeparator()}\n </li>\n );\n });\n }\n\n private renderSeparator() {\n return (\n <atomic-icon\n class=\"result-printable-uri-separator\"\n icon={Arrow}\n role=\"separator\"\n ></atomic-icon>\n );\n }\n\n private renderParents() {\n const parents = this.allParents;\n if (this.listExpanded || parents.length <= this.maxNumberOfParts) {\n return parents;\n }\n\n return [\n parents.slice(0, this.getIndexOfEllipsis(parents.length)),\n this.renderEllipsis(),\n parents.slice(-1),\n ];\n }\n\n private renderLink(\n content: VNode | string | null,\n uri: string,\n shouldSetTarget: boolean\n ) {\n return (\n <LinkWithItemAnalytics\n href={uri}\n title={typeof content === 'string' ? content : undefined}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n ref={\n shouldSetTarget\n ? (el?: HTMLAnchorElement) => this.focusTarget.setTarget(el)\n : undefined\n }\n >\n {content}\n </LinkWithItemAnalytics>\n );\n }\n\n public render() {\n const parents = this.renderParents();\n if (parents.length) {\n return (\n <ul aria-label={this.bindings.i18n.t('printable-uri')}>{parents}</ul>\n );\n }\n\n return this.renderLink(\n <atomic-result-text field=\"printableUri\"></atomic-result-text>,\n this.result.clickUri,\n false\n );\n }\n}\n"],"mappings":"snBAAA,MAAMA,EAA8B,62lEACpC,MAAAC,EAAeD,E,iXC0BFE,EAAwB,M,yBAK1BC,KAAAC,aAAe,MAMDD,KAAAE,iBAAmB,E,kBANlB,M,2CAMkB,C,CAO1C,eAAYC,GACV,IAAKH,KAAKI,kBAAmB,CAC3BJ,KAAKI,kBAAoB,IAAIC,EAAsBL,K,CAErD,OAAOA,KAAKI,iB,CAGP,iBAAAE,GACL,IACE,IAAIC,EAAO,CACTL,iBAAkB,IAAIM,EAAY,CAACC,IAAK,MACvCC,SAAS,CAACR,iBAAkBF,KAAKE,kB,CACpC,MAAOS,GACPX,KAAKW,MAAQA,C,CAEf,MAAMC,EAAW,aACjBZ,KAAKa,eAAiBC,EAA0Bd,KAAKe,KAAMH,E,CAGtD,UAAAI,GACLhB,KAAKiB,kBAAoBC,EAAuBlB,KAAKmB,SAASC,OAAQ,CACpEC,QAAS,CAACC,OAAQtB,KAAKsB,S,CAInB,kBAAAC,CAAmBC,GACzB,MAAMC,EAAeC,KAAKC,IAAI,EAAGH,EAAexB,KAAKE,kBACrD,MAAM0B,EAA6BJ,EAAeC,EAAe,EACjE,OAAOG,C,CAGD,cAAAC,GACN,OACEC,EAAA,UACEA,EAAA,uBACc9B,KAAKmB,SAASY,KAAKC,EAAE,uBACjCC,QAAUC,IACRA,EAAEC,kBACFnC,KAAKG,YAAYiC,oBACjBpC,KAAKC,aAAe,IAAI,GACzB,OAIFD,KAAKqC,kB,CAKZ,cAAYC,GACV,MAAMC,EAAaC,EAAS,GAAGxC,KAAKsB,OAAOmB,IAAIC,WAC/C,MAAMA,EAAUC,MAAMC,KAAKL,EAAWM,qBA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 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicInsightResultAttachToCaseIndicatorCss","AtomicInsightResultAttachToCaseIndicatorStyle0","AtomicInsightResultAttachToCaseIndicator","initialize","caseId","this","bindings","engine","state","insightCaseContext","attachToCase","buildAttachToCase","options","result","render","isAttached","h","key","part","class","icon","AttachIcon","title","i18n","t","__decorate","InitializeBindings","ResultContext","BindStateToController"],"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"],"mappings":"yVAAA,MAAMA,EAA8C,+8iEACpD,MAAAC,EAAeD,E,iXCoBFE,EAAwC,M,+EAe5C,UAAAC,GACL,MAAMC,EACJC,KAAKC,SAASC,OAAOC,MAAMC,oBAAoBL,QAAU,GAC3DC,KAAKK,aAAeC,EAAkBN,KAAKC,SAASC,OAAQ,CAC1DK,QAAS,CACPC,OAAQR,KAAKQ,OACbT,OAAQA,I,CAKP,MAAAU,GACL,GAAIT,KAAKK,aAAaK,aAAc,CAClC,OACEC,EAAA,eAAAC,IAAA,2CACEC,KAAK,OACLC,MAAM,0BACNC,KAAMC,EACNC,MAAOjB,KAAKC,SAASiB,KAAKC,EAAE,uB,8BA9BPC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K,6BASMF,EAAA,CAFNG,EAAsB,iB","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultRatingCss","AtomicResultRatingStyle0","AtomicResultRating","this","maxValueInIndex","icon","Star","numberOfStars","updateNumberOfStars","value","ResultTemplatesHelpers","getResultProperty","result","field","computeNumberOfStars","error","Error","componentWillRender","render","host","remove","h","Rating","i18n","bindings","numberOfTotalIcons","numberOfActiveIcons","iconSize","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-rating/atomic-result-rating.pcss?tag=atomic-result-rating&encapsulation=shadow","src/components/search/result-template-components/atomic-result-rating/atomic-result-rating.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../common/atomic-rating/atomic-rating.pcss';\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h, State} from '@stencil/core';\nimport Star from '../../../../images/star.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n Rating,\n computeNumberOfStars,\n} from '../../../common/atomic-rating/stencil-rating';\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-result-rating` element renders a star rating.\n *\n * @part value-rating - The wrapper that contains the row of inactive stars and the row of active stars.\n * @part value-rating-icon - The individual star icons used in the rating display.\n */\n@Component({\n tag: 'atomic-result-rating',\n styleUrl: 'atomic-result-rating.pcss',\n shadow: true,\n})\nexport class AtomicResultRating implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n\n /**\n * The field whose values you want to display as a rating.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum value of the field. This value is also used as the number of icons to be displayed.\n */\n @Prop({reflect: true}) public maxValueInIndex = 5;\n\n /**\n * The SVG icon to use to display the rating.\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 * When using a custom icon, at least part of your icon should have the color set to `fill=\"currentColor\"`.\n * This part of the SVG will take on the colors set in the following [variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties):\n *\n * - `--atomic-rating-icon-active-color`\n * - `--atomic-rating-icon-inactive-color`\n */\n @Prop({reflect: true}) public icon = Star;\n\n @State() public error!: Error;\n\n @State() numberOfStars: number | null = null;\n\n private updateNumberOfStars() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n try {\n this.numberOfStars = computeNumberOfStars(value, this.field);\n } catch (error) {\n this.error = error instanceof Error ? error : new Error(`${error}`);\n this.numberOfStars = null;\n }\n }\n\n componentWillRender() {\n this.updateNumberOfStars();\n }\n\n render() {\n if (this.numberOfStars === null) {\n this.host.remove();\n return;\n }\n return (\n <Rating\n i18n={this.bindings.i18n}\n icon={this.icon}\n numberOfTotalIcons={this.maxValueInIndex}\n numberOfActiveIcons={this.numberOfStars}\n iconSize={0.875}\n ></Rating>\n );\n }\n}\n"],"mappings":"6VAAA,MAAMA,EAAwB,+ujEAC9B,MAAAC,EAAeD,E,iXCwBFE,EAAkB,M,yBAaCC,KAAAC,gBAAkB,EAelBD,KAAAE,KAAOC,EAI5BH,KAAAI,cAA+B,K,0CAnBQ,E,UAeXD,E,wCAIG,I,CAEhC,mBAAAE,GACN,MAAMC,EAAQC,EAAuBC,kBACnCR,KAAKS,OACLT,KAAKU,OAEP,IACEV,KAAKI,cAAgBO,EAAqBL,EAAON,KAAKU,M,CACtD,MAAOE,GACPZ,KAAKY,MAAQA,aAAiBC,MAAQD,EAAQ,IAAIC,MAAM,GAAGD,KAC3DZ,KAAKI,cAAgB,I,EAIzB,mBAAAU,GACEd,KAAKK,qB,CAGP,MAAAU,GACE,GAAIf,KAAKI,gBAAkB,KAAM,CAC/BJ,KAAKgB,KAAKC,SACV,M,CAEF,OACEC,EAACC,EAAM,CACLC,KAAMpB,KAAKqB,SAASD,KACpBlB,KAAMF,KAAKE,KACXoB,mBAAoBtB,KAAKC,gBACzBsB,oBAAqBvB,KAAKI,cAC1BoB,SAAU,M,6BA7DaC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["t","s","module","exports","this","n","i","e","r","o","u","d","a","h","years","months","days","hours","minutes","seconds","milliseconds","weeks","c","g","f","$l","m","p","l","$","Math","ceil","floor","y","abs","v","negative","format","$d","$ms","parseFromMilliseconds","Object","keys","forEach","calMilliseconds","match","slice","map","Number","prototype","reduce","toISOString","round","toJSON","Y","YY","YYYY","M","MM","D","DD","H","HH","mm","ss","SSS","replace","String","as","get","add","subtract","locale","clone","humanize","fromNow","valueOf","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","$utils","duration","isDuration","bind","dayjs","extend","AtomicResultTimespan","unit","initialize","Schema","field","StringValue","required","emptyAllowed","validate","value","error","Error","isNaN","render","bindings","i18n","count","ResultTemplatesHelpers","getResultProperty","result","__decorate","InitializeBindings","ResultContext"],"sources":["../../node_modules/dayjs/plugin/duration.js","src/components/search/result-template-components/atomic-result-timespan/atomic-result-timespan.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","import {Schema, StringValue} from '@coveo/bueno';\nimport {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, State} from '@stencil/core';\nimport dayjs from 'dayjs';\nimport {DurationUnitType} from 'dayjs/plugin/duration';\nimport duration from 'dayjs/plugin/duration';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\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\ndayjs.extend(duration);\n\n/**\n * The `atomic-result-timespan` component renders a target result number field value as a duration.\n */\n@Component({\n tag: 'atomic-result-timespan',\n})\nexport class AtomicResultTimespan {\n @InitializeBindings()\n public bindings!: Bindings;\n\n @ResultContext() private result!: Result;\n\n @State() public error!: Error;\n\n /**\n * The target result field.\n * The component first looks for the field in the Result object, and then in the Result.raw object.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n /**\n * The unit of measurement of the field value.\n * Available units: https://day.js.org/docs/en/durations/creating\n */\n @Prop({reflect: true}) unit = 'ms';\n /**\n * The format to apply to the result field value.\n *\n * By default, the format is HH:mm:ss when the duration is under a day, and it is an approximation when longer (days, months or years).\n *\n * The string displayed when there is an approximation can be modified with [localization](https://docs.coveo.com/en/atomic/latest/usage/atomic-localization/).\n *\n * Available formats: https://day.js.org/docs/en/durations/format\n */\n @Prop({reflect: true}) format?: string;\n\n public initialize() {\n new Schema({\n field: new StringValue({required: true, emptyAllowed: false}),\n }).validate({\n field: this.field,\n });\n if (!this.value) {\n this.error = new Error(`No value found for field ${this.field}`);\n return;\n }\n if (isNaN(this.value)) {\n this.error = new Error(\n `Value ${this.value} for field ${this.field} is not a number`\n );\n }\n }\n\n public render() {\n const duration = dayjs.duration(this.value, this.unit as DurationUnitType);\n if (this.format) {\n return duration.format(this.format);\n }\n\n if (duration.asYears() >= 1) {\n return this.bindings.i18n.t('approx_year', {\n count: Math.round(duration.asYears()),\n });\n }\n\n if (duration.asMonths() >= 1) {\n return this.bindings.i18n.t('approx_month', {\n count: Math.round(duration.asMonths()),\n });\n }\n\n if (duration.asDays() >= 1) {\n return this.bindings.i18n.t('approx_day', {\n count: Math.round(duration.asDays()),\n });\n }\n\n return duration.format('HH:mm:ss');\n }\n\n private get value() {\n return ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n ) as number;\n }\n}\n"],"mappings":"+bAAC,SAASA,EAAEC,GAAwDC,EAAAC,QAAeF,GAAmI,CAArN,CAAuNG,GAAI,WAA0B,IAAIJ,EAAEC,EAAEI,EAAE,IAAIC,EAAE,IAAIC,EAAE,KAAKC,EAAE,MAAMC,EAAE,sFAAsFC,EAAE,QAAQC,EAAE,OAAOC,EAAE,sKAAsKC,EAAE,CAACC,MAAMJ,EAAEK,OAAOJ,EAAEK,KAAKR,EAAES,MAAMV,EAAEW,QAAQZ,EAAEa,QAAQd,EAAEe,aAAa,EAAEC,MAAM,QAAQC,EAAE,SAAStB,GAAG,OAAOA,aAAauB,CAAC,EAAEC,EAAE,SAASxB,EAAEC,EAAEI,GAAG,OAAO,IAAIkB,EAAEvB,EAAEK,EAAEJ,EAAEwB,GAAG,EAAEC,EAAE,SAAS1B,GAAG,OAAOC,EAAE0B,EAAE3B,GAAG,GAAG,EAAE4B,EAAE,SAAS5B,GAAG,OAAOA,EAAE,CAAC,EAAE6B,EAAE,SAAS7B,GAAG,OAAO4B,EAAE5B,GAAG8B,KAAKC,KAAK/B,GAAG8B,KAAKE,MAAMhC,EAAE,EAAEiC,EAAE,SAASjC,GAAG,OAAO8B,KAAKI,IAAIlC,EAAE,EAAEmC,EAAE,SAASnC,EAAEC,GAAG,OAAOD,EAAE4B,EAAE5B,GAAG,CAACoC,UAAU,EAAEC,OAAO,GAAGJ,EAAEjC,GAAGC,GAAG,CAACmC,UAAU,EAAEC,OAAO,GAAGrC,EAAEC,GAAG,CAACmC,UAAU,EAAEC,OAAO,GAAG,EAAEd,EAAE,WAAW,SAASK,EAAE5B,EAAEC,EAAEI,GAAG,IAAIC,EAAEF,KA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|
-
{"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}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"stencil-result-template-decorators-f989bc6b.js","mappings":";;AASA;;;;;;;;;;;SAWgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAO,WAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;;;SAYgB,aAAa,CAC3B,OAAgB;IAEhB,OAAO,WAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;","names":[],"sources":["src/components/search/result-template-component-utils/context/stencil-result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '@/src/components/common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n * \n * @deprecated should only be used for Stencil components. For Lit components, use `createResultContextController` from \\@/src/components/search/result-template-component-utils/context/result-context-controller.ts\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element The element that the event is dispatched to, which must be the child of a rendered \"atomic-result\" element.\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n * \n * @deprecated should only be used for Stencil components. For Lit components, use `fetchResultContext` from \\@/src/components/search/result-template-component-utils/context/fetch-result-context.ts\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"version":3}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { Product } from '@coveo/headless/commerce';
|
2
|
-
/**
|
3
|
-
* Retrieves `Product` on a rendered `atomic-product`.
|
4
|
-
*
|
5
|
-
* This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.
|
6
|
-
*
|
7
|
-
* You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
|
8
|
-
*
|
9
|
-
* @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.
|
10
|
-
* @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.
|
11
|
-
*/
|
12
|
-
export declare function fetchProductContext<T extends Product>(element: Element): Promise<T>;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import type { InteractiveProduct } from '@coveo/headless/commerce';
|
2
|
-
import type { LitElement } from 'lit';
|
3
|
-
import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
-
/**
|
5
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
|
6
|
-
*
|
7
|
-
* @param host - The Lit component instance
|
8
|
-
* @returns InteractiveItemContextController instance
|
9
|
-
*
|
10
|
-
* @example
|
11
|
-
* ```typescript
|
12
|
-
* @customElement('my-interactive-product-component')
|
13
|
-
* export class MyInteractiveProductComponent extends LitElement {
|
14
|
-
* private interactiveProductController = createInteractiveProductContextController(this);
|
15
|
-
*
|
16
|
-
* @state() product!: Product;
|
17
|
-
*
|
18
|
-
* render() {
|
19
|
-
* this.product = this.interactiveProductController.interactiveItem;
|
20
|
-
* return html`<div>${this.product?.ec_name}</div>`;
|
21
|
-
* }
|
22
|
-
* }
|
23
|
-
* ```
|
24
|
-
*/
|
25
|
-
export declare function createInteractiveProductContextController(host: LitElement & {
|
26
|
-
error: Error;
|
27
|
-
}): InteractiveItemContextController<InteractiveProduct>;
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import type { InteractiveProduct, Product } from '@coveo/headless/commerce';
|
2
|
-
import type { LitElement } from 'lit';
|
3
|
-
import type { InteractiveItemContextEvent } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
-
import { ItemContextController, type ItemContextEvent } from "../../../common/item-list/context/item-context-controller";
|
5
|
-
/**
|
6
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
|
7
|
-
*
|
8
|
-
* @param host - The Lit component instance
|
9
|
-
* @param options - Configuration options
|
10
|
-
* @returns ItemContextController instance configured for atomic-product
|
11
|
-
*
|
12
|
-
* @example
|
13
|
-
* ```typescript
|
14
|
-
* @customElement('my-product-component')
|
15
|
-
* export class MyProductComponent extends LitElement {
|
16
|
-
* private productController = createProductContextController(this);
|
17
|
-
*
|
18
|
-
* @state() product!: Product;
|
19
|
-
*
|
20
|
-
* render() {
|
21
|
-
* this.product = this.productController.item;
|
22
|
-
* return html`<div>${this.product?.ec_name}</div>`;
|
23
|
-
* }
|
24
|
-
* }
|
25
|
-
* ```
|
26
|
-
*/
|
27
|
-
export declare function createProductContextController(host: LitElement & {
|
28
|
-
error: Error | null;
|
29
|
-
}, options?: {
|
30
|
-
folded?: boolean;
|
31
|
-
}): ItemContextController<Product>;
|
32
|
-
export type ProductContextEvent<T = Product> = ItemContextEvent<T>;
|
33
|
-
export type InteractiveProductContextEvent<T extends InteractiveProduct = InteractiveProduct> = InteractiveItemContextEvent<T>;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { FoldedResult, Result } from '@coveo/headless';
|
2
|
-
/**
|
3
|
-
* Retrieves `Result` on a rendered `atomic-result`.
|
4
|
-
*
|
5
|
-
* @param element - The element that the event is dispatched to
|
6
|
-
* @returns A promise that resolves on initialization of the parent `atomic-result` element, or rejects if missing
|
7
|
-
*/
|
8
|
-
export declare function fetchResultContext<T extends Result | FoldedResult = Result>(element: Element): Promise<T>;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { InteractiveResult } from '@coveo/headless';
|
2
|
-
import type { LitElement } from 'lit';
|
3
|
-
import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
-
/**
|
5
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive result context in result template components.
|
6
|
-
*
|
7
|
-
* @param host - The Lit component instance
|
8
|
-
* @returns InteractiveItemContextController instance
|
9
|
-
*/
|
10
|
-
export declare function createInteractiveResultContextController(host: LitElement & {
|
11
|
-
error: Error;
|
12
|
-
}): InteractiveItemContextController<InteractiveResult>;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import type { FoldedResult, InteractiveResult, Result } from '@coveo/headless';
|
2
|
-
import type { LitElement } from 'lit';
|
3
|
-
import type { InteractiveItemContextEvent } from "../../../common/item-list/context/interactive-item-context-controller";
|
4
|
-
import { ItemContextController, type ItemContextEvent } from "../../../common/item-list/context/item-context-controller";
|
5
|
-
/**
|
6
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing result context in result template components.
|
7
|
-
*
|
8
|
-
* @param host - The Lit component instance
|
9
|
-
* @param options - Configuration options
|
10
|
-
* @returns ItemContextController instance configured for atomic-result
|
11
|
-
*/
|
12
|
-
export declare function createResultContextController(host: LitElement & {
|
13
|
-
error: Error | null;
|
14
|
-
}, options?: {
|
15
|
-
folded?: boolean;
|
16
|
-
}): ItemContextController<Result | FoldedResult>;
|
17
|
-
export type ResultContextEvent<T = Result | FoldedResult> = ItemContextEvent<T>;
|
18
|
-
export type InteractiveResultContextEvent<T extends InteractiveResult = InteractiveResult> = InteractiveItemContextEvent<T>;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|