@searchcraft/javascript-sdk 0.9.7 → 0.10.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 (119) hide show
  1. package/README.md +2 -2
  2. package/dist/components/defineCustomElements.js +6 -6
  3. package/dist/components/index.d.ts +2514 -68
  4. package/dist/components/index.js +45 -14
  5. package/dist/components/index.js.map +1 -1
  6. package/dist/components/{p-e55a7970.js → p-1adf78b9.js} +2 -2
  7. package/dist/components/p-1adf78b9.js.map +1 -0
  8. package/dist/components/{p-60f05735.js → p-34a32648.js} +4 -4
  9. package/dist/components/p-34a32648.js.map +1 -0
  10. package/dist/components/p-39e70a00.js +67 -0
  11. package/dist/components/p-39e70a00.js.map +1 -0
  12. package/dist/components/{p-e41b0f43.js → p-3f63fa14.js} +14 -21
  13. package/dist/components/p-3f63fa14.js.map +1 -0
  14. package/dist/components/{p-bf6a086a.js → p-73db9122.js} +3 -10
  15. package/dist/components/p-73db9122.js.map +1 -0
  16. package/dist/components/p-810a7850.js +17 -0
  17. package/dist/components/p-810a7850.js.map +1 -0
  18. package/dist/components/{p-8f854dec.js → p-8aa0fff5.js} +4 -3
  19. package/dist/components/p-8aa0fff5.js.map +1 -0
  20. package/dist/components/{p-5fdaf1e6.js → p-a64b4cba.js} +2 -145
  21. package/dist/components/p-a64b4cba.js.map +1 -0
  22. package/dist/components/{p-71cc28c1.js → p-acf23bab.js} +2 -2
  23. package/dist/components/p-acf23bab.js.map +1 -0
  24. package/dist/components/{p-bb12ab5a.js → p-bc9e0e40.js} +4 -3
  25. package/dist/components/p-bc9e0e40.js.map +1 -0
  26. package/dist/components/{p-4df578e4.js → p-c317a36a.js} +7 -7
  27. package/dist/components/p-c317a36a.js.map +1 -0
  28. package/dist/components/{p-e27a0dab.js → p-d361b781.js} +5 -7
  29. package/dist/components/p-d361b781.js.map +1 -0
  30. package/dist/components/p-e72d0167.js +147 -0
  31. package/dist/components/p-e72d0167.js.map +1 -0
  32. package/dist/components/{p-0e393fe1.js → p-f2585cdf.js} +3 -9
  33. package/dist/components/p-f2585cdf.js.map +1 -0
  34. package/dist/components/{p-580c09dc.js → p-f8df3d49.js} +143 -143
  35. package/dist/components/p-f8df3d49.js.map +1 -0
  36. package/dist/components/searchcraft-ad.js +1 -1
  37. package/dist/components/searchcraft-button.js +1 -1
  38. package/dist/components/searchcraft-error-message.js +1 -1
  39. package/dist/components/searchcraft-facet-list.js +1 -1
  40. package/dist/components/searchcraft-filter-panel.js +6 -5
  41. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  42. package/dist/components/searchcraft-input-form.js +2 -2
  43. package/dist/components/searchcraft-input-label.js +1 -1
  44. package/dist/components/searchcraft-pagination.js +3 -9
  45. package/dist/components/searchcraft-pagination.js.map +1 -1
  46. package/dist/components/searchcraft-popover-button.js +2 -2
  47. package/dist/components/searchcraft-popover-button.js.map +1 -1
  48. package/dist/components/searchcraft-popover-form.js +14 -15
  49. package/dist/components/searchcraft-popover-form.js.map +1 -1
  50. package/dist/components/searchcraft-popover-list-item.js +1 -1
  51. package/dist/components/searchcraft-popover-list-view.js +1 -1
  52. package/dist/components/searchcraft-results-info.js +15 -19
  53. package/dist/components/searchcraft-results-info.js.map +1 -1
  54. package/dist/components/searchcraft-search-result.d.ts +11 -0
  55. package/dist/components/searchcraft-search-result.js +8 -0
  56. package/dist/components/searchcraft-search-result.js.map +1 -0
  57. package/dist/components/searchcraft-search-results-per-page.js +3 -10
  58. package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
  59. package/dist/components/searchcraft-search-results.d.ts +11 -0
  60. package/dist/components/{searchcraft-base-search-results.js → searchcraft-search-results.js} +25 -71
  61. package/dist/components/searchcraft-search-results.js.map +1 -0
  62. package/dist/components/searchcraft-select.js +1 -1
  63. package/dist/components/searchcraft-slider.js +1 -1
  64. package/dist/components/searchcraft-theme.js +4 -42
  65. package/dist/components/searchcraft-theme.js.map +1 -1
  66. package/dist/components/searchcraft-toggle-button.js +1 -1
  67. package/dist/hydrate/index.d.ts +242 -0
  68. package/dist/hydrate/index.js +23290 -0
  69. package/dist/hydrate/index.mjs +23282 -0
  70. package/dist/hydrate/package.json +12 -0
  71. package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +2 -0
  72. package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +3 -2
  73. package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +6 -7
  74. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +3 -1
  75. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +29 -1
  76. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +22 -14
  77. package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +3 -2
  78. package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +21 -8
  79. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +30 -0
  80. package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +26 -15
  81. package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +2 -0
  82. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +3 -2
  83. package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +41 -15
  84. package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +25 -0
  85. package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +80 -0
  86. package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +20 -5
  87. package/dist/types/components/searchcraft-select/searchcraft-select.d.ts +3 -5
  88. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +3 -3
  89. package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +23 -16
  90. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
  91. package/dist/types/components.d.ts +836 -612
  92. package/dist/types/index.d.ts +5 -4
  93. package/dist/types/utils/html.d.ts +6 -0
  94. package/dist/types/utils/index.d.ts +1 -0
  95. package/package.json +9 -7
  96. package/dist/components/bundled.types.d.ts +0 -2275
  97. package/dist/components/p-0e393fe1.js.map +0 -1
  98. package/dist/components/p-19fe91f1.js +0 -136
  99. package/dist/components/p-19fe91f1.js.map +0 -1
  100. package/dist/components/p-4df578e4.js.map +0 -1
  101. package/dist/components/p-580c09dc.js.map +0 -1
  102. package/dist/components/p-5fdaf1e6.js.map +0 -1
  103. package/dist/components/p-60f05735.js.map +0 -1
  104. package/dist/components/p-71cc28c1.js.map +0 -1
  105. package/dist/components/p-8f854dec.js.map +0 -1
  106. package/dist/components/p-bb12ab5a.js.map +0 -1
  107. package/dist/components/p-bf6a086a.js.map +0 -1
  108. package/dist/components/p-d9551738.js +0 -25
  109. package/dist/components/p-d9551738.js.map +0 -1
  110. package/dist/components/p-e27a0dab.js.map +0 -1
  111. package/dist/components/p-e41b0f43.js.map +0 -1
  112. package/dist/components/p-e55a7970.js.map +0 -1
  113. package/dist/components/searchcraft-base-search-result.d.ts +0 -11
  114. package/dist/components/searchcraft-base-search-result.js +0 -8
  115. package/dist/components/searchcraft-base-search-result.js.map +0 -1
  116. package/dist/components/searchcraft-base-search-results.d.ts +0 -11
  117. package/dist/components/searchcraft-base-search-results.js.map +0 -1
  118. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +0 -55
  119. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +0 -89
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@searchcraft/javascript-sdk/hydrate",
3
+ "description": "SearchcraftJavascriptSdk component hydration app.",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "require": "./index.js",
9
+ "import": "./index.mjs"
10
+ }
11
+ }
12
+ }
@@ -1,6 +1,8 @@
1
1
  import type { AdClientResponseItem, SearchcraftAdSource } from '@searchcraft/core';
2
2
  /**
3
3
  * An inline ad meant to be rendered in a list of search results.
4
+ *
5
+ * @internal
4
6
  */
5
7
  export declare class SearchcraftPopoverListItemAd {
6
8
  adSource: SearchcraftAdSource;
@@ -1,8 +1,9 @@
1
1
  import { type EventEmitter } from '../../stencil-public-runtime';
2
2
  /**
3
- * This web component represents a button to be consumed within the `search-input-form` component.
3
+ * This web component represents a button.
4
4
  * It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
5
- * It is consumed within the `searchcraft-input-form` component.
5
+ *
6
+ * @internal
6
7
  */
7
8
  export declare class SearchcraftButton {
8
9
  /**
@@ -1,17 +1,16 @@
1
1
  /**
2
2
  * This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
3
3
  *
4
- * ## Usage
4
+ * @js-example
5
5
  * ```html
6
- * <!-- index.html -->
7
- * <searchcraft-error-message error-message="No search results found for query" />
6
+ * <searchcraft-error-message>
7
+ * No search results found for query
8
+ * </searchcraft-error-message>
8
9
  * ```
10
+ *
11
+ * @internal
9
12
  */
10
13
  export declare class SearchcraftErrorMessage {
11
- /**
12
- * The error message.
13
- */
14
- errorMessage?: string;
15
14
  render(): any;
16
15
  }
17
16
  //# sourceMappingURL=searchcraft-error-message.d.ts.map
@@ -5,7 +5,7 @@ import { type SearchcraftState } from "../../store/index";
5
5
  * This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
6
6
  * It is consumed within the `searchcraft-filter-panel`.
7
7
  *
8
- * ## Usage
8
+ * @js-example
9
9
  * ```html
10
10
  * <!-- index.html -->
11
11
  * <searchcraft-facet-list field-name="title" />
@@ -19,6 +19,8 @@ import { type SearchcraftState } from "../../store/index";
19
19
  * console.log('Facet selection updated');
20
20
  * });
21
21
  * ```
22
+ *
23
+ * @internal
22
24
  */
23
25
  export declare class SearchcraftFacetList {
24
26
  /**
@@ -2,11 +2,39 @@ import type { FilterItem } from '@searchcraft/core';
2
2
  /**
3
3
  * This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
4
4
  *
5
- * ## Usage
5
+ * @import
6
+ * ```jsx
7
+ * // react
8
+ * import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
9
+ *
10
+ * // vue
11
+ * import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
12
+ * ```
13
+ *
14
+ * @js-example
6
15
  * ```html
7
16
  * <!-- index.html -->
8
17
  * <searchcraft-filter-panel />
9
18
  * ```
19
+ *
20
+ * ```js
21
+ * // index.js
22
+ * const filterPanel = document.querySelector('searchcraft-filter-panel');
23
+ *
24
+ * if (filterPanel) {
25
+ * filterPanel.items = [];
26
+ * }
27
+ * ```
28
+ *
29
+ * @react-example
30
+ * ```jsx
31
+ * <SearchcraftFilterPanel items={[]} />
32
+ * ```
33
+ *
34
+ * @vue-example
35
+ * ```jsx
36
+ * <SearchcraftFilterPanel :items="[]" />
37
+ * ```
10
38
  */
11
39
  export declare class SearchcraftFilterPanel {
12
40
  /**
@@ -4,27 +4,39 @@ import type { SearchcraftCore } from '@searchcraft/core';
4
4
  * This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
5
5
  * It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
6
6
  *
7
- * ## Usage
7
+ * @import
8
+ * ```jsx
9
+ * // react
10
+ * import { SearchcraftInputForm } from "@searchcraft/react-sdk";
11
+ *
12
+ * // vue
13
+ * import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
14
+ * ```
15
+ *
16
+ * @js-example
8
17
  * ```html
9
- * <!-- index.html -->
10
- * <searchcraft-input-form placeholder-value="Search here" />
18
+ * <searchcraft-input-form auto-search />
11
19
  * ```
12
20
  *
13
- * ```js
14
- * // index.js
15
- * const searchInputForm = document.querySelector('searchcraft-input-form');
21
+ * @react-example
22
+ * ```jsx
23
+ * <SearchcraftInputForm autoSearch />
24
+ * ```
16
25
  *
26
+ * @vue-example
27
+ * ```jsx
28
+ * <SearchcraftInputForm autoSearch />
17
29
  * ```
18
30
  */
19
- export declare class SearchcraftInput {
31
+ export declare class SearchcraftInputForm {
20
32
  /**
21
33
  * Whether or not to automatically submit the search term when the input changes.
22
34
  */
23
- autoSearch: boolean;
35
+ autoSearch?: boolean;
24
36
  /**
25
37
  * Where to place the search button.
26
38
  */
27
- buttonPlacement: 'left' | 'right' | 'none';
39
+ buttonPlacement?: 'left' | 'right' | 'none';
28
40
  /**
29
41
  * The label for the submit button.
30
42
  */
@@ -33,14 +45,10 @@ export declare class SearchcraftInput {
33
45
  * The label rendered above the input.
34
46
  */
35
47
  inputLabel?: string;
36
- /**
37
- * A custom styles object to be applied to the input element.
38
- */
39
- customStyles: string | Record<string, string>;
40
48
  /**
41
49
  * The input element's placeholder value.
42
50
  */
43
- placeholderValue: string;
51
+ placeholderValue?: string;
44
52
  /**
45
53
  * When the input becomes focused.
46
54
  */
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * This web component serves as the input label for the searchcraft-input-form component.
3
3
  *
4
- * ## Usage
4
+ * @js-example
5
5
  * ```html
6
- * <!-- index.html -->
7
6
  * <searchcraft-input-label label="Search" />
8
7
  * ```
8
+ *
9
+ * @internal
9
10
  */
10
11
  export declare class SearchcraftInputLabel {
11
12
  /**
@@ -1,18 +1,31 @@
1
1
  /**
2
- * This web component is designed to facilitate pagination of search results.
3
- * Once a query is submitted, calculates the number for pages.
2
+ * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
4
3
  *
5
- * ## Usage
4
+ * @import
5
+ * ```jsx
6
+ * // react
7
+ * import { SearchcraftPagination } from "@searchcraft/react-sdk";
8
+ *
9
+ * // vue
10
+ * import { SearchcraftPagination } from "@searchcraft/vue-sdk";
11
+ * ```
12
+ *
13
+ * @js-example
6
14
  * ```html
7
- * <!-- index.html -->
8
15
  * <searchcraft-pagination />
9
16
  * ```
17
+ *
18
+ * @react-example
19
+ * ```jsx
20
+ * <SearchcraftPagination />
21
+ * ```
22
+ *
23
+ * @vue-example
24
+ * ```jsx
25
+ * <SearchcraftPagination />
26
+ * ```
10
27
  */
11
28
  export declare class SearchcraftPagination {
12
- /**
13
- * The custom styles object.
14
- */
15
- customStyles?: string;
16
29
  searchTerm: any;
17
30
  searchResultsPerPage: any;
18
31
  searchResultsPage: any;
@@ -1,5 +1,35 @@
1
1
  /**
2
2
  * Renders a button which, when clicked, turns on popover visibility.
3
+ *
4
+ * @import
5
+ * ```jsx
6
+ * // react
7
+ * import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
8
+ *
9
+ * // vue
10
+ * import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
11
+ * ```
12
+ *
13
+ * @js-example
14
+ * ```html
15
+ * <searchcraft-popover-button>
16
+ * Open popover
17
+ * </searchcraft-popover-button>
18
+ * ```
19
+ *
20
+ * @react-example
21
+ * ```jsx
22
+ * <SearchcraftPopoverButton>
23
+ * Open popover
24
+ * </SearchcraftPopoverButton>
25
+ * ```
26
+ *
27
+ * @vue-example
28
+ * ```jsx
29
+ * <SearchcraftPopoverButton>
30
+ * Open popover
31
+ * </SearchcraftPopoverButton>
32
+ * ```
3
33
  */
4
34
  export declare class SearchcraftPopoverButton {
5
35
  handleOnClick(): void;
@@ -2,36 +2,47 @@ import type { SearchClientResponseItem, AdClientResponseItem, PopoverResultMappi
2
2
  /**
3
3
  * This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
4
4
  *
5
- * ## Usage
5
+ * @import
6
+ * ```jsx
7
+ * // react
8
+ * import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
9
+ *
10
+ * // vue
11
+ * import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
12
+ * ```
13
+ *
14
+ * @js-example
6
15
  * ```html
7
16
  * <!-- index.html -->
8
- * <searchcraft-popover-form type="fullscreen" />
17
+ * <searchcraft-popover-form type="inline" />
9
18
  * ```
10
19
  *
11
20
  * ```js
12
21
  * // index.js
13
22
  * const popoverForm = document.querySelector('searchcraft-popover-form');
14
23
  *
15
- * popoverForm.popoverResultMappings = {
16
- * containerHref: {
17
- * fieldNames: [
18
- * {
19
- * fieldName: 'canonical_link',
20
- * dataType: 'text',
21
- * },
22
- * ],
23
- * };
24
+ * popoverForm.popoverResultMappings = {};
25
+ * ```
26
+ *
27
+ * @react-example
28
+ * ```jsx
29
+ * <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
24
30
  * ```
31
+ *
32
+ * @vue-example
33
+ * ```jsx
34
+ * <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
35
+ * ```
36
+ *
25
37
  */
26
38
  export declare class SearchcraftPopoverForm {
27
39
  /**
28
40
  * The type of popover form to render.
29
- *
30
41
  * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.
31
42
  * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.
32
43
  * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
33
44
  */
34
- type: 'inline' | 'fullscreen' | 'modal';
45
+ type?: 'inline' | 'fullscreen' | 'modal';
35
46
  /**
36
47
  * Formats the content rendered for each result.
37
48
  */
@@ -39,11 +50,11 @@ export declare class SearchcraftPopoverForm {
39
50
  /**
40
51
  * The hotkey that activates the popover.
41
52
  */
42
- hotkey: string;
53
+ hotkey?: string;
43
54
  /**
44
55
  * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
45
56
  */
46
- hotkeyModifier: 'ctrl' | 'meta' | 'alt' | 'option';
57
+ hotkeyModifier?: 'ctrl' | 'meta' | 'alt' | 'option';
47
58
  isPopoverVisibleInState: boolean;
48
59
  unsubscribe: (() => void) | undefined;
49
60
  searchClientResponseItems: SearchClientResponseItem[];
@@ -1,6 +1,8 @@
1
1
  import type { SearchDocument, SearchClientResponseItem, PopoverResultMappings } from '@searchcraft/core';
2
2
  /**
3
3
  * A single list item rendered in a searchcraft-popover-list-view.
4
+ *
5
+ * @internal
4
6
  */
5
7
  export declare class SearchcraftPopoverListItem {
6
8
  item: SearchClientResponseItem | undefined;
@@ -4,11 +4,12 @@ import type { PopoverResultMappings } from '@searchcraft/core';
4
4
  * This web component is designed to display a list of results within a popover interface.
5
5
  * It is consumed within the `searchcraft-popover-form` component.
6
6
  *
7
- * ## Usage
7
+ * @js-example
8
8
  * ```html
9
- * <!-- index.html -->
10
9
  * <searchcraft-popover-list-view />
11
10
  * ```
11
+ *
12
+ * @internal
12
13
  */
13
14
  export declare class SearchcraftPopoverListView {
14
15
  /**
@@ -1,33 +1,59 @@
1
+ import type { ResultsInfoTemplate } from '@searchcraft/core';
1
2
  /**
2
3
  * This web component is designed to display the number of results returned from a search query.
3
4
  *
4
- * ## Usage
5
+ * @import
6
+ * ```jsx
7
+ * // react
8
+ * import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
9
+ *
10
+ * // vue
11
+ * import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
12
+ * ```
13
+ *
14
+ * @js-example
5
15
  * ```html
6
16
  * <!-- index.html -->
7
- * <script>
8
- * const resultsInfo = document.querySelector('searchcraft-results-info');
9
- * resultsInfo.customFormatter = (range, count, responseTime) =>
10
- * `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
11
- * </script>
12
- *
13
17
  * <searchcraft-results-info />
14
18
  * ```
19
+ *
20
+ * ```js
21
+ * // index.js
22
+ * const resultsInfo = document.querySelector('searchcraft-results-info');
23
+ *
24
+ * resultsInfo.template = (info, { html }) => html`
25
+ * ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
26
+ * `;
27
+ * ```
28
+ *
29
+ * @react-example
30
+ * ```jsx
31
+ * <SearchcraftResultsInfo
32
+ * template={(info, { html }) => html`
33
+ * ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
34
+ * `}
35
+ * />
36
+ *
37
+ * @vue-example
38
+ * ```jsx
39
+ * <SearchcraftResultsInfo
40
+ * :template={(info, { html }) => html`
41
+ * ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
42
+ * `}
43
+ * />
15
44
  */
16
45
  export declare class SearchcraftResultsInfo {
17
46
  /**
18
- * The custom formatter for the resulting string.
47
+ * A callback function responsible for rendering the results info.
19
48
  *
20
49
  * @example
21
50
  * ```ts
22
- * resultsInfo.customFormatter = (range, count, responseTime) =>
23
- * `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
51
+ * resultsInfo.template = html`
52
+ * ${range[0]}-${range[1]} of ${count} results in ${responseTime}ms
53
+ * `;
24
54
  * ```
25
55
  */
26
- customFormatter?: (range: [string, string], count: string, responseTime: string) => void;
27
- /**
28
- * The custom styles object.
29
- */
30
- customStyles?: string;
56
+ template?: ResultsInfoTemplate;
31
57
  searchTerm: any;
32
58
  searchResultsPage: any;
33
59
  searchResultsPerPage: any;
@@ -0,0 +1,25 @@
1
+ import type { SearchClientResponseItem, SearchResultTemplate, SearchResultTemplateData } from '@searchcraft/core';
2
+ /**
3
+ * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare class SearchcraftSearchResult {
8
+ item?: SearchClientResponseItem;
9
+ /**
10
+ * The index.
11
+ */
12
+ index: number;
13
+ /**
14
+ * The position in the document. Used with the "document_clicked" measure event.
15
+ */
16
+ documentPosition: number;
17
+ /**
18
+ * A callback function responsible for rendering a result.
19
+ */
20
+ template?: SearchResultTemplate<SearchResultTemplateData>;
21
+ templateHtml: string | undefined;
22
+ connectedCallback(): void;
23
+ render(): any;
24
+ }
25
+ //# sourceMappingURL=searchcraft-search-result.d.ts.map
@@ -0,0 +1,80 @@
1
+ import type { AdClientResponseItem, SearchClientResponseItem, SearchcraftConfig, SearchResultTemplate, SearchResultTemplateData } from '@searchcraft/core';
2
+ import { type SearchcraftState } from "../../store/index";
3
+ /**
4
+ * This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
5
+ *
6
+ *
7
+ * @import
8
+ * ```jsx
9
+ * // react
10
+ * import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
11
+ *
12
+ * // vue
13
+ * import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
14
+ * ```
15
+ *
16
+ * @js-example
17
+ * ```html
18
+ * <!-- index.html -->
19
+ * <searchcraft-search-results
20
+ * ad-interval="4"
21
+ * place-ad-at-start="true"
22
+ * />
23
+ * ```
24
+ *
25
+ * ```js
26
+ * // index.js
27
+ * const searchResults = document.querySelector('searchcraft-search-results');
28
+ *
29
+ * searchResults.template = (item, index, { html }) => html`
30
+ * <h2>${item.title}</h2>
31
+ * `;
32
+ * ```
33
+ *
34
+ * @react-example
35
+ * ```jsx
36
+ * <SearchcraftSearchResults
37
+ * adInterval={4}
38
+ * placeAdAtState={true}
39
+ * template={(item, index, { html }) => html`
40
+ * <h2>${item.title}</h2>
41
+ * `}
42
+ * />
43
+ * ```
44
+ *
45
+ * @vue-example
46
+ * ```jsx
47
+ * <SearchcraftSearchResults
48
+ * adInterval={4}
49
+ * placeAdAtState={true}
50
+ * :template={(item, index, { html }) => html`
51
+ * <h2>${item.title}</h2>
52
+ * `}
53
+ * />
54
+ * ```
55
+ */
56
+ export declare class SearchcraftSearchResults {
57
+ /**
58
+ * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
59
+ */
60
+ template?: SearchResultTemplate<SearchResultTemplateData>;
61
+ searchTerm: string;
62
+ searchClientResponseItems?: SearchClientResponseItem[];
63
+ adClientResponseItems: AdClientResponseItem[];
64
+ searchResultsPerPage: any;
65
+ searchResultsPage: any;
66
+ isSearchInProgress: boolean;
67
+ config?: SearchcraftConfig;
68
+ private unsubscribe;
69
+ componentDidLoad(): void;
70
+ disconnectedCallback(): void;
71
+ handleStateChange(state: SearchcraftState): void;
72
+ renderEmptyState(): any;
73
+ renderNoResultsFoundState(): any;
74
+ renderWithADMAds(): any;
75
+ renderWithCustomAds(): any;
76
+ renderWithNativoAds(): any;
77
+ renderWithNoAds(): any;
78
+ render(): any;
79
+ }
80
+ //# sourceMappingURL=searchcraft-search-results.d.ts.map
@@ -1,11 +1,30 @@
1
1
  /**
2
2
  * This web component is designed to choose the number of search results displayed.
3
3
  *
4
- * ## Usage
4
+ * @import
5
+ * ```jsx
6
+ * // react
7
+ * import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
8
+ *
9
+ * // vue
10
+ * import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
11
+ * ```
12
+ *
13
+ * @js-example
5
14
  * ```html
6
15
  * <!-- index.html -->
7
16
  * <searchcraft-search-results-per-page increment="20" />
8
17
  * ```
18
+ *
19
+ * @react-example
20
+ * ```jsx
21
+ * <SearchcraftSearchResultsPerPage increment={20} />
22
+ * ```
23
+ *
24
+ * @vue-example
25
+ * ```jsx
26
+ * <SearchcraftSearchResultsPerPage increment="20" />
27
+ * ```
9
28
  */
10
29
  export declare class SearchcraftSearchResultsPerPage {
11
30
  /**
@@ -13,10 +32,6 @@ export declare class SearchcraftSearchResultsPerPage {
13
32
  * The base value is defined by the `searchResultsPerPage` option in the configuration.
14
33
  */
15
34
  increment: string | number;
16
- /**
17
- * The custom styles object.
18
- */
19
- customStyles?: string;
20
35
  searchTerm: any;
21
36
  searchResultsPage: any;
22
37
  searchResultsPerPage: any;
@@ -7,7 +7,7 @@ export type SearchcraftSelectOption = {
7
7
  /**
8
8
  * This web component is designed to allow users to select between a group of options.
9
9
  *
10
- * ## Usage
10
+ * @js-example
11
11
  * ```html
12
12
  * <!-- index.html -->
13
13
  * <searchcraft-select
@@ -16,6 +16,8 @@ export type SearchcraftSelectOption = {
16
16
  * options="[{ label: 'label', value: 'value' }]"
17
17
  * />
18
18
  * ```
19
+ *
20
+ * @internal
19
21
  */
20
22
  export declare class SearchcraftSelect {
21
23
  /**
@@ -46,10 +48,6 @@ export declare class SearchcraftSelect {
46
48
  * The options for the select input.
47
49
  */
48
50
  options: SearchcraftSelectOption[] | string;
49
- /**
50
- * A custom styles object.
51
- */
52
- customStyles?: string;
53
51
  /**
54
52
  * The event fired when the select is changed.
55
53
  */
@@ -1,8 +1,8 @@
1
1
  import { type EventEmitter } from '../../stencil-public-runtime';
2
2
  /**
3
- * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
4
- * The component renders a slider interface, which can be used to visually choose a value between two boundaries.
5
- * It is consumed by the `searchcraft-filter-panel` component.
3
+ * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
4
+ *
5
+ * @internal
6
6
  */
7
7
  export declare class SearchcraftSlider {
8
8
  /**