cloudcommerce 0.22.1 → 0.22.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 (167) hide show
  1. package/.editorconfig +13 -0
  2. package/.gitmodules +3 -0
  3. package/.vscode/settings.json +2 -1
  4. package/CHANGELOG.md +25 -0
  5. package/ecomplus-stores/barra-doce/.devcontainer/devcontainer.json +30 -0
  6. package/ecomplus-stores/barra-doce/.editorconfig +13 -0
  7. package/ecomplus-stores/barra-doce/.eslintrc.cjs +3 -0
  8. package/ecomplus-stores/barra-doce/.firebaserc +5 -0
  9. package/ecomplus-stores/barra-doce/.github/build-and-deploy +1 -0
  10. package/ecomplus-stores/barra-doce/.github/renovate.json +5 -0
  11. package/ecomplus-stores/barra-doce/.github/workflows/build-and-deploy.yml +36 -0
  12. package/ecomplus-stores/barra-doce/.github/workflows/calibreapp-image-actions.yml +23 -0
  13. package/ecomplus-stores/barra-doce/.gitpod.yml +12 -0
  14. package/ecomplus-stores/barra-doce/.nvmrc +1 -0
  15. package/ecomplus-stores/barra-doce/.vscode/extensions.json +8 -0
  16. package/ecomplus-stores/barra-doce/.vscode/launch.json +11 -0
  17. package/ecomplus-stores/barra-doce/.vscode/settings.json +10 -0
  18. package/ecomplus-stores/barra-doce/LICENSE.md +230 -0
  19. package/ecomplus-stores/barra-doce/README.md +31 -0
  20. package/ecomplus-stores/barra-doce/SETUP.md +117 -0
  21. package/ecomplus-stores/{iluminim/README.pt-BR.md → barra-doce/SETUP.pt-BR.md} +5 -1
  22. package/ecomplus-stores/barra-doce/functions/config.json +3 -0
  23. package/ecomplus-stores/barra-doce/functions/example.env +10 -0
  24. package/ecomplus-stores/barra-doce/functions/many/index.js +14 -0
  25. package/ecomplus-stores/barra-doce/functions/many/package.json +22 -0
  26. package/ecomplus-stores/barra-doce/functions/ssr/.eslintrc.cjs +6 -0
  27. package/ecomplus-stores/barra-doce/functions/ssr/astro.config.mjs +4 -0
  28. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/.gitkeep +0 -0
  29. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/.gitkeep +0 -0
  30. package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +37 -0
  31. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +33 -0
  32. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +48 -0
  33. package/ecomplus-stores/barra-doce/functions/ssr/index.js +18 -0
  34. package/ecomplus-stores/barra-doce/functions/ssr/package.json +31 -0
  35. package/ecomplus-stores/barra-doce/functions/ssr/public/admin/.gitkeep +2 -0
  36. package/ecomplus-stores/barra-doce/functions/ssr/public/assets/.gitkeep +2 -0
  37. package/ecomplus-stores/barra-doce/functions/ssr/public/img/icon.png +0 -0
  38. package/ecomplus-stores/barra-doce/functions/ssr/public/img/large-icon.png +0 -0
  39. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner-forma-decora.jpg +0 -0
  40. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner2.webp +0 -0
  41. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
  42. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/headphone.webp +0 -0
  43. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo-barradoce.webp +0 -0
  44. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo.png +0 -0
  45. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/og-image.png +0 -0
  46. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/passion.webp +0 -0
  47. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect8589.png +0 -0
  48. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect859.png +0 -0
  49. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect89.webp +0 -0
  50. package/ecomplus-stores/barra-doce/functions/ssr/public/robots.txt +8 -0
  51. package/ecomplus-stores/barra-doce/functions/ssr/scripts/build.sh +14 -0
  52. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +65 -0
  53. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +104 -0
  54. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Banner.vue +64 -0
  55. package/ecomplus-stores/barra-doce/functions/ssr/src/components/BannersGrid.astro +25 -0
  56. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +35 -0
  57. package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +51 -0
  58. package/ecomplus-stores/barra-doce/functions/ssr/src/components/PitchBar.vue +53 -0
  59. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +96 -0
  60. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +117 -0
  61. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +60 -0
  62. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +6 -0
  63. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +180 -0
  64. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderMenu.vue +66 -0
  65. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +90 -0
  66. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +61 -0
  67. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenavCategory.vue +80 -0
  68. package/ecomplus-stores/barra-doce/functions/ssr/src/env.d.ts +13 -0
  69. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Base.astro +15 -0
  70. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Checkout.astro +0 -0
  71. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +42 -0
  72. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +10 -0
  73. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +30 -0
  74. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Sections.astro +29 -0
  75. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +18 -0
  76. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +40 -0
  77. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/_vue.ts +3 -0
  78. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +0 -0
  79. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +0 -0
  80. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/fallback.astro +25 -0
  81. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +35 -0
  82. package/ecomplus-stores/barra-doce/functions/ssr/src/scripts/InlineScripts.astro +10 -0
  83. package/ecomplus-stores/barra-doce/functions/ssr/tailwind.config.cjs +19 -0
  84. package/ecomplus-stores/barra-doce/functions/ssr/tsconfig.json +12 -0
  85. package/ecomplus-stores/barra-doce/functions/ssr/uno.config.cjs +5 -0
  86. package/ecomplus-stores/barra-doce/functions/with-apps/index.js +12 -0
  87. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +22 -0
  88. package/ecomplus-stores/barra-doce/package.json +28 -0
  89. package/ecomplus-stores/barra-doce/scripts/install.sh +14 -0
  90. package/ecomplus-stores/iluminim/.ecomplus.cd.json +5 -0
  91. package/ecomplus-stores/iluminim/.editorconfig +13 -0
  92. package/ecomplus-stores/iluminim/README.md +11 -93
  93. package/ecomplus-stores/iluminim/SETUP.md +117 -0
  94. package/ecomplus-stores/iluminim/SETUP.pt-BR.md +117 -0
  95. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  96. package/ecomplus-stores/iluminim/functions/ssr/package.json +6 -6
  97. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +1 -1
  98. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +2 -2
  99. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +4 -2
  100. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +10 -1
  101. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  102. package/ecomplus-stores/iluminim/package.json +1 -1
  103. package/package.json +1 -1
  104. package/packages/api/package.json +1 -1
  105. package/packages/apps/affilate-program/package.json +1 -1
  106. package/packages/apps/correios/package.json +1 -1
  107. package/packages/apps/custom-payment/package.json +1 -1
  108. package/packages/apps/custom-shipping/package.json +1 -1
  109. package/packages/apps/datafrete/package.json +1 -1
  110. package/packages/apps/discounts/package.json +1 -1
  111. package/packages/apps/emails/package.json +1 -1
  112. package/packages/apps/fb-conversions/package.json +1 -1
  113. package/packages/apps/flash-courier/package.json +1 -1
  114. package/packages/apps/frenet/package.json +1 -1
  115. package/packages/apps/galaxpay/package.json +1 -1
  116. package/packages/apps/google-analytics/package.json +1 -1
  117. package/packages/apps/jadlog/package.json +1 -1
  118. package/packages/apps/loyalty-points/package.json +1 -1
  119. package/packages/apps/melhor-envio/package.json +1 -1
  120. package/packages/apps/mercadopago/package.json +1 -1
  121. package/packages/apps/pagarme/package.json +1 -1
  122. package/packages/apps/paghiper/package.json +1 -1
  123. package/packages/apps/pix/package.json +1 -1
  124. package/packages/apps/tiny-erp/package.json +1 -1
  125. package/packages/apps/webhooks/package.json +1 -1
  126. package/packages/cli/package.json +1 -1
  127. package/packages/config/package.json +1 -1
  128. package/packages/emails/package.json +1 -1
  129. package/packages/events/package.json +1 -1
  130. package/packages/feeds/package.json +1 -1
  131. package/packages/firebase/package.json +1 -1
  132. package/packages/i18n/package.json +1 -1
  133. package/packages/modules/package.json +1 -1
  134. package/packages/passport/package.json +1 -1
  135. package/packages/ssr/package.json +1 -1
  136. package/packages/storefront/dist/client/_astro/HeroSlider.cea1f361.js +1 -0
  137. package/packages/storefront/dist/client/_astro/{ProductShelf.9e290480.js → ProductShelf.35614736.js} +1 -1
  138. package/packages/storefront/dist/client/_astro/ShopHeader.1c27e68e.js +4 -0
  139. package/packages/storefront/dist/client/_astro/{_...slug_.2f4f6929.css → _...slug_.c13e0486.css} +1 -1
  140. package/packages/storefront/dist/client/sw.js +1 -1
  141. package/packages/storefront/dist/server/chunks/{_...d496b072.mjs → _...75363048.mjs} +2 -2
  142. package/packages/storefront/dist/server/chunks/{account@_@astro.1b311a3d.mjs → account@_@astro.12fbe243.mjs} +1 -1
  143. package/packages/storefront/dist/server/chunks/{endpoint@_@js.631ff6c5.mjs → endpoint@_@js.67b66d0a.mjs} +2 -2
  144. package/packages/storefront/dist/server/chunks/{fallback@_@astro.12cf85ba.mjs → fallback@_@astro.0a6656b6.mjs} +2 -2
  145. package/packages/storefront/dist/server/chunks/{index@_@astro.69eb5e8a.mjs → index@_@astro.a4c9c84e.mjs} +2 -2
  146. package/packages/storefront/dist/server/chunks/{index@_@astro.a20d91aa.mjs → index@_@astro.df499bf2.mjs} +2 -2
  147. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.c93fc36d.mjs → _...slug_.astro.a71c9334.mjs} +77 -38
  148. package/packages/storefront/dist/server/chunks/pages/{endpoint.js.630b1212.mjs → endpoint.js.085dadb5.mjs} +1 -1
  149. package/packages/storefront/dist/server/chunks/pages/{fallback.astro.58c7e581.mjs → fallback.astro.055cb7df.mjs} +1 -1
  150. package/packages/storefront/dist/server/chunks/pages/{index.astro.6efe85be.mjs → index.astro.abc34f72.mjs} +5 -5
  151. package/packages/storefront/dist/server/entry.mjs +8 -8
  152. package/packages/storefront/dist/server/renderers.mjs +1 -1
  153. package/packages/storefront/package.json +1 -1
  154. package/packages/storefront/src/lib/$storefront.d.ts +1 -0
  155. package/packages/storefront/src/lib/components/SharedData.astro +12 -0
  156. package/packages/storefront/src/lib/composables/use-prices.ts +1 -1
  157. package/packages/storefront/src/lib/composables/use-shared-data.ts +18 -0
  158. package/packages/storefront/src/lib/composables/use-shop-header-submenu.ts +10 -1
  159. package/packages/storefront/src/lib/composables/use-shop-header.ts +20 -19
  160. package/packages/storefront/src/lib/composables/use-sticky-header.ts +1 -1
  161. package/packages/storefront/src/lib/layouts/BaseHead.astro +1 -1
  162. package/packages/storefront/src/lib/layouts/use-page-header.ts +14 -2
  163. package/packages/storefront/src/lib/ssr-context.ts +1 -0
  164. package/packages/types/package.json +1 -1
  165. package/pnpm-workspace.yaml +2 -0
  166. package/packages/storefront/dist/client/_astro/HeroSlider.0890631f.js +0 -1
  167. package/packages/storefront/dist/client/_astro/ShopHeader.82ae97a5.js +0 -4
@@ -274,7 +274,8 @@ if (!globalThis.$storefront) {
274
274
  settings: {},
275
275
  onLoad(callback) {
276
276
  emitter.on("load", callback);
277
- }
277
+ },
278
+ data: {}
278
279
  };
279
280
  }
280
281
  const setResponseCache = (Astro, maxAge, sMaxAge) => {
@@ -404,10 +405,10 @@ const loadRouteContext = async (Astro, {
404
405
 
405
406
  const pwaInfo = {"pwaInDevEnvironment":false,"webManifest":{"href":"/manifest.webmanifest","useCredentials":false,"linkTag":"<link rel=\"manifest\" href=\"/manifest.webmanifest\">"}};
406
407
 
407
- var __freeze$1 = Object.freeze;
408
- var __defProp$1 = Object.defineProperty;
409
- var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
410
- var _a$1;
408
+ var __freeze$2 = Object.freeze;
409
+ var __defProp$2 = Object.defineProperty;
410
+ var __template$2 = (cooked, raw) => __freeze$2(__defProp$2(cooked, "raw", { value: __freeze$2(raw || cooked.slice()) }));
411
+ var _a$2;
411
412
  const $$Astro$8 = createAstro("https://ecom2-demo.web.app");
412
413
  const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
413
414
  const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
@@ -461,7 +462,7 @@ window.ECOM_LANG = '${lang}';
461
462
  window.ECOM_CURRENCY = '${currency}';
462
463
  window.ECOM_CURRENCY_SYMBOL = '${currencySymbol}';
463
464
  window.ECOM_COUNTRY_CODE = '${countryCode}';
464
- window.$storefront = ${JSON.stringify({ settings })};`;
465
+ window.$storefront = ${JSON.stringify({ settings, data: {} })};`;
465
466
  if (apiContext.error) {
466
467
  const { message, statusCode } = apiContext.error;
467
468
  const url = Astro2.url.pathname;
@@ -511,7 +512,7 @@ window.$isCmsPreview = true;`;
511
512
  url: `https://${domain}/`,
512
513
  logo: `https://${domain}${settings.logo}`
513
514
  });
514
- return renderTemplate(_a$1 || (_a$1 = __template$1(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n<title>", '</title>\n<meta name="description"', '>\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n", "\n", "\n\n<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>"])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd));
515
+ return renderTemplate(_a$2 || (_a$2 = __template$2(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n<title>", '</title>\n<meta name="description"', '>\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n", "\n", "\n\n<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>"])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd));
515
516
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", void 0);
516
517
 
517
518
  function isRemoteImage(src) {
@@ -600,7 +601,7 @@ async function getImage(transform) {
600
601
  }
601
602
  let loader = (_a = globalThis.astroImage) == null ? void 0 : _a.loader;
602
603
  if (!loader) {
603
- const { default: mod } = await import('./endpoint.js.630b1212.mjs').then(n => n.s).catch(() => {
604
+ const { default: mod } = await import('./endpoint.js.085dadb5.mjs').then(n => n.s).catch(() => {
604
605
  throw new Error(
605
606
  "[@astrojs/image] Builtin image loader not found. (Did you remember to add the integration to your Astro config?)"
606
607
  );
@@ -907,15 +908,15 @@ ${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2)
907
908
  ` })}`;
908
909
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
909
910
 
910
- var __freeze = Object.freeze;
911
- var __defProp = Object.defineProperty;
912
- var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
913
- var _a;
911
+ var __freeze$1 = Object.freeze;
912
+ var __defProp$1 = Object.defineProperty;
913
+ var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
914
+ var _a$1;
914
915
  const $$Astro$4 = createAstro("https://ecom2-demo.web.app");
915
916
  const $$InlineScripts = createComponent(async ($$result, $$props, $$slots) => {
916
917
  const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
917
918
  Astro2.self = $$InlineScripts;
918
- return renderTemplate(_a || (_a = __template(['<script>\n window.$firebaseConfig = {\n apiKey: "AIzaSyCnvm7QrPKzSBrUi09Z3zTgjDST0t4Yikg",\n authDomain: "ecom2-demo.firebaseapp.com",\n projectId: "ecom2-demo",\n storageBucket: "ecom2-demo.appspot.com",\n messagingSenderId: "70369627313",\n appId: "1:70369627313:web:06634033b9c6208fe7e690"\n };\n<\/script>'])));
919
+ return renderTemplate(_a$1 || (_a$1 = __template$1(['<script>\n window.$firebaseConfig = {\n apiKey: "AIzaSyCnvm7QrPKzSBrUi09Z3zTgjDST0t4Yikg",\n authDomain: "ecom2-demo.firebaseapp.com",\n projectId: "ecom2-demo",\n storageBucket: "ecom2-demo.appspot.com",\n messagingSenderId: "70369627313",\n appId: "1:70369627313:web:06634033b9c6208fe7e690"\n };\n<\/script>'])));
919
920
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/scripts/InlineScripts.astro", void 0);
920
921
 
921
922
  const $$Astro$3 = createAstro("https://ecom2-demo.web.app");
@@ -1054,7 +1055,7 @@ const usePitchBar = (props) => {
1054
1055
  };
1055
1056
  };
1056
1057
 
1057
- const usePageHeader = async ({ routeContext }) => {
1058
+ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
1058
1059
  const { apiState, getContent } = routeContext;
1059
1060
  const layoutContent = await getContent("layout");
1060
1061
  const {
@@ -1065,7 +1066,18 @@ const usePageHeader = async ({ routeContext }) => {
1065
1066
  let { categories } = apiState;
1066
1067
  if (!categories) {
1067
1068
  try {
1068
- categories = (await api.get("categories")).data.result;
1069
+ categories = (await api.get("categories", {
1070
+ fields: listedCategoryFields || [
1071
+ "name",
1072
+ "slug",
1073
+ "parent.name",
1074
+ "parent.slug",
1075
+ "icon.url",
1076
+ "icon.size",
1077
+ "pictures.0.url",
1078
+ "pictures.0.size"
1079
+ ]
1080
+ })).data.result;
1069
1081
  } catch (err) {
1070
1082
  categories = [];
1071
1083
  console.error(err);
@@ -1084,6 +1096,14 @@ const usePageHeader = async ({ routeContext }) => {
1084
1096
  };
1085
1097
  };
1086
1098
 
1099
+ const useSharedData = ({ field, value }) => {
1100
+ global.$storefront.data[field] = value;
1101
+ return {
1102
+ inlineClientJS: `
1103
+ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
1104
+ };
1105
+ };
1106
+
1087
1107
  const carouselKey = Symbol("carousel");
1088
1108
 
1089
1109
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
@@ -1683,7 +1703,7 @@ const filterMainCategories = (categories, featuredSlugs) => {
1683
1703
  const filterSubcategories = (categories, parentCategory, isAlphabeticalSort = false) => {
1684
1704
  const subcategories = categories.filter(({ name, slug, parent }) => {
1685
1705
  if (name && slug && parent) {
1686
- return parent._id === parentCategory._id || parent.slug && parent.slug === parentCategory.slug;
1706
+ return parent._id && parent._id === parentCategory._id || parent.slug && parent.slug === parentCategory.slug;
1687
1707
  }
1688
1708
  return false;
1689
1709
  });
@@ -1696,13 +1716,14 @@ const filterSubcategories = (categories, parentCategory, isAlphabeticalSort = fa
1696
1716
  }
1697
1717
  return subcategories;
1698
1718
  };
1699
- const useShopHeader = ({
1700
- header,
1701
- categories,
1702
- menuCategorySlugs,
1703
- menuRandomCategories = 7,
1704
- isAlphabeticalSortSubmenu
1705
- }) => {
1719
+ const useShopHeader = (props) => {
1720
+ const {
1721
+ header,
1722
+ categories = globalThis.$storefront.data.categories || [],
1723
+ menuCategorySlugs,
1724
+ menuRandomCategories = 7,
1725
+ isAlphabeticalSortSubmenu
1726
+ } = props;
1706
1727
  const {
1707
1728
  isSticky,
1708
1729
  staticHeight,
@@ -2180,15 +2201,16 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2180
2201
  if (!$setup.isOpen && $props.categoryTree.icon) {
2181
2202
  _push(ssrRenderComponent(_component_AImg, {
2182
2203
  picture: $props.categoryTree.icon,
2204
+ alt: $props.categoryTree.name,
2183
2205
  class: "w-auto h-5 inline mr-3"
2184
2206
  }, null, _parent));
2185
2207
  } else {
2186
2208
  _push(`<!---->`);
2187
2209
  }
2188
2210
  _push(`<h3 class="${ssrRenderClass([$setup.isOpen ? "ml-4 text-base" : null, "inline"])}">${ssrInterpolate($props.categoryTree.name)}</h3></summary><ul class="${ssrRenderClass([$setup.isFaded ? "opacity-20" : "opacity-100", "mt-2 transition-opacity"])}" tabindex="-1"><!--[-->`);
2189
- ssrRenderList($props.categoryTree.subcategories, (subcategoryTree) => {
2211
+ ssrRenderList($props.categoryTree.subcategories, (subcategoryTree, i) => {
2190
2212
  _push(ssrRenderComponent(_component_ShopSidenavCategory, {
2191
- key: subcategoryTree._id,
2213
+ key: i,
2192
2214
  "category-tree": subcategoryTree
2193
2215
  }, null, _parent));
2194
2216
  });
@@ -2198,6 +2220,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2198
2220
  if (!$setup.isOpen && $props.categoryTree.icon) {
2199
2221
  _push(ssrRenderComponent(_component_AImg, {
2200
2222
  picture: $props.categoryTree.icon,
2223
+ alt: $props.categoryTree.name,
2201
2224
  class: "w-auto h-5 inline mr-3"
2202
2225
  }, null, _parent));
2203
2226
  } else {
@@ -2238,9 +2261,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2238
2261
  });
2239
2262
  function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2240
2263
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-full" }, _attrs))}><nav class="py-4 grow"><ul class="relative h-full"><!--[-->`);
2241
- ssrRenderList($props.categoryTrees, (categoryTree) => {
2264
+ ssrRenderList($props.categoryTrees, (categoryTree, i) => {
2242
2265
  _push(ssrRenderComponent($setup["ShopSidenavCategory"], {
2243
- key: categoryTree._id,
2266
+ key: i,
2244
2267
  "category-tree": categoryTree
2245
2268
  }, null, _parent));
2246
2269
  });
@@ -2286,7 +2309,16 @@ _sfc_main$6.setup = (props, ctx) => {
2286
2309
  const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
2287
2310
 
2288
2311
  const useShopHeaderSubmenu = (props) => {
2289
- const categoryPicture = computed(() => props.categoryTree.pictures?.[0]);
2312
+ const categoryPicture = computed(() => {
2313
+ const picture = props.categoryTree.pictures?.[0];
2314
+ if (picture && !picture.alt) {
2315
+ return {
2316
+ alt: props.categoryTree.name,
2317
+ ...picture
2318
+ };
2319
+ }
2320
+ return void 0;
2321
+ });
2290
2322
  const subcategoriesWithChild = computed(() => {
2291
2323
  return props.categoryTree.subcategories.filter(({ subcategories }) => subcategories.length);
2292
2324
  });
@@ -2429,7 +2461,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2429
2461
  ])) : createCommentVNode("", true),
2430
2462
  (openBlock(true), createBlock(Fragment$1, null, renderList($setup.subcategoryCols, (subcategory, i) => {
2431
2463
  return openBlock(), createBlock("div", {
2432
- key: subcategory._id,
2464
+ key: i,
2433
2465
  class: "flex-1"
2434
2466
  }, [
2435
2467
  createVNode("a", {
@@ -2501,7 +2533,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2501
2533
  ])) : createCommentVNode("", true),
2502
2534
  (openBlock(true), createBlock(Fragment$1, null, renderList($setup.subcategoryCols, (subcategory, i) => {
2503
2535
  return openBlock(), createBlock("div", {
2504
- key: subcategory._id,
2536
+ key: i,
2505
2537
  class: "flex-1"
2506
2538
  }, [
2507
2539
  createVNode("a", {
@@ -2586,7 +2618,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2586
2618
  ])) : createCommentVNode("", true),
2587
2619
  (openBlock(true), createBlock(Fragment$1, null, renderList($setup.subcategoryCols, (subcategory, i) => {
2588
2620
  return openBlock(), createBlock("div", {
2589
- key: subcategory._id,
2621
+ key: i,
2590
2622
  class: "flex-1"
2591
2623
  }, [
2592
2624
  createVNode("a", {
@@ -3536,6 +3568,10 @@ _sfc_main.setup = (props, ctx) => {
3536
3568
  };
3537
3569
  const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
3538
3570
 
3571
+ var __freeze = Object.freeze;
3572
+ var __defProp = Object.defineProperty;
3573
+ var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
3574
+ var _a;
3539
3575
  const $$Astro$2 = createAstro("https://ecom2-demo.web.app");
3540
3576
  const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3541
3577
  const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
@@ -3543,16 +3579,19 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3543
3579
  const { routeContext } = Astro2.locals;
3544
3580
  const { settings, isHomepage } = routeContext;
3545
3581
  const LogoHeading = isHomepage ? "h1" : "h2";
3546
- const { pitchBar, shopHeader } = await usePageHeader({ routeContext });
3547
- return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate`
3548
- ${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`}
3549
- ${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`}
3550
-
3551
- ${renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
3582
+ const {
3583
+ pitchBar,
3584
+ shopHeader: { categories, ...shopHeader }
3585
+ } = await usePageHeader({ routeContext });
3586
+ const { inlineClientJS } = useSharedData({
3587
+ field: "categories",
3588
+ value: categories?.map(({ _id, ...c }) => c)
3589
+ });
3590
+ return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a || (_a = __template(["\n ", "\n ", "\n\n<script>", "<\/script>\n", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(inlineClientJS), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
3552
3591
  ${maybeRenderHead()}<a href="/">
3553
3592
  ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "logo-picture": ($$result4) => renderTemplate`${renderComponent($$result4, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}` })}
3554
3593
  </a>
3555
- ` })}` })}`)}`;
3594
+ ` })}` })))}`;
3556
3595
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
3557
3596
 
3558
3597
  const $$Astro$1 = createAstro("https://ecom2-demo.web.app");
@@ -1,6 +1,6 @@
1
1
  import mime from 'mime';
2
2
  import sharp$1 from 'sharp';
3
- import { B as BaseSSRService, i as isOutputFormatSupportsAlpha } from './_...slug_.astro.c93fc36d.mjs';
3
+ import { B as BaseSSRService, i as isOutputFormatSupportsAlpha } from './_...slug_.astro.a71c9334.mjs';
4
4
 
5
5
  class SharpService extends BaseSSRService {
6
6
  async transform(inputBuffer, transform) {
@@ -1,5 +1,5 @@
1
1
  import { c as createAstro, a as createComponent, r as renderTemplate, m as maybeRenderHead, d as addAttribute, b as renderComponent } from '../astro.e0968ba7.mjs';
2
- import { l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.c93fc36d.mjs';
2
+ import { l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.a71c9334.mjs';
3
3
  import 'path-to-regexp';
4
4
  import 'cookie';
5
5
  import '@astrojs/internal-helpers/path';
@@ -1,5 +1,5 @@
1
1
  import { c as createAstro, a as createComponent, r as renderTemplate, b as renderComponent, m as maybeRenderHead, d as addAttribute, u as unescapeHTML, F as Fragment$1 } from '../astro.e0968ba7.mjs';
2
- import { c as $$Picture, p as parseShippingPhrase, _ as _export_sfc, C as Carousel, d as CarouselControl, e as availableExtraDiscount, f as installmentsOption, g as discountOption, h as loyaltyPointsPrograms, j as addProductToCart, l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.c93fc36d.mjs';
2
+ import { c as $$Picture, p as parseShippingPhrase, _ as _export_sfc, C as Carousel, d as CarouselControl, e as availableExtraDiscount, f as installmentsOption, g as discountOption, h as loyaltyPointsPrograms, j as addProductToCart, l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.a71c9334.mjs';
3
3
  import { ref, shallowReactive, computed, useSSRContext, defineComponent, mergeProps, createVNode, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, withDirectives, vShow, openBlock, createBlock, Fragment, renderList, resolveComponent, createCommentVNode, withModifiers, withAsyncContext } from 'vue';
4
4
  import api from '@cloudcommerce/api';
5
5
  import { inStock, price, name, img, onPromotion } from '@ecomplus/utils';
@@ -288,11 +288,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
288
288
  });
289
289
  function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
290
290
  _push(`<div${ssrRenderAttrs(mergeProps({
291
- class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 md:grid-cols-2 items-center" : null]
291
+ class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
292
292
  }, _attrs))}>`);
293
293
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.href ? "a-link" : "span"), {
294
294
  href: $props.href,
295
- class: $setup.hasHeader ? "basis-1/2 grow-0 md:order-last" : null
295
+ class: $setup.hasHeader ? "sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover" : "[&_img]:max-w-full"
296
296
  }, {
297
297
  default: withCtx((_, _push2, _parent2, _scopeId) => {
298
298
  if (_push2) {
@@ -306,7 +306,7 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
306
306
  _: 3
307
307
  }), _parent);
308
308
  if ($setup.hasHeader) {
309
- _push(`<div class="basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0">`);
309
+ _push(`<div class="p-12 xl:ps-32 mb-3 sm:mb-0">`);
310
310
  if ($setup.parsedTitle) {
311
311
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.headingTag), { class: "ui-title mt-1" }, {
312
312
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -641,7 +641,7 @@ const usePrices = (props) => {
641
641
  return 1;
642
642
  }
643
643
  const minInstallment = installmentsObject.value.min_installment || 5;
644
- const maxInstallmentsNumber = Math.round(salePrice.value / minInstallment);
644
+ const maxInstallmentsNumber = Math.floor(salePrice.value / minInstallment);
645
645
  return Math.min(maxInstallmentsNumber, installmentsObject.value.max_number);
646
646
  });
647
647
  const monthlyInterest = computed(() => {
@@ -26,7 +26,7 @@ import 'html-escaper';
26
26
  import 'vue';
27
27
  import 'vue/server-renderer';
28
28
  import '@ecomplus/utils';
29
- import './chunks/pages/_...slug_.astro.c93fc36d.mjs';
29
+ import './chunks/pages/_...slug_.astro.a71c9334.mjs';
30
30
  import 'node:fs/promises';
31
31
  import 'node:path';
32
32
  import 'node:url';
@@ -2825,13 +2825,13 @@ const adapter = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2825
2825
  start
2826
2826
  }, Symbol.toStringTag, { value: 'Module' }));
2827
2827
 
2828
- const _page0 = () => import('./chunks/endpoint@_@js.631ff6c5.mjs');
2829
- const _page1 = () => import('./chunks/index@_@astro.69eb5e8a.mjs');
2830
- const _page2 = () => import('./chunks/fallback@_@astro.12cf85ba.mjs');
2831
- const _page3 = () => import('./chunks/index@_@astro.a20d91aa.mjs');
2832
- const _page4 = () => import('./chunks/account@_@astro.1b311a3d.mjs');
2833
- const _page5 = () => import('./chunks/_...d496b072.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint.js", _page0],["src/pages/index.astro", _page1],["src/pages/fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5]]);
2834
- const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.2f4f6929.css"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.2f4f6929.css"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.2f4f6929.css"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-demo.web.app","base":"/","compressHTML":false,"markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,n)=>{let s=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),s();break}});for(let e of n.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/app/account.astro":"chunks/pages/account.astro.0003ca94.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.58c7e581.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.631ff6c5.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.69eb5e8a.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.12cf85ba.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.a20d91aa.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.1b311a3d.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...d496b072.mjs","/astro/hoisted.js?q=0":"_astro/hoisted.572313d6.js","~/components/PitchBar.vue":"_astro/PitchBar.ed85833a.js","~/components/HeroSlider.vue":"_astro/HeroSlider.0890631f.js","~/components/ProductShelf.vue":"_astro/ProductShelf.9e290480.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.a7b12eab.js","@astrojs/vue/client.js":"_astro/client.0fb6b44e.js","~/components/ShopHeader.vue":"_astro/ShopHeader.82ae97a5.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.84207480.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_...slug_.2f4f6929.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-5e0bf4e4.js","/_astro/Carousel.62c97a79.js","/_astro/HeroSlider.0890631f.js","/_astro/PitchBar.ed85833a.js","/_astro/ProductShelf.9e290480.js","/_astro/ShopHeader.82ae97a5.js","/_astro/_plugin-vue_export-helper.4cb7dd76.js","/_astro/api.4984c5be.js","/_astro/client.0fb6b44e.js","/_astro/firebase-app.84207480.js","/_astro/hoisted.572313d6.js","/_astro/img.abbe849f.js","/_astro/index.b93f3d06.js","/_astro/preload-helper.cf010ec4.js","/_astro/session-utm.744b0db3.js","/_astro/workbox-window.prod.es5.a7b12eab.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]}), {
2828
+ const _page0 = () => import('./chunks/endpoint@_@js.67b66d0a.mjs');
2829
+ const _page1 = () => import('./chunks/index@_@astro.a4c9c84e.mjs');
2830
+ const _page2 = () => import('./chunks/fallback@_@astro.0a6656b6.mjs');
2831
+ const _page3 = () => import('./chunks/index@_@astro.df499bf2.mjs');
2832
+ const _page4 = () => import('./chunks/account@_@astro.12fbe243.mjs');
2833
+ const _page5 = () => import('./chunks/_...75363048.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint.js", _page0],["src/pages/index.astro", _page1],["src/pages/fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5]]);
2834
+ const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c13e0486.css"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c13e0486.css"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c13e0486.css"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-demo.web.app","base":"/","compressHTML":false,"markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,n)=>{let s=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),s();break}});for(let e of n.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/app/account.astro":"chunks/pages/account.astro.0003ca94.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.055cb7df.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.67b66d0a.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.a4c9c84e.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.0a6656b6.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.df499bf2.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.12fbe243.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...75363048.mjs","~/components/PitchBar.vue":"_astro/PitchBar.ed85833a.js","/astro/hoisted.js?q=0":"_astro/hoisted.572313d6.js","~/components/HeroSlider.vue":"_astro/HeroSlider.cea1f361.js","@astrojs/vue/client.js":"_astro/client.0fb6b44e.js","~/components/ProductShelf.vue":"_astro/ProductShelf.35614736.js","~/components/ShopHeader.vue":"_astro/ShopHeader.1c27e68e.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.a7b12eab.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.84207480.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_...slug_.c13e0486.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-5e0bf4e4.js","/_astro/Carousel.62c97a79.js","/_astro/HeroSlider.cea1f361.js","/_astro/PitchBar.ed85833a.js","/_astro/ProductShelf.35614736.js","/_astro/ShopHeader.1c27e68e.js","/_astro/_plugin-vue_export-helper.4cb7dd76.js","/_astro/api.4984c5be.js","/_astro/client.0fb6b44e.js","/_astro/firebase-app.84207480.js","/_astro/hoisted.572313d6.js","/_astro/img.abbe849f.js","/_astro/index.b93f3d06.js","/_astro/preload-helper.cf010ec4.js","/_astro/session-utm.744b0db3.js","/_astro/workbox-window.prod.es5.a7b12eab.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]}), {
2835
2835
  pageMap,
2836
2836
  renderers,
2837
2837
  });
@@ -2,7 +2,7 @@ import { h as server_default } from './chunks/astro.e0968ba7.mjs';
2
2
  import { useSSRContext, defineComponent, computed, mergeProps, h, createSSRApp } from 'vue';
3
3
  import { ssrRenderSlotInner, ssrRenderAttrs, ssrRenderSlot, renderToString } from 'vue/server-renderer';
4
4
  import { img, imgSizes, i18n, formatMoney } from '@ecomplus/utils';
5
- import { _ as _export_sfc } from './chunks/pages/_...slug_.astro.c93fc36d.mjs';
5
+ import { _ as _export_sfc } from './chunks/pages/_...slug_.astro.a71c9334.mjs';
6
6
  import 'path-to-regexp';
7
7
  import 'cookie';
8
8
  import '@astrojs/internal-helpers/path';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.22.1",
4
+ "version": "0.22.3",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -25,4 +25,5 @@ export type $Storefront = {
25
25
  doc: CollectionSet,
26
26
  timestamp: number,
27
27
  },
28
+ data: Record<string, any>,
28
29
  };
@@ -0,0 +1,12 @@
1
+ ---
2
+ import {
3
+ type Props as UseSharedDataProps,
4
+ useSharedData,
5
+ } from '@@sf/composables/use-shared-data';
6
+
7
+ export interface Props extends UseSharedDataProps {}
8
+
9
+ const { inlineClientJS } = useSharedData(Astro.props);
10
+ ---
11
+
12
+ <script is:inline set:html={inlineClientJS} />
@@ -88,7 +88,7 @@ const usePrices = (props: Props) => {
88
88
  return 1;
89
89
  }
90
90
  const minInstallment = installmentsObject.value.min_installment || 5;
91
- const maxInstallmentsNumber = Math.round(salePrice.value / minInstallment);
91
+ const maxInstallmentsNumber = Math.floor(salePrice.value / minInstallment);
92
92
  return Math.min(maxInstallmentsNumber, installmentsObject.value.max_number);
93
93
  });
94
94
  const monthlyInterest = computed(() => {
@@ -0,0 +1,18 @@
1
+ export interface Props {
2
+ field: string;
3
+ value: any;
4
+ }
5
+
6
+ const useSharedData = ({ field, value }: Props) => {
7
+ global.$storefront.data[field] = value;
8
+ return {
9
+ inlineClientJS: `
10
+ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`,
11
+ };
12
+ };
13
+
14
+ export default useSharedData;
15
+
16
+ export {
17
+ useSharedData,
18
+ };
@@ -7,7 +7,16 @@ export interface Props {
7
7
  }
8
8
 
9
9
  const useShopHeaderSubmenu = (props: Props) => {
10
- const categoryPicture = computed(() => props.categoryTree.pictures?.[0]);
10
+ const categoryPicture = computed(() => {
11
+ const picture = props.categoryTree.pictures?.[0];
12
+ if (picture && !picture.alt) {
13
+ return {
14
+ alt: props.categoryTree.name,
15
+ ...picture,
16
+ };
17
+ }
18
+ return undefined;
19
+ });
11
20
  const subcategoriesWithChild = computed(() => {
12
21
  return props.categoryTree.subcategories
13
22
  .filter(({ subcategories }) => subcategories.length);
@@ -1,24 +1,24 @@
1
1
  import type { Ref } from 'vue';
2
- import type { ResourceId, Categories, CategoriesList } from '@cloudcommerce/api/types';
2
+ import type { Categories } from '@cloudcommerce/api/types';
3
3
  import { computed } from 'vue';
4
4
  import useStickyHeader from '@@sf/composables/use-sticky-header';
5
5
 
6
+ type PartCategory = Partial<Categories>;
7
+
6
8
  export interface Props {
7
9
  header: Ref<HTMLElement | null>;
8
- categories: CategoriesList;
10
+ categories?: PartCategory[];
9
11
  menuCategorySlugs?: string[];
10
12
  menuRandomCategories?: number;
11
13
  isAlphabeticalSortSubmenu?: boolean;
12
14
  }
13
15
 
14
- type MainCategory = Partial<Categories> & {
15
- _id: ResourceId,
16
+ type MainCategory = PartCategory & {
16
17
  name: string,
17
18
  slug: string,
18
19
  parent: undefined,
19
20
  };
20
- type Subcategory = Partial<Categories> & {
21
- _id: ResourceId,
21
+ type Subcategory = PartCategory & {
22
22
  name: string,
23
23
  slug: string,
24
24
  parent: Exclude<Categories['parent'], undefined>,
@@ -33,7 +33,7 @@ export type CategoryTree = MainCategory & {
33
33
  };
34
34
 
35
35
  const filterMainCategories = (
36
- categories: CategoriesList,
36
+ categories: PartCategory[],
37
37
  featuredSlugs?: string[],
38
38
  ) => {
39
39
  const mainCategories = categories.filter(({ name, slug, parent }) => {
@@ -55,13 +55,13 @@ const filterMainCategories = (
55
55
  };
56
56
 
57
57
  const filterSubcategories = (
58
- categories: CategoriesList,
59
- parentCategory: CategoriesList[0],
58
+ categories: PartCategory[],
59
+ parentCategory: PartCategory,
60
60
  isAlphabeticalSort = false,
61
61
  ) => {
62
62
  const subcategories = categories.filter(({ name, slug, parent }) => {
63
63
  if (name && slug && parent) {
64
- return parent._id === parentCategory._id
64
+ return (parent._id && parent._id === parentCategory._id)
65
65
  || (parent.slug && parent.slug === parentCategory.slug);
66
66
  }
67
67
  return false;
@@ -75,13 +75,14 @@ const filterSubcategories = (
75
75
  return subcategories;
76
76
  };
77
77
 
78
- const useShopHeader = ({
79
- header,
80
- categories,
81
- menuCategorySlugs,
82
- menuRandomCategories = 7,
83
- isAlphabeticalSortSubmenu,
84
- }: Props) => {
78
+ const useShopHeader = (props: Props) => {
79
+ const {
80
+ header,
81
+ categories = (globalThis.$storefront.data.categories || []) as PartCategory[],
82
+ menuCategorySlugs,
83
+ menuRandomCategories = 7,
84
+ isAlphabeticalSortSubmenu,
85
+ } = props;
85
86
  const {
86
87
  isSticky,
87
88
  staticHeight,
@@ -91,14 +92,14 @@ const useShopHeader = ({
91
92
  return isSticky.value ? header.value?.offsetHeight : staticY.value;
92
93
  });
93
94
  const mainCategories = filterMainCategories(categories, menuCategorySlugs);
94
- const getSubcategories = (parentCategory: CategoriesList[0]) => {
95
+ const getSubcategories = (parentCategory: PartCategory) => {
95
96
  return filterSubcategories(
96
97
  categories,
97
98
  parentCategory,
98
99
  !!isAlphabeticalSortSubmenu,
99
100
  );
100
101
  };
101
- const getCategoryTree = <T extends CategoriesList[0]>(parentCategory: T):
102
+ const getCategoryTree = <T extends PartCategory>(parentCategory: T):
102
103
  T & { subcategories: SubcategoryTree[] } => {
103
104
  return {
104
105
  ...parentCategory,
@@ -63,7 +63,7 @@ const useStickyHeader = (props: Props) => {
63
63
  const headerElm = header.value as HTMLElement;
64
64
  staticHeight.value = headerElm.offsetHeight;
65
65
  staticY.value = staticHeight.value
66
- + window.pageYOffset + headerElm.getBoundingClientRect().top;
66
+ + window.scrollY + headerElm.getBoundingClientRect().top;
67
67
  start();
68
68
  };
69
69
  const imgs = header.value.getElementsByTagName('IMG');
@@ -56,7 +56,7 @@ window.ECOM_LANG = '${lang}';
56
56
  window.ECOM_CURRENCY = '${currency}';
57
57
  window.ECOM_CURRENCY_SYMBOL = '${currencySymbol}';
58
58
  window.ECOM_COUNTRY_CODE = '${countryCode}';
59
- window.$storefront = ${JSON.stringify({ settings })};`;
59
+ window.$storefront = ${JSON.stringify({ settings, data: {} })};`;
60
60
  if (apiContext.error) {
61
61
  const { message, statusCode } = apiContext.error;
62
62
  const url = Astro.url.pathname;