@seekora-ai/ui-sdk-angular 1.0.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.
@@ -0,0 +1,433 @@
1
+ import { SeekoraClient, SearchResponse, SearchContext, SearchOptions } from '@seekora-ai/search-sdk';
2
+ import * as _seekora_ai_ui_sdk_types from '@seekora-ai/ui-sdk-types';
3
+ import { Theme, ThemeConfig, SuggestionItem, ViewMode, FieldMapping, ResultItem } from '@seekora-ai/ui-sdk-types';
4
+ export { FieldMapping, ResultItem, SuggestionItem, Theme, ThemeConfig, ViewMode } from '@seekora-ai/ui-sdk-types';
5
+ import { Observable } from 'rxjs';
6
+ import { OnInit, OnDestroy, Injector, ElementRef, OnChanges, TemplateRef } from '@angular/core';
7
+ export { mergeThemes } from '@seekora-ai/ui-sdk-core';
8
+
9
+ /**
10
+ * SearchContext Service
11
+ *
12
+ * Provides search context (client, theme, etc.) to Angular components
13
+ */
14
+
15
+ declare const SEEKORA_CLIENT: any;
16
+ declare const SEEKORA_THEME_CONFIG: any;
17
+ declare class SearchContextService {
18
+ readonly client: SeekoraClient;
19
+ readonly theme: Theme;
20
+ readonly enableAnalytics: boolean;
21
+ readonly autoTrackSearch: boolean;
22
+ constructor(client: SeekoraClient, themeConfig?: ThemeConfig, enableAnalytics?: boolean, autoTrackSearch?: boolean);
23
+ }
24
+
25
+ /**
26
+ * SeekoraSearch Service
27
+ *
28
+ * Service for performing searches with the Seekora SDK
29
+ */
30
+
31
+ interface SearchState {
32
+ results: SearchResponse | null;
33
+ loading: boolean;
34
+ error: Error | null;
35
+ context: SearchContext | null;
36
+ }
37
+ declare class SeekoraSearchService {
38
+ private searchContext;
39
+ private searchStateSubject;
40
+ readonly searchState$: Observable<SearchState>;
41
+ constructor(searchContext: SearchContextService);
42
+ search(options: SearchOptions): Observable<SearchResponse | null>;
43
+ clearResults(): void;
44
+ getCurrentState(): SearchState;
45
+ }
46
+
47
+ /**
48
+ * QuerySuggestions Service
49
+ *
50
+ * Service for fetching query suggestions with debouncing
51
+ */
52
+
53
+ interface SuggestionsState {
54
+ suggestions: SuggestionItem[];
55
+ loading: boolean;
56
+ error: Error | null;
57
+ }
58
+ declare class QuerySuggestionsService {
59
+ private searchContext;
60
+ private debounceMs;
61
+ private maxSuggestions;
62
+ private querySubject;
63
+ private suggestionsStateSubject;
64
+ readonly suggestionsState$: Observable<SuggestionsState>;
65
+ constructor(searchContext: SearchContextService, debounceMs?: number, maxSuggestions?: number);
66
+ setQuery(query: string): void;
67
+ getCurrentState(): SuggestionsState;
68
+ }
69
+
70
+ /**
71
+ * SearchProvider Component
72
+ *
73
+ * Provides Seekora client and context to child components
74
+ */
75
+
76
+ declare class SearchProviderComponent implements OnInit, OnDestroy {
77
+ private injector;
78
+ client: SeekoraClient;
79
+ theme?: ThemeConfig;
80
+ enableAnalytics: boolean;
81
+ autoTrackSearch: boolean;
82
+ constructor(injector: Injector);
83
+ ngOnInit(): void;
84
+ ngOnDestroy(): void;
85
+ }
86
+
87
+ /**
88
+ * SearchBar Component
89
+ *
90
+ * Interactive search input component with query suggestions support
91
+ */
92
+
93
+ declare class SearchBarComponent implements OnInit, OnDestroy {
94
+ private searchContext;
95
+ private searchService;
96
+ private suggestionsService;
97
+ placeholder: string;
98
+ showSuggestions: boolean;
99
+ minQueryLength: number;
100
+ maxSuggestions: number;
101
+ debounceMs: number;
102
+ searchOptions?: Partial<SearchOptions>;
103
+ search: any;
104
+ suggestionSelect: any;
105
+ queryChange: any;
106
+ searchStateChange: any;
107
+ searchInput?: ElementRef<HTMLInputElement>;
108
+ query: string;
109
+ isFocused: boolean;
110
+ selectedIndex: number;
111
+ suggestions: SuggestionItem[];
112
+ suggestionsLoading: boolean;
113
+ private querySubject;
114
+ private subscriptions;
115
+ constructor(searchContext: SearchContextService, searchService: SeekoraSearchService, suggestionsService: QuerySuggestionsService);
116
+ ngOnInit(): void;
117
+ ngOnDestroy(): void;
118
+ get displayedSuggestions(): SuggestionItem[];
119
+ get showSuggestionsList(): boolean;
120
+ onInputChange(event: Event): void;
121
+ onFocus(): void;
122
+ onBlur(): void;
123
+ onKeyDown(event: KeyboardEvent): void;
124
+ selectSuggestion(suggestion: string): void;
125
+ performSearch(): void;
126
+ getInputStyle(): Record<string, any>;
127
+ getSuggestionsStyle(): Record<string, any>;
128
+ get loadingStyle(): Record<string, any>;
129
+ get emptyStyle(): Record<string, any>;
130
+ getSuggestionStyle(index: number): Record<string, any>;
131
+ }
132
+
133
+ /**
134
+ * SearchResults Component
135
+ *
136
+ * Displays search results with customizable rendering
137
+ */
138
+
139
+ declare class SearchResultsComponent implements OnInit, OnDestroy {
140
+ private searchContext;
141
+ private searchService;
142
+ results?: any;
143
+ loading: boolean;
144
+ error?: Error | null;
145
+ viewMode: ViewMode;
146
+ fieldMapping?: FieldMapping;
147
+ itemsPerPage: number;
148
+ resultClick: any;
149
+ private subscriptions;
150
+ constructor(searchContext: SearchContextService, searchService: SeekoraSearchService);
151
+ ngOnInit(): void;
152
+ ngOnDestroy(): void;
153
+ extractResults(results: any): any[];
154
+ get displayedResults(): any[];
155
+ extractedFields(item: any): ResultItem;
156
+ onResultClick(result: any, index: number): void;
157
+ get containerStyle(): Record<string, any>;
158
+ get loadingStyle(): Record<string, any>;
159
+ get errorStyle(): Record<string, any>;
160
+ get emptyStyle(): Record<string, any>;
161
+ getContainerStyle(): Record<string, any>;
162
+ getResultStyle(): Record<string, any>;
163
+ get imageStyle(): Record<string, any>;
164
+ get imageImgStyle(): Record<string, any>;
165
+ get titleStyle(): Record<string, any>;
166
+ get descriptionStyle(): Record<string, any>;
167
+ get priceStyle(): Record<string, any>;
168
+ }
169
+
170
+ declare class QuerySuggestionsComponent implements OnInit, OnDestroy, OnChanges {
171
+ searchContext: SearchContextService;
172
+ query: string;
173
+ maxSuggestions: number;
174
+ debounceMs: number;
175
+ minQueryLength: number;
176
+ showTitle: boolean;
177
+ title: string;
178
+ className?: string;
179
+ style?: Record<string, any>;
180
+ suggestionClick: any;
181
+ displayedSuggestions: SuggestionItem[];
182
+ suggestionsLoading: boolean;
183
+ error: Error | null;
184
+ selectedIndex: number;
185
+ private querySubject;
186
+ private subscription?;
187
+ private suggestionsSubscription?;
188
+ constructor(searchContext: SearchContextService);
189
+ ngOnInit(): void;
190
+ ngOnDestroy(): void;
191
+ ngOnChanges(): void;
192
+ private loadSuggestions;
193
+ onSuggestionClick(suggestion: SuggestionItem): void;
194
+ get theme(): _seekora_ai_ui_sdk_types.Theme;
195
+ getContainerStyle(): Record<string, any>;
196
+ getTitleStyle(): Record<string, any>;
197
+ getLoadingStyle(): Record<string, any>;
198
+ getEmptyStyle(): Record<string, any>;
199
+ getSuggestionStyle(index: number): Record<string, any>;
200
+ getCountStyle(): Record<string, any>;
201
+ }
202
+
203
+ /**
204
+ * Stats Component
205
+ *
206
+ * Displays search statistics
207
+ */
208
+
209
+ declare class StatsComponent {
210
+ private searchContext;
211
+ results?: any;
212
+ loading: boolean;
213
+ showProcessingTime: boolean;
214
+ showQuery: boolean;
215
+ labels?: {
216
+ resultsFound?: (total: number) => string;
217
+ processingTime?: (time: number) => string;
218
+ };
219
+ constructor(searchContext: SearchContextService);
220
+ get totalResults(): number;
221
+ get processingTime(): number | undefined;
222
+ get hasResults(): boolean;
223
+ get resultsText(): string;
224
+ get processingTimeText(): string;
225
+ get containerStyle(): Record<string, any>;
226
+ get textStyle(): Record<string, any>;
227
+ }
228
+
229
+ /**
230
+ * Pagination Component
231
+ *
232
+ * Displays pagination controls for search results
233
+ */
234
+
235
+ declare class PaginationComponent {
236
+ private searchContext;
237
+ results?: any;
238
+ currentPage: number;
239
+ itemsPerPage: number;
240
+ maxVisiblePages: number;
241
+ showFirstLast: boolean;
242
+ showPrevNext: boolean;
243
+ pageChange: any;
244
+ constructor(searchContext: SearchContextService);
245
+ get totalResults(): number;
246
+ get totalPages(): number;
247
+ get visiblePages(): number[];
248
+ handlePageChange(page: number): void;
249
+ get containerStyle(): Record<string, any>;
250
+ getButtonStyle(page: number, isActive?: boolean): Record<string, any>;
251
+ }
252
+
253
+ /**
254
+ * SortBy Component
255
+ *
256
+ * Displays sort options for search results
257
+ */
258
+
259
+ interface SortOption {
260
+ value: string;
261
+ label: string;
262
+ }
263
+ declare class SortByComponent {
264
+ private searchContext;
265
+ options: SortOption[];
266
+ value: string;
267
+ label?: string;
268
+ sortChange: any;
269
+ constructor(searchContext: SearchContextService);
270
+ handleChange(event: Event): void;
271
+ get containerStyle(): Record<string, any>;
272
+ get labelStyle(): Record<string, any>;
273
+ get selectStyle(): Record<string, any>;
274
+ }
275
+
276
+ /**
277
+ * Facets Component
278
+ *
279
+ * Displays facet filters for search results
280
+ */
281
+
282
+ interface FacetCount {
283
+ value: string;
284
+ count: number;
285
+ }
286
+ interface Facet {
287
+ field_name: string;
288
+ counts: FacetCount[];
289
+ stats?: Record<string, any>;
290
+ }
291
+ declare class FacetsComponent {
292
+ private searchContext;
293
+ results?: any;
294
+ maxItems: number;
295
+ showMore: boolean;
296
+ selectedFacets: Record<string, string[]>;
297
+ facetChange: any;
298
+ expandedFacets: Record<string, boolean>;
299
+ constructor(searchContext: SearchContextService);
300
+ get facets(): Facet[];
301
+ visibleCounts(facet: Facet): FacetCount[];
302
+ isSelected(field: string, value: string): boolean;
303
+ toggleShowMore(field: string): void;
304
+ handleFacetClick(field: string, value: string): void;
305
+ handleFacetChange(field: string, value: string, selected: boolean): void;
306
+ get containerStyle(): Record<string, any>;
307
+ get titleStyle(): Record<string, any>;
308
+ getFacetItemStyle(field: string, value: string): Record<string, any>;
309
+ get checkboxStyle(): Record<string, any>;
310
+ get labelStyle(): Record<string, any>;
311
+ get countStyle(): Record<string, any>;
312
+ get showMoreStyle(): Record<string, any>;
313
+ isExpanded(field: string): boolean;
314
+ getShowMoreLabel(facet: Facet): string;
315
+ }
316
+
317
+ /**
318
+ * CurrentRefinements Component
319
+ *
320
+ * Displays currently active filters/refinements with ability to clear them
321
+ */
322
+
323
+ interface Refinement {
324
+ field: string;
325
+ value: string;
326
+ label?: string;
327
+ }
328
+ declare class CurrentRefinementsComponent {
329
+ private searchContext;
330
+ refinements: Refinement[];
331
+ showLabel: boolean;
332
+ label: string;
333
+ showClearAll: boolean;
334
+ refinementClear: any;
335
+ clearAll: any;
336
+ constructor(searchContext: SearchContextService);
337
+ getRefinementLabel(refinement: Refinement): string;
338
+ handleClear(field: string, value: string): void;
339
+ handleClearAll(): void;
340
+ get containerStyle(): Record<string, any>;
341
+ get labelStyle(): Record<string, any>;
342
+ get refinementsStyle(): Record<string, any>;
343
+ get refinementStyle(): Record<string, any>;
344
+ get refinementTextStyle(): Record<string, any>;
345
+ get clearButtonStyle(): Record<string, any>;
346
+ get clearAllStyle(): Record<string, any>;
347
+ }
348
+
349
+ declare class RangeInputComponent implements OnInit {
350
+ searchContext: SearchContextService;
351
+ field: string;
352
+ label?: string;
353
+ min?: number;
354
+ max?: number;
355
+ step: number;
356
+ currentMin?: number;
357
+ currentMax?: number;
358
+ showApplyButton: boolean;
359
+ placeholder?: {
360
+ min?: string;
361
+ max?: string;
362
+ };
363
+ className?: string;
364
+ style?: Record<string, any>;
365
+ rangeChange: any;
366
+ private internalMin?;
367
+ private internalMax?;
368
+ private appliedMin?;
369
+ private appliedMax?;
370
+ constructor(searchContext: SearchContextService);
371
+ ngOnInit(): void;
372
+ get theme(): _seekora_ai_ui_sdk_types.Theme;
373
+ get effectiveMin(): number | undefined;
374
+ get effectiveMax(): number | undefined;
375
+ hasValue(): boolean;
376
+ onMinChange(event: Event): void;
377
+ onMaxChange(event: Event): void;
378
+ onApply(): void;
379
+ onReset(): void;
380
+ getContainerStyle(): Record<string, any>;
381
+ getLabelStyle(): Record<string, any>;
382
+ getInputGroupStyle(): Record<string, any>;
383
+ getInputStyle(): Record<string, any>;
384
+ getSeparatorStyle(): Record<string, any>;
385
+ getApplyButtonStyle(): Record<string, any>;
386
+ getResetButtonStyle(): Record<string, any>;
387
+ }
388
+
389
+ declare class SearchLayoutComponent {
390
+ searchContext: SearchContextService;
391
+ sidebar?: any;
392
+ header?: any;
393
+ footer?: any;
394
+ sidebarWidth: string;
395
+ showSidebarOnMobile: boolean;
396
+ className?: string;
397
+ style?: Record<string, any>;
398
+ headerTemplate?: TemplateRef<any>;
399
+ sidebarTemplate?: TemplateRef<any>;
400
+ footerTemplate?: TemplateRef<any>;
401
+ constructor(searchContext: SearchContextService);
402
+ get theme(): _seekora_ai_ui_sdk_types.Theme;
403
+ getContainerStyle(): Record<string, any>;
404
+ getHeaderStyle(): Record<string, any>;
405
+ getContentStyle(): Record<string, any>;
406
+ getSidebarStyle(): Record<string, any>;
407
+ getSidebarClass(): string;
408
+ getMainStyle(): Record<string, any>;
409
+ getFooterStyle(): Record<string, any>;
410
+ }
411
+
412
+ /**
413
+ * Default Theme
414
+ */
415
+
416
+ declare const defaultTheme: Theme;
417
+
418
+ /**
419
+ * Dark Theme
420
+ */
421
+
422
+ declare const darkTheme: Theme;
423
+
424
+ /**
425
+ * Minimal Theme
426
+ */
427
+
428
+ declare const minimalTheme: Theme;
429
+
430
+ declare const createTheme: (config: ThemeConfig) => _seekora_ai_ui_sdk_types.Theme;
431
+
432
+ export { CurrentRefinementsComponent, FacetsComponent, PaginationComponent, QuerySuggestionsComponent, QuerySuggestionsService, RangeInputComponent, SEEKORA_CLIENT, SEEKORA_THEME_CONFIG, SearchBarComponent, SearchContextService, SearchLayoutComponent, SearchProviderComponent, SearchResultsComponent, SeekoraSearchService, SortByComponent, StatsComponent, createTheme, darkTheme, defaultTheme, minimalTheme };
433
+ export type { Facet, FacetCount, Refinement, SearchState, SortOption, SuggestionsState };