@best-bundles/bundle-ui 0.0.40 → 0.0.42
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/dist/components/BundleBuilderDrawer.d.ts.map +1 -1
- package/dist/components/BundleBuilderPanel.d.ts.map +1 -1
- package/dist/context/BundleProvider.d.ts +5 -0
- package/dist/context/BundleProvider.d.ts.map +1 -1
- package/dist/i18n.d.ts +8 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1599 -1449
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.css +1 -1
- package/dist/liquid/bundle-ui.iife.js +19 -19
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/liquid/iife.d.ts +3 -0
- package/dist/liquid/iife.d.ts.map +1 -1
- package/dist/stories/BundleBuilderPanel.stories.d.ts +6 -2
- package/dist/stories/BundleBuilderPanel.stories.d.ts.map +1 -1
- package/dist/stories/BundleUI.stories.d.ts +11 -6
- package/dist/stories/BundleUI.stories.d.ts.map +1 -1
- package/dist/utils/stock.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleBuilderDrawer.d.ts","sourceRoot":"","sources":["../../src/components/BundleBuilderDrawer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BundleBuilderDrawer.d.ts","sourceRoot":"","sources":["../../src/components/BundleBuilderDrawer.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,kDAkzBlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleBuilderPanel.d.ts","sourceRoot":"","sources":["../../src/components/BundleBuilderPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BundleBuilderPanel.d.ts","sourceRoot":"","sources":["../../src/components/BundleBuilderPanel.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAqiBhE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BundleCartAdapter, BundleConfig, BundleEligibleVariant, PublicActiveBundleConfigsResponse, PublicBundleConfigResponse, PublicBundleConfigStatusResponse } from "../types";
|
|
2
|
+
import type { BundleUiLocale, BundleUiMessageKey, BundleUiMessages } from "../i18n";
|
|
2
3
|
type BundleProviderData = {
|
|
3
4
|
currencyCode: string | null;
|
|
4
5
|
config: BundleConfig;
|
|
@@ -33,6 +34,8 @@ export type BundleProviderProps = {
|
|
|
33
34
|
}) => Promise<PublicBundleConfigStatusResponse>;
|
|
34
35
|
analyticsEndpoint?: string;
|
|
35
36
|
allowDrawerWhenInactive?: boolean;
|
|
37
|
+
locale?: string;
|
|
38
|
+
messages?: BundleUiMessages;
|
|
36
39
|
children: React.ReactNode;
|
|
37
40
|
};
|
|
38
41
|
export type BundleBuilderContextValue = {
|
|
@@ -61,6 +64,8 @@ export type BundleBuilderContextValue = {
|
|
|
61
64
|
canSubmit: boolean;
|
|
62
65
|
submit: () => Promise<void>;
|
|
63
66
|
submitAndCheckout: () => Promise<void>;
|
|
67
|
+
locale: BundleUiLocale;
|
|
68
|
+
t: (key: BundleUiMessageKey, vars?: Record<string, string | number>) => string;
|
|
64
69
|
};
|
|
65
70
|
export declare const BundleBuilderContext: import("react").Context<BundleBuilderContextValue | null>;
|
|
66
71
|
export declare function BundleProvider(props: BundleProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleProvider.d.ts","sourceRoot":"","sources":["../../src/context/BundleProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,iCAAiC,EACjC,0BAA0B,EAC1B,gCAAgC,EAEjC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"BundleProvider.d.ts","sourceRoot":"","sources":["../../src/context/BundleProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,iCAAiC,EACjC,0BAA0B,EAC1B,gCAAgC,EAEjC,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGpF,KAAK,kBAAkB,GAAG;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;CAC3C,CAAC;AAIF,KAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACnD,KAAK,oBAAoB,GAAG,MAAM,EAAE,CAAC;AACrC,KAAK,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,iBAAiB,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,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AAM,GAAG,IAAI,CAAC;IAErB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;IAE1C,UAAU,EAAE,oBAAoB,CAAC;IACjC,cAAc,EAAE,oBAAoB,CAAC;IACrC,+BAA+B,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC1E,WAAW,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,eAAe,EAAE,MAAM,IAAI,CAAC;IAE5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,EAAE,cAAc,CAAC;IACvB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CAChF,CAAC;AAEF,eAAO,MAAM,oBAAoB,2DAAwD,CAAC;AAwI1F,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAyzBxD"}
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type BundleUiLocale = "en" | "fr" | "de" | "es";
|
|
2
|
+
export type BundleUiMessageKey = "bundle.title.default" | "bundle.loading" | "bundle.inactive" | "bundle.drawer.aria" | "bundle.search" | "bundle.search.expanded" | "bundle.search.placeholder" | "bundle.search.clear" | "bundle.close" | "bundle.section.discount_tiers" | "bundle.section.your_bundle" | "bundle.section.select_items" | "bundle.select.items" | "bundle.size.min" | "bundle.stock.max_reached" | "bundle.stock.max_added" | "bundle.stock.sold_out" | "bundle.item.generic" | "bundle.slot" | "bundle.unlocks" | "bundle.totals" | "bundle.discount.badge" | "bundle.discount.off_label" | "bundle.celebration.received_discount" | "bundle.cta.adding" | "bundle.cta.processing" | "bundle.cta.checkout" | "bundle.cta.add_to_bundle" | "bundle.cta.add_to_basket" | "bundle.cta.add_more" | "bundle.powered_by" | "bundle.button.default" | "bundle.provider.inactive_error" | "bundle.provider.load_error" | "bundle.provider.stock_error" | "bundle.provider.add_error" | "bundle.a11y.add_to_bundle" | "bundle.a11y.remove_from_bundle" | "bundle.a11y.quantity" | "bundle.a11y.sold_out" | "bundle.a11y.max_available_selected" | "bundle.a11y.increase" | "bundle.a11y.decrease";
|
|
3
|
+
export type BundleUiMessages = Partial<Record<BundleUiMessageKey, string>>;
|
|
4
|
+
export declare function normalizeBundleLocale(raw: string | null | undefined): BundleUiLocale;
|
|
5
|
+
export declare function translateBundleUi(locale: BundleUiLocale, key: BundleUiMessageKey, vars?: Record<string, string | number>, overrides?: BundleUiMessages): string;
|
|
6
|
+
export declare function formatBundleCurrency(amount: string | number, currencyCode: string | null, locale: string): string;
|
|
7
|
+
export declare function getProductWord(locale: BundleUiLocale, count: number): "produit" | "produits" | "Produkt" | "Produkte" | "producto" | "productos" | "product" | "products";
|
|
8
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,gBAAgB,GAChB,iBAAiB,GACjB,oBAAoB,GACpB,eAAe,GACf,wBAAwB,GACxB,2BAA2B,GAC3B,qBAAqB,GACrB,cAAc,GACd,+BAA+B,GAC/B,4BAA4B,GAC5B,6BAA6B,GAC7B,qBAAqB,GACrB,iBAAiB,GACjB,0BAA0B,GAC1B,wBAAwB,GACxB,uBAAuB,GACvB,qBAAqB,GACrB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,uBAAuB,GACvB,2BAA2B,GAC3B,sCAAsC,GACtC,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,0BAA0B,GAC1B,0BAA0B,GAC1B,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,gCAAgC,GAChC,4BAA4B,GAC5B,6BAA6B,GAC7B,2BAA2B,GAC3B,2BAA2B,GAC3B,gCAAgC,GAChC,sBAAsB,GACtB,sBAAsB,GACtB,oCAAoC,GACpC,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;AAgJ3E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAMpF;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,kBAAkB,EACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACtC,SAAS,CAAC,EAAE,gBAAgB,GAC3B,MAAM,CAMR;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,UAaxG;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,uGAMnE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { BundleCartAdapter } from "./types";
|
|
2
2
|
export type { BundleConfig, BundleEligibleVariant, BundleDiscountRule, PublicBundleConfigResponse } from "./types";
|
|
3
|
+
export type { BundleUiMessages, BundleUiMessageKey, BundleUiLocale } from "./i18n";
|
|
3
4
|
export { BundleLineAttributeKeys } from "./constants";
|
|
4
5
|
export { BundleProvider } from "./context/BundleProvider";
|
|
5
6
|
export { useBundleBuilder } from "./hooks/useBundleBuilder";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,YAAY,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AACnH,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EA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