@shopware/composables 1.7.0 → 1.8.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/README.md +4 -8
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +8 -8
- package/src/cms/useCmsElementImage.ts +1 -1
- package/src/index.test.ts +1 -1
- package/src/index.ts +1 -1
- package/src/types/index.ts +0 -7
- package/src/useBreadcrumbs/useBreadcrumbs.test.ts +4 -4
- package/src/useBreadcrumbs/useBreadcrumbs.ts +1 -1
- package/src/useCartItem/useCartItem.ts +1 -1
- package/src/useCmsMeta/useCmsMeta.ts +1 -1
- package/src/useInternationalization/useInternationalization.ts +1 -1
- package/src/useListing/useListing.ts +1 -1
- package/src/useProductConfigurator/useProductConfigurator.ts +1 -1
- package/src/useProductPrice/useProductPrice.ts +2 -2
- package/src/useUrlResolver/useUrlResolver.test.ts +2 -2
- package/src/useUrlResolver/useUrlResolver.ts +1 -1
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ All composable functions are fully typed with TypeScript and they are registed g
|
|
|
157
157
|
|
|
158
158
|
- [📘 Documentation](https://frontends.shopware.com)
|
|
159
159
|
|
|
160
|
-
- [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends`
|
|
160
|
+
- [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends`)
|
|
161
161
|
|
|
162
162
|
<!-- AUTO GENERATED CHANGELOG -->
|
|
163
163
|
|
|
@@ -165,13 +165,9 @@ All composable functions are fully typed with TypeScript and they are registed g
|
|
|
165
165
|
|
|
166
166
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/composables/CHANGELOG.md)
|
|
167
167
|
|
|
168
|
-
### Latest changes: 1.
|
|
169
|
-
|
|
170
|
-
### Minor Changes
|
|
171
|
-
|
|
172
|
-
- [#1596](https://github.com/shopware/frontends/pull/1596) [`3a79106`](https://github.com/shopware/frontends/commit/3a791065d04152255095965e3fb12ea538a22639) Thanks [@patzick](https://github.com/patzick)! - Changed `@shopware-pwa/composables` package to `@shopware/composables`. Just rename it in package.json file and run install.
|
|
168
|
+
### Latest changes: 1.8.1
|
|
173
169
|
|
|
174
170
|
### Patch Changes
|
|
175
171
|
|
|
176
|
-
- Updated dependencies [[`
|
|
177
|
-
- @shopware
|
|
172
|
+
- Updated dependencies [[`7324620`](https://github.com/shopware/frontends/commit/7324620a3f39c1b62f7cc294192a3e8b8b336d09)]:
|
|
173
|
+
- @shopware/api-client@1.2.1
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
|
|
3
3
|
import { createAPIClient, ApiError } from '@shopware/api-client';
|
|
4
4
|
import { operations as operations$1, components } from '@shopware/api-client/store-api-types';
|
|
5
|
-
import { getListingFilters, TierPrice } from '@shopware
|
|
5
|
+
import { getListingFilters, TierPrice } from '@shopware/helpers';
|
|
6
6
|
|
|
7
7
|
type operations = operations$1;
|
|
8
8
|
type Schemas = components["schemas"];
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
|
|
3
3
|
import { createAPIClient, ApiError } from '@shopware/api-client';
|
|
4
4
|
import { operations as operations$1, components } from '@shopware/api-client/store-api-types';
|
|
5
|
-
import { getListingFilters, TierPrice } from '@shopware
|
|
5
|
+
import { getListingFilters, TierPrice } from '@shopware/helpers';
|
|
6
6
|
|
|
7
7
|
type operations = operations$1;
|
|
8
8
|
type Schemas = components["schemas"];
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pascalCase } from 'scule';
|
|
2
2
|
import { computed, effectScope, reactive, markRaw, inject, ref, provide, unref, onMounted, watch, resolveComponent } from 'vue';
|
|
3
|
-
import { urlIsAbsolute, relativeUrlSlash, getSrcSetForMedia, getMainImageUrl, getTranslatedProperty, getListingFilters, getProductTierPrices, buildUrlPrefix } from '@shopware
|
|
3
|
+
import { urlIsAbsolute, relativeUrlSlash, getSrcSetForMedia, getMainImageUrl, getTranslatedProperty, getListingFilters, getProductTierPrices, buildUrlPrefix } from '@shopware/helpers';
|
|
4
4
|
import { ApiClientError } from '@shopware/api-client';
|
|
5
5
|
import { createSharedComposable, injectLocal, provideLocal, createInjectionState, syncRefs } from '@vueuse/core';
|
|
6
6
|
import { defu } from 'defu';
|
|
@@ -230,7 +230,7 @@ function useBreadcrumbs(newBreadcrumbs) {
|
|
|
230
230
|
_breadcrumbs.value = [breadcrumb];
|
|
231
231
|
};
|
|
232
232
|
const buildDynamicBreadcrumbs = async (breadcrumbs) => {
|
|
233
|
-
_breadcrumbs.value = breadcrumbs.
|
|
233
|
+
_breadcrumbs.value = breadcrumbs.map((breadcrumb) => {
|
|
234
234
|
return {
|
|
235
235
|
...breadcrumb,
|
|
236
236
|
path: `/${breadcrumb.path}`
|
|
@@ -2678,7 +2678,7 @@ function resolveCmsComponent(content) {
|
|
|
2678
2678
|
}
|
|
2679
2679
|
function getDefaultApiParams() {
|
|
2680
2680
|
console.error(
|
|
2681
|
-
"[@shopware
|
|
2681
|
+
"[@shopware/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release."
|
|
2682
2682
|
);
|
|
2683
2683
|
return {};
|
|
2684
2684
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopware/composables",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Shopware Frontends composables for Vue",
|
|
5
5
|
"author": "Shopware",
|
|
6
6
|
"repository": {
|
|
@@ -51,21 +51,21 @@
|
|
|
51
51
|
"types"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vueuse/core": "
|
|
54
|
+
"@vueuse/core": "12.5.0",
|
|
55
55
|
"defu": "6.1.4",
|
|
56
56
|
"scule": "1.3.0",
|
|
57
|
-
"@shopware/
|
|
58
|
-
"@shopware
|
|
57
|
+
"@shopware/helpers": "1.4.0",
|
|
58
|
+
"@shopware/api-client": "1.2.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@biomejs/biome": "1.8.3",
|
|
62
|
-
"@nuxt/kit": "3.
|
|
63
|
-
"@vitest/coverage-v8": "
|
|
62
|
+
"@nuxt/kit": "3.15.4",
|
|
63
|
+
"@vitest/coverage-v8": "3.0.5",
|
|
64
64
|
"@vue/test-utils": "2.4.6",
|
|
65
|
-
"happy-dom": "
|
|
65
|
+
"happy-dom": "17.1.0",
|
|
66
66
|
"typescript": "5.6.3",
|
|
67
67
|
"unbuild": "2.0.0",
|
|
68
|
-
"vitest": "
|
|
68
|
+
"vitest": "3.0.5",
|
|
69
69
|
"vue": "3.5.13",
|
|
70
70
|
"tsconfig": "0.0.0"
|
|
71
71
|
},
|
package/src/index.test.ts
CHANGED
|
@@ -21,7 +21,7 @@ describe("resolveCmsComponent", () => {
|
|
|
21
21
|
const result = getDefaultApiParams();
|
|
22
22
|
expect(result).toEqual({});
|
|
23
23
|
expect(console.error).toHaveBeenCalledWith(
|
|
24
|
-
"[@shopware
|
|
24
|
+
"[@shopware/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release.",
|
|
25
25
|
);
|
|
26
26
|
});
|
|
27
27
|
|
package/src/index.ts
CHANGED
|
@@ -105,7 +105,7 @@ export function getDefaultApiParams(): {
|
|
|
105
105
|
[composableName: string]: unknown;
|
|
106
106
|
} {
|
|
107
107
|
console.error(
|
|
108
|
-
"[@shopware
|
|
108
|
+
"[@shopware/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release.",
|
|
109
109
|
);
|
|
110
110
|
return {};
|
|
111
111
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Schemas } from "#shopware";
|
|
3
3
|
import { useSetup } from "../_test";
|
|
4
4
|
import { useBreadcrumbs } from "./useBreadcrumbs";
|
|
5
5
|
|
|
@@ -48,9 +48,9 @@ describe("useBreadcrumbs", () => {
|
|
|
48
48
|
],
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
|
-
await vm.buildDynamicBreadcrumbs(
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
await vm.buildDynamicBreadcrumbs([
|
|
52
|
+
{ path: "test" } as Schemas["Breadcrumb"],
|
|
53
|
+
]);
|
|
54
54
|
|
|
55
55
|
expect(vm.breadcrumbs[0].path).toBe("/test");
|
|
56
56
|
});
|
|
@@ -71,7 +71,7 @@ export function useBreadcrumbs(
|
|
|
71
71
|
const buildDynamicBreadcrumbs = async (
|
|
72
72
|
breadcrumbs: operations["readBreadcrumb get /breadcrumb/{id}"]["response"],
|
|
73
73
|
) => {
|
|
74
|
-
_breadcrumbs.value = breadcrumbs.
|
|
74
|
+
_breadcrumbs.value = breadcrumbs.map((breadcrumb) => {
|
|
75
75
|
// Adjust path to be compatible with the router
|
|
76
76
|
return {
|
|
77
77
|
...breadcrumb,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getListingFilters } from "@shopware
|
|
1
|
+
import { getListingFilters } from "@shopware/helpers";
|
|
2
2
|
import { createInjectionState, createSharedComposable } from "@vueuse/core";
|
|
3
3
|
import { computed, inject, provide, ref } from "vue";
|
|
4
4
|
import type { ComputedRef, Ref } from "vue";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTranslatedProperty } from "@shopware
|
|
1
|
+
import { getTranslatedProperty } from "@shopware/helpers";
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
3
|
import type { ComputedRef, Ref } from "vue";
|
|
4
4
|
import { useProduct, useShopwareContext } from "#imports";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getProductTierPrices } from "@shopware
|
|
2
|
-
import type { TierPrice } from "@shopware
|
|
1
|
+
import { getProductTierPrices } from "@shopware/helpers";
|
|
2
|
+
import type { TierPrice } from "@shopware/helpers";
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
import type { ComputedRef, Ref } from "vue";
|
|
5
5
|
import type { Schemas } from "#shopware";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { buildUrlPrefix } from "@shopware
|
|
1
|
+
import { buildUrlPrefix } from "@shopware/helpers";
|
|
2
2
|
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
import { useSetup } from "../_test";
|
|
4
4
|
import { useUrlResolver } from "./useUrlResolver";
|
|
5
5
|
|
|
6
|
-
vi.mock("@shopware
|
|
6
|
+
vi.mock("@shopware/helpers", async () => {
|
|
7
7
|
return {
|
|
8
8
|
buildUrlPrefix: vi.fn(),
|
|
9
9
|
};
|