cloudcommerce 0.26.7 → 0.27.0

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 (193) hide show
  1. package/.github/workflows/test-apps.yml +2 -2
  2. package/.gitmodules +0 -3
  3. package/.vscode/settings.json +3 -1
  4. package/CHANGELOG.md +31 -0
  5. package/action.yml +2 -2
  6. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  7. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  8. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  9. package/ecomplus-stores/barra-doce/package.json +2 -2
  10. package/ecomplus-stores/monocard/functions/many/package.json +3 -3
  11. package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
  12. package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
  13. package/ecomplus-stores/monocard/package.json +2 -2
  14. package/package.json +6 -6
  15. package/packages/api/package.json +1 -1
  16. package/packages/apps/affilate-program/package.json +2 -2
  17. package/packages/apps/correios/package.json +3 -4
  18. package/packages/apps/custom-payment/package.json +1 -1
  19. package/packages/apps/custom-shipping/package.json +1 -1
  20. package/packages/apps/datafrete/package.json +3 -3
  21. package/packages/apps/discounts/package.json +1 -1
  22. package/packages/apps/emails/package.json +2 -2
  23. package/packages/apps/fb-conversions/package.json +3 -3
  24. package/packages/apps/flash-courier/package.json +2 -2
  25. package/packages/apps/frenet/package.json +3 -3
  26. package/packages/apps/galaxpay/package.json +3 -3
  27. package/packages/apps/google-analytics/package.json +3 -3
  28. package/packages/apps/jadlog/package.json +2 -2
  29. package/packages/apps/loyalty-points/package.json +1 -1
  30. package/packages/apps/melhor-envio/package.json +3 -3
  31. package/packages/apps/mercadopago/package.json +3 -3
  32. package/packages/apps/pagarme/package.json +3 -3
  33. package/packages/apps/paghiper/package.json +3 -3
  34. package/packages/apps/pix/package.json +3 -3
  35. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +22 -0
  36. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +1 -1
  37. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +2 -2
  38. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js.map +1 -1
  39. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +7 -1
  40. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +1 -1
  41. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +14 -5
  42. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +1 -1
  43. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +9 -1
  44. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js.map +1 -1
  45. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +8 -6
  46. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +1 -1
  47. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +118 -38
  48. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +1 -1
  49. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +8 -0
  50. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +1 -1
  51. package/packages/apps/tiny-erp/package.json +3 -3
  52. package/packages/apps/tiny-erp/src/integration/export-order-to-tiny.ts +24 -0
  53. package/packages/apps/tiny-erp/src/integration/helpers/format-tiny-date.ts +2 -2
  54. package/packages/apps/tiny-erp/src/integration/import-order-from-tiny.ts +8 -1
  55. package/packages/apps/tiny-erp/src/integration/import-product-from-tiny.ts +17 -5
  56. package/packages/apps/tiny-erp/src/integration/parsers/order-from-tiny.ts +13 -1
  57. package/packages/apps/tiny-erp/src/integration/parsers/order-to-tiny.ts +11 -6
  58. package/packages/apps/tiny-erp/src/integration/parsers/product-from-tiny.ts +144 -41
  59. package/packages/apps/tiny-erp/src/integration/parsers/product-to-tiny.ts +10 -0
  60. package/packages/apps/webhooks/package.json +3 -3
  61. package/packages/cli/package.json +1 -1
  62. package/packages/config/package.json +1 -1
  63. package/packages/emails/package.json +4 -4
  64. package/packages/eslint/base.eslintrc.cjs +3 -0
  65. package/packages/eslint/package.json +5 -4
  66. package/packages/eslint/storefront.eslintrc.cjs +8 -1
  67. package/packages/events/package.json +2 -2
  68. package/packages/feeds/package.json +1 -1
  69. package/packages/firebase/package.json +2 -2
  70. package/packages/i18n/package.json +1 -1
  71. package/packages/modules/package.json +3 -3
  72. package/packages/passport/package.json +2 -2
  73. package/packages/ssr/package.json +3 -3
  74. package/packages/storefront/.auto-imports.d.ts +65 -0
  75. package/packages/storefront/astro.config.mjs +24 -1
  76. package/packages/storefront/client.d.ts +1 -0
  77. package/packages/storefront/config/astro/context-directive.mjs +21 -0
  78. package/packages/storefront/config/astro/index.d.ts +8 -0
  79. package/packages/storefront/config/storefront.tailwind.cjs +0 -1
  80. package/packages/storefront/package.json +4 -3
  81. package/packages/storefront/server.d.ts +1 -1
  82. package/packages/storefront/src/lib/$storefront.d.ts +8 -8
  83. package/packages/storefront/src/lib/assets/base.css +5 -0
  84. package/packages/storefront/src/lib/components/Carousel.vue +93 -72
  85. package/packages/storefront/src/lib/components/CarouselControl.vue +13 -7
  86. package/packages/storefront/src/lib/components/ContentClearfix.vue +17 -0
  87. package/packages/storefront/src/lib/components/Drawer.vue +2 -2
  88. package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +1 -1
  89. package/packages/storefront/src/lib/components/QuantitySelector.vue +4 -4
  90. package/packages/storefront/src/lib/components/QuantitySelectorControl.vue +2 -2
  91. package/packages/storefront/src/lib/components/ViewTransitions.astro +409 -0
  92. package/packages/storefront/src/lib/components/globals/AImg.vue +2 -1
  93. package/packages/storefront/src/lib/layouts/BaseBody.astro +0 -2
  94. package/packages/storefront/src/lib/layouts/BaseHead.astro +25 -7
  95. package/packages/test-base/package.json +1 -1
  96. package/packages/types/package.json +1 -1
  97. package/ecomplus-stores/iluminim/.devcontainer/devcontainer.json +0 -30
  98. package/ecomplus-stores/iluminim/.editorconfig +0 -13
  99. package/ecomplus-stores/iluminim/.eslintrc.cjs +0 -3
  100. package/ecomplus-stores/iluminim/.firebaserc +0 -5
  101. package/ecomplus-stores/iluminim/.github/renovate.json +0 -5
  102. package/ecomplus-stores/iluminim/.github/workflows/build-and-deploy.yml +0 -36
  103. package/ecomplus-stores/iluminim/.github/workflows/calibreapp-image-actions.yml +0 -23
  104. package/ecomplus-stores/iluminim/.gitpod.yml +0 -12
  105. package/ecomplus-stores/iluminim/.idx/dev.nix +0 -24
  106. package/ecomplus-stores/iluminim/.nvmrc +0 -1
  107. package/ecomplus-stores/iluminim/.vscode/extensions.json +0 -8
  108. package/ecomplus-stores/iluminim/.vscode/launch.json +0 -11
  109. package/ecomplus-stores/iluminim/.vscode/settings.json +0 -10
  110. package/ecomplus-stores/iluminim/README.md +0 -31
  111. package/ecomplus-stores/iluminim/SETUP.md +0 -117
  112. package/ecomplus-stores/iluminim/SETUP.pt-BR.md +0 -117
  113. package/ecomplus-stores/iluminim/functions/config.json +0 -3
  114. package/ecomplus-stores/iluminim/functions/example.env +0 -10
  115. package/ecomplus-stores/iluminim/functions/many/index.js +0 -14
  116. package/ecomplus-stores/iluminim/functions/many/package.json +0 -22
  117. package/ecomplus-stores/iluminim/functions/ssr/.eslintrc.cjs +0 -6
  118. package/ecomplus-stores/iluminim/functions/ssr/astro.config.mjs +0 -4
  119. package/ecomplus-stores/iluminim/functions/ssr/content/blog/.gitkeep +0 -0
  120. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/contato.json +0 -11
  121. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/terms.json +0 -11
  122. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/trocas.json +0 -11
  123. package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +0 -57
  124. package/ecomplus-stores/iluminim/functions/ssr/content/pages/home.json +0 -70
  125. package/ecomplus-stores/iluminim/functions/ssr/content/settings.json +0 -65
  126. package/ecomplus-stores/iluminim/functions/ssr/index.js +0 -18
  127. package/ecomplus-stores/iluminim/functions/ssr/package.json +0 -31
  128. package/ecomplus-stores/iluminim/functions/ssr/public/admin/.gitkeep +0 -2
  129. package/ecomplus-stores/iluminim/functions/ssr/public/assets/cms-preview.css +0 -274
  130. package/ecomplus-stores/iluminim/functions/ssr/public/assets/cms.css +0 -114
  131. package/ecomplus-stores/iluminim/functions/ssr/public/assets/cvv.png +0 -0
  132. package/ecomplus-stores/iluminim/functions/ssr/public/assets/img-placeholder.png +0 -0
  133. package/ecomplus-stores/iluminim/functions/ssr/public/assets/payments.png +0 -0
  134. package/ecomplus-stores/iluminim/functions/ssr/public/assets/ssl-safe.png +0 -0
  135. package/ecomplus-stores/iluminim/functions/ssr/public/img/icon.png +0 -0
  136. package/ecomplus-stores/iluminim/functions/ssr/public/img/large-icon.png +0 -0
  137. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner-chamada-desktop-9x81zmd91q.webp +0 -0
  138. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner2.webp +0 -0
  139. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/chamada-mobile-q1c6om6jx4.webp +0 -0
  140. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
  141. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/headphone.webp +0 -0
  142. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/logo.webp +0 -0
  143. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/og-image.png +0 -0
  144. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/passion.webp +0 -0
  145. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect8589.png +0 -0
  146. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect859.png +0 -0
  147. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect89.webp +0 -0
  148. package/ecomplus-stores/iluminim/functions/ssr/public/robots.txt +0 -6
  149. package/ecomplus-stores/iluminim/functions/ssr/scripts/build.sh +0 -14
  150. package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +0 -65
  151. package/ecomplus-stores/iluminim/functions/ssr/src/components/AccountMenu.vue +0 -95
  152. package/ecomplus-stores/iluminim/functions/ssr/src/components/Banner.vue +0 -57
  153. package/ecomplus-stores/iluminim/functions/ssr/src/components/BannersGrid.astro +0 -25
  154. package/ecomplus-stores/iluminim/functions/ssr/src/components/CartItem.vue +0 -64
  155. package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +0 -66
  156. package/ecomplus-stores/iluminim/functions/ssr/src/components/Countdown.vue +0 -79
  157. package/ecomplus-stores/iluminim/functions/ssr/src/components/HeroSlider.vue +0 -52
  158. package/ecomplus-stores/iluminim/functions/ssr/src/components/PitchBar.vue +0 -56
  159. package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +0 -95
  160. package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductCard.vue +0 -117
  161. package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductShelf.vue +0 -57
  162. package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductsCountdown.vue +0 -20
  163. package/ecomplus-stores/iluminim/functions/ssr/src/components/SearchModal.vue +0 -6
  164. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopFooter.vue +0 -149
  165. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +0 -158
  166. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderMenu.vue +0 -58
  167. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +0 -88
  168. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +0 -61
  169. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +0 -80
  170. package/ecomplus-stores/iluminim/functions/ssr/src/env.d.ts +0 -13
  171. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Base.astro +0 -16
  172. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Checkout.astro +0 -0
  173. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageFooter.astro +0 -68
  174. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +0 -42
  175. package/ecomplus-stores/iluminim/functions/ssr/src/main/Fallback.astro +0 -10
  176. package/ecomplus-stores/iluminim/functions/ssr/src/main/Home.astro +0 -49
  177. package/ecomplus-stores/iluminim/functions/ssr/src/main/Sections.astro +0 -42
  178. package/ecomplus-stores/iluminim/functions/ssr/src/main/Wildcard.astro +0 -18
  179. package/ecomplus-stores/iluminim/functions/ssr/src/pages/[...slug].astro +0 -40
  180. package/ecomplus-stores/iluminim/functions/ssr/src/pages/_vue.ts +0 -3
  181. package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/account.astro +0 -0
  182. package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/index.astro +0 -0
  183. package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +0 -37
  184. package/ecomplus-stores/iluminim/functions/ssr/src/pages/~fallback.astro +0 -25
  185. package/ecomplus-stores/iluminim/functions/ssr/src/scripts/InlineScripts.astro +0 -10
  186. package/ecomplus-stores/iluminim/functions/ssr/tailwind.config.cjs +0 -13
  187. package/ecomplus-stores/iluminim/functions/ssr/tsconfig.json +0 -12
  188. package/ecomplus-stores/iluminim/functions/ssr/uno.config.cjs +0 -5
  189. package/ecomplus-stores/iluminim/functions/with-apps/index.js +0 -12
  190. package/ecomplus-stores/iluminim/functions/with-apps/package.json +0 -22
  191. package/ecomplus-stores/iluminim/package.json +0 -31
  192. package/ecomplus-stores/iluminim/scripts/install.sh +0 -24
  193. package/packages/storefront/src/lib/components/ContentClearfix.astro +0 -15
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.26.7",
4
+ "version": "0.27.0",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "@cloudcommerce/api": "workspace:*",
33
33
  "@cloudcommerce/config": "workspace:*",
34
34
  "@google-cloud/pubsub": "^4.0.6",
35
- "firebase-admin": "^11.10.1",
35
+ "firebase-admin": "^11.11.0",
36
36
  "firebase-functions": "^4.4.1",
37
37
  "source-map-support": "^0.5.21"
38
38
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/i18n",
3
3
  "type": "module",
4
- "version": "0.26.7",
4
+ "version": "0.27.0",
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.26.7",
4
+ "version": "0.27.0",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -45,8 +45,8 @@
45
45
  "@ecomplus/utils": "1.5.0-rc.5",
46
46
  "ajv": "^8.12.0",
47
47
  "ajv-formats": "^2.1.1",
48
- "axios": "^1.5.0",
49
- "firebase-admin": "^11.10.1",
48
+ "axios": "^1.5.1",
49
+ "firebase-admin": "^11.11.0",
50
50
  "firebase-functions": "^4.4.1",
51
51
  "source-map-support": "^0.5.21"
52
52
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.26.7",
4
+ "version": "0.27.0",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@cloudcommerce/api": "workspace:*",
27
27
  "@cloudcommerce/firebase": "workspace:*",
28
- "firebase-admin": "^11.10.1",
28
+ "firebase-admin": "^11.11.0",
29
29
  "firebase-functions": "^4.4.1",
30
30
  "source-map-support": "^0.5.21"
31
31
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.26.7",
4
+ "version": "0.27.0",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -33,13 +33,13 @@
33
33
  "@vueuse/core": "10.4.1",
34
34
  "astro": "2.10.15",
35
35
  "astro-capo": "^0.0.1",
36
- "firebase-admin": "^11.10.1",
36
+ "firebase-admin": "^11.11.0",
37
37
  "firebase-functions": "^4.4.1",
38
38
  "vue": "^3.3.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@cloudcommerce/types": "workspace:*",
42
- "@cloudflare/workers-types": "^4.20230914.0",
42
+ "@cloudflare/workers-types": "^4.20230922.0",
43
43
  "@firebase/app-types": "^0.9.0"
44
44
  }
45
45
  }
@@ -0,0 +1,65 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // noinspection JSUnusedGlobalSymbols
5
+ // Generated by unplugin-auto-import
6
+ export {}
7
+ declare global {
8
+ const EffectScope: typeof import('vue')['EffectScope']
9
+ const computed: typeof import('vue')['computed']
10
+ const createApp: typeof import('vue')['createApp']
11
+ const customRef: typeof import('vue')['customRef']
12
+ const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
13
+ const defineComponent: typeof import('vue')['defineComponent']
14
+ const effectScope: typeof import('vue')['effectScope']
15
+ const getCurrentInstance: typeof import('vue')['getCurrentInstance']
16
+ const getCurrentScope: typeof import('vue')['getCurrentScope']
17
+ const h: typeof import('vue')['h']
18
+ const inject: typeof import('vue')['inject']
19
+ const isProxy: typeof import('vue')['isProxy']
20
+ const isReactive: typeof import('vue')['isReactive']
21
+ const isReadonly: typeof import('vue')['isReadonly']
22
+ const isRef: typeof import('vue')['isRef']
23
+ const markRaw: typeof import('vue')['markRaw']
24
+ const nextTick: typeof import('vue')['nextTick']
25
+ const onActivated: typeof import('vue')['onActivated']
26
+ const onBeforeMount: typeof import('vue')['onBeforeMount']
27
+ const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
28
+ const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
29
+ const onDeactivated: typeof import('vue')['onDeactivated']
30
+ const onErrorCaptured: typeof import('vue')['onErrorCaptured']
31
+ const onMounted: typeof import('vue')['onMounted']
32
+ const onRenderTracked: typeof import('vue')['onRenderTracked']
33
+ const onRenderTriggered: typeof import('vue')['onRenderTriggered']
34
+ const onScopeDispose: typeof import('vue')['onScopeDispose']
35
+ const onServerPrefetch: typeof import('vue')['onServerPrefetch']
36
+ const onUnmounted: typeof import('vue')['onUnmounted']
37
+ const onUpdated: typeof import('vue')['onUpdated']
38
+ const provide: typeof import('vue')['provide']
39
+ const reactive: typeof import('vue')['reactive']
40
+ const readonly: typeof import('vue')['readonly']
41
+ const ref: typeof import('vue')['ref']
42
+ const resolveComponent: typeof import('vue')['resolveComponent']
43
+ const shallowReactive: typeof import('vue')['shallowReactive']
44
+ const shallowReadonly: typeof import('vue')['shallowReadonly']
45
+ const shallowRef: typeof import('vue')['shallowRef']
46
+ const toRaw: typeof import('vue')['toRaw']
47
+ const toRef: typeof import('vue')['toRef']
48
+ const toRefs: typeof import('vue')['toRefs']
49
+ const toValue: typeof import('vue')['toValue']
50
+ const triggerRef: typeof import('vue')['triggerRef']
51
+ const unref: typeof import('vue')['unref']
52
+ const useAttrs: typeof import('vue')['useAttrs']
53
+ const useCssModule: typeof import('vue')['useCssModule']
54
+ const useCssVars: typeof import('vue')['useCssVars']
55
+ const useSlots: typeof import('vue')['useSlots']
56
+ const watch: typeof import('vue')['watch']
57
+ const watchEffect: typeof import('vue')['watchEffect']
58
+ const watchPostEffect: typeof import('vue')['watchPostEffect']
59
+ const watchSyncEffect: typeof import('vue')['watchSyncEffect']
60
+ }
61
+ // for type re-export
62
+ declare global {
63
+ // @ts-ignore
64
+ export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
65
+ }
@@ -1,6 +1,6 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { lstatSync, readFileSync } from 'node:fs';
3
- import { join as joinPath } from 'node:path';
3
+ import { join as joinPath, relative as relativePath } from 'node:path';
4
4
  import * as dotenv from 'dotenv';
5
5
  import { defineConfig } from 'astro/config';
6
6
  import node from '@astrojs/node';
@@ -8,6 +8,7 @@ import vue from '@astrojs/vue';
8
8
  import image from '@astrojs/image';
9
9
  import UnoCSS from 'unocss/astro';
10
10
  import AstroPWA from '@vite-pwa/astro';
11
+ import AutoImport from 'unplugin-auto-import/astro';
11
12
  import dictionaryDir from '@cloudcommerce/i18n/lib/dirname';
12
13
  import getConfig from './config/storefront.config.mjs';
13
14
 
@@ -18,6 +19,7 @@ const isSSG = process.env.BUILD_OUTPUT === 'static';
18
19
  const outDir = process.env.BUILD_OUT_DIR || (isSSG ? './dist/client' : './dist');
19
20
  const isToServerless = !isSSG && process.env.DEPLOY_RUNTIME === 'serverless';
20
21
  const deployRand = process.env.DEPLOY_RAND || '_';
22
+ const isLibDev = !(relativePath(__dirname, process.cwd()));
21
23
 
22
24
  const {
23
25
  lang,
@@ -179,6 +181,27 @@ const genAstroConfig = ({
179
181
  injectEntry: false,
180
182
  }),
181
183
  AstroPWA(vitePWAOptions),
184
+ AutoImport({
185
+ include: [
186
+ /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
187
+ /\.vue$/, /\.vue\?vue/, // .vue
188
+ /\.mdx?$/, // .md, .mdx
189
+ /\.astro$/,
190
+ ],
191
+ imports: ['vue'],
192
+ dts: isLibDev ? '.auto-imports.d.ts' : false,
193
+ }),
194
+ {
195
+ name: 'client:context',
196
+ hooks: {
197
+ 'astro:config:setup': ({ addClientDirective }) => {
198
+ addClientDirective({
199
+ name: 'context',
200
+ entrypoint: joinPath(__dirname, 'config/astro/context-directive.mjs'),
201
+ });
202
+ },
203
+ },
204
+ },
182
205
  ];
183
206
  if (!isToServerless) {
184
207
  integrations.push(image({
@@ -1,4 +1,5 @@
1
1
  /// <reference types="./src/vue-globals" />
2
+ /// <reference types="./.auto-imports" />
2
3
 
3
4
  type DocCleanupFields = 'body_html'
4
5
  | 'body_text'
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Hydrate on context script executed (`$storefront.apiContext` ready)
3
+ * Check event emits at BaseHead.astro
4
+ * @type {import('astro').ClientDirective}
5
+ */
6
+ export default (load) => {
7
+ const hy = async () => {
8
+ const hydrate = await load();
9
+ await hydrate();
10
+ };
11
+ const id = window.$storefront?.apiContext?.doc._id || null;
12
+ if (window._firstLoadContextId === id && window._emitedContextId === id) {
13
+ console.log('[ctx] first load');
14
+ hy();
15
+ setTimeout(() => {
16
+ delete window._firstLoadContextId;
17
+ }, 49);
18
+ return;
19
+ }
20
+ window.addEventListener('storefront:apiContext', hy, { once: true });
21
+ };
@@ -0,0 +1,8 @@
1
+ /* eslint-disable */
2
+ import 'astro';
3
+
4
+ declare module 'astro' {
5
+ interface AstroClientDirectives {
6
+ 'client:context'?: boolean
7
+ }
8
+ }
@@ -44,7 +44,6 @@ let defaultThemeOptions = {
44
44
  iconAliases: {
45
45
  close: 'x-mark',
46
46
  'chevron-right': 'chevron-right',
47
- 'chevron-left': 'chevron-left',
48
47
  },
49
48
  };
50
49
  if (globalThis.$storefrontThemeOptions) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.26.7",
4
+ "version": "0.27.0",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -51,9 +51,10 @@
51
51
  "image-size": "^1.0.2",
52
52
  "mime": "^3.0.0",
53
53
  "semver": "^7.5.4",
54
- "sharp": "^0.32.5",
54
+ "sharp": "^0.32.6",
55
55
  "tailwindcss": "^3.3.3",
56
- "unocss": "^0.55.7",
56
+ "unocss": "^0.56.4",
57
+ "unplugin-auto-import": "^0.16.6",
57
58
  "vite": "^4.4.9",
58
59
  "vite-plugin-pwa": "^0.16.5",
59
60
  "vue": "^3.3.4"
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable vars-on-top, no-var */
2
+ /// <reference types="./config/astro/index.d.ts" />
2
3
 
3
4
  import type { ApiEndpoint } from '@cloudcommerce/api';
4
5
  import type { RouteContext } from '@@sf/ssr-context';
@@ -8,7 +9,6 @@ declare global {
8
9
  namespace App {
9
10
  interface Locals {
10
11
  routeContext: RouteContext,
11
- contextInlineClientJS?: string,
12
12
  }
13
13
  }
14
14
 
@@ -1,8 +1,8 @@
1
1
  import type {
2
- ProductSet,
3
- CategorySet,
4
- BrandSet,
5
- CollectionSet,
2
+ Products,
3
+ Categories,
4
+ Brands,
5
+ Collections,
6
6
  } from '@cloudcommerce/api/types';
7
7
  import type { SettingsContent } from '@@sf/content';
8
8
 
@@ -10,19 +10,19 @@ export type $Storefront = {
10
10
  settings: Partial<SettingsContent>,
11
11
  apiContext?: {
12
12
  resource: 'products',
13
- doc: ProductSet,
13
+ doc: Products,
14
14
  timestamp: number,
15
15
  } | {
16
16
  resource: 'categories',
17
- doc: CategorySet,
17
+ doc: Categories,
18
18
  timestamp: number,
19
19
  } | {
20
20
  resource: 'brands',
21
- doc: BrandSet,
21
+ doc: Brands,
22
22
  timestamp: number,
23
23
  } | {
24
24
  resource: 'collections',
25
- doc: CollectionSet,
25
+ doc: Collections,
26
26
  timestamp: number,
27
27
  },
28
28
  data: Record<string, any>,
@@ -118,3 +118,8 @@ https://stackoverflow.com/questions/37112218/css3-100vh-not-constant-in-mobile-b
118
118
  .h-screen {
119
119
  max-height: 100dvh;
120
120
  }
121
+
122
+ /* Hardfix for multiple <Teleport> backdrops with View Transitions "SPA" */
123
+ [data-drawer-backdrop] + [data-drawer-backdrop] {
124
+ display: none;
125
+ }
@@ -11,14 +11,19 @@ import {
11
11
  nextTick,
12
12
  provide,
13
13
  } from 'vue';
14
- import { useDebounceFn, useElementHover, useScroll } from '@vueuse/core';
14
+ import {
15
+ useDebounceFn,
16
+ useElementHover,
17
+ useScroll,
18
+ } from '@vueuse/core';
15
19
  import CarouselControl from '@@sf/components/CarouselControl.vue';
16
20
 
17
21
  export type CarouselInject = {
18
22
  autoplay: Ref<number | undefined>,
19
- changeSlide: (direction: number, isPageScroll?: boolean) => void,
20
- isBoundLeft: Ref<boolean>,
21
- isBoundRight: Ref<boolean>,
23
+ axis: 'x' | 'y',
24
+ changeSlide: (step: number, isPageScroll?: boolean) => void,
25
+ isBoundStart: Ref<boolean>,
26
+ isBoundEnd: Ref<boolean>,
22
27
  };
23
28
 
24
29
  export const carouselKey = Symbol('carousel') as InjectionKey<CarouselInject>;
@@ -28,78 +33,82 @@ export const carouselKey = Symbol('carousel') as InjectionKey<CarouselInject>;
28
33
  /* REFERENCE: https://github.com/bartdominiak/vue-snap */
29
34
  export interface Props {
30
35
  as?: string;
31
- modelValue?: number;
36
+ index?: number;
32
37
  autoplay?: number; // milliseconds
38
+ axis?: 'x' | 'y';
39
+ hasControls?: boolean
33
40
  }
34
41
 
35
42
  const props = withDefaults(defineProps<Props>(), {
36
43
  as: 'ul',
37
- modelValue: 1,
44
+ index: 0,
45
+ axis: 'x',
38
46
  });
39
- const emit = defineEmits([
40
- 'update:modelValue',
41
- ]);
42
- const currentIndex = ref(0);
43
- watch(toRef(props, 'modelValue'), (modelValue) => {
44
- currentIndex.value = modelValue - 1;
47
+ const emit = defineEmits(['update:index']);
48
+ const activeIndex = ref(0);
49
+ watch(toRef(props, 'index'), (index) => {
50
+ if (index !== activeIndex.value) {
51
+ const step = index - activeIndex.value;
52
+ changeSlide(step, false);
53
+ }
45
54
  }, { immediate: true });
46
- watch(currentIndex, (current, previous) => {
55
+ watch(activeIndex, (current, previous) => {
47
56
  if (current !== previous) {
48
- emit('update:modelValue', current + 1);
57
+ emit('update:index', current);
49
58
  }
50
59
  });
51
60
  const wrapper = ref<HTMLElement | null>(null);
52
- const { x: currentPos, isScrolling, arrivedState } = useScroll(wrapper);
53
- const isBoundLeft = computed(() => arrivedState.left);
54
- const isBoundRight = computed(() => arrivedState.right);
55
- const slidesWidth = ref<{ offsetLeft: number; width: number; }[]>([]);
56
- const wrapperScrollWidth = ref(0);
57
- const wrapperVisibleWidth = ref(0);
58
- const indexCount = ref(0);
59
- const calcWrapperWidth = () => {
61
+ const { [props.axis]: currentPos, isScrolling, arrivedState } = useScroll(wrapper);
62
+ const isX = props.axis === 'x';
63
+ const isBoundStart = computed(() => (isX ? arrivedState.left : arrivedState.top));
64
+ const isBoundEnd = computed(() => (isX ? arrivedState.right : arrivedState.bottom));
65
+ const slideSizes = ref<{ offset: number; size: number; }[]>([]);
66
+ const wrapperScrollSize = ref(0);
67
+ const wrapperVisibleSize = ref(0);
68
+ const calcWrapperSize = () => {
60
69
  if (!wrapper.value) return;
61
- wrapperScrollWidth.value = wrapper.value.scrollWidth;
62
- wrapperVisibleWidth.value = wrapper.value.offsetWidth;
70
+ if (isX) {
71
+ wrapperScrollSize.value = wrapper.value.scrollWidth;
72
+ wrapperVisibleSize.value = wrapper.value.offsetWidth;
73
+ } else {
74
+ wrapperScrollSize.value = wrapper.value.scrollHeight;
75
+ wrapperVisibleSize.value = wrapper.value.offsetHeight;
76
+ }
63
77
  };
64
- const calcSlidesWidth = () => {
78
+ const calcSlidesSize = () => {
65
79
  if (!wrapper.value) return;
66
80
  let childNodes = [...wrapper.value.children] as HTMLElement[];
67
81
  if (childNodes.length === 1 && childNodes[0].tagName.endsWith('SLOT')) {
68
82
  childNodes = [...childNodes[0].children] as HTMLElement[];
69
83
  }
70
- slidesWidth.value = childNodes.map((node) => ({
71
- offsetLeft: node.offsetLeft,
72
- width: node.offsetWidth,
84
+ slideSizes.value = childNodes.map((node) => ({
85
+ offset: isX ? node.offsetLeft : node.offsetTop,
86
+ size: isX ? node.offsetWidth : node.offsetHeight,
73
87
  }));
74
88
  };
75
- const calcNextOffsetLeft = (direction: number) => {
76
- let nextSlideIndex = currentIndex.value + direction;
77
- if (nextSlideIndex >= slidesWidth.value.length) {
89
+ const calcNextOffset = (step: number) => {
90
+ let nextSlideIndex = activeIndex.value + step;
91
+ if (nextSlideIndex >= slideSizes.value.length) {
78
92
  return 0;
79
93
  }
80
94
  if (nextSlideIndex < 0) {
81
- nextSlideIndex = slidesWidth.value.length + nextSlideIndex;
95
+ nextSlideIndex = slideSizes.value.length + nextSlideIndex;
82
96
  }
83
- const { offsetLeft, width } = slidesWidth.value[nextSlideIndex] || {};
84
- if (!width) {
97
+ const { offset, size } = slideSizes.value[nextSlideIndex] || {};
98
+ if (!size) {
85
99
  return 0;
86
100
  }
87
- return offsetLeft;
101
+ return offset;
88
102
  };
89
103
  const calcCurrentIndex = () => {
90
- const getCurrentIndex = slidesWidth.value.findIndex((slide) => {
104
+ const index = slideSizes.value.findIndex((slide) => {
91
105
  // Find the closest point, with 5px approximate.
92
- return Math.abs(slide.offsetLeft - currentPos.value) <= 5;
106
+ return Math.abs(slide.offset - currentPos.value) <= 5;
93
107
  });
94
- if (getCurrentIndex > -1) {
95
- currentIndex.value = getCurrentIndex || 0;
108
+ if (index > -1) {
109
+ activeIndex.value = index || 0;
96
110
  }
97
111
  };
98
- const calcIndexCount = () => {
99
- const maxPos = wrapperScrollWidth.value - wrapperVisibleWidth.value;
100
- indexCount.value = slidesWidth.value
101
- .findIndex(({ offsetLeft }) => (offsetLeft >= maxPos - 5));
102
- };
103
112
  let autoplayTimer: ReturnType<typeof setTimeout> | undefined;
104
113
  const restartAutoplay = () => {
105
114
  if (props.autoplay) {
@@ -110,29 +119,32 @@ const restartAutoplay = () => {
110
119
  }, props.autoplay);
111
120
  }
112
121
  };
113
- const changeSlide = (direction: number, isPageScroll: boolean = true) => {
114
- if (slidesWidth.value.length < 2) {
122
+ const changeSlide = (step: number, isPageScroll: boolean = true) => {
123
+ if (slideSizes.value.length < 2) {
115
124
  return;
116
125
  }
117
- if (isPageScroll && (direction === 1 || direction === -1)) {
126
+ if (isPageScroll && (step === 1 || step === -1)) {
118
127
  let pageStep = 0;
119
- let pageStepWidth = 0;
120
- for (let i = currentIndex.value; i < slidesWidth.value.length; i++) {
121
- const { width } = slidesWidth.value[i] || {};
122
- if (width) {
128
+ let pageStepSize = 0;
129
+ for (let i = activeIndex.value; i < slideSizes.value.length; i++) {
130
+ const { size } = slideSizes.value[i] || {};
131
+ if (size) {
123
132
  pageStep += 1;
124
- pageStepWidth += width;
125
- if (pageStepWidth >= wrapperVisibleWidth.value) {
133
+ pageStepSize += size;
134
+ if (pageStepSize >= wrapperVisibleSize.value) {
126
135
  break;
127
136
  }
128
137
  }
129
138
  }
130
139
  if (pageStep) {
131
- direction = direction > 0 ? pageStep : -pageStep;
140
+ step = step > 0 ? pageStep : -pageStep;
132
141
  }
133
142
  }
134
- const nextOffsetLeft = calcNextOffsetLeft(direction);
135
- wrapper.value?.scrollTo({ left: nextOffsetLeft, behavior: 'smooth' });
143
+ const nextOffset = calcNextOffset(step);
144
+ wrapper.value?.scrollTo({
145
+ [isX ? 'left' : 'top']: nextOffset,
146
+ behavior: 'smooth',
147
+ });
136
148
  restartAutoplay();
137
149
  };
138
150
  watch(isScrolling, (_isScrolling: boolean) => {
@@ -156,14 +168,17 @@ const calcOnInit = () => {
156
168
  if (!wrapper.value) {
157
169
  return;
158
170
  }
159
- calcWrapperWidth();
160
- calcSlidesWidth();
171
+ calcWrapperSize();
172
+ calcSlidesSize();
161
173
  calcCurrentIndex();
162
- calcIndexCount();
163
174
  };
164
175
  const onResize = useDebounceFn(() => {
165
176
  if (!wrapper.value) return;
166
- wrapper.value.scrollLeft = 0;
177
+ if (isX) {
178
+ wrapper.value.scrollLeft = 0;
179
+ } else {
180
+ wrapper.value.scrollTop = 0;
181
+ }
167
182
  calcOnInit();
168
183
  }, 400);
169
184
  onMounted(() => {
@@ -187,20 +202,27 @@ onBeforeUnmount(() => {
187
202
  });
188
203
  provide(carouselKey, {
189
204
  autoplay: toRef(props, 'autoplay'),
205
+ axis: props.axis,
190
206
  changeSlide,
191
- isBoundLeft,
192
- isBoundRight,
207
+ isBoundStart,
208
+ isBoundEnd,
193
209
  });
194
210
  </script>
195
211
 
196
212
  <template>
197
- <div ref="carousel" class="relative" data-carousel>
213
+ <div
214
+ ref="carousel"
215
+ :class="`relative ${(!isX ? 'overflow-hidden' : '')}`"
216
+ data-carousel
217
+ >
198
218
  <component
199
219
  :is="as"
200
220
  ref="wrapper"
201
- class="flex overflow-x-scroll overflow-y-hidden list-none m-0 p-0
202
- snap-x snap-mandatory scroll-smooth
203
- [&>*]:snap-start [&>*]:outline-none"
221
+ class="m-0 flex snap-mandatory list-none scroll-smooth p-0
222
+ [&>*]:snap-start [&>*]:outline-none"
223
+ :class="isX
224
+ ? 'snap-x overflow-y-hidden overflow-x-scroll'
225
+ : 'h-full flex-col snap-y overflow-x-hidden overflow-y-scroll'"
204
226
  style="
205
227
  scrollbar-width: none;
206
228
  -webkit-overflow-scrolling: touch;
@@ -214,16 +236,15 @@ provide(carouselKey, {
214
236
  name="controls"
215
237
  v-bind="{
216
238
  changeSlide,
217
- isBoundLeft,
218
- isBoundRight,
219
- currentPage: currentIndex + 1,
220
- pageCount: indexCount + 1,
239
+ isBoundStart,
240
+ isBoundEnd,
241
+ activeIndex,
221
242
  }"
222
243
  >
223
- <CarouselControl is-prev>
244
+ <CarouselControl v-if="slideSizes.length > 1 || hasControls" is-prev>
224
245
  <slot name="previous" />
225
246
  </CarouselControl>
226
- <CarouselControl>
247
+ <CarouselControl v-if="slideSizes.length > 1 || hasControls">
227
248
  <slot name="next" />
228
249
  </CarouselControl>
229
250
  </slot>
@@ -9,7 +9,8 @@ export interface Props {
9
9
  withDefaults(defineProps<Props>(), {
10
10
  isPrev: false,
11
11
  });
12
- const { changeSlide } = inject(carouselKey) as CarouselInject;
12
+ const { axis, changeSlide } = inject(carouselKey) as CarouselInject;
13
+ const isX = axis === 'x';
13
14
  </script>
14
15
 
15
16
  <template>
@@ -17,16 +18,21 @@ const { changeSlide } = inject(carouselKey) as CarouselInject;
17
18
  type="button"
18
19
  :aria-label="!isPrev ? $t.i19next : $t.i19previous"
19
20
  @click="changeSlide(!isPrev ? 1 : -1)"
20
- class="group absolute top-0 z-1"
21
- :class="!isPrev ? 'right-0' : 'left-0'"
21
+ class="z-1 group absolute"
22
+ :class="isX
23
+ ? `${(!isPrev ? 'right-0' : 'left-0')} top-0`
24
+ : `${(!isPrev ? 'bottom-0' : 'top-0')} left-0`"
22
25
  :data-carousel-control="!isPrev ? 'next' : 'previous'"
23
26
  >
24
27
  <slot>
25
28
  <i
26
- class="m-0"
27
- :class="!isPrev
28
- ? 'i-chevron-right group-active:translate-x-1'
29
- : 'i-chevron-left group-active:-translate-x-1'"
29
+ class="i-chevron-right m-0"
30
+ :class="{
31
+ 'group-active:translate-x-1': isX && !isPrev,
32
+ 'rotate-180 group-active:-translate-x-1': isX && isPrev,
33
+ 'rotate-90 group-active:translate-y-1': !isX && !isPrev,
34
+ '-rotate-90 group-active:-translate-y-1': !isX && isPrev,
35
+ }"
30
36
  ></i>
31
37
  </slot>
32
38
  </button>