@coveo/atomic 3.34.0-pre.4a147a2f19 → 3.34.0-pre.4aac7c5056
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 -4
- package/dist/atomic/components/_index.js +0 -2
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-category-facet.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-insight-history-toggle.js +2 -2
- package/dist/atomic/components/atomic-insight-history-toggle.js.map +1 -1
- package/dist/atomic/components/atomic-insight-user-actions-toggle.js +2 -2
- package/dist/atomic/components/atomic-insight-user-actions-toggle.js.map +1 -1
- package/dist/atomic/components/atomic-ipx-result-link.js +3 -3
- package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
- package/dist/{esm/sections-ae00b53a.js → atomic/components/atomic-layout-section-utils.js} +1 -1
- package/dist/atomic/components/atomic-layout-section-utils.js.map +1 -0
- package/dist/atomic/components/atomic-numeric-facet.js +1 -1
- package/dist/atomic/components/atomic-quickview-modal2.js +23 -23
- package/dist/atomic/components/atomic-quickview-modal2.js.map +1 -1
- package/dist/atomic/components/atomic-quickview.js +1 -1
- package/dist/atomic/components/atomic-refine-modal2.js +2 -2
- package/dist/atomic/components/atomic-refine-modal2.js.map +1 -1
- 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 +3 -3
- package/dist/atomic/components/atomic-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-result-list.js +1 -1
- package/dist/atomic/components/atomic-result-table-placeholder2.js +1 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +1 -1
- package/dist/atomic/components/atomic-search-box.js +7 -13
- 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-sort-dropdown.js +2 -2
- package/dist/atomic/components/atomic-sort-expression.js +1 -1
- package/dist/atomic/components/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/attributes-slot.js +3 -8
- package/dist/atomic/components/attributes-slot.js.map +1 -1
- package/dist/atomic/components/clock.js +2 -2
- package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +17 -32
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +3 -6
- package/dist/atomic/components/components/commerce/atomic-product/atomic-product.js +26 -58
- package/dist/atomic/components/components/common/atomic-layout-section/layout.js +1 -1
- package/dist/atomic/components/components/common/item-link/attributes-slot.js +3 -8
- package/dist/atomic/components/components/common/layout/custom-render-controller.js +37 -0
- package/dist/atomic/components/components/common/layout/display-options.js +1 -1
- package/dist/atomic/components/components/common/layout/item-layout-controller.js +103 -0
- package/dist/atomic/components/components/common/layout/{sections.js → item-layout-sections.js} +1 -1
- package/dist/atomic/components/components/common/product-template/product-template-common.js +1 -1
- package/dist/atomic/components/components/common/validate-props-controller/validate-props-controller.js +50 -0
- package/dist/atomic/components/components/insight/atomic-insight-layout/insight-layout.js +1 -1
- package/dist/atomic/components/components/search/atomic-relevance-inspector/atomic-relevance-inspector.js +100 -0
- package/dist/atomic/components/components/search/atomic-search-box-recent-queries/atomic-search-box-recent-queries.js +137 -0
- package/dist/atomic/components/components/search/atomic-search-interface/atomic-search-interface.js +17 -24
- package/dist/atomic/components/components/search/index.js +2 -0
- package/dist/atomic/components/components/search/lazy-index.js +2 -0
- package/dist/atomic/components/display-options.js +1 -1
- package/dist/atomic/components/display-options.js.map +1 -1
- package/dist/atomic/components/generated-answer-common.js +3 -2
- package/dist/atomic/components/generated-answer-common.js.map +1 -1
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/insight-layout.js +1 -1
- package/dist/atomic/components/insight-layout.js.map +1 -1
- package/dist/atomic/components/{sections2.js → item-layout-sections.js} +1 -1
- package/dist/atomic/components/item-layout-sections.js.map +1 -0
- package/dist/atomic/components/result-template-common.js +1 -1
- package/dist/atomic/components/result-template-common.js.map +1 -1
- package/dist/atomic/components/slot-utils.js +23 -6
- package/dist/atomic/components/slot-utils.js.map +1 -1
- package/dist/atomic/components/utils/compare-utils.js +49 -0
- package/dist/atomic/components/utils/slot-utils.js +22 -5
- package/dist/atomic/{p-06349e36.entry.js → p-01511388.entry.js} +2 -2
- package/dist/atomic/p-01511388.entry.js.map +1 -0
- package/dist/atomic/{p-2caa1859.js → p-0e62bdd6.js} +2 -2
- package/dist/atomic/p-0e62bdd6.js.map +1 -0
- package/dist/atomic/{p-60800b2f.entry.js → p-0ed76e65.entry.js} +2 -2
- package/dist/atomic/{p-5f706e3d.entry.js → p-170c7da6.entry.js} +2 -2
- package/dist/atomic/p-1891bbcf.js +2 -0
- package/dist/atomic/p-1891bbcf.js.map +1 -0
- package/dist/atomic/{p-3857d6a3.entry.js → p-1bbaf206.entry.js} +2 -2
- package/dist/atomic/{p-4723ffa5.entry.js → p-20b33c18.entry.js} +2 -2
- package/dist/atomic/{p-6d52fad7.js → p-20cbcfb9.js} +2 -2
- package/dist/atomic/p-20cbcfb9.js.map +1 -0
- package/dist/atomic/{p-7709fba4.js → p-2250f505.js} +2 -2
- package/dist/atomic/p-2250f505.js.map +1 -0
- package/dist/atomic/{p-0aec5665.entry.js → p-2e4628bb.entry.js} +2 -2
- package/dist/atomic/p-2e4628bb.entry.js.map +1 -0
- package/dist/atomic/{p-16f6c1f3.entry.js → p-2fb49fe8.entry.js} +2 -2
- package/dist/atomic/{p-13391e75.entry.js → p-3549a469.entry.js} +2 -2
- package/dist/atomic/{p-bd3542d2.entry.js → p-36112c34.entry.js} +2 -2
- package/dist/atomic/p-36112c34.entry.js.map +1 -0
- package/dist/atomic/{p-d6e04719.entry.js → p-373448df.entry.js} +2 -2
- package/dist/atomic/{p-88af4470.entry.js → p-40c1dfcb.entry.js} +2 -2
- package/dist/atomic/{p-875fc491.entry.js → p-45159342.entry.js} +2 -2
- package/dist/atomic/{p-b2f5f6cb.entry.js → p-47ab6c9f.entry.js} +2 -2
- package/dist/atomic/{p-7c3c5f07.entry.js → p-4f4c9a03.entry.js} +2 -2
- package/dist/atomic/p-4f4c9a03.entry.js.map +1 -0
- package/dist/atomic/{p-20764605.entry.js → p-52d5461a.entry.js} +2 -2
- package/dist/atomic/{p-2925bd87.entry.js → p-59b15bd6.entry.js} +2 -2
- package/dist/atomic/{p-406a288c.entry.js → p-6078667f.entry.js} +2 -2
- package/dist/atomic/p-62e85c20.entry.js +2 -0
- package/dist/atomic/p-6f1bffa2.entry.js +2 -0
- package/dist/atomic/p-6f1bffa2.entry.js.map +1 -0
- package/dist/atomic/{p-93da1f4e.entry.js → p-6f34dd3a.entry.js} +2 -2
- package/dist/atomic/{p-0c0b8d41.entry.js → p-768b172e.entry.js} +2 -2
- package/dist/atomic/{p-3cbab25b.entry.js → p-7e971d15.entry.js} +2 -2
- package/dist/atomic/{p-a4d277c7.entry.js → p-7fd5b6ac.entry.js} +2 -2
- package/dist/atomic/{p-644f71e2.entry.js → p-83d3857f.entry.js} +2 -2
- package/dist/atomic/p-83d3857f.entry.js.map +1 -0
- package/dist/atomic/{p-36ab8440.js → p-87a6faea.js} +2 -2
- package/dist/atomic/{p-dbcef3a9.entry.js → p-87f69e53.entry.js} +2 -2
- package/dist/atomic/{p-6289adc7.entry.js → p-9239be63.entry.js} +2 -2
- package/dist/atomic/{p-f71b14b2.entry.js → p-9260dd7d.entry.js} +2 -2
- package/dist/atomic/{p-ed8e5c4d.entry.js → p-98dd6df1.entry.js} +2 -2
- package/dist/atomic/{p-86bde026.entry.js → p-9a6ec803.entry.js} +2 -2
- package/dist/atomic/{p-0b5efb51.entry.js → p-a1e5f767.entry.js} +2 -2
- package/dist/atomic/{p-1db20a4a.entry.js → p-a5f66ecd.entry.js} +2 -2
- package/dist/atomic/{p-7ec6dd3e.entry.js → p-af1b4924.entry.js} +2 -2
- package/dist/atomic/{p-e398835b.entry.js → p-b2b9e83f.entry.js} +2 -2
- package/dist/atomic/p-b309aadd.js +2 -0
- package/dist/atomic/p-b309aadd.js.map +1 -0
- package/dist/atomic/{p-8fdef8a3.entry.js → p-b313058c.entry.js} +2 -2
- package/dist/atomic/{p-0bdd730f.entry.js → p-b6ae0244.entry.js} +2 -2
- package/dist/atomic/{p-3a7a1a00.entry.js → p-bbfe727a.entry.js} +2 -2
- package/dist/atomic/{p-97ce3384.entry.js → p-be2a43f4.entry.js} +2 -2
- package/dist/atomic/{p-e01d5fdd.entry.js → p-c25f1437.entry.js} +2 -2
- package/dist/atomic/{p-577d34ba.entry.js → p-c4fb6426.entry.js} +2 -2
- package/dist/atomic/{p-55211c25.entry.js → p-cafa4083.entry.js} +2 -2
- package/dist/atomic/{p-4701feae.entry.js → p-cb3fd0f4.entry.js} +2 -2
- package/dist/atomic/{p-9c7dbbdf.js → p-cc2b2231.js} +1 -1
- package/dist/atomic/p-cc2b2231.js.map +1 -0
- package/dist/atomic/{p-f11c8293.entry.js → p-ce5b896e.entry.js} +2 -2
- package/dist/atomic/{p-a5714bc4.entry.js → p-d211a422.entry.js} +2 -2
- package/dist/atomic/{p-9faad55b.entry.js → p-dc128135.entry.js} +2 -2
- package/dist/atomic/{p-97748161.js → p-dc28ee14.js} +1 -1
- package/dist/{esm/sections-d787040b.js.map → atomic/p-dc28ee14.js.map} +1 -1
- package/dist/atomic/{p-c280cd05.js → p-e1cc5150.js} +1 -1
- package/dist/atomic/{p-27b8404c.js → p-e62fc40e.js} +2 -2
- package/dist/atomic/p-e62fc40e.js.map +1 -0
- package/dist/atomic/{p-d1795580.entry.js → p-e7a25b00.entry.js} +2 -2
- package/dist/atomic/{p-7f977dca.entry.js → p-f76b7ac3.entry.js} +2 -2
- package/dist/atomic/{p-e3af2029.entry.js → p-f956cadf.entry.js} +2 -2
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-66bd2ca7.js → analytics-config-f093753d.js} +2 -2
- package/dist/cjs/{analytics-config-66bd2ca7.js.map → analytics-config-f093753d.js.map} +1 -1
- package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
- package/dist/cjs/atomic-folded-result-list.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.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-layout.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-result-list.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-result-template.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-result.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-smart-snippet-suggestions.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-smart-snippet.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js +2 -2
- 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/{sections-4b4af2f8.js → atomic-layout-section-utils-08b4fbcd.js} +1 -1
- package/dist/cjs/atomic-layout-section-utils-08b4fbcd.js.map +1 -0
- package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js +23 -23
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-quickview.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-list.cjs.entry.js +2 -2
- package/dist/cjs/atomic-recs-result-template.cjs.entry.js +2 -2
- package/dist/cjs/atomic-recs-result.cjs.entry.js +2 -2
- package/dist/cjs/atomic-refine-modal.cjs.entry.js +4 -4
- package/dist/cjs/atomic-refine-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-children-template.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 +4 -4
- package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-list.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-placeholder_8.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-template.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result.cjs.entry.js +2 -2
- package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js +76 -0
- package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js.map +1 -0
- package/dist/cjs/atomic-search-box.cjs.entry.js +5 -5
- package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-smart-snippet-suggestions.cjs.entry.js +2 -2
- package/dist/cjs/atomic-smart-snippet.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-tab-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/{attributes-slot-afccc1fd.js → attributes-slot-4e7d7a75.js} +4 -9
- package/dist/cjs/attributes-slot-4e7d7a75.js.map +1 -0
- package/dist/cjs/clock-7aeb19d0.js +7 -0
- package/dist/cjs/clock-7aeb19d0.js.map +1 -0
- package/dist/cjs/{display-options-14f05862.js → display-options-69531e8d.js} +4 -4
- package/dist/cjs/display-options-69531e8d.js.map +1 -0
- package/dist/cjs/{generated-answer-common-57443e50.js → generated-answer-common-3c400311.js} +4 -3
- package/dist/cjs/generated-answer-common-3c400311.js.map +1 -0
- package/dist/cjs/index-757bc886.js +2 -6
- package/dist/cjs/{insight-layout-355a94dd.js → insight-layout-b6ff92fd.js} +11 -11
- package/dist/cjs/insight-layout-b6ff92fd.js.map +1 -0
- package/dist/cjs/{sections-fbb93b53.js → item-layout-sections-b09ba4b3.js} +1 -1
- package/dist/cjs/item-layout-sections-b09ba4b3.js.map +1 -0
- package/dist/cjs/{result-template-common-88359dad.js → result-template-common-84bd4057.js} +3 -3
- package/dist/cjs/result-template-common-84bd4057.js.map +1 -0
- package/dist/cjs/slot-utils-a30cb814.js +40 -0
- package/dist/cjs/slot-utils-a30cb814.js.map +1 -0
- package/dist/cjs/version.cjs.js +2 -2
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-d050ec34.js → analytics-config-3ce26b8b.js} +2 -2
- package/dist/esm/{analytics-config-d050ec34.js.map → analytics-config-3ce26b8b.js.map} +1 -1
- package/dist/esm/atomic-category-facet.entry.js +1 -1
- package/dist/esm/atomic-facet.entry.js +1 -1
- package/dist/esm/atomic-field-condition.entry.js +2 -2
- package/dist/esm/atomic-folded-result-list.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.entry.js +2 -2
- package/dist/esm/atomic-insight-folded-result-list.entry.js +2 -2
- package/dist/esm/atomic-insight-generated-answer.entry.js +2 -2
- package/dist/esm/atomic-insight-history-toggle.entry.js +2 -2
- package/dist/esm/atomic-insight-history-toggle.entry.js.map +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +3 -3
- package/dist/esm/atomic-insight-layout.entry.js +2 -2
- package/dist/esm/atomic-insight-result-children-template.entry.js +2 -2
- package/dist/esm/atomic-insight-result-list.entry.js +2 -2
- package/dist/esm/atomic-insight-result-template.entry.js +2 -2
- package/dist/esm/atomic-insight-result.entry.js +2 -2
- package/dist/esm/atomic-insight-smart-snippet-suggestions.entry.js +2 -2
- package/dist/esm/atomic-insight-smart-snippet.entry.js +2 -2
- package/dist/esm/atomic-insight-user-actions-toggle.entry.js +2 -2
- package/dist/esm/atomic-insight-user-actions-toggle.entry.js.map +1 -1
- package/dist/esm/atomic-ipx-recs-list.entry.js +2 -2
- package/dist/esm/atomic-ipx-result-link.entry.js +4 -4
- package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
- package/dist/{atomic/components/sections.js → esm/atomic-layout-section-utils-c8ca7445.js} +1 -1
- package/dist/esm/atomic-layout-section-utils-c8ca7445.js.map +1 -0
- package/dist/esm/atomic-numeric-facet.entry.js +1 -1
- package/dist/esm/atomic-quickview-modal.entry.js +23 -23
- package/dist/esm/atomic-quickview-modal.entry.js.map +1 -1
- package/dist/esm/atomic-quickview.entry.js +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-recs-list.entry.js +2 -2
- package/dist/esm/atomic-recs-result-template.entry.js +2 -2
- package/dist/esm/atomic-recs-result.entry.js +2 -2
- package/dist/esm/atomic-refine-modal.entry.js +2 -2
- package/dist/esm/atomic-refine-modal.entry.js.map +1 -1
- package/dist/esm/atomic-result-children-template.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 +4 -4
- package/dist/esm/atomic-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-result-list.entry.js +3 -3
- package/dist/esm/atomic-result-placeholder_8.entry.js +3 -3
- package/dist/esm/atomic-result-printable-uri.entry.js +2 -2
- package/dist/esm/atomic-result-template.entry.js +2 -2
- package/dist/esm/atomic-result.entry.js +2 -2
- package/dist/esm/atomic-search-box-query-suggestions.entry.js +72 -0
- package/dist/esm/atomic-search-box-query-suggestions.entry.js.map +1 -0
- package/dist/esm/atomic-search-box.entry.js +5 -5
- package/dist/esm/atomic-search-box.entry.js.map +1 -1
- package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-smart-snippet-suggestions.entry.js +2 -2
- package/dist/esm/atomic-smart-snippet.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-tab-manager.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/{attributes-slot-7bf61dda.js → attributes-slot-cb60f29b.js} +4 -9
- package/dist/esm/attributes-slot-cb60f29b.js.map +1 -0
- package/dist/esm/clock-b1f5d7f7.js +5 -0
- package/dist/esm/clock-b1f5d7f7.js.map +1 -0
- package/dist/esm/{display-options-c16840c6.js → display-options-1199eed5.js} +2 -2
- package/dist/esm/display-options-1199eed5.js.map +1 -0
- package/dist/esm/{generated-answer-common-8b06a33d.js → generated-answer-common-9d0c5ada.js} +4 -3
- package/dist/esm/generated-answer-common-9d0c5ada.js.map +1 -0
- package/dist/esm/index-3f35faca.js +2 -6
- package/dist/esm/{insight-layout-776b87f2.js → insight-layout-a1e4b795.js} +2 -2
- package/dist/esm/insight-layout-a1e4b795.js.map +1 -0
- package/dist/esm/{sections-d787040b.js → item-layout-sections-8afb5049.js} +1 -1
- package/dist/esm/item-layout-sections-8afb5049.js.map +1 -0
- package/dist/esm/{result-template-common-ac9fecab.js → result-template-common-995b94f8.js} +2 -2
- package/dist/esm/result-template-common-995b94f8.js.map +1 -0
- package/dist/esm/slot-utils-dcf4fc27.js +37 -0
- package/dist/esm/slot-utils-dcf4fc27.js.map +1 -0
- package/dist/esm/version.js +2 -2
- package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +2 -3
- package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +4 -16
- package/dist/types/components/common/atomic-layout-section/atomic-layout-section.d.ts +1 -1
- package/dist/types/components/common/facets/facet-search/facet-search-input-guard.d.ts +1 -1
- package/dist/types/components/common/layout/custom-render-controller.d.ts +25 -0
- package/dist/types/components/common/layout/item-layout-controller.d.ts +47 -0
- package/dist/types/components/common/no-items/guard.d.ts +1 -1
- package/dist/types/components/common/refine-modal/guard.d.ts +1 -1
- package/dist/types/components/common/sort/sort-guard.d.ts +1 -1
- package/dist/types/components/common/validate-props-controller/validate-props-controller.d.ts +32 -0
- package/dist/types/components/search/atomic-relevance-inspector/atomic-relevance-inspector.d.ts +18 -8
- package/dist/types/components/search/atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts +45 -0
- package/dist/types/components/search/atomic-search-interface/atomic-search-interface.d.ts +6 -3
- package/dist/types/components/search/index.d.ts +2 -0
- package/dist/types/components.d.ts +0 -102
- package/dist/types/directives/hierarchical-path.d.ts +1 -1
- package/dist/types/utils/compare-utils.d.ts +9 -0
- package/dist/types/utils/slot-utils.d.ts +2 -2
- package/docs/atomic-docs.json +1 -185
- package/package.json +12 -9
- package/dist/atomic/components/atomic-relevance-inspector.d.ts +0 -11
- package/dist/atomic/components/atomic-relevance-inspector.js +0 -53
- package/dist/atomic/components/atomic-relevance-inspector.js.map +0 -1
- package/dist/atomic/components/atomic-search-box-recent-queries.d.ts +0 -11
- package/dist/atomic/components/atomic-search-box-recent-queries.js +0 -8
- package/dist/atomic/components/atomic-search-box-recent-queries.js.map +0 -1
- package/dist/atomic/components/atomic-search-box-recent-queries2.js +0 -183
- package/dist/atomic/components/atomic-search-box-recent-queries2.js.map +0 -1
- package/dist/atomic/components/sections.js.map +0 -1
- package/dist/atomic/components/sections2.js.map +0 -1
- package/dist/atomic/p-06349e36.entry.js.map +0 -1
- package/dist/atomic/p-0aec5665.entry.js.map +0 -1
- package/dist/atomic/p-250f34d4.entry.js +0 -2
- package/dist/atomic/p-27b8404c.js.map +0 -1
- package/dist/atomic/p-2caa1859.js.map +0 -1
- package/dist/atomic/p-644f71e2.entry.js.map +0 -1
- package/dist/atomic/p-6d52fad7.js.map +0 -1
- package/dist/atomic/p-7709fba4.js.map +0 -1
- package/dist/atomic/p-7c3c5f07.entry.js.map +0 -1
- package/dist/atomic/p-97748161.js.map +0 -1
- package/dist/atomic/p-9c7dbbdf.js.map +0 -1
- package/dist/atomic/p-a62f2bf9.js +0 -2
- package/dist/atomic/p-a62f2bf9.js.map +0 -1
- package/dist/atomic/p-bd3542d2.entry.js.map +0 -1
- package/dist/atomic/p-de687bed.entry.js +0 -2
- package/dist/atomic/p-de687bed.entry.js.map +0 -1
- package/dist/atomic/p-df4397ab.entry.js +0 -2
- package/dist/atomic/p-df4397ab.entry.js.map +0 -1
- package/dist/atomic/p-e7ca5aea.js +0 -2
- package/dist/atomic/p-e7ca5aea.js.map +0 -1
- package/dist/cjs/atomic-relevance-inspector.cjs.entry.js +0 -38
- package/dist/cjs/atomic-relevance-inspector.cjs.entry.js.map +0 -1
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js +0 -234
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js.map +0 -1
- package/dist/cjs/attributes-slot-afccc1fd.js.map +0 -1
- package/dist/cjs/clock-f03ff827.js +0 -7
- package/dist/cjs/clock-f03ff827.js.map +0 -1
- package/dist/cjs/display-options-14f05862.js.map +0 -1
- package/dist/cjs/generated-answer-common-57443e50.js.map +0 -1
- package/dist/cjs/insight-layout-355a94dd.js.map +0 -1
- package/dist/cjs/result-template-common-88359dad.js.map +0 -1
- package/dist/cjs/sections-4b4af2f8.js.map +0 -1
- package/dist/cjs/sections-fbb93b53.js.map +0 -1
- package/dist/cjs/slot-utils-086dacac.js +0 -23
- package/dist/cjs/slot-utils-086dacac.js.map +0 -1
- package/dist/esm/atomic-relevance-inspector.entry.js +0 -34
- package/dist/esm/atomic-relevance-inspector.entry.js.map +0 -1
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +0 -229
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js.map +0 -1
- package/dist/esm/attributes-slot-7bf61dda.js.map +0 -1
- package/dist/esm/clock-add3e9a5.js +0 -5
- package/dist/esm/clock-add3e9a5.js.map +0 -1
- package/dist/esm/display-options-c16840c6.js.map +0 -1
- package/dist/esm/generated-answer-common-8b06a33d.js.map +0 -1
- package/dist/esm/insight-layout-776b87f2.js.map +0 -1
- package/dist/esm/result-template-common-ac9fecab.js.map +0 -1
- package/dist/esm/sections-ae00b53a.js.map +0 -1
- package/dist/esm/slot-utils-3a3874a2.js +0 -20
- package/dist/esm/slot-utils-3a3874a2.js.map +0 -1
- package/dist/types/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts +0 -37
- /package/dist/atomic/components/components/common/atomic-layout-section/{sections.js → atomic-layout-section-utils.js} +0 -0
- /package/dist/atomic/{p-60800b2f.entry.js.map → p-0ed76e65.entry.js.map} +0 -0
- /package/dist/atomic/{p-5f706e3d.entry.js.map → p-170c7da6.entry.js.map} +0 -0
- /package/dist/atomic/{p-3857d6a3.entry.js.map → p-1bbaf206.entry.js.map} +0 -0
- /package/dist/atomic/{p-4723ffa5.entry.js.map → p-20b33c18.entry.js.map} +0 -0
- /package/dist/atomic/{p-16f6c1f3.entry.js.map → p-2fb49fe8.entry.js.map} +0 -0
- /package/dist/atomic/{p-13391e75.entry.js.map → p-3549a469.entry.js.map} +0 -0
- /package/dist/atomic/{p-d6e04719.entry.js.map → p-373448df.entry.js.map} +0 -0
- /package/dist/atomic/{p-88af4470.entry.js.map → p-40c1dfcb.entry.js.map} +0 -0
- /package/dist/atomic/{p-875fc491.entry.js.map → p-45159342.entry.js.map} +0 -0
- /package/dist/atomic/{p-b2f5f6cb.entry.js.map → p-47ab6c9f.entry.js.map} +0 -0
- /package/dist/atomic/{p-20764605.entry.js.map → p-52d5461a.entry.js.map} +0 -0
- /package/dist/atomic/{p-2925bd87.entry.js.map → p-59b15bd6.entry.js.map} +0 -0
- /package/dist/atomic/{p-406a288c.entry.js.map → p-6078667f.entry.js.map} +0 -0
- /package/dist/atomic/{p-250f34d4.entry.js.map → p-62e85c20.entry.js.map} +0 -0
- /package/dist/atomic/{p-93da1f4e.entry.js.map → p-6f34dd3a.entry.js.map} +0 -0
- /package/dist/atomic/{p-0c0b8d41.entry.js.map → p-768b172e.entry.js.map} +0 -0
- /package/dist/atomic/{p-3cbab25b.entry.js.map → p-7e971d15.entry.js.map} +0 -0
- /package/dist/atomic/{p-a4d277c7.entry.js.map → p-7fd5b6ac.entry.js.map} +0 -0
- /package/dist/atomic/{p-36ab8440.js.map → p-87a6faea.js.map} +0 -0
- /package/dist/atomic/{p-dbcef3a9.entry.js.map → p-87f69e53.entry.js.map} +0 -0
- /package/dist/atomic/{p-6289adc7.entry.js.map → p-9239be63.entry.js.map} +0 -0
- /package/dist/atomic/{p-f71b14b2.entry.js.map → p-9260dd7d.entry.js.map} +0 -0
- /package/dist/atomic/{p-ed8e5c4d.entry.js.map → p-98dd6df1.entry.js.map} +0 -0
- /package/dist/atomic/{p-86bde026.entry.js.map → p-9a6ec803.entry.js.map} +0 -0
- /package/dist/atomic/{p-0b5efb51.entry.js.map → p-a1e5f767.entry.js.map} +0 -0
- /package/dist/atomic/{p-1db20a4a.entry.js.map → p-a5f66ecd.entry.js.map} +0 -0
- /package/dist/atomic/{p-7ec6dd3e.entry.js.map → p-af1b4924.entry.js.map} +0 -0
- /package/dist/atomic/{p-e398835b.entry.js.map → p-b2b9e83f.entry.js.map} +0 -0
- /package/dist/atomic/{p-8fdef8a3.entry.js.map → p-b313058c.entry.js.map} +0 -0
- /package/dist/atomic/{p-0bdd730f.entry.js.map → p-b6ae0244.entry.js.map} +0 -0
- /package/dist/atomic/{p-3a7a1a00.entry.js.map → p-bbfe727a.entry.js.map} +0 -0
- /package/dist/atomic/{p-97ce3384.entry.js.map → p-be2a43f4.entry.js.map} +0 -0
- /package/dist/atomic/{p-e01d5fdd.entry.js.map → p-c25f1437.entry.js.map} +0 -0
- /package/dist/atomic/{p-577d34ba.entry.js.map → p-c4fb6426.entry.js.map} +0 -0
- /package/dist/atomic/{p-55211c25.entry.js.map → p-cafa4083.entry.js.map} +0 -0
- /package/dist/atomic/{p-4701feae.entry.js.map → p-cb3fd0f4.entry.js.map} +0 -0
- /package/dist/atomic/{p-f11c8293.entry.js.map → p-ce5b896e.entry.js.map} +0 -0
- /package/dist/atomic/{p-a5714bc4.entry.js.map → p-d211a422.entry.js.map} +0 -0
- /package/dist/atomic/{p-9faad55b.entry.js.map → p-dc128135.entry.js.map} +0 -0
- /package/dist/atomic/{p-c280cd05.js.map → p-e1cc5150.js.map} +0 -0
- /package/dist/atomic/{p-d1795580.entry.js.map → p-e7a25b00.entry.js.map} +0 -0
- /package/dist/atomic/{p-7f977dca.entry.js.map → p-f76b7ac3.entry.js.map} +0 -0
- /package/dist/atomic/{p-e3af2029.entry.js.map → p-f956cadf.entry.js.map} +0 -0
- /package/dist/types/components/common/atomic-layout-section/{sections.d.ts → atomic-layout-section-utils.d.ts} +0 -0
- /package/dist/types/components/common/layout/{sections.d.ts → item-layout-sections.d.ts} +0 -0
@@ -8,7 +8,8 @@ import { html, LitElement } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
9
9
|
import { ref } from 'lit/directives/ref.js';
|
10
10
|
import { resultComponentClass, } from "../../common/item-list/item-list-common";
|
11
|
-
import {
|
11
|
+
import { CustomRenderController } from "../../common/layout/custom-render-controller";
|
12
|
+
import { ItemLayoutController } from "../../common/layout/item-layout-controller";
|
12
13
|
import { booleanConverter } from "../../../converters/boolean-converter";
|
13
14
|
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles";
|
14
15
|
import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-complete-mixin";
|
@@ -20,7 +21,6 @@ import styles from './atomic-product.tw.css';
|
|
20
21
|
let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitElement) {
|
21
22
|
constructor() {
|
22
23
|
super(...arguments);
|
23
|
-
this.executedRenderingFunctionOnce = false;
|
24
24
|
/**
|
25
25
|
* The product link to use when the product is clicked in a grid layout.
|
26
26
|
*
|
@@ -84,11 +84,26 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
84
84
|
}
|
85
85
|
async connectedCallback() {
|
86
86
|
super.connectedCallback();
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
87
|
+
new CustomRenderController(this, {
|
88
|
+
renderingFunction: () => this.renderingFunction,
|
89
|
+
itemData: () => this.product,
|
90
|
+
rootElementRef: () => this.productRootRef,
|
91
|
+
linkContainerRef: () => this.linkContainerRef,
|
92
|
+
onRenderComplete: (element, output) => {
|
93
|
+
this.itemLayoutController.applyLayoutClassesToElement(element, output);
|
94
|
+
},
|
95
|
+
});
|
96
|
+
this.itemLayoutController = new ItemLayoutController(this, {
|
97
|
+
elementPrefix: 'atomic-product',
|
98
|
+
renderingFunction: () => this.renderingFunction,
|
99
|
+
content: () => this.content,
|
100
|
+
layoutConfig: () => ({
|
101
|
+
display: this.display,
|
102
|
+
density: this.density,
|
103
|
+
imageSize: this.imageSize,
|
104
|
+
}),
|
105
|
+
itemClasses: () => this.classes,
|
106
|
+
});
|
92
107
|
this.addEventListener('atomic/resolveResult', this.resolveProduct);
|
93
108
|
this.addEventListener('atomic/resolveInteractiveResult', this.resolveInteractiveProduct);
|
94
109
|
this.addEventListener('atomic/resolveStopPropagation', this.resolveStopPropagation);
|
@@ -105,12 +120,9 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
105
120
|
this.removeEventListener('atomic/resolveResultDisplayConfig', this.resolveProductDisplayConfig);
|
106
121
|
this.removeEventListener('click', this.handleClick);
|
107
122
|
}
|
108
|
-
get isCustomRenderFunctionMode() {
|
109
|
-
return this.renderingFunction !== undefined;
|
110
|
-
}
|
111
123
|
getContentHTML() {
|
112
124
|
if (!this.content) {
|
113
|
-
console.warn('
|
125
|
+
console.warn('atomic-product: content property is undefined. Cannot get content HTML.', this);
|
114
126
|
return '';
|
115
127
|
}
|
116
128
|
return parentNodeToString(this.content);
|
@@ -118,13 +130,8 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
118
130
|
getLinkHTML() {
|
119
131
|
return parentNodeToString(this.linkContent ?? new HTMLElement());
|
120
132
|
}
|
121
|
-
shouldExecuteRenderFunction() {
|
122
|
-
return (this.isCustomRenderFunctionMode &&
|
123
|
-
this.productRootRef &&
|
124
|
-
!this.executedRenderingFunctionOnce);
|
125
|
-
}
|
126
133
|
render() {
|
127
|
-
if (this.
|
134
|
+
if (this.renderingFunction !== undefined) {
|
128
135
|
return html `
|
129
136
|
<div class=${resultComponentClass}>
|
130
137
|
<div
|
@@ -143,16 +150,13 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
143
150
|
`;
|
144
151
|
}
|
145
152
|
// Handle case where content is undefined and layout was not created
|
146
|
-
if (!this.
|
153
|
+
if (!this.itemLayoutController.getLayout()) {
|
147
154
|
return html `<div class=${resultComponentClass}></div>`;
|
148
155
|
}
|
149
156
|
return html `
|
150
157
|
<div class=${resultComponentClass}>
|
151
158
|
<div
|
152
|
-
class="result-root ${this.
|
153
|
-
.getClasses()
|
154
|
-
.concat(this.classes)
|
155
|
-
.join(' ')}"
|
159
|
+
class="result-root ${this.itemLayoutController.getCombinedClasses().join(' ')}"
|
156
160
|
.innerHTML=${this.getContentHTML()}
|
157
161
|
></div>
|
158
162
|
<div class="link-container" .innerHTML=${this.getLinkHTML()}></div>
|
@@ -164,42 +168,6 @@ let AtomicProduct = class AtomicProduct extends ChildrenUpdateCompleteMixin(LitE
|
|
164
168
|
this.store.unsetLoadingFlag(this.loadingFlag);
|
165
169
|
}
|
166
170
|
}
|
167
|
-
getCombinedClasses(additionalContent) {
|
168
|
-
const layoutClasses = this.layout
|
169
|
-
? this.layout.getClasses(additionalContent)
|
170
|
-
: [];
|
171
|
-
const extraClasses = this.classes.split(/\s+/).filter((c) => c);
|
172
|
-
return [...layoutClasses, ...extraClasses];
|
173
|
-
}
|
174
|
-
applyClassesToChildren() {
|
175
|
-
if (!this.layout) {
|
176
|
-
return;
|
177
|
-
}
|
178
|
-
const classes = this.getCombinedClasses();
|
179
|
-
const root = this.shadowRoot?.querySelector('.result-root');
|
180
|
-
if (!root) {
|
181
|
-
return;
|
182
|
-
}
|
183
|
-
root.querySelectorAll('*').forEach((el) => {
|
184
|
-
const tag = el.tagName.toLowerCase();
|
185
|
-
if (tag.startsWith('atomic-product-')) {
|
186
|
-
el.classList.add(...classes);
|
187
|
-
}
|
188
|
-
});
|
189
|
-
}
|
190
|
-
updated(_changedProperties) {
|
191
|
-
if (this.shouldExecuteRenderFunction()) {
|
192
|
-
const customRenderOutputAsString = this.renderingFunction(this.product, this.productRootRef, this.linkContainerRef);
|
193
|
-
if (this.layout) {
|
194
|
-
const classes = this.getCombinedClasses(customRenderOutputAsString);
|
195
|
-
this.productRootRef.classList.add(...classes);
|
196
|
-
}
|
197
|
-
this.executedRenderingFunctionOnce = true;
|
198
|
-
}
|
199
|
-
if (!this.isCustomRenderFunctionMode) {
|
200
|
-
this.applyClassesToChildren();
|
201
|
-
}
|
202
|
-
}
|
203
171
|
};
|
204
172
|
AtomicProduct.styles = styles;
|
205
173
|
__decorate([
|
@@ -1,14 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
// TODO: should warn!!!
|
1
|
+
import { getNamedSlotFromHost } from '../../../utils/slot-utils';
|
3
2
|
export function getAttributesFromLinkSlot(host, slotName) {
|
4
|
-
const
|
5
|
-
if (
|
3
|
+
const attributesSlot = getNamedSlotFromHost(host, slotName);
|
4
|
+
if (!attributesSlot) {
|
6
5
|
return;
|
7
6
|
}
|
8
|
-
if (namedSlots.length > 1) {
|
9
|
-
console.warn(`Element should only have 1 slot named "${slotName}".`, host);
|
10
|
-
}
|
11
|
-
const attributesSlot = namedSlots[0];
|
12
7
|
if (attributesSlot.nodeName !== 'A') {
|
13
8
|
console.warn(`Slot named "${slotName}" should be an "a" tag`, attributesSlot);
|
14
9
|
return;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/**
|
2
|
+
* A reactive controller that manages custom rendering function execution for item components.
|
3
|
+
*/
|
4
|
+
export class CustomRenderController {
|
5
|
+
constructor(host, options) {
|
6
|
+
this.hasExecutedRenderFunction = false;
|
7
|
+
this.options = {
|
8
|
+
linkContainerRef: () => undefined,
|
9
|
+
onRenderComplete: () => { },
|
10
|
+
...options,
|
11
|
+
};
|
12
|
+
host.addController(this);
|
13
|
+
}
|
14
|
+
hostConnected() {
|
15
|
+
this.resetRenderState();
|
16
|
+
}
|
17
|
+
hostUpdated() {
|
18
|
+
this.executeRenderFunction();
|
19
|
+
}
|
20
|
+
resetRenderState() {
|
21
|
+
this.hasExecutedRenderFunction = false;
|
22
|
+
}
|
23
|
+
executeRenderFunction() {
|
24
|
+
const renderingFunction = this.options.renderingFunction();
|
25
|
+
const itemData = this.options.itemData();
|
26
|
+
const rootElementRef = this.options.rootElementRef();
|
27
|
+
if (!renderingFunction ||
|
28
|
+
!itemData ||
|
29
|
+
!rootElementRef ||
|
30
|
+
this.hasExecutedRenderFunction) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
const customRenderOutput = renderingFunction(itemData, rootElementRef, this.options.linkContainerRef());
|
34
|
+
this.options.onRenderComplete(rootElementRef, customRenderOutput);
|
35
|
+
this.hasExecutedRenderFunction = true;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { ItemLayout, } from './display-options';
|
2
|
+
/**
|
3
|
+
* A reactive controller that manages layout creation and class application for item components.
|
4
|
+
*/
|
5
|
+
export class ItemLayoutController {
|
6
|
+
constructor(host, options) {
|
7
|
+
this.layoutInstance = null;
|
8
|
+
this.host = host;
|
9
|
+
this.options = {
|
10
|
+
...options,
|
11
|
+
};
|
12
|
+
host.addController(this);
|
13
|
+
}
|
14
|
+
hostConnected() {
|
15
|
+
this.createLayout();
|
16
|
+
}
|
17
|
+
hostUpdated() {
|
18
|
+
this.applyLayoutClasses();
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Gets the current layout instance
|
22
|
+
*/
|
23
|
+
getLayout() {
|
24
|
+
return this.layoutInstance;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Gets combined layout and extra classes
|
28
|
+
*/
|
29
|
+
getCombinedClasses(additionalContent) {
|
30
|
+
const layout = this.getLayout();
|
31
|
+
const layoutClasses = layout ? layout.getClasses(additionalContent) : [];
|
32
|
+
const itemClasses = this.options
|
33
|
+
.itemClasses()
|
34
|
+
.split(/\s+/)
|
35
|
+
.filter((c) => c);
|
36
|
+
return [...layoutClasses, ...itemClasses];
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Applies layout classes to a specific element (useful for custom rendering)
|
40
|
+
*/
|
41
|
+
applyLayoutClassesToElement(element, additionalContent) {
|
42
|
+
const layout = this.getLayout();
|
43
|
+
if (!layout) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
const classes = this.getCombinedClasses(additionalContent);
|
47
|
+
if (classes.length > 0) {
|
48
|
+
element.classList.add(...classes);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
applyLayoutClasses() {
|
52
|
+
const layout = this.getLayout();
|
53
|
+
if (!layout) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
const classes = this.getCombinedClasses();
|
57
|
+
const root = this.host.shadowRoot?.querySelector('.result-root');
|
58
|
+
if (!root || classes.length === 0) {
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
if (this.hasCustomRenderFunction()) {
|
62
|
+
this.observeAndApplyClasses(root, classes);
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
this.addClassesToElements(root, classes);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
createLayout() {
|
69
|
+
const content = this.options.content();
|
70
|
+
if (!content) {
|
71
|
+
console.warn(`${this.options.elementPrefix}: content property is undefined. Cannot create layout.`, this.host);
|
72
|
+
this.layoutInstance = null;
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
const config = this.options.layoutConfig();
|
76
|
+
this.layoutInstance = new ItemLayout(content.children, config.display, config.density, config.imageSize);
|
77
|
+
}
|
78
|
+
hasCustomRenderFunction() {
|
79
|
+
return this.options.renderingFunction() !== undefined;
|
80
|
+
}
|
81
|
+
addClassesToElements(root, classes) {
|
82
|
+
if (classes.length === 0) {
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
const elements = root.querySelectorAll('*');
|
86
|
+
elements.forEach((element) => {
|
87
|
+
const tagName = element.tagName.toLowerCase();
|
88
|
+
if (tagName.startsWith(`${this.options.elementPrefix}-`)) {
|
89
|
+
element.classList.add(...classes);
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
observeAndApplyClasses(root, classes) {
|
94
|
+
const observer = new MutationObserver((mutations) => {
|
95
|
+
const hasNewElements = mutations.some((mutation) => mutation.type === 'childList' && mutation.addedNodes.length > 0);
|
96
|
+
if (hasNewElements) {
|
97
|
+
this.addClassesToElements(root, classes);
|
98
|
+
observer.disconnect();
|
99
|
+
}
|
100
|
+
});
|
101
|
+
observer.observe(root, { childList: true, subtree: true });
|
102
|
+
}
|
103
|
+
}
|
package/dist/atomic/components/components/common/product-template/product-template-common.js
CHANGED
@@ -2,7 +2,7 @@ import { ProductTemplatesHelpers, } from '@coveo/headless/commerce';
|
|
2
2
|
import { intersection } from '../../../utils/set';
|
3
3
|
import { isElementNode, isVisualNode } from '../../../utils/utils';
|
4
4
|
import { tableElementTagName } from '../../search/atomic-table-result/table-element-utils';
|
5
|
-
import { isResultSectionNode } from '../layout/sections';
|
5
|
+
import { isResultSectionNode } from '../layout/item-layout-sections';
|
6
6
|
export function getTemplateNodeType(node) {
|
7
7
|
if (isResultSectionNode(node)) {
|
8
8
|
return 'section';
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { deepEqual } from "../../../utils/compare-utils";
|
2
|
+
/**
|
3
|
+
* A reactive controller that validates the props of a Lit component against a
|
4
|
+
* provided Bueno schema.
|
5
|
+
*
|
6
|
+
* It validates the props when the host is connected to the DOM and whenever
|
7
|
+
* the host updates, revalidating only if the props have changed since the last
|
8
|
+
* validation.
|
9
|
+
*
|
10
|
+
* If validation fails, the controller sets the `error` property on the host.
|
11
|
+
*/
|
12
|
+
export class ValidatePropsController {
|
13
|
+
/**
|
14
|
+
* Creates a `ValidatePropsController`.
|
15
|
+
*
|
16
|
+
* @param host The host element.
|
17
|
+
* @param getProps A function that returns the current props to validate.
|
18
|
+
* @param schema The Bueno schema to validate the props against.
|
19
|
+
*/
|
20
|
+
constructor(host, getProps, schema) {
|
21
|
+
this.host = host;
|
22
|
+
this.getProps = getProps;
|
23
|
+
this.schema = schema;
|
24
|
+
host.addController(this);
|
25
|
+
}
|
26
|
+
hostConnected() {
|
27
|
+
this.currentProps = this.getProps();
|
28
|
+
this._validateProps();
|
29
|
+
}
|
30
|
+
hostUpdate() {
|
31
|
+
this.currentProps = this.getProps();
|
32
|
+
if (deepEqual(this.currentProps, this.previousProps)) {
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
// @ts-expect-error: we need to clear the error.
|
36
|
+
this.host.error = undefined;
|
37
|
+
this._validateProps();
|
38
|
+
}
|
39
|
+
_validateProps() {
|
40
|
+
try {
|
41
|
+
this.schema.validate(this.currentProps);
|
42
|
+
}
|
43
|
+
catch (error) {
|
44
|
+
this.host.error = error;
|
45
|
+
}
|
46
|
+
finally {
|
47
|
+
this.previousProps = this.currentProps;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { findSection, sectionSelector, } from '../../common/atomic-layout-section/
|
1
|
+
import { findSection, sectionSelector, } from '../../common/atomic-layout-section/atomic-layout-section-utils';
|
2
2
|
const tabsSelector = 'atomic-insight-tabs';
|
3
3
|
const refineModalSelector = 'atomic-insight-refine-modal';
|
4
4
|
const searchBoxSelector = 'atomic-insight-search-box';
|
@@ -0,0 +1,100 @@
|
|
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 { getOrganizationEndpoint } from '@coveo/headless';
|
8
|
+
import { html, LitElement, nothing } from 'lit';
|
9
|
+
import { customElement, state } from 'lit/decorators.js';
|
10
|
+
import { renderButton } from "../../common/button";
|
11
|
+
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
|
12
|
+
import "../../common/atomic-modal/atomic-modal";
|
13
|
+
import { bindingGuard } from "../../../decorators/binding-guard";
|
14
|
+
import { bindings } from "../../../decorators/bindings";
|
15
|
+
import { errorGuard } from "../../../decorators/error-guard";
|
16
|
+
/**
|
17
|
+
* The `atomic-relevance-inspector` component is used internally to offer insight on search page relevance, as well as information to help troubleshoot issues during development.
|
18
|
+
*
|
19
|
+
* @internal
|
20
|
+
*/
|
21
|
+
let AtomicRelevanceInspector = class AtomicRelevanceInspector extends LitElement {
|
22
|
+
constructor() {
|
23
|
+
super(...arguments);
|
24
|
+
this.open = false;
|
25
|
+
this.initialize = () => {
|
26
|
+
this.bindings.interfaceElement.addEventListener('dblclick', this.handleRelevanceInspectorDoubleClick);
|
27
|
+
};
|
28
|
+
this.handleRelevanceInspectorDoubleClick = (e) => {
|
29
|
+
if (e.altKey) {
|
30
|
+
this.open = !this.open;
|
31
|
+
}
|
32
|
+
};
|
33
|
+
}
|
34
|
+
disconnectedCallback() {
|
35
|
+
this.bindings.interfaceElement.removeEventListener('dblclick', this.handleRelevanceInspectorDoubleClick);
|
36
|
+
}
|
37
|
+
render() {
|
38
|
+
return html `
|
39
|
+
<atomic-modal
|
40
|
+
.isOpen=${this.open}
|
41
|
+
@close=${() => this.handleCloseRelevanceInspector()}
|
42
|
+
exportparts="footer"
|
43
|
+
>
|
44
|
+
<p slot="header">Open the relevance inspector</p>
|
45
|
+
<p slot="body">
|
46
|
+
The Relevance Inspector will open in the Coveo Administration Console.
|
47
|
+
</p>
|
48
|
+
<div slot="footer" class="flex w-full items-center justify-end">
|
49
|
+
${renderButton({
|
50
|
+
props: {
|
51
|
+
style: 'outline-primary',
|
52
|
+
class: 'mr-2 p-2',
|
53
|
+
onClick: () => this.handleCloseRelevanceInspector(),
|
54
|
+
text: 'Ignore',
|
55
|
+
},
|
56
|
+
})(nothing)}
|
57
|
+
${renderButton({
|
58
|
+
props: {
|
59
|
+
style: 'primary',
|
60
|
+
class: 'p-2',
|
61
|
+
onClick: () => {
|
62
|
+
window.open(this.adminHref, '_blank');
|
63
|
+
this.handleCloseRelevanceInspector();
|
64
|
+
},
|
65
|
+
text: 'Open',
|
66
|
+
},
|
67
|
+
})(nothing)}
|
68
|
+
</div>
|
69
|
+
</atomic-modal>
|
70
|
+
`;
|
71
|
+
}
|
72
|
+
handleCloseRelevanceInspector() {
|
73
|
+
this.open = false;
|
74
|
+
}
|
75
|
+
get adminHref() {
|
76
|
+
const { organizationId, environment } = this.bindings.engine.state.configuration;
|
77
|
+
const admin = getOrganizationEndpoint(organizationId, environment, 'admin');
|
78
|
+
const { searchResponseId } = this.bindings.engine.state.search;
|
79
|
+
return `${admin}/admin/#/${organizationId}/search/relevanceInspector/${searchResponseId}`;
|
80
|
+
}
|
81
|
+
};
|
82
|
+
__decorate([
|
83
|
+
state()
|
84
|
+
], AtomicRelevanceInspector.prototype, "bindings", void 0);
|
85
|
+
__decorate([
|
86
|
+
state()
|
87
|
+
], AtomicRelevanceInspector.prototype, "error", void 0);
|
88
|
+
__decorate([
|
89
|
+
state()
|
90
|
+
], AtomicRelevanceInspector.prototype, "open", void 0);
|
91
|
+
__decorate([
|
92
|
+
bindingGuard(),
|
93
|
+
errorGuard()
|
94
|
+
], AtomicRelevanceInspector.prototype, "render", null);
|
95
|
+
AtomicRelevanceInspector = __decorate([
|
96
|
+
customElement('atomic-relevance-inspector'),
|
97
|
+
bindings(),
|
98
|
+
withTailwindStyles
|
99
|
+
], AtomicRelevanceInspector);
|
100
|
+
export { AtomicRelevanceInspector };
|
@@ -0,0 +1,137 @@
|
|
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 { buildRecentQueriesList, } from '@coveo/headless';
|
8
|
+
import { html, LitElement, nothing } from 'lit';
|
9
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
10
|
+
import { errorGuard } from "../../../decorators/error-guard";
|
11
|
+
import { SafeStorage, StorageItems } from "../../../utils/local-storage-utils";
|
12
|
+
import { once } from "../../../utils/utils";
|
13
|
+
const Clock = "<svg fill=\"none\" stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-linecap=\"round\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"8\" cy=\"8\" r=\"7.5\"/><path d=\"m8.5 4.5v4\"/><path d=\"m10.3066 10.1387-1.80932-1.5768\"/></svg>";
|
14
|
+
import { getPartialRecentQueryClearElement, getPartialRecentQueryElement, renderRecentQuery, renderRecentQueryClear, } from '../../common/suggestions/recent-queries';
|
15
|
+
import { dispatchSearchBoxSuggestionsEvent } from '../../common/suggestions/suggestions-events';
|
16
|
+
/**
|
17
|
+
* The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
|
18
|
+
*/
|
19
|
+
let AtomicSearchBoxRecentQueries = class AtomicSearchBoxRecentQueries extends LitElement {
|
20
|
+
constructor() {
|
21
|
+
super(...arguments);
|
22
|
+
/**
|
23
|
+
* The maximum number of suggestions to display when the user types in the input field.
|
24
|
+
*/
|
25
|
+
this.maxWithQuery = 3;
|
26
|
+
this.warnUser = once(() => this.bindings.engine.logger.warn('The recent queries feature is deactivated because analytics are disabled.'));
|
27
|
+
}
|
28
|
+
connectedCallback() {
|
29
|
+
super.connectedCallback();
|
30
|
+
try {
|
31
|
+
dispatchSearchBoxSuggestionsEvent((bindings) => {
|
32
|
+
this.bindings = bindings;
|
33
|
+
return this.initialize();
|
34
|
+
}, this, ['atomic-search-box']);
|
35
|
+
}
|
36
|
+
catch (error) {
|
37
|
+
this.error = error;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
initialize() {
|
41
|
+
this.storage = new SafeStorage();
|
42
|
+
this.recentQueriesList = buildRecentQueriesList(this.bindings.engine, {
|
43
|
+
initialState: { queries: this.retrieveLocalStorage() },
|
44
|
+
options: {
|
45
|
+
maxLength: 1000,
|
46
|
+
clearFilters: this.bindings.clearFilters,
|
47
|
+
},
|
48
|
+
});
|
49
|
+
this.recentQueriesList.subscribe(() => this.updateLocalStorage());
|
50
|
+
return {
|
51
|
+
position: Array.from(this.parentNode.children).indexOf(this),
|
52
|
+
renderItems: () => this.renderItems(),
|
53
|
+
};
|
54
|
+
}
|
55
|
+
retrieveLocalStorage() {
|
56
|
+
return this.storage.getParsedJSON(StorageItems.RECENT_QUERIES, []);
|
57
|
+
}
|
58
|
+
updateLocalStorage() {
|
59
|
+
if (!this.recentQueriesList.state.analyticsEnabled) {
|
60
|
+
return this.disableFeature();
|
61
|
+
}
|
62
|
+
return this.storage.setJSON(StorageItems.RECENT_QUERIES, this.recentQueriesList.state.queries);
|
63
|
+
}
|
64
|
+
disableFeature() {
|
65
|
+
this.warnUser();
|
66
|
+
this.storage.removeItem(StorageItems.RECENT_QUERIES);
|
67
|
+
}
|
68
|
+
renderItems() {
|
69
|
+
if (!this.recentQueriesList.state.analyticsEnabled) {
|
70
|
+
return [];
|
71
|
+
}
|
72
|
+
const query = this.bindings.searchBoxController.state.value;
|
73
|
+
const hasQuery = query !== '';
|
74
|
+
const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;
|
75
|
+
const filteredQueries = this.recentQueriesList.state.queries
|
76
|
+
.filter((recentQuery) => recentQuery.toLowerCase().startsWith(query.toLowerCase()))
|
77
|
+
.slice(0, max);
|
78
|
+
const suggestionElements = filteredQueries.map((value) => this.renderItem(value));
|
79
|
+
if (suggestionElements.length) {
|
80
|
+
suggestionElements.unshift(this.renderClear());
|
81
|
+
}
|
82
|
+
return suggestionElements;
|
83
|
+
}
|
84
|
+
renderClear() {
|
85
|
+
const partialItem = getPartialRecentQueryClearElement(this.bindings.i18n);
|
86
|
+
return {
|
87
|
+
...partialItem,
|
88
|
+
content: renderRecentQueryClear({ i18n: this.bindings.i18n }),
|
89
|
+
onSelect: () => {
|
90
|
+
this.recentQueriesList.clear();
|
91
|
+
this.bindings.triggerSuggestions();
|
92
|
+
},
|
93
|
+
};
|
94
|
+
}
|
95
|
+
renderItem(value) {
|
96
|
+
const query = this.bindings.searchBoxController.state.value;
|
97
|
+
const partialItem = getPartialRecentQueryElement(value, this.bindings.i18n);
|
98
|
+
return {
|
99
|
+
...partialItem,
|
100
|
+
content: renderRecentQuery({
|
101
|
+
icon: this.icon || Clock,
|
102
|
+
query,
|
103
|
+
value,
|
104
|
+
}),
|
105
|
+
onSelect: () => {
|
106
|
+
if (this.bindings.isStandalone) {
|
107
|
+
this.bindings.searchBoxController.updateText(value);
|
108
|
+
this.bindings.searchBoxController.submit();
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
this.recentQueriesList.executeRecentQuery(this.recentQueriesList.state.queries.indexOf(value));
|
112
|
+
},
|
113
|
+
};
|
114
|
+
}
|
115
|
+
render() {
|
116
|
+
return html `${nothing}`;
|
117
|
+
}
|
118
|
+
};
|
119
|
+
__decorate([
|
120
|
+
state()
|
121
|
+
], AtomicSearchBoxRecentQueries.prototype, "error", void 0);
|
122
|
+
__decorate([
|
123
|
+
property()
|
124
|
+
], AtomicSearchBoxRecentQueries.prototype, "icon", void 0);
|
125
|
+
__decorate([
|
126
|
+
property({ type: Number, attribute: 'max-with-query', reflect: true })
|
127
|
+
], AtomicSearchBoxRecentQueries.prototype, "maxWithQuery", void 0);
|
128
|
+
__decorate([
|
129
|
+
property({ type: Number, attribute: 'max-without-query', reflect: true })
|
130
|
+
], AtomicSearchBoxRecentQueries.prototype, "maxWithoutQuery", void 0);
|
131
|
+
__decorate([
|
132
|
+
errorGuard()
|
133
|
+
], AtomicSearchBoxRecentQueries.prototype, "render", null);
|
134
|
+
AtomicSearchBoxRecentQueries = __decorate([
|
135
|
+
customElement('atomic-search-box-recent-queries')
|
136
|
+
], AtomicSearchBoxRecentQueries);
|
137
|
+
export { AtomicSearchBoxRecentQueries };
|