cloudcommerce 0.8.7 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/renovate.json +1 -2
- package/.vscode/extensions.json +3 -1
- package/.vscode/settings.json +5 -1
- package/CHANGELOG.md +54 -0
- package/ecomplus-stores/monocard/.devcontainer/devcontainer.json +1 -1
- package/ecomplus-stores/monocard/.gitpod.yml +3 -0
- package/ecomplus-stores/monocard/functions/core/package.json +1 -1
- package/ecomplus-stores/monocard/functions/events/package.json +2 -2
- package/ecomplus-stores/monocard/functions/modules/package.json +2 -2
- package/ecomplus-stores/monocard/functions/passport/package.json +2 -2
- package/ecomplus-stores/monocard/functions/ssr/content/layout.json +37 -0
- package/ecomplus-stores/monocard/functions/ssr/package.json +8 -8
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.astro +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +23 -10
- package/ecomplus-stores/monocard/functions/ssr/src/components/PitchBar.vue +2 -2
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +11 -10
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenavCategory.vue +2 -2
- package/ecomplus-stores/monocard/functions/ssr/src/layouts/Pages.astro +28 -14
- package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +3 -3
- package/ecomplus-stores/monocard/functions/ssr/src/main/Wildcard.astro +9 -7
- package/ecomplus-stores/monocard/functions/ssr/src/pages/[...slug].astro +2 -2
- package/ecomplus-stores/monocard/functions/ssr/src/pages/fallback.astro +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/pages/index.astro +2 -2
- package/ecomplus-stores/monocard/package.json +1 -1
- package/ecomplus-stores/monocard/scripts/install.sh +6 -1
- package/ecomplus-stores/tia-sonia/.devcontainer/devcontainer.json +3 -0
- package/ecomplus-stores/tia-sonia/.gitpod.yml +3 -0
- package/ecomplus-stores/tia-sonia/scripts/install.sh +6 -1
- package/package.json +13 -13
- package/packages/api/lib/api.d.ts +27 -11
- package/packages/api/package.json +1 -1
- package/packages/apps/correios/package.json +3 -3
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +4 -4
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/lib/functios-lib/abandoned-carts.js +2 -1
- package/packages/apps/emails/lib/functios-lib/abandoned-carts.js.map +1 -1
- package/packages/apps/emails/package.json +2 -2
- package/packages/apps/emails/src/functios-lib/abandoned-carts.ts +2 -1
- package/packages/apps/fb-conversions/package.json +3 -3
- package/packages/apps/frenet/lib/functions-lib/tracking-codes.js +2 -1
- package/packages/apps/frenet/lib/functions-lib/tracking-codes.js.map +1 -1
- package/packages/apps/frenet/package.json +4 -4
- package/packages/apps/frenet/src/functions-lib/tracking-codes.ts +2 -1
- package/packages/apps/galaxpay/lib/functions-lib/ecom/events-to-galaxpay.js +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/ecom/events-to-galaxpay.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/webhook.js +101 -37
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/webhook.js.map +1 -1
- package/packages/apps/galaxpay/package.json +4 -4
- package/packages/apps/galaxpay/src/functions-lib/ecom/events-to-galaxpay.ts +1 -1
- package/packages/apps/galaxpay/src/functions-lib/galaxpay/webhook.ts +123 -39
- package/packages/apps/google-analytics/package.json +4 -4
- package/packages/apps/infinitepay/package.json +4 -4
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/tracking-codes.js +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/tracking-codes.js.map +1 -1
- package/packages/apps/melhor-envio/package.json +4 -4
- package/packages/apps/melhor-envio/src/functions-lib/tracking-codes.ts +1 -1
- package/packages/apps/mercadopago/package.json +4 -4
- package/packages/apps/pagarme/package.json +4 -4
- package/packages/apps/paghiper/package.json +4 -4
- package/packages/apps/pix/package.json +4 -4
- package/packages/apps/tiny-erp/package.json +4 -4
- package/packages/apps/webhooks/package.json +4 -4
- package/packages/cli/lib/build.js +2 -0
- package/packages/cli/lib/cli.js +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/build.ts +2 -0
- package/packages/cli/src/cli.ts +2 -2
- package/packages/config/lib/config.js +13 -2
- package/packages/config/lib/config.js.map +1 -1
- package/packages/config/lib/defaults.d.ts +1 -0
- package/packages/config/lib/defaults.js +2 -0
- package/packages/config/lib/defaults.js.map +1 -1
- package/packages/config/package.json +1 -1
- package/packages/config/src/config.ts +13 -1
- package/packages/config/src/defaults.ts +2 -0
- package/packages/emails/package.json +2 -2
- package/packages/events/package.json +3 -3
- package/packages/firebase/package.json +4 -4
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +4 -4
- package/packages/passport/package.json +3 -3
- package/packages/ssr/package.json +8 -8
- package/packages/storefront/client.d.ts +1 -1
- package/packages/storefront/config/storefront.cms.cjs +17 -12
- package/packages/storefront/config/storefront.cms.mjs +17 -12
- package/packages/storefront/dist/client/_astro/Carousel.ef27cf12.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.276b893c.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.ff1445b5.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.70885f17.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.89b60037.js +4 -0
- package/packages/storefront/dist/client/_astro/_...slug_.9a31c59e.css +1 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.0c2b7f88.js +1 -0
- package/packages/storefront/dist/client/_astro/client.4e825332.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.d090c84e.js → firebase-app.2840bd36.js} +111 -111
- package/packages/storefront/dist/client/_astro/{format-money.ab6b71eb.js → format-money.f09b89ed.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.541b5c05.js → hoisted.56fa2eff.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.1eaf97c3.css +1 -0
- package/packages/storefront/dist/client/_astro/index.9018a8da.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.06ac0727.js → modules-info.2a72e536.js} +1 -1
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.1fd80976.js +1 -0
- package/packages/storefront/dist/client/_astro/session-utm.ac492493.js +1 -0
- package/packages/storefront/dist/client/img/uploads/ecom-icon.png +0 -0
- package/packages/storefront/dist/client/img/uploads/logo.png +0 -0
- package/packages/storefront/dist/client/manifest.webmanifest +1 -1
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/client/workbox-e0d788d4.js +1 -1
- package/packages/storefront/dist/server/chunks/{astro.9781c0a7.mjs → astro.39f7f387.mjs} +910 -295
- package/packages/storefront/dist/server/chunks/pages/{all.b355675e.mjs → all.2ca6d33d.mjs} +414 -258
- package/packages/storefront/dist/server/entry.mjs +32 -19
- package/packages/storefront/dist/server/manifest.webmanifest +1 -1
- package/packages/storefront/package.json +16 -16
- package/packages/storefront/server.d.ts +1 -1
- package/packages/storefront/src/images/use-ssr-picture.ts +30 -10
- package/packages/storefront/src/lib/assets/base.css +4 -2
- package/packages/storefront/src/lib/cms.d.ts +14 -18
- package/packages/storefront/src/lib/components/Carousel.vue +24 -23
- package/packages/storefront/src/lib/components/CarouselControl.vue +2 -2
- package/packages/storefront/src/lib/components/Drawer.vue +5 -5
- package/packages/storefront/src/lib/components/HeroPicture.astro +54 -0
- package/packages/storefront/src/lib/components/LoginForm.vue +3 -2
- package/packages/storefront/src/lib/components/SocialNetworkLink.vue +2 -2
- package/packages/storefront/src/lib/components/_injection-keys.ts +5 -3
- package/packages/storefront/src/lib/components/globals/AImg.vue +4 -5
- package/packages/storefront/src/lib/components/globals/ALink.vue +2 -2
- package/packages/storefront/src/lib/components/globals/Fade.vue +5 -5
- package/packages/storefront/src/lib/composables/use-hero-slider.ts +38 -0
- package/packages/storefront/src/lib/composables/use-prices.ts +6 -3
- package/packages/storefront/src/lib/composables/use-shop-header.ts +30 -14
- package/packages/storefront/src/lib/composables/use-sticky-header.ts +15 -12
- package/packages/storefront/src/lib/layouts/Base.astro +1 -1
- package/packages/storefront/src/lib/layouts/BaseBody.astro +2 -2
- package/packages/storefront/src/lib/layouts/BaseHead.astro +2 -2
- package/packages/storefront/src/lib/layouts/sections/use-hero-section.ts +48 -0
- package/packages/storefront/src/lib/layouts/use-home-main.ts +16 -0
- package/packages/storefront/src/lib/layouts/use-page-layout.ts +41 -0
- package/packages/storefront/src/lib/pages/_vue.ts +1 -1
- package/packages/storefront/src/lib/scripts/modules-info-preset.ts +5 -2
- package/packages/storefront/src/lib/scripts/session-utm.ts +6 -1
- package/packages/storefront/src/lib/ssr-context.ts +24 -15
- package/packages/storefront/src/lib/state/customer-session.ts +14 -2
- package/packages/storefront/src/lib/state/shopping-cart/add-cart-item.ts +8 -10
- package/packages/storefront/src/lib/state/shopping-cart.ts +4 -3
- package/packages/storefront/src/vue-globals.d.ts +3 -2
- package/packages/storefront/tailwind.config.cjs +10 -3
- package/packages/storefront/tsconfig.json +3 -1
- package/packages/storefront/uno.config.cjs +8 -4
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/monocard/functions/ssr/content/code.json +0 -5
- package/ecomplus-stores/monocard/functions/ssr/content/footer.json +0 -46
- package/ecomplus-stores/monocard/functions/ssr/content/header.json +0 -23
- package/ecomplus-stores/monocard/functions/ssr/content/menu.json +0 -6
- package/ecomplus-stores/monocard/functions/ssr/content/metatags.json +0 -5
- package/ecomplus-stores/monocard/functions/ssr/src/components/header/HeaderButtonLink.vue +0 -5
- package/ecomplus-stores/monocard/functions/ssr/src/components/header/HeaderButtons.vue +0 -39
- package/ecomplus-stores/monocard/functions/ssr/src/components/header/HeaderNav.vue +0 -61
- package/ecomplus-stores/monocard/functions/ssr/src/components/header/HeaderNavLink.vue +0 -5
- package/packages/storefront/dist/client/_astro/PitchBar.5d55c359.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.55399c72.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductCard.7e891c08.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.6bbe1a17.js +0 -4
- package/packages/storefront/dist/client/_astro/_...slug_.45f0edaf.css +0 -1
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.77ed7c18.js +0 -1
- package/packages/storefront/dist/client/_astro/client.0de2f274.js +0 -1
- package/packages/storefront/dist/client/_astro/index.ff4f0b30.js +0 -1
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.d2f39f33.js +0 -1
- package/packages/storefront/dist/client/_astro/session-utm.72684b84.js +0 -1
- package/packages/storefront/dist/client/img/uploads/icon.png +0 -0
- package/packages/storefront/dist/client/img/uploads/large-icon.png +0 -0
- package/packages/storefront/dist/client/img/uploads/logo.webp +0 -0
- package/packages/storefront/src/lib/components/ProductCard.vue +0 -36
- package/packages/storefront/src/lib/layouts/PagesHeader.astro +0 -51
- /package/packages/storefront/dist/client/_astro/{index.0c833781.css → index.e56fc6b3.css} +0 -0
- /package/packages/storefront/dist/client/_astro/{server.1bc2fa51.css → server.1dabec03.css} +0 -0
|
@@ -9,16 +9,16 @@ import 'node:os';
|
|
|
9
9
|
import sizeOf from 'image-size';
|
|
10
10
|
import 'magic-string';
|
|
11
11
|
import 'node:stream';
|
|
12
|
-
import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, d as renderComponent, u as unescapeHTML, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.
|
|
12
|
+
import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, d as renderComponent, u as unescapeHTML, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.39f7f387.mjs';
|
|
13
13
|
import api from '@cloudcommerce/api';
|
|
14
14
|
import { reactive, computed, defineComponent, inject, useSSRContext, mergeProps, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, resolveComponent, withModifiers, Teleport, createTextVNode, toDisplayString, setBlockTracking } from 'vue';
|
|
15
|
-
import { img, price, formatMoney, nickname, onPromotion } from '@ecomplus/utils';
|
|
16
15
|
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate } from 'vue/server-renderer';
|
|
16
|
+
import { img, price, formatMoney, nickname, onPromotion } from '@ecomplus/utils';
|
|
17
17
|
/* empty css */import { EventEmitter } from 'node:events';
|
|
18
18
|
import fs, { readFileSync } from 'node:fs';
|
|
19
19
|
import config from '@cloudcommerce/config';
|
|
20
20
|
/* empty css */import { useScroll, useElementHover, useDebounceFn, useTimeout, promiseTimeout } from '@vueuse/core';
|
|
21
|
-
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
21
|
+
/* empty css */import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
22
22
|
|
|
23
23
|
const _export_sfc = (sfc, props) => {
|
|
24
24
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -230,7 +230,7 @@ const get = async ({ request }) => {
|
|
|
230
230
|
"Content-Type": mime.getType(format) || "",
|
|
231
231
|
"Cache-Control": "public, max-age=31536000",
|
|
232
232
|
ETag: etag(data.toString()),
|
|
233
|
-
Date: new Date().toUTCString()
|
|
233
|
+
Date: (/* @__PURE__ */ new Date()).toUTCString()
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
} catch (err) {
|
|
@@ -255,23 +255,28 @@ const getCMS = () => {
|
|
|
255
255
|
process.env.STOREFRONT_BASE_DIR = baseDir;
|
|
256
256
|
const dirContent = resolve(baseDir, 'content');
|
|
257
257
|
|
|
258
|
+
const cmsCache = {};
|
|
258
259
|
const cms = (filename) => {
|
|
259
260
|
// MUST be sync for 'settings'
|
|
260
261
|
// Async with other content to support external CMS integration
|
|
261
262
|
const loadLocal = () => {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
263
|
+
let content = cmsCache[filename];
|
|
264
|
+
if (!content) {
|
|
265
|
+
if (filename.endsWith('/')) {
|
|
266
|
+
const dirColl = resolve(dirContent, filename);
|
|
267
|
+
return new Promise((resolve) => {
|
|
268
|
+
const slugs = fs.existsSync(dirColl)
|
|
269
|
+
? fs.readdirSync(dirColl).map((file) => file.replace('.json', ''))
|
|
270
|
+
: [];
|
|
271
|
+
resolve(slugs);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
const filepath = resolve(dirContent, `${filename}.json`);
|
|
275
|
+
content = fs.existsSync(filepath)
|
|
276
|
+
? JSON.parse(fs.readFileSync(filepath, 'utf8'))
|
|
277
|
+
: null;
|
|
278
|
+
cmsCache[filename] = content;
|
|
270
279
|
}
|
|
271
|
-
const filepath = resolve(dirContent, `${filename}.json`);
|
|
272
|
-
const content = fs.existsSync(filepath)
|
|
273
|
-
? JSON.parse(fs.readFileSync(filepath, 'utf8'))
|
|
274
|
-
: null;
|
|
275
280
|
return filename === 'settings'
|
|
276
281
|
? content
|
|
277
282
|
: new Promise((resolve) => { resolve(content); });
|
|
@@ -310,7 +315,7 @@ const getCMS = () => {
|
|
|
310
315
|
};
|
|
311
316
|
|
|
312
317
|
const _getConfig = () => {
|
|
313
|
-
const { VITE_ECOM_STORE_ID } = (Object.assign({"BASE_URL":"
|
|
318
|
+
const { VITE_ECOM_STORE_ID } = (Object.assign({"BASE_URL":"\"/\"","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"\"https://ecom2-002.web.app\"","ASSETS_PREFIX":undefined},{ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
|
|
314
319
|
if (VITE_ECOM_STORE_ID) {
|
|
315
320
|
config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
|
|
316
321
|
}
|
|
@@ -386,7 +391,6 @@ const loadPageContext = async (Astro, {
|
|
|
386
391
|
const startedAt = Date.now();
|
|
387
392
|
const urlPath = Astro.url.pathname;
|
|
388
393
|
const isHomepage = urlPath === "/";
|
|
389
|
-
const { slug } = Astro.params;
|
|
390
394
|
const config = getConfig();
|
|
391
395
|
globalThis.storefront.settings = config.settings;
|
|
392
396
|
let cmsContent;
|
|
@@ -402,11 +406,16 @@ const loadPageContext = async (Astro, {
|
|
|
402
406
|
// fetch by slug
|
|
403
407
|
...apiPrefetchEndpoints.map((endpoint) => api.get(endpoint, apiOptions))
|
|
404
408
|
];
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
409
|
+
if (isHomepage) {
|
|
410
|
+
cmsContent = await config.cms("home");
|
|
411
|
+
} else {
|
|
412
|
+
const { slug } = Astro.params;
|
|
413
|
+
if (slug) {
|
|
414
|
+
if (cmsCollection) {
|
|
415
|
+
cmsContent = await config.cms(`${cmsCollection}/${slug}`);
|
|
416
|
+
} else {
|
|
417
|
+
apiFetchings[0] = api.get(`slugs/${slug}`, apiOptions);
|
|
418
|
+
}
|
|
410
419
|
}
|
|
411
420
|
}
|
|
412
421
|
try {
|
|
@@ -414,10 +423,15 @@ const loadPageContext = async (Astro, {
|
|
|
414
423
|
if (slugResponse) {
|
|
415
424
|
apiResource = slugResponse.data.resource;
|
|
416
425
|
apiDoc = slugResponse.data.doc;
|
|
417
|
-
|
|
426
|
+
if (apiDoc) {
|
|
427
|
+
apiState[`${apiResource}/${apiDoc._id}`] = apiDoc;
|
|
428
|
+
}
|
|
418
429
|
}
|
|
419
|
-
prefetchResponses.forEach((
|
|
420
|
-
|
|
430
|
+
prefetchResponses.forEach((response) => {
|
|
431
|
+
if (response) {
|
|
432
|
+
const { config: { endpoint }, data } = response;
|
|
433
|
+
apiState[endpoint.replace(/\?.*$/, "")] = data.result || data;
|
|
434
|
+
}
|
|
421
435
|
});
|
|
422
436
|
} catch (err) {
|
|
423
437
|
const error = err;
|
|
@@ -463,7 +477,8 @@ const loadPageContext = async (Astro, {
|
|
|
463
477
|
cmsContent,
|
|
464
478
|
apiResource,
|
|
465
479
|
apiDoc,
|
|
466
|
-
apiState
|
|
480
|
+
apiState,
|
|
481
|
+
getContent: config.cms
|
|
467
482
|
};
|
|
468
483
|
emitter.emit("load", pageContext);
|
|
469
484
|
return pageContext;
|
|
@@ -495,11 +510,11 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
495
510
|
const favicon = settings.icon ? getIconUrl(32) : "/favicon.ico";
|
|
496
511
|
const shortcutIcon = settings.icon ? getIconUrl(192) : null;
|
|
497
512
|
const canonicalUrl = new URL(Astro2.url.pathname, Astro2.site || `https://${domain}`);
|
|
498
|
-
const cmsMetatags = await cms("
|
|
513
|
+
const { metatags: cmsMetatags } = await cms("layout");
|
|
499
514
|
const ogLocale = lang.length === 2 ? lang : lang.substring(0, 2) + lang.slice(3).toUpperCase();
|
|
500
515
|
let ogImage;
|
|
501
516
|
if (apiDoc) {
|
|
502
|
-
const picture = img(state,
|
|
517
|
+
const picture = img(state, void 0, "zoom");
|
|
503
518
|
ogImage = picture && picture.url;
|
|
504
519
|
}
|
|
505
520
|
if (!ogImage) {
|
|
@@ -701,7 +716,7 @@ async function getImage(transform) {
|
|
|
701
716
|
}
|
|
702
717
|
const resolved = await resolveTransform(transform);
|
|
703
718
|
const attributes = await loader.getImageAttributes(resolved);
|
|
704
|
-
const isDev = (_b = (Object.assign({"BASE_URL":"
|
|
719
|
+
const isDev = (_b = (Object.assign({"BASE_URL":"\"/\"","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"\"https://ecom2-002.web.app\"","ASSETS_PREFIX":undefined},{SSR:true,}))) == null ? void 0 : _b.DEV;
|
|
705
720
|
const isLocalImage = !isRemoteImage(resolved.src);
|
|
706
721
|
const _loader = isDev && isLocalImage ? globalThis.astroImage.defaultLoader : loader;
|
|
707
722
|
if (!_loader) {
|
|
@@ -786,6 +801,7 @@ async function getPicture(params) {
|
|
|
786
801
|
const sources = await Promise.all(allFormats.map((format) => getSource(format)));
|
|
787
802
|
return {
|
|
788
803
|
sources,
|
|
804
|
+
// @ts-expect-error image will always be defined
|
|
789
805
|
image
|
|
790
806
|
};
|
|
791
807
|
}
|
|
@@ -835,26 +851,42 @@ const useSSRPicture = async (params) => {
|
|
|
835
851
|
let sizes = propSizes || "";
|
|
836
852
|
if (!sizes && attrs.class) {
|
|
837
853
|
const classNames = attrs.class.split(" ");
|
|
838
|
-
const classRegex = /^(\w+:)?max-w-\[(\w+)\]$/;
|
|
839
854
|
let nextSize;
|
|
855
|
+
const breakpoints = {
|
|
856
|
+
sm: 640,
|
|
857
|
+
md: 768,
|
|
858
|
+
lg: 1024,
|
|
859
|
+
xl: 1280,
|
|
860
|
+
"2xl": 1536
|
|
861
|
+
};
|
|
840
862
|
[
|
|
841
863
|
[""],
|
|
842
|
-
|
|
843
|
-
["md", 768],
|
|
844
|
-
["lg", 1024],
|
|
845
|
-
["xl", 1280],
|
|
846
|
-
["2xl", 1536]
|
|
864
|
+
...Object.entries(breakpoints)
|
|
847
865
|
].forEach(([breakpoint, minWidth]) => {
|
|
848
|
-
const
|
|
849
|
-
|
|
866
|
+
const classRegex = breakpoint ? new RegExp(`^${breakpoint}:max-w-(\\[\\w+\\]|screen-\\w+)$`) : /^max-w-(\[\w+\]|screen-\w+)$/;
|
|
867
|
+
let classMaxW;
|
|
868
|
+
classNames.find((_class) => {
|
|
869
|
+
const maxW = _class.replace(classRegex, "$1");
|
|
870
|
+
if (maxW !== _class) {
|
|
871
|
+
classMaxW = maxW;
|
|
872
|
+
return true;
|
|
873
|
+
}
|
|
874
|
+
return false;
|
|
850
875
|
});
|
|
851
|
-
if (
|
|
876
|
+
if (classMaxW) {
|
|
852
877
|
if (nextSize) {
|
|
853
878
|
if (sizes)
|
|
854
879
|
sizes += ", ";
|
|
855
880
|
sizes += `(max-width: ${minWidth - 1}px) ${nextSize}`;
|
|
856
881
|
}
|
|
857
|
-
|
|
882
|
+
if (classMaxW.charAt(0) === "[") {
|
|
883
|
+
nextSize = classMaxW.slice(1, classMaxW.length - 1);
|
|
884
|
+
} else {
|
|
885
|
+
const screenSize = breakpoints[classMaxW.slice(7)];
|
|
886
|
+
if (screenSize) {
|
|
887
|
+
nextSize = `${screenSize}px`;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
858
890
|
}
|
|
859
891
|
});
|
|
860
892
|
if (nextSize) {
|
|
@@ -951,10 +983,10 @@ const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
951
983
|
const { settings } = Astro2.props.pageContext;
|
|
952
984
|
return renderTemplate`${maybeRenderHead($$result)}<body>
|
|
953
985
|
<div id="teleported-overlap" class="relative z-50"></div>
|
|
954
|
-
<div id="teleported-top" class="relative z-
|
|
986
|
+
<div id="teleported-top" class="relative z-10"></div>
|
|
955
987
|
${renderSlot($$result, $$slots["default"])}
|
|
956
988
|
${renderSlot($$result, $$slots["before-body-end"])}
|
|
957
|
-
<div id="teleported-bottom" class="relative z-
|
|
989
|
+
<div id="teleported-bottom" class="relative z-10"></div>
|
|
958
990
|
${settings.icon && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": settings.icon, "alt": "Icon", "formats": ["png"], "widths": [32, 192, 512], "sizes": "32px", "class": "hidden absolute", "style": "bottom: -1000px", "hasImg": false })}`}
|
|
959
991
|
</body>`;
|
|
960
992
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro");
|
|
@@ -965,7 +997,7 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
965
997
|
Astro2.self = $$Base$1;
|
|
966
998
|
const { pageContext, title } = Astro2.props;
|
|
967
999
|
const { cms } = pageContext;
|
|
968
|
-
const cmsCustomCode = await cms("
|
|
1000
|
+
const { custom_code: cmsCustomCode } = await cms("layout");
|
|
969
1001
|
return renderTemplate`<head>
|
|
970
1002
|
${renderComponent($$result, "BaseHead", $$BaseHead, { "pageContext": pageContext, "title": title })}
|
|
971
1003
|
${renderComponent($$result, "BaseStateJson", $$BaseStateJson, { "pageContext": pageContext })}
|
|
@@ -974,7 +1006,11 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
974
1006
|
${renderSlot($$result, $$slots["base-head-scripts"])}
|
|
975
1007
|
${renderSlot($$result, $$slots["before-head-end"])}
|
|
976
1008
|
${renderHead($$result)}</head>
|
|
977
|
-
${renderComponent($$result, "BaseBody", $$BaseBody, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate
|
|
1009
|
+
${renderComponent($$result, "BaseBody", $$BaseBody, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`
|
|
1010
|
+
${renderSlot($$result2, $$slots["default"])}
|
|
1011
|
+
${cmsCustomCode?.html_body && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(cmsCustomCode.html_body)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}
|
|
1012
|
+
${renderSlot($$result2, $$slots["before-body-end"])}
|
|
1013
|
+
` })}`;
|
|
978
1014
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro");
|
|
979
1015
|
|
|
980
1016
|
var __freeze = Object.freeze;
|
|
@@ -993,9 +1029,35 @@ const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
993
1029
|
const Astro2 = $$result.createAstro($$Astro$a, $$props, $$slots);
|
|
994
1030
|
Astro2.self = $$Base;
|
|
995
1031
|
const { pageContext, title } = Astro2.props;
|
|
996
|
-
return renderTemplate`${renderComponent($$result, "Base", $$Base$1, { "pageContext": pageContext, "title": title }, { "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate
|
|
1032
|
+
return renderTemplate`${renderComponent($$result, "Base", $$Base$1, { "pageContext": pageContext, "title": title }, { "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`
|
|
1033
|
+
|
|
1034
|
+
${renderSlot($$result2, $$slots["default"])}
|
|
1035
|
+
` })}`;
|
|
997
1036
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro");
|
|
998
1037
|
|
|
1038
|
+
const usePageLayout = async ({ pageContext }) => {
|
|
1039
|
+
const { apiState, cms } = pageContext;
|
|
1040
|
+
const {
|
|
1041
|
+
header: cmsHeader,
|
|
1042
|
+
service_links: cmsServiceLinks
|
|
1043
|
+
} = await cms("layout");
|
|
1044
|
+
const pitchBar = { slides: [] };
|
|
1045
|
+
if (cmsHeader?.pitch_bar) {
|
|
1046
|
+
pitchBar.slides = cmsHeader.pitch_bar;
|
|
1047
|
+
}
|
|
1048
|
+
const shopHeader = {
|
|
1049
|
+
categories: apiState.categories || [],
|
|
1050
|
+
menuCategorySlugs: cmsHeader.inline_menu_categories?.featured,
|
|
1051
|
+
menuRandomCategories: cmsHeader.inline_menu_categories?.random,
|
|
1052
|
+
isAlphabeticalSortSubmenu: cmsHeader.alphabetical_sort_submenu,
|
|
1053
|
+
serviceLinks: cmsServiceLinks
|
|
1054
|
+
};
|
|
1055
|
+
return {
|
|
1056
|
+
pitchBar,
|
|
1057
|
+
shopHeader
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
|
|
999
1061
|
const checkObjNotNull = (obj) => {
|
|
1000
1062
|
return Object.values(obj).filter((val) => val).length;
|
|
1001
1063
|
};
|
|
@@ -1030,8 +1092,11 @@ const getModulesInfoPreset = (settingsModules = globalThis.storefront.settings.m
|
|
|
1030
1092
|
}
|
|
1031
1093
|
}
|
|
1032
1094
|
const settingsShipping = settingsModules.calculate_shipping;
|
|
1033
|
-
|
|
1034
|
-
|
|
1095
|
+
const freeShippingFromValue = settingsShipping?.free_shipping_from_value;
|
|
1096
|
+
if (typeof freeShippingFromValue === "number") {
|
|
1097
|
+
modulesInfoPreset.calculate_shipping = {
|
|
1098
|
+
free_shipping_from_value: freeShippingFromValue
|
|
1099
|
+
};
|
|
1035
1100
|
}
|
|
1036
1101
|
}
|
|
1037
1102
|
return modulesInfoPreset;
|
|
@@ -1153,18 +1218,32 @@ const _sfc_main$e = defineComponent({
|
|
|
1153
1218
|
const wrapperVisibleWidth = ref(0);
|
|
1154
1219
|
const indexCount = ref(0);
|
|
1155
1220
|
const calcWrapperWidth = () => {
|
|
1221
|
+
if (!wrapper.value)
|
|
1222
|
+
return;
|
|
1156
1223
|
wrapperScrollWidth.value = wrapper.value.scrollWidth;
|
|
1157
1224
|
wrapperVisibleWidth.value = wrapper.value.offsetWidth;
|
|
1158
1225
|
};
|
|
1159
1226
|
const calcSlidesWidth = () => {
|
|
1160
|
-
|
|
1227
|
+
if (!wrapper.value)
|
|
1228
|
+
return;
|
|
1229
|
+
let childNodes = [...wrapper.value.children];
|
|
1230
|
+
if (childNodes.length === 1 && childNodes[0].tagName.endsWith("SLOT")) {
|
|
1231
|
+
childNodes = [...childNodes[0].children];
|
|
1232
|
+
}
|
|
1161
1233
|
slidesWidth.value = childNodes.map((node) => ({
|
|
1162
1234
|
offsetLeft: node.offsetLeft,
|
|
1163
1235
|
width: node.offsetWidth
|
|
1164
1236
|
}));
|
|
1165
1237
|
};
|
|
1166
1238
|
const calcNextWidth = (direction) => {
|
|
1167
|
-
|
|
1239
|
+
let nextSlideIndex = currentIndex.value + direction;
|
|
1240
|
+
if (nextSlideIndex >= slidesWidth.value.length) {
|
|
1241
|
+
nextSlideIndex = 0;
|
|
1242
|
+
direction = -direction;
|
|
1243
|
+
} else if (nextSlideIndex < 0) {
|
|
1244
|
+
nextSlideIndex = slidesWidth.value.length - 1;
|
|
1245
|
+
direction = -direction;
|
|
1246
|
+
}
|
|
1168
1247
|
const width = slidesWidth.value[nextSlideIndex]?.width || 0;
|
|
1169
1248
|
if (!width) {
|
|
1170
1249
|
return 0;
|
|
@@ -1183,7 +1262,7 @@ const _sfc_main$e = defineComponent({
|
|
|
1183
1262
|
const maxPos = wrapperScrollWidth.value - wrapperVisibleWidth.value;
|
|
1184
1263
|
indexCount.value = slidesWidth.value.findIndex(({ offsetLeft }) => offsetLeft >= maxPos - 5);
|
|
1185
1264
|
};
|
|
1186
|
-
let autoplayTimer
|
|
1265
|
+
let autoplayTimer;
|
|
1187
1266
|
const restartAutoplay = () => {
|
|
1188
1267
|
if (props.autoplay) {
|
|
1189
1268
|
clearTimeout(autoplayTimer);
|
|
@@ -1193,21 +1272,9 @@ const _sfc_main$e = defineComponent({
|
|
|
1193
1272
|
}
|
|
1194
1273
|
};
|
|
1195
1274
|
const changeSlide = (direction) => {
|
|
1196
|
-
if (direction < 0) {
|
|
1197
|
-
if (isBoundLeft.value) {
|
|
1198
|
-
calcIndexCount();
|
|
1199
|
-
currentIndex.value = indexCount.value - 1;
|
|
1200
|
-
changeSlide(1);
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
} else if (isBoundRight.value) {
|
|
1204
|
-
currentIndex.value = 1;
|
|
1205
|
-
changeSlide(-1);
|
|
1206
|
-
return;
|
|
1207
|
-
}
|
|
1208
1275
|
const nextSlideWidth = calcNextWidth(direction);
|
|
1209
1276
|
if (nextSlideWidth) {
|
|
1210
|
-
wrapper.value
|
|
1277
|
+
wrapper.value?.scrollBy({ left: nextSlideWidth, behavior: "smooth" });
|
|
1211
1278
|
restartAutoplay();
|
|
1212
1279
|
}
|
|
1213
1280
|
};
|
|
@@ -1238,6 +1305,8 @@ const _sfc_main$e = defineComponent({
|
|
|
1238
1305
|
calcIndexCount();
|
|
1239
1306
|
};
|
|
1240
1307
|
const onResize = useDebounceFn(() => {
|
|
1308
|
+
if (!wrapper.value)
|
|
1309
|
+
return;
|
|
1241
1310
|
wrapper.value.scrollLeft = 0;
|
|
1242
1311
|
calcOnInit();
|
|
1243
1312
|
}, 400);
|
|
@@ -1344,9 +1413,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1344
1413
|
}
|
|
1345
1414
|
});
|
|
1346
1415
|
function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1347
|
-
_push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-base-100 relative z-
|
|
1416
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-base-100 relative z-20" }, _attrs))}><div class="container md:w-2/3 mx-auto px-3 py-1">`);
|
|
1348
1417
|
_push(ssrRenderComponent($setup["Carousel"], {
|
|
1349
|
-
autoplay: $setup.countValidSlides > 1 ? 7e3 :
|
|
1418
|
+
autoplay: $setup.countValidSlides > 1 ? 7e3 : void 0
|
|
1350
1419
|
}, {
|
|
1351
1420
|
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1352
1421
|
if (_push2) {
|
|
@@ -1459,8 +1528,8 @@ const useStickyHeader = (props) => {
|
|
|
1459
1528
|
const isSticky = computed(() => ready.value && y.value > staticY.value * 1.2);
|
|
1460
1529
|
const transition = ref("none");
|
|
1461
1530
|
watch(isSticky, async (_isSticky) => {
|
|
1462
|
-
if (canSetStyles) {
|
|
1463
|
-
header.value.style.position = _isSticky ? "sticky" :
|
|
1531
|
+
if (canSetStyles && header.value) {
|
|
1532
|
+
header.value.style.position = _isSticky ? "sticky" : "";
|
|
1464
1533
|
}
|
|
1465
1534
|
if (!_isSticky) {
|
|
1466
1535
|
start();
|
|
@@ -1484,8 +1553,8 @@ const useStickyHeader = (props) => {
|
|
|
1484
1553
|
};
|
|
1485
1554
|
|
|
1486
1555
|
const filterMainCategories = (categories, featuredSlugs) => {
|
|
1487
|
-
const mainCategories = categories.filter(({ slug, parent }) => {
|
|
1488
|
-
return slug && !parent;
|
|
1556
|
+
const mainCategories = categories.filter(({ name, slug, parent }) => {
|
|
1557
|
+
return name && slug && !parent;
|
|
1489
1558
|
});
|
|
1490
1559
|
if (featuredSlugs?.length) {
|
|
1491
1560
|
mainCategories.sort((a, b) => {
|
|
@@ -1504,8 +1573,8 @@ const filterMainCategories = (categories, featuredSlugs) => {
|
|
|
1504
1573
|
return mainCategories;
|
|
1505
1574
|
};
|
|
1506
1575
|
const filterSubcategories = (categories, parentCategory, isAlphabeticalSort = false) => {
|
|
1507
|
-
const subcategories = categories.filter(({ slug, parent }) => {
|
|
1508
|
-
if (slug && parent) {
|
|
1576
|
+
const subcategories = categories.filter(({ name, slug, parent }) => {
|
|
1577
|
+
if (name && slug && parent) {
|
|
1509
1578
|
return parent._id === parentCategory._id || parent.slug && parent.slug === parentCategory.slug;
|
|
1510
1579
|
}
|
|
1511
1580
|
return false;
|
|
@@ -1532,7 +1601,7 @@ const useShopHeader = ({
|
|
|
1532
1601
|
staticY
|
|
1533
1602
|
} = useStickyHeader({ header });
|
|
1534
1603
|
const positionY = computed(() => {
|
|
1535
|
-
return isSticky.value ? header.value
|
|
1604
|
+
return isSticky.value ? header.value?.offsetHeight : staticY.value;
|
|
1536
1605
|
});
|
|
1537
1606
|
const mainCategories = filterMainCategories(categories, menuCategorySlugs);
|
|
1538
1607
|
const getSubcategories = (parentCategory) => {
|
|
@@ -1612,8 +1681,8 @@ const _sfc_main$c = defineComponent({
|
|
|
1612
1681
|
document.addEventListener("keydown", escClickListener, { passive: true });
|
|
1613
1682
|
}, 500);
|
|
1614
1683
|
} else {
|
|
1615
|
-
document.body.style.overflow =
|
|
1616
|
-
document.body.style.paddingRight =
|
|
1684
|
+
document.body.style.overflow = "";
|
|
1685
|
+
document.body.style.paddingRight = "";
|
|
1617
1686
|
document.removeEventListener("click", outsideClickListener);
|
|
1618
1687
|
document.removeEventListener("keydown", escClickListener);
|
|
1619
1688
|
}
|
|
@@ -1656,7 +1725,7 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1656
1725
|
$setup.isFixed ? `top-0 left-0 ${$setup.isPlacementX ? "h-screen" : ""}` : null,
|
|
1657
1726
|
$setup.isPlacementX ? "max-w-sm" : null
|
|
1658
1727
|
], "w-screen shadow p-0 m-0 z-50"])}" style="${ssrRenderStyle({
|
|
1659
|
-
maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` :
|
|
1728
|
+
maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
|
|
1660
1729
|
})}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
|
|
1661
1730
|
if ($props.hasCloseButton) {
|
|
1662
1731
|
_push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2"])}" data-drawer-close${_scopeId}>`);
|
|
@@ -1706,7 +1775,7 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1706
1775
|
$setup.isPlacementX ? "max-w-sm" : null
|
|
1707
1776
|
]],
|
|
1708
1777
|
style: {
|
|
1709
|
-
maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` :
|
|
1778
|
+
maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
|
|
1710
1779
|
},
|
|
1711
1780
|
open: $props.modelValue,
|
|
1712
1781
|
"data-drawer": $props.placement
|
|
@@ -1943,7 +2012,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1943
2012
|
expose();
|
|
1944
2013
|
const props = __props;
|
|
1945
2014
|
const fixedHref = computed(() => {
|
|
1946
|
-
let href = props.href || socialNetworks[props.network];
|
|
2015
|
+
let href = props.href || socialNetworks[props.network] || "";
|
|
1947
2016
|
if (props.network === "whatsapp") {
|
|
1948
2017
|
const tel = href.replace(/[^+\d]/g, "");
|
|
1949
2018
|
href = `https://${isMobile ? "api" : "web"}.whatsapp.com/send?phone=` + encodeURIComponent(tel.charAt(0) === "+" ? tel : `+55${tel}`);
|
|
@@ -3211,10 +3280,10 @@ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3211
3280
|
$setup.isSticky && !$setup.isSidenavOpen ? "bg-white/80" : "bg-white",
|
|
3212
3281
|
$setup.isSticky ? "backdrop-blur-md shadow py-2 md:py-3" : "py-3 sm:py-4 md:py-5"
|
|
3213
3282
|
]]
|
|
3214
|
-
}, _attrs))}><div class="container
|
|
3283
|
+
}, _attrs))}><div class="container 2xl:max-w-7xl mx-auto px-1 lg:pr-3 lg:pl-5 xl:pr-7 xl:pl-9 2xl:pr-0 2xl:pl-2 flex md:grid grid-flow-col grid-cols-3 lg:grid-cols-none lg:auto-cols-max justify-between items-center"><div class="basis-1/4 lg:hidden"><button class="px-2 my-1"${ssrRenderAttr("aria-label", "Abrir/fechar menu")}><i class="${ssrRenderClass([$setup.isSidenavOpen ? "i-close" : "i-menu", "text-base-500 text-3xl"])}"></i></button></div>`);
|
|
3215
3284
|
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
3216
3285
|
_push(ssrRenderComponent($setup["ShopHeaderMenu"], mergeProps({ class: "hidden lg:block" }, { inlineMenuTrees: $setup.inlineMenuTrees }), null, _parent));
|
|
3217
|
-
_push(`<div class="px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800"><button${ssrRenderAttr("aria-label", "Buscar produtos")}><i class="i-search w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"></i></button>`);
|
|
3286
|
+
_push(`<div class="basis-1/4 px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800"><button${ssrRenderAttr("aria-label", "Buscar produtos")}><i class="i-search w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"></i></button>`);
|
|
3218
3287
|
_push(ssrRenderComponent($setup["AccountMenu"], {
|
|
3219
3288
|
class: "hidden sm:block",
|
|
3220
3289
|
"aria-label": "Minha conta",
|
|
@@ -3281,51 +3350,254 @@ _sfc_main$2.setup = (props, ctx) => {
|
|
|
3281
3350
|
const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
|
|
3282
3351
|
|
|
3283
3352
|
const $$Astro$9 = createAstro("https://ecom2-002.web.app");
|
|
3284
|
-
const $$
|
|
3353
|
+
const $$Pages = createComponent(async ($$result, $$props, $$slots) => {
|
|
3285
3354
|
const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
|
|
3286
|
-
Astro2.self = $$
|
|
3287
|
-
const {
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3355
|
+
Astro2.self = $$Pages;
|
|
3356
|
+
const { pageContext, title } = Astro2.props;
|
|
3357
|
+
const { settings, isHomepage } = pageContext;
|
|
3358
|
+
const LogoHeading = isHomepage ? "h1" : "h2";
|
|
3359
|
+
const { pitchBar, shopHeader } = await usePageLayout({ pageContext });
|
|
3360
|
+
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "pageContext": pageContext, "title": title }, { "default": ($$result2) => renderTemplate`
|
|
3361
|
+
${renderSlot($$result2, $$slots["header"], renderTemplate`
|
|
3362
|
+
${renderSlot($$result2, $$slots["pitch-bar"], renderTemplate`
|
|
3363
|
+
${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result2, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`}
|
|
3364
|
+
${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result2, "PitchBar", PitchBar, { ...pitchBar })}`}
|
|
3365
|
+
`)}
|
|
3366
|
+
${renderComponent($$result2, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result3) => renderTemplate`${renderComponent($$result3, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result4) => renderTemplate`
|
|
3367
|
+
${maybeRenderHead($$result4)}<a href="/">
|
|
3368
|
+
${renderComponent($$result4, "LogoHeading", LogoHeading, {}, { "logo-picture": ($$result5) => renderTemplate`${renderComponent($$result5, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}` })}
|
|
3369
|
+
</a>
|
|
3370
|
+
` })}` })}
|
|
3371
|
+
`)}
|
|
3372
|
+
${renderSlot($$result2, $$slots["default"])}
|
|
3373
|
+
` })}`;
|
|
3374
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Pages.astro");
|
|
3375
|
+
|
|
3376
|
+
const useHeroSection = async ({ pageContext }) => {
|
|
3377
|
+
const { cmsContent } = pageContext;
|
|
3378
|
+
const heroSlider = { slides: [] };
|
|
3379
|
+
const cmsHero = cmsContent?.hero;
|
|
3380
|
+
if (cmsHero) {
|
|
3381
|
+
heroSlider.autoplay = cmsHero.autoplay;
|
|
3382
|
+
const now = Date.now();
|
|
3383
|
+
cmsHero.slides?.forEach(({
|
|
3384
|
+
img,
|
|
3385
|
+
start,
|
|
3386
|
+
end,
|
|
3387
|
+
mobile_img: mobileImg,
|
|
3388
|
+
button_link: buttonLink,
|
|
3389
|
+
button_text: buttonText,
|
|
3390
|
+
...rest
|
|
3391
|
+
}) => {
|
|
3392
|
+
if (!img)
|
|
3393
|
+
return;
|
|
3394
|
+
if (start && new Date(start).getTime() < now)
|
|
3395
|
+
return;
|
|
3396
|
+
if (end && new Date(end).getTime() > now)
|
|
3397
|
+
return;
|
|
3398
|
+
heroSlider.slides.push({
|
|
3399
|
+
...rest,
|
|
3400
|
+
img,
|
|
3401
|
+
mobileImg,
|
|
3402
|
+
buttonLink,
|
|
3403
|
+
buttonText
|
|
3404
|
+
});
|
|
3405
|
+
});
|
|
3298
3406
|
}
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
menuCategorySlugs: cmsHeader.inline_menu_categories?.featured,
|
|
3302
|
-
menuRandomCategories: cmsHeader.inline_menu_categories?.random,
|
|
3303
|
-
isAlphabeticalSortSubmenu: cmsHeader.alphabetical_sort_submenu,
|
|
3304
|
-
serviceLinks: cmsHeader.service_links
|
|
3407
|
+
return {
|
|
3408
|
+
heroSlider
|
|
3305
3409
|
};
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
${renderComponent($$result4, "LogoHeading", LogoHeading, {}, { "default": ($$result5) => renderTemplate`${renderSlot($$result5, $$slots["logo-picture"])}` })}
|
|
3314
|
-
</a>
|
|
3315
|
-
`)}` })}` })}
|
|
3316
|
-
`)}` })}`;
|
|
3317
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/PagesHeader.astro");
|
|
3410
|
+
};
|
|
3411
|
+
|
|
3412
|
+
const useHomeMain = async ({ pageContext }) => {
|
|
3413
|
+
return {
|
|
3414
|
+
...await useHeroSection({ pageContext })
|
|
3415
|
+
};
|
|
3416
|
+
};
|
|
3318
3417
|
|
|
3319
3418
|
const $$Astro$8 = createAstro("https://ecom2-002.web.app");
|
|
3320
|
-
const $$
|
|
3419
|
+
const $$HeroPicture = createComponent(async ($$result, $$props, $$slots) => {
|
|
3321
3420
|
const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
|
|
3322
|
-
Astro2.self = $$
|
|
3323
|
-
const {
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3421
|
+
Astro2.self = $$HeroPicture;
|
|
3422
|
+
const {
|
|
3423
|
+
img,
|
|
3424
|
+
alt,
|
|
3425
|
+
mobileImg,
|
|
3426
|
+
title,
|
|
3427
|
+
subtitle,
|
|
3428
|
+
buttonText,
|
|
3429
|
+
index
|
|
3430
|
+
} = Astro2.props;
|
|
3431
|
+
const hasHeader = title || subtitle || buttonText;
|
|
3432
|
+
let { widths, mobileWidths } = Astro2.props;
|
|
3433
|
+
if (!widths?.length) {
|
|
3434
|
+
if (mobileImg) {
|
|
3435
|
+
widths = [1536, 2048];
|
|
3436
|
+
} else {
|
|
3437
|
+
widths = [856, 1536, 2048];
|
|
3438
|
+
if (hasHeader) {
|
|
3439
|
+
widths = widths.map((w) => w / 2);
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
if (!mobileWidths?.length) {
|
|
3444
|
+
mobileWidths = [720, 856];
|
|
3445
|
+
}
|
|
3446
|
+
return 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" : ""} max-w-screen-2xl mx-auto` })}
|
|
3447
|
+
${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 max-w-screen-sm mx-auto" })}`}`;
|
|
3448
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/HeroPicture.astro");
|
|
3449
|
+
|
|
3450
|
+
const useHeroSlider = (props) => {
|
|
3451
|
+
const parsedSlides = computed(() => {
|
|
3452
|
+
return props.slides.map((slide) => {
|
|
3453
|
+
const title = slide.title ? parseShippingPhrase(slide.title).value : "";
|
|
3454
|
+
const subtitle = slide.subtitle ? parseShippingPhrase(slide.subtitle).value : "";
|
|
3455
|
+
const buttonText = slide.buttonText ? parseShippingPhrase(slide.buttonText).value : "";
|
|
3456
|
+
return {
|
|
3457
|
+
...slide,
|
|
3458
|
+
hasHeader: Boolean(title || subtitle || buttonText)
|
|
3459
|
+
};
|
|
3460
|
+
});
|
|
3461
|
+
});
|
|
3462
|
+
return {
|
|
3463
|
+
parsedSlides
|
|
3464
|
+
};
|
|
3465
|
+
};
|
|
3466
|
+
|
|
3467
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3468
|
+
__name: "HeroSlider",
|
|
3469
|
+
props: {
|
|
3470
|
+
autoplay: null,
|
|
3471
|
+
slides: null
|
|
3472
|
+
},
|
|
3473
|
+
setup(__props, { expose }) {
|
|
3474
|
+
expose();
|
|
3475
|
+
const props = __props;
|
|
3476
|
+
const { parsedSlides } = useHeroSlider(props);
|
|
3477
|
+
const __returned__ = { props, parsedSlides, Carousel, CarouselControl };
|
|
3478
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
3479
|
+
return __returned__;
|
|
3480
|
+
}
|
|
3481
|
+
});
|
|
3482
|
+
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3483
|
+
_push(`<section${ssrRenderAttrs(mergeProps({ class: "relative mx-auto" }, _attrs))}>`);
|
|
3484
|
+
_push(ssrRenderComponent($setup["Carousel"], { autoplay: $props.autoplay }, {
|
|
3485
|
+
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3486
|
+
if (_push2) {
|
|
3487
|
+
_push2(`<div style="${ssrRenderStyle($setup.parsedSlides.length > 1 ? null : { display: "none" })}" class="absolute z-10 top-1/2 -mt-8 w-screen xl:max-w-screen-xl xl:left-1/2 -ms-[640px] text-3xl leading-none text-base-400 opacity-60"${_scopeId}><div class="relative"${_scopeId}>`);
|
|
3488
|
+
_push2(ssrRenderComponent($setup["CarouselControl"], {
|
|
3489
|
+
direction: -1,
|
|
3490
|
+
class: "p-3 rounded-full hover:bg-white/40 hover:text-primary"
|
|
3491
|
+
}, null, _parent2, _scopeId));
|
|
3492
|
+
_push2(ssrRenderComponent($setup["CarouselControl"], { class: "p-3 rounded-full hover:bg-white/40 hover:text-primary" }, null, _parent2, _scopeId));
|
|
3493
|
+
_push2(`</div></div>`);
|
|
3494
|
+
} else {
|
|
3495
|
+
return [
|
|
3496
|
+
withDirectives(createVNode("div", { class: "absolute z-10 top-1/2 -mt-8 w-screen xl:max-w-screen-xl xl:left-1/2 -ms-[640px] text-3xl leading-none text-base-400 opacity-60" }, [
|
|
3497
|
+
createVNode("div", { class: "relative" }, [
|
|
3498
|
+
createVNode($setup["CarouselControl"], {
|
|
3499
|
+
direction: -1,
|
|
3500
|
+
class: "p-3 rounded-full hover:bg-white/40 hover:text-primary"
|
|
3501
|
+
}),
|
|
3502
|
+
createVNode($setup["CarouselControl"], { class: "p-3 rounded-full hover:bg-white/40 hover:text-primary" })
|
|
3503
|
+
])
|
|
3504
|
+
], 512), [
|
|
3505
|
+
[vShow, $setup.parsedSlides.length > 1]
|
|
3506
|
+
])
|
|
3507
|
+
];
|
|
3508
|
+
}
|
|
3509
|
+
}),
|
|
3510
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3511
|
+
if (_push2) {
|
|
3512
|
+
_push2(`<!--[-->`);
|
|
3513
|
+
ssrRenderList($setup.parsedSlides, (slide, i) => {
|
|
3514
|
+
_push2(`<li class="shrink-0 basis-full h-full secondary"${_scopeId}><div class="${ssrRenderClass([slide.hasHeader ? "grid grid-cols-1 md:grid-cols-2 items-center" : null, "w-screen max-w-screen-2xl mx-auto overflow-x-hidden"])}"${_scopeId}><a${ssrRenderAttr("href", slide.href)} class="${ssrRenderClass(slide.hasHeader ? "basis-1/2 grow-0 md:order-last" : null)}"${_scopeId}>`);
|
|
3515
|
+
ssrRenderSlot(_ctx.$slots, `picture-${i}`, {}, null, _push2, _parent2, _scopeId);
|
|
3516
|
+
_push2(`</a>`);
|
|
3517
|
+
if (slide.hasHeader) {
|
|
3518
|
+
_push2(`<div class="basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0"${_scopeId}>`);
|
|
3519
|
+
ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(i === 0 ? "h2" : "h3"), { class: "mt-1 text-3xl xl:text-5xl font-black" }, {
|
|
3520
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3521
|
+
if (_push3) {
|
|
3522
|
+
_push3(`${ssrInterpolate(slide.title)}`);
|
|
3523
|
+
} else {
|
|
3524
|
+
return [
|
|
3525
|
+
createTextVNode(toDisplayString(slide.title), 1)
|
|
3526
|
+
];
|
|
3527
|
+
}
|
|
3528
|
+
}),
|
|
3529
|
+
_: 2
|
|
3530
|
+
}), _parent2, _scopeId);
|
|
3531
|
+
if (slide.subtitle) {
|
|
3532
|
+
_push2(`<p class="text-lg mt-4 md:mt-6"${_scopeId}>${ssrInterpolate(slide.subtitle)}</p>`);
|
|
3533
|
+
} else {
|
|
3534
|
+
_push2(`<!---->`);
|
|
3535
|
+
}
|
|
3536
|
+
if (slide.buttonText) {
|
|
3537
|
+
_push2(`<a${ssrRenderAttr("href", slide.buttonLink)} class="not-prose inline-block min-w-[150px] mt-7 md:mt-10 bg-white text-primary text-lg font-bold px-6 py-2.5 rounded hover:bg-primary-100 active:ring-3 ring-white/30"${_scopeId}>${ssrInterpolate(slide.buttonText)}</a>`);
|
|
3538
|
+
} else {
|
|
3539
|
+
_push2(`<!---->`);
|
|
3540
|
+
}
|
|
3541
|
+
_push2(`</div>`);
|
|
3542
|
+
} else {
|
|
3543
|
+
_push2(`<!---->`);
|
|
3544
|
+
}
|
|
3545
|
+
_push2(`</div></li>`);
|
|
3546
|
+
});
|
|
3547
|
+
_push2(`<!--]-->`);
|
|
3548
|
+
} else {
|
|
3549
|
+
return [
|
|
3550
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.parsedSlides, (slide, i) => {
|
|
3551
|
+
return openBlock(), createBlock("li", {
|
|
3552
|
+
key: i,
|
|
3553
|
+
class: "shrink-0 basis-full h-full secondary"
|
|
3554
|
+
}, [
|
|
3555
|
+
createVNode("div", {
|
|
3556
|
+
class: ["w-screen max-w-screen-2xl mx-auto overflow-x-hidden", slide.hasHeader ? "grid grid-cols-1 md:grid-cols-2 items-center" : null]
|
|
3557
|
+
}, [
|
|
3558
|
+
createVNode("a", {
|
|
3559
|
+
href: slide.href,
|
|
3560
|
+
class: slide.hasHeader ? "basis-1/2 grow-0 md:order-last" : null
|
|
3561
|
+
}, [
|
|
3562
|
+
renderSlot$1(_ctx.$slots, `picture-${i}`)
|
|
3563
|
+
], 10, ["href"]),
|
|
3564
|
+
slide.hasHeader ? (openBlock(), createBlock("div", {
|
|
3565
|
+
key: 0,
|
|
3566
|
+
class: "basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0"
|
|
3567
|
+
}, [
|
|
3568
|
+
(openBlock(), createBlock(resolveDynamicComponent(i === 0 ? "h2" : "h3"), { class: "mt-1 text-3xl xl:text-5xl font-black" }, {
|
|
3569
|
+
default: withCtx(() => [
|
|
3570
|
+
createTextVNode(toDisplayString(slide.title), 1)
|
|
3571
|
+
]),
|
|
3572
|
+
_: 2
|
|
3573
|
+
}, 1024)),
|
|
3574
|
+
slide.subtitle ? (openBlock(), createBlock("p", {
|
|
3575
|
+
key: 0,
|
|
3576
|
+
class: "text-lg mt-4 md:mt-6"
|
|
3577
|
+
}, toDisplayString(slide.subtitle), 1)) : createCommentVNode("", true),
|
|
3578
|
+
slide.buttonText ? (openBlock(), createBlock("a", {
|
|
3579
|
+
key: 1,
|
|
3580
|
+
href: slide.buttonLink,
|
|
3581
|
+
class: "not-prose inline-block min-w-[150px] mt-7 md:mt-10 bg-white text-primary text-lg font-bold px-6 py-2.5 rounded hover:bg-primary-100 active:ring-3 ring-white/30"
|
|
3582
|
+
}, toDisplayString(slide.buttonText), 9, ["href"])) : createCommentVNode("", true)
|
|
3583
|
+
])) : createCommentVNode("", true)
|
|
3584
|
+
], 2)
|
|
3585
|
+
]);
|
|
3586
|
+
}), 128))
|
|
3587
|
+
];
|
|
3588
|
+
}
|
|
3589
|
+
}),
|
|
3590
|
+
_: 3
|
|
3591
|
+
}, _parent));
|
|
3592
|
+
_push(`</section>`);
|
|
3593
|
+
}
|
|
3594
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
3595
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
3596
|
+
const ssrContext = useSSRContext();
|
|
3597
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/HeroSlider.vue");
|
|
3598
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
3599
|
+
};
|
|
3600
|
+
const HeroSlider = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
|
|
3329
3601
|
|
|
3330
3602
|
const getPriceWithDiscount = (price, discount) => {
|
|
3331
3603
|
const { type, value } = discount;
|
|
@@ -3437,7 +3709,7 @@ const usePrices = (props) => {
|
|
|
3437
3709
|
const programIds = Object.keys(pointsPrograms);
|
|
3438
3710
|
for (let i = 0; i < programIds.length; i++) {
|
|
3439
3711
|
const program = pointsPrograms[programIds[i]];
|
|
3440
|
-
if (program && program.earn_percentage > 0) {
|
|
3712
|
+
if (program?.earn_percentage && program.earn_percentage > 0) {
|
|
3441
3713
|
return program;
|
|
3442
3714
|
}
|
|
3443
3715
|
}
|
|
@@ -3479,7 +3751,7 @@ const usePrices = (props) => {
|
|
|
3479
3751
|
};
|
|
3480
3752
|
};
|
|
3481
3753
|
|
|
3482
|
-
const _sfc_main
|
|
3754
|
+
const _sfc_main = defineComponent({
|
|
3483
3755
|
__name: "Prices",
|
|
3484
3756
|
props: {
|
|
3485
3757
|
product: null,
|
|
@@ -3513,7 +3785,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3513
3785
|
return __returned__;
|
|
3514
3786
|
}
|
|
3515
3787
|
});
|
|
3516
|
-
function _sfc_ssrRender
|
|
3788
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3517
3789
|
const _component_Fade = resolveComponent("Fade");
|
|
3518
3790
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
3519
3791
|
class: ["text-base-600", $props.isBig ? "text-lg" : null],
|
|
@@ -3644,144 +3916,25 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3644
3916
|
}, _parent));
|
|
3645
3917
|
_push(`</div>`);
|
|
3646
3918
|
}
|
|
3647
|
-
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
3648
|
-
_sfc_main$1.setup = (props, ctx) => {
|
|
3649
|
-
const ssrContext = useSSRContext();
|
|
3650
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
|
|
3651
|
-
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
3652
|
-
};
|
|
3653
|
-
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
|
|
3654
|
-
|
|
3655
|
-
const _sfc_main = defineComponent({
|
|
3656
|
-
__name: "ProductCard",
|
|
3657
|
-
props: {
|
|
3658
|
-
as: { default: "div" }
|
|
3659
|
-
},
|
|
3660
|
-
setup(__props, { expose }) {
|
|
3661
|
-
expose();
|
|
3662
|
-
const price = ref(12);
|
|
3663
|
-
const isBig = ref(false);
|
|
3664
|
-
setTimeout(() => {
|
|
3665
|
-
price.value = 8;
|
|
3666
|
-
isBig.value = true;
|
|
3667
|
-
}, 5e3);
|
|
3668
|
-
const __returned__ = { price, isBig, Prices };
|
|
3669
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
3670
|
-
return __returned__;
|
|
3671
|
-
}
|
|
3672
|
-
});
|
|
3673
|
-
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3674
|
-
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), _attrs, {
|
|
3675
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3676
|
-
if (_push2) {
|
|
3677
|
-
_push2(ssrRenderComponent($setup["Prices"], null, {
|
|
3678
|
-
default: withCtx(({ salePrice }, _push3, _parent3, _scopeId2) => {
|
|
3679
|
-
if (_push3) {
|
|
3680
|
-
_push3(` ProductCard ${ssrInterpolate(salePrice)}`);
|
|
3681
|
-
} else {
|
|
3682
|
-
return [
|
|
3683
|
-
createTextVNode(" ProductCard " + toDisplayString(salePrice), 1)
|
|
3684
|
-
];
|
|
3685
|
-
}
|
|
3686
|
-
}),
|
|
3687
|
-
_: 1
|
|
3688
|
-
}, _parent2, _scopeId));
|
|
3689
|
-
_push2(ssrRenderComponent($setup["Prices"], {
|
|
3690
|
-
product: { price: $setup.price }
|
|
3691
|
-
}, null, _parent2, _scopeId));
|
|
3692
|
-
_push2(ssrRenderComponent($setup["Prices"], {
|
|
3693
|
-
price: 12,
|
|
3694
|
-
"base-price": 17
|
|
3695
|
-
}, null, _parent2, _scopeId));
|
|
3696
|
-
_push2(ssrRenderComponent($setup["Prices"], {
|
|
3697
|
-
price: 12,
|
|
3698
|
-
"base-price": 16,
|
|
3699
|
-
"is-literal": true
|
|
3700
|
-
}, null, _parent2, _scopeId));
|
|
3701
|
-
_push2(ssrRenderComponent($setup["Prices"], {
|
|
3702
|
-
price: 12,
|
|
3703
|
-
"is-big": $setup.isBig
|
|
3704
|
-
}, null, _parent2, _scopeId));
|
|
3705
|
-
_push2(ssrRenderComponent($setup["Prices"], {
|
|
3706
|
-
price: 14,
|
|
3707
|
-
"base-price": 18,
|
|
3708
|
-
"is-big": $setup.isBig,
|
|
3709
|
-
"is-literal": true
|
|
3710
|
-
}, null, _parent2, _scopeId));
|
|
3711
|
-
_push2(ssrRenderComponent($setup["Prices"], {
|
|
3712
|
-
price: 12,
|
|
3713
|
-
"base-price": 16
|
|
3714
|
-
}, {
|
|
3715
|
-
"compare-value": withCtx(({ comparePrice }, _push3, _parent3, _scopeId2) => {
|
|
3716
|
-
if (_push3) {
|
|
3717
|
-
_push3(` x${ssrInterpolate(comparePrice)}`);
|
|
3718
|
-
} else {
|
|
3719
|
-
return [
|
|
3720
|
-
createTextVNode(" x" + toDisplayString(comparePrice), 1)
|
|
3721
|
-
];
|
|
3722
|
-
}
|
|
3723
|
-
}),
|
|
3724
|
-
_: 1
|
|
3725
|
-
}, _parent2, _scopeId));
|
|
3726
|
-
} else {
|
|
3727
|
-
return [
|
|
3728
|
-
createVNode($setup["Prices"], null, {
|
|
3729
|
-
default: withCtx(({ salePrice }) => [
|
|
3730
|
-
createTextVNode(" ProductCard " + toDisplayString(salePrice), 1)
|
|
3731
|
-
]),
|
|
3732
|
-
_: 1
|
|
3733
|
-
}),
|
|
3734
|
-
createVNode($setup["Prices"], {
|
|
3735
|
-
product: { price: $setup.price }
|
|
3736
|
-
}, null, 8, ["product"]),
|
|
3737
|
-
createVNode($setup["Prices"], {
|
|
3738
|
-
price: 12,
|
|
3739
|
-
"base-price": 17
|
|
3740
|
-
}),
|
|
3741
|
-
createVNode($setup["Prices"], {
|
|
3742
|
-
price: 12,
|
|
3743
|
-
"base-price": 16,
|
|
3744
|
-
"is-literal": true
|
|
3745
|
-
}),
|
|
3746
|
-
createVNode($setup["Prices"], {
|
|
3747
|
-
price: 12,
|
|
3748
|
-
"is-big": $setup.isBig
|
|
3749
|
-
}, null, 8, ["is-big"]),
|
|
3750
|
-
createVNode($setup["Prices"], {
|
|
3751
|
-
price: 14,
|
|
3752
|
-
"base-price": 18,
|
|
3753
|
-
"is-big": $setup.isBig,
|
|
3754
|
-
"is-literal": true
|
|
3755
|
-
}, null, 8, ["is-big"]),
|
|
3756
|
-
createVNode($setup["Prices"], {
|
|
3757
|
-
price: 12,
|
|
3758
|
-
"base-price": 16
|
|
3759
|
-
}, {
|
|
3760
|
-
"compare-value": withCtx(({ comparePrice }) => [
|
|
3761
|
-
createTextVNode(" x" + toDisplayString(comparePrice), 1)
|
|
3762
|
-
]),
|
|
3763
|
-
_: 1
|
|
3764
|
-
})
|
|
3765
|
-
];
|
|
3766
|
-
}
|
|
3767
|
-
}),
|
|
3768
|
-
_: 1
|
|
3769
|
-
}), _parent);
|
|
3770
|
-
}
|
|
3771
3919
|
const _sfc_setup = _sfc_main.setup;
|
|
3772
3920
|
_sfc_main.setup = (props, ctx) => {
|
|
3773
3921
|
const ssrContext = useSSRContext();
|
|
3774
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/
|
|
3922
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
|
|
3775
3923
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
3776
3924
|
};
|
|
3777
|
-
const
|
|
3925
|
+
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
3778
3926
|
|
|
3779
3927
|
const $$Astro$7 = createAstro("https://ecom2-002.web.app");
|
|
3780
3928
|
const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
3781
3929
|
const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
|
|
3782
3930
|
Astro2.self = $$Home;
|
|
3931
|
+
const { pageContext } = Astro2.props;
|
|
3932
|
+
const { heroSlider } = await useHomeMain({ pageContext });
|
|
3933
|
+
const heroSlides = heroSlider.slides;
|
|
3783
3934
|
const products = (await api.get("products")).data.result;
|
|
3784
3935
|
return renderTemplate`${maybeRenderHead($$result)}<main>
|
|
3936
|
+
${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, "HeroPicture", $$HeroPicture, { "slot": "picture-0", ...heroSlides[0], "index": 0 })}`}`, "picture-1": ($$result2) => renderTemplate`${heroSlides[1] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-1", ...heroSlides[1], "index": 1 })}`}`, "picture-2": ($$result2) => renderTemplate`${heroSlides[2] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-2", ...heroSlides[2], "index": 2 })}`}`, "picture-3": ($$result2) => renderTemplate`${heroSlides[3] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-3", ...heroSlides[3], "index": 3 })}`}`, "picture-4": ($$result2) => renderTemplate`${heroSlides[4] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-4", ...heroSlides[4], "index": 4 })}`}`, "picture-5": ($$result2) => renderTemplate`${heroSlides[5] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-5", ...heroSlides[5], "index": 5 })}`}`, "picture-6": ($$result2) => renderTemplate`${heroSlides[6] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-6", ...heroSlides[6], "index": 6 })}`}`, "picture-7": ($$result2) => renderTemplate`${heroSlides[7] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-7", ...heroSlides[7], "index": 7 })}`}`, "picture-8": ($$result2) => renderTemplate`${heroSlides[8] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-8", ...heroSlides[8], "index": 8 })}`}`, "picture-9": ($$result2) => renderTemplate`${heroSlides[9] && renderTemplate`${renderComponent($$result2, "HeroPicture", $$HeroPicture, { "slot": "picture-9", ...heroSlides[9], "index": 9 })}`}` })}`}
|
|
3937
|
+
|
|
3785
3938
|
<h1>Welcome to <span class="text-primary">Astro</span></h1>
|
|
3786
3939
|
<ul role="list" class="mt-3 fs-20">
|
|
3787
3940
|
${products.map((product) => renderTemplate`<li>
|
|
@@ -3822,7 +3975,6 @@ const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3822
3975
|
</div>
|
|
3823
3976
|
</div>
|
|
3824
3977
|
${renderComponent($$result, "Prices", Prices, { "price": 10, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/Prices.vue", "client:component-export": "default" })}
|
|
3825
|
-
${renderComponent($$result, "ProductCard", ProductCard, { "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/ProductCard.vue", "client:component-export": "default" })}
|
|
3826
3978
|
</main>`;
|
|
3827
3979
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Home.astro");
|
|
3828
3980
|
|
|
@@ -3841,7 +3993,9 @@ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3841
3993
|
loadError = err;
|
|
3842
3994
|
}
|
|
3843
3995
|
return renderTemplate`<html${addAttribute(pageContext?.lang.replace("_", "-"), "lang")}>
|
|
3844
|
-
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate
|
|
3996
|
+
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`
|
|
3997
|
+
${renderComponent($$result2, "HomeMain", $$Home, { "pageContext": pageContext })}
|
|
3998
|
+
` })}`}
|
|
3845
3999
|
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
3846
4000
|
</html>`;
|
|
3847
4001
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro");
|
|
@@ -3880,7 +4034,9 @@ const $$Fallback = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3880
4034
|
return err.astroResponse;
|
|
3881
4035
|
}
|
|
3882
4036
|
return renderTemplate`<html${addAttribute(pageContext?.lang.replace("_", "-"), "lang")}>
|
|
3883
|
-
${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate
|
|
4037
|
+
${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`
|
|
4038
|
+
${renderComponent($$result2, "FallbackMain", $$Fallback$1, { "pageContext": pageContext })}
|
|
4039
|
+
` })}
|
|
3884
4040
|
</html>`;
|
|
3885
4041
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro");
|
|
3886
4042
|
|
|
@@ -3936,13 +4092,11 @@ const $$Wildcard = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3936
4092
|
pageContext: { apiResource, apiDoc }
|
|
3937
4093
|
} = Astro2.props;
|
|
3938
4094
|
return renderTemplate`${maybeRenderHead($$result)}<main>
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
<em>Lorem ipsum dolor sit amet</em>
|
|
3945
|
-
</div>
|
|
4095
|
+
${apiDoc && renderTemplate`<h1>Hello <span class="text-gradient">${apiDoc.name}</span></h1><hr><div class="mt-3">
|
|
4096
|
+
<mark>${apiDoc._id}</mark> from <i>${apiResource}</i>
|
|
4097
|
+
<p>${Math.random()}</p>
|
|
4098
|
+
<em>Lorem ipsum dolor sit amet</em>
|
|
4099
|
+
</div>`}
|
|
3946
4100
|
</main>`;
|
|
3947
4101
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Wildcard.astro");
|
|
3948
4102
|
|
|
@@ -3967,7 +4121,9 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3967
4121
|
loadError = err;
|
|
3968
4122
|
}
|
|
3969
4123
|
return renderTemplate`<html${addAttribute(pageContext?.lang.replace("_", "-"), "lang")}>
|
|
3970
|
-
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate
|
|
4124
|
+
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`
|
|
4125
|
+
${renderComponent($$result2, "WildcardMain", $$Wildcard, { "pageContext": pageContext })}
|
|
4126
|
+
` })}`}
|
|
3971
4127
|
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
3972
4128
|
</html>`;
|
|
3973
4129
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro");
|