@coveops/abi 1.0.1 → 1.0.3
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.esm.js +1 -1
- package/dist/abi/index.esm.js +1 -1
- package/dist/abi/{p-1fd19815.entry.js → p-53221f92.entry.js} +1 -1
- package/dist/abi/p-7f068cc3.entry.js +1 -0
- package/dist/abi/p-8c974da8.entry.js +1 -0
- package/dist/abi/{p-ddacae1a.js → p-b984457f.js} +2 -2
- package/dist/bundle/index.html +1 -1
- package/dist/bundle/index.js +17 -17
- package/dist/cjs/faq-popup-component.cjs.entry.js +37 -6
- package/dist/cjs/{index-8f6652e1.js → index-20ac4bdb.js} +2 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/sample-component.cjs.entry.js +1 -1
- package/dist/cjs/standalone-searchbox-listener.cjs.entry.js +7 -6
- package/dist/collection/components/faq-popup-component/faq-popup-component.js +36 -5
- package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.js +7 -6
- package/dist/components/index.js +44 -12
- package/dist/esm/faq-popup-component.entry.js +37 -6
- package/dist/esm/{index-886ab6f0.js → index-4e0bf5cd.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/sample-component.entry.js +1 -1
- package/dist/esm/standalone-searchbox-listener.entry.js +7 -6
- package/package.json +1 -1
- package/src/components/faq-popup-component/faq-popup-component.tsx +33 -2
- package/src/components/standalone-searchbox-listener/standalone-searchbox-listener.tsx +5 -2
- package/src/pages/index.html +1 -1
- package/dist/abi/p-03b6e905.entry.js +0 -1
- package/dist/abi/p-50003f11.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement, H as Host } from './index-3c594d24.js';
|
|
2
|
-
import { i as initializeBindings, F as Fde } from './index-
|
|
2
|
+
import { i as initializeBindings, F as Fde } from './index-4e0bf5cd.js';
|
|
3
3
|
import { r as resultContext } from './result-template-decorators-881a4c8e-ed85ad21.js';
|
|
4
4
|
import './headless.esm-085e70ed-c4dfb380.js';
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ const FaqPopupComponent = class {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
openFAQModal(result) {
|
|
34
|
-
var _a, _b, _c, _d;
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35
35
|
if (this.bindings) {
|
|
36
36
|
const { logClickEvent } = Fde(this.bindings.engine);
|
|
37
37
|
const logClickPayload = {
|
|
@@ -48,7 +48,7 @@ const FaqPopupComponent = class {
|
|
|
48
48
|
const tableEl = document.createElement('table');
|
|
49
49
|
const questionElement = document.createElement("tr");
|
|
50
50
|
questionElement.className = "question-row";
|
|
51
|
-
questionElement.innerHTML = '<td>Question:
|
|
51
|
+
questionElement.innerHTML = '<td>Question: <a href="https://anheuserbuschinbev.sharepoint.com" autofocus="true" style="display:none;"></a></td> <td>' + (((_a = this.result) === null || _a === void 0 ? void 0 : _a.title) || '') + '</td>'
|
|
52
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
53
|
tableEl.appendChild(questionElement);
|
|
54
54
|
const answerElement = document.createElement('tr');
|
|
@@ -58,17 +58,48 @@ const FaqPopupComponent = class {
|
|
|
58
58
|
answerElement.appendChild(answerTitleElement);
|
|
59
59
|
// Create a new element to contain the answer content
|
|
60
60
|
const answerContentElement = document.createElement('td');
|
|
61
|
-
|
|
61
|
+
if ((_c = (_b = this.result) === null || _b === void 0 ? void 0 : _b.raw) === null || _c === void 0 ? void 0 : _c.answer) {
|
|
62
|
+
let value = (_e = (_d = this.result) === null || _d === void 0 ? void 0 : _d.raw) === null || _e === void 0 ? void 0 : _e.answer;
|
|
63
|
+
try {
|
|
64
|
+
var els = new DOMParser().parseFromString(value, 'text/html');
|
|
65
|
+
var html = '';
|
|
66
|
+
Array.from(els.children).forEach(el => {
|
|
67
|
+
var _a;
|
|
68
|
+
el.querySelectorAll('a').forEach(a => {
|
|
69
|
+
if (a.href.startsWith(window.location.origin) && a.href.indexOf('/sites/') > -1) {
|
|
70
|
+
a.href = a.href.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
71
|
+
}
|
|
72
|
+
if (a.href.startsWith(window.location.origin) && a.href.match(/:.:\/./)) {
|
|
73
|
+
a.href = a.href.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
el.querySelectorAll('img').forEach(a => {
|
|
77
|
+
if (a.src.startsWith(window.location.origin) && a.src.indexOf('/sites/') > -1) {
|
|
78
|
+
a.src = a.src.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
79
|
+
}
|
|
80
|
+
if (a.src.startsWith(window.location.origin) && a.src.match(/:.:\/./)) {
|
|
81
|
+
a.src = a.src.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
html = html + ((_a = el.querySelector('body')) === null || _a === void 0 ? void 0 : _a.innerHTML);
|
|
85
|
+
});
|
|
86
|
+
answerContentElement.innerHTML = html;
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
console.log(e);
|
|
90
|
+
answerContentElement.innerHTML = value;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
62
93
|
// Append the answer content element to the answer element
|
|
63
94
|
answerElement.appendChild(answerContentElement);
|
|
64
95
|
// Now, the answer element has the title and the content properly appended
|
|
65
96
|
tableEl.appendChild(answerElement);
|
|
66
|
-
if ((
|
|
97
|
+
if ((_f = this.result) === null || _f === void 0 ? void 0 : _f.raw.category) {
|
|
67
98
|
const categoryElement = document.createElement("tr");
|
|
68
99
|
categoryElement.innerHTML = '<td> Category: </td><td>' + this.result.raw.category + '</td>';
|
|
69
100
|
tableEl.appendChild(categoryElement);
|
|
70
101
|
}
|
|
71
|
-
if ((
|
|
102
|
+
if ((_g = this.result) === null || _g === void 0 ? void 0 : _g.raw.newmoreinfo) {
|
|
72
103
|
const linkElement = document.createElement("tr");
|
|
73
104
|
const linkUrl = this.result.raw.newmoreinfo;
|
|
74
105
|
linkElement.innerHTML = '<td> Link: </td><td> <a href="' + linkUrl + '" target="_blank">' + linkUrl + '</a> </td>';
|