@coveops/abi 0.9.0 → 1.0.1

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 (67) 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 → p-03b6e905.entry.js} +1 -1
  5. package/dist/abi/p-1fd19815.entry.js +1 -0
  6. package/dist/abi/{p-9f80f982.entry.js → p-3303b27f.entry.js} +1 -1
  7. package/dist/abi/p-50003f11.entry.js +1 -0
  8. package/dist/abi/p-d6d34d34.js +2 -0
  9. package/dist/abi/p-dd8b0f76.entry.js +1 -0
  10. package/dist/abi/p-ddacae1a.js +49 -0
  11. package/dist/bundle/index.css +1 -1
  12. package/dist/bundle/index.html +64 -57
  13. package/dist/bundle/index.js +129 -54
  14. package/dist/cjs/abi.cjs.js +2 -2
  15. package/dist/cjs/faq-popup-component.cjs.entry.js +3 -3
  16. package/dist/cjs/{index-87155b50.js → index-355878fc.js} +55 -0
  17. package/dist/cjs/{index-03be0841.js → index-8f6652e1.js} +4 -1
  18. package/dist/cjs/index.cjs.js +27 -2
  19. package/dist/cjs/loader.cjs.js +2 -2
  20. package/dist/cjs/results-manager.cjs.entry.js +12 -12
  21. package/dist/cjs/sample-component.cjs.entry.js +2 -2
  22. package/dist/cjs/standalone-searchbox-listener.cjs.entry.js +43 -0
  23. package/dist/cjs/strip-html-component.cjs.entry.js +1 -1
  24. package/dist/collection/collection-manifest.json +1 -0
  25. package/dist/collection/components/faq-popup-component/faq-popup-component.css +6 -0
  26. package/dist/collection/components/results-manager/results-manager.js +2 -0
  27. package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.css +1 -0
  28. package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.js +45 -0
  29. package/dist/collection/index.js +26 -1
  30. package/dist/components/index.d.ts +6 -0
  31. package/dist/components/index.js +123 -17
  32. package/dist/esm/abi.js +2 -2
  33. package/dist/esm/faq-popup-component.entry.js +3 -3
  34. package/dist/esm/{index-99665e7c.js → index-3c594d24.js} +55 -0
  35. package/dist/esm/{index-42e9a708.js → index-886ab6f0.js} +2 -2
  36. package/dist/esm/index.js +27 -2
  37. package/dist/esm/loader.js +2 -2
  38. package/dist/esm/results-manager.entry.js +12 -12
  39. package/dist/esm/sample-component.entry.js +2 -2
  40. package/dist/esm/standalone-searchbox-listener.entry.js +39 -0
  41. package/dist/esm/strip-html-component.entry.js +1 -1
  42. package/dist/types/components/standalone-searchbox-listener/standalone-searchbox-listener.d.ts +7 -0
  43. package/dist/types/components.d.ts +13 -0
  44. package/package.json +1 -1
  45. package/src/components/faq-popup-component/faq-popup-component.css +6 -0
  46. package/src/components/results-manager/AppTemplate.html +1 -1
  47. package/src/components/results-manager/DocumentsTemplate.html +4 -1
  48. package/src/components/results-manager/ELearningTemplate.html +1 -1
  49. package/src/components/results-manager/FAQTemplate.html +6 -2
  50. package/src/components/results-manager/KATemplate.html +7 -4
  51. package/src/components/results-manager/MediaTemplate.html +35 -8
  52. package/src/components/results-manager/PeopleTemplate.html +9 -1
  53. package/src/components/results-manager/QuickLinksTemplate.html +2 -2
  54. package/src/components/results-manager/SitePagesTemplate.html +11 -6
  55. package/src/components/results-manager/results-manager.tsx +4 -0
  56. package/src/components/results-manager/template-1.html +37 -12
  57. package/src/components/standalone-searchbox-listener/standalone-searchbox-listener.css +1 -0
  58. package/src/components/standalone-searchbox-listener/standalone-searchbox-listener.tsx +52 -0
  59. package/src/components.d.ts +13 -0
  60. package/src/index.ts +29 -1
  61. package/src/pages/index.html +64 -57
  62. package/src/pages/recs.html +59 -0
  63. package/src/style/index.css +8 -1
  64. package/dist/abi/p-0f4a7ce9.js +0 -49
  65. package/dist/abi/p-d46927d1.entry.js +0 -1
  66. package/dist/abi/p-e7416b40.entry.js +0 -1
  67. package/dist/abi/p-facfefe1.js +0 -2
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-87155b50.js');
6
- const index$1 = require('./index-03be0841.js');
5
+ const index = require('./index-355878fc.js');
6
+ const index$1 = require('./index-8f6652e1.js');
7
7
  const atomic = require('./atomic-7321a250.js');
8
8
  require('./headless.esm-085e70ed-f2e18485.js');
9
9
 
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-355878fc.js');
6
+ const index$1 = require('./index-8f6652e1.js');
7
+ const atomic = require('./atomic-7321a250.js');
8
+ require('./headless.esm-085e70ed-f2e18485.js');
9
+
10
+ const standaloneSearchboxListenerCss = "";
11
+
12
+ const StandaloneSearchboxListener = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ }
16
+ async connectedCallback() {
17
+ try {
18
+ await atomic.waitForAtomic();
19
+ this.bindings = await index$1.initializeBindings(this.host);
20
+ }
21
+ catch (error) {
22
+ console.error(error);
23
+ }
24
+ }
25
+ async handleStandaloneSearchbox(ev) {
26
+ var _a, _b, _c, _d, _e, _f, _g;
27
+ debugger;
28
+ let queryActionCreator = index$1.fce((_a = this.bindings) === null || _a === void 0 ? void 0 : _a.engine);
29
+ (_c = (_b = this.bindings) === null || _b === void 0 ? void 0 : _b.engine) === null || _c === void 0 ? void 0 : _c.dispatch(queryActionCreator.updateQuery({
30
+ q: ev.detail
31
+ }));
32
+ let analyticsActionCreator = index$1.mde((_d = this.bindings) === null || _d === void 0 ? void 0 : _d.engine);
33
+ let searchActionCreator = index$1.$ce((_e = this.bindings) === null || _e === void 0 ? void 0 : _e.engine);
34
+ (_g = (_f = this.bindings) === null || _f === void 0 ? void 0 : _f.engine) === null || _g === void 0 ? void 0 : _g.dispatch(searchActionCreator.executeSearch(analyticsActionCreator.logSearchboxSubmit()));
35
+ }
36
+ render() {
37
+ return (index.h(index.Host, null));
38
+ }
39
+ get host() { return index.getElement(this); }
40
+ };
41
+ StandaloneSearchboxListener.style = standaloneSearchboxListenerCss;
42
+
43
+ exports.standalone_searchbox_listener = StandaloneSearchboxListener;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-87155b50.js');
5
+ const index = require('./index-355878fc.js');
6
6
  require('./headless.esm-085e70ed-f2e18485.js');
7
7
  const resultTemplateDecorators881a4c8e = require('./result-template-decorators-881a4c8e-4ff46481.js');
8
8
 
@@ -3,6 +3,7 @@
3
3
  "./components/faq-popup-component/faq-popup-component.js",
4
4
  "./components/results-manager/results-manager.js",
5
5
  "./components/sample-component/sample-component.js",
6
+ "./components/standalone-searchbox-listener/standalone-searchbox-listener.js",
6
7
  "./components/strip-html-component/strip-html-component.js"
7
8
  ],
8
9
  "compiler": {
@@ -1,3 +1,9 @@
1
1
  b {
2
2
  color: var(--atomic-primary);
3
3
  }
4
+ :host {
5
+ color: #CAA144 !important;
6
+ font-size: 1.7rem !important;
7
+ max-height: unset !important;
8
+ line-height: normal !important;
9
+ }
@@ -20,6 +20,8 @@ export class ResultsManager {
20
20
  }
21
21
  render() {
22
22
  return (h("atomic-result-list", null,
23
+ h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' },
24
+ h("template", { innerHTML: MediaTemplate })),
23
25
  h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" },
24
26
  h("template", { innerHTML: SitePagesTemplate })),
25
27
  h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" },
@@ -0,0 +1,45 @@
1
+ import { initializeBindings } from "@coveo/atomic";
2
+ import { Component, Element, h, Host, Listen } from "@stencil/core";
3
+ import { waitForAtomic } from "../../utils/atomic";
4
+ import { loadQueryActions, loadSearchActions, loadSearchAnalyticsActions } from "@coveo/headless";
5
+ export class StandaloneSearchboxListener {
6
+ async connectedCallback() {
7
+ try {
8
+ await waitForAtomic();
9
+ this.bindings = await initializeBindings(this.host);
10
+ }
11
+ catch (error) {
12
+ console.error(error);
13
+ }
14
+ }
15
+ async handleStandaloneSearchbox(ev) {
16
+ var _a, _b, _c, _d, _e, _f, _g;
17
+ debugger;
18
+ let queryActionCreator = loadQueryActions((_a = this.bindings) === null || _a === void 0 ? void 0 : _a.engine);
19
+ (_c = (_b = this.bindings) === null || _b === void 0 ? void 0 : _b.engine) === null || _c === void 0 ? void 0 : _c.dispatch(queryActionCreator.updateQuery({
20
+ q: ev.detail
21
+ }));
22
+ let analyticsActionCreator = loadSearchAnalyticsActions((_d = this.bindings) === null || _d === void 0 ? void 0 : _d.engine);
23
+ let searchActionCreator = loadSearchActions((_e = this.bindings) === null || _e === void 0 ? void 0 : _e.engine);
24
+ (_g = (_f = this.bindings) === null || _f === void 0 ? void 0 : _f.engine) === null || _g === void 0 ? void 0 : _g.dispatch(searchActionCreator.executeSearch(analyticsActionCreator.logSearchboxSubmit()));
25
+ }
26
+ render() {
27
+ return (h(Host, null));
28
+ }
29
+ static get is() { return "standalone-searchbox-listener"; }
30
+ static get encapsulation() { return "shadow"; }
31
+ static get originalStyleUrls() { return {
32
+ "$": ["standalone-searchbox-listener.css"]
33
+ }; }
34
+ static get styleUrls() { return {
35
+ "$": ["standalone-searchbox-listener.css"]
36
+ }; }
37
+ static get elementRef() { return "host"; }
38
+ static get listeners() { return [{
39
+ "name": "header/searchbox/query",
40
+ "method": "handleStandaloneSearchbox",
41
+ "target": "window",
42
+ "capture": false,
43
+ "passive": false
44
+ }]; }
45
+ }
@@ -1,7 +1,8 @@
1
1
  import { waitForAtomic } from "./utils/atomic";
2
2
  async function main() {
3
3
  await waitForAtomic();
4
- const searchInterface = document.querySelector("atomic-search-interface");
4
+ const searchInterface = document.querySelector("#search");
5
+ const searchBox = document.querySelector("#searchbox");
5
6
  const platformUrl = process.env.PLATFORM_URL;
6
7
  const organizationId = process.env.ORGANIZATION_ID;
7
8
  const accessToken = process.env.API_KEY;
@@ -22,5 +23,29 @@ async function main() {
22
23
  }
23
24
  });
24
25
  searchInterface.executeFirstSearch();
26
+ await searchBox.initialize({
27
+ accessToken,
28
+ organizationId,
29
+ platformUrl,
30
+ preprocessRequest: (request, clientOrigin, metadata) => {
31
+ if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
32
+ request.url += '&viewAllContent=1';
33
+ var body = JSON.parse(request.body);
34
+ body.context = {
35
+ "user_country_snow": "CZ"
36
+ };
37
+ var q = body.q || "";
38
+ var event = new CustomEvent('header/searchbox/query', {
39
+ detail: q
40
+ });
41
+ window.dispatchEvent(event);
42
+ request.body = JSON.stringify(body);
43
+ }
44
+ return request;
45
+ },
46
+ analytics: {
47
+ enabled: false
48
+ }
49
+ });
25
50
  }
26
51
  main();
@@ -20,6 +20,12 @@ export const SampleComponent: {
20
20
  new (): SampleComponent;
21
21
  };
22
22
 
23
+ interface StandaloneSearchboxListener extends Components.StandaloneSearchboxListener, HTMLElement {}
24
+ export const StandaloneSearchboxListener: {
25
+ prototype: StandaloneSearchboxListener;
26
+ new (): StandaloneSearchboxListener;
27
+ };
28
+
23
29
  interface StripHtmlComponent extends Components.StripHtmlComponent, HTMLElement {}
24
30
  export const StripHtmlComponent: {
25
31
  prototype: StripHtmlComponent;