@moonbase.sh/vue 0.3.29 → 0.3.31
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 +8 -5
- package/dist/index.js +9 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -171,14 +171,17 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
171
171
|
term: urlParams.get("utm_term") || void 0,
|
|
172
172
|
content: urlParams.get("utm_content") || void 0
|
|
173
173
|
});
|
|
174
|
-
if (this.hasUtm
|
|
175
|
-
localStorage.setItem(_StorefrontContextImpl.utmKey, JSON.stringify(this.utm.value));
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
if (this.hasUtm) {
|
|
175
|
+
(configuration.persistUtm ? localStorage : sessionStorage).setItem(_StorefrontContextImpl.utmKey, JSON.stringify(this.utm.value));
|
|
176
|
+
console.log("Caching given UTM parameters:", (0, import_vue.toRaw)(this.utm.value));
|
|
177
|
+
} else {
|
|
178
|
+
const cachedUtm = (configuration.persistUtm ? localStorage : sessionStorage).getItem(_StorefrontContextImpl.utmKey);
|
|
178
179
|
if (cachedUtm) {
|
|
179
180
|
try {
|
|
180
181
|
this.utm = stateFactory(_StorefrontContextImpl.utmKey, JSON.parse(cachedUtm));
|
|
181
|
-
|
|
182
|
+
console.log("Using cached UTM parameters:", (0, import_vue.toRaw)(this.utm.value));
|
|
183
|
+
} catch (err) {
|
|
184
|
+
console.warn(`Could not parse cached UTM from ${_StorefrontContextImpl.utmKey}`, err);
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
187
|
}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TokenStore
|
|
13
13
|
} from "@moonbase.sh/storefront-api";
|
|
14
14
|
import { v4 as uuidv4 } from "uuid";
|
|
15
|
-
import { ref, watch } from "vue";
|
|
15
|
+
import { ref, toRaw, watch } from "vue";
|
|
16
16
|
|
|
17
17
|
// src/symbols.ts
|
|
18
18
|
var storefrontKey = Symbol("storefront");
|
|
@@ -141,14 +141,17 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
141
141
|
term: urlParams.get("utm_term") || void 0,
|
|
142
142
|
content: urlParams.get("utm_content") || void 0
|
|
143
143
|
});
|
|
144
|
-
if (this.hasUtm
|
|
145
|
-
localStorage.setItem(_StorefrontContextImpl.utmKey, JSON.stringify(this.utm.value));
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
if (this.hasUtm) {
|
|
145
|
+
(configuration.persistUtm ? localStorage : sessionStorage).setItem(_StorefrontContextImpl.utmKey, JSON.stringify(this.utm.value));
|
|
146
|
+
console.log("Caching given UTM parameters:", toRaw(this.utm.value));
|
|
147
|
+
} else {
|
|
148
|
+
const cachedUtm = (configuration.persistUtm ? localStorage : sessionStorage).getItem(_StorefrontContextImpl.utmKey);
|
|
148
149
|
if (cachedUtm) {
|
|
149
150
|
try {
|
|
150
151
|
this.utm = stateFactory(_StorefrontContextImpl.utmKey, JSON.parse(cachedUtm));
|
|
151
|
-
|
|
152
|
+
console.log("Using cached UTM parameters:", toRaw(this.utm.value));
|
|
153
|
+
} catch (err) {
|
|
154
|
+
console.warn(`Could not parse cached UTM from ${_StorefrontContextImpl.utmKey}`, err);
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.31",
|
|
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.3.
|
|
22
|
+
"@moonbase.sh/storefront-api": "0.3.31"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|