@moonbase.sh/vue 0.4.55 → 0.4.57
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 +7 -2
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +7 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -85,12 +85,17 @@ function closeCheckout() {
|
|
|
85
85
|
(_a = iframe.contentWindow) == null ? void 0 : _a.postMessage("close", "*");
|
|
86
86
|
}
|
|
87
87
|
function mountCheckout(endpoint) {
|
|
88
|
+
var _a;
|
|
88
89
|
if (typeof window === "undefined") {
|
|
89
90
|
console.warn("Can not mount checkout server side");
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
93
|
if (document.getElementById("moonbase-checkout"))
|
|
93
94
|
return;
|
|
95
|
+
const colorScheme = (_a = document.head.querySelector('meta[name="color-scheme"]')) == null ? void 0 : _a.getAttribute("content");
|
|
96
|
+
if (colorScheme) {
|
|
97
|
+
endpoint += `${endpoint.includes("?") ? "&" : "?"}color_scheme=${encodeURIComponent(colorScheme)}`;
|
|
98
|
+
}
|
|
94
99
|
const iframe = document.createElement("iframe");
|
|
95
100
|
iframe.id = "moonbase-checkout";
|
|
96
101
|
iframe.src = endpoint;
|
|
@@ -111,7 +116,7 @@ function mountCheckout(endpoint) {
|
|
|
111
116
|
document.body.append(iframe);
|
|
112
117
|
document.documentElement.style.overflow = "hidden";
|
|
113
118
|
window.onmessage = function(e) {
|
|
114
|
-
var
|
|
119
|
+
var _a2;
|
|
115
120
|
try {
|
|
116
121
|
const evnt = eventSchema.parse(e.data);
|
|
117
122
|
if (evnt.event === "close") {
|
|
@@ -129,7 +134,7 @@ function mountCheckout(endpoint) {
|
|
|
129
134
|
}));
|
|
130
135
|
}
|
|
131
136
|
} catch (err) {
|
|
132
|
-
if (((
|
|
137
|
+
if (((_a2 = e.data) == null ? void 0 : _a2.source) === "moonbase-checkout") {
|
|
133
138
|
console.error("Could not parse event:", e.data, err);
|
|
134
139
|
}
|
|
135
140
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -459,7 +459,11 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
459
459
|
maxNumberOfActivations: number;
|
|
460
460
|
createdAt: Date;
|
|
461
461
|
expiresAt?: Date | undefined;
|
|
462
|
-
externalFulfillment?: string |
|
|
462
|
+
externalFulfillment?: string | {
|
|
463
|
+
data: string;
|
|
464
|
+
fileName: string;
|
|
465
|
+
contentType: string;
|
|
466
|
+
} | undefined;
|
|
463
467
|
}>>;
|
|
464
468
|
getLicenseActivations: (licenseId: string, nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
465
469
|
id: string;
|
|
@@ -579,7 +583,11 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
579
583
|
maxNumberOfActivations: number;
|
|
580
584
|
createdAt: Date;
|
|
581
585
|
expiresAt?: Date | undefined;
|
|
582
|
-
externalFulfillment?: string |
|
|
586
|
+
externalFulfillment?: string | {
|
|
587
|
+
data: string;
|
|
588
|
+
fileName: string;
|
|
589
|
+
contentType: string;
|
|
590
|
+
} | undefined;
|
|
583
591
|
}>>;
|
|
584
592
|
getProductActivations: (productId: string, nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
585
593
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -459,7 +459,11 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
459
459
|
maxNumberOfActivations: number;
|
|
460
460
|
createdAt: Date;
|
|
461
461
|
expiresAt?: Date | undefined;
|
|
462
|
-
externalFulfillment?: string |
|
|
462
|
+
externalFulfillment?: string | {
|
|
463
|
+
data: string;
|
|
464
|
+
fileName: string;
|
|
465
|
+
contentType: string;
|
|
466
|
+
} | undefined;
|
|
463
467
|
}>>;
|
|
464
468
|
getLicenseActivations: (licenseId: string, nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
465
469
|
id: string;
|
|
@@ -579,7 +583,11 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
579
583
|
maxNumberOfActivations: number;
|
|
580
584
|
createdAt: Date;
|
|
581
585
|
expiresAt?: Date | undefined;
|
|
582
|
-
externalFulfillment?: string |
|
|
586
|
+
externalFulfillment?: string | {
|
|
587
|
+
data: string;
|
|
588
|
+
fileName: string;
|
|
589
|
+
contentType: string;
|
|
590
|
+
} | undefined;
|
|
583
591
|
}>>;
|
|
584
592
|
getProductActivations: (productId: string, nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
585
593
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -53,12 +53,17 @@ function closeCheckout() {
|
|
|
53
53
|
(_a = iframe.contentWindow) == null ? void 0 : _a.postMessage("close", "*");
|
|
54
54
|
}
|
|
55
55
|
function mountCheckout(endpoint) {
|
|
56
|
+
var _a;
|
|
56
57
|
if (typeof window === "undefined") {
|
|
57
58
|
console.warn("Can not mount checkout server side");
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
if (document.getElementById("moonbase-checkout"))
|
|
61
62
|
return;
|
|
63
|
+
const colorScheme = (_a = document.head.querySelector('meta[name="color-scheme"]')) == null ? void 0 : _a.getAttribute("content");
|
|
64
|
+
if (colorScheme) {
|
|
65
|
+
endpoint += `${endpoint.includes("?") ? "&" : "?"}color_scheme=${encodeURIComponent(colorScheme)}`;
|
|
66
|
+
}
|
|
62
67
|
const iframe = document.createElement("iframe");
|
|
63
68
|
iframe.id = "moonbase-checkout";
|
|
64
69
|
iframe.src = endpoint;
|
|
@@ -79,7 +84,7 @@ function mountCheckout(endpoint) {
|
|
|
79
84
|
document.body.append(iframe);
|
|
80
85
|
document.documentElement.style.overflow = "hidden";
|
|
81
86
|
window.onmessage = function(e) {
|
|
82
|
-
var
|
|
87
|
+
var _a2;
|
|
83
88
|
try {
|
|
84
89
|
const evnt = eventSchema.parse(e.data);
|
|
85
90
|
if (evnt.event === "close") {
|
|
@@ -97,7 +102,7 @@ function mountCheckout(endpoint) {
|
|
|
97
102
|
}));
|
|
98
103
|
}
|
|
99
104
|
} catch (err) {
|
|
100
|
-
if (((
|
|
105
|
+
if (((_a2 = e.data) == null ? void 0 : _a2.source) === "moonbase-checkout") {
|
|
101
106
|
console.error("Could not parse event:", e.data, err);
|
|
102
107
|
}
|
|
103
108
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.57",
|
|
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.4.
|
|
22
|
+
"@moonbase.sh/storefront-api": "0.4.57"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|