@nosto/search-js 1.7.5 → 1.8.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,36 @@
1
+ import { ComponentChildren } from 'preact';
2
+ /**
3
+ * @group Components
4
+ */
5
+ export type AutocompleteElementProps = {
6
+ /**
7
+ * Rendered content.
8
+ */
9
+ children: ComponentChildren;
10
+ /**
11
+ * Get product data for analytics
12
+ */
13
+ hit: {
14
+ productId: string;
15
+ url?: string;
16
+ keyword?: string;
17
+ };
18
+ };
19
+ /**
20
+ * Wraps elements to interactive component that handles selection based on provided configuration.
21
+ *
22
+ * @example
23
+ * ```jsx
24
+ * // Render product
25
+ * {products?.hits?.map(hit => <AutocompleteElement hit={hit}>
26
+ * <a href={hit.url} class="nosto-product">
27
+ * <img src={hit.imageUrl} alt={hit.name} />
28
+ * <span>{hit.name}</span>
29
+ * <span>{hit.price}</span>
30
+ * </a>
31
+ * </AutocompleteElement>)}
32
+ * ```
33
+ *
34
+ * @group Components
35
+ */
36
+ export declare function AutocompleteElement({ children, hit }: AutocompleteElementProps): import('preact').VNode<any>;
@@ -0,0 +1,5 @@
1
+ import { ComponentChildren, JSX } from 'preact';
2
+ /**
3
+ * Check if the provided children is a valid HTML element (div/anchor/etc).
4
+ */
5
+ export declare function isValidHTMLElement(children: ComponentChildren): children is JSX.Element;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../InfiniteScrollWithObserver-DbErxedF.cjs");exports.InfiniteScrollWithObserver=e.InfiniteScrollWithObserver;exports.getNextPageQuery=e.getNextPageQuery;exports.intersectionObserverSupported=e.intersectionObserverSupported;
@@ -0,0 +1,4 @@
1
+ /** @module preact-legacy */
2
+ export { InfiniteScrollWithObserver } from '../preact/src/components/InfiniteScroll/InfiniteScrollWithObserver';
3
+ export { intersectionObserverSupported } from '../preact/src/components/InfiniteScroll/utils';
4
+ export { getNextPageQuery } from '../preact/src/hooks/useLoadMore/getNextPageQuery';
@@ -0,0 +1,6 @@
1
+ import { I as t, g as i, i as s } from "../InfiniteScrollWithObserver-kuSGeBWr.js";
2
+ export {
3
+ t as InfiniteScrollWithObserver,
4
+ i as getNextPageQuery,
5
+ s as intersectionObserverSupported
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosto/search-js",
3
- "version": "1.7.5",
3
+ "version": "1.8.0",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "files": [
@@ -37,6 +37,11 @@
37
37
  "import": "./dist/preact/preact.es.js",
38
38
  "require": "./dist/preact/preact.cjs.js"
39
39
  },
40
+ "./preact-legacy": {
41
+ "types": "./dist/preact-legacy/preact-legacy.d.ts",
42
+ "import": "./dist/preact-legacy/preact-legacy.es.js",
43
+ "require": "./dist/preact-legacy/preact-legacy.cjs.js"
44
+ },
40
45
  "./utils": {
41
46
  "types": "./dist/utils/utils.d.ts",
42
47
  "import": "./dist/utils/utils.es.js",
@@ -55,30 +60,32 @@
55
60
  "test:watch": "vitest",
56
61
  "lint": "eslint",
57
62
  "lint-fix": "eslint --fix",
58
- "install:dev": "(cd dev/preact && npm i --ignore-scripts)"
63
+ "install:dev": "(cd dev/preact && npm i --ignore-scripts)",
64
+ "prepare": "husky"
59
65
  },
60
66
  "devDependencies": {
61
67
  "@nosto/nosto-js": "^1.7.0",
62
68
  "@testing-library/dom": "^10.4.0",
63
69
  "@types/eslint-config-prettier": "^6.11.3",
64
- "@types/node": "^22.13.14",
70
+ "@types/node": "^22.14.0",
65
71
  "concurrently": "^9.1.2",
66
72
  "copyfiles": "^2.4.1",
67
- "eslint": "^9.23.0",
73
+ "eslint": "^9.24.0",
68
74
  "eslint-config-prettier": "^10.1.1",
69
75
  "eslint-plugin-barrel-files": "^3.0.1",
70
- "eslint-plugin-prettier": "^5.2.5",
71
- "eslint-plugin-react": "^7.37.4",
76
+ "eslint-plugin-prettier": "^5.2.6",
77
+ "eslint-plugin-react": "^7.37.5",
72
78
  "eslint-plugin-react-hooks": "^5.2.0",
73
79
  "eslint-plugin-simple-import-sort": "^12.1.1",
74
80
  "eslint-plugin-unused-imports": "^4.1.4",
81
+ "husky": "^9.1.7",
75
82
  "isbot": "^5.1.25",
76
83
  "jsdom": "^26.0.0",
77
84
  "prettier": "^3.5.3",
78
85
  "typedoc": "^0.27.9",
79
- "typescript": "^5.8.2",
80
- "typescript-eslint": "^8.28.0",
81
- "vite": "^6.2.4",
86
+ "typescript": "^5.8.3",
87
+ "typescript-eslint": "^8.29.1",
88
+ "vite": "^6.2.5",
82
89
  "vite-plugin-dts": "^4.5.3",
83
90
  "vitest": "^3.1.1"
84
91
  },