@moonbase.sh/vue 0.1.81 → 0.1.83

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
@@ -278,7 +278,29 @@ function useCart() {
278
278
  if (!storefront)
279
279
  throw new Error("No storefront configured");
280
280
  return {
281
- items: (0, import_vue8.computed)(() => storefront.currentOrder.value.items),
281
+ items: (0, import_vue8.computed)(() => storefront.currentOrder.value.items.map((item) => {
282
+ if (item.type === "Product") {
283
+ const product = storefront.storefront.value.products.find((p) => p.id === item.productId);
284
+ const variations = (product == null ? void 0 : product.variations) || [];
285
+ const variation = variations.find((v) => v.id === item.variationId);
286
+ return {
287
+ ...item,
288
+ product,
289
+ variation,
290
+ price: variation == null ? void 0 : variation.price
291
+ };
292
+ } else {
293
+ const bundle = storefront.storefront.value.bundles.find((b) => b.id === item.bundleId);
294
+ const variations = (bundle == null ? void 0 : bundle.variations) || [];
295
+ const variation = variations.find((v) => v.id === item.variationId);
296
+ return {
297
+ ...item,
298
+ bundle,
299
+ variation,
300
+ price: variation == null ? void 0 : variation.price
301
+ };
302
+ }
303
+ })),
282
304
  currency: (0, import_vue8.computed)(() => storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency),
283
305
  total: (0, import_vue8.computed)(() => {
284
306
  const currency = storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency;
package/dist/index.d.cts CHANGED
@@ -145,6 +145,14 @@ declare function useVoucher(): {
145
145
  tagline: string;
146
146
  iconUrl: string | null;
147
147
  owned: boolean;
148
+ currentVersion?: string | undefined;
149
+ downloads?: {
150
+ path: string | null;
151
+ name: string;
152
+ key: string;
153
+ platform: _moonbase_sh_storefront_api.Platform;
154
+ size: number;
155
+ }[] | undefined;
148
156
  defaultVariation?: {
149
157
  id: string;
150
158
  name: string;
@@ -202,6 +210,14 @@ declare function useVoucher(): {
202
210
  tagline: string;
203
211
  iconUrl: string | null;
204
212
  owned: boolean;
213
+ currentVersion?: string | undefined;
214
+ downloads?: {
215
+ path: string | null;
216
+ name: string;
217
+ key: string;
218
+ platform: _moonbase_sh_storefront_api.Platform;
219
+ size: number;
220
+ }[] | undefined;
205
221
  defaultVariation?: {
206
222
  id: string;
207
223
  name: string;
@@ -299,6 +315,14 @@ declare function useVoucher(): {
299
315
  tagline: string;
300
316
  iconUrl: string | null;
301
317
  owned: boolean;
318
+ currentVersion?: string | undefined;
319
+ downloads?: {
320
+ path: string | null;
321
+ name: string;
322
+ key: string;
323
+ platform: _moonbase_sh_storefront_api.Platform;
324
+ size: number;
325
+ }[] | undefined;
302
326
  defaultVariation?: {
303
327
  id: string;
304
328
  name: string;
@@ -356,6 +380,14 @@ declare function useVoucher(): {
356
380
  tagline: string;
357
381
  iconUrl: string | null;
358
382
  owned: boolean;
383
+ currentVersion?: string | undefined;
384
+ downloads?: {
385
+ path: string | null;
386
+ name: string;
387
+ key: string;
388
+ platform: _moonbase_sh_storefront_api.Platform;
389
+ size: number;
390
+ }[] | undefined;
359
391
  defaultVariation?: {
360
392
  id: string;
361
393
  name: string;
@@ -475,6 +507,14 @@ declare function useCart(): {
475
507
  tagline: string;
476
508
  iconUrl: string | null;
477
509
  owned: boolean;
510
+ currentVersion?: string | undefined;
511
+ downloads?: {
512
+ path: string | null;
513
+ name: string;
514
+ key: string;
515
+ platform: _moonbase_sh_storefront_api.Platform;
516
+ size: number;
517
+ }[] | undefined;
478
518
  defaultVariation?: {
479
519
  id: string;
480
520
  name: string;
@@ -569,6 +609,14 @@ declare function useCart(): {
569
609
  tagline: string;
570
610
  iconUrl: string | null;
571
611
  owned: boolean;
612
+ currentVersion?: string | undefined;
613
+ downloads?: {
614
+ path: string | null;
615
+ name: string;
616
+ key: string;
617
+ platform: _moonbase_sh_storefront_api.Platform;
618
+ size: number;
619
+ }[] | undefined;
572
620
  defaultVariation?: {
573
621
  id: string;
574
622
  name: string;
package/dist/index.d.ts CHANGED
@@ -145,6 +145,14 @@ declare function useVoucher(): {
145
145
  tagline: string;
146
146
  iconUrl: string | null;
147
147
  owned: boolean;
148
+ currentVersion?: string | undefined;
149
+ downloads?: {
150
+ path: string | null;
151
+ name: string;
152
+ key: string;
153
+ platform: _moonbase_sh_storefront_api.Platform;
154
+ size: number;
155
+ }[] | undefined;
148
156
  defaultVariation?: {
149
157
  id: string;
150
158
  name: string;
@@ -202,6 +210,14 @@ declare function useVoucher(): {
202
210
  tagline: string;
203
211
  iconUrl: string | null;
204
212
  owned: boolean;
213
+ currentVersion?: string | undefined;
214
+ downloads?: {
215
+ path: string | null;
216
+ name: string;
217
+ key: string;
218
+ platform: _moonbase_sh_storefront_api.Platform;
219
+ size: number;
220
+ }[] | undefined;
205
221
  defaultVariation?: {
206
222
  id: string;
207
223
  name: string;
@@ -299,6 +315,14 @@ declare function useVoucher(): {
299
315
  tagline: string;
300
316
  iconUrl: string | null;
301
317
  owned: boolean;
318
+ currentVersion?: string | undefined;
319
+ downloads?: {
320
+ path: string | null;
321
+ name: string;
322
+ key: string;
323
+ platform: _moonbase_sh_storefront_api.Platform;
324
+ size: number;
325
+ }[] | undefined;
302
326
  defaultVariation?: {
303
327
  id: string;
304
328
  name: string;
@@ -356,6 +380,14 @@ declare function useVoucher(): {
356
380
  tagline: string;
357
381
  iconUrl: string | null;
358
382
  owned: boolean;
383
+ currentVersion?: string | undefined;
384
+ downloads?: {
385
+ path: string | null;
386
+ name: string;
387
+ key: string;
388
+ platform: _moonbase_sh_storefront_api.Platform;
389
+ size: number;
390
+ }[] | undefined;
359
391
  defaultVariation?: {
360
392
  id: string;
361
393
  name: string;
@@ -475,6 +507,14 @@ declare function useCart(): {
475
507
  tagline: string;
476
508
  iconUrl: string | null;
477
509
  owned: boolean;
510
+ currentVersion?: string | undefined;
511
+ downloads?: {
512
+ path: string | null;
513
+ name: string;
514
+ key: string;
515
+ platform: _moonbase_sh_storefront_api.Platform;
516
+ size: number;
517
+ }[] | undefined;
478
518
  defaultVariation?: {
479
519
  id: string;
480
520
  name: string;
@@ -569,6 +609,14 @@ declare function useCart(): {
569
609
  tagline: string;
570
610
  iconUrl: string | null;
571
611
  owned: boolean;
612
+ currentVersion?: string | undefined;
613
+ downloads?: {
614
+ path: string | null;
615
+ name: string;
616
+ key: string;
617
+ platform: _moonbase_sh_storefront_api.Platform;
618
+ size: number;
619
+ }[] | undefined;
572
620
  defaultVariation?: {
573
621
  id: string;
574
622
  name: string;
package/dist/index.js CHANGED
@@ -244,7 +244,29 @@ function useCart() {
244
244
  if (!storefront)
245
245
  throw new Error("No storefront configured");
246
246
  return {
247
- items: computed5(() => storefront.currentOrder.value.items),
247
+ items: computed5(() => storefront.currentOrder.value.items.map((item) => {
248
+ if (item.type === "Product") {
249
+ const product = storefront.storefront.value.products.find((p) => p.id === item.productId);
250
+ const variations = (product == null ? void 0 : product.variations) || [];
251
+ const variation = variations.find((v) => v.id === item.variationId);
252
+ return {
253
+ ...item,
254
+ product,
255
+ variation,
256
+ price: variation == null ? void 0 : variation.price
257
+ };
258
+ } else {
259
+ const bundle = storefront.storefront.value.bundles.find((b) => b.id === item.bundleId);
260
+ const variations = (bundle == null ? void 0 : bundle.variations) || [];
261
+ const variation = variations.find((v) => v.id === item.variationId);
262
+ return {
263
+ ...item,
264
+ bundle,
265
+ variation,
266
+ price: variation == null ? void 0 : variation.price
267
+ };
268
+ }
269
+ })),
248
270
  currency: computed5(() => storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency),
249
271
  total: computed5(() => {
250
272
  const currency = storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/vue",
3
3
  "type": "module",
4
- "version": "0.1.81",
4
+ "version": "0.1.83",
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",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@vue/devtools-api": "^6.5.1",
20
20
  "uuid": "^9.0.1",
21
- "@moonbase.sh/storefront-api": "0.1.81"
21
+ "@moonbase.sh/storefront-api": "0.1.83"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/uuid": "^9.0.7",