cloudcommerce 2.0.0 → 2.0.1

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 (111) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/ecomplus-stores/barra-doce/conf/firebase.json +7 -0
  3. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  4. package/ecomplus-stores/barra-doce/functions/ssr/astro.config.mjs +18 -3
  5. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/3.md +24 -0
  6. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/4.md +24 -0
  7. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/5.md +24 -0
  8. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/dos.md +24 -0
  9. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/uno.md +24 -0
  10. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.md +9 -0
  11. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.md +20 -0
  12. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.md +9 -0
  13. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/brands.json +16 -0
  14. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/categories.json +16 -0
  15. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/collections.json +16 -0
  16. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/search.json +7 -0
  17. package/ecomplus-stores/barra-doce/functions/ssr/package.json +10 -9
  18. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +23 -9
  19. package/ecomplus-stores/barra-doce/functions/ssr/src/components/BannersGrid.astro +1 -1
  20. package/ecomplus-stores/barra-doce/functions/ssr/src/components/BlogPosts.vue +88 -0
  21. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.vue +49 -0
  22. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +2 -2
  23. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CheckoutPage.vue +14 -0
  24. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Collapse.vue +4 -4
  25. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ContentEntry.vue +23 -0
  26. package/ecomplus-stores/barra-doce/functions/ssr/src/components/DocBanners.vue +26 -0
  27. package/ecomplus-stores/barra-doce/functions/ssr/src/components/FooterStamps.vue +1 -1
  28. package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +1 -1
  29. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ImagesGallery.vue +5 -4
  30. package/ecomplus-stores/barra-doce/functions/ssr/src/components/LoginForm.vue +2 -2
  31. package/ecomplus-stores/barra-doce/functions/ssr/src/components/PageTitle.vue +43 -0
  32. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Pagination.vue +67 -0
  33. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +1 -1
  34. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +3 -4
  35. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductDetails.vue +4 -3
  36. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +34 -18
  37. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductSpecifications.vue +1 -1
  38. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchFilters.vue +122 -0
  39. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +97 -1
  40. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchShowcase.vue +169 -0
  41. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +10 -6
  42. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +61 -63
  43. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +1 -1
  44. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +1 -1
  45. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SkuSelector.vue +7 -7
  46. package/ecomplus-stores/barra-doce/functions/ssr/src/env.d.ts +4 -0
  47. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +4 -1
  48. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +2 -2
  49. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +28 -5
  50. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Main.astro +26 -0
  51. package/ecomplus-stores/barra-doce/functions/ssr/src/main/content/Hero.astro +33 -0
  52. package/ecomplus-stores/barra-doce/functions/ssr/src/main/{Sections.astro → content/Sections.astro} +27 -4
  53. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +35 -8
  54. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +6 -2
  55. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +24 -4
  56. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/blog/[page].astro +71 -0
  57. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/blog/_blog-pages.ts +9 -0
  58. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/~fallback.astro +9 -2
  59. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  60. package/ecomplus-stores/barra-doce/package.json +2 -2
  61. package/package.json +2 -2
  62. package/packages/api/package.json +1 -1
  63. package/packages/apps/affiliate-program/package.json +1 -1
  64. package/packages/apps/correios/package.json +1 -1
  65. package/packages/apps/custom-payment/package.json +1 -1
  66. package/packages/apps/custom-shipping/package.json +1 -1
  67. package/packages/apps/datafrete/package.json +1 -1
  68. package/packages/apps/discounts/package.json +1 -1
  69. package/packages/apps/emails/package.json +1 -1
  70. package/packages/apps/fb-conversions/package.json +1 -1
  71. package/packages/apps/flash-courier/package.json +1 -1
  72. package/packages/apps/frenet/package.json +1 -1
  73. package/packages/apps/galaxpay/package.json +1 -1
  74. package/packages/apps/google-analytics/package.json +1 -1
  75. package/packages/apps/jadlog/package.json +1 -1
  76. package/packages/apps/loyalty-points/package.json +1 -1
  77. package/packages/apps/mandae/package.json +1 -1
  78. package/packages/apps/melhor-envio/package.json +1 -1
  79. package/packages/apps/mercadopago/package.json +1 -1
  80. package/packages/apps/pagarme/package.json +1 -1
  81. package/packages/apps/pagarme-v5/package.json +1 -1
  82. package/packages/apps/paghiper/package.json +1 -1
  83. package/packages/apps/pix/package.json +1 -1
  84. package/packages/apps/tiny-erp/package.json +1 -1
  85. package/packages/apps/webhooks/package.json +1 -1
  86. package/packages/cli/package.json +1 -1
  87. package/packages/config/package.json +1 -1
  88. package/packages/emails/package.json +1 -1
  89. package/packages/eslint/package.json +1 -1
  90. package/packages/events/package.json +1 -1
  91. package/packages/feeds/package.json +1 -1
  92. package/packages/firebase/package.json +1 -1
  93. package/packages/i18n/package.json +1 -1
  94. package/packages/modules/package.json +1 -1
  95. package/packages/passport/package.json +1 -1
  96. package/packages/ssr/package.json +1 -1
  97. package/packages/storefront/config/astro/context-directive.mjs +16 -2
  98. package/packages/storefront/config/astro/index.d.ts +3 -1
  99. package/packages/storefront/package.json +1 -1
  100. package/packages/storefront/src/lib/components/SharedData.astro +1 -1
  101. package/packages/storefront/src/lib/composables/use-shared-data.ts +2 -1
  102. package/packages/test-base/package.json +1 -1
  103. package/packages/types/package.json +1 -1
  104. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/.gitkeep +0 -0
  105. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.json +0 -11
  106. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +0 -11
  107. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.json +0 -11
  108. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.astro +0 -44
  109. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +0 -37
  110. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +0 -18
  111. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +0 -32
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/emails",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce email sender",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/eslint",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce ESLint config",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
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": "2.0.0",
4
+ "version": "2.0.1",
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": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/i18n",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
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": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
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": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Hydrate on context script executed (`$storefront.apiContext` ready)
3
- * Check event emits at BaseHead.astro
3
+ * Check event emits at BaseHead.astro and use-shared-data.ts
4
4
  * @type {import('astro').ClientDirective}
5
5
  */
6
6
  export default (load, opts) => {
@@ -9,7 +9,21 @@ export default (load, opts) => {
9
9
  await hydrate();
10
10
  };
11
11
  const next = () => {
12
- if (opts.value === 'idle') {
12
+ const arrOpts = Array.isArray(opts.value) ? opts.value : [opts.value];
13
+ for (let i = 0; i < arrOpts.length; i++) {
14
+ if (typeof arrOpts[i] === 'string' && arrOpts[i].startsWith('data:')) {
15
+ const field = arrOpts[i].substring(5);
16
+ if (!window.$storefront?.data?.[field]) {
17
+ window.addEventListener(
18
+ `storefront:data:${field}`,
19
+ next,
20
+ { once: true },
21
+ );
22
+ return;
23
+ }
24
+ }
25
+ }
26
+ if (arrOpts.includes('idle')) {
13
27
  if (typeof window.requestIdleCallback === 'function') {
14
28
  setTimeout(() => window.requestIdleCallback(hy), 9);
15
29
  return;
@@ -1,8 +1,10 @@
1
1
  /* eslint-disable */
2
2
  import 'astro';
3
3
 
4
+ type ClientContextOption = 'idle' | `data:${string}`;
5
+
4
6
  declare module 'astro' {
5
7
  interface AstroClientDirectives {
6
- 'client:context'?: boolean | 'idle';
8
+ 'client:context'?: boolean | ClientContextOption | ClientContextOption[];
7
9
  }
8
10
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -9,4 +9,4 @@ export interface Props extends UseSharedDataProps {}
9
9
  const { getInlineClientJS } = await useSharedData(Astro.props);
10
10
  ---
11
11
 
12
- <script is:inline set:html={getInlineClientJS()} />
12
+ <script async is:inline set:html={getInlineClientJS()} />
@@ -38,7 +38,8 @@ const useSharedData = async <T extends string = string>(props: Props<T>) => {
38
38
  return {
39
39
  value,
40
40
  getInlineClientJS: () => `
41
- window.$storefront.data['${field}'] = ${JSON.stringify(value)};`,
41
+ window.$storefront.data['${field}'] = ${JSON.stringify(value)};
42
+ window.dispatchEvent(new Event('storefront:data:${field}'));`,
42
43
  };
43
44
  };
44
45
 
@@ -2,7 +2,7 @@
2
2
  "name": "@cloudcommerce/test-base",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "2.0.0",
5
+ "version": "2.0.1",
6
6
  "description": "E-Com Plus Cloud Commerce basic setup for testing",
7
7
  "main": "lib/index.js",
8
8
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
@@ -1,11 +0,0 @@
1
- {
2
- "title": "Contato",
3
- "date": "",
4
- "meta_title": "",
5
- "meta_description": "",
6
- "hero": {
7
- "slides": []
8
- },
9
- "body": "",
10
- "sections": []
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "title": "Privacidade e termos de serviço",
3
- "date": "",
4
- "meta_title": "",
5
- "meta_description": "",
6
- "hero": {
7
- "slides": []
8
- },
9
- "body": "",
10
- "sections": []
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "title": "Trocas e devoluções",
3
- "date": "",
4
- "meta_title": "",
5
- "meta_description": "",
6
- "hero": {
7
- "slides": []
8
- },
9
- "body": "",
10
- "sections": []
11
- }
@@ -1,44 +0,0 @@
1
- ---
2
- import {
3
- type Props as UseBreadcrumbsProps,
4
- useBreadcrumbs,
5
- } from '@@sf/composables/use-breadcrumbs';
6
-
7
- export interface Props extends UseBreadcrumbsProps {}
8
-
9
- const { breadcrumbs, inlineJSONLd } = await useBreadcrumbs(Astro.props);
10
- ---
11
-
12
- {breadcrumbs.length > 0 &&
13
- <section class={`ui-section-slim ${breadcrumbs.length > 1 ? '' : 'hidden lg:block'}`}>
14
- <nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm">
15
- <ol class="flex items-center gap-1 text-base-600">
16
- <li>
17
- <a href="/" class="hover:text-primary">
18
- <span class="sr-only"> Home </span>
19
- <i class="i-home"></i>
20
- </a>
21
- </li>
22
- {breadcrumbs.map(({ name, link }, i) =>
23
- <>
24
- {i + 1 < breadcrumbs.length
25
- ? <li class="text-base-300">
26
- <i class="i-chevron-right"></i>
27
- </li>
28
- <li class="whitespace-nowrap">
29
- <a href={link} class="hover:text-primary">{name}</a>
30
- </li>
31
- : <li class="hidden lg:block text-base-300">
32
- <i class="i-chevron-right"></i>
33
- </li>
34
- <li class="hidden lg:block whitespace-nowrap overflow-hidden text-ellipsis">
35
- <span class="text-base-500">{name}</span>
36
- </li>
37
- }
38
- </>
39
- )}
40
- </ol>
41
- </nav>
42
- {inlineJSONLd && <script type="application/ld+json" set:html={inlineJSONLd} />}
43
- </section>
44
- }
@@ -1,37 +0,0 @@
1
- ---
2
- import { usePageHero } from '@@sf/layouts/use-page-main';
3
- import BannerPictures from '@@sf/components/BannerPictures.astro';
4
- import HeroSlider from '~/components/HeroSlider.vue';
5
- import Sections from '~/main/Sections.astro';
6
-
7
- const { routeContext } = Astro.locals;
8
- const { heroSlider } = await usePageHero({ routeContext });
9
- const heroSlides = heroSlider.slides;
10
- ---
11
-
12
- <main>
13
- {heroSlider.slides.length &&
14
- <HeroSlider {...heroSlider} client:idle>
15
- {heroSlides[0] && <BannerPictures
16
- slot="picture-0" {...heroSlides[0]} index={0}
17
- widths={[640, 856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
18
- {heroSlides[1] && <BannerPictures
19
- slot="picture-1" {...heroSlides[1]} index={1}
20
- widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
21
- {heroSlides[2] && <BannerPictures
22
- slot="picture-2" {...heroSlides[2]} index={2}
23
- widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
24
- {heroSlides[3] && <BannerPictures
25
- slot="picture-3" {...heroSlides[3]} index={3}
26
- widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
27
- {heroSlides[4] && <BannerPictures
28
- slot="picture-4" {...heroSlides[4]} index={4}
29
- widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
30
- {heroSlides[5] && <BannerPictures
31
- slot="picture-5" {...heroSlides[5]} index={5}
32
- widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
33
- <!-- https://github.com/withastro/astro/issues/5066#issuecomment-1277998365 -->
34
- </HeroSlider>
35
- }
36
- <Sections />
37
- </main>
@@ -1,18 +0,0 @@
1
- ---
2
- import api from '@cloudcommerce/api';
3
- import SharedData from '@@sf/components/SharedData.astro';
4
- import Sections from '~/main/Sections.astro';
5
-
6
- const { fetchingApiContext } = Astro.locals.routeContext;
7
- const [
8
- { data: { result: grids } },
9
- ] = await Promise.all([
10
- api.get('grids'),
11
- fetchingApiContext,
12
- ]);
13
- ---
14
-
15
- <main>
16
- <SharedData field="grids" value={grids} />
17
- <Sections />
18
- </main>
@@ -1,32 +0,0 @@
1
- ---
2
- import loadRouteContext, { type RouteContext } from '@@sf/ssr-context';
3
- import BaseHead from '@@sf/layouts/BaseHead.astro';
4
- import Base from '~/layouts/Base.astro';
5
- import PageHeader from '~/layouts/PageHeader.astro';
6
- import PageFooter from '~/layouts/PageFooter.astro';
7
- import HomeMain from '~/main/Home.astro';
8
-
9
- let routeContext: RouteContext | undefined;
10
- let loadError: any;
11
- try {
12
- routeContext = await loadRouteContext(Astro);
13
- } catch (err: any) {
14
- if (err.astroResponse) {
15
- return err.astroResponse;
16
- }
17
- loadError = err;
18
- }
19
- ---
20
-
21
- <!DOCTYPE html>
22
- <html lang={routeContext?.lang.replace('_', '-')}>
23
- {routeContext &&
24
- <Base>
25
- <BaseHead slot="base-head" />
26
- <PageHeader />
27
- <HomeMain />
28
- <PageFooter />
29
- </Base>
30
- }
31
- {loadError && <Fragment set:html={loadError.responseHTML} />}
32
- </html>