@coveo/atomic 3.34.0-pre.af85860e30 → 3.34.0-pre.b429ebe8aa
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 +1 -1
- package/dist/atomic/components/atomic-field-condition.js +1 -1
- package/dist/atomic/components/atomic-field-condition.js.map +1 -1
- package/dist/atomic/components/atomic-insight-history-toggle.js +2 -2
- package/dist/atomic/components/atomic-insight-history-toggle.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-children-template.js +1 -1
- package/dist/atomic/components/atomic-insight-result-children-template.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-template.js +1 -1
- package/dist/atomic/components/atomic-insight-result-template.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/{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-quickview-modal2.js +22 -22
- package/dist/atomic/components/atomic-quickview-modal2.js.map +1 -1
- package/dist/atomic/components/atomic-recs-result-template.js +1 -1
- package/dist/atomic/components/atomic-recs-result-template.js.map +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-template.js +1 -1
- package/dist/atomic/components/atomic-result-children-template.js.map +1 -1
- package/dist/atomic/components/atomic-result-list.js.map +1 -1
- package/dist/atomic/components/atomic-result-template.js +1 -1
- package/dist/atomic/components/atomic-result-template.js.map +1 -1
- package/dist/atomic/components/atomic-search-box.js +2 -8
- 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-tab-manager.js +1 -1
- package/dist/atomic/components/clock.js +2 -2
- package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +4 -3
- package/dist/atomic/components/components/commerce/atomic-product-template/atomic-product-template.js +3 -2
- package/dist/atomic/components/components/common/atomic-layout-section/layout.js +1 -1
- package/dist/atomic/components/components/common/item-list/table-layout.js +1 -1
- package/dist/atomic/components/components/common/layout/display-options.js +1 -1
- 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-controller.js +16 -81
- package/dist/atomic/components/components/common/template-controller/base-template-controller.js +89 -0
- package/dist/atomic/components/components/common/{product-template/product-template-common.js → template-controller/template-utils.js} +11 -12
- package/dist/atomic/components/components/insight/atomic-insight-layout/insight-layout.js +1 -1
- 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/index.js +1 -0
- package/dist/atomic/components/components/search/lazy-index.js +1 -0
- package/dist/atomic/components/display-options.js +1 -1
- package/dist/atomic/components/display-options.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 → stencil-result-template-common.js} +2 -2
- package/dist/atomic/components/stencil-result-template-common.js.map +1 -0
- package/dist/atomic/components/table-element-utils.js.map +1 -1
- package/dist/atomic/{p-2caa1859.js → p-0e62bdd6.js} +2 -2
- package/dist/atomic/p-0e62bdd6.js.map +1 -0
- package/dist/atomic/{p-5f706e3d.entry.js → p-170c7da6.entry.js} +2 -2
- 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-a4d277c7.entry.js → p-2213060b.entry.js} +2 -2
- package/dist/atomic/p-2213060b.entry.js.map +1 -0
- package/dist/atomic/{p-d1795580.entry.js → p-2895c42c.entry.js} +2 -2
- package/dist/atomic/p-2895c42c.entry.js.map +1 -0
- 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-8bf425b0.entry.js → p-40c1dfcb.entry.js} +2 -2
- package/dist/atomic/{p-7709fba4.js → p-4da8f827.js} +2 -2
- package/dist/atomic/p-4da8f827.js.map +1 -0
- package/dist/atomic/{p-0c098321.entry.js → p-4f34763d.entry.js} +2 -2
- package/dist/atomic/{p-86ca8ef9.entry.js → p-4f4c9a03.entry.js} +2 -2
- package/dist/atomic/p-4f4c9a03.entry.js.map +1 -0
- package/dist/atomic/{p-d82b85ab.entry.js → p-52d5461a.entry.js} +2 -2
- package/dist/atomic/{p-406a288c.entry.js → p-6078667f.entry.js} +2 -2
- package/dist/atomic/{p-77d560aa.js → p-60be00ad.js} +2 -2
- package/dist/atomic/p-6694e114.entry.js +2 -0
- package/dist/atomic/p-6694e114.entry.js.map +1 -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-0b5efb51.entry.js → p-86f950a5.entry.js} +2 -2
- package/dist/atomic/p-86f950a5.entry.js.map +1 -0
- package/dist/atomic/{p-6289adc7.entry.js → p-9239be63.entry.js} +2 -2
- package/dist/atomic/{p-ed8e5c4d.entry.js → p-98dd6df1.entry.js} +2 -2
- package/dist/atomic/{p-736f4d7e.entry.js → p-9a6ec803.entry.js} +2 -2
- package/dist/atomic/{p-ba8d24ff.entry.js → p-a3fac2ec.entry.js} +2 -2
- package/dist/atomic/{p-d6e04719.entry.js → p-a46d36dd.entry.js} +2 -2
- package/dist/atomic/p-a46d36dd.entry.js.map +1 -0
- package/dist/atomic/{p-1db20a4a.entry.js → p-a5f66ecd.entry.js} +2 -2
- package/dist/atomic/{p-acd1a1d3.js → p-be0518ae.js} +1 -1
- package/dist/atomic/p-be0518ae.js.map +1 -0
- package/dist/atomic/{p-577d34ba.entry.js → p-c4fb6426.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-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-f71b14b2.entry.js → p-ebd00891.entry.js} +2 -2
- package/dist/atomic/p-ebd00891.entry.js.map +1 -0
- package/dist/atomic/{p-65dd9017.entry.js → p-f676b5ba.entry.js} +2 -2
- package/dist/atomic/p-f676b5ba.entry.js.map +1 -0
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-81ebc0cd.js → analytics-config-7fafe2ee.js} +2 -2
- package/dist/cjs/{analytics-config-81ebc0cd.js.map → analytics-config-7fafe2ee.js.map} +1 -1
- package/dist/cjs/atomic-field-condition.cjs.entry.js +4 -4
- package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-folded-result-list.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-folded-result-list.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 +6 -6
- package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-list.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-result-template.cjs.entry.js +6 -6
- package/dist/cjs/atomic-insight-result-template.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result.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/{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-quickview-modal.cjs.entry.js +22 -22
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js.map +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 +6 -6
- package/dist/cjs/atomic-recs-result-template.cjs.entry.js.map +1 -1
- 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 +5 -5
- package/dist/cjs/atomic-result-children-template.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-list.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-list.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-placeholder_8.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-template.cjs.entry.js +5 -5
- package/dist/cjs/atomic-result-template.cjs.entry.js.map +1 -1
- 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-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/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/index-757bc886.js +2 -2
- 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 → stencil-result-template-common-bb38948f.js} +4 -4
- package/dist/cjs/stencil-result-template-common-bb38948f.js.map +1 -0
- package/dist/cjs/{table-element-utils-4865b735.js → table-element-utils-2cc6dc82.js} +1 -1
- package/dist/cjs/table-element-utils-2cc6dc82.js.map +1 -0
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-a15cf5c0.js → analytics-config-a8c239d1.js} +2 -2
- package/dist/esm/{analytics-config-a15cf5c0.js.map → analytics-config-a8c239d1.js.map} +1 -1
- package/dist/esm/atomic-field-condition.entry.js +3 -3
- package/dist/esm/atomic-field-condition.entry.js.map +1 -1
- package/dist/esm/atomic-folded-result-list.entry.js +2 -2
- package/dist/esm/atomic-insight-folded-result-list.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 +3 -3
- package/dist/esm/atomic-insight-result-children-template.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-list.entry.js +2 -2
- package/dist/esm/atomic-insight-result-template.entry.js +3 -3
- package/dist/esm/atomic-insight-result-template.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result.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/{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-quickview-modal.entry.js +22 -22
- package/dist/esm/atomic-quickview-modal.entry.js.map +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 +3 -3
- package/dist/esm/atomic-recs-result-template.entry.js.map +1 -1
- 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 +3 -3
- package/dist/esm/atomic-result-children-template.entry.js.map +1 -1
- package/dist/esm/atomic-result-list.entry.js +3 -3
- package/dist/esm/atomic-result-list.entry.js.map +1 -1
- package/dist/esm/atomic-result-placeholder_8.entry.js +2 -2
- package/dist/esm/atomic-result-template.entry.js +3 -3
- package/dist/esm/atomic-result-template.entry.js.map +1 -1
- 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-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-tab-manager.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/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/index-3f35faca.js +2 -2
- 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 → stencil-result-template-common-19af5cfb.js} +3 -3
- package/dist/esm/stencil-result-template-common-19af5cfb.js.map +1 -0
- package/dist/esm/{table-element-utils-49d22ec6.js → table-element-utils-1dbc5ef6.js} +1 -1
- package/dist/esm/table-element-utils-1dbc5ef6.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/components/common/atomic-layout-section/atomic-layout-section.d.ts +1 -1
- package/dist/types/components/common/product-template/product-template-controller.d.ts +9 -19
- package/dist/types/components/common/product-template/stencil-product-template-common.d.ts +1 -1
- package/dist/types/components/common/result-templates/result-template-controller.d.ts +16 -0
- package/dist/types/components/common/template-controller/base-template-controller.d.ts +36 -0
- package/dist/types/components/common/template-controller/template-utils.d.ts +11 -0
- package/dist/types/components/insight/result-templates/atomic-insight-result-children-template/atomic-insight-result-children-template.d.ts +1 -1
- package/dist/types/components/search/atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts +45 -0
- package/dist/types/components/search/index.d.ts +1 -0
- package/dist/types/components/search/result-templates/atomic-result-children-template/atomic-result-children-template.d.ts +1 -1
- package/dist/types/components.d.ts +0 -49
- package/docs/atomic-docs.json +1 -98
- package/package.json +1 -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/result-template-common.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-0b5efb51.entry.js.map +0 -1
- package/dist/atomic/p-250f34d4.entry.js +0 -2
- package/dist/atomic/p-250f34d4.entry.js.map +0 -1
- package/dist/atomic/p-27b8404c.js.map +0 -1
- package/dist/atomic/p-2caa1859.js.map +0 -1
- package/dist/atomic/p-65dd9017.entry.js.map +0 -1
- package/dist/atomic/p-7709fba4.js.map +0 -1
- package/dist/atomic/p-86ca8ef9.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-a4d277c7.entry.js.map +0 -1
- package/dist/atomic/p-acd1a1d3.js.map +0 -1
- package/dist/atomic/p-bd3542d2.entry.js.map +0 -1
- package/dist/atomic/p-d1795580.entry.js.map +0 -1
- package/dist/atomic/p-d6e04719.entry.js.map +0 -1
- package/dist/atomic/p-ea1b81fa.entry.js +0 -2
- package/dist/atomic/p-ea1b81fa.entry.js.map +0 -1
- package/dist/atomic/p-f71b14b2.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/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/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/table-element-utils-4865b735.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/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/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/table-element-utils-49d22ec6.js.map +0 -1
- package/dist/types/components/common/product-template/product-template-common.d.ts +0 -6
- 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/components/components/{search/atomic-table-result → common}/table-element-utils.js +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-8bf425b0.entry.js.map → p-40c1dfcb.entry.js.map} +0 -0
- /package/dist/atomic/{p-0c098321.entry.js.map → p-4f34763d.entry.js.map} +0 -0
- /package/dist/atomic/{p-d82b85ab.entry.js.map → p-52d5461a.entry.js.map} +0 -0
- /package/dist/atomic/{p-406a288c.entry.js.map → p-6078667f.entry.js.map} +0 -0
- /package/dist/atomic/{p-77d560aa.js.map → p-60be00ad.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-6289adc7.entry.js.map → p-9239be63.entry.js.map} +0 -0
- /package/dist/atomic/{p-ed8e5c4d.entry.js.map → p-98dd6df1.entry.js.map} +0 -0
- /package/dist/atomic/{p-736f4d7e.entry.js.map → p-9a6ec803.entry.js.map} +0 -0
- /package/dist/atomic/{p-ba8d24ff.entry.js.map → p-a3fac2ec.entry.js.map} +0 -0
- /package/dist/atomic/{p-1db20a4a.entry.js.map → p-a5f66ecd.entry.js.map} +0 -0
- /package/dist/atomic/{p-577d34ba.entry.js.map → p-c4fb6426.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/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
- /package/dist/types/components/common/result-templates/{result-template-common.d.ts → stencil-result-template-common.d.ts} +0 -0
- /package/dist/types/components/{search/atomic-table-result → common}/table-element-utils.d.ts +0 -0
@@ -2399,23 +2399,6 @@ export namespace Components {
|
|
2399
2399
|
*/
|
2400
2400
|
"maxWithoutQuery"?: number;
|
2401
2401
|
}
|
2402
|
-
/**
|
2403
|
-
* 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.
|
2404
|
-
*/
|
2405
|
-
interface AtomicSearchBoxRecentQueries {
|
2406
|
-
/**
|
2407
|
-
* The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
|
2408
|
-
*/
|
2409
|
-
"icon"?: string;
|
2410
|
-
/**
|
2411
|
-
* The maximum number of suggestions that will be displayed if the user has typed something into the input field.
|
2412
|
-
*/
|
2413
|
-
"maxWithQuery": number;
|
2414
|
-
/**
|
2415
|
-
* The maximum number of suggestions that will be displayed initially when the input field is empty.
|
2416
|
-
*/
|
2417
|
-
"maxWithoutQuery"?: number;
|
2418
|
-
}
|
2419
2402
|
/**
|
2420
2403
|
* The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
|
2421
2404
|
*/
|
@@ -4044,15 +4027,6 @@ declare global {
|
|
4044
4027
|
prototype: HTMLAtomicSearchBoxQuerySuggestionsElement;
|
4045
4028
|
new (): HTMLAtomicSearchBoxQuerySuggestionsElement;
|
4046
4029
|
};
|
4047
|
-
/**
|
4048
|
-
* 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.
|
4049
|
-
*/
|
4050
|
-
interface HTMLAtomicSearchBoxRecentQueriesElement extends Components.AtomicSearchBoxRecentQueries, HTMLStencilElement {
|
4051
|
-
}
|
4052
|
-
var HTMLAtomicSearchBoxRecentQueriesElement: {
|
4053
|
-
prototype: HTMLAtomicSearchBoxRecentQueriesElement;
|
4054
|
-
new (): HTMLAtomicSearchBoxRecentQueriesElement;
|
4055
|
-
};
|
4056
4030
|
/**
|
4057
4031
|
* The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
|
4058
4032
|
*/
|
@@ -4446,7 +4420,6 @@ declare global {
|
|
4446
4420
|
"atomic-search-box": HTMLAtomicSearchBoxElement;
|
4447
4421
|
"atomic-search-box-instant-results": HTMLAtomicSearchBoxInstantResultsElement;
|
4448
4422
|
"atomic-search-box-query-suggestions": HTMLAtomicSearchBoxQuerySuggestionsElement;
|
4449
|
-
"atomic-search-box-recent-queries": HTMLAtomicSearchBoxRecentQueriesElement;
|
4450
4423
|
"atomic-segmented-facet": HTMLAtomicSegmentedFacetElement;
|
4451
4424
|
"atomic-segmented-facet-scrollable": HTMLAtomicSegmentedFacetScrollableElement;
|
4452
4425
|
"atomic-smart-snippet": HTMLAtomicSmartSnippetElement;
|
@@ -6699,23 +6672,6 @@ declare namespace LocalJSX {
|
|
6699
6672
|
*/
|
6700
6673
|
"maxWithoutQuery"?: number;
|
6701
6674
|
}
|
6702
|
-
/**
|
6703
|
-
* 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.
|
6704
|
-
*/
|
6705
|
-
interface AtomicSearchBoxRecentQueries {
|
6706
|
-
/**
|
6707
|
-
* The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
|
6708
|
-
*/
|
6709
|
-
"icon"?: string;
|
6710
|
-
/**
|
6711
|
-
* The maximum number of suggestions that will be displayed if the user has typed something into the input field.
|
6712
|
-
*/
|
6713
|
-
"maxWithQuery"?: number;
|
6714
|
-
/**
|
6715
|
-
* The maximum number of suggestions that will be displayed initially when the input field is empty.
|
6716
|
-
*/
|
6717
|
-
"maxWithoutQuery"?: number;
|
6718
|
-
}
|
6719
6675
|
/**
|
6720
6676
|
* The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
|
6721
6677
|
*/
|
@@ -7220,7 +7176,6 @@ declare namespace LocalJSX {
|
|
7220
7176
|
"atomic-search-box": AtomicSearchBox;
|
7221
7177
|
"atomic-search-box-instant-results": AtomicSearchBoxInstantResults;
|
7222
7178
|
"atomic-search-box-query-suggestions": AtomicSearchBoxQuerySuggestions;
|
7223
|
-
"atomic-search-box-recent-queries": AtomicSearchBoxRecentQueries;
|
7224
7179
|
"atomic-segmented-facet": AtomicSegmentedFacet;
|
7225
7180
|
"atomic-segmented-facet-scrollable": AtomicSegmentedFacetScrollable;
|
7226
7181
|
"atomic-smart-snippet": AtomicSmartSnippet;
|
@@ -7728,10 +7683,6 @@ declare module "@stencil/core" {
|
|
7728
7683
|
* The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
|
7729
7684
|
*/
|
7730
7685
|
"atomic-search-box-query-suggestions": LocalJSX.AtomicSearchBoxQuerySuggestions & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxQuerySuggestionsElement>;
|
7731
|
-
/**
|
7732
|
-
* 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.
|
7733
|
-
*/
|
7734
|
-
"atomic-search-box-recent-queries": LocalJSX.AtomicSearchBoxRecentQueries & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxRecentQueriesElement>;
|
7735
7686
|
/**
|
7736
7687
|
* The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
|
7737
7688
|
*/
|
package/docs/atomic-docs.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"timestamp": "2025-10-
|
2
|
+
"timestamp": "2025-10-07T18:18:11",
|
3
3
|
"compiler": {
|
4
4
|
"name": "@stencil/core",
|
5
5
|
"version": "4.20.0",
|
@@ -12226,13 +12226,11 @@
|
|
12226
12226
|
"dependents": [],
|
12227
12227
|
"dependencies": [
|
12228
12228
|
"atomic-suggestion-renderer",
|
12229
|
-
"atomic-search-box-recent-queries",
|
12230
12229
|
"atomic-search-box-query-suggestions"
|
12231
12230
|
],
|
12232
12231
|
"dependencyGraph": {
|
12233
12232
|
"atomic-search-box": [
|
12234
12233
|
"atomic-suggestion-renderer",
|
12235
|
-
"atomic-search-box-recent-queries",
|
12236
12234
|
"atomic-search-box-query-suggestions"
|
12237
12235
|
]
|
12238
12236
|
}
|
@@ -12551,101 +12549,6 @@
|
|
12551
12549
|
]
|
12552
12550
|
}
|
12553
12551
|
},
|
12554
|
-
{
|
12555
|
-
"filePath": "src/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.tsx",
|
12556
|
-
"encapsulation": "shadow",
|
12557
|
-
"tag": "atomic-search-box-recent-queries",
|
12558
|
-
"docs": "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.",
|
12559
|
-
"docsTags": [],
|
12560
|
-
"usage": {},
|
12561
|
-
"props": [
|
12562
|
-
{
|
12563
|
-
"name": "icon",
|
12564
|
-
"type": "string | undefined",
|
12565
|
-
"complexType": {
|
12566
|
-
"original": "string",
|
12567
|
-
"resolved": "string | undefined",
|
12568
|
-
"references": {}
|
12569
|
-
},
|
12570
|
-
"mutable": false,
|
12571
|
-
"attr": "icon",
|
12572
|
-
"reflectToAttr": false,
|
12573
|
-
"docs": "The SVG icon to display.\n\n- Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n- Use a value that starts with `assets://`, to display an icon from the Atomic package.\n- Use a stringified SVG to display it directly.",
|
12574
|
-
"docsTags": [],
|
12575
|
-
"values": [
|
12576
|
-
{
|
12577
|
-
"type": "string"
|
12578
|
-
},
|
12579
|
-
{
|
12580
|
-
"type": "undefined"
|
12581
|
-
}
|
12582
|
-
],
|
12583
|
-
"optional": true,
|
12584
|
-
"required": false
|
12585
|
-
},
|
12586
|
-
{
|
12587
|
-
"name": "maxWithQuery",
|
12588
|
-
"type": "number",
|
12589
|
-
"complexType": {
|
12590
|
-
"original": "number",
|
12591
|
-
"resolved": "number",
|
12592
|
-
"references": {}
|
12593
|
-
},
|
12594
|
-
"mutable": false,
|
12595
|
-
"attr": "max-with-query",
|
12596
|
-
"reflectToAttr": true,
|
12597
|
-
"docs": "The maximum number of suggestions that will be displayed if the user has typed something into the input field.",
|
12598
|
-
"docsTags": [],
|
12599
|
-
"default": "3",
|
12600
|
-
"values": [
|
12601
|
-
{
|
12602
|
-
"type": "number"
|
12603
|
-
}
|
12604
|
-
],
|
12605
|
-
"optional": false,
|
12606
|
-
"required": false
|
12607
|
-
},
|
12608
|
-
{
|
12609
|
-
"name": "maxWithoutQuery",
|
12610
|
-
"type": "number | undefined",
|
12611
|
-
"complexType": {
|
12612
|
-
"original": "number",
|
12613
|
-
"resolved": "number | undefined",
|
12614
|
-
"references": {}
|
12615
|
-
},
|
12616
|
-
"mutable": false,
|
12617
|
-
"attr": "max-without-query",
|
12618
|
-
"reflectToAttr": true,
|
12619
|
-
"docs": "The maximum number of suggestions that will be displayed initially when the input field is empty.",
|
12620
|
-
"docsTags": [],
|
12621
|
-
"values": [
|
12622
|
-
{
|
12623
|
-
"type": "number"
|
12624
|
-
},
|
12625
|
-
{
|
12626
|
-
"type": "undefined"
|
12627
|
-
}
|
12628
|
-
],
|
12629
|
-
"optional": true,
|
12630
|
-
"required": false
|
12631
|
-
}
|
12632
|
-
],
|
12633
|
-
"methods": [],
|
12634
|
-
"events": [],
|
12635
|
-
"listeners": [],
|
12636
|
-
"styles": [],
|
12637
|
-
"slots": [],
|
12638
|
-
"parts": [],
|
12639
|
-
"dependents": [
|
12640
|
-
"atomic-search-box"
|
12641
|
-
],
|
12642
|
-
"dependencies": [],
|
12643
|
-
"dependencyGraph": {
|
12644
|
-
"atomic-search-box": [
|
12645
|
-
"atomic-search-box-recent-queries"
|
12646
|
-
]
|
12647
|
-
}
|
12648
|
-
},
|
12649
12552
|
{
|
12650
12553
|
"filePath": "src/components/search/facets/atomic-segmented-facet/atomic-segmented-facet.tsx",
|
12651
12554
|
"encapsulation": "shadow",
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@coveo/atomic",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.34.0-pre.
|
4
|
+
"version": "3.34.0-pre.b429ebe8aa",
|
5
5
|
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
|
6
6
|
"homepage": "https://docs.coveo.com/en/atomic/latest/",
|
7
7
|
"repository": {
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { Components, JSX } from "../../types/components";
|
2
|
-
|
3
|
-
interface AtomicSearchBoxRecentQueries extends Components.AtomicSearchBoxRecentQueries, HTMLElement {}
|
4
|
-
export const AtomicSearchBoxRecentQueries: {
|
5
|
-
prototype: AtomicSearchBoxRecentQueries;
|
6
|
-
new (): AtomicSearchBoxRecentQueries;
|
7
|
-
};
|
8
|
-
/**
|
9
|
-
* Used to define this component and all nested components recursively.
|
10
|
-
*/
|
11
|
-
export const defineCustomElement: () => void;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { A as AtomicSearchBoxRecentQueries$1, d as defineCustomElement$1 } from './atomic-search-box-recent-queries2.js';
|
2
|
-
|
3
|
-
const AtomicSearchBoxRecentQueries = AtomicSearchBoxRecentQueries$1;
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
5
|
-
|
6
|
-
export { AtomicSearchBoxRecentQueries, defineCustomElement };
|
7
|
-
|
8
|
-
//# sourceMappingURL=atomic-search-box-recent-queries.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"atomic-search-box-recent-queries.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1,183 +0,0 @@
|
|
1
|
-
import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
2
|
-
import { HighlightUtils, buildRecentQueriesList } from '@coveo/headless';
|
3
|
-
import { C as Clock } from './clock.js';
|
4
|
-
import { a as SafeStorage, S as StorageItems } from './local-storage-utils.js';
|
5
|
-
import { o as once } from './utils.js';
|
6
|
-
import { e as encodeForDomAttribute } from './string-utils.js';
|
7
|
-
import { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events.js';
|
8
|
-
|
9
|
-
const getPartialRecentQueryElement = (value, i18n) => {
|
10
|
-
return {
|
11
|
-
part: 'recent-query-item',
|
12
|
-
query: value,
|
13
|
-
key: `recent-${encodeForDomAttribute(value)}`,
|
14
|
-
ariaLabel: i18n.t('recent-query-suggestion-label', {
|
15
|
-
query: value,
|
16
|
-
interpolation: { escapeValue: false },
|
17
|
-
}),
|
18
|
-
};
|
19
|
-
};
|
20
|
-
const getPartialRecentQueryClearElement = (i18n) => {
|
21
|
-
return {
|
22
|
-
key: 'recent-query-clear',
|
23
|
-
ariaLabel: i18n.t('clear-recent-searches', {
|
24
|
-
interpolation: { escapeValue: false },
|
25
|
-
}),
|
26
|
-
part: 'recent-query-title-item suggestion-divider',
|
27
|
-
hideIfLast: true,
|
28
|
-
};
|
29
|
-
};
|
30
|
-
const RecentQueriesContainer = (_, children) => {
|
31
|
-
return (h("div", { part: "recent-query-content", class: "flex items-center text-left break-all" }, children));
|
32
|
-
};
|
33
|
-
const RecentQueryIcon = ({ icon, }) => {
|
34
|
-
return (h("atomic-icon", { part: "recent-query-icon", icon: icon, class: "mr-2 h-4 w-4 shrink-0" }));
|
35
|
-
};
|
36
|
-
const RecentQueryText = ({ query, value, }) => {
|
37
|
-
if (query === '') {
|
38
|
-
return (h("span", { part: "recent-query-text", class: "line-clamp-2 break-all" }, value));
|
39
|
-
}
|
40
|
-
return (h("span", { part: "recent-query-text", class: "line-clamp-2 break-all", innerHTML: HighlightUtils.highlightString({
|
41
|
-
content: value,
|
42
|
-
openingDelimiter: '<span part="recent-query-text-highlight" class="font-bold">',
|
43
|
-
closingDelimiter: '</span>',
|
44
|
-
highlights: [
|
45
|
-
{
|
46
|
-
offset: query.length,
|
47
|
-
length: value.length - query.length,
|
48
|
-
},
|
49
|
-
],
|
50
|
-
}) }));
|
51
|
-
};
|
52
|
-
const RecentQueryClear = ({ i18n, }) => {
|
53
|
-
return (h("div", { part: "recent-query-title-content", class: "flex w-full justify-between" },
|
54
|
-
h("span", { class: "font-bold", part: "recent-query-title" }, i18n.t('recent-searches')),
|
55
|
-
h("span", { part: "recent-query-clear" }, i18n.t('clear'))));
|
56
|
-
};
|
57
|
-
|
58
|
-
const AtomicSearchBoxRecentQueries = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBoxRecentQueries extends HTMLElement {
|
59
|
-
constructor() {
|
60
|
-
super();
|
61
|
-
this.__registerHost();
|
62
|
-
this.__attachShadow();
|
63
|
-
/**
|
64
|
-
* The maximum number of suggestions that will be displayed if the user has typed something into the input field.
|
65
|
-
*/
|
66
|
-
this.maxWithQuery = 3;
|
67
|
-
this.warnUser = once(() => this.bindings.engine.logger.warn('Because analytics are disabled, the recent queries feature is deactivated.'));
|
68
|
-
this.error = undefined;
|
69
|
-
this.icon = undefined;
|
70
|
-
this.maxWithQuery = 3;
|
71
|
-
this.maxWithoutQuery = undefined;
|
72
|
-
}
|
73
|
-
componentWillLoad() {
|
74
|
-
try {
|
75
|
-
dispatchSearchBoxSuggestionsEvent((bindings) => {
|
76
|
-
this.bindings = bindings;
|
77
|
-
return this.initialize();
|
78
|
-
}, this.host, ['atomic-search-box']);
|
79
|
-
}
|
80
|
-
catch (error) {
|
81
|
-
this.error = error;
|
82
|
-
}
|
83
|
-
}
|
84
|
-
renderIcon() {
|
85
|
-
return this.icon || Clock;
|
86
|
-
}
|
87
|
-
initialize() {
|
88
|
-
this.storage = new SafeStorage();
|
89
|
-
this.recentQueriesList = buildRecentQueriesList(this.bindings.engine, {
|
90
|
-
initialState: { queries: this.retrieveLocalStorage() },
|
91
|
-
options: { maxLength: 1000, clearFilters: this.bindings.clearFilters },
|
92
|
-
});
|
93
|
-
this.recentQueriesList.subscribe(() => this.updateLocalStorage());
|
94
|
-
return {
|
95
|
-
position: Array.from(this.host.parentNode.children).indexOf(this.host),
|
96
|
-
renderItems: () => this.renderItems(),
|
97
|
-
};
|
98
|
-
}
|
99
|
-
retrieveLocalStorage() {
|
100
|
-
return this.storage.getParsedJSON(StorageItems.RECENT_QUERIES, []);
|
101
|
-
}
|
102
|
-
updateLocalStorage() {
|
103
|
-
if (!this.recentQueriesList.state.analyticsEnabled) {
|
104
|
-
return this.disableFeature();
|
105
|
-
}
|
106
|
-
return this.storage.setJSON(StorageItems.RECENT_QUERIES, this.recentQueriesList.state.queries);
|
107
|
-
}
|
108
|
-
disableFeature() {
|
109
|
-
this.warnUser();
|
110
|
-
this.storage.removeItem(StorageItems.RECENT_QUERIES);
|
111
|
-
}
|
112
|
-
renderItems() {
|
113
|
-
if (!this.recentQueriesList.state.analyticsEnabled) {
|
114
|
-
return [];
|
115
|
-
}
|
116
|
-
const query = this.bindings.searchBoxController.state.value;
|
117
|
-
const hasQuery = query !== '';
|
118
|
-
const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;
|
119
|
-
const filteredQueries = this.recentQueriesList.state.queries
|
120
|
-
.filter((recentQuery) => recentQuery.toLowerCase().startsWith(query.toLowerCase()))
|
121
|
-
.slice(0, max);
|
122
|
-
const suggestionElements = filteredQueries.map((value) => this.renderItem(value));
|
123
|
-
if (suggestionElements.length) {
|
124
|
-
suggestionElements.unshift(this.renderClear());
|
125
|
-
}
|
126
|
-
return suggestionElements;
|
127
|
-
}
|
128
|
-
renderClear() {
|
129
|
-
const partialItem = getPartialRecentQueryClearElement(this.bindings.i18n);
|
130
|
-
return {
|
131
|
-
...partialItem,
|
132
|
-
content: h(RecentQueryClear, { i18n: this.bindings.i18n }),
|
133
|
-
onSelect: () => {
|
134
|
-
this.recentQueriesList.clear();
|
135
|
-
this.bindings.triggerSuggestions();
|
136
|
-
},
|
137
|
-
};
|
138
|
-
}
|
139
|
-
renderItem(value) {
|
140
|
-
const query = this.bindings.searchBoxController.state.value;
|
141
|
-
const partialItem = getPartialRecentQueryElement(value, this.bindings.i18n);
|
142
|
-
return {
|
143
|
-
...partialItem,
|
144
|
-
content: (h(RecentQueriesContainer, null, h(RecentQueryIcon, { icon: this.renderIcon() }), h(RecentQueryText, { query: query, value: value }))),
|
145
|
-
onSelect: () => {
|
146
|
-
if (this.bindings.isStandalone) {
|
147
|
-
this.bindings.searchBoxController.updateText(value);
|
148
|
-
this.bindings.searchBoxController.submit();
|
149
|
-
return;
|
150
|
-
}
|
151
|
-
this.recentQueriesList.executeRecentQuery(this.recentQueriesList.state.queries.indexOf(value));
|
152
|
-
},
|
153
|
-
};
|
154
|
-
}
|
155
|
-
render() {
|
156
|
-
if (this.error) {
|
157
|
-
return (h("atomic-component-error", { key: 'a428e82c6ce29e81704777cbbf3bea98937b906a', element: this.host, error: this.error }));
|
158
|
-
}
|
159
|
-
}
|
160
|
-
get host() { return this; }
|
161
|
-
}, [1, "atomic-search-box-recent-queries", {
|
162
|
-
"icon": [1],
|
163
|
-
"maxWithQuery": [514, "max-with-query"],
|
164
|
-
"maxWithoutQuery": [514, "max-without-query"],
|
165
|
-
"error": [32]
|
166
|
-
}]);
|
167
|
-
function defineCustomElement() {
|
168
|
-
if (typeof customElements === "undefined") {
|
169
|
-
return;
|
170
|
-
}
|
171
|
-
const components = ["atomic-search-box-recent-queries"];
|
172
|
-
components.forEach(tagName => { switch (tagName) {
|
173
|
-
case "atomic-search-box-recent-queries":
|
174
|
-
if (!customElements.get(tagName)) {
|
175
|
-
customElements.define(tagName, AtomicSearchBoxRecentQueries);
|
176
|
-
}
|
177
|
-
break;
|
178
|
-
} });
|
179
|
-
}
|
180
|
-
|
181
|
-
export { AtomicSearchBoxRecentQueries as A, defineCustomElement as d };
|
182
|
-
|
183
|
-
//# sourceMappingURL=atomic-search-box-recent-queries2.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"atomic-search-box-recent-queries2.js","mappings":";;;;;;;;AAMO,MAAM,4BAA4B,GAAG,CAC1C,KAAa,EACb,IAAU;IAEV,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,UAAU,qBAAqB,CAAC,KAAK,CAAC,EAAE;QAC7C,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,+BAA+B,EAAE;YACjD,KAAK,EAAE,KAAK;YACZ,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,iCAAiC,GAAG,CAC/C,IAAU;IAKV,OAAO;QACL,GAAG,EAAE,oBAAoB;QACzB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,uBAAuB,EAAE;YACzC,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;QACF,IAAI,EAAE,4CAA4C;QAClD,UAAU,EAAE,IAAI;KACjB,CA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;QACX,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,QACE,+EACE,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACO,EAC1B;SACH;KACF;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/common/suggestions/stencil-recent-queries.tsx","src/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.tsx"],"sourcesContent":["import {HighlightUtils} from '@coveo/headless';\nimport {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils';\nimport {SearchBoxSuggestionElement} from './suggestions-types';\n\nexport const getPartialRecentQueryElement = (\n value: string,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'recent-query-item',\n query: value,\n key: `recent-${encodeForDomAttribute(value)}`,\n ariaLabel: i18n.t('recent-query-suggestion-label', {\n query: value,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const getPartialRecentQueryClearElement = (\n i18n: i18n\n): Pick<\n SearchBoxSuggestionElement,\n 'ariaLabel' | 'key' | 'part' | 'hideIfLast'\n> => {\n return {\n key: 'recent-query-clear',\n ariaLabel: i18n.t('clear-recent-searches', {\n interpolation: {escapeValue: false},\n }),\n part: 'recent-query-title-item suggestion-divider',\n hideIfLast: true,\n };\n};\n\nexport const RecentQueriesContainer: FunctionalComponent = (_, children) => {\n return (\n <div\n part=\"recent-query-content\"\n class=\"flex items-center text-left break-all\"\n >\n {children}\n </div>\n );\n};\n\ninterface RecentQueryIconProps {\n icon: string;\n}\n\nexport const RecentQueryIcon: FunctionalComponent<RecentQueryIconProps> = ({\n icon,\n}) => {\n return (\n <atomic-icon\n part=\"recent-query-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface RecentQueryTextProps {\n query: string;\n value: string;\n}\n\nexport const RecentQueryText: FunctionalComponent<RecentQueryTextProps> = ({\n query,\n value,\n}) => {\n if (query === '') {\n return (\n <span part=\"recent-query-text\" class=\"line-clamp-2 break-all\">\n {value}\n </span>\n );\n }\n return (\n <span\n part=\"recent-query-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={HighlightUtils.highlightString({\n content: value,\n openingDelimiter:\n '<span part=\"recent-query-text-highlight\" class=\"font-bold\">',\n closingDelimiter: '</span>',\n highlights: [\n {\n offset: query.length,\n length: value.length - query.length,\n },\n ],\n })}\n ></span>\n );\n};\n\ninterface RecentQueryClearProps {\n i18n: i18n;\n}\n\nexport const RecentQueryClear: FunctionalComponent<RecentQueryClearProps> = ({\n i18n,\n}) => {\n return (\n <div part=\"recent-query-title-content\" class=\"flex w-full justify-between\">\n <span class=\"font-bold\" part=\"recent-query-title\">\n {i18n.t('recent-searches')}\n </span>\n <span part=\"recent-query-clear\">{i18n.t('clear')}</span>\n </div>\n );\n};\n","import {\n buildRecentQueriesList,\n RecentQueriesList,\n SearchBox,\n} from '@coveo/headless';\nimport {Component, Element, Prop, State, h} from '@stencil/core';\nimport Clock from '../../../../images/clock.svg';\nimport {SafeStorage, StorageItems} from '../../../../utils/local-storage-utils';\nimport {once} from '../../../../utils/utils';\nimport {\n getPartialRecentQueryClearElement,\n getPartialRecentQueryElement,\n RecentQueriesContainer,\n RecentQueryClear,\n RecentQueryIcon,\n RecentQueryText,\n} from '../../../common/suggestions/stencil-recent-queries';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * 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.\n */\n@Component({\n tag: 'atomic-search-box-recent-queries',\n shadow: true,\n})\nexport class AtomicSearchBoxRecentQueries {\n private bindings!: SearchBoxSuggestionsBindings<SearchBox, Bindings>;\n private recentQueriesList!: RecentQueriesList;\n private storage!: SafeStorage;\n\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The SVG icon to display.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly.\n */\n @Prop() public icon?: string;\n\n /**\n * The maximum number of suggestions that will be displayed if the user has typed something into the input field.\n */\n @Prop({reflect: true}) public maxWithQuery = 3;\n /**\n * The maximum number of suggestions that will be displayed initially when the input field is empty.\n */\n @Prop({reflect: true}) public maxWithoutQuery?: number;\n\n componentWillLoad() {\n try {\n dispatchSearchBoxSuggestionsEvent<SearchBox, Bindings>(\n (bindings) => {\n this.bindings = bindings;\n return this.initialize();\n },\n this.host,\n ['atomic-search-box']\n );\n } catch (error) {\n this.error = error as Error;\n }\n }\n\n private renderIcon() {\n return this.icon || Clock;\n }\n\n private initialize(): SearchBoxSuggestions {\n this.storage = new SafeStorage();\n this.recentQueriesList = buildRecentQueriesList(this.bindings.engine, {\n initialState: {queries: this.retrieveLocalStorage()},\n options: {maxLength: 1000, clearFilters: this.bindings.clearFilters},\n });\n\n this.recentQueriesList.subscribe(() => this.updateLocalStorage());\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n renderItems: () => this.renderItems(),\n };\n }\n\n private retrieveLocalStorage() {\n return this.storage.getParsedJSON(StorageItems.RECENT_QUERIES, []);\n }\n\n private updateLocalStorage() {\n if (!this.recentQueriesList.state.analyticsEnabled) {\n return this.disableFeature();\n }\n\n return this.storage.setJSON(\n StorageItems.RECENT_QUERIES,\n this.recentQueriesList.state.queries\n );\n }\n\n private warnUser = once(() =>\n this.bindings.engine.logger.warn(\n 'Because analytics are disabled, the recent queries feature is deactivated.'\n )\n );\n\n private disableFeature() {\n this.warnUser();\n this.storage.removeItem(StorageItems.RECENT_QUERIES);\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n if (!this.recentQueriesList.state.analyticsEnabled) {\n return [];\n }\n\n const query = this.bindings.searchBoxController.state.value;\n const hasQuery = query !== '';\n const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;\n const filteredQueries = this.recentQueriesList.state.queries\n .filter((recentQuery) =>\n recentQuery.toLowerCase().startsWith(query.toLowerCase())\n )\n .slice(0, max);\n\n const suggestionElements: SearchBoxSuggestionElement[] =\n filteredQueries.map((value) => this.renderItem(value));\n if (suggestionElements.length) {\n suggestionElements.unshift(this.renderClear());\n }\n\n return suggestionElements;\n }\n\n private renderClear(): SearchBoxSuggestionElement {\n const partialItem = getPartialRecentQueryClearElement(this.bindings.i18n);\n\n return {\n ...partialItem,\n content: <RecentQueryClear i18n={this.bindings.i18n} />,\n onSelect: () => {\n this.recentQueriesList.clear();\n this.bindings.triggerSuggestions();\n },\n };\n }\n\n private renderItem(value: string): SearchBoxSuggestionElement {\n const query = this.bindings.searchBoxController.state.value;\n const partialItem = getPartialRecentQueryElement(value, this.bindings.i18n);\n return {\n ...partialItem,\n content: (\n <RecentQueriesContainer>\n <RecentQueryIcon icon={this.renderIcon()} />\n <RecentQueryText query={query} value={value} />\n </RecentQueriesContainer>\n ),\n\n onSelect: () => {\n if (this.bindings.isStandalone) {\n this.bindings.searchBoxController.updateText(value);\n this.bindings.searchBoxController.submit();\n return;\n }\n\n this.recentQueriesList.executeRecentQuery(\n this.recentQueriesList.state.queries.indexOf(value)\n );\n },\n };\n }\n\n public render() {\n if (this.error) {\n return (\n <atomic-component-error\n element={this.host}\n error={this.error}\n ></atomic-component-error>\n );\n }\n }\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"result-template-common.js","mappings":";;;;;;SA0BgB,mBAAmB,CAAC,IAAU;IAC5C,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE;QAC7B,OAAO,SAAS,CAAC;KAClB;IACD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B,EAClB,YAAqB;IAErB,MAAM,UAAU,GAA8B,EAAE,CAAC;IACjD,IAAI,SAAS,EAAE;QACb,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;KACzE;IAED,IAAI,YAAY,EAAE;QAChB,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAC;KAC5E;IACD,OAAO,UAAU,CAAC;AACpB;;;;","names":[],"sources":["src/components/common/result-templates/result-template-common.tsx"],"sourcesContent":["import {\n ResultTemplate,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {h} from '@stencil/core';\nimport {aggregate, isElementNode, isVisualNode} from '../../../utils/utils';\nimport {tableElementTagName} from '../../search/atomic-table-result/table-element-utils';\nimport {ItemTarget} from '../layout/display-options';\nimport {isResultSectionNode} from '../layout/sections';\n\nexport type TemplateContent = DocumentFragment;\n\ninterface ResultTemplateCommonProps {\n allowEmpty?: boolean;\n host: HTMLDivElement;\n validParents: string[];\n setError: (error: Error) => void;\n}\n\ntype TemplateNodeType =\n | 'section'\n | 'metadata'\n | 'table-column-definition'\n | 'other';\n\nexport function getTemplateNodeType(node: Node): TemplateNodeType {\n if (isResultSectionNode(node)) {\n return 'section';\n }\n if (!isVisualNode(node)) {\n return 'metadata';\n }\n if (\n isElementNode(node) &&\n node.tagName.toLowerCase() === tableElementTagName\n ) {\n return 'table-column-definition';\n }\n return 'other';\n}\n\nfunction groupNodesByType(nodes: NodeList) {\n return aggregate(Array.from(nodes), (node) => getTemplateNodeType(node));\n}\n\nexport class ResultTemplateCommon {\n private host: HTMLDivElement;\n public matchConditions: ResultTemplateCondition[] = [];\n private gridCellLinkTarget: ItemTarget = '_self';\n\n constructor({\n host,\n setError,\n validParents,\n allowEmpty = false,\n }: ResultTemplateCommonProps) {\n this.host = host;\n this.validateTemplate(host, setError, validParents, allowEmpty);\n }\n\n validateTemplate(\n host: HTMLDivElement,\n setError: (error: Error) => void,\n validParents: string[],\n allowEmpty = true\n ) {\n const hasValidParent = validParents\n .map((p) => p.toUpperCase())\n .includes(host.parentElement?.nodeName || '');\n const tagName = host.nodeName.toLowerCase();\n\n if (!hasValidParent) {\n setError(\n new Error(\n `The \"${tagName}\" component has to be the child of one of the following: ${validParents\n .map((p) => `\"${p.toLowerCase()}\"`)\n .join(', ')}.`\n )\n );\n return;\n }\n\n if (\n host.parentElement?.attributes.getNamedItem('display')?.value === 'grid'\n ) {\n this.gridCellLinkTarget = host.parentElement?.attributes.getNamedItem(\n 'grid-cell-link-target'\n )?.value as ItemTarget;\n }\n\n const template = host.querySelector<HTMLTemplateElement>(\n 'template:not([slot])'\n );\n if (!template) {\n setError(\n new Error(\n `The \"${tagName}\" component has to contain a \"template\" element as a child.`\n )\n );\n return;\n }\n\n if (!allowEmpty && !template.innerHTML.trim()) {\n setError(\n new Error(`The \"template\" tag inside \"${tagName}\" cannot be empty.`)\n );\n return;\n }\n\n if (template.content.querySelector('script')) {\n console.warn(\n 'Any \"script\" tags defined inside of \"template\" elements are not supported and will not be executed when the results are rendered.',\n host\n );\n }\n\n const {section: sectionNodes, other: otherNodes} = groupNodesByType(\n template.content.childNodes\n );\n if (sectionNodes?.length && otherNodes?.length) {\n console.warn(\n 'Result templates should only contain section elements or non-section elements. Future updates could unpredictably affect this result template.',\n host,\n {sectionNodes, otherNodes}\n );\n }\n }\n\n getTemplate(\n conditions: ResultTemplateCondition[],\n error: Error\n ): ResultTemplate<TemplateContent> | null {\n if (error) {\n return null;\n }\n\n return {\n conditions: conditions.concat(this.matchConditions),\n content: getTemplateElement(this.host).content!,\n linkContent: this.getLinkTemplateElement(this.host).content!,\n priority: 1,\n };\n }\n\n renderIfError(error: Error) {\n if (error) {\n return (\n <atomic-component-error\n element={this.host}\n error={error}\n ></atomic-component-error>\n );\n }\n }\n\n getDefaultLinkTemplateElement() {\n const linkTemplate = document.createElement('template');\n linkTemplate.innerHTML = `<atomic-result-link>${this.gridCellLinkTarget ? `<a slot=\"attributes\" target=\"${this.gridCellLinkTarget}\"></a>` : ''}</atomic-result-link>`;\n return linkTemplate;\n }\n\n getLinkTemplateElement(host: HTMLElement) {\n return (\n host.querySelector<HTMLTemplateElement>('template[slot=\"link\"]') ??\n this.getDefaultLinkTemplateElement()\n );\n }\n}\n\nfunction getTemplateElement(host: HTMLElement) {\n return host.querySelector<HTMLTemplateElement>('template:not([slot])')!;\n}\n\nexport function makeMatchConditions(\n mustMatch: Record<string, string[]>,\n mustNotMatch: Record<string, string[]>\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n for (const field in mustMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustMatch(field, mustMatch[field])\n );\n }\n\n for (const field in mustNotMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field])\n );\n }\n return conditions;\n}\n\nexport function makeDefinedConditions(\n ifDefined?: string,\n ifNotDefined?: string\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n if (ifDefined) {\n const fieldNames = ifDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames));\n }\n\n if (ifNotDefined) {\n const fieldNames = ifNotDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));\n }\n return conditions;\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"sections.js","mappings":"SAYgB,WAAW,CAAC,OAAoB,EAAE,OAAgB;IAChE,OAAO,OAAO,CAAC,aAAa,CAC1B,eAAe,CAAC,OAAO,CAAC,CACK,CAAC;AAClC,CAAC;SAEe,eAAe,CAAC,OAAgB;IAC9C,OAAO,kCAAkC,OAAO,IAAI,CAAC;AACvD;;;;","names":[],"sources":["src/components/common/atomic-layout-section/sections.ts"],"sourcesContent":["import type {AtomicLayoutSection} from './atomic-layout-section';\n\nexport type Section =\n | 'search'\n | 'facets'\n | 'main'\n | 'status'\n | 'results'\n | 'horizontal-facets'\n | 'products'\n | 'pagination';\n\nexport function findSection(element: HTMLElement, section: Section) {\n return element.querySelector(\n sectionSelector(section)\n ) as AtomicLayoutSection | null;\n}\n\nexport function sectionSelector(section: Section) {\n return `atomic-layout-section[section=\"${section}\"]`;\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"sections2.js","mappings":";;AAEA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,8BAA8B;IAC9B,8BAA8B;IAC9B,+BAA+B;IAC/B,6BAA6B;IAC7B,sCAAsC;IACtC,kCAAkC;IAClC,+BAA+B;IAC/B,uCAAuC;IACvC,gCAAgC;CACxB,CAAC,CAAC;AAEZ,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,+BAA+B;IAC/B,+BAA+B;IAC/B,gCAAgC;IAChC,6BAA6B;IAC7B,iCAAiC;IACjC,mCAAmC;IACnC,oCAAoC;IACpC,wCAAwC;IACxC,iCAAiC;CACzB,CAAC,CAAC;AAEZ,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,kBAAkB,CAAC,CAAC,CAAC;SAMvD,mBAAmB,CAAC,OAAa;IAC/C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAwB,CAAC,CAAC;AAC1E,CAAC;SAEe,gBAAgB,CAAC,OAA2C;IAC1E,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;KAC1E;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE;;;;","names":[],"sources":["src/components/common/layout/sections.ts"],"sourcesContent":["import {isElementNode} from '../../../utils/utils';\n\nconst resultSectionTags = new Set([\n 'atomic-result-section-visual',\n 'atomic-result-section-badges',\n 'atomic-result-section-actions',\n 'atomic-result-section-title',\n 'atomic-result-section-title-metadata',\n 'atomic-result-section-emphasized',\n 'atomic-result-section-excerpt',\n 'atomic-result-section-bottom-metadata',\n 'atomic-result-section-children',\n] as const);\n\nconst productSectionTags = new Set([\n 'atomic-product-section-visual',\n 'atomic-product-section-badges',\n 'atomic-product-section-actions',\n 'atomic-product-section-name',\n 'atomic-product-section-metadata',\n 'atomic-product-section-emphasized',\n 'atomic-product-section-description',\n 'atomic-product-section-bottom-metadata',\n 'atomic-product-section-children',\n] as const);\n\nconst allTags = new Set([...resultSectionTags, ...productSectionTags]);\n\ntype SetValueType<T> = T extends Set<infer U> ? U : never;\n\nexport type ItemSectionTagName = SetValueType<typeof allTags>;\n\nexport function isResultSectionNode(element: Node) {\n if (!isElementNode(element)) {\n return false;\n }\n return allTags.has(element.tagName.toLowerCase() as ItemSectionTagName);\n}\n\nexport function containsSections(content: string | NodeList | HTMLCollection) {\n if (typeof content === 'string') {\n return Array.from(allTags.values()).some((tag) => content.includes(tag));\n }\n return Array.from(content).some((child) => isResultSectionNode(child));\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["AtomicInsightResultTemplate","constructor","hostRef","this","matchConditions","conditions","mustMatch","mustNotMatch","connectedCallback","resultTemplateCommon","ResultTemplateCommon","host","setError","err","error","validParents","allowEmpty","componentWillLoad","makeDefinedConditions","ifDefined","ifNotDefined","makeMatchConditions","getTemplate","render","renderIfError","__decorate","MapProp","splitValues"],"sources":["src/components/insight/result-templates/atomic-insight-result-template/atomic-insight-result-template.tsx"],"sourcesContent":["import {\n ResultTemplate as InsightResultTemplate,\n ResultTemplateCondition as InsightResultTemplateCondition,\n} from '@coveo/headless/insight';\nimport {Component, Element, Prop, Method, State} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {\n makeDefinedConditions,\n makeMatchConditions,\n ResultTemplateCommon,\n} from '../../../common/result-templates/result-template-common';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-template',\n shadow: true,\n})\nexport class AtomicInsightResultTemplate {\n private resultTemplateCommon!: ResultTemplateCommon;\n\n @State() public error!: Error;\n\n @Element() public host!: HTMLDivElement;\n public matchConditions: InsightResultTemplateCondition[] = [];\n\n /**\n * A function that must return true on results for the result template to apply.\n * Set programmatically before initialization, not via attribute.\n *\n * For example, the following targets a template and sets a condition to make it apply only to results whose `title` contains `singapore`:\n * `document.querySelector('#target-template').conditions = [(result) => /singapore/i.test(result.title)];`\n */\n @Prop() public conditions: InsightResultTemplateCondition[] = [];\n\n /**\n * The field that, when defined on a result item, would allow the template to be applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are defined: `if-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifDefined?: string;\n\n /**\n * The field that, when defined on a result item, would prevent the template from being applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are NOT defined: `if-not-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * The field and values that define which result items the condition must be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustMatch: Record<\n string,\n string[]\n > = {};\n\n /**\n * The field and values that define which result items the condition must not be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustNotMatch: Record<\n string,\n string[]\n > = {};\n\n constructor() {}\n\n connectedCallback() {\n this.resultTemplateCommon = new ResultTemplateCommon({\n host: this.host,\n setError: (err) => {\n this.error = err;\n },\n validParents: [\n 'atomic-insight-result-list',\n 'atomic-insight-folded-result-list',\n ],\n allowEmpty: true,\n });\n }\n\n public componentWillLoad() {\n this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);\n this.resultTemplateCommon.matchConditions = makeMatchConditions(\n this.mustMatch,\n this.mustNotMatch\n );\n }\n\n /**\n * Gets the appropriate result template based on conditions applied.\n */\n @Method()\n public async getTemplate(): Promise<InsightResultTemplate<DocumentFragment> | null> {\n return this.resultTemplateCommon.getTemplate(this.conditions, this.error);\n }\n\n public render() {\n return this.resultTemplateCommon.renderIfError(this.error);\n }\n}\n"],"mappings":"upBAmBaA,EAA2B,MAmDtC,WAAAC,CAAAC,G,UA7COC,KAAAC,gBAAoD,GAS5CD,KAAAE,WAA+C,GAqBjBF,KAAAG,UAGzC,GAOyCH,KAAAI,aAGzC,G,qCAlC0D,G,oEAwB1D,G,kBAUA,E,CAIJ,iBAAAC,GACEL,KAAKM,qBAAuB,IAAIC,EAAqB,CACnDC,KAAMR,KAAKQ,KACXC,SAAWC,IACTV,KAAKW,MAAQD,CAAG,EAElBE,aAAc,CACZ,6BACA,qCAEFC,WAAY,M,CAIT,iBAAAC,GACLd,KAAKE,WAAaa,EAAsBf,KAAKgB,UAAWhB,KAAKiB,cAC7DjB,KAAKM,qBAAqBL,gBAAkBiB,EAC1ClB,KAAKG,UACLH,KAAKI,a,CAQF,iBAAMe,GACX,OAAOnB,KAAKM,qBAAqBa,YAAYnB,KAAKE,WAAYF,KAAKW,M,CAG9D,MAAAS,GACL,OAAOpB,KAAKM,qBAAqBe,cAAcrB,KAAKW,M,6BAhDTW,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q,gCAUcF,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as t,g as s}from"./p-dc3df5ce.js";import{M as e}from"./p-3af2fca0.js";import{R as i,m as r}from"./p-7709fba4.js";import"@coveo/bueno";import"./p-a12e1c59.js";import"./p-f284897c.js";import"./p-0462f723.js";import"@coveo/headless";import"./p-acd1a1d3.js";import"./p-97748161.js";var o=undefined&&undefined.__decorate||function(t,s,e,i){var r=arguments.length,o=r<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(t,s,e,i);else for(var c=t.length-1;c>=0;c--)if(a=t[c])o=(r<3?a(o):r>3?a(s,e,o):a(s,e))||o;return r>3&&o&&Object.defineProperty(s,e,o),o};const a=class{constructor(s){t(this,s);this.conditions=[];this.mustMatch={};this.mustNotMatch={};this.error=undefined;this.conditions=[];this.mustMatch={};this.mustNotMatch={}}connectedCallback(){this.resultTemplateCommon=new i({host:this.host,setError:t=>{this.error=t},validParents:["atomic-result-children"]})}async getTemplate(){return this.resultTemplateCommon.getTemplate(this.conditions,this.error)}componentWillLoad(){this.resultTemplateCommon.matchConditions=r(this.mustMatch,this.mustNotMatch)}render(){return this.resultTemplateCommon.renderIfError(this.error)}get host(){return s(this)}};o([e({splitValues:true})],a.prototype,"mustMatch",void 0);o([e({splitValues:true})],a.prototype,"mustNotMatch",void 0);export{a as atomic_result_children_template};
|
2
|
-
//# sourceMappingURL=p-250f34d4.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["AtomicResultChildrenTemplate","constructor","hostRef","this","conditions","mustMatch","mustNotMatch","connectedCallback","resultTemplateCommon","ResultTemplateCommon","host","setError","err","error","validParents","getTemplate","componentWillLoad","matchConditions","makeMatchConditions","render","renderIfError","__decorate","MapProp","splitValues"],"sources":["src/components/search/result-templates/atomic-result-children-template/atomic-result-children-template.tsx"],"sourcesContent":["import {ResultTemplate, ResultTemplateCondition} from '@coveo/headless';\nimport {Component, Element, Prop, State, Method} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {\n makeMatchConditions,\n ResultTemplateCommon,\n} from '../../../common/result-templates/result-template-common';\n\n/**\n * The `atomic-result-children-template` component determines the format of the child results, depending on the conditions that are defined for each template. A `template` element must be the child of an `atomic-result-children-template`, and an `atomic-result-children` must be the parent of each `atomic-result-children-template`.\n *\n * Note: Any `<script>` tags defined inside of a `<template>` element will not be executed when results are being rendered.\n * @MapProp name: mustMatch;attr: must-match;docs: The field and values that define which result items the condition must be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`;type: Record<string, string[]> ;default: {}\n * @MapProp name: mustNotMatch;attr: must-not-match;docs: The field and values that define which result items the condition must not be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\";type: Record<string, string[]> ;default: {}\n */\n@Component({\n tag: 'atomic-result-children-template',\n shadow: true,\n})\nexport class AtomicResultChildrenTemplate {\n @Element() public host!: HTMLDivElement;\n\n @State() public error!: Error;\n\n /**\n * A function that must return true on results for the result template to apply.\n * Set programmatically before initialization, not via attribute.\n *\n * For example, the following targets a template and sets a condition to make it apply only to results whose `title` contains `singapore`:\n * `document.querySelector('#target-template').conditions = [(result) => /singapore/i.test(result.title)];`\n */\n @Prop() public conditions: ResultTemplateCondition[] = [];\n\n /**\n * Verifies whether the specified fields match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) public mustMatch: Record<\n string,\n string[]\n > = {};\n\n /**\n * Verifies whether the specified fields do not match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) public mustNotMatch: Record<\n string,\n string[]\n > = {};\n\n public resultTemplateCommon!: ResultTemplateCommon;\n\n constructor() {}\n\n connectedCallback() {\n this.resultTemplateCommon = new ResultTemplateCommon({\n host: this.host,\n setError: (err) => {\n this.error = err;\n },\n validParents: ['atomic-result-children'],\n });\n }\n\n /**\n * Gets the appropriate result template based on conditions applied.\n */\n @Method()\n public async getTemplate(): Promise<ResultTemplate<DocumentFragment> | null> {\n return this.resultTemplateCommon.getTemplate(this.conditions, this.error);\n }\n\n public componentWillLoad() {\n this.resultTemplateCommon.matchConditions = makeMatchConditions(\n this.mustMatch,\n this.mustNotMatch\n );\n }\n\n public render() {\n return this.resultTemplateCommon.renderIfError(this.error);\n }\n}\n"],"mappings":"gpBAmBaA,EAA4B,MAkCvC,WAAAC,CAAAC,G,UAtBeC,KAAAC,WAAwC,GAMVD,KAAAE,UAGzC,GAMyCF,KAAAG,aAGzC,G,qCAlBmD,G,eASnD,G,kBASA,E,CAMJ,iBAAAC,GACEJ,KAAKK,qBAAuB,IAAIC,EAAqB,CACnDC,KAAMP,KAAKO,KACXC,SAAWC,IACTT,KAAKU,MAAQD,CAAG,EAElBE,aAAc,CAAC,2B,CAQZ,iBAAMC,GACX,OAAOZ,KAAKK,qBAAqBO,YAAYZ,KAAKC,WAAYD,KAAKU,M,CAG9D,iBAAAG,GACLb,KAAKK,qBAAqBS,gBAAkBC,EAC1Cf,KAAKE,UACLF,KAAKG,a,CAIF,MAAAa,GACL,OAAOhB,KAAKK,qBAAqBY,cAAcjB,KAAKU,M,6BA5CTQ,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q,gCAScF,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["getDisplayClass","display","getDensityClass","density","getImageClass","image","getItemListDisplayClasses","isLoading","isAppLoading","classes","getItemDisplayClasses","push","join","ItemLayout","constructor","children","imageSize","this","getImageSizeFromSections","getSection","getAttribute","undefined","section","Array","from","find","element","tagName","toLowerCase","getClasses","HTMLContent","containsSections"],"sources":["src/components/common/layout/display-options.ts"],"sourcesContent":["import {containsSections, type ItemSectionTagName} from './sections';\n\nexport type ItemDisplayBasicLayout = 'list' | 'grid';\nexport type ItemDisplayLayout = ItemDisplayBasicLayout | 'table';\nexport type ItemDisplayDensity = 'comfortable' | 'normal' | 'compact';\nexport type ItemDisplayImageSize = 'large' | 'small' | 'icon' | 'none';\nexport type ItemTarget = '_self' | '_blank' | '_parent' | '_top';\n\nfunction getDisplayClass(display: ItemDisplayLayout) {\n switch (display) {\n case 'grid':\n return 'display-grid';\n case 'table':\n return 'display-table';\n default:\n return 'display-list';\n }\n}\n\nfunction getDensityClass(density: ItemDisplayDensity) {\n switch (density) {\n case 'comfortable':\n return 'density-comfortable';\n case 'compact':\n return 'density-compact';\n default:\n return 'density-normal';\n }\n}\n\nfunction getImageClass(image: ItemDisplayImageSize) {\n switch (image) {\n case 'large':\n return 'image-large';\n case 'small':\n return 'image-small';\n case 'none':\n return 'image-none';\n default:\n return 'image-icon';\n }\n}\n\nexport function getItemListDisplayClasses(\n display: ItemDisplayLayout,\n density: ItemDisplayDensity,\n image: ItemDisplayImageSize,\n isLoading: boolean,\n isAppLoading: boolean\n) {\n const classes = getItemDisplayClasses(display, density, image);\n\n if (isLoading) {\n classes.push('loading');\n }\n\n if (isAppLoading) {\n classes.push('placeholder');\n }\n return classes.join(' ');\n}\n\nexport function getItemDisplayClasses(\n display: ItemDisplayLayout,\n density: ItemDisplayDensity,\n image: ItemDisplayImageSize\n) {\n const classes = [\n getDisplayClass(display),\n getDensityClass(density),\n getImageClass(image),\n ];\n return classes;\n}\n\nexport class ItemLayout {\n private children: HTMLCollection;\n private density: ItemDisplayDensity;\n private imageSize: ItemDisplayImageSize;\n private display: ItemDisplayLayout;\n\n constructor(\n children: HTMLCollection,\n display: ItemDisplayLayout,\n density: ItemDisplayDensity,\n imageSize: ItemDisplayImageSize\n ) {\n this.children = children;\n this.display = display;\n this.density = density;\n this.imageSize = imageSize;\n }\n\n private getImageSizeFromSections() {\n const imageSize = this.getSection(\n 'atomic-result-section-visual'\n )?.getAttribute('image-size');\n if (!imageSize) {\n return undefined;\n }\n return imageSize as ItemDisplayImageSize;\n }\n\n private getSection(section: ItemSectionTagName) {\n return Array.from(this.children).find(\n (element) => element.tagName.toLowerCase() === section\n );\n }\n\n public getClasses(HTMLContent?: string) {\n const classes = getItemDisplayClasses(\n this.display,\n this.density,\n this.getImageSizeFromSections() ?? this.imageSize\n );\n if (\n HTMLContent\n ? containsSections(HTMLContent)\n : containsSections(this.children)\n ) {\n classes.push('with-sections');\n }\n return classes;\n }\n}\n"],"mappings":"oCAQA,SAASA,EAAgBC,GACvB,OAAQA,GACN,IAAK,OACH,MAAO,eACT,IAAK,QACH,MAAO,gBACT,QACE,MAAO,eAEb,CAEA,SAASC,EAAgBC,GACvB,OAAQA,GACN,IAAK,cACH,MAAO,sBACT,IAAK,UACH,MAAO,kBACT,QACE,MAAO,iBAEb,CAEA,SAASC,EAAcC,GACrB,OAAQA,GACN,IAAK,QACH,MAAO,cACT,IAAK,QACH,MAAO,cACT,IAAK,OACH,MAAO,aACT,QACE,MAAO,aAEb,C,SAEgBC,EACdL,EACAE,EACAE,EACAE,EACAC,GAEA,MAAMC,EAAUC,EAAsBT,EAASE,EAASE,GAExD,GAAIE,EAAW,CACbE,EAAQE,KAAK,U,CAGf,GAAIH,EAAc,CAChBC,EAAQE,KAAK,c,CAEf,OAAOF,EAAQG,KAAK,IACtB,C,SAEgBF,EACdT,EACAE,EACAE,GAEA,MAAMI,EAAU,CACdT,EAAgBC,GAChBC,EAAgBC,GAChBC,EAAcC,IAEhB,OAAOI,CACT,C,MAEaI,EAMX,WAAAC,CACEC,EACAd,EACAE,EACAa,GAEAC,KAAKF,SAAWA,EAChBE,KAAKhB,QAAUA,EACfgB,KAAKd,QAAUA,EACfc,KAAKD,UAAYA,C,CAGX,wBAAAE,GACN,MAAMF,EAAYC,KAAKE,WACrB,iCACCC,aAAa,cAChB,IAAKJ,EAAW,CACd,OAAOK,S,CAET,OAAOL,C,CAGD,UAAAG,CAAWG,GACjB,OAAOC,MAAMC,KAAKP,KAAKF,UAAUU,MAC9BC,GAAYA,EAAQC,QAAQC,gBAAkBN,G,CAI5C,UAAAO,CAAWC,GAChB,MAAMrB,EAAUC,EACdO,KAAKhB,QACLgB,KAAKd,QACLc,KAAKC,4BAA8BD,KAAKD,WAE1C,GACEc,EACIC,EAAiBD,GACjBC,EAAiBd,KAAKF,UAC1B,CACAN,EAAQE,KAAK,gB,CAEf,OAAOF,C","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["tabsSelector","refineModalSelector","searchBoxSelector","toggleSelectors","smartSnippetSelectors","generatedAnswerSelector","makeDesktopQuery","mobileBreakpoint","buildInsightLayout","element","widget","id","layoutSelector","hasTabs","Boolean","findSection","querySelector","interfaceStyle","search","sectionSelector","map","toggleSelector","facets","results","join","filter","declaration"],"sources":["src/components/insight/atomic-insight-layout/insight-layout.ts"],"sourcesContent":["import {\n findSection,\n sectionSelector,\n} from '../../common/atomic-layout-section/sections';\n\nconst tabsSelector = 'atomic-insight-tabs';\nconst refineModalSelector = 'atomic-insight-refine-modal';\nconst searchBoxSelector = 'atomic-insight-search-box';\nconst toggleSelectors = [\n 'atomic-insight-refine-toggle',\n 'atomic-insight-edit-toggle',\n 'atomic-insight-history-toggle',\n];\nconst smartSnippetSelectors = [\n 'atomic-insight-smart-snippet-suggestions',\n 'atomic-insight-smart-snippet',\n];\nconst generatedAnswerSelector = 'atomic-insight-generated-answer';\n\nexport function makeDesktopQuery(mobileBreakpoint: string) {\n return `only screen and (min-width: ${mobileBreakpoint})`;\n}\n\nexport function buildInsightLayout(element: HTMLElement, widget: boolean) {\n const id = element.id;\n const layoutSelector = `atomic-insight-layout#${id}`;\n\n const hasTabs = Boolean(\n findSection(element, 'search')?.querySelector(tabsSelector)\n );\n\n const interfaceStyle = widget\n ? `\n ${layoutSelector} {\n display: grid;\n grid-template-rows: auto auto 8fr 1fr;\n max-height: 100%;\n box-sizing: border-box;\n }\n ${layoutSelector} ${refineModalSelector} {\n grid-row-start: 5;\n }`\n : '';\n\n const search = `${sectionSelector('search')} {\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n grid-gap: 0.5rem;\n background: var(--atomic-neutral-light);\n padding-top: 1.5rem;\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n box-sizing: border-box;\n min-width: 0;\n ${!hasTabs ? 'padding-bottom: 1.5rem;' : ''}\n }\n\n ${sectionSelector('search')} ${searchBoxSelector} {\n flex-grow: 1;\n height: 2.6rem;\n }\n\n ${toggleSelectors.map(\n (toggleSelector) => `${sectionSelector('search')} ${toggleSelector} {\n flex-shrink: 0;\n }`\n )}\n\n ${sectionSelector('search')} ${tabsSelector} {\n width: 100%;\n }\n `;\n\n const facets = `${sectionSelector('facets')} {\n display: none;\n }\n `;\n\n const results = `\n ${sectionSelector('results')} {\n overflow: auto;\n }\n\n ${sectionSelector('results')} ${smartSnippetSelectors.join(',')} {\n padding: 1.5rem 1.5rem 0px;\n }\n\n ${sectionSelector('results')} ${generatedAnswerSelector} {\n margin-left: 1.5rem;\n margin-right: 1.5rem;\n }\n `;\n\n return [interfaceStyle, search, facets, results]\n .filter((declaration) => declaration !== '')\n .join('\\n\\n');\n}\n"],"mappings":"2CAKA,MAAMA,EAAe,sBACrB,MAAMC,EAAsB,8BAC5B,MAAMC,EAAoB,4BAC1B,MAAMC,EAAkB,CACtB,+BACA,6BACA,iCAEF,MAAMC,EAAwB,CAC5B,2CACA,gCAEF,MAAMC,EAA0B,kC,SAEhBC,EAAiBC,GAC/B,MAAO,+BAA+BA,IACxC,C,SAEgBC,EAAmBC,EAAsBC,GACvD,MAAMC,EAAKF,EAAQE,GACnB,MAAMC,EAAiB,yBAAyBD,IAEhD,MAAME,EAAUC,QACdC,EAAYN,EAAS,WAAWO,cAAchB,IAGhD,MAAMiB,EAAiBP,EACnB,OACFE,mIAMAA,KAAkBX,mCAGhB,GAEJ,MAAMiB,EAAS,GAAGC,EAAgB,6SAW3BN,EAAU,0BAA4B,oBAGzCM,EAAgB,aAAajB,iEAK7BC,EAAgBiB,KACfC,GAAmB,GAAGF,EAAgB,aAAaE,gDAKpDF,EAAgB,aAAanB,uCAKjC,MAAMsB,EAAS,GAAGH,EAAgB,iDAKlC,MAAMI,EAAU,SACZJ,EAAgB,qDAIhBA,EAAgB,cAAcf,EAAsBoB,KAAK,2DAIzDL,EAAgB,cAAcd,4EAMlC,MAAO,CAACY,EAAgBC,EAAQI,EAAQC,GACrCE,QAAQC,GAAgBA,IAAgB,KACxCF,KAAK,OACV,Q","ignoreList":[]}
|