@zenky/storefront-vue 0.10.18 → 0.11.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/CHANGELOG.md +37 -0
- package/dist/cart/index.js +5 -5
- package/dist/{chunk-6BXHWR5E.js → chunk-5KCBZJV3.js} +45 -12
- package/dist/chunk-5KCBZJV3.js.map +1 -0
- package/dist/{chunk-LABBB43Q.js → chunk-KK645XNR.js} +162 -4
- package/dist/chunk-KK645XNR.js.map +1 -0
- package/dist/{chunk-YTYCSTHP.js → chunk-PBBVWWMI.js} +3 -3
- package/dist/{chunk-YTYCSTHP.js.map → chunk-PBBVWWMI.js.map} +1 -1
- package/dist/{chunk-2DUKIVKC.js → chunk-QFKA2R6D.js} +3 -3
- package/dist/{chunk-2DUKIVKC.js.map → chunk-QFKA2R6D.js.map} +1 -1
- package/dist/{chunk-T52G6JN7.js → chunk-TXR76IDL.js} +16 -3
- package/dist/chunk-TXR76IDL.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/products/index.d.ts +41 -2
- package/dist/products/index.js +2 -2
- package/dist/promotions/index.js +2 -2
- package/dist/seo/index.js +3 -3
- package/dist/stores/index.d.ts +3 -2
- package/dist/stores/index.js +3 -3
- package/docs/consumer-setup.md +1 -1
- package/package.json +3 -3
- package/dist/chunk-6BXHWR5E.js.map +0 -1
- package/dist/chunk-LABBB43Q.js.map +0 -1
- package/dist/chunk-T52G6JN7.js.map +0 -1
package/dist/products/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UnitType, Product, ProductVariant, NestedCategory, ProductModifiersRequest, Discount, ProductVariantOptionValue, PaginatedResponse } from '@zenky/storefront-api';
|
|
1
|
+
import { UnitType, Product, ProductVariant, NestedCategory, ProductModifiersRequest, Discount, ProductVariantOptionValue, PaginatedResponse, ProductBadgeColors, ProductBadge } from '@zenky/storefront-api';
|
|
2
2
|
import { ComputedRef, Ref } from 'vue';
|
|
3
3
|
import { S as StaticCatalogItem } from '../catalogEntity-C2UxCFng.js';
|
|
4
4
|
|
|
@@ -122,4 +122,43 @@ interface UseProductListApi {
|
|
|
122
122
|
}
|
|
123
123
|
declare function useProductList(): UseProductListApi;
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
/** A merchant badge validated and normalized for rendering. */
|
|
126
|
+
interface ProductBadgeView {
|
|
127
|
+
id: string;
|
|
128
|
+
label: string | null;
|
|
129
|
+
emoji: string | null;
|
|
130
|
+
imageUrl: string | null;
|
|
131
|
+
colors: ProductBadgeColors | null;
|
|
132
|
+
}
|
|
133
|
+
/** `image-square`: an image without a label, drawn as a square with no background. */
|
|
134
|
+
type ProductBadgeLayout = 'text' | 'image-square';
|
|
135
|
+
/** Colors derived from a badge's own text/background pair, for styles other than solid. */
|
|
136
|
+
interface ProductBadgeAccent {
|
|
137
|
+
base: string;
|
|
138
|
+
shifted: string;
|
|
139
|
+
on: string;
|
|
140
|
+
text: string;
|
|
141
|
+
glass: string;
|
|
142
|
+
}
|
|
143
|
+
interface ProductBadgeVisibility {
|
|
144
|
+
showText: boolean;
|
|
145
|
+
showImages: boolean;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Validates the backend `Product.badges` list: drops badges with nothing to show, repeated
|
|
149
|
+
* ids and unusable icons, accepts only hex colors (alpha is ignored) and http(s) image urls.
|
|
150
|
+
* `colors` is `null` when either color is missing or invalid, so the consumer can fall back
|
|
151
|
+
* to its own theme.
|
|
152
|
+
*/
|
|
153
|
+
declare function toProductBadgeViews(badges: ProductBadge[] | null | undefined): ProductBadgeView[];
|
|
154
|
+
declare function getProductBadgeLayout(badge: ProductBadgeView): ProductBadgeLayout;
|
|
155
|
+
/**
|
|
156
|
+
* Derives a palette from the badge's own colors: the more chromatic of text/background
|
|
157
|
+
* becomes the accent (darker one when both are neutral), `on` is white or black, whichever
|
|
158
|
+
* stays readable on it, `shifted` is the hue-rotated gradient end and `glass` is a
|
|
159
|
+
* translucent fill. Pure JS math, no CSS color functions, so it works for any hex input.
|
|
160
|
+
*/
|
|
161
|
+
declare function getProductBadgeAccent(colors: ProductBadgeColors): ProductBadgeAccent;
|
|
162
|
+
declare function filterProductBadges(badges: ProductBadgeView[], visibility: ProductBadgeVisibility): ProductBadgeView[];
|
|
163
|
+
|
|
164
|
+
export { type CatalogProductMatch, type CategoryWithProducts, type OrderCredentials, type ProductBadgeAccent, type ProductBadgeLayout, type ProductBadgeView, type ProductBadgeVisibility, type ProductListParams, type ProductVariantOptionListItem, type ResolvedPrice, type UseProductDetailApi, type UseProductListApi, canAddDirectly, filterProductBadges, findProductInCatalog, formatWeight, getProductBadgeAccent, getProductBadgeLayout, getProductWeight, getVariantWeight, resolveVariantPrice, toGrams, toProductBadgeViews, usePriceRecalculation, useProductDetail, useProductList, useProductPricing, useProductVariant, useProductVariantModifiers, useProductVariantSelector, useProductsByCategory, useRelatedProducts };
|
package/dist/products/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { canAddDirectly, findProductInCatalog, formatWeight, getProductWeight, getVariantWeight, resolveVariantPrice, toGrams, usePriceRecalculation, useProductDetail, useProductList, useProductPricing, useProductVariant, useProductVariantModifiers, useProductVariantSelector, useProductsByCategory, useRelatedProducts } from '../chunk-
|
|
1
|
+
export { canAddDirectly, filterProductBadges, findProductInCatalog, formatWeight, getProductBadgeAccent, getProductBadgeLayout, getProductWeight, getVariantWeight, resolveVariantPrice, toGrams, toProductBadgeViews, usePriceRecalculation, useProductDetail, useProductList, useProductPricing, useProductVariant, useProductVariantModifiers, useProductVariantSelector, useProductsByCategory, useRelatedProducts } from '../chunk-KK645XNR.js';
|
|
2
2
|
import '../chunk-XUGXLJZB.js';
|
|
3
3
|
import '../chunk-5QCUH3FF.js';
|
|
4
4
|
import '../chunk-4JCJHAL3.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-TXR76IDL.js';
|
|
6
6
|
import '../chunk-IOYYCA75.js';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/promotions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { usePromotionsChecker } from '../chunk-
|
|
1
|
+
export { usePromotionsChecker } from '../chunk-QFKA2R6D.js';
|
|
2
2
|
import '../chunk-544USTPB.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-TXR76IDL.js';
|
|
4
4
|
import '../chunk-IOYYCA75.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/seo/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { resolveVariantPrice } from '../chunk-
|
|
1
|
+
import { resolveVariantPrice } from '../chunk-KK645XNR.js';
|
|
2
2
|
import { getSocialLinks } from '../chunk-RURXGVWW.js';
|
|
3
3
|
import '../chunk-XUGXLJZB.js';
|
|
4
4
|
import '../chunk-5QCUH3FF.js';
|
|
5
5
|
import '../chunk-4JCJHAL3.js';
|
|
6
|
-
import '../chunk-T52G6JN7.js';
|
|
7
|
-
import '../chunk-IOYYCA75.js';
|
|
8
6
|
import { minorToMajorString } from '../chunk-2Y6QTHXI.js';
|
|
7
|
+
import '../chunk-TXR76IDL.js';
|
|
8
|
+
import '../chunk-IOYYCA75.js';
|
|
9
9
|
import { ContactType } from '@zenky/storefront-api';
|
|
10
10
|
|
|
11
11
|
// src/seo/utils.ts
|
package/dist/stores/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as vue from 'vue';
|
|
|
3
3
|
import { Ref, ComputedRef } from 'vue';
|
|
4
4
|
import { S as StaticCatalogItem } from '../catalogEntity-C2UxCFng.js';
|
|
5
5
|
import * as _zenky_storefront_api from '@zenky/storefront-api';
|
|
6
|
-
import { Product, Store, City, Stock, NestedCategory, DeliveryMethod, Order, OrderDeliveryMethod, OrderSettings, OrderCheckoutTotal, PaymentMethod, OrderPaymentTransaction, OrderProductVariant, OrderPaymentMethod } from '@zenky/storefront-api';
|
|
6
|
+
import { Product, Store, City, Stock, NestedCategory, DeliveryMethod, Order, OrderDeliveryMethod, OrderSettings, OrderCheckoutTotal, PaymentMethod, OrderPackage, OrderPaymentTransaction, OrderProductVariant, OrderPaymentMethod } from '@zenky/storefront-api';
|
|
7
7
|
import { Website } from '../website-settings/index.js';
|
|
8
8
|
import { a as AuthStep, f as CodeContext, g as ConfirmationChannel, e as ChannelIntent, S as SelectableConfirmationChannel } from '../types-CXm2F6Hz.js';
|
|
9
9
|
import { R as RecaptchaPayloadProvider } from '../useCheckoutSubmit-C934F26-.js';
|
|
@@ -174,6 +174,7 @@ interface CartStore {
|
|
|
174
174
|
minPriceViolation: Ref<MinPriceViolation | null>;
|
|
175
175
|
setOrder: (order: Order) => void;
|
|
176
176
|
patchOrder: (partial: Order) => void;
|
|
177
|
+
setOrderPackages: (packages: OrderPackage[], packagingPrice: number | null) => void;
|
|
177
178
|
setCredentials: (credentials: CartCredentials) => void;
|
|
178
179
|
setLoading: (value: boolean) => void;
|
|
179
180
|
setInitializing: (value: boolean) => void;
|
|
@@ -210,7 +211,7 @@ interface CartStore {
|
|
|
210
211
|
hasBonusesApplied: ComputedRef<boolean>;
|
|
211
212
|
productQuantities: ComputedRef<Record<string, number>>;
|
|
212
213
|
}
|
|
213
|
-
declare const useCartStore: pinia.StoreDefinition<"zenky-cart", Pick<CartStore, "order" | "credentials" | "loading" | "initializing" | "optimisticAdjustments" | "lineOptimistic" | "deliveryMethods" | "orderSettings" | "comment" | "personsCount" | "checkoutTotal" | "selectedPaymentMethod" | "selectedPaymentBill" | "selectedCardTokenId" | "selectedSaveCard" | "bonusesIntent" | "deliveryTimeIntent" | "minPriceViolation">, Pick<CartStore, "variants" | "hasOrder" | "hasCredentials" | "totalPrice" | "itemCount" | "availableDeliveryMethodIds" | "paymentMethods" | "hasBonusesApplied" | "productQuantities">, Pick<CartStore, "setOrder" | "patchOrder" | "setCredentials" | "setLoading" | "setInitializing" | "adjustOptimistic" | "clearOptimistic" | "adjustLineOptimistic" | "setDeliveryMethods" | "setOrderSettings" | "clearOrderSettings" | "setComment" | "setPersonsCount" | "setSelectedPaymentMethod" | "setSelectedPaymentBill" | "setSelectedCardTokenId" | "setSelectedSaveCard" | "setBonusesIntentEnabled" | "setDesiredBonusesAmount" | "setBonusesRequiresConfirmation" | "clearBonusesIntent" | "setDeliveryTimeIntent" | "restorePaymentSelection" | "validatePaymentSelection" | "setOrderPaymentsState" | "setCheckoutTotal" | "clearCheckoutTotal" | "clearCart">>;
|
|
214
|
+
declare const useCartStore: pinia.StoreDefinition<"zenky-cart", Pick<CartStore, "order" | "credentials" | "loading" | "initializing" | "optimisticAdjustments" | "lineOptimistic" | "deliveryMethods" | "orderSettings" | "comment" | "personsCount" | "checkoutTotal" | "selectedPaymentMethod" | "selectedPaymentBill" | "selectedCardTokenId" | "selectedSaveCard" | "bonusesIntent" | "deliveryTimeIntent" | "minPriceViolation">, Pick<CartStore, "variants" | "hasOrder" | "hasCredentials" | "totalPrice" | "itemCount" | "availableDeliveryMethodIds" | "paymentMethods" | "hasBonusesApplied" | "productQuantities">, Pick<CartStore, "setOrder" | "patchOrder" | "setOrderPackages" | "setCredentials" | "setLoading" | "setInitializing" | "adjustOptimistic" | "clearOptimistic" | "adjustLineOptimistic" | "setDeliveryMethods" | "setOrderSettings" | "clearOrderSettings" | "setComment" | "setPersonsCount" | "setSelectedPaymentMethod" | "setSelectedPaymentBill" | "setSelectedCardTokenId" | "setSelectedSaveCard" | "setBonusesIntentEnabled" | "setDesiredBonusesAmount" | "setBonusesRequiresConfirmation" | "clearBonusesIntent" | "setDeliveryTimeIntent" | "restorePaymentSelection" | "validatePaymentSelection" | "setOrderPaymentsState" | "setCheckoutTotal" | "clearCheckoutTotal" | "clearCart">>;
|
|
214
215
|
|
|
215
216
|
interface RewardSelectionContext {
|
|
216
217
|
type: string;
|
package/dist/stores/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { RESEND_TIMER_SECONDS, useAuthFlowStore, useProductsStore, useStore, useStorefrontProfile } from '../chunk-
|
|
1
|
+
export { RESEND_TIMER_SECONDS, useAuthFlowStore, useProductsStore, useStore, useStorefrontProfile } from '../chunk-PBBVWWMI.js';
|
|
2
2
|
import '../chunk-5B2P5W3E.js';
|
|
3
3
|
import '../chunk-TE42OCFK.js';
|
|
4
|
-
export { usePromotionsStore } from '../chunk-544USTPB.js';
|
|
5
4
|
export { useCatalogStore } from '../chunk-4JCJHAL3.js';
|
|
6
|
-
export { useAuthStore, useCartStore, useOrderSettingsStore } from '../chunk-T52G6JN7.js';
|
|
7
5
|
import '../chunk-TIQ7AJLY.js';
|
|
6
|
+
export { usePromotionsStore } from '../chunk-544USTPB.js';
|
|
7
|
+
export { useAuthStore, useCartStore, useOrderSettingsStore } from '../chunk-TXR76IDL.js';
|
|
8
8
|
export { useStoreProfileStore } from '../chunk-IOYYCA75.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/docs/consumer-setup.md
CHANGED
|
@@ -11,7 +11,7 @@ Use an exact version while integrating or testing a prerelease. Upgrade delibera
|
|
|
11
11
|
after the consumer quality gate is green.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install --save-exact @zenky/storefront-vue@0.
|
|
14
|
+
npm install --save-exact @zenky/storefront-vue@0.11.0
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
The consumer must also provide compatible peer dependencies:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenky/storefront-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Zenky Storefront SDK for Vue 3.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zenky",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"@zenky/integrations-sdk": ">=0.1.3",
|
|
122
|
-
"@zenky/storefront-api": "^1.
|
|
122
|
+
"@zenky/storefront-api": "^1.7.0",
|
|
123
123
|
"pinia": "^3.0.0",
|
|
124
124
|
"vue": "^3.5.0"
|
|
125
125
|
},
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"@types/node": "^22.10.0",
|
|
130
130
|
"@vitest/coverage-v8": "^4.1.10",
|
|
131
131
|
"@zenky/integrations-sdk": "^0.1.3",
|
|
132
|
-
"@zenky/storefront-api": "^1.
|
|
132
|
+
"@zenky/storefront-api": "^1.7.0",
|
|
133
133
|
"pinia": "^3.0.4",
|
|
134
134
|
"publint": "^0.3.21",
|
|
135
135
|
"tsup": "^8.3.5",
|