@coveops/abi 0.6.0 → 0.8.0
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/abi/abi.css +1 -1
- package/dist/abi/abi.esm.js +1 -1
- package/dist/abi/index.esm.js +1 -1
- package/dist/abi/p-0b2d2c7b.entry.js +1 -0
- package/dist/abi/p-1c8e5ecc.entry.js +1 -0
- package/dist/abi/{p-24a5774b.entry.js → p-9f80f982.entry.js} +1 -1
- package/dist/abi/{p-adb4a9f9.entry.js → p-e7416b40.entry.js} +1 -1
- package/dist/abi/p-facfefe1.js +2 -0
- package/dist/bundle/index.css +1 -1
- package/dist/bundle/index.html +1 -1
- package/dist/bundle/index.js +28 -28
- package/dist/cjs/abi.cjs.js +1 -1
- package/dist/cjs/faq-popup-component.cjs.entry.js +33 -16
- package/dist/cjs/{index-9c1d2337.js → index-87155b50.js} +32 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/results-manager.cjs.entry.js +10 -10
- package/dist/cjs/sample-component.cjs.entry.js +1 -1
- package/dist/cjs/strip-html-component.cjs.entry.js +1 -1
- package/dist/collection/components/faq-popup-component/faq-popup-component.js +32 -15
- package/dist/components/index.js +74 -26
- package/dist/esm/abi.js +1 -1
- package/dist/esm/faq-popup-component.entry.js +33 -16
- package/dist/esm/{index-8b0b351b.js → index-99665e7c.js} +32 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/results-manager.entry.js +10 -10
- package/dist/esm/sample-component.entry.js +1 -1
- package/dist/esm/strip-html-component.entry.js +1 -1
- package/package.json +1 -1
- package/src/components/faq-popup-component/faq-popup-component.tsx +38 -20
- package/src/components/results-manager/AppTemplate.html +1 -1
- package/src/components/results-manager/DocumentsTemplate.html +1 -1
- package/src/components/results-manager/ELearningTemplate.html +1 -1
- package/src/components/results-manager/FAQTemplate.html +1 -1
- package/src/components/results-manager/KATemplate.html +2 -2
- package/src/components/results-manager/MediaTemplate.html +2 -2
- package/src/components/results-manager/QuickLinksTemplate.html +1 -1
- package/src/components/results-manager/SitePagesTemplate.html +1 -1
- package/src/components/results-manager/template-1.html +1 -1
- package/src/pages/index.html +1 -1
- package/src/style/index.css +51 -18
- package/dist/abi/p-1cbc472e.entry.js +0 -1
- package/dist/abi/p-3d7bc0f4.entry.js +0 -1
- package/dist/abi/p-52c70e74.js +0 -2
    
        package/dist/esm/abi.js
    CHANGED
    
    
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            import { r as registerInstance, h, g as getElement, H as Host } from './index- | 
| 1 | 
            +
            import { r as registerInstance, h, g as getElement, H as Host } from './index-99665e7c.js';
         | 
| 2 2 | 
             
            import { i as initializeBindings, F as Fde } from './index-42e9a708.js';
         | 
| 3 3 | 
             
            import { r as resultContext } from './result-template-decorators-881a4c8e-ed85ad21.js';
         | 
| 4 4 | 
             
            import './headless.esm-085e70ed-c4dfb380.js';
         | 
| @@ -41,36 +41,53 @@ const FaqPopupComponent = class { | |
| 41 41 | 
             
                  this.bindings.engine.dispatch(logClickEvent(logClickPayload));
         | 
| 42 42 | 
             
                }
         | 
| 43 43 | 
             
                this.modalElement.source = this.host;
         | 
| 44 | 
            -
                this.modalElement.querySelector('[slot=header]').children[0].innerHTML = 'Question: ' + (((_a = this.result) === null || _a === void 0 ? void 0 : _a.title) || '');
         | 
| 45 44 | 
             
                // Get the body slot
         | 
| 46 45 | 
             
                const bodySlot = this.modalElement.querySelector('[slot=body]');
         | 
| 47 46 | 
             
                // Clear any existing content
         | 
| 48 47 | 
             
                bodySlot.innerHTML = '';
         | 
| 49 | 
            -
                const  | 
| 50 | 
            -
                 | 
| 51 | 
            -
                 | 
| 48 | 
            +
                const tableEl = document.createElement('table');
         | 
| 49 | 
            +
                const questionElement = document.createElement("tr");
         | 
| 50 | 
            +
                questionElement.className = "question-row";
         | 
| 51 | 
            +
                questionElement.innerHTML = '<td>Question: </td> <td>' + (((_a = this.result) === null || _a === void 0 ? void 0 : _a.title) || '') + '</td>'
         | 
| 52 | 
            +
                  + '<div id="faq-modal-close-button"><svg width="48" height="49" viewBox="0 0 48 49" fill="black" xmlns="http://www.w3.org/2000/svg"><rect y="0.5" width="48" height="48" rx="24" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M22.5382 24.5L15 16.9618L16.4618 15.5L24 23.0382L31.5382 15.5L33 16.9618L25.4618 24.5L33 32.0382L31.5382 33.5L24 25.9618L16.4618 33.5L15 32.0382L22.5382 24.5Z" fill="#17171A"/></svg></div>';
         | 
| 53 | 
            +
                tableEl.appendChild(questionElement);
         | 
| 54 | 
            +
                const answerElement = document.createElement('tr');
         | 
| 52 55 | 
             
                // Create the answer title element and set its text
         | 
| 53 | 
            -
                const answerTitleElement = document.createElement(' | 
| 56 | 
            +
                const answerTitleElement = document.createElement('td');
         | 
| 54 57 | 
             
                answerTitleElement.innerText = 'Answer:';
         | 
| 55 58 | 
             
                answerElement.appendChild(answerTitleElement);
         | 
| 56 | 
            -
                // Get the answer from the result object
         | 
| 57 | 
            -
                const answerContent = ((_b = this.result) === null || _b === void 0 ? void 0 : _b.raw.answer) || '';
         | 
| 58 59 | 
             
                // Create a new element to contain the answer content
         | 
| 59 | 
            -
                const answerContentElement = document.createElement(' | 
| 60 | 
            -
                answerContentElement.innerHTML =  | 
| 60 | 
            +
                const answerContentElement = document.createElement('td');
         | 
| 61 | 
            +
                answerContentElement.innerHTML = ((_b = this.result) === null || _b === void 0 ? void 0 : _b.raw.answer) || '';
         | 
| 61 62 | 
             
                // Append the answer content element to the answer element
         | 
| 62 63 | 
             
                answerElement.appendChild(answerContentElement);
         | 
| 63 64 | 
             
                // Now, the answer element has the title and the content properly appended
         | 
| 64 | 
            -
                 | 
| 65 | 
            +
                tableEl.appendChild(answerElement);
         | 
| 66 | 
            +
                if ((_c = this.result) === null || _c === void 0 ? void 0 : _c.raw.category) {
         | 
| 67 | 
            +
                  const categoryElement = document.createElement("tr");
         | 
| 68 | 
            +
                  categoryElement.innerHTML = '<td> Category: </td><td>' + this.result.raw.category + '</td>';
         | 
| 69 | 
            +
                  tableEl.appendChild(categoryElement);
         | 
| 70 | 
            +
                }
         | 
| 71 | 
            +
                if ((_d = this.result) === null || _d === void 0 ? void 0 : _d.raw.newmoreinfo) {
         | 
| 72 | 
            +
                  const linkElement = document.createElement("tr");
         | 
| 73 | 
            +
                  const linkUrl = this.result.raw.newmoreinfo;
         | 
| 74 | 
            +
                  linkElement.innerHTML = '<td> Link: </td><td> <a href="' + linkUrl + '" target="_blank">' + linkUrl + '</a> </td>';
         | 
| 75 | 
            +
                  tableEl.appendChild(linkElement);
         | 
| 76 | 
            +
                }
         | 
| 65 77 | 
             
                // Create and append the category element
         | 
| 66 | 
            -
                const categoryElement = document.createElement('div');
         | 
| 67 | 
            -
                categoryElement.innerHTML = 'Category: ' + ( | 
| 78 | 
            +
                /*const categoryElement = document.createElement('div');
         | 
| 79 | 
            +
                categoryElement.innerHTML = 'Category: ' + (this.result?.raw.category || '');
         | 
| 68 80 | 
             
                bodySlot.appendChild(categoryElement);
         | 
| 81 | 
            +
             | 
| 82 | 
            +
             | 
| 83 | 
            +
             | 
| 84 | 
            +
             | 
| 69 85 | 
             
                const linkElement = document.createElement('div');
         | 
| 70 | 
            -
                const linkUrl =  | 
| 86 | 
            +
                const linkUrl = this.result?.raw.newmoreinfo || '';
         | 
| 71 87 | 
             
                linkElement.innerHTML = `Link: <a href="${linkUrl}" target="_blank">${linkUrl}</a>`;
         | 
| 72 | 
            -
                bodySlot.appendChild(linkElement) | 
| 73 | 
            -
                 | 
| 88 | 
            +
                bodySlot.appendChild(linkElement);*/
         | 
| 89 | 
            +
                bodySlot.appendChild(tableEl);
         | 
| 90 | 
            +
                this.modalElement.querySelector('#faq-modal-close-button').addEventListener('click', this.closeFAQModal);
         | 
| 74 91 | 
             
                this.modalElement.setAttribute('is-open', 'true');
         | 
| 75 92 | 
             
                if (this.result) {
         | 
| 76 93 | 
             
                  localStorage.setItem(`visited-${this.result.title}`, 'true');
         | 
| @@ -118,6 +118,11 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$); | |
| 118 118 | 
             
             * Don't add values to these!!
         | 
| 119 119 | 
             
             */
         | 
| 120 120 | 
             
            const EMPTY_OBJ = {};
         | 
| 121 | 
            +
            /**
         | 
| 122 | 
            +
             * Namespaces
         | 
| 123 | 
            +
             */
         | 
| 124 | 
            +
            const SVG_NS = 'http://www.w3.org/2000/svg';
         | 
| 125 | 
            +
            const HTML_NS = 'http://www.w3.org/1999/xhtml';
         | 
| 121 126 | 
             
            const isDef = (v) => v != null;
         | 
| 122 127 | 
             
            const isComplexType = (o) => {
         | 
| 123 128 | 
             
                // https://jsperf.com/typeof-fn-object/5
         | 
| @@ -353,8 +358,15 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { | |
| 353 358 | 
             
                    elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
         | 
| 354 359 | 
             
                }
         | 
| 355 360 | 
             
                else {
         | 
| 361 | 
            +
                    if (!isSvgMode) {
         | 
| 362 | 
            +
                        isSvgMode = newVNode.$tag$ === 'svg';
         | 
| 363 | 
            +
                    }
         | 
| 356 364 | 
             
                    // create element
         | 
| 357 | 
            -
                    elm = newVNode.$elm$ = (doc. | 
| 365 | 
            +
                    elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
         | 
| 366 | 
            +
                        );
         | 
| 367 | 
            +
                    if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
         | 
| 368 | 
            +
                        isSvgMode = false;
         | 
| 369 | 
            +
                    }
         | 
| 358 370 | 
             
                    // add css classes, attrs, props, listeners, etc.
         | 
| 359 371 | 
             
                    {
         | 
| 360 372 | 
             
                        updateElement(null, newVNode, isSvgMode);
         | 
| @@ -375,6 +387,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { | |
| 375 387 | 
             
                            }
         | 
| 376 388 | 
             
                        }
         | 
| 377 389 | 
             
                    }
         | 
| 390 | 
            +
                    {
         | 
| 391 | 
            +
                        if (newVNode.$tag$ === 'svg') {
         | 
| 392 | 
            +
                            // Only reset the SVG context when we're exiting <svg> element
         | 
| 393 | 
            +
                            isSvgMode = false;
         | 
| 394 | 
            +
                        }
         | 
| 395 | 
            +
                        else if (elm.tagName === 'foreignObject') {
         | 
| 396 | 
            +
                            // Reenter SVG context when we're exiting <foreignObject> element
         | 
| 397 | 
            +
                            isSvgMode = true;
         | 
| 398 | 
            +
                        }
         | 
| 399 | 
            +
                    }
         | 
| 378 400 | 
             
                }
         | 
| 379 401 | 
             
                return elm;
         | 
| 380 402 | 
             
            };
         | 
| @@ -481,8 +503,14 @@ const patch = (oldVNode, newVNode) => { | |
| 481 503 | 
             
                const elm = (newVNode.$elm$ = oldVNode.$elm$);
         | 
| 482 504 | 
             
                const oldChildren = oldVNode.$children$;
         | 
| 483 505 | 
             
                const newChildren = newVNode.$children$;
         | 
| 506 | 
            +
                const tag = newVNode.$tag$;
         | 
| 484 507 | 
             
                const text = newVNode.$text$;
         | 
| 485 508 | 
             
                if (text === null) {
         | 
| 509 | 
            +
                    {
         | 
| 510 | 
            +
                        // test if we're rendering an svg element, or still rendering nodes inside of one
         | 
| 511 | 
            +
                        // only add this to the when the compiler sees we're using an svg somewhere
         | 
| 512 | 
            +
                        isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
         | 
| 513 | 
            +
                    }
         | 
| 486 514 | 
             
                    // element node
         | 
| 487 515 | 
             
                    {
         | 
| 488 516 | 
             
                        {
         | 
| @@ -509,6 +537,9 @@ const patch = (oldVNode, newVNode) => { | |
| 509 537 | 
             
                        // no new child vnodes, but there are old child vnodes to remove
         | 
| 510 538 | 
             
                        removeVnodes(oldChildren, 0, oldChildren.length - 1);
         | 
| 511 539 | 
             
                    }
         | 
| 540 | 
            +
                    if (isSvgMode && tag === 'svg') {
         | 
| 541 | 
            +
                        isSvgMode = false;
         | 
| 542 | 
            +
                    }
         | 
| 512 543 | 
             
                }
         | 
| 513 544 | 
             
                else if (oldVNode.$text$ !== text) {
         | 
| 514 545 | 
             
                    // update the text content for the text only vnode
         | 
    
        package/dist/esm/index.js
    CHANGED
    
    | @@ -5,7 +5,7 @@ async function main() { | |
| 5 5 | 
             
              const searchInterface = document.querySelector("atomic-search-interface");
         | 
| 6 6 | 
             
              const platformUrl = "https://platform.cloud.coveo.com";
         | 
| 7 7 | 
             
              const organizationId = "anheuserbuschinbevprod";
         | 
| 8 | 
            -
              const accessToken = " | 
| 8 | 
            +
              const accessToken = "x831705fd-ca93-4aa8-b4c6-c965a24c5f50";
         | 
| 9 9 | 
             
              await searchInterface.initialize({
         | 
| 10 10 | 
             
                accessToken,
         | 
| 11 11 | 
             
                organizationId,
         | 
    
        package/dist/esm/loader.js
    CHANGED