@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
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, g as getElement, f as forceUpdate } from './index-99665e7c.js';
2
- import { i as initializeBindings, n as nw, D as DI } from './index-42e9a708.js';
1
+ import { r as registerInstance, h, g as getElement, f as forceUpdate } from './index-3c594d24.js';
2
+ import { i as initializeBindings, n as nw, D as DI } from './index-886ab6f0.js';
3
3
  import { w as waitForAtomic } from './atomic-0e957d02.js';
4
4
  import './headless.esm-085e70ed-c4dfb380.js';
5
5
 
@@ -0,0 +1,39 @@
1
+ import { r as registerInstance, h, g as getElement, H as Host } from './index-3c594d24.js';
2
+ import { i as initializeBindings, f as fce, m as mde, $ as $ce } from './index-886ab6f0.js';
3
+ import { w as waitForAtomic } from './atomic-0e957d02.js';
4
+ import './headless.esm-085e70ed-c4dfb380.js';
5
+
6
+ const standaloneSearchboxListenerCss = "";
7
+
8
+ const StandaloneSearchboxListener = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ }
12
+ async connectedCallback() {
13
+ try {
14
+ await waitForAtomic();
15
+ this.bindings = await initializeBindings(this.host);
16
+ }
17
+ catch (error) {
18
+ console.error(error);
19
+ }
20
+ }
21
+ async handleStandaloneSearchbox(ev) {
22
+ var _a, _b, _c, _d, _e, _f, _g;
23
+ debugger;
24
+ let queryActionCreator = fce((_a = this.bindings) === null || _a === void 0 ? void 0 : _a.engine);
25
+ (_c = (_b = this.bindings) === null || _b === void 0 ? void 0 : _b.engine) === null || _c === void 0 ? void 0 : _c.dispatch(queryActionCreator.updateQuery({
26
+ q: ev.detail
27
+ }));
28
+ let analyticsActionCreator = mde((_d = this.bindings) === null || _d === void 0 ? void 0 : _d.engine);
29
+ let searchActionCreator = $ce((_e = this.bindings) === null || _e === void 0 ? void 0 : _e.engine);
30
+ (_g = (_f = this.bindings) === null || _f === void 0 ? void 0 : _f.engine) === null || _g === void 0 ? void 0 : _g.dispatch(searchActionCreator.executeSearch(analyticsActionCreator.logSearchboxSubmit()));
31
+ }
32
+ render() {
33
+ return (h(Host, null));
34
+ }
35
+ get host() { return getElement(this); }
36
+ };
37
+ StandaloneSearchboxListener.style = standaloneSearchboxListenerCss;
38
+
39
+ export { StandaloneSearchboxListener as standalone_searchbox_listener };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-99665e7c.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-3c594d24.js';
2
2
  import './headless.esm-085e70ed-c4dfb380.js';
3
3
  import { r as resultContext } from './result-template-decorators-881a4c8e-ed85ad21.js';
4
4
 
@@ -0,0 +1,7 @@
1
+ export declare class StandaloneSearchboxListener {
2
+ private bindings?;
3
+ private host;
4
+ connectedCallback(): Promise<void>;
5
+ handleStandaloneSearchbox(ev: CustomEvent): Promise<void>;
6
+ render(): any;
7
+ }
@@ -12,6 +12,8 @@ export namespace Components {
12
12
  }
13
13
  interface SampleComponent {
14
14
  }
15
+ interface StandaloneSearchboxListener {
16
+ }
15
17
  interface StripHtmlComponent {
16
18
  }
17
19
  }
@@ -34,6 +36,12 @@ declare global {
34
36
  prototype: HTMLSampleComponentElement;
35
37
  new (): HTMLSampleComponentElement;
36
38
  };
39
+ interface HTMLStandaloneSearchboxListenerElement extends Components.StandaloneSearchboxListener, HTMLStencilElement {
40
+ }
41
+ var HTMLStandaloneSearchboxListenerElement: {
42
+ prototype: HTMLStandaloneSearchboxListenerElement;
43
+ new (): HTMLStandaloneSearchboxListenerElement;
44
+ };
37
45
  interface HTMLStripHtmlComponentElement extends Components.StripHtmlComponent, HTMLStencilElement {
38
46
  }
39
47
  var HTMLStripHtmlComponentElement: {
@@ -44,6 +52,7 @@ declare global {
44
52
  "faq-popup-component": HTMLFaqPopupComponentElement;
45
53
  "results-manager": HTMLResultsManagerElement;
46
54
  "sample-component": HTMLSampleComponentElement;
55
+ "standalone-searchbox-listener": HTMLStandaloneSearchboxListenerElement;
47
56
  "strip-html-component": HTMLStripHtmlComponentElement;
48
57
  }
49
58
  }
@@ -54,12 +63,15 @@ declare namespace LocalJSX {
54
63
  }
55
64
  interface SampleComponent {
56
65
  }
66
+ interface StandaloneSearchboxListener {
67
+ }
57
68
  interface StripHtmlComponent {
58
69
  }
59
70
  interface IntrinsicElements {
60
71
  "faq-popup-component": FaqPopupComponent;
61
72
  "results-manager": ResultsManager;
62
73
  "sample-component": SampleComponent;
74
+ "standalone-searchbox-listener": StandaloneSearchboxListener;
63
75
  "strip-html-component": StripHtmlComponent;
64
76
  }
65
77
  }
@@ -70,6 +82,7 @@ declare module "@stencil/core" {
70
82
  "faq-popup-component": LocalJSX.FaqPopupComponent & JSXBase.HTMLAttributes<HTMLFaqPopupComponentElement>;
71
83
  "results-manager": LocalJSX.ResultsManager & JSXBase.HTMLAttributes<HTMLResultsManagerElement>;
72
84
  "sample-component": LocalJSX.SampleComponent & JSXBase.HTMLAttributes<HTMLSampleComponentElement>;
85
+ "standalone-searchbox-listener": LocalJSX.StandaloneSearchboxListener & JSXBase.HTMLAttributes<HTMLStandaloneSearchboxListenerElement>;
73
86
  "strip-html-component": LocalJSX.StripHtmlComponent & JSXBase.HTMLAttributes<HTMLStripHtmlComponentElement>;
74
87
  }
75
88
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveops/abi",
3
3
  "description": "Abi project",
4
- "version": "0.9.0",
4
+ "version": "1.0.1",
5
5
  "private": false,
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",
@@ -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
+ }
@@ -27,7 +27,7 @@
27
27
 
28
28
  atomic-result-section-excerpt {
29
29
  font-size: 1.3rem !important;
30
- margin-top: 2px !important;
30
+ margin-top: 0.875rem !important;
31
31
  max-height: unset !important;
32
32
  line-height: normal !important;
33
33
  }
@@ -34,7 +34,7 @@
34
34
 
35
35
  atomic-result-section-excerpt {
36
36
  font-size: 1.3rem !important;
37
- margin-top: 2px !important;
37
+ margin-top: 0.875rem !important;
38
38
  max-height: unset !important;
39
39
  line-height: normal !important;
40
40
  }
@@ -55,6 +55,9 @@
55
55
  display: flex;
56
56
  align-items: center;
57
57
  }
58
+ atomic-result-date{
59
+ font-size:1.0rem;
60
+ }
58
61
  </style>
59
62
 
60
63
  <atomic-result-section-visual>
@@ -30,7 +30,7 @@
30
30
  }
31
31
  atomic-result-section-excerpt {
32
32
  font-size: 1.3rem !important;
33
- margin-top: 2px !important;
33
+ margin-top: 0.875rem !important;
34
34
  max-height: unset !important;
35
35
  line-height: normal !important;
36
36
  }
@@ -11,7 +11,7 @@
11
11
 
12
12
  atomic-result-section-excerpt {
13
13
  font-size: 1.3rem !important;
14
- margin-top: 2px !important;
14
+ margin-top: 0.875rem !important;
15
15
  max-height: unset !important;
16
16
  line-height: normal !important;
17
17
  }
@@ -28,7 +28,7 @@
28
28
  }
29
29
  atomic-result-section-excerpt {
30
30
  font-size: 1.3rem !important;
31
- margin-top: 2px !important;
31
+ margin-top: 0.875rem !important;
32
32
  max-height: unset !important;
33
33
  line-height: normal !important;
34
34
  }
@@ -70,6 +70,10 @@ atomic-result-section-visual {
70
70
  display: grid;
71
71
  align-items: center;
72
72
  }
73
+
74
+ atomic-result-date{
75
+ font-size:1.0rem;
76
+ }
73
77
  </style>
74
78
 
75
79
  <atomic-result-section-visual>
@@ -12,7 +12,7 @@
12
12
 
13
13
  atomic-result-section-excerpt {
14
14
  font-size: 1.3rem !important;
15
- margin-top: 2px !important;
15
+ margin-top: 0.875rem !important;
16
16
  max-height: unset !important;
17
17
  line-height: normal !important;
18
18
  }
@@ -29,7 +29,7 @@
29
29
  line-height: 18px !important;
30
30
  display: grid;
31
31
  grid-template-columns: 0.5fr 0.5fr 1fr;
32
- gap: 1rem;
32
+ gap: 5rem;
33
33
  align-items: center;
34
34
  }
35
35
  atomic-result-section-title a {
@@ -52,6 +52,9 @@
52
52
  justify-content: center;
53
53
 
54
54
  }
55
+ atomic-result-date{
56
+ font-size:1.0rem;
57
+ }
55
58
  </style>
56
59
 
57
60
  <atomic-result-section-visual>
@@ -130,9 +133,9 @@
130
133
  <atomic-result-date></atomic-result-date>
131
134
  </span> <span>
132
135
  <atomic-field-condition class="field" must-match-source="ServiceNow - Knowledge">
133
- </a><atomic-text value="Source: ServiceNow"></atomic-text>
136
+ </a><atomic-text value="Source: ServiceNow Articles"></atomic-text>
134
137
  </atomic-field-condition>
135
- </span> <span>
138
+
136
139
  <atomic-field-condition class="field" must-match-source="Salesforce - Guru">
137
140
  <atomic-text value="Source: Guru Articles">
138
141
  </atomic-field-condition>
@@ -10,7 +10,7 @@
10
10
  }
11
11
  atomic-result-section-excerpt {
12
12
  font-size: 1.3rem !important;
13
- margin-top: 2px !important;
13
+ margin-top: 0.875rem !important;
14
14
  max-height: unset !important;
15
15
  line-height: normal !important;
16
16
  }
@@ -21,6 +21,10 @@
21
21
  color: #A6A6A6 !important;
22
22
  }
23
23
 
24
+ atomic-result-section-bottom-metadata a {
25
+ color: #A6A6A6 !important;
26
+ }
27
+
24
28
 
25
29
  atomic-result-section-title a {
26
30
  color: #CAA144 !important;
@@ -40,16 +44,32 @@
40
44
  justify-content: center;
41
45
 
42
46
  }
47
+
48
+ atomic-result-section-bottom-metadata {
49
+ margin-top: 2px;
50
+ color: #A6A6A6 !important;
51
+ font-size: 1rem !important;
52
+ margin-right: 3px;
53
+ line-height: 18px !important;
54
+ display: grid;
55
+ grid-template-columns: auto auto auto;
56
+ gap: 1rem;
57
+ align-items: center;
58
+ }
59
+
60
+ atomic-result-date{
61
+ font-size:1.0rem;
62
+ }
43
63
  </style>
44
64
 
45
65
  <atomic-result-section-visual>
46
- <atomic-field-condition class="field" must-match-filetype="mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v">
47
- <img src="https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Images.png" alt="Image" />
66
+ <atomic-field-condition class="field" must-match-filetype="mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg">
67
+ <img src="https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Movies.png" alt="Image" />
48
68
  <!-- <atomic-icon class="icon"></atomic-icon>
49
69
  <img src="https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Movies.png" class="thumbnail"> -->
50
70
  </atomic-field-condition>
51
- <atomic-field-condition class="field" must-match-filetype="gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v">
52
- <img src="https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Movies.png" alt="Image" />
71
+ <atomic-field-condition class="field" must-match-filetype="gif,jpeg,jpg,png,bmp,Image">
72
+ <img src="https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Images.png" alt="Image" />
53
73
  <!-- <atomic-icon class="icon"></atomic-icon>
54
74
  <img src="https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Images.png" class="thumbnail"> -->
55
75
  </atomic-field-condition>
@@ -62,7 +82,14 @@
62
82
 
63
83
 
64
84
  <atomic-result-section-bottom-metadata>
65
- <atomic-result-fields-list>
66
- <atomic-result-text field="PrintableUri"></atomic-result-text>
67
- </atomic-result-fields-list>
85
+ <span>
86
+ <atomic-text value="Date: &nbsp;"></atomic-text>
87
+ <atomic-result-date></atomic-result-date>
88
+ </span><span>
89
+ <atomic-text value="Source: &nbsp;"></atomic-text><atomic-result-text field="sourcetype"></atomic-result-text>
90
+ </span><span> <atomic-text value="Sharepoint: &nbsp;"></atomic-text>
91
+ <atomic-result-link><a slot="attributes" target="_blank"></a>
92
+ <atomic-result-text field="spsitename"></atomic-result-text>
93
+ </atomic-result-link>
94
+ </span>
68
95
  </atomic-result-section-bottom-metadata>
@@ -2,6 +2,7 @@
2
2
  .field {
3
3
  display: inline-flex;
4
4
  align-items: center;
5
+ line-height: normal !important;
5
6
  }
6
7
 
7
8
  .field-label {
@@ -12,7 +13,7 @@
12
13
  atomic-result-section-bottom-metadata {
13
14
  display: grid;
14
15
  grid-template-columns: 1fr 1fr;
15
- font-size: 1.3rem;
16
+ font-size: 1.3rem !important;
16
17
  width: 100%;
17
18
  margin-top: 2px;
18
19
  max-height: 25rem !important;
@@ -30,6 +31,13 @@
30
31
  display: grid;
31
32
  align-items: center;
32
33
  }
34
+ atomic-result-image{
35
+ width: auto !important;
36
+ height: auto !important;
37
+ }
38
+ atomic-result-image img{
39
+ border-radius: 20% !important;
40
+ }
33
41
  </style>
34
42
 
35
43
  <atomic-result-section-visual>
@@ -23,7 +23,7 @@
23
23
 
24
24
  atomic-result-section-excerpt {
25
25
  font-size: 13px;
26
- margin-top: 2px !important;
26
+ margin-top: 0.875rem !important;
27
27
  }
28
28
 
29
29
  atomic-result-section-title a:visited {
@@ -47,7 +47,7 @@
47
47
 
48
48
  atomic-result-section-excerpt {
49
49
  font-size: 1.3rem !important;
50
- margin-top: 2px !important;
50
+ margin-top: 0.875rem !important;
51
51
  max-height: unset !important;
52
52
  line-height: normal !important;
53
53
  }
@@ -20,7 +20,7 @@
20
20
  }
21
21
  atomic-result-section-excerpt {
22
22
  font-size: 1.3rem !important;
23
- margin-top:2px !important;
23
+ margin-top:0.875rem !important;
24
24
  max-height: unset !important;
25
25
  line-height: normal !important;
26
26
  }
@@ -41,10 +41,7 @@
41
41
  align-items: center;
42
42
  }
43
43
 
44
- atomic-result-date {
45
- font-size: 13px;
46
- justify-self: end;
47
- }
44
+
48
45
 
49
46
  atomic-result-section-title a {
50
47
  color: #CAA144 !important;
@@ -66,6 +63,9 @@
66
63
  display: flex;
67
64
  align-items: center;
68
65
  }
66
+ atomic-result-date{
67
+ font-size:1.0rem;
68
+ }
69
69
  </style>
70
70
 
71
71
  <atomic-result-section-visual>
@@ -108,7 +108,12 @@
108
108
 
109
109
  <atomic-result-section-title>
110
110
  <div class="title-date">
111
- <atomic-result-link> <a slot="attributes" target="_blank"></a></atomic-result-link>
111
+ <atomic-result-link>
112
+ <a slot="attributes" target="_blank"></a>
113
+ <atomic-result-text field="PrintableUri"></atomic-result-text>
114
+ &nbsp;-&nbsp;
115
+ <atomic-result-text field="title"></atomic-result-text>
116
+ </atomic-result-link>
112
117
  </div>
113
118
  </atomic-result-section-title>
114
119
 
@@ -27,7 +27,11 @@ export class ResultsManager {
27
27
 
28
28
 
29
29
  return (
30
+
30
31
  <atomic-result-list>
32
+ <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'>
33
+ <template innerHTML={MediaTemplate}></template>
34
+ </atomic-result-template>
31
35
  <atomic-result-template must-match-abicontenttype="Site Pages">
32
36
  <template innerHTML={SitePagesTemplate}></template>
33
37
  </atomic-result-template>
@@ -16,14 +16,19 @@
16
16
 
17
17
 
18
18
  atomic-result-section-bottom-metadata {
19
+ margin-top: 2px;
19
20
  color: #A6A6A6 !important;
20
- margin-right: 3px;
21
21
  font-size: 1rem !important;
22
+ margin-right: 3px;
22
23
  line-height: 18px !important;
24
+ display: grid;
25
+ grid-template-columns: auto auto auto;
26
+ gap: 1rem;
27
+ align-items: center;
23
28
  }
24
29
 
25
30
  atomic-result-date {
26
- font-size: 13px;
31
+ font-size: 1.0rem;
27
32
  justify-self: end;
28
33
  }
29
34
 
@@ -35,14 +40,15 @@
35
40
  }
36
41
 
37
42
 
38
-
39
- atomic-result-link a:visited {
43
+ atomic-result-section-bottom-metadata a {
44
+ color: #A6A6A6 !important;
45
+ }
46
+ atomic-result-section-title a:visited {
40
47
  color: black !important;
41
48
  }
42
-
43
49
  atomic-result-section-excerpt {
44
50
  font-size: 1.3rem !important;
45
- margin-top: 2px !important;
51
+ margin-top: 0.875rem !important;
46
52
  max-height: unset !important;
47
53
  line-height: normal !important;
48
54
  }
@@ -53,6 +59,18 @@
53
59
  display: grid;
54
60
  align-items: center;
55
61
  }
62
+ atomic-result-section-bottom-metadata span {
63
+ display: flex;
64
+ align-items: center;
65
+ }
66
+
67
+ atomic-field-condition{
68
+ max-width: 100%;
69
+ display: grid;
70
+ grid-template-columns: auto auto auto;
71
+ align-items: center;
72
+ gap: 1rem;
73
+ }
56
74
  </style>
57
75
 
58
76
  <atomic-result-section-visual>
@@ -128,10 +146,17 @@
128
146
  <atomic-result-text field="excerpt"></atomic-result-text>
129
147
  </atomic-result-section-excerpt>
130
148
 
131
- <!-- <atomic-result-section-bottom-metadata>
132
- <atomic-result-fields-list>
133
- <atomic-result-link> <a slot="attributes" target="_blank"></a>
134
- <atomic-result-text field="PrintableUri"></atomic-result-text>
149
+ <atomic-result-section-bottom-metadata>
150
+ <atomic-field-condition must-match-sourcetype="SharePointOnline">
151
+ <span>
152
+ <atomic-text value="Date: &nbsp;"></atomic-text>
153
+ <atomic-result-date></atomic-result-date>
154
+ </span><span>
155
+ <atomic-text value="Source: &nbsp;"></atomic-text><atomic-result-text field="sourcetype"></atomic-result-text>
156
+ </span><span> <atomic-text value="Sharepoint: &nbsp;"></atomic-text>
157
+ <atomic-result-link><a slot="attributes" target="_blank"></a>
158
+ <atomic-result-text field="spsitename"></atomic-result-text>
135
159
  </atomic-result-link>
136
- </atomic-result-fields-list>
137
- </atomic-result-section-bottom-metadata> -->
160
+ </span>
161
+ </atomic-field-condition>
162
+ </atomic-result-section-bottom-metadata>
@@ -0,0 +1,52 @@
1
+ import { Bindings, 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
+
6
+ @Component({
7
+ tag: "standalone-searchbox-listener",
8
+ styleUrl: "standalone-searchbox-listener.css",
9
+ shadow: true,
10
+ })
11
+ export class StandaloneSearchboxListener {
12
+
13
+ private bindings?: Bindings;
14
+
15
+ @Element() private host!: Element;
16
+
17
+ public async connectedCallback() {
18
+ try {
19
+ await waitForAtomic();
20
+ this.bindings = await initializeBindings(this.host);
21
+
22
+
23
+ } catch (error) {
24
+ console.error(error);
25
+ }
26
+ }
27
+
28
+ @Listen('header/searchbox/query', { target: 'window' })
29
+ async handleStandaloneSearchbox(ev: CustomEvent) {
30
+ debugger;
31
+ let queryActionCreator = loadQueryActions(this.bindings?.engine!);
32
+ this.bindings?.engine?.dispatch(
33
+ queryActionCreator.updateQuery({
34
+ q: ev.detail
35
+ })
36
+ );
37
+ let analyticsActionCreator = loadSearchAnalyticsActions(this.bindings?.engine!);
38
+ let searchActionCreator = loadSearchActions(this.bindings?.engine!);
39
+ this.bindings?.engine?.dispatch(
40
+ searchActionCreator.executeSearch(
41
+ analyticsActionCreator.logSearchboxSubmit()
42
+ )
43
+ );
44
+ }
45
+
46
+ public render() {
47
+ return (
48
+ <Host></Host>
49
+ )
50
+ }
51
+
52
+ }
@@ -12,6 +12,8 @@ export namespace Components {
12
12
  }
13
13
  interface SampleComponent {
14
14
  }
15
+ interface StandaloneSearchboxListener {
16
+ }
15
17
  interface StripHtmlComponent {
16
18
  }
17
19
  }
@@ -34,6 +36,12 @@ declare global {
34
36
  prototype: HTMLSampleComponentElement;
35
37
  new (): HTMLSampleComponentElement;
36
38
  };
39
+ interface HTMLStandaloneSearchboxListenerElement extends Components.StandaloneSearchboxListener, HTMLStencilElement {
40
+ }
41
+ var HTMLStandaloneSearchboxListenerElement: {
42
+ prototype: HTMLStandaloneSearchboxListenerElement;
43
+ new (): HTMLStandaloneSearchboxListenerElement;
44
+ };
37
45
  interface HTMLStripHtmlComponentElement extends Components.StripHtmlComponent, HTMLStencilElement {
38
46
  }
39
47
  var HTMLStripHtmlComponentElement: {
@@ -44,6 +52,7 @@ declare global {
44
52
  "faq-popup-component": HTMLFaqPopupComponentElement;
45
53
  "results-manager": HTMLResultsManagerElement;
46
54
  "sample-component": HTMLSampleComponentElement;
55
+ "standalone-searchbox-listener": HTMLStandaloneSearchboxListenerElement;
47
56
  "strip-html-component": HTMLStripHtmlComponentElement;
48
57
  }
49
58
  }
@@ -54,12 +63,15 @@ declare namespace LocalJSX {
54
63
  }
55
64
  interface SampleComponent {
56
65
  }
66
+ interface StandaloneSearchboxListener {
67
+ }
57
68
  interface StripHtmlComponent {
58
69
  }
59
70
  interface IntrinsicElements {
60
71
  "faq-popup-component": FaqPopupComponent;
61
72
  "results-manager": ResultsManager;
62
73
  "sample-component": SampleComponent;
74
+ "standalone-searchbox-listener": StandaloneSearchboxListener;
63
75
  "strip-html-component": StripHtmlComponent;
64
76
  }
65
77
  }
@@ -70,6 +82,7 @@ declare module "@stencil/core" {
70
82
  "faq-popup-component": LocalJSX.FaqPopupComponent & JSXBase.HTMLAttributes<HTMLFaqPopupComponentElement>;
71
83
  "results-manager": LocalJSX.ResultsManager & JSXBase.HTMLAttributes<HTMLResultsManagerElement>;
72
84
  "sample-component": LocalJSX.SampleComponent & JSXBase.HTMLAttributes<HTMLSampleComponentElement>;
85
+ "standalone-searchbox-listener": LocalJSX.StandaloneSearchboxListener & JSXBase.HTMLAttributes<HTMLStandaloneSearchboxListenerElement>;
73
86
  "strip-html-component": LocalJSX.StripHtmlComponent & JSXBase.HTMLAttributes<HTMLStripHtmlComponentElement>;
74
87
  }
75
88
  }
package/src/index.ts CHANGED
@@ -3,7 +3,10 @@ import { waitForAtomic } from "./utils/atomic";
3
3
  async function main() {
4
4
  await waitForAtomic();
5
5
  const searchInterface: HTMLAtomicSearchInterfaceElement =
6
- document.querySelector("atomic-search-interface")!;
6
+ document.querySelector("#search")!;
7
+
8
+ const searchBox: HTMLAtomicSearchInterfaceElement =
9
+ document.querySelector("#searchbox")!;
7
10
 
8
11
  const platformUrl = process.env.PLATFORM_URL!;
9
12
  const organizationId = process.env.ORGANIZATION_ID!;
@@ -26,6 +29,31 @@ async function main() {
26
29
  });
27
30
 
28
31
  searchInterface.executeFirstSearch();
32
+
33
+ await searchBox.initialize({
34
+ accessToken,
35
+ organizationId,
36
+ platformUrl,
37
+ preprocessRequest: (request, clientOrigin, metadata) => {
38
+ if(clientOrigin == "searchApiFetch" && metadata?.method == "search") {
39
+ request.url += '&viewAllContent=1';
40
+ var body = JSON.parse(request.body as string);
41
+ body.context = {
42
+ "user_country_snow": "CZ"
43
+ };
44
+ var q = body.q || "";
45
+ var event = new CustomEvent('header/searchbox/query', {
46
+ detail: q
47
+ });
48
+ window.dispatchEvent(event);
49
+ request.body = JSON.stringify(body);
50
+ }
51
+ return request;
52
+ },
53
+ analytics: {
54
+ enabled: false
55
+ }
56
+ });
29
57
  }
30
58
 
31
59
  main();