cloudcommerce 0.20.2 → 0.22.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.
- package/.gitmodules +3 -0
- package/.nvmrc +1 -0
- package/.vscode/settings.json +2 -1
- package/CHANGELOG.md +44 -0
- package/action.yml +37 -13
- package/ecomplus-stores/iluminim/.devcontainer/devcontainer.json +30 -0
- package/ecomplus-stores/iluminim/.eslintrc.cjs +3 -0
- package/ecomplus-stores/iluminim/.firebaserc +5 -0
- package/ecomplus-stores/iluminim/.github/renovate.json +5 -0
- package/ecomplus-stores/iluminim/.github/workflows/build-and-deploy.yml +36 -0
- package/ecomplus-stores/iluminim/.github/workflows/calibreapp-image-actions.yml +23 -0
- package/ecomplus-stores/iluminim/.gitpod.yml +12 -0
- package/ecomplus-stores/iluminim/.nvmrc +1 -0
- package/ecomplus-stores/iluminim/.vscode/extensions.json +8 -0
- package/ecomplus-stores/iluminim/.vscode/launch.json +11 -0
- package/ecomplus-stores/iluminim/.vscode/settings.json +10 -0
- package/ecomplus-stores/iluminim/README.md +113 -0
- package/ecomplus-stores/iluminim/README.pt-BR.md +113 -0
- package/ecomplus-stores/iluminim/functions/config.json +3 -0
- package/ecomplus-stores/iluminim/functions/example.env +10 -0
- package/ecomplus-stores/iluminim/functions/many/index.js +14 -0
- package/ecomplus-stores/iluminim/functions/many/package.json +22 -0
- package/ecomplus-stores/iluminim/functions/ssr/.eslintrc.cjs +6 -0
- package/ecomplus-stores/iluminim/functions/ssr/astro.config.mjs +4 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/blog/.gitkeep +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/.gitkeep +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +33 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/pages/home.json +70 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/settings.json +49 -0
- package/ecomplus-stores/iluminim/functions/ssr/index.js +18 -0
- package/ecomplus-stores/iluminim/functions/ssr/package.json +31 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/admin/.gitkeep +2 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/cms-preview.css +274 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/cms.css +114 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/cvv.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/img-placeholder.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/payments.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/ssl-safe.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/icon.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/large-icon.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner-chamada-desktop-9x81zmd91q.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner2.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/chamada-mobile-q1c6om6jx4.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/headphone.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/logo.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/og-image.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/passion.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect8589.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect859.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect89.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/robots.txt +8 -0
- package/ecomplus-stores/iluminim/functions/ssr/scripts/build.sh +14 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +65 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/AccountMenu.vue +104 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Banner.vue +59 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/BannersGrid.astro +25 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +35 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Countdown.vue +79 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/HeroSlider.vue +52 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/PitchBar.vue +57 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +96 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductCard.vue +118 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductShelf.vue +60 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductsCountdown.vue +20 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/SearchModal.vue +6 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +137 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderMenu.vue +58 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +88 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +61 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +78 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/env.d.ts +13 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Base.astro +16 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Checkout.astro +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +33 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Fallback.astro +10 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Home.astro +49 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Sections.astro +42 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Wildcard.astro +18 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/[...slug].astro +40 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/_vue.ts +3 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/account.astro +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/index.astro +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/fallback.astro +25 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +35 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/scripts/InlineScripts.astro +10 -0
- package/ecomplus-stores/iluminim/functions/ssr/tailwind.config.cjs +13 -0
- package/ecomplus-stores/iluminim/functions/ssr/tsconfig.json +12 -0
- package/ecomplus-stores/iluminim/functions/ssr/uno.config.cjs +5 -0
- package/ecomplus-stores/iluminim/functions/with-apps/index.js +12 -0
- package/ecomplus-stores/iluminim/functions/with-apps/package.json +22 -0
- package/ecomplus-stores/iluminim/package.json +28 -0
- package/ecomplus-stores/iluminim/scripts/install.sh +14 -0
- package/ecomplus-stores/monocard/.eslintrc.cjs +3 -0
- package/ecomplus-stores/monocard/.nvmrc +1 -0
- package/ecomplus-stores/tia-sonia/.eslintrc.cjs +3 -0
- package/ecomplus-stores/tia-sonia/.nvmrc +1 -0
- package/package.json +4 -4
- package/packages/api/package.json +1 -1
- package/packages/api/types.d.ts +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/config/firebase.json +10 -0
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/lib/en_us/i19hour.txt +1 -0
- package/packages/i18n/lib/en_us/i19hours.txt +1 -0
- package/packages/i18n/lib/en_us/i19milliseconds.txt +1 -0
- package/packages/i18n/lib/en_us/i19minute.txt +1 -0
- package/packages/i18n/lib/en_us/i19minutes.txt +1 -0
- package/packages/i18n/lib/en_us/i19second.txt +1 -0
- package/packages/i18n/lib/en_us/i19seconds.txt +1 -0
- package/packages/i18n/lib/en_us.d.ts +7 -0
- package/packages/i18n/lib/en_us.js +7 -0
- package/packages/i18n/lib/en_us.js.map +1 -1
- package/packages/i18n/lib/pt_br/i19home.txt +1 -1
- package/packages/i18n/lib/pt_br/i19hour.txt +1 -0
- package/packages/i18n/lib/pt_br/i19hours.txt +1 -0
- package/packages/i18n/lib/pt_br/i19milliseconds.txt +1 -0
- package/packages/i18n/lib/pt_br/i19minute.txt +1 -0
- package/packages/i18n/lib/pt_br/i19minutes.txt +1 -0
- package/packages/i18n/lib/pt_br/i19second.txt +1 -0
- package/packages/i18n/lib/pt_br/i19seconds.txt +1 -0
- package/packages/i18n/lib/pt_br.d.ts +8 -1
- package/packages/i18n/lib/pt_br.js +8 -1
- package/packages/i18n/lib/pt_br.js.map +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/i18n/src/en_us.ts +7 -0
- package/packages/i18n/src/pt_br.ts +8 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/lib/firebase/serve-storefront.js +24 -18
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +2 -2
- package/packages/ssr/src/firebase/serve-storefront.ts +25 -18
- package/packages/storefront/.eslintrc.cjs +8 -1
- package/packages/storefront/client.d.ts +1 -19
- package/packages/storefront/dist/client/_astro/HeroSlider.0890631f.js +1 -0
- package/packages/storefront/dist/client/_astro/{ShopHeader.0c884bbe.js → ShopHeader.82ae97a5.js} +1 -1
- package/packages/storefront/dist/client/_astro/_...slug_.c85b8978.css +1 -0
- package/packages/storefront/dist/client/_astro/{client.8035a95a.js → client.0fb6b44e.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.9d9d7ac4.js → hoisted.572313d6.js} +1 -1
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/_...7e1df40a.mjs +34 -0
- package/packages/storefront/dist/server/chunks/{account@_@astro.89e4cf60.mjs → account@_@astro.5f1dba7a.mjs} +7 -8
- package/packages/storefront/dist/server/chunks/{astro.45d3047f.mjs → astro.2d3ebf0f.mjs} +560 -511
- package/packages/storefront/dist/server/chunks/{endpoint@_@js.f880a152.mjs → endpoint@_@js.80de0568.mjs} +7 -8
- package/packages/storefront/dist/server/chunks/{fallback@_@astro.89538855.mjs → fallback@_@astro.02a45b47.mjs} +7 -8
- package/packages/storefront/dist/server/chunks/{index@_@astro.56fdd6da.mjs → index@_@astro.23b50301.mjs} +7 -8
- package/packages/storefront/dist/server/chunks/{index@_@astro.548cf7ad.mjs → index@_@astro.7cb07e52.mjs} +7 -8
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.bde9380b.mjs → _...slug_.astro.4358f614.mjs} +92 -104
- package/packages/storefront/dist/server/chunks/pages/{account.astro.f07cf19e.mjs → account.astro.afae5a12.mjs} +6 -6
- package/packages/storefront/dist/server/chunks/pages/{endpoint.js.d4e37801.mjs → endpoint.js.60fd21aa.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{fallback.astro.e2e8a0e4.mjs → fallback.astro.e5566925.mjs} +10 -10
- package/packages/storefront/dist/server/chunks/pages/{index.astro.3760ebe3.mjs → index.astro.5bc6b9d8.mjs} +34 -32
- package/packages/storefront/dist/server/entry.mjs +13 -12
- package/packages/storefront/dist/server/renderers.mjs +7 -8
- package/packages/storefront/package.json +2 -2
- package/packages/storefront/server.d.ts +3 -27
- package/packages/storefront/src/lib/$storefront.d.ts +28 -0
- package/packages/storefront/src/lib/assets/base.css +2 -0
- package/packages/storefront/src/lib/layouts/Base.astro +1 -9
- package/packages/storefront/src/lib/layouts/BaseHead.astro +73 -2
- package/packages/storefront/src/lib/layouts/use-page-main.ts +18 -5
- package/packages/storefront/src/lib/pages/_vue.ts +1 -1
- package/packages/storefront/src/lib/server-data.ts +1 -1
- package/packages/storefront/src/lib/ssr-context.ts +46 -36
- package/packages/storefront/src/vue-globals.d.ts +3 -3
- package/packages/types/package.json +1 -1
- package/pnpm-workspace.yaml +2 -2
- package/packages/storefront/dist/client/_astro/HeroSlider.eb156f18.js +0 -1
- package/packages/storefront/dist/client/_astro/_...slug_.c2da43fb.css +0 -1
- package/packages/storefront/dist/server/chunks/_...9e22b578.mjs +0 -35
- package/packages/storefront/src/lib/composables/use-hero-slider.ts +0 -26
- package/packages/storefront/src/lib/layouts/BaseStateJson.astro +0 -68
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createAstro, a as createComponent, r as renderTemplate,
|
|
2
|
-
import {
|
|
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.2d3ebf0f.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.4358f614.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';
|
|
@@ -112,7 +112,7 @@ const usePageHero = async ({ routeContext }) => {
|
|
|
112
112
|
}
|
|
113
113
|
return { heroSlider };
|
|
114
114
|
};
|
|
115
|
-
const usePageSections = async ({ routeContext }) => {
|
|
115
|
+
const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
116
116
|
const sectionsContent = routeContext.cmsContent?.sections;
|
|
117
117
|
const sections = [];
|
|
118
118
|
if (sectionsContent) {
|
|
@@ -188,6 +188,14 @@ const usePageSections = async ({ routeContext }) => {
|
|
|
188
188
|
banners: parseBanners(sectionContent.banners || [])
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (typeof handleCustomSection === "function") {
|
|
194
|
+
const { props } = await handleCustomSection(
|
|
195
|
+
type,
|
|
196
|
+
sectionContent
|
|
197
|
+
);
|
|
198
|
+
sections[index] = { type, props };
|
|
191
199
|
}
|
|
192
200
|
}));
|
|
193
201
|
}
|
|
@@ -228,7 +236,7 @@ const $$BannerPictures = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
228
236
|
}
|
|
229
237
|
return renderTemplate`${img && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": img, "alt": alt || "", "widths": widths, "fetchpriority": index === 0 ? "high" : "low", "loading": index === 0 ? "eager" : "lazy", "class": `${mobileImg ? "hidden md:block " : ""}mx-auto ${className}` })}`}
|
|
230
238
|
${mobileImg && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": mobileImg, "alt": alt || "", "widths": mobileWidths, "fetchpriority": index === 0 ? "high" : "low", "loading": index === 0 ? "eager" : "lazy", "class": `md:hidden mx-auto ${mobileClass}` })}`}`;
|
|
231
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/BannerPictures.astro");
|
|
239
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/BannerPictures.astro", void 0);
|
|
232
240
|
|
|
233
241
|
const useBanner = (props) => {
|
|
234
242
|
const parsedTitle = computed(() => {
|
|
@@ -251,20 +259,6 @@ const useBanner = (props) => {
|
|
|
251
259
|
};
|
|
252
260
|
};
|
|
253
261
|
|
|
254
|
-
const useHeroSlider = (props) => {
|
|
255
|
-
const parsedSlides = computed(() => {
|
|
256
|
-
return props.slides.map((slide) => {
|
|
257
|
-
return {
|
|
258
|
-
...slide,
|
|
259
|
-
...useBanner(slide)
|
|
260
|
-
};
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
return {
|
|
264
|
-
parsedSlides
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
|
|
268
262
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
269
263
|
__name: "Banner",
|
|
270
264
|
props: {
|
|
@@ -375,9 +369,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
375
369
|
},
|
|
376
370
|
setup(__props, { expose: __expose }) {
|
|
377
371
|
__expose();
|
|
378
|
-
const
|
|
379
|
-
const { parsedSlides } = useHeroSlider(props);
|
|
380
|
-
const __returned__ = { props, parsedSlides, Carousel, CarouselControl, Banner };
|
|
372
|
+
const __returned__ = { Carousel, CarouselControl, Banner };
|
|
381
373
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
382
374
|
return __returned__;
|
|
383
375
|
}
|
|
@@ -390,7 +382,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
390
382
|
}, {
|
|
391
383
|
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
392
384
|
if (_push2) {
|
|
393
|
-
_push2(`<div style="${ssrRenderStyle($
|
|
385
|
+
_push2(`<div style="${ssrRenderStyle($props.slides.length > 1 ? null : { display: "none" })}" class="absolute z-10 bottom-5 flex justify-end items-center w-screen right-5 xl:right-auto xl:max-w-screen-xl xl:left-1/2 xl:-ms-[640px]"${_scopeId}><div class="relative w-20 h-10 rounded-full bg-white/50 text-primary shadow-sm ring-1 ring-black/5"${_scopeId}>`);
|
|
394
386
|
_push2(ssrRenderComponent($setup["CarouselControl"], {
|
|
395
387
|
class: "w-10 h-10 rounded-full hover:bg-primary/10",
|
|
396
388
|
"is-prev": ""
|
|
@@ -440,7 +432,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
440
432
|
})
|
|
441
433
|
])
|
|
442
434
|
], 512), [
|
|
443
|
-
[vShow, $
|
|
435
|
+
[vShow, $props.slides.length > 1]
|
|
444
436
|
])
|
|
445
437
|
];
|
|
446
438
|
}
|
|
@@ -448,7 +440,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
448
440
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
449
441
|
if (_push2) {
|
|
450
442
|
_push2(`<!--[-->`);
|
|
451
|
-
ssrRenderList($
|
|
443
|
+
ssrRenderList($props.slides, (slide, i) => {
|
|
452
444
|
_push2(`<li class="shrink-0 basis-full"${_scopeId}>`);
|
|
453
445
|
_push2(ssrRenderComponent($setup["Banner"], mergeProps({ ...slide, headingTag: i === 0 ? "h2" : "h3" }, { class: "w-screen max-w-screen-2xl" }), {
|
|
454
446
|
picture: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
@@ -467,7 +459,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
467
459
|
_push2(`<!--]-->`);
|
|
468
460
|
} else {
|
|
469
461
|
return [
|
|
470
|
-
(openBlock(true), createBlock(Fragment, null, renderList($
|
|
462
|
+
(openBlock(true), createBlock(Fragment, null, renderList($props.slides, (slide, i) => {
|
|
471
463
|
return openBlock(), createBlock("li", {
|
|
472
464
|
key: i,
|
|
473
465
|
class: "shrink-0 basis-full"
|
|
@@ -507,7 +499,7 @@ const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
507
499
|
</li>`)}
|
|
508
500
|
</ul>
|
|
509
501
|
</section>`;
|
|
510
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/BannersGrid.astro");
|
|
502
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/BannersGrid.astro", void 0);
|
|
511
503
|
|
|
512
504
|
const useProductCard = (props) => {
|
|
513
505
|
const isFetching = ref(false);
|
|
@@ -1215,7 +1207,14 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1215
1207
|
const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
|
|
1216
1208
|
Astro2.self = $$Sections;
|
|
1217
1209
|
const { routeContext } = Astro2.locals;
|
|
1218
|
-
const { sections } = await usePageSections({
|
|
1210
|
+
const { sections } = await usePageSections({
|
|
1211
|
+
routeContext,
|
|
1212
|
+
handleCustomSection: async (type, content) => {
|
|
1213
|
+
if (type === "c:foo")
|
|
1214
|
+
return { props: { ...content, foo: "bar" } };
|
|
1215
|
+
return { props: content };
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1219
1218
|
return renderTemplate`${maybeRenderHead()}<article class="my-9 md:my-12">
|
|
1220
1219
|
${sections.map(({ type, props }) => {
|
|
1221
1220
|
switch (type) {
|
|
@@ -1223,12 +1222,14 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1223
1222
|
return renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
|
|
1224
1223
|
case "banners-grid":
|
|
1225
1224
|
return renderTemplate`${renderComponent($$result, "BannersGrid", $$BannersGrid, { ...props })}`;
|
|
1225
|
+
case "c:foo":
|
|
1226
|
+
return renderTemplate`<div${addAttribute(props.foo, "data-foo")}></div>`;
|
|
1226
1227
|
default:
|
|
1227
1228
|
return renderTemplate`<div${addAttribute(type, "data-section")}></div>`;
|
|
1228
1229
|
}
|
|
1229
1230
|
})}
|
|
1230
1231
|
</article>`;
|
|
1231
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Sections.astro");
|
|
1232
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Sections.astro", void 0);
|
|
1232
1233
|
|
|
1233
1234
|
const $$Astro$2 = createAstro("https://ecom2-demo.web.app");
|
|
1234
1235
|
const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -1241,7 +1242,7 @@ const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1241
1242
|
${heroSlider.slides.length && renderTemplate`${renderComponent($$result, "HeroSlider", HeroSlider, { ...heroSlider, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/HeroSlider.vue", "client:component-export": "default" }, { "picture-0": ($$result2) => renderTemplate`${heroSlides[0] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-0", ...heroSlides[0], "index": 0 })}`}`, "picture-1": ($$result2) => renderTemplate`${heroSlides[1] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-1", ...heroSlides[1], "index": 1 })}`}`, "picture-2": ($$result2) => renderTemplate`${heroSlides[2] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-2", ...heroSlides[2], "index": 2 })}`}`, "picture-3": ($$result2) => renderTemplate`${heroSlides[3] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-3", ...heroSlides[3], "index": 3 })}`}`, "picture-4": ($$result2) => renderTemplate`${heroSlides[4] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-4", ...heroSlides[4], "index": 4 })}`}`, "picture-5": ($$result2) => renderTemplate`${heroSlides[5] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-5", ...heroSlides[5], "index": 5 })}`}`, "picture-6": ($$result2) => renderTemplate`${heroSlides[6] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-6", ...heroSlides[6], "index": 6 })}`}`, "picture-7": ($$result2) => renderTemplate`${heroSlides[7] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-7", ...heroSlides[7], "index": 7 })}`}`, "picture-8": ($$result2) => renderTemplate`${heroSlides[8] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-8", ...heroSlides[8], "index": 8 })}`}`, "picture-9": ($$result2) => renderTemplate`${heroSlides[9] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-9", ...heroSlides[9], "index": 9 })}`}` })}`}
|
|
1242
1243
|
${renderComponent($$result, "Sections", $$Sections, {})}
|
|
1243
1244
|
</main>`;
|
|
1244
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Home.astro");
|
|
1245
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Home.astro", void 0);
|
|
1245
1246
|
|
|
1246
1247
|
const $$Astro$1 = createAstro("https://ecom2-demo.web.app");
|
|
1247
1248
|
const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -1258,13 +1259,14 @@ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1258
1259
|
loadError = err;
|
|
1259
1260
|
}
|
|
1260
1261
|
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>
|
|
1261
|
-
${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "default": ($$result2) => renderTemplate`
|
|
1262
|
+
${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`
|
|
1263
|
+
|
|
1262
1264
|
${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
|
|
1263
1265
|
${renderComponent($$result2, "HomeMain", $$Home, {})}
|
|
1264
1266
|
` })}`}
|
|
1265
1267
|
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment$1, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
1266
1268
|
</html>`;
|
|
1267
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro");
|
|
1269
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", void 0);
|
|
1268
1270
|
|
|
1269
1271
|
const $$file$1 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro";
|
|
1270
1272
|
const $$url$1 = "";
|
|
@@ -1281,7 +1283,7 @@ const $$Index = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1281
1283
|
const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
|
|
1282
1284
|
Astro2.self = $$Index;
|
|
1283
1285
|
return renderTemplate``;
|
|
1284
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro");
|
|
1286
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", void 0);
|
|
1285
1287
|
|
|
1286
1288
|
const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro";
|
|
1287
1289
|
const $$url = "/app";
|
|
@@ -3,7 +3,7 @@ import { webcrypto } from 'node:crypto';
|
|
|
3
3
|
import { ByteLengthQueuingStrategy, CountQueuingStrategy, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, TransformStream, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter } from 'node:stream/web';
|
|
4
4
|
import { File, FormData, Headers, Request, Response, fetch } from 'undici';
|
|
5
5
|
import { setTimeout as setTimeout$1, clearTimeout as clearTimeout$1 } from 'node:timers';
|
|
6
|
-
import { N as NodeApp, g as deserializeManifest } from './chunks/astro.
|
|
6
|
+
import { N as NodeApp, g as deserializeManifest } from './chunks/astro.2d3ebf0f.mjs';
|
|
7
7
|
import { Readable } from 'stream';
|
|
8
8
|
import https from 'https';
|
|
9
9
|
import path from 'path';
|
|
@@ -18,13 +18,15 @@ import 'cookie';
|
|
|
18
18
|
import 'kleur/colors';
|
|
19
19
|
import '@astrojs/internal-helpers/path';
|
|
20
20
|
import 'path-to-regexp';
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
21
|
+
import 'node:fs';
|
|
22
|
+
import 'node:http';
|
|
23
|
+
import 'node:tls';
|
|
23
24
|
import 'string-width';
|
|
25
|
+
import 'html-escaper';
|
|
24
26
|
import 'vue';
|
|
25
27
|
import 'vue/server-renderer';
|
|
26
28
|
import '@ecomplus/utils';
|
|
27
|
-
import './chunks/pages/_...slug_.astro.
|
|
29
|
+
import './chunks/pages/_...slug_.astro.4358f614.mjs';
|
|
28
30
|
import 'node:fs/promises';
|
|
29
31
|
import 'node:path';
|
|
30
32
|
import 'node:url';
|
|
@@ -35,7 +37,6 @@ import 'magic-string';
|
|
|
35
37
|
import 'node:stream';
|
|
36
38
|
import '@cloudcommerce/api';
|
|
37
39
|
import 'node:events';
|
|
38
|
-
import 'node:fs';
|
|
39
40
|
import '@cloudcommerce/config';
|
|
40
41
|
/* empty css */import '@vueuse/core';
|
|
41
42
|
import '@headlessui/vue';
|
|
@@ -2824,13 +2825,13 @@ const adapter = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
2824
2825
|
start
|
|
2825
2826
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
2826
2827
|
|
|
2827
|
-
const _page0 = () => import('./chunks/endpoint@_@js.
|
|
2828
|
-
const _page1 = () => import('./chunks/index@_@astro.
|
|
2829
|
-
const _page2 = () => import('./chunks/fallback@_@astro.
|
|
2830
|
-
const _page3 = () => import('./chunks/index@_@astro.
|
|
2831
|
-
const _page4 = () => import('./chunks/account@_@astro.
|
|
2832
|
-
const _page5 = () => import('./chunks/_...
|
|
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.
|
|
2828
|
+
const _page0 = () => import('./chunks/endpoint@_@js.80de0568.mjs');
|
|
2829
|
+
const _page1 = () => import('./chunks/index@_@astro.23b50301.mjs');
|
|
2830
|
+
const _page2 = () => import('./chunks/fallback@_@astro.02a45b47.mjs');
|
|
2831
|
+
const _page3 = () => import('./chunks/index@_@astro.7cb07e52.mjs');
|
|
2832
|
+
const _page4 = () => import('./chunks/account@_@astro.5f1dba7a.mjs');
|
|
2833
|
+
const _page5 = () => import('./chunks/_...7e1df40a.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.0_sharp@0.32.3/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.0_sharp@0.32.3/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_.c85b8978.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_.c85b8978.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_.c85b8978.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.afae5a12.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.e5566925.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.0_sharp@0.32.3/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.80de0568.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.23b50301.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.02a45b47.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.7cb07e52.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.5f1dba7a.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...7e1df40a.mjs","~/components/PitchBar.vue":"_astro/PitchBar.ed85833a.js","@astrojs/vue/client.js":"_astro/client.0fb6b44e.js","/astro/hoisted.js?q=0":"_astro/hoisted.572313d6.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.0890631f.js","~/components/ProductShelf.vue":"_astro/ProductShelf.9e290480.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_.c85b8978.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","/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/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"]}), {
|
|
2834
2835
|
pageMap,
|
|
2835
2836
|
renderers,
|
|
2836
2837
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { h as server_default } from './chunks/astro.
|
|
1
|
+
import { h as server_default } from './chunks/astro.2d3ebf0f.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.
|
|
5
|
+
import { _ as _export_sfc } from './chunks/pages/_...slug_.astro.4358f614.mjs';
|
|
6
6
|
import 'path-to-regexp';
|
|
7
7
|
import 'cookie';
|
|
8
8
|
import '@astrojs/internal-helpers/path';
|
|
9
9
|
import 'kleur/colors';
|
|
10
|
-
import 'fs';
|
|
11
|
-
import 'http';
|
|
12
|
-
import 'tls';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import 'node:http';
|
|
12
|
+
import 'node:tls';
|
|
13
13
|
import 'mime';
|
|
14
|
-
import 'html-escaper';
|
|
15
14
|
import 'string-width';
|
|
15
|
+
import 'html-escaper';
|
|
16
16
|
import 'node:fs/promises';
|
|
17
17
|
import 'node:path';
|
|
18
18
|
import 'node:url';
|
|
@@ -23,7 +23,6 @@ import 'magic-string';
|
|
|
23
23
|
import 'node:stream';
|
|
24
24
|
import '@cloudcommerce/api';
|
|
25
25
|
import 'node:events';
|
|
26
|
-
import 'node:fs';
|
|
27
26
|
import '@cloudcommerce/config';
|
|
28
27
|
/* empty css */import '@vueuse/core';
|
|
29
28
|
import '@headlessui/vue';
|
|
@@ -272,7 +271,7 @@ const createApp = (app) => {
|
|
|
272
271
|
app2.config.globalProperties.$money = formatMoney;
|
|
273
272
|
app2.config.globalProperties.$percentage = formatPercentage;
|
|
274
273
|
app2.config.globalProperties.$settings = globalThis.$storefront.settings;
|
|
275
|
-
app2.config.globalProperties.$
|
|
274
|
+
app2.config.globalProperties.$apiContext = globalThis.$storefront.apiContext;
|
|
276
275
|
}
|
|
277
276
|
});
|
|
278
277
|
app.component("Fade", Fade);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@iconify-json/logos": "^1.1.33",
|
|
44
44
|
"@vite-pwa/astro": "^0.1.1",
|
|
45
45
|
"@vueuse/core": "10.2.1",
|
|
46
|
-
"astro": "2.
|
|
46
|
+
"astro": "2.9.0",
|
|
47
47
|
"chroma-js": "^2.4.2",
|
|
48
48
|
"dotenv": "^16.3.1",
|
|
49
49
|
"firebase": "^9.23.0",
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
/* eslint-disable vars-on-top, no-var */
|
|
2
2
|
|
|
3
3
|
import type { ApiEndpoint } from '@cloudcommerce/api';
|
|
4
|
-
import type {
|
|
5
|
-
ProductSet,
|
|
6
|
-
CategorySet,
|
|
7
|
-
BrandSet,
|
|
8
|
-
CollectionSet,
|
|
9
|
-
} from '@cloudcommerce/api/types';
|
|
10
4
|
import type { RouteContext } from '@@sf/ssr-context';
|
|
11
|
-
import type {
|
|
5
|
+
import type { $Storefront } from '@@sf/$storefront';
|
|
12
6
|
|
|
13
7
|
declare global {
|
|
14
8
|
namespace App {
|
|
@@ -17,28 +11,10 @@ declare global {
|
|
|
17
11
|
}
|
|
18
12
|
}
|
|
19
13
|
|
|
20
|
-
var $storefront: {
|
|
21
|
-
settings: Partial<SettingsContent>,
|
|
22
|
-
context?: {
|
|
23
|
-
resource: 'products',
|
|
24
|
-
doc: ProductSet,
|
|
25
|
-
timestamp: number,
|
|
26
|
-
} | {
|
|
27
|
-
resource: 'categories',
|
|
28
|
-
doc: CategorySet,
|
|
29
|
-
timestamp: number,
|
|
30
|
-
} | {
|
|
31
|
-
resource: 'brands',
|
|
32
|
-
doc: BrandSet,
|
|
33
|
-
timestamp: number,
|
|
34
|
-
} | {
|
|
35
|
-
resource: 'collections',
|
|
36
|
-
doc: CollectionSet,
|
|
37
|
-
timestamp: number,
|
|
38
|
-
},
|
|
14
|
+
var $storefront: $Storefront & {
|
|
39
15
|
onLoad: (callback: (...args: any[]) => void) => void,
|
|
40
16
|
};
|
|
41
|
-
var $apiPrefetchEndpoints: ApiEndpoint
|
|
17
|
+
var $apiPrefetchEndpoints: Array<ApiEndpoint | ':slug'>;
|
|
42
18
|
var $storefrontSlimDocRegex: undefined | RegExp;
|
|
43
19
|
// @TODO
|
|
44
20
|
var $storefrontCmsHandler: undefined | any;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ProductSet,
|
|
3
|
+
CategorySet,
|
|
4
|
+
BrandSet,
|
|
5
|
+
CollectionSet,
|
|
6
|
+
} from '@cloudcommerce/api/types';
|
|
7
|
+
import type { SettingsContent } from '@@sf/content';
|
|
8
|
+
|
|
9
|
+
export type $Storefront = {
|
|
10
|
+
settings: Partial<SettingsContent>,
|
|
11
|
+
apiContext?: {
|
|
12
|
+
resource: 'products',
|
|
13
|
+
doc: ProductSet,
|
|
14
|
+
timestamp: number,
|
|
15
|
+
} | {
|
|
16
|
+
resource: 'categories',
|
|
17
|
+
doc: CategorySet,
|
|
18
|
+
timestamp: number,
|
|
19
|
+
} | {
|
|
20
|
+
resource: 'brands',
|
|
21
|
+
doc: BrandSet,
|
|
22
|
+
timestamp: number,
|
|
23
|
+
} | {
|
|
24
|
+
resource: 'collections',
|
|
25
|
+
doc: CollectionSet,
|
|
26
|
+
timestamp: number,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -75,6 +75,7 @@ html {
|
|
|
75
75
|
::marker {
|
|
76
76
|
color: var(--c-primary);
|
|
77
77
|
}
|
|
78
|
+
/*
|
|
78
79
|
:is(
|
|
79
80
|
::-webkit-calendar-picker-indicator,
|
|
80
81
|
::-webkit-clear-button,
|
|
@@ -83,6 +84,7 @@ html {
|
|
|
83
84
|
) {
|
|
84
85
|
color: var(--c-secondary);
|
|
85
86
|
}
|
|
87
|
+
*/
|
|
86
88
|
|
|
87
89
|
body {
|
|
88
90
|
background: var(--c-background);
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import BaseHead from '@@sf/layouts/BaseHead.astro';
|
|
3
|
-
import BaseStateJson from '@@sf/layouts/BaseStateJson.astro';
|
|
4
2
|
import BaseBody from '@@sf/layouts/BaseBody.astro';
|
|
5
3
|
|
|
6
|
-
export interface Props {
|
|
7
|
-
title?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { title } = Astro.props as Props;
|
|
11
4
|
const { getContent } = Astro.locals.routeContext;
|
|
12
5
|
const { custom_code: customCodeContent } = await getContent('layout');
|
|
13
6
|
---
|
|
14
7
|
|
|
15
8
|
<head>
|
|
16
|
-
<
|
|
17
|
-
<BaseStateJson />
|
|
9
|
+
<slot name="base-head" />
|
|
18
10
|
{customCodeContent?.css && <style>{customCodeContent.css}</style>}
|
|
19
11
|
{customCodeContent?.html_head && <Fragment set:html={customCodeContent.html_head} />}
|
|
20
12
|
<slot name="base-head-scripts">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { pwaInfo } from 'virtual:pwa-info';
|
|
3
|
-
import { img as getImg } from '@ecomplus/utils';
|
|
3
|
+
import { img as getImg, price as getPrice } from '@ecomplus/utils';
|
|
4
4
|
|
|
5
5
|
const deployRand = import.meta.env.DEPLOY_RAND || '_';
|
|
6
6
|
const getIconUrl = (size: number) => {
|
|
@@ -11,14 +11,23 @@ const getIconUrl = (size: number) => {
|
|
|
11
11
|
const {
|
|
12
12
|
storeId,
|
|
13
13
|
cmsContent,
|
|
14
|
-
|
|
14
|
+
fetchingApiContext,
|
|
15
|
+
apiContext,
|
|
15
16
|
lang,
|
|
17
|
+
countryCode,
|
|
18
|
+
currency,
|
|
19
|
+
currencySymbol,
|
|
16
20
|
domain,
|
|
17
21
|
primaryColor,
|
|
18
22
|
settings,
|
|
23
|
+
isPreview,
|
|
19
24
|
getContent,
|
|
20
25
|
} = Astro.locals.routeContext;
|
|
26
|
+
if (fetchingApiContext) {
|
|
27
|
+
await fetchingApiContext;
|
|
28
|
+
}
|
|
21
29
|
|
|
30
|
+
const apiDoc = apiContext.doc;
|
|
22
31
|
const state: Record<string, any> = apiDoc || cmsContent || {};
|
|
23
32
|
const title = state.meta_title || state.name || state.title || Astro.props.title || settings.name;
|
|
24
33
|
const description = state.meta_description || state.short_description || settings.description;
|
|
@@ -40,6 +49,65 @@ if (!ogImage) {
|
|
|
40
49
|
} else {
|
|
41
50
|
ogImage = ogImage.replace(/(\w+\.)?(ecoms\d)\.com/i, '$2-nyc3.nyc3.cdn.digitaloceanspaces.com');
|
|
42
51
|
}
|
|
52
|
+
|
|
53
|
+
let inlineClientJS = `
|
|
54
|
+
window.ECOM_STORE_ID = ${storeId};
|
|
55
|
+
window.ECOM_LANG = '${lang}';
|
|
56
|
+
window.ECOM_CURRENCY = '${currency}';
|
|
57
|
+
window.ECOM_CURRENCY_SYMBOL = '${currencySymbol}';
|
|
58
|
+
window.ECOM_COUNTRY_CODE = '${countryCode}';
|
|
59
|
+
window.$storefront = ${JSON.stringify({ settings })};`;
|
|
60
|
+
if (apiContext.error) {
|
|
61
|
+
const { message, statusCode } = apiContext.error;
|
|
62
|
+
const url = Astro.url.pathname;
|
|
63
|
+
inlineClientJS += `
|
|
64
|
+
console.error(${JSON.stringify(message)});
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
window.location.replace("/fallback?status=${statusCode}&url=${encodeURIComponent(url)}");
|
|
67
|
+
}, 1);`;
|
|
68
|
+
}
|
|
69
|
+
if (apiDoc) {
|
|
70
|
+
if (typeof apiDoc.price === 'number') {
|
|
71
|
+
apiDoc.price = getPrice(apiDoc);
|
|
72
|
+
}
|
|
73
|
+
const slimDocRegex = globalThis.$storefrontSlimDocRegex
|
|
74
|
+
|| /body_|meta_|metafields|_records|i18n/;
|
|
75
|
+
const minifyApiDoc = (nestedDoc: any) => {
|
|
76
|
+
if (typeof nestedDoc === 'object' && nestedDoc) {
|
|
77
|
+
if (Array.isArray(nestedDoc)) {
|
|
78
|
+
nestedDoc.forEach((item) => minifyApiDoc(item));
|
|
79
|
+
} else {
|
|
80
|
+
Object.keys(nestedDoc).forEach((field) => {
|
|
81
|
+
if (slimDocRegex.test(field)) {
|
|
82
|
+
delete nestedDoc[field];
|
|
83
|
+
} else {
|
|
84
|
+
minifyApiDoc(nestedDoc[field]);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return nestedDoc;
|
|
90
|
+
};
|
|
91
|
+
inlineClientJS += `
|
|
92
|
+
window.$storefront.apiContext = ${JSON.stringify({
|
|
93
|
+
resource: apiContext.resource,
|
|
94
|
+
doc: minifyApiDoc({ ...apiDoc }),
|
|
95
|
+
timestamp: Date.now(),
|
|
96
|
+
})};
|
|
97
|
+
window.$storefront.context /* DEPRECATED */ = window.$storefront.apiContext`;
|
|
98
|
+
}
|
|
99
|
+
if (isPreview) {
|
|
100
|
+
inlineClientJS += `
|
|
101
|
+
window.$isCmsPreview = true;`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const inlineJSONLd = JSON.stringify({
|
|
105
|
+
'@context': 'http://schema.org',
|
|
106
|
+
'@type': 'Organization',
|
|
107
|
+
name: settings.name,
|
|
108
|
+
url: `https://${domain}/`,
|
|
109
|
+
logo: `https://${domain}${settings.logo}`,
|
|
110
|
+
});
|
|
43
111
|
---
|
|
44
112
|
|
|
45
113
|
<meta charset="UTF-8">
|
|
@@ -76,3 +144,6 @@ if (!ogImage) {
|
|
|
76
144
|
{pwaInfo && <Fragment set:html={pwaInfo.webManifest.linkTag} />}
|
|
77
145
|
{(!pwaInfo && !import.meta.env.DEV) &&
|
|
78
146
|
<link rel="manifest" href="/manifest.webmanifest" />}
|
|
147
|
+
|
|
148
|
+
<script is:inline set:html={inlineClientJS} />
|
|
149
|
+
<script type="application/ld+json" set:html={inlineJSONLd} />
|
|
@@ -2,12 +2,13 @@ import type { ResourceId } from '@cloudcommerce/types';
|
|
|
2
2
|
import type { PageContent } from '@@sf/content';
|
|
3
3
|
import type { RouteContext } from '@@sf/ssr-context';
|
|
4
4
|
import type { Props as UseBannerProps } from '@@sf/composables/use-banner';
|
|
5
|
-
import type { Props as UseHeroSliderProps } from '@@sf/composables/use-hero-slider';
|
|
6
5
|
import type { Props as UseProductShelfProps } from '@@sf/composables/use-product-shelf';
|
|
7
6
|
import { useProductShelf } from '@@sf/composables/use-product-shelf';
|
|
8
7
|
|
|
9
8
|
export interface Props {
|
|
10
9
|
routeContext: RouteContext;
|
|
10
|
+
handleCustomSection?: (type: `${string}:${string}`, content: Record<string, any>) =>
|
|
11
|
+
Promise<{ props: Record<string, any> }>;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
const now = Date.now();
|
|
@@ -37,7 +38,8 @@ const parseBanners = (banners: Partial<PageContent['hero']['slides'][0]>[]) => {
|
|
|
37
38
|
|
|
38
39
|
export const usePageHero = async ({ routeContext }: Props) => {
|
|
39
40
|
const { cmsContent } = routeContext;
|
|
40
|
-
const heroSlider:
|
|
41
|
+
const heroSlider: Omit<Partial<PageContent['hero']>, 'slides'>
|
|
42
|
+
& { slides: UseBannerProps[] } = { slides: [] };
|
|
41
43
|
const heroContent = cmsContent?.hero;
|
|
42
44
|
if (heroContent) {
|
|
43
45
|
heroSlider.autoplay = heroContent.autoplay;
|
|
@@ -48,10 +50,14 @@ export const usePageHero = async ({ routeContext }: Props) => {
|
|
|
48
50
|
return { heroSlider };
|
|
49
51
|
};
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
type CustomSection = { type: `${string}:${string}`, props: any };
|
|
54
|
+
|
|
55
|
+
export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
56
|
+
({ routeContext, handleCustomSection }: Props) => {
|
|
52
57
|
const sectionsContent = routeContext.cmsContent?.sections;
|
|
53
58
|
const sections: Array<
|
|
54
|
-
|
|
59
|
+
T
|
|
60
|
+
| { type: 'product-shelf', props: UseProductShelfProps }
|
|
55
61
|
| { type: 'banners-grid', props: { banners: UseBannerProps[] } }
|
|
56
62
|
> = [];
|
|
57
63
|
if (sectionsContent) {
|
|
@@ -135,7 +141,14 @@ export const usePageSections = async ({ routeContext }: Props) => {
|
|
|
135
141
|
banners: parseBanners(sectionContent.banners || []),
|
|
136
142
|
},
|
|
137
143
|
};
|
|
138
|
-
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (typeof handleCustomSection === 'function') {
|
|
147
|
+
const { props } = await handleCustomSection(
|
|
148
|
+
type as `${string}:${string}`,
|
|
149
|
+
sectionContent,
|
|
150
|
+
);
|
|
151
|
+
sections[index] = { type, props } as T;
|
|
139
152
|
}
|
|
140
153
|
}));
|
|
141
154
|
}
|
|
@@ -20,7 +20,7 @@ const createApp = (app: App) => {
|
|
|
20
20
|
app.config.globalProperties.$money = formatMoney;
|
|
21
21
|
app.config.globalProperties.$percentage = formatPercentage;
|
|
22
22
|
app.config.globalProperties.$settings = globalThis.$storefront.settings;
|
|
23
|
-
app.config.globalProperties.$
|
|
23
|
+
app.config.globalProperties.$apiContext = globalThis.$storefront.apiContext;
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
app.component('Fade', Fade);
|