cloudcommerce 0.4.0 → 0.5.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/.github/renovate.json +1 -1
- package/CHANGELOG.md +42 -0
- package/action.yml +1 -2
- package/package.json +10 -10
- package/packages/api/package.json +1 -1
- 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 +1 -1
- package/packages/apps/fb-conversions/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/infinitepay/lib/ip-create-transaction.js +1 -1
- package/packages/apps/infinitepay/lib/ip-create-transaction.js.map +1 -1
- package/packages/apps/infinitepay/package.json +3 -3
- package/packages/apps/infinitepay/src/ip-create-transaction.ts +1 -1
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +3 -3
- package/packages/apps/mercadopago/package.json +3 -3
- package/packages/apps/pagarme/package.json +4 -4
- 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/CHANGELOG.md +1 -0
- package/packages/apps/webhooks/README.md +1 -0
- package/packages/apps/webhooks/lib/app-webhooks.js +9 -0
- package/packages/apps/webhooks/lib/app-webhooks.js.map +1 -0
- package/packages/apps/webhooks/lib/events-to-webhooks-app.js +127 -0
- package/packages/apps/webhooks/lib/events-to-webhooks-app.js.map +1 -0
- package/packages/apps/webhooks/lib/index.js +2 -0
- package/packages/apps/webhooks/lib/index.js.map +1 -0
- package/packages/apps/webhooks/package.json +32 -0
- package/packages/apps/webhooks/src/app-webhooks.ts +14 -0
- package/packages/apps/webhooks/src/events-to-webhooks-app.ts +178 -0
- package/packages/apps/webhooks/src/index.ts +1 -0
- package/packages/apps/webhooks/tsconfig.json +3 -0
- package/packages/cli/lib/setup-gcloud.js +120 -20
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +1 -1
- package/packages/cli/src/setup-gcloud.ts +146 -21
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/emails/tests/assets/order.json +1 -1
- package/packages/events/lib/firebase.js +2 -0
- package/packages/events/lib/firebase.js.map +1 -1
- package/packages/events/package.json +3 -2
- package/packages/events/src/firebase.ts +2 -0
- package/packages/firebase/lib/config.d.ts +4 -0
- package/packages/firebase/lib/config.js +10 -1
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/lib/handlers/check-store-events.js +13 -4
- package/packages/firebase/lib/handlers/check-store-events.js.map +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/firebase/src/config.ts +10 -7
- package/packages/firebase/src/handlers/check-store-events.ts +14 -4
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/checkout.js +7 -4
- package/packages/modules/lib/firebase/checkout.js.map +1 -1
- package/packages/modules/package.json +3 -3
- package/packages/modules/schemas/@checkout.cjs +0 -5
- package/packages/modules/schemas/create_transaction.cjs +6 -1
- package/packages/modules/src/firebase/checkout.ts +7 -4
- package/packages/passport/package.json +2 -2
- package/packages/ssr/package.json +7 -7
- package/packages/storefront/config/storefront.cms.cjs +31 -5
- package/packages/storefront/config/storefront.cms.mjs +31 -5
- package/packages/storefront/dist/client/_astro/PitchBar.df2672ff.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.99fa99bf.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductCard.a322c854.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.abd6dec6.js +1 -0
- package/packages/storefront/dist/client/_astro/_...slug_.648728f3.css +1 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.e6f0b936.js +1 -0
- package/packages/storefront/dist/client/_astro/client.e6b58b55.js +1 -0
- package/packages/storefront/dist/client/_astro/index.5dd878ac.js +1 -0
- package/packages/storefront/dist/client/_astro/modules-info.e8935203.js +1 -0
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.e8b26f2c.js +1 -0
- package/packages/storefront/dist/client/fallback/index.html +12 -11
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{astro.89bd9221.mjs → astro.7d9d5f6e.mjs} +957 -850
- package/packages/storefront/dist/server/chunks/pages/{all.6379e666.mjs → all.ba8f4b85.mjs} +771 -627
- package/packages/storefront/dist/server/chunks/{prerender.a1ec39e0.mjs → prerender.8cd4ad42.mjs} +0 -0
- package/packages/storefront/dist/server/entry.mjs +113 -53
- package/packages/storefront/package.json +16 -16
- package/packages/storefront/src/lib/assets/base.css +6 -0
- package/packages/storefront/src/lib/cms.d.ts +25 -0
- package/packages/storefront/src/lib/components/Drawer.vue +10 -1
- package/packages/storefront/src/lib/composables/use-shop-header.ts +79 -0
- package/packages/storefront/src/lib/layouts/Base.astro +4 -5
- package/packages/storefront/src/lib/layouts/BaseBody.astro +3 -2
- package/packages/storefront/src/lib/layouts/BaseHead.astro +7 -7
- package/packages/storefront/src/lib/layouts/PagesHeader.astro +5 -23
- package/packages/storefront/src/lib/ssr-context.ts +3 -4
- package/packages/storefront/src/lib/state/modules-info.ts +1 -1
- package/packages/storefront/tailwind.config.cjs +0 -4
- package/packages/types/index.ts +8 -0
- package/packages/types/modules/@checkout:params.d.ts +1 -5
- package/packages/types/modules/apply_discount:params.d.ts +1 -1
- package/packages/types/modules/apply_discount:response.d.ts +1 -1
- package/packages/types/modules/calculate_shipping:params.d.ts +1 -1
- package/packages/types/modules/calculate_shipping:response.d.ts +1 -1
- package/packages/types/modules/create_transaction:params.d.ts +6 -2
- package/packages/types/modules/create_transaction:response.d.ts +1 -1
- package/packages/types/modules/list_payments:params.d.ts +1 -1
- package/packages/types/modules/list_payments:response.d.ts +1 -1
- package/packages/types/package.json +1 -1
- package/pnpm-workspace.yaml +3 -3
- package/packages/storefront/dist/client/_astro/PitchBar.103168e6.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.b75d44d6.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.054033ef.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductCard.9138ec25.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.65213f83.js +0 -1
- package/packages/storefront/dist/client/_astro/_...slug_.39c46f54.css +0 -1
- package/packages/storefront/dist/client/_astro/client.eba0daa7.js +0 -1
- package/packages/storefront/dist/client/_astro/index.7577af70.js +0 -1
- package/packages/storefront/dist/client/_astro/modules-info.0c999f60.js +0 -1
- package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.4da3640b.js +0 -1
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.0869e112.js +0 -1
- package/packages/storefront/src/lib/components/ShopHeader.vue +0 -110
- package/packages/storefront/src/lib/components/ShopSidenav.vue +0 -26
- package/packages/storefront/src/lib/types/cms-code.d.ts +0 -5
- package/packages/storefront/src/lib/types/cms-contacts.d.ts +0 -5
- package/packages/storefront/src/lib/types/cms-header.d.ts +0 -5
- package/packages/storefront/src/lib/types/cms-settings.d.ts +0 -8
- package/packages/storefront/src/lib/types/cms-social.d.ts +0 -5
|
@@ -52,9 +52,11 @@ function deserializeManifest(serializedManifest) {
|
|
|
52
52
|
route.routeData = deserializeRouteData(serializedRoute.routeData);
|
|
53
53
|
}
|
|
54
54
|
const assets = new Set(serializedManifest.assets);
|
|
55
|
+
const propagation = new Map(serializedManifest.propagation);
|
|
55
56
|
return {
|
|
56
57
|
...serializedManifest,
|
|
57
58
|
assets,
|
|
59
|
+
propagation,
|
|
58
60
|
routes
|
|
59
61
|
};
|
|
60
62
|
}
|
|
@@ -235,748 +237,924 @@ function* getSetCookiesFromResponse(response) {
|
|
|
235
237
|
}
|
|
236
238
|
}
|
|
237
239
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (mod["all"]) {
|
|
284
|
-
return mod["all"];
|
|
285
|
-
}
|
|
286
|
-
return void 0;
|
|
287
|
-
}
|
|
288
|
-
async function renderEndpoint(mod, context, ssr) {
|
|
289
|
-
var _a;
|
|
290
|
-
const { request, params } = context;
|
|
291
|
-
const chosenMethod = (_a = request.method) == null ? void 0 : _a.toLowerCase();
|
|
292
|
-
const handler = getHandlerFromModule(mod, chosenMethod);
|
|
293
|
-
if (!ssr && ssr === false && chosenMethod && chosenMethod !== "get") {
|
|
294
|
-
console.warn(`
|
|
295
|
-
${chosenMethod} requests are not available when building a static site. Update your config to output: 'server' to handle ${chosenMethod} requests.`);
|
|
296
|
-
}
|
|
297
|
-
if (!handler || typeof handler !== "function") {
|
|
298
|
-
let response = new Response(null, {
|
|
299
|
-
status: 404,
|
|
300
|
-
headers: {
|
|
301
|
-
"X-Astro-Response": "Not-Found"
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
return response;
|
|
305
|
-
}
|
|
306
|
-
if (handler.length > 1) {
|
|
307
|
-
console.warn(`
|
|
308
|
-
API routes with 2 arguments have been deprecated. Instead they take a single argument in the form of:
|
|
309
|
-
|
|
310
|
-
export function get({ params, request }) {
|
|
311
|
-
//...
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
Update your code to remove this warning.`);
|
|
315
|
-
}
|
|
316
|
-
const proxy = new Proxy(context, {
|
|
317
|
-
get(target, prop) {
|
|
318
|
-
if (prop in target) {
|
|
319
|
-
return Reflect.get(target, prop);
|
|
320
|
-
} else if (prop in params) {
|
|
321
|
-
console.warn(`
|
|
322
|
-
API routes no longer pass params as the first argument. Instead an object containing a params property is provided in the form of:
|
|
323
|
-
|
|
324
|
-
export function get({ params }) {
|
|
325
|
-
// ...
|
|
326
|
-
}
|
|
240
|
+
const defineErrors = (errs) => errs;
|
|
241
|
+
const AstroErrorData = defineErrors({
|
|
242
|
+
UnknownCompilerError: {
|
|
243
|
+
title: "Unknown compiler error.",
|
|
244
|
+
code: 1e3,
|
|
245
|
+
hint: "This is almost always a problem with the Astro compiler, not your code. Please open an issue at https://astro.build/issues/compiler."
|
|
246
|
+
},
|
|
247
|
+
StaticRedirectNotAvailable: {
|
|
248
|
+
title: "`Astro.redirect` is not available in static mode.",
|
|
249
|
+
code: 3001,
|
|
250
|
+
message: "Redirects are only available when using `output: 'server'`. Update your Astro config if you need SSR features.",
|
|
251
|
+
hint: "See https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project for more information on how to enable SSR."
|
|
252
|
+
},
|
|
253
|
+
ClientAddressNotAvailable: {
|
|
254
|
+
title: "`Astro.clientAddress` is not available in current adapter.",
|
|
255
|
+
code: 3002,
|
|
256
|
+
message: (adapterName) => `\`Astro.clientAddress\` is not available in the \`${adapterName}\` adapter. File an issue with the adapter to add support.`
|
|
257
|
+
},
|
|
258
|
+
StaticClientAddressNotAvailable: {
|
|
259
|
+
title: "`Astro.clientAddress` is not available in static mode.",
|
|
260
|
+
code: 3003,
|
|
261
|
+
message: "`Astro.clientAddress` is only available when using `output: 'server'`. Update your Astro config if you need SSR features.",
|
|
262
|
+
hint: "See https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project for more information on how to enable SSR."
|
|
263
|
+
},
|
|
264
|
+
NoMatchingStaticPathFound: {
|
|
265
|
+
title: "No static path found for requested path.",
|
|
266
|
+
code: 3004,
|
|
267
|
+
message: (pathName) => `A \`getStaticPaths()\` route pattern was matched, but no matching static path was found for requested path \`${pathName}\`.`,
|
|
268
|
+
hint: (possibleRoutes) => `Possible dynamic routes being matched: ${possibleRoutes.join(", ")}.`
|
|
269
|
+
},
|
|
270
|
+
OnlyResponseCanBeReturned: {
|
|
271
|
+
title: "Invalid type returned by Astro page.",
|
|
272
|
+
code: 3005,
|
|
273
|
+
message: (route, returnedValue) => `Route \`${route ? route : ""}\` returned a \`${returnedValue}\`. Only a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from Astro files.`,
|
|
274
|
+
hint: "See https://docs.astro.build/en/guides/server-side-rendering/#response for more information."
|
|
275
|
+
},
|
|
276
|
+
MissingMediaQueryDirective: {
|
|
277
|
+
title: "Missing value for `client:media` directive.",
|
|
278
|
+
code: 3006,
|
|
279
|
+
message: 'Media query not provided for `client:media` directive. A media query similar to `client:media="(max-width: 600px)"` must be provided'
|
|
280
|
+
},
|
|
281
|
+
NoMatchingRenderer: {
|
|
282
|
+
title: "No matching renderer found.",
|
|
283
|
+
code: 3007,
|
|
284
|
+
message: (componentName, componentExtension, plural, validRenderersCount) => `Unable to render \`${componentName}\`.
|
|
327
285
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return void 0;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
return handler.call(mod, proxy, request);
|
|
336
|
-
}
|
|
286
|
+
${validRenderersCount > 0 ? `There ${plural ? "are." : "is."} ${validRenderersCount} renderer${plural ? "s." : ""} configured in your \`astro.config.mjs\` file,
|
|
287
|
+
but ${plural ? "none were." : "it was not."} able to server-side render \`${componentName}\`.` : `No valid renderer was found ${componentExtension ? `for the \`.${componentExtension}\` file extension.` : `for this file extension.`}`}`,
|
|
288
|
+
hint: (probableRenderers) => `Did you mean to enable the ${probableRenderers} integration?
|
|
337
289
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
290
|
+
See https://docs.astro.build/en/core-concepts/framework-components/ for more information on how to install and configure integrations.`
|
|
291
|
+
},
|
|
292
|
+
NoClientEntrypoint: {
|
|
293
|
+
title: "No client entrypoint specified in renderer.",
|
|
294
|
+
code: 3008,
|
|
295
|
+
message: (componentName, clientDirective, rendererName) => `\`${componentName}\` component has a \`client:${clientDirective}\` directive, but no client entrypoint was provided by \`${rendererName}\`.`,
|
|
296
|
+
hint: "See https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option for more information on how to configure your renderer."
|
|
297
|
+
},
|
|
298
|
+
NoClientOnlyHint: {
|
|
299
|
+
title: "Missing hint on client:only directive.",
|
|
300
|
+
code: 3009,
|
|
301
|
+
message: (componentName) => `Unable to render \`${componentName}\`. When using the \`client:only\` hydration strategy, Astro needs a hint to use the correct renderer.`,
|
|
302
|
+
hint: (probableRenderers) => `Did you mean to pass \`client:only="${probableRenderers}"\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on client:only`
|
|
303
|
+
},
|
|
304
|
+
InvalidGetStaticPathParam: {
|
|
305
|
+
title: "Invalid value returned by a `getStaticPaths` path.",
|
|
306
|
+
code: 3010,
|
|
307
|
+
message: (paramType) => `Invalid params given to \`getStaticPaths\` path. Expected an \`object\`, got \`${paramType}\``,
|
|
308
|
+
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
309
|
+
},
|
|
310
|
+
InvalidGetStaticPathsReturn: {
|
|
311
|
+
title: "Invalid value returned by getStaticPaths.",
|
|
312
|
+
code: 3011,
|
|
313
|
+
message: (returnType) => `Invalid type returned by \`getStaticPaths\`. Expected an \`array\`, got \`${returnType}\``,
|
|
314
|
+
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
315
|
+
},
|
|
316
|
+
GetStaticPathsRemovedRSSHelper: {
|
|
317
|
+
title: "getStaticPaths RSS helper is not available anymore.",
|
|
318
|
+
code: 3012,
|
|
319
|
+
message: "The RSS helper has been removed from `getStaticPaths`. Try the new @astrojs/rss package instead.",
|
|
320
|
+
hint: "See https://docs.astro.build/en/guides/rss/ for more information."
|
|
321
|
+
},
|
|
322
|
+
GetStaticPathsExpectedParams: {
|
|
323
|
+
title: "Missing params property on `getStaticPaths` route.",
|
|
324
|
+
code: 3013,
|
|
325
|
+
message: "Missing or empty required `params` property on `getStaticPaths` route.",
|
|
326
|
+
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
327
|
+
},
|
|
328
|
+
GetStaticPathsInvalidRouteParam: {
|
|
329
|
+
title: "Invalid value for `getStaticPaths` route parameter.",
|
|
330
|
+
code: 3014,
|
|
331
|
+
message: (key, value, valueType) => `Invalid getStaticPaths route parameter for \`${key}\`. Expected undefined, a string or a number, received \`${valueType}\` (\`${value}\`)`,
|
|
332
|
+
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
333
|
+
},
|
|
334
|
+
GetStaticPathsRequired: {
|
|
335
|
+
title: "`getStaticPaths()` function required for dynamic routes.",
|
|
336
|
+
code: 3015,
|
|
337
|
+
message: "`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.",
|
|
338
|
+
hint: `See https://docs.astro.build/en/core-concepts/routing/#dynamic-routes for more information on dynamic routes.
|
|
376
339
|
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
340
|
+
Alternatively, set \`output: "server"\` in your Astro config file to switch to a non-static server build. This error can also occur if using \`export const prerender = true;\`.
|
|
341
|
+
See https://docs.astro.build/en/guides/server-side-rendering/ for more information on non-static rendering.`
|
|
342
|
+
},
|
|
343
|
+
ReservedSlotName: {
|
|
344
|
+
title: "Invalid slot name.",
|
|
345
|
+
code: 3016,
|
|
346
|
+
message: (slotName) => `Unable to create a slot named \`${slotName}\`. \`${slotName}\` is a reserved slot name. Please update the name of this slot.`
|
|
347
|
+
},
|
|
348
|
+
NoAdapterInstalled: {
|
|
349
|
+
title: "Cannot use Server-side Rendering without an adapter.",
|
|
350
|
+
code: 3017,
|
|
351
|
+
message: `Cannot use \`output: 'server'\` without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
|
|
352
|
+
hint: "See https://docs.astro.build/en/guides/server-side-rendering/ for more information."
|
|
353
|
+
},
|
|
354
|
+
NoMatchingImport: {
|
|
355
|
+
title: "No import found for component.",
|
|
356
|
+
code: 3018,
|
|
357
|
+
message: (componentName) => `Could not render \`${componentName}\`. No matching import has been found for \`${componentName}\`.`,
|
|
358
|
+
hint: "Please make sure the component is properly imported."
|
|
359
|
+
},
|
|
360
|
+
InvalidPrerenderExport: {
|
|
361
|
+
title: "Invalid prerender export.",
|
|
362
|
+
code: 3019,
|
|
363
|
+
message: (prefix, suffix) => {
|
|
364
|
+
let msg = `A \`prerender\` export has been detected, but its value cannot be statically analyzed.`;
|
|
365
|
+
if (prefix !== "const")
|
|
366
|
+
msg += `
|
|
367
|
+
Expected \`const\` declaration but got \`${prefix}\`.`;
|
|
368
|
+
if (suffix !== "true")
|
|
369
|
+
msg += `
|
|
370
|
+
Expected \`true\` value but got \`${suffix}\`.`;
|
|
371
|
+
return msg;
|
|
372
|
+
},
|
|
373
|
+
hint: "Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`."
|
|
374
|
+
},
|
|
375
|
+
InvalidComponentArgs: {
|
|
376
|
+
title: "Invalid component arguments.",
|
|
377
|
+
code: 3020,
|
|
378
|
+
message: (name) => `Invalid arguments passed to${name ? ` <${name}>` : ""} component.`,
|
|
379
|
+
hint: "Astro components cannot be rendered directly via function call, such as `Component()` or `{items.map(Component)}`."
|
|
380
|
+
},
|
|
381
|
+
PageNumberParamNotFound: {
|
|
382
|
+
title: "Page number param not found.",
|
|
383
|
+
code: 3021,
|
|
384
|
+
message: (paramName) => `[paginate()] page number param \`${paramName}\` not found in your filepath.`,
|
|
385
|
+
hint: "Rename your file to `[page].astro` or `[...page].astro`."
|
|
386
|
+
},
|
|
387
|
+
UnknownViteError: {
|
|
388
|
+
title: "Unknown Vite Error.",
|
|
389
|
+
code: 4e3
|
|
390
|
+
},
|
|
391
|
+
FailedToLoadModuleSSR: {
|
|
392
|
+
title: "Could not import file.",
|
|
393
|
+
code: 4001,
|
|
394
|
+
message: (importName) => `Could not import \`${importName}\`.`,
|
|
395
|
+
hint: "This is often caused by a typo in the import path. Please make sure the file exists."
|
|
396
|
+
},
|
|
397
|
+
InvalidGlob: {
|
|
398
|
+
title: "Invalid glob pattern.",
|
|
399
|
+
code: 4002,
|
|
400
|
+
message: (globPattern) => `Invalid glob pattern: \`${globPattern}\`. Glob patterns must start with './', '../' or '/'.`,
|
|
401
|
+
hint: "See https://docs.astro.build/en/guides/imports/#glob-patterns for more information on supported glob patterns."
|
|
402
|
+
},
|
|
403
|
+
UnknownCSSError: {
|
|
404
|
+
title: "Unknown CSS Error.",
|
|
405
|
+
code: 5e3
|
|
406
|
+
},
|
|
407
|
+
CSSSyntaxError: {
|
|
408
|
+
title: "CSS Syntax Error.",
|
|
409
|
+
code: 5001
|
|
410
|
+
},
|
|
411
|
+
UnknownMarkdownError: {
|
|
412
|
+
title: "Unknown Markdown Error.",
|
|
413
|
+
code: 6e3
|
|
414
|
+
},
|
|
415
|
+
MarkdownFrontmatterParseError: {
|
|
416
|
+
title: "Failed to parse Markdown frontmatter.",
|
|
417
|
+
code: 6001
|
|
418
|
+
},
|
|
419
|
+
InvalidFrontmatterInjectionError: {
|
|
420
|
+
title: "Invalid frontmatter injection.",
|
|
421
|
+
code: 6003,
|
|
422
|
+
message: 'A remark or rehype plugin attempted to inject invalid frontmatter. Ensure "astro.frontmatter" is set to a valid JSON object that is not `null` or `undefined`.',
|
|
423
|
+
hint: "See the frontmatter injection docs https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically for more information."
|
|
424
|
+
},
|
|
425
|
+
MdxIntegrationMissingError: {
|
|
426
|
+
title: "MDX integration missing.",
|
|
427
|
+
code: 6004,
|
|
428
|
+
message: (file) => `Unable to render ${file}. Ensure that the \`@astrojs/mdx\` integration is installed.`,
|
|
429
|
+
hint: "See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/"
|
|
430
|
+
},
|
|
431
|
+
UnknownConfigError: {
|
|
432
|
+
title: "Unknown configuration error.",
|
|
433
|
+
code: 7e3
|
|
434
|
+
},
|
|
435
|
+
ConfigNotFound: {
|
|
436
|
+
title: "Specified configuration file not found.",
|
|
437
|
+
code: 7001,
|
|
438
|
+
message: (configFile) => `Unable to resolve \`--config "${configFile}"\`. Does the file exist?`
|
|
439
|
+
},
|
|
440
|
+
ConfigLegacyKey: {
|
|
441
|
+
title: "Legacy configuration detected.",
|
|
442
|
+
code: 7002,
|
|
443
|
+
message: (legacyConfigKey) => `Legacy configuration detected: \`${legacyConfigKey}\`.`,
|
|
444
|
+
hint: "Please update your configuration to the new format.\nSee https://astro.build/config for more information."
|
|
445
|
+
},
|
|
446
|
+
UnknownCLIError: {
|
|
447
|
+
title: "Unknown CLI Error.",
|
|
448
|
+
code: 8e3
|
|
449
|
+
},
|
|
450
|
+
GenerateContentTypesError: {
|
|
451
|
+
title: "Failed to generate content types.",
|
|
452
|
+
code: 8001,
|
|
453
|
+
message: "`astro sync` command failed to generate content collection types.",
|
|
454
|
+
hint: "Check your `src/content/config.*` file for typos."
|
|
455
|
+
},
|
|
456
|
+
UnknownContentCollectionError: {
|
|
457
|
+
title: "Unknown Content Collection Error.",
|
|
458
|
+
code: 9e3
|
|
459
|
+
},
|
|
460
|
+
InvalidContentEntryFrontmatterError: {
|
|
461
|
+
title: "Content entry frontmatter does not match schema.",
|
|
462
|
+
code: 9001,
|
|
463
|
+
message: (collection, entryId, error) => {
|
|
464
|
+
return [
|
|
465
|
+
`${String(collection)} \u2192 ${String(entryId)} frontmatter does not match collection schema.`,
|
|
466
|
+
...error.errors.map((zodError) => zodError.message)
|
|
467
|
+
].join("\n");
|
|
468
|
+
},
|
|
469
|
+
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
470
|
+
},
|
|
471
|
+
InvalidContentEntrySlugError: {
|
|
472
|
+
title: "Invalid content entry slug.",
|
|
473
|
+
code: 9002,
|
|
474
|
+
message: (collection, entryId) => {
|
|
475
|
+
return `${String(collection)} \u2192 ${String(
|
|
476
|
+
entryId
|
|
477
|
+
)} has an invalid slug. \`slug\` must be a string.`;
|
|
478
|
+
},
|
|
479
|
+
hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
|
|
480
|
+
},
|
|
481
|
+
ContentSchemaContainsSlugError: {
|
|
482
|
+
title: "Content Schema should not contain `slug`.",
|
|
483
|
+
code: 9003,
|
|
484
|
+
message: (collection) => {
|
|
485
|
+
return `A content collection schema should not contain \`slug\` since it is reserved for slug generation. Remove this from your ${collection} collection schema.`;
|
|
486
|
+
},
|
|
487
|
+
hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
|
|
488
|
+
},
|
|
489
|
+
UnknownError: {
|
|
490
|
+
title: "Unknown Error.",
|
|
491
|
+
code: 99999
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
function normalizeLF(code) {
|
|
496
|
+
return code.replace(/\r\n|\r(?!\n)|\n/g, "\n");
|
|
407
497
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
yield unescapeHTML(chunk);
|
|
416
|
-
}
|
|
498
|
+
function getErrorDataByCode(code) {
|
|
499
|
+
const entry = Object.entries(AstroErrorData).find((data) => data[1].code === code);
|
|
500
|
+
if (entry) {
|
|
501
|
+
return {
|
|
502
|
+
name: entry[0],
|
|
503
|
+
data: entry[1]
|
|
504
|
+
};
|
|
417
505
|
}
|
|
418
506
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
507
|
+
|
|
508
|
+
function codeFrame(src, loc) {
|
|
509
|
+
if (!loc || loc.line === void 0 || loc.column === void 0) {
|
|
510
|
+
return "";
|
|
511
|
+
}
|
|
512
|
+
const lines = normalizeLF(src).split("\n").map((ln) => ln.replace(/\t/g, " "));
|
|
513
|
+
const visibleLines = [];
|
|
514
|
+
for (let n = -2; n <= 2; n++) {
|
|
515
|
+
if (lines[loc.line + n])
|
|
516
|
+
visibleLines.push(loc.line + n);
|
|
517
|
+
}
|
|
518
|
+
let gutterWidth = 0;
|
|
519
|
+
for (const lineNo of visibleLines) {
|
|
520
|
+
let w = `> ${lineNo}`;
|
|
521
|
+
if (w.length > gutterWidth)
|
|
522
|
+
gutterWidth = w.length;
|
|
523
|
+
}
|
|
524
|
+
let output = "";
|
|
525
|
+
for (const lineNo of visibleLines) {
|
|
526
|
+
const isFocusedLine = lineNo === loc.line - 1;
|
|
527
|
+
output += isFocusedLine ? "> " : " ";
|
|
528
|
+
output += `${lineNo + 1} | ${lines[lineNo]}
|
|
529
|
+
`;
|
|
530
|
+
if (isFocusedLine)
|
|
531
|
+
output += `${Array.from({ length: gutterWidth }).join(" ")} | ${Array.from({
|
|
532
|
+
length: loc.column
|
|
533
|
+
}).join(" ")}^
|
|
534
|
+
`;
|
|
422
535
|
}
|
|
536
|
+
return output;
|
|
423
537
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
return unescapeChunks(str);
|
|
437
|
-
} else if (Symbol.asyncIterator in str || hasGetReader(str)) {
|
|
438
|
-
return unescapeChunksAsync(str);
|
|
538
|
+
|
|
539
|
+
class AstroError extends Error {
|
|
540
|
+
constructor(props, ...params) {
|
|
541
|
+
var _a;
|
|
542
|
+
super(...params);
|
|
543
|
+
this.type = "AstroError";
|
|
544
|
+
const { code, name, title, message, stack, location, hint, frame } = props;
|
|
545
|
+
this.errorCode = code;
|
|
546
|
+
if (name && name !== "Error") {
|
|
547
|
+
this.name = name;
|
|
548
|
+
} else {
|
|
549
|
+
this.name = ((_a = getErrorDataByCode(this.errorCode)) == null ? void 0 : _a.name) ?? "UnknownError";
|
|
439
550
|
}
|
|
551
|
+
this.title = title;
|
|
552
|
+
if (message)
|
|
553
|
+
this.message = message;
|
|
554
|
+
this.stack = stack ? stack : this.stack;
|
|
555
|
+
this.loc = location;
|
|
556
|
+
this.hint = hint;
|
|
557
|
+
this.frame = frame;
|
|
558
|
+
}
|
|
559
|
+
setErrorCode(errorCode) {
|
|
560
|
+
this.errorCode = errorCode;
|
|
561
|
+
}
|
|
562
|
+
setLocation(location) {
|
|
563
|
+
this.loc = location;
|
|
564
|
+
}
|
|
565
|
+
setName(name) {
|
|
566
|
+
this.name = name;
|
|
567
|
+
}
|
|
568
|
+
setMessage(message) {
|
|
569
|
+
this.message = message;
|
|
570
|
+
}
|
|
571
|
+
setHint(hint) {
|
|
572
|
+
this.hint = hint;
|
|
573
|
+
}
|
|
574
|
+
setFrame(source, location) {
|
|
575
|
+
this.frame = codeFrame(source, location);
|
|
576
|
+
}
|
|
577
|
+
static is(err) {
|
|
578
|
+
return err.type === "AstroError";
|
|
440
579
|
}
|
|
441
|
-
return markHTMLString(str);
|
|
442
580
|
}
|
|
443
581
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
582
|
+
function validateArgs(args) {
|
|
583
|
+
if (args.length !== 3)
|
|
584
|
+
return false;
|
|
585
|
+
if (!args[0] || typeof args[0] !== "object")
|
|
586
|
+
return false;
|
|
587
|
+
return true;
|
|
449
588
|
}
|
|
450
|
-
function
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
if (Array.isArray(vnode.props.children)) {
|
|
467
|
-
vnode.props.children = vnode.props.children.map((child) => {
|
|
468
|
-
if (!isVNode(child))
|
|
469
|
-
return child;
|
|
470
|
-
if (!("slot" in child.props))
|
|
471
|
-
return child;
|
|
472
|
-
const name = toSlotName(child.props.slot);
|
|
473
|
-
if (Array.isArray(slots[name])) {
|
|
474
|
-
slots[name].push(child);
|
|
475
|
-
} else {
|
|
476
|
-
slots[name] = [child];
|
|
477
|
-
slots[name]["$$slot"] = true;
|
|
478
|
-
}
|
|
479
|
-
delete child.props.slot;
|
|
480
|
-
return Empty;
|
|
481
|
-
}).filter((v) => v !== Empty);
|
|
482
|
-
}
|
|
483
|
-
Object.assign(vnode.props, slots);
|
|
589
|
+
function baseCreateComponent(cb, moduleId) {
|
|
590
|
+
var _a;
|
|
591
|
+
const name = ((_a = moduleId == null ? void 0 : moduleId.split("/").pop()) == null ? void 0 : _a.replace(".astro", "")) ?? "";
|
|
592
|
+
const fn = (...args) => {
|
|
593
|
+
if (!validateArgs(args)) {
|
|
594
|
+
throw new AstroError({
|
|
595
|
+
...AstroErrorData.InvalidComponentArgs,
|
|
596
|
+
message: AstroErrorData.InvalidComponentArgs.message(name)
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
return cb(...args);
|
|
600
|
+
};
|
|
601
|
+
Object.defineProperty(fn, "name", { value: name, writable: false });
|
|
602
|
+
fn.isAstroComponentFactory = true;
|
|
603
|
+
fn.moduleId = moduleId;
|
|
604
|
+
return fn;
|
|
484
605
|
}
|
|
485
|
-
function
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
return child.map((c) => markRawChildren(c));
|
|
490
|
-
return child;
|
|
606
|
+
function createComponentWithOptions(opts) {
|
|
607
|
+
const cb = baseCreateComponent(opts.factory, opts.moduleId);
|
|
608
|
+
cb.propagation = opts.propagation;
|
|
609
|
+
return cb;
|
|
491
610
|
}
|
|
492
|
-
function
|
|
493
|
-
if (
|
|
494
|
-
return;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
delete vnode.props["set:html"];
|
|
498
|
-
Object.assign(vnode.props, { children });
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
if ("set:text" in vnode.props) {
|
|
502
|
-
const children = vnode.props["set:text"];
|
|
503
|
-
delete vnode.props["set:text"];
|
|
504
|
-
Object.assign(vnode.props, { children });
|
|
505
|
-
return;
|
|
611
|
+
function createComponent(arg1, moduleId) {
|
|
612
|
+
if (typeof arg1 === "function") {
|
|
613
|
+
return baseCreateComponent(arg1, moduleId);
|
|
614
|
+
} else {
|
|
615
|
+
return createComponentWithOptions(arg1);
|
|
506
616
|
}
|
|
507
617
|
}
|
|
508
|
-
function createVNode(type, props) {
|
|
509
|
-
const vnode = {
|
|
510
|
-
[Renderer]: "astro:jsx",
|
|
511
|
-
[AstroJSX]: true,
|
|
512
|
-
type,
|
|
513
|
-
props: props ?? {}
|
|
514
|
-
};
|
|
515
|
-
transformSetDirectives(vnode);
|
|
516
|
-
transformSlots(vnode);
|
|
517
|
-
return vnode;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
var idle_prebuilt_default = `(self.Astro=self.Astro||{}).idle=t=>{const e=async()=>{await(await t())()};"requestIdleCallback"in window?window.requestIdleCallback(e):setTimeout(e,200)},window.dispatchEvent(new Event("astro:idle"));`;
|
|
521
|
-
|
|
522
|
-
var load_prebuilt_default = `(self.Astro=self.Astro||{}).load=a=>{(async()=>await(await a())())()},window.dispatchEvent(new Event("astro:load"));`;
|
|
523
|
-
|
|
524
|
-
var media_prebuilt_default = `(self.Astro=self.Astro||{}).media=(s,a)=>{const t=async()=>{await(await s())()};if(a.value){const e=matchMedia(a.value);e.matches?t():e.addEventListener("change",t,{once:!0})}},window.dispatchEvent(new Event("astro:media"));`;
|
|
525
|
-
|
|
526
|
-
var only_prebuilt_default = `(self.Astro=self.Astro||{}).only=t=>{(async()=>await(await t())())()},window.dispatchEvent(new Event("astro:only"));`;
|
|
527
618
|
|
|
528
|
-
|
|
619
|
+
const ASTRO_VERSION = "2.0.10";
|
|
529
620
|
|
|
530
|
-
|
|
621
|
+
function createAstroGlobFn() {
|
|
622
|
+
const globHandler = (importMetaGlobResult, globValue) => {
|
|
623
|
+
let allEntries = [...Object.values(importMetaGlobResult)];
|
|
624
|
+
if (allEntries.length === 0) {
|
|
625
|
+
throw new Error(`Astro.glob(${JSON.stringify(globValue())}) - no matches found.`);
|
|
626
|
+
}
|
|
627
|
+
return Promise.all(allEntries.map((fn) => fn()));
|
|
628
|
+
};
|
|
629
|
+
return globHandler;
|
|
630
|
+
}
|
|
631
|
+
function createAstro(site) {
|
|
632
|
+
return {
|
|
633
|
+
site: site ? new URL(site) : void 0,
|
|
634
|
+
generator: `Astro v${ASTRO_VERSION}`,
|
|
635
|
+
glob: createAstroGlobFn()
|
|
636
|
+
};
|
|
637
|
+
}
|
|
531
638
|
|
|
532
|
-
function
|
|
533
|
-
if (
|
|
534
|
-
return
|
|
639
|
+
function getHandlerFromModule(mod, method) {
|
|
640
|
+
if (mod[method]) {
|
|
641
|
+
return mod[method];
|
|
535
642
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
const hydrationScripts = {
|
|
539
|
-
idle: idle_prebuilt_default,
|
|
540
|
-
load: load_prebuilt_default,
|
|
541
|
-
only: only_prebuilt_default,
|
|
542
|
-
media: media_prebuilt_default,
|
|
543
|
-
visible: visible_prebuilt_default
|
|
544
|
-
};
|
|
545
|
-
function determinesIfNeedsDirectiveScript(result, directive) {
|
|
546
|
-
if (result._metadata.hasDirectives.has(directive)) {
|
|
547
|
-
return false;
|
|
643
|
+
if (method === "delete" && mod["del"]) {
|
|
644
|
+
return mod["del"];
|
|
548
645
|
}
|
|
549
|
-
|
|
550
|
-
|
|
646
|
+
if (mod["all"]) {
|
|
647
|
+
return mod["all"];
|
|
648
|
+
}
|
|
649
|
+
return void 0;
|
|
551
650
|
}
|
|
552
|
-
function
|
|
553
|
-
|
|
554
|
-
|
|
651
|
+
async function renderEndpoint(mod, context, ssr) {
|
|
652
|
+
var _a;
|
|
653
|
+
const { request, params } = context;
|
|
654
|
+
const chosenMethod = (_a = request.method) == null ? void 0 : _a.toLowerCase();
|
|
655
|
+
const handler = getHandlerFromModule(mod, chosenMethod);
|
|
656
|
+
if (!ssr && ssr === false && chosenMethod && chosenMethod !== "get") {
|
|
657
|
+
console.warn(`
|
|
658
|
+
${chosenMethod} requests are not available when building a static site. Update your config to output: 'server' to handle ${chosenMethod} requests.`);
|
|
555
659
|
}
|
|
556
|
-
|
|
557
|
-
|
|
660
|
+
if (!handler || typeof handler !== "function") {
|
|
661
|
+
let response = new Response(null, {
|
|
662
|
+
status: 404,
|
|
663
|
+
headers: {
|
|
664
|
+
"X-Astro-Response": "Not-Found"
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
return response;
|
|
668
|
+
}
|
|
669
|
+
if (handler.length > 1) {
|
|
670
|
+
console.warn(`
|
|
671
|
+
API routes with 2 arguments have been deprecated. Instead they take a single argument in the form of:
|
|
672
|
+
|
|
673
|
+
export function get({ params, request }) {
|
|
674
|
+
//...
|
|
558
675
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
case "both":
|
|
562
|
-
return `<style>astro-island,astro-slot{display:contents}</style><script>${getDirectiveScriptText(directive) + astro_island_prebuilt_default}<\/script>`;
|
|
563
|
-
case "directive":
|
|
564
|
-
return `<script>${getDirectiveScriptText(directive)}<\/script>`;
|
|
676
|
+
|
|
677
|
+
Update your code to remove this warning.`);
|
|
565
678
|
}
|
|
566
|
-
|
|
679
|
+
const proxy = new Proxy(context, {
|
|
680
|
+
get(target, prop) {
|
|
681
|
+
if (prop in target) {
|
|
682
|
+
return Reflect.get(target, prop);
|
|
683
|
+
} else if (prop in params) {
|
|
684
|
+
console.warn(`
|
|
685
|
+
API routes no longer pass params as the first argument. Instead an object containing a params property is provided in the form of:
|
|
686
|
+
|
|
687
|
+
export function get({ params }) {
|
|
688
|
+
// ...
|
|
567
689
|
}
|
|
568
690
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
691
|
+
Update your code to remove this warning.`);
|
|
692
|
+
return Reflect.get(params, prop);
|
|
693
|
+
} else {
|
|
694
|
+
return void 0;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
return handler.call(mod, proxy, request);
|
|
572
699
|
}
|
|
573
700
|
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
701
|
+
function serializeListValue(value) {
|
|
702
|
+
const hash = {};
|
|
703
|
+
push(value);
|
|
704
|
+
return Object.keys(hash).join(" ");
|
|
705
|
+
function push(item) {
|
|
706
|
+
if (item && typeof item.forEach === "function")
|
|
707
|
+
item.forEach(push);
|
|
708
|
+
else if (item === Object(item))
|
|
709
|
+
Object.keys(item).forEach((name) => {
|
|
710
|
+
if (item[name])
|
|
711
|
+
push(name);
|
|
712
|
+
});
|
|
713
|
+
else {
|
|
714
|
+
item = item === false || item == null ? "" : String(item).trim();
|
|
715
|
+
if (item) {
|
|
716
|
+
item.split(/\s+/).forEach((name) => {
|
|
717
|
+
hash[name] = true;
|
|
588
718
|
});
|
|
589
719
|
}
|
|
590
|
-
return expression;
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
async *[(_a$1 = renderTemplateResultSym, Symbol.asyncIterator)]() {
|
|
594
|
-
const { htmlParts, expressions } = this;
|
|
595
|
-
for (let i = 0; i < htmlParts.length; i++) {
|
|
596
|
-
const html = htmlParts[i];
|
|
597
|
-
const expression = expressions[i];
|
|
598
|
-
yield markHTMLString(html);
|
|
599
|
-
yield* renderChild(expression);
|
|
600
720
|
}
|
|
601
721
|
}
|
|
602
722
|
}
|
|
603
|
-
function
|
|
604
|
-
return typeof
|
|
723
|
+
function isPromise(value) {
|
|
724
|
+
return !!value && typeof value === "object" && typeof value.then === "function";
|
|
605
725
|
}
|
|
606
|
-
async function*
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
default: {
|
|
616
|
-
yield markHTMLString(chunk);
|
|
617
|
-
break;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
726
|
+
async function* streamAsyncIterator(stream) {
|
|
727
|
+
const reader = stream.getReader();
|
|
728
|
+
try {
|
|
729
|
+
while (true) {
|
|
730
|
+
const { done, value } = await reader.read();
|
|
731
|
+
if (done)
|
|
732
|
+
return;
|
|
733
|
+
yield value;
|
|
621
734
|
}
|
|
735
|
+
} finally {
|
|
736
|
+
reader.releaseLock();
|
|
622
737
|
}
|
|
623
738
|
}
|
|
624
|
-
function renderTemplate(htmlParts, ...expressions) {
|
|
625
|
-
return new RenderTemplateResult(htmlParts, expressions);
|
|
626
|
-
}
|
|
627
739
|
|
|
628
|
-
|
|
629
|
-
|
|
740
|
+
const escapeHTML = escape;
|
|
741
|
+
class HTMLBytes extends Uint8Array {
|
|
630
742
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
const response = factoryResult;
|
|
635
|
-
throw response;
|
|
743
|
+
Object.defineProperty(HTMLBytes.prototype, Symbol.toStringTag, {
|
|
744
|
+
get() {
|
|
745
|
+
return "HTMLBytes";
|
|
636
746
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
747
|
+
});
|
|
748
|
+
class HTMLString extends String {
|
|
749
|
+
get [Symbol.toStringTag]() {
|
|
750
|
+
return "HTMLString";
|
|
641
751
|
}
|
|
642
|
-
return parts.toString();
|
|
643
752
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
hint = result.propagation.get(factory.moduleId);
|
|
753
|
+
const markHTMLString = (value) => {
|
|
754
|
+
if (value instanceof HTMLString) {
|
|
755
|
+
return value;
|
|
648
756
|
}
|
|
649
|
-
|
|
757
|
+
if (typeof value === "string") {
|
|
758
|
+
return new HTMLString(value);
|
|
759
|
+
}
|
|
760
|
+
return value;
|
|
761
|
+
};
|
|
762
|
+
function isHTMLString(value) {
|
|
763
|
+
return Object.prototype.toString.call(value) === "[object HTMLString]";
|
|
650
764
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
title: "Missing value for `client:media` directive.",
|
|
690
|
-
code: 3006,
|
|
691
|
-
message: 'Media query not provided for `client:media` directive. A media query similar to `client:media="(max-width: 600px)"` must be provided'
|
|
692
|
-
},
|
|
693
|
-
NoMatchingRenderer: {
|
|
694
|
-
title: "No matching renderer found.",
|
|
695
|
-
code: 3007,
|
|
696
|
-
message: (componentName, componentExtension, plural, validRenderersCount) => `Unable to render \`${componentName}\`.
|
|
697
|
-
|
|
698
|
-
${validRenderersCount > 0 ? `There ${plural ? "are." : "is."} ${validRenderersCount} renderer${plural ? "s." : ""} configured in your \`astro.config.mjs\` file,
|
|
699
|
-
but ${plural ? "none were." : "it was not."} able to server-side render \`${componentName}\`.` : `No valid renderer was found ${componentExtension ? `for the \`.${componentExtension}\` file extension.` : `for this file extension.`}`}`,
|
|
700
|
-
hint: (probableRenderers) => `Did you mean to enable the ${probableRenderers} integration?
|
|
701
|
-
|
|
702
|
-
See https://docs.astro.build/en/core-concepts/framework-components/ for more information on how to install and configure integrations.`
|
|
703
|
-
},
|
|
704
|
-
NoClientEntrypoint: {
|
|
705
|
-
title: "No client entrypoint specified in renderer.",
|
|
706
|
-
code: 3008,
|
|
707
|
-
message: (componentName, clientDirective, rendererName) => `\`${componentName}\` component has a \`client:${clientDirective}\` directive, but no client entrypoint was provided by \`${rendererName}\`.`,
|
|
708
|
-
hint: "See https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option for more information on how to configure your renderer."
|
|
709
|
-
},
|
|
710
|
-
NoClientOnlyHint: {
|
|
711
|
-
title: "Missing hint on client:only directive.",
|
|
712
|
-
code: 3009,
|
|
713
|
-
message: (componentName) => `Unable to render \`${componentName}\`. When using the \`client:only\` hydration strategy, Astro needs a hint to use the correct renderer.`,
|
|
714
|
-
hint: (probableRenderers) => `Did you mean to pass \`client:only="${probableRenderers}"\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on client:only`
|
|
715
|
-
},
|
|
716
|
-
InvalidGetStaticPathParam: {
|
|
717
|
-
title: "Invalid value returned by a `getStaticPaths` path.",
|
|
718
|
-
code: 3010,
|
|
719
|
-
message: (paramType) => `Invalid params given to \`getStaticPaths\` path. Expected an \`object\`, got \`${paramType}\``,
|
|
720
|
-
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
721
|
-
},
|
|
722
|
-
InvalidGetStaticPathsReturn: {
|
|
723
|
-
title: "Invalid value returned by getStaticPaths.",
|
|
724
|
-
code: 3011,
|
|
725
|
-
message: (returnType) => `Invalid type returned by \`getStaticPaths\`. Expected an \`array\`, got \`${returnType}\``,
|
|
726
|
-
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
727
|
-
},
|
|
728
|
-
GetStaticPathsRemovedRSSHelper: {
|
|
729
|
-
title: "getStaticPaths RSS helper is not available anymore.",
|
|
730
|
-
code: 3012,
|
|
731
|
-
message: "The RSS helper has been removed from `getStaticPaths`. Try the new @astrojs/rss package instead.",
|
|
732
|
-
hint: "See https://docs.astro.build/en/guides/rss/ for more information."
|
|
733
|
-
},
|
|
734
|
-
GetStaticPathsExpectedParams: {
|
|
735
|
-
title: "Missing params property on `getStaticPaths` route.",
|
|
736
|
-
code: 3013,
|
|
737
|
-
message: "Missing or empty required `params` property on `getStaticPaths` route.",
|
|
738
|
-
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
739
|
-
},
|
|
740
|
-
GetStaticPathsInvalidRouteParam: {
|
|
741
|
-
title: "Invalid value for `getStaticPaths` route parameter.",
|
|
742
|
-
code: 3014,
|
|
743
|
-
message: (key, value, valueType) => `Invalid getStaticPaths route parameter for \`${key}\`. Expected undefined, a string or a number, received \`${valueType}\` (\`${value}\`)`,
|
|
744
|
-
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
745
|
-
},
|
|
746
|
-
GetStaticPathsRequired: {
|
|
747
|
-
title: "`getStaticPaths()` function required for dynamic routes.",
|
|
748
|
-
code: 3015,
|
|
749
|
-
message: "`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.",
|
|
750
|
-
hint: `See https://docs.astro.build/en/core-concepts/routing/#dynamic-routes for more information on dynamic routes.
|
|
751
|
-
|
|
752
|
-
Alternatively, set \`output: "server"\` in your Astro config file to switch to a non-static server build. This error can also occur if using \`export const prerender = true;\`.
|
|
753
|
-
See https://docs.astro.build/en/guides/server-side-rendering/ for more information on non-static rendering.`
|
|
754
|
-
},
|
|
755
|
-
ReservedSlotName: {
|
|
756
|
-
title: "Invalid slot name.",
|
|
757
|
-
code: 3016,
|
|
758
|
-
message: (slotName) => `Unable to create a slot named \`${slotName}\`. \`${slotName}\` is a reserved slot name. Please update the name of this slot.`
|
|
759
|
-
},
|
|
760
|
-
NoAdapterInstalled: {
|
|
761
|
-
title: "Cannot use Server-side Rendering without an adapter.",
|
|
762
|
-
code: 3017,
|
|
763
|
-
message: `Cannot use \`output: 'server'\` without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
|
|
764
|
-
hint: "See https://docs.astro.build/en/guides/server-side-rendering/ for more information."
|
|
765
|
-
},
|
|
766
|
-
NoMatchingImport: {
|
|
767
|
-
title: "No import found for component.",
|
|
768
|
-
code: 3018,
|
|
769
|
-
message: (componentName) => `Could not render \`${componentName}\`. No matching import has been found for \`${componentName}\`.`,
|
|
770
|
-
hint: "Please make sure the component is properly imported."
|
|
771
|
-
},
|
|
772
|
-
InvalidPrerenderExport: {
|
|
773
|
-
title: "Invalid prerender export.",
|
|
774
|
-
code: 3019,
|
|
775
|
-
message: (prefix, suffix) => {
|
|
776
|
-
let msg = `A \`prerender\` export has been detected, but its value cannot be statically analyzed.`;
|
|
777
|
-
if (prefix !== "const")
|
|
778
|
-
msg += `
|
|
779
|
-
Expected \`const\` declaration but got \`${prefix}\`.`;
|
|
780
|
-
if (suffix !== "true")
|
|
781
|
-
msg += `
|
|
782
|
-
Expected \`true\` value but got \`${suffix}\`.`;
|
|
783
|
-
return msg;
|
|
784
|
-
},
|
|
785
|
-
hint: "Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`."
|
|
786
|
-
},
|
|
787
|
-
UnknownViteError: {
|
|
788
|
-
title: "Unknown Vite Error.",
|
|
789
|
-
code: 4e3
|
|
790
|
-
},
|
|
791
|
-
FailedToLoadModuleSSR: {
|
|
792
|
-
title: "Could not import file.",
|
|
793
|
-
code: 4001,
|
|
794
|
-
message: (importName) => `Could not import \`${importName}\`.`,
|
|
795
|
-
hint: "This is often caused by a typo in the import path. Please make sure the file exists."
|
|
796
|
-
},
|
|
797
|
-
InvalidGlob: {
|
|
798
|
-
title: "Invalid glob pattern.",
|
|
799
|
-
code: 4002,
|
|
800
|
-
message: (globPattern) => `Invalid glob pattern: \`${globPattern}\`. Glob patterns must start with './', '../' or '/'.`,
|
|
801
|
-
hint: "See https://docs.astro.build/en/guides/imports/#glob-patterns for more information on supported glob patterns."
|
|
802
|
-
},
|
|
803
|
-
UnknownCSSError: {
|
|
804
|
-
title: "Unknown CSS Error.",
|
|
805
|
-
code: 5e3
|
|
806
|
-
},
|
|
807
|
-
CSSSyntaxError: {
|
|
808
|
-
title: "CSS Syntax Error.",
|
|
809
|
-
code: 5001
|
|
810
|
-
},
|
|
811
|
-
UnknownMarkdownError: {
|
|
812
|
-
title: "Unknown Markdown Error.",
|
|
813
|
-
code: 6e3
|
|
814
|
-
},
|
|
815
|
-
MarkdownFrontmatterParseError: {
|
|
816
|
-
title: "Failed to parse Markdown frontmatter.",
|
|
817
|
-
code: 6001
|
|
818
|
-
},
|
|
819
|
-
InvalidFrontmatterInjectionError: {
|
|
820
|
-
title: "Invalid frontmatter injection.",
|
|
821
|
-
code: 6003,
|
|
822
|
-
message: 'A remark or rehype plugin attempted to inject invalid frontmatter. Ensure "astro.frontmatter" is set to a valid JSON object that is not `null` or `undefined`.',
|
|
823
|
-
hint: "See the frontmatter injection docs https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically for more information."
|
|
824
|
-
},
|
|
825
|
-
MdxIntegrationMissingError: {
|
|
826
|
-
title: "MDX integration missing.",
|
|
827
|
-
code: 6004,
|
|
828
|
-
message: (file) => `Unable to render ${file}. Ensure that the \`@astrojs/mdx\` integration is installed.`,
|
|
829
|
-
hint: "See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/"
|
|
830
|
-
},
|
|
831
|
-
UnknownConfigError: {
|
|
832
|
-
title: "Unknown configuration error.",
|
|
833
|
-
code: 7e3
|
|
834
|
-
},
|
|
835
|
-
ConfigNotFound: {
|
|
836
|
-
title: "Specified configuration file not found.",
|
|
837
|
-
code: 7001,
|
|
838
|
-
message: (configFile) => `Unable to resolve \`--config "${configFile}"\`. Does the file exist?`
|
|
839
|
-
},
|
|
840
|
-
ConfigLegacyKey: {
|
|
841
|
-
title: "Legacy configuration detected.",
|
|
842
|
-
code: 7002,
|
|
843
|
-
message: (legacyConfigKey) => `Legacy configuration detected: \`${legacyConfigKey}\`.`,
|
|
844
|
-
hint: "Please update your configuration to the new format.\nSee https://astro.build/config for more information."
|
|
845
|
-
},
|
|
846
|
-
UnknownCLIError: {
|
|
847
|
-
title: "Unknown CLI Error.",
|
|
848
|
-
code: 8e3
|
|
849
|
-
},
|
|
850
|
-
GenerateContentTypesError: {
|
|
851
|
-
title: "Failed to generate content types.",
|
|
852
|
-
code: 8001,
|
|
853
|
-
message: "`astro sync` command failed to generate content collection types.",
|
|
854
|
-
hint: "Check your `src/content/config.*` file for typos."
|
|
855
|
-
},
|
|
856
|
-
UnknownContentCollectionError: {
|
|
857
|
-
title: "Unknown Content Collection Error.",
|
|
858
|
-
code: 9e3
|
|
859
|
-
},
|
|
860
|
-
InvalidContentEntryFrontmatterError: {
|
|
861
|
-
title: "Content entry frontmatter does not match schema.",
|
|
862
|
-
code: 9001,
|
|
863
|
-
message: (collection, entryId, error) => {
|
|
864
|
-
return [
|
|
865
|
-
`${String(collection)} \u2192 ${String(entryId)} frontmatter does not match collection schema.`,
|
|
866
|
-
...error.errors.map((zodError) => zodError.message)
|
|
867
|
-
].join("\n");
|
|
868
|
-
},
|
|
869
|
-
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
870
|
-
},
|
|
871
|
-
InvalidContentEntrySlugError: {
|
|
872
|
-
title: "Invalid content entry slug.",
|
|
873
|
-
code: 9002,
|
|
874
|
-
message: (collection, entryId) => {
|
|
875
|
-
return `${String(collection)} \u2192 ${String(
|
|
876
|
-
entryId
|
|
877
|
-
)} has an invalid slug. \`slug\` must be a string.`;
|
|
878
|
-
},
|
|
879
|
-
hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
|
|
880
|
-
},
|
|
881
|
-
ContentSchemaContainsSlugError: {
|
|
882
|
-
title: "Content Schema should not contain `slug`.",
|
|
883
|
-
code: 9003,
|
|
884
|
-
message: (collection) => {
|
|
885
|
-
return `A content collection schema should not contain \`slug\` since it is reserved for slug generation. Remove this from your ${collection} collection schema.`;
|
|
886
|
-
},
|
|
887
|
-
hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
|
|
888
|
-
},
|
|
889
|
-
UnknownError: {
|
|
890
|
-
title: "Unknown Error.",
|
|
891
|
-
code: 99999
|
|
765
|
+
function markHTMLBytes(bytes) {
|
|
766
|
+
return new HTMLBytes(bytes);
|
|
767
|
+
}
|
|
768
|
+
function hasGetReader(obj) {
|
|
769
|
+
return typeof obj.getReader === "function";
|
|
770
|
+
}
|
|
771
|
+
async function* unescapeChunksAsync(iterable) {
|
|
772
|
+
if (hasGetReader(iterable)) {
|
|
773
|
+
for await (const chunk of streamAsyncIterator(iterable)) {
|
|
774
|
+
yield unescapeHTML(chunk);
|
|
775
|
+
}
|
|
776
|
+
} else {
|
|
777
|
+
for await (const chunk of iterable) {
|
|
778
|
+
yield unescapeHTML(chunk);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
function* unescapeChunks(iterable) {
|
|
783
|
+
for (const chunk of iterable) {
|
|
784
|
+
yield unescapeHTML(chunk);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
function unescapeHTML(str) {
|
|
788
|
+
if (!!str && typeof str === "object") {
|
|
789
|
+
if (str instanceof Uint8Array) {
|
|
790
|
+
return markHTMLBytes(str);
|
|
791
|
+
} else if (str instanceof Response && str.body) {
|
|
792
|
+
const body = str.body;
|
|
793
|
+
return unescapeChunksAsync(body);
|
|
794
|
+
} else if (typeof str.then === "function") {
|
|
795
|
+
return Promise.resolve(str).then((value) => {
|
|
796
|
+
return unescapeHTML(value);
|
|
797
|
+
});
|
|
798
|
+
} else if (Symbol.iterator in str) {
|
|
799
|
+
return unescapeChunks(str);
|
|
800
|
+
} else if (Symbol.asyncIterator in str || hasGetReader(str)) {
|
|
801
|
+
return unescapeChunksAsync(str);
|
|
802
|
+
}
|
|
892
803
|
}
|
|
893
|
-
|
|
804
|
+
return markHTMLString(str);
|
|
805
|
+
}
|
|
894
806
|
|
|
895
|
-
|
|
896
|
-
|
|
807
|
+
const AstroJSX = "astro:jsx";
|
|
808
|
+
const Empty = Symbol("empty");
|
|
809
|
+
const toSlotName = (slotAttr) => slotAttr;
|
|
810
|
+
function isVNode(vnode) {
|
|
811
|
+
return vnode && typeof vnode === "object" && vnode[AstroJSX];
|
|
897
812
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
813
|
+
function transformSlots(vnode) {
|
|
814
|
+
if (typeof vnode.type === "string")
|
|
815
|
+
return vnode;
|
|
816
|
+
const slots = {};
|
|
817
|
+
if (isVNode(vnode.props.children)) {
|
|
818
|
+
const child = vnode.props.children;
|
|
819
|
+
if (!isVNode(child))
|
|
820
|
+
return;
|
|
821
|
+
if (!("slot" in child.props))
|
|
822
|
+
return;
|
|
823
|
+
const name = toSlotName(child.props.slot);
|
|
824
|
+
slots[name] = [child];
|
|
825
|
+
slots[name]["$$slot"] = true;
|
|
826
|
+
delete child.props.slot;
|
|
827
|
+
delete vnode.props.children;
|
|
828
|
+
}
|
|
829
|
+
if (Array.isArray(vnode.props.children)) {
|
|
830
|
+
vnode.props.children = vnode.props.children.map((child) => {
|
|
831
|
+
if (!isVNode(child))
|
|
832
|
+
return child;
|
|
833
|
+
if (!("slot" in child.props))
|
|
834
|
+
return child;
|
|
835
|
+
const name = toSlotName(child.props.slot);
|
|
836
|
+
if (Array.isArray(slots[name])) {
|
|
837
|
+
slots[name].push(child);
|
|
838
|
+
} else {
|
|
839
|
+
slots[name] = [child];
|
|
840
|
+
slots[name]["$$slot"] = true;
|
|
841
|
+
}
|
|
842
|
+
delete child.props.slot;
|
|
843
|
+
return Empty;
|
|
844
|
+
}).filter((v) => v !== Empty);
|
|
845
|
+
}
|
|
846
|
+
Object.assign(vnode.props, slots);
|
|
847
|
+
}
|
|
848
|
+
function markRawChildren(child) {
|
|
849
|
+
if (typeof child === "string")
|
|
850
|
+
return markHTMLString(child);
|
|
851
|
+
if (Array.isArray(child))
|
|
852
|
+
return child.map((c) => markRawChildren(c));
|
|
853
|
+
return child;
|
|
854
|
+
}
|
|
855
|
+
function transformSetDirectives(vnode) {
|
|
856
|
+
if (!("set:html" in vnode.props || "set:text" in vnode.props))
|
|
857
|
+
return;
|
|
858
|
+
if ("set:html" in vnode.props) {
|
|
859
|
+
const children = markRawChildren(vnode.props["set:html"]);
|
|
860
|
+
delete vnode.props["set:html"];
|
|
861
|
+
Object.assign(vnode.props, { children });
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
if ("set:text" in vnode.props) {
|
|
865
|
+
const children = vnode.props["set:text"];
|
|
866
|
+
delete vnode.props["set:text"];
|
|
867
|
+
Object.assign(vnode.props, { children });
|
|
868
|
+
return;
|
|
905
869
|
}
|
|
906
870
|
}
|
|
871
|
+
function createVNode(type, props) {
|
|
872
|
+
const vnode = {
|
|
873
|
+
[Renderer]: "astro:jsx",
|
|
874
|
+
[AstroJSX]: true,
|
|
875
|
+
type,
|
|
876
|
+
props: props ?? {}
|
|
877
|
+
};
|
|
878
|
+
transformSetDirectives(vnode);
|
|
879
|
+
transformSlots(vnode);
|
|
880
|
+
return vnode;
|
|
881
|
+
}
|
|
907
882
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
883
|
+
var idle_prebuilt_default = `(self.Astro=self.Astro||{}).idle=t=>{const e=async()=>{await(await t())()};"requestIdleCallback"in window?window.requestIdleCallback(e):setTimeout(e,200)},window.dispatchEvent(new Event("astro:idle"));`;
|
|
884
|
+
|
|
885
|
+
var load_prebuilt_default = `(self.Astro=self.Astro||{}).load=a=>{(async()=>await(await a())())()},window.dispatchEvent(new Event("astro:load"));`;
|
|
886
|
+
|
|
887
|
+
var media_prebuilt_default = `(self.Astro=self.Astro||{}).media=(s,a)=>{const t=async()=>{await(await s())()};if(a.value){const e=matchMedia(a.value);e.matches?t():e.addEventListener("change",t,{once:!0})}},window.dispatchEvent(new Event("astro:media"));`;
|
|
888
|
+
|
|
889
|
+
var only_prebuilt_default = `(self.Astro=self.Astro||{}).only=t=>{(async()=>await(await t())())()},window.dispatchEvent(new Event("astro:only"));`;
|
|
890
|
+
|
|
891
|
+
var visible_prebuilt_default = `(self.Astro=self.Astro||{}).visible=(s,c,n)=>{const r=async()=>{await(await s())()};let i=new IntersectionObserver(e=>{for(const t of e)if(!!t.isIntersecting){i.disconnect(),r();break}});for(let e=0;e<n.children.length;e++){const t=n.children[e];i.observe(t)}},window.dispatchEvent(new Event("astro:visible"));`;
|
|
892
|
+
|
|
893
|
+
var astro_island_prebuilt_default = `var l;{const c={0:t=>t,1:t=>JSON.parse(t,o),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(JSON.parse(t,o)),5:t=>new Set(JSON.parse(t,o)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(JSON.parse(t)),9:t=>new Uint16Array(JSON.parse(t)),10:t=>new Uint32Array(JSON.parse(t))},o=(t,s)=>{if(t===""||!Array.isArray(s))return s;const[e,n]=s;return e in c?c[e](n):void 0};customElements.get("astro-island")||customElements.define("astro-island",(l=class extends HTMLElement{constructor(){super(...arguments);this.hydrate=()=>{if(!this.hydrator||this.parentElement&&this.parentElement.closest("astro-island[ssr]"))return;const s=this.querySelectorAll("astro-slot"),e={},n=this.querySelectorAll("template[data-astro-template]");for(const r of n){const i=r.closest(this.tagName);!i||!i.isSameNode(this)||(e[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(const r of s){const i=r.closest(this.tagName);!i||!i.isSameNode(this)||(e[r.getAttribute("name")||"default"]=r.innerHTML)}const a=this.hasAttribute("props")?JSON.parse(this.getAttribute("props"),o):{};this.hydrator(this)(this.Component,a,e,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),window.removeEventListener("astro:hydrate",this.hydrate),window.dispatchEvent(new CustomEvent("astro:hydrate"))}}connectedCallback(){!this.hasAttribute("await-children")||this.firstChild?this.childrenConnectedCallback():new MutationObserver((s,e)=>{e.disconnect(),this.childrenConnectedCallback()}).observe(this,{childList:!0})}async childrenConnectedCallback(){window.addEventListener("astro:hydrate",this.hydrate);let s=this.getAttribute("before-hydration-url");s&&await import(s),this.start()}start(){const s=JSON.parse(this.getAttribute("opts")),e=this.getAttribute("client");if(Astro[e]===void 0){window.addEventListener(\`astro:\${e}\`,()=>this.start(),{once:!0});return}Astro[e](async()=>{const n=this.getAttribute("renderer-url"),[a,{default:r}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),i=this.getAttribute("component-export")||"default";if(!i.includes("."))this.Component=a[i];else{this.Component=a;for(const d of i.split("."))this.Component=this.Component[d]}return this.hydrator=r,this.hydrate},s,this)}attributeChangedCallback(){this.hydrator&&this.hydrate()}},l.observedAttributes=["props"],l))}`;
|
|
894
|
+
|
|
895
|
+
function determineIfNeedsHydrationScript(result) {
|
|
896
|
+
if (result._metadata.hasHydrationScript) {
|
|
897
|
+
return false;
|
|
911
898
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
899
|
+
return result._metadata.hasHydrationScript = true;
|
|
900
|
+
}
|
|
901
|
+
const hydrationScripts = {
|
|
902
|
+
idle: idle_prebuilt_default,
|
|
903
|
+
load: load_prebuilt_default,
|
|
904
|
+
only: only_prebuilt_default,
|
|
905
|
+
media: media_prebuilt_default,
|
|
906
|
+
visible: visible_prebuilt_default
|
|
907
|
+
};
|
|
908
|
+
function determinesIfNeedsDirectiveScript(result, directive) {
|
|
909
|
+
if (result._metadata.hasDirectives.has(directive)) {
|
|
910
|
+
return false;
|
|
917
911
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
912
|
+
result._metadata.hasDirectives.add(directive);
|
|
913
|
+
return true;
|
|
914
|
+
}
|
|
915
|
+
function getDirectiveScriptText(directive) {
|
|
916
|
+
if (!(directive in hydrationScripts)) {
|
|
917
|
+
throw new Error(`Unknown directive: ${directive}`);
|
|
918
|
+
}
|
|
919
|
+
const directiveScriptText = hydrationScripts[directive];
|
|
920
|
+
return directiveScriptText;
|
|
921
|
+
}
|
|
922
|
+
function getPrescripts(type, directive) {
|
|
923
|
+
switch (type) {
|
|
924
|
+
case "both":
|
|
925
|
+
return `<style>astro-island,astro-slot{display:contents}</style><script>${getDirectiveScriptText(directive) + astro_island_prebuilt_default}<\/script>`;
|
|
926
|
+
case "directive":
|
|
927
|
+
return `<script>${getDirectiveScriptText(directive)}<\/script>`;
|
|
923
928
|
}
|
|
929
|
+
return "";
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
const voidElementNames = /^(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i;
|
|
933
|
+
const htmlBooleanAttributes = /^(allowfullscreen|async|autofocus|autoplay|controls|default|defer|disabled|disablepictureinpicture|disableremoteplayback|formnovalidate|hidden|loop|nomodule|novalidate|open|playsinline|readonly|required|reversed|scoped|seamless|itemscope)$/i;
|
|
934
|
+
const htmlEnumAttributes = /^(contenteditable|draggable|spellcheck|value)$/i;
|
|
935
|
+
const svgEnumAttributes = /^(autoReverse|externalResourcesRequired|focusable|preserveAlpha)$/i;
|
|
936
|
+
const STATIC_DIRECTIVES = /* @__PURE__ */ new Set(["set:html", "set:text"]);
|
|
937
|
+
const toIdent = (k) => k.trim().replace(/(?:(?!^)\b\w|\s+|[^\w]+)/g, (match, index) => {
|
|
938
|
+
if (/[^\w]|\s/.test(match))
|
|
939
|
+
return "";
|
|
940
|
+
return index === 0 ? match : match.toUpperCase();
|
|
941
|
+
});
|
|
942
|
+
const toAttributeString = (value, shouldEscape = true) => shouldEscape ? String(value).replace(/&/g, "&").replace(/"/g, """) : value;
|
|
943
|
+
const kebab = (k) => k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
|
944
|
+
const toStyleString = (obj) => Object.entries(obj).map(([k, v]) => `${kebab(k)}:${v}`).join(";");
|
|
945
|
+
function defineScriptVars(vars) {
|
|
924
946
|
let output = "";
|
|
925
|
-
for (const
|
|
926
|
-
const
|
|
927
|
-
output += isFocusedLine ? "> " : " ";
|
|
928
|
-
output += `${lineNo + 1} | ${lines[lineNo]}
|
|
929
|
-
`;
|
|
930
|
-
if (isFocusedLine)
|
|
931
|
-
output += `${Array.from({ length: gutterWidth }).join(" ")} | ${Array.from({
|
|
932
|
-
length: loc.column
|
|
933
|
-
}).join(" ")}^
|
|
947
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
948
|
+
output += `const ${toIdent(key)} = ${JSON.stringify(value)};
|
|
934
949
|
`;
|
|
935
950
|
}
|
|
936
|
-
return output;
|
|
951
|
+
return markHTMLString(output);
|
|
952
|
+
}
|
|
953
|
+
function formatList(values) {
|
|
954
|
+
if (values.length === 1) {
|
|
955
|
+
return values[0];
|
|
956
|
+
}
|
|
957
|
+
return `${values.slice(0, -1).join(", ")} or ${values[values.length - 1]}`;
|
|
958
|
+
}
|
|
959
|
+
function addAttribute(value, key, shouldEscape = true) {
|
|
960
|
+
if (value == null) {
|
|
961
|
+
return "";
|
|
962
|
+
}
|
|
963
|
+
if (value === false) {
|
|
964
|
+
if (htmlEnumAttributes.test(key) || svgEnumAttributes.test(key)) {
|
|
965
|
+
return markHTMLString(` ${key}="false"`);
|
|
966
|
+
}
|
|
967
|
+
return "";
|
|
968
|
+
}
|
|
969
|
+
if (STATIC_DIRECTIVES.has(key)) {
|
|
970
|
+
console.warn(`[astro] The "${key}" directive cannot be applied dynamically at runtime. It will not be rendered as an attribute.
|
|
971
|
+
|
|
972
|
+
Make sure to use the static attribute syntax (\`${key}={value}\`) instead of the dynamic spread syntax (\`{...{ "${key}": value }}\`).`);
|
|
973
|
+
return "";
|
|
974
|
+
}
|
|
975
|
+
if (key === "class:list") {
|
|
976
|
+
const listValue = toAttributeString(serializeListValue(value), shouldEscape);
|
|
977
|
+
if (listValue === "") {
|
|
978
|
+
return "";
|
|
979
|
+
}
|
|
980
|
+
return markHTMLString(` ${key.slice(0, -5)}="${listValue}"`);
|
|
981
|
+
}
|
|
982
|
+
if (key === "style" && !(value instanceof HTMLString) && typeof value === "object") {
|
|
983
|
+
return markHTMLString(` ${key}="${toAttributeString(toStyleString(value), shouldEscape)}"`);
|
|
984
|
+
}
|
|
985
|
+
if (key === "className") {
|
|
986
|
+
return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`);
|
|
987
|
+
}
|
|
988
|
+
if (value === true && (key.startsWith("data-") || htmlBooleanAttributes.test(key))) {
|
|
989
|
+
return markHTMLString(` ${key}`);
|
|
990
|
+
} else {
|
|
991
|
+
return markHTMLString(` ${key}="${toAttributeString(value, shouldEscape)}"`);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
function internalSpreadAttributes(values, shouldEscape = true) {
|
|
995
|
+
let output = "";
|
|
996
|
+
for (const [key, value] of Object.entries(values)) {
|
|
997
|
+
output += addAttribute(value, key, shouldEscape);
|
|
998
|
+
}
|
|
999
|
+
return markHTMLString(output);
|
|
1000
|
+
}
|
|
1001
|
+
function renderElement$1(name, { props: _props, children = "" }, shouldEscape = true) {
|
|
1002
|
+
const { lang: _, "data-astro-id": astroId, "define:vars": defineVars, ...props } = _props;
|
|
1003
|
+
if (defineVars) {
|
|
1004
|
+
if (name === "style") {
|
|
1005
|
+
delete props["is:global"];
|
|
1006
|
+
delete props["is:scoped"];
|
|
1007
|
+
}
|
|
1008
|
+
if (name === "script") {
|
|
1009
|
+
delete props.hoist;
|
|
1010
|
+
children = defineScriptVars(defineVars) + "\n" + children;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
if ((children == null || children == "") && voidElementNames.test(name)) {
|
|
1014
|
+
return `<${name}${internalSpreadAttributes(props, shouldEscape)} />`;
|
|
1015
|
+
}
|
|
1016
|
+
return `<${name}${internalSpreadAttributes(props, shouldEscape)}>${children}</${name}>`;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
const uniqueElements = (item, index, all) => {
|
|
1020
|
+
const props = JSON.stringify(item.props);
|
|
1021
|
+
const children = item.children;
|
|
1022
|
+
return index === all.findIndex((i) => JSON.stringify(i.props) === props && i.children == children);
|
|
1023
|
+
};
|
|
1024
|
+
function renderAllHeadContent(result) {
|
|
1025
|
+
result._metadata.hasRenderedHead = true;
|
|
1026
|
+
const styles = Array.from(result.styles).filter(uniqueElements).map((style) => renderElement$1("style", style));
|
|
1027
|
+
result.styles.clear();
|
|
1028
|
+
const scripts = Array.from(result.scripts).filter(uniqueElements).map((script, i) => {
|
|
1029
|
+
return renderElement$1("script", script, false);
|
|
1030
|
+
});
|
|
1031
|
+
const links = Array.from(result.links).filter(uniqueElements).map((link) => renderElement$1("link", link, false));
|
|
1032
|
+
let content = links.join("\n") + styles.join("\n") + scripts.join("\n");
|
|
1033
|
+
if (result.extraHead.length > 0) {
|
|
1034
|
+
for (const part of result.extraHead) {
|
|
1035
|
+
content += part;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
return markHTMLString(content);
|
|
1039
|
+
}
|
|
1040
|
+
function* renderHead(result) {
|
|
1041
|
+
yield { type: "head", result };
|
|
1042
|
+
}
|
|
1043
|
+
function* maybeRenderHead(result) {
|
|
1044
|
+
if (result._metadata.hasRenderedHead) {
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
yield { type: "maybe-head", result, scope: result.scope };
|
|
937
1048
|
}
|
|
938
1049
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1050
|
+
const ScopeFlags = {
|
|
1051
|
+
Astro: 1 << 0,
|
|
1052
|
+
JSX: 1 << 1,
|
|
1053
|
+
Slot: 1 << 2,
|
|
1054
|
+
HeadBuffer: 1 << 3,
|
|
1055
|
+
RenderSlot: 1 << 4
|
|
1056
|
+
};
|
|
1057
|
+
function addScopeFlag(result, flag) {
|
|
1058
|
+
result.scope |= flag;
|
|
1059
|
+
}
|
|
1060
|
+
function hasScopeFlag(result, flag) {
|
|
1061
|
+
return (result.scope & flag) === flag;
|
|
1062
|
+
}
|
|
1063
|
+
function createScopedResult(result, flag) {
|
|
1064
|
+
const scopedResult = Object.create(result, {
|
|
1065
|
+
scope: {
|
|
1066
|
+
writable: true,
|
|
1067
|
+
value: result.scope
|
|
950
1068
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
this.stack = stack ? stack : this.stack;
|
|
955
|
-
this.loc = location;
|
|
956
|
-
this.hint = hint;
|
|
957
|
-
this.frame = frame;
|
|
958
|
-
}
|
|
959
|
-
setErrorCode(errorCode) {
|
|
960
|
-
this.errorCode = errorCode;
|
|
1069
|
+
});
|
|
1070
|
+
if (flag != null) {
|
|
1071
|
+
addScopeFlag(scopedResult, flag);
|
|
961
1072
|
}
|
|
962
|
-
|
|
963
|
-
|
|
1073
|
+
return scopedResult;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
const headAndContentSym = Symbol.for("astro.headAndContent");
|
|
1077
|
+
function isHeadAndContent(obj) {
|
|
1078
|
+
return typeof obj === "object" && !!obj[headAndContentSym];
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
var _a$1;
|
|
1082
|
+
const renderTemplateResultSym = Symbol.for("astro.renderTemplateResult");
|
|
1083
|
+
class RenderTemplateResult {
|
|
1084
|
+
constructor(htmlParts, expressions) {
|
|
1085
|
+
this[_a$1] = true;
|
|
1086
|
+
this.htmlParts = htmlParts;
|
|
1087
|
+
this.error = void 0;
|
|
1088
|
+
this.expressions = expressions.map((expression) => {
|
|
1089
|
+
if (isPromise(expression)) {
|
|
1090
|
+
return Promise.resolve(expression).catch((err) => {
|
|
1091
|
+
if (!this.error) {
|
|
1092
|
+
this.error = err;
|
|
1093
|
+
throw err;
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
return expression;
|
|
1098
|
+
});
|
|
964
1099
|
}
|
|
965
|
-
|
|
966
|
-
|
|
1100
|
+
async *[(_a$1 = renderTemplateResultSym, Symbol.asyncIterator)]() {
|
|
1101
|
+
const { htmlParts, expressions } = this;
|
|
1102
|
+
for (let i = 0; i < htmlParts.length; i++) {
|
|
1103
|
+
const html = htmlParts[i];
|
|
1104
|
+
const expression = expressions[i];
|
|
1105
|
+
yield markHTMLString(html);
|
|
1106
|
+
yield* renderChild(expression);
|
|
1107
|
+
}
|
|
967
1108
|
}
|
|
968
|
-
|
|
969
|
-
|
|
1109
|
+
}
|
|
1110
|
+
function isRenderTemplateResult(obj) {
|
|
1111
|
+
return typeof obj === "object" && !!obj[renderTemplateResultSym];
|
|
1112
|
+
}
|
|
1113
|
+
async function* renderAstroTemplateResult(component) {
|
|
1114
|
+
for await (const value of component) {
|
|
1115
|
+
if (value || value === 0) {
|
|
1116
|
+
for await (const chunk of renderChild(value)) {
|
|
1117
|
+
switch (chunk.type) {
|
|
1118
|
+
case "directive": {
|
|
1119
|
+
yield chunk;
|
|
1120
|
+
break;
|
|
1121
|
+
}
|
|
1122
|
+
default: {
|
|
1123
|
+
yield markHTMLString(chunk);
|
|
1124
|
+
break;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
970
1129
|
}
|
|
971
|
-
|
|
972
|
-
|
|
1130
|
+
}
|
|
1131
|
+
function renderTemplate(htmlParts, ...expressions) {
|
|
1132
|
+
return new RenderTemplateResult(htmlParts, expressions);
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
function isAstroComponentFactory(obj) {
|
|
1136
|
+
return obj == null ? false : obj.isAstroComponentFactory === true;
|
|
1137
|
+
}
|
|
1138
|
+
async function renderToString(result, componentFactory, props, children) {
|
|
1139
|
+
const scoped = createScopedResult(result, ScopeFlags.Astro);
|
|
1140
|
+
const factoryResult = await componentFactory(scoped, props, children);
|
|
1141
|
+
if (factoryResult instanceof Response) {
|
|
1142
|
+
const response = factoryResult;
|
|
1143
|
+
throw response;
|
|
973
1144
|
}
|
|
974
|
-
|
|
975
|
-
|
|
1145
|
+
let parts = new HTMLParts();
|
|
1146
|
+
const templateResult = isHeadAndContent(factoryResult) ? factoryResult.content : factoryResult;
|
|
1147
|
+
for await (const chunk of renderAstroTemplateResult(templateResult)) {
|
|
1148
|
+
parts.append(chunk, result);
|
|
976
1149
|
}
|
|
977
|
-
|
|
978
|
-
|
|
1150
|
+
return parts.toString();
|
|
1151
|
+
}
|
|
1152
|
+
function isAPropagatingComponent(result, factory) {
|
|
1153
|
+
let hint = factory.propagation || "none";
|
|
1154
|
+
if (factory.moduleId && result.propagation.has(factory.moduleId) && hint === "none") {
|
|
1155
|
+
hint = result.propagation.get(factory.moduleId);
|
|
979
1156
|
}
|
|
1157
|
+
return hint === "in-tree" || hint === "self";
|
|
980
1158
|
}
|
|
981
1159
|
|
|
982
1160
|
const PROP_TYPE = {
|
|
@@ -1190,17 +1368,19 @@ class AstroComponentInstance {
|
|
|
1190
1368
|
this.props = props;
|
|
1191
1369
|
this.factory = factory;
|
|
1192
1370
|
this.slotValues = {};
|
|
1371
|
+
const scoped = createScopedResult(result, ScopeFlags.Slot);
|
|
1193
1372
|
for (const name in slots) {
|
|
1194
|
-
|
|
1373
|
+
const value = slots[name](scoped);
|
|
1374
|
+
this.slotValues[name] = () => value;
|
|
1195
1375
|
}
|
|
1196
1376
|
}
|
|
1197
|
-
async init() {
|
|
1198
|
-
this.returnValue = this.factory(
|
|
1377
|
+
async init(result) {
|
|
1378
|
+
this.returnValue = this.factory(result, this.props, this.slotValues);
|
|
1199
1379
|
return this.returnValue;
|
|
1200
1380
|
}
|
|
1201
1381
|
async *render() {
|
|
1202
1382
|
if (this.returnValue === void 0) {
|
|
1203
|
-
await this.init();
|
|
1383
|
+
await this.init(this.result);
|
|
1204
1384
|
}
|
|
1205
1385
|
let value = this.returnValue;
|
|
1206
1386
|
if (isPromise(value)) {
|
|
@@ -1278,13 +1458,14 @@ class SlotString extends HTMLString {
|
|
|
1278
1458
|
function isSlotString(str) {
|
|
1279
1459
|
return !!str[slotString];
|
|
1280
1460
|
}
|
|
1281
|
-
async function renderSlot(
|
|
1461
|
+
async function renderSlot(result, slotted, fallback) {
|
|
1282
1462
|
if (slotted) {
|
|
1283
|
-
|
|
1463
|
+
const scoped = createScopedResult(result, ScopeFlags.Slot);
|
|
1464
|
+
let iterator = renderChild(typeof slotted === "function" ? slotted(scoped) : slotted);
|
|
1284
1465
|
let content = "";
|
|
1285
1466
|
let instructions = null;
|
|
1286
1467
|
for await (const chunk of iterator) {
|
|
1287
|
-
if (chunk.type === "
|
|
1468
|
+
if (typeof chunk.type === "string") {
|
|
1288
1469
|
if (instructions === null) {
|
|
1289
1470
|
instructions = [];
|
|
1290
1471
|
}
|
|
@@ -1295,7 +1476,10 @@ async function renderSlot(_result, slotted, fallback) {
|
|
|
1295
1476
|
}
|
|
1296
1477
|
return markHTMLString(new SlotString(content, instructions));
|
|
1297
1478
|
}
|
|
1298
|
-
|
|
1479
|
+
if (fallback) {
|
|
1480
|
+
return renderSlot(result, fallback);
|
|
1481
|
+
}
|
|
1482
|
+
return "";
|
|
1299
1483
|
}
|
|
1300
1484
|
async function renderSlots(result, slots = {}) {
|
|
1301
1485
|
let slotInstructions = null;
|
|
@@ -1323,33 +1507,72 @@ const Renderer = Symbol.for("astro:renderer");
|
|
|
1323
1507
|
const encoder = new TextEncoder();
|
|
1324
1508
|
const decoder = new TextDecoder();
|
|
1325
1509
|
function stringifyChunk(result, chunk) {
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
let
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1510
|
+
if (typeof chunk.type === "string") {
|
|
1511
|
+
const instruction = chunk;
|
|
1512
|
+
switch (instruction.type) {
|
|
1513
|
+
case "directive": {
|
|
1514
|
+
const { hydration } = instruction;
|
|
1515
|
+
let needsHydrationScript = hydration && determineIfNeedsHydrationScript(result);
|
|
1516
|
+
let needsDirectiveScript = hydration && determinesIfNeedsDirectiveScript(result, hydration.directive);
|
|
1517
|
+
let prescriptType = needsHydrationScript ? "both" : needsDirectiveScript ? "directive" : null;
|
|
1518
|
+
if (prescriptType) {
|
|
1519
|
+
let prescripts = getPrescripts(prescriptType, hydration.directive);
|
|
1520
|
+
return markHTMLString(prescripts);
|
|
1521
|
+
} else {
|
|
1522
|
+
return "";
|
|
1523
|
+
}
|
|
1337
1524
|
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1525
|
+
case "head": {
|
|
1526
|
+
if (result._metadata.hasRenderedHead) {
|
|
1527
|
+
return "";
|
|
1528
|
+
}
|
|
1529
|
+
return renderAllHeadContent(result);
|
|
1530
|
+
}
|
|
1531
|
+
case "maybe-head": {
|
|
1532
|
+
if (result._metadata.hasRenderedHead) {
|
|
1533
|
+
return "";
|
|
1534
|
+
}
|
|
1535
|
+
const scope = instruction.scope;
|
|
1536
|
+
switch (scope) {
|
|
1537
|
+
case ScopeFlags.JSX | ScopeFlags.Slot | ScopeFlags.Astro:
|
|
1538
|
+
case ScopeFlags.JSX | ScopeFlags.Astro | ScopeFlags.HeadBuffer:
|
|
1539
|
+
case ScopeFlags.JSX | ScopeFlags.Slot | ScopeFlags.Astro | ScopeFlags.HeadBuffer: {
|
|
1540
|
+
return "";
|
|
1541
|
+
}
|
|
1542
|
+
case ScopeFlags.JSX | ScopeFlags.Astro: {
|
|
1543
|
+
if (hasScopeFlag(result, ScopeFlags.JSX)) {
|
|
1544
|
+
return "";
|
|
1545
|
+
}
|
|
1546
|
+
break;
|
|
1547
|
+
}
|
|
1548
|
+
case ScopeFlags.Slot: {
|
|
1549
|
+
if (hasScopeFlag(result, ScopeFlags.RenderSlot)) {
|
|
1550
|
+
return "";
|
|
1551
|
+
}
|
|
1552
|
+
break;
|
|
1553
|
+
}
|
|
1554
|
+
case ScopeFlags.RenderSlot | ScopeFlags.Astro:
|
|
1555
|
+
case ScopeFlags.RenderSlot | ScopeFlags.Astro | ScopeFlags.JSX:
|
|
1556
|
+
case ScopeFlags.RenderSlot | ScopeFlags.Astro | ScopeFlags.JSX | ScopeFlags.HeadBuffer: {
|
|
1557
|
+
return "";
|
|
1346
1558
|
}
|
|
1347
1559
|
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1560
|
+
return renderAllHeadContent(result);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
} else {
|
|
1564
|
+
if (isSlotString(chunk)) {
|
|
1565
|
+
let out = "";
|
|
1566
|
+
const c = chunk;
|
|
1567
|
+
if (c.instructions) {
|
|
1568
|
+
for (const instr of c.instructions) {
|
|
1569
|
+
out += stringifyChunk(result, instr);
|
|
1570
|
+
}
|
|
1350
1571
|
}
|
|
1351
|
-
|
|
1572
|
+
out += chunk.toString();
|
|
1573
|
+
return out;
|
|
1352
1574
|
}
|
|
1575
|
+
return chunk.toString();
|
|
1353
1576
|
}
|
|
1354
1577
|
}
|
|
1355
1578
|
class HTMLParts {
|
|
@@ -1374,7 +1597,8 @@ function chunkToByteArray(result, chunk) {
|
|
|
1374
1597
|
if (chunk instanceof Uint8Array) {
|
|
1375
1598
|
return chunk;
|
|
1376
1599
|
}
|
|
1377
|
-
|
|
1600
|
+
let stringified = stringifyChunk(result, chunk);
|
|
1601
|
+
return encoder.encode(stringified.toString());
|
|
1378
1602
|
}
|
|
1379
1603
|
|
|
1380
1604
|
const ClientOnlyPlaceholder = "astro-client-only";
|
|
@@ -1445,12 +1669,14 @@ Did you forget to import the component or is it possible there is a typo?`);
|
|
|
1445
1669
|
props[key] = value;
|
|
1446
1670
|
}
|
|
1447
1671
|
}
|
|
1448
|
-
|
|
1672
|
+
const scoped = createScopedResult(result, ScopeFlags.JSX);
|
|
1673
|
+
const html = markHTMLString(await renderToString(scoped, vnode.type, props, slots));
|
|
1674
|
+
return html;
|
|
1449
1675
|
}
|
|
1450
1676
|
case (!vnode.type && vnode.type !== 0):
|
|
1451
1677
|
return "";
|
|
1452
1678
|
case (typeof vnode.type === "string" && vnode.type !== ClientOnlyPlaceholder):
|
|
1453
|
-
return markHTMLString(await renderElement
|
|
1679
|
+
return markHTMLString(await renderElement(result, vnode.type, vnode.props ?? {}));
|
|
1454
1680
|
}
|
|
1455
1681
|
if (vnode.type) {
|
|
1456
1682
|
let extractSlots2 = function(child) {
|
|
@@ -1555,7 +1781,7 @@ Did you forget to import the component or is it possible there is a typo?`);
|
|
|
1555
1781
|
}
|
|
1556
1782
|
return markHTMLString(`${vnode}`);
|
|
1557
1783
|
}
|
|
1558
|
-
async function renderElement
|
|
1784
|
+
async function renderElement(result, tag, { children, ...props }) {
|
|
1559
1785
|
return markHTMLString(
|
|
1560
1786
|
`<${tag}${spreadAttributes(props)}${markHTMLString(
|
|
1561
1787
|
(children == null || children == "") && voidElementNames.test(tag) ? `/>` : `>${children == null ? "" : await renderJSX(result, children)}</${tag}>`
|
|
@@ -1644,93 +1870,6 @@ function shorthash(text) {
|
|
|
1644
1870
|
return sign + result;
|
|
1645
1871
|
}
|
|
1646
1872
|
|
|
1647
|
-
const voidElementNames = /^(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i;
|
|
1648
|
-
const htmlBooleanAttributes = /^(allowfullscreen|async|autofocus|autoplay|controls|default|defer|disabled|disablepictureinpicture|disableremoteplayback|formnovalidate|hidden|loop|nomodule|novalidate|open|playsinline|readonly|required|reversed|scoped|seamless|itemscope)$/i;
|
|
1649
|
-
const htmlEnumAttributes = /^(contenteditable|draggable|spellcheck|value)$/i;
|
|
1650
|
-
const svgEnumAttributes = /^(autoReverse|externalResourcesRequired|focusable|preserveAlpha)$/i;
|
|
1651
|
-
const STATIC_DIRECTIVES = /* @__PURE__ */ new Set(["set:html", "set:text"]);
|
|
1652
|
-
const toIdent = (k) => k.trim().replace(/(?:(?!^)\b\w|\s+|[^\w]+)/g, (match, index) => {
|
|
1653
|
-
if (/[^\w]|\s/.test(match))
|
|
1654
|
-
return "";
|
|
1655
|
-
return index === 0 ? match : match.toUpperCase();
|
|
1656
|
-
});
|
|
1657
|
-
const toAttributeString = (value, shouldEscape = true) => shouldEscape ? String(value).replace(/&/g, "&").replace(/"/g, """) : value;
|
|
1658
|
-
const kebab = (k) => k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
|
1659
|
-
const toStyleString = (obj) => Object.entries(obj).map(([k, v]) => `${kebab(k)}:${v}`).join(";");
|
|
1660
|
-
function defineScriptVars(vars) {
|
|
1661
|
-
let output = "";
|
|
1662
|
-
for (const [key, value] of Object.entries(vars)) {
|
|
1663
|
-
output += `const ${toIdent(key)} = ${JSON.stringify(value)};
|
|
1664
|
-
`;
|
|
1665
|
-
}
|
|
1666
|
-
return markHTMLString(output);
|
|
1667
|
-
}
|
|
1668
|
-
function formatList(values) {
|
|
1669
|
-
if (values.length === 1) {
|
|
1670
|
-
return values[0];
|
|
1671
|
-
}
|
|
1672
|
-
return `${values.slice(0, -1).join(", ")} or ${values[values.length - 1]}`;
|
|
1673
|
-
}
|
|
1674
|
-
function addAttribute(value, key, shouldEscape = true) {
|
|
1675
|
-
if (value == null) {
|
|
1676
|
-
return "";
|
|
1677
|
-
}
|
|
1678
|
-
if (value === false) {
|
|
1679
|
-
if (htmlEnumAttributes.test(key) || svgEnumAttributes.test(key)) {
|
|
1680
|
-
return markHTMLString(` ${key}="false"`);
|
|
1681
|
-
}
|
|
1682
|
-
return "";
|
|
1683
|
-
}
|
|
1684
|
-
if (STATIC_DIRECTIVES.has(key)) {
|
|
1685
|
-
console.warn(`[astro] The "${key}" directive cannot be applied dynamically at runtime. It will not be rendered as an attribute.
|
|
1686
|
-
|
|
1687
|
-
Make sure to use the static attribute syntax (\`${key}={value}\`) instead of the dynamic spread syntax (\`{...{ "${key}": value }}\`).`);
|
|
1688
|
-
return "";
|
|
1689
|
-
}
|
|
1690
|
-
if (key === "class:list") {
|
|
1691
|
-
const listValue = toAttributeString(serializeListValue(value), shouldEscape);
|
|
1692
|
-
if (listValue === "") {
|
|
1693
|
-
return "";
|
|
1694
|
-
}
|
|
1695
|
-
return markHTMLString(` ${key.slice(0, -5)}="${listValue}"`);
|
|
1696
|
-
}
|
|
1697
|
-
if (key === "style" && !(value instanceof HTMLString) && typeof value === "object") {
|
|
1698
|
-
return markHTMLString(` ${key}="${toAttributeString(toStyleString(value), shouldEscape)}"`);
|
|
1699
|
-
}
|
|
1700
|
-
if (key === "className") {
|
|
1701
|
-
return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`);
|
|
1702
|
-
}
|
|
1703
|
-
if (value === true && (key.startsWith("data-") || htmlBooleanAttributes.test(key))) {
|
|
1704
|
-
return markHTMLString(` ${key}`);
|
|
1705
|
-
} else {
|
|
1706
|
-
return markHTMLString(` ${key}="${toAttributeString(value, shouldEscape)}"`);
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
function internalSpreadAttributes(values, shouldEscape = true) {
|
|
1710
|
-
let output = "";
|
|
1711
|
-
for (const [key, value] of Object.entries(values)) {
|
|
1712
|
-
output += addAttribute(value, key, shouldEscape);
|
|
1713
|
-
}
|
|
1714
|
-
return markHTMLString(output);
|
|
1715
|
-
}
|
|
1716
|
-
function renderElement(name, { props: _props, children = "" }, shouldEscape = true) {
|
|
1717
|
-
const { lang: _, "data-astro-id": astroId, "define:vars": defineVars, ...props } = _props;
|
|
1718
|
-
if (defineVars) {
|
|
1719
|
-
if (name === "style") {
|
|
1720
|
-
delete props["is:global"];
|
|
1721
|
-
delete props["is:scoped"];
|
|
1722
|
-
}
|
|
1723
|
-
if (name === "script") {
|
|
1724
|
-
delete props.hoist;
|
|
1725
|
-
children = defineScriptVars(defineVars) + "\n" + children;
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
if ((children == null || children == "") && voidElementNames.test(name)) {
|
|
1729
|
-
return `<${name}${internalSpreadAttributes(props, shouldEscape)} />`;
|
|
1730
|
-
}
|
|
1731
|
-
return `<${name}${internalSpreadAttributes(props, shouldEscape)}>${children}</${name}>`;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
1873
|
function componentIsHTMLElement(Component) {
|
|
1735
1874
|
return typeof HTMLElement !== "undefined" && HTMLElement.isPrototypeOf(Component);
|
|
1736
1875
|
}
|
|
@@ -1769,7 +1908,8 @@ function guessRenderers(componentUrl) {
|
|
|
1769
1908
|
"@astrojs/preact",
|
|
1770
1909
|
"@astrojs/solid-js",
|
|
1771
1910
|
"@astrojs/vue",
|
|
1772
|
-
"@astrojs/svelte"
|
|
1911
|
+
"@astrojs/svelte",
|
|
1912
|
+
"@astrojs/lit"
|
|
1773
1913
|
];
|
|
1774
1914
|
}
|
|
1775
1915
|
}
|
|
@@ -1943,8 +2083,10 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr
|
|
|
1943
2083
|
}
|
|
1944
2084
|
if (isPage || (renderer == null ? void 0 : renderer.name) === "astro:jsx") {
|
|
1945
2085
|
yield html;
|
|
1946
|
-
} else {
|
|
2086
|
+
} else if (html && html.length > 0) {
|
|
1947
2087
|
yield markHTMLString(html.replace(/\<\/?astro-slot\>/g, ""));
|
|
2088
|
+
} else {
|
|
2089
|
+
yield "";
|
|
1948
2090
|
}
|
|
1949
2091
|
}();
|
|
1950
2092
|
}
|
|
@@ -1984,7 +2126,7 @@ ${serializeProps(
|
|
|
1984
2126
|
yield* slotInstructions;
|
|
1985
2127
|
}
|
|
1986
2128
|
yield { type: "directive", hydration, result };
|
|
1987
|
-
yield markHTMLString(renderElement("astro-island", island, false));
|
|
2129
|
+
yield markHTMLString(renderElement$1("astro-island", island, false));
|
|
1988
2130
|
}
|
|
1989
2131
|
return renderAll();
|
|
1990
2132
|
}
|
|
@@ -2032,43 +2174,6 @@ function renderComponentToIterable(result, displayName, Component, props, slots
|
|
|
2032
2174
|
return renderResult;
|
|
2033
2175
|
}
|
|
2034
2176
|
|
|
2035
|
-
const uniqueElements = (item, index, all) => {
|
|
2036
|
-
const props = JSON.stringify(item.props);
|
|
2037
|
-
const children = item.children;
|
|
2038
|
-
return index === all.findIndex((i) => JSON.stringify(i.props) === props && i.children == children);
|
|
2039
|
-
};
|
|
2040
|
-
async function* renderExtraHead(result, base) {
|
|
2041
|
-
yield base;
|
|
2042
|
-
for (const part of result.extraHead) {
|
|
2043
|
-
yield* renderChild(part);
|
|
2044
|
-
}
|
|
2045
|
-
}
|
|
2046
|
-
function renderAllHeadContent(result) {
|
|
2047
|
-
const styles = Array.from(result.styles).filter(uniqueElements).map((style) => renderElement("style", style));
|
|
2048
|
-
result.styles.clear();
|
|
2049
|
-
const scripts = Array.from(result.scripts).filter(uniqueElements).map((script, i) => {
|
|
2050
|
-
return renderElement("script", script, false);
|
|
2051
|
-
});
|
|
2052
|
-
const links = Array.from(result.links).filter(uniqueElements).map((link) => renderElement("link", link, false));
|
|
2053
|
-
const baseHeadContent = markHTMLString(links.join("\n") + styles.join("\n") + scripts.join("\n"));
|
|
2054
|
-
if (result.extraHead.length > 0) {
|
|
2055
|
-
return renderExtraHead(result, baseHeadContent);
|
|
2056
|
-
} else {
|
|
2057
|
-
return baseHeadContent;
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
function createRenderHead(result) {
|
|
2061
|
-
result._metadata.hasRenderedHead = true;
|
|
2062
|
-
return renderAllHeadContent.bind(null, result);
|
|
2063
|
-
}
|
|
2064
|
-
const renderHead = createRenderHead;
|
|
2065
|
-
async function* maybeRenderHead(result) {
|
|
2066
|
-
if (result._metadata.hasRenderedHead) {
|
|
2067
|
-
return;
|
|
2068
|
-
}
|
|
2069
|
-
yield createRenderHead(result)();
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
2177
|
var __accessCheck$2 = (obj, member, msg) => {
|
|
2073
2178
|
if (!member.has(obj))
|
|
2074
2179
|
throw TypeError("Cannot " + msg);
|
|
@@ -2172,12 +2277,13 @@ async function iterableToHTMLBytes(result, iterable, onDocTypeInjection) {
|
|
|
2172
2277
|
}
|
|
2173
2278
|
async function bufferHeadContent(result) {
|
|
2174
2279
|
const iterator = result.propagators.values();
|
|
2280
|
+
const scoped = createScopedResult(result, ScopeFlags.HeadBuffer);
|
|
2175
2281
|
while (true) {
|
|
2176
2282
|
const { value, done } = iterator.next();
|
|
2177
2283
|
if (done) {
|
|
2178
2284
|
break;
|
|
2179
2285
|
}
|
|
2180
|
-
const returnValue = await value.init();
|
|
2286
|
+
const returnValue = await value.init(scoped);
|
|
2181
2287
|
if (isHeadAndContent(returnValue)) {
|
|
2182
2288
|
result.extraHead.push(returnValue.head);
|
|
2183
2289
|
}
|
|
@@ -2513,6 +2619,7 @@ class Slots {
|
|
|
2513
2619
|
async render(name, args = []) {
|
|
2514
2620
|
if (!__privateGet$1(this, _slots) || !this.has(name))
|
|
2515
2621
|
return;
|
|
2622
|
+
const scoped = createScopedResult(__privateGet$1(this, _result), ScopeFlags.RenderSlot);
|
|
2516
2623
|
if (!Array.isArray(args)) {
|
|
2517
2624
|
warn(
|
|
2518
2625
|
__privateGet$1(this, _loggingOpts),
|
|
@@ -2521,22 +2628,20 @@ class Slots {
|
|
|
2521
2628
|
);
|
|
2522
2629
|
} else if (args.length > 0) {
|
|
2523
2630
|
const slotValue = __privateGet$1(this, _slots)[name];
|
|
2524
|
-
const component = typeof slotValue === "function" ? await slotValue() : await slotValue;
|
|
2631
|
+
const component = typeof slotValue === "function" ? await slotValue(scoped) : await slotValue;
|
|
2525
2632
|
const expression = getFunctionExpression(component);
|
|
2526
2633
|
if (expression) {
|
|
2527
|
-
const slot = expression(...args);
|
|
2528
|
-
return await renderSlot(
|
|
2529
|
-
(res) => res != null ? String(res) : res
|
|
2530
|
-
);
|
|
2634
|
+
const slot = () => expression(...args);
|
|
2635
|
+
return await renderSlot(scoped, slot).then((res) => res != null ? String(res) : res);
|
|
2531
2636
|
}
|
|
2532
2637
|
if (typeof component === "function") {
|
|
2533
|
-
return await renderJSX(
|
|
2638
|
+
return await renderJSX(scoped, component(...args)).then(
|
|
2534
2639
|
(res) => res != null ? String(res) : res
|
|
2535
2640
|
);
|
|
2536
2641
|
}
|
|
2537
2642
|
}
|
|
2538
|
-
const content = await renderSlot(
|
|
2539
|
-
const outHTML = stringifyChunk(
|
|
2643
|
+
const content = await renderSlot(scoped, __privateGet$1(this, _slots)[name]);
|
|
2644
|
+
const outHTML = stringifyChunk(scoped, content);
|
|
2540
2645
|
return outHTML;
|
|
2541
2646
|
}
|
|
2542
2647
|
}
|
|
@@ -2567,6 +2672,7 @@ function createResult(args) {
|
|
|
2567
2672
|
propagation: args.propagation ?? /* @__PURE__ */ new Map(),
|
|
2568
2673
|
propagators: /* @__PURE__ */ new Map(),
|
|
2569
2674
|
extraHead: [],
|
|
2675
|
+
scope: 0,
|
|
2570
2676
|
cookies,
|
|
2571
2677
|
createAstro(astroGlobal, props, slots) {
|
|
2572
2678
|
const astroSlots = new Slots(result, slots, args.logging);
|
|
@@ -2652,10 +2758,10 @@ function generatePaginateFunction(routeMatch) {
|
|
|
2652
2758
|
} else if (routeMatch.params.includes(`${paramName}`)) {
|
|
2653
2759
|
includesFirstPageNumber = true;
|
|
2654
2760
|
} else {
|
|
2655
|
-
throw new
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
);
|
|
2761
|
+
throw new AstroError({
|
|
2762
|
+
...AstroErrorData.PageNumberParamNotFound,
|
|
2763
|
+
message: AstroErrorData.PageNumberParamNotFound.message(paramName)
|
|
2764
|
+
});
|
|
2659
2765
|
}
|
|
2660
2766
|
const lastPage = Math.max(1, Math.ceil(data.length / pageSize));
|
|
2661
2767
|
const result = [...Array(lastPage).keys()].map((num) => {
|
|
@@ -2683,7 +2789,7 @@ Rename your file to \`[...page].astro\` or customize the param name via the \`pa
|
|
|
2683
2789
|
next: pageNum === lastPage ? void 0 : routeMatch.generate({ ...params, page: String(pageNum + 1) }),
|
|
2684
2790
|
prev: pageNum === 1 ? void 0 : routeMatch.generate({
|
|
2685
2791
|
...params,
|
|
2686
|
-
page: !includesFirstPageNumber && pageNum - 1 === 1 ?
|
|
2792
|
+
page: !includesFirstPageNumber && pageNum - 1 === 1 ? "" : String(pageNum - 1)
|
|
2687
2793
|
})
|
|
2688
2794
|
}
|
|
2689
2795
|
}
|
|
@@ -3237,6 +3343,7 @@ renderPage_fn = async function(request, routeData, mod, status = 200) {
|
|
|
3237
3343
|
request,
|
|
3238
3344
|
origin: url.origin,
|
|
3239
3345
|
pathname,
|
|
3346
|
+
propagation: __privateGet(this, _manifest).propagation,
|
|
3240
3347
|
scripts,
|
|
3241
3348
|
links,
|
|
3242
3349
|
route: routeData,
|
|
@@ -3375,4 +3482,4 @@ var server_default = {
|
|
|
3375
3482
|
renderToStaticMarkup
|
|
3376
3483
|
};
|
|
3377
3484
|
|
|
3378
|
-
export { Fragment as F, NodeApp as N, createComponent as a, addAttribute as b, createAstro as c,
|
|
3485
|
+
export { Fragment as F, NodeApp as N, createComponent as a, addAttribute as b, createAstro as c, renderSlot as d, renderComponent as e, renderHead as f, server_default as g, deserializeManifest as h, maybeRenderHead as m, renderTemplate as r, spreadAttributes as s, unescapeHTML as u };
|