@coveops/abi 0.1.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 (90) hide show
  1. package/.env.example +24 -0
  2. package/README.md +34 -0
  3. package/coveo.deploy.json +30 -0
  4. package/deployment.esbuild.mjs +54 -0
  5. package/dist/abi/abi.css +1 -0
  6. package/dist/abi/abi.esm.js +1 -0
  7. package/dist/abi/index.esm.js +1 -0
  8. package/dist/abi/p-0ae1e588.js +2 -0
  9. package/dist/abi/p-38555fec.js +1 -0
  10. package/dist/abi/p-424e40eb.entry.js +1 -0
  11. package/dist/abi/p-4da5a336.js +18 -0
  12. package/dist/abi/p-941f664c.entry.js +1 -0
  13. package/dist/abi/p-e5564016.entry.js +50 -0
  14. package/dist/bundle/index.css +1 -0
  15. package/dist/bundle/index.html +61 -0
  16. package/dist/bundle/index.js +673 -0
  17. package/dist/cjs/abi.cjs.js +19 -0
  18. package/dist/cjs/atomic-7321a250.js +7 -0
  19. package/dist/cjs/faq-popup-component.cjs.entry.js +106 -0
  20. package/dist/cjs/index-39c8295a.js +1753 -0
  21. package/dist/cjs/index-bea59ea1.js +1093 -0
  22. package/dist/cjs/index.cjs.js +18 -0
  23. package/dist/cjs/loader.cjs.js +21 -0
  24. package/dist/cjs/results-manager.cjs.entry.js +40 -0
  25. package/dist/cjs/sample-component.cjs.entry.js +146 -0
  26. package/dist/collection/collection-manifest.json +19 -0
  27. package/dist/collection/components/faq-popup-component/faq-popup-component.css +15 -0
  28. package/dist/collection/components/faq-popup-component/faq-popup-component.js +78 -0
  29. package/dist/collection/components/results-manager/results-manager.js +45 -0
  30. package/dist/collection/components/sample-component/sample-component.css +10 -0
  31. package/dist/collection/components/sample-component/sample-component.js +102 -0
  32. package/dist/collection/index.js +15 -0
  33. package/dist/collection/utils/atomic.js +3 -0
  34. package/dist/components/index.d.ts +57 -0
  35. package/dist/components/index.js +2999 -0
  36. package/dist/esm/abi.js +17 -0
  37. package/dist/esm/atomic-0e957d02.js +5 -0
  38. package/dist/esm/faq-popup-component.entry.js +102 -0
  39. package/dist/esm/index-51334f26.js +1065 -0
  40. package/dist/esm/index-9483cecb.js +1749 -0
  41. package/dist/esm/index.js +16 -0
  42. package/dist/esm/loader.js +17 -0
  43. package/dist/esm/polyfills/core-js.js +11 -0
  44. package/dist/esm/polyfills/css-shim.js +1 -0
  45. package/dist/esm/polyfills/dom.js +79 -0
  46. package/dist/esm/polyfills/es5-html-element.js +1 -0
  47. package/dist/esm/polyfills/index.js +34 -0
  48. package/dist/esm/polyfills/system.js +6 -0
  49. package/dist/esm/results-manager.entry.js +36 -0
  50. package/dist/esm/sample-component.entry.js +142 -0
  51. package/dist/index.cjs.js +1 -0
  52. package/dist/index.js +1 -0
  53. package/dist/loader/cdn.js +3 -0
  54. package/dist/loader/index.cjs.js +3 -0
  55. package/dist/loader/index.d.ts +12 -0
  56. package/dist/loader/index.es2017.js +3 -0
  57. package/dist/loader/index.js +4 -0
  58. package/dist/loader/package.json +10 -0
  59. package/dist/types/components/faq-popup-component/faq-popup-component.d.ts +10 -0
  60. package/dist/types/components/results-manager/results-manager.d.ts +8 -0
  61. package/dist/types/components/sample-component/sample-component.d.ts +25 -0
  62. package/dist/types/components.d.ts +63 -0
  63. package/dist/types/html.d.ts +4 -0
  64. package/dist/types/index.d.ts +1 -0
  65. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  66. package/dist/types/utils/atomic.d.ts +1 -0
  67. package/package.json +31 -0
  68. package/src/components/faq-popup-component/faq-popup-component.css +15 -0
  69. package/src/components/faq-popup-component/faq-popup-component.tsx +102 -0
  70. package/src/components/results-manager/AppTemplate.html +44 -0
  71. package/src/components/results-manager/DocumentsTemplate.html +37 -0
  72. package/src/components/results-manager/ELearningTemplate.html +81 -0
  73. package/src/components/results-manager/FAQTemplate.html +73 -0
  74. package/src/components/results-manager/KATemplate.html +84 -0
  75. package/src/components/results-manager/MediaTemplate.html +40 -0
  76. package/src/components/results-manager/PeopleTemplate.html +74 -0
  77. package/src/components/results-manager/QuickLinksTemplate.html +51 -0
  78. package/src/components/results-manager/SitePagesTemplate.html +69 -0
  79. package/src/components/results-manager/results-manager.tsx +64 -0
  80. package/src/components/results-manager/template-1.html +67 -0
  81. package/src/components/sample-component/sample-component.css +10 -0
  82. package/src/components/sample-component/sample-component.tsx +157 -0
  83. package/src/components.d.ts +63 -0
  84. package/src/html.d.ts +4 -0
  85. package/src/index.ts +20 -0
  86. package/src/pages/index.html +137 -0
  87. package/src/style/index.css +12 -0
  88. package/src/utils/atomic.ts +3 -0
  89. package/stencil.config.ts +63 -0
  90. package/tsconfig.json +19 -0
@@ -0,0 +1,69 @@
1
+ <style>
2
+ .field {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ }
6
+
7
+ .field-label {
8
+ font-weight: bold;
9
+ margin-right: 0.25rem;
10
+ }
11
+
12
+ .title-date {
13
+ display: grid;
14
+ grid-template-columns: 3fr 1fr;
15
+ }
16
+
17
+ atomic-result-section-excerpt {
18
+ font-size: 13px;
19
+ margin-top:2px !important;
20
+ }
21
+
22
+ atomic-result-link a:visited {
23
+ color: #45130f !important;
24
+
25
+ }
26
+
27
+ atomic-result-section-bottom-metadata {
28
+ color: darkgray !important;
29
+ font-weight: bold;
30
+ margin-right: 3px;
31
+ margin-right: 2px;
32
+ font-size: 14px;
33
+ line-height: 18px !important;
34
+ }
35
+
36
+ atomic-result-date {
37
+ font-size: 13px;
38
+ justify-self: end;
39
+ }
40
+
41
+ atomic-result-section-title a {
42
+ color: #b11f24 !important;
43
+ font-size: 13px;
44
+ font-weight: 600;
45
+ }
46
+
47
+ </style>
48
+
49
+ <atomic-result-section-visual>
50
+ <atomic-icon class="icon"></atomic-icon>
51
+ <img src="https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Default.png" class="thumbnail">
52
+ </atomic-result-section-visual>
53
+
54
+ <atomic-result-section-title>
55
+ <div class="title-date">
56
+ <atomic-result-link></atomic-result-link>
57
+ <atomic-result-date></atomic-result-date>
58
+ </div>
59
+ </atomic-result-section-title>
60
+
61
+ <atomic-result-section-excerpt>
62
+ <atomic-result-text field="description"></atomic-result-text>
63
+ </atomic-result-section-excerpt>
64
+
65
+ <atomic-result-section-bottom-metadata>
66
+ <atomic-result-fields-list>
67
+ <atomic-result-link> <atomic-result-text field="PrintableUri"></atomic-result-text></atomic-result-link>
68
+ </atomic-result-fields-list>
69
+ </atomic-result-section-bottom-metadata>
@@ -0,0 +1,64 @@
1
+ import { Component, h } from "@stencil/core";
2
+ import { waitForAtomic } from "../../utils/atomic";
3
+ import template1 from "./template-1.html";
4
+ import SitePagesTemplate from "./SitePagesTemplate.html";
5
+ import KATemplate from "./KATemplate.html";
6
+ import FAQTemplate from "./FAQTemplate.html";
7
+ import QuickLinksTemplate from "./QuickLinksTemplate.html";
8
+ import AppTemplate from "./AppTemplate.html";
9
+ import ELearningTemplate from "./ELearningTemplate.html";
10
+ import PeopleTemplate from "./PeopleTemplate.html";
11
+ import DocumentsTemplate from "./DocumentsTemplate.html";
12
+ import MediaTemplate from "./MediaTemplate.html";
13
+ /**
14
+ * Component used to manage results & result templates.
15
+ * See https://docs.coveo.com/en/atomic/latest/usage/create-a-result-list/
16
+ */
17
+ @Component({
18
+ tag: "results-manager",
19
+ shadow: false,
20
+ })
21
+ export class ResultsManager {
22
+ public async componentWillLoad() {
23
+ return waitForAtomic();
24
+ }
25
+
26
+ public render() {
27
+
28
+
29
+ return (
30
+ <atomic-result-list>
31
+ <atomic-result-template must-match-abicontenttype="Site Pages">
32
+ <template innerHTML={SitePagesTemplate}></template>
33
+ </atomic-result-template>
34
+ <atomic-result-template must-match-abicontenttype="Knowledge Article">
35
+ <template innerHTML={KATemplate}></template>
36
+ </atomic-result-template>
37
+ <atomic-result-template must-match-abicontenttype='FAQ'>
38
+ <template innerHTML={FAQTemplate}></template>
39
+ </atomic-result-template>
40
+ <atomic-result-template must-match-abicontenttype='Quick Links'>
41
+ <template innerHTML={QuickLinksTemplate}></template>
42
+ </atomic-result-template>
43
+ <atomic-result-template must-match-abicontenttype='Application'>
44
+ <template innerHTML={AppTemplate}></template>
45
+ </atomic-result-template>
46
+ <atomic-result-template must-match-abicontenttype='eLearning'>
47
+ <template innerHTML={ELearningTemplate}></template>
48
+ </atomic-result-template>
49
+ <atomic-result-template must-match-abicontenttype='People'>
50
+ <template innerHTML={PeopleTemplate}></template>
51
+ </atomic-result-template>
52
+ <atomic-result-template must-match-abicontenttype='Documents'>
53
+ <template innerHTML={DocumentsTemplate}></template>
54
+ </atomic-result-template>
55
+ <atomic-result-template must-match-abicontenttype='Media'>
56
+ <template innerHTML={MediaTemplate}></template>
57
+ </atomic-result-template>
58
+ <atomic-result-template>
59
+ <template innerHTML={template1}></template>
60
+ </atomic-result-template>
61
+ </atomic-result-list>
62
+ );
63
+ }
64
+ }
@@ -0,0 +1,67 @@
1
+ <style>
2
+ .field {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ }
6
+
7
+ .field-label {
8
+ font-weight: bold;
9
+ margin-right: 0.25rem;
10
+ }
11
+
12
+ .title-date {
13
+ display: grid;
14
+ grid-template-columns: 3fr 1fr;
15
+ }
16
+
17
+ atomic-result-section-excerpt {
18
+ font-size: 13px;
19
+ margin-top:2px !important;
20
+ }
21
+
22
+ atomic-result-link a:visited {
23
+ color: #45130f !important;
24
+
25
+ }
26
+
27
+ atomic-result-section-bottom-metadata {
28
+ color: darkgray !important;
29
+ font-weight: bold;
30
+ margin-right: 3px;
31
+ font-size: 14px;
32
+ line-height: 18px !important;
33
+ }
34
+
35
+ atomic-result-date {
36
+ font-size: 13px;
37
+ justify-self: end;
38
+ }
39
+
40
+ atomic-result-section-title a {
41
+ color: #b11f24 !important;
42
+ font-size: 13px;
43
+ font-weight: 600;
44
+ }
45
+ </style>
46
+
47
+ <atomic-result-section-visual>
48
+ <atomic-icon class="icon"></atomic-icon>
49
+ <img src="https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Default.png" class="thumbnail">
50
+ </atomic-result-section-visual>
51
+
52
+ <atomic-result-section-title>
53
+ <div class="title-date">
54
+ <atomic-result-link></atomic-result-link>
55
+ <atomic-result-date></atomic-result-date>
56
+ </div>
57
+ </atomic-result-section-title>
58
+
59
+ <atomic-result-section-excerpt>
60
+ <atomic-result-text field="excerpt"></atomic-result-text>
61
+ </atomic-result-section-excerpt>
62
+
63
+ <atomic-result-section-bottom-metadata>
64
+ <atomic-result-fields-list>
65
+ <atomic-result-link> <atomic-result-text field="PrintableUri"></atomic-result-text></atomic-result-link>
66
+ </atomic-result-fields-list>
67
+ </atomic-result-section-bottom-metadata>
@@ -0,0 +1,10 @@
1
+ nav {
2
+ width: 300px;
3
+ display: flex;
4
+ justify-content: space-around;
5
+ }
6
+
7
+ button {
8
+ color: var(--atomic-on-primary);
9
+ background-color: var(--atomic-primary);
10
+ }
@@ -0,0 +1,157 @@
1
+ import { Bindings, initializeBindings } from "@coveo/atomic";
2
+ import { Component, Element, h, State, forceUpdate } from "@stencil/core";
3
+ import {
4
+ PagerState,
5
+ Pager,
6
+ SearchStatusState,
7
+ buildSearchStatus,
8
+ buildPager,
9
+ Unsubscribe,
10
+ } from "@coveo/headless";
11
+ import { waitForAtomic } from "../../utils/atomic";
12
+
13
+ /**
14
+ * Sample custom Atomic component, initializing itself against a parent search interface in order to retrieve the bindings.
15
+ *
16
+ * This component showcases a custom-made pagination component, for educational purposes.
17
+ *
18
+ * In a real life scenario, we recommend using either [atomic-pager](https://docs.coveo.com/en/atomic/latest/reference/components/atomic-pager/) or [atomic-load-more-results](https://docs.coveo.com/en/atomic/latest/reference/components/atomic-load-more-results/) instead.
19
+ */
20
+ @Component({
21
+ tag: "sample-component",
22
+ styleUrl: "sample-component.css",
23
+ shadow: true,
24
+ })
25
+ export class SampleComponent {
26
+ // The Atomic bindings to be resolved on the parent atomic-search-interface.
27
+ // Used to access the Headless engine in order to create controllers, dispatch actions, access state, etc.
28
+ private bindings?: Bindings;
29
+
30
+ // We recommend recording possible errors thrown during the configuration.
31
+ private error?: Error;
32
+
33
+ // Headless controller that contains the necessary methods.
34
+ private pagerController!: Pager;
35
+
36
+ // When disconnecting components from the page, we recommend removing
37
+ // state change listeners as well by calling the unsubscribe methods.
38
+ private pagerUnsubscribe: Unsubscribe = () => {};
39
+ private statusUnsubscribe: Unsubscribe = () => {};
40
+ private i18nUnsubscribe = () => {};
41
+
42
+ @Element() private host!: Element;
43
+
44
+ // Headless controller state property, using the `@State()` decorator.
45
+ // Headless will automatically update these objects when the state related
46
+ // to the controller has changed.
47
+ @State() private pagerState!: PagerState;
48
+ @State() private statusState!: SearchStatusState;
49
+
50
+ // We recommend initializing the bindings and the Headless controllers
51
+ // using the `connectedCallback` lifecycle method with async/await.
52
+ // Using `componentWillLoad` will hang the parent atomic-search-interface initialization.
53
+ public async connectedCallback() {
54
+ try {
55
+ // Wait for the Atomic to load and bindings to be resolved.
56
+ await waitForAtomic();
57
+ this.bindings = await initializeBindings(this.host);
58
+
59
+ // Initialize controllers.
60
+ const statusController = buildSearchStatus(this.bindings.engine);
61
+ this.pagerController = buildPager(this.bindings.engine);
62
+
63
+ // Subscribe to controller state changes.
64
+ this.statusUnsubscribe = statusController.subscribe(
65
+ () => (this.statusState = statusController.state)
66
+ );
67
+ this.pagerUnsubscribe = this.pagerController.subscribe(
68
+ () => (this.pagerState = this.pagerController.state)
69
+ );
70
+
71
+ // (Optional) To use if component needs to rerender when the Atomic i18n language changes.
72
+ // If your component does not use any strings or does not support multiple languages,
73
+ // you can ignore everything related to i18n.
74
+ const updateLanguage = () => forceUpdate(this);
75
+ this.bindings!.i18n.on("languageChanged", updateLanguage);
76
+ this.i18nUnsubscribe = () =>
77
+ this.bindings!.i18n.off("languageChanged", updateLanguage);
78
+ } catch (error) {
79
+ console.error(error);
80
+ this.error = error as Error;
81
+ }
82
+ }
83
+
84
+ // The `disconnectedCallback` lifecycle method should be used to unsubcribe controllers and
85
+ // possibly the i18n language change listener.
86
+ public disconnectedCallback() {
87
+ this.pagerUnsubscribe();
88
+ this.statusUnsubscribe();
89
+ this.i18nUnsubscribe();
90
+ }
91
+
92
+ private get pages() {
93
+ const pages = this.pagerState!.currentPages;
94
+ return pages.map((page) => this.buildPage(page));
95
+ }
96
+
97
+ private buildPage(page: number) {
98
+ const isSelected = this.pagerController.isCurrentPage(page);
99
+ return (
100
+ <button
101
+ onClick={() => {
102
+ this.pagerController.selectPage(page);
103
+ }}
104
+ >
105
+ {isSelected ? "✓ " : ""}
106
+ {page.toLocaleString(this.bindings!.i18n.language)}
107
+ </button>
108
+ );
109
+ }
110
+
111
+ private get previous() {
112
+ return (
113
+ <button
114
+ onClick={() => {
115
+ this.pagerController.previousPage();
116
+ }}
117
+ >
118
+ <atomic-text value="previous"></atomic-text>
119
+ </button>
120
+ );
121
+ }
122
+
123
+ private get next() {
124
+ return (
125
+ <button
126
+ onClick={() => {
127
+ this.pagerController.nextPage();
128
+ }}
129
+ >
130
+ <atomic-text value="next"></atomic-text>
131
+ </button>
132
+ );
133
+ }
134
+
135
+ public render() {
136
+ if (this.error) {
137
+ return (
138
+ <p>
139
+ Error when initializing the component, please view the console for
140
+ more information.
141
+ </p>
142
+ );
143
+ }
144
+
145
+ if (!this.bindings || !this.statusState.hasResults) {
146
+ return;
147
+ }
148
+
149
+ return (
150
+ <nav>
151
+ {this.pagerState.hasPreviousPage && this.previous}
152
+ {this.pages}
153
+ {this.pagerState.hasNextPage && this.next}
154
+ </nav>
155
+ );
156
+ }
157
+ }
@@ -0,0 +1,63 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /**
4
+ * This is an autogenerated file created by the Stencil compiler.
5
+ * It contains typing information for all components that exist in this project.
6
+ */
7
+ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
8
+ export namespace Components {
9
+ interface FaqPopupComponent {
10
+ }
11
+ interface ResultsManager {
12
+ }
13
+ interface SampleComponent {
14
+ }
15
+ }
16
+ declare global {
17
+ interface HTMLFaqPopupComponentElement extends Components.FaqPopupComponent, HTMLStencilElement {
18
+ }
19
+ var HTMLFaqPopupComponentElement: {
20
+ prototype: HTMLFaqPopupComponentElement;
21
+ new (): HTMLFaqPopupComponentElement;
22
+ };
23
+ interface HTMLResultsManagerElement extends Components.ResultsManager, HTMLStencilElement {
24
+ }
25
+ var HTMLResultsManagerElement: {
26
+ prototype: HTMLResultsManagerElement;
27
+ new (): HTMLResultsManagerElement;
28
+ };
29
+ interface HTMLSampleComponentElement extends Components.SampleComponent, HTMLStencilElement {
30
+ }
31
+ var HTMLSampleComponentElement: {
32
+ prototype: HTMLSampleComponentElement;
33
+ new (): HTMLSampleComponentElement;
34
+ };
35
+ interface HTMLElementTagNameMap {
36
+ "faq-popup-component": HTMLFaqPopupComponentElement;
37
+ "results-manager": HTMLResultsManagerElement;
38
+ "sample-component": HTMLSampleComponentElement;
39
+ }
40
+ }
41
+ declare namespace LocalJSX {
42
+ interface FaqPopupComponent {
43
+ }
44
+ interface ResultsManager {
45
+ }
46
+ interface SampleComponent {
47
+ }
48
+ interface IntrinsicElements {
49
+ "faq-popup-component": FaqPopupComponent;
50
+ "results-manager": ResultsManager;
51
+ "sample-component": SampleComponent;
52
+ }
53
+ }
54
+ export { LocalJSX as JSX };
55
+ declare module "@stencil/core" {
56
+ export namespace JSX {
57
+ interface IntrinsicElements {
58
+ "faq-popup-component": LocalJSX.FaqPopupComponent & JSXBase.HTMLAttributes<HTMLFaqPopupComponentElement>;
59
+ "results-manager": LocalJSX.ResultsManager & JSXBase.HTMLAttributes<HTMLResultsManagerElement>;
60
+ "sample-component": LocalJSX.SampleComponent & JSXBase.HTMLAttributes<HTMLSampleComponentElement>;
61
+ }
62
+ }
63
+ }
package/src/html.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare module "*.html" {
2
+ const content: string;
3
+ export default content;
4
+ }
package/src/index.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { waitForAtomic } from "./utils/atomic";
2
+
3
+ async function main() {
4
+ await waitForAtomic();
5
+ const searchInterface: HTMLAtomicSearchInterfaceElement =
6
+ document.querySelector("atomic-search-interface")!;
7
+
8
+ const platformUrl = process.env.PLATFORM_URL!;
9
+ const organizationId = process.env.ORGANIZATION_ID!;
10
+ const accessToken = process.env.API_KEY!;
11
+ await searchInterface.initialize({
12
+ accessToken,
13
+ organizationId,
14
+ platformUrl,
15
+ });
16
+
17
+ searchInterface.executeFirstSearch();
18
+ }
19
+
20
+ main();
@@ -0,0 +1,137 @@
1
+ <html lang="en">
2
+
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <!--
8
+ Modifying any <head> attributes of the page locally (including the title attribute) will have no effect when the page is uploaded to the Coveo platform.
9
+ If you wish to modify the page title, you should modify the `name` property defined in the coveo.deploy.json configuration file.
10
+ -->
11
+ <title>Abi</title>
12
+ <link href="/atomic/themes/coveo.css" rel="stylesheet" />
13
+ <link href="/build/abi.css" rel="stylesheet" />
14
+ <!--
15
+ When using the Coveo CDN - Make sure you're using the same minor version as the packaged Atomic.
16
+ E.g., if you have "@coveo/atomic@2.0.0" installed, use the "/atomic/v2.0.0/" path.
17
+ When deploying with the Coveo CLI, the Atomic CDN defined in the coveo.deploy.json configuration file will be used.
18
+
19
+ <script type="module" src="https://static.cloud.coveo.com/atomic/vMAJOR.MINOR/atomic.esm.js"></script>
20
+ -->
21
+ <script type="module" src="/atomic/atomic.esm.js"></script>
22
+ <!-- Custom Elements Lazy Loading -->
23
+ <script type="module" src="/build/abi.esm.js"></script>
24
+ <!-- Global initialization script -->
25
+ <script type="module" src="/build/index.esm.js"></script>
26
+ </head>
27
+
28
+ <body>
29
+ <!--
30
+ This is a non-functional element.
31
+ Contents of this element will be parsed and injected in the bundle's HTML when deploying.
32
+ -->
33
+ <style>
34
+ atomic-search-box::part(wrapper) {
35
+ border-radius: 30px;
36
+ border: thin solid #7e8c9a;
37
+ }
38
+
39
+ atomic-search-box::part(submit-button) {
40
+ background-color: white;
41
+ border: thin solid #7e8c9a;
42
+ border-radius: 0px 30px 30px 0px;
43
+ }
44
+
45
+ atomic-search-box::part(submit-icon) {
46
+ color: black;
47
+ }
48
+
49
+ atomic-pager::part(active-page-button) {
50
+ background-color: #1d4f76;
51
+ color: #cddee9;
52
+
53
+ }
54
+
55
+ atomic-pager::part(page-button) {
56
+ color: #cddee9;
57
+ }
58
+
59
+ atomic-pager::part(page-button) {
60
+ border: thin solid #7e8c9a;
61
+ border-radius: 0px;
62
+ }
63
+ atomic-modal#faq-modal::part(header-wrapper) {
64
+ display: grid;
65
+ width: 100%;
66
+ padding-right: 0px !important;
67
+ }
68
+ atomic-modal#faq-modal::part(container) {
69
+ width: 155%;
70
+ }
71
+ </style>
72
+ <atomic-hosted-page>
73
+ <atomic-search-interface fields-to-include='[
74
+ "sfcaseid", "sfppcustomlinkcpplinkurlc", "sfcaseppstatus", "sfcaseppstatusc", "sfcasestatus",
75
+ "sfppcustomlinkcppiconc", "sfcasenumber", "sfcaseppprocessc", "sfppleaveabsencecppactiontypec",
76
+ "sfppleaveabsencecppactionreasonc", "sfppleaveabsencecppenddatecfq", "sfppleaveabsencecppenddatecfy",
77
+ "sfppleaveabsencecppstartdatecfq", "sfppleaveabsencecppstartdatecfy", "sfppleaveabsencecppstartdatec",
78
+ "sfppleaveabsencecppenddatec", "sfrecordtypename", "sfcasepprequesterc", "sfcaseemployeec",
79
+ "sfppourcompanylinkdetailcppcontentc", "sfppourcompanylinkdetailcid", "sfppcustomlinkname", "sfppcustomlinkid",
80
+ "sfppmyteamcppemployeenumberc", "sfppmyteamcpppositionc", "sfppmyteamcppemailc", "sfppmyteamcppphonenumberc",
81
+ "sfppmyteamcppmanagersemployeenumberc", "sfppmyteamcppmanagersnamec", "function", "owner", "businessunit",
82
+ "datesubmitted", "bestpracticezone", "connectortype", "clickUri", "zone", "roadmap", "strategy", "sfkeywordc",
83
+ "spitemtype", "splistbasetype", "splisttype", "title", "searchablemeta", "totalNumberOfChildResults",
84
+ "moreinformation", "picture", "targettab", "targettemplate", "metatype", "resultimage", "sfppzonec",
85
+ "sfppemployeeworklocationc", "sfppbusinessfunctionc", "sfpersonemail", "sfpppositontitlec", "istailoredmappingtype",
86
+ "resultpicture", "abicontenttype", "containsattachment", "spsitename", "spsiteuri", "attachmentfilename", "parents",
87
+ "sysparents", "description", "answer","newmoreinfo", "filetype","sfppcustomlinkcppdescriptionc","trainingsource","function","category","sfpersonemail","sfppbusinessfunctionc","sfppemployeeworklocationc","duration"
88
+ ]'><atomic-modal id="faq-modal" is-open="false">
89
+ <div slot="header" style="display: grid;grid-template-columns: 5fr 01fr; width:100%;">
90
+ <div class="header-title" style="padding-top:4%;">This is a title</div>
91
+ <div id="faq-modal-close" style="text-align: end;">
92
+ <svg width="48" height="49" viewBox="0 0 48 49" fill="black" xmlns="http://www.w3.org/2000/svg">
93
+ <rect y="0.5" width="48" height="48" rx="24" fill="white"/>
94
+ <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"/>
95
+ </svg>
96
+ </div>
97
+
98
+ </div>
99
+ <div slot="body">This is the body</div>
100
+ <div slot="footer"><button id="btn-done">Done</button></div>
101
+ </atomic-modal>
102
+ <atomic-search-layout>
103
+ <atomic-layout-section style="justify-self:center" section="search">
104
+ <atomic-search-box></atomic-search-box>
105
+ </atomic-layout-section>
106
+ <!-- <atomic-layout-section section="facets">
107
+ <atomic-facet-manager>
108
+ <atomic-facet field="filetype" label="Filetype"></atomic-facet>
109
+ <atomic-facet field="source" label="Source"></atomic-facet>
110
+ </atomic-facet-manager>
111
+ </atomic-layout-section> -->
112
+ <atomic-layout-section section="main">
113
+ <atomic-layout-section section="status">
114
+ <atomic-breadbox></atomic-breadbox>
115
+ <atomic-query-summary enable-duration="true"></atomic-query-summary>
116
+ <atomic-refine-toggle></atomic-refine-toggle>
117
+ <atomic-sort-dropdown>
118
+ <atomic-sort-expression label="relevance" expression="relevancy"></atomic-sort-expression>
119
+ <atomic-sort-expression label="most-recent" expression="date descending"></atomic-sort-expression>
120
+ </atomic-sort-dropdown>
121
+ <atomic-did-you-mean></atomic-did-you-mean>
122
+ </atomic-layout-section>
123
+ <atomic-layout-section section="results">
124
+ <results-manager></results-manager>
125
+ <atomic-query-error></atomic-query-error>
126
+ <atomic-no-results></atomic-no-results>
127
+ </atomic-layout-section>
128
+ <atomic-layout-section section="pagination">
129
+ <atomic-pager></atomic-pager>
130
+ </atomic-layout-section>
131
+ </atomic-layout-section>
132
+ </atomic-search-layout>
133
+ </atomic-search-interface>
134
+ </atomic-hosted-page>
135
+ </body>
136
+
137
+ </html>
@@ -0,0 +1,12 @@
1
+
2
+ body {
3
+ margin: 0;
4
+
5
+ }
6
+
7
+ atomic-modal#faq-modal::part(header-wrapper) {
8
+ display: grid;
9
+ width: 100%;
10
+ padding-right: 0px !important;
11
+ }
12
+
@@ -0,0 +1,3 @@
1
+ export function waitForAtomic() {
2
+ return customElements.whenDefined("atomic-search-interface");
3
+ }
@@ -0,0 +1,63 @@
1
+ import { Config } from "@stencil/core";
2
+ import dotenvPlugin from "rollup-plugin-dotenv";
3
+ import html from "rollup-plugin-html";
4
+ import replace from "@rollup/plugin-replace";
5
+
6
+ // https://stenciljs.com/docs/config
7
+
8
+ export const config: Config = {
9
+ namespace: "abi",
10
+ globalStyle: "src/style/index.css",
11
+ taskQueue: "async",
12
+ outputTargets: [
13
+ {
14
+ type: "www",
15
+ serviceWorker: null, // disable service workers
16
+ copy: [
17
+ { src: "pages", keepDirStructure: false },
18
+ {
19
+ src: "../node_modules/@coveo/atomic/dist/atomic",
20
+ dest: "atomic",
21
+ keepDirStructure: false,
22
+ },
23
+ ],
24
+ },
25
+ {
26
+ type: "dist",
27
+ },
28
+ {
29
+ type: "dist-custom-elements-bundle",
30
+ minify: false,
31
+ includeGlobalScripts: true,
32
+ externalRuntime: false,
33
+ inlineDynamicImports: false,
34
+ dir: "dist/components",
35
+ },
36
+ /*
37
+ If migrating to Stencil v3, the "dist-custom-elements-bundle" output target should be replaced by the following:
38
+ {
39
+ type: "dist-custom-elements",
40
+ customElementsExportBehavior: "bundle",
41
+ minify: false,
42
+ includeGlobalScripts: true,
43
+ generateTypeDeclarations: false,
44
+ externalRuntime: false,
45
+ },
46
+ */
47
+ ],
48
+ plugins: [
49
+ dotenvPlugin(),
50
+ replace({
51
+ "process.env.PLATFORM_URL": `'${process.env.PLATFORM_URL}'`,
52
+ "process.env.ORGANIZATION_ID": `'${process.env.ORGANIZATION_ID}'`,
53
+ "process.env.API_KEY": `'${process.env.API_KEY}'`,
54
+ }),
55
+ ],
56
+ rollupPlugins: {
57
+ before: [
58
+ html({
59
+ include: "src/components/**/*.html",
60
+ }),
61
+ ],
62
+ },
63
+ };