@scayle/storefront-nuxt 7.72.2 → 7.72.4
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/CHANGELOG.md +13 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/composables/core/useAvailableShops.d.ts +1 -1
- package/dist/runtime/composables/core/useAvailableShops.mjs +2 -2
- package/dist/runtime/composables/core/useFormatHelpers.d.ts +1 -1
- package/dist/runtime/composables/core/useFormatHelpers.mjs +1 -1
- package/dist/runtime/composables/core/useIDP.d.ts +1 -1
- package/dist/runtime/composables/core/useIDP.mjs +2 -2
- package/dist/runtime/composables/core/useRpc.d.ts +2 -1
- package/dist/runtime/composables/core/useRpc.mjs +2 -2
- package/dist/runtime/composables/storefront/useQueryFilterState.d.ts +2 -2
- package/dist/runtime/composables/storefront/useQueryFilterState.mjs +2 -2
- package/dist/runtime/composables/storefront/useSearch.d.ts +1 -1
- package/dist/runtime/composables/storefront/useSearch.mjs +2 -2
- package/dist/runtime/composables/storefront/useStorefrontSearch.d.ts +2 -1
- package/dist/runtime/composables/storefront/useStorefrontSearch.mjs +2 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.72.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @scayle/storefront-core@7.52.1
|
|
9
|
+
|
|
10
|
+
## 7.72.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Refactored composables to consistently use named exports rather than default exports and to use named functions instead of arrow functions
|
|
15
|
+
|
|
3
16
|
## 7.72.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PublicShopConfig } from '../../../module';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function useAvailableShops(): import("vue").Ref<PublicShopConfig[]>;
|
|
@@ -8,7 +8,7 @@ type FormatCurrencyOptions = {
|
|
|
8
8
|
currencyFractionDigits?: number;
|
|
9
9
|
style: 'decimal';
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export declare function useFormatHelpers(): {
|
|
12
12
|
formatCurrency: (value: number, options?: FormatCurrencyOptions) => string;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getDefaultFractionDigits } from "@scayle/storefront-core";
|
|
2
2
|
import { useCurrentShop } from "./useCurrentShop.mjs";
|
|
3
|
-
export
|
|
3
|
+
export function useFormatHelpers() {
|
|
4
4
|
const currentShop = useCurrentShop();
|
|
5
5
|
const formatCurrency = (value, options) => {
|
|
6
6
|
const locale = options?.locale ?? currentShop.value.locale;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
3
|
-
export declare
|
|
3
|
+
export declare function useIDP(params?: MaybeRefOrGetter<RpcMethodParameters<'getExternalIdpRedirect'>>): Promise<{
|
|
4
4
|
data: import("vue").Ref<{
|
|
5
5
|
[k: string]: string;
|
|
6
6
|
} | undefined>;
|
|
@@ -3,7 +3,7 @@ import { useRpc } from "../core/useRpc.mjs";
|
|
|
3
3
|
import { rpcCall } from "./../../rpc/rpcCall.mjs";
|
|
4
4
|
import { useCurrentShop } from "./useCurrentShop.mjs";
|
|
5
5
|
import { toValue } from "#imports";
|
|
6
|
-
export
|
|
6
|
+
export async function useIDP(params = {}) {
|
|
7
7
|
const nuxtApp = useNuxtApp();
|
|
8
8
|
const shop = useCurrentShop();
|
|
9
9
|
const { data, fetching, fetch, error, status } = await useRpc(
|
|
@@ -25,4 +25,4 @@ export const useIDP = async (params = {}) => {
|
|
|
25
25
|
// TODO: Deprecate the property here and remove it with the next major release
|
|
26
26
|
handleIDPLoginCallback
|
|
27
27
|
};
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
|
|
2
2
|
import type { AsyncDataOptions, NuxtError } from 'nuxt/app';
|
|
3
|
+
import { type MaybeRefOrGetter } from '#imports';
|
|
3
4
|
type KeysOf<T> = Array<T extends T ? (keyof T extends string ? keyof T : never) : never>;
|
|
4
5
|
export type RpcAsyncDataOptions<TResult> = AsyncDataOptions<TResult, TResult, KeysOf<TResult>, TResult>;
|
|
5
6
|
export interface RpcOptions {
|
|
@@ -7,7 +8,7 @@ export interface RpcOptions {
|
|
|
7
8
|
lazy?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export type Status = 'idle' | 'pending' | 'success' | 'error';
|
|
10
|
-
export declare
|
|
11
|
+
export declare function useRpc<N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>, TParams = P extends RpcContext ? undefined : P>(method: N, key: string, params?: MaybeRefOrGetter<TParams>, options?: RpcOptions): Promise<{
|
|
11
12
|
data: import("vue").Ref<TResult | undefined>;
|
|
12
13
|
fetching: import("vue").Ref<boolean>;
|
|
13
14
|
fetch: () => Promise<void>;
|
|
@@ -15,7 +15,7 @@ const handleError = (error) => {
|
|
|
15
15
|
const data = resolveError(error);
|
|
16
16
|
return createError(data);
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export async function useRpc(method, key, params, options = { autoFetch: true, lazy: false }) {
|
|
19
19
|
const currentShop = useCurrentShop();
|
|
20
20
|
const log = useCoreLog("rpc");
|
|
21
21
|
const nuxtApp = useNuxtApp();
|
|
@@ -73,4 +73,4 @@ export const useRpc = async (method, key, params, options = { autoFetch: true, l
|
|
|
73
73
|
error,
|
|
74
74
|
status
|
|
75
75
|
};
|
|
76
|
-
}
|
|
76
|
+
}
|
|
@@ -2,11 +2,11 @@ import type { FilterParams, SortingValueKey, TransformedFilter, Filter } from '@
|
|
|
2
2
|
type Options = {
|
|
3
3
|
defaultSort?: SortingValueKey;
|
|
4
4
|
};
|
|
5
|
-
declare
|
|
5
|
+
export declare function useQueryFilterState(options?: Options): {
|
|
6
6
|
activeFilters: import("vue").ComputedRef<Filter>;
|
|
7
7
|
applyFilters: (filter?: Filter, scrollToTop?: boolean) => Promise<void>;
|
|
8
8
|
isActiveFilter: (filter?: TransformedFilter) => any;
|
|
9
9
|
resetFilterUrl: () => Promise<void>;
|
|
10
10
|
productConditions: import("vue").ComputedRef<FilterParams>;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export {};
|
|
@@ -10,7 +10,7 @@ import { computed } from "vue";
|
|
|
10
10
|
import { getCurrentPage } from "../../utils/route.mjs";
|
|
11
11
|
import { useRoute, useRouter } from "#imports";
|
|
12
12
|
const DEFAULT_QUERY_KEYS = ["page", "sort", "term"];
|
|
13
|
-
export
|
|
13
|
+
export function useQueryFilterState(options = {}) {
|
|
14
14
|
const router = useRouter();
|
|
15
15
|
const route = useRoute();
|
|
16
16
|
const activeFilters = computed(() => {
|
|
@@ -63,4 +63,4 @@ export default (options = {}) => {
|
|
|
63
63
|
resetFilterUrl,
|
|
64
64
|
productConditions: computed(() => generateFilterParams())
|
|
65
65
|
};
|
|
66
|
-
}
|
|
66
|
+
}
|
|
@@ -4,7 +4,7 @@ type Options = Partial<{
|
|
|
4
4
|
key: string;
|
|
5
5
|
}>;
|
|
6
6
|
/** @deprecated `useSearch` is deprecated. Please, use `useSearchSuggestions` or `useSearchResolve` */
|
|
7
|
-
export declare
|
|
7
|
+
export declare function useSearch({ params, key }?: Options): {
|
|
8
8
|
data: import("vue").Ref<TypeaheadSuggestionsEndpointResponseData | undefined>;
|
|
9
9
|
pending: import("vue").Ref<boolean>;
|
|
10
10
|
searchQuery: import("vue").Ref<string>;
|
|
@@ -2,7 +2,7 @@ import { useState } from "nuxt/app";
|
|
|
2
2
|
import { rpcCall } from "../../rpc/rpcCall.mjs";
|
|
3
3
|
import { useCurrentShop } from "../core/useCurrentShop.mjs";
|
|
4
4
|
import { useNuxtApp, toValue } from "#imports";
|
|
5
|
-
export
|
|
5
|
+
export function useSearch({ params, key = "search" } = {}) {
|
|
6
6
|
const data = useState(
|
|
7
7
|
`${key}-data`,
|
|
8
8
|
() => void 0
|
|
@@ -48,4 +48,4 @@ export const useSearch = ({ params, key = "search" } = {}) => {
|
|
|
48
48
|
resetSearch,
|
|
49
49
|
search
|
|
50
50
|
};
|
|
51
|
-
}
|
|
51
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type SearchV2SuggestionsEndpointResponseData, type SearchV2With } from '@scayle/storefront-core';
|
|
2
|
+
import { type Ref } from '#imports';
|
|
2
3
|
export type SearchOptions = Partial<{
|
|
3
4
|
params: Partial<{
|
|
4
5
|
categoryId: number;
|
|
@@ -6,7 +7,7 @@ export type SearchOptions = Partial<{
|
|
|
6
7
|
}>;
|
|
7
8
|
key: string;
|
|
8
9
|
}>;
|
|
9
|
-
export declare
|
|
10
|
+
export declare function useStorefrontSearch(searchQuery: Ref<string>, { params, key }?: SearchOptions): {
|
|
10
11
|
data: import("vue").Ref<SearchV2SuggestionsEndpointResponseData | undefined>;
|
|
11
12
|
pending: import("vue").Ref<boolean>;
|
|
12
13
|
resetSearch: () => void;
|
|
@@ -2,7 +2,7 @@ import { useState } from "nuxt/app";
|
|
|
2
2
|
import { rpcCall } from "../../rpc/rpcCall.mjs";
|
|
3
3
|
import { useCurrentShop } from "../core/useCurrentShop.mjs";
|
|
4
4
|
import { useNuxtApp, toValue } from "#imports";
|
|
5
|
-
export
|
|
5
|
+
export function useStorefrontSearch(searchQuery, { params, key = "search" } = {}) {
|
|
6
6
|
const data = useState(
|
|
7
7
|
`${key}-data`,
|
|
8
8
|
() => void 0
|
|
@@ -61,4 +61,4 @@ export const useStorefrontSearch = (searchQuery, { params, key = "search" } = {}
|
|
|
61
61
|
getSearchSuggestions,
|
|
62
62
|
resolveSearch
|
|
63
63
|
};
|
|
64
|
-
}
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.72.
|
|
4
|
+
"version": "7.72.4",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@nuxt/kit": "3.11.1",
|
|
61
61
|
"@opentelemetry/api": "1.8.0",
|
|
62
62
|
"@scayle/h3-session": "0.4.0",
|
|
63
|
-
"@scayle/storefront-core": "7.52.
|
|
63
|
+
"@scayle/storefront-core": "7.52.1",
|
|
64
64
|
"@scayle/unstorage-compression-driver": "0.1.3",
|
|
65
|
-
"@vueuse/core": "10.
|
|
65
|
+
"@vueuse/core": "10.10.0",
|
|
66
66
|
"consola": "3.2.3",
|
|
67
67
|
"core-js": "3.37.1",
|
|
68
68
|
"defu": "6.1.4",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"@nuxt/test-utils": "3.13.1",
|
|
85
85
|
"@scayle/eslint-config-storefront": "4.2.0",
|
|
86
86
|
"@scayle/eslint-plugin-vue-composable": "0.2.0",
|
|
87
|
-
"@types/node": "20.
|
|
88
|
-
"dprint": "0.
|
|
89
|
-
"eslint": "9.
|
|
87
|
+
"@types/node": "20.14.0",
|
|
88
|
+
"dprint": "0.46.1",
|
|
89
|
+
"eslint": "9.4.0",
|
|
90
90
|
"eslint-formatter-gitlab": "5.1.0",
|
|
91
91
|
"fishery": "2.2.2",
|
|
92
92
|
"h3": "1.11.1",
|
|
@@ -110,6 +110,6 @@
|
|
|
110
110
|
"@nuxt/schema": "3.11.1"
|
|
111
111
|
},
|
|
112
112
|
"volta": {
|
|
113
|
-
"node": "20.
|
|
113
|
+
"node": "20.14.0"
|
|
114
114
|
}
|
|
115
115
|
}
|