@coveops/abi 1.5.7 → 2.0.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 (95) hide show
  1. package/dist/abi/abi.css +206 -1
  2. package/dist/abi/abi.esm.js +129 -1
  3. package/dist/abi/app-globals-0f993ce5.js +3 -0
  4. package/dist/abi/css-shim-04165e59.js +4 -0
  5. package/dist/abi/dom-26e7cb2c.js +73 -0
  6. package/dist/{esm → abi}/faq-popup-component.entry.js +3 -4
  7. package/dist/abi/headless.esm-c328011d.js +72 -0
  8. package/dist/abi/index-4c45f50c.js +3064 -0
  9. package/dist/abi/index-bf9cad6e.js +4108 -0
  10. package/dist/abi/index.esm.js +168 -1
  11. package/dist/{esm → abi}/recs-initialization-helper.entry.js +5 -5
  12. package/dist/{esm → abi}/recs-results-manager.entry.js +1 -1
  13. package/dist/{esm → abi}/results-manager.entry.js +1 -1
  14. package/dist/{esm → abi}/sample-component.entry.js +3 -3
  15. package/dist/abi/shadow-css-1257b266.js +387 -0
  16. package/dist/{esm → abi}/standalone-searchbox-listener.entry.js +3 -3
  17. package/dist/{esm → abi}/strip-html-component.entry.js +2 -3
  18. package/package.json +2 -2
  19. package/src/components/recs-initialization-helper/recs-initialization-helper.tsx +2 -2
  20. package/src/index.ts +2 -2
  21. package/src/pages/index.html +1 -1
  22. package/dist/abi/p-380ced38.entry.js +0 -1
  23. package/dist/abi/p-7282c5fe.entry.js +0 -1
  24. package/dist/abi/p-9d42030c.entry.js +0 -1
  25. package/dist/abi/p-ac870f21.js +0 -49
  26. package/dist/abi/p-b83bab81.js +0 -1
  27. package/dist/abi/p-c0436bc1.entry.js +0 -1
  28. package/dist/abi/p-c10b6b7f.js +0 -2
  29. package/dist/abi/p-c602c74e.entry.js +0 -1
  30. package/dist/abi/p-c82303fb.js +0 -1
  31. package/dist/abi/p-cd1744bb.entry.js +0 -1
  32. package/dist/abi/p-d20ee37c.js +0 -18
  33. package/dist/abi/p-d5e62885.entry.js +0 -1
  34. package/dist/bundle/index.css +0 -1
  35. package/dist/bundle/index.html +0 -72
  36. package/dist/bundle/index.js +0 -1363
  37. package/dist/cjs/abi.cjs.js +0 -19
  38. package/dist/cjs/atomic-70a93c69.js +0 -11
  39. package/dist/cjs/faq-popup-component.cjs.entry.js +0 -144
  40. package/dist/cjs/headless.esm-085e70ed-f2e18485.js +0 -1720
  41. package/dist/cjs/index-3cecd23d.js +0 -1283
  42. package/dist/cjs/index-d1493bab.js +0 -105
  43. package/dist/cjs/index.cjs.js +0 -170
  44. package/dist/cjs/loader.cjs.js +0 -21
  45. package/dist/cjs/recs-initialization-helper.cjs.entry.js +0 -55
  46. package/dist/cjs/recs-results-manager.cjs.entry.js +0 -36
  47. package/dist/cjs/result-template-decorators-881a4c8e-4ff46481.js +0 -33
  48. package/dist/cjs/results-manager.cjs.entry.js +0 -42
  49. package/dist/cjs/sample-component.cjs.entry.js +0 -87
  50. package/dist/cjs/standalone-searchbox-listener.cjs.entry.js +0 -48
  51. package/dist/cjs/strip-html-component.cjs.entry.js +0 -60
  52. package/dist/collection/collection-manifest.json +0 -23
  53. package/dist/collection/components/faq-popup-component/faq-popup-component.css +0 -15
  54. package/dist/collection/components/faq-popup-component/faq-popup-component.js +0 -162
  55. package/dist/collection/components/recs-initialization-helper/recs-initialization-helper.js +0 -66
  56. package/dist/collection/components/recs-results-manager/recs-results-manager.js +0 -39
  57. package/dist/collection/components/results-manager/results-manager.js +0 -50
  58. package/dist/collection/components/sample-component/sample-component.css +0 -10
  59. package/dist/collection/components/sample-component/sample-component.js +0 -102
  60. package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.css +0 -1
  61. package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.js +0 -50
  62. package/dist/collection/components/strip-html-component/strip-html-component.css +0 -3
  63. package/dist/collection/components/strip-html-component/strip-html-component.js +0 -64
  64. package/dist/collection/images/Default.png +0 -0
  65. package/dist/collection/images/Documents.png +0 -0
  66. package/dist/collection/images/FAQ.png +0 -0
  67. package/dist/collection/images/Images.png +0 -0
  68. package/dist/collection/images/Link.png +0 -0
  69. package/dist/collection/images/Movies.png +0 -0
  70. package/dist/collection/images/ProcessPeople.png +0 -0
  71. package/dist/collection/index.js +0 -167
  72. package/dist/collection/utils/atomic.js +0 -6
  73. package/dist/components/index.js +0 -3576
  74. package/dist/esm/abi.js +0 -17
  75. package/dist/esm/headless.esm-085e70ed-c4dfb380.js +0 -1717
  76. package/dist/esm/index-072be88f.js +0 -95
  77. package/dist/esm/index-66fdbb35.js +0 -1255
  78. package/dist/esm/index.js +0 -168
  79. package/dist/esm/loader.js +0 -17
  80. package/dist/esm/polyfills/core-js.js +0 -11
  81. package/dist/esm/polyfills/css-shim.js +0 -1
  82. package/dist/esm/polyfills/dom.js +0 -79
  83. package/dist/esm/polyfills/es5-html-element.js +0 -1
  84. package/dist/esm/polyfills/index.js +0 -34
  85. package/dist/esm/polyfills/system.js +0 -6
  86. package/dist/esm/result-template-decorators-881a4c8e-ed85ad21.js +0 -31
  87. package/dist/index.cjs.js +0 -1
  88. package/dist/index.js +0 -1
  89. package/dist/loader/cdn.js +0 -3
  90. package/dist/loader/index.cjs.js +0 -3
  91. package/dist/loader/index.d.ts +0 -12
  92. package/dist/loader/index.es2017.js +0 -3
  93. package/dist/loader/index.js +0 -4
  94. package/dist/loader/package.json +0 -10
  95. /package/dist/{esm → abi}/atomic-7b1e6d55.js +0 -0
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-3cecd23d.js');
4
-
5
- /*
6
- Stencil Client Patch Browser v2.17.3 | MIT Licensed | https://stenciljs.com
7
- */
8
- const patchBrowser = () => {
9
- const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('abi.cjs.js', document.baseURI).href));
10
- const opts = {};
11
- if (importMeta !== '') {
12
- opts.resourcesUrl = new URL('.', importMeta).href;
13
- }
14
- return index.promiseResolve(opts);
15
- };
16
-
17
- patchBrowser().then(options => {
18
- return index.bootstrapLazy([["faq-popup-component.cjs",[[1,"faq-popup-component",{"origin":[1],"result":[32]}]]],["recs-initialization-helper.cjs",[[1,"recs-initialization-helper",{"userCountry":[1,"user-country"]}]]],["recs-results-manager.cjs",[[0,"recs-results-manager"]]],["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
- });
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- function waitForAtomic() {
4
- return customElements.whenDefined("atomic-search-interface");
5
- }
6
- function waitForRecsAtomic() {
7
- return customElements.whenDefined("atomic-recs-interface");
8
- }
9
-
10
- exports.waitForAtomic = waitForAtomic;
11
- exports.waitForRecsAtomic = waitForRecsAtomic;
@@ -1,144 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3cecd23d.js');
6
- const index$1 = require('./index-d1493bab.js');
7
- const resultTemplateDecorators881a4c8e = require('./result-template-decorators-881a4c8e-4ff46481.js');
8
- require('./headless.esm-085e70ed-f2e18485.js');
9
-
10
- const faqPopupComponentCss = "b{color:var(--atomic-primary)}.search-css{color:#CAA144 !important;font-size:1.7rem !important;max-height:unset !important;line-height:normal !important}:host{cursor:pointer}";
11
-
12
- const FaqPopupComponent = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.closeFAQModal = () => {
16
- this.modalElement.setAttribute('is-open', 'false');
17
- this.modalElement.querySelector('#btn-done').removeEventListener('click', this.closeFAQModal);
18
- };
19
- }
20
- // We recommended fetching the result context using the `connectedCallback` lifecycle method
21
- // with async/await. Using `componentWillLoad` will hang the parent `atomic-search-interface` initialization.
22
- async connectedCallback() {
23
- var _a;
24
- try {
25
- this.bindings = await index$1.initializeBindings(this.host);
26
- this.result = await resultTemplateDecorators881a4c8e.resultContext(this.host);
27
- this.modalElement = (_a = this.bindings) === null || _a === void 0 ? void 0 : _a.interfaceElement.querySelector('#faq-modal');
28
- if (this.result && localStorage.getItem(`visited-${this.result.title}`)) {
29
- this.host.classList.add('visited-title');
30
- }
31
- }
32
- catch (error) {
33
- console.error(error);
34
- this.host.remove();
35
- }
36
- }
37
- openFAQModal(result) {
38
- var _a, _b, _c, _d, _e, _f, _g;
39
- if (this.bindings) {
40
- const { logClickEvent } = index$1.Fde(this.bindings.engine);
41
- const logClickPayload = {
42
- evt: 'documentQuickview',
43
- result: result,
44
- };
45
- this.bindings.engine.dispatch(logClickEvent(logClickPayload));
46
- }
47
- this.modalElement.source = this.host;
48
- // Get the body slot
49
- const bodySlot = this.modalElement.querySelector('[slot=body]');
50
- // Clear any existing content
51
- bodySlot.innerHTML = '';
52
- const tableEl = document.createElement('table');
53
- const questionElement = document.createElement("tr");
54
- questionElement.className = "question-row";
55
- 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>'
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');
59
- // Create the answer title element and set its text
60
- const answerTitleElement = document.createElement('td');
61
- answerTitleElement.innerText = 'Answer:';
62
- answerElement.appendChild(answerTitleElement);
63
- // Create a new element to contain the answer content
64
- const answerContentElement = document.createElement('td');
65
- if ((_c = (_b = this.result) === null || _b === void 0 ? void 0 : _b.raw) === null || _c === void 0 ? void 0 : _c.answer) {
66
- let value = (_e = (_d = this.result) === null || _d === void 0 ? void 0 : _d.raw) === null || _e === void 0 ? void 0 : _e.answer;
67
- try {
68
- var els = new DOMParser().parseFromString(value, 'text/html');
69
- var html = '';
70
- Array.from(els.children).forEach(el => {
71
- var _a;
72
- el.querySelectorAll('a').forEach(a => {
73
- if (a.href.startsWith(window.location.origin) && a.href.indexOf('/sites/') > -1) {
74
- a.href = a.href.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
75
- }
76
- if (a.href.startsWith(window.location.origin) && a.href.match(/:.:\/./)) {
77
- a.href = a.href.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
78
- }
79
- });
80
- el.querySelectorAll('img').forEach(a => {
81
- if (a.src.startsWith(window.location.origin) && a.src.indexOf('/sites/') > -1) {
82
- a.src = a.src.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
83
- }
84
- if (a.src.startsWith(window.location.origin) && a.src.match(/:.:\/./)) {
85
- a.src = a.src.replace(window.location.origin, 'https://anheuserbuschinbev.sharepoint.com');
86
- }
87
- });
88
- html = html + ((_a = el.querySelector('body')) === null || _a === void 0 ? void 0 : _a.innerHTML);
89
- });
90
- answerContentElement.innerHTML = html;
91
- }
92
- catch (e) {
93
- console.log(e);
94
- answerContentElement.innerHTML = value;
95
- }
96
- }
97
- // Append the answer content element to the answer element
98
- answerElement.appendChild(answerContentElement);
99
- // Now, the answer element has the title and the content properly appended
100
- tableEl.appendChild(answerElement);
101
- if ((_f = this.result) === null || _f === void 0 ? void 0 : _f.raw.category) {
102
- const categoryElement = document.createElement("tr");
103
- categoryElement.innerHTML = '<td> Category: </td><td>' + this.result.raw.category + '</td>';
104
- tableEl.appendChild(categoryElement);
105
- }
106
- if ((_g = this.result) === null || _g === void 0 ? void 0 : _g.raw.newmoreinfo) {
107
- const linkElement = document.createElement("tr");
108
- const linkUrl = this.result.raw.newmoreinfo;
109
- linkElement.innerHTML = '<td> Link: </td><td> <a href="' + linkUrl + '" target="_blank">' + linkUrl + '</a> </td>';
110
- tableEl.appendChild(linkElement);
111
- }
112
- // Create and append the category element
113
- /*const categoryElement = document.createElement('div');
114
- categoryElement.innerHTML = 'Category: ' + (this.result?.raw.category || '');
115
- bodySlot.appendChild(categoryElement);
116
-
117
-
118
-
119
-
120
- const linkElement = document.createElement('div');
121
- const linkUrl = this.result?.raw.newmoreinfo || '';
122
- linkElement.innerHTML = `Link: <a href="${linkUrl}" target="_blank">${linkUrl}</a>`;
123
- bodySlot.appendChild(linkElement);*/
124
- bodySlot.appendChild(tableEl);
125
- this.modalElement.querySelector('#faq-modal-close-button').addEventListener('click', this.closeFAQModal);
126
- this.modalElement.setAttribute('is-open', 'true');
127
- if (this.result) {
128
- localStorage.setItem(`visited-${this.result.title}`, 'true');
129
- }
130
- // Add the class to change color
131
- this.host.classList.add('visited-title');
132
- }
133
- render() {
134
- if (!this.result) {
135
- return;
136
- }
137
- const cssCondition = this.origin === 'searchResult' ? 'search-css' : '';
138
- return (index.h(index.Host, { className: `clickable-host ${cssCondition}`, onClick: () => this.openFAQModal(this.result) }, this.result.title));
139
- }
140
- get host() { return index.getElement(this); }
141
- };
142
- FaqPopupComponent.style = faqPopupComponentCss;
143
-
144
- exports.faq_popup_component = FaqPopupComponent;