@shopware/composables 1.12.1 → 1.14.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.
- package/README.md +40 -12
- package/dist/index.d.mts +130 -20
- package/dist/index.d.ts +130 -20
- package/dist/index.mjs +95 -30
- package/package.json +11 -10
- package/src/cms/useCmsElementConfig.test.ts +38 -0
- package/src/cms/useCmsElementConfig.ts +13 -12
- package/src/cms/useCmsElementImage.test.ts +139 -0
- package/src/cms/useCmsElementImage.ts +19 -1
- package/src/index.test.ts +19 -1
- package/src/index.ts +9 -4
- package/src/types/cmsBlockTypes.ts +12 -0
- package/src/types/cmsElementTypes.ts +58 -2
- package/src/useAddToCart/useAddToCart.test.ts +17 -17
- package/src/useB2bQuoteManagement/useB2bQuoteManagement.test.ts +61 -1
- package/src/useB2bQuoteManagement/useB2bQuoteManagement.ts +121 -14
- package/src/useCategorySearch/useCategorySearch.test.ts +2 -2
- package/src/useCategorySearch/useCategorySearch.ts +3 -1
- package/src/useCmsBlock/useCmsBlock.test.ts +47 -13
- package/src/useCmsBlock/useCmsBlock.ts +17 -7
- package/src/useCmsSection/useCmsSection.test.ts +48 -5
- package/src/useCmsSection/useCmsSection.ts +11 -5
- package/src/useInternationalization/useInternationalization.test.ts +154 -0
- package/src/useInternationalization/useInternationalization.ts +21 -2
- package/src/useListing/useListing.ts +3 -1
- package/src/useNotifications/useNotifications.test.ts +19 -0
- package/src/useNotifications/useNotifications.ts +14 -1
- package/src/useProductSearch/useProductSearch.ts +1 -1
- package/src/useUser/useUser.test.ts +24 -0
- package/src/useUser/useUser.ts +2 -0
package/README.md
CHANGED
|
@@ -166,24 +166,52 @@ All composable functions are fully typed with TypeScript and they are registed g
|
|
|
166
166
|
|
|
167
167
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/composables/CHANGELOG.md)
|
|
168
168
|
|
|
169
|
-
### Latest changes: 1.
|
|
169
|
+
### Latest changes: 1.14.0
|
|
170
|
+
|
|
171
|
+
### Minor Changes
|
|
172
|
+
|
|
173
|
+
- [#2785](https://github.com/shopware/frontends/pull/2785) [`74a477b`](https://github.com/shopware/frontends/commit/74a477bfa88e3c518d3a0336e4d301c823122ba8) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - `useCmsElementConfig` accepts a `ref` or a getter. `getConfigValue` reads the element on every call, so a component that passes `() => props.content` follows a new `content` instead of the one it was set up with. Passing a plain object works as before.
|
|
174
|
+
|
|
175
|
+
- [#2785](https://github.com/shopware/frontends/pull/2785) [`74a477b`](https://github.com/shopware/frontends/commit/74a477bfa88e3c518d3a0336e4d301c823122ba8) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Add the `CmsBlockCategoryHeading`, `CmsBlockVideo`, `CmsBlockAppRenderer`, `CmsElementCategoryName`, `CmsElementVideo` and `MediaDisplayMode` types.
|
|
176
|
+
|
|
177
|
+
- [#2774](https://github.com/shopware/frontends/pull/2774) [`5961f55`](https://github.com/shopware/frontends/commit/5961f55b9f7cebad626cc073ae0bf857aa26f91b) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Let the CMS tree lookups follow a changing `content`, and fix `resolveCmsComponent().isResolved`
|
|
178
|
+
|
|
179
|
+
**`useCmsSection` and `useCmsBlock` accept a `ref` or a getter.** Both took a plain object and closed over it, so `getPositionContent()` and `getSlotContent()` kept reading the tree captured at setup: a component receiving a new `content` prop had to remount to see it, and calling the function again did not help. Both now accept `MaybeRefOrGetter` and resolve it with `toValue()` on every call.
|
|
180
|
+
|
|
181
|
+
Passing a plain object still works exactly as before, so nothing has to change. To benefit, pass a getter and read the lookups through a `computed`:
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
const { getSlotContent } = useCmsBlock(() => props.content);
|
|
185
|
+
const leftContent = computed(() => getSlotContent("left"));
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The returned `section` and `block` are still the value read when the composable was called, so they do not follow a replacement — use the source you passed in when you need that.
|
|
189
|
+
|
|
190
|
+
**`resolveCmsComponent().isResolved` now means resolved.** It compared the resolved value with `content.type`, while Vue's `resolveComponent` returns the _component name_ when nothing is registered — two strings that never match, so `isResolved` was `true` even when nothing resolved, and code guarding a fallback with `!isResolved` never ran. It is now derived from `resolvedComponent !== undefined`. Check `resolvedComponent` directly if you want the component itself.
|
|
191
|
+
|
|
192
|
+
The `resolved` field, which appears only when resolving throws, is now marked `@deprecated`. It always equals `isResolved`, so read that instead.
|
|
193
|
+
|
|
194
|
+
Note what is not fixed here: `getSlotContent()` still returns `undefined` at runtime for a slot the block does not carry, while its return type promises a value. The signature stays as it is because correcting it would be a breaking type change; the JSDoc now says so, and callers should keep guarding on the result.
|
|
170
195
|
|
|
171
196
|
### Patch Changes
|
|
172
197
|
|
|
173
|
-
- [#
|
|
198
|
+
- [#2731](https://github.com/shopware/frontends/pull/2731) [`46d6daa`](https://github.com/shopware/frontends/commit/46d6daade81e3d9e443f3badfeba2ca0e2751477) Thanks [@patzick](https://github.com/patzick)! - Add an optional notification action (label + link) so add-to-cart toasts can offer a "View cart" shortcut, and keep those toasts visible a little longer.
|
|
199
|
+
|
|
200
|
+
- [#2799](https://github.com/shopware/frontends/pull/2799) [`7dbca8b`](https://github.com/shopware/frontends/commit/7dbca8bf8bca1225b365bc03e4dbc07d3764c2e1) Thanks [@mkucmus](https://github.com/mkucmus)! - `useCategorySearch().search()` with `withCmsAssociations: true` now requests the CMS associations. Before, it nested them one level too deep, so the backend ignored them.
|
|
201
|
+
|
|
202
|
+
- [#2724](https://github.com/shopware/frontends/pull/2724) [`c78188a`](https://github.com/shopware/frontends/commit/c78188ac6c95ae19b070f5ea3361a60f21dff281) Thanks [@patzick](https://github.com/patzick)! - Fall back `getStorefrontUrl()` to a sales channel domain
|
|
203
|
+
|
|
204
|
+
`useUser().register()` injects `storefrontUrl` from `getStorefrontUrl()`. Shopware rejects that value unless it matches a **Sales Channel → Domains** entry, so guest checkout against the public demo (`devStorefrontUrl` pointing at the starter Vercel host) never reached `POST /checkout/order`.
|
|
174
205
|
|
|
175
|
-
|
|
176
|
-
- `useProductReviews.loadProductReviews` now calls `GET /product/{productId}/reviews` and sends its encoded Criteria in `_criteria` when cacheable reads are enabled.
|
|
177
|
-
- The CMS product description reviews element follows the same flag and endpoint behavior when it needs to fetch reviews directly.
|
|
206
|
+
`getStorefrontUrl()` now uses the preferred URL when it is one of the current sales channel domains, and otherwise the domain for the active language (or the first configured domain).
|
|
178
207
|
|
|
179
|
-
- [#
|
|
208
|
+
- [#2700](https://github.com/shopware/frontends/pull/2700) [`0df4c17`](https://github.com/shopware/frontends/commit/0df4c17b18ec38fc4d0c33f1cb6396f8f532a65d) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Refresh the cart after `register()`
|
|
180
209
|
|
|
181
|
-
|
|
210
|
+
`useUser().register()` changed the session context without refreshing the cart, while `login()` and `logout()` both did. Registration is the first point at which the backend learns the customer's billing country, which drives tax rates, shipping surcharges and customer-group prices, so the cart totals held in `useCart()` could stay at their pre-registration values while the order was placed at the recalculated ones.
|
|
182
211
|
|
|
183
|
-
|
|
212
|
+
`register()` now awaits `refreshCart()` after `refreshSessionContext()`, so a caller that awaits `register()` cannot observe the pre-registration totals afterwards. Note this makes `register()` resolve slightly later than before, and a failing cart refresh now rejects `register()` even though the customer was created — the same property `refreshSessionContext()` on the preceding line already had.
|
|
184
213
|
|
|
185
|
-
|
|
214
|
+
`login()` and `logout()` still call `refreshCart()` without awaiting it and are unchanged here.
|
|
186
215
|
|
|
187
|
-
- Updated dependencies [[`
|
|
188
|
-
- @shopware/api-client@1.
|
|
189
|
-
- @shopware/helpers@1.7.2
|
|
216
|
+
- Updated dependencies [[`44ece9d`](https://github.com/shopware/frontends/commit/44ece9dac2e4d0248c2270f7eff496c258632f5b), [`4b43e64`](https://github.com/shopware/frontends/commit/4b43e64a8d78be6eca1f8d9c24140e046193af41)]:
|
|
217
|
+
- @shopware/api-client@1.7.0
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
|
|
2
|
+
import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, MaybeRefOrGetter, App, EffectScope, Ref } from 'vue';
|
|
3
3
|
import { createAPIClient, ApiError } from '@shopware/api-client';
|
|
4
4
|
import { components, operations as operations$1 } from '@shopware/api-client/store-api-types';
|
|
5
5
|
import * as _shopware_api_client_api_types from '@shopware/api-client/api-types';
|
|
@@ -33,6 +33,7 @@ type CmsBlockImageHighlightRow = BlockType<THREE_COLUMNS>;
|
|
|
33
33
|
type CmsBlockImageSimpleGrid = BlockType<"left-top" | "left-bottom" | "right">;
|
|
34
34
|
type CmsBlockImageSlider = BlockType<"imageSlider">;
|
|
35
35
|
type CmsBlockImageGallery = BlockType<"imageGallery">;
|
|
36
|
+
type CmsBlockVideo = BlockType<"video">;
|
|
36
37
|
type CmsBlockYoutubeVideo = BlockType<"video">;
|
|
37
38
|
type CmsBlockVimeoVideo = BlockType<"video">;
|
|
38
39
|
type CmsBlockImageText = BlockType<TWO_COLUMNS>;
|
|
@@ -44,6 +45,7 @@ type CmsBlockImageTextBubble = BlockType<"left-image" | "left-text" | "center-im
|
|
|
44
45
|
type CmsBlockTextOnImage = BlockType<"content">;
|
|
45
46
|
type CmsBlockSidebarFilter = BlockType<"content">;
|
|
46
47
|
type CmsBlockCategoryNavigation = BlockType<"content">;
|
|
48
|
+
type CmsBlockCategoryHeading = BlockType<"content">;
|
|
47
49
|
type CmsBlockProductHeading = BlockType<TWO_COLUMNS>;
|
|
48
50
|
type CmsBlockProductThreeColumn = BlockType<THREE_COLUMNS>;
|
|
49
51
|
type CmsBlockProductListing = BlockType<"content">;
|
|
@@ -54,10 +56,20 @@ type CmsBlockCrossSelling = BlockType<"content">;
|
|
|
54
56
|
type CmsBlockForm = BlockType<"content">;
|
|
55
57
|
type CmsBlockHtml = BlockType<"content">;
|
|
56
58
|
type CmsBlockImageGalleryBig = BlockType<"imageGallery">;
|
|
59
|
+
type CmsBlockAppRenderer = BlockType<string> & {
|
|
60
|
+
type: "app-renderer";
|
|
61
|
+
customFields?: {
|
|
62
|
+
appBlockName?: string;
|
|
63
|
+
slotLayout?: {
|
|
64
|
+
grid?: string | null;
|
|
65
|
+
};
|
|
66
|
+
} | null;
|
|
67
|
+
};
|
|
57
68
|
|
|
58
69
|
type SourceType = "static" | "mapped";
|
|
59
70
|
type Position = "left" | "center" | "right";
|
|
60
71
|
type DisplayMode = Exclude<CSSProperties["objectFit"], undefined> | "standard";
|
|
72
|
+
type MediaDisplayMode = "standard" | "stretch" | "cover";
|
|
61
73
|
type BoxLayout = "standard" | "image" | "minimal";
|
|
62
74
|
type VerticalAlign = "flex-start" | "center" | "flex-end" | "";
|
|
63
75
|
type ElementConfig<VALUE_TYPE> = {
|
|
@@ -99,9 +111,11 @@ type ImageElementConfig = {
|
|
|
99
111
|
media: ElementConfig<string>;
|
|
100
112
|
newTab: ElementConfig<boolean>;
|
|
101
113
|
product: ElementConfig<string>;
|
|
114
|
+
ariaLabel?: ElementConfig<string | null>;
|
|
102
115
|
boxLayout: ElementConfig<BoxLayout>;
|
|
103
116
|
displayMode: ElementConfig<DisplayMode>;
|
|
104
117
|
minHeight: ElementConfig<string | number>;
|
|
118
|
+
isDecorative?: ElementConfig<boolean>;
|
|
105
119
|
verticalAlign: ElementConfig<VerticalAlign>;
|
|
106
120
|
horizontalAlign: ElementConfig<VerticalAlign>;
|
|
107
121
|
};
|
|
@@ -112,6 +126,7 @@ type CmsElementImage = Omit<Schemas["CmsSlot"], "config"> & {
|
|
|
112
126
|
mediaId: string;
|
|
113
127
|
url: string;
|
|
114
128
|
newTab: boolean;
|
|
129
|
+
ariaLabel?: string | null;
|
|
115
130
|
apiAlias: "cms_image";
|
|
116
131
|
media: Schemas["Media"];
|
|
117
132
|
};
|
|
@@ -121,8 +136,8 @@ type SliderElementConfig = {
|
|
|
121
136
|
minHeight: ElementConfig<string | number>;
|
|
122
137
|
verticalAlign?: ElementConfig<VerticalAlign>;
|
|
123
138
|
displayMode?: ElementConfig<"standard" | "cover" | "contain">;
|
|
124
|
-
navigationDots?: ElementConfig<"outside" | "inside" | "">;
|
|
125
|
-
navigationArrows?: ElementConfig<"outside" | "inside" | "">;
|
|
139
|
+
navigationDots?: ElementConfig<"outside" | "inside" | "none" | "">;
|
|
140
|
+
navigationArrows?: ElementConfig<"outside" | "inside" | "none" | "">;
|
|
126
141
|
};
|
|
127
142
|
type ImageSliderElementConfig = ImageElementConfig & SliderElementConfig & {
|
|
128
143
|
sliderItems: ElementConfig<Array<{
|
|
@@ -168,6 +183,36 @@ type CmsElementImageGallery = Omit<Schemas["CmsSlot"], "config"> & {
|
|
|
168
183
|
} | Schemas["ProductMedia"]>;
|
|
169
184
|
};
|
|
170
185
|
};
|
|
186
|
+
type VideoElementConfig = {
|
|
187
|
+
media: ElementConfig<string | null>;
|
|
188
|
+
displayMode: ElementConfig<MediaDisplayMode>;
|
|
189
|
+
minHeight: ElementConfig<string | null>;
|
|
190
|
+
verticalAlign: ElementConfig<VerticalAlign | null>;
|
|
191
|
+
horizontalAlign: ElementConfig<VerticalAlign | null>;
|
|
192
|
+
ariaLabel: ElementConfig<string | null>;
|
|
193
|
+
autoPlay: ElementConfig<boolean>;
|
|
194
|
+
muted: ElementConfig<boolean>;
|
|
195
|
+
loop: ElementConfig<boolean>;
|
|
196
|
+
playsInline: ElementConfig<boolean>;
|
|
197
|
+
showControls: ElementConfig<boolean>;
|
|
198
|
+
showCover: ElementConfig<boolean>;
|
|
199
|
+
};
|
|
200
|
+
type CmsElementVideo = Omit<Schemas["CmsSlot"], "config"> & {
|
|
201
|
+
type: "video";
|
|
202
|
+
config: VideoElementConfig;
|
|
203
|
+
data: {
|
|
204
|
+
mediaId: string | null;
|
|
205
|
+
url: string | null;
|
|
206
|
+
newTab: boolean | null;
|
|
207
|
+
ariaLabel: string | null;
|
|
208
|
+
apiAlias: "cms_video";
|
|
209
|
+
media: (Schemas["Media"] & {
|
|
210
|
+
extensions?: {
|
|
211
|
+
videoCoverMedia?: Schemas["Media"];
|
|
212
|
+
};
|
|
213
|
+
}) | null;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
171
216
|
type YouTubeVideoElementConfig = {
|
|
172
217
|
end: ElementConfig<string>;
|
|
173
218
|
url: ElementConfig<string>;
|
|
@@ -356,6 +401,18 @@ type CmsElementProductName = Omit<Schemas["CmsSlot"], "config"> & {
|
|
|
356
401
|
config: TextElementConfig;
|
|
357
402
|
};
|
|
358
403
|
};
|
|
404
|
+
type CategoryNameElementConfig = {
|
|
405
|
+
content: ElementConfig<string>;
|
|
406
|
+
verticalAlign?: ElementConfig<VerticalAlign | null>;
|
|
407
|
+
};
|
|
408
|
+
type CmsElementCategoryName = Omit<Schemas["CmsSlot"], "config"> & {
|
|
409
|
+
type: "category-name";
|
|
410
|
+
config: CategoryNameElementConfig;
|
|
411
|
+
data: {
|
|
412
|
+
content: string | null;
|
|
413
|
+
apiAlias: "cms_text";
|
|
414
|
+
};
|
|
415
|
+
};
|
|
359
416
|
type CmsElementManufacturerLogo = Omit<Schemas["CmsSlot"], "config"> & {
|
|
360
417
|
type: "manufacturer-logo";
|
|
361
418
|
config: ImageElementConfig;
|
|
@@ -363,6 +420,7 @@ type CmsElementManufacturerLogo = Omit<Schemas["CmsSlot"], "config"> & {
|
|
|
363
420
|
mediaId: string;
|
|
364
421
|
url: string;
|
|
365
422
|
newTab: boolean;
|
|
423
|
+
ariaLabel?: string | null;
|
|
366
424
|
apiAlias: "cms_manufacturer_logo";
|
|
367
425
|
media: Schemas["Media"];
|
|
368
426
|
};
|
|
@@ -391,6 +449,8 @@ type UseCmsElementImage = {
|
|
|
391
449
|
newTab: boolean;
|
|
392
450
|
url: string;
|
|
393
451
|
}>;
|
|
452
|
+
ariaLabel: ComputedRef<string>;
|
|
453
|
+
isDecorative: ComputedRef<boolean>;
|
|
394
454
|
displayMode: ComputedRef<DisplayMode>;
|
|
395
455
|
isVideoElement: ComputedRef<boolean>;
|
|
396
456
|
mimeType: ComputedRef<string | undefined>;
|
|
@@ -405,16 +465,15 @@ declare function useCmsElementImage(element: CmsElementImage | CmsElementManufac
|
|
|
405
465
|
/**
|
|
406
466
|
* Composable to get cms element config
|
|
407
467
|
*
|
|
468
|
+
* `getConfigValue` reads the element on every call, so it follows a `ref` or
|
|
469
|
+
* getter passed as `element`.
|
|
470
|
+
*
|
|
408
471
|
* @category CMS (Shopping Experiences)
|
|
409
472
|
*/
|
|
410
473
|
declare function useCmsElementConfig<T extends Omit<Schemas["CmsSlot"], "config"> & {
|
|
411
|
-
config:
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
[key in X]: ElementConfig<T["config"][key]["value"]>;
|
|
415
|
-
} : never;
|
|
416
|
-
}>(element: T): {
|
|
417
|
-
getConfigValue: <ELEMENT_CONFIG extends keyof T["config"]>(key: ELEMENT_CONFIG) => (typeof element.config)[ELEMENT_CONFIG]["value"];
|
|
474
|
+
config: Record<string, ElementConfig<unknown> | undefined>;
|
|
475
|
+
}>(element: MaybeRefOrGetter<T>): {
|
|
476
|
+
getConfigValue: <ELEMENT_CONFIG extends keyof T["config"]>(key: ELEMENT_CONFIG) => NonNullable<T["config"][ELEMENT_CONFIG]>["value"];
|
|
418
477
|
};
|
|
419
478
|
|
|
420
479
|
declare function createShopwareContext(app: App, options: {
|
|
@@ -854,11 +913,18 @@ declare function useCheckout(): UseCheckoutReturn;
|
|
|
854
913
|
type ArrayElement$1<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
855
914
|
type UseCmsBlockReturn = {
|
|
856
915
|
/**
|
|
857
|
-
* Cms block content
|
|
916
|
+
* Cms block content, as it was when the composable was called.
|
|
858
917
|
*/
|
|
859
918
|
block: Schemas["CmsBlock"];
|
|
860
919
|
/**
|
|
861
|
-
* Get slot content by slot name (identifier)
|
|
920
|
+
* Get slot content by slot name (identifier).
|
|
921
|
+
*
|
|
922
|
+
* Reads the block on every call, so it follows a `ref` or getter passed as
|
|
923
|
+
* `content`.
|
|
924
|
+
*
|
|
925
|
+
* A block does not have to carry every slot its layout allows: the lookup
|
|
926
|
+
* returns `undefined` at runtime for a slot that is not there, which the
|
|
927
|
+
* return type does not express yet. Guard on the result.
|
|
862
928
|
* @example getSlotContent("main")
|
|
863
929
|
*/
|
|
864
930
|
getSlotContent(slotName: string): ArrayElement$1<Schemas["CmsBlock"]["slots"]>;
|
|
@@ -868,7 +934,7 @@ type UseCmsBlockReturn = {
|
|
|
868
934
|
* @public
|
|
869
935
|
* @category CMS (Shopping Experiences)
|
|
870
936
|
*/
|
|
871
|
-
declare function useCmsBlock<BLOCK_TYPE extends Schemas["CmsBlock"]>(content: BLOCK_TYPE): UseCmsBlockReturn;
|
|
937
|
+
declare function useCmsBlock<BLOCK_TYPE extends Schemas["CmsBlock"]>(content: MaybeRefOrGetter<BLOCK_TYPE>): UseCmsBlockReturn;
|
|
872
938
|
|
|
873
939
|
type UseCmsMetaReturn = {
|
|
874
940
|
/**
|
|
@@ -892,11 +958,14 @@ declare function useCmsMeta(entity: Schemas["Category"] | Schemas["Product"] | S
|
|
|
892
958
|
type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
893
959
|
type UseCmsSectionType = {
|
|
894
960
|
/**
|
|
895
|
-
* CMS section
|
|
961
|
+
* CMS section, as it was when the composable was called.
|
|
896
962
|
*/
|
|
897
963
|
section: Schemas["CmsSection"];
|
|
898
964
|
/**
|
|
899
|
-
*
|
|
965
|
+
* Blocks of the section placed on the given position.
|
|
966
|
+
*
|
|
967
|
+
* Reads the section on every call, so it follows a `ref` or getter passed as
|
|
968
|
+
* `content`.
|
|
900
969
|
*/
|
|
901
970
|
getPositionContent(position: ArrayElement<Schemas["CmsSection"]["blocks"]>["sectionPosition"]): Array<Schemas["CmsBlock"]>;
|
|
902
971
|
};
|
|
@@ -905,7 +974,7 @@ type UseCmsSectionType = {
|
|
|
905
974
|
* @public
|
|
906
975
|
* @category CMS (Shopping Experiences)
|
|
907
976
|
*/
|
|
908
|
-
declare function useCmsSection<SECTION_TYPE extends Schemas["CmsSection"]>(content: SECTION_TYPE): UseCmsSectionType;
|
|
977
|
+
declare function useCmsSection<SECTION_TYPE extends Schemas["CmsSection"]>(content: MaybeRefOrGetter<SECTION_TYPE>): UseCmsSectionType;
|
|
909
978
|
|
|
910
979
|
/**
|
|
911
980
|
* @category CMS (Shopping Experiences)
|
|
@@ -1138,7 +1207,7 @@ type UseListingReturn = {
|
|
|
1138
1207
|
/**
|
|
1139
1208
|
* Available sorting orders
|
|
1140
1209
|
*/
|
|
1141
|
-
getSortingOrders: ComputedRef<Schemas["
|
|
1210
|
+
getSortingOrders: ComputedRef<Schemas["ProductListingResult"]["availableSortings"] | {
|
|
1142
1211
|
key: string;
|
|
1143
1212
|
label: string;
|
|
1144
1213
|
}[] | undefined>;
|
|
@@ -1424,6 +1493,15 @@ type UseNewsletterReturn = {
|
|
|
1424
1493
|
declare function useNewsletter(): UseNewsletterReturn;
|
|
1425
1494
|
|
|
1426
1495
|
type NotificationType = "info" | "warning" | "success" | "danger";
|
|
1496
|
+
/**
|
|
1497
|
+
* Optional CTA rendered next to a notification message (e.g. "View cart").
|
|
1498
|
+
*
|
|
1499
|
+
* @private
|
|
1500
|
+
*/
|
|
1501
|
+
type NotificationAction = {
|
|
1502
|
+
label: string;
|
|
1503
|
+
to: string;
|
|
1504
|
+
};
|
|
1427
1505
|
/**
|
|
1428
1506
|
* @private
|
|
1429
1507
|
*/
|
|
@@ -1431,6 +1509,7 @@ type Notification = {
|
|
|
1431
1509
|
type: NotificationType;
|
|
1432
1510
|
message: string;
|
|
1433
1511
|
id: number;
|
|
1512
|
+
action?: NotificationAction;
|
|
1434
1513
|
};
|
|
1435
1514
|
/**
|
|
1436
1515
|
* @private
|
|
@@ -1442,6 +1521,7 @@ type NotificationOptions = {
|
|
|
1442
1521
|
type?: NotificationType;
|
|
1443
1522
|
timeout?: number;
|
|
1444
1523
|
persistent?: boolean;
|
|
1524
|
+
action?: NotificationAction;
|
|
1445
1525
|
};
|
|
1446
1526
|
/**
|
|
1447
1527
|
* @public
|
|
@@ -1841,7 +1921,7 @@ declare function useProductReviews(product: Ref<Schemas["Product"]>): UseProduct
|
|
|
1841
1921
|
type UseProductSearchReturnOptions = {
|
|
1842
1922
|
withCmsAssociations?: boolean;
|
|
1843
1923
|
criteria?: Partial<Schemas["Criteria"]>;
|
|
1844
|
-
associations?: Partial<Schemas["
|
|
1924
|
+
associations?: Partial<Schemas["Associations"]>;
|
|
1845
1925
|
};
|
|
1846
1926
|
type UseProductSearchReturn = {
|
|
1847
1927
|
/**
|
|
@@ -2290,13 +2370,36 @@ declare function useWishlist(): UseWishlistReturn;
|
|
|
2290
2370
|
type UseB2bQuoteManagement = {
|
|
2291
2371
|
getQuoteList: () => Promise<Schemas["Quote"][]>;
|
|
2292
2372
|
getQuote: (quoteId: string) => Promise<Schemas["Quote"]>;
|
|
2373
|
+
/**
|
|
2374
|
+
* @deprecated use `declineQuoteWithComment` instead — it sends the
|
|
2375
|
+
* `lineItemId` and `versionId` that `POST /quote/{id}/decline` expects.
|
|
2376
|
+
* A `comment`-only body is still accepted at runtime on 6.7.12+: the API
|
|
2377
|
+
* schema marks `lineItemId` and `versionId` as required, but the endpoint
|
|
2378
|
+
* does not validate the request body, so existing callers keep working.
|
|
2379
|
+
* Removed in v2.
|
|
2380
|
+
*/
|
|
2293
2381
|
declineQuote: (quoteId: string, comment: string) => Promise<void>;
|
|
2382
|
+
declineQuoteWithComment: (quoteId: string, params: DeclineQuoteParams) => Promise<void>;
|
|
2383
|
+
createDraftQuoteVersion: (quoteId: string) => Promise<string>;
|
|
2384
|
+
deleteDraftQuoteVersion: (quoteId: string, versionId: string) => Promise<void>;
|
|
2294
2385
|
requestChangeQuote: (quoteId: string, comment: string) => Promise<void>;
|
|
2295
2386
|
requestQuote: (comment: string) => Promise<Schemas["Quote"]>;
|
|
2296
2387
|
createOrderFromQuote: (quoteId: string, comment: string) => Promise<Schemas["Order"]>;
|
|
2297
2388
|
changeShippingMethod: (quoteId: string, shippingMethodId: string) => Promise<void>;
|
|
2298
2389
|
changePaymentMethod: (quoteId: string, paymentMethodId: string) => Promise<void>;
|
|
2299
2390
|
};
|
|
2391
|
+
type DeclineQuoteParams = {
|
|
2392
|
+
/** Message content */
|
|
2393
|
+
comment: string;
|
|
2394
|
+
/** Identifier of the quote line item that owns the new comment */
|
|
2395
|
+
lineItemId: string;
|
|
2396
|
+
/**
|
|
2397
|
+
* Draft version identifier of the quote currently shown in storefront,
|
|
2398
|
+
* as returned by `createDraftQuoteVersion`. This is not the `versionId`
|
|
2399
|
+
* property of the quote entity.
|
|
2400
|
+
*/
|
|
2401
|
+
versionId: string;
|
|
2402
|
+
};
|
|
2300
2403
|
type ChangePaymentShippingMethodParams = {
|
|
2301
2404
|
quoteId: string;
|
|
2302
2405
|
paymentMethodId?: string;
|
|
@@ -2308,7 +2411,8 @@ type ChangePaymentShippingMethodParams = {
|
|
|
2308
2411
|
* With this composable you can:
|
|
2309
2412
|
* - Get list of quotes
|
|
2310
2413
|
* - Get quote details
|
|
2311
|
-
* -
|
|
2414
|
+
* - Create and delete a storefront draft version of the quote
|
|
2415
|
+
* - Decline quote, with or without a line item comment
|
|
2312
2416
|
* - Request change of the quote
|
|
2313
2417
|
* - Change shipping method
|
|
2314
2418
|
* - Change payment method
|
|
@@ -2359,12 +2463,18 @@ declare function resolveCmsComponent(content: Schemas["CmsSection"] | Schemas["C
|
|
|
2359
2463
|
componentNameToResolve: never;
|
|
2360
2464
|
isResolved: boolean;
|
|
2361
2465
|
resolvedComponent: vue.ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions, {}, any> | undefined;
|
|
2466
|
+
/**
|
|
2467
|
+
* @deprecated Use `isResolved` instead. Kept so the error shape is unchanged.
|
|
2468
|
+
*/
|
|
2362
2469
|
resolved?: undefined;
|
|
2363
2470
|
error?: undefined;
|
|
2364
2471
|
} | {
|
|
2365
2472
|
componentName: string;
|
|
2366
2473
|
componentNameToResolve: never;
|
|
2367
2474
|
resolvedComponent: undefined;
|
|
2475
|
+
/**
|
|
2476
|
+
* @deprecated Use `isResolved` instead. Kept so the error shape is unchanged.
|
|
2477
|
+
*/
|
|
2368
2478
|
resolved: boolean;
|
|
2369
2479
|
isResolved: boolean;
|
|
2370
2480
|
error: string;
|
|
@@ -2374,4 +2484,4 @@ declare function getDefaultApiParams(): {
|
|
|
2374
2484
|
};
|
|
2375
2485
|
|
|
2376
2486
|
export { createCategoryListingContext, createListingComposable, createShopwareContext, getDefaultApiParams, resolveCmsComponent, useAddToCart, useAddress, useB2bQuoteManagement, useBreadcrumbs, useCart, useCartErrorParamsResolver, useCartFunction, useCartItem, useCartNotification, useCategory, useCategoryListing, useCategorySearch, useCheckout, useCmsBlock, useCmsElementConfig, useCmsElementImage, useCmsMeta, useCmsSection, useCmsTranslations, useContext, useCountries, useCustomerOrders, useCustomerPassword, useDefaultOrderAssociations, useInternationalization, useLandingSearch, useListing, useLocalWishlist, useNavigation, useNavigationContext, useNavigationSearch, useNewsletter, useNotifications, useOrderDetails, useOrderPayment, usePrice, useProduct, useProductAssociations, useProductConfigurator, useProductPrice, useProductReviews, useProductSearch, useProductSearchListing, useProductSearchSuggest, useProductWishlist, useSalutations, useSessionContext, useShopwareContext, useSyncWishlist, useUrlResolver, useUser, useWishlist };
|
|
2377
|
-
export type { BoxLayout, Breadcrumb, ChangePaymentShippingMethodParams, CmsBlockCategoryNavigation, CmsBlockCenterText, CmsBlockCrossSelling, CmsBlockForm, CmsBlockGalleryBuybox, CmsBlockHtml, CmsBlockImage, CmsBlockImageBubbleRow, CmsBlockImageCover, CmsBlockImageFourColumn, CmsBlockImageGallery, CmsBlockImageGalleryBig, CmsBlockImageHighlightRow, CmsBlockImageSimpleGrid, CmsBlockImageSlider, CmsBlockImageText, CmsBlockImageTextBubble, CmsBlockImageTextCover, CmsBlockImageTextGallery, CmsBlockImageTextRow, CmsBlockImageThreeColumn, CmsBlockImageThreeCover, CmsBlockImageTwoColumn, CmsBlockProductDescriptionReviews, CmsBlockProductHeading, CmsBlockProductListing, CmsBlockProductSlider, CmsBlockProductThreeColumn, CmsBlockSidebarFilter, CmsBlockText, CmsBlockTextHero, CmsBlockTextOnImage, CmsBlockTextTeaser, CmsBlockTextTeaserSection, CmsBlockTextThreeColumn, CmsBlockTextTwoColumn, CmsBlockVimeoVideo, CmsBlockYoutubeVideo, CmsElementBuyBox, CmsElementCategoryNavigation, CmsElementCrossSelling, CmsElementForm, CmsElementHtml, CmsElementImage, CmsElementImageGallery, CmsElementImageSlider, CmsElementManufacturerLogo, CmsElementProductBox, CmsElementProductDescriptionReviews, CmsElementProductListing, CmsElementProductName, CmsElementProductSlider, CmsElementSidebarFilter, CmsElementText, CmsElementVimeoVideo, CmsElementYoutubeVideo, CmsSectionBlock, CmsSectionDefault, CmsSectionSidebar, DisplayMode, ElementConfig, ErrorObjectParam, ImageContainerAttrs, ListingType, Notification, NotificationOptions, Position, RouteObject, ShopwareContext, ShortcutFilterParam, SliderElementConfig, SourceType, UseAddToCartReturn, UseAddressReturn, UseBreadcrumbsReturn, UseCartErrorParamsResolver, UseCartItemReturn, UseCartReturn, UseCategoryReturn, UseCategorySearchReturn, UseCheckoutReturn, UseCmsBlockReturn, UseCmsElementImage, UseCmsMetaReturn, UseCountriesReturn, UseCustomerOrdersReturn, UseCustomerPasswordReturn, UseInternationalizationReturn, UseLandingSearchReturn, UseListingReturn, UseLocalWishlistReturn, UseNavigationContextReturn, UseNavigationReturn, UseNavigationSearchReturn, UseNewsletterReturn, UseNotificationsReturn, UseOrderDetailsReturn, UseOrderPaymentReturn, UsePriceReturn, UseProductAssociationsReturn, UseProductConfiguratorReturn, UseProductPriceReturn, UseProductReturn, UseProductReviewsReturn, UseProductSearchReturn, UseProductSearchSuggestReturn, UseProductWishlistReturn, UseSalutationsReturn, UseSessionContextReturn, UseSyncWishlistReturn, UseUserReturn, UseWishlistReturn, VerticalAlign, useCartNotificationReturn };
|
|
2487
|
+
export type { BoxLayout, Breadcrumb, ChangePaymentShippingMethodParams, CmsBlockAppRenderer, CmsBlockCategoryHeading, CmsBlockCategoryNavigation, CmsBlockCenterText, CmsBlockCrossSelling, CmsBlockForm, CmsBlockGalleryBuybox, CmsBlockHtml, CmsBlockImage, CmsBlockImageBubbleRow, CmsBlockImageCover, CmsBlockImageFourColumn, CmsBlockImageGallery, CmsBlockImageGalleryBig, CmsBlockImageHighlightRow, CmsBlockImageSimpleGrid, CmsBlockImageSlider, CmsBlockImageText, CmsBlockImageTextBubble, CmsBlockImageTextCover, CmsBlockImageTextGallery, CmsBlockImageTextRow, CmsBlockImageThreeColumn, CmsBlockImageThreeCover, CmsBlockImageTwoColumn, CmsBlockProductDescriptionReviews, CmsBlockProductHeading, CmsBlockProductListing, CmsBlockProductSlider, CmsBlockProductThreeColumn, CmsBlockSidebarFilter, CmsBlockText, CmsBlockTextHero, CmsBlockTextOnImage, CmsBlockTextTeaser, CmsBlockTextTeaserSection, CmsBlockTextThreeColumn, CmsBlockTextTwoColumn, CmsBlockVideo, CmsBlockVimeoVideo, CmsBlockYoutubeVideo, CmsElementBuyBox, CmsElementCategoryName, CmsElementCategoryNavigation, CmsElementCrossSelling, CmsElementForm, CmsElementHtml, CmsElementImage, CmsElementImageGallery, CmsElementImageSlider, CmsElementManufacturerLogo, CmsElementProductBox, CmsElementProductDescriptionReviews, CmsElementProductListing, CmsElementProductName, CmsElementProductSlider, CmsElementSidebarFilter, CmsElementText, CmsElementVideo, CmsElementVimeoVideo, CmsElementYoutubeVideo, CmsSectionBlock, CmsSectionDefault, CmsSectionSidebar, DeclineQuoteParams, DisplayMode, ElementConfig, ErrorObjectParam, ImageContainerAttrs, ListingType, MediaDisplayMode, Notification, NotificationAction, NotificationOptions, Position, RouteObject, ShopwareContext, ShortcutFilterParam, SliderElementConfig, SourceType, UseAddToCartReturn, UseAddressReturn, UseBreadcrumbsReturn, UseCartErrorParamsResolver, UseCartItemReturn, UseCartReturn, UseCategoryReturn, UseCategorySearchReturn, UseCheckoutReturn, UseCmsBlockReturn, UseCmsElementImage, UseCmsMetaReturn, UseCountriesReturn, UseCustomerOrdersReturn, UseCustomerPasswordReturn, UseInternationalizationReturn, UseLandingSearchReturn, UseListingReturn, UseLocalWishlistReturn, UseNavigationContextReturn, UseNavigationReturn, UseNavigationSearchReturn, UseNewsletterReturn, UseNotificationsReturn, UseOrderDetailsReturn, UseOrderPaymentReturn, UsePriceReturn, UseProductAssociationsReturn, UseProductConfiguratorReturn, UseProductPriceReturn, UseProductReturn, UseProductReviewsReturn, UseProductSearchReturn, UseProductSearchSuggestReturn, UseProductWishlistReturn, UseSalutationsReturn, UseSessionContextReturn, UseSyncWishlistReturn, UseUserReturn, UseWishlistReturn, VerticalAlign, useCartNotificationReturn };
|