@searchcraft/javascript-sdk 0.9.4 → 0.9.5

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 (42) hide show
  1. package/dist/components/bundled.types.d.ts +51 -8
  2. package/dist/components/index.js +4 -4
  3. package/dist/components/{p-6d8b0ead.js → p-39be2b10.js} +435 -367
  4. package/dist/components/p-39be2b10.js.map +1 -0
  5. package/dist/components/{p-b0bc5cee.js → p-52edbc31.js} +36 -4
  6. package/dist/components/p-52edbc31.js.map +1 -0
  7. package/dist/components/{p-05872320.js → p-70f5d28f.js} +9 -18
  8. package/dist/components/p-70f5d28f.js.map +1 -0
  9. package/dist/components/{p-3568414f.js → p-8a4f8203.js} +2 -2
  10. package/dist/components/{p-3568414f.js.map → p-8a4f8203.js.map} +1 -1
  11. package/dist/components/{p-7777d986.js → p-c3cc2fc3.js} +2 -2
  12. package/dist/components/{p-7777d986.js.map → p-c3cc2fc3.js.map} +1 -1
  13. package/dist/components/{p-5bd5c3cb.js → p-d3351811.js} +7 -10
  14. package/dist/components/p-d3351811.js.map +1 -0
  15. package/dist/components/{p-cd9ba361.js → p-fee8c484.js} +2 -2
  16. package/dist/components/{p-cd9ba361.js.map → p-fee8c484.js.map} +1 -1
  17. package/dist/components/{p-11b05b94.js → p-ffb05b5b.js} +2 -2
  18. package/dist/components/{p-11b05b94.js.map → p-ffb05b5b.js.map} +1 -1
  19. package/dist/components/searchcraft-ad.js +1 -1
  20. package/dist/components/searchcraft-base-search-result.js +1 -1
  21. package/dist/components/searchcraft-base-search-results.js +37 -4
  22. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  23. package/dist/components/searchcraft-facet-list.js +1 -1
  24. package/dist/components/searchcraft-filter-panel.js +3 -3
  25. package/dist/components/searchcraft-input-form.js +1 -1
  26. package/dist/components/searchcraft-pagination.js +1 -1
  27. package/dist/components/searchcraft-popover-button.js +1 -1
  28. package/dist/components/searchcraft-popover-form.js +5 -5
  29. package/dist/components/searchcraft-popover-list-item.js +1 -1
  30. package/dist/components/searchcraft-popover-list-view.js +1 -1
  31. package/dist/components/searchcraft-results-info.js +1 -1
  32. package/dist/components/searchcraft-search-results-per-page.js +1 -1
  33. package/dist/components/searchcraft-toggle-button.js +1 -1
  34. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -0
  35. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +1 -4
  36. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -0
  37. package/dist/types/components.d.ts +0 -8
  38. package/package.json +3 -3
  39. package/dist/components/p-05872320.js.map +0 -1
  40. package/dist/components/p-5bd5c3cb.js.map +0 -1
  41. package/dist/components/p-6d8b0ead.js.map +0 -1
  42. package/dist/components/p-b0bc5cee.js.map +0 -1
@@ -87,6 +87,34 @@ export interface SearchcraftConfig {
87
87
  * A callback function responsible for rendering the custom ad containers.
88
88
  */
89
89
  customAdTemplate?: CustomAdTemplateRenderFunction;
90
+ /**
91
+ * The placement id to use for Nativo ads.
92
+ */
93
+ nativoPlacementId?: number;
94
+ /**
95
+ * The class name for nativo ad containers.
96
+ */
97
+ nativoAdClassName?: string;
98
+ /**
99
+ * The number of custom ads to render at the start of the search results page.
100
+ */
101
+ nativoAdStartQuantity?: number;
102
+ /**
103
+ * The number of custom ads to render at the end of the search results page.
104
+ */
105
+ nativoAdEndQuantity?: number;
106
+ /**
107
+ * Renders a custom ad in between search results, at the specified interval.
108
+ */
109
+ nativoAdInterstitialInterval?: number;
110
+ /**
111
+ * Specify how many normal search results to render before rendering the first interstitial ad grouping.
112
+ */
113
+ nativoAdInterstialStartIndex?: number;
114
+ /**
115
+ * Specifies the number of ads to be rendered in each interstitial in between search results.
116
+ */
117
+ nativoAdInterstitialQuantity?: number;
90
118
  }
91
119
  export type SearchcraftAdSource = "adMarketplace" | "Nativo" | "Custom" | "None";
92
120
  /**
@@ -249,6 +277,7 @@ export type SearchParams = {
249
277
  };
250
278
  export interface SubscriptionEventMap {
251
279
  ad_container_rendered: AdContainerSubscriptionEvent;
280
+ query_fetched: QueryFetchedEvent;
252
281
  query_submitted: QuerySubmittedEvent;
253
282
  input_cleared: InputClearedEvent;
254
283
  no_results_returned: NoResultsReturnedEvent;
@@ -267,6 +296,12 @@ export interface QuerySubmittedEvent extends SubscriptionEvent {
267
296
  searchTerm: string;
268
297
  };
269
298
  }
299
+ export interface QueryFetchedEvent extends SubscriptionEvent {
300
+ name: "query_fetched";
301
+ data: {
302
+ searchTerm: string;
303
+ };
304
+ }
270
305
  export interface InputClearedEvent extends SubscriptionEvent {
271
306
  name: "input_cleared";
272
307
  }
@@ -386,6 +421,9 @@ declare class AdClient {
386
421
  config: SearchcraftConfig;
387
422
  constructor(config: SearchcraftConfig);
388
423
  getAdsForSearchParams(_params: SearchParams): Promise<AdClientResponseItem[]>;
424
+ onQuerySubmitted(_params: SearchParams): Promise<void>;
425
+ onQueryFetched(_params: SearchParams, _response: SearchcraftResponse): Promise<void>;
426
+ onInputCleared(): Promise<void>;
389
427
  }
390
428
  declare class MeasureClient {
391
429
  private measureRequestTimeout;
@@ -444,6 +482,19 @@ declare class SearchcraftCore {
444
482
  private initClients;
445
483
  emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
446
484
  subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
485
+ /**
486
+ * Called when a `<searchcraft-ad>` component is rendered
487
+ */
488
+ handleAdContainerRendered(data: {
489
+ adClientResponseItem?: AdClientResponseItem;
490
+ adContainerId: string;
491
+ adSource: SearchcraftAdSource;
492
+ searchTerm: string;
493
+ }): void;
494
+ /**
495
+ * Perform various actions when the input is cleared
496
+ */
497
+ handleInputCleared(): void;
447
498
  /**
448
499
  * Gets items from the SearchClient and the AdClient.
449
500
  */
@@ -731,10 +782,6 @@ export namespace Components {
731
782
  * The input element's placeholder value.
732
783
  */
733
784
  "placeholderValue": string;
734
- /**
735
- * The starting value of the input element.
736
- */
737
- "searchTerm": string;
738
785
  }
739
786
  /**
740
787
  * This web component serves as the input label for the searchcraft-input-form component.
@@ -1672,10 +1719,6 @@ declare namespace LocalJSX {
1672
1719
  * The input element's placeholder value.
1673
1720
  */
1674
1721
  "placeholderValue"?: string;
1675
- /**
1676
- * The starting value of the input element.
1677
- */
1678
- "searchTerm"?: string;
1679
1722
  }
1680
1723
  /**
1681
1724
  * This web component serves as the input label for the searchcraft-input-form component.
@@ -1,6 +1,6 @@
1
1
  export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-5365011f.js';
2
- import { g as ge } from './p-6d8b0ead.js';
3
- export { s as searchcraftStore } from './p-6d8b0ead.js';
2
+ import { g as ge } from './p-39be2b10.js';
3
+ export { s as searchcraftStore } from './p-39be2b10.js';
4
4
  export { SearchcraftAd, defineCustomElement as defineCustomElementSearchcraftAd } from './searchcraft-ad.js';
5
5
  export { SearchcraftBaseSearchResult, defineCustomElement as defineCustomElementSearchcraftBaseSearchResult } from './searchcraft-base-search-result.js';
6
6
  export { SearchcraftBaseSearchResults, defineCustomElement as defineCustomElementSearchcraftBaseSearchResults } from './searchcraft-base-search-results.js';
@@ -24,7 +24,7 @@ export { SearchcraftToggleButton, defineCustomElement as defineCustomElementSear
24
24
  export { p as parseCustomStyles, s as serializeStyles } from './p-d9551738.js';
25
25
 
26
26
  const name = "@searchcraft/javascript-sdk";
27
- const version = "0.9.4";
27
+ const version = "0.9.5";
28
28
  const description = "Searchcraft Javascript SDK";
29
29
  const author = "Searchcraft";
30
30
  const license = "Apache-2.0";
@@ -64,7 +64,7 @@ const dependencies = {
64
64
  nanoid: "^5.0.9"
65
65
  };
66
66
  const devDependencies = {
67
- "@searchcraft/core": "^0.9.4",
67
+ "@searchcraft/core": "^0.9.5",
68
68
  "@stencil/core": "^4.7.0",
69
69
  "@stencil/react-output-target": "^0.8.2",
70
70
  "@stencil/sass": "^3.0.12",