@coveops/abi 1.0.5 → 1.0.6

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.
@@ -70,7 +70,7 @@ async function main() {
70
70
  searchBox && initStandaloneSearchBox(searchBox);
71
71
  // const platformUrl = "https://platform.cloud.coveo.com"!;
72
72
  // const organizationId = "anheuserbuschinbevprod"!;
73
- // const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242"!;
73
+ // const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792"!;
74
74
  // await searchInterface.initialize({
75
75
  // accessToken,
76
76
  // organizationId,
@@ -122,7 +122,7 @@ async function main() {
122
122
  async function initStandaloneSearchBox(searchBox) {
123
123
  const platformUrl = "https://platform.cloud.coveo.com";
124
124
  const organizationId = "anheuserbuschinbevprod";
125
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
125
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
126
126
  await searchBox.initialize({
127
127
  accessToken,
128
128
  organizationId,
@@ -151,7 +151,7 @@ async function initStandaloneSearchBox(searchBox) {
151
151
  async function initSearch(searchInterface) {
152
152
  const platformUrl = "https://platform.cloud.coveo.com";
153
153
  const organizationId = "anheuserbuschinbevprod";
154
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
154
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
155
155
  await searchInterface.initialize({
156
156
  accessToken,
157
157
  organizationId,
@@ -172,7 +172,7 @@ async function initSearch(searchInterface) {
172
172
  }
173
173
  async function initRecs(recsInterfaces) {
174
174
  const organizationId = "anheuserbuschinbevprod";
175
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
175
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
176
176
  await Promise.all(recsInterfaces.map(async (recommendationInterface) => recommendationInterface.initialize({
177
177
  accessToken: accessToken,
178
178
  organizationId: organizationId
@@ -14,9 +14,13 @@ const StandaloneSearchboxListener = class {
14
14
  index.registerInstance(this, hostRef);
15
15
  }
16
16
  async connectedCallback() {
17
+ var _a;
17
18
  try {
18
19
  await atomic.waitForAtomic();
19
20
  this.bindings = await index$1.initializeBindings(this.host);
21
+ (_a = this.bindings) === null || _a === void 0 ? void 0 : _a.i18n.addResourceBundle('en', 'translation', {
22
+ "search-tips": "You may want to try using different keywords or checking for spelling mistakes."
23
+ });
20
24
  }
21
25
  catch (error) {
22
26
  console.error(error);
@@ -4,9 +4,13 @@ import { waitForAtomic } from "../../utils/atomic";
4
4
  import { loadPaginationActions, loadQueryActions, loadSearchActions, loadSearchAnalyticsActions } from "@coveo/headless";
5
5
  export class StandaloneSearchboxListener {
6
6
  async connectedCallback() {
7
+ var _a;
7
8
  try {
8
9
  await waitForAtomic();
9
10
  this.bindings = await initializeBindings(this.host);
11
+ (_a = this.bindings) === null || _a === void 0 ? void 0 : _a.i18n.addResourceBundle('en', 'translation', {
12
+ "search-tips": "You may want to try using different keywords or checking for spelling mistakes."
13
+ });
10
14
  }
11
15
  catch (error) {
12
16
  console.error(error);
@@ -1113,7 +1113,7 @@ async function main() {
1113
1113
  searchBox && initStandaloneSearchBox(searchBox);
1114
1114
  // const platformUrl = "https://platform.cloud.coveo.com"!;
1115
1115
  // const organizationId = "anheuserbuschinbevprod"!;
1116
- // const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242"!;
1116
+ // const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792"!;
1117
1117
  // await searchInterface.initialize({
1118
1118
  // accessToken,
1119
1119
  // organizationId,
@@ -1165,7 +1165,7 @@ async function main() {
1165
1165
  async function initStandaloneSearchBox(searchBox) {
1166
1166
  const platformUrl = "https://platform.cloud.coveo.com";
1167
1167
  const organizationId = "anheuserbuschinbevprod";
1168
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
1168
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
1169
1169
  await searchBox.initialize({
1170
1170
  accessToken,
1171
1171
  organizationId,
@@ -1194,7 +1194,7 @@ async function initStandaloneSearchBox(searchBox) {
1194
1194
  async function initSearch(searchInterface) {
1195
1195
  const platformUrl = "https://platform.cloud.coveo.com";
1196
1196
  const organizationId = "anheuserbuschinbevprod";
1197
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
1197
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
1198
1198
  await searchInterface.initialize({
1199
1199
  accessToken,
1200
1200
  organizationId,
@@ -1215,7 +1215,7 @@ async function initSearch(searchInterface) {
1215
1215
  }
1216
1216
  async function initRecs(recsInterfaces) {
1217
1217
  const organizationId = "anheuserbuschinbevprod";
1218
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
1218
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
1219
1219
  await Promise.all(recsInterfaces.map(async (recommendationInterface) => recommendationInterface.initialize({
1220
1220
  accessToken: accessToken,
1221
1221
  organizationId: organizationId
@@ -3324,9 +3324,13 @@ const StandaloneSearchboxListener$1 = class extends H$1 {
3324
3324
  this.__attachShadow();
3325
3325
  }
3326
3326
  async connectedCallback() {
3327
+ var _a;
3327
3328
  try {
3328
3329
  await waitForAtomic();
3329
3330
  this.bindings = await initializeBindings(this.host);
3331
+ (_a = this.bindings) === null || _a === void 0 ? void 0 : _a.i18n.addResourceBundle('en', 'translation', {
3332
+ "search-tips": "You may want to try using different keywords or checking for spelling mistakes."
3333
+ });
3330
3334
  }
3331
3335
  catch (error) {
3332
3336
  console.error(error);
package/dist/esm/index.js CHANGED
@@ -68,7 +68,7 @@ async function main() {
68
68
  searchBox && initStandaloneSearchBox(searchBox);
69
69
  // const platformUrl = "https://platform.cloud.coveo.com"!;
70
70
  // const organizationId = "anheuserbuschinbevprod"!;
71
- // const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242"!;
71
+ // const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792"!;
72
72
  // await searchInterface.initialize({
73
73
  // accessToken,
74
74
  // organizationId,
@@ -120,7 +120,7 @@ async function main() {
120
120
  async function initStandaloneSearchBox(searchBox) {
121
121
  const platformUrl = "https://platform.cloud.coveo.com";
122
122
  const organizationId = "anheuserbuschinbevprod";
123
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
123
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
124
124
  await searchBox.initialize({
125
125
  accessToken,
126
126
  organizationId,
@@ -149,7 +149,7 @@ async function initStandaloneSearchBox(searchBox) {
149
149
  async function initSearch(searchInterface) {
150
150
  const platformUrl = "https://platform.cloud.coveo.com";
151
151
  const organizationId = "anheuserbuschinbevprod";
152
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
152
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
153
153
  await searchInterface.initialize({
154
154
  accessToken,
155
155
  organizationId,
@@ -170,7 +170,7 @@ async function initSearch(searchInterface) {
170
170
  }
171
171
  async function initRecs(recsInterfaces) {
172
172
  const organizationId = "anheuserbuschinbevprod";
173
- const accessToken = "x7e95c452-b717-4459-a9a1-a808b74c2242";
173
+ const accessToken = "x45e93227-0ffd-4591-b3c6-f40fa75c5792";
174
174
  await Promise.all(recsInterfaces.map(async (recommendationInterface) => recommendationInterface.initialize({
175
175
  accessToken: accessToken,
176
176
  organizationId: organizationId
@@ -10,9 +10,13 @@ const StandaloneSearchboxListener = class {
10
10
  registerInstance(this, hostRef);
11
11
  }
12
12
  async connectedCallback() {
13
+ var _a;
13
14
  try {
14
15
  await waitForAtomic();
15
16
  this.bindings = await initializeBindings(this.host);
17
+ (_a = this.bindings) === null || _a === void 0 ? void 0 : _a.i18n.addResourceBundle('en', 'translation', {
18
+ "search-tips": "You may want to try using different keywords or checking for spelling mistakes."
19
+ });
16
20
  }
17
21
  catch (error) {
18
22
  console.error(error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveops/abi",
3
3
  "description": "Abi project",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "private": false,
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",
@@ -19,6 +19,11 @@ export class StandaloneSearchboxListener {
19
19
  await waitForAtomic();
20
20
  this.bindings = await initializeBindings(this.host);
21
21
 
22
+ this.bindings?.i18n.addResourceBundle('en', 'translation', {
23
+ "search-tips": "You may want to try using different keywords or checking for spelling mistakes."
24
+ });
25
+
26
+
22
27
 
23
28
  } catch (error) {
24
29
  console.error(error);
@@ -23,38 +23,6 @@
23
23
  <script type="module" src="/build/abi.esm.js"></script>
24
24
  <!-- Global initialization script -->
25
25
  <script type="module" src="/build/index.esm.js"></script>
26
- <style>
27
- .atomic-recs-layout {
28
- display: flex;
29
- justify-content: center;
30
- padding: 20px;
31
- }
32
- atomic-recs-interface {
33
- border: 1px solid #ffffe0; ; /* Add a border */
34
- border-radius: 5px; /* Add border radius */
35
- padding: 15px;
36
- position: relative;
37
- width: 300px; /* Adjust as needed */
38
- background-color: #fff; /* Background color */
39
- }
40
- atomic-recs-list {
41
- margin-top: 40px; /* Space for the title */
42
- }
43
- .recommendation-title {
44
- width: 100%; /* Make the header span the full width of the parent */
45
- background-color: #ffffe0; /* Light yellow background */
46
- padding: 10px 0; /* Add padding for spacing */
47
- text-align: center; /* Center the text horizontally */
48
- position: absolute;
49
- top: 0;
50
- left: 0;
51
- border-radius: 5px 5px 0 0; /* Optional: rounded top corners */
52
- box-sizing: border-box; /* Ensure padding is included in the element's total width */
53
- font-size: 16px;
54
- color: red; /* Set text color to red */
55
-
56
- }
57
- </style>
58
26
  </head>
59
27
 
60
28
 
@@ -118,9 +118,7 @@ atomic-search-box::part(query-suggestion-text) {
118
118
  atomic-no-results::part(icon){
119
119
  display: none;
120
120
  }
121
- atomic-no-results::part(search-tips){
122
- display: none;
123
- }
121
+
124
122
  atomic-no-results::part(no-results){
125
123
  font-size: 1.3rem !important;
126
124
  padding-bottom: -5px !important;;
@@ -133,6 +131,7 @@ atomic-no-results::part(cancel-button){
133
131
  padding-left: 0px !important;
134
132
  font-size: 1rem !important;
135
133
  margin-top:0px !important;
134
+ display: none;
136
135
  }
137
136
  .align{
138
137
  display: flex !important;
@@ -156,5 +155,36 @@ atomic-recs-list::part(result-list-grid-clickable-container):hover {
156
155
  }
157
156
  atomic-recs-list::part(result-list-grid-clickable-container) {
158
157
  padding: 0px;
158
+ }
159
+
160
+ .atomic-recs-layout {
161
+ display: flex;
162
+ justify-content: center;
163
+ padding: 20px;
164
+ }
165
+ atomic-recs-interface {
166
+ border: 1px solid #ffffe0; ; /* Add a border */
167
+ border-radius: 5px; /* Add border radius */
168
+ padding: 15px;
169
+ position: relative;
170
+ width: 300px; /* Adjust as needed */
171
+ background-color: #fff; /* Background color */
172
+ }
173
+ atomic-recs-list {
174
+ margin-top: 40px; /* Space for the title */
175
+ }
176
+ .recommendation-title {
177
+ width: 100%; /* Make the header span the full width of the parent */
178
+ background-color: #ffffe0; /* Light yellow background */
179
+ padding: 10px 0; /* Add padding for spacing */
180
+ text-align: center; /* Center the text horizontally */
181
+ position: absolute;
182
+ top: 0;
183
+ left: 0;
184
+ border-radius: 5px 5px 0 0; /* Optional: rounded top corners */
185
+ box-sizing: border-box; /* Ensure padding is included in the element's total width */
186
+ font-size: 16px;
187
+ color: red; /* Set text color to red */
188
+
159
189
  }
160
190
  /* [part~='outline'][part~='result-list-grid-clickable-container']:hover */
@@ -1 +0,0 @@
1
- import{r as i,h as o,g as s,H as t}from"./p-d6d34d34.js";import{i as l,f as a,a as n,m as d,$ as r}from"./p-b984457f.js";import{w as e}from"./p-c82303fb.js";import"./p-d20ee37c.js";const v=class{constructor(o){i(this,o)}async connectedCallback(){try{await e(),this.bindings=await l(this.host)}catch(i){console.error(i)}}async handleStandaloneSearchbox(i){var o,s,t,l,e,v,c,h,u,p;let m=a(null===(o=this.bindings)||void 0===o?void 0:o.engine);null===(t=null===(s=this.bindings)||void 0===s?void 0:s.engine)||void 0===t||t.dispatch(m.updateQuery({q:i.detail}));let f=n(null===(l=this.bindings)||void 0===l?void 0:l.engine);null===(v=null===(e=this.bindings)||void 0===e?void 0:e.engine)||void 0===v||v.dispatch(f.updatePage(1));let b=d(null===(c=this.bindings)||void 0===c?void 0:c.engine),j=r(null===(h=this.bindings)||void 0===h?void 0:h.engine);null===(p=null===(u=this.bindings)||void 0===u?void 0:u.engine)||void 0===p||p.dispatch(j.executeSearch(b.logSearchboxSubmit()))}render(){return o(t,null)}get host(){return s(this)}};v.style="";export{v as standalone_searchbox_listener}