@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.
Files changed (45) hide show
  1. package/dist/abi/abi.css +1 -1
  2. package/dist/abi/abi.esm.js +1 -1
  3. package/dist/abi/index.esm.js +1 -1
  4. package/dist/abi/p-0b2d2c7b.entry.js +1 -0
  5. package/dist/abi/p-1c8e5ecc.entry.js +1 -0
  6. package/dist/abi/{p-24a5774b.entry.js → p-9f80f982.entry.js} +1 -1
  7. package/dist/abi/{p-adb4a9f9.entry.js → p-e7416b40.entry.js} +1 -1
  8. package/dist/abi/p-facfefe1.js +2 -0
  9. package/dist/bundle/index.css +1 -1
  10. package/dist/bundle/index.html +1 -1
  11. package/dist/bundle/index.js +28 -28
  12. package/dist/cjs/abi.cjs.js +1 -1
  13. package/dist/cjs/faq-popup-component.cjs.entry.js +33 -16
  14. package/dist/cjs/{index-9c1d2337.js → index-87155b50.js} +32 -1
  15. package/dist/cjs/index.cjs.js +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/results-manager.cjs.entry.js +10 -10
  18. package/dist/cjs/sample-component.cjs.entry.js +1 -1
  19. package/dist/cjs/strip-html-component.cjs.entry.js +1 -1
  20. package/dist/collection/components/faq-popup-component/faq-popup-component.js +32 -15
  21. package/dist/components/index.js +74 -26
  22. package/dist/esm/abi.js +1 -1
  23. package/dist/esm/faq-popup-component.entry.js +33 -16
  24. package/dist/esm/{index-8b0b351b.js → index-99665e7c.js} +32 -1
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/results-manager.entry.js +10 -10
  28. package/dist/esm/sample-component.entry.js +1 -1
  29. package/dist/esm/strip-html-component.entry.js +1 -1
  30. package/package.json +1 -1
  31. package/src/components/faq-popup-component/faq-popup-component.tsx +38 -20
  32. package/src/components/results-manager/AppTemplate.html +1 -1
  33. package/src/components/results-manager/DocumentsTemplate.html +1 -1
  34. package/src/components/results-manager/ELearningTemplate.html +1 -1
  35. package/src/components/results-manager/FAQTemplate.html +1 -1
  36. package/src/components/results-manager/KATemplate.html +2 -2
  37. package/src/components/results-manager/MediaTemplate.html +2 -2
  38. package/src/components/results-manager/QuickLinksTemplate.html +1 -1
  39. package/src/components/results-manager/SitePagesTemplate.html +1 -1
  40. package/src/components/results-manager/template-1.html +1 -1
  41. package/src/pages/index.html +1 -1
  42. package/src/style/index.css +51 -18
  43. package/dist/abi/p-1cbc472e.entry.js +0 -1
  44. package/dist/abi/p-3d7bc0f4.entry.js +0 -1
  45. package/dist/abi/p-52c70e74.js +0 -2
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-9c1d2337.js');
3
+ const index = require('./index-87155b50.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.17.3 | MIT Licensed | https://stenciljs.com
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-9c1d2337.js');
5
+ const index = require('./index-87155b50.js');
6
6
  const index$1 = require('./index-03be0841.js');
7
7
  const resultTemplateDecorators881a4c8e = require('./result-template-decorators-881a4c8e-4ff46481.js');
8
8
  require('./headless.esm-085e70ed-f2e18485.js');
@@ -45,36 +45,53 @@ const FaqPopupComponent = class {
45
45
  this.bindings.engine.dispatch(logClickEvent(logClickPayload));
46
46
  }
47
47
  this.modalElement.source = this.host;
48
- this.modalElement.querySelector('[slot=header]').children[0].innerHTML = 'Question: ' + (((_a = this.result) === null || _a === void 0 ? void 0 : _a.title) || '');
49
48
  // Get the body slot
50
49
  const bodySlot = this.modalElement.querySelector('[slot=body]');
51
50
  // Clear any existing content
52
51
  bodySlot.innerHTML = '';
53
- const answerElement = document.createElement('div');
54
- answerElement.style.display = 'flex';
55
- answerElement.style.gap = '16px';
52
+ const tableEl = document.createElement('table');
53
+ const questionElement = document.createElement("tr");
54
+ questionElement.className = "question-row";
55
+ questionElement.innerHTML = '<td>Question: </td> <td>' + (((_a = this.result) === null || _a === void 0 ? void 0 : _a.title) || '') + '</td>'
56
+ + '<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>';
57
+ tableEl.appendChild(questionElement);
58
+ const answerElement = document.createElement('tr');
56
59
  // Create the answer title element and set its text
57
- const answerTitleElement = document.createElement('div');
60
+ const answerTitleElement = document.createElement('td');
58
61
  answerTitleElement.innerText = 'Answer:';
59
62
  answerElement.appendChild(answerTitleElement);
60
- // Get the answer from the result object
61
- const answerContent = ((_b = this.result) === null || _b === void 0 ? void 0 : _b.raw.answer) || '';
62
63
  // Create a new element to contain the answer content
63
- const answerContentElement = document.createElement('div');
64
- answerContentElement.innerHTML = answerContent;
64
+ const answerContentElement = document.createElement('td');
65
+ answerContentElement.innerHTML = ((_b = this.result) === null || _b === void 0 ? void 0 : _b.raw.answer) || '';
65
66
  // Append the answer content element to the answer element
66
67
  answerElement.appendChild(answerContentElement);
67
68
  // Now, the answer element has the title and the content properly appended
68
- bodySlot.appendChild(answerElement);
69
+ tableEl.appendChild(answerElement);
70
+ if ((_c = this.result) === null || _c === void 0 ? void 0 : _c.raw.category) {
71
+ const categoryElement = document.createElement("tr");
72
+ categoryElement.innerHTML = '<td> Category: </td><td>' + this.result.raw.category + '</td>';
73
+ tableEl.appendChild(categoryElement);
74
+ }
75
+ if ((_d = this.result) === null || _d === void 0 ? void 0 : _d.raw.newmoreinfo) {
76
+ const linkElement = document.createElement("tr");
77
+ const linkUrl = this.result.raw.newmoreinfo;
78
+ linkElement.innerHTML = '<td> Link: </td><td> <a href="' + linkUrl + '" target="_blank">' + linkUrl + '</a> </td>';
79
+ tableEl.appendChild(linkElement);
80
+ }
69
81
  // Create and append the category element
70
- const categoryElement = document.createElement('div');
71
- categoryElement.innerHTML = 'Category: ' + (((_c = this.result) === null || _c === void 0 ? void 0 : _c.raw.category) || '');
82
+ /*const categoryElement = document.createElement('div');
83
+ categoryElement.innerHTML = 'Category: ' + (this.result?.raw.category || '');
72
84
  bodySlot.appendChild(categoryElement);
85
+
86
+
87
+
88
+
73
89
  const linkElement = document.createElement('div');
74
- const linkUrl = ((_d = this.result) === null || _d === void 0 ? void 0 : _d.raw.newmoreinfo) || '';
90
+ const linkUrl = this.result?.raw.newmoreinfo || '';
75
91
  linkElement.innerHTML = `Link: <a href="${linkUrl}" target="_blank">${linkUrl}</a>`;
76
- bodySlot.appendChild(linkElement);
77
- this.modalElement.querySelector('#faq-modal-close').addEventListener('click', this.closeFAQModal);
92
+ bodySlot.appendChild(linkElement);*/
93
+ bodySlot.appendChild(tableEl);
94
+ this.modalElement.querySelector('#faq-modal-close-button').addEventListener('click', this.closeFAQModal);
78
95
  this.modalElement.setAttribute('is-open', 'true');
79
96
  if (this.result) {
80
97
  localStorage.setItem(`visited-${this.result.title}`, 'true');
@@ -140,6 +140,11 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
140
140
  * Don't add values to these!!
141
141
  */
142
142
  const EMPTY_OBJ = {};
143
+ /**
144
+ * Namespaces
145
+ */
146
+ const SVG_NS = 'http://www.w3.org/2000/svg';
147
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
143
148
  const isDef = (v) => v != null;
144
149
  const isComplexType = (o) => {
145
150
  // https://jsperf.com/typeof-fn-object/5
@@ -375,8 +380,15 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
375
380
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
376
381
  }
377
382
  else {
383
+ if (!isSvgMode) {
384
+ isSvgMode = newVNode.$tag$ === 'svg';
385
+ }
378
386
  // create element
379
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
387
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
388
+ );
389
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
390
+ isSvgMode = false;
391
+ }
380
392
  // add css classes, attrs, props, listeners, etc.
381
393
  {
382
394
  updateElement(null, newVNode, isSvgMode);
@@ -397,6 +409,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
397
409
  }
398
410
  }
399
411
  }
412
+ {
413
+ if (newVNode.$tag$ === 'svg') {
414
+ // Only reset the SVG context when we're exiting <svg> element
415
+ isSvgMode = false;
416
+ }
417
+ else if (elm.tagName === 'foreignObject') {
418
+ // Reenter SVG context when we're exiting <foreignObject> element
419
+ isSvgMode = true;
420
+ }
421
+ }
400
422
  }
401
423
  return elm;
402
424
  };
@@ -503,8 +525,14 @@ const patch = (oldVNode, newVNode) => {
503
525
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
504
526
  const oldChildren = oldVNode.$children$;
505
527
  const newChildren = newVNode.$children$;
528
+ const tag = newVNode.$tag$;
506
529
  const text = newVNode.$text$;
507
530
  if (text === null) {
531
+ {
532
+ // test if we're rendering an svg element, or still rendering nodes inside of one
533
+ // only add this to the when the compiler sees we're using an svg somewhere
534
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
535
+ }
508
536
  // element node
509
537
  {
510
538
  {
@@ -531,6 +559,9 @@ const patch = (oldVNode, newVNode) => {
531
559
  // no new child vnodes, but there are old child vnodes to remove
532
560
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
533
561
  }
562
+ if (isSvgMode && tag === 'svg') {
563
+ isSvgMode = false;
564
+ }
534
565
  }
535
566
  else if (oldVNode.$text$ !== text) {
536
567
  // update the text content for the text only vnode
@@ -7,7 +7,7 @@ async function main() {
7
7
  const searchInterface = document.querySelector("atomic-search-interface");
8
8
  const platformUrl = "https://platform.cloud.coveo.com";
9
9
  const organizationId = "anheuserbuschinbevprod";
10
- const accessToken = "x0e506b82-043a-4eea-b18d-ee82aab46562";
10
+ const accessToken = "x831705fd-ca93-4aa8-b4c6-c965a24c5f50";
11
11
  await searchInterface.initialize({
12
12
  accessToken,
13
13
  organizationId,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-9c1d2337.js');
5
+ const index = require('./index-87155b50.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.17.3 | MIT Licensed | https://stenciljs.com