@coveo/atomic 3.33.2 → 3.33.3-pre.0757b1116b
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 +0 -1
- package/dist/atomic/components/analytics-config.js +2 -2
- package/dist/atomic/components/analytics-config.js.map +1 -1
- package/dist/atomic/components/atomic-category-facet.js +1 -1
- package/dist/atomic/components/atomic-citation.js +1 -1
- package/dist/atomic/components/atomic-facet-manager.js +1 -1
- package/dist/atomic/components/atomic-facet.js +1 -1
- package/dist/atomic/components/atomic-format-currency.js +1 -1
- package/dist/atomic/components/atomic-format-number.js +1 -1
- package/dist/atomic/components/atomic-format-unit.js +1 -1
- package/dist/atomic/components/atomic-generated-answer-feedback-modal.js +1 -1
- package/dist/atomic/components/atomic-html2.js +1 -1
- package/dist/atomic/components/atomic-insight-edit-toggle.js +1 -1
- package/dist/atomic/components/atomic-insight-facet.js +1 -1
- package/dist/atomic/components/atomic-insight-folded-result-list.js +1 -1
- package/dist/atomic/components/atomic-insight-full-search-button.js +1 -1
- package/dist/atomic/components/atomic-insight-history-toggle.js +1 -1
- package/dist/atomic/components/atomic-insight-layout.js +80 -1
- package/dist/atomic/components/atomic-insight-layout.js.map +1 -1
- package/dist/atomic/components/atomic-insight-no-results.js +1 -1
- package/dist/atomic/components/atomic-insight-numeric-facet.js +1 -1
- package/dist/atomic/components/atomic-insight-pager.js +3 -3
- package/dist/atomic/components/atomic-insight-query-error.js +1 -1
- package/dist/atomic/components/atomic-insight-refine-modal2.js +2 -2
- package/dist/atomic/components/atomic-insight-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-insight-result-action.js +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +1 -1
- package/dist/atomic/components/atomic-insight-result-children.js +1 -1
- package/dist/atomic/components/atomic-insight-result-list.js +1 -1
- package/dist/atomic/components/atomic-insight-result-quickview-action.js +1 -1
- package/dist/atomic/components/atomic-insight-result2.js +2 -2
- package/dist/atomic/components/atomic-insight-result2.js.map +1 -1
- package/dist/atomic/components/atomic-insight-search-box.js +2 -2
- package/dist/atomic/components/atomic-insight-smart-snippet-feedback-modal2.js +2 -2
- package/dist/atomic/components/atomic-insight-tabs.js +1 -1
- package/dist/atomic/components/atomic-insight-user-actions-session2.js +1 -1
- package/dist/atomic/components/atomic-insight-user-actions-toggle.js +1 -1
- package/dist/atomic/components/atomic-ipx-body2.js +2 -2
- package/dist/atomic/components/atomic-ipx-button.js +2 -2
- package/dist/atomic/components/atomic-ipx-embedded.js +1 -1
- package/dist/atomic/components/atomic-ipx-modal.js +2 -2
- package/dist/atomic/components/atomic-ipx-recs-list.js +1 -1
- package/dist/atomic/components/atomic-ipx-refine-modal2.js +1 -1
- package/dist/atomic/components/atomic-ipx-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-ipx-result-link.js +1 -1
- package/dist/atomic/components/atomic-ipx-tabs.js +1 -1
- package/dist/atomic/components/atomic-load-more-results.js +1 -1
- package/dist/atomic/components/atomic-modal2.js +2 -2
- package/dist/atomic/components/atomic-no-results.js +1 -1
- package/dist/atomic/components/atomic-numeric-facet.js +1 -1
- package/dist/atomic/components/atomic-pager.js +3 -3
- package/dist/atomic/components/atomic-query-error.js +1 -1
- package/dist/atomic/components/atomic-query-summary.js +1 -1
- package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
- package/dist/atomic/components/atomic-quickview.js +1 -1
- package/dist/atomic/components/atomic-recs-error.js +1 -1
- package/dist/atomic/components/atomic-recs-interface.js +2 -2
- package/dist/atomic/components/atomic-recs-list.js +1 -1
- package/dist/atomic/components/atomic-recs-result2.js +1 -1
- package/dist/atomic/components/atomic-recs-result2.js.map +1 -1
- package/dist/atomic/components/atomic-refine-modal2.js +1 -1
- package/dist/atomic/components/atomic-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-relevance-inspector2.js +2 -2
- package/dist/atomic/components/atomic-result-children.js +1 -1
- package/dist/atomic/components/atomic-result-fields-list.js +1 -1
- package/dist/atomic/components/atomic-result-link.js +1 -1
- package/dist/atomic/components/atomic-result-list.js +1 -1
- package/dist/atomic/components/atomic-result-placeholder2.js +3 -3
- package/dist/atomic/components/atomic-result-placeholder2.js.map +1 -1
- package/dist/atomic/components/atomic-result-table-placeholder2.js +1 -1
- package/dist/atomic/components/atomic-result2.js +1 -1
- package/dist/atomic/components/atomic-result2.js.map +1 -1
- package/dist/atomic/components/atomic-search-box-instant-results.js +1 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +1 -1
- package/dist/atomic/components/atomic-search-box-recent-queries2.js +1 -1
- package/dist/atomic/components/atomic-search-box.js +4 -4
- package/dist/atomic/components/atomic-search-interface.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-answer2.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-collapse-wrapper2.js +2 -2
- package/dist/atomic/components/atomic-smart-snippet-expandable-answer2.js +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-sort-dropdown.js +2 -2
- package/dist/atomic/components/atomic-sort-expression.js +1 -1
- package/dist/atomic/components/atomic-stencil-facet-date-input.js +3 -3
- package/dist/atomic/components/atomic-suggestion-renderer2.js +1 -1
- package/dist/atomic/components/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product/atomic-product.tw.css.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-section-emphasized/atomic-product-section-emphasized.js +3 -2
- package/dist/atomic/components/components/insight/atomic-insight-interface/analytics-config.js +31 -0
- package/dist/atomic/components/components/insight/atomic-insight-interface/atomic-insight-interface.js +252 -0
- package/dist/atomic/components/components/insight/index.js +2 -1
- package/dist/atomic/components/components/insight/lazy-index.js +3 -1
- package/dist/atomic/components/facet-number-input.js +2 -2
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/tab-button.js +1 -1
- package/dist/atomic/components/tab-popover.js +1 -1
- package/dist/atomic/{p-d1d2d945.entry.js → p-05a3e5a4.entry.js} +2 -2
- package/dist/atomic/{p-26098930.entry.js → p-09953fee.entry.js} +2 -2
- package/dist/atomic/{p-84befe35.entry.js → p-0b44ae08.entry.js} +2 -2
- package/dist/atomic/{p-80055cf6.entry.js → p-0dac8e7b.entry.js} +2 -2
- package/dist/atomic/{p-5c995d77.entry.js → p-0dc6ebf8.entry.js} +2 -2
- package/dist/atomic/{p-ef22a3f2.entry.js → p-104c7d84.entry.js} +2 -2
- package/dist/atomic/{p-ce9e510c.entry.js → p-117be4a4.entry.js} +2 -2
- package/dist/atomic/{p-cbb819d2.entry.js → p-11fc3a7b.entry.js} +2 -2
- package/dist/atomic/{p-b0bd2709.entry.js → p-156aa33a.entry.js} +2 -2
- package/dist/atomic/p-15d2ebce.entry.js +2 -0
- package/dist/atomic/{p-64fc4340.entry.js.map → p-15d2ebce.entry.js.map} +1 -1
- package/dist/atomic/{p-26ad479b.entry.js → p-182a3f9e.entry.js} +2 -2
- package/dist/atomic/{p-bfdecd0f.entry.js → p-1d8eba10.entry.js} +2 -2
- package/dist/atomic/{p-58610952.entry.js → p-24c2110b.entry.js} +2 -2
- package/dist/atomic/p-256b5495.entry.js +2 -0
- package/dist/atomic/{p-571c9614.entry.js → p-2c64e9a2.entry.js} +2 -2
- package/dist/atomic/{p-6ad1adfb.entry.js → p-31e55d26.entry.js} +2 -2
- package/dist/atomic/{p-069bf2b9.entry.js → p-39698267.entry.js} +2 -2
- package/dist/atomic/p-3a3f7783.entry.js +2 -0
- package/dist/atomic/{p-29919fba.entry.js.map → p-3a3f7783.entry.js.map} +1 -1
- package/dist/atomic/{p-c9fa8526.entry.js → p-3a994997.entry.js} +2 -2
- package/dist/atomic/{p-1c3363ec.entry.js → p-3c7ed752.entry.js} +2 -2
- package/dist/atomic/{p-5027d796.entry.js → p-3e7ea7a5.entry.js} +2 -2
- package/dist/atomic/{p-ab627e18.entry.js → p-429270f6.entry.js} +2 -2
- package/dist/atomic/{p-737f842d.entry.js → p-43a0f6e2.entry.js} +2 -2
- package/dist/atomic/p-44930be9.entry.js +2 -0
- package/dist/atomic/{p-9d9f201f.entry.js.map → p-44930be9.entry.js.map} +1 -1
- package/dist/atomic/{p-8b70f39a.entry.js → p-455fbbd7.entry.js} +2 -2
- package/dist/atomic/{p-b97abfb9.entry.js → p-45e88039.entry.js} +2 -2
- package/dist/atomic/{p-c61609ea.entry.js → p-52b66ca8.entry.js} +2 -2
- package/dist/atomic/p-564be2a3.entry.js +2 -0
- package/dist/atomic/{p-09924944.entry.js → p-681610d3.entry.js} +2 -2
- package/dist/atomic/{p-2e91aea8.entry.js → p-6b297a61.entry.js} +2 -2
- package/dist/atomic/{p-1c2d25ba.entry.js → p-6bea42e6.entry.js} +2 -2
- package/dist/atomic/{p-b103b28a.entry.js → p-70c431f9.entry.js} +2 -2
- package/dist/atomic/{p-a14fd4de.entry.js → p-770da48e.entry.js} +2 -2
- package/dist/atomic/{p-a3a1f8e9.entry.js → p-7753ae27.entry.js} +2 -2
- package/dist/atomic/{p-612155f0.entry.js → p-7bff27b2.entry.js} +2 -2
- package/dist/atomic/{p-0368a213.entry.js → p-81b6d12c.entry.js} +2 -2
- package/dist/atomic/{p-1a79c944.entry.js → p-842d31d0.entry.js} +2 -2
- package/dist/atomic/p-8677b56e.entry.js +2 -0
- package/dist/atomic/{p-6f7c823d.entry.js.map → p-8677b56e.entry.js.map} +1 -1
- package/dist/atomic/{p-4c7654eb.entry.js → p-87747240.entry.js} +2 -2
- package/dist/atomic/{p-258c3253.entry.js → p-8b8eb35f.entry.js} +2 -2
- package/dist/atomic/{p-df2df66a.entry.js → p-8baf4780.entry.js} +2 -2
- package/dist/atomic/{p-82a8cf74.entry.js → p-943b29c2.entry.js} +2 -2
- package/dist/atomic/{p-05ab5909.entry.js → p-9507e1bc.entry.js} +2 -2
- package/dist/atomic/{p-aa40956c.entry.js → p-971a8a73.entry.js} +2 -2
- package/dist/atomic/{p-552d1f66.entry.js → p-a0d04767.entry.js} +2 -2
- package/dist/atomic/{p-c667812c.entry.js → p-a5751bb0.entry.js} +2 -2
- package/dist/atomic/{p-fc6beee6.entry.js → p-af487ad9.entry.js} +2 -2
- package/dist/atomic/{p-1d091f9a.entry.js → p-b1c9b043.entry.js} +2 -2
- package/dist/atomic/p-b8cce384.entry.js +2 -0
- package/dist/atomic/{p-1f5473a6.entry.js.map → p-b8cce384.entry.js.map} +1 -1
- package/dist/atomic/{p-516b5bd4.entry.js → p-ba9b2923.entry.js} +2 -2
- package/dist/atomic/{p-2d3ef0f7.entry.js → p-bbed84f9.entry.js} +2 -2
- package/dist/atomic/p-bd404744.entry.js +2 -0
- package/dist/atomic/p-bd404744.entry.js.map +1 -0
- package/dist/atomic/{p-5138d839.entry.js → p-bfb23490.entry.js} +2 -2
- package/dist/atomic/{p-57b47b73.entry.js → p-c15fc656.entry.js} +2 -2
- package/dist/atomic/{p-896724e9.entry.js → p-c1721cb2.entry.js} +2 -2
- package/dist/atomic/{p-875583aa.entry.js → p-c434b50f.entry.js} +2 -2
- package/dist/atomic/{p-cb051c21.entry.js → p-c572a219.entry.js} +2 -2
- package/dist/atomic/{p-15d952f3.entry.js → p-c69ae97a.entry.js} +2 -2
- package/dist/atomic/{p-88e4a2f9.entry.js → p-c81d1971.entry.js} +2 -2
- package/dist/atomic/{p-633628d5.entry.js → p-cbeca949.entry.js} +2 -2
- package/dist/atomic/{p-b7f38541.entry.js → p-cc330153.entry.js} +2 -2
- package/dist/atomic/{p-0c9b553c.entry.js → p-cd8f11ea.entry.js} +2 -2
- package/dist/atomic/{p-d5071b5a.entry.js → p-d1caf040.entry.js} +2 -2
- package/dist/atomic/{p-496da1c9.entry.js → p-d1e5e2d7.entry.js} +2 -2
- package/dist/atomic/{p-b16950ec.entry.js → p-d3146795.entry.js} +2 -2
- package/dist/atomic/{p-f39de057.entry.js → p-d3b5c8e5.entry.js} +2 -2
- package/dist/atomic/{p-aff3a66a.entry.js → p-d6d0a47f.entry.js} +2 -2
- package/dist/atomic/{p-b328cab9.entry.js → p-db6034e2.entry.js} +2 -2
- package/dist/atomic/{p-3af5e810.entry.js → p-e20c18f0.entry.js} +2 -2
- package/dist/atomic/{p-79499898.entry.js → p-e50b1d73.entry.js} +2 -2
- package/dist/atomic/{p-c3746d6e.entry.js → p-e67dabc9.entry.js} +2 -2
- package/dist/atomic/{p-a2714d7e.entry.js → p-e9922d7c.entry.js} +2 -2
- package/dist/atomic/{p-1315bbaf.js → p-eb45c870.js} +2 -2
- package/dist/atomic/{p-1315bbaf.js.map → p-eb45c870.js.map} +1 -1
- package/dist/atomic/{p-13e67ab3.entry.js → p-f076efa7.entry.js} +2 -2
- package/dist/atomic/{p-a7dcf131.entry.js → p-f30c4c7d.entry.js} +2 -2
- package/dist/atomic/{p-50467793.entry.js → p-f45a7b82.entry.js} +2 -2
- package/dist/atomic/{p-2c7d4967.entry.js → p-f79f31f8.entry.js} +2 -2
- package/dist/atomic/{p-cdd70f49.entry.js → p-fa1dcc3e.entry.js} +2 -2
- package/dist/atomic/{p-e750df14.entry.js → p-fce653a1.entry.js} +2 -2
- package/dist/atomic/{p-ce83d873.entry.js → p-fe23b0b3.entry.js} +2 -2
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-f2718cd7.js → analytics-config-1a560aab.js} +2 -2
- package/dist/cjs/analytics-config-1a560aab.js.map +1 -0
- package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-citation.cjs.entry.js +1 -1
- package/dist/cjs/atomic-facet-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic-facet-number-input.cjs.entry.js +2 -2
- package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-focus-trap_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-format-currency.cjs.entry.js +1 -1
- package/dist/cjs/atomic-format-number.cjs.entry.js +1 -1
- package/dist/cjs/atomic-format-unit.cjs.entry.js +1 -1
- package/dist/cjs/atomic-generated-answer-feedback-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-html.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-edit-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-full-search-button.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-layout.cjs.entry.js +82 -4
- package/dist/cjs/atomic-insight-layout.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-no-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-numeric-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-pager.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-query-error.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-refine-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-children.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-result.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-search-box.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-tabs.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-user-actions-session_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-body.cjs.entry.js +2 -2
- package/dist/cjs/atomic-ipx-button.cjs.entry.js +2 -2
- package/dist/cjs/atomic-ipx-embedded.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-refine-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-tabs.cjs.entry.js +1 -1
- package/dist/cjs/atomic-load-more-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-no-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-pager.cjs.entry.js +3 -3
- package/dist/cjs/atomic-query-error.cjs.entry.js +1 -1
- package/dist/cjs/atomic-query-summary.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-error.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +2 -2
- package/dist/cjs/atomic-recs-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-result.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-result.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-refine-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-relevance-inspector.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-children.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-link.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-placeholder_8.cjs.entry.js +4 -4
- package/dist/cjs/atomic-result-placeholder_8.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-search-box-instant-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-search-box.cjs.entry.js +4 -4
- package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-smart-snippet-collapse-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-sort-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/atomic-sort-expression.cjs.entry.js +1 -1
- package/dist/cjs/atomic-stencil-facet-date-input.cjs.entry.js +3 -3
- package/dist/cjs/atomic-suggestion-renderer.cjs.entry.js +1 -1
- package/dist/cjs/atomic-tab-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-tab-button.cjs.entry.js +1 -1
- 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/version.cjs.js +1 -1
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-a2ebaf0d.js → analytics-config-0dc0bb46.js} +3 -3
- package/dist/esm/analytics-config-0dc0bb46.js.map +1 -0
- package/dist/esm/atomic-category-facet.entry.js +1 -1
- package/dist/esm/atomic-citation.entry.js +1 -1
- package/dist/esm/atomic-facet-manager.entry.js +1 -1
- package/dist/esm/atomic-facet-number-input.entry.js +2 -2
- package/dist/esm/atomic-facet.entry.js +1 -1
- package/dist/esm/atomic-focus-trap_2.entry.js +2 -2
- package/dist/esm/atomic-format-currency.entry.js +1 -1
- package/dist/esm/atomic-format-number.entry.js +1 -1
- package/dist/esm/atomic-format-unit.entry.js +1 -1
- package/dist/esm/atomic-generated-answer-feedback-modal.entry.js +1 -1
- package/dist/esm/atomic-html.entry.js +1 -1
- package/dist/esm/atomic-insight-edit-toggle.entry.js +1 -1
- package/dist/esm/atomic-insight-facet.entry.js +1 -1
- package/dist/esm/atomic-insight-folded-result-list.entry.js +1 -1
- package/dist/esm/atomic-insight-full-search-button.entry.js +1 -1
- package/dist/esm/atomic-insight-history-toggle.entry.js +1 -1
- package/dist/esm/atomic-insight-layout.entry.js +80 -2
- package/dist/esm/atomic-insight-layout.entry.js.map +1 -1
- package/dist/esm/atomic-insight-no-results.entry.js +1 -1
- package/dist/esm/atomic-insight-numeric-facet.entry.js +1 -1
- package/dist/esm/atomic-insight-pager.entry.js +3 -3
- package/dist/esm/atomic-insight-query-error.entry.js +1 -1
- package/dist/esm/atomic-insight-refine-modal.entry.js +2 -2
- package/dist/esm/atomic-insight-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-insight-result-action.entry.js +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +1 -1
- package/dist/esm/atomic-insight-result-children.entry.js +1 -1
- package/dist/esm/atomic-insight-result-list.entry.js +1 -1
- package/dist/esm/atomic-insight-result-quickview-action.entry.js +1 -1
- package/dist/esm/atomic-insight-result.entry.js +2 -2
- package/dist/esm/atomic-insight-result.entry.js.map +1 -1
- package/dist/esm/atomic-insight-search-box.entry.js +2 -2
- package/dist/esm/atomic-insight-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-insight-tabs.entry.js +1 -1
- package/dist/esm/atomic-insight-user-actions-session_2.entry.js +1 -1
- package/dist/esm/atomic-insight-user-actions-toggle.entry.js +1 -1
- package/dist/esm/atomic-ipx-body.entry.js +2 -2
- package/dist/esm/atomic-ipx-button.entry.js +2 -2
- package/dist/esm/atomic-ipx-embedded.entry.js +1 -1
- package/dist/esm/atomic-ipx-modal.entry.js +2 -2
- package/dist/esm/atomic-ipx-recs-list.entry.js +1 -1
- package/dist/esm/atomic-ipx-refine-modal.entry.js +1 -1
- package/dist/esm/atomic-ipx-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-ipx-result-link.entry.js +1 -1
- package/dist/esm/atomic-ipx-tabs.entry.js +1 -1
- package/dist/esm/atomic-load-more-results.entry.js +1 -1
- package/dist/esm/atomic-no-results.entry.js +1 -1
- package/dist/esm/atomic-numeric-facet.entry.js +1 -1
- package/dist/esm/atomic-pager.entry.js +3 -3
- package/dist/esm/atomic-query-error.entry.js +1 -1
- package/dist/esm/atomic-query-summary.entry.js +1 -1
- package/dist/esm/atomic-quickview-modal.entry.js +1 -1
- package/dist/esm/atomic-quickview.entry.js +1 -1
- package/dist/esm/atomic-recs-error.entry.js +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +2 -2
- package/dist/esm/atomic-recs-list.entry.js +1 -1
- package/dist/esm/atomic-recs-result.entry.js +1 -1
- package/dist/esm/atomic-recs-result.entry.js.map +1 -1
- package/dist/esm/atomic-refine-modal.entry.js +1 -1
- package/dist/esm/atomic-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-relevance-inspector.entry.js +2 -2
- package/dist/esm/atomic-result-children.entry.js +1 -1
- package/dist/esm/atomic-result-fields-list.entry.js +1 -1
- package/dist/esm/atomic-result-link.entry.js +1 -1
- package/dist/esm/atomic-result-list.entry.js +1 -1
- package/dist/esm/atomic-result-placeholder_8.entry.js +4 -4
- package/dist/esm/atomic-result-placeholder_8.entry.js.map +1 -1
- package/dist/esm/atomic-result.entry.js +1 -1
- package/dist/esm/atomic-result.entry.js.map +1 -1
- package/dist/esm/atomic-search-box-instant-results.entry.js +1 -1
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +2 -2
- package/dist/esm/atomic-search-box.entry.js +4 -4
- package/dist/esm/atomic-search-interface.entry.js +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js +2 -2
- package/dist/esm/atomic-smart-snippet-collapse-wrapper_2.entry.js +3 -3
- package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-sort-dropdown.entry.js +2 -2
- package/dist/esm/atomic-sort-expression.entry.js +1 -1
- package/dist/esm/atomic-stencil-facet-date-input.entry.js +3 -3
- package/dist/esm/atomic-suggestion-renderer.entry.js +1 -1
- package/dist/esm/atomic-tab-bar_2.entry.js +1 -1
- package/dist/esm/atomic-tab-button.entry.js +1 -1
- 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/version.js +1 -1
- package/dist/types/components/insight/atomic-insight-interface/atomic-insight-interface.d.ts +35 -42
- package/dist/types/components/insight/index.d.ts +1 -1
- package/dist/types/components.d.ts +4 -113
- package/docs/atomic-docs.json +1 -416
- package/package.json +1 -1
- package/dist/atomic/components/atomic-insight-interface.d.ts +0 -11
- package/dist/atomic/components/atomic-insight-interface.js +0 -332
- package/dist/atomic/components/atomic-insight-interface.js.map +0 -1
- package/dist/atomic/components/insight-layout.js +0 -87
- package/dist/atomic/components/insight-layout.js.map +0 -1
- package/dist/atomic/p-1f5473a6.entry.js +0 -2
- package/dist/atomic/p-217c470c.entry.js +0 -2
- package/dist/atomic/p-217c470c.entry.js.map +0 -1
- package/dist/atomic/p-29919fba.entry.js +0 -2
- package/dist/atomic/p-2caa1859.js +0 -2
- package/dist/atomic/p-2caa1859.js.map +0 -1
- package/dist/atomic/p-412b233b.entry.js +0 -2
- package/dist/atomic/p-412b233b.entry.js.map +0 -1
- package/dist/atomic/p-52121e1e.entry.js +0 -2
- package/dist/atomic/p-64fc4340.entry.js +0 -2
- package/dist/atomic/p-6f7c823d.entry.js +0 -2
- package/dist/atomic/p-8ef0e022.entry.js +0 -2
- package/dist/atomic/p-9d9f201f.entry.js +0 -2
- package/dist/cjs/analytics-config-f2718cd7.js.map +0 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +0 -307
- package/dist/cjs/atomic-insight-interface.cjs.entry.js.map +0 -1
- package/dist/cjs/insight-layout-355a94dd.js +0 -90
- package/dist/cjs/insight-layout-355a94dd.js.map +0 -1
- package/dist/esm/analytics-config-a2ebaf0d.js.map +0 -1
- package/dist/esm/atomic-insight-interface.entry.js +0 -303
- package/dist/esm/atomic-insight-interface.entry.js.map +0 -1
- package/dist/esm/insight-layout-776b87f2.js +0 -87
- package/dist/esm/insight-layout-776b87f2.js.map +0 -1
- /package/dist/atomic/{p-d1d2d945.entry.js.map → p-05a3e5a4.entry.js.map} +0 -0
- /package/dist/atomic/{p-26098930.entry.js.map → p-09953fee.entry.js.map} +0 -0
- /package/dist/atomic/{p-84befe35.entry.js.map → p-0b44ae08.entry.js.map} +0 -0
- /package/dist/atomic/{p-80055cf6.entry.js.map → p-0dac8e7b.entry.js.map} +0 -0
- /package/dist/atomic/{p-5c995d77.entry.js.map → p-0dc6ebf8.entry.js.map} +0 -0
- /package/dist/atomic/{p-ef22a3f2.entry.js.map → p-104c7d84.entry.js.map} +0 -0
- /package/dist/atomic/{p-ce9e510c.entry.js.map → p-117be4a4.entry.js.map} +0 -0
- /package/dist/atomic/{p-cbb819d2.entry.js.map → p-11fc3a7b.entry.js.map} +0 -0
- /package/dist/atomic/{p-b0bd2709.entry.js.map → p-156aa33a.entry.js.map} +0 -0
- /package/dist/atomic/{p-26ad479b.entry.js.map → p-182a3f9e.entry.js.map} +0 -0
- /package/dist/atomic/{p-bfdecd0f.entry.js.map → p-1d8eba10.entry.js.map} +0 -0
- /package/dist/atomic/{p-58610952.entry.js.map → p-24c2110b.entry.js.map} +0 -0
- /package/dist/atomic/{p-52121e1e.entry.js.map → p-256b5495.entry.js.map} +0 -0
- /package/dist/atomic/{p-571c9614.entry.js.map → p-2c64e9a2.entry.js.map} +0 -0
- /package/dist/atomic/{p-6ad1adfb.entry.js.map → p-31e55d26.entry.js.map} +0 -0
- /package/dist/atomic/{p-069bf2b9.entry.js.map → p-39698267.entry.js.map} +0 -0
- /package/dist/atomic/{p-c9fa8526.entry.js.map → p-3a994997.entry.js.map} +0 -0
- /package/dist/atomic/{p-1c3363ec.entry.js.map → p-3c7ed752.entry.js.map} +0 -0
- /package/dist/atomic/{p-5027d796.entry.js.map → p-3e7ea7a5.entry.js.map} +0 -0
- /package/dist/atomic/{p-ab627e18.entry.js.map → p-429270f6.entry.js.map} +0 -0
- /package/dist/atomic/{p-737f842d.entry.js.map → p-43a0f6e2.entry.js.map} +0 -0
- /package/dist/atomic/{p-8b70f39a.entry.js.map → p-455fbbd7.entry.js.map} +0 -0
- /package/dist/atomic/{p-b97abfb9.entry.js.map → p-45e88039.entry.js.map} +0 -0
- /package/dist/atomic/{p-c61609ea.entry.js.map → p-52b66ca8.entry.js.map} +0 -0
- /package/dist/atomic/{p-8ef0e022.entry.js.map → p-564be2a3.entry.js.map} +0 -0
- /package/dist/atomic/{p-09924944.entry.js.map → p-681610d3.entry.js.map} +0 -0
- /package/dist/atomic/{p-2e91aea8.entry.js.map → p-6b297a61.entry.js.map} +0 -0
- /package/dist/atomic/{p-1c2d25ba.entry.js.map → p-6bea42e6.entry.js.map} +0 -0
- /package/dist/atomic/{p-b103b28a.entry.js.map → p-70c431f9.entry.js.map} +0 -0
- /package/dist/atomic/{p-a14fd4de.entry.js.map → p-770da48e.entry.js.map} +0 -0
- /package/dist/atomic/{p-a3a1f8e9.entry.js.map → p-7753ae27.entry.js.map} +0 -0
- /package/dist/atomic/{p-612155f0.entry.js.map → p-7bff27b2.entry.js.map} +0 -0
- /package/dist/atomic/{p-0368a213.entry.js.map → p-81b6d12c.entry.js.map} +0 -0
- /package/dist/atomic/{p-1a79c944.entry.js.map → p-842d31d0.entry.js.map} +0 -0
- /package/dist/atomic/{p-4c7654eb.entry.js.map → p-87747240.entry.js.map} +0 -0
- /package/dist/atomic/{p-258c3253.entry.js.map → p-8b8eb35f.entry.js.map} +0 -0
- /package/dist/atomic/{p-df2df66a.entry.js.map → p-8baf4780.entry.js.map} +0 -0
- /package/dist/atomic/{p-82a8cf74.entry.js.map → p-943b29c2.entry.js.map} +0 -0
- /package/dist/atomic/{p-05ab5909.entry.js.map → p-9507e1bc.entry.js.map} +0 -0
- /package/dist/atomic/{p-aa40956c.entry.js.map → p-971a8a73.entry.js.map} +0 -0
- /package/dist/atomic/{p-552d1f66.entry.js.map → p-a0d04767.entry.js.map} +0 -0
- /package/dist/atomic/{p-c667812c.entry.js.map → p-a5751bb0.entry.js.map} +0 -0
- /package/dist/atomic/{p-fc6beee6.entry.js.map → p-af487ad9.entry.js.map} +0 -0
- /package/dist/atomic/{p-1d091f9a.entry.js.map → p-b1c9b043.entry.js.map} +0 -0
- /package/dist/atomic/{p-516b5bd4.entry.js.map → p-ba9b2923.entry.js.map} +0 -0
- /package/dist/atomic/{p-2d3ef0f7.entry.js.map → p-bbed84f9.entry.js.map} +0 -0
- /package/dist/atomic/{p-5138d839.entry.js.map → p-bfb23490.entry.js.map} +0 -0
- /package/dist/atomic/{p-57b47b73.entry.js.map → p-c15fc656.entry.js.map} +0 -0
- /package/dist/atomic/{p-896724e9.entry.js.map → p-c1721cb2.entry.js.map} +0 -0
- /package/dist/atomic/{p-875583aa.entry.js.map → p-c434b50f.entry.js.map} +0 -0
- /package/dist/atomic/{p-cb051c21.entry.js.map → p-c572a219.entry.js.map} +0 -0
- /package/dist/atomic/{p-15d952f3.entry.js.map → p-c69ae97a.entry.js.map} +0 -0
- /package/dist/atomic/{p-88e4a2f9.entry.js.map → p-c81d1971.entry.js.map} +0 -0
- /package/dist/atomic/{p-633628d5.entry.js.map → p-cbeca949.entry.js.map} +0 -0
- /package/dist/atomic/{p-b7f38541.entry.js.map → p-cc330153.entry.js.map} +0 -0
- /package/dist/atomic/{p-0c9b553c.entry.js.map → p-cd8f11ea.entry.js.map} +0 -0
- /package/dist/atomic/{p-d5071b5a.entry.js.map → p-d1caf040.entry.js.map} +0 -0
- /package/dist/atomic/{p-496da1c9.entry.js.map → p-d1e5e2d7.entry.js.map} +0 -0
- /package/dist/atomic/{p-b16950ec.entry.js.map → p-d3146795.entry.js.map} +0 -0
- /package/dist/atomic/{p-f39de057.entry.js.map → p-d3b5c8e5.entry.js.map} +0 -0
- /package/dist/atomic/{p-aff3a66a.entry.js.map → p-d6d0a47f.entry.js.map} +0 -0
- /package/dist/atomic/{p-b328cab9.entry.js.map → p-db6034e2.entry.js.map} +0 -0
- /package/dist/atomic/{p-3af5e810.entry.js.map → p-e20c18f0.entry.js.map} +0 -0
- /package/dist/atomic/{p-79499898.entry.js.map → p-e50b1d73.entry.js.map} +0 -0
- /package/dist/atomic/{p-c3746d6e.entry.js.map → p-e67dabc9.entry.js.map} +0 -0
- /package/dist/atomic/{p-a2714d7e.entry.js.map → p-e9922d7c.entry.js.map} +0 -0
- /package/dist/atomic/{p-13e67ab3.entry.js.map → p-f076efa7.entry.js.map} +0 -0
- /package/dist/atomic/{p-a7dcf131.entry.js.map → p-f30c4c7d.entry.js.map} +0 -0
- /package/dist/atomic/{p-50467793.entry.js.map → p-f45a7b82.entry.js.map} +0 -0
- /package/dist/atomic/{p-2c7d4967.entry.js.map → p-f79f31f8.entry.js.map} +0 -0
- /package/dist/atomic/{p-cdd70f49.entry.js.map → p-fa1dcc3e.entry.js.map} +0 -0
- /package/dist/atomic/{p-e750df14.entry.js.map → p-fce653a1.entry.js.map} +0 -0
- /package/dist/atomic/{p-ce83d873.entry.js.map → p-fe23b0b3.entry.js.map} +0 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { VERSION as HEADLESS_VERSION } from '@coveo/headless'; // TODO - KIT-4886 import from @coveo/headless/insight
|
|
8
|
+
import { buildInsightEngine, buildResultsPerPage as buildInsightResultsPerPage, loadFieldActions, } from '@coveo/headless/insight';
|
|
9
|
+
import { provide } from '@lit/context';
|
|
10
|
+
import i18next from 'i18next';
|
|
11
|
+
import { css, html, LitElement } from 'lit';
|
|
12
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
13
|
+
import { InterfaceController, } from "../../common/interface/interface-controller";
|
|
14
|
+
import { bindingsContext } from "../../context/bindings-context";
|
|
15
|
+
import { booleanConverter } from "../../../converters/boolean-converter";
|
|
16
|
+
import { errorGuard } from "../../../decorators/error-guard";
|
|
17
|
+
import { watch } from "../../../decorators/watch";
|
|
18
|
+
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
|
|
19
|
+
import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-complete-mixin";
|
|
20
|
+
import { markParentAsReady } from "../../../utils/init-queue";
|
|
21
|
+
import { getAnalyticsConfig } from './analytics-config.js';
|
|
22
|
+
import { createInsightStore } from './store.js';
|
|
23
|
+
const FirstInsightRequestExecutedFlag = 'firstInsightRequestExecuted';
|
|
24
|
+
/**
|
|
25
|
+
* The `atomic-insight-interface` component is the parent to all other atomic insight components in an insight page.
|
|
26
|
+
* It handles the headless insight engine and localization configurations.
|
|
27
|
+
*
|
|
28
|
+
* @slot default - The default slot where you can add child components to the interface.
|
|
29
|
+
* @slot full-search - A slot for components that should be positioned absolutely in the top-right corner.
|
|
30
|
+
*/
|
|
31
|
+
let AtomicInsightInterface = class AtomicInsightInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
this.initialized = false;
|
|
35
|
+
this.interfaceController = new InterfaceController(this, 'CoveoAtomic', HEADLESS_VERSION);
|
|
36
|
+
/**
|
|
37
|
+
* Whether analytics should be enabled.
|
|
38
|
+
*/
|
|
39
|
+
this.analytics = true;
|
|
40
|
+
/**
|
|
41
|
+
* The service insight interface language.
|
|
42
|
+
*/
|
|
43
|
+
this.language = 'en';
|
|
44
|
+
/**
|
|
45
|
+
* The language assets path. By default, this will be a relative URL pointing to `./lang`.
|
|
46
|
+
*
|
|
47
|
+
* Example: "/mypublicpath/languages"
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
this.languageAssetsPath = './lang';
|
|
51
|
+
/**
|
|
52
|
+
* The icon assets path. By default, this will be a relative URL pointing to `./assets`.
|
|
53
|
+
*
|
|
54
|
+
* Example: "/mypublicpath/icons"
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
this.iconAssetsPath = './assets';
|
|
58
|
+
/**
|
|
59
|
+
* A list of non-default fields to include in the query results.
|
|
60
|
+
*
|
|
61
|
+
* Specify the property as an array using a JSON string representation:
|
|
62
|
+
* ```html
|
|
63
|
+
* <atomic-insight-interface fields-to-include='["fieldA", "fieldB"]'></atomic-insight-interface>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
this.fieldsToInclude = [];
|
|
67
|
+
/**
|
|
68
|
+
* The number of results per page. By default, this is set to `5`.
|
|
69
|
+
*/
|
|
70
|
+
this.resultsPerPage = 5;
|
|
71
|
+
this.handleInitialization = (event) => {
|
|
72
|
+
this.interfaceController.onComponentInitializing(event);
|
|
73
|
+
};
|
|
74
|
+
this.bindings = {};
|
|
75
|
+
this.store = createInsightStore();
|
|
76
|
+
const { promise, resolve } = Promise.withResolvers();
|
|
77
|
+
this.i18Initialized = promise;
|
|
78
|
+
this.i18n = i18next.createInstance(undefined, resolve);
|
|
79
|
+
}
|
|
80
|
+
connectedCallback() {
|
|
81
|
+
super.connectedCallback();
|
|
82
|
+
this.store.setLoadingFlag(FirstInsightRequestExecutedFlag);
|
|
83
|
+
this.addEventListener('atomic/initializeComponent', this.handleInitialization);
|
|
84
|
+
}
|
|
85
|
+
disconnectedCallback() {
|
|
86
|
+
super.disconnectedCallback();
|
|
87
|
+
this.removeEventListener('atomic/initializeComponent', this.handleInitialization);
|
|
88
|
+
}
|
|
89
|
+
toggleAnalytics() {
|
|
90
|
+
this.interfaceController.onAnalyticsChange();
|
|
91
|
+
}
|
|
92
|
+
updateLanguage() {
|
|
93
|
+
return this.interfaceController.onLanguageChange();
|
|
94
|
+
}
|
|
95
|
+
updateIconAssetsPath() {
|
|
96
|
+
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
97
|
+
}
|
|
98
|
+
initResultsPerPage() {
|
|
99
|
+
if (!this.interfaceController.engineIsCreated(this.engine)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
buildInsightResultsPerPage(this.bindings.engine, {
|
|
103
|
+
initialState: { numberOfResults: this.resultsPerPage },
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
registerFieldsToInclude() {
|
|
107
|
+
if (this.fieldsToInclude.length) {
|
|
108
|
+
this.engine.dispatch(loadFieldActions(this.engine).registerFieldsToInclude([
|
|
109
|
+
...this.fieldsToInclude,
|
|
110
|
+
]));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Initializes the connection with the headless insight engine using options for `accessToken` (required), `organizationId` (required), `environment` (defaults to `prod`), and `renewAccessToken`.
|
|
115
|
+
*/
|
|
116
|
+
initialize(options) {
|
|
117
|
+
return this.internalInitialization(() => this.initEngine(options));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Initializes the connection with an already preconfigured headless insight engine.
|
|
121
|
+
*/
|
|
122
|
+
initializeWithInsightEngine(engine) {
|
|
123
|
+
return this.internalInitialization(() => {
|
|
124
|
+
this.engine = engine;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Executes the first search and logs the interface load event to analytics, after initializing connection to the headless search engine.
|
|
129
|
+
*/
|
|
130
|
+
async executeFirstSearch() {
|
|
131
|
+
if (!this.interfaceController.engineIsCreated(this.engine)) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (!this.initialized) {
|
|
135
|
+
console.error('You have to wait until the "initialize" promise is fulfilled before executing a search.', this);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.engine.executeFirstSearch();
|
|
139
|
+
}
|
|
140
|
+
async internalInitialization(initEngine) {
|
|
141
|
+
await Promise.all([
|
|
142
|
+
this.interfaceController.onInitialization(initEngine),
|
|
143
|
+
this.i18Initialized,
|
|
144
|
+
]);
|
|
145
|
+
this.updateLanguage();
|
|
146
|
+
this.bindings = this.getBindings();
|
|
147
|
+
markParentAsReady(this);
|
|
148
|
+
this.initResultsPerPage();
|
|
149
|
+
this.registerFieldsToInclude();
|
|
150
|
+
this.store.unsetLoadingFlag(FirstInsightRequestExecutedFlag);
|
|
151
|
+
await this.getUpdateComplete();
|
|
152
|
+
this.initialized = true;
|
|
153
|
+
}
|
|
154
|
+
getBindings() {
|
|
155
|
+
return {
|
|
156
|
+
engine: this.engine,
|
|
157
|
+
i18n: this.i18n,
|
|
158
|
+
store: this.store,
|
|
159
|
+
interfaceElement: this,
|
|
160
|
+
// TODO - KIT-4839: Remove once atomic-insight-layout migration is complete.
|
|
161
|
+
createStyleElement: () => {
|
|
162
|
+
const styleTag = document.createElement('style');
|
|
163
|
+
return styleTag;
|
|
164
|
+
},
|
|
165
|
+
// TODO - KIT-4839: Remove once atomic-insight-layout migration is complete.
|
|
166
|
+
createScriptElement: () => {
|
|
167
|
+
const scriptTag = document.createElement('script');
|
|
168
|
+
return scriptTag;
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
initEngine(options) {
|
|
173
|
+
const analyticsConfig = getAnalyticsConfig(options, this.analytics);
|
|
174
|
+
try {
|
|
175
|
+
this.engine = buildInsightEngine({
|
|
176
|
+
configuration: {
|
|
177
|
+
...options,
|
|
178
|
+
analytics: analyticsConfig,
|
|
179
|
+
},
|
|
180
|
+
loggerOptions: {
|
|
181
|
+
level: this.logLevel,
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
this.error = error;
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
render() {
|
|
191
|
+
return html `
|
|
192
|
+
<slot name="full-search"></slot>
|
|
193
|
+
<slot></slot>
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
AtomicInsightInterface.styles = css`:host{position:relative}slot[name=full-search]{display:block;position:absolute;top:0;right:0}`;
|
|
198
|
+
__decorate([
|
|
199
|
+
state()
|
|
200
|
+
], AtomicInsightInterface.prototype, "error", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
property({ type: Object })
|
|
203
|
+
], AtomicInsightInterface.prototype, "engine", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
property({
|
|
206
|
+
type: Boolean,
|
|
207
|
+
converter: booleanConverter,
|
|
208
|
+
reflect: true,
|
|
209
|
+
})
|
|
210
|
+
], AtomicInsightInterface.prototype, "analytics", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
property({ type: Object })
|
|
213
|
+
], AtomicInsightInterface.prototype, "i18n", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
property({ type: String, attribute: 'log-level', reflect: true })
|
|
216
|
+
], AtomicInsightInterface.prototype, "logLevel", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property({ type: String, attribute: 'language', reflect: true })
|
|
219
|
+
], AtomicInsightInterface.prototype, "language", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: String, attribute: 'language-assets-path', reflect: true })
|
|
222
|
+
], AtomicInsightInterface.prototype, "languageAssetsPath", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: String, attribute: 'icon-assets-path', reflect: true })
|
|
225
|
+
], AtomicInsightInterface.prototype, "iconAssetsPath", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: Array, attribute: 'fields-to-include' })
|
|
228
|
+
], AtomicInsightInterface.prototype, "fieldsToInclude", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Number, attribute: 'results-per-page', reflect: true })
|
|
231
|
+
], AtomicInsightInterface.prototype, "resultsPerPage", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
watch('analytics')
|
|
234
|
+
], AtomicInsightInterface.prototype, "toggleAnalytics", null);
|
|
235
|
+
__decorate([
|
|
236
|
+
watch('language')
|
|
237
|
+
], AtomicInsightInterface.prototype, "updateLanguage", null);
|
|
238
|
+
__decorate([
|
|
239
|
+
watch('iconAssetsPath')
|
|
240
|
+
], AtomicInsightInterface.prototype, "updateIconAssetsPath", null);
|
|
241
|
+
__decorate([
|
|
242
|
+
state(),
|
|
243
|
+
provide({ context: bindingsContext })
|
|
244
|
+
], AtomicInsightInterface.prototype, "bindings", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
errorGuard()
|
|
247
|
+
], AtomicInsightInterface.prototype, "render", null);
|
|
248
|
+
AtomicInsightInterface = __decorate([
|
|
249
|
+
customElement('atomic-insight-interface'),
|
|
250
|
+
withTailwindStyles
|
|
251
|
+
], AtomicInsightInterface);
|
|
252
|
+
export { AtomicInsightInterface };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
// Auto-generated file
|
|
2
|
+
export { AtomicInsightInterface } from './atomic-insight-interface/atomic-insight-interface.js';
|
|
@@ -42,11 +42,11 @@ const FacetNumberInput = /*@__PURE__*/ proxyCustomElement(class FacetNumberInput
|
|
|
42
42
|
const inputClasses = 'p-2.5 input-primary placeholder-neutral-dark min-w-0 mr-1';
|
|
43
43
|
const labelClasses = 'text-neutral-dark text-sm';
|
|
44
44
|
const step = this.type === 'integer' ? '1' : 'any';
|
|
45
|
-
return (h("form", { key: '
|
|
45
|
+
return (h("form", { key: '0406137b757fd80da0c1003275fe4d85b1989d40', class: "mt-4 gap-y-0.5 px-2", part: "input-form", onSubmit: (e) => {
|
|
46
46
|
e.preventDefault();
|
|
47
47
|
this.apply();
|
|
48
48
|
return false;
|
|
49
|
-
} }, h("label", { key: '
|
|
49
|
+
} }, h("label", { key: '5f6edbdcdcb7b47a0e762bcd635d0ed19ee0b31d', part: "label-start", class: labelClasses, htmlFor: `${this.filterState.facetId}_start` }, minText), h("input", { key: '433ec768234b052b43cf54b7178c023d42ebb6d2', part: "input-start", id: `${this.filterState.facetId}_start`, type: "number", step: step, ref: (ref) => (this.startRef = ref), class: inputClasses, "aria-label": minAria, required: true, min: Number.MIN_SAFE_INTEGER, max: this.end, value: this.filterState.range?.start, onInput: (e) => (this.start = e.target.valueAsNumber) }), h("label", { key: 'ee812a7d94ced36e18dbfc48708521cd7749f4ce', part: "label-end", class: labelClasses, htmlFor: `${this.filterState.facetId}_end` }, maxText), h("input", { key: '3b108ec9fcf5c27ea4d842ba1562cde73f243c43', part: "input-end", id: `${this.filterState.facetId}_end`, type: "number", step: step, ref: (ref) => (this.endRef = ref), class: inputClasses, "aria-label": maxAria, required: true, min: this.start, max: Number.MAX_SAFE_INTEGER, value: this.filterState.range?.end, onInput: (e) => (this.end = e.target.valueAsNumber) }), h(Button, { key: '858b1dddb7ba6d7d921eab781825382a05760526', style: "outline-primary", type: "submit", part: "input-apply-button", class: "flex-none truncate p-2.5", ariaLabel: applyAria, text: apply })));
|
|
50
50
|
}
|
|
51
51
|
static get style() { return AtomicFacetNumberInputStyle0; }
|
|
52
52
|
}, [0, "atomic-facet-number-input", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCjCa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\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 product template components.\n * This allows the Stencil component to fetch the current product from its rendered parent, the `atomic-product` component.\n *\n * Example:\n * ```\n * @ProductContext() private product!: Product;\n * ```\n *\n * For more information and examples, view the [Utilities section](https://github.com/coveo/ui-kit/tree/master/packages/atomic#utilities) of the Coveo Atomic README.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `createProductContextController` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function ProductContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-product', folded: opts.folded});\n}\n\nexport function InteractiveProductContext() {\n return InteractiveItemContext();\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
|
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCjCa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\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 product template components.\n * This allows the Stencil component to fetch the current product from its rendered parent, the `atomic-product` component.\n *\n * Example:\n * ```\n * @ProductContext() private product!: Product;\n * ```\n *\n * For more information and examples, view the [Utilities section](https://github.com/coveo/ui-kit/tree/master/packages/atomic#utilities) of the Coveo Atomic README.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `createProductContextController` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function ProductContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-product', folded: opts.folded});\n}\n\nexport function InteractiveProductContext() {\n return InteractiveItemContext();\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
|
|
@@ -25,7 +25,7 @@ const AtomicTabButton = /*@__PURE__*/ proxyCustomElement(class AtomicTabButton e
|
|
|
25
25
|
return this.active ? '' : 'text-neutral-dark hover:text-primary-light';
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: '36d89d7d005ea647c5a9a101afe9e6155142b346', role: "listitem", class: `${this.activeTabClass}`, "aria-current": this.active ? 'true' : 'false', "aria-label": 'tab for ' + this.label, part: 'button-container' + (this.active ? '-active' : '') }, h(Button, { key: '5ecddd1784342807e03c884ef189be4dfd3dd2e1', class: `w-full truncate px-2 pb-1 text-xl sm:px-6 ${this.activeTabTextClass}`, part: 'tab-button' + (this.active ? '-active' : ''), onClick: this.select, style: "text-transparent" }, this.label)));
|
|
29
29
|
}
|
|
30
30
|
static get style() { return AtomicTabButtonStyle0; }
|
|
31
31
|
}, [0, "atomic-tab-button", {
|
|
@@ -144,7 +144,7 @@ const TabPopover = /*@__PURE__*/ proxyCustomElement(class TabPopover extends HTM
|
|
|
144
144
|
this.popperInstance?.forceUpdate();
|
|
145
145
|
}
|
|
146
146
|
render() {
|
|
147
|
-
return (h(Host, { key: '
|
|
147
|
+
return (h(Host, { key: '05df5ce2d98644088151efdcfbf778a130495fee', onFocusout: (event) => this.closePopoverOnFocusOut(event), class: this.show ? '' : 'visibility-hidden', "aria-hidden": !this.show }, this.renderPopover(), this.isOpen && this.renderBackdrop()));
|
|
148
148
|
}
|
|
149
149
|
get host() { return this; }
|
|
150
150
|
static get style() { return AtomicTabPopoverStyle0; }
|