@coveops/abi 1.5.8 → 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 (92) 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 +3 -3
  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/dist/abi/p-380ced38.entry.js +0 -1
  20. package/dist/abi/p-9d42030c.entry.js +0 -1
  21. package/dist/abi/p-ac870f21.js +0 -49
  22. package/dist/abi/p-b09970bf.entry.js +0 -1
  23. package/dist/abi/p-b83bab81.js +0 -1
  24. package/dist/abi/p-c0436bc1.entry.js +0 -1
  25. package/dist/abi/p-c10b6b7f.js +0 -2
  26. package/dist/abi/p-c602c74e.entry.js +0 -1
  27. package/dist/abi/p-c82303fb.js +0 -1
  28. package/dist/abi/p-cd1744bb.entry.js +0 -1
  29. package/dist/abi/p-d20ee37c.js +0 -18
  30. package/dist/abi/p-d5e62885.entry.js +0 -1
  31. package/dist/bundle/index.css +0 -1
  32. package/dist/bundle/index.html +0 -72
  33. package/dist/bundle/index.js +0 -1363
  34. package/dist/cjs/abi.cjs.js +0 -19
  35. package/dist/cjs/atomic-70a93c69.js +0 -11
  36. package/dist/cjs/faq-popup-component.cjs.entry.js +0 -144
  37. package/dist/cjs/headless.esm-085e70ed-f2e18485.js +0 -1720
  38. package/dist/cjs/index-3cecd23d.js +0 -1283
  39. package/dist/cjs/index-d1493bab.js +0 -105
  40. package/dist/cjs/index.cjs.js +0 -170
  41. package/dist/cjs/loader.cjs.js +0 -21
  42. package/dist/cjs/recs-initialization-helper.cjs.entry.js +0 -55
  43. package/dist/cjs/recs-results-manager.cjs.entry.js +0 -36
  44. package/dist/cjs/result-template-decorators-881a4c8e-4ff46481.js +0 -33
  45. package/dist/cjs/results-manager.cjs.entry.js +0 -42
  46. package/dist/cjs/sample-component.cjs.entry.js +0 -87
  47. package/dist/cjs/standalone-searchbox-listener.cjs.entry.js +0 -48
  48. package/dist/cjs/strip-html-component.cjs.entry.js +0 -60
  49. package/dist/collection/collection-manifest.json +0 -23
  50. package/dist/collection/components/faq-popup-component/faq-popup-component.css +0 -15
  51. package/dist/collection/components/faq-popup-component/faq-popup-component.js +0 -162
  52. package/dist/collection/components/recs-initialization-helper/recs-initialization-helper.js +0 -66
  53. package/dist/collection/components/recs-results-manager/recs-results-manager.js +0 -39
  54. package/dist/collection/components/results-manager/results-manager.js +0 -50
  55. package/dist/collection/components/sample-component/sample-component.css +0 -10
  56. package/dist/collection/components/sample-component/sample-component.js +0 -102
  57. package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.css +0 -1
  58. package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.js +0 -50
  59. package/dist/collection/components/strip-html-component/strip-html-component.css +0 -3
  60. package/dist/collection/components/strip-html-component/strip-html-component.js +0 -64
  61. package/dist/collection/images/Default.png +0 -0
  62. package/dist/collection/images/Documents.png +0 -0
  63. package/dist/collection/images/FAQ.png +0 -0
  64. package/dist/collection/images/Images.png +0 -0
  65. package/dist/collection/images/Link.png +0 -0
  66. package/dist/collection/images/Movies.png +0 -0
  67. package/dist/collection/images/ProcessPeople.png +0 -0
  68. package/dist/collection/index.js +0 -167
  69. package/dist/collection/utils/atomic.js +0 -6
  70. package/dist/components/index.js +0 -3576
  71. package/dist/esm/abi.js +0 -17
  72. package/dist/esm/headless.esm-085e70ed-c4dfb380.js +0 -1717
  73. package/dist/esm/index-072be88f.js +0 -95
  74. package/dist/esm/index-66fdbb35.js +0 -1255
  75. package/dist/esm/index.js +0 -168
  76. package/dist/esm/loader.js +0 -17
  77. package/dist/esm/polyfills/core-js.js +0 -11
  78. package/dist/esm/polyfills/css-shim.js +0 -1
  79. package/dist/esm/polyfills/dom.js +0 -79
  80. package/dist/esm/polyfills/es5-html-element.js +0 -1
  81. package/dist/esm/polyfills/index.js +0 -34
  82. package/dist/esm/polyfills/system.js +0 -6
  83. package/dist/esm/result-template-decorators-881a4c8e-ed85ad21.js +0 -31
  84. package/dist/index.cjs.js +0 -1
  85. package/dist/index.js +0 -1
  86. package/dist/loader/cdn.js +0 -3
  87. package/dist/loader/index.cjs.js +0 -3
  88. package/dist/loader/index.d.ts +0 -12
  89. package/dist/loader/index.es2017.js +0 -3
  90. package/dist/loader/index.js +0 -4
  91. package/dist/loader/package.json +0 -10
  92. /package/dist/{esm → abi}/atomic-7b1e6d55.js +0 -0
@@ -1,170 +0,0 @@
1
- 'use strict';
2
-
3
- const atomic = require('./atomic-70a93c69.js');
4
-
5
- async function main() {
6
- await atomic.waitForAtomic();
7
- const searchInterface = document.querySelector("#search");
8
- searchInterface && initSearch(searchInterface);
9
- const searchBox = document.querySelector("#searchbox");
10
- searchBox && initStandaloneSearchBox(searchBox);
11
- // const platformUrl = "https://platform.cloud.coveo.com"!;
12
- // const organizationId = "anheuserbuschinbevprod"!;
13
- // const accessToken = "eyJhbGciOiJIUzI1NiJ9.eyJmaWx0ZXIiOiJAb2JqZWN0dHlwZT09RkFRIE9SIEBvYmplY3R0eXBlPT1BY2NvdW50IE9SIEB0YXJnZXRvcmc9PSh1YXQscHJvZHVjdGlvbikiLCJ2OCI6dHJ1ZSwidG9rZW5JZCI6InZ5MnJob3U0eTdjazJ2czd1Y3FwZDJzY3lhIiwib3JnYW5pemF0aW9uIjoiYW5oZXVzZXJidXNjaGluYmV2cHJvZCIsInVzZXJJZHMiOlt7InR5cGUiOiJVc2VyIiwibmFtZSI6ImFnbmllc3prYS5ub3Zha292YUBhYi1pbmJldi5jb20iLCJwcm92aWRlciI6IkVtYWlsIFNlY3VyaXR5IFByb3ZpZGVyIn1dLCJyb2xlcyI6WyJxdWVyeUV4ZWN1dG9yIl0sImlzcyI6IlNlYXJjaEFwaSIsImV4cCI6MTcyODQxOTcwNCwiaWF0IjoxNzI4MzMzMzA0fQ.KZjuzS5x8GlJY1E-wUAMpRFvUsMt0lurjDIS7bCBzEM"!;
14
- // await searchInterface.initialize({
15
- // accessToken,
16
- // organizationId,
17
- // platformUrl,
18
- // preprocessRequest: (request, clientOrigin, metadata) => {
19
- // if(clientOrigin == "searchApiFetch" && metadata?.method == "search") {
20
- // request.url += '&viewAllContent=1';
21
- // var body = JSON.parse(request.body as string);
22
- // body.context = {
23
- // "user_country_snow": "CZ"
24
- // };
25
- // request.body = JSON.stringify(body);
26
- // }
27
- // return request;
28
- // }
29
- // });
30
- // searchInterface.executeFirstSearch();
31
- // searchInterface.i18n.addResourceBundle('en', 'translation', {
32
- // 'no-results-for': 'No results for {{query}}'
33
- // });
34
- // await searchBox.initialize({
35
- // accessToken,
36
- // organizationId,
37
- // platformUrl,
38
- // preprocessRequest: (request, clientOrigin, metadata) => {
39
- // if(clientOrigin == "searchApiFetch" && metadata?.method == "search") {
40
- // request.url += '&viewAllContent=1';
41
- // var body = JSON.parse(request.body as string);
42
- // body.context = {
43
- // "user_country_snow": "CZ"
44
- // };
45
- // var q = body.q || "";
46
- // var event = new CustomEvent('header/searchbox/query', {
47
- // detail: q
48
- // });
49
- // window.dispatchEvent(event);
50
- // request.body = JSON.stringify(body);
51
- // }
52
- // return request;
53
- // },
54
- // analytics: {
55
- // enabled: false
56
- // }
57
- // });
58
- await atomic.waitForRecsAtomic();
59
- const recsInterfaces = Array.from(document.querySelectorAll('atomic-recs-interface'));
60
- recsInterfaces.length && initRecs();
61
- }
62
- async function initStandaloneSearchBox(searchBox) {
63
- const platformUrl = "https://platform.cloud.coveo.com";
64
- const organizationId = "anheuserbuschinbevprod";
65
- const accessToken = "eyJhbGciOiJIUzI1NiJ9.eyJmaWx0ZXIiOiJAb2JqZWN0dHlwZT09RkFRIE9SIEBvYmplY3R0eXBlPT1BY2NvdW50IE9SIEB0YXJnZXRvcmc9PSh1YXQscHJvZHVjdGlvbikiLCJ2OCI6dHJ1ZSwidG9rZW5JZCI6InZ5MnJob3U0eTdjazJ2czd1Y3FwZDJzY3lhIiwib3JnYW5pemF0aW9uIjoiYW5oZXVzZXJidXNjaGluYmV2cHJvZCIsInVzZXJJZHMiOlt7InR5cGUiOiJVc2VyIiwibmFtZSI6ImFnbmllc3prYS5ub3Zha292YUBhYi1pbmJldi5jb20iLCJwcm92aWRlciI6IkVtYWlsIFNlY3VyaXR5IFByb3ZpZGVyIn1dLCJyb2xlcyI6WyJxdWVyeUV4ZWN1dG9yIl0sImlzcyI6IlNlYXJjaEFwaSIsImV4cCI6MTcyODQxOTcwNCwiaWF0IjoxNzI4MzMzMzA0fQ.KZjuzS5x8GlJY1E-wUAMpRFvUsMt0lurjDIS7bCBzEM";
66
- await searchBox.initialize({
67
- accessToken,
68
- organizationId,
69
- platformUrl,
70
- preprocessRequest: (request, clientOrigin, metadata) => {
71
- if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
72
- request.url += '&viewAllContent=1';
73
- var body = JSON.parse(request.body);
74
- body.context = {
75
- "user_country_snow": "CZ"
76
- };
77
- var q = body.q || "";
78
- var event = new CustomEvent('header/searchbox/query', {
79
- detail: q
80
- });
81
- window.dispatchEvent(event);
82
- request.body = JSON.stringify(body);
83
- }
84
- return request;
85
- },
86
- analytics: {
87
- enabled: false
88
- }
89
- });
90
- }
91
- async function initSearch(searchInterface) {
92
- const platformUrl = "https://platform.cloud.coveo.com";
93
- const organizationId = "anheuserbuschinbevprod";
94
- const accessToken = "eyJhbGciOiJIUzI1NiJ9.eyJmaWx0ZXIiOiJAb2JqZWN0dHlwZT09RkFRIE9SIEBvYmplY3R0eXBlPT1BY2NvdW50IE9SIEB0YXJnZXRvcmc9PSh1YXQscHJvZHVjdGlvbikiLCJ2OCI6dHJ1ZSwidG9rZW5JZCI6InZ5MnJob3U0eTdjazJ2czd1Y3FwZDJzY3lhIiwib3JnYW5pemF0aW9uIjoiYW5oZXVzZXJidXNjaGluYmV2cHJvZCIsInVzZXJJZHMiOlt7InR5cGUiOiJVc2VyIiwibmFtZSI6ImFnbmllc3prYS5ub3Zha292YUBhYi1pbmJldi5jb20iLCJwcm92aWRlciI6IkVtYWlsIFNlY3VyaXR5IFByb3ZpZGVyIn1dLCJyb2xlcyI6WyJxdWVyeUV4ZWN1dG9yIl0sImlzcyI6IlNlYXJjaEFwaSIsImV4cCI6MTcyODQxOTcwNCwiaWF0IjoxNzI4MzMzMzA0fQ.KZjuzS5x8GlJY1E-wUAMpRFvUsMt0lurjDIS7bCBzEM";
95
- await searchInterface.initialize({
96
- accessToken,
97
- organizationId,
98
- platformUrl,
99
- preprocessRequest: (request, clientOrigin, metadata) => {
100
- if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
101
- request.url += '&viewAllContent=1';
102
- var body = JSON.parse(request.body);
103
- body.context = {
104
- "user_country_snow": "CZ"
105
- };
106
- request.body = JSON.stringify(body);
107
- }
108
- return request;
109
- },
110
- search: {
111
- preprocessSearchResponseMiddleware: (response) => {
112
- response.body.results.forEach((result) => {
113
- if (result.raw.snavatar) {
114
- result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/' + result.raw.snavatar;
115
- }
116
- return result;
117
- });
118
- return response;
119
- },
120
- }
121
- });
122
- searchInterface.executeFirstSearch();
123
- }
124
- async function initRecs() {
125
- var _a;
126
- const organizationId = "anheuserbuschinbevprod";
127
- const accessToken = "eyJhbGciOiJIUzI1NiJ9.eyJmaWx0ZXIiOiJAb2JqZWN0dHlwZT09RkFRIE9SIEBvYmplY3R0eXBlPT1BY2NvdW50IE9SIEB0YXJnZXRvcmc9PSh1YXQscHJvZHVjdGlvbikiLCJ2OCI6dHJ1ZSwidG9rZW5JZCI6InZ5MnJob3U0eTdjazJ2czd1Y3FwZDJzY3lhIiwib3JnYW5pemF0aW9uIjoiYW5oZXVzZXJidXNjaGluYmV2cHJvZCIsInVzZXJJZHMiOlt7InR5cGUiOiJVc2VyIiwibmFtZSI6ImFnbmllc3prYS5ub3Zha292YUBhYi1pbmJldi5jb20iLCJwcm92aWRlciI6IkVtYWlsIFNlY3VyaXR5IFByb3ZpZGVyIn1dLCJyb2xlcyI6WyJxdWVyeUV4ZWN1dG9yIl0sImlzcyI6IlNlYXJjaEFwaSIsImV4cCI6MTcyODQxOTcwNCwiaWF0IjoxNzI4MzMzMzA0fQ.KZjuzS5x8GlJY1E-wUAMpRFvUsMt0lurjDIS7bCBzEM";
128
- const recsInterface = document.querySelector('#recs');
129
- (_a = recsInterface.querySelector("recs-initialization-helper")) === null || _a === void 0 ? void 0 : _a.setAttribute("user-country", "BE");
130
- await (recsInterface === null || recsInterface === void 0 ? void 0 : recsInterface.initialize({
131
- accessToken: accessToken,
132
- organizationId: organizationId,
133
- preprocessRequest: (request, clientOrigin, metadata) => {
134
- if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "recommendations") {
135
- request.url += '&viewAllContent=1';
136
- var body = JSON.parse(request.body);
137
- body.context = {
138
- "user_country": "CZ",
139
- "user_country_snow": "CZ",
140
- ...body.context
141
- };
142
- request.body = JSON.stringify(body);
143
- }
144
- return request;
145
- }
146
- }));
147
- //recsInterface?.getRecommendations();
148
- /*await Promise.all(
149
- recsInterfaces.map(async (recommendationInterface: { initialize: (arg0: { accessToken: string; organizationId: string; }) => any; getOrganizationEndpoints: (arg0: string) => any; }) =>
150
- recommendationInterface.initialize({
151
- accessToken: accessToken,
152
- organizationId: organizationId
153
- })
154
- )
155
- );
156
-
157
- const context = {
158
- "user_country": "CZ",
159
- "context_user_country": "CZ"
160
- };
161
-
162
- recsInterfaces.forEach((recInterface: { engine: any; getRecommendations: () => void; }) => {
163
- const engine = recInterface.engine;
164
-
165
- engine.dispatch(loadContextActions(engine).setContext(context));
166
-
167
- recInterface.getRecommendations();
168
- });*/
169
- }
170
- main();
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3cecd23d.js');
6
-
7
- /*
8
- Stencil Client Patch Esm v2.17.3 | MIT Licensed | https://stenciljs.com
9
- */
10
- const patchEsm = () => {
11
- return index.promiseResolve();
12
- };
13
-
14
- const defineCustomElements = (win, options) => {
15
- if (typeof window === 'undefined') return Promise.resolve();
16
- return patchEsm().then(() => {
17
- 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);
18
- });
19
- };
20
-
21
- exports.defineCustomElements = defineCustomElements;
@@ -1,55 +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 atomic = require('./atomic-70a93c69.js');
8
- require('./headless.esm-085e70ed-f2e18485.js');
9
-
10
- const RecsInitializationHelper = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- }
14
- async connectedCallback() {
15
- var _a;
16
- try {
17
- await atomic.waitForAtomic();
18
- this.bindings = await index$1.initializeBindings(this.host);
19
- let toDate = new Date().toISOString();
20
- let fromDate = new Date();
21
- if (fromDate.getMonth() == 1) {
22
- fromDate.setMonth(12);
23
- fromDate.setFullYear(fromDate.getFullYear() - 1);
24
- }
25
- else {
26
- fromDate.setMonth(fromDate.getMonth() - 1);
27
- }
28
- let filter = encodeURIComponent(`(clicks.c_context_user_country_snow=='${this.userCountry}')`);
29
- let url = `https://${(_a = this.bindings) === null || _a === void 0 ? void 0 : _a.engine.state.configuration.organizationId}.admin.org.coveo.com/rest/ua/v15/stats/combinedData?from=${fromDate.toISOString()}&to=${toDate}&m=DocumentView&d=documentTitle&d=documentURL&d=clicks.c_context_user_country_snow&d=documentSysUriHash&f=${filter}&p=1&n=10&s=DocumentView&asc=false&includeMetadata=true`;
30
- const reqHeaders = new Headers();
31
- reqHeaders.append("authorization", "Bearer xxf42da36f-db11-4565-8358-8bac8c307236");
32
- const requestOptions = {
33
- method: "GET",
34
- headers: reqHeaders
35
- };
36
- let response = await fetch(url, requestOptions);
37
- response = await response.json();
38
- debugger;
39
- if (response.combinations.length > 0) {
40
- let dqExp = response.combinations.map((c) => c.documentSysUriHash);
41
- index$1.QP(this.bindings.engine).add("dqExp", dqExp);
42
- this.bindings.interfaceElement.getRecommendations();
43
- }
44
- else {
45
- this.bindings.interfaceElement.style.display = "none";
46
- }
47
- }
48
- catch (error) {
49
- console.error(error);
50
- }
51
- }
52
- get host() { return index.getElement(this); }
53
- };
54
-
55
- exports.recs_initialization_helper = RecsInitializationHelper;
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3cecd23d.js');
6
- const atomic = require('./atomic-70a93c69.js');
7
-
8
- const FaqTemplateRec = "\n<style>\n atomic-result-link{\n font-size: 1.3rem !important;\n color: #626971 !important;\n }\n faq-popup-component{\n font-size: 1.3rem; color: #626971 !important; \n }\n faq-popup-component:hover{\n text-decoration: underline; \n }\n hr {\n margin-top: 10px !important;\n }\n</style> \n<faq-popup-component></faq-popup-component>\n<hr>\n ";
9
-
10
- const QuickLinksRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n</style>\n\n\n<atomic-result-section-title>\n <atomic-result-link href-template=\"${raw.sfppcustomlinkcpplinkurlc}\"><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n</atomic-result-section-title>";
11
-
12
- const defaultRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n</style>\n<atomic-result-section-title>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n</atomic-result-section-title>";
13
-
14
- const SitePagesTemplateRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n </style>\n <atomic-result-section-title>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n </atomic-result-section-title>";
15
-
16
- const KATemplateRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n </style>\n <atomic-result-section-title>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n </atomic-result-section-title>";
17
-
18
- const AppTemplateRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n </style>\n <atomic-result-section-title>\n <atomic-result-link href-template=\"${raw.sfppcustomlinkcpplinkurlc}\"><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n </atomic-result-section-title>";
19
-
20
- const ELearningTemplateRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n </style>\n <atomic-result-section-title>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n </atomic-result-section-title>";
21
-
22
- const DocumentsTemplateRec = "<style>\n atomic-result-link a {\n font-size: 1.3rem;\n color: #626971 !important;\n }\n hr {\n margin-top: 10px !important;\n }\n </style>\n <atomic-result-section-title>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n <hr>\n </atomic-result-section-title>";
23
-
24
- const RecsResultsManager = class {
25
- constructor(hostRef) {
26
- index.registerInstance(this, hostRef);
27
- }
28
- async componentWillLoad() {
29
- return atomic.waitForRecsAtomic();
30
- }
31
- render() {
32
- return (index.h("atomic-recs-list", { "number-of-recommendations": "5" }, index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'FAQ' }, index.h("template", { innerHTML: FaqTemplateRec })), index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'Quick Links' }, index.h("template", { innerHTML: QuickLinksRec })), index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'Site Pages' }, index.h("template", { innerHTML: SitePagesTemplateRec })), index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'Knowledge Article' }, index.h("template", { innerHTML: KATemplateRec })), index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'Application' }, index.h("template", { innerHTML: AppTemplateRec })), index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'eLearning' }, index.h("template", { innerHTML: ELearningTemplateRec })), index.h("atomic-recs-result-template", { "must-match-abicontenttype": 'Documents' }, index.h("template", { innerHTML: DocumentsTemplateRec })), index.h("atomic-recs-result-template", null, index.h("template", { innerHTML: defaultRec }))));
33
- }
34
- };
35
-
36
- exports.recs_results_manager = RecsResultsManager;
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- const headless_esm085e70ed = require('./headless.esm-085e70ed-f2e18485.js');
4
-
5
- class MissingResultParentError extends Error {
6
- constructor(elementName) {
7
- super(`The "${elementName}" element must be the child of an "atomic-result" element.`);
8
- }
9
- }
10
- const resultContextEventName = 'atomic/resolveResult';
11
- /**
12
- * Retrieves `Result` on a rendered `atomic-result`.
13
- *
14
- * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/usage/create-a-result-list/) for more information.
15
- *
16
- * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
17
- *
18
- * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
19
- * @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
20
- */
21
- function resultContext(element) {
22
- return new Promise((resolve, reject) => {
23
- const event = headless_esm085e70ed.buildCustomEvent(resultContextEventName, (result) => {
24
- return resolve(result);
25
- });
26
- element.dispatchEvent(event);
27
- if (!headless_esm085e70ed.closest(element, 'atomic-result')) {
28
- reject(new MissingResultParentError(element.nodeName.toLowerCase()));
29
- }
30
- });
31
- }
32
-
33
- exports.resultContext = resultContext;