cloudcommerce 0.16.4 → 0.18.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 (145) hide show
  1. package/.vscode/settings.json +2 -1
  2. package/CHANGELOG.md +41 -0
  3. package/package.json +1 -1
  4. package/packages/api/package.json +1 -1
  5. package/packages/apps/affilate-program/package.json +1 -1
  6. package/packages/apps/correios/package.json +1 -1
  7. package/packages/apps/custom-payment/package.json +1 -1
  8. package/packages/apps/custom-shipping/package.json +1 -1
  9. package/packages/apps/datafrete/package.json +1 -1
  10. package/packages/apps/discounts/package.json +1 -1
  11. package/packages/apps/emails/package.json +1 -1
  12. package/packages/apps/fb-conversions/package.json +1 -1
  13. package/packages/apps/flash-courier/package.json +1 -1
  14. package/packages/apps/frenet/package.json +1 -1
  15. package/packages/apps/galaxpay/package.json +1 -1
  16. package/packages/apps/google-analytics/package.json +1 -1
  17. package/packages/apps/jadlog/package.json +1 -1
  18. package/packages/apps/loyalty-points/package.json +1 -1
  19. package/packages/apps/melhor-envio/package.json +1 -1
  20. package/packages/apps/mercadopago/package.json +1 -1
  21. package/packages/apps/pagarme/package.json +1 -1
  22. package/packages/apps/paghiper/package.json +1 -1
  23. package/packages/apps/pix/package.json +1 -1
  24. package/packages/apps/tiny-erp/package.json +1 -1
  25. package/packages/apps/webhooks/package.json +1 -1
  26. package/packages/cli/package.json +1 -1
  27. package/packages/config/package.json +1 -1
  28. package/packages/emails/package.json +1 -1
  29. package/packages/events/lib/firebase.js +0 -2
  30. package/packages/events/lib/firebase.js.map +1 -1
  31. package/packages/events/package.json +1 -2
  32. package/packages/events/src/firebase.ts +0 -2
  33. package/packages/feeds/package.json +1 -1
  34. package/packages/firebase/lib/config.d.ts +0 -3
  35. package/packages/firebase/lib/config.js +0 -3
  36. package/packages/firebase/lib/config.js.map +1 -1
  37. package/packages/firebase/package.json +1 -1
  38. package/packages/firebase/src/config.ts +0 -3
  39. package/packages/i18n/package.json +1 -1
  40. package/packages/modules/lib/firebase/call-app-module.js +0 -12
  41. package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
  42. package/packages/modules/package.json +1 -2
  43. package/packages/modules/src/firebase/call-app-module.ts +0 -12
  44. package/packages/passport/package.json +1 -1
  45. package/packages/ssr/lib/firebase/serve-storefront.js +144 -45
  46. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
  47. package/packages/ssr/package.json +1 -1
  48. package/packages/ssr/src/firebase/serve-storefront.ts +153 -49
  49. package/packages/storefront/.eslintrc.cjs +1 -0
  50. package/packages/storefront/dist/client/_astro/{Carousel.f39be3c0.js → Carousel.533b4b19.js} +1 -1
  51. package/packages/storefront/dist/client/_astro/HeroSlider.359c76cc.js +1 -0
  52. package/packages/storefront/dist/client/_astro/PitchBar.75d2999f.js +1 -0
  53. package/packages/storefront/dist/client/_astro/Prices.bd0d3474.js +1 -0
  54. package/packages/storefront/dist/client/_astro/ProductShelf.83c66e3e.js +1 -0
  55. package/packages/storefront/dist/client/_astro/ShopHeader.f66a56cb.js +4 -0
  56. package/packages/storefront/dist/client/_astro/_...slug_.b19aabfc.css +1 -0
  57. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.4e6dc3af.js +1 -0
  58. package/packages/storefront/dist/client/_astro/client.24201f93.js +1 -0
  59. package/packages/storefront/dist/client/_astro/{img.517fec8e.js → img.22ad29ec.js} +1 -1
  60. package/packages/storefront/dist/client/_astro/{index.33347cbd.js → index.ddc27a3a.js} +1 -1
  61. package/packages/storefront/dist/client/_astro/modules-info.d6bd555b.js +1 -0
  62. package/packages/storefront/dist/client/_astro/{runtime-dom.esm-bundler.00b967e0.js → runtime-dom.esm-bundler.578d6e91.js} +1 -1
  63. package/packages/storefront/dist/client/sw.js +1 -1
  64. package/packages/storefront/dist/server/chunks/{_...06f412d0.mjs → _...ed1d4ed7.mjs} +2 -2
  65. package/packages/storefront/dist/server/chunks/{account@_@astro.d58b2d34.mjs → account@_@astro.97e06bd2.mjs} +1 -1
  66. package/packages/storefront/dist/server/chunks/{endpoint@_@js.ce919661.mjs → endpoint@_@js.e9171d18.mjs} +2 -2
  67. package/packages/storefront/dist/server/chunks/{fallback@_@astro.6c7c4acd.mjs → fallback@_@astro.4a1f8c08.mjs} +2 -2
  68. package/packages/storefront/dist/server/chunks/{index@_@astro.f7e2409d.mjs → index@_@astro.7472fe37.mjs} +2 -2
  69. package/packages/storefront/dist/server/chunks/{index@_@astro.8e359cb4.mjs → index@_@astro.de13f221.mjs} +2 -2
  70. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.f0a57b8d.mjs → _...slug_.astro.9e731356.mjs} +279 -133
  71. package/packages/storefront/dist/server/chunks/pages/{endpoint.js.1d889b2f.mjs → endpoint.js.96a9b7f9.mjs} +1 -1
  72. package/packages/storefront/dist/server/chunks/pages/{fallback.astro.42f81a9a.mjs → fallback.astro.3ebb4e85.mjs} +3 -2
  73. package/packages/storefront/dist/server/chunks/pages/{index.astro.533679e1.mjs → index.astro.8d786fcb.mjs} +27 -25
  74. package/packages/storefront/dist/server/entry.mjs +8 -8
  75. package/packages/storefront/dist/server/renderers.mjs +4 -3
  76. package/packages/storefront/package.json +1 -1
  77. package/packages/storefront/src/lib/components/Drawer.vue +6 -2
  78. package/packages/storefront/src/lib/components/globals/AImg.vue +2 -1
  79. package/packages/storefront/src/lib/composables/use-prices.ts +10 -8
  80. package/packages/storefront/src/lib/composables/use-product-card.ts +15 -15
  81. package/packages/storefront/src/lib/layouts/BaseBody.astro +3 -3
  82. package/packages/storefront/src/lib/layouts/main/use-page-sections.ts +5 -0
  83. package/packages/storefront/src/lib/layouts/{use-page-layout.ts → use-page-header.ts} +24 -4
  84. package/packages/storefront/src/lib/ssr-context.ts +1 -1
  85. package/packages/storefront/src/lib/state/modules-info.ts +25 -0
  86. package/packages/storefront/src/lib/state/shopping-cart.ts +6 -0
  87. package/packages/types/package.json +1 -1
  88. package/packages/apps/infinitepay/CHANGELOG.md +0 -1
  89. package/packages/apps/infinitepay/README.md +0 -1
  90. package/packages/apps/infinitepay/assets/onload-expression.js +0 -57
  91. package/packages/apps/infinitepay/lib/functions-lib/add-installments.d.ts +0 -55
  92. package/packages/apps/infinitepay/lib/functions-lib/add-installments.js +0 -63
  93. package/packages/apps/infinitepay/lib/functions-lib/add-installments.js.map +0 -1
  94. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-access.d.ts +0 -14
  95. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-access.js +0 -67
  96. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-access.js.map +0 -1
  97. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-axios.d.ts +0 -2
  98. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-axios.js +0 -19
  99. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/create-axios.js.map +0 -1
  100. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/oauth.d.ts +0 -2
  101. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/oauth.js +0 -25
  102. package/packages/apps/infinitepay/lib/functions-lib/ip-auth/oauth.js.map +0 -1
  103. package/packages/apps/infinitepay/lib/functions-lib/utils.d.ts +0 -8
  104. package/packages/apps/infinitepay/lib/functions-lib/utils.js +0 -17
  105. package/packages/apps/infinitepay/lib/functions-lib/utils.js.map +0 -1
  106. package/packages/apps/infinitepay/lib/index.d.ts +0 -1
  107. package/packages/apps/infinitepay/lib/index.js +0 -3
  108. package/packages/apps/infinitepay/lib/index.js.map +0 -1
  109. package/packages/apps/infinitepay/lib/infinitepay.d.ts +0 -80
  110. package/packages/apps/infinitepay/lib/infinitepay.js +0 -12
  111. package/packages/apps/infinitepay/lib/infinitepay.js.map +0 -1
  112. package/packages/apps/infinitepay/lib/ip-create-transaction.d.ts +0 -75
  113. package/packages/apps/infinitepay/lib/ip-create-transaction.js +0 -324
  114. package/packages/apps/infinitepay/lib/ip-create-transaction.js.map +0 -1
  115. package/packages/apps/infinitepay/lib/ip-list-payments.d.ts +0 -7
  116. package/packages/apps/infinitepay/lib/ip-list-payments.js +0 -146
  117. package/packages/apps/infinitepay/lib/ip-list-payments.js.map +0 -1
  118. package/packages/apps/infinitepay/lib/ip-webhook.d.ts +0 -5
  119. package/packages/apps/infinitepay/lib/ip-webhook.js +0 -152
  120. package/packages/apps/infinitepay/lib/ip-webhook.js.map +0 -1
  121. package/packages/apps/infinitepay/package.json +0 -38
  122. package/packages/apps/infinitepay/scripts/build.sh +0 -4
  123. package/packages/apps/infinitepay/src/functions-lib/add-installments.ts +0 -78
  124. package/packages/apps/infinitepay/src/functions-lib/ip-auth/create-access.ts +0 -89
  125. package/packages/apps/infinitepay/src/functions-lib/ip-auth/create-axios.ts +0 -20
  126. package/packages/apps/infinitepay/src/functions-lib/ip-auth/oauth.ts +0 -30
  127. package/packages/apps/infinitepay/src/functions-lib/utils.ts +0 -23
  128. package/packages/apps/infinitepay/src/index.ts +0 -2
  129. package/packages/apps/infinitepay/src/infinitepay.ts +0 -12
  130. package/packages/apps/infinitepay/src/ip-create-transaction.ts +0 -441
  131. package/packages/apps/infinitepay/src/ip-list-payments.ts +0 -178
  132. package/packages/apps/infinitepay/src/ip-webhook.ts +0 -183
  133. package/packages/apps/infinitepay/tsconfig.json +0 -6
  134. package/packages/apps/infinitepay/webhook.js +0 -1
  135. package/packages/storefront/dist/client/_astro/HeroSlider.3d4a1d1c.js +0 -1
  136. package/packages/storefront/dist/client/_astro/PitchBar.c53e6d0b.js +0 -1
  137. package/packages/storefront/dist/client/_astro/Prices.de6df3cb.js +0 -1
  138. package/packages/storefront/dist/client/_astro/ProductShelf.f013b3ee.js +0 -1
  139. package/packages/storefront/dist/client/_astro/ShopHeader.c0ba5061.js +0 -4
  140. package/packages/storefront/dist/client/_astro/_...slug_.45bc69ca.css +0 -1
  141. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.d3aaeb0d.js +0 -1
  142. package/packages/storefront/dist/client/_astro/client.2d950540.js +0 -1
  143. package/packages/storefront/dist/client/_astro/format-money.3b884fcb.js +0 -1
  144. package/packages/storefront/dist/client/_astro/idle-callback.889bf0ea.js +0 -1
  145. package/packages/storefront/dist/client/_astro/modules-info.ad27b027.js +0 -1
@@ -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.f0a57b8d.mjs';
3
+ import { B as BaseSSRService, i as isOutputFormatSupportsAlpha } from './_...slug_.astro.9e731356.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, b as addAttribute, d as renderComponent } from '../astro.2df8d1c5.mjs';
2
- import { l as loadRouteContext, $ as $$Pages } from './_...slug_.astro.f0a57b8d.mjs';
2
+ import { l as loadRouteContext, $ as $$PageHeader, a as $$Base } from './_...slug_.astro.9e731356.mjs';
3
3
  import 'path-to-regexp';
4
4
  import 'cookie';
5
5
  import '@astrojs/internal-helpers/path';
@@ -52,7 +52,8 @@ const $$Fallback = createComponent(async ($$result, $$props, $$slots) => {
52
52
  return err.astroResponse;
53
53
  }
54
54
  return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>
55
- ${renderComponent($$result, "PagesLayout", $$Pages, {}, { "default": ($$result2) => renderTemplate`
55
+ ${renderComponent($$result, "Base", $$Base, {}, { "default": ($$result2) => renderTemplate`
56
+ ${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
56
57
  ${renderComponent($$result2, "FallbackMain", $$Fallback$1, {})}
57
58
  ` })}
58
59
  </html>`;
@@ -1,5 +1,5 @@
1
1
  import { c as createAstro, a as createComponent, r as renderTemplate, d as renderComponent, m as maybeRenderHead, b as addAttribute, u as unescapeHTML, F as Fragment$1 } from '../astro.2df8d1c5.mjs';
2
- import { a as $$Picture, p as parseShippingPhrase, _ as _export_sfc, C as Carousel, b as CarouselControl, m as modulesInfo, l as loadRouteContext, $ as $$Pages } from './_...slug_.astro.f0a57b8d.mjs';
2
+ import { b as $$Picture, p as parseShippingPhrase, _ as _export_sfc, C as Carousel, c as CarouselControl, d as availableExtraDiscount, e as installmentsOption, f as discountOption, g as loyaltyPointsPrograms, l as loadRouteContext, $ as $$PageHeader, a as $$Base } from './_...slug_.astro.9e731356.mjs';
3
3
  import api from '@cloudcommerce/api';
4
4
  import { computed, useSSRContext, defineComponent, mergeProps, withCtx, createVNode, withDirectives, vShow, resolveDynamicComponent, createTextVNode, toDisplayString, openBlock, createBlock, Fragment, renderList, renderSlot, createCommentVNode, ref, shallowReactive, resolveComponent, withAsyncContext } from 'vue';
5
5
  import { ssrRenderAttrs, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrRenderAttr, ssrRenderSlot, ssrRenderVNode, ssrInterpolate } from 'vue/server-renderer';
@@ -409,6 +409,20 @@ const useProductCard = (props) => {
409
409
  ...props.product,
410
410
  price: price(props.product || {})
411
411
  });
412
+ const { productId } = props;
413
+ if (!props.product && productId) {
414
+ isFetching.value = true;
415
+ fetching = (async () => {
416
+ try {
417
+ const { data } = await api.get(`products/${productId}`);
418
+ Object.assign(product, data);
419
+ } catch (err) {
420
+ console.error(err);
421
+ fetchError.value = err;
422
+ }
423
+ isFetching.value = false;
424
+ })();
425
+ }
412
426
  const title = computed(() => {
413
427
  return name(product);
414
428
  });
@@ -451,20 +465,6 @@ const useProductCard = (props) => {
451
465
  }
452
466
  return 0;
453
467
  });
454
- const { productId } = props;
455
- if (!props.product && productId) {
456
- isFetching.value = true;
457
- fetching = (async () => {
458
- try {
459
- const { data } = await api.get(`products/${productId}`);
460
- Object.assign(product, data);
461
- } catch (err) {
462
- console.error(err);
463
- fetchError.value = err;
464
- }
465
- isFetching.value = false;
466
- })();
467
- }
468
468
  return {
469
469
  isFetching,
470
470
  fetching,
@@ -515,12 +515,9 @@ const usePrices = (props) => {
515
515
  }
516
516
  return false;
517
517
  });
518
- const extraDiscount = computed(() => {
519
- return modulesInfo.apply_discount.available_extra_discount;
520
- });
521
518
  const salePrice = computed(() => {
522
519
  const price$1 = price(_product.value);
523
- const discount = extraDiscount.value;
520
+ const discount = availableExtraDiscount.value;
524
521
  if (discount && (!discount.min_amount || price$1 > discount.min_amount)) {
525
522
  return getPriceWithDiscount(price$1, discount);
526
523
  }
@@ -537,7 +534,7 @@ const usePrices = (props) => {
537
534
  return 0;
538
535
  });
539
536
  const installmentsObject = computed(() => {
540
- return props.installmentsOption || modulesInfo.list_payments.installments_option || { max_number: 1 };
537
+ return props.installmentsOption || installmentsOption.value || { max_number: 1 };
541
538
  });
542
539
  const installmentsNumber = computed(() => {
543
540
  if (installmentsObject.value.max_number <= 1) {
@@ -561,7 +558,7 @@ const usePrices = (props) => {
561
558
  return 0;
562
559
  });
563
560
  const discountObject = computed(() => {
564
- const discount = props.discountOption || modulesInfo.list_payments.discount_option;
561
+ const discount = props.discountOption || discountOption.value;
565
562
  if (discount && (!discount.min_amount || discount.min_amount <= salePrice.value) && (!props.isAmountTotal || discount.apply_at === "total")) {
566
563
  return discount;
567
564
  }
@@ -584,7 +581,7 @@ const usePrices = (props) => {
584
581
  if (props.loyaltyPointsProgram) {
585
582
  return props.loyaltyPointsProgram;
586
583
  }
587
- const pointsPrograms = modulesInfo.list_payments.loyalty_points_programs;
584
+ const pointsPrograms = loyaltyPointsPrograms.value;
588
585
  if (pointsPrograms) {
589
586
  const programIds = Object.keys(pointsPrograms);
590
587
  for (let i = 0; i < programIds.length; i++) {
@@ -853,11 +850,13 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
853
850
  _push2(`<!--[-->`);
854
851
  _push2(ssrRenderComponent(_component_AImg, {
855
852
  picture: $setup.images[0],
853
+ alt: $setup.title,
856
854
  class: "absolute top-0 left-0 block w-full h-full object-cover"
857
855
  }, null, _parent2, _scopeId));
858
856
  if ($setup.images[1] && $setup.wasHoveredOnce) {
859
857
  _push2(ssrRenderComponent(_component_AImg, {
860
858
  picture: $setup.images[1],
859
+ alt: $setup.title,
861
860
  class: "absolute top-0 left-0 block w-full h-full object-cover opacity-0 group-hover:opacity-100 transition-opacity motion-safe:duration-300 text-transparent z-10"
862
861
  }, null, _parent2, _scopeId));
863
862
  } else {
@@ -892,13 +891,15 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
892
891
  $setup.images?.length ? (openBlock(), createBlock(Fragment, { key: 0 }, [
893
892
  createVNode(_component_AImg, {
894
893
  picture: $setup.images[0],
894
+ alt: $setup.title,
895
895
  class: "absolute top-0 left-0 block w-full h-full object-cover"
896
- }, null, 8, ["picture"]),
896
+ }, null, 8, ["picture", "alt"]),
897
897
  $setup.images[1] && $setup.wasHoveredOnce ? (openBlock(), createBlock(_component_AImg, {
898
898
  key: 0,
899
899
  picture: $setup.images[1],
900
+ alt: $setup.title,
900
901
  class: "absolute top-0 left-0 block w-full h-full object-cover opacity-0 group-hover:opacity-100 transition-opacity motion-safe:duration-300 text-transparent z-10"
901
- }, null, 8, ["picture"])) : createCommentVNode("", true)
902
+ }, null, 8, ["picture", "alt"])) : createCommentVNode("", true)
902
903
  ], 64)) : (openBlock(), createBlock("div", {
903
904
  key: 1,
904
905
  class: "w-full h-full bg-gradient-to-br from-base-50/20 to-base-100"
@@ -1135,7 +1136,8 @@ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
1135
1136
  loadError = err;
1136
1137
  }
1137
1138
  return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>
1138
- ${routeContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, {}, { "default": ($$result2) => renderTemplate`
1139
+ ${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "default": ($$result2) => renderTemplate`
1140
+ ${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
1139
1141
  ${renderComponent($$result2, "HomeMain", $$Home, {})}
1140
1142
  ` })}`}
1141
1143
  ${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment$1, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
@@ -24,7 +24,7 @@ import 'string-width';
24
24
  import 'vue';
25
25
  import 'vue/server-renderer';
26
26
  import '@ecomplus/utils';
27
- import './chunks/pages/_...slug_.astro.f0a57b8d.mjs';
27
+ import './chunks/pages/_...slug_.astro.9e731356.mjs';
28
28
  import 'node:fs/promises';
29
29
  import 'node:path';
30
30
  import 'node:url';
@@ -2824,13 +2824,13 @@ const adapter = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2824
2824
  start
2825
2825
  }, Symbol.toStringTag, { value: 'Module' }));
2826
2826
 
2827
- const _page0 = () => import('./chunks/endpoint@_@js.ce919661.mjs');
2828
- const _page1 = () => import('./chunks/index@_@astro.8e359cb4.mjs');
2829
- const _page2 = () => import('./chunks/fallback@_@astro.6c7c4acd.mjs');
2830
- const _page3 = () => import('./chunks/index@_@astro.f7e2409d.mjs');
2831
- const _page4 = () => import('./chunks/account@_@astro.d58b2d34.mjs');
2832
- const _page5 = () => import('./chunks/_...06f412d0.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.8.0_sharp@0.32.1/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]]);
2833
- 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.8.0_sharp@0.32.1/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.9d9d7ac4.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.45bc69ca.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.9d9d7ac4.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.45bc69ca.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.9d9d7ac4.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.45bc69ca.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.f630663e.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.42f81a9a.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.8.0_sharp@0.32.1/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.ce919661.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.8e359cb4.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.6c7c4acd.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.f7e2409d.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.d58b2d34.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...06f412d0.mjs","@astrojs/vue/client.js":"_astro/client.2d950540.js","~/components/PitchBar.vue":"_astro/PitchBar.c53e6d0b.js","/astro/hoisted.js?q=0":"_astro/hoisted.9d9d7ac4.js","~/components/HeroSlider.vue":"_astro/HeroSlider.3d4a1d1c.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.a7b12eab.js","~/components/ProductShelf.vue":"_astro/ProductShelf.f013b3ee.js","~/components/Prices.vue":"_astro/Prices.de6df3cb.js","~/components/ShopHeader.vue":"_astro/ShopHeader.c0ba5061.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_.45bc69ca.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-5e0bf4e4.js","/_astro/Carousel.f39be3c0.js","/_astro/HeroSlider.3d4a1d1c.js","/_astro/PitchBar.c53e6d0b.js","/_astro/Prices.de6df3cb.js","/_astro/ProductShelf.f013b3ee.js","/_astro/ShopHeader.c0ba5061.js","/_astro/_plugin-vue_export-helper.d3aaeb0d.js","/_astro/api.7f62c1ff.js","/_astro/client.2d950540.js","/_astro/firebase-app.84207480.js","/_astro/format-money.3b884fcb.js","/_astro/hoisted.9d9d7ac4.js","/_astro/idle-callback.889bf0ea.js","/_astro/img.517fec8e.js","/_astro/index.33347cbd.js","/_astro/modules-info.ad27b027.js","/_astro/preload-helper.cf010ec4.js","/_astro/runtime-dom.esm-bundler.00b967e0.js","/_astro/session-utm.744b0db3.js","/_astro/workbox-window.prod.es5.a7b12eab.js","/assets/cms-preview.css","/assets/cms.css","/assets/cvv.png","/assets/img-placeholder.png","/assets/payments.png","/assets/ssl-safe.png","/img/icon.png","/img/large-icon.png","/img/uploads/banner1.png","/img/uploads/banner2.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/favicon.png","/img/uploads/headless.png","/img/uploads/headphone.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.png","/img/uploads/passion.webp","/img/uploads/pwa-reliable.png","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.png","/img/uploads/rect89.webp","/img/uploads/ssl-safe.png"]}), {
2827
+ const _page0 = () => import('./chunks/endpoint@_@js.e9171d18.mjs');
2828
+ const _page1 = () => import('./chunks/index@_@astro.de13f221.mjs');
2829
+ const _page2 = () => import('./chunks/fallback@_@astro.4a1f8c08.mjs');
2830
+ const _page3 = () => import('./chunks/index@_@astro.7472fe37.mjs');
2831
+ const _page4 = () => import('./chunks/account@_@astro.97e06bd2.mjs');
2832
+ const _page5 = () => import('./chunks/_...ed1d4ed7.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.8.0_sharp@0.32.1/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]]);
2833
+ 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.8.0_sharp@0.32.1/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.9d9d7ac4.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.b19aabfc.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.9d9d7ac4.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.b19aabfc.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.9d9d7ac4.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.b19aabfc.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.f630663e.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.3ebb4e85.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.8.0_sharp@0.32.1/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.e9171d18.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.de13f221.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.4a1f8c08.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.7472fe37.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.97e06bd2.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...ed1d4ed7.mjs","/astro/hoisted.js?q=0":"_astro/hoisted.9d9d7ac4.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.a7b12eab.js","~/components/HeroSlider.vue":"_astro/HeroSlider.359c76cc.js","~/components/PitchBar.vue":"_astro/PitchBar.75d2999f.js","~/components/ProductShelf.vue":"_astro/ProductShelf.83c66e3e.js","@astrojs/vue/client.js":"_astro/client.24201f93.js","~/components/Prices.vue":"_astro/Prices.bd0d3474.js","~/components/ShopHeader.vue":"_astro/ShopHeader.f66a56cb.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_.b19aabfc.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-5e0bf4e4.js","/_astro/Carousel.533b4b19.js","/_astro/HeroSlider.359c76cc.js","/_astro/PitchBar.75d2999f.js","/_astro/Prices.bd0d3474.js","/_astro/ProductShelf.83c66e3e.js","/_astro/ShopHeader.f66a56cb.js","/_astro/_plugin-vue_export-helper.4e6dc3af.js","/_astro/api.7f62c1ff.js","/_astro/client.24201f93.js","/_astro/firebase-app.84207480.js","/_astro/hoisted.9d9d7ac4.js","/_astro/img.22ad29ec.js","/_astro/index.ddc27a3a.js","/_astro/modules-info.d6bd555b.js","/_astro/preload-helper.cf010ec4.js","/_astro/runtime-dom.esm-bundler.578d6e91.js","/_astro/session-utm.744b0db3.js","/_astro/workbox-window.prod.es5.a7b12eab.js","/assets/cms-preview.css","/assets/cms.css","/assets/cvv.png","/assets/img-placeholder.png","/assets/payments.png","/assets/ssl-safe.png","/img/icon.png","/img/large-icon.png","/img/uploads/banner1.png","/img/uploads/banner2.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/favicon.png","/img/uploads/headless.png","/img/uploads/headphone.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.png","/img/uploads/passion.webp","/img/uploads/pwa-reliable.png","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.png","/img/uploads/rect89.webp","/img/uploads/ssl-safe.png"]}), {
2834
2834
  pageMap,
2835
2835
  renderers,
2836
2836
  });
@@ -2,7 +2,7 @@ import { h as server_default } from './chunks/astro.2df8d1c5.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.f0a57b8d.mjs';
5
+ import { _ as _export_sfc } from './chunks/pages/_...slug_.astro.9e731356.mjs';
6
6
  import 'path-to-regexp';
7
7
  import 'cookie';
8
8
  import '@astrojs/internal-helpers/path';
@@ -220,7 +220,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
220
220
  props: {
221
221
  picture: {},
222
222
  loading: { default: "lazy" },
223
- decoding: {}
223
+ decoding: {},
224
+ alt: {}
224
225
  },
225
226
  setup(__props, { expose: __expose }) {
226
227
  __expose();
@@ -236,7 +237,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
236
237
  });
237
238
  const attrs = computed(() => ({
238
239
  src: image.value.url,
239
- alt: image.value.alt,
240
+ alt: image.value.alt || props.alt,
240
241
  width: dimensions.value.width || void 0,
241
242
  height: dimensions.value.height || void 0,
242
243
  loading: props.loading,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.16.4",
4
+ "version": "0.18.0",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -11,6 +11,7 @@ export interface Props {
11
11
  placement?: 'start' | 'end' | 'top' | 'bottom';
12
12
  position?: 'fixed' | 'absolute';
13
13
  hasCloseButton?: boolean;
14
+ backdropTarget?: string;
14
15
  }
15
16
 
16
17
  const props = withDefaults(defineProps<Props>(), {
@@ -18,6 +19,7 @@ const props = withDefaults(defineProps<Props>(), {
18
19
  placement: 'start',
19
20
  position: 'fixed',
20
21
  hasCloseButton: true,
22
+ backdropTarget: '#teleported-top',
21
23
  });
22
24
  const emit = defineEmits([
23
25
  'update:modelValue',
@@ -75,7 +77,9 @@ const isPlacementX = computed(() => {
75
77
  class="w-screen shadow p-0 m-0 z-50"
76
78
  :class="[
77
79
  position,
78
- isFixed ? `top-0 left-0 ${(isPlacementX ? 'h-screen' : '')}` : null,
80
+ isFixed ? `top-0 ${(isPlacementX ? 'h-screen' : '')}` : null,
81
+ isFixed && placement !== 'end' ? 'left-0' : null,
82
+ isFixed && placement === 'end' ? 'left-auto right-0' : null,
79
83
  isPlacementX ? 'max-w-sm' : null,
80
84
  ]"
81
85
  :style="{
@@ -100,7 +104,7 @@ const isPlacementX = computed(() => {
100
104
  </button>
101
105
  <slot />
102
106
  </div>
103
- <Teleport to="#teleported-top">
107
+ <Teleport :to="backdropTarget">
104
108
  <Fade>
105
109
  <div
106
110
  v-if="modelValue"
@@ -22,6 +22,7 @@ export interface Props {
22
22
  };
23
23
  loading?: 'lazy' | 'eager';
24
24
  decoding?: 'async' | 'sync' | 'auto';
25
+ alt?: string;
25
26
  }
26
27
 
27
28
  const props = withDefaults(defineProps<Props>(), {
@@ -38,7 +39,7 @@ const dimensions = computed(() => {
38
39
  });
39
40
  const attrs = computed<ImgHTMLAttributes>(() => ({
40
41
  src: image.value.url,
41
- alt: image.value.alt,
42
+ alt: image.value.alt || props.alt,
42
43
  width: dimensions.value.width || undefined,
43
44
  height: dimensions.value.height || undefined,
44
45
  loading: props.loading,
@@ -1,7 +1,12 @@
1
1
  import type { Products, ListPaymentsResponse } from '@cloudcommerce/types';
2
2
  import { computed } from 'vue';
3
3
  import { price as getPrice, onPromotion as checkOnPromotion } from '@ecomplus/utils';
4
- import modulesInfo from '@@sf/state/modules-info';
4
+ import {
5
+ installmentsOption,
6
+ discountOption,
7
+ loyaltyPointsPrograms,
8
+ availableExtraDiscount,
9
+ } from '@@sf/state/modules-info';
5
10
 
6
11
  export interface Props {
7
12
  product?: Partial<Products> & { final_price?: number } &
@@ -54,12 +59,9 @@ const usePrices = (props: Props) => {
54
59
  }
55
60
  return false;
56
61
  });
57
- const extraDiscount = computed(() => {
58
- return modulesInfo.apply_discount.available_extra_discount;
59
- });
60
62
  const salePrice = computed(() => {
61
63
  const price = getPrice(_product.value);
62
- const discount = extraDiscount.value;
64
+ const discount = availableExtraDiscount.value;
63
65
  if (discount && (!discount.min_amount || price > discount.min_amount)) {
64
66
  return getPriceWithDiscount(price, discount);
65
67
  }
@@ -78,7 +80,7 @@ const usePrices = (props: Props) => {
78
80
 
79
81
  const installmentsObject = computed(() => {
80
82
  return props.installmentsOption
81
- || modulesInfo.list_payments.installments_option
83
+ || installmentsOption.value
82
84
  || { max_number: 1 };
83
85
  });
84
86
  const installmentsNumber = computed(() => {
@@ -105,7 +107,7 @@ const usePrices = (props: Props) => {
105
107
  });
106
108
 
107
109
  const discountObject = computed(() => {
108
- const discount = props.discountOption || modulesInfo.list_payments.discount_option;
110
+ const discount = props.discountOption || discountOption.value;
109
111
  if (
110
112
  discount
111
113
  && (!discount.min_amount || discount.min_amount <= salePrice.value)
@@ -133,7 +135,7 @@ const usePrices = (props: Props) => {
133
135
  if (props.loyaltyPointsProgram) {
134
136
  return props.loyaltyPointsProgram;
135
137
  }
136
- const pointsPrograms = modulesInfo.list_payments.loyalty_points_programs;
138
+ const pointsPrograms = loyaltyPointsPrograms.value;
137
139
  if (pointsPrograms) {
138
140
  const programIds = Object.keys(pointsPrograms);
139
141
  for (let i = 0; i < programIds.length; i++) {
@@ -28,6 +28,21 @@ const useProductCard = <T extends ProductItem | undefined = undefined>(props: Pr
28
28
  ...(props.product as Exclude<T, undefined>),
29
29
  price: getPrice(props.product || {}),
30
30
  });
31
+ const { productId } = props;
32
+ if (!props.product && productId) {
33
+ isFetching.value = true;
34
+ fetching = (async () => {
35
+ try {
36
+ const { data } = await api.get(`products/${productId}`);
37
+ Object.assign(product, data);
38
+ } catch (err: any) {
39
+ console.error(err);
40
+ fetchError.value = err;
41
+ }
42
+ isFetching.value = false;
43
+ })();
44
+ }
45
+
31
46
  const title = computed(() => {
32
47
  return getName(product);
33
48
  });
@@ -70,21 +85,6 @@ const useProductCard = <T extends ProductItem | undefined = undefined>(props: Pr
70
85
  return 0;
71
86
  });
72
87
 
73
- const { productId } = props;
74
- if (!props.product && productId) {
75
- isFetching.value = true;
76
- fetching = (async () => {
77
- try {
78
- const { data } = await api.get(`products/${productId}`);
79
- Object.assign(product, data);
80
- } catch (err: any) {
81
- console.error(err);
82
- fetchError.value = err;
83
- }
84
- isFetching.value = false;
85
- })();
86
- }
87
-
88
88
  return {
89
89
  isFetching,
90
90
  fetching,
@@ -11,11 +11,11 @@ const { settings } = Astro.locals.routeContext;
11
11
  ---
12
12
 
13
13
  <body>
14
- <div id="teleported-overlap" class="relative z-50"></div>
15
- <div id="teleported-top" class="relative z-10"></div>
14
+ <div id="teleported-overlap" class="relative z-[59]"></div>
15
+ <div id="teleported-top" class="relative z-[19]"></div>
16
16
  <slot />
17
17
  <slot name="before-body-end" />
18
- <div id="teleported-bottom" class="relative z-10"></div>
18
+ <div id="teleported-bottom" class="relative z-[19]"></div>
19
19
  {settings.icon &&
20
20
  <Picture
21
21
  src={settings.icon}
@@ -88,6 +88,11 @@ const usePageSections = async ({ routeContext }: Props) => {
88
88
  }
89
89
  }));
90
90
  }
91
+ /*
92
+ if (import.meta.env.DEV) {
93
+ console.log('> Sections loaded');
94
+ }
95
+ */
91
96
  return {
92
97
  sections,
93
98
  };
@@ -1,6 +1,7 @@
1
1
  import type { RouteContext } from '@@sf/ssr-context';
2
2
  import type { LayoutContent } from '@@sf/content';
3
3
  import type { Props as UseShopHeaderProps } from '@@sf/composables/use-shop-header';
4
+ import api from '@cloudcommerce/api';
4
5
  import { parseLayoutContent } from '@@sf/composables/use-pitch-bar';
5
6
 
6
7
  type ShopHeaderProps = Omit<UseShopHeaderProps, 'header'> & {
@@ -11,7 +12,7 @@ export interface Props {
11
12
  routeContext: RouteContext;
12
13
  }
13
14
 
14
- const usePageLayout = async ({ routeContext }: Props) => {
15
+ const usePageHeader = async ({ routeContext }: Props) => {
15
16
  const { apiState, getContent } = routeContext;
16
17
  const layoutContent = await getContent('layout');
17
18
  const {
@@ -19,21 +20,40 @@ const usePageLayout = async ({ routeContext }: Props) => {
19
20
  service_links: serviceLinks,
20
21
  } = layoutContent;
21
22
  const pitchBar = parseLayoutContent(layoutContent);
23
+ let { categories } = apiState;
24
+ if (!categories) {
25
+ try {
26
+ categories = (await api.get('categories')).data.result;
27
+ } catch (err) {
28
+ categories = [];
29
+ console.error(err);
30
+ }
31
+ }
22
32
  const shopHeader: ShopHeaderProps = {
23
- categories: apiState.categories || [],
33
+ categories,
24
34
  menuCategorySlugs: headerContent.inline_menu_categories?.featured,
25
35
  menuRandomCategories: headerContent.inline_menu_categories?.random,
26
36
  isAlphabeticalSortSubmenu: headerContent.alphabetical_sort_submenu,
27
37
  serviceLinks,
28
38
  };
39
+ /*
40
+ if (import.meta.env.DEV) {
41
+ await new Promise((resolve) => {
42
+ setTimeout(() => {
43
+ console.log('> This log must come after sections');
44
+ resolve(true);
45
+ }, 2000);
46
+ });
47
+ }
48
+ */
29
49
  return {
30
50
  pitchBar,
31
51
  shopHeader,
32
52
  };
33
53
  };
34
54
 
35
- export default usePageLayout;
55
+ export default usePageHeader;
36
56
 
37
- export { usePageLayout };
57
+ export { usePageHeader };
38
58
 
39
59
  export type { ShopHeaderProps };
@@ -30,7 +30,7 @@ if (!globalThis.$apiMergeConfig) {
30
30
  };
31
31
  }
32
32
  if (!globalThis.$apiPrefetchEndpoints) {
33
- globalThis.$apiPrefetchEndpoints = ['categories'];
33
+ globalThis.$apiPrefetchEndpoints = [];
34
34
  }
35
35
  if (!globalThis.$storefront) {
36
36
  globalThis.$storefront = {
@@ -146,6 +146,31 @@ if (!import.meta.env.SSR) {
146
146
 
147
147
  export default modulesInfo;
148
148
 
149
+ const freeShippingFromValue = computed(() => {
150
+ return modulesInfo.calculate_shipping.free_shipping_from_value;
151
+ });
152
+ const installmentsOption = computed(() => {
153
+ return modulesInfo.list_payments.installments_option;
154
+ });
155
+ const discountOption = computed(() => {
156
+ return modulesInfo.list_payments.discount_option;
157
+ });
158
+ const loyaltyPointsPrograms = computed(() => {
159
+ return modulesInfo.list_payments.loyalty_points_programs;
160
+ });
161
+ const availableExtraDiscount = computed(() => {
162
+ return modulesInfo.apply_discount.available_extra_discount;
163
+ });
164
+
165
+ export {
166
+ modulesInfo,
167
+ freeShippingFromValue,
168
+ installmentsOption,
169
+ discountOption,
170
+ loyaltyPointsPrograms,
171
+ availableExtraDiscount,
172
+ };
173
+
149
174
  const parsePhrase = <T extends keyof typeof modulesInfo>(
150
175
  phrase: string,
151
176
  modName: T,
@@ -45,6 +45,11 @@ const subtotal = computed(() => {
45
45
  return acc + (item.quantity * (item.final_price || item.price));
46
46
  }, 0);
47
47
  });
48
+ const totalItems = computed(() => {
49
+ return cartItems.value.reduce((acc, item) => {
50
+ return acc + item.quantity;
51
+ }, 0);
52
+ });
48
53
  const shoppingCart = computed({
49
54
  get() {
50
55
  return {
@@ -77,6 +82,7 @@ const addProductToCart = (
77
82
  export default shoppingCart;
78
83
 
79
84
  export {
85
+ totalItems,
80
86
  shoppingCart,
81
87
  addCartItem,
82
88
  parseProduct,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.16.4",
4
+ "version": "0.18.0",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
@@ -1 +0,0 @@
1
- Please refer to GitHub [repository releases](https://github.com/ecomplus/cloud-commerce/releases) or monorepo unified [CHANGELOG.md](https://github.com/ecomplus/cloud-commerce/blob/main/CHANGELOG.md).
@@ -1 +0,0 @@
1
- # `@cloudcommerce/app-infinitepay`