@moonbase.sh/vue 0.2.47 → 0.2.49

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 CHANGED
@@ -642,7 +642,9 @@ function useCart(context) {
642
642
  const _ = storefront.pushOrderContent();
643
643
  },
644
644
  checkout: async (options) => {
645
- const absoluteReturnUrl = new URL(options.returnUrl, document.baseURI).href;
645
+ var _a;
646
+ const fallbackPath = typeof window !== "undefined" ? window.location.pathname : "";
647
+ const absoluteReturnUrl = new URL((_a = options.returnUrl) != null ? _a : fallbackPath, document.baseURI).href;
646
648
  const updatedOrder = await storefront.client.orders.pushContent(storefront.currentOrder.value, {
647
649
  returnUrl: absoluteReturnUrl
648
650
  });
package/dist/index.d.cts CHANGED
@@ -704,7 +704,7 @@ declare function useCart(context?: StorefrontContext): {
704
704
  removeFromCart: (cartItem: CartItem) => void;
705
705
  checkout: (options: {
706
706
  redirect: boolean;
707
- returnUrl: string;
707
+ returnUrl?: string;
708
708
  }) => Promise<{
709
709
  next: string | undefined;
710
710
  } | undefined>;
package/dist/index.d.ts CHANGED
@@ -704,7 +704,7 @@ declare function useCart(context?: StorefrontContext): {
704
704
  removeFromCart: (cartItem: CartItem) => void;
705
705
  checkout: (options: {
706
706
  redirect: boolean;
707
- returnUrl: string;
707
+ returnUrl?: string;
708
708
  }) => Promise<{
709
709
  next: string | undefined;
710
710
  } | undefined>;
package/dist/index.js CHANGED
@@ -607,7 +607,9 @@ function useCart(context) {
607
607
  const _ = storefront.pushOrderContent();
608
608
  },
609
609
  checkout: async (options) => {
610
- const absoluteReturnUrl = new URL(options.returnUrl, document.baseURI).href;
610
+ var _a;
611
+ const fallbackPath = typeof window !== "undefined" ? window.location.pathname : "";
612
+ const absoluteReturnUrl = new URL((_a = options.returnUrl) != null ? _a : fallbackPath, document.baseURI).href;
611
613
  const updatedOrder = await storefront.client.orders.pushContent(storefront.currentOrder.value, {
612
614
  returnUrl: absoluteReturnUrl
613
615
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/vue",
3
3
  "type": "module",
4
- "version": "0.2.47",
4
+ "version": "0.2.49",
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.47"
22
+ "@moonbase.sh/storefront-api": "0.2.49"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/uuid": "^9.0.8",