cloudcommerce 0.23.2 → 0.24.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/CHANGELOG.md +45 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +0 -6
- package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +17 -0
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/ssr/public/robots.txt +2 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +1 -10
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Banner.vue +4 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/PitchBar.vue +2 -3
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +4 -5
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +1 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +2 -7
- package/ecomplus-stores/barra-doce/functions/ssr/tailwind.config.cjs +1 -1
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
- package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +0 -6
- package/ecomplus-stores/iluminim/functions/ssr/content/settings.json +16 -0
- package/ecomplus-stores/iluminim/functions/ssr/package.json +6 -6
- package/ecomplus-stores/iluminim/functions/ssr/public/robots.txt +2 -4
- package/ecomplus-stores/iluminim/functions/ssr/src/components/AccountMenu.vue +1 -10
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Banner.vue +4 -6
- package/ecomplus-stores/iluminim/functions/ssr/src/components/PitchBar.vue +2 -3
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductCard.vue +4 -5
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductShelf.vue +1 -4
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +2 -7
- package/ecomplus-stores/iluminim/functions/ssr/tailwind.config.cjs +1 -1
- package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/iluminim/package.json +2 -2
- package/package.json +8 -8
- package/packages/api/package.json +1 -1
- package/packages/api/tests/index.test.ts +0 -2
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/lib/custom-payment-create-transaction.js +1 -1
- package/packages/apps/custom-payment/lib/custom-payment-list-payments.js +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 +2 -2
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/lib/galaxpay-create-transaction.js +1 -1
- package/packages/apps/galaxpay/lib/galaxpay-list-payments.js +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/lib/loyalty-create-transaction.js +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-list-payments.js +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/lib/mp-create-transaction.js +1 -1
- package/packages/apps/mercadopago/lib/mp-list-payments.js +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/lib/pagarme-create-transaction.js +1 -1
- package/packages/apps/pagarme/lib/pagarme-list-payments.js +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/paghiper/lib/paghiper-create-transaction.js +1 -1
- package/packages/apps/paghiper/lib/paghiper-list-payments.js +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/lib/pix-create-transaction.js +1 -1
- package/packages/apps/pix/lib/pix-list-payments.js +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/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/emails/tests/sendgrid.test.ts +0 -1
- package/packages/emails/tests/smtp.test.ts +0 -1
- package/packages/eslint/base.eslintrc.cjs +23 -0
- package/packages/eslint/package.json +5 -5
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/cloudflare/swr-worker.js +94 -26
- package/packages/ssr/lib/firebase/serve-storefront.js +22 -28
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +4 -4
- package/packages/ssr/src/cloudflare/swr-worker.ts +99 -26
- package/packages/ssr/src/firebase/serve-storefront.ts +24 -28
- package/packages/storefront/config/storefront.tailwind.cjs +41 -27
- package/packages/storefront/config/storefront.unocss.cjs +9 -23
- package/packages/storefront/dist/client/_astro/{_...slug_.07c1fa58.css → _...slug_.a786e016.css} +1 -1
- package/packages/storefront/dist/client/_astro/ecom-icon_CDmhA.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Z27EX9f.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Zo1CLq.png +0 -0
- package/packages/storefront/dist/client/_astro/headphone_22qtrt.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_247ud8.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1hoMcQ.webp +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1j5MXv.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_144owC.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_1ug3XF.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1EIN1I.avif +0 -0
- package/packages/storefront/dist/client/_astro/passion_29BEzB.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_2sykkb.avif +0 -0
- package/packages/storefront/dist/client/_astro/passion_HYj6i.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_Z18ANwS.avif +0 -0
- package/packages/storefront/dist/client/_astro/passion_ZK2FPz.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_pVNbE.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1EUYOa.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1Sqf3x.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1VeSii.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_2wFECM.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_7mg8W.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Kv492.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1DNkkN.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1IS4wy.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Zt4vbx.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1Bqr36.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1pj5UP.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_2dVuzq.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_HaXay.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z100iy0.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z2i1RBz.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_ZMRWqJ.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_mPQHw.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_xyq7d.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_1DkX0O.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_2uIqYp.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect89_Z1rGPGT.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_ZAjmIj.avif +0 -0
- package/packages/storefront/dist/client/robots.txt +2 -4
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/client/~fallback.html +98 -0
- package/packages/storefront/dist/client/~index.html +134 -0
- package/packages/storefront/dist/server/chunks/{_...c5a36021.mjs → _...5323ec5a.mjs} +4 -11
- package/packages/storefront/dist/server/chunks/{account@_@astro.3e90f29a.mjs → account@_@astro.a02ffb0b.mjs} +4 -11
- package/packages/storefront/dist/server/chunks/{astro.6adaff02.mjs → astro.a7611b51.mjs} +11 -18
- package/packages/storefront/dist/server/chunks/{index@_@astro.66b84ac2.mjs → index@_@astro.42c693b9.mjs} +4 -11
- package/packages/storefront/dist/server/chunks/{index@_@astro.0221a7bd.mjs → index@_@astro.d898498a.mjs} +4 -11
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.501582b9.mjs → _...slug_.astro.0f33557e.mjs} +103 -309
- package/packages/storefront/dist/server/chunks/pages/{account.astro.53400a42.mjs → account.astro.9325adb2.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{index.astro.f1104ab2.mjs → index.astro.0f31fa39.mjs} +8 -27
- package/packages/storefront/dist/server/chunks/pages/{fallback.astro.8d1c6076.mjs → ~fallback.astro.bd93f01e.mjs} +15 -32
- package/packages/storefront/dist/server/chunks/{fallback@_@astro.9f73db0f.mjs → ~fallback@_@astro.d17419ae.mjs} +4 -11
- package/packages/storefront/dist/server/entry.mjs +47 -16
- package/packages/storefront/dist/server/images.dist.csv +38 -0
- package/packages/storefront/dist/server/images.src.csv +11 -0
- package/packages/storefront/dist/server/renderers.mjs +3 -10
- package/packages/storefront/dist/server/stylesheets.csv +1 -0
- package/packages/storefront/package.json +7 -6
- package/packages/storefront/scripts/build-prod.sh +2 -0
- package/packages/storefront/src/env.d.ts +0 -2
- package/packages/storefront/src/helpers/server-data.ts +9 -2
- package/packages/storefront/src/lib/components/BannerPictures.astro +2 -2
- package/packages/storefront/src/lib/components/Drawer.vue +1 -1
- package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +36 -0
- package/packages/storefront/src/lib/components/SocialNetworkIcon.vue +1 -0
- package/packages/storefront/src/lib/components/globals/ALink.vue +5 -3
- package/packages/storefront/src/lib/composables/use-sticky-header.ts +1 -1
- package/packages/storefront/src/lib/layouts/BaseHead.astro +1 -1
- package/packages/storefront/src/lib/layouts/use-page-header.ts +2 -9
- package/packages/storefront/src/lib/ssr-context.ts +31 -25
- package/packages/storefront/src/vue-globals.d.ts +0 -1
- package/packages/types/index.ts +16 -0
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/server/chunks/endpoint@_@js.b79eed3b.mjs +0 -34
- package/packages/storefront/dist/server/chunks/pages/endpoint.js.4c130895.mjs +0 -119
- /package/ecomplus-stores/barra-doce/functions/ssr/src/pages/{fallback.astro → ~fallback.astro} +0 -0
- /package/ecomplus-stores/iluminim/functions/ssr/src/pages/{fallback.astro → ~fallback.astro} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { renderers } from '../renderers.mjs';
|
|
2
2
|
export { onRequest } from '../_empty-middleware.mjs';
|
|
3
|
-
import './astro.
|
|
3
|
+
import './astro.a7611b51.mjs';
|
|
4
4
|
import 'path-to-regexp';
|
|
5
5
|
import 'cookie';
|
|
6
6
|
import '@astrojs/internal-helpers/path';
|
|
@@ -14,21 +14,14 @@ import 'html-escaper';
|
|
|
14
14
|
import 'vue';
|
|
15
15
|
import 'vue/server-renderer';
|
|
16
16
|
import '@ecomplus/utils';
|
|
17
|
-
import './pages/_...slug_.astro.
|
|
18
|
-
import 'node:fs/promises';
|
|
19
|
-
import 'node:path';
|
|
20
|
-
import 'node:url';
|
|
21
|
-
import 'http-cache-semantics';
|
|
22
|
-
import 'node:os';
|
|
23
|
-
import 'image-size';
|
|
24
|
-
import 'magic-string';
|
|
25
|
-
import 'node:stream';
|
|
17
|
+
import './pages/_...slug_.astro.0f33557e.mjs';
|
|
26
18
|
import '@cloudcommerce/api';
|
|
27
19
|
import 'node:events';
|
|
20
|
+
import 'node:path';
|
|
28
21
|
import '@cloudcommerce/config';
|
|
29
22
|
/* empty css */import '@vueuse/core';
|
|
30
23
|
import '@headlessui/vue';
|
|
31
24
|
|
|
32
|
-
const page = () => import('./pages/index.astro.
|
|
25
|
+
const page = () => import('./pages/index.astro.0f31fa39.mjs').then(n => n.a);
|
|
33
26
|
|
|
34
27
|
export { page };
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import 'node:fs/promises';
|
|
3
|
-
import { resolve, join } from 'node:path';
|
|
4
|
-
import 'node:url';
|
|
5
|
-
import 'http-cache-semantics';
|
|
6
|
-
import 'node:os';
|
|
7
|
-
import sizeOf from 'image-size';
|
|
8
|
-
import 'magic-string';
|
|
9
|
-
import mime from 'mime';
|
|
10
|
-
import 'node:stream';
|
|
11
|
-
import { c as createAstro, a as createComponent, r as renderTemplate, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.6adaff02.mjs';
|
|
1
|
+
import { c as createAstro, a as createComponent, r as renderTemplate, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.a7611b51.mjs';
|
|
12
2
|
import api from '@cloudcommerce/api';
|
|
13
3
|
import { EventEmitter } from 'node:events';
|
|
14
|
-
import fs from 'node:fs';
|
|
4
|
+
import fs, { readFileSync } from 'node:fs';
|
|
5
|
+
import { resolve, join } from 'node:path';
|
|
15
6
|
import config from '@cloudcommerce/config';
|
|
16
7
|
import { img, price, formatMoney, randomObjectId, nickname, onPromotion, name } from '@ecomplus/utils';
|
|
17
|
-
/* empty css */import
|
|
8
|
+
/* empty css */import mime from 'mime';
|
|
9
|
+
import { reactive, computed, shallowRef, useSSRContext, defineComponent, inject, 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 } from 'vue';
|
|
18
10
|
import { useScroll, useElementHover, useDebounceFn, useTimeout, watchDebounced, promiseTimeout } from '@vueuse/core';
|
|
19
11
|
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate } from 'vue/server-renderer';
|
|
20
12
|
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
@@ -27,108 +19,6 @@ const _export_sfc = (sfc, props) => {
|
|
|
27
19
|
return target;
|
|
28
20
|
};
|
|
29
21
|
|
|
30
|
-
function isOutputFormat(value) {
|
|
31
|
-
return ["avif", "jpeg", "jpg", "png", "webp", "svg"].includes(value);
|
|
32
|
-
}
|
|
33
|
-
function isOutputFormatSupportsAlpha(value) {
|
|
34
|
-
return ["avif", "png", "webp"].includes(value);
|
|
35
|
-
}
|
|
36
|
-
function isAspectRatioString(value) {
|
|
37
|
-
return /^\d*:\d*$/.test(value);
|
|
38
|
-
}
|
|
39
|
-
function parseAspectRatio(aspectRatio) {
|
|
40
|
-
if (!aspectRatio) {
|
|
41
|
-
return void 0;
|
|
42
|
-
}
|
|
43
|
-
if (typeof aspectRatio === "number") {
|
|
44
|
-
return aspectRatio;
|
|
45
|
-
} else {
|
|
46
|
-
const [width, height] = aspectRatio.split(":");
|
|
47
|
-
return parseInt(width) / parseInt(height);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function isSSRService(service) {
|
|
51
|
-
return "transform" in service;
|
|
52
|
-
}
|
|
53
|
-
class BaseSSRService {
|
|
54
|
-
async getImageAttributes(transform) {
|
|
55
|
-
const { width, height, src, format, quality, aspectRatio, ...rest } = transform;
|
|
56
|
-
return {
|
|
57
|
-
...rest,
|
|
58
|
-
width,
|
|
59
|
-
height
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
serializeTransform(transform) {
|
|
63
|
-
const searchParams = new URLSearchParams();
|
|
64
|
-
if (transform.quality) {
|
|
65
|
-
searchParams.append("q", transform.quality.toString());
|
|
66
|
-
}
|
|
67
|
-
if (transform.format) {
|
|
68
|
-
searchParams.append("f", transform.format);
|
|
69
|
-
}
|
|
70
|
-
if (transform.width) {
|
|
71
|
-
searchParams.append("w", transform.width.toString());
|
|
72
|
-
}
|
|
73
|
-
if (transform.height) {
|
|
74
|
-
searchParams.append("h", transform.height.toString());
|
|
75
|
-
}
|
|
76
|
-
if (transform.aspectRatio) {
|
|
77
|
-
searchParams.append("ar", transform.aspectRatio.toString());
|
|
78
|
-
}
|
|
79
|
-
if (transform.fit) {
|
|
80
|
-
searchParams.append("fit", transform.fit);
|
|
81
|
-
}
|
|
82
|
-
if (transform.background) {
|
|
83
|
-
searchParams.append("bg", transform.background);
|
|
84
|
-
}
|
|
85
|
-
if (transform.position) {
|
|
86
|
-
searchParams.append("p", encodeURI(transform.position));
|
|
87
|
-
}
|
|
88
|
-
searchParams.append("href", transform.src);
|
|
89
|
-
return { searchParams };
|
|
90
|
-
}
|
|
91
|
-
parseTransform(searchParams) {
|
|
92
|
-
if (!searchParams.has("href")) {
|
|
93
|
-
return void 0;
|
|
94
|
-
}
|
|
95
|
-
let transform = { src: searchParams.get("href") };
|
|
96
|
-
if (searchParams.has("q")) {
|
|
97
|
-
transform.quality = parseInt(searchParams.get("q"));
|
|
98
|
-
}
|
|
99
|
-
if (searchParams.has("f")) {
|
|
100
|
-
const format = searchParams.get("f");
|
|
101
|
-
if (isOutputFormat(format)) {
|
|
102
|
-
transform.format = format;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (searchParams.has("w")) {
|
|
106
|
-
transform.width = parseInt(searchParams.get("w"));
|
|
107
|
-
}
|
|
108
|
-
if (searchParams.has("h")) {
|
|
109
|
-
transform.height = parseInt(searchParams.get("h"));
|
|
110
|
-
}
|
|
111
|
-
if (searchParams.has("ar")) {
|
|
112
|
-
const ratio = searchParams.get("ar");
|
|
113
|
-
if (isAspectRatioString(ratio)) {
|
|
114
|
-
transform.aspectRatio = ratio;
|
|
115
|
-
} else {
|
|
116
|
-
transform.aspectRatio = parseFloat(ratio);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (searchParams.has("fit")) {
|
|
120
|
-
transform.fit = searchParams.get("fit");
|
|
121
|
-
}
|
|
122
|
-
if (searchParams.has("p")) {
|
|
123
|
-
transform.position = decodeURI(searchParams.get("p"));
|
|
124
|
-
}
|
|
125
|
-
if (searchParams.has("bg")) {
|
|
126
|
-
transform.background = searchParams.get("bg");
|
|
127
|
-
}
|
|
128
|
-
return transform;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
22
|
global.__storefrontCMS = (fs, resolvePath) => {
|
|
133
23
|
const { STOREFRONT_BASE_DIR } = process.env;
|
|
134
24
|
let baseDir;
|
|
@@ -376,13 +266,13 @@ const loadRouteContext = async (Astro, {
|
|
|
376
266
|
Astro.response.status = status;
|
|
377
267
|
err.responseHTML = `<head>
|
|
378
268
|
<meta http-equiv="refresh" content="0;
|
|
379
|
-
url
|
|
269
|
+
url=/~fallback?status=${status}&url=${encodeURIComponent(urlPath)}"/>
|
|
380
270
|
</head>
|
|
381
271
|
<body></body>`;
|
|
382
272
|
throw err;
|
|
383
273
|
}
|
|
384
274
|
Astro.response.headers.set("X-Load-Took", String(Date.now() - startedAt));
|
|
385
|
-
if (urlPath === "
|
|
275
|
+
if (urlPath === "/~fallback") {
|
|
386
276
|
setResponseCache(Astro, 3600, 86400);
|
|
387
277
|
} else if (isHomepage) {
|
|
388
278
|
setResponseCache(Astro, 180, 300);
|
|
@@ -469,7 +359,7 @@ window.$storefront = ${JSON.stringify({ settings, data: {} })};`;
|
|
|
469
359
|
inlineClientJS += `
|
|
470
360
|
console.error(${JSON.stringify(message)});
|
|
471
361
|
setTimeout(() => {
|
|
472
|
-
window.location.replace("
|
|
362
|
+
window.location.replace("/~fallback?status=${statusCode}&url=${encodeURIComponent(url)}");
|
|
473
363
|
}, 1);`;
|
|
474
364
|
}
|
|
475
365
|
if (apiDoc) {
|
|
@@ -512,150 +402,98 @@ window.$isCmsPreview = true;`;
|
|
|
512
402
|
url: `https://${domain}/`,
|
|
513
403
|
logo: `https://${domain}${settings.logo}`
|
|
514
404
|
});
|
|
515
|
-
return renderTemplate(_a$2 || (_a$2 = __template$2(['<meta charset="UTF-8"
|
|
405
|
+
return renderTemplate(_a$2 || (_a$2 = __template$2(['<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="theme-color"', '><link rel="icon" type="image/png"', ' sizes="32x32">', "<title>", '</title><meta name="description"', '><meta name="author"', '><meta name="generator"', '><link rel="canonical"', ">", '<meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta property="og:site_name"', '><meta property="og:url"', '><meta property="og:title"', '><meta property="og:description"', '><meta property="og:type" content="website"><meta property="og:locale"', ">", "", '<meta name="twitter:card" content="summary">', '<meta name="ecom-store-id"', ">", "", "<script>", '<\/script><script type="application/ld+json">', "<\/script>"])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd));
|
|
516
406
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", void 0);
|
|
517
407
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
408
|
+
const { STOREFRONT_BASE_DIR } = process.env;
|
|
409
|
+
const baseDir = STOREFRONT_BASE_DIR || process.cwd();
|
|
410
|
+
const builtImages = [];
|
|
411
|
+
const manifestFilepath = join(baseDir, "dist/server/images.dist.csv");
|
|
412
|
+
readFileSync(manifestFilepath, "utf-8").split(/\n/).forEach((line) => {
|
|
413
|
+
const [filename, width, height] = line.split(",");
|
|
414
|
+
builtImages.push({
|
|
415
|
+
filename,
|
|
416
|
+
width: Number(width),
|
|
417
|
+
height: Number(height)
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
builtImages.sort((a, b) => {
|
|
421
|
+
if (a.width < b.width)
|
|
422
|
+
return -1;
|
|
423
|
+
return 1;
|
|
424
|
+
});
|
|
425
|
+
const getBuiltImage = async ({ src, width, format }) => {
|
|
426
|
+
const filename = src.replace(/^.*\//, "").replace(/.\w+(\?.*)?$/, "");
|
|
427
|
+
const filenameRegExp = new RegExp(`[_.][a-z0-9]+\\.${format}$`, "i");
|
|
428
|
+
const matchFilename = (_builtImage) => {
|
|
429
|
+
return filename === _builtImage.filename.replace(filenameRegExp, "");
|
|
430
|
+
};
|
|
431
|
+
let builtImage = builtImages.find((_builtImage) => {
|
|
432
|
+
return _builtImage.width >= width && matchFilename(_builtImage);
|
|
433
|
+
});
|
|
434
|
+
if (!builtImage) {
|
|
435
|
+
builtImage = builtImages.find(matchFilename);
|
|
436
|
+
}
|
|
437
|
+
if (builtImage) {
|
|
438
|
+
return {
|
|
439
|
+
src: `/_astro/${builtImage.filename}`,
|
|
440
|
+
width: builtImage.width,
|
|
441
|
+
height: builtImage.height
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
console.warn(`Could not match built ${format} image for ${src} ${width}px`);
|
|
445
|
+
return { src, width };
|
|
446
|
+
};
|
|
447
|
+
|
|
521
448
|
function removeQueryString(src) {
|
|
522
449
|
const index = src.lastIndexOf("?");
|
|
523
450
|
return index > 0 ? src.substring(0, index) : src;
|
|
524
451
|
}
|
|
525
|
-
function
|
|
452
|
+
function basename(src) {
|
|
453
|
+
return removeQueryString(src.replace(/^.*[\\\/]/, ""));
|
|
454
|
+
}
|
|
455
|
+
const extname = (src) => {
|
|
526
456
|
const base = basename(src);
|
|
527
457
|
const index = base.lastIndexOf(".");
|
|
528
458
|
if (index <= 0) {
|
|
529
459
|
return "";
|
|
530
460
|
}
|
|
531
461
|
return base.substring(index);
|
|
532
|
-
}
|
|
533
|
-
function
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
function resolveSize(transform) {
|
|
538
|
-
if (transform.width && transform.height) {
|
|
539
|
-
return transform;
|
|
540
|
-
}
|
|
541
|
-
if (!transform.width && !transform.height) {
|
|
542
|
-
throw new Error(`"width" and "height" cannot both be undefined`);
|
|
543
|
-
}
|
|
544
|
-
if (!transform.aspectRatio) {
|
|
545
|
-
throw new Error(
|
|
546
|
-
`"aspectRatio" must be included if only "${transform.width ? "width" : "height"}" is provided`
|
|
547
|
-
);
|
|
548
|
-
}
|
|
549
|
-
let aspectRatio;
|
|
550
|
-
if (typeof transform.aspectRatio === "number") {
|
|
551
|
-
aspectRatio = transform.aspectRatio;
|
|
552
|
-
} else {
|
|
553
|
-
const [width, height] = transform.aspectRatio.split(":");
|
|
554
|
-
aspectRatio = Number.parseInt(width) / Number.parseInt(height);
|
|
555
|
-
}
|
|
556
|
-
if (transform.width) {
|
|
557
|
-
return {
|
|
558
|
-
...transform,
|
|
559
|
-
width: transform.width,
|
|
560
|
-
height: Math.round(transform.width / aspectRatio)
|
|
561
|
-
};
|
|
562
|
-
} else if (transform.height) {
|
|
563
|
-
return {
|
|
564
|
-
...transform,
|
|
565
|
-
width: Math.round(transform.height * aspectRatio),
|
|
566
|
-
height: transform.height
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
return transform;
|
|
570
|
-
}
|
|
571
|
-
async function resolveTransform(input) {
|
|
572
|
-
if (typeof input.src === "string") {
|
|
573
|
-
return resolveSize(input);
|
|
574
|
-
}
|
|
575
|
-
const metadata = "then" in input.src ? (await input.src).default : input.src;
|
|
576
|
-
let { width, height, aspectRatio, background, format = metadata.format, ...rest } = input;
|
|
577
|
-
if (!width && !height) {
|
|
578
|
-
width = metadata.width;
|
|
579
|
-
height = metadata.height;
|
|
580
|
-
} else if (width) {
|
|
581
|
-
let ratio = parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
|
|
582
|
-
height = height || Math.round(width / ratio);
|
|
583
|
-
} else if (height) {
|
|
584
|
-
let ratio = parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
|
|
585
|
-
width = width || Math.round(height * ratio);
|
|
586
|
-
}
|
|
587
|
-
return {
|
|
588
|
-
...rest,
|
|
589
|
-
src: metadata.src,
|
|
590
|
-
width,
|
|
591
|
-
height,
|
|
592
|
-
aspectRatio,
|
|
593
|
-
format,
|
|
594
|
-
background
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
async function getImage(transform) {
|
|
598
|
-
var _a, _b, _c;
|
|
599
|
-
if (!transform.src) {
|
|
600
|
-
throw new Error("[@astrojs/image] `src` is required");
|
|
601
|
-
}
|
|
602
|
-
let loader = (_a = globalThis.astroImage) == null ? void 0 : _a.loader;
|
|
603
|
-
if (!loader) {
|
|
604
|
-
const { default: mod } = await import('./endpoint.js.4c130895.mjs').then(n => n.s).catch(() => {
|
|
605
|
-
throw new Error(
|
|
606
|
-
"[@astrojs/image] Builtin image loader not found. (Did you remember to add the integration to your Astro config?)"
|
|
607
|
-
);
|
|
608
|
-
});
|
|
609
|
-
loader = mod;
|
|
610
|
-
globalThis.astroImage = globalThis.astroImage || {};
|
|
611
|
-
globalThis.astroImage.loader = loader;
|
|
612
|
-
}
|
|
613
|
-
const resolved = await resolveTransform(transform);
|
|
614
|
-
const attributes = await loader.getImageAttributes(resolved);
|
|
615
|
-
const isDev = (_b = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://ecom2-demo.web.app","ASSETS_PREFIX":undefined},{SSR:true,}))) == null ? void 0 : _b.DEV;
|
|
616
|
-
const isLocalImage = !isRemoteImage(resolved.src);
|
|
617
|
-
const _loader = isDev && isLocalImage ? globalThis.astroImage.defaultLoader : loader;
|
|
618
|
-
if (!_loader) {
|
|
619
|
-
throw new Error("@astrojs/image: loader not found!");
|
|
620
|
-
}
|
|
621
|
-
const { searchParams } = isSSRService(_loader) ? _loader.serializeTransform(resolved) : globalThis.astroImage.defaultLoader.serializeTransform(resolved);
|
|
622
|
-
const imgSrc = !isLocalImage && resolved.src.startsWith("//") ? `https:${resolved.src}` : resolved.src;
|
|
623
|
-
let src;
|
|
624
|
-
if (/^[\/\\]?@astroimage/.test(imgSrc)) {
|
|
625
|
-
src = `${imgSrc}?${searchParams.toString()}`;
|
|
626
|
-
} else {
|
|
627
|
-
searchParams.set("href", imgSrc);
|
|
628
|
-
src = `/_image?${searchParams.toString()}`;
|
|
462
|
+
};
|
|
463
|
+
function parseAspectRatio(aspectRatio) {
|
|
464
|
+
if (!aspectRatio) {
|
|
465
|
+
return void 0;
|
|
629
466
|
}
|
|
630
|
-
if (
|
|
631
|
-
|
|
467
|
+
if (typeof aspectRatio === "number") {
|
|
468
|
+
return aspectRatio;
|
|
632
469
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
src
|
|
636
|
-
};
|
|
470
|
+
const [width, height] = aspectRatio.split(":");
|
|
471
|
+
return parseInt(width, 10) / parseInt(height, 10);
|
|
637
472
|
}
|
|
638
|
-
|
|
639
473
|
async function resolveAspectRatio({ src, aspectRatio }) {
|
|
640
474
|
if (typeof src === "string") {
|
|
641
475
|
return parseAspectRatio(aspectRatio);
|
|
642
|
-
} else {
|
|
643
|
-
const metadata = "then" in src ? (await src).default : src;
|
|
644
|
-
return parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
|
|
645
476
|
}
|
|
477
|
+
throw new Error('Custom (faster) `Picture.ssr.astro` works only with string ("remote") src');
|
|
646
478
|
}
|
|
647
479
|
async function resolveFormats({ src, formats }) {
|
|
648
480
|
const unique = new Set(formats);
|
|
649
481
|
if (typeof src === "string") {
|
|
650
482
|
unique.add(extname(src).replace(".", ""));
|
|
651
483
|
} else {
|
|
652
|
-
|
|
653
|
-
unique.add(extname(metadata.src).replace(".", ""));
|
|
484
|
+
throw new Error("Custom `Picture.ssr.astro` works only with string src");
|
|
654
485
|
}
|
|
655
486
|
return Array.from(unique).filter(Boolean);
|
|
656
487
|
}
|
|
657
|
-
async function
|
|
658
|
-
const {
|
|
488
|
+
async function getBuiltPicture(params) {
|
|
489
|
+
const {
|
|
490
|
+
src,
|
|
491
|
+
alt,
|
|
492
|
+
widths,
|
|
493
|
+
fit,
|
|
494
|
+
position,
|
|
495
|
+
background
|
|
496
|
+
} = params;
|
|
659
497
|
if (!src) {
|
|
660
498
|
throw new Error("[@astrojs/image] `src` is required");
|
|
661
499
|
}
|
|
@@ -673,8 +511,7 @@ async function getPicture(params) {
|
|
|
673
511
|
async function getSource(format) {
|
|
674
512
|
const imgs = await Promise.all(
|
|
675
513
|
widths.map(async (width) => {
|
|
676
|
-
|
|
677
|
-
const img = await getImage({
|
|
514
|
+
const img = await getBuiltImage({
|
|
678
515
|
src,
|
|
679
516
|
alt,
|
|
680
517
|
format,
|
|
@@ -687,7 +524,7 @@ async function getPicture(params) {
|
|
|
687
524
|
if (format === lastFormat && width === maxWidth) {
|
|
688
525
|
image = img;
|
|
689
526
|
}
|
|
690
|
-
return `${
|
|
527
|
+
return `${img.src} ${width}w`;
|
|
691
528
|
})
|
|
692
529
|
);
|
|
693
530
|
return {
|
|
@@ -698,7 +535,7 @@ async function getPicture(params) {
|
|
|
698
535
|
const sources = await Promise.all(allFormats.map((format) => getSource(format)));
|
|
699
536
|
return {
|
|
700
537
|
sources,
|
|
701
|
-
// @ts-
|
|
538
|
+
// @ts-ignore
|
|
702
539
|
image
|
|
703
540
|
};
|
|
704
541
|
}
|
|
@@ -833,18 +670,27 @@ const $$Astro$7 = createAstro("https://ecom2-demo.web.app");
|
|
|
833
670
|
const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
834
671
|
const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
|
|
835
672
|
Astro2.self = $$Picture;
|
|
836
|
-
const
|
|
837
|
-
const
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
|
|
673
|
+
const { STOREFRONT_BASE_DIR } = process.env;
|
|
674
|
+
const baseDir = STOREFRONT_BASE_DIR || process.cwd();
|
|
675
|
+
const originalImages = [];
|
|
676
|
+
const manifestFilepath = join(baseDir, "dist/server/images.src.csv");
|
|
677
|
+
readFileSync(manifestFilepath, "utf-8").split(/\n/).forEach((line) => {
|
|
678
|
+
const [filepath, width, height] = line.split(",");
|
|
679
|
+
originalImages.push({
|
|
680
|
+
filepath,
|
|
681
|
+
width: Number(width),
|
|
682
|
+
height: Number(height)
|
|
683
|
+
});
|
|
684
|
+
});
|
|
841
685
|
const tryImageSize = (src) => {
|
|
842
686
|
let dimensions = {};
|
|
843
687
|
if (typeof src === "string" && src.startsWith("/")) {
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
}
|
|
847
|
-
|
|
688
|
+
const originalImage = originalImages.find(({ filepath }) => {
|
|
689
|
+
return new RegExp(`^/${filepath}\\??.*`).test(src);
|
|
690
|
+
});
|
|
691
|
+
if (originalImage) {
|
|
692
|
+
const { width, height } = originalImage;
|
|
693
|
+
dimensions = { width, height };
|
|
848
694
|
}
|
|
849
695
|
}
|
|
850
696
|
return dimensions;
|
|
@@ -857,35 +703,17 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
857
703
|
} = await useSSRPicture({
|
|
858
704
|
...Astro2.props,
|
|
859
705
|
tryImageSize,
|
|
860
|
-
getPicture
|
|
706
|
+
getPicture: getBuiltPicture
|
|
861
707
|
});
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}>
|
|
866
|
-
${sources.map((attrs) => {
|
|
867
|
-
if (versionSuffix) {
|
|
868
|
-
attrs.srcset = attrs.srcset.replace(/\s(\w+)$/, `${versionSuffix} $1`);
|
|
869
|
-
}
|
|
870
|
-
return renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`;
|
|
871
|
-
})}
|
|
872
|
-
${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`}
|
|
873
|
-
</picture>`;
|
|
874
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Picture.astro", void 0);
|
|
708
|
+
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}>${sources.map((attrs) => renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`)}${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`}</picture>`;
|
|
709
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/images/Picture.runtime.astro", void 0);
|
|
875
710
|
|
|
876
711
|
const $$Astro$6 = createAstro("https://ecom2-demo.web.app");
|
|
877
712
|
const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
|
|
878
713
|
const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
|
|
879
714
|
Astro2.self = $$BaseBody;
|
|
880
715
|
const { settings } = Astro2.locals.routeContext;
|
|
881
|
-
return renderTemplate`${maybeRenderHead()}<body
|
|
882
|
-
<div id="teleported-overlap" class="relative z-[59]"></div>
|
|
883
|
-
<div id="teleported-top" class="relative z-[19]"></div>
|
|
884
|
-
${renderSlot($$result, $$slots["default"])}
|
|
885
|
-
${renderSlot($$result, $$slots["before-body-end"])}
|
|
886
|
-
<div id="teleported-bottom" class="relative z-[19]"></div>
|
|
887
|
-
${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 })}`}
|
|
888
|
-
</body>`;
|
|
716
|
+
return renderTemplate`${maybeRenderHead()}<body><div id="teleported-overlap" class="relative z-[59]"></div><div id="teleported-top" class="relative z-[19]"></div>${renderSlot($$result, $$slots["default"])}${renderSlot($$result, $$slots["before-body-end"])}<div id="teleported-bottom" class="relative z-[19]"></div>${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 })}`}</body>`;
|
|
889
717
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro", void 0);
|
|
890
718
|
|
|
891
719
|
const $$Astro$5 = createAstro("https://ecom2-demo.web.app");
|
|
@@ -894,18 +722,7 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
894
722
|
Astro2.self = $$Base$1;
|
|
895
723
|
const { getContent } = Astro2.locals.routeContext;
|
|
896
724
|
const { custom_code: customCodeContent } = await getContent("layout");
|
|
897
|
-
return renderTemplate`<head>
|
|
898
|
-
${renderSlot($$result, $$slots["base-head"])}
|
|
899
|
-
${customCodeContent?.css && renderTemplate`<style>{customCodeContent.css}</style>`}
|
|
900
|
-
${customCodeContent?.html_head && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(customCodeContent.html_head)}` })}`}
|
|
901
|
-
${renderSlot($$result, $$slots["base-head-scripts"])}
|
|
902
|
-
${renderSlot($$result, $$slots["before-head-end"])}
|
|
903
|
-
${renderHead()}</head>
|
|
904
|
-
${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate`
|
|
905
|
-
${renderSlot($$result2, $$slots["default"])}
|
|
906
|
-
${customCodeContent?.html_body && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCodeContent.html_body)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}
|
|
907
|
-
${renderSlot($$result2, $$slots["before-body-end"])}
|
|
908
|
-
` })}`;
|
|
725
|
+
return renderTemplate`<head>${renderSlot($$result, $$slots["base-head"])}${customCodeContent?.css && renderTemplate`<style>{customCodeContent.css}</style>`}${customCodeContent?.html_head && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(customCodeContent.html_head)}` })}`}${renderSlot($$result, $$slots["base-head-scripts"])}${renderSlot($$result, $$slots["before-head-end"])}${renderHead()}</head>${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["default"])}${customCodeContent?.html_body && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCodeContent.html_body)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}${renderSlot($$result2, $$slots["before-body-end"])}` })}`;
|
|
909
726
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
|
|
910
727
|
|
|
911
728
|
var __freeze$1 = Object.freeze;
|
|
@@ -923,13 +740,7 @@ const $$Astro$3 = createAstro("https://ecom2-demo.web.app");
|
|
|
923
740
|
const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
924
741
|
const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
|
|
925
742
|
Astro2.self = $$Base;
|
|
926
|
-
return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`
|
|
927
|
-
${renderSlot($$result3, $$slots["base-head"])}
|
|
928
|
-
` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
${renderSlot($$result2, $$slots["default"])}
|
|
932
|
-
` })}`;
|
|
743
|
+
return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`${renderSlot($$result3, $$slots["base-head"])}` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["default"])}` })}`;
|
|
933
744
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro", void 0);
|
|
934
745
|
|
|
935
746
|
const checkObjNotNull = (obj) => {
|
|
@@ -4254,11 +4065,7 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4254
4065
|
field: "categories",
|
|
4255
4066
|
value: categories?.map(({ _id, ...c }) => c)
|
|
4256
4067
|
});
|
|
4257
|
-
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a || (_a = __template(["
|
|
4258
|
-
${maybeRenderHead()}<a href="/">
|
|
4259
|
-
${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "logo-picture": ($$result4) => renderTemplate`${renderComponent($$result4, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}` })}
|
|
4260
|
-
</a>
|
|
4261
|
-
` })}` })))}`;
|
|
4068
|
+
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a || (_a = __template(["", "", "<script>", "<\/script>", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(inlineClientJS), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`${maybeRenderHead()}<a href="/">${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "logo-picture": ($$result4) => renderTemplate`${renderComponent($$result4, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}` })}</a>` })}` })))}`;
|
|
4262
4069
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
|
|
4263
4070
|
|
|
4264
4071
|
const $$Astro$1 = createAstro("https://ecom2-demo.web.app");
|
|
@@ -4268,13 +4075,7 @@ const $$Wildcard = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4268
4075
|
const { fetchingApiContext, apiContext } = Astro2.locals.routeContext;
|
|
4269
4076
|
await fetchingApiContext;
|
|
4270
4077
|
const apiDoc = apiContext.doc;
|
|
4271
|
-
return renderTemplate`${maybeRenderHead()}<main>
|
|
4272
|
-
${apiDoc && renderTemplate`<h1>Hello <span class="text-gradient">${apiDoc.name}</span></h1><hr><div class="mt-3">
|
|
4273
|
-
<mark>${apiDoc._id}</mark> from <i>${apiContext.resource}</i>
|
|
4274
|
-
<p>${Math.random()}</p>
|
|
4275
|
-
<em>Lorem ipsum dolor sit amet</em>
|
|
4276
|
-
</div>`}
|
|
4277
|
-
</main>`;
|
|
4078
|
+
return renderTemplate`${maybeRenderHead()}<main>${apiDoc && renderTemplate`<h1>Hello <span class="text-gradient">${apiDoc.name}</span></h1><hr><div class="mt-3"><mark>${apiDoc._id}</mark> from <i>${apiContext.resource}</i><p>${Math.random()}</p><em>Lorem ipsum dolor sit amet</em></div>`}</main>`;
|
|
4278
4079
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Wildcard.astro", void 0);
|
|
4279
4080
|
|
|
4280
4081
|
const $$Astro = createAstro("https://ecom2-demo.web.app");
|
|
@@ -4297,14 +4098,7 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4297
4098
|
}
|
|
4298
4099
|
loadError = err;
|
|
4299
4100
|
}
|
|
4300
|
-
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}
|
|
4301
|
-
${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`
|
|
4302
|
-
|
|
4303
|
-
${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
|
|
4304
|
-
${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}
|
|
4305
|
-
` })}`}
|
|
4306
|
-
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
4307
|
-
</html>`;
|
|
4101
|
+
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`${renderComponent($$result2, "PageHeader", $$PageHeader, {})}${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}` })}`}${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}</html>`;
|
|
4308
4102
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", void 0);
|
|
4309
4103
|
|
|
4310
4104
|
const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
|
|
@@ -4318,4 +4112,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
|
|
|
4318
4112
|
url: $$url
|
|
4319
4113
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
4320
4114
|
|
|
4321
|
-
export { $$
|
|
4115
|
+
export { $$Picture as $, Carousel as C, Prices as P, _export_sfc as _, CarouselControl as a, addProductToCart as b, $$BaseHead as c, $$PageHeader as d, $$Base as e, ____slug_ as f, loadRouteContext as l, parseShippingPhrase as p };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createAstro, a as createComponent, r as renderTemplate } from '../astro.
|
|
1
|
+
import { c as createAstro, a as createComponent, r as renderTemplate } from '../astro.a7611b51.mjs';
|
|
2
2
|
import 'path-to-regexp';
|
|
3
3
|
import 'cookie';
|
|
4
4
|
import '@astrojs/internal-helpers/path';
|