@coveops/abi 0.4.1 → 0.5.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.
Files changed (61) hide show
  1. package/dist/abi/abi.css +1 -1
  2. package/dist/abi/abi.esm.js +1 -1
  3. package/dist/abi/p-0f4a7ce9.js +49 -0
  4. package/dist/abi/p-52c70e74.js +2 -0
  5. package/dist/abi/p-5a5f74eb.entry.js +1 -0
  6. package/dist/abi/p-adb4a9f9.entry.js +1 -0
  7. package/dist/abi/p-b62c5f66.entry.js +1 -0
  8. package/dist/abi/p-b83bab81.js +1 -0
  9. package/dist/abi/p-d20ee37c.js +18 -0
  10. package/dist/abi/p-e7475cc6.entry.js +1 -0
  11. package/dist/bundle/index.css +1 -1
  12. package/dist/bundle/index.html +6 -6
  13. package/dist/bundle/index.js +170 -91
  14. package/dist/cjs/abi.cjs.js +2 -2
  15. package/dist/cjs/faq-popup-component.cjs.entry.js +10 -36
  16. package/dist/cjs/{index-daa118f5.js → headless.esm-085e70ed-f2e18485.js} +0 -96
  17. package/dist/cjs/index-03be0841.js +100 -0
  18. package/dist/cjs/{index-bea59ea1.js → index-9c1d2337.js} +25 -0
  19. package/dist/cjs/loader.cjs.js +2 -2
  20. package/dist/cjs/result-template-decorators-881a4c8e-4ff46481.js +33 -0
  21. package/dist/cjs/results-manager.cjs.entry.js +11 -11
  22. package/dist/cjs/sample-component.cjs.entry.js +3 -2
  23. package/dist/cjs/strip-html-component.cjs.entry.js +60 -0
  24. package/dist/collection/collection-manifest.json +2 -1
  25. package/dist/collection/components/strip-html-component/strip-html-component.css +3 -0
  26. package/dist/collection/components/strip-html-component/strip-html-component.js +64 -0
  27. package/dist/components/index.d.ts +6 -0
  28. package/dist/components/index.js +92 -12
  29. package/dist/esm/abi.js +2 -2
  30. package/dist/esm/faq-popup-component.entry.js +4 -30
  31. package/dist/esm/{index-77ebb3d5.js → headless.esm-085e70ed-c4dfb380.js} +1 -93
  32. package/dist/esm/index-42e9a708.js +95 -0
  33. package/dist/esm/{index-51334f26.js → index-8b0b351b.js} +25 -0
  34. package/dist/esm/loader.js +2 -2
  35. package/dist/esm/result-template-decorators-881a4c8e-ed85ad21.js +31 -0
  36. package/dist/esm/results-manager.entry.js +11 -11
  37. package/dist/esm/sample-component.entry.js +3 -2
  38. package/dist/esm/strip-html-component.entry.js +56 -0
  39. package/dist/types/components/strip-html-component/strip-html-component.d.ts +14 -0
  40. package/dist/types/components.d.ts +13 -0
  41. package/package.json +1 -1
  42. package/src/components/results-manager/AppTemplate.html +32 -14
  43. package/src/components/results-manager/DocumentsTemplate.html +16 -4
  44. package/src/components/results-manager/ELearningTemplate.html +10 -8
  45. package/src/components/results-manager/FAQTemplate.html +11 -6
  46. package/src/components/results-manager/KATemplate.html +12 -8
  47. package/src/components/results-manager/MediaTemplate.html +18 -0
  48. package/src/components/results-manager/PeopleTemplate.html +3 -3
  49. package/src/components/results-manager/QuickLinksTemplate.html +15 -3
  50. package/src/components/results-manager/SitePagesTemplate.html +8 -2
  51. package/src/components/results-manager/template-1.html +83 -41
  52. package/src/components/strip-html-component/strip-html-component.css +3 -0
  53. package/src/components/strip-html-component/strip-html-component.tsx +77 -0
  54. package/src/components.d.ts +13 -0
  55. package/src/pages/index.html +6 -6
  56. package/src/style/index.css +13 -4
  57. package/dist/abi/p-0ae1e588.js +0 -2
  58. package/dist/abi/p-27bd9f1c.entry.js +0 -1
  59. package/dist/abi/p-63fd8dcd.js +0 -66
  60. package/dist/abi/p-e04b6a2c.entry.js +0 -1
  61. package/dist/abi/p-fc39046e.entry.js +0 -1
@@ -0,0 +1,2 @@
1
+ let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),i=new WeakMap,a=e=>"sc-"+e.o,u={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1;const c=[],r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?c[c.length-1].i+=l:c.push(s?y(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=y(e,null);return i.u=t,c.length>0&&(i.$=c),i},y=(e,t)=>({t:0,m:e,i:t,p:null,$:null,u:null}),d={},m=(e,t,n,s,c,r)=>{if(n!==s){let i=z(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=h(n),o=h(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("style"===t){for(const t in n)s&&null!=s[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in s)n&&s[t]===n[t]||(t.includes("-")?e.style.setProperty(t,s[t]):e.style[t]=s[t])}else if(i||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{const l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):z(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},p=/\s/,h=e=>e?e.split(p):[],b=(e,t,n,l)=>{const s=11===t.p.nodeType&&t.p.host?t.p.host:t.p,o=e&&e.u||u,c=t.u||u;for(l in o)l in c||m(s,l,o[l],void 0,n,t.t);for(l in c)m(s,l,o[l],c[l],n,t.t)},w=(t,n,l)=>{const o=n.$[l];let c,r,i=0;if(null!==o.i)c=o.p=s.createTextNode(o.i);else if(c=o.p=s.createElement(o.m),b(null,o,!1),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),o.$)for(i=0;i<o.$.length;++i)r=w(t,o,i),r&&c.appendChild(r);return c},S=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=w(null,l,o),r&&(s[o].p=r,i.insertBefore(r,n)))},g=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.p.remove()},j=(e,t)=>e.m===t.m,k=(e,t)=>{const n=t.p=e.p,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],a=t[r],u=l.length-1,f=l[0],$=l[u];for(;o<=r&&c<=u;)null==i?i=t[++o]:null==a?a=t[--r]:null==f?f=l[++c]:null==$?$=l[--u]:j(i,f)?(k(i,f),i=t[++o],f=l[++c]):j(a,$)?(k(a,$),a=t[--r],$=l[--u]):j(i,$)?(k(i,$),e.insertBefore(i.p,a.p.nextSibling),i=t[++o],$=l[--u]):j(a,f)?(k(a,f),e.insertBefore(a.p,i.p),a=t[--r],f=l[++c]):(s=w(t&&t[c],n,c),f=l[++c],s&&i.p.parentNode.insertBefore(s,i.p));o>r?S(e,null==l[u+1]?null:l[u+1].p,n,l,c,u):c>u&&g(t,o,r)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},C=e=>F(e).h,v=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},M=(e,t)=>{if(e.t|=16,!(4&e.t))return v(e,e.g),ee((()=>O(e,t)));e.t|=512},O=(e,t)=>{const n=e.j;let l;return t&&(l=T(n,"componentWillLoad")),W(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.h,o=l["s-rc"];n&&(e=>{const t=e.k,n=e.h,l=t.t,o=((e,t)=>{let n=a(t);const l=I.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=i.get(e=e.head||e);o||i.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);x(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.h,o=n.C||y(null,null),c=(e=>e&&e.m===d)(l)?l:$(null,null,l);t=s.tagName,c.m=null,c.t|=4,n.C=c,c.p=o.p=s.shadowRoot||s,e=s["s-sc"],k(o,c)})(n,l)}catch(e){B(e,n.h)}return null},E=e=>{const t=e.h,n=e.g;64&e.t||(e.t|=64,A(t),e.v(t),n||N()),e.S&&(e.S(),e.S=void 0),512&e.t&&Z((()=>M(e,!1))),e.t&=-517},L=e=>{{const t=F(e),n=t.h.isConnected;return n&&2==(18&t.t)&&M(t,!1),n}},N=()=>{A(s.documentElement),Z((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"abi"}});return e.dispatchEvent(t),t})(l)))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){B(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),A=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.M){const l=Object.entries(t.M),s=e.prototype;l.map((([e,[t]])=>{(31&t||2&n&&32&t)&&Object.defineProperty(s,e,{get(){return((e,t)=>F(this).O.get(t))(0,e)},set(t){((e,t,n)=>{const l=F(e),s=l.O.get(t),o=l.t,c=l.j;n=(e=>(null==e||f(e),e))(n),8&o&&void 0!==s||n===s||Number.isNaN(s)&&Number.isNaN(n)||(l.O.set(t,n),c&&2==(18&o)&&M(l,!1))})(this,e,t)},configurable:!0,enumerable:!0})}))}return e},R=e=>{T(e,"connectedCallback")},U=(e,t={})=>{const n=[],c=t.exclude||[],i=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),$=s.createElement("style"),y=[];let d,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],M:t[2],P:t[3]};l.M=t[2];const s=l.o,u=class extends HTMLElement{constructor(e){super(e),_(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),m?y.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=F(e),n=t.k,l=()=>{};if(1&t.t)R(t.j);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){v(t,t.g=n);break}}(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=G(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){B(e)}t.t&=-9,e(),R(t.j)}if(s.style){let e=s.style;const t=a(n);if(!I.has(t)){const l=()=>{};((e,t,n)=>{let l=I.get(e);r&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,I.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,c=()=>M(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{0==(1&o.t)&&T(F(this).j,"disconnectedCallback")})()))}componentOnReady(){return F(this).L}};l.N=e[0],c.includes(s)||i.get(s)||(n.push(s),i.define(s,H(u,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),u.insertBefore($,f?f.nextSibling:u.firstChild),m=!1,y.length?y.map((e=>e.connectedCallback())):o.jmp((()=>d=setTimeout(N,30)))},q=new WeakMap,F=e=>q.get(e),V=(e,t)=>q.set(t.j=e,t),_=(e,t)=>{const n={t:0,h:e,k:t,O:new Map};return n.L=new Promise((e=>n.v=e)),e["s-p"]=[],e["s-rc"]=[],q.set(e,n)},z=(e,t)=>t in e,B=(e,t)=>(0,console.error)(e,t),D=new Map,G=e=>{const t=e.o.replace(/-/g,"_"),n=e.N,l=D.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(D.set(n,e),e[t])),B)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},I=new Map,J=[],K=[],Q=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?Z(Y):o.raf(Y))},X=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){B(e)}e.length=0},Y=()=>{X(J),X(K),(n=J.length>0)&&o.raf(Y)},Z=e=>c().then(e),ee=Q(K,!0);export{d as H,U as b,L as f,C as g,$ as h,c as p,V as r}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as s,H as o}from"./p-52c70e74.js";import{i as c,F as e}from"./p-0f4a7ce9.js";import{r as n}from"./p-b83bab81.js";import"./p-d20ee37c.js";const a=class{constructor(i){t(this,i),this.closeFAQModal=()=>{this.modalElement.setAttribute("is-open","false"),this.modalElement.querySelector("#btn-done").removeEventListener("click",this.closeFAQModal)}}async connectedCallback(){var t;try{this.bindings=await c(this.host),this.result=await n(this.host),this.modalElement=null===(t=this.bindings)||void 0===t?void 0:t.interfaceElement.querySelector("#faq-modal")}catch(t){console.error(t),this.host.remove()}}openFAQModal(t){var i,s,o,c;if(this.bindings){const{logClickEvent:i}=e(this.bindings.engine);this.bindings.engine.dispatch(i({evt:"documentQuickview",result:t}))}this.modalElement.source=this.host,this.modalElement.querySelector("[slot=header]").children[0].innerHTML="Question: "+((null===(i=this.result)||void 0===i?void 0:i.title)||"");const n=this.modalElement.querySelector("[slot=body]");n.innerHTML="";const a=document.createElement("div");a.style.display="flex",a.style.gap="16px";const h=document.createElement("div");h.innerText="Answer:",a.appendChild(h);const l=(null===(s=this.result)||void 0===s?void 0:s.raw.answer)||"",r=document.createElement("div");r.innerHTML=l,a.appendChild(r),n.appendChild(a);const d=document.createElement("div");d.innerHTML="Category: "+((null===(o=this.result)||void 0===o?void 0:o.raw.category)||""),n.appendChild(d);const v=document.createElement("div"),m=(null===(c=this.result)||void 0===c?void 0:c.raw.newmoreinfo)||"";v.innerHTML=`Link: <a href="${m}" target="_blank">${m}</a>`,n.appendChild(v),this.modalElement.querySelector("#faq-modal-close").addEventListener("click",this.closeFAQModal),this.modalElement.setAttribute("is-open","true")}render(){if(this.result)return i(o,{className:"clickable-host",onClick:()=>this.openFAQModal(this.result)},this.result.title)}get host(){return s(this)}};a.style="b{color:var(--atomic-primary)}";export{a as faq_popup_component}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as s,f as o}from"./p-52c70e74.js";import{i as e,n,D as a}from"./p-0f4a7ce9.js";import{w as h}from"./p-38555fec.js";import"./p-d20ee37c.js";const r=class{constructor(i){t(this,i),this.pagerUnsubscribe=()=>{},this.statusUnsubscribe=()=>{},this.i18nUnsubscribe=()=>{}}async connectedCallback(){try{await h(),this.bindings=await e(this.host);const t=n(this.bindings.engine);this.pagerController=a(this.bindings.engine),this.statusUnsubscribe=t.subscribe((()=>this.statusState=t.state)),this.pagerUnsubscribe=this.pagerController.subscribe((()=>this.pagerState=this.pagerController.state));const i=()=>o(this);this.bindings.i18n.on("languageChanged",i),this.i18nUnsubscribe=()=>this.bindings.i18n.off("languageChanged",i)}catch(t){console.error(t),this.error=t}}disconnectedCallback(){this.pagerUnsubscribe(),this.statusUnsubscribe(),this.i18nUnsubscribe()}get pages(){return this.pagerState.currentPages.map((t=>this.buildPage(t)))}buildPage(t){const s=this.pagerController.isCurrentPage(t);return i("button",{onClick:()=>{this.pagerController.selectPage(t)}},s?"✓ ":"",t.toLocaleString(this.bindings.i18n.language))}get previous(){return i("button",{onClick:()=>{this.pagerController.previousPage()}},i("atomic-text",{value:"previous"}))}get next(){return i("button",{onClick:()=>{this.pagerController.nextPage()}},i("atomic-text",{value:"next"}))}render(){return this.error?i("p",null,"Error when initializing the component, please view the console for more information."):this.bindings&&this.statusState.hasResults?i("nav",null,this.pagerState.hasPreviousPage&&this.previous,this.pages,this.pagerState.hasNextPage&&this.next):void 0}get host(){return s(this)}};r.style="nav{width:300px;display:flex;justify-content:space-around}button{color:var(--atomic-on-primary);background-color:var(--atomic-primary)}";export{r as sample_component}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as r}from"./p-52c70e74.js";import"./p-d20ee37c.js";import{r as s}from"./p-b83bab81.js";const e=class{constructor(i){t(this,i)}async connectedCallback(){try{this.result=await s(this.host)}catch(t){console.error(t),this.host.remove()}}stripHtmlAndEntities(t){var i=document.createElement("div");return i.innerHTML=t,(i.textContent||i.innerText||"").replace(/&#(\d+);/g,((t,i)=>String.fromCharCode(i)))}render(){if(!this.result)return;let t;t="Quick Links"==this.result.raw.abicontenttype?this.result.excerpt||"No description available":this.result.raw.description;let r="";return"string"==typeof t&&(r=this.stripHtmlAndEntities(t)),i("div",{style:{fontSize:"13px"}},r)}get host(){return r(this)}};e.style="b{color:var(--atomic-primary)}";export{e as strip_html_component}
@@ -0,0 +1 @@
1
+ import{b as e,c as t}from"./p-d20ee37c.js";class r extends Error{constructor(e){super(`The "${e}" element must be the child of an "atomic-result" element.`)}}function s(s){return new Promise(((o,c)=>{const n=e("atomic/resolveResult",(e=>o(e)));s.dispatchEvent(n),t(s,"atomic-result")||c(new r(s.nodeName.toLowerCase()))}))}export{s as r}