cloudcommerce 0.33.0 → 0.33.2

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 (173) hide show
  1. package/.github/workflows/test-apps.yml +2 -2
  2. package/CHANGELOG.md +37 -0
  3. package/action.yml +2 -2
  4. package/ecomplus-stores/barra-doce/.github/workflows/build-and-deploy.yml +1 -1
  5. package/ecomplus-stores/barra-doce/.github/workflows/calibreapp-image-actions.yml +1 -1
  6. package/ecomplus-stores/barra-doce/.vscode/settings.json +3 -0
  7. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  8. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +1 -1
  9. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +20 -0
  10. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/products.json +2 -1
  11. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +4 -1
  12. package/ecomplus-stores/barra-doce/functions/ssr/package.json +9 -8
  13. package/ecomplus-stores/barra-doce/functions/ssr/public/robots.txt +1 -1
  14. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +15 -4
  15. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +5 -3
  16. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountPage.vue +62 -0
  17. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Banner.vue +6 -3
  18. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.astro +44 -0
  19. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartItem.vue +11 -11
  20. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +16 -13
  21. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CheckoutPage.vue +33 -0
  22. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Collapse.vue +19 -0
  23. package/ecomplus-stores/barra-doce/functions/ssr/src/components/DocDescription.vue +28 -0
  24. package/ecomplus-stores/barra-doce/functions/ssr/src/components/FooterStamps.vue +62 -0
  25. package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +14 -9
  26. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ImagesGallery.vue +151 -0
  27. package/ecomplus-stores/barra-doce/functions/ssr/src/components/LoginForm.vue +107 -0
  28. package/ecomplus-stores/barra-doce/functions/ssr/src/components/PitchBar.vue +6 -8
  29. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +3 -3
  30. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +22 -22
  31. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductDetails.vue +122 -0
  32. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +10 -12
  33. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductSpecifications.vue +42 -0
  34. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +1 -1
  35. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +7 -58
  36. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +33 -34
  37. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderMenu.vue +5 -5
  38. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +19 -11
  39. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +10 -11
  40. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenavCategory.vue +9 -10
  41. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SkuSelector.vue +58 -0
  42. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +3 -1
  43. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +1 -2
  44. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +1 -2
  45. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Sections.astro +25 -2
  46. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +12 -12
  47. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +2 -0
  48. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/_vue.ts +17 -1
  49. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +34 -0
  50. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +62 -0
  51. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +0 -5
  52. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/~fallback.astro +0 -2
  53. package/ecomplus-stores/barra-doce/functions/ssr/tailwind.config.cjs +0 -1
  54. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  55. package/ecomplus-stores/barra-doce/package.json +2 -2
  56. package/ecomplus-stores/monocard/.editorconfig +13 -0
  57. package/ecomplus-stores/monocard/.eslintrc.cjs +1 -1
  58. package/ecomplus-stores/monocard/.vscode/settings.json +5 -1
  59. package/ecomplus-stores/monocard/functions/many/package.json +3 -3
  60. package/ecomplus-stores/monocard/functions/ssr/content/extra-pages/terms.json +1 -1
  61. package/ecomplus-stores/monocard/functions/ssr/content/pages/home.json +1 -44
  62. package/ecomplus-stores/monocard/functions/ssr/content/pages/products.json +2 -1
  63. package/ecomplus-stores/monocard/functions/ssr/content/settings.json +4 -1
  64. package/ecomplus-stores/monocard/functions/ssr/package.json +8 -7
  65. package/ecomplus-stores/monocard/functions/ssr/public/robots.txt +2 -4
  66. package/ecomplus-stores/monocard/functions/ssr/src/assets/style.css +7 -2
  67. package/ecomplus-stores/monocard/functions/ssr/src/components/AccountMenu.vue +16 -14
  68. package/ecomplus-stores/monocard/functions/ssr/src/components/AccountPage.vue +62 -0
  69. package/ecomplus-stores/monocard/functions/ssr/src/components/Banner.vue +3 -3
  70. package/ecomplus-stores/monocard/functions/ssr/src/components/Breadcrumbs.astro +1 -1
  71. package/ecomplus-stores/monocard/functions/ssr/src/components/CartItem.vue +11 -11
  72. package/ecomplus-stores/monocard/functions/ssr/src/components/CartSidebar.vue +16 -13
  73. package/ecomplus-stores/monocard/functions/ssr/src/components/CheckoutPage.vue +33 -0
  74. package/ecomplus-stores/monocard/functions/ssr/src/components/Collapse.vue +19 -0
  75. package/ecomplus-stores/monocard/functions/ssr/src/components/DemoVideo.vue +1 -1
  76. package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.vue +3 -8
  77. package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +73 -79
  78. package/ecomplus-stores/monocard/functions/ssr/src/components/FooterStamps.vue +63 -0
  79. package/ecomplus-stores/monocard/functions/ssr/src/components/ImagesGallery.vue +154 -0
  80. package/ecomplus-stores/monocard/functions/ssr/src/components/LoginForm.vue +107 -0
  81. package/ecomplus-stores/monocard/functions/ssr/src/components/LottiePhoneNFC.vue +1 -3
  82. package/ecomplus-stores/monocard/functions/ssr/src/components/MonocardCustomizer.vue +21 -22
  83. package/ecomplus-stores/monocard/functions/ssr/src/components/PitchBar.vue +7 -7
  84. package/ecomplus-stores/monocard/functions/ssr/src/components/Prices.vue +3 -3
  85. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductCard.vue +24 -24
  86. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductDetails.vue +122 -0
  87. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductShelf.vue +11 -11
  88. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductSpecifications.vue +42 -0
  89. package/ecomplus-stores/monocard/functions/ssr/src/components/SearchModal.vue +1 -1
  90. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopFooter.vue +10 -62
  91. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +25 -31
  92. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeaderMenu.vue +8 -8
  93. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenav.vue +10 -11
  94. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenavCategory.vue +9 -10
  95. package/ecomplus-stores/monocard/functions/ssr/src/components/SkuSelector.vue +58 -0
  96. package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageFooter.astro +4 -3
  97. package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageHeader.astro +1 -1
  98. package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +2 -1
  99. package/ecomplus-stores/monocard/functions/ssr/src/main/Sections.astro +18 -4
  100. package/ecomplus-stores/monocard/functions/ssr/src/main/Wildcard.astro +10 -1
  101. package/ecomplus-stores/monocard/functions/ssr/src/pages/app/account.astro +34 -0
  102. package/ecomplus-stores/monocard/functions/ssr/src/pages/app/index.astro +62 -0
  103. package/ecomplus-stores/monocard/functions/ssr/src/pages/index.astro +0 -5
  104. package/ecomplus-stores/monocard/functions/ssr/src/pages/~fallback.astro +0 -2
  105. package/ecomplus-stores/monocard/functions/ssr/tailwind.config.cjs +0 -1
  106. package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
  107. package/ecomplus-stores/monocard/package.json +2 -2
  108. package/package.json +7 -7
  109. package/packages/api/package.json +1 -1
  110. package/packages/apps/affilate-program/package.json +1 -1
  111. package/packages/apps/correios/package.json +3 -3
  112. package/packages/apps/custom-payment/package.json +1 -1
  113. package/packages/apps/custom-shipping/package.json +1 -1
  114. package/packages/apps/datafrete/package.json +2 -2
  115. package/packages/apps/discounts/package.json +1 -1
  116. package/packages/apps/emails/package.json +1 -1
  117. package/packages/apps/fb-conversions/package.json +3 -3
  118. package/packages/apps/flash-courier/package.json +2 -2
  119. package/packages/apps/frenet/package.json +2 -2
  120. package/packages/apps/galaxpay/package.json +2 -2
  121. package/packages/apps/google-analytics/package.json +2 -2
  122. package/packages/apps/jadlog/package.json +2 -2
  123. package/packages/apps/loyalty-points/package.json +1 -1
  124. package/packages/apps/mandae/package.json +2 -2
  125. package/packages/apps/melhor-envio/package.json +2 -2
  126. package/packages/apps/mercadopago/package.json +2 -2
  127. package/packages/apps/pagarme/package.json +2 -2
  128. package/packages/apps/pagarme-v5/package.json +3 -3
  129. package/packages/apps/paghiper/package.json +2 -2
  130. package/packages/apps/pix/package.json +2 -2
  131. package/packages/apps/tiny-erp/package.json +2 -2
  132. package/packages/apps/webhooks/package.json +2 -2
  133. package/packages/cli/package.json +1 -1
  134. package/packages/config/package.json +1 -1
  135. package/packages/emails/package.json +4 -4
  136. package/packages/eslint/package.json +4 -4
  137. package/packages/events/package.json +1 -1
  138. package/packages/feeds/package.json +1 -1
  139. package/packages/firebase/package.json +2 -2
  140. package/packages/i18n/package.json +1 -1
  141. package/packages/modules/package.json +2 -2
  142. package/packages/passport/package.json +1 -1
  143. package/packages/ssr/package.json +2 -2
  144. package/packages/storefront/client.d.ts +3 -0
  145. package/packages/storefront/config/astro/context-directive.mjs +2 -2
  146. package/packages/storefront/package.json +9 -7
  147. package/packages/storefront/src/analytics/event-to-fbq.ts +82 -0
  148. package/packages/storefront/src/analytics/event-to-ttq.ts +15 -0
  149. package/packages/storefront/src/helpers/afetch.ts +20 -8
  150. package/packages/storefront/src/helpers/sf-utils.ts +15 -0
  151. package/packages/storefront/src/lib/components/Carousel.vue +19 -14
  152. package/packages/storefront/src/lib/composables/use-product-card.ts +12 -0
  153. package/packages/storefront/src/lib/layouts/Base.astro +1 -0
  154. package/packages/storefront/src/lib/layouts/BaseHead.astro +9 -2
  155. package/packages/storefront/src/lib/scripts/push-analytics-events.ts +88 -0
  156. package/packages/storefront/src/lib/scripts/session-utm.ts +16 -6
  157. package/packages/storefront/src/lib/scripts/vbeta-app.ts +4 -0
  158. package/packages/storefront/src/lib/ssr-context.ts +2 -2
  159. package/packages/storefront/src/lib/state/shopping-cart.ts +35 -2
  160. package/packages/storefront/src/lib/state/use-analytics.ts +283 -0
  161. package/packages/test-base/package.json +1 -1
  162. package/packages/types/package.json +1 -1
  163. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner2.webp +0 -0
  164. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/headphone.webp +0 -0
  165. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo.png +0 -0
  166. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/passion.webp +0 -0
  167. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect8589.png +0 -0
  168. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect859.png +0 -0
  169. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect89.webp +0 -0
  170. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Checkout.astro +0 -0
  171. package/ecomplus-stores/monocard/functions/ssr/content/extra-pages/contato.json +0 -11
  172. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/fluxo.png +0 -0
  173. package/ecomplus-stores/monocard/functions/ssr/src/layouts/Checkout.astro +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me",
6
6
  "main": "lib/pagarme.js",
7
7
  "exports": {
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@cloudcommerce/api": "workspace:*",
27
27
  "@cloudcommerce/firebase": "workspace:*",
28
- "axios": "^1.6.0",
28
+ "axios": "^1.6.2",
29
29
  "firebase-admin": "^11.11.0",
30
30
  "firebase-functions": "^4.5.0",
31
31
  "pagarme": "^4.33.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme-v5",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me API v5 with recurring payments",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -27,9 +27,9 @@
27
27
  "@cloudcommerce/api": "workspace:*",
28
28
  "@cloudcommerce/firebase": "workspace:*",
29
29
  "@ecomplus/utils": "1.5.0-rc.5",
30
- "axios": "^1.5.1",
30
+ "axios": "^1.6.2",
31
31
  "firebase-admin": "^11.11.0",
32
- "firebase-functions": "^4.4.1"
32
+ "firebase-functions": "^4.5.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@cloudcommerce/test-base": "workspace:*",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-paghiper",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate PagHiper",
6
6
  "main": "lib/paghiper.js",
7
7
  "exports": {
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@cloudcommerce/api": "workspace:*",
27
27
  "@cloudcommerce/firebase": "workspace:*",
28
- "axios": "^1.6.0",
28
+ "axios": "^1.6.2",
29
29
  "firebase-admin": "^11.11.0",
30
30
  "firebase-functions": "^4.5.0"
31
31
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pix",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pix API (Bacen)",
6
6
  "main": "lib/pix.js",
7
7
  "exports": {
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@cloudcommerce/api": "workspace:*",
27
27
  "@cloudcommerce/firebase": "workspace:*",
28
- "axios": "^1.6.0",
28
+ "axios": "^1.6.2",
29
29
  "firebase-admin": "^11.11.0",
30
30
  "firebase-functions": "^4.5.0"
31
31
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "@cloudcommerce/api": "workspace:*",
23
23
  "@cloudcommerce/firebase": "workspace:*",
24
24
  "@ecomplus/utils": "1.5.0-rc.5",
25
- "axios": "^1.6.0",
25
+ "axios": "^1.6.2",
26
26
  "firebase-admin": "^11.11.0",
27
27
  "firebase-functions": "^4.5.0",
28
28
  "form-data": "4.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-webhooks",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app for general order webhooks",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@cloudcommerce/api": "workspace:*",
23
23
  "@cloudcommerce/firebase": "workspace:*",
24
- "axios": "^1.6.0",
24
+ "axios": "^1.6.2",
25
25
  "firebase-admin": "^11.11.0",
26
26
  "firebase-functions": "^4.5.0"
27
27
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/config",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce base config",
6
6
  "main": "lib/config.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/emails",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce email sender",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -23,13 +23,13 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@cloudcommerce/firebase": "workspace:*",
26
- "axios": "^1.6.0",
26
+ "axios": "^1.6.2",
27
27
  "ejs": "^3.1.9",
28
28
  "nodemailer": "^6.9.7"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@cloudcommerce/types": "workspace:*",
32
- "@types/ejs": "^3.1.4",
33
- "@types/nodemailer": "^6.4.13"
32
+ "@types/ejs": "^3.1.5",
33
+ "@types/nodemailer": "^6.4.14"
34
34
  }
35
35
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/eslint",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce ESLint config",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -19,9 +19,9 @@
19
19
  "build": "echo '@ecomplus/eslint'"
20
20
  },
21
21
  "dependencies": {
22
- "@typescript-eslint/eslint-plugin": "^6.9.1",
23
- "@typescript-eslint/parser": "^6.9.1",
24
- "eslint": "^8.53.0",
22
+ "@typescript-eslint/eslint-plugin": "^6.12.0",
23
+ "@typescript-eslint/parser": "^6.12.0",
24
+ "eslint": "^8.54.0",
25
25
  "eslint-config-airbnb-base": "^15.0.0",
26
26
  "eslint-plugin-import": "^2.29.0",
27
27
  "eslint-plugin-tailwindcss": "3.13.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/feeds",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce catalog feeds",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@cloudcommerce/api": "workspace:*",
33
33
  "@cloudcommerce/config": "workspace:*",
34
- "@google-cloud/pubsub": "^4.0.6",
34
+ "@google-cloud/pubsub": "^4.0.7",
35
35
  "firebase-admin": "^11.11.0",
36
36
  "firebase-functions": "^4.5.0",
37
37
  "source-map-support": "^0.5.21"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/i18n",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce i18n",
6
6
  "main": "lib/all.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -47,7 +47,7 @@
47
47
  "@ecomplus/utils": "1.5.0-rc.5",
48
48
  "ajv": "^8.12.0",
49
49
  "ajv-formats": "^2.1.1",
50
- "axios": "^1.6.0",
50
+ "axios": "^1.6.2",
51
51
  "firebase-admin": "^11.11.0",
52
52
  "firebase-functions": "^4.5.0",
53
53
  "source-map-support": "^0.5.21"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -30,7 +30,7 @@
30
30
  "@cloudcommerce/firebase": "workspace:*",
31
31
  "@cloudcommerce/i18n": "workspace:*",
32
32
  "@ecomplus/utils": "1.5.0-rc.5",
33
- "@vueuse/core": "10.5.0",
33
+ "@vueuse/core": "10.6.1",
34
34
  "astro": "2.10.15",
35
35
  "astro-capo": "^0.0.1",
36
36
  "firebase-admin": "^11.11.0",
@@ -1,5 +1,6 @@
1
1
  /// <reference types="./src/vue-globals" />
2
2
  /// <reference types="./.auto-imports" />
3
+ /// <reference types="gtag.js" />
3
4
 
4
5
  type DocCleanupFields = 'body_html'
5
6
  | 'body_text'
@@ -29,3 +30,5 @@ interface Window {
29
30
  };
30
31
  $isCmsPreview?: boolean;
31
32
  }
33
+
34
+ declare module 'gtag.js';
@@ -23,9 +23,9 @@ export default (load, opts) => {
23
23
  if (window._firstLoadContextId === id && window._emitedContextId === id) {
24
24
  console.log('[ctx] first load');
25
25
  next();
26
- setTimeout(() => {
26
+ document.addEventListener('astro:beforeload', () => {
27
27
  delete window._firstLoadContextId;
28
- }, 49);
28
+ }, { once: true });
29
29
  return;
30
30
  }
31
31
  window.addEventListener('storefront:apiContext', next, { once: true });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.33.2",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -39,23 +39,25 @@
39
39
  "@fastify/deepmerge": "^1.3.0",
40
40
  "@iconify-json/fa6-brands": "^1.1.13",
41
41
  "@iconify-json/heroicons": "^1.1.13",
42
- "@iconify-json/logos": "^1.1.37",
43
- "@vite-pwa/astro": "^0.1.4",
44
- "@vueuse/core": "10.5.0",
42
+ "@iconify-json/logos": "^1.1.38",
43
+ "@types/gtag.js": "^0.0.18",
44
+ "@vite-pwa/astro": "^0.1.5",
45
+ "@vueuse/core": "10.6.1",
45
46
  "astro": "2.10.15",
46
47
  "astro-capo": "^0.0.1",
47
48
  "chroma-js": "^2.4.2",
48
49
  "dotenv": "^16.3.1",
49
- "firebase": "^10.5.2",
50
+ "firebase": "^10.6.0",
50
51
  "image-size": "^1.0.2",
51
52
  "mime": "^3.0.0",
53
+ "mitt": "^3.0.1",
52
54
  "semver": "^7.5.4",
53
55
  "sharp": "^0.32.6",
54
56
  "tailwindcss": "^3.3.5",
55
- "unocss": "^0.57.2",
57
+ "unocss": "^0.57.6",
56
58
  "unplugin-auto-import": "^0.16.7",
57
59
  "vite": "^4.5.0",
58
- "vite-plugin-pwa": "^0.16.7",
60
+ "vite-plugin-pwa": "^0.17.0",
59
61
  "vue": "^3.3.8"
60
62
  },
61
63
  "devDependencies": {
@@ -0,0 +1,82 @@
1
+ import type { GtagEventMessage } from '@@sf/state/use-analytics';
2
+
3
+ const pageContentState = {
4
+ waiting: Promise.resolve(),
5
+ params: {
6
+ content_ids: [] as string[],
7
+ content_name: '',
8
+ },
9
+ };
10
+
11
+ const parseGtagItem = (
12
+ item: Exclude<Gtag.EventParams['items'], undefined>[0],
13
+ currency = 'BRL',
14
+ isCartEvent = false,
15
+ ) => {
16
+ const params: Record<string, any> = {
17
+ currency,
18
+ content_category: item.item_category,
19
+ content_name: item.item_name,
20
+ value: item.price,
21
+ content_type: 'product',
22
+ };
23
+ if (isCartEvent) {
24
+ params.contents = [{
25
+ id: item.item_id,
26
+ quantity: item.quantity,
27
+ }];
28
+ } else {
29
+ params.content_ids = [item.item_id];
30
+ }
31
+ return params;
32
+ };
33
+
34
+ // https://developers.facebook.com/docs/meta-pixel/reference#standard-events
35
+ export const parseGtagToFbq = async ({ event }: GtagEventMessage) => {
36
+ if (event.name === 'page_view') {
37
+ pageContentState.waiting = new Promise((resolve) => {
38
+ setTimeout(resolve, 110);
39
+ });
40
+ pageContentState.params.content_name = event.params.page_title;
41
+ return [{ name: 'PageView' }];
42
+ }
43
+ const { items, currency } = event.params;
44
+ if (event.name === 'view_item' && items) {
45
+ const firstItem = items[0];
46
+ if (firstItem) {
47
+ if (firstItem.item_list_id === 'product-page') {
48
+ return [{
49
+ name: 'ViewContent',
50
+ params: parseGtagItem(firstItem, currency),
51
+ }];
52
+ }
53
+ items.forEach(({ item_id: id }) => {
54
+ pageContentState.params.content_ids.push(id as string);
55
+ });
56
+ if (pageContentState.params.content_ids.length > items.length) {
57
+ return [{ name: null }];
58
+ }
59
+ await pageContentState.waiting;
60
+ return [{
61
+ name: 'ViewContent',
62
+ params: {
63
+ ...pageContentState.params,
64
+ content_type: 'product',
65
+ },
66
+ }];
67
+ }
68
+ }
69
+ if ((event.name === 'add_to_cart' || event.name === 'remove_from_cart') && items) {
70
+ const isAdd = event.name === 'add_to_cart';
71
+ return items.map((item) => ({
72
+ name: 'AddToCart',
73
+ params: parseGtagItem({
74
+ ...item,
75
+ quantity: isAdd ? (item.quantity || 1) : -(item.quantity || 1),
76
+ }, currency, true),
77
+ }));
78
+ }
79
+ return [{ name: null }];
80
+ };
81
+
82
+ export default parseGtagToFbq;
@@ -0,0 +1,15 @@
1
+ import type { GtagEventMessage } from '@@sf/state/use-analytics';
2
+
3
+ export const parseGtagToTtq = (event: GtagEventMessage['event']) => {
4
+ let name = '';
5
+ const params: Record<string, any> = {};
6
+ switch (event.name) {
7
+ case 'page_view':
8
+ name = 'PageView';
9
+ break;
10
+ default:
11
+ }
12
+ return { name, params };
13
+ };
14
+
15
+ export default parseGtagToTtq;
@@ -1,6 +1,12 @@
1
1
  type FetchParams = Parameters<typeof fetch>;
2
+ type RequestInit = Exclude<FetchParams[1], undefined>;
3
+ type BodyInit = RequestInit['body'] | Record<string, any> | Array<any>;
2
4
 
3
- const afetch = (url: FetchParams[0], init?: FetchParams[1], timeout = 10000) => {
5
+ const afetch = (
6
+ url: FetchParams[0],
7
+ init?: Omit<RequestInit, 'body'> & { body?: BodyInit },
8
+ timeout = 10000,
9
+ ) => {
4
10
  let abortController: AbortController | undefined;
5
11
  let timer: NodeJS.Timeout | undefined;
6
12
  if (timeout) {
@@ -9,16 +15,22 @@ const afetch = (url: FetchParams[0], init?: FetchParams[1], timeout = 10000) =>
9
15
  (abortController as AbortController).abort();
10
16
  }, timeout);
11
17
  }
12
- if (init?.body && typeof init.body === 'object') {
13
- init.body = JSON.stringify(init.body);
14
- init.headers = {
15
- ...init.headers,
16
- 'Content-Type': 'application/json',
17
- 'Content-Length': init.body.length.toString(),
18
- };
18
+ let body: RequestInit['body'];
19
+ if (init?.body) {
20
+ if (typeof init.body === 'object') {
21
+ body = JSON.stringify(init.body);
22
+ init.headers = {
23
+ ...init.headers,
24
+ 'Content-Type': 'application/json',
25
+ 'Content-Length': body.length.toString(),
26
+ };
27
+ } else {
28
+ body = init.body;
29
+ }
19
30
  }
20
31
  const promise = fetch(url, {
21
32
  ...init,
33
+ body,
22
34
  signal: abortController?.signal,
23
35
  });
24
36
  promise.finally(() => {
@@ -10,3 +10,18 @@ export const requestIdleCallback = (fn: (...args: any[]) => any, fallbackMs = 30
10
10
  setTimeout(fn, fallbackMs);
11
11
  }
12
12
  };
13
+
14
+ export const slugify = (str: string) => {
15
+ return str
16
+ .toLowerCase()
17
+ .trim()
18
+ .replace(/[ÁáÃãÂâÀà]/g, 'a')
19
+ .replace(/[Éé]/g, 'e')
20
+ .replace(/[Íí]/g, 'i')
21
+ .replace(/[ÓóÔô]/g, 'o')
22
+ .replace(/[Úú]/g, 'u')
23
+ .replace(/[Çç]/g, 'c')
24
+ .replace(/[\W\r\n]/gm, '-')
25
+ .replace(/-{2,}/g, '-')
26
+ .replace(/(^-)|(-$)/g, '');
27
+ };
@@ -127,24 +127,29 @@ const changeSlide = (step: number, isPageScroll: boolean = true) => {
127
127
  if (slideSizes.value.length < 2) {
128
128
  return;
129
129
  }
130
- if (isPageScroll && (step === 1 || step === -1)) {
131
- let pageStep = 0;
132
- let pageStepSize = 0;
133
- for (let i = activeIndex.value; i < slideSizes.value.length; i++) {
134
- const { size } = slideSizes.value[i] || {};
135
- if (size) {
136
- pageStep += 1;
137
- pageStepSize += size;
138
- if (pageStepSize >= wrapperVisibleSize.value) {
139
- break;
130
+ let nextOffset = -1;
131
+ if (currentPos.value + wrapperVisibleSize.value >= wrapperScrollSize.value) {
132
+ nextOffset = 0;
133
+ } else {
134
+ if (isPageScroll && (step === 1 || step === -1)) {
135
+ let pageStep = 0;
136
+ let pageStepSize = 0;
137
+ for (let i = activeIndex.value; i < slideSizes.value.length; i++) {
138
+ const { size } = slideSizes.value[i] || {};
139
+ if (size) {
140
+ pageStep += 1;
141
+ pageStepSize += size;
142
+ if (pageStepSize + size * 0.75 >= wrapperVisibleSize.value) {
143
+ break;
144
+ }
140
145
  }
141
146
  }
147
+ if (pageStep) {
148
+ step = step > 0 ? pageStep : -pageStep;
149
+ }
142
150
  }
143
- if (pageStep) {
144
- step = step > 0 ? pageStep : -pageStep;
145
- }
151
+ nextOffset = calcNextOffset(step);
146
152
  }
147
- const nextOffset = calcNextOffset(step);
148
153
  wrapper.value?.scrollTo({
149
154
  [isX ? 'left' : 'top']: nextOffset,
150
155
  behavior: 'smooth',
@@ -8,6 +8,8 @@ import {
8
8
  inStock as checkInStock,
9
9
  onPromotion as checkOnPromotion,
10
10
  } from '@ecomplus/utils';
11
+ import { slugify } from '@@sf/sf-lib';
12
+ import { emitGtagEvent, getGtagItem } from '@@sf/state/use-analytics';
11
13
 
12
14
  type PictureSize = { url: string; alt?: string; size?: string };
13
15
 
@@ -16,6 +18,8 @@ export type ProductItem = Products | SearchItem;
16
18
  export type Props = {
17
19
  product?: ProductItem;
18
20
  productId?: Products['_id'];
21
+ listName?: string;
22
+ listId?: string;
19
23
  } & ({ product: ProductItem } | { productId: Products['_id'] });
20
24
 
21
25
  const useProductCard = <T extends ProductItem | undefined = undefined>(props: Props) => {
@@ -82,6 +86,14 @@ const useProductCard = <T extends ProductItem | undefined = undefined>(props: Pr
82
86
  if ((product as SearchItem).has_variations) return true;
83
87
  return Boolean(product.variations?.length);
84
88
  });
89
+ emitGtagEvent('view_item', {
90
+ value: isActive.value ? product.price : 0,
91
+ items: [{
92
+ ...getGtagItem(product),
93
+ item_list_name: props.listName,
94
+ item_list_id: props.listId || (props.listName && slugify(props.listName)),
95
+ }],
96
+ });
85
97
 
86
98
  return {
87
99
  isFetching,
@@ -20,6 +20,7 @@ const { customCode } = await getContent('layout');
20
20
  {customCode?.htmlBody && <Fragment set:html={customCode.htmlBody} />}
21
21
  <slot name="base-body-scripts">
22
22
  <script src="../scripts/session-utm"></script>
23
+ <script src="../scripts/push-analytics-events"></script>
23
24
  </slot>
24
25
  <slot name="before-body-end" />
25
26
  </BaseBody>
@@ -38,8 +38,15 @@ if (fetchingApiContext) {
38
38
 
39
39
  const apiDoc = apiContext.doc;
40
40
  const state: Record<string, any> = apiDoc || cmsContent || {};
41
- const title = state.meta_title || state.name || state.title || settings.name;
42
- const description = state.meta_description || state.short_description || settings.description;
41
+ const title = state.meta_title ||
42
+ state.metaTitle ||
43
+ (state.name && `${state.name} | ${settings.name}`) ||
44
+ (state.title && `${state.title} | ${settings.name}`) ||
45
+ settings.name;
46
+ const description = state.meta_description ||
47
+ state.metaDescription ||
48
+ state.short_description ||
49
+ settings.description;
43
50
  const favicon = settings.icon ? getIconUrl(32) : '/favicon.ico';
44
51
  const shortcutIcon = settings.icon ? getIconUrl(192) : null;
45
52
  const canonicalUrl = new URL(Astro.url.pathname, Astro.site || `https://${domain}`);