@coveops/abi 1.0.0 → 1.0.2
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 +1 -0
- package/dist/abi/{p-9f80f982.entry.js → p-3303b27f.entry.js} +1 -1
- package/dist/abi/p-50003f11.entry.js +1 -0
- package/dist/abi/p-cd8cdf0e.entry.js +1 -0
- package/dist/abi/p-d6d34d34.js +2 -0
- package/dist/abi/{p-dca22988.entry.js → p-dd8b0f76.entry.js} +1 -1
- package/dist/abi/p-ddacae1a.js +49 -0
- package/dist/bundle/index.html +64 -57
- package/dist/bundle/index.js +17 -17
- package/dist/cjs/abi.cjs.js +2 -2
- package/dist/cjs/faq-popup-component.cjs.entry.js +39 -6
- package/dist/cjs/{index-87155b50.js → index-355878fc.js} +55 -0
- package/dist/cjs/{index-03be0841.js → index-8f6652e1.js} +4 -1
- package/dist/cjs/index.cjs.js +27 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/results-manager.cjs.entry.js +1 -1
- package/dist/cjs/sample-component.cjs.entry.js +2 -2
- package/dist/cjs/standalone-searchbox-listener.cjs.entry.js +43 -0
- package/dist/cjs/strip-html-component.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/faq-popup-component/faq-popup-component.js +37 -4
- package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.css +1 -0
- package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.js +45 -0
- package/dist/collection/index.js +26 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +148 -9
- package/dist/esm/abi.js +2 -2
- package/dist/esm/faq-popup-component.entry.js +39 -6
- package/dist/esm/{index-99665e7c.js → index-3c594d24.js} +55 -0
- package/dist/esm/{index-42e9a708.js → index-886ab6f0.js} +2 -2
- package/dist/esm/index.js +27 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/results-manager.entry.js +1 -1
- package/dist/esm/sample-component.entry.js +2 -2
- package/dist/esm/standalone-searchbox-listener.entry.js +39 -0
- package/dist/esm/strip-html-component.entry.js +1 -1
- package/dist/types/components/standalone-searchbox-listener/standalone-searchbox-listener.d.ts +7 -0
- package/dist/types/components.d.ts +13 -0
- package/package.json +1 -1
- package/src/components/faq-popup-component/faq-popup-component.tsx +34 -1
- package/src/components/standalone-searchbox-listener/standalone-searchbox-listener.css +1 -0
- package/src/components/standalone-searchbox-listener/standalone-searchbox-listener.tsx +52 -0
- package/src/components.d.ts +13 -0
- package/src/index.ts +29 -1
- package/src/pages/index.html +64 -57
- package/dist/abi/p-0f4a7ce9.js +0 -49
- package/dist/abi/p-211c1e78.entry.js +0 -1
- package/dist/abi/p-e7416b40.entry.js +0 -1
- package/dist/abi/p-facfefe1.js +0 -2
package/dist/cjs/abi.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-355878fc.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.17.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["faq-popup-component.cjs",[[1,"faq-popup-component",{"result":[32]}]]],["results-manager.cjs",[[0,"results-manager"]]],["sample-component.cjs",[[1,"sample-component",{"pagerState":[32],"statusState":[32]}]]],["strip-html-component.cjs",[[1,"strip-html-component",{"result":[32]}]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["faq-popup-component.cjs",[[1,"faq-popup-component",{"result":[32]}]]],["results-manager.cjs",[[0,"results-manager"]]],["sample-component.cjs",[[1,"sample-component",{"pagerState":[32],"statusState":[32]}]]],["standalone-searchbox-listener.cjs",[[1,"standalone-searchbox-listener",null,[[8,"header/searchbox/query","handleStandaloneSearchbox"]]]]],["strip-html-component.cjs",[[1,"strip-html-component",{"result":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$1 = require('./index-
|
|
5
|
+
const index = require('./index-355878fc.js');
|
|
6
|
+
const index$1 = require('./index-8f6652e1.js');
|
|
7
7
|
const resultTemplateDecorators881a4c8e = require('./result-template-decorators-881a4c8e-4ff46481.js');
|
|
8
8
|
require('./headless.esm-085e70ed-f2e18485.js');
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@ const FaqPopupComponent = class {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
openFAQModal(result) {
|
|
38
|
-
var _a, _b, _c, _d;
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
39
39
|
if (this.bindings) {
|
|
40
40
|
const { logClickEvent } = index$1.Fde(this.bindings.engine);
|
|
41
41
|
const logClickPayload = {
|
|
@@ -62,17 +62,50 @@ const FaqPopupComponent = class {
|
|
|
62
62
|
answerElement.appendChild(answerTitleElement);
|
|
63
63
|
// Create a new element to contain the answer content
|
|
64
64
|
const answerContentElement = document.createElement('td');
|
|
65
|
-
|
|
65
|
+
debugger;
|
|
66
|
+
if ((_c = (_b = this.result) === null || _b === void 0 ? void 0 : _b.raw) === null || _c === void 0 ? void 0 : _c.answer) {
|
|
67
|
+
let value = (_e = (_d = this.result) === null || _d === void 0 ? void 0 : _d.raw) === null || _e === void 0 ? void 0 : _e.answer;
|
|
68
|
+
try {
|
|
69
|
+
var els = new DOMParser().parseFromString(value, 'text/html');
|
|
70
|
+
var html = '';
|
|
71
|
+
Array.from(els.children).forEach(el => {
|
|
72
|
+
var _a;
|
|
73
|
+
debugger;
|
|
74
|
+
el.querySelectorAll('a').forEach(a => {
|
|
75
|
+
if (a.href.startsWith(window.location.origin) && a.href.indexOf('/sites/') > -1) {
|
|
76
|
+
a.href = a.href.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
77
|
+
}
|
|
78
|
+
if (a.href.startsWith(window.location.origin) && a.href.match(/:.:\/./)) {
|
|
79
|
+
a.href = a.href.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
el.querySelectorAll('img').forEach(a => {
|
|
83
|
+
if (a.src.startsWith(window.location.origin) && a.src.indexOf('/sites/') > -1) {
|
|
84
|
+
a.src = a.src.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
85
|
+
}
|
|
86
|
+
if (a.src.startsWith(window.location.origin) && a.src.match(/:.:\/./)) {
|
|
87
|
+
a.src = a.src.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
html = html + ((_a = el.querySelector('body')) === null || _a === void 0 ? void 0 : _a.innerHTML);
|
|
91
|
+
});
|
|
92
|
+
answerContentElement.innerHTML = html;
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
console.log(e);
|
|
96
|
+
answerContentElement.innerHTML = value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
66
99
|
// Append the answer content element to the answer element
|
|
67
100
|
answerElement.appendChild(answerContentElement);
|
|
68
101
|
// Now, the answer element has the title and the content properly appended
|
|
69
102
|
tableEl.appendChild(answerElement);
|
|
70
|
-
if ((
|
|
103
|
+
if ((_f = this.result) === null || _f === void 0 ? void 0 : _f.raw.category) {
|
|
71
104
|
const categoryElement = document.createElement("tr");
|
|
72
105
|
categoryElement.innerHTML = '<td> Category: </td><td>' + this.result.raw.category + '</td>';
|
|
73
106
|
tableEl.appendChild(categoryElement);
|
|
74
107
|
}
|
|
75
|
-
if ((
|
|
108
|
+
if ((_g = this.result) === null || _g === void 0 ? void 0 : _g.raw.newmoreinfo) {
|
|
76
109
|
const linkElement = document.createElement("tr");
|
|
77
110
|
const linkUrl = this.result.raw.newmoreinfo;
|
|
78
111
|
linkElement.innerHTML = '<td> Link: </td><td> <a href="' + linkUrl + '" target="_blank">' + linkUrl + '</a> </td>';
|
|
@@ -47,6 +47,40 @@ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
|
47
47
|
return false;
|
|
48
48
|
})()
|
|
49
49
|
;
|
|
50
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
51
|
+
if (listeners) {
|
|
52
|
+
listeners.map(([flags, name, method]) => {
|
|
53
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
54
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
55
|
+
const opts = hostListenerOpts(flags);
|
|
56
|
+
plt.ael(target, name, handler, opts);
|
|
57
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
62
|
+
try {
|
|
63
|
+
{
|
|
64
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
65
|
+
// instance is ready, let's call it's member method for this event
|
|
66
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
consoleError(e);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
78
|
+
if (flags & 8 /* TargetWindow */)
|
|
79
|
+
return win;
|
|
80
|
+
return elm;
|
|
81
|
+
};
|
|
82
|
+
// prettier-ignore
|
|
83
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
50
84
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
51
85
|
const createTime = (fnName, tagName = '') => {
|
|
52
86
|
{
|
|
@@ -622,6 +656,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
622
656
|
const instance = hostRef.$lazyInstance$ ;
|
|
623
657
|
let promise;
|
|
624
658
|
if (isInitialLoad) {
|
|
659
|
+
{
|
|
660
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
661
|
+
if (hostRef.$queuedListeners$) {
|
|
662
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
663
|
+
hostRef.$queuedListeners$ = null;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
625
666
|
{
|
|
626
667
|
promise = safeCall(instance, 'componentWillLoad');
|
|
627
668
|
}
|
|
@@ -951,6 +992,10 @@ const connectedCallback = (elm) => {
|
|
|
951
992
|
}
|
|
952
993
|
}
|
|
953
994
|
else {
|
|
995
|
+
// not the first time this has connected
|
|
996
|
+
// reattach any event listeners to the host
|
|
997
|
+
// since they would have been removed when disconnected
|
|
998
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
954
999
|
// fire off connectedCallback() on component instance
|
|
955
1000
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
956
1001
|
}
|
|
@@ -961,6 +1006,12 @@ const disconnectedCallback = (elm) => {
|
|
|
961
1006
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
962
1007
|
const hostRef = getHostRef(elm);
|
|
963
1008
|
const instance = hostRef.$lazyInstance$ ;
|
|
1009
|
+
{
|
|
1010
|
+
if (hostRef.$rmListeners$) {
|
|
1011
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1012
|
+
hostRef.$rmListeners$ = undefined;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
964
1015
|
{
|
|
965
1016
|
safeCall(instance, 'disconnectedCallback');
|
|
966
1017
|
}
|
|
@@ -990,6 +1041,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
990
1041
|
{
|
|
991
1042
|
cmpMeta.$members$ = compactMeta[2];
|
|
992
1043
|
}
|
|
1044
|
+
{
|
|
1045
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1046
|
+
}
|
|
993
1047
|
const tagName = cmpMeta.$tagName$;
|
|
994
1048
|
const HostElement = class extends HTMLElement {
|
|
995
1049
|
// StencilLazyHost
|
|
@@ -1070,6 +1124,7 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1070
1124
|
elm['s-p'] = [];
|
|
1071
1125
|
elm['s-rc'] = [];
|
|
1072
1126
|
}
|
|
1127
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1073
1128
|
return hostRefs.set(elm, hostRef);
|
|
1074
1129
|
};
|
|
1075
1130
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|