@coveo/atomic 3.35.0-pre.25e9237b66 → 3.35.0-pre.2a8da8ee82
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/atomic.esm.js.map +1 -1
- package/dist/atomic/components/_index.d.ts +0 -2
- package/dist/atomic/components/_index.js +20 -22
- 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-insight-search-box.js +29 -2
- package/dist/atomic/components/atomic-insight-search-box.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-search-box-instant-results.js +37 -2
- package/dist/atomic/components/atomic-search-box-instant-results.js.map +1 -1
- package/dist/atomic/components/atomic-search-box.js +4 -14
- package/dist/atomic/components/atomic-search-box.js.map +1 -1
- package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
- 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/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +1 -3
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +0 -5
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +0 -3
- package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
- package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
- package/dist/atomic/components/components/common/breadbox/breadcrumb-button.js +1 -6
- package/dist/atomic/components/components/common/search-box/text-area-clear-button.js +1 -1
- package/dist/atomic/components/components/common/suggestions/query-suggestions.js +11 -16
- package/dist/atomic/components/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js +105 -0
- package/dist/atomic/components/components/search/index.js +1 -0
- package/dist/atomic/components/components/search/lazy-index.js +1 -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/components/stencil-suggestion-manager.js +1 -1
- package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
- package/dist/atomic/index.esm.js +1 -1
- package/dist/atomic/index.esm.js.map +1 -1
- package/dist/atomic/lang/cs.json +1 -1
- package/dist/atomic/lang/da.json +1 -1
- package/dist/atomic/lang/de.json +1 -1
- package/dist/atomic/lang/dev.json +1 -1
- package/dist/atomic/lang/el.json +1 -1
- package/dist/atomic/lang/en.json +1 -1
- package/dist/atomic/lang/es.json +1 -1
- package/dist/atomic/lang/fi.json +1 -1
- package/dist/atomic/lang/fr.json +1 -1
- package/dist/atomic/lang/hu.json +1 -1
- package/dist/atomic/lang/id.json +1 -1
- package/dist/atomic/lang/it.json +1 -1
- package/dist/atomic/lang/ja.json +1 -1
- package/dist/atomic/lang/ko.json +1 -1
- package/dist/atomic/lang/nl.json +1 -1
- package/dist/atomic/lang/no.json +1 -1
- package/dist/atomic/lang/pl.json +1 -1
- package/dist/atomic/lang/pt-BR.json +1 -1
- package/dist/atomic/lang/pt.json +1 -1
- package/dist/atomic/lang/ru.json +1 -1
- package/dist/atomic/lang/sv.json +1 -1
- package/dist/atomic/lang/th.json +1 -1
- package/dist/atomic/lang/tr.json +1 -1
- package/dist/atomic/lang/zh-CN.json +1 -1
- package/dist/atomic/lang/zh-TW.json +1 -1
- package/dist/atomic/lang/zh.json +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-874f0a4c.entry.js → p-060b94d2.entry.js} +2 -2
- 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-16f4ce98.js +2 -0
- package/dist/atomic/p-16f4ce98.js.map +1 -0
- 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-9e6462cf.entry.js → p-36ff2bc3.entry.js} +2 -2
- package/dist/atomic/p-36ff2bc3.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-ed413091.entry.js → p-8a30d1e9.entry.js} +2 -2
- 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-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-df592625.entry.js → p-ce6e5989.entry.js} +2 -2
- 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-d55668a3.entry.js +2 -0
- package/dist/atomic/p-d55668a3.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/_loader.cjs.js +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-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-insight-search-box.cjs.entry.js +31 -5
- package/dist/cjs/atomic-insight-search-box.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-search-box.cjs.entry.js +4 -8
- package/dist/cjs/atomic-search-box.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/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/index-757bc886.js +0 -4
- 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/{stencil-suggestion-manager-88cb88f2.js → stencil-suggestion-manager-2cba6d69.js} +2 -2
- package/dist/cjs/stencil-suggestion-manager-2cba6d69.js.map +1 -0
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_index.js +19 -19
- package/dist/esm/_loader.js +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-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-insight-search-box.entry.js +30 -4
- package/dist/esm/atomic-insight-search-box.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-search-box.entry.js +4 -8
- package/dist/esm/atomic-search-box.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/atomic-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-tab-manager.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/index-3f35faca.js +0 -4
- 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/{stencil-suggestion-manager-1f4ed8d0.js → stencil-suggestion-manager-376f83e8.js} +2 -2
- package/dist/esm/stencil-suggestion-manager-376f83e8.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +0 -2
- package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +0 -1
- package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +0 -2
- 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/breadbox/breadcrumb-button.d.ts +0 -2
- 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/atomic-search-box/atomic-search-box.d.ts +0 -1
- package/dist/types/components/search/{search-box-suggestions/atomic-search-box-query-suggestions → atomic-search-box-query-suggestions}/atomic-search-box-query-suggestions.d.ts +16 -7
- package/dist/types/components/search/index.d.ts +1 -0
- 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/components.d.ts +0 -49
- package/dist/types/directives/hierarchical-path.d.ts +1 -1
- package/dist/types/index.d.ts +3 -3
- package/docs/atomic-docs.json +3 -102
- package/package.json +1 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions.d.ts +0 -11
- package/dist/atomic/components/atomic-search-box-query-suggestions.js +0 -8
- package/dist/atomic/components/atomic-search-box-query-suggestions.js.map +0 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +0 -89
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +0 -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/components/stencil-query-suggestions.js +0 -33
- package/dist/atomic/components/stencil-query-suggestions.js.map +0 -1
- package/dist/atomic/components/suggestions-events.js +0 -40
- package/dist/atomic/components/suggestions-events.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-2559747d.js +0 -2
- package/dist/atomic/p-2559747d.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-567b2841.entry.js +0 -2
- package/dist/atomic/p-567b2841.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-9e6462cf.entry.js.map +0 -1
- package/dist/atomic/p-a1798150.entry.js.map +0 -1
- package/dist/atomic/p-af93b44c.js +0 -2
- package/dist/atomic/p-af93b44c.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-e8176ac8.entry.js +0 -2
- package/dist/atomic/p-e8176ac8.entry.js.map +0 -1
- package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
- package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js +0 -76
- package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js.map +0 -1
- package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
- package/dist/cjs/stencil-query-suggestions-03268ecc.js +0 -38
- package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +0 -1
- package/dist/cjs/stencil-suggestion-manager-88cb88f2.js.map +0 -1
- package/dist/esm/atomic-search-box-query-suggestions.entry.js +0 -72
- package/dist/esm/atomic-search-box-query-suggestions.entry.js.map +0 -1
- package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js +0 -33
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +0 -1
- package/dist/esm/stencil-suggestion-manager-1f4ed8d0.js.map +0 -1
- package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
- /package/dist/atomic/{p-874f0a4c.entry.js.map → p-060b94d2.entry.js.map} +0 -0
- /package/dist/atomic/{p-ed413091.entry.js.map → p-8a30d1e9.entry.js.map} +0 -0
- /package/dist/atomic/{p-df592625.entry.js.map → p-ce6e5989.entry.js.map} +0 -0
- /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
package/dist/types/index.d.ts
CHANGED
@@ -2,7 +2,8 @@ export type { i18n } from 'i18next';
|
|
2
2
|
export { Components, JSX } from './components';
|
3
3
|
export { CommerceBindings } from './components/commerce/atomic-commerce-interface/atomic-commerce-interface';
|
4
4
|
export { SelectChildProductEventArgs } from './components/commerce/atomic-product-children/select-child-product-event';
|
5
|
-
export {
|
5
|
+
export { fetchProductContext } from './components/commerce/product-template-component-utils/context/fetch-product-context';
|
6
|
+
export { productContext } from './components/commerce/product-template-component-utils/context/stencil-product-template-decorators';
|
6
7
|
export { PopoverChildFacet } from './components/common/facets/popover/popover-type';
|
7
8
|
export { RedirectionPayload } from './components/common/search-box/redirection-payload';
|
8
9
|
export { dispatchSearchBoxSuggestionsEvent } from './components/common/suggestions/suggestions-events';
|
@@ -10,7 +11,6 @@ export type { SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggest
|
|
10
11
|
export { elementHasNoQuery, elementHasQuery, } from './components/common/suggestions/suggestions-utils';
|
11
12
|
export { RecsBindings } from './components/recommendations/atomic-recs-interface/atomic-recs-interface';
|
12
13
|
export { Bindings } from './components/search/atomic-search-interface/atomic-search-interface';
|
13
|
-
export { resultContext } from './components/search/result-template-
|
14
|
-
export { fetchProductContext } from './decorators/commerce/product-template-decorators';
|
14
|
+
export { resultContext } from './components/search/result-template-component-utils/context/stencil-result-template-decorators';
|
15
15
|
export { initializeBindings, MissingInterfaceParentError, } from './utils/initialization-utils';
|
16
16
|
export { bindLogDocumentOpenOnResult } from './utils/result-utils';
|
package/docs/atomic-docs.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"timestamp": "2025-10-
|
2
|
+
"timestamp": "2025-10-08T17:05:41",
|
3
3
|
"compiler": {
|
4
4
|
"name": "@stencil/core",
|
5
5
|
"version": "4.20.0",
|
@@ -11825,13 +11825,11 @@
|
|
11825
11825
|
],
|
11826
11826
|
"dependents": [],
|
11827
11827
|
"dependencies": [
|
11828
|
-
"atomic-suggestion-renderer"
|
11829
|
-
"atomic-search-box-query-suggestions"
|
11828
|
+
"atomic-suggestion-renderer"
|
11830
11829
|
],
|
11831
11830
|
"dependencyGraph": {
|
11832
11831
|
"atomic-search-box": [
|
11833
|
-
"atomic-suggestion-renderer"
|
11834
|
-
"atomic-search-box-query-suggestions"
|
11832
|
+
"atomic-suggestion-renderer"
|
11835
11833
|
]
|
11836
11834
|
}
|
11837
11835
|
},
|
@@ -12052,103 +12050,6 @@
|
|
12052
12050
|
]
|
12053
12051
|
}
|
12054
12052
|
},
|
12055
|
-
{
|
12056
|
-
"filePath": "src/components/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.tsx",
|
12057
|
-
"encapsulation": "shadow",
|
12058
|
-
"tag": "atomic-search-box-query-suggestions",
|
12059
|
-
"docs": "The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.",
|
12060
|
-
"docsTags": [],
|
12061
|
-
"usage": {},
|
12062
|
-
"props": [
|
12063
|
-
{
|
12064
|
-
"name": "icon",
|
12065
|
-
"type": "string | undefined",
|
12066
|
-
"complexType": {
|
12067
|
-
"original": "string",
|
12068
|
-
"resolved": "string | undefined",
|
12069
|
-
"references": {}
|
12070
|
-
},
|
12071
|
-
"mutable": false,
|
12072
|
-
"attr": "icon",
|
12073
|
-
"reflectToAttr": false,
|
12074
|
-
"docs": "The SVG icon to display.\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.",
|
12075
|
-
"docsTags": [],
|
12076
|
-
"values": [
|
12077
|
-
{
|
12078
|
-
"type": "string"
|
12079
|
-
},
|
12080
|
-
{
|
12081
|
-
"type": "undefined"
|
12082
|
-
}
|
12083
|
-
],
|
12084
|
-
"optional": true,
|
12085
|
-
"required": false
|
12086
|
-
},
|
12087
|
-
{
|
12088
|
-
"name": "maxWithQuery",
|
12089
|
-
"type": "number | undefined",
|
12090
|
-
"complexType": {
|
12091
|
-
"original": "number",
|
12092
|
-
"resolved": "number | undefined",
|
12093
|
-
"references": {}
|
12094
|
-
},
|
12095
|
-
"mutable": false,
|
12096
|
-
"attr": "max-with-query",
|
12097
|
-
"reflectToAttr": true,
|
12098
|
-
"docs": "The maximum number of suggestions that will be displayed if the user has typed something into the input field.",
|
12099
|
-
"docsTags": [],
|
12100
|
-
"values": [
|
12101
|
-
{
|
12102
|
-
"type": "number"
|
12103
|
-
},
|
12104
|
-
{
|
12105
|
-
"type": "undefined"
|
12106
|
-
}
|
12107
|
-
],
|
12108
|
-
"optional": true,
|
12109
|
-
"required": false
|
12110
|
-
},
|
12111
|
-
{
|
12112
|
-
"name": "maxWithoutQuery",
|
12113
|
-
"type": "number | undefined",
|
12114
|
-
"complexType": {
|
12115
|
-
"original": "number",
|
12116
|
-
"resolved": "number | undefined",
|
12117
|
-
"references": {}
|
12118
|
-
},
|
12119
|
-
"mutable": false,
|
12120
|
-
"attr": "max-without-query",
|
12121
|
-
"reflectToAttr": true,
|
12122
|
-
"docs": "The maximum number of suggestions that will be displayed initially when the input field is empty.",
|
12123
|
-
"docsTags": [],
|
12124
|
-
"values": [
|
12125
|
-
{
|
12126
|
-
"type": "number"
|
12127
|
-
},
|
12128
|
-
{
|
12129
|
-
"type": "undefined"
|
12130
|
-
}
|
12131
|
-
],
|
12132
|
-
"optional": true,
|
12133
|
-
"required": false
|
12134
|
-
}
|
12135
|
-
],
|
12136
|
-
"methods": [],
|
12137
|
-
"events": [],
|
12138
|
-
"listeners": [],
|
12139
|
-
"styles": [],
|
12140
|
-
"slots": [],
|
12141
|
-
"parts": [],
|
12142
|
-
"dependents": [
|
12143
|
-
"atomic-search-box"
|
12144
|
-
],
|
12145
|
-
"dependencies": [],
|
12146
|
-
"dependencyGraph": {
|
12147
|
-
"atomic-search-box": [
|
12148
|
-
"atomic-search-box-query-suggestions"
|
12149
|
-
]
|
12150
|
-
}
|
12151
|
-
},
|
12152
12053
|
{
|
12153
12054
|
"filePath": "src/components/search/facets/atomic-segmented-facet/atomic-segmented-facet.tsx",
|
12154
12055
|
"encapsulation": "shadow",
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@coveo/atomic",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.35.0-pre.
|
4
|
+
"version": "3.35.0-pre.2a8da8ee82",
|
5
5
|
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
|
6
6
|
"homepage": "https://docs.coveo.com/en/atomic/latest/",
|
7
7
|
"repository": {
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { Components, JSX } from "../../types/components";
|
2
|
-
|
3
|
-
interface AtomicSearchBoxQuerySuggestions extends Components.AtomicSearchBoxQuerySuggestions, HTMLElement {}
|
4
|
-
export const AtomicSearchBoxQuerySuggestions: {
|
5
|
-
prototype: AtomicSearchBoxQuerySuggestions;
|
6
|
-
new (): AtomicSearchBoxQuerySuggestions;
|
7
|
-
};
|
8
|
-
/**
|
9
|
-
* Used to define this component and all nested components recursively.
|
10
|
-
*/
|
11
|
-
export const defineCustomElement: () => void;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { A as AtomicSearchBoxQuerySuggestions$1, d as defineCustomElement$1 } from './atomic-search-box-query-suggestions2.js';
|
2
|
-
|
3
|
-
const AtomicSearchBoxQuerySuggestions = AtomicSearchBoxQuerySuggestions$1;
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
5
|
-
|
6
|
-
export { AtomicSearchBoxQuerySuggestions, defineCustomElement };
|
7
|
-
|
8
|
-
//# sourceMappingURL=atomic-search-box-query-suggestions.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"atomic-search-box-query-suggestions.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1,89 +0,0 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
2
|
-
import { loadQuerySuggestActions } from '@coveo/headless';
|
3
|
-
import { S as SearchIcon } from './search.js';
|
4
|
-
import { g as getPartialSearchBoxSuggestionElement, Q as QuerySuggestionContainer, a as QuerySuggestionIcon, b as QuerySuggestionText } from './stencil-query-suggestions.js';
|
5
|
-
import { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events.js';
|
6
|
-
|
7
|
-
const AtomicSearchBoxQuerySuggestions = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBoxQuerySuggestions extends HTMLElement {
|
8
|
-
constructor() {
|
9
|
-
super();
|
10
|
-
this.__registerHost();
|
11
|
-
this.__attachShadow();
|
12
|
-
this.error = undefined;
|
13
|
-
this.icon = undefined;
|
14
|
-
this.maxWithQuery = undefined;
|
15
|
-
this.maxWithoutQuery = undefined;
|
16
|
-
}
|
17
|
-
componentWillLoad() {
|
18
|
-
try {
|
19
|
-
dispatchSearchBoxSuggestionsEvent((bindings) => {
|
20
|
-
this.bindings = bindings;
|
21
|
-
return this.initialize();
|
22
|
-
}, this.host, ['atomic-search-box']);
|
23
|
-
}
|
24
|
-
catch (error) {
|
25
|
-
this.error = error;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
initialize() {
|
29
|
-
const engine = this.bindings.engine;
|
30
|
-
const { registerQuerySuggest, fetchQuerySuggestions } = loadQuerySuggestActions(engine);
|
31
|
-
engine.dispatch(registerQuerySuggest({
|
32
|
-
id: this.bindings.id,
|
33
|
-
count: this.bindings.numberOfQueries,
|
34
|
-
}));
|
35
|
-
return {
|
36
|
-
position: Array.from(this.host.parentNode.children).indexOf(this.host),
|
37
|
-
onInput: () => engine.dispatch(fetchQuerySuggestions({
|
38
|
-
id: this.bindings.id,
|
39
|
-
})),
|
40
|
-
renderItems: () => this.renderItems(),
|
41
|
-
};
|
42
|
-
}
|
43
|
-
renderItems() {
|
44
|
-
const hasQuery = this.bindings.searchBoxController.state.value !== '';
|
45
|
-
const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;
|
46
|
-
return this.bindings.searchBoxController.state.suggestions
|
47
|
-
.slice(0, max)
|
48
|
-
.map((suggestion) => this.renderItem(suggestion));
|
49
|
-
}
|
50
|
-
renderItem(suggestion) {
|
51
|
-
const hasQuery = this.bindings.searchBoxController.state.value !== '';
|
52
|
-
const partialItem = getPartialSearchBoxSuggestionElement(suggestion, this.bindings.i18n);
|
53
|
-
return {
|
54
|
-
...partialItem,
|
55
|
-
content: (h(QuerySuggestionContainer, null, h(QuerySuggestionIcon, { icon: this.icon || SearchIcon, hasSuggestion: this.bindings.getSuggestions().length > 1 }), h(QuerySuggestionText, { suggestion: suggestion, hasQuery: hasQuery }))),
|
56
|
-
onSelect: () => {
|
57
|
-
this.bindings.searchBoxController.selectSuggestion(suggestion.rawValue);
|
58
|
-
},
|
59
|
-
};
|
60
|
-
}
|
61
|
-
render() {
|
62
|
-
if (this.error) {
|
63
|
-
return (h("atomic-component-error", { key: '7fdb4afa7291ad70c37a9709fd7108f4fe0fb94d', element: this.host, error: this.error }));
|
64
|
-
}
|
65
|
-
}
|
66
|
-
get host() { return this; }
|
67
|
-
}, [1, "atomic-search-box-query-suggestions", {
|
68
|
-
"icon": [1],
|
69
|
-
"maxWithQuery": [514, "max-with-query"],
|
70
|
-
"maxWithoutQuery": [514, "max-without-query"],
|
71
|
-
"error": [32]
|
72
|
-
}]);
|
73
|
-
function defineCustomElement() {
|
74
|
-
if (typeof customElements === "undefined") {
|
75
|
-
return;
|
76
|
-
}
|
77
|
-
const components = ["atomic-search-box-query-suggestions"];
|
78
|
-
components.forEach(tagName => { switch (tagName) {
|
79
|
-
case "atomic-search-box-query-suggestions":
|
80
|
-
if (!customElements.get(tagName)) {
|
81
|
-
customElements.define(tagName, AtomicSearchBoxQuerySuggestions);
|
82
|
-
}
|
83
|
-
break;
|
84
|
-
} });
|
85
|
-
}
|
86
|
-
|
87
|
-
export { AtomicSearchBoxQuerySuggestions as A, defineCustomElement as d };
|
88
|
-
|
89
|
-
//# sourceMappingURL=atomic-search-box-query-suggestions2.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"atomic-search-box-query-suggestions2.js","mappings":";;;;;;MA8Ba,+BAA+B;;;;;;;;;;IAwB1C,iBAAiB;QACf,IAAI;YACF,iCAAiC,CAC/B,CAAC,QAAQ;gBACP,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACzB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;aAC1B,EACD,IAAI,CAAC,IAAI,EACT,CAAC,mBAAmB,CAAC,CACtB,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;SAC7B;KACF;IAEO,UAAU;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAG3B,CAAC;QACH,MAAM,EAAC,oBAAoB,EAAE,qBAAqB,EAAC,GACjD,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAElC,MAAM,CAAC,QAAQ,CACb,oBAAoB,CAAC;YACnB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;YACpB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe;SACrC,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAW,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACvE,OAAO,EAAE,MACP,MAAM,CAAC,QAAQ,CACb,qBAAqB,CAAC;gBACpB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;aACrB,CAAC,CACH;YACH,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE;SACtC,CAAC;KACH;IAEO,WAAW;QACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QACtE,MAAM,GAAG,GAAG,QAAQ,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC;QAChE,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,WAAW;aACvD,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;aACb,GAAG,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;KACrD;IAEO,UAAU,CAAC,UAAsB;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QACtE,MAAM,WAAW,GAAG,oCAAoC,CACtD,UAAU,EACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CACnB,CAAC;QAEF,OAAO;YACL,GAAG,WAAW;YACd,OAAO,GACL,EAAC,wBAAwB,QACvB,EAAC,mBAAmB,IAClB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,UAAU,EAC7B,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC,GACxD,EAEF,EAAC,mBAAmB,IAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC1C,CAC5B;YACD,QAAQ,EAAE;gBACR,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACzE;SACF,CAAC;KACH;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,QACE,+EACE,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACO,EAC1B;SACH;KACF;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.tsx"],"sourcesContent":["import {\n loadQuerySuggestActions,\n SearchBox,\n SearchEngine,\n Suggestion,\n} from '@coveo/headless';\nimport {Component, Element, Prop, State, h} from '@stencil/core';\nimport SearchIcon from '../../../../images/search.svg';\nimport {\n getPartialSearchBoxSuggestionElement,\n QuerySuggestionContainer,\n QuerySuggestionIcon,\n QuerySuggestionText,\n} from '../../../common/suggestions/stencil-query-suggestions';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\n\n/**\n * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.\n */\n@Component({\n tag: 'atomic-search-box-query-suggestions',\n shadow: true,\n})\nexport class AtomicSearchBoxQuerySuggestions {\n private bindings!: SearchBoxSuggestionsBindings<SearchBox>;\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The SVG icon to display.\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() public icon?: string;\n\n /**\n * The maximum number of suggestions that will be displayed if the user has typed something into the input field.\n */\n @Prop({reflect: true}) public maxWithQuery?: number;\n /**\n * The maximum number of suggestions that will be displayed initially when the input field is empty.\n */\n @Prop({reflect: true}) public maxWithoutQuery?: number;\n\n componentWillLoad() {\n try {\n dispatchSearchBoxSuggestionsEvent<SearchBox>(\n (bindings) => {\n this.bindings = bindings;\n return this.initialize();\n },\n this.host,\n ['atomic-search-box']\n );\n } catch (error) {\n this.error = error as Error;\n }\n }\n\n private initialize(): SearchBoxSuggestions {\n const engine = this.bindings.engine as SearchEngine<{\n querySet: string;\n querySuggest: string;\n }>;\n const {registerQuerySuggest, fetchQuerySuggestions} =\n loadQuerySuggestActions(engine);\n\n engine.dispatch(\n registerQuerySuggest({\n id: this.bindings.id,\n count: this.bindings.numberOfQueries,\n })\n );\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n onInput: () =>\n engine.dispatch(\n fetchQuerySuggestions({\n id: this.bindings.id,\n })\n ),\n renderItems: () => this.renderItems(),\n };\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n const hasQuery = this.bindings.searchBoxController.state.value !== '';\n const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;\n return this.bindings.searchBoxController.state.suggestions\n .slice(0, max)\n .map((suggestion) => this.renderItem(suggestion));\n }\n\n private renderItem(suggestion: Suggestion) {\n const hasQuery = this.bindings.searchBoxController.state.value !== '';\n const partialItem = getPartialSearchBoxSuggestionElement(\n suggestion,\n this.bindings.i18n\n );\n\n return {\n ...partialItem,\n content: (\n <QuerySuggestionContainer>\n <QuerySuggestionIcon\n icon={this.icon || SearchIcon}\n hasSuggestion={this.bindings.getSuggestions().length > 1}\n />\n\n <QuerySuggestionText suggestion={suggestion} hasQuery={hasQuery} />\n </QuerySuggestionContainer>\n ),\n onSelect: () => {\n this.bindings.searchBoxController.selectSuggestion(suggestion.rawValue);\n },\n };\n }\n\n public render() {\n if (this.error) {\n return (\n <atomic-component-error\n element={this.host}\n error={this.error}\n ></atomic-component-error>\n );\n }\n }\n}\n"],"version":3}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { closest } from '../../../utils/dom-utils.js';
|
2
|
-
import { buildCustomEvent } from '../../../utils/event-utils.js';
|
3
|
-
import { MissingParentError } from './context/item-context-controller.js';
|
4
|
-
const itemContextEventName = 'atomic/resolveResult';
|
5
|
-
export function fetchItemContext(element, parentName) {
|
6
|
-
return new Promise((resolve, reject) => {
|
7
|
-
const event = buildCustomEvent(itemContextEventName, (item) => {
|
8
|
-
return resolve(item);
|
9
|
-
});
|
10
|
-
element.dispatchEvent(event);
|
11
|
-
if (!closest(element, parentName)) {
|
12
|
-
reject(new MissingParentError(element.nodeName.toLowerCase(), parentName));
|
13
|
-
}
|
14
|
-
});
|
15
|
-
}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { InteractiveItemContextController, } from "../../components/common/item-list/context/interactive-item-context-controller";
|
2
|
-
import { ItemContextController, } from "../../components/common/item-list/context/item-context-controller";
|
3
|
-
import { fetchItemContext } from "../../components/common/item-list/fetch-item-context";
|
4
|
-
/**
|
5
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
|
6
|
-
*
|
7
|
-
* @param host - The Lit component instance
|
8
|
-
* @param options - Configuration options
|
9
|
-
* @returns ItemContextController instance configured for atomic-product
|
10
|
-
*
|
11
|
-
* @example
|
12
|
-
* ```typescript
|
13
|
-
* @customElement('my-product-component')
|
14
|
-
* export class MyProductComponent extends LitElement {
|
15
|
-
* private productController = createProductContextController(this);
|
16
|
-
*
|
17
|
-
* @state() product!: Product;
|
18
|
-
*
|
19
|
-
* render() {
|
20
|
-
* this.product = this.productController.item;
|
21
|
-
* return html`<div>${this.product?.ec_name}</div>`;
|
22
|
-
* }
|
23
|
-
* }
|
24
|
-
* ```
|
25
|
-
*/
|
26
|
-
export function createProductContextController(host, options = {}) {
|
27
|
-
return new ItemContextController(host, {
|
28
|
-
parentName: 'atomic-product',
|
29
|
-
folded: options.folded ?? false,
|
30
|
-
});
|
31
|
-
}
|
32
|
-
/**
|
33
|
-
* Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
|
34
|
-
*
|
35
|
-
* @param host - The Lit component instance
|
36
|
-
* @returns InteractiveItemContextController instance
|
37
|
-
*
|
38
|
-
* @example
|
39
|
-
* ```typescript
|
40
|
-
* @customElement('my-interactive-product-component')
|
41
|
-
* export class MyInteractiveProductComponent extends LitElement {
|
42
|
-
* private interactiveProductController = createInteractiveProductContextController(this);
|
43
|
-
*
|
44
|
-
* @state() product!: Product;
|
45
|
-
*
|
46
|
-
* render() {
|
47
|
-
* this.product = this.interactiveProductController.interactiveItem;
|
48
|
-
* return html`<div>${this.product?.ec_name}</div>`;
|
49
|
-
* }
|
50
|
-
* }
|
51
|
-
* ```
|
52
|
-
*/
|
53
|
-
export function createInteractiveProductContextController(host) {
|
54
|
-
return new InteractiveItemContextController(host);
|
55
|
-
}
|
56
|
-
/**
|
57
|
-
* Retrieves `Product` on a rendered `atomic-product`.
|
58
|
-
*
|
59
|
-
* This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.
|
60
|
-
*
|
61
|
-
* You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
|
62
|
-
*
|
63
|
-
* @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.
|
64
|
-
* @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.
|
65
|
-
*/
|
66
|
-
export function fetchProductContext(element) {
|
67
|
-
return fetchItemContext(element, 'atomic-product');
|
68
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"result-template-decorators.js","mappings":";;AASA;;;;;;;;;SASgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAO,WAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;SAUgB,aAAa,CAC3B,OAAgB;IAEhB,OAAO,WAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;","names":[],"sources":["src/components/search/result-template-components/result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element The element that the event is dispatched to, which must be the child of a rendered \"atomic-result\".\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"version":3}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { h } from '@stencil/core/internal/client';
|
2
|
-
import { e as encodeForDomAttribute } from './string-utils.js';
|
3
|
-
|
4
|
-
const getPartialSearchBoxSuggestionElement = (suggestion, i18n) => {
|
5
|
-
return {
|
6
|
-
part: 'query-suggestion-item',
|
7
|
-
key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,
|
8
|
-
query: suggestion.rawValue,
|
9
|
-
ariaLabel: i18n.t('query-suggestion-label', {
|
10
|
-
query: suggestion.rawValue,
|
11
|
-
interpolation: { escapeValue: false },
|
12
|
-
}),
|
13
|
-
};
|
14
|
-
};
|
15
|
-
const QuerySuggestionContainer = (_, children) => {
|
16
|
-
return (h("div", { part: "query-suggestion-content", class: "flex items-center" }, children));
|
17
|
-
};
|
18
|
-
const QuerySuggestionIcon = ({ icon, hasSuggestion }) => {
|
19
|
-
if (!hasSuggestion) {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
return (h("atomic-icon", { part: "query-suggestion-icon", icon: icon, class: "mr-2 h-4 w-4 shrink-0" }));
|
23
|
-
};
|
24
|
-
const QuerySuggestionText = ({ suggestion, hasQuery }) => {
|
25
|
-
if (hasQuery) {
|
26
|
-
return (h("span", { part: "query-suggestion-text", class: "line-clamp-2 break-all", innerHTML: suggestion.highlightedValue }));
|
27
|
-
}
|
28
|
-
return (h("span", { part: "query-suggestion-text", class: "line-clamp-2 break-all" }, suggestion.rawValue));
|
29
|
-
};
|
30
|
-
|
31
|
-
export { QuerySuggestionContainer as Q, QuerySuggestionIcon as a, QuerySuggestionText as b, getPartialSearchBoxSuggestionElement as g };
|
32
|
-
|
33
|
-
//# sourceMappingURL=stencil-query-suggestions.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"stencil-query-suggestions.js","mappings":";;;MAUa,oCAAoC,GAAG,CAClD,UAAsB,EACtB,IAAU;IAEV,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,GAAG,EAAE,MAAM,qBAAqB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACvD,KAAK,EAAE,UAAU,CAAC,QAAQ;QAC1B,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE;YAC1C,KAAK,EAAE,UAAU,CAAC,QAAQ;YAC1B,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;KACH,CAAC;AACJ,EAAE;MAEW,wBAAwB,GAAwB,CAAC,CAAC,EAAE,QAAQ;IACvE,QACE,WAAK,IAAI,EAAC,0BAA0B,EAAC,KAAK,EAAC,mBAAmB,IAC3D,QAAQ,CACL,EACN;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC;IACxB,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;KACR;IAED,QACE,mBACE,IAAI,EAAC,uBAAuB,EAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAC,uBAAuB,GAChB,EACf;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAC;IACzB,IAAI,QAAQ,EAAE;QACZ,QACE,YACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,wBAAwB,EAC9B,SAAS,EAAE,UAAU,CAAC,gBAAgB,GAChC,EACR;KACH;IAED,QACE,YAAM,IAAI,EAAC,uBAAuB,EAAC,KAAK,EAAC,wBAAwB,IAC9D,UAAU,CAAC,QAAQ,CACf,EACP;AACJ;;;;","names":[],"sources":["src/components/common/suggestions/stencil-query-suggestions.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils.js';\nimport {SearchBoxSuggestionElement} from './suggestions-types.js';\n\ninterface Suggestion {\n highlightedValue: string;\n rawValue: string;\n}\n\nexport const getPartialSearchBoxSuggestionElement = (\n suggestion: Suggestion,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'query-suggestion-item',\n key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,\n query: suggestion.rawValue,\n ariaLabel: i18n.t('query-suggestion-label', {\n query: suggestion.rawValue,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const QuerySuggestionContainer: FunctionalComponent = (_, children) => {\n return (\n <div part=\"query-suggestion-content\" class=\"flex items-center\">\n {children}\n </div>\n );\n};\n\ninterface QuerySuggestionIconProps {\n icon: string;\n hasSuggestion: boolean;\n}\n\nexport const QuerySuggestionIcon: FunctionalComponent<\n QuerySuggestionIconProps\n> = ({icon, hasSuggestion}) => {\n if (!hasSuggestion) {\n return;\n }\n\n return (\n <atomic-icon\n part=\"query-suggestion-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface QuerySuggestionTextProps {\n suggestion: Suggestion;\n hasQuery: boolean;\n}\n\nexport const QuerySuggestionText: FunctionalComponent<\n QuerySuggestionTextProps\n> = ({suggestion, hasQuery}) => {\n if (hasQuery) {\n return (\n <span\n part=\"query-suggestion-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={suggestion.highlightedValue}\n ></span>\n );\n }\n\n return (\n <span part=\"query-suggestion-text\" class=\"line-clamp-2 break-all\">\n {suggestion.rawValue}\n </span>\n );\n};\n"],"version":3}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import { c as closest } from './dom-utils.js';
|
2
|
-
import { b as buildCustomEvent } from './event-utils.js';
|
3
|
-
|
4
|
-
/**
|
5
|
-
* Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
|
6
|
-
*
|
7
|
-
* @param event Event sent from the registered query suggestions to the parent search box
|
8
|
-
* @param element Element on which to dispatch the event, which must be the child of a configured search box
|
9
|
-
* @param allowedSearchBoxElements Optional array of allowed search box element selectors
|
10
|
-
*
|
11
|
-
* @throws Error if the element is not a child of an allowed search box element
|
12
|
-
*/
|
13
|
-
const dispatchSearchBoxSuggestionsEvent = (event, element, allowedSearchBoxElements = searchBoxElements) => {
|
14
|
-
const interfaceElement = closest(element, searchBoxElements.join(', '));
|
15
|
-
if (!interfaceElement) {
|
16
|
-
throw new Error(`The "${element.nodeName.toLowerCase()}" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(', ')}`);
|
17
|
-
}
|
18
|
-
void dispatchSearchBoxSuggestionsEventEventually(interfaceElement, element, event);
|
19
|
-
};
|
20
|
-
const searchBoxElements = [
|
21
|
-
'atomic-search-box',
|
22
|
-
'atomic-insight-search-box',
|
23
|
-
'atomic-commerce-search-box',
|
24
|
-
];
|
25
|
-
const isLitElementLoosely = (candidate) => 'updateComplete' in candidate &&
|
26
|
-
candidate.updateComplete instanceof Promise;
|
27
|
-
const dispatchSearchBoxSuggestionsEventEventually = async (interfaceElement, element, event) => {
|
28
|
-
await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());
|
29
|
-
if (isLitElementLoosely(interfaceElement)) {
|
30
|
-
await interfaceElement.updateComplete;
|
31
|
-
}
|
32
|
-
else if ('componentOnReady' in interfaceElement) {
|
33
|
-
await interfaceElement.componentOnReady();
|
34
|
-
}
|
35
|
-
element.dispatchEvent(buildCustomEvent('atomic/searchBoxSuggestion/register', event));
|
36
|
-
};
|
37
|
-
|
38
|
-
export { dispatchSearchBoxSuggestionsEvent as d };
|
39
|
-
|
40
|
-
//# sourceMappingURL=suggestions-events.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"suggestions-events.js","mappings":";;;AAOA;;;;;;;;;MASa,iCAAiC,GAAG,CAI/C,KAA+D,EAC/D,OAAoB,EACpB,2BAA0E,iBAAiB;IAE3F,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CACb,QAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gFAAgF,wBAAwB,CAAC,IAAI,CACjJ,IAAI,CACL,EAAE,CACJ,CAAC;KACH;IACD,KAAK,2CAA2C,CAC9C,gBAAgB,EAChB,OAAO,EACP,KAAK,CACN,CAAC;AACJ,EAAE;AAEF,MAAM,iBAAiB,GAAG;IACxB,mBAAmB;IACnB,2BAA2B;IAC3B,4BAA4B;CACpB,CAAC;AAEX,MAAM,mBAAmB,GAAG,CAAC,SAAkB,KAC7C,gBAAgB,IAAK,SAAwB;IAC5C,SAAwB,CAAC,cAAc,YAAY,OAAO,CAAC;AAE9D,MAAM,2CAA2C,GAAG,OAIlD,gBAAyB,EACzB,OAAoB,EACpB,KAA+D;IAE/D,MAAM,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1E,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,EAAE;QACzC,MAAM,gBAAgB,CAAC,cAAc,CAAC;KACvC;SAAM,IAAI,kBAAkB,IAAI,gBAAgB,EAAE;QACjD,MAAO,gBAAuC,CAAC,gBAAgB,EAAE,CAAC;KACnE;IACD,OAAO,CAAC,aAAa,CACnB,gBAAgB,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAC/D,CAAC;AACJ,CAAC;;;;","names":[],"sources":["src/components/common/suggestions/suggestions-events.ts"],"sourcesContent":["import type {HTMLStencilElement} from '@stencil/core/internal';\nimport type {LitElement} from 'lit';\nimport {closest} from '../../../utils/dom-utils';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport type {AnyBindings} from '../interface/bindings';\nimport type {SearchBoxSuggestionsEvent} from './suggestions-types';\n\n/**\n * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.\n *\n * @param event Event sent from the registered query suggestions to the parent search box\n * @param element Element on which to dispatch the event, which must be the child of a configured search box\n * @param allowedSearchBoxElements Optional array of allowed search box element selectors\n *\n * @throws Error if the element is not a child of an allowed search box element\n */\nexport const dispatchSearchBoxSuggestionsEvent = <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>,\n element: HTMLElement,\n allowedSearchBoxElements: readonly (typeof searchBoxElements)[number][] = searchBoxElements\n) => {\n const interfaceElement = closest(element, searchBoxElements.join(', '));\n if (!interfaceElement) {\n throw new Error(\n `The \"${element.nodeName.toLowerCase()}\" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(\n ', '\n )}`\n );\n }\n void dispatchSearchBoxSuggestionsEventEventually(\n interfaceElement,\n element,\n event\n );\n};\n\nconst searchBoxElements = [\n 'atomic-search-box',\n 'atomic-insight-search-box',\n 'atomic-commerce-search-box',\n] as const;\n\nconst isLitElementLoosely = (candidate: unknown): candidate is LitElement =>\n 'updateComplete' in (candidate as LitElement) &&\n (candidate as LitElement).updateComplete instanceof Promise;\n\nconst dispatchSearchBoxSuggestionsEventEventually = async <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n interfaceElement: Element,\n element: HTMLElement,\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>\n) => {\n await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());\n if (isLitElementLoosely(interfaceElement)) {\n await interfaceElement.updateComplete;\n } else if ('componentOnReady' in interfaceElement) {\n await (interfaceElement as HTMLStencilElement).componentOnReady();\n }\n element.dispatchEvent(\n buildCustomEvent('atomic/searchBoxSuggestion/register', event)\n );\n};\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultLinkCss","AtomicResultLinkStyle0","AtomicResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotFromHost","linkAttributes","getAttributesFromLinkSlot","render","href","isUndefined","hrefTemplate","result","clickUri","buildStringTemplateFromResult","bindings","h","LinkWithItemAnalytics","key","onSelect","interactiveResult","select","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/search/result-template-components/atomic-result-link/atomic-result-link.pcss?tag=atomic-result-link","src/components/search/result-template-components/atomic-result-link/atomic-result-link.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@reference '../../../../utils/tailwind-utilities/link-style.css';\natomic-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {InteractiveResult} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {\n InteractiveResultContext,\n ResultContext,\n} from '../result-template-decorators';\n\n/**\n * The `atomic-result-link` component automatically transforms a search result title into a clickable link that points to the original item.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-link',\n styleUrl: 'atomic-result-link.pcss',\n shadow: false,\n})\nexport class AtomicResultLink implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"gfAAA,MAAMA,EAAsB,qwkEAC5B,MAAAC,EAAeD,E,iXC4BFE,EAAgB,M,qDA0BpB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,I,CAMvC,iBAAAC,GACL,MAAMC,EAAW,aACjBN,KAAKO,iBAAmBC,EAAuBR,KAAKC,MACpDD,KAAKS,eAAiBC,EAA0BV,KAAKC,KAAMK,E,CAGtD,MAAAK,GACL,MAAMC,EAAOC,EAAYb,KAAKc,cAC1Bd,KAAKe,OAAOC,SACZC,EACEjB,KAAKc,aACLd,KAAKe,OACLf,KAAKkB,UAGX,OACEC,EAACC,EAAqB,CAAAC,IAAA,2CACpBT,KAAMA,EACNU,SAAU,IAAMtB,KAAKuB,kBAAkBC,SACvCC,qBAAsB,IAAMzB,KAAKuB,kBAAkBG,qBACnDC,sBAAuB,IACrB3B,KAAKuB,kBAAkBK,sBAEzBC,WAAY7B,KAAKS,eACjBL,gBAAiBJ,KAAKI,iBAErBJ,KAAKO,eACJY,EAAA,aAEAA,EAAA,sBACEW,MAAM,QACNC,QAAQ,a,6BAnEWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicQuickviewCss","AtomicQuickviewStyle0","AtomicQuickview","this","sandbox","onNextQuickview","evt","stopImmediatePropagation","quickview","next","onPreviousQuickview","previous","focusTarget","buttonFocusTarget","FocusTargetController","initialize","buildQuickview","bindings","engine","options","result","Schema","StringValue","required","regex","validate","addQuickviewModalIfNeeded","quickviewModalRef","quickviewModal","interfaceElement","querySelector","document","createElement","setAttribute","appendChild","updateModalContent","state","content","total","quickviewState","totalResults","current","currentResult","modalCloseCallback","focus","quickviewAriaMessage","isLoading","i18n","t","first","last","title","onClick","event","stopPropagation","fetchResultContent","componentWillUpdate","render","resultHasPreview","h","Button","key","part","style","class","ref","setTarget","icon","QuickviewIcon","__decorate","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"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 '../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"],"mappings":"6iBAAA,MAAMA,EAAqB,+8iEAC3B,MAAAC,EAAeD,E,iXCoCFE,EAAe,M,yBAwBXC,KAAAC,QACb,sD,gEAAA,qD,CAMK,eAAAC,CAAgBC,GACrBA,EAAIC,2BACJJ,KAAKK,UAAUC,M,CAIV,mBAAAC,CAAoBJ,GACzBA,EAAIC,2BACJJ,KAAKK,UAAUG,U,CAKjB,eAAWC,GACT,IAAKT,KAAKU,kBAAmB,CAC3BV,KAAKU,kBAAoB,IAAIC,EAAsBX,K,CAErD,OAAOA,KAAKU,iB,CAGP,UAAAE,GACLZ,KAAKK,UAAYQ,EAAeb,KAAKc,SAASC,OAAQ,CACpDC,QAAS,CAACC,OAAQjB,KAAKiB,UAEzB,IAAIC,EAAO,CACTjB,QAAS,IAAIkB,EAAY,CACvBC,SAAU,KACVC,MAAO,wBAERC,SAAS,CAACrB,QAASD,KAAKC,S,CAGrB,yBAAAsB,GACN,GAAIvB,KAAKwB,kBAAmB,CAC1B,M,CAGF,MAAMC,EAAiBzB,KAAKc,SAASY,iBAAiBC,cACpD,0BAEF,GAAIF,EAAgB,CAClBzB,KAAKwB,kBAAoBC,EACzB,M,CAEFzB,KAAKwB,kBAAoBI,SAASC,cAAc,0BAChD7B,KAAKwB,kBAAkBM,aAAa,UAAW9B,KAAKC,SACpDD,KAAKc,SAASY,iBAAiBK,YAAY/B,KAAKwB,kB,CAG1C,kBAAAQ,GACN,GAAIhC,KAAKwB,mBAAqBxB,KAAKK,UAAU4B,MAAMC,QAAS,CAC1DlC,KAAKwB,kBAAkBU,QAAUlC,KAAKK,UAAU4B,MAAMC,QACtDlC,KAAKwB,kBAAkBP,OAASjB,KAAKiB,OACrCjB,KAAKwB,kBAAkBW,MAAQnC,KAAKoC,eAAeC,aACnDrC,KAAKwB,kBAAkBc,QAAUtC,KAAKoC,eAAeG,cACrDvC,KAAKwB,kBAAkBgB,mBAAqB,IAC1CxC,KAAKS,YAAYgC,QAEnBzC,KAAK0C,qBAAuB1C,KAAKoC,eAAeO,UAC5C3C,KAAKc,SAAS8B,KAAKC,EAAE,qBACrB7C,KAAKc,SAAS8B,KAAKC,EAAE,mBAAoB,CACvCC,MAAO9C,KAAKoC,eAAeG,cAC3BQ,KAAM/C,KAAKoC,eAAeC,aAC1BW,MAAOhD,KAAKiB,OAAO+B,O,EAKrB,OAAAC,CAAQC,GACdA,GAAOC,kBACPnD,KAAKK,UAAU+C,oB,CAGjB,mBAAAC,GACErD,KAAKuB,4BACLvB,KAAKgC,oB,CAGA,MAAAsB,GACL,GAAItD,KAAKoC,eAAemB,iBAAkB,CACxC,OACEC,EAACC,EAAM,CAAAC,IAAA,2CACLC,KAAK,SACLX,MAAOhD,KAAKc,SAAS8B,KAAKC,EAAE,aAC5Be,MAAM,kBACNC,MAAM,MACNZ,QAAUC,GAAUlD,KAAKiD,QAAQC,GACjCY,IAAK9D,KAAKS,YAAYsD,WAEtBP,EAAA,eAAAE,IAAA,2CACEC,KAAK,OACLE,MAAM,0BACNG,KAAMC,I,IA1HaC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K,6BASMF,EAAA,CAFNG,EAAsB,c,qCAmBbH,EAAA,CADTI,EAAe,c","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["ResultContext","opts","folded","ItemContext","parentName","InteractiveResultContext","InteractiveItemContext","resultContext","element","itemContext"],"sources":["src/components/search/result-template-components/result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element The element that the event is dispatched to, which must be the child of a rendered \"atomic-result\".\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"mappings":"2DAkBgBA,EAAcC,EAA0B,CAACC,OAAQ,QAC/D,OAAOC,EAAY,CAACC,WAAY,gBAAiBF,OAAQD,EAAKC,QAChE,C,SAEgBG,IACd,OAAOC,GACT,C,SAegBC,EACdC,GAEA,OAAOC,EAAeD,EAAS,gBACjC,Q","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["possiblyWarnOnBadFieldType","field","itemValueRaw","host","logger","isArray","error","nodeName","toLowerCase","ItemTextFallback","defaultValue","item","getProperty","children","raw","isUndefined","remove","h","Fragment","renderWithHighlights","value","highlights","highlightString","openingDelimiter","closingDelimiter","highlightedValue","content","replace","RegExp","ItemTextHighlighted","highlightKeywords","onError","textValue","Host","innerHTML","AtomicResultText","this","shouldHighlight","render","resultValueAsString","getStringValueFromResultOrNull","result","bindings","engine","default","ResultTemplatesHelpers","getResultProperty","getFieldValueCaption","i18n","HighlightUtils","__decorate","InitializeBindings","ResultContext","AtomicText","strings","t","count","connectedCallback","Error"],"sources":["src/components/common/item-text/field-warning.ts","src/components/common/item-text/stencil-item-text-fallback.tsx","src/components/common/item-text/render-highlights.ts","src/components/common/item-text/stencil-item-text-highlighted.tsx","src/components/search/result-template-components/atomic-result-text/atomic-result-text.tsx","src/components/search/atomic-text/atomic-text.tsx"],"sourcesContent":["import {isArray} from '@coveo/bueno';\n\nexport function possiblyWarnOnBadFieldType(\n field: string,\n itemValueRaw: unknown,\n host: HTMLElement,\n logger: Pick<Console, 'error'>\n) {\n if (isArray(itemValueRaw)) {\n logger.error(\n `${host.nodeName.toLowerCase()} cannot be used with multi value field \"${field}\" with values \"${itemValueRaw}\".`,\n host\n );\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {Fragment, FunctionalComponent, VNode, h} from '@stencil/core';\nimport {possiblyWarnOnBadFieldType} from './field-warning';\n\nexport interface ItemTextProps<T> {\n logger: Pick<Console, 'error'>;\n host: HTMLElement;\n defaultValue: string | undefined;\n field: string;\n item: T;\n getProperty: (result: T, property: string) => unknown;\n}\n\nexport const ItemTextFallback = <T,>(\n {field, host, logger, defaultValue, item, getProperty}: ItemTextProps<T>,\n children: VNode[]\n): FunctionalComponent<ItemTextProps<T>> | null => {\n const raw = getProperty(item, field);\n possiblyWarnOnBadFieldType(field, raw, host, logger);\n\n if (isUndefined(defaultValue)) {\n host.remove();\n return null;\n } else {\n return <Fragment>{children}</Fragment>;\n }\n};\n","export type HighlightKeywords = {\n offset: number;\n length: number;\n};\n\nexport type HighlightString = (params: {\n content: string;\n openingDelimiter: string;\n closingDelimiter: string;\n highlights: HighlightKeywords[];\n}) => string;\n\nexport function renderWithHighlights(\n value: string,\n highlights: HighlightKeywords[],\n highlightString: HighlightString\n) {\n const openingDelimiter = '_openingDelimiter_';\n const closingDelimiter = '_closingDelimiter_';\n const highlightedValue = highlightString({\n content: value,\n openingDelimiter,\n closingDelimiter,\n highlights,\n });\n return highlightedValue\n .replace(new RegExp(openingDelimiter, 'g'), '<b>')\n .replace(new RegExp(closingDelimiter, 'g'), '</b>');\n}\n","import {FunctionalComponent, h, Host} from '@stencil/core';\nimport {\n HighlightKeywords,\n HighlightString,\n renderWithHighlights,\n} from './render-highlights';\n\nexport interface ItemTextHighlightedProps {\n textValue: string;\n highlightKeywords: HighlightKeywords[];\n onError: (error: Error) => void;\n highlightString: HighlightString;\n}\n\nexport const ItemTextHighlighted: FunctionalComponent<\n ItemTextHighlightedProps\n> = ({highlightKeywords, highlightString, onError, textValue}) => {\n try {\n const highlightedValue = renderWithHighlights(\n textValue,\n highlightKeywords,\n highlightString\n );\n\n // deepcode ignore ReactSetInnerHtml: This is not React code\n return <Host innerHTML={highlightedValue}></Host>;\n } catch (error) {\n onError(error as Error);\n }\n};\n","import {HighlightUtils, Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, h, Element, State} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {getStringValueFromResultOrNull} from '../../../../utils/result-utils';\nimport {ItemTextFallback} from '../../../common/item-text/stencil-item-text-fallback';\nimport {ItemTextHighlighted} from '../../../common/item-text/stencil-item-text-highlighted';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-text` component renders the value of a string result field.\n */\n@Component({\n tag: 'atomic-result-text',\n shadow: false,\n})\nexport class AtomicResultText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The result field which the component should use.\n * This will look in the Result object first, and then in the Result.raw object for the fields.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n /**\n * When this is set to `true`, the component attempts to highlight text based on the highlighting properties provided by the search API response.\n */\n @Prop({reflect: true}) public shouldHighlight = true;\n\n /**\n * The locale key for the text to display when the configured field has no value.\n */\n @Prop({reflect: true}) public default?: string;\n\n public render() {\n const resultValueAsString = getStringValueFromResultOrNull(\n this.result,\n this.field\n );\n\n if (resultValueAsString === null) {\n return (\n <ItemTextFallback\n field={this.field}\n host={this.host}\n logger={this.bindings.engine.logger}\n defaultValue={this.default}\n item={this.result}\n getProperty={ResultTemplatesHelpers.getResultProperty}\n >\n <atomic-text\n value={getFieldValueCaption(\n this.field,\n this.default!,\n this.bindings.i18n\n )}\n ></atomic-text>\n </ItemTextFallback>\n );\n }\n\n const textValue = `${resultValueAsString}`;\n const highlightKeywords = ResultTemplatesHelpers.getResultProperty(\n this.result,\n `${this.field}Highlights`\n ) as HighlightUtils.HighlightKeyword[];\n\n return this.shouldHighlight && highlightKeywords ? (\n <ItemTextHighlighted\n textValue={textValue}\n highlightKeywords={highlightKeywords}\n highlightString={HighlightUtils.highlightString}\n onError={(error) => (this.error = error)}\n ></ItemTextHighlighted>\n ) : (\n getFieldValueCaption(this.field, textValue, this.bindings.i18n)\n );\n }\n}\n","import {Component, Prop, State} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {Bindings} from '../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-text` component leverages the I18n translation module through the atomic-search-interface.\n */\n@Component({\n tag: 'atomic-text',\n shadow: true,\n})\nexport class AtomicText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n\n private strings = {\n value: () =>\n this.bindings.i18n.t(this.value, {\n count: this.count,\n }),\n };\n @State() public error!: Error;\n\n /**\n * The string key value.\n */\n @Prop({reflect: true}) public value!: string;\n /**\n * The count value used for plurals.\n */\n @Prop({reflect: true}) public count?: number;\n\n public connectedCallback() {\n if (!this.value) {\n this.error = new Error('The \"value\" attribute must be defined.');\n }\n }\n\n public render() {\n return this.strings.value();\n }\n}\n"],"mappings":"sdAEgBA,EACdC,EACAC,EACAC,EACAC,GAEA,GAAIC,EAAQH,GAAe,CACzBE,EAAOE,MACL,GAAGH,EAAKI,SAASC,wDAAwDP,mBAAuBC,MAChGC,E,CAGN,CCDO,MAAMM,EAAmB,EAC7BR,QAAOE,OAAMC,SAAQM,eAAcC,OAAMC,eAC1CC,KAEA,MAAMC,EAAMF,EAAYD,EAAMV,GAC9BD,EAA2BC,EAAOa,EAAKX,EAAMC,GAE7C,GAAIW,EAAYL,GAAe,CAC7BP,EAAKa,SACL,OAAO,I,KACF,CACL,OAAOC,EAACC,EAAQ,KAAEL,E,YCZNM,EACdC,EACAC,EACAC,GAEA,MAAMC,EAAmB,qBACzB,MAAMC,EAAmB,qBACzB,MAAMC,EAAmBH,EAAgB,CACvCI,QAASN,EACTG,mBACAC,mBACAH,eAEF,OAAOI,EACJE,QAAQ,IAAIC,OAAOL,EAAkB,KAAM,OAC3CI,QAAQ,IAAIC,OAAOJ,EAAkB,KAAM,OAChD,CCdO,MAAMK,EAET,EAAEC,oBAAmBR,kBAAiBS,UAASC,gBACjD,IACE,MAAMP,EAAmBN,EACvBa,EACAF,EACAR,GAIF,OAAOL,EAACgB,EAAI,CAACC,UAAWT,G,CACxB,MAAOnB,GACPyB,EAAQzB,E,oXCPC6B,EAAgB,M,yBAiBGC,KAAAC,gBAAkB,K,+DAAA,K,uBAOzC,MAAAC,GACL,MAAMC,EAAsBC,EAC1BJ,KAAKK,OACLL,KAAKnC,OAGP,GAAIsC,IAAwB,KAAM,CAChC,OACEtB,EAACR,EAAgB,CACfR,MAAOmC,KAAKnC,MACZE,KAAMiC,KAAKjC,KACXC,OAAQgC,KAAKM,SAASC,OAAOvC,OAC7BM,aAAc0B,KAAKQ,QACnBjC,KAAMyB,KAAKK,OACX7B,YAAaiC,EAAuBC,mBAEpC7B,EAAA,eACEG,MAAO2B,EACLX,KAAKnC,MACLmC,KAAKQ,QACLR,KAAKM,SAASM,Q,CAOxB,MAAMhB,EAAY,GAAGO,IACrB,MAAMT,EAAoBe,EAAuBC,kBAC/CV,KAAKK,OACL,GAAGL,KAAKnC,mBAGV,OAAOmC,KAAKC,iBAAmBP,EAC7Bb,EAACY,EAAmB,CAClBG,UAAWA,EACXF,kBAAmBA,EACnBR,gBAAiB2B,EAAe3B,gBAChCS,QAAUzB,GAAW8B,KAAK9B,MAAQA,IAGpCyC,EAAqBX,KAAKnC,MAAO+B,EAAWI,KAAKM,SAASM,K,6BAhEjCE,GAA5BC,K,+BACwBD,GAAxBE,K,8YCRUC,EAAU,M,yBAGbjB,KAAAkB,QAAU,CAChBlC,MAAO,IACLgB,KAAKM,SAASM,KAAKO,EAAEnB,KAAKhB,MAAO,CAC/BoC,MAAOpB,KAAKoB,S,+DAcX,iBAAAC,GACL,IAAKrB,KAAKhB,MAAO,CACfgB,KAAK9B,MAAQ,IAAIoD,MAAM,yC,EAIpB,MAAApB,GACL,OAAOF,KAAKkB,QAAQlC,O,GA1BO8B,EAAA,CAA5BC,K","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicResultImageCss","AtomicResultImageStyle0","AtomicResultImage","this","useFallback","url","value","ResultTemplatesHelpers","getResultProperty","result","field","Array","isArray","altText","imageAltField","bindings","i18n","t","itemName","title","logWarning","message","engine","logger","warn","host","handleImageError","fallback","handleMissingFallback","remove","validateUrl","render","h","alt","src","filterProtocol","onError","loading","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-image/atomic-result-image.pcss?tag=atomic-result-image","src/components/search/result-template-components/atomic-result-image/atomic-result-image.tsx"],"sourcesContent":["atomic-result-image {\n display: grid;\n place-items: center;\n grid-template-rows: 100%;\n width: 100%;\n height: 100%;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, h, Prop, Element, State} from '@stencil/core';\nimport {\n InitializeBindings,\n InitializableComponent,\n} from '../../../../utils/initialization-utils';\nimport {filterProtocol} from '../../../../utils/xss-utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-image` component renders an image from a result field.\n */\n@Component({\n tag: 'atomic-result-image',\n styleUrl: 'atomic-result-image.pcss',\n shadow: false,\n})\nexport class AtomicResultImage implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() private host!: HTMLElement;\n @State() private useFallback = false;\n\n /**\n * The result field which the component should use. This will look for the field in the Result object first, then in the Result.raw object. It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n\n /**\n * The result field that contains the alt text for the image. This will look for the field in the Result object first, then in the Result.raw object\n *\n * If the field is not specified, or does not contain a valid value, the alt text will be set to \"Image for {productName}\".\n */\n @Prop({reflect: true}) imageAltField?: string;\n\n /**\n * An optional fallback image URL that will be used in case the specified image field is not available or encounters an error.\n */\n @Prop({reflect: true}) fallback?: string;\n\n public error!: Error;\n\n public get url() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n return Array.isArray(value) ? value[0] : value;\n }\n\n private get altText(): string {\n if (this.imageAltField) {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.imageAltField\n );\n\n if (Array.isArray(value) && typeof value[0] === 'string') {\n return value[0];\n }\n\n if (typeof value === 'string') {\n return value;\n }\n }\n\n return this.bindings.i18n.t('image-alt-fallback', {\n itemName: this.result.title,\n });\n }\n\n private logWarning(message: string) {\n this.bindings.engine.logger.warn(message, this.host);\n }\n\n private handleImageError() {\n const message = `The image url \"${this.url}\" is not valid or could not be loaded. You might want to add a \"fallback\" property.`;\n\n this.fallback ? (this.useFallback = true) : this.logWarning(message);\n }\n\n private handleMissingFallback(message: string) {\n if (!this.fallback) {\n this.logWarning(message);\n this.host.remove();\n return null;\n }\n return this.fallback;\n }\n\n private validateUrl(url: string) {\n if (!url) {\n const message = `\"${this.field}\" is missing. Please review your indexation. You might want to add a \"fallback\" property.`;\n return this.handleMissingFallback(message);\n }\n\n if (typeof url !== 'string') {\n const message = `Expected \"${this.field}\" to be a text field. Please review your indexation. You might want to add a \"fallback\" property.`;\n return this.handleMissingFallback(message);\n }\n\n return url;\n }\n\n public render() {\n let url = this.useFallback ? this.fallback : this.url;\n\n if (!this.useFallback) {\n url = this.validateUrl(url);\n if (!url) {\n return;\n }\n }\n\n return (\n <img\n alt={this.altText}\n src={filterProtocol(url)}\n onError={() => this.handleImageError()}\n loading=\"lazy\"\n />\n );\n }\n}\n"],"mappings":"+UAAA,MAAMA,EAAuB,wKAC7B,MAAAC,EAAeD,E,iXCiBFE,EAAiB,M,yBAIXC,KAAAC,YAAc,M,iBAAA,M,0EAqB/B,OAAWC,GACT,MAAMC,EAAQC,EAAuBC,kBACnCL,KAAKM,OACLN,KAAKO,OAEP,OAAOC,MAAMC,QAAQN,GAASA,EAAM,GAAKA,C,CAG3C,WAAYO,GACV,GAAIV,KAAKW,cAAe,CACtB,MAAMR,EAAQC,EAAuBC,kBACnCL,KAAKM,OACLN,KAAKW,eAGP,GAAIH,MAAMC,QAAQN,WAAiBA,EAAM,KAAO,SAAU,CACxD,OAAOA,EAAM,E,CAGf,UAAWA,IAAU,SAAU,CAC7B,OAAOA,C,EAIX,OAAOH,KAAKY,SAASC,KAAKC,EAAE,qBAAsB,CAChDC,SAAUf,KAAKM,OAAOU,O,CAIlB,UAAAC,CAAWC,GACjBlB,KAAKY,SAASO,OAAOC,OAAOC,KAAKH,EAASlB,KAAKsB,K,CAGzC,gBAAAC,GACN,MAAML,EAAU,kBAAkBlB,KAAKE,yFAEvCF,KAAKwB,SAAYxB,KAAKC,YAAc,KAAQD,KAAKiB,WAAWC,E,CAGtD,qBAAAO,CAAsBP,GAC5B,IAAKlB,KAAKwB,SAAU,CAClBxB,KAAKiB,WAAWC,GAChBlB,KAAKsB,KAAKI,SACV,OAAO,I,CAET,OAAO1B,KAAKwB,Q,CAGN,WAAAG,CAAYzB,GAClB,IAAKA,EAAK,CACR,MAAMgB,EAAU,IAAIlB,KAAKO,iGACzB,OAAOP,KAAKyB,sBAAsBP,E,CAGpC,UAAWhB,IAAQ,SAAU,CAC3B,MAAMgB,EAAU,aAAalB,KAAKO,yGAClC,OAAOP,KAAKyB,sBAAsBP,E,CAGpC,OAAOhB,C,CAGF,MAAA0B,GACL,IAAI1B,EAAMF,KAAKC,YAAcD,KAAKwB,SAAWxB,KAAKE,IAElD,IAAKF,KAAKC,YAAa,CACrBC,EAAMF,KAAK2B,YAAYzB,GACvB,IAAKA,EAAK,CACR,M,EAIJ,OACE2B,EAAA,OACEC,IAAK9B,KAAKU,QACVqB,IAAKC,EAAe9B,GACpB+B,QAAS,IAAMjC,KAAKuB,mBACpBW,QAAQ,Q,6BArGeC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{h as t,f as s}from"./p-dc3df5ce.js";import{B as e}from"./p-b93ccff9.js";import{isNullOrUndefined as i}from"@coveo/bueno";import{D as n}from"./p-f284897c.js";import{d as r}from"./p-01c91b69.js";import{a as o,e as a}from"./p-0a051b8d.js";const h=`<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="7" cy="7" r="6.5" stroke="currentColor"/>\n<path d="M16 16L12 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const u=(s,e)=>{const i=()=>{const t="flex bg-background w-full border border-neutral rounded-md focus-within:ring-3 absolute top-0 left-0";const e=s.disabled?"focus-within:border-disabled focus-within:ring-neutral":"focus-within:border-primary focus-within:ring-ring-primary";return[t,e].join(" ")};return t("div",{part:"wrapper",class:i(),onFocusout:s.onFocusout},e)};const c=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M15 1.00012L1.00012 14.9999" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M0.999878 1L14.9999 15" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const l=({inputRef:s,bindings:i,onClick:n,...r})=>t("div",{part:"clear-button-wrapper",class:"ml-2 flex items-center justify-center py-2"},t(e,{style:"text-transparent",part:"clear-button",class:"text-neutral-dark flex h-8 w-8 shrink-0 items-center justify-center",onClick:()=>{n?.();s?.focus()},ariaLabel:i.i18n.t("clear-search"),...r},t("atomic-icon",{part:"clear-icon",icon:c,class:"h-4 w-4"})));function g(t){return{autocomplete:"off",autocapitalize:"off",autocorrect:"off",...t.activeDescendant&&{"aria-activedescendant":t.activeDescendant},"aria-autocomplete":"both","aria-haspopup":"true","aria-controls":t.id}}function f(t,s){const e=t?.parentNode;if(!e){return}if(t.value==="\n"){return}e.dataset.replicatedValue=s??t.value}function d(t){const s=t?.parentNode;if(s){delete s.dataset.replicatedValue}}function p(t){const s=t?.parentNode;if(s){s.classList.remove("expanded")}}function m(t){const s=t?.parentNode;if(s){s.classList.add("expanded")}}const w=({textAreaRef:s,loading:e,bindings:i,onInput:n,onFocus:r,onBlur:o,onChange:a,onKeyDown:h,onKeyUp:u,value:c,ariaLabel:w,onClear:b,popup:v,...y})=>t("div",{class:"flex grow overflow-hidden"},t("div",{part:"textarea-expander",class:"grid grow overflow-hidden"},t("textarea",{part:"textarea","aria-label":w,placeholder:i.i18n.t("search"),class:"placeholder-neutral-dark",rows:1,onInput:t=>{n?.(t);f(s)},onKeyDown:t=>{f(s);if(t.key==="Enter"){if(t.shiftKey){return}t.preventDefault()}h?.(t)},onKeyUp:t=>{u?.(t);if(t.key==="Enter"){t.preventDefault();return}f(s)},onBlur:t=>{o?.(t);p(s);f(s)},onChange:t=>{a?.(t);f(s)},onFocus:t=>{r?.(t);const e=t.target;f(s??e);m(s??e)},autocomplete:"off",...v&&g(v),...y,value:c})),e&&t("div",{class:"searchbox-button-wrapper ml-2 flex items-center justify-center"},t("span",{part:"loading",class:"loading mr-2 grid h-5 w-5 animate-spin place-items-center rounded-full bg-linear-to-r"})),!e&&c&&t(l,{inputRef:s,bindings:i,onClick:()=>{b();d(s)}}));function b(t,s){let e;const i=new Promise(((t,i)=>{e=setTimeout((()=>{i(new Error("Promise timed out."))}),s)}));return Promise.race([t,i]).then((()=>{clearTimeout(e)}))}class v{constructor(t){this.ownerSearchBoxProps=t;this.suggestions=[];this.leftSuggestionElements=[];this.rightSuggestionElements=[];this.leftPanel=undefined;this.rightPanel=undefined;this.activeDescendant="";this.suggestedQuery="";this.keyboardActiveDescendant="";this.queryDataAttribute="data-query";this.suggestionEvents=[];this.previousActiveDescendantElement=null;this.leftSuggestions=[];this.rightSuggestions=[];this.triggerSuggestions=r((()=>this.executeQuerySuggestion()),this.ownerSearchBoxProps.getSuggestionDelay())}get partialSuggestionBindings(){return{suggestedQuery:()=>this.suggestedQuery,clearSuggestions:()=>this.clearSuggestions(),triggerSuggestions:()=>this.triggerSuggestions(),getSuggestions:()=>this.suggestions,getSuggestionElements:()=>this.allSuggestionElements}}get activeDescendantElement(){if(!this.hasActiveDescendant){return null}return this.leftPanel?.querySelector(`#${this.activeDescendant}`)||this.rightPanel?.querySelector(`#${this.activeDescendant}`)||null}onSubmit(){this.clickOnActiveElement();this.clearSuggestions()}updateActiveDescendant(t=""){this.activeDescendant=t;s(this.ownerSearchBoxProps.getHost())}updateKeyboardActiveDescendant(t=""){this.keyboardActiveDescendant=t}clickOnActiveElement(){this.activeDescendantElement?.click();this.updateActiveDescendant()}isRightPanelInFocus(){if(i(this.panelInFocus)||i(this.rightPanel)){return false}return this.panelInFocus===this.rightPanel}initializeSuggestions(t){this.suggestions=this.suggestionEvents.map((s=>s(t)))}registerSuggestionsFromEvent(t,s){t.preventDefault();t.stopPropagation();this.suggestionEvents.push(t.detail);this.suggestions.push(t.detail(s))}registerSuggestions(t){this.suggestions.push(t)}get isDoubleList(){return Boolean(this.leftSuggestionElements.length&&this.rightSuggestionElements.length)}focusPanel(t){const s=t==="left"?this.leftPanel:this.rightPanel;if(this.panelInFocus===s){return}if(s?.firstElementChild){const t=this.previousActiveDescendantElement&&s.contains(this.previousActiveDescendantElement);const e=t?this.previousActiveDescendantElement:s.firstElementChild;this.updateDescendants(e.id)}}clearSuggestions(){this.clearSuggestionElements();this.updateActiveDescendant()}async focusNextValue(){if(!this.hasSuggestions||!this.nextOrFirstValue){return}await this.focusValue(this.nextOrFirstValue)}async focusValue(t){this.updateKeyboardActiveDescendant(t.id);this.updateActiveDescendant(t.id);this.scrollActiveDescendantIntoView();await this.updateQueryFromSuggestion()}async onSuggestionMouseOver(t,s,e){const i=s==="left"?this.leftPanel:this.rightPanel;this.updateKeyboardActiveDescendant();if(this.panelInFocus===i){this.updateActiveDescendant(e)}else{this.updateDescendants(e)}if(t.query){await this.updateSuggestedQuery(t.query)}}async onSuggestionClick(t,s){if(t.query){this.clearSuggestions();await this.updateOwnerSearchboxQuery(t.query)}t.onSelect?.(s)}get hasSuggestions(){return!!this.allSuggestionElements.length}get allSuggestionElements(){return[...this.leftSuggestionElements,...this.rightSuggestionElements]}async focusPreviousValue(){if(this.firstValue===this.activeDescendantElement){this.updateKeyboardActiveDescendant();this.updateActiveDescendant();return}if(!this.hasSuggestions||!this.previousOrLastValue){return}await this.focusValue(this.previousOrLastValue)}get hasActiveDescendant(){return this.activeDescendant!==""}async executeQuerySuggestion(){this.updateActiveDescendant();const t=await Promise.allSettled(this.suggestions.map((t=>b(t.onInput?t.onInput():Promise.resolve(),this.ownerSearchBoxProps.getSuggestionTimeout()))));const s=[];t.forEach(((t,e)=>{if(t.status==="fulfilled"){s.push(this.suggestions[e])}else{this.ownerSearchBoxProps.getLogger().warn("Some query suggestions are not being shown because the promise timed out.")}}));const e=(t,e=false)=>s.filter((s=>s.panel===t||!s.panel&&e)).sort(this.sortSuggestions);this.leftSuggestions=e("left",true);this.leftSuggestionElements=this.getAndFilterLeftSuggestionElements();this.rightSuggestions=e("right");this.rightSuggestionElements=this.getSuggestionElements(this.rightSuggestions);const i=this.allSuggestionElements.find(o)?.query||"";await this.updateSuggestedQuery(i)}get lastValue(){return this.panelInFocus?.lastElementChild}get previousOrLastValue(){if(!this.hasActiveDescendant){return this.lastValue?.firstChild}const t=this.activeDescendantElement?.parentElement;return t?.previousElementSibling?.firstChild||this.firstValue?.firstChild}sortSuggestions(t,s){return t.position-s.position}get nextOrFirstValue(){if(!this.hasActiveDescendant){return this.firstValue?.firstChild}const t=this.activeDescendantElement?.parentElement;return t?.nextElementSibling?.firstChild||this.firstValue?.firstChild}get firstValue(){return this.panelInFocus?.firstElementChild}get panelInFocus(){if(this.leftPanel?.contains(this.activeDescendantElement)){return this.leftPanel}if(this.rightPanel?.contains(this.activeDescendantElement)){return this.rightPanel}return this.leftPanel||this.rightPanel}scrollActiveDescendantIntoView(){this.activeDescendantElement?.scrollIntoView({block:"nearest"})}async updateQueryFromSuggestion(){const t=this.activeDescendantElement?.getAttribute(this.queryDataAttribute);await this.updateOwnerSearchboxQuery(t||"")}async updateOwnerSearchboxQuery(t){if(t&&this.ownerSearchBoxProps.getSearchBoxValue()!==t){this.ownerSearchBoxProps.updateQuery(t);await this.updateSuggestedQuery(t)}}async updateSuggestedQuery(t){await Promise.allSettled(this.suggestions.map((s=>b(s.onSuggestedQueryChange?s.onSuggestedQueryChange(t):Promise.resolve(),this.ownerSearchBoxProps.getSuggestionTimeout()))));this.suggestedQuery=t;this.updateSuggestionElements(t);s(this.ownerSearchBoxProps.getHost())}updateSuggestionElements(t){if(!this.isPanelInFocus(this.leftPanel,t)){this.leftSuggestionElements=this.getAndFilterLeftSuggestionElements()}if(!this.isPanelInFocus(this.rightPanel,t)){this.rightSuggestionElements=this.getSuggestionElements(this.rightSuggestions)}}forceUpdate(){this.updateSuggestionElements(this.suggestedQuery);s(this.ownerSearchBoxProps.getHost())}isPanelInFocus(t,s){if(!this.activeDescendantElement){return false}if(s){const e=n.sanitize(s);return!!t?.querySelector(`[${this.queryDataAttribute}="${CSS.escape(e)}"]`)}return this.activeDescendantElement?.closest("ul")===t}getAndFilterLeftSuggestionElements(){const t=this.getSuggestionElements(this.leftSuggestions);const s=new Set;const e=t.filter((t=>{if(i(t.query)){return true}if(s.has(t.query)){return false}else{s.add(t.query);return true}}));return e}getSuggestionElements(t){const s=t.flatMap((t=>t.renderItems()));const e=this.ownerSearchBoxProps.getNumberOfSuggestionsToDisplay()+s.filter(a).length;return s.slice(0,e)}updateDescendants(t=""){const s=this.activeDescendantElement;this.previousActiveDescendantElement=s;this.updateActiveDescendant(t)}clearSuggestionElements(){this.leftSuggestionElements=[];this.rightSuggestionElements=[]}}export{v as S,h as a,w as b,u as c};
|
2
|
-
//# sourceMappingURL=p-2559747d.js.map
|