@coveo/atomic 3.35.0-pre.4282ff1b60 → 3.35.0-pre.511ce3c910
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/_index.js +19 -19
- package/dist/atomic/components/atomic-field-condition.js +1 -1
- package/dist/atomic/components/atomic-field-condition.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
- package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
- package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
- package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
- package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
- package/dist/atomic/components/atomic-quickview.js +2 -2
- package/dist/atomic/components/atomic-quickview.js.map +1 -1
- package/dist/atomic/components/atomic-recs-interface.js +1 -1
- package/dist/atomic/components/atomic-result-badge.js +1 -1
- package/dist/atomic/components/atomic-result-badge.js.map +1 -1
- package/dist/atomic/components/atomic-result-children.js +2 -2
- package/dist/atomic/components/atomic-result-children.js.map +1 -1
- package/dist/atomic/components/atomic-result-date.js +1 -1
- package/dist/atomic/components/atomic-result-date.js.map +1 -1
- package/dist/atomic/components/atomic-result-fields-list.js +2 -2
- package/dist/atomic/components/atomic-result-fields-list.js.map +1 -1
- package/dist/atomic/components/atomic-result-html.js +1 -1
- package/dist/atomic/components/atomic-result-html.js.map +1 -1
- package/dist/atomic/components/atomic-result-icon.js +1 -1
- package/dist/atomic/components/atomic-result-icon.js.map +1 -1
- package/dist/atomic/components/atomic-result-image.js +1 -1
- package/dist/atomic/components/atomic-result-image.js.map +1 -1
- package/dist/atomic/components/atomic-result-link.js +2 -2
- package/dist/atomic/components/atomic-result-link.js.map +1 -1
- package/dist/atomic/components/atomic-result-localized-text.js +1 -1
- package/dist/atomic/components/atomic-result-localized-text.js.map +1 -1
- package/dist/atomic/components/atomic-result-multi-value-text.js +1 -1
- package/dist/atomic/components/atomic-result-multi-value-text.js.map +1 -1
- package/dist/atomic/components/atomic-result-number.js +1 -1
- package/dist/atomic/components/atomic-result-number.js.map +1 -1
- package/dist/atomic/components/atomic-result-printable-uri.js +1 -1
- package/dist/atomic/components/atomic-result-printable-uri.js.map +1 -1
- package/dist/atomic/components/atomic-result-rating.js +1 -1
- package/dist/atomic/components/atomic-result-rating.js.map +1 -1
- package/dist/atomic/components/atomic-result-text2.js +1 -1
- package/dist/atomic/components/atomic-result-text2.js.map +1 -1
- package/dist/atomic/components/atomic-result-timespan.js +1 -1
- package/dist/atomic/components/atomic-result-timespan.js.map +1 -1
- package/dist/atomic/components/atomic-result2.js.map +1 -1
- package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
- package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
- package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
- package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
- package/dist/atomic/index.esm.js +1 -1
- package/dist/atomic/index.esm.js.map +1 -1
- package/dist/atomic/{p-955092ed.entry.js → p-01096d1c.entry.js} +2 -2
- package/dist/atomic/p-01096d1c.entry.js.map +1 -0
- package/dist/atomic/{p-82cd6398.entry.js → p-154cbbfe.entry.js} +2 -2
- package/dist/atomic/{p-82cd6398.entry.js.map → p-154cbbfe.entry.js.map} +1 -1
- package/dist/atomic/{p-db3b11ca.entry.js → p-2033533c.entry.js} +2 -2
- package/dist/atomic/{p-db3b11ca.entry.js.map → p-2033533c.entry.js.map} +1 -1
- package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
- package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
- package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
- package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
- package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
- package/dist/atomic/p-4080f740.js.map +1 -0
- package/dist/atomic/{p-8d5228da.entry.js → p-42fffab2.entry.js} +2 -2
- package/dist/atomic/p-42fffab2.entry.js.map +1 -0
- package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
- package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
- package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
- package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
- package/dist/atomic/{p-15547bd5.entry.js → p-61b3f5ce.entry.js} +2 -2
- package/dist/atomic/p-61b3f5ce.entry.js.map +1 -0
- package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
- package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
- package/dist/atomic/{p-df8d38ca.entry.js → p-7015679e.entry.js} +2 -2
- package/dist/atomic/p-7015679e.entry.js.map +1 -0
- package/dist/atomic/{p-dea22a8d.entry.js → p-886b184f.entry.js} +2 -2
- package/dist/atomic/p-886b184f.entry.js.map +1 -0
- package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
- package/dist/atomic/p-8e964890.entry.js.map +1 -0
- package/dist/atomic/{p-182f9112.entry.js → p-a413f820.entry.js} +2 -2
- package/dist/atomic/p-a413f820.entry.js.map +1 -0
- package/dist/atomic/{p-5cab535b.entry.js → p-c5bd7f8d.entry.js} +2 -2
- package/dist/atomic/p-c5bd7f8d.entry.js.map +1 -0
- package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
- package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
- package/dist/atomic/{p-c5164dbf.entry.js → p-cee86cff.entry.js} +2 -2
- package/dist/atomic/p-cee86cff.entry.js.map +1 -0
- package/dist/atomic/{p-4cb91ee7.entry.js → p-d5402772.entry.js} +2 -2
- package/dist/atomic/p-d5402772.entry.js.map +1 -0
- package/dist/atomic/{p-e6dc9de7.entry.js → p-da141605.entry.js} +2 -2
- package/dist/atomic/p-da141605.entry.js.map +1 -0
- package/dist/atomic/{p-a1798150.entry.js → p-dd258eaa.entry.js} +2 -2
- package/dist/atomic/p-dd258eaa.entry.js.map +1 -0
- package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
- package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
- package/dist/atomic/{p-448091f7.entry.js → p-ecd3c0a9.entry.js} +2 -2
- package/dist/atomic/p-ecd3c0a9.entry.js.map +1 -0
- package/dist/atomic/{p-c2a5dac0.entry.js → p-f2c4209d.entry.js} +2 -2
- package/dist/atomic/{p-57049cd2.entry.js → p-f2c89d7c.entry.js} +2 -2
- package/dist/atomic/p-f2c89d7c.entry.js.map +1 -0
- package/dist/atomic/{p-3f34929a.entry.js → p-f4f99f5e.entry.js} +2 -2
- package/dist/atomic/p-f800678c.entry.js.map +1 -1
- package/dist/cjs/_index.cjs.js +20 -20
- package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
- package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
- package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
- package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
- package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
- package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_index.js +19 -19
- package/dist/esm/atomic-field-condition.entry.js +1 -1
- package/dist/esm/atomic-field-condition.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
- package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
- package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
- package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
- package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-quickview-modal.entry.js +1 -1
- package/dist/esm/atomic-quickview.entry.js +2 -2
- package/dist/esm/atomic-quickview.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-result-badge.entry.js +1 -1
- package/dist/esm/atomic-result-badge.entry.js.map +1 -1
- package/dist/esm/atomic-result-children.entry.js +2 -2
- package/dist/esm/atomic-result-children.entry.js.map +1 -1
- package/dist/esm/atomic-result-date.entry.js +1 -1
- package/dist/esm/atomic-result-date.entry.js.map +1 -1
- package/dist/esm/atomic-result-fields-list.entry.js +2 -2
- package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
- package/dist/esm/atomic-result-html.entry.js +1 -1
- package/dist/esm/atomic-result-html.entry.js.map +1 -1
- package/dist/esm/atomic-result-icon.entry.js +1 -1
- package/dist/esm/atomic-result-icon.entry.js.map +1 -1
- package/dist/esm/atomic-result-image.entry.js +1 -1
- package/dist/esm/atomic-result-image.entry.js.map +1 -1
- package/dist/esm/atomic-result-link.entry.js +2 -2
- package/dist/esm/atomic-result-link.entry.js.map +1 -1
- package/dist/esm/atomic-result-localized-text.entry.js +2 -2
- package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
- package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
- package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
- package/dist/esm/atomic-result-number.entry.js +1 -1
- package/dist/esm/atomic-result-number.entry.js.map +1 -1
- package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
- package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
- package/dist/esm/atomic-result-rating.entry.js +1 -1
- package/dist/esm/atomic-result-rating.entry.js.map +1 -1
- package/dist/esm/atomic-result-text_2.entry.js +1 -1
- package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
- package/dist/esm/atomic-result-timespan.entry.js +1 -1
- package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
- package/dist/esm/atomic-result.entry.js.map +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
- package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
- package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
- package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
- package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
- package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
- package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
- package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
- package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
- package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
- package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
- package/dist/types/components/search/{result-template-components/result-template-decorators.d.ts → result-template-component-utils/context/stencil-result-template-decorators.d.ts} +6 -2
- package/dist/types/index.d.ts +3 -3
- package/docs/atomic-docs.json +1 -1
- package/package.json +3 -6
- package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
- package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
- package/dist/atomic/components/result-template-decorators.js.map +0 -1
- package/dist/atomic/p-15547bd5.entry.js.map +0 -1
- package/dist/atomic/p-182f9112.entry.js.map +0 -1
- package/dist/atomic/p-18684d4c.js.map +0 -1
- package/dist/atomic/p-190ddaca.entry.js.map +0 -1
- package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
- package/dist/atomic/p-4069d801.entry.js.map +0 -1
- package/dist/atomic/p-448091f7.entry.js.map +0 -1
- package/dist/atomic/p-4cb91ee7.entry.js.map +0 -1
- package/dist/atomic/p-57049cd2.entry.js.map +0 -1
- package/dist/atomic/p-5cab535b.entry.js.map +0 -1
- package/dist/atomic/p-78427c6a.entry.js.map +0 -1
- package/dist/atomic/p-852cc16d.entry.js.map +0 -1
- package/dist/atomic/p-8d5228da.entry.js.map +0 -1
- package/dist/atomic/p-945ddd53.entry.js.map +0 -1
- package/dist/atomic/p-955092ed.entry.js.map +0 -1
- package/dist/atomic/p-a1798150.entry.js.map +0 -1
- package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
- package/dist/atomic/p-c5164dbf.entry.js.map +0 -1
- package/dist/atomic/p-dea22a8d.entry.js.map +0 -1
- package/dist/atomic/p-df8d38ca.entry.js.map +0 -1
- package/dist/atomic/p-e6dc9de7.entry.js.map +0 -1
- package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
- package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
- package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
- package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
- /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
- /package/dist/atomic/{p-3f34929a.entry.js.map → p-f4f99f5e.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["atomicResultCss","AtomicResultStyle0","AtomicResult","this","linkContent","DocumentFragment","display","density","imageSize","classes","executedRenderingFunctionOnce","resolveResult","event","preventDefault","stopPropagation","detail","result","resolveInteractiveResult","interactiveResult","resolveStopPropagation","resolveResultDisplayConfig","handleClick","host","shadowRoot","querySelector","click","connectedCallback","layout","ItemLayout","content","children","isCustomRenderFunctionMode","renderingFunction","undefined","getContentHTML","parentNodeToString","getLinkHTML","shouldExecuteRenderFunction","resultRootRef","render","h","Host","class","resultComponentClass","ref","linkContainerRef","getClasses","concat","join","innerHTML","componentDidLoad","loadingFlag","store","unsetLoadingFlag","classList","add","componentDidRender","customRenderOutputAsString","className"],"sources":["src/components/search/atomic-result/atomic-result.pcss?tag=atomic-result&encapsulation=shadow","src/components/search/atomic-result/atomic-result.tsx"],"sourcesContent":["@import '../../common/template-system/template-system.pcss';\n\n:host {\n @apply atomic-template-system;\n}\n","import {FoldedResult, InteractiveResult, Result} from '@coveo/headless';\nimport {Component, h, Prop, Element, Listen, Host} from '@stencil/core';\nimport {parentNodeToString} from '../../../utils/dom-utils';\nimport {DisplayConfig} from '../../common/item-list/stencil-item-decorators';\nimport {\n ItemRenderingFunction,\n resultComponentClass,\n} from '../../common/item-list/stencil-item-list-common';\nimport {\n ItemLayout,\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n} from '../../common/layout/display-options';\nimport {SearchStore} from '../atomic-search-interface/store';\nimport {\n InteractiveResultContextEvent,\n ResultContextEvent,\n} from '
|
1
|
+
{"version":3,"names":["atomicResultCss","AtomicResultStyle0","AtomicResult","this","linkContent","DocumentFragment","display","density","imageSize","classes","executedRenderingFunctionOnce","resolveResult","event","preventDefault","stopPropagation","detail","result","resolveInteractiveResult","interactiveResult","resolveStopPropagation","resolveResultDisplayConfig","handleClick","host","shadowRoot","querySelector","click","connectedCallback","layout","ItemLayout","content","children","isCustomRenderFunctionMode","renderingFunction","undefined","getContentHTML","parentNodeToString","getLinkHTML","shouldExecuteRenderFunction","resultRootRef","render","h","Host","class","resultComponentClass","ref","linkContainerRef","getClasses","concat","join","innerHTML","componentDidLoad","loadingFlag","store","unsetLoadingFlag","classList","add","componentDidRender","customRenderOutputAsString","className"],"sources":["src/components/search/atomic-result/atomic-result.pcss?tag=atomic-result&encapsulation=shadow","src/components/search/atomic-result/atomic-result.tsx"],"sourcesContent":["@import '../../common/template-system/template-system.pcss';\n\n:host {\n @apply atomic-template-system;\n}\n","import {FoldedResult, InteractiveResult, Result} from '@coveo/headless';\nimport {Component, h, Prop, Element, Listen, Host} from '@stencil/core';\nimport {parentNodeToString} from '../../../utils/dom-utils';\nimport {DisplayConfig} from '../../common/item-list/stencil-item-decorators';\nimport {\n ItemRenderingFunction,\n resultComponentClass,\n} from '../../common/item-list/stencil-item-list-common';\nimport {\n ItemLayout,\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n} from '../../common/layout/display-options';\nimport {SearchStore} from '../atomic-search-interface/store';\nimport {\n InteractiveResultContextEvent,\n ResultContextEvent,\n} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result` component is used internally by the `atomic-result-list` component.\n */\n@Component({\n tag: 'atomic-result',\n styleUrl: 'atomic-result.pcss',\n shadow: true,\n})\nexport class AtomicResult {\n private layout!: ItemLayout;\n\n @Element() host!: HTMLElement;\n\n /**\n * Whether an atomic-result-link inside atomic-result should stop click event propagation.\n */\n @Prop() stopPropagation?: boolean;\n\n /**\n * The result item.\n */\n @Prop() result!: Result | FoldedResult;\n\n /**\n * The InteractiveResult item.\n * @internal\n */\n @Prop() interactiveResult!: InteractiveResult;\n\n /**\n * Global Atomic state.\n * @internal\n */\n @Prop() store?: SearchStore;\n\n /**\n * The result content to display.\n */\n @Prop() content?: ParentNode;\n\n /**\n * The result link to use when the result is clicked in a grid layout.\n *\n * @default - An `atomic-result-link` without any customization.\n */\n @Prop() linkContent: ParentNode = new DocumentFragment();\n\n /**\n * How results should be displayed.\n */\n @Prop() display: ItemDisplayLayout = 'list';\n\n /**\n * How large or small results should be.\n */\n @Prop() density: ItemDisplayDensity = 'normal';\n\n /**\n * The size of the visual section in result list items.\n *\n * This is overwritten by the image size defined in the result content, if it exists.\n */\n @Prop() imageSize: ItemDisplayImageSize = 'icon';\n\n /**\n * The classes to add to the result element.\n */\n @Prop() classes = '';\n\n /**\n * @internal\n */\n @Prop() loadingFlag?: string;\n\n /**\n * Internal function used by atomic-recs-list in advanced setups, which lets you bypass the standard HTML template system.\n * Particularly useful for Atomic React\n *\n * @internal\n */\n @Prop() renderingFunction: ItemRenderingFunction;\n\n private resultRootRef?: HTMLElement;\n private linkContainerRef?: HTMLElement;\n private executedRenderingFunctionOnce = false;\n\n @Listen('atomic/resolveResult')\n public resolveResult(event: ResultContextEvent<FoldedResult | Result>) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.result);\n }\n\n @Listen('atomic/resolveInteractiveResult')\n public resolveInteractiveResult(event: InteractiveResultContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n if (this.interactiveResult) {\n event.detail(this.interactiveResult);\n }\n }\n\n @Listen('atomic/resolveStopPropagation')\n public resolveStopPropagation(event: CustomEvent) {\n event.detail(this.stopPropagation);\n }\n\n @Listen('atomic/resolveResultDisplayConfig')\n public resolveResultDisplayConfig(event: ResultContextEvent<DisplayConfig>) {\n event.preventDefault();\n event.stopPropagation();\n event.detail({\n density: this.density,\n imageSize: this.imageSize!,\n });\n }\n\n @Listen('click')\n public handleClick(event: MouseEvent) {\n if (this.stopPropagation) {\n event.stopPropagation();\n }\n this.host\n .shadowRoot!.querySelector<HTMLAnchorElement>(\n '.link-container > atomic-result-link a:not([slot])'\n )\n ?.click();\n }\n\n public connectedCallback() {\n this.layout = new ItemLayout(\n this.content!.children,\n this.display,\n this.density,\n this.imageSize\n );\n }\n\n private get isCustomRenderFunctionMode() {\n return this.renderingFunction !== undefined;\n }\n\n private getContentHTML() {\n return parentNodeToString(this.content!);\n }\n\n private getLinkHTML() {\n return parentNodeToString(this.linkContent);\n }\n\n private shouldExecuteRenderFunction() {\n return (\n this.isCustomRenderFunctionMode &&\n this.resultRootRef &&\n !this.executedRenderingFunctionOnce\n );\n }\n\n public render() {\n if (this.isCustomRenderFunctionMode) {\n return (\n <Host class={resultComponentClass}>\n <div\n class=\"result-root\"\n ref={(ref) => (this.resultRootRef = ref)}\n ></div>\n <div\n class=\"link-container\"\n ref={(ref) => (this.linkContainerRef = ref)}\n ></div>\n </Host>\n );\n }\n return (\n <Host class={resultComponentClass}>\n <div\n class={`result-root ${this.layout\n .getClasses()\n .concat(this.classes)\n .join(' ')}`}\n innerHTML={this.getContentHTML()}\n ></div>\n <div class=\"link-container\" innerHTML={this.getLinkHTML()}></div>\n </Host>\n );\n }\n\n public componentDidLoad() {\n if (this.loadingFlag && this.store) {\n this.store.unsetLoadingFlag(this.loadingFlag);\n }\n this.host.classList.add('hydrated');\n }\n\n public componentDidRender() {\n if (this.shouldExecuteRenderFunction()) {\n const customRenderOutputAsString = this.renderingFunction!(\n this.result,\n this.resultRootRef!,\n this.linkContainerRef!\n );\n\n this.resultRootRef!.className += ` ${this.layout\n .getClasses(customRenderOutputAsString)\n .concat(this.classes)\n .join(' ')}`;\n\n this.executedRenderingFunctionOnce = true;\n }\n this.host.classList.add('hydrated');\n }\n}\n"],"mappings":"6UAAA,MAAMA,EAAkB,glkHACxB,MAAAC,EAAeD,E,MC2BFE,EAAY,M,yBAqCfC,KAAAC,YAA0B,IAAIC,iBAK9B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,OACEE,MAAO,eAAevC,KAAKwB,OACxBmB,aACAC,OAAO5C,KAAKM,SACZuC,KAAK,OACRC,UAAW9C,KAAK+B,mBAElBM,EAAA,OAAKE,MAAM,iBAAiBO,UAAW9C,KAAKiC,gB,CAK3C,gBAAAc,GACL,GAAI/C,KAAKgD,aAAehD,KAAKiD,MAAO,CAClCjD,KAAKiD,MAAMC,iBAAiBlD,KAAKgD,Y,CAEnChD,KAAKmB,KAAKgC,UAAUC,IAAI,W,CAGnB,kBAAAC,GACL,GAAIrD,KAAKkC,8BAA+B,CACtC,MAAMoB,EAA6BtD,KAAK6B,kBACtC7B,KAAKa,OACLb,KAAKmC,cACLnC,KAAK0C,kBAGP1C,KAAKmC,cAAeoB,WAAa,IAAIvD,KAAKwB,OACvCmB,WAAWW,GACXV,OAAO5C,KAAKM,SACZuC,KAAK,OAER7C,KAAKO,8BAAgC,I,CAEvCP,KAAKmB,KAAKgC,UAAUC,IAAI,W","ignoreList":[]}
|
package/dist/cjs/_index.cjs.js
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
+
const domUtils = require('./dom-utils-d4790328.js');
|
6
|
+
const eventUtils = require('./event-utils-9bfcf3c5.js');
|
5
7
|
const stencilItemDecorators = require('./stencil-item-decorators-43a96f33.js');
|
6
8
|
const suggestionsEvents = require('./suggestions-events-63dd0640.js');
|
7
9
|
const suggestionsUtils = require('./suggestions-utils-61000808.js');
|
8
|
-
const
|
9
|
-
const domUtils = require('./dom-utils-d4790328.js');
|
10
|
-
const eventUtils = require('./event-utils-9bfcf3c5.js');
|
10
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
11
11
|
const initializationUtils = require('./initialization-utils-92f1b080.js');
|
12
12
|
const resultUtils = require('./result-utils-3313d650.js');
|
13
13
|
const initializationLitStencilCommonUtils = require('./initialization-lit-stencil-common-utils-730030b0.js');
|
@@ -15,22 +15,6 @@ require('./index-757bc886.js');
|
|
15
15
|
require('./init-queue-a18aa323.js');
|
16
16
|
require('@coveo/headless');
|
17
17
|
|
18
|
-
/**
|
19
|
-
* Retrieves `Product` on a rendered `atomic-product`.
|
20
|
-
*
|
21
|
-
* This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.
|
22
|
-
*
|
23
|
-
* You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
|
24
|
-
*
|
25
|
-
* @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
|
26
|
-
* @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
|
27
|
-
*
|
28
|
-
* @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/decorators/commerce/product-template-decorators.ts
|
29
|
-
*/
|
30
|
-
function productContext(element) {
|
31
|
-
return stencilItemDecorators.itemContext(element, 'atomic-product');
|
32
|
-
}
|
33
|
-
|
34
18
|
class MissingParentError extends Error {
|
35
19
|
constructor(elementName, parentName) {
|
36
20
|
super(`The "${elementName}" element must be the child of an "${parentName}" element.`);
|
@@ -64,10 +48,26 @@ function fetchProductContext(element) {
|
|
64
48
|
return fetchItemContext(element, 'atomic-product');
|
65
49
|
}
|
66
50
|
|
51
|
+
/**
|
52
|
+
* Retrieves `Product` on a rendered `atomic-product`.
|
53
|
+
*
|
54
|
+
* This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.
|
55
|
+
*
|
56
|
+
* You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
|
57
|
+
*
|
58
|
+
* @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
|
59
|
+
* @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
|
60
|
+
*
|
61
|
+
* @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/components/commerce/product-template-component-utils/context/fetch-product-context.ts
|
62
|
+
*/
|
63
|
+
function productContext(element) {
|
64
|
+
return stencilItemDecorators.itemContext(element, 'atomic-product');
|
65
|
+
}
|
66
|
+
|
67
67
|
exports.dispatchSearchBoxSuggestionsEvent = suggestionsEvents.dispatchSearchBoxSuggestionsEvent;
|
68
68
|
exports.elementHasNoQuery = suggestionsUtils.elementHasNoQuery;
|
69
69
|
exports.elementHasQuery = suggestionsUtils.elementHasQuery;
|
70
|
-
exports.resultContext =
|
70
|
+
exports.resultContext = stencilResultTemplateDecorators.resultContext;
|
71
71
|
exports.initializeBindings = initializationUtils.initializeBindings;
|
72
72
|
exports.bindLogDocumentOpenOnResult = resultUtils.bindLogDocumentOpenOnResult;
|
73
73
|
exports.MissingInterfaceParentError = initializationLitStencilCommonUtils.MissingInterfaceParentError;
|
@@ -6,7 +6,7 @@ const index = require('./index-757bc886.js');
|
|
6
6
|
const headless = require('@coveo/headless');
|
7
7
|
const propsUtils = require('./props-utils-15a042f3.js');
|
8
8
|
const resultTemplateCommon = require('./result-template-common-bc03b2ad.js');
|
9
|
-
const
|
9
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
10
10
|
require('@coveo/bueno');
|
11
11
|
require('./utils-12b49e87.js');
|
12
12
|
require('./purify-85b542e2.js');
|
@@ -80,7 +80,7 @@ __decorate([
|
|
80
80
|
propsUtils.MapProp({ splitValues: true })
|
81
81
|
], AtomicFieldCondition.prototype, "mustNotMatch", void 0);
|
82
82
|
__decorate([
|
83
|
-
|
83
|
+
stencilResultTemplateDecorators.ResultContext()
|
84
84
|
], AtomicFieldCondition.prototype, "result", void 0);
|
85
85
|
AtomicFieldCondition.style = AtomicFieldConditionStyle0;
|
86
86
|
|
@@ -1 +1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e,GAAG,IAAI,CAAC;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,OAAOC,qBAAQ,CAAC;KACjB;IAEM,gBAAgB;QACrB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;KAC5C;;;AA9CqC;IAA7BC,kBAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;uDAChC;AAMiC;IAA7BA,kBAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;0DAChC;AAKoB;IAAxBC,6CAAa,EAAE;oDAAyB;;;;;","names":["ResultTemplatesHelpers","makeMatchConditions","h","MapProp","ResultContext"],"sources":["src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.pcss?tag=atomic-field-condition","src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.tsx"],"sourcesContent":["atomic-field-condition {\n max-width: 100%;\n}\n","import {\n Result,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Prop, h, Element} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {makeMatchConditions} from '../../../common/result-templates/result-template-common';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.\n * The condition properties can be based on any top-level result property of the `result` object, not restricted to fields (e.g., `isRecommendation`).\n *\n * @slot default - The content to display if the conditions are met.\n *\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-field-condition',\n styleUrl: 'atomic-field-condition.pcss',\n shadow: false,\n})\nexport class AtomicFieldCondition {\n @Element() host!: HTMLElement;\n\n /**\n * Verifies whether the specified fields are defined.\n */\n @Prop({reflect: true}) ifDefined?: string;\n /**\n * Verifies whether the specified fields are not defined.\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * Verifies whether the specified fields match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustMatch: Record<string, 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}) mustNotMatch: Record<string, string[]> =\n {};\n\n private conditions: ResultTemplateCondition[] = [];\n private shouldBeRemoved = false;\n\n @ResultContext() private result!: Result;\n\n public componentWillLoad() {\n if (this.ifDefined) {\n const fieldNames = this.ifDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames)\n );\n }\n\n if (this.ifNotDefined) {\n const fieldNames = this.ifNotDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames)\n );\n }\n\n this.conditions.push(\n ...makeMatchConditions(this.mustMatch, this.mustNotMatch)\n );\n }\n\n public render() {\n if (!this.conditions.every((condition) => condition(this.result))) {\n this.shouldBeRemoved = true;\n return '';\n }\n\n return <slot />;\n }\n\n public componentDidLoad() {\n this.shouldBeRemoved && this.host.remove();\n }\n}\n"],"version":3}
|
@@ -8,7 +8,7 @@ const attach = require('./attach-19283bec.js');
|
|
8
8
|
const preview = require('./preview-8eebe5d5.js');
|
9
9
|
const initializationUtils = require('./initialization-utils-92f1b080.js');
|
10
10
|
const stencilIconButton = require('./stencil-iconButton-738b1548.js');
|
11
|
-
const
|
11
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
12
12
|
require('./dom-utils-d4790328.js');
|
13
13
|
require('./event-utils-9bfcf3c5.js');
|
14
14
|
require('./init-queue-a18aa323.js');
|
@@ -124,14 +124,14 @@ const AtomicInsightResultAction = class {
|
|
124
124
|
}
|
125
125
|
}
|
126
126
|
render() {
|
127
|
-
return (index.h(stencilIconButton.IconButton, { key: '
|
127
|
+
return (index.h(stencilIconButton.IconButton, { key: 'd5c5574abd87823727ec04b21d30068c6e5440f7', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.tooltip, onClick: () => this.onClick() }));
|
128
128
|
}
|
129
129
|
};
|
130
130
|
__decorate([
|
131
131
|
initializationUtils.InitializeBindings()
|
132
132
|
], AtomicInsightResultAction.prototype, "bindings", void 0);
|
133
133
|
__decorate([
|
134
|
-
|
134
|
+
stencilResultTemplateDecorators.ResultContext()
|
135
135
|
], AtomicInsightResultAction.prototype, "result", void 0);
|
136
136
|
AtomicInsightResultAction.style = AtomicInsightResultActionStyle0;
|
137
137
|
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,4BAA4B,GAAG,mwjEAAmwjE,CAAC;AACzyjE,wCAAe,4BAA4B;;;;;;;;;;;;ACuB3C,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,8CAAmC,CAAA;IACnC,wCAA6B,CAAA;IAC7B,kCAAuB,CAAA;IACvB,oCAAyB,CAAA;IACzB,sCAA2B,CAAA;AAC7B,CAAC,EANW,OAAO,KAAP,OAAO,QAMlB;MASY,yBAAyB;;;;;;;QAkBN,SAAI,GAAG,EAAE,CAAC;;;;QAKV,YAAO,GAAG,EAAE,CAAC;;;;QAKb,mBAAc,GAAG,EAAE,CAAC;;;;QAKpB,WAAM,GAAqB,EAAE,CAAC;;oBAfvB,EAAE;uBAKC,EAAE;8BAKK,EAAE;sBAKQ,EAAE;;IAIpD,UAAU;QACf,IAAI,CAAC,OAAO,GAAGA,mCAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC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,YAAY;gBACvB,OAAOC,iBAAU,CAAC;YACpB,KAAK,OAAO,CAAC,SAAS;gBACpB,OAAOC,qBAAa,CAAC;YACvB,KAAK,OAAO,CAAC,UAAU;gBACrB,OAAO,QAAQ,CAAC;YAClB,KAAK,OAAO,CAAC,WAAW;gBACtB,OAAO,SAAS,CAAC;YACnB;gBACE,OAAOA,qBAAa,CAAC;SACxB;KACF;IAEM,MAAM;QACX,QACEC,QAACC,4BAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;AApG4B;IAA5BC,sCAAkB,EAAE;2DAAmC;AAC/B;IAAxBC,6CAAa,EAAE;yDAAyB;;;;;","names":["loadInsightAnalyticsActions","AttachIcon","QuickviewIcon","h","IconButton","InitializeBindings","ResultContext"],"sources":["src/components/insight/atomic-insight-result-action/atomic-insight-result-action.pcss?tag=atomic-insight-result-action","src/components/insight/atomic-insight-result-action/atomic-insight-result-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n\n:host {\n &::part(result-action-button) {\n @apply flex items-center justify-center;\n @apply h-8 w-8;\n }\n}\n","import {Result} from '@coveo/headless';\nimport {\n InsightAnalyticsActionCreators,\n loadInsightAnalyticsActions,\n} from '@coveo/headless/insight';\nimport {Component, Event, EventEmitter, Prop, State, h} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport CopyIcon from '../../../images/copy-dark.svg';\nimport EmailIcon from '../../../images/email.svg';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport FeedIcon from '../../../images/share-post.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultActionClickedEvent {\n action: string;\n result: Result;\n}\n\nexport enum Actions {\n CopyToClipboard = 'copyToClipboard',\n AttachToCase = 'attachToCase',\n Quickview = 'quickview',\n PostToFeed = 'postToFeed',\n SendAsEmail = 'sendAsEmail',\n}\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-action',\n styleUrl: 'atomic-insight-result-action.pcss',\n})\nexport class AtomicInsightResultAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n @State() public error!: Error;\n\n @Event({\n eventName: 'atomicInsightResultActionClicked',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private actionClicked!: EventEmitter<InsightResultActionClickedEvent>;\n\n /**\n * Specify the result action icon to display.\n */\n @Prop({mutable: true}) public icon = '';\n\n /**\n * The text tooltip to show on the result action icon.\n */\n @Prop({mutable: true}) public tooltip = '';\n\n /**\n * The text tooltip to show on the result action icon for some time after clicking the button.\n */\n @Prop({mutable: true}) public tooltipOnClick = '';\n\n /**\n * The type of action to perform when the result action is clicked. This will be sent along the event fired when the button is clicked.\n */\n @Prop({mutable: true}) public action: Actions | string = '';\n\n private actions!: InsightAnalyticsActionCreators;\n\n public initialize() {\n this.actions = loadInsightAnalyticsActions(this.bindings.engine);\n }\n\n private onClick() {\n if (this.tooltipOnClick) {\n const originalTooltip = this.tooltip;\n this.tooltip = this.tooltipOnClick;\n setTimeout(() => {\n this.tooltip = originalTooltip;\n }, 1000);\n }\n\n switch (this.action) {\n case Actions.CopyToClipboard:\n this.bindings.engine.dispatch(\n this.actions.logCopyToClipboard(this.result)\n );\n navigator.clipboard.writeText(this.result?.clickUri);\n break;\n case Actions.PostToFeed:\n this.bindings.engine.dispatch(\n this.actions.logFeedItemTextPost(this.result)\n );\n break;\n case Actions.SendAsEmail:\n this.bindings.engine.dispatch(\n this.actions.logCaseSendEmail(this.result)\n );\n break;\n }\n\n this.actionClicked.emit({action: this.action, result: this.result});\n }\n\n private getIcon() {\n if (this.icon) {\n return this.icon;\n }\n\n switch (this.action) {\n case Actions.CopyToClipboard:\n return CopyIcon;\n case Actions.AttachToCase:\n return AttachIcon;\n case Actions.Quickview:\n return QuickviewIcon;\n case Actions.PostToFeed:\n return FeedIcon;\n case Actions.SendAsEmail:\n return EmailIcon;\n default:\n return QuickviewIcon;\n }\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.tooltip}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"version":3}
|
@@ -7,7 +7,7 @@ const insight = require('@coveo/headless/insight');
|
|
7
7
|
const attach = require('./attach-19283bec.js');
|
8
8
|
const initializationUtils = require('./initialization-utils-92f1b080.js');
|
9
9
|
const stencilIconButton = require('./stencil-iconButton-738b1548.js');
|
10
|
-
const
|
10
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
11
11
|
require('./dom-utils-d4790328.js');
|
12
12
|
require('./event-utils-9bfcf3c5.js');
|
13
13
|
require('./init-queue-a18aa323.js');
|
@@ -74,7 +74,7 @@ const AtomicInsightResultAttachToCaseAction = class {
|
|
74
74
|
: this.bindings.i18n.t('attach-to-case');
|
75
75
|
}
|
76
76
|
render() {
|
77
|
-
return (index.h(stencilIconButton.IconButton, { key: '
|
77
|
+
return (index.h(stencilIconButton.IconButton, { key: 'e1c89295cfce20a53f7fb4ee0c6bb749c9512969', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.getTooltip(), onClick: () => this.onClick() }));
|
78
78
|
}
|
79
79
|
get host() { return index.getElement(this); }
|
80
80
|
};
|
@@ -82,7 +82,7 @@ __decorate([
|
|
82
82
|
initializationUtils.InitializeBindings()
|
83
83
|
], AtomicInsightResultAttachToCaseAction.prototype, "bindings", void 0);
|
84
84
|
__decorate([
|
85
|
-
|
85
|
+
stencilResultTemplateDecorators.ResultContext()
|
86
86
|
], AtomicInsightResultAttachToCaseAction.prototype, "result", void 0);
|
87
87
|
__decorate([
|
88
88
|
initializationUtils.BindStateToController('attachToCase')
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-attach-to-case-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wCAAwC,GAAG,0ljEAA0ljE,CAAC;AAC5ojE,oDAAe,wCAAwC;;;;;;;;;;;;MC4B1C,qCAAqC;;;;;;;;IA+BzC,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAGA,yBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;KACF;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,UAAU,GAAGC,iBAAU,CAAC;KACjE;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;cACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC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M,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;KACF;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,UAAU,GAAGC,iBAAU,CAAC;KACjE;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;cACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;cACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;KAC5C;IAEM,MAAM;QACX,QACEC,QAACC,4BAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;;AAzE4B;IAA5BC,sCAAkB,EAAE;uEAAmC;AAC/B;IAAxBC,6CAAa,EAAE;qEAAyB;AASlC;IAFNC,yCAAqB,CAAC,cAAc,CAAC;gFAER;;;;;","names":["buildAttachToCase","AttachIcon","h","IconButton","InitializeBindings","ResultContext","BindStateToController"],"sources":["src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.pcss?tag=atomic-insight-result-attach-to-case-action","src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, Event, State, h, Element, EventEmitter} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport DetachIcon from '../../../images/detach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultAttachToCaseEvent {\n callback: () => void;\n result: Result;\n}\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-action` component can be nested inside a `atomic-insight-result-actions` to render an interactive button that will emit an `atomic/insight/attachToCase/attach` or `atomic/insight/attachToCase/detach` JavaScript event, based on its current state, when clicked.\n *\n * @part result-action-container - The result action container\n * @part result-action-button - The result action button\n * @part result-action-icon - The result action icon\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-action',\n styleUrl: 'atomic-insight-result-attach-to-case-action.pcss',\n})\nexport class AtomicInsightResultAttachToCaseAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n @Event({\n eventName: 'atomic/insight/attachToCase/attach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private attach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n @Event({\n eventName: 'atomic/insight/attachToCase/detach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private detach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n private onClick() {\n if (this.attachToCase.isAttached()) {\n this.detach.emit({\n callback: this.attachToCase.detach,\n result: this.result,\n });\n } else {\n this.attach.emit({\n callback: this.attachToCase.attach,\n result: this.result,\n });\n }\n }\n\n private getIcon() {\n return this.attachToCase.isAttached() ? DetachIcon : AttachIcon;\n }\n\n private getTooltip() {\n return this.attachToCase.isAttached()\n ? this.bindings.i18n.t('detach-from-case')\n : this.bindings.i18n.t('attach-to-case');\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.getTooltip()}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"version":3}
|
@@ -6,7 +6,7 @@ const index = require('./index-757bc886.js');
|
|
6
6
|
const insight = require('@coveo/headless/insight');
|
7
7
|
const attach = require('./attach-19283bec.js');
|
8
8
|
const initializationUtils = require('./initialization-utils-92f1b080.js');
|
9
|
-
const
|
9
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
10
10
|
require('./dom-utils-d4790328.js');
|
11
11
|
require('./event-utils-9bfcf3c5.js');
|
12
12
|
require('./init-queue-a18aa323.js');
|
@@ -43,7 +43,7 @@ const AtomicInsightResultAttachToCaseIndicator = class {
|
|
43
43
|
}
|
44
44
|
render() {
|
45
45
|
if (this.attachToCase.isAttached()) {
|
46
|
-
return (index.h("atomic-icon", { key: '
|
46
|
+
return (index.h("atomic-icon", { key: 'ba05b4a5586e7d21e3f5e2657b410a2514183874', part: "icon", class: "flex w-5 justify-center", icon: attach.AttachIcon, title: this.bindings.i18n.t('result-is-attached') }));
|
47
47
|
}
|
48
48
|
}
|
49
49
|
get host() { return index.getElement(this); }
|
@@ -52,7 +52,7 @@ __decorate([
|
|
52
52
|
initializationUtils.InitializeBindings()
|
53
53
|
], AtomicInsightResultAttachToCaseIndicator.prototype, "bindings", void 0);
|
54
54
|
__decorate([
|
55
|
-
|
55
|
+
stencilResultTemplateDecorators.ResultContext()
|
56
56
|
], AtomicInsightResultAttachToCaseIndicator.prototype, "result", void 0);
|
57
57
|
__decorate([
|
58
58
|
initializationUtils.BindStateToController('attachToCase')
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-attach-to-case-indicator.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,2CAA2C,GAAG,0ljEAA0ljE,CAAC;AAC/ojE,uDAAe,2CAA2C;;;;;;;;;;;;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IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAEC,iBAAU,EAChB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,GACpC,EACf;SACH;KACF;;;AAlC4B;IAA5BC,sCAAkB,EAAE;0EAAmC;AAC/B;IAAxBC,6CAAa,EAAE;wEAAyB;AASlC;IAFNC,yCAAqB,CAAC,cAAc,CAAC;mFAER;;;;;","names":["buildAttachToCase","h","AttachIcon","InitializeBindings","ResultContext","BindStateToController"],"sources":["src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.pcss?tag=atomic-insight-result-attach-to-case-indicator","src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, State, h, Element} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-indicator` component can be included inside a result template to indicate whether a result is attached to the current case.\n *\n * @part icon The icon that indicates whether the result is attached to the case.\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-indicator',\n styleUrl: 'atomic-insight-result-attach-to-case-indicator.pcss',\n})\nexport class AtomicInsightResultAttachToCaseIndicator\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n public render() {\n if (this.attachToCase.isAttached()) {\n return (\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={AttachIcon}\n title={this.bindings.i18n.t('result-is-attached')}\n ></atomic-icon>\n );\n }\n }\n}\n"],"version":3}
|
@@ -9,7 +9,7 @@ const preview = require('./preview-8eebe5d5.js');
|
|
9
9
|
const initializationUtils = require('./initialization-utils-92f1b080.js');
|
10
10
|
const stencilAccessibilityUtils = require('./stencil-accessibility-utils-86cc7071.js');
|
11
11
|
const stencilIconButton = require('./stencil-iconButton-738b1548.js');
|
12
|
-
const
|
12
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
13
13
|
require('./dom-utils-d4790328.js');
|
14
14
|
require('./event-utils-9bfcf3c5.js');
|
15
15
|
require('./init-queue-a18aa323.js');
|
@@ -118,7 +118,7 @@ const AtomicInsightResultQuickviewAction = class {
|
|
118
118
|
this.addQuickviewModalIfNeeded();
|
119
119
|
this.updateModalContent();
|
120
120
|
if (this.shouldRenderQuickview) {
|
121
|
-
return (index.h(stencilIconButton.IconButton, { key: '
|
121
|
+
return (index.h(stencilIconButton.IconButton, { key: 'e23b1775e764f5304d2247fe30cb090811abf86f', partPrefix: "result-action", style: "outline-neutral", ref: this.focusTarget.setTarget, icon: preview.QuickviewIcon, title: this.bindings.i18n.t('quickview'), onClick: () => this.onClick() }));
|
122
122
|
}
|
123
123
|
}
|
124
124
|
get host() { return index.getElement(this); }
|
@@ -127,7 +127,7 @@ __decorate([
|
|
127
127
|
initializationUtils.InitializeBindings()
|
128
128
|
], AtomicInsightResultQuickviewAction.prototype, "bindings", void 0);
|
129
129
|
__decorate([
|
130
|
-
|
130
|
+
stencilResultTemplateDecorators.ResultContext()
|
131
131
|
], AtomicInsightResultQuickviewAction.prototype, "result", void 0);
|
132
132
|
__decorate([
|
133
133
|
initializationUtils.BindStateToController('quickview')
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-insight-result-quickview-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,qCAAqC,GAAG,0ljEAA0ljE,CAAC;AACzojE,iDAAe,qCAAqC;;;;;;;;;;;;MC4BvC,kCAAkC;;;;;;;;;;;;;;QA6BtC,YAAO,GAAG,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAM/D,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAIA,+CAAqB,CAAC,IAAI,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;KAC/B;IAEM,UAAU;QACf,IAAI,CAAC,SAAS,GAAGC,uBAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpD,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;SAC/B,CAAC,CAAC;QACH,IAAIC,YAAM,CAAC;YACT,OAAO,EAAE,IAAIC,iBAAW,CAAC;gBACvB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,mBAAmB;aAC3B,CAAC;SACH,CAAC,CAAC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC,CAAC;KACtC;IAEO,yBAAyB;QAC/B,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,OAAO;SACR;QAED,MAAM,cAAc,GAAG,IA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W,CAAC,SAAS,EAC/B,IAAI,EAAEC,qBAAa,EACnB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,EACxC,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;SACH;KACF;;;AA5H4B;IAA5BC,sCAAkB,EAAE;oEAA4B;AACxB;IAAxBC,6CAAa,EAAE;kEAAyB;AAWlC;IAFNC,yCAAqB,CAAC,WAAW,CAAC;0EAEI;AAiB7B;IADTC,wCAAc,CAAC,WAAW,CAAC;gFACY;;;;;","names":["FocusTargetController","buildQuickview","Schema","StringValue","h","IconButton","QuickviewIcon","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"sources":["src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.pcss?tag=atomic-insight-result-quickview-action","src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n buildQuickview,\n QuickviewState,\n Quickview,\n Result,\n} from '@coveo/headless';\nimport {Component, Listen, Prop, State, h, Element} from '@stencil/core';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../utils/stencil-accessibility-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {Bindings} from '../../search/atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-quickview-action',\n styleUrl: 'atomic-insight-result-quickview-action.pcss',\n})\nexport class AtomicInsightResultQuickviewAction\n implements InitializableComponent\n{\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n private buttonFocusTarget?: FocusTargetController;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop()\n public sandbox = 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n private get shouldRenderQuickview() {\n return this.quickviewState.resultHasPreview;\n }\n\n public render() {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n if (this.shouldRenderQuickview) {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n ref={this.focusTarget.setTarget}\n icon={QuickviewIcon}\n title={this.bindings.i18n.t('quickview')}\n onClick={() => this.onClick()}\n />\n );\n }\n }\n}\n"],"version":3}
|
@@ -11,7 +11,7 @@ const resultUtils = require('./result-utils-3313d650.js');
|
|
11
11
|
const slotUtils = require('./slot-utils-a30cb814.js');
|
12
12
|
const attributesSlot = require('./attributes-slot-4e7d7a75.js');
|
13
13
|
const stencilItemLink = require('./stencil-item-link-9feaef61.js');
|
14
|
-
const
|
14
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
15
15
|
require('./dom-utils-d4790328.js');
|
16
16
|
require('./init-queue-a18aa323.js');
|
17
17
|
require('./initialization-lit-stencil-common-utils-730030b0.js');
|
@@ -59,7 +59,7 @@ const AtomicIPXResultLink = class {
|
|
59
59
|
const href = bueno.isUndefined(this.hrefTemplate)
|
60
60
|
? this.result.clickUri
|
61
61
|
: resultUtils.buildStringTemplateFromResult(this.hrefTemplate, this.result, this.bindings);
|
62
|
-
return (index.h(stencilItemLink.LinkWithItemAnalytics, { key: '
|
62
|
+
return (index.h(stencilItemLink.LinkWithItemAnalytics, { key: 'dce9d569cd2ad2a03e89e5d86365dbfb3ca78deb', href: href, onSelect: () => this.onSelect(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (index.h("slot", null)) : (index.h("atomic-result-text", { field: "title", default: "no-title" }))));
|
63
63
|
}
|
64
64
|
get host() { return index.getElement(this); }
|
65
65
|
};
|
@@ -67,10 +67,10 @@ __decorate([
|
|
67
67
|
initializationUtils.InitializeBindings()
|
68
68
|
], AtomicIPXResultLink.prototype, "bindings", void 0);
|
69
69
|
__decorate([
|
70
|
-
|
70
|
+
stencilResultTemplateDecorators.ResultContext()
|
71
71
|
], AtomicIPXResultLink.prototype, "result", void 0);
|
72
72
|
__decorate([
|
73
|
-
|
73
|
+
stencilResultTemplateDecorators.InteractiveResultContext()
|
74
74
|
], AtomicIPXResultLink.prototype, "interactiveResult", void 0);
|
75
75
|
AtomicIPXResultLink.style = AtomicIpxResultLinkStyle0;
|
76
76
|
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-ipx-result-link.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,o8kEAAo8kE,CAAC;AACp+kE,kCAAe,sBAAsB;;;;;;;;;;;;MCiCxB,mBAAmB;;;;;IA6BvB,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,aAAa,CACrBA,2BAAgB,CACd,+BAA+B,EAC/B,CAAC,eAAwB;YACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC,CACF,CACF,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAGC,qCAA4B,CACvD,IAAI,CAAC,QAAQ,CAAC,MAAM,CACrB,CAAC;KACH;IAEM,iBAAiB;QACtB,MAAM,QAAQ,GAAG,YAAY,CAAC;QAC9B,IAAI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AAC,QAAQ,CACd,CAAC;QAEN,QACEC,QAACC,qCAAqB,qDACpB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EACvE,qBAAqB,EAAE,MACrB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,IAEpC,IAAI,CAAC,cAAc,IAClBD,qBAAQ,KAERA,gCACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,GACE,CACvB,CACqB,EACxB;KACH;;;AAxF4B;IAA5BE,sCAAkB,EAAE;qDAAgC;AAG5B;IAAxBC,6CAAa,EAAE;mDAAkC;AACd;IAAnCC,wDAAwB,EAAE;8DAA+C;;;;;","names":["buildCustomEvent","loadIPXActionsHistoryActions","getDefaultSlotFromHost","getAttributesFromLinkSlot","isUndefined","buildStringTemplateFromResult","h","LinkWithItemAnalytics","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@reference '../../../utils/tailwind-utilities/link-style.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"version":3}
|
@@ -590,7 +590,7 @@ const AtomicQuickviewModal = class {
|
|
590
590
|
});
|
591
591
|
}
|
592
592
|
render() {
|
593
|
-
return (index.h("atomic-modal", { key: '
|
593
|
+
return (index.h("atomic-modal", { key: 'a99d0aa49ca1f74b0894dd9764e2c02498b848eb', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: exportParts.ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
|
594
594
|
}
|
595
595
|
static get watchers() { return {
|
596
596
|
"highlightKeywords": ["watchHighlightKeywords"]
|
@@ -9,7 +9,7 @@ const quickview = require('./quickview-b74d3d85.js');
|
|
9
9
|
const initializationUtils = require('./initialization-utils-92f1b080.js');
|
10
10
|
const stencilAccessibilityUtils = require('./stencil-accessibility-utils-86cc7071.js');
|
11
11
|
const stencilButton = require('./stencil-button-94b89acc.js');
|
12
|
-
const
|
12
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
13
13
|
require('./dom-utils-d4790328.js');
|
14
14
|
require('./event-utils-9bfcf3c5.js');
|
15
15
|
require('./init-queue-a18aa323.js');
|
@@ -116,7 +116,7 @@ const AtomicQuickview = class {
|
|
116
116
|
}
|
117
117
|
render() {
|
118
118
|
if (this.quickviewState.resultHasPreview) {
|
119
|
-
return (index.h(stencilButton.Button, { key: '
|
119
|
+
return (index.h(stencilButton.Button, { key: '812c28d91ada60004a79baf65b805c0974c506ad', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, index.h("atomic-icon", { key: 'b2c17750551b3c893b5b6e1f22a5969bbc76ecab', part: "icon", class: "flex w-5 justify-center", icon: quickview.QuickviewIcon })));
|
120
120
|
}
|
121
121
|
}
|
122
122
|
};
|
@@ -124,7 +124,7 @@ __decorate([
|
|
124
124
|
initializationUtils.InitializeBindings()
|
125
125
|
], AtomicQuickview.prototype, "bindings", void 0);
|
126
126
|
__decorate([
|
127
|
-
|
127
|
+
stencilResultTemplateDecorators.ResultContext()
|
128
128
|
], AtomicQuickview.prototype, "result", void 0);
|
129
129
|
__decorate([
|
130
130
|
initializationUtils.BindStateToController('quickview')
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-quickview.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,0ljEAA0ljE,CAAC;AACtnjE,8BAAe,kBAAkB;;;;;;;;;;;;MCoCpB,eAAe;;;;;;;;;;;;;;QAwBX,YAAO,GACpB,qDAAqD,CAAC;;;uBAAtD,qDAAqD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CAAkB,EAAE;iDAA4B;AACxB;IAAxBC,6CAAa,EAAE;+CAAyB;AASlC;IAFNC,yCAAqB,CAAC,WAAW,CAAC;uDAEI;AAiB7B;IADTC,wCAAc,CAAC,WAAW,CAAC;6DACY;;;;;","names":["FocusTargetController","buildQuickview","Schema","StringValue","h","Button","QuickviewIcon","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"sources":["src/components/search/result-template-components/atomic-quickview/atomic-quickview.pcss?tag=atomic-quickview&encapsulation=shadow","src/components/search/result-template-components/atomic-quickview/atomic-quickview.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n Result,\n buildQuickview,\n Quickview,\n QuickviewState,\n} from '@coveo/headless';\nimport {Component, h, Listen, Prop, State} from '@stencil/core';\nimport QuickviewIcon from '../../../../images/quickview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {Button} from '../../../common/stencil-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-quickview` component renders a button which the end user can click to open a modal box containing a preview\n * about a result.\n *\n * The `atomic-quickview` is not meant to replace the `atomic-result-link` to access an item in a result template; it has certain limitations (e.g., custom styles and embedded\n * images/links may not work as expected in an `atomic-quickview`).\n *\n * @part button - The button that opens the quickview modal on click.\n * @part icon - The icon for the quickview button.\n */\n@Component({\n tag: 'atomic-quickview',\n styleUrl: 'atomic-quickview.pcss',\n shadow: true,\n})\nexport class AtomicQuickview implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n private buttonFocusTarget?: FocusTargetController;\n\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop() public sandbox =\n 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n componentWillUpdate(): void {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n }\n\n public render() {\n if (this.quickviewState.resultHasPreview) {\n return (\n <Button\n part=\"button\"\n title={this.bindings.i18n.t('quickview')}\n style=\"outline-primary\"\n class=\"p-2\"\n onClick={(event) => this.onClick(event)}\n ref={this.focusTarget.setTarget}\n >\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={QuickviewIcon}\n ></atomic-icon>\n </Button>\n );\n }\n }\n}\n"],"version":3}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-757bc886.js');
|
6
6
|
const headless = require('@coveo/headless');
|
7
|
-
const
|
7
|
+
const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
|
8
8
|
require('./stencil-item-decorators-43a96f33.js');
|
9
9
|
require('./dom-utils-d4790328.js');
|
10
10
|
require('./event-utils-9bfcf3c5.js');
|
@@ -62,7 +62,7 @@ const AtomicResultBadge = class {
|
|
62
62
|
get host() { return index.getElement(this); }
|
63
63
|
};
|
64
64
|
__decorate([
|
65
|
-
|
65
|
+
stencilResultTemplateDecorators.ResultContext()
|
66
66
|
], AtomicResultBadge.prototype, "result", void 0);
|
67
67
|
AtomicResultBadge.style = AtomicResultBadgeStyle0;
|
68
68
|
|