@moonbase.sh/vue 0.2.56 → 0.2.58
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 +4 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -165,9 +165,9 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
165
165
|
term: urlParams.get("utm_term") || void 0,
|
|
166
166
|
content: urlParams.get("utm_content") || void 0
|
|
167
167
|
});
|
|
168
|
-
if (this.hasUtm) {
|
|
168
|
+
if (this.hasUtm && configuration.persistUtm) {
|
|
169
169
|
localStorage.setItem(_StorefrontContextImpl.utmKey, JSON.stringify(this.utm.value));
|
|
170
|
-
} else {
|
|
170
|
+
} else if (configuration.persistUtm) {
|
|
171
171
|
const cachedUtm = localStorage.getItem(_StorefrontContextImpl.utmKey);
|
|
172
172
|
if (cachedUtm) {
|
|
173
173
|
try {
|
|
@@ -750,8 +750,9 @@ function useAuth(context) {
|
|
|
750
750
|
}
|
|
751
751
|
|
|
752
752
|
// src/index.ts
|
|
753
|
-
function createStorefront(endpoint, stateFactory) {
|
|
753
|
+
function createStorefront(endpoint, stateFactory, config) {
|
|
754
754
|
const configuration = {
|
|
755
|
+
...config != null ? config : {},
|
|
755
756
|
endpoint
|
|
756
757
|
};
|
|
757
758
|
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
|
@@ -130,9 +130,9 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
130
130
|
term: urlParams.get("utm_term") || void 0,
|
|
131
131
|
content: urlParams.get("utm_content") || void 0
|
|
132
132
|
});
|
|
133
|
-
if (this.hasUtm) {
|
|
133
|
+
if (this.hasUtm && configuration.persistUtm) {
|
|
134
134
|
localStorage.setItem(_StorefrontContextImpl.utmKey, JSON.stringify(this.utm.value));
|
|
135
|
-
} else {
|
|
135
|
+
} else if (configuration.persistUtm) {
|
|
136
136
|
const cachedUtm = localStorage.getItem(_StorefrontContextImpl.utmKey);
|
|
137
137
|
if (cachedUtm) {
|
|
138
138
|
try {
|
|
@@ -715,8 +715,9 @@ function useAuth(context) {
|
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
// src/index.ts
|
|
718
|
-
function createStorefront(endpoint, stateFactory) {
|
|
718
|
+
function createStorefront(endpoint, stateFactory, config) {
|
|
719
719
|
const configuration = {
|
|
720
|
+
...config != null ? config : {},
|
|
720
721
|
endpoint
|
|
721
722
|
};
|
|
722
723
|
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.58",
|
|
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.58"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|