@moonbase.sh/vue 0.2.57 → 0.2.59
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/index.cjs +13 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -287,13 +287,23 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
287
287
|
const _ = this.debouncedPushOrderContent(this.currentOrder.value);
|
|
288
288
|
}
|
|
289
289
|
handleStorageUpdate(event) {
|
|
290
|
+
var _a;
|
|
290
291
|
switch (event.key) {
|
|
291
292
|
case _StorefrontContextImpl.sessionKey:
|
|
292
|
-
this.currentOrder.value = JSON.parse(event.newValue)
|
|
293
|
+
this.currentOrder.value = event.newValue ? JSON.parse(event.newValue) : {
|
|
294
|
+
id: (0, import_uuid.v4)(),
|
|
295
|
+
currency: ((_a = this.storefront.value) == null ? void 0 : _a.suggestedCurrency) || "",
|
|
296
|
+
status: import_storefront_api2.OrderStatus.Open,
|
|
297
|
+
items: [],
|
|
298
|
+
couponsApplied: []
|
|
299
|
+
};
|
|
293
300
|
break;
|
|
294
301
|
case _StorefrontContextImpl.storefrontKey:
|
|
295
302
|
this.storefront.value = JSON.parse(event.newValue);
|
|
296
303
|
break;
|
|
304
|
+
case _StorefrontContextImpl.utmKey:
|
|
305
|
+
this.utm.value = JSON.parse(event.newValue);
|
|
306
|
+
break;
|
|
297
307
|
}
|
|
298
308
|
}
|
|
299
309
|
async refreshOrder() {
|
|
@@ -750,8 +760,9 @@ function useAuth(context) {
|
|
|
750
760
|
}
|
|
751
761
|
|
|
752
762
|
// src/index.ts
|
|
753
|
-
function createStorefront(endpoint, stateFactory) {
|
|
763
|
+
function createStorefront(endpoint, stateFactory, config) {
|
|
754
764
|
const configuration = {
|
|
765
|
+
...config != null ? config : {},
|
|
755
766
|
endpoint
|
|
756
767
|
};
|
|
757
768
|
return new StorefrontContextImpl(
|
package/dist/index.d.cts
CHANGED
|
@@ -826,6 +826,6 @@ interface Cart {
|
|
|
826
826
|
items: CartItem[];
|
|
827
827
|
}
|
|
828
828
|
type CartItem = LineItem;
|
|
829
|
-
declare function createStorefront(endpoint: string, stateFactory?: StateFactory): StorefrontContext;
|
|
829
|
+
declare function createStorefront(endpoint: string, stateFactory?: StateFactory, config?: Omit<MoonbaseConfiguration, 'endpoint'>): StorefrontContext;
|
|
830
830
|
|
|
831
831
|
export { type ActivationRequestComposable, type Cart, type CartItem, createStorefront, storefrontKey, useActivationRequest, useAuth, useBundle, useBundles, useCart, useInventory, useProduct, useProducts, useVoucher };
|
package/dist/index.d.ts
CHANGED
|
@@ -826,6 +826,6 @@ interface Cart {
|
|
|
826
826
|
items: CartItem[];
|
|
827
827
|
}
|
|
828
828
|
type CartItem = LineItem;
|
|
829
|
-
declare function createStorefront(endpoint: string, stateFactory?: StateFactory): StorefrontContext;
|
|
829
|
+
declare function createStorefront(endpoint: string, stateFactory?: StateFactory, config?: Omit<MoonbaseConfiguration, 'endpoint'>): StorefrontContext;
|
|
830
830
|
|
|
831
831
|
export { type ActivationRequestComposable, type Cart, type CartItem, createStorefront, storefrontKey, useActivationRequest, useAuth, useBundle, useBundles, useCart, useInventory, useProduct, useProducts, useVoucher };
|
package/dist/index.js
CHANGED
|
@@ -252,13 +252,23 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
252
252
|
const _ = this.debouncedPushOrderContent(this.currentOrder.value);
|
|
253
253
|
}
|
|
254
254
|
handleStorageUpdate(event) {
|
|
255
|
+
var _a;
|
|
255
256
|
switch (event.key) {
|
|
256
257
|
case _StorefrontContextImpl.sessionKey:
|
|
257
|
-
this.currentOrder.value = JSON.parse(event.newValue)
|
|
258
|
+
this.currentOrder.value = event.newValue ? JSON.parse(event.newValue) : {
|
|
259
|
+
id: uuidv4(),
|
|
260
|
+
currency: ((_a = this.storefront.value) == null ? void 0 : _a.suggestedCurrency) || "",
|
|
261
|
+
status: OrderStatus.Open,
|
|
262
|
+
items: [],
|
|
263
|
+
couponsApplied: []
|
|
264
|
+
};
|
|
258
265
|
break;
|
|
259
266
|
case _StorefrontContextImpl.storefrontKey:
|
|
260
267
|
this.storefront.value = JSON.parse(event.newValue);
|
|
261
268
|
break;
|
|
269
|
+
case _StorefrontContextImpl.utmKey:
|
|
270
|
+
this.utm.value = JSON.parse(event.newValue);
|
|
271
|
+
break;
|
|
262
272
|
}
|
|
263
273
|
}
|
|
264
274
|
async refreshOrder() {
|
|
@@ -715,8 +725,9 @@ function useAuth(context) {
|
|
|
715
725
|
}
|
|
716
726
|
|
|
717
727
|
// src/index.ts
|
|
718
|
-
function createStorefront(endpoint, stateFactory) {
|
|
728
|
+
function createStorefront(endpoint, stateFactory, config) {
|
|
719
729
|
const configuration = {
|
|
730
|
+
...config != null ? config : {},
|
|
720
731
|
endpoint
|
|
721
732
|
};
|
|
722
733
|
return new StorefrontContextImpl(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.59",
|
|
5
5
|
"description": "Package to let you build vue.js storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@vue/devtools-api": "^6.6.3",
|
|
20
20
|
"uuid": "^9.0.1",
|
|
21
21
|
"zod": "^3.23.8",
|
|
22
|
-
"@moonbase.sh/storefront-api": "0.2.
|
|
22
|
+
"@moonbase.sh/storefront-api": "0.2.59"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|