@shopware/composables 1.12.0 → 1.13.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  [![](https://img.shields.io/github/issues/shopware/frontends/composables?label=package%20issues&logo=github)](https://github.com/shopware/frontends/issues?q=is%3Aopen+is%3Aissue+label%3Acomposables)
6
6
  [![](https://img.shields.io/github/license/shopware/frontends?color=blue)](#)
7
7
 
8
- Set of Vue.js composition functions that can be used in any Vue.js project. They provide state management, UI logic and data fetching and are the base for all guides in our [building section](https://frontends.shopware.com/getting-started/page-elements/navigation.html).
8
+ Set of Vue.js composition functions that can be used in any Vue.js project. They provide state management, UI logic and data fetching and are the base for all guides in our [building section](https://developer.shopware.com/frontends/guides/page-elements/navigation.html).
9
9
 
10
10
  ## Features
11
11
 
@@ -88,7 +88,7 @@ Now you can use any composable function in your setup function:
88
88
 
89
89
  const { login } = useUser();
90
90
  const { refreshSessionContext, sessionContext } = useSessionContext();
91
- refreshSessionContext();
91
+ await refreshSessionContext();
92
92
  </script>
93
93
  <template>
94
94
  <pre>{{ sessionContext }}</pre>
@@ -156,7 +156,7 @@ All composable functions are fully typed with TypeScript and they are registed g
156
156
 
157
157
  ## Links
158
158
 
159
- - [📘 Documentation](https://frontends.shopware.com)
159
+ - [📘 Documentation](https://developer.shopware.com/frontends)
160
160
 
161
161
  - [👥 Community Discord](https://discord.com/channels/1308047705309708348/1405501315160739951) (`#composable-frontend`)
162
162
 
@@ -166,20 +166,60 @@ 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.12.0
169
+ ### Latest changes: 1.13.0
170
170
 
171
171
  ### Minor Changes
172
172
 
173
- - [#2486](https://github.com/shopware/frontends/pull/2486) [`5678fb0`](https://github.com/shopware/frontends/commit/5678fb008cbd86eaddd061e004de89e6f45bb7ec) Thanks [@mkucmus](https://github.com/mkucmus)! - `useSessionContext`: expose `currentLocaleCode` — the active language's locale code (e.g. `"en-GB"`), read directly from the context's `languageInfo`. The current locale can now be derived from the session context alone, without loading the full language list via `useInternationalization().getAvailableLanguages()` just to map the current `languageId` to a locale.
173
+ - [#2663](https://github.com/shopware/frontends/pull/2663) [`7020545`](https://github.com/shopware/frontends/commit/70205458cb9357a068029d0aaef41898ab94b354) Thanks [@mkucmus](https://github.com/mkucmus)! - `useCmsElementImage` now honours the `ariaLabel` and `isDecorative` fields of a CMS image element, which were ignored before, and returns both. `imageAttrs.alt` is empty for a decorative image. `ariaLabel` names the link the image sits in, as it does in the Storefront, so it is not copied into `alt`.
174
174
 
175
- - [#2473](https://github.com/shopware/frontends/pull/2473) [`22611e5`](https://github.com/shopware/frontends/commit/22611e542b8f42a4f34dce5186f628f9a17f457b) Thanks [@mkucmus](https://github.com/mkucmus)! - Add an opt-in `cacheableReads` flag that routes anonymous Store API reads through their cacheable GET variants instead of POST. Criteria is compressed into the `_criteria` query param via `encodeForQuery` from `@shopware/api-client/helpers`, which lets CDNs / reverse proxies / the browser cache the responses.
175
+ Both fields are optional on the image element config, because a Shopware instance that has never had them set does not return them. `useCmsElementConfig` accepts optional config members now, so `getConfigValue` keeps the declared value type for them instead of widening to `{}`.
176
176
 
177
- Disabled by default — fully backwards compatible. Enable it in `nuxt.config` (`shopware: { cacheableReads: true }`) or via `createShopwareContext(app, { cacheableReads: true })` for non-Nuxt setups. It is surfaced on the Shopware context and read by the affected composables; public composable signatures are unchanged.
177
+ `SliderElementConfig` gained the `"none"` value for `navigationDots` and `navigationArrows`. The Administration offers it, the type did not list it.
178
178
 
179
- Affected composables: `useNavigation`, `useNavigationSearch`, `useCountries`, `useUser` (country + salutation lookups), `useSalutations`, `useInternationalization`, `useProductConfigurator`, `useProductSearch`, and `useCategorySearch.advancedSearch`.
179
+ - [#2642](https://github.com/shopware/frontends/pull/2642) [`183c183`](https://github.com/shopware/frontends/commit/183c183f905486c27fa770fd0f4cd9993e86c20e) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Add `createDraftQuoteVersion` and `deleteDraftQuoteVersion` to `useB2bQuoteManagement`.
180
180
 
181
- `useListing` (product-listing), single-category `useCategorySearch.search`, and `useLandingSearch` remain POST for now: the generated Store API schema does not type `_criteria` on those GET routes (a Shopware OpenAPI gap). The backend does honor `_criteria` on product-listing GET at runtime, so that one can be migrated later once the types are augmented.
181
+ Quote write operations such as `declineQuoteWithComment` expect the identifier of a temporary storefront draft version, not the `versionId` property of the quote entity. `createDraftQuoteVersion` wraps `POST /quote/{id}/draft-version` and returns that identifier, throwing when the API responds without one; `deleteDraftQuoteVersion` discards the draft again.
182
+
183
+ ```ts
184
+ const { createDraftQuoteVersion, declineQuoteWithComment } =
185
+ useB2bQuoteManagement();
186
+
187
+ const versionId = await createDraftQuoteVersion(quoteId);
188
+
189
+ await declineQuoteWithComment(quoteId, {
190
+ comment: "Too expensive",
191
+ lineItemId,
192
+ versionId,
193
+ });
194
+ ```
195
+
196
+ - [#2642](https://github.com/shopware/frontends/pull/2642) [`183c183`](https://github.com/shopware/frontends/commit/183c183f905486c27fa770fd0f4cd9993e86c20e) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Add `declineQuoteWithComment` to `useB2bQuoteManagement`, following the Store API `POST /quote/{id}/decline` schema, which as of `6.7.12` also carries `lineItemId` and `versionId` next to `comment`.
197
+
198
+ `declineQuote` keeps its `(quoteId, comment)` signature and is deprecated. It will be removed in the next major.
199
+
200
+ ```ts
201
+ const { declineQuoteWithComment, createDraftQuoteVersion } =
202
+ useB2bQuoteManagement();
203
+
204
+ const versionId = await createDraftQuoteVersion(quoteId);
205
+
206
+ await declineQuoteWithComment(quoteId, {
207
+ comment: "Too expensive",
208
+ lineItemId,
209
+ versionId,
210
+ });
211
+ ```
182
212
 
183
213
  ### Patch Changes
184
214
 
185
- - [#2462](https://github.com/shopware/frontends/pull/2462) [`8be060d`](https://github.com/shopware/frontends/commit/8be060de825ca799f98a8f045a5e7fea61f5d1a2) Thanks [@mkucmus](https://github.com/mkucmus)! - `useProductAssociations`: add optional `includeSeoUrls` option. When `true`, the cross-selling request sends `sw-include-seo-urls: true` so returned products include the `seoUrls` association. Defaults to `false` to avoid extra backend overhead.
215
+ - [#2676](https://github.com/shopware/frontends/pull/2676) [`458494e`](https://github.com/shopware/frontends/commit/458494e8bd2be88d4fbf161636a109c8f4efc443) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Realign the composables with the `6.7.13.0` Store API schema:
216
+
217
+ - `useB2bQuoteManagement`: `getQuote()` now invokes `readQuote post /quote/{id}` (was `readQuote post /quote/detail/{id}`) and `createOrderFromQuote()` now invokes `createOrderFromQuote post /quote/{id}/order` (was `createOrderFromQuote post /quote/order/{id}`), matching the renamed endpoints.
218
+ - `useListing`: `getSortingOrders` is typed as `Schemas["ProductListingResult"]["availableSortings"]` instead of the removed `Schemas["ProductSorting"][]`.
219
+ - `useProductSearch`: the `associations` option is typed as `Partial<Schemas["Associations"]>` instead of the removed `Schemas["Association"]`.
220
+
221
+ - [#2660](https://github.com/shopware/frontends/pull/2660) [`8913956`](https://github.com/shopware/frontends/commit/89139563924163e57cafdd9770fe603f2dbd8cba) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - `useCmsElementImage` now returns the translated media `alt` in `imageAttrs`. It read `element.data.media.alt` from the entity root, which the Store API fills with the system language value, so the `alt` attribute ignored the language of the current request. The value is now resolved with `getTranslatedProperty()` and falls back to the root property when `translated` is missing.
222
+
223
+ - Updated dependencies [[`2ddf156`](https://github.com/shopware/frontends/commit/2ddf156805b2941fe2069e78453fb3c4eb6d44ac), [`204c8f4`](https://github.com/shopware/frontends/commit/204c8f45f737e724db6d00b80c5faef8ddb77cb4), [`183c183`](https://github.com/shopware/frontends/commit/183c183f905486c27fa770fd0f4cd9993e86c20e), [`458494e`](https://github.com/shopware/frontends/commit/458494e8bd2be88d4fbf161636a109c8f4efc443)]:
224
+ - @shopware/helpers@1.8.0
225
+ - @shopware/api-client@1.6.0
package/dist/index.d.mts CHANGED
@@ -99,9 +99,11 @@ type ImageElementConfig = {
99
99
  media: ElementConfig<string>;
100
100
  newTab: ElementConfig<boolean>;
101
101
  product: ElementConfig<string>;
102
+ ariaLabel?: ElementConfig<string | null>;
102
103
  boxLayout: ElementConfig<BoxLayout>;
103
104
  displayMode: ElementConfig<DisplayMode>;
104
105
  minHeight: ElementConfig<string | number>;
106
+ isDecorative?: ElementConfig<boolean>;
105
107
  verticalAlign: ElementConfig<VerticalAlign>;
106
108
  horizontalAlign: ElementConfig<VerticalAlign>;
107
109
  };
@@ -112,6 +114,7 @@ type CmsElementImage = Omit<Schemas["CmsSlot"], "config"> & {
112
114
  mediaId: string;
113
115
  url: string;
114
116
  newTab: boolean;
117
+ ariaLabel?: string | null;
115
118
  apiAlias: "cms_image";
116
119
  media: Schemas["Media"];
117
120
  };
@@ -121,8 +124,8 @@ type SliderElementConfig = {
121
124
  minHeight: ElementConfig<string | number>;
122
125
  verticalAlign?: ElementConfig<VerticalAlign>;
123
126
  displayMode?: ElementConfig<"standard" | "cover" | "contain">;
124
- navigationDots?: ElementConfig<"outside" | "inside" | "">;
125
- navigationArrows?: ElementConfig<"outside" | "inside" | "">;
127
+ navigationDots?: ElementConfig<"outside" | "inside" | "none" | "">;
128
+ navigationArrows?: ElementConfig<"outside" | "inside" | "none" | "">;
126
129
  };
127
130
  type ImageSliderElementConfig = ImageElementConfig & SliderElementConfig & {
128
131
  sliderItems: ElementConfig<Array<{
@@ -363,6 +366,7 @@ type CmsElementManufacturerLogo = Omit<Schemas["CmsSlot"], "config"> & {
363
366
  mediaId: string;
364
367
  url: string;
365
368
  newTab: boolean;
369
+ ariaLabel?: string | null;
366
370
  apiAlias: "cms_manufacturer_logo";
367
371
  media: Schemas["Media"];
368
372
  };
@@ -391,6 +395,8 @@ type UseCmsElementImage = {
391
395
  newTab: boolean;
392
396
  url: string;
393
397
  }>;
398
+ ariaLabel: ComputedRef<string>;
399
+ isDecorative: ComputedRef<boolean>;
394
400
  displayMode: ComputedRef<DisplayMode>;
395
401
  isVideoElement: ComputedRef<boolean>;
396
402
  mimeType: ComputedRef<string | undefined>;
@@ -408,13 +414,9 @@ declare function useCmsElementImage(element: CmsElementImage | CmsElementManufac
408
414
  * @category CMS (Shopping Experiences)
409
415
  */
410
416
  declare function useCmsElementConfig<T extends Omit<Schemas["CmsSlot"], "config"> & {
411
- config: T["config"] extends {
412
- [key in infer X extends keyof T["config"]]: ElementConfig<unknown>;
413
- } ? {
414
- [key in X]: ElementConfig<T["config"][key]["value"]>;
415
- } : never;
417
+ config: Record<string, ElementConfig<unknown> | undefined>;
416
418
  }>(element: T): {
417
- getConfigValue: <ELEMENT_CONFIG extends keyof T["config"]>(key: ELEMENT_CONFIG) => (typeof element.config)[ELEMENT_CONFIG]["value"];
419
+ getConfigValue: <ELEMENT_CONFIG extends keyof T["config"]>(key: ELEMENT_CONFIG) => NonNullable<T["config"][ELEMENT_CONFIG]>["value"];
418
420
  };
419
421
 
420
422
  declare function createShopwareContext(app: App, options: {
@@ -572,7 +574,7 @@ type UseBreadcrumbsReturn = {
572
574
  };
573
575
  /**
574
576
  * Composable for breadcrumbs management.
575
- * Read the [guide](https://frontends.shopware.com/getting-started/page-elements/breadcrumbs.html#building-breadcrumbs-for-cms-pages).
577
+ * Read the [guide](https://developer.shopware.com/frontends/guides/page-elements/breadcrumbs.html#building-breadcrumbs-for-cms-pages).
576
578
  *
577
579
  * @public
578
580
  * @category CMS (Shopping Experiences)
@@ -671,13 +673,14 @@ type UseCartReturn = {
671
673
  /**
672
674
  * Cart management logic.
673
675
  *
674
- * Used as [Shared](https://frontends.shopware.com/framework/composables/shared-composables.html) Composable `useCart`
676
+ * Used as [Shared](https://developer.shopware.com/frontends/concepts/composables/shared-composables.html) Composable `useCart`
675
677
  *
676
678
  * @category Cart & Checkout
677
679
  */
678
680
  declare function useCartFunction(): UseCartReturn;
679
681
  declare const useCart: typeof useCartFunction;
680
682
 
683
+ type LineItemOptions = Schemas["PropertyGroupOption"][];
681
684
  type UseCartItemReturn = {
682
685
  /**
683
686
  * Calculated price {number} for the current item
@@ -698,7 +701,7 @@ type UseCartItemReturn = {
698
701
  /**
699
702
  * Options (of variation) for the current item
700
703
  */
701
- itemOptions: ComputedRef<Schemas["LineItem"]["payload"]["options"]>;
704
+ itemOptions: ComputedRef<LineItemOptions>;
702
705
  /**
703
706
  * Type of the current item: "product" or "promotion"
704
707
  */
@@ -941,7 +944,7 @@ type UseCountriesReturn = {
941
944
  * @public
942
945
  * @category Context & Language
943
946
  */
944
- declare function useCountries(): UseCountriesReturn;
947
+ declare function useCountries(criteria?: Schemas["Criteria"]): UseCountriesReturn;
945
948
 
946
949
  type UseCustomerOrdersReturn = {
947
950
  /**
@@ -1137,7 +1140,7 @@ type UseListingReturn = {
1137
1140
  /**
1138
1141
  * Available sorting orders
1139
1142
  */
1140
- getSortingOrders: ComputedRef<Schemas["ProductSorting"][] | {
1143
+ getSortingOrders: ComputedRef<Schemas["ProductListingResult"]["availableSortings"] | {
1141
1144
  key: string;
1142
1145
  label: string;
1143
1146
  }[] | undefined>;
@@ -1840,7 +1843,7 @@ declare function useProductReviews(product: Ref<Schemas["Product"]>): UseProduct
1840
1843
  type UseProductSearchReturnOptions = {
1841
1844
  withCmsAssociations?: boolean;
1842
1845
  criteria?: Partial<Schemas["Criteria"]>;
1843
- associations?: Partial<Schemas["Association"]>;
1846
+ associations?: Partial<Schemas["Associations"]>;
1844
1847
  };
1845
1848
  type UseProductSearchReturn = {
1846
1849
  /**
@@ -1949,6 +1952,10 @@ type UseSessionContextReturn = {
1949
1952
  sessionContext: ComputedRef<Schemas["SalesChannelContext"] | undefined>;
1950
1953
  /**
1951
1954
  * Fetches the session context and assigns the result to the `sessionContext` property
1955
+ *
1956
+ * Throws when the context cannot be loaded. Callers that depend on a verified
1957
+ * context switch, such as logout or checkout flows, should block progression
1958
+ * when this fails.
1952
1959
  */
1953
1960
  refreshSessionContext(): Promise<void>;
1954
1961
  /**
@@ -2285,13 +2292,36 @@ declare function useWishlist(): UseWishlistReturn;
2285
2292
  type UseB2bQuoteManagement = {
2286
2293
  getQuoteList: () => Promise<Schemas["Quote"][]>;
2287
2294
  getQuote: (quoteId: string) => Promise<Schemas["Quote"]>;
2295
+ /**
2296
+ * @deprecated use `declineQuoteWithComment` instead — it sends the
2297
+ * `lineItemId` and `versionId` that `POST /quote/{id}/decline` expects.
2298
+ * A `comment`-only body is still accepted at runtime on 6.7.12+: the API
2299
+ * schema marks `lineItemId` and `versionId` as required, but the endpoint
2300
+ * does not validate the request body, so existing callers keep working.
2301
+ * Removed in v2.
2302
+ */
2288
2303
  declineQuote: (quoteId: string, comment: string) => Promise<void>;
2304
+ declineQuoteWithComment: (quoteId: string, params: DeclineQuoteParams) => Promise<void>;
2305
+ createDraftQuoteVersion: (quoteId: string) => Promise<string>;
2306
+ deleteDraftQuoteVersion: (quoteId: string, versionId: string) => Promise<void>;
2289
2307
  requestChangeQuote: (quoteId: string, comment: string) => Promise<void>;
2290
2308
  requestQuote: (comment: string) => Promise<Schemas["Quote"]>;
2291
2309
  createOrderFromQuote: (quoteId: string, comment: string) => Promise<Schemas["Order"]>;
2292
2310
  changeShippingMethod: (quoteId: string, shippingMethodId: string) => Promise<void>;
2293
2311
  changePaymentMethod: (quoteId: string, paymentMethodId: string) => Promise<void>;
2294
2312
  };
2313
+ type DeclineQuoteParams = {
2314
+ /** Message content */
2315
+ comment: string;
2316
+ /** Identifier of the quote line item that owns the new comment */
2317
+ lineItemId: string;
2318
+ /**
2319
+ * Draft version identifier of the quote currently shown in storefront,
2320
+ * as returned by `createDraftQuoteVersion`. This is not the `versionId`
2321
+ * property of the quote entity.
2322
+ */
2323
+ versionId: string;
2324
+ };
2295
2325
  type ChangePaymentShippingMethodParams = {
2296
2326
  quoteId: string;
2297
2327
  paymentMethodId?: string;
@@ -2303,7 +2333,8 @@ type ChangePaymentShippingMethodParams = {
2303
2333
  * With this composable you can:
2304
2334
  * - Get list of quotes
2305
2335
  * - Get quote details
2306
- * - Decline quote
2336
+ * - Create and delete a storefront draft version of the quote
2337
+ * - Decline quote, with or without a line item comment
2307
2338
  * - Request change of the quote
2308
2339
  * - Change shipping method
2309
2340
  * - Change payment method
@@ -2369,4 +2400,4 @@ declare function getDefaultApiParams(): {
2369
2400
  };
2370
2401
 
2371
2402
  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 };
2372
- 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 };
2403
+ 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, DeclineQuoteParams, 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 };
package/dist/index.d.ts CHANGED
@@ -99,9 +99,11 @@ type ImageElementConfig = {
99
99
  media: ElementConfig<string>;
100
100
  newTab: ElementConfig<boolean>;
101
101
  product: ElementConfig<string>;
102
+ ariaLabel?: ElementConfig<string | null>;
102
103
  boxLayout: ElementConfig<BoxLayout>;
103
104
  displayMode: ElementConfig<DisplayMode>;
104
105
  minHeight: ElementConfig<string | number>;
106
+ isDecorative?: ElementConfig<boolean>;
105
107
  verticalAlign: ElementConfig<VerticalAlign>;
106
108
  horizontalAlign: ElementConfig<VerticalAlign>;
107
109
  };
@@ -112,6 +114,7 @@ type CmsElementImage = Omit<Schemas["CmsSlot"], "config"> & {
112
114
  mediaId: string;
113
115
  url: string;
114
116
  newTab: boolean;
117
+ ariaLabel?: string | null;
115
118
  apiAlias: "cms_image";
116
119
  media: Schemas["Media"];
117
120
  };
@@ -121,8 +124,8 @@ type SliderElementConfig = {
121
124
  minHeight: ElementConfig<string | number>;
122
125
  verticalAlign?: ElementConfig<VerticalAlign>;
123
126
  displayMode?: ElementConfig<"standard" | "cover" | "contain">;
124
- navigationDots?: ElementConfig<"outside" | "inside" | "">;
125
- navigationArrows?: ElementConfig<"outside" | "inside" | "">;
127
+ navigationDots?: ElementConfig<"outside" | "inside" | "none" | "">;
128
+ navigationArrows?: ElementConfig<"outside" | "inside" | "none" | "">;
126
129
  };
127
130
  type ImageSliderElementConfig = ImageElementConfig & SliderElementConfig & {
128
131
  sliderItems: ElementConfig<Array<{
@@ -363,6 +366,7 @@ type CmsElementManufacturerLogo = Omit<Schemas["CmsSlot"], "config"> & {
363
366
  mediaId: string;
364
367
  url: string;
365
368
  newTab: boolean;
369
+ ariaLabel?: string | null;
366
370
  apiAlias: "cms_manufacturer_logo";
367
371
  media: Schemas["Media"];
368
372
  };
@@ -391,6 +395,8 @@ type UseCmsElementImage = {
391
395
  newTab: boolean;
392
396
  url: string;
393
397
  }>;
398
+ ariaLabel: ComputedRef<string>;
399
+ isDecorative: ComputedRef<boolean>;
394
400
  displayMode: ComputedRef<DisplayMode>;
395
401
  isVideoElement: ComputedRef<boolean>;
396
402
  mimeType: ComputedRef<string | undefined>;
@@ -408,13 +414,9 @@ declare function useCmsElementImage(element: CmsElementImage | CmsElementManufac
408
414
  * @category CMS (Shopping Experiences)
409
415
  */
410
416
  declare function useCmsElementConfig<T extends Omit<Schemas["CmsSlot"], "config"> & {
411
- config: T["config"] extends {
412
- [key in infer X extends keyof T["config"]]: ElementConfig<unknown>;
413
- } ? {
414
- [key in X]: ElementConfig<T["config"][key]["value"]>;
415
- } : never;
417
+ config: Record<string, ElementConfig<unknown> | undefined>;
416
418
  }>(element: T): {
417
- getConfigValue: <ELEMENT_CONFIG extends keyof T["config"]>(key: ELEMENT_CONFIG) => (typeof element.config)[ELEMENT_CONFIG]["value"];
419
+ getConfigValue: <ELEMENT_CONFIG extends keyof T["config"]>(key: ELEMENT_CONFIG) => NonNullable<T["config"][ELEMENT_CONFIG]>["value"];
418
420
  };
419
421
 
420
422
  declare function createShopwareContext(app: App, options: {
@@ -572,7 +574,7 @@ type UseBreadcrumbsReturn = {
572
574
  };
573
575
  /**
574
576
  * Composable for breadcrumbs management.
575
- * Read the [guide](https://frontends.shopware.com/getting-started/page-elements/breadcrumbs.html#building-breadcrumbs-for-cms-pages).
577
+ * Read the [guide](https://developer.shopware.com/frontends/guides/page-elements/breadcrumbs.html#building-breadcrumbs-for-cms-pages).
576
578
  *
577
579
  * @public
578
580
  * @category CMS (Shopping Experiences)
@@ -671,13 +673,14 @@ type UseCartReturn = {
671
673
  /**
672
674
  * Cart management logic.
673
675
  *
674
- * Used as [Shared](https://frontends.shopware.com/framework/composables/shared-composables.html) Composable `useCart`
676
+ * Used as [Shared](https://developer.shopware.com/frontends/concepts/composables/shared-composables.html) Composable `useCart`
675
677
  *
676
678
  * @category Cart & Checkout
677
679
  */
678
680
  declare function useCartFunction(): UseCartReturn;
679
681
  declare const useCart: typeof useCartFunction;
680
682
 
683
+ type LineItemOptions = Schemas["PropertyGroupOption"][];
681
684
  type UseCartItemReturn = {
682
685
  /**
683
686
  * Calculated price {number} for the current item
@@ -698,7 +701,7 @@ type UseCartItemReturn = {
698
701
  /**
699
702
  * Options (of variation) for the current item
700
703
  */
701
- itemOptions: ComputedRef<Schemas["LineItem"]["payload"]["options"]>;
704
+ itemOptions: ComputedRef<LineItemOptions>;
702
705
  /**
703
706
  * Type of the current item: "product" or "promotion"
704
707
  */
@@ -941,7 +944,7 @@ type UseCountriesReturn = {
941
944
  * @public
942
945
  * @category Context & Language
943
946
  */
944
- declare function useCountries(): UseCountriesReturn;
947
+ declare function useCountries(criteria?: Schemas["Criteria"]): UseCountriesReturn;
945
948
 
946
949
  type UseCustomerOrdersReturn = {
947
950
  /**
@@ -1137,7 +1140,7 @@ type UseListingReturn = {
1137
1140
  /**
1138
1141
  * Available sorting orders
1139
1142
  */
1140
- getSortingOrders: ComputedRef<Schemas["ProductSorting"][] | {
1143
+ getSortingOrders: ComputedRef<Schemas["ProductListingResult"]["availableSortings"] | {
1141
1144
  key: string;
1142
1145
  label: string;
1143
1146
  }[] | undefined>;
@@ -1840,7 +1843,7 @@ declare function useProductReviews(product: Ref<Schemas["Product"]>): UseProduct
1840
1843
  type UseProductSearchReturnOptions = {
1841
1844
  withCmsAssociations?: boolean;
1842
1845
  criteria?: Partial<Schemas["Criteria"]>;
1843
- associations?: Partial<Schemas["Association"]>;
1846
+ associations?: Partial<Schemas["Associations"]>;
1844
1847
  };
1845
1848
  type UseProductSearchReturn = {
1846
1849
  /**
@@ -1949,6 +1952,10 @@ type UseSessionContextReturn = {
1949
1952
  sessionContext: ComputedRef<Schemas["SalesChannelContext"] | undefined>;
1950
1953
  /**
1951
1954
  * Fetches the session context and assigns the result to the `sessionContext` property
1955
+ *
1956
+ * Throws when the context cannot be loaded. Callers that depend on a verified
1957
+ * context switch, such as logout or checkout flows, should block progression
1958
+ * when this fails.
1952
1959
  */
1953
1960
  refreshSessionContext(): Promise<void>;
1954
1961
  /**
@@ -2285,13 +2292,36 @@ declare function useWishlist(): UseWishlistReturn;
2285
2292
  type UseB2bQuoteManagement = {
2286
2293
  getQuoteList: () => Promise<Schemas["Quote"][]>;
2287
2294
  getQuote: (quoteId: string) => Promise<Schemas["Quote"]>;
2295
+ /**
2296
+ * @deprecated use `declineQuoteWithComment` instead — it sends the
2297
+ * `lineItemId` and `versionId` that `POST /quote/{id}/decline` expects.
2298
+ * A `comment`-only body is still accepted at runtime on 6.7.12+: the API
2299
+ * schema marks `lineItemId` and `versionId` as required, but the endpoint
2300
+ * does not validate the request body, so existing callers keep working.
2301
+ * Removed in v2.
2302
+ */
2288
2303
  declineQuote: (quoteId: string, comment: string) => Promise<void>;
2304
+ declineQuoteWithComment: (quoteId: string, params: DeclineQuoteParams) => Promise<void>;
2305
+ createDraftQuoteVersion: (quoteId: string) => Promise<string>;
2306
+ deleteDraftQuoteVersion: (quoteId: string, versionId: string) => Promise<void>;
2289
2307
  requestChangeQuote: (quoteId: string, comment: string) => Promise<void>;
2290
2308
  requestQuote: (comment: string) => Promise<Schemas["Quote"]>;
2291
2309
  createOrderFromQuote: (quoteId: string, comment: string) => Promise<Schemas["Order"]>;
2292
2310
  changeShippingMethod: (quoteId: string, shippingMethodId: string) => Promise<void>;
2293
2311
  changePaymentMethod: (quoteId: string, paymentMethodId: string) => Promise<void>;
2294
2312
  };
2313
+ type DeclineQuoteParams = {
2314
+ /** Message content */
2315
+ comment: string;
2316
+ /** Identifier of the quote line item that owns the new comment */
2317
+ lineItemId: string;
2318
+ /**
2319
+ * Draft version identifier of the quote currently shown in storefront,
2320
+ * as returned by `createDraftQuoteVersion`. This is not the `versionId`
2321
+ * property of the quote entity.
2322
+ */
2323
+ versionId: string;
2324
+ };
2295
2325
  type ChangePaymentShippingMethodParams = {
2296
2326
  quoteId: string;
2297
2327
  paymentMethodId?: string;
@@ -2303,7 +2333,8 @@ type ChangePaymentShippingMethodParams = {
2303
2333
  * With this composable you can:
2304
2334
  * - Get list of quotes
2305
2335
  * - Get quote details
2306
- * - Decline quote
2336
+ * - Create and delete a storefront draft version of the quote
2337
+ * - Decline quote, with or without a line item comment
2307
2338
  * - Request change of the quote
2308
2339
  * - Change shipping method
2309
2340
  * - Change payment method
@@ -2369,4 +2400,4 @@ declare function getDefaultApiParams(): {
2369
2400
  };
2370
2401
 
2371
2402
  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 };
2372
- 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 };
2403
+ 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, DeclineQuoteParams, 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 };