@vue-storefront/next 4.3.0 → 4.3.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/dist/client.d.mts +19 -2
- package/dist/client.d.ts +19 -2
- package/package.json +4 -3
package/dist/client.d.mts
CHANGED
|
@@ -11,16 +11,33 @@ import 'react';
|
|
|
11
11
|
* Create a new Alokai context somewhere in your application. It may be the `hooks/sdk.ts` file.
|
|
12
12
|
*
|
|
13
13
|
* ```tsx
|
|
14
|
+
* 'use client';
|
|
15
|
+
*
|
|
14
16
|
* import { createAlokaiContext } from "@vue-storefront/next/client";
|
|
15
17
|
* import type { Sdk } from './sdk.server';
|
|
18
|
+
* import type { SfContract } from 'storefront-middleware/types';
|
|
16
19
|
*
|
|
17
|
-
* export const
|
|
20
|
+
* export const {
|
|
21
|
+
* AlokaiProvider,
|
|
22
|
+
* useSdk,
|
|
23
|
+
* useSfCartState,
|
|
24
|
+
* useSfCurrenciesState,
|
|
25
|
+
* useSfCurrencyState,
|
|
26
|
+
* useSfCustomerState,
|
|
27
|
+
* } = createAlokaiContext<Sdk, SfContract>();
|
|
18
28
|
* ```
|
|
29
|
+
* This is also a place where you can import hooks for handling the state management.
|
|
30
|
+
* You can read more about the state management in the documentation https://docs.alokai.com/sdk/getting-started/state-management.
|
|
19
31
|
* Then use the `AlokaiProvider` in the root component of your application.
|
|
20
32
|
* For Pages Router it would be the `pages/_app.tsx` file,
|
|
21
33
|
* and for the App Router it would be the `app/layout.tsx` file.
|
|
22
34
|
* Finally, you can use the `useSdk` in any client component of your application.
|
|
23
|
-
* @returns
|
|
35
|
+
* @returns AlokaiProvider - The Alokai Context Provider.
|
|
36
|
+
* @returns useSdk - The SDK provider and the `useSdk` hook.
|
|
37
|
+
* @returns useSfCartState - Hook that return Cart state with `SfCart` type.
|
|
38
|
+
* @returns useSfCurrenciesState - Hook that return Currencies state with `SfCurrency` type.
|
|
39
|
+
* @returns useSfCurrencyState - Hook that return Currency state with `SfCurrency[]` type.
|
|
40
|
+
* @returns useSfCustomerState - Hook that return Customer state with `SfCustomer` type.
|
|
24
41
|
*/
|
|
25
42
|
declare function createAlokaiContext<TSdk extends SDKApi<any>, TSfContract extends SfContract>(): CreateSdkContextReturn<TSdk, TSfContract>;
|
|
26
43
|
|
package/dist/client.d.ts
CHANGED
|
@@ -11,16 +11,33 @@ import 'react';
|
|
|
11
11
|
* Create a new Alokai context somewhere in your application. It may be the `hooks/sdk.ts` file.
|
|
12
12
|
*
|
|
13
13
|
* ```tsx
|
|
14
|
+
* 'use client';
|
|
15
|
+
*
|
|
14
16
|
* import { createAlokaiContext } from "@vue-storefront/next/client";
|
|
15
17
|
* import type { Sdk } from './sdk.server';
|
|
18
|
+
* import type { SfContract } from 'storefront-middleware/types';
|
|
16
19
|
*
|
|
17
|
-
* export const
|
|
20
|
+
* export const {
|
|
21
|
+
* AlokaiProvider,
|
|
22
|
+
* useSdk,
|
|
23
|
+
* useSfCartState,
|
|
24
|
+
* useSfCurrenciesState,
|
|
25
|
+
* useSfCurrencyState,
|
|
26
|
+
* useSfCustomerState,
|
|
27
|
+
* } = createAlokaiContext<Sdk, SfContract>();
|
|
18
28
|
* ```
|
|
29
|
+
* This is also a place where you can import hooks for handling the state management.
|
|
30
|
+
* You can read more about the state management in the documentation https://docs.alokai.com/sdk/getting-started/state-management.
|
|
19
31
|
* Then use the `AlokaiProvider` in the root component of your application.
|
|
20
32
|
* For Pages Router it would be the `pages/_app.tsx` file,
|
|
21
33
|
* and for the App Router it would be the `app/layout.tsx` file.
|
|
22
34
|
* Finally, you can use the `useSdk` in any client component of your application.
|
|
23
|
-
* @returns
|
|
35
|
+
* @returns AlokaiProvider - The Alokai Context Provider.
|
|
36
|
+
* @returns useSdk - The SDK provider and the `useSdk` hook.
|
|
37
|
+
* @returns useSfCartState - Hook that return Cart state with `SfCart` type.
|
|
38
|
+
* @returns useSfCurrenciesState - Hook that return Currencies state with `SfCurrency` type.
|
|
39
|
+
* @returns useSfCurrencyState - Hook that return Currency state with `SfCurrency[]` type.
|
|
40
|
+
* @returns useSfCustomerState - Hook that return Customer state with `SfCustomer` type.
|
|
24
41
|
*/
|
|
25
42
|
declare function createAlokaiContext<TSdk extends SDKApi<any>, TSfContract extends SfContract>(): CreateSdkContextReturn<TSdk, TSfContract>;
|
|
26
43
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@vue-storefront/next",
|
|
3
3
|
"description": "Alokai dedicated features for Next.js",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "4.3.
|
|
5
|
+
"version": "4.3.1",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"import": "./dist/index.mjs",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"build": "tsup",
|
|
23
23
|
"lint": "biome ci .",
|
|
24
24
|
"format": "prettier --write .",
|
|
25
|
-
"test:unit": "vitest run"
|
|
25
|
+
"test:unit": "vitest run",
|
|
26
|
+
"version": "cp CHANGELOG.md ../../docs/content/storefront/6.change-log/next.md"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"zustand": "^4.5.4",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"react-dom": "18.3.0",
|
|
36
37
|
"start-server-and-test": "^2.0.3",
|
|
37
38
|
"tsup": "8.3.0",
|
|
38
|
-
"vitest": "2.
|
|
39
|
+
"vitest": "2.1.5",
|
|
39
40
|
"react": "18.3.1",
|
|
40
41
|
"next": "14.2.5"
|
|
41
42
|
},
|