cloudcommerce 2.10.2 → 2.10.4
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/.vscode/settings.json +3 -3
- package/CHANGELOG.md +15 -0
- package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/content/pages/products.json +1 -4
- package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barradoce/functions/ssr/{tailwind.config.cjs → tailwind.config.js} +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/uno.config.js +4 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/package.json +2 -2
- package/ecomplus-stores/barradoce/tailwind.config.js +8 -0
- package/package.json +4 -4
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-program/package.json +2 -2
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +3 -3
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +3 -3
- package/packages/apps/fb-conversions/package.json +3 -3
- package/packages/apps/flash-courier/package.json +2 -2
- package/packages/apps/frenet/package.json +3 -3
- package/packages/apps/galaxpay/package.json +3 -3
- package/packages/apps/google-analytics/package.json +3 -3
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +2 -2
- package/packages/apps/melhor-envio/package.json +3 -3
- package/packages/apps/mercadopago/package.json +3 -3
- package/packages/apps/pagarme/package.json +3 -3
- package/packages/apps/pagarme-v5/package.json +2 -2
- package/packages/apps/paghiper/package.json +3 -3
- package/packages/apps/pix/package.json +3 -3
- package/packages/apps/tiny-erp/package.json +3 -3
- package/packages/apps/webhooks/package.json +3 -3
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/base.eslintrc.cjs +1 -0
- package/packages/eslint/package.json +4 -4
- package/packages/events/package.json +3 -3
- package/packages/feeds/package.json +2 -2
- package/packages/firebase/package.json +3 -3
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +3 -3
- package/packages/passport/package.json +3 -3
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/config/{storefront.tailwind.cjs → storefront.tailwind.mjs} +19 -19
- package/packages/storefront/config/{storefront.unocss.cjs → storefront.unocss.mjs} +9 -9
- package/packages/storefront/dist/client/_astro/AccountPage.Cf0WE6GF.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.DAvJKL2c.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.DyjSOy4Q.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.CEGsee2q.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.9RhV7hCY.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.BpZtnS8j.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.C0TU_sRb.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.DWNSfxML.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchShowcase.CUkbXIRk.js +1 -0
- package/packages/storefront/dist/client/_astro/ShippingCalculator.DZSCK4xv.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.D7qqQxFD.js +7 -0
- package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.3R8ooc_r.js → _plugin-vue_export-helper.6K9uDcVo.js} +1 -1
- package/packages/storefront/dist/client/_astro/_slug_.HhgCFKHv.css +1 -0
- package/packages/storefront/dist/client/_astro/client.D_V8TfA5.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.Cctko5_9.js +7 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.CBckq0Sj.js → firebase-app.CmI1zl7o.js} +1 -1
- package/packages/storefront/dist/client/_astro/{format-money.vLicYTv9.js → format-money.D19_eJVX.js} +1 -1
- package/packages/storefront/dist/client/_astro/{grid-title.CxNZApGL.js → grid-title.CZdq2sDS.js} +1 -1
- package/packages/storefront/dist/client/_astro/hoisted.BeKMioW4.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.Bf1gCkSN.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.CSjieYcR.js +8 -0
- package/packages/storefront/dist/client/_astro/{i18n.BE5r_SIU.js → i18n.DPcLqMFO.js} +1 -1
- package/packages/storefront/dist/client/_astro/{img.CB-F9VLo.js → img.Be85e5da.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index-bea2a320.CHELEM8n.js → index-a8cf6c8f.k99a-gIB.js} +99 -99
- package/packages/storefront/dist/client/_astro/index.BCNoXz_Z.js +1 -0
- package/packages/storefront/dist/client/_astro/index.BgtOIB20.js +1 -0
- package/packages/storefront/dist/client/_astro/index.DlxZwqDP.js +1 -0
- package/packages/storefront/dist/client/_astro/modules-info.BswYf_-7.js +1 -0
- package/packages/storefront/dist/client/_astro/name.Dll7Wwmg.js +1 -0
- package/packages/storefront/dist/client/_astro/page.FdSlRisw.js +1 -0
- package/packages/storefront/dist/client/_astro/sf-utils.C9ygvYIB.js +13 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.Cqc6p5UR.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.bP3a5cR0.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-cms-preview.CPGTKut8.js → use-cms-preview.BxKK4a1X.js} +1 -1
- package/packages/storefront/dist/client/_astro/use-product-card.Cj9Q-Y1A.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-text-value.D4Rw7N4D.js → use-text-value.DT0v9Yj_.js} +2 -2
- package/packages/storefront/dist/server/_astro-internal_middleware.mjs +4 -0
- package/packages/storefront/dist/server/chunks/404_jTV5wvby.mjs +5 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_lUckG0fs.mjs → CartSidebar_CV9qwGNE.mjs} +2 -1
- package/packages/storefront/dist/server/chunks/{SearchModal_B2f22Mff.mjs → SearchModal_Cw1ECnXI.mjs} +37 -15
- package/packages/storefront/dist/server/chunks/_.._k1NruPDv.mjs +5 -0
- package/packages/storefront/dist/server/chunks/_astro-internal_middleware_DIG56BhA.mjs +40 -0
- package/packages/storefront/dist/server/chunks/{_page__Ex4FhYrc.mjs → _page__BKNX3RH7.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_B7sLjsXD.mjs → account_BZOa6Kmc.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_BOyOfKDQ.mjs → assets-service_MW85B416.mjs} +5 -2
- package/packages/storefront/dist/server/chunks/{astro_B5LBy7PI.mjs → astro_8KdHu_Gf.mjs} +83 -113
- package/packages/storefront/dist/server/chunks/{index_C2hkTn-w.mjs → index_CZ6FSUEb.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{index_BOh755yP.mjs → index_D1o9pXka.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{node_DavlI8UF.mjs → node_Khrf-0bH.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__RXg_hYeF.mjs → 404_BPSxJtl3.mjs} +675 -4955
- package/packages/storefront/dist/server/chunks/pages/__ByRpsTnC.mjs +4630 -0
- package/packages/storefront/dist/server/chunks/pages/{_page__Dyte93f2.mjs → _page__BasreLue.mjs} +32 -9
- package/packages/storefront/dist/server/chunks/pages/{account_C66y6_Y9.mjs → account_MZBvNAyZ.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/pages/{index_EO1hhrt8.mjs → index_CV2ET14h.mjs} +24 -9
- package/packages/storefront/dist/server/chunks/pages/{node_hc25rqYt.mjs → node_1tKTIKG-.mjs} +145 -11
- package/packages/storefront/dist/server/chunks/pages/{~fallback_-K3esUV3.mjs → ~fallback_BVYzgZ5p.mjs} +2 -28
- package/packages/storefront/dist/server/chunks/{~fallback_DQ6yB81s.mjs → ~fallback_xH9bJF7E.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +469 -507
- package/packages/storefront/dist/server/manifest_S9lE9v48.mjs +206 -0
- package/packages/storefront/dist/server/middleware.mjs +4 -0
- package/packages/storefront/dist/server/renderers.mjs +39 -50
- package/packages/storefront/package.json +7 -7
- package/packages/storefront/src/decap-cms/get-cms-config.ts +0 -1
- package/packages/storefront/src/images/picture-base.ts +1 -1
- package/packages/storefront/src/lib/assets/decap-cms.css +13 -3
- package/packages/storefront/src/lib/components/Picture.astro +1 -1
- package/packages/storefront/src/lib/composables/use-product-shelf.ts +1 -1
- package/packages/storefront/tailwind.config.js +3 -0
- package/packages/storefront/uno.config.js +3 -0
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/tailwind.config.js +6 -0
- package/ecomplus-stores/barradoce/functions/ssr/uno.config.cjs +0 -5
- package/ecomplus-stores/barradoce/tailwind.config.cjs +0 -7
- package/packages/storefront/dist/client/_astro/AccountPage.Cq0jrJE5.js +0 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.DkX2BE1w.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.CZujn8cU.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.DhcSEQPV.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.D1uItqV5.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.DDNMc2oj.js +0 -7
- package/packages/storefront/dist/client/_astro/ProductShelf.BwRDTU-V.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.DgrtGsIu.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchShowcase.DggdcmcI.js +0 -1
- package/packages/storefront/dist/client/_astro/ShippingCalculator.B5JIh5xw.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.CIsQLhMR.js +0 -7
- package/packages/storefront/dist/client/_astro/_slug_.CnXAH2gj.css +0 -1
- package/packages/storefront/dist/client/_astro/client.mwowSQrH.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.BAjMMoBA.js +0 -7
- package/packages/storefront/dist/client/_astro/hoisted.B8Lw6O9a.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.D4m7OTKi.js +0 -8
- package/packages/storefront/dist/client/_astro/hoisted.DSAg3dYh.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.D_dlmSy5.js +0 -1
- package/packages/storefront/dist/client/_astro/index.BAyyMfaO.js +0 -1
- package/packages/storefront/dist/client/_astro/index.CTTHpJlV.js +0 -1
- package/packages/storefront/dist/client/_astro/modules-info.C6KJuGeB.js +0 -1
- package/packages/storefront/dist/client/_astro/name.CIPngEFN.js +0 -1
- package/packages/storefront/dist/client/_astro/server-data.CUHTES8a.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.xmJHVMAX.js +0 -13
- package/packages/storefront/dist/client/_astro/shopping-cart.DGvCZWRZ.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.BWhF_fCv.js +0 -1
- package/packages/storefront/dist/client/_astro/use-product-card.C-RbCwna.js +0 -1
- package/packages/storefront/dist/server/_noop-middleware.mjs +0 -3
- package/packages/storefront/dist/server/chunks/_.._CvgSOb3Z.mjs +0 -5
- package/packages/storefront/dist/server/manifest_bZVxjk3o.mjs +0 -201
- package/packages/storefront/tailwind.config.cjs +0 -3
- package/packages/storefront/uno.config.cjs +0 -3
- package/tailwind.config.cjs +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isRemotePath, joinPaths } from '@astrojs/internal-helpers/path';
|
|
2
|
-
import { A as AstroError$1, E as ExpectedImage, L as LocalImageUsedWrongly, M as MissingImageDimension, U as UnsupportedImageFormat, I as IncompatibleDescriptorOptions, a as UnsupportedImageConversion, b as MissingSharp } from '../
|
|
2
|
+
import { A as AstroError$1, E as ExpectedImage, L as LocalImageUsedWrongly, M as MissingImageDimension, U as UnsupportedImageFormat, I as IncompatibleDescriptorOptions, a as UnsupportedImageConversion, b as MissingSharp } from '../astro_8KdHu_Gf.mjs';
|
|
3
3
|
|
|
4
4
|
const InvalidImageService = {
|
|
5
5
|
name: "InvalidImageService",
|
|
@@ -148,6 +148,9 @@ function isESMImportedImage(src) {
|
|
|
148
148
|
function isRemoteImage(src) {
|
|
149
149
|
return typeof src === "string";
|
|
150
150
|
}
|
|
151
|
+
async function resolveSrc(src) {
|
|
152
|
+
return typeof src === "object" && "then" in src ? (await src).default ?? await src : src;
|
|
153
|
+
}
|
|
151
154
|
|
|
152
155
|
function matchPattern(url, remotePattern) {
|
|
153
156
|
return matchProtocol(url, remotePattern.protocol) && matchHostname(url, remotePattern.hostname, true) && matchPort(url, remotePattern.port) && matchPathname(url, remotePattern.pathname, true);
|
|
@@ -467,4 +470,4 @@ const sharp$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
467
470
|
default: sharp_default
|
|
468
471
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
469
472
|
|
|
470
|
-
export { AstroError as A, DEFAULT_HASH_PROPS as D, InvalidImageService as I, isESMImportedImage as a, isLocalService as b, isRemoteAllowed$1 as c, isRemoteImage as i, sharp$1 as s };
|
|
473
|
+
export { AstroError as A, DEFAULT_HASH_PROPS as D, InvalidImageService as I, isESMImportedImage as a, isLocalService as b, isRemoteAllowed$1 as c, isRemoteImage as i, resolveSrc as r, sharp$1 as s };
|
|
@@ -186,12 +186,23 @@ const MiddlewareNotAResponse = {
|
|
|
186
186
|
title: "The middleware returned something that is not a `Response` object.",
|
|
187
187
|
message: "Any data returned from middleware must be a valid `Response` object."
|
|
188
188
|
};
|
|
189
|
+
const EndpointDidNotReturnAResponse = {
|
|
190
|
+
name: "EndpointDidNotReturnAResponse",
|
|
191
|
+
title: "The endpoint did not return a `Response`.",
|
|
192
|
+
message: "An endpoint must return either a `Response`, or a `Promise` that resolves with a `Response`."
|
|
193
|
+
};
|
|
189
194
|
const LocalsNotAnObject = {
|
|
190
195
|
name: "LocalsNotAnObject",
|
|
191
196
|
title: "Value assigned to `locals` is not accepted.",
|
|
192
197
|
message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.",
|
|
193
198
|
hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`."
|
|
194
199
|
};
|
|
200
|
+
const AstroResponseHeadersReassigned = {
|
|
201
|
+
name: "AstroResponseHeadersReassigned",
|
|
202
|
+
title: "`Astro.response.headers` must not be reassigned.",
|
|
203
|
+
message: "Individual headers can be added to and removed from `Astro.response.headers`, but it must not be replaced with another instance of `Headers` altogether.",
|
|
204
|
+
hint: "Consider using `Astro.response.headers.add()`, and `Astro.response.headers.delete()`."
|
|
205
|
+
};
|
|
195
206
|
const LocalImageUsedWrongly = {
|
|
196
207
|
name: "LocalImageUsedWrongly",
|
|
197
208
|
title: "Local images must be imported.",
|
|
@@ -290,9 +301,10 @@ class AstroError extends Error {
|
|
|
290
301
|
}
|
|
291
302
|
}
|
|
292
303
|
|
|
293
|
-
const ASTRO_VERSION = "4.
|
|
304
|
+
const ASTRO_VERSION = "4.5.12";
|
|
294
305
|
const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
|
|
295
306
|
const ROUTE_TYPE_HEADER = "X-Astro-Route-Type";
|
|
307
|
+
const DEFAULT_404_COMPONENT = "astro-default-404";
|
|
296
308
|
const REROUTABLE_STATUS_CODES = [404, 500];
|
|
297
309
|
const clientAddressSymbol = Symbol.for("astro.clientAddress");
|
|
298
310
|
const clientLocalsSymbol = Symbol.for("astro.locals");
|
|
@@ -328,6 +340,9 @@ Found handlers: ${Object.keys(mod).map((exp) => JSON.stringify(exp)).join(", ")}
|
|
|
328
340
|
return new Response(null, { status: 500 });
|
|
329
341
|
}
|
|
330
342
|
const response = await handler.call(mod, context);
|
|
343
|
+
if (!response || response instanceof Response === false) {
|
|
344
|
+
throw new AstroError(EndpointDidNotReturnAResponse);
|
|
345
|
+
}
|
|
331
346
|
if (REROUTABLE_STATUS_CODES.includes(response.status)) {
|
|
332
347
|
response.headers.set(REROUTE_DIRECTIVE_HEADER, "no");
|
|
333
348
|
}
|
|
@@ -391,6 +406,8 @@ function createAstroGlobFn() {
|
|
|
391
406
|
}
|
|
392
407
|
function createAstro(site) {
|
|
393
408
|
return {
|
|
409
|
+
// TODO: this is no longer neccessary for `Astro.site`
|
|
410
|
+
// but it somehow allows working around caching issues in content collections for some tests
|
|
394
411
|
site: site ? new URL(site) : void 0,
|
|
395
412
|
generator: `Astro v${ASTRO_VERSION}`,
|
|
396
413
|
glob: createAstroGlobFn()
|
|
@@ -591,7 +608,8 @@ function serializeProps(props, metadata) {
|
|
|
591
608
|
|
|
592
609
|
const transitionDirectivesToCopyOnIsland = Object.freeze([
|
|
593
610
|
"data-astro-transition-scope",
|
|
594
|
-
"data-astro-transition-persist"
|
|
611
|
+
"data-astro-transition-persist",
|
|
612
|
+
"data-astro-transition-persist-props"
|
|
595
613
|
]);
|
|
596
614
|
function extractDirectives(inputProps, clientDirectives) {
|
|
597
615
|
let extracted = {
|
|
@@ -698,7 +716,7 @@ async function generateHydrateScript(scriptOptions, metadata) {
|
|
|
698
716
|
})
|
|
699
717
|
);
|
|
700
718
|
transitionDirectivesToCopyOnIsland.forEach((name) => {
|
|
701
|
-
if (props[name]) {
|
|
719
|
+
if (typeof props[name] !== "undefined") {
|
|
702
720
|
island.props[name] = props[name];
|
|
703
721
|
}
|
|
704
722
|
});
|
|
@@ -887,6 +905,9 @@ Make sure to use the static attribute syntax (\`${key}={value}\`) instead of the
|
|
|
887
905
|
if (key === "className") {
|
|
888
906
|
return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`);
|
|
889
907
|
}
|
|
908
|
+
if (typeof value === "string" && value.includes("&") && urlCanParse(value)) {
|
|
909
|
+
return markHTMLString(` ${key}="${toAttributeString(value, false)}"`);
|
|
910
|
+
}
|
|
890
911
|
if (value === true && (key.startsWith("data-") || htmlBooleanAttributes.test(key))) {
|
|
891
912
|
return markHTMLString(` ${key}`);
|
|
892
913
|
} else {
|
|
@@ -913,7 +934,7 @@ function renderElement$1(name, { props: _props, children = "" }, shouldEscape =
|
|
|
913
934
|
}
|
|
914
935
|
}
|
|
915
936
|
if ((children == null || children == "") && voidElementNames.test(name)) {
|
|
916
|
-
return `<${name}${internalSpreadAttributes(props, shouldEscape)}
|
|
937
|
+
return `<${name}${internalSpreadAttributes(props, shouldEscape)}>`;
|
|
917
938
|
}
|
|
918
939
|
return `<${name}${internalSpreadAttributes(props, shouldEscape)}>${children}</${name}>`;
|
|
919
940
|
}
|
|
@@ -948,6 +969,14 @@ function promiseWithResolvers() {
|
|
|
948
969
|
reject
|
|
949
970
|
};
|
|
950
971
|
}
|
|
972
|
+
function urlCanParse(url) {
|
|
973
|
+
try {
|
|
974
|
+
new URL(url);
|
|
975
|
+
return true;
|
|
976
|
+
} catch {
|
|
977
|
+
return false;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
951
980
|
|
|
952
981
|
const uniqueElements = (item, index, all) => {
|
|
953
982
|
const props = JSON.stringify(item.props);
|
|
@@ -972,8 +1001,8 @@ function renderAllHeadContent(result) {
|
|
|
972
1001
|
}
|
|
973
1002
|
return markHTMLString(content);
|
|
974
1003
|
}
|
|
975
|
-
function
|
|
976
|
-
|
|
1004
|
+
function maybeRenderHead() {
|
|
1005
|
+
return createRenderInstruction({ type: "maybe-head" });
|
|
977
1006
|
}
|
|
978
1007
|
|
|
979
1008
|
const slotString = Symbol.for("astro:slot-string");
|
|
@@ -1004,9 +1033,15 @@ async function renderSlotToString(result, slotted, fallback) {
|
|
|
1004
1033
|
let instructions = null;
|
|
1005
1034
|
const temporaryDestination = {
|
|
1006
1035
|
write(chunk) {
|
|
1007
|
-
if (chunk instanceof
|
|
1036
|
+
if (chunk instanceof SlotString) {
|
|
1037
|
+
content += chunk;
|
|
1038
|
+
if (chunk.instructions) {
|
|
1039
|
+
instructions ??= [];
|
|
1040
|
+
instructions.push(...chunk.instructions);
|
|
1041
|
+
}
|
|
1042
|
+
} else if (chunk instanceof Response)
|
|
1008
1043
|
return;
|
|
1009
|
-
if (typeof chunk === "object" && "type" in chunk && typeof chunk.type === "string") {
|
|
1044
|
+
else if (typeof chunk === "object" && "type" in chunk && typeof chunk.type === "string") {
|
|
1010
1045
|
if (instructions === null) {
|
|
1011
1046
|
instructions = [];
|
|
1012
1047
|
}
|
|
@@ -1350,6 +1385,9 @@ async function renderToReadableStream(result, componentFactory, props, children,
|
|
|
1350
1385
|
setTimeout(() => controller.error(e), 0);
|
|
1351
1386
|
}
|
|
1352
1387
|
})();
|
|
1388
|
+
},
|
|
1389
|
+
cancel() {
|
|
1390
|
+
result.cancelled = true;
|
|
1353
1391
|
}
|
|
1354
1392
|
});
|
|
1355
1393
|
}
|
|
@@ -1400,6 +1438,8 @@ async function renderToAsyncIterable(result, componentFactory, props, children,
|
|
|
1400
1438
|
const buffer = [];
|
|
1401
1439
|
const iterator = {
|
|
1402
1440
|
async next() {
|
|
1441
|
+
if (result.cancelled)
|
|
1442
|
+
return { done: true, value: void 0 };
|
|
1403
1443
|
await next.promise;
|
|
1404
1444
|
if (error) {
|
|
1405
1445
|
throw error;
|
|
@@ -1422,6 +1462,10 @@ async function renderToAsyncIterable(result, componentFactory, props, children,
|
|
|
1422
1462
|
value: mergedArray
|
|
1423
1463
|
};
|
|
1424
1464
|
return returnValue;
|
|
1465
|
+
},
|
|
1466
|
+
async return() {
|
|
1467
|
+
result.cancelled = true;
|
|
1468
|
+
return { done: true, value: void 0 };
|
|
1425
1469
|
}
|
|
1426
1470
|
};
|
|
1427
1471
|
const destination = {
|
|
@@ -1510,7 +1554,7 @@ function isHTMLComponent(Component) {
|
|
|
1510
1554
|
}
|
|
1511
1555
|
const ASTRO_SLOT_EXP = /<\/?astro-slot\b[^>]*>/g;
|
|
1512
1556
|
const ASTRO_STATIC_SLOT_EXP = /<\/?astro-static-slot\b[^>]*>/g;
|
|
1513
|
-
function removeStaticAstroSlot(html, supportsAstroStaticSlot) {
|
|
1557
|
+
function removeStaticAstroSlot(html, supportsAstroStaticSlot = true) {
|
|
1514
1558
|
const exp = supportsAstroStaticSlot ? ASTRO_STATIC_SLOT_EXP : ASTRO_SLOT_EXP;
|
|
1515
1559
|
return html.replace(exp, "");
|
|
1516
1560
|
}
|
|
@@ -1706,9 +1750,7 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr
|
|
|
1706
1750
|
destination.write(html);
|
|
1707
1751
|
} else if (html && html.length > 0) {
|
|
1708
1752
|
destination.write(
|
|
1709
|
-
markHTMLString(
|
|
1710
|
-
removeStaticAstroSlot(html, renderer?.ssr?.supportsAstroStaticSlot ?? false)
|
|
1711
|
-
)
|
|
1753
|
+
markHTMLString(removeStaticAstroSlot(html, renderer?.ssr?.supportsAstroStaticSlot))
|
|
1712
1754
|
);
|
|
1713
1755
|
}
|
|
1714
1756
|
}
|
|
@@ -1767,7 +1809,8 @@ ${serializeProps(
|
|
|
1767
1809
|
})
|
|
1768
1810
|
);
|
|
1769
1811
|
}
|
|
1770
|
-
|
|
1812
|
+
const renderedElement = renderElement$1("astro-island", island, false);
|
|
1813
|
+
destination.write(markHTMLString(renderedElement));
|
|
1771
1814
|
}
|
|
1772
1815
|
};
|
|
1773
1816
|
}
|
|
@@ -1807,19 +1850,27 @@ function renderAstroComponent(result, displayName, Component, props, slots = {})
|
|
|
1807
1850
|
}
|
|
1808
1851
|
async function renderComponent(result, displayName, Component, props, slots = {}) {
|
|
1809
1852
|
if (isPromise(Component)) {
|
|
1810
|
-
Component = await Component;
|
|
1853
|
+
Component = await Component.catch(handleCancellation);
|
|
1811
1854
|
}
|
|
1812
1855
|
if (isFragmentComponent(Component)) {
|
|
1813
|
-
return await renderFragmentComponent(result, slots);
|
|
1856
|
+
return await renderFragmentComponent(result, slots).catch(handleCancellation);
|
|
1814
1857
|
}
|
|
1815
1858
|
props = normalizeProps(props);
|
|
1816
1859
|
if (isHTMLComponent(Component)) {
|
|
1817
|
-
return await renderHTMLComponent(result, Component, props, slots);
|
|
1860
|
+
return await renderHTMLComponent(result, Component, props, slots).catch(handleCancellation);
|
|
1818
1861
|
}
|
|
1819
1862
|
if (isAstroComponentFactory(Component)) {
|
|
1820
1863
|
return renderAstroComponent(result, displayName, Component, props, slots);
|
|
1821
1864
|
}
|
|
1822
|
-
return await renderFrameworkComponent(result, displayName, Component, props, slots)
|
|
1865
|
+
return await renderFrameworkComponent(result, displayName, Component, props, slots).catch(
|
|
1866
|
+
handleCancellation
|
|
1867
|
+
);
|
|
1868
|
+
function handleCancellation(e) {
|
|
1869
|
+
if (result.cancelled)
|
|
1870
|
+
return { render() {
|
|
1871
|
+
} };
|
|
1872
|
+
throw e;
|
|
1873
|
+
}
|
|
1823
1874
|
}
|
|
1824
1875
|
function normalizeProps(props) {
|
|
1825
1876
|
if (props["class:list"] !== void 0) {
|
|
@@ -1836,17 +1887,15 @@ async function renderComponentToString(result, displayName, Component, props, sl
|
|
|
1836
1887
|
let str = "";
|
|
1837
1888
|
let renderedFirstPageChunk = false;
|
|
1838
1889
|
let head = "";
|
|
1839
|
-
if (nonAstroPageNeedsHeadInjection(Component)) {
|
|
1840
|
-
|
|
1841
|
-
head += chunkToString(result, headChunk);
|
|
1842
|
-
}
|
|
1890
|
+
if (isPage && !result.partial && nonAstroPageNeedsHeadInjection(Component)) {
|
|
1891
|
+
head += chunkToString(result, maybeRenderHead());
|
|
1843
1892
|
}
|
|
1844
1893
|
try {
|
|
1845
1894
|
const destination = {
|
|
1846
1895
|
write(chunk) {
|
|
1847
|
-
if (isPage && !renderedFirstPageChunk) {
|
|
1896
|
+
if (isPage && !result.partial && !renderedFirstPageChunk) {
|
|
1848
1897
|
renderedFirstPageChunk = true;
|
|
1849
|
-
if (
|
|
1898
|
+
if (!/<!doctype html/i.test(String(chunk))) {
|
|
1850
1899
|
const doctype = result.compressHTML ? "<!DOCTYPE html>" : "<!DOCTYPE html>\n";
|
|
1851
1900
|
str += doctype + head;
|
|
1852
1901
|
}
|
|
@@ -1873,25 +1922,7 @@ function nonAstroPageNeedsHeadInjection(pageComponent) {
|
|
|
1873
1922
|
}
|
|
1874
1923
|
|
|
1875
1924
|
const ClientOnlyPlaceholder = "astro-client-only";
|
|
1876
|
-
|
|
1877
|
-
constructor(vnode) {
|
|
1878
|
-
this.vnode = vnode;
|
|
1879
|
-
this.count = 0;
|
|
1880
|
-
}
|
|
1881
|
-
count;
|
|
1882
|
-
increment() {
|
|
1883
|
-
this.count++;
|
|
1884
|
-
}
|
|
1885
|
-
haveNoTried() {
|
|
1886
|
-
return this.count === 0;
|
|
1887
|
-
}
|
|
1888
|
-
isCompleted() {
|
|
1889
|
-
return this.count > 2;
|
|
1890
|
-
}
|
|
1891
|
-
static symbol = Symbol("astro:jsx:skip");
|
|
1892
|
-
}
|
|
1893
|
-
let originalConsoleError;
|
|
1894
|
-
let consoleFilterRefs = 0;
|
|
1925
|
+
const hasTriedRenderComponentSymbol = Symbol("hasTriedRenderComponent");
|
|
1895
1926
|
async function renderJSX(result, vnode) {
|
|
1896
1927
|
switch (true) {
|
|
1897
1928
|
case vnode instanceof HTMLString:
|
|
@@ -1910,19 +1941,9 @@ async function renderJSX(result, vnode) {
|
|
|
1910
1941
|
(await Promise.all(vnode.map((v) => renderJSX(result, v)))).join("")
|
|
1911
1942
|
);
|
|
1912
1943
|
}
|
|
1913
|
-
|
|
1914
|
-
if (vnode.props) {
|
|
1915
|
-
if (vnode.props[Skip.symbol]) {
|
|
1916
|
-
skip = vnode.props[Skip.symbol];
|
|
1917
|
-
} else {
|
|
1918
|
-
skip = new Skip(vnode);
|
|
1919
|
-
}
|
|
1920
|
-
} else {
|
|
1921
|
-
skip = new Skip(vnode);
|
|
1922
|
-
}
|
|
1923
|
-
return renderJSXVNode(result, vnode, skip);
|
|
1944
|
+
return renderJSXVNode(result, vnode);
|
|
1924
1945
|
}
|
|
1925
|
-
async function renderJSXVNode(result, vnode
|
|
1946
|
+
async function renderJSXVNode(result, vnode) {
|
|
1926
1947
|
if (isVNode(vnode)) {
|
|
1927
1948
|
switch (true) {
|
|
1928
1949
|
case !vnode.type: {
|
|
@@ -1969,36 +1990,20 @@ Did you forget to import the component or is it possible there is a typo?`);
|
|
|
1969
1990
|
}
|
|
1970
1991
|
_slots.default.push(child);
|
|
1971
1992
|
};
|
|
1972
|
-
if (typeof vnode.type === "function" && vnode.type["astro:renderer"]) {
|
|
1973
|
-
skip.increment();
|
|
1974
|
-
}
|
|
1975
1993
|
if (typeof vnode.type === "function" && vnode.props["server:root"]) {
|
|
1976
1994
|
const output2 = await vnode.type(vnode.props ?? {});
|
|
1977
1995
|
return await renderJSX(result, output2);
|
|
1978
1996
|
}
|
|
1979
1997
|
if (typeof vnode.type === "function") {
|
|
1980
|
-
if (
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
renderResult = await renderJSXVNode(result, output2, skip);
|
|
1987
|
-
return renderResult;
|
|
1988
|
-
} else if (!output2) {
|
|
1989
|
-
renderResult = await renderJSXVNode(result, output2, skip);
|
|
1990
|
-
return renderResult;
|
|
1991
|
-
}
|
|
1992
|
-
} catch (e) {
|
|
1993
|
-
if (skip.isCompleted()) {
|
|
1994
|
-
throw e;
|
|
1995
|
-
}
|
|
1996
|
-
skip.increment();
|
|
1997
|
-
} finally {
|
|
1998
|
-
finishUsingConsoleFilter();
|
|
1998
|
+
if (vnode.props[hasTriedRenderComponentSymbol]) {
|
|
1999
|
+
const output2 = await vnode.type(vnode.props ?? {});
|
|
2000
|
+
if (output2?.[AstroJSX] || !output2) {
|
|
2001
|
+
return await renderJSXVNode(result, output2);
|
|
2002
|
+
} else {
|
|
2003
|
+
return;
|
|
1999
2004
|
}
|
|
2000
2005
|
} else {
|
|
2001
|
-
|
|
2006
|
+
vnode.props[hasTriedRenderComponentSymbol] = true;
|
|
2002
2007
|
}
|
|
2003
2008
|
}
|
|
2004
2009
|
const { children = null, ...props } = vnode.props ?? {};
|
|
@@ -2024,7 +2029,6 @@ Did you forget to import the component or is it possible there is a typo?`);
|
|
|
2024
2029
|
);
|
|
2025
2030
|
}
|
|
2026
2031
|
await Promise.all(slotPromises);
|
|
2027
|
-
props[Skip.symbol] = skip;
|
|
2028
2032
|
let output;
|
|
2029
2033
|
if (vnode.type === ClientOnlyPlaceholder && vnode.props["client:only"]) {
|
|
2030
2034
|
output = await renderComponentToString(
|
|
@@ -2062,27 +2066,6 @@ function prerenderElementChildren(tag, children) {
|
|
|
2062
2066
|
return children;
|
|
2063
2067
|
}
|
|
2064
2068
|
}
|
|
2065
|
-
function useConsoleFilter() {
|
|
2066
|
-
consoleFilterRefs++;
|
|
2067
|
-
if (!originalConsoleError) {
|
|
2068
|
-
originalConsoleError = console.error;
|
|
2069
|
-
try {
|
|
2070
|
-
console.error = filteredConsoleError;
|
|
2071
|
-
} catch (error) {
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
function finishUsingConsoleFilter() {
|
|
2076
|
-
consoleFilterRefs--;
|
|
2077
|
-
}
|
|
2078
|
-
function filteredConsoleError(msg, ...rest) {
|
|
2079
|
-
if (consoleFilterRefs > 0 && typeof msg === "string") {
|
|
2080
|
-
const isKnownReactHookError = msg.includes("Warning: Invalid hook call.") && msg.includes("https://reactjs.org/link/invalid-hook-call");
|
|
2081
|
-
if (isKnownReactHookError)
|
|
2082
|
-
return;
|
|
2083
|
-
}
|
|
2084
|
-
originalConsoleError(msg, ...rest);
|
|
2085
|
-
}
|
|
2086
2069
|
|
|
2087
2070
|
async function renderPage(result, componentFactory, props, children, streaming, route) {
|
|
2088
2071
|
if (!isAstroComponentFactory(componentFactory)) {
|
|
@@ -2139,19 +2122,6 @@ async function renderPage(result, componentFactory, props, children, streaming,
|
|
|
2139
2122
|
return response;
|
|
2140
2123
|
}
|
|
2141
2124
|
|
|
2142
|
-
const transitionNameMap = /* @__PURE__ */ new WeakMap();
|
|
2143
|
-
function incrementTransitionNumber(result) {
|
|
2144
|
-
let num = 1;
|
|
2145
|
-
if (transitionNameMap.has(result)) {
|
|
2146
|
-
num = transitionNameMap.get(result) + 1;
|
|
2147
|
-
}
|
|
2148
|
-
transitionNameMap.set(result, num);
|
|
2149
|
-
return num;
|
|
2150
|
-
}
|
|
2151
|
-
function createTransitionScope(result, hash) {
|
|
2152
|
-
const num = incrementTransitionNumber(result);
|
|
2153
|
-
return `astro-${hash}-${num}`;
|
|
2154
|
-
}
|
|
2155
2125
|
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_".split("").reduce((v, c) => (v[c.charCodeAt(0)] = c, v), []);
|
|
2156
2126
|
"-0123456789_".split("").reduce((v, c) => (v[c.charCodeAt(0)] = c, v), []);
|
|
2157
2127
|
|
|
@@ -2172,4 +2142,4 @@ function spreadAttributes(values = {}, _name, { class: scopedClassName } = {}) {
|
|
|
2172
2142
|
return markHTMLString(output);
|
|
2173
2143
|
}
|
|
2174
2144
|
|
|
2175
|
-
export { AstroError as A, ReservedSlotName as B, renderJSX as C,
|
|
2145
|
+
export { AstroError as A, ReservedSlotName as B, renderJSX as C, DEFAULT_404_COMPONENT as D, ExpectedImage as E, FailedToFetchRemoteImageDimensions as F, GetStaticPathsRequired as G, chunkToString as H, IncompatibleDescriptorOptions as I, LocalsNotAnObject as J, clientLocalsSymbol as K, LocalImageUsedWrongly as L, MissingImageDimension as M, NoMatchingStaticPathFound as N, clientAddressSymbol as O, PageNumberParamNotFound as P, ClientAddressNotAvailable as Q, ResponseSentError as R, StaticClientAddressNotAvailable as S, ASTRO_VERSION as T, UnsupportedImageFormat as U, responseSentSymbol as V, AstroResponseHeadersReassigned as W, renderPage as X, renderEndpoint as Y, REROUTABLE_STATUS_CODES as Z, UnsupportedImageConversion as a, MissingSharp as b, ExpectedImageOptions as c, InvalidImageService as d, createAstro as e, createComponent as f, ImageMissingAlt as g, addAttribute as h, renderSlotToString as i, renderAllHeadContent as j, renderSlot as k, renderComponent as l, maybeRenderHead as m, Fragment as n, MiddlewareNoDataOrNextCalled as o, MiddlewareNotAResponse as p, ROUTE_TYPE_HEADER as q, renderTemplate as r, spreadAttributes as s, REROUTE_DIRECTIVE_HEADER as t, unescapeHTML as u, InvalidGetStaticPathsReturn as v, InvalidGetStaticPathsEntry as w, GetStaticPathsExpectedParams as x, GetStaticPathsInvalidRouteParam as y, PrerenderDynamicEndpointPathCollide as z };
|