@seekora-ai/ui-sdk-vanilla 0.2.14 → 0.2.16
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.
- package/dist/components/infinite-hits.d.ts +0 -5
- package/dist/components/infinite-hits.d.ts.map +1 -1
- package/dist/components/infinite-hits.js +1 -24
- package/dist/components/query-suggestions.d.ts +0 -1
- package/dist/components/query-suggestions.d.ts.map +1 -1
- package/dist/components/query-suggestions.js +0 -15
- package/dist/components/search-bar.d.ts +0 -4
- package/dist/components/search-bar.d.ts.map +1 -1
- package/dist/components/search-bar.js +34 -130
- package/dist/components/search-results.d.ts +0 -3
- package/dist/components/search-results.d.ts.map +1 -1
- package/dist/components/search-results.js +0 -21
- package/dist/components/stats.d.ts.map +1 -1
- package/dist/components/stats.js +0 -3
- package/dist/index.d.ts +0 -13
- package/dist/index.esm.js +35 -193
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +35 -193
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +5 -5
|
@@ -12,8 +12,6 @@ export interface InfiniteHitsOptions {
|
|
|
12
12
|
renderHit?: (hit: ResultItem, index: number) => HTMLElement;
|
|
13
13
|
/** Custom render for empty state */
|
|
14
14
|
renderEmpty?: () => HTMLElement;
|
|
15
|
-
/** Custom render for loading state */
|
|
16
|
-
renderLoading?: () => HTMLElement;
|
|
17
15
|
/** Whether to show the "Show More" button (default: true) */
|
|
18
16
|
showMoreButton?: boolean;
|
|
19
17
|
/** Whether to use infinite scroll with IntersectionObserver (default: false) */
|
|
@@ -24,8 +22,6 @@ export interface InfiniteHitsOptions {
|
|
|
24
22
|
fieldMapping?: FieldMapping;
|
|
25
23
|
/** Text for "Show More" button */
|
|
26
24
|
showMoreLabel?: string;
|
|
27
|
-
/** Text for loading state */
|
|
28
|
-
loadingLabel?: string;
|
|
29
25
|
/** Callback when a hit is clicked */
|
|
30
26
|
onHitClick?: (hit: ResultItem, index: number) => void;
|
|
31
27
|
}
|
|
@@ -47,7 +43,6 @@ export declare class InfiniteHits {
|
|
|
47
43
|
private setupIntersectionObserver;
|
|
48
44
|
private createDefaultHit;
|
|
49
45
|
private createDefaultEmpty;
|
|
50
|
-
private createDefaultLoading;
|
|
51
46
|
private createShowMoreButton;
|
|
52
47
|
/** Extract string value using fieldMapping (no hardcoded field names) */
|
|
53
48
|
private extractField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infinite-hits.d.ts","sourceRoot":"","sources":["../../src/components/infinite-hits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC;IAC5D,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,WAAW,CAAC;IAChC,
|
|
1
|
+
{"version":3,"file":"infinite-hits.d.ts","sourceRoot":"","sources":["../../src/components/infinite-hits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC;IAC5D,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,WAAW,CAAC;IAChC,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,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26
26
|
renderHit: options.renderHit,
|
|
27
27
|
renderEmpty: options.renderEmpty,
|
|
28
|
-
renderLoading: options.renderLoading,
|
|
29
28
|
showMoreButton: options.showMoreButton !== false,
|
|
30
29
|
useInfiniteScroll: options.useInfiniteScroll ?? false,
|
|
31
30
|
scrollThreshold: options.scrollThreshold ?? 0.1,
|
|
32
31
|
fieldMapping: options.fieldMapping,
|
|
33
32
|
showMoreLabel: options.showMoreLabel ?? 'Show more',
|
|
34
|
-
loadingLabel: options.loadingLabel ?? 'Loading...',
|
|
35
33
|
onHitClick: options.onHitClick,
|
|
36
34
|
};
|
|
37
35
|
// Subscribe to state manager
|
|
@@ -96,10 +94,6 @@ export class InfiniteHits {
|
|
|
96
94
|
const state = this.provider.stateManager.getState();
|
|
97
95
|
// Initial loading state
|
|
98
96
|
if (state.loading && this.accumulatedHits.length === 0) {
|
|
99
|
-
const loadingEl = this.options.renderLoading
|
|
100
|
-
? this.options.renderLoading()
|
|
101
|
-
: this.createDefaultLoading();
|
|
102
|
-
this.container.appendChild(loadingEl);
|
|
103
97
|
return;
|
|
104
98
|
}
|
|
105
99
|
// Empty state
|
|
@@ -124,13 +118,6 @@ export class InfiniteHits {
|
|
|
124
118
|
const button = this.createShowMoreButton();
|
|
125
119
|
this.container.appendChild(button);
|
|
126
120
|
}
|
|
127
|
-
// Loading more indicator
|
|
128
|
-
if (this.isLoadingMore) {
|
|
129
|
-
const loadingEl = this.options.renderLoading
|
|
130
|
-
? this.options.renderLoading()
|
|
131
|
-
: this.createDefaultLoading();
|
|
132
|
-
this.container.appendChild(loadingEl);
|
|
133
|
-
}
|
|
134
121
|
// Infinite scroll sentinel
|
|
135
122
|
if (this.options.useInfiniteScroll && !this.isLastPage) {
|
|
136
123
|
const sentinel = document.createElement('div');
|
|
@@ -223,20 +210,10 @@ export class InfiniteHits {
|
|
|
223
210
|
`;
|
|
224
211
|
return empty;
|
|
225
212
|
}
|
|
226
|
-
createDefaultLoading() {
|
|
227
|
-
const loading = document.createElement('div');
|
|
228
|
-
loading.textContent = this.options.loadingLabel;
|
|
229
|
-
loading.style.cssText = `
|
|
230
|
-
padding: ${this.theme.spacing.medium};
|
|
231
|
-
text-align: center;
|
|
232
|
-
color: ${this.theme.colors.textSecondary};
|
|
233
|
-
`;
|
|
234
|
-
return loading;
|
|
235
|
-
}
|
|
236
213
|
createShowMoreButton() {
|
|
237
214
|
const button = document.createElement('button');
|
|
238
215
|
button.type = 'button';
|
|
239
|
-
button.textContent = this.
|
|
216
|
+
button.textContent = this.options.showMoreLabel;
|
|
240
217
|
button.disabled = this.isLoadingMore;
|
|
241
218
|
button.style.cssText = this.getShowMoreButtonStyle();
|
|
242
219
|
button.addEventListener('click', () => this.handleShowMore());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-suggestions.d.ts","sourceRoot":"","sources":["../../src/components/query-suggestions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,OAAO,CAAsJ;IACrK,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,aAAa,CAAc;IACnC,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Aa;IASrB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,aAAa;IAOrB,OAAO,IAAI,IAAI;CAMhB"}
|
|
@@ -53,7 +53,6 @@ export class QuerySuggestions {
|
|
|
53
53
|
async loadSuggestions(query) {
|
|
54
54
|
this.loading = true;
|
|
55
55
|
this.error = null;
|
|
56
|
-
this.render();
|
|
57
56
|
try {
|
|
58
57
|
const response = await this.provider.client.getSuggestions(query, this.options.maxSuggestions);
|
|
59
58
|
const rawSuggestions = Array.isArray(response) ? response : [];
|
|
@@ -92,13 +91,6 @@ export class QuerySuggestions {
|
|
|
92
91
|
if (!this.options.query || this.options.query.length < this.options.minQueryLength) {
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
|
-
if (this.loading) {
|
|
96
|
-
const loadingDiv = document.createElement('div');
|
|
97
|
-
loadingDiv.style.cssText = this.getLoadingStyle();
|
|
98
|
-
loadingDiv.textContent = 'Loading suggestions...';
|
|
99
|
-
this.container.appendChild(loadingDiv);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
94
|
if (this.error || this.suggestions.length === 0) {
|
|
103
95
|
const emptyDiv = document.createElement('div');
|
|
104
96
|
emptyDiv.style.cssText = this.getEmptyStyle();
|
|
@@ -168,13 +160,6 @@ export class QuerySuggestions {
|
|
|
168
160
|
color: ${this.theme.colors.text};
|
|
169
161
|
`;
|
|
170
162
|
}
|
|
171
|
-
getLoadingStyle() {
|
|
172
|
-
return `
|
|
173
|
-
padding: ${this.theme.spacing.medium};
|
|
174
|
-
text-align: center;
|
|
175
|
-
color: ${this.theme.colors.text};
|
|
176
|
-
`;
|
|
177
|
-
}
|
|
178
163
|
getEmptyStyle() {
|
|
179
164
|
return `
|
|
180
165
|
padding: ${this.theme.spacing.medium};
|
|
@@ -96,9 +96,6 @@ export declare class SearchBar {
|
|
|
96
96
|
private debounceTimer;
|
|
97
97
|
private isFocused;
|
|
98
98
|
private unsubscribeStateManager;
|
|
99
|
-
private cachedStoreId;
|
|
100
|
-
private cachedReadSecret;
|
|
101
|
-
private cachedEnvironment;
|
|
102
99
|
constructor(providerOrClient: SearchProvider | SeekoraClient, options: SearchBarOptions);
|
|
103
100
|
private render;
|
|
104
101
|
private injectPlaceholderStyles;
|
|
@@ -108,7 +105,6 @@ export declare class SearchBar {
|
|
|
108
105
|
private selectSuggestion;
|
|
109
106
|
private fetchRichSuggestions;
|
|
110
107
|
private fallbackToBasicSuggestions;
|
|
111
|
-
private cacheClientCredentials;
|
|
112
108
|
private performSearch;
|
|
113
109
|
private renderSuggestions;
|
|
114
110
|
private updateSuggestionsVisibility;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.d.ts","sourceRoot":"","sources":["../../src/components/search-bar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"search-bar.d.ts","sourceRoot":"","sources":["../../src/components/search-bar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAC;AAGzG,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,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AI;CAUhB"}
|
|
@@ -31,7 +31,7 @@ export class SearchBar {
|
|
|
31
31
|
}
|
|
32
32
|
this.container = container;
|
|
33
33
|
this.options = {
|
|
34
|
-
placeholder: options.placeholder || '
|
|
34
|
+
placeholder: options.placeholder || 'Powered by Seekora',
|
|
35
35
|
showSuggestions: options.showSuggestions !== false,
|
|
36
36
|
minQueryLength: options.minQueryLength || 1,
|
|
37
37
|
maxSuggestions: options.maxSuggestions || 10,
|
|
@@ -43,8 +43,6 @@ export class SearchBar {
|
|
|
43
43
|
onBrandClick: options.onBrandClick,
|
|
44
44
|
searchOptions: options.searchOptions,
|
|
45
45
|
};
|
|
46
|
-
// Cache credentials and environment from client for rich suggestions
|
|
47
|
-
this.cacheClientCredentials();
|
|
48
46
|
this.render();
|
|
49
47
|
this.attachEventListeners();
|
|
50
48
|
// Subscribe to state manager to sync input with query state
|
|
@@ -266,108 +264,58 @@ export class SearchBar {
|
|
|
266
264
|
}
|
|
267
265
|
async fetchRichSuggestions(query) {
|
|
268
266
|
try {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
// If not cached, try to get from client
|
|
275
|
-
const clientAny = this.client;
|
|
276
|
-
if (!storeId || !readSecret) {
|
|
277
|
-
if (clientAny.config) {
|
|
278
|
-
storeId = storeId || clientAny.config.storeId;
|
|
279
|
-
readSecret = readSecret || clientAny.config.readSecret;
|
|
280
|
-
}
|
|
281
|
-
else if (clientAny.storeId && clientAny.readSecret) {
|
|
282
|
-
storeId = storeId || clientAny.storeId;
|
|
283
|
-
readSecret = readSecret || clientAny.readSecret;
|
|
284
|
-
}
|
|
285
|
-
else if (clientAny._config) {
|
|
286
|
-
storeId = storeId || clientAny._config.storeId;
|
|
287
|
-
readSecret = readSecret || clientAny._config.readSecret;
|
|
288
|
-
}
|
|
289
|
-
else if (clientAny._storeId && clientAny._readSecret) {
|
|
290
|
-
storeId = storeId || clientAny._storeId;
|
|
291
|
-
readSecret = readSecret || clientAny._readSecret;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
// Determine environment and set baseUrl
|
|
295
|
-
const environment = env || clientAny.environment || clientAny.config?.environment || clientAny._config?.environment;
|
|
296
|
-
const isDevelopment = environment === 'development';
|
|
297
|
-
// ALWAYS use localhost:3000 for development - FORCE IT
|
|
298
|
-
baseUrl = 'http://localhost:3000'; // Force localhost for all requests in dev
|
|
299
|
-
console.log('🌐 SearchBar: Setting baseUrl', {
|
|
300
|
-
environment,
|
|
301
|
-
isDevelopment,
|
|
302
|
-
forcedBaseUrl: baseUrl,
|
|
267
|
+
log.verbose('SearchBar: Fetching rich suggestions via client.getSuggestions', { query });
|
|
268
|
+
const response = await this.client.getSuggestions(query, {
|
|
269
|
+
include_dropdown_recommendations: true,
|
|
270
|
+
hitsPerPage: this.options.maxSuggestions,
|
|
271
|
+
returnFullResponse: true,
|
|
303
272
|
});
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
hitsPerPage: String(this.options.maxSuggestions),
|
|
328
|
-
});
|
|
329
|
-
// Only add query parameter if it's not empty
|
|
330
|
-
if (query && query.trim().length > 0) {
|
|
331
|
-
params.append('query', query);
|
|
332
|
-
}
|
|
333
|
-
const url = `${baseUrl}/api/v1/suggestions/queries?${params.toString()}`;
|
|
334
|
-
log.verbose('SearchBar: Making rich suggestions request', { url: url.replace(/secret=[^&]+/, 'secret=***') });
|
|
335
|
-
const response = await fetch(url, {
|
|
336
|
-
method: 'GET',
|
|
337
|
-
headers: {
|
|
338
|
-
'x-storeid': storeId,
|
|
339
|
-
'x-storesecret': readSecret,
|
|
340
|
-
'Content-Type': 'application/json',
|
|
273
|
+
// response is QuerySuggestionsFullResponse when returnFullResponse is true
|
|
274
|
+
const suggestions = response.suggestions || [];
|
|
275
|
+
const extensions = response.extensions;
|
|
276
|
+
// Build RichQuerySuggestionsResponse from SDK response
|
|
277
|
+
const raw = response.raw || {};
|
|
278
|
+
const data = {
|
|
279
|
+
status: 'success',
|
|
280
|
+
data: {
|
|
281
|
+
hits: suggestions,
|
|
282
|
+
nbHits: suggestions.length,
|
|
283
|
+
page: raw.page || 0,
|
|
284
|
+
hitsPerPage: raw.hitsPerPage || this.options.maxSuggestions,
|
|
285
|
+
processingTimeMS: raw.processingTimeMS || 0,
|
|
286
|
+
query: query,
|
|
287
|
+
indexUsed: raw.indexUsed || '',
|
|
288
|
+
parsedQuery: raw.parsedQuery || query,
|
|
289
|
+
dropdown_recommendations: extensions ? {
|
|
290
|
+
trending_searches: extensions.trending_searches,
|
|
291
|
+
trending_products: extensions.trending_products,
|
|
292
|
+
popular_brands: extensions.popular_brands,
|
|
293
|
+
processing_time_ms: extensions.processing_time_ms || 0,
|
|
294
|
+
cached_at: extensions.cached_at,
|
|
295
|
+
} : undefined,
|
|
341
296
|
},
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
const data = await response.json();
|
|
347
|
-
if (data.status === 'error') {
|
|
348
|
-
throw new Error('API returned error status');
|
|
349
|
-
}
|
|
297
|
+
timestamp: raw.timestamp || new Date().toISOString(),
|
|
298
|
+
version: raw.version || '',
|
|
299
|
+
};
|
|
350
300
|
this.richSuggestionsData = data;
|
|
351
301
|
// Transform hits to SuggestionItem format
|
|
352
|
-
this.suggestions =
|
|
302
|
+
this.suggestions = suggestions.map((hit) => ({
|
|
353
303
|
query: hit.query,
|
|
354
304
|
count: hit.popularity,
|
|
355
305
|
metadata: hit,
|
|
356
306
|
}));
|
|
357
|
-
|
|
307
|
+
log.verbose('SearchBar: Rich suggestions loaded', {
|
|
358
308
|
query,
|
|
359
309
|
suggestionsCount: this.suggestions.length,
|
|
360
310
|
hasTrendingSearches: !!data.data.dropdown_recommendations?.trending_searches?.length,
|
|
361
311
|
hasTrendingProducts: !!data.data.dropdown_recommendations?.trending_products?.length,
|
|
362
312
|
hasPopularBrands: !!data.data.dropdown_recommendations?.popular_brands?.length,
|
|
363
|
-
rawData: data.data.dropdown_recommendations,
|
|
364
313
|
});
|
|
365
314
|
}
|
|
366
315
|
catch (err) {
|
|
367
316
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
368
317
|
log.error('SearchBar: Failed to fetch rich suggestions, falling back to basic', {
|
|
369
318
|
error: error.message,
|
|
370
|
-
stack: error.stack,
|
|
371
319
|
query,
|
|
372
320
|
});
|
|
373
321
|
await this.fallbackToBasicSuggestions(query);
|
|
@@ -396,50 +344,6 @@ export class SearchBar {
|
|
|
396
344
|
this.richSuggestionsData = null;
|
|
397
345
|
}
|
|
398
346
|
}
|
|
399
|
-
cacheClientCredentials() {
|
|
400
|
-
const clientAny = this.client;
|
|
401
|
-
console.log('🔍 SearchBar: Attempting to cache credentials', {
|
|
402
|
-
hasConfig: !!clientAny.config,
|
|
403
|
-
hasDirectProps: !!(clientAny.storeId && clientAny.readSecret),
|
|
404
|
-
hasPrivateConfig: !!clientAny._config,
|
|
405
|
-
hasPrivateProps: !!(clientAny._storeId && clientAny._readSecret),
|
|
406
|
-
clientKeys: Object.keys(clientAny).slice(0, 10),
|
|
407
|
-
// Try to see actual values
|
|
408
|
-
configStoreId: clientAny.config?.storeId,
|
|
409
|
-
directStoreId: clientAny.storeId,
|
|
410
|
-
});
|
|
411
|
-
// Try multiple ways to extract credentials - check ALL properties
|
|
412
|
-
if (clientAny.config && clientAny.config.storeId) {
|
|
413
|
-
this.cachedStoreId = clientAny.config.storeId;
|
|
414
|
-
this.cachedReadSecret = clientAny.config.readSecret;
|
|
415
|
-
this.cachedEnvironment = clientAny.config.environment;
|
|
416
|
-
console.log('📍 Extracted from config');
|
|
417
|
-
}
|
|
418
|
-
if (!this.cachedStoreId && clientAny.storeId) {
|
|
419
|
-
this.cachedStoreId = clientAny.storeId;
|
|
420
|
-
this.cachedReadSecret = clientAny.readSecret;
|
|
421
|
-
this.cachedEnvironment = clientAny.environment;
|
|
422
|
-
console.log('📍 Extracted from direct props');
|
|
423
|
-
}
|
|
424
|
-
if (!this.cachedStoreId && clientAny._config) {
|
|
425
|
-
this.cachedStoreId = clientAny._config.storeId;
|
|
426
|
-
this.cachedReadSecret = clientAny._config.readSecret;
|
|
427
|
-
this.cachedEnvironment = clientAny._config.environment;
|
|
428
|
-
console.log('📍 Extracted from _config');
|
|
429
|
-
}
|
|
430
|
-
if (!this.cachedStoreId && clientAny._storeId) {
|
|
431
|
-
this.cachedStoreId = clientAny._storeId;
|
|
432
|
-
this.cachedReadSecret = clientAny._readSecret;
|
|
433
|
-
this.cachedEnvironment = clientAny._environment || clientAny.environment;
|
|
434
|
-
console.log('📍 Extracted from _private props');
|
|
435
|
-
}
|
|
436
|
-
console.log('✅ SearchBar: Cached client credentials', {
|
|
437
|
-
hasStoreId: !!this.cachedStoreId,
|
|
438
|
-
storeIdPreview: this.cachedStoreId ? this.cachedStoreId.substring(0, 8) + '...' : 'MISSING',
|
|
439
|
-
hasReadSecret: !!this.cachedReadSecret,
|
|
440
|
-
environment: this.cachedEnvironment,
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
347
|
async performSearch() {
|
|
444
348
|
// Use empty string for empty queries
|
|
445
349
|
const query = this.input.value.trim();
|
|
@@ -17,7 +17,6 @@ export interface SearchResultsOptions {
|
|
|
17
17
|
onResultClick?: (result: ResultItem, index: number) => void;
|
|
18
18
|
renderResult?: (result: ResultItem, index: number) => HTMLElement;
|
|
19
19
|
renderEmpty?: () => HTMLElement;
|
|
20
|
-
renderLoading?: () => HTMLElement;
|
|
21
20
|
renderError?: (error: Error) => HTMLElement;
|
|
22
21
|
}
|
|
23
22
|
export declare class SearchResults {
|
|
@@ -31,14 +30,12 @@ export declare class SearchResults {
|
|
|
31
30
|
private render;
|
|
32
31
|
private extractResults;
|
|
33
32
|
private extractFields;
|
|
34
|
-
private renderDefaultLoading;
|
|
35
33
|
private renderDefaultError;
|
|
36
34
|
private renderDefaultEmpty;
|
|
37
35
|
private renderDefaultResult;
|
|
38
36
|
private renderCardResult;
|
|
39
37
|
private renderListResult;
|
|
40
38
|
private get theme();
|
|
41
|
-
private getLoadingStyle;
|
|
42
39
|
private getErrorStyle;
|
|
43
40
|
private getEmptyStyle;
|
|
44
41
|
private getGridContainerStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-results.d.ts","sourceRoot":"","sources":["../../src/components/search-results.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC;IAClE,WAAW,CAAC,EAAE,MAAM,WAAW,CAAC;IAChC,
|
|
1
|
+
{"version":3,"file":"search-results.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,CAAC,MAAM;IAmDd,OAAO,CAAC,cAAc;IAgCtB,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,mBAAmB;IAiD3B,OAAO,CAAC,gBAAgB;IAyCxB,OAAO,CAAC,gBAAgB;IAoCxB,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,aAAa;CAQtB"}
|
|
@@ -25,7 +25,6 @@ export class SearchResults {
|
|
|
25
25
|
onResultClick: options.onResultClick,
|
|
26
26
|
renderResult: options.renderResult,
|
|
27
27
|
renderEmpty: options.renderEmpty,
|
|
28
|
-
renderLoading: options.renderLoading,
|
|
29
28
|
renderError: options.renderError,
|
|
30
29
|
};
|
|
31
30
|
// Attach event delegation listener to the persistent container for result clicks
|
|
@@ -173,13 +172,6 @@ export class SearchResults {
|
|
|
173
172
|
loading: this.options.loading,
|
|
174
173
|
hasError: !!this.options.error,
|
|
175
174
|
});
|
|
176
|
-
if (this.options.loading) {
|
|
177
|
-
const loadingEl = this.options.renderLoading
|
|
178
|
-
? this.options.renderLoading()
|
|
179
|
-
: this.renderDefaultLoading();
|
|
180
|
-
this.container.appendChild(loadingEl);
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
175
|
if (this.options.error) {
|
|
184
176
|
const errorEl = this.options.renderError
|
|
185
177
|
? this.options.renderError(this.options.error)
|
|
@@ -274,12 +266,6 @@ export class SearchResults {
|
|
|
274
266
|
};
|
|
275
267
|
}
|
|
276
268
|
}
|
|
277
|
-
renderDefaultLoading() {
|
|
278
|
-
const div = document.createElement('div');
|
|
279
|
-
div.style.cssText = this.getLoadingStyle();
|
|
280
|
-
div.textContent = 'Loading results...';
|
|
281
|
-
return div;
|
|
282
|
-
}
|
|
283
269
|
renderDefaultError(error) {
|
|
284
270
|
const div = document.createElement('div');
|
|
285
271
|
div.style.cssText = this.getErrorStyle();
|
|
@@ -399,13 +385,6 @@ export class SearchResults {
|
|
|
399
385
|
get theme() {
|
|
400
386
|
return this.provider.theme;
|
|
401
387
|
}
|
|
402
|
-
getLoadingStyle() {
|
|
403
|
-
return `
|
|
404
|
-
padding: ${this.theme.spacing.large};
|
|
405
|
-
text-align: center;
|
|
406
|
-
color: ${this.theme.colors.text};
|
|
407
|
-
`;
|
|
408
|
-
}
|
|
409
388
|
getErrorStyle() {
|
|
410
389
|
return `
|
|
411
390
|
padding: ${this.theme.spacing.large};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/components/stats.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;QACzC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;KAC3C,CAAC;CACH;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,QA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,CAAC,eAAe;IA0BvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,sBAAsB;IAO9B,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,YAAY;CAMrB"}
|
package/dist/components/stats.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -126,9 +126,6 @@ declare class SearchBar {
|
|
|
126
126
|
private debounceTimer;
|
|
127
127
|
private isFocused;
|
|
128
128
|
private unsubscribeStateManager;
|
|
129
|
-
private cachedStoreId;
|
|
130
|
-
private cachedReadSecret;
|
|
131
|
-
private cachedEnvironment;
|
|
132
129
|
constructor(providerOrClient: SearchProvider | SeekoraClient, options: SearchBarOptions);
|
|
133
130
|
private render;
|
|
134
131
|
private injectPlaceholderStyles;
|
|
@@ -138,7 +135,6 @@ declare class SearchBar {
|
|
|
138
135
|
private selectSuggestion;
|
|
139
136
|
private fetchRichSuggestions;
|
|
140
137
|
private fallbackToBasicSuggestions;
|
|
141
|
-
private cacheClientCredentials;
|
|
142
138
|
private performSearch;
|
|
143
139
|
private renderSuggestions;
|
|
144
140
|
private updateSuggestionsVisibility;
|
|
@@ -185,7 +181,6 @@ interface SearchResultsOptions {
|
|
|
185
181
|
onResultClick?: (result: ResultItem, index: number) => void;
|
|
186
182
|
renderResult?: (result: ResultItem, index: number) => HTMLElement;
|
|
187
183
|
renderEmpty?: () => HTMLElement;
|
|
188
|
-
renderLoading?: () => HTMLElement;
|
|
189
184
|
renderError?: (error: Error) => HTMLElement;
|
|
190
185
|
}
|
|
191
186
|
declare class SearchResults {
|
|
@@ -199,14 +194,12 @@ declare class SearchResults {
|
|
|
199
194
|
private render;
|
|
200
195
|
private extractResults;
|
|
201
196
|
private extractFields;
|
|
202
|
-
private renderDefaultLoading;
|
|
203
197
|
private renderDefaultError;
|
|
204
198
|
private renderDefaultEmpty;
|
|
205
199
|
private renderDefaultResult;
|
|
206
200
|
private renderCardResult;
|
|
207
201
|
private renderListResult;
|
|
208
202
|
private get theme();
|
|
209
|
-
private getLoadingStyle;
|
|
210
203
|
private getErrorStyle;
|
|
211
204
|
private getEmptyStyle;
|
|
212
205
|
private getGridContainerStyle;
|
|
@@ -532,8 +525,6 @@ interface InfiniteHitsOptions {
|
|
|
532
525
|
renderHit?: (hit: ResultItem, index: number) => HTMLElement;
|
|
533
526
|
/** Custom render for empty state */
|
|
534
527
|
renderEmpty?: () => HTMLElement;
|
|
535
|
-
/** Custom render for loading state */
|
|
536
|
-
renderLoading?: () => HTMLElement;
|
|
537
528
|
/** Whether to show the "Show More" button (default: true) */
|
|
538
529
|
showMoreButton?: boolean;
|
|
539
530
|
/** Whether to use infinite scroll with IntersectionObserver (default: false) */
|
|
@@ -544,8 +535,6 @@ interface InfiniteHitsOptions {
|
|
|
544
535
|
fieldMapping?: FieldMapping;
|
|
545
536
|
/** Text for "Show More" button */
|
|
546
537
|
showMoreLabel?: string;
|
|
547
|
-
/** Text for loading state */
|
|
548
|
-
loadingLabel?: string;
|
|
549
538
|
/** Callback when a hit is clicked */
|
|
550
539
|
onHitClick?: (hit: ResultItem, index: number) => void;
|
|
551
540
|
}
|
|
@@ -567,7 +556,6 @@ declare class InfiniteHits {
|
|
|
567
556
|
private setupIntersectionObserver;
|
|
568
557
|
private createDefaultHit;
|
|
569
558
|
private createDefaultEmpty;
|
|
570
|
-
private createDefaultLoading;
|
|
571
559
|
private createShowMoreButton;
|
|
572
560
|
/** Extract string value using fieldMapping (no hardcoded field names) */
|
|
573
561
|
private extractField;
|
|
@@ -648,7 +636,6 @@ declare class QuerySuggestions {
|
|
|
648
636
|
private render;
|
|
649
637
|
private get theme();
|
|
650
638
|
private getTitleStyle;
|
|
651
|
-
private getLoadingStyle;
|
|
652
639
|
private getEmptyStyle;
|
|
653
640
|
private getListStyle;
|
|
654
641
|
private getSuggestionStyle;
|