@best-bundles/bundle-ui 0.0.37 → 0.0.39
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/adapters/LiquidAdapter.d.ts.map +1 -1
- package/dist/api/fetchActiveBundleConfigs.d.ts +7 -0
- package/dist/api/fetchActiveBundleConfigs.d.ts.map +1 -0
- package/dist/api/fetchBundleConfig.d.ts +1 -0
- package/dist/api/fetchBundleConfig.d.ts.map +1 -1
- package/dist/api/fetchBundleConfigStatus.d.ts +8 -0
- package/dist/api/fetchBundleConfigStatus.d.ts.map +1 -0
- package/dist/context/BundleProvider.d.ts +19 -20
- package/dist/context/BundleProvider.d.ts.map +1 -1
- package/dist/index.js +1244 -1125
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.js +17 -17
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/liquid/iife.d.ts +8 -2
- package/dist/liquid/iife.d.ts.map +1 -1
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiquidAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/LiquidAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"LiquidAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/LiquidAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,UAAU,CAAC;AAuE3E,wBAAgB,uBAAuB,IAAI,iBAAiB,CA2C3D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PublicActiveBundleConfigsResponse } from "../types";
|
|
2
|
+
export declare function fetchActiveBundleConfigs(params: {
|
|
3
|
+
apiBaseUrl: string;
|
|
4
|
+
shop: string;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}): Promise<PublicActiveBundleConfigsResponse>;
|
|
7
|
+
//# sourceMappingURL=fetchActiveBundleConfigs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchActiveBundleConfigs.d.ts","sourceRoot":"","sources":["../../src/api/fetchActiveBundleConfigs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAElE,wBAAsB,wBAAwB,CAAC,MAAM,EAAE;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAgB7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchBundleConfig.d.ts","sourceRoot":"","sources":["../../src/api/fetchBundleConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"fetchBundleConfig.d.ts","sourceRoot":"","sources":["../../src/api/fetchBundleConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAuBtC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PublicBundleConfigStatusResponse } from "../types";
|
|
2
|
+
export declare function fetchBundleConfigStatus(params: {
|
|
3
|
+
apiBaseUrl: string;
|
|
4
|
+
shop: string;
|
|
5
|
+
configHandle?: string;
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
}): Promise<PublicBundleConfigStatusResponse>;
|
|
8
|
+
//# sourceMappingURL=fetchBundleConfigStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchBundleConfigStatus.d.ts","sourceRoot":"","sources":["../../src/api/fetchBundleConfigStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAEjE,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAmB5C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { BundleCartAdapter, BundleConfig, BundleEligibleVariant, PublicBundleConfigResponse } from "../types";
|
|
1
|
+
import type { BundleCartAdapter, BundleConfig, BundleEligibleVariant, PublicActiveBundleConfigsResponse, PublicBundleConfigResponse, PublicBundleConfigStatusResponse } from "../types";
|
|
3
2
|
type BundleProviderData = {
|
|
4
3
|
currencyCode: string | null;
|
|
5
4
|
config: BundleConfig;
|
|
@@ -7,44 +6,44 @@ type BundleProviderData = {
|
|
|
7
6
|
};
|
|
8
7
|
type BundleSelectionState = Record<string, number>;
|
|
9
8
|
type BundleSelectionOrder = string[];
|
|
9
|
+
type OpenSource = "api" | "hash" | "click";
|
|
10
10
|
export type BundleProviderProps = {
|
|
11
11
|
apiBaseUrl: string;
|
|
12
12
|
shop: string;
|
|
13
13
|
cartAdapter: BundleCartAdapter;
|
|
14
|
-
/**
|
|
15
|
-
* v1 default is "default" to mirror the app's current single-config endpoint.
|
|
16
|
-
* Kept as a prop to avoid an API break when the public endpoint supports multiple handles.
|
|
17
|
-
*/
|
|
18
14
|
configHandle?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Optional override for Storybook/tests so we can avoid network calls.
|
|
21
|
-
*/
|
|
22
15
|
initialData?: BundleProviderData;
|
|
23
|
-
/**
|
|
24
|
-
* Optional fetcher override for Storybook/tests.
|
|
25
|
-
*/
|
|
26
16
|
configFetcher?: (params: {
|
|
27
17
|
apiBaseUrl: string;
|
|
28
18
|
shop: string;
|
|
29
19
|
configHandle?: string;
|
|
20
|
+
fresh?: boolean;
|
|
30
21
|
signal?: AbortSignal;
|
|
31
22
|
}) => Promise<PublicBundleConfigResponse>;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
activeConfigsFetcher?: (params: {
|
|
24
|
+
apiBaseUrl: string;
|
|
25
|
+
shop: string;
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}) => Promise<PublicActiveBundleConfigsResponse>;
|
|
28
|
+
configStatusFetcher?: (params: {
|
|
29
|
+
apiBaseUrl: string;
|
|
30
|
+
shop: string;
|
|
31
|
+
configHandle?: string;
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
}) => Promise<PublicBundleConfigStatusResponse>;
|
|
35
34
|
analyticsEndpoint?: string;
|
|
36
|
-
/**
|
|
37
|
-
* When true, the drawer may open even when config is inactive (e.g. styling preview).
|
|
38
|
-
* Default false for storefront; set true for preview contexts.
|
|
39
|
-
*/
|
|
40
35
|
allowDrawerWhenInactive?: boolean;
|
|
41
36
|
children: React.ReactNode;
|
|
42
37
|
};
|
|
43
38
|
export type BundleBuilderContextValue = {
|
|
44
39
|
isOpen: boolean;
|
|
45
40
|
open: () => void;
|
|
41
|
+
openForHandle: (handle: string, source?: OpenSource) => void;
|
|
46
42
|
close: () => void;
|
|
47
43
|
toggle: () => void;
|
|
44
|
+
currentHandle: string;
|
|
45
|
+
setConfigHandle: (handle: string) => void;
|
|
46
|
+
loadHandle: (handle: string) => void;
|
|
48
47
|
loading: boolean;
|
|
49
48
|
submitting: boolean;
|
|
50
49
|
error: string | null;
|
|
@@ -61,7 +60,7 @@ export type BundleBuilderContextValue = {
|
|
|
61
60
|
submit: () => Promise<void>;
|
|
62
61
|
submitAndCheckout: () => Promise<void>;
|
|
63
62
|
};
|
|
64
|
-
export declare const BundleBuilderContext:
|
|
63
|
+
export declare const BundleBuilderContext: import("react").Context<BundleBuilderContextValue | null>;
|
|
65
64
|
export declare function BundleProvider(props: BundleProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
66
65
|
export {};
|
|
67
66
|
//# sourceMappingURL=BundleProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleProvider.d.ts","sourceRoot":"","sources":["../../src/context/BundleProvider.tsx"],"names":[],"mappings":"
|
|
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,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,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