@ecomid/modules 0.1.0 → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 eComID AB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ecomid/modules
2
2
 
3
- React components for ecomid.
3
+ Components and a framework-free search client for ecomid.
4
4
 
5
5
  ## Install
6
6
 
@@ -10,6 +10,8 @@ npm install @ecomid/modules
10
10
 
11
11
  The `react` entry point requires `react` and `react-dom` 18 or newer. The `search` entry point works without React.
12
12
 
13
+ The eComID loader script must be on the page for the React components too. Personalize and sign-in, signed-in search and usage events all depend on it; without it the components render and search as a guest, but those features do nothing.
14
+
13
15
  ## Entry points
14
16
 
15
17
  | Import | Contents |
@@ -180,7 +182,7 @@ export default function Search({ params, initialResults }) {
180
182
  | `onPageChange` | `(params: URLSearchParams) => void` | Called with the params of each new page the shopper reaches: a new search, a refine, a filter or sort change, a removed term. Not called for a `page` you passed in |
181
183
  | `initialResults` | `SearchResultsData \| null` | Results fetched on the server. Only used when `results.query`, `results.lang`, `results.market`, `results.limit` and `results.page` match the trimmed `query` (or the `page`'s terms), the component's locale, `limit` and `page`, in which case the client request is skipped. Results that don't match are ignored, the client fetches instead, and a mismatch in the results that seed a new instance is reported once per instance |
182
184
  | `limit` | `number` | Products per page. Defaults to 24 on the client. Use the same value as the server fetch |
183
- | `headingLevel` | `1 \| 2 \| 3 \| 4 \| 5` | Heading level of the results title. Section headings are one level below. Defaults to `1` |
185
+ | `headingLevel` | `1 \| 2 \| 3 \| 4 \| 5` | Heading level of the results title. Section headings are one level below it; without a title they use this level. Defaults to `1` |
184
186
  | `clientId` | `string` | Overrides the provider |
185
187
  | `locale` | `string` | Overrides the provider |
186
188
  | `environment` | `'production' \| 'staging' \| 'sandbox'` | Overrides the provider |