cloudcommerce 0.26.2 → 0.26.3

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.
Files changed (132) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  3. package/ecomplus-stores/barra-doce/functions/ssr/index.js +0 -1
  4. package/ecomplus-stores/barra-doce/functions/ssr/package.json +8 -8
  5. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartItem.vue +64 -0
  6. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +38 -7
  7. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +2 -3
  8. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +8 -4
  9. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  10. package/ecomplus-stores/barra-doce/package.json +2 -2
  11. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  12. package/ecomplus-stores/iluminim/functions/ssr/package.json +8 -8
  13. package/ecomplus-stores/iluminim/functions/ssr/src/components/CartItem.vue +64 -0
  14. package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +37 -6
  15. package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +2 -3
  16. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +6 -2
  17. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  18. package/ecomplus-stores/iluminim/package.json +2 -2
  19. package/package.json +3 -3
  20. package/packages/api/package.json +1 -1
  21. package/packages/apps/affilate-program/package.json +1 -1
  22. package/packages/apps/correios/package.json +1 -1
  23. package/packages/apps/custom-payment/package.json +1 -1
  24. package/packages/apps/custom-shipping/package.json +1 -1
  25. package/packages/apps/datafrete/package.json +1 -1
  26. package/packages/apps/discounts/package.json +1 -1
  27. package/packages/apps/emails/package.json +2 -2
  28. package/packages/apps/fb-conversions/package.json +1 -1
  29. package/packages/apps/flash-courier/package.json +1 -1
  30. package/packages/apps/frenet/package.json +1 -1
  31. package/packages/apps/galaxpay/package.json +1 -1
  32. package/packages/apps/google-analytics/package.json +1 -1
  33. package/packages/apps/jadlog/package.json +1 -1
  34. package/packages/apps/loyalty-points/package.json +1 -1
  35. package/packages/apps/melhor-envio/package.json +1 -1
  36. package/packages/apps/mercadopago/package.json +1 -1
  37. package/packages/apps/pagarme/package.json +1 -1
  38. package/packages/apps/paghiper/package.json +1 -1
  39. package/packages/apps/pix/package.json +1 -1
  40. package/packages/apps/tiny-erp/package.json +1 -1
  41. package/packages/apps/webhooks/package.json +1 -1
  42. package/packages/cli/package.json +1 -1
  43. package/packages/config/package.json +1 -1
  44. package/packages/emails/package.json +1 -1
  45. package/packages/eslint/package.json +3 -3
  46. package/packages/events/package.json +1 -1
  47. package/packages/feeds/package.json +1 -1
  48. package/packages/firebase/package.json +1 -1
  49. package/packages/i18n/package.json +1 -1
  50. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js +2 -2
  51. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
  52. package/packages/modules/lib/firebase/functions-checkout/utils.js +21 -9
  53. package/packages/modules/lib/firebase/functions-checkout/utils.js.map +1 -1
  54. package/packages/modules/package.json +2 -2
  55. package/packages/modules/schemas/@checkout.cjs +0 -1
  56. package/packages/modules/src/firebase/functions-checkout/request-to-module.ts +2 -2
  57. package/packages/modules/src/firebase/functions-checkout/utils.ts +23 -9
  58. package/packages/passport/package.json +1 -1
  59. package/packages/ssr/package.json +2 -2
  60. package/packages/storefront/dist/client/_astro/{Carousel.926668f2.js → Carousel.0b24e2cb.js} +1 -1
  61. package/packages/storefront/dist/client/_astro/CartSidebar.2731d333.js +1 -0
  62. package/packages/storefront/dist/client/_astro/{HeroSlider.1f0524aa.js → HeroSlider.a70b2582.js} +1 -1
  63. package/packages/storefront/dist/client/_astro/{PitchBar.7407eeaf.js → PitchBar.13991988.js} +1 -1
  64. package/packages/storefront/dist/client/_astro/{Prices.562a32ab.js → Prices.cdfa346a.js} +1 -1
  65. package/packages/storefront/dist/client/_astro/{ProductShelf.763cd2ca.js → ProductShelf.619c56a5.js} +1 -1
  66. package/packages/storefront/dist/client/_astro/SearchModal.117a477d.js +1 -0
  67. package/packages/storefront/dist/client/_astro/{ShopHeader.126900a6.js → ShopHeader.2c2fded7.js} +2 -2
  68. package/packages/storefront/dist/client/_astro/_...slug_.b693913e.css +1 -0
  69. package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.ee681fa8.js → _plugin-vue_export-helper.fc5e2f5b.js} +1 -1
  70. package/packages/storefront/dist/client/_astro/{api.a2eda23e.js → api.39f40cd8.js} +1 -1
  71. package/packages/storefront/dist/client/_astro/client.a5d2898b.js +1 -0
  72. package/packages/storefront/dist/client/_astro/{firebase-app.93857bfb.js → firebase-app.8c541cce.js} +3 -3
  73. package/packages/storefront/dist/client/_astro/{format-money.923559cc.js → format-money.86f14860.js} +1 -1
  74. package/packages/storefront/dist/client/_astro/hoisted.d90361ee.js +1 -0
  75. package/packages/storefront/dist/client/_astro/{img.ec6ba316.js → img.d4891d80.js} +1 -1
  76. package/packages/storefront/dist/client/_astro/index.33801818.js +1 -0
  77. package/packages/storefront/dist/client/_astro/{modules-info.48980668.js → modules-info.ec412b24.js} +1 -1
  78. package/packages/storefront/dist/client/_empty-middleware.mjs +3 -0
  79. package/packages/storefront/dist/client/chunks/CartSidebar.0ce1e999.mjs +382 -0
  80. package/packages/storefront/dist/client/chunks/SearchModal.f603145b.mjs +32 -0
  81. package/packages/storefront/dist/client/chunks/astro.11be33ee.mjs +1424 -0
  82. package/packages/storefront/dist/{server/chunks/pages/_...slug_.astro.fd8a229f.mjs → client/chunks/pages/_...slug_.astro.ec6517ba.mjs} +360 -274
  83. package/packages/storefront/dist/{server/chunks/pages/account.astro.3b21bff8.mjs → client/chunks/pages/account.astro.3d2605e6.mjs} +2 -10
  84. package/packages/storefront/dist/{server/chunks/pages/index.astro.dab642f5.mjs → client/chunks/pages/index.astro.8ad03206.mjs} +167 -17
  85. package/packages/storefront/dist/{server/chunks/pages/~fallback.astro.7630c0d6.mjs → client/chunks/pages/~fallback.astro.d31d20b4.mjs} +8 -20
  86. package/packages/storefront/dist/client/chunks/sharp.3f154e38.mjs +74 -0
  87. package/packages/storefront/dist/client/manifest.e39eb543.mjs +79 -0
  88. package/packages/storefront/dist/client/pages/_---slug_.astro.mjs +23 -0
  89. package/packages/storefront/dist/client/pages/app/account.astro.mjs +23 -0
  90. package/packages/storefront/dist/client/pages/app.astro.mjs +23 -0
  91. package/packages/storefront/dist/client/pages/index.astro.mjs +23 -0
  92. package/packages/storefront/dist/client/pages/~fallback.astro.mjs +23 -0
  93. package/packages/storefront/dist/client/registerSW.js +1 -0
  94. package/packages/storefront/dist/client/renderers.mjs +369 -0
  95. package/packages/storefront/dist/client/sw.js +1 -1
  96. package/packages/storefront/dist/server/chunks/{CartSidebar.2b555408.mjs → CartSidebar.cca9fdd3.mjs} +14 -24
  97. package/packages/storefront/dist/server/chunks/{SearchModal.f418e188.mjs → SearchModal.a680efae.mjs} +8 -19
  98. package/packages/storefront/dist/server/chunks/_...f7cdc954.mjs +24 -0
  99. package/packages/storefront/dist/server/chunks/account@_@astro.fa8b921b.mjs +24 -0
  100. package/packages/storefront/dist/server/chunks/{astro.bb5b7191.mjs → astro.440a2e08.mjs} +149 -1859
  101. package/packages/storefront/dist/server/chunks/image-endpoint@_@js.802bf648.mjs +24 -0
  102. package/packages/storefront/dist/server/chunks/index@_@astro.a122f091.mjs +24 -0
  103. package/packages/storefront/dist/server/chunks/index@_@astro.da98dcbe.mjs +24 -0
  104. package/packages/storefront/dist/server/chunks/pages/_...slug_.astro.08ba5973.mjs +3930 -0
  105. package/packages/storefront/dist/server/chunks/pages/account.astro.f11f26f3.mjs +15 -0
  106. package/packages/storefront/dist/server/chunks/pages/image-endpoint.js.a9374d3e.mjs +238 -0
  107. package/packages/storefront/dist/server/chunks/pages/index.astro.079f316a.mjs +1650 -0
  108. package/packages/storefront/dist/server/chunks/pages/~fallback.astro.01594623.mjs +55 -0
  109. package/packages/storefront/dist/server/chunks/sharp.52841bb4.mjs +75 -0
  110. package/packages/storefront/dist/server/chunks/~fallback@_@astro.876a97c5.mjs +24 -0
  111. package/packages/storefront/dist/server/entry.mjs +1167 -2360
  112. package/packages/storefront/dist/server/manifest.12e7a10c.mjs +561 -0
  113. package/packages/storefront/dist/server/renderers.mjs +10 -21
  114. package/packages/storefront/package.json +6 -6
  115. package/packages/storefront/src/lib/layouts/BaseHead.astro +3 -2
  116. package/packages/test-base/package.json +1 -1
  117. package/packages/types/modules/@checkout:params.d.ts +1 -1
  118. package/packages/types/package.json +1 -1
  119. package/ecomplus-stores/iluminim/.ecomplus.cd.json +0 -5
  120. package/packages/storefront/dist/client/_astro/CartSidebar.eadba34f.js +0 -1
  121. package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +0 -1
  122. package/packages/storefront/dist/client/_astro/_...slug_.36cd433d.css +0 -1
  123. package/packages/storefront/dist/client/_astro/client.e6d9439a.js +0 -1
  124. package/packages/storefront/dist/client/_astro/hoisted.572313d6.js +0 -1
  125. package/packages/storefront/dist/client/_astro/index.709ac149.js +0 -1
  126. package/packages/storefront/dist/server/chunks/_...d32bcc0c.mjs +0 -35
  127. package/packages/storefront/dist/server/chunks/account@_@astro.0106855f.mjs +0 -35
  128. package/packages/storefront/dist/server/chunks/endpoint@_@js.35807882.mjs +0 -35
  129. package/packages/storefront/dist/server/chunks/index@_@astro.477f5af1.mjs +0 -35
  130. package/packages/storefront/dist/server/chunks/index@_@astro.e5a61d6e.mjs +0 -35
  131. package/packages/storefront/dist/server/chunks/pages/endpoint.js.247079ba.mjs +0 -119
  132. package/packages/storefront/dist/server/chunks/~fallback@_@astro.65227dd7.mjs +0 -35
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.26.3](https://github.com/ecomplus/cloud-commerce/compare/v0.26.2...v0.26.3) (2023-09-08)
6
+
7
+
8
+ ### Features
9
+
10
+ * **modules:** Checkout accepting undefined discount app id for multiple discount apps ([8c6984a](https://github.com/ecomplus/cloud-commerce/commit/8c6984a719b0b3b942ef6f4b50797beb818ebe07))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deps:** Update non-major dependencies ([#228](https://github.com/ecomplus/cloud-commerce/issues/228)) ([0aa35ea](https://github.com/ecomplus/cloud-commerce/commit/0aa35ea0fe8bbc11cc291e2266a70a646e32444b))
16
+ * **modules:** Better handling multiple results (apps) for apply discounts ([4f9126b](https://github.com/ecomplus/cloud-commerce/commit/4f9126b362d40cc87d633bde012271ac15c5bb31))
17
+
5
18
  ### [0.26.2](https://github.com/ecomplus/cloud-commerce/compare/v0.26.1...v0.26.2) (2023-08-28)
6
19
 
7
20
 
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/feeds": "^0.26.1",
19
- "@cloudcommerce/firebase": "^0.26.1",
20
- "@cloudcommerce/passport": "^0.26.1"
18
+ "@cloudcommerce/feeds": "^0.26.2",
19
+ "@cloudcommerce/firebase": "^0.26.2",
20
+ "@cloudcommerce/passport": "^0.26.2"
21
21
  }
22
22
  }
@@ -1,4 +1,3 @@
1
- process.env.SSR_SET_LINK_HEADER = false;
2
1
  import config from '@cloudcommerce/firebase/config';
3
2
  // eslint-ignore-next-line import/no-unresolved
4
3
  import { handler as renderStorefront } from './dist/server/entry.mjs';
@@ -17,15 +17,15 @@
17
17
  },
18
18
  "main": "index.js",
19
19
  "dependencies": {
20
- "@cloudcommerce/api": "^0.26.1",
21
- "@cloudcommerce/firebase": "^0.26.1",
22
- "@cloudcommerce/ssr": "^0.26.1"
20
+ "@cloudcommerce/api": "^0.26.2",
21
+ "@cloudcommerce/firebase": "^0.26.2",
22
+ "@cloudcommerce/ssr": "^0.26.2"
23
23
  },
24
24
  "devDependencies": {
25
- "@cloudcommerce/i18n": "^0.26.1",
26
- "@cloudcommerce/storefront": "^0.26.1",
27
- "@cloudcommerce/types": "^0.26.1",
28
- "@fontsource/croissant-one": "^5.0.5",
29
- "@iconify-json/mingcute": "^1.1.7"
25
+ "@cloudcommerce/i18n": "^0.26.2",
26
+ "@cloudcommerce/storefront": "^0.26.2",
27
+ "@cloudcommerce/types": "^0.26.2",
28
+ "@fontsource/croissant-one": "^5.0.9",
29
+ "@iconify-json/mingcute": "^1.1.9"
30
30
  }
31
31
  }
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <article class="relative bg-white shadow-sm">
3
+ <ALink :href="link" class="flex items-center gap-5 p-4 group">
4
+ <AImg
5
+ v-if="image"
6
+ :picture="image"
7
+ :alt="title"
8
+ class="w-20 h-20 object-cover"
9
+ />
10
+ <p class="py-2 flex-auto text-sm text-base-700
11
+ group-hover:text-base-900 group-hover:underline">
12
+ {{ title }}
13
+ </p>
14
+ </ALink>
15
+ <button
16
+ v-if="cartItem._id"
17
+ @click.stop="removeCartItem(cartItem._id)"
18
+ class="absolute top-0 right-0 p-2 opacity-70 hover:opacity-100"
19
+ :aria-label="$t.i19remove"
20
+ >
21
+ <span class="w-5 h-5 text-sm leading-none flex flex-col justify-center
22
+ rounded-full border-3 text-danger-800 border-danger-700/30">
23
+ <i class="i-close my-0 mx-auto"></i>
24
+ </span>
25
+ </button>
26
+ <div class="flex justify-between items-center border-t-2 border-base-100">
27
+ <div class="border-r-2 border-base-100">
28
+ <QuantitySelector
29
+ v-model="cartItem.quantity"
30
+ :min="cartItem.min_quantity"
31
+ :max="cartItem.max_quantity"
32
+ />
33
+ </div>
34
+ <Prices
35
+ :base-price="cartItem.base_price"
36
+ :price="finalPrice"
37
+ :has-cashback="false"
38
+ :has-price-options="false"
39
+ class="px-4 py-2.5 text-[95%] text-right"
40
+ />
41
+ </div>
42
+ </article>
43
+ </template>
44
+
45
+ <script setup lang="ts">
46
+ import { removeCartItem } from '@@sf/state/shopping-cart';
47
+ import {
48
+ type Props as UseCartItemProps,
49
+ useCartItem,
50
+ } from '@@sf/composables/use-cart-item';
51
+ import QuantitySelector from '@@sf/components/QuantitySelector.vue';
52
+ import Prices from '~/components/Prices.vue';
53
+
54
+ export type Props = UseCartItemProps;
55
+
56
+ const props = defineProps<Props>();
57
+ const {
58
+ cartItem,
59
+ title,
60
+ link,
61
+ image,
62
+ finalPrice,
63
+ } = useCartItem(props);
64
+ </script>
@@ -1,14 +1,17 @@
1
1
  <template>
2
- <aside class="flex flex-col h-full">
3
- <header class="px-6 py-4 flex justify-end items-center gap-3">
2
+ <aside class="flex flex-col h-screen bg-white">
3
+ <header class="px-6 py-4 flex justify-end items-center gap-3
4
+ shadow ring-1 ring-black/5 z-10">
4
5
  <span class="text-right text-base text-base-600 font-medium">
5
6
  {{ $t.i19myShoppingCart }}
6
7
  </span>
7
- <span class="ui-badge-pill-lg">
8
- {{ totalItems }}
8
+ <span class="min-w-[3rem] text-right">
9
+ <span class="ui-badge-pill-lg">
10
+ {{ totalItems }}
11
+ </span>
9
12
  </span>
10
13
  </header>
11
- <article class="grow bg-base-50 border-t-2 border-b-2 border-base-100">
14
+ <article class="grow overflow-y-auto bg-base-50">
12
15
  <div v-if="freeShippingFromValue" class="text-sm text-center">
13
16
  <div
14
17
  v-if="freeShippingFromValue > shoppingCart.subtotal"
@@ -19,12 +22,35 @@
19
22
  <strong class="lowercase">{{ $t.i19freeShipping }}</strong>
20
23
  </div>
21
24
  <div v-else class="p-3 bg-success-50 text-success-800">
22
- <i class="text-success-900 i-check-fill mr-1"></i>
25
+ <i class="text-success-900 i-check mr-1"></i>
23
26
  {{ $t.i19freeShippingFrom }} {{ $money(freeShippingFromValue) }}
24
27
  </div>
25
28
  </div>
29
+ <ul class="px-4 pt-4 pb-2">
30
+ <li v-for="(item, i) in shoppingCart.items" :key="i">
31
+ <CartItem :item="item" class="mb-3" />
32
+ </li>
33
+ </ul>
26
34
  </article>
27
- <footer class="p-5 shadow">
35
+ <footer class="px-5 pt-4 pb-3 ring-2 ring-black/5 z-10">
36
+ <div class="grid grid-cols-5 gap-3 items-center text-right">
37
+ <div class="col-span-2">
38
+ {{ $t.i19subtotal }}
39
+ </div>
40
+ <Prices :price="shoppingCart.subtotal" class="col-span-3 text-lg" />
41
+ </div>
42
+ <CheckoutLink class="ui-btn-lg ui-btn-primary w-full text-right my-2.5">
43
+ <i class="i-check mr-2"></i>
44
+ {{ $t.i19checkout }}
45
+ </CheckoutLink>
46
+ <a
47
+ href="#"
48
+ @click.prevent="emit('close')"
49
+ class="ui-link text-base-500 hover:text-base-700 text-sm"
50
+ >
51
+ <i class="i-arrow-left mr-1"></i>
52
+ {{ $t.i19continueShopping }}
53
+ </a>
28
54
  </footer>
29
55
  </aside>
30
56
  </template>
@@ -32,4 +58,9 @@
32
58
  <script setup lang="ts">
33
59
  import { freeShippingFromValue } from '@@sf/state/modules-info';
34
60
  import { shoppingCart, totalItems } from '@@sf/state/shopping-cart';
61
+ import CheckoutLink from '@@sf/components/CheckoutLink.vue';
62
+ import Prices from '~/components/Prices.vue';
63
+ import CartItem from '~/components/CartItem.vue';
64
+
65
+ const emit = defineEmits(['close']);
35
66
  </script>
@@ -1,9 +1,8 @@
1
1
  <template>
2
2
  <div
3
3
  class="text-base-600
4
- [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]"
4
+ [&>div]:[font-size:90%] [&_small]:[font-size:92%] [&_small]:lowercase"
5
5
  :class="isBig ? 'text-lg' : null"
6
- data-prices
7
6
  >
8
7
  <span v-if="comparePrice" class="text-base-500 mr-1 [font-size:87%]">
9
8
  <small v-if="isLiteral">
@@ -46,7 +45,7 @@
46
45
  </small>
47
46
  <span>{{ $money(installmentValue) }}</span>
48
47
  <small v-if="!monthlyInterest && isLiteral">
49
- {{ $t.i19interestFree }}
48
+ {{ ` ${$t.i19interestFree}` }}
50
49
  </small>
51
50
  </div>
52
51
  </Fade>
@@ -183,15 +183,19 @@ watchOnce(isCartOpen, () => {
183
183
  });
184
184
  const isMounted = ref(false);
185
185
  const delayedTotalItems = ref(0);
186
- const searchTerm = ref('');
187
- const searchInput = ref<HTMLElement | null>(null);
188
186
  onMounted(() => {
189
187
  isMounted.value = true;
190
188
  watch(totalItems, (newTotalItems, prevTotalItems) => {
191
- if (prevTotalItems && prevTotalItems < newTotalItems) {
192
- isCartOpen.value = true;
189
+ if (typeof prevTotalItems === 'number') {
190
+ if (prevTotalItems < newTotalItems) {
191
+ isCartOpen.value = true;
192
+ } else if (prevTotalItems && !newTotalItems) {
193
+ isCartOpen.value = false;
194
+ }
193
195
  }
194
196
  delayedTotalItems.value = newTotalItems;
195
197
  }, { immediate: true });
196
198
  });
199
+ const searchTerm = ref('');
200
+ const searchInput = ref<HTMLElement | null>(null);
197
201
  </script>
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/events": "^0.26.1",
19
- "@cloudcommerce/firebase": "^0.26.1",
20
- "@cloudcommerce/modules": "^0.26.1"
18
+ "@cloudcommerce/events": "^0.26.2",
19
+ "@cloudcommerce/firebase": "^0.26.2",
20
+ "@cloudcommerce/modules": "^0.26.2"
21
21
  }
22
22
  }
@@ -23,9 +23,9 @@
23
23
  "url": "https://github.com/ecomplus/cloud-commerce/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@cloudcommerce/cli": "^0.26.1"
26
+ "@cloudcommerce/cli": "^0.26.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@cloudcommerce/eslint": "^0.26.1"
29
+ "@cloudcommerce/eslint": "^0.26.2"
30
30
  }
31
31
  }
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/feeds": "^0.26.1",
19
- "@cloudcommerce/firebase": "^0.26.1",
20
- "@cloudcommerce/passport": "^0.26.1"
18
+ "@cloudcommerce/feeds": "^0.26.2",
19
+ "@cloudcommerce/firebase": "^0.26.2",
20
+ "@cloudcommerce/passport": "^0.26.2"
21
21
  }
22
22
  }
@@ -17,15 +17,15 @@
17
17
  },
18
18
  "main": "index.js",
19
19
  "dependencies": {
20
- "@cloudcommerce/api": "^0.26.1",
21
- "@cloudcommerce/firebase": "^0.26.1",
22
- "@cloudcommerce/ssr": "^0.26.1"
20
+ "@cloudcommerce/api": "^0.26.2",
21
+ "@cloudcommerce/firebase": "^0.26.2",
22
+ "@cloudcommerce/ssr": "^0.26.2"
23
23
  },
24
24
  "devDependencies": {
25
- "@cloudcommerce/i18n": "^0.26.1",
26
- "@cloudcommerce/storefront": "^0.26.1",
27
- "@cloudcommerce/types": "^0.26.1",
28
- "@fontsource-variable/heebo": "^5.0.5",
29
- "@iconify-json/carbon": "^1.1.18"
25
+ "@cloudcommerce/i18n": "^0.26.2",
26
+ "@cloudcommerce/storefront": "^0.26.2",
27
+ "@cloudcommerce/types": "^0.26.2",
28
+ "@fontsource-variable/heebo": "^5.0.8",
29
+ "@iconify-json/carbon": "^1.1.20"
30
30
  }
31
31
  }
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <article class="relative bg-white shadow-sm">
3
+ <ALink :href="link" class="flex items-center gap-5 p-4 group">
4
+ <AImg
5
+ v-if="image"
6
+ :picture="image"
7
+ :alt="title"
8
+ class="w-20 h-20 object-cover"
9
+ />
10
+ <p class="py-2 flex-auto text-sm text-base-700
11
+ group-hover:text-base-900 group-hover:underline">
12
+ {{ title }}
13
+ </p>
14
+ </ALink>
15
+ <button
16
+ v-if="cartItem._id"
17
+ @click.stop="removeCartItem(cartItem._id)"
18
+ class="absolute top-0 right-0 p-2 opacity-70 hover:opacity-100"
19
+ :aria-label="$t.i19remove"
20
+ >
21
+ <span class="w-5 h-5 text-sm leading-none flex flex-col justify-center
22
+ rounded-full border-3 text-danger-800 border-danger-700/30">
23
+ <i class="i-close my-0 mx-auto"></i>
24
+ </span>
25
+ </button>
26
+ <div class="flex justify-between items-center border-t-2 border-base-100">
27
+ <div class="border-r-2 border-base-100">
28
+ <QuantitySelector
29
+ v-model="cartItem.quantity"
30
+ :min="cartItem.min_quantity"
31
+ :max="cartItem.max_quantity"
32
+ />
33
+ </div>
34
+ <Prices
35
+ :base-price="cartItem.base_price"
36
+ :price="finalPrice"
37
+ :has-cashback="false"
38
+ :has-price-options="false"
39
+ class="px-4 py-2.5 text-[95%] text-right"
40
+ />
41
+ </div>
42
+ </article>
43
+ </template>
44
+
45
+ <script setup lang="ts">
46
+ import { removeCartItem } from '@@sf/state/shopping-cart';
47
+ import {
48
+ type Props as UseCartItemProps,
49
+ useCartItem,
50
+ } from '@@sf/composables/use-cart-item';
51
+ import QuantitySelector from '@@sf/components/QuantitySelector.vue';
52
+ import Prices from '~/components/Prices.vue';
53
+
54
+ export type Props = UseCartItemProps;
55
+
56
+ const props = defineProps<Props>();
57
+ const {
58
+ cartItem,
59
+ title,
60
+ link,
61
+ image,
62
+ finalPrice,
63
+ } = useCartItem(props);
64
+ </script>
@@ -1,14 +1,17 @@
1
1
  <template>
2
- <aside class="flex flex-col h-full">
3
- <header class="px-6 py-4 flex justify-end items-center gap-3">
2
+ <aside class="flex flex-col h-screen bg-white">
3
+ <header class="px-6 py-4 flex justify-end items-center gap-3
4
+ shadow ring-1 ring-black/5 z-10">
4
5
  <span class="text-right text-base text-base-600 font-medium">
5
6
  {{ $t.i19myShoppingCart }}
6
7
  </span>
7
- <span class="ui-badge-pill-lg">
8
- {{ totalItems }}
8
+ <span class="min-w-[3rem] text-right">
9
+ <span class="ui-badge-pill-lg">
10
+ {{ totalItems }}
11
+ </span>
9
12
  </span>
10
13
  </header>
11
- <article class="grow bg-base-50 border-t-2 border-b-2 border-base-100">
14
+ <article class="grow overflow-y-auto bg-base-50">
12
15
  <div v-if="freeShippingFromValue" class="text-sm text-center">
13
16
  <div
14
17
  v-if="freeShippingFromValue > shoppingCart.subtotal"
@@ -23,8 +26,31 @@
23
26
  {{ $t.i19freeShippingFrom }} {{ $money(freeShippingFromValue) }}
24
27
  </div>
25
28
  </div>
29
+ <ul class="px-4 pt-4 pb-2">
30
+ <li v-for="(item, i) in shoppingCart.items" :key="i">
31
+ <CartItem :item="item" class="mb-3" />
32
+ </li>
33
+ </ul>
26
34
  </article>
27
- <footer class="p-5 shadow">
35
+ <footer class="px-5 pt-4 pb-3 ring-2 ring-black/5 z-10">
36
+ <div class="grid grid-cols-5 gap-3 items-center text-right">
37
+ <div class="col-span-2">
38
+ {{ $t.i19subtotal }}
39
+ </div>
40
+ <Prices :price="shoppingCart.subtotal" class="col-span-3 text-lg" />
41
+ </div>
42
+ <CheckoutLink class="ui-btn-lg ui-btn-primary w-full text-right my-2.5">
43
+ <i class="i-check mr-2"></i>
44
+ {{ $t.i19checkout }}
45
+ </CheckoutLink>
46
+ <a
47
+ href="#"
48
+ @click.prevent="emit('close')"
49
+ class="ui-link text-base-500 hover:text-base-700 text-sm"
50
+ >
51
+ <i class="i-arrow-left mr-1"></i>
52
+ {{ $t.i19continueShopping }}
53
+ </a>
28
54
  </footer>
29
55
  </aside>
30
56
  </template>
@@ -32,4 +58,9 @@
32
58
  <script setup lang="ts">
33
59
  import { freeShippingFromValue } from '@@sf/state/modules-info';
34
60
  import { shoppingCart, totalItems } from '@@sf/state/shopping-cart';
61
+ import CheckoutLink from '@@sf/components/CheckoutLink.vue';
62
+ import Prices from '~/components/Prices.vue';
63
+ import CartItem from '~/components/CartItem.vue';
64
+
65
+ const emit = defineEmits(['close']);
35
66
  </script>
@@ -1,9 +1,8 @@
1
1
  <template>
2
2
  <div
3
3
  class="text-base-600
4
- [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]"
4
+ [&>div]:[font-size:90%] [&_small]:[font-size:92%] [&_small]:lowercase"
5
5
  :class="isBig ? 'text-lg' : null"
6
- data-prices
7
6
  >
8
7
  <span v-if="comparePrice" class="text-base-500 mr-1 [font-size:87%]">
9
8
  <small v-if="isLiteral">
@@ -46,7 +45,7 @@
46
45
  </small>
47
46
  <span>{{ $money(installmentValue) }}</span>
48
47
  <small v-if="!monthlyInterest && isLiteral">
49
- {{ $t.i19interestFree }}
48
+ {{ ` ${$t.i19interestFree}` }}
50
49
  </small>
51
50
  </div>
52
51
  </Fade>
@@ -145,8 +145,12 @@ const delayedTotalItems = ref(0);
145
145
  onMounted(() => {
146
146
  isMounted.value = true;
147
147
  watch(totalItems, (newTotalItems, prevTotalItems) => {
148
- if (prevTotalItems && prevTotalItems < newTotalItems) {
149
- isCartOpen.value = true;
148
+ if (typeof prevTotalItems === 'number') {
149
+ if (prevTotalItems < newTotalItems) {
150
+ isCartOpen.value = true;
151
+ } else if (prevTotalItems && !newTotalItems) {
152
+ isCartOpen.value = false;
153
+ }
150
154
  }
151
155
  delayedTotalItems.value = newTotalItems;
152
156
  }, { immediate: true });
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/events": "^0.26.1",
19
- "@cloudcommerce/firebase": "^0.26.1",
20
- "@cloudcommerce/modules": "^0.26.1"
18
+ "@cloudcommerce/events": "^0.26.2",
19
+ "@cloudcommerce/firebase": "^0.26.2",
20
+ "@cloudcommerce/modules": "^0.26.2"
21
21
  }
22
22
  }
@@ -23,9 +23,9 @@
23
23
  "url": "https://github.com/ecomplus/cloud-commerce/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@cloudcommerce/cli": "^0.26.1"
26
+ "@cloudcommerce/cli": "^0.26.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@cloudcommerce/eslint": "^0.26.1"
29
+ "@cloudcommerce/eslint": "^0.26.2"
30
30
  }
31
31
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
6
6
  "main": "packages/api/lib/index.js",
7
7
  "author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
@@ -19,7 +19,7 @@
19
19
  "@commitlint/cli": "^17.7.1",
20
20
  "@commitlint/config-conventional": "^17.7.0",
21
21
  "@commitlint/rules": "^17.7.0",
22
- "@types/node": "^18.17.12",
22
+ "@types/node": "^18.17.14",
23
23
  "eslint": "^8.48.0",
24
24
  "husky": "^8.0.3",
25
25
  "standard-version": "^9.5.0",
@@ -30,7 +30,7 @@
30
30
  "vite": "^4.4.9",
31
31
  "vitest": "^0.34.3",
32
32
  "zx": "^7.2.3",
33
- "@cloudcommerce/eslint": "0.26.2"
33
+ "@cloudcommerce/eslint": "0.26.3"
34
34
  },
35
35
  "scripts": {
36
36
  "fix-install": "bash scripts/pre-install.sh && pnpm i",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/api.js",
7
7
  "types": "lib/api.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-affilate-program",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app for simple affiliate program",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-correios",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app for Correios shipping calculation",
6
6
  "main": "lib/correios.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-payment",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app for simple custom payment methods",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-shipping",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app for custom shipping methods",
6
6
  "main": "lib/custom-shipping.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-datafrete",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Datafrete shipping gateway ",
6
6
  "main": "lib/datafrete.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "lib/discounts.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-emails",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce default transactional email app",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "@cloudcommerce/api": "workspace:*",
23
23
  "@cloudcommerce/emails": "workspace:*",
24
24
  "@cloudcommerce/firebase": "workspace:*",
25
- "@ecomplus/transactional-mails": "^2.0.0",
25
+ "@ecomplus/transactional-mails": "^2.0.2",
26
26
  "firebase-admin": "^11.10.1",
27
27
  "firebase-functions": "^4.4.1"
28
28
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-fb-conversions",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app to send carts/orders to Facebook Conversions API",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-flash-courier",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Flash Courier",
6
6
  "main": "lib/index.js",
7
7
  "exports": {