@justanarthur/payload-www 1.4.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -33
- package/dist/access.d.ts +1 -1
- package/dist/access.js +3 -5
- package/dist/blocks.d.ts +1 -1
- package/dist/blocks.js +2 -4
- package/dist/cli.js +0 -2
- package/dist/collections.d.ts +19 -19
- package/dist/collections.js +91 -125
- package/dist/config.d.ts +2 -1
- package/dist/config.js +17 -47
- package/dist/fields.d.ts +4 -5
- package/dist/fields.js +14 -48
- package/dist/imagehash.d.ts +1 -1
- package/dist/imagehash.js +2 -4
- package/dist/import-map-provider.d.ts +1 -1
- package/dist/import-map-provider.js +2 -4
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -4
- package/dist/metadata.d.ts +35 -10
- package/dist/metadata.js +99 -122
- package/dist/pages.d.ts +15 -5
- package/dist/pages.js +119 -136
- package/dist/render-pages.d.ts +18 -8
- package/dist/render-pages.js +146 -149
- package/dist/sitemap.d.ts +18 -2
- package/dist/sitemap.js +118 -132
- package/dist/translator.d.ts +1 -1
- package/dist/translator.js +2 -4
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -4
- package/package.json +16 -14
package/dist/render-pages.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
// src/render/pages/FooterPage.tsx
|
|
4
|
-
import"server-only";
|
|
5
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
3
|
function FooterPage({ data }) {
|
|
7
4
|
const nav = data.nav ?? [];
|
|
@@ -59,7 +56,6 @@ function FooterPage({ data }) {
|
|
|
59
56
|
}
|
|
60
57
|
|
|
61
58
|
// src/render/pages/HeaderPage.tsx
|
|
62
|
-
import"server-only";
|
|
63
59
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
64
60
|
function HeaderPage({ data }) {
|
|
65
61
|
const nav = data.nav ?? [];
|
|
@@ -208,7 +204,7 @@ async function PostsPage({ doc, locale, ...props }) {
|
|
|
208
204
|
}
|
|
209
205
|
|
|
210
206
|
// src/render/pages/createCollectionPageExports.tsx
|
|
211
|
-
import"
|
|
207
|
+
import * as React from "react";
|
|
212
208
|
|
|
213
209
|
// src/render/metadata/slug.ts
|
|
214
210
|
var SLUG_NESTED_DIVIDER = "_";
|
|
@@ -229,135 +225,112 @@ function slugToPath(slug) {
|
|
|
229
225
|
}
|
|
230
226
|
|
|
231
227
|
// src/render/metadata/query.ts
|
|
228
|
+
import { createCacheHelpers } from "@pro-laico/payload-revalidate/cache";
|
|
229
|
+
import { tagsFor } from "@pro-laico/payload-revalidate";
|
|
230
|
+
import { cacheLife } from "next/cache";
|
|
232
231
|
import { getPayload } from "payload";
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
} catch (error) {
|
|
243
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
244
|
-
if (msg.includes("static generation store missing"))
|
|
245
|
-
return;
|
|
246
|
-
console.error(error);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
if ("collection" in args) {
|
|
250
|
-
[
|
|
251
|
-
doc && doc._status !== "draft" && doc.slug,
|
|
252
|
-
previousDoc && previousDoc._status === "published" && previousDoc.slug
|
|
253
|
-
].filter((slug) => slug !== undefined && slug !== false).map((slug) => revalidate({ collectionSlug: args.collection.slug, slug }));
|
|
254
|
-
} else {
|
|
255
|
-
revalidate({ globalSlug: args.global.slug });
|
|
256
|
-
}
|
|
257
|
-
return doc;
|
|
258
|
-
};
|
|
259
|
-
return { afterChange: afterChangeDeleteHook, afterDelete: afterChangeDeleteHook };
|
|
260
|
-
}
|
|
261
|
-
function createCollectionCacheKey(args) {
|
|
262
|
-
return `${"globalSlug" in args ? args.globalSlug : args.collectionSlug + args.slug}_${args.locale}`;
|
|
232
|
+
var _helpers = null;
|
|
233
|
+
var _seedPromise = null;
|
|
234
|
+
function seedPayloadCache({ config }) {
|
|
235
|
+
if (_helpers || _seedPromise)
|
|
236
|
+
return;
|
|
237
|
+
_seedPromise = (async () => {
|
|
238
|
+
const payload = await getPayload({ config: await config });
|
|
239
|
+
_helpers = createCacheHelpers(payload);
|
|
240
|
+
})();
|
|
263
241
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
242
|
+
async function requireCacheHelpers() {
|
|
243
|
+
if (_helpers)
|
|
244
|
+
return _helpers;
|
|
245
|
+
if (_seedPromise) {
|
|
246
|
+
await _seedPromise;
|
|
247
|
+
if (_helpers)
|
|
248
|
+
return _helpers;
|
|
249
|
+
}
|
|
250
|
+
throw new Error("[payload-www] seedPayloadCache({ config }) must be called before any query getter. " + "Call it from createCollectionPageExports / createRootLayoutExports factory, or in your root layout.");
|
|
269
251
|
}
|
|
270
|
-
async function
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
252
|
+
async function queryDocBySlug(args) {
|
|
253
|
+
"use cache";
|
|
254
|
+
cacheLife("weeks");
|
|
255
|
+
const { findDoc } = await requireCacheHelpers();
|
|
256
|
+
const slugField = args.slugField ?? "slug";
|
|
257
|
+
const result = await findDoc(args.collectionSlug, {
|
|
258
|
+
where: { [slugField]: { equals: args.slug } },
|
|
259
|
+
locale: args.locale,
|
|
260
|
+
draft: args.draft ?? false,
|
|
261
|
+
depth: args.depth
|
|
276
262
|
});
|
|
263
|
+
return result ?? null;
|
|
277
264
|
}
|
|
278
|
-
async function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
const payload = await getPayload({ config });
|
|
288
|
-
const result = await payload.find({
|
|
289
|
-
collection: collectionSlug,
|
|
290
|
-
draft,
|
|
291
|
-
limit: 1,
|
|
292
|
-
pagination: false,
|
|
293
|
-
overrideAccess: draft,
|
|
294
|
-
where: { [slugField]: { equals: slug } },
|
|
295
|
-
locale
|
|
265
|
+
async function queryGlobal(args) {
|
|
266
|
+
"use cache";
|
|
267
|
+
cacheLife("weeks");
|
|
268
|
+
const { findGlobal } = await requireCacheHelpers();
|
|
269
|
+
try {
|
|
270
|
+
const result = await findGlobal(args.globalSlug, {
|
|
271
|
+
locale: args.locale,
|
|
272
|
+
draft: args.draft ?? false,
|
|
273
|
+
depth: args.depth
|
|
296
274
|
});
|
|
297
|
-
return result
|
|
298
|
-
})
|
|
275
|
+
return result ?? null;
|
|
276
|
+
} catch (error) {
|
|
277
|
+
console.warn("[WWW] queryGlobal failed", { globalSlug: args.globalSlug, locale: args.locale, error: String(error) });
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
299
280
|
}
|
|
300
|
-
async function
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
} catch (error) {
|
|
311
|
-
console.warn("[WWW] queryGlobal failed", { globalSlug, locale, error: String(error) });
|
|
312
|
-
return null;
|
|
313
|
-
}
|
|
314
|
-
});
|
|
281
|
+
async function queryAllDocs(args) {
|
|
282
|
+
"use cache";
|
|
283
|
+
cacheLife("weeks");
|
|
284
|
+
const { findIds, findDocByID } = await requireCacheHelpers();
|
|
285
|
+
const collection = args.collectionSlug;
|
|
286
|
+
const { ids } = await findIds(collection, { locale: args.locale });
|
|
287
|
+
if (ids.length === 0)
|
|
288
|
+
return [];
|
|
289
|
+
const docs = await Promise.all(ids.map((id) => findDocByID(collection, id, { locale: args.locale })));
|
|
290
|
+
return docs.filter((d) => d !== null);
|
|
315
291
|
}
|
|
316
|
-
async function
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
config
|
|
321
|
-
}) {
|
|
322
|
-
return withUnstableCache([collectionSlug, slugField, locale], [createCollectionCacheKey({ collectionSlug, slug: "__all__", locale })], async () => {
|
|
323
|
-
const payload = await getPayload({ config });
|
|
324
|
-
const result = await payload.find({
|
|
325
|
-
collection: collectionSlug,
|
|
326
|
-
draft: false,
|
|
327
|
-
limit: 1000,
|
|
328
|
-
pagination: false,
|
|
329
|
-
overrideAccess: false,
|
|
330
|
-
select: { [slugField]: true },
|
|
331
|
-
locale
|
|
332
|
-
});
|
|
333
|
-
return result.docs ?? [];
|
|
334
|
-
});
|
|
292
|
+
async function queryDoc(args) {
|
|
293
|
+
if ("globalSlug" in args)
|
|
294
|
+
return queryGlobal(args);
|
|
295
|
+
return queryDocBySlug(args);
|
|
335
296
|
}
|
|
336
|
-
async function queryAllLocaleSlugs({
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
})
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
297
|
+
async function queryAllLocaleSlugs(args) {
|
|
298
|
+
"use cache";
|
|
299
|
+
cacheLife("weeks");
|
|
300
|
+
const { findDocByID } = await requireCacheHelpers();
|
|
301
|
+
const slugField = args.slugField ?? "slug";
|
|
302
|
+
const doc = await findDocByID(args.collectionSlug, args.id, { locale: "all", select: { [slugField]: true } });
|
|
303
|
+
const localeMap = doc?.[slugField];
|
|
304
|
+
if (localeMap && typeof localeMap === "object")
|
|
305
|
+
return localeMap;
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
async function queryDocByID(args) {
|
|
309
|
+
"use cache";
|
|
310
|
+
cacheLife("weeks");
|
|
311
|
+
const { findDocByID } = await requireCacheHelpers();
|
|
312
|
+
return await findDocByID(args.collectionSlug, args.id, {
|
|
313
|
+
locale: args.locale,
|
|
314
|
+
draft: args.draft ?? false,
|
|
315
|
+
depth: args.depth
|
|
348
316
|
});
|
|
349
|
-
return doc?.[slugField];
|
|
350
317
|
}
|
|
351
318
|
|
|
352
319
|
// src/render/pages/createCollectionPageExports.tsx
|
|
353
320
|
import { setRequestLocale } from "next-intl/server";
|
|
354
321
|
|
|
355
322
|
// src/render/pages/utils/buildLocalizedPath.ts
|
|
323
|
+
function resolvePagePathPrefix(prefix, locale, routing) {
|
|
324
|
+
if (typeof prefix !== "object")
|
|
325
|
+
return prefix;
|
|
326
|
+
return prefix[locale] ?? prefix[routing.defaultLocale];
|
|
327
|
+
}
|
|
356
328
|
function buildLocalizedPath(locale, prefix, slug, { routing }) {
|
|
357
329
|
const path = slugToPath(slug);
|
|
330
|
+
const localePrefix = resolvePagePathPrefix(prefix, locale, routing);
|
|
358
331
|
return `${routing.localePrefix === "never" ? "" : routing.localePrefix === "always" ? locale : routing.localePrefix === "as-needed" ? locale === routing.defaultLocale ? "" : "/" + locale : (() => {
|
|
359
332
|
throw new Error("Unsupported locale prefix");
|
|
360
|
-
})()}${
|
|
333
|
+
})()}${localePrefix ? "/" + localePrefix : ""}${path ? "/" + path : ""}`;
|
|
361
334
|
}
|
|
362
335
|
function buildLocalizedPaths(localesSlug, pagePathPrefix, { routing }) {
|
|
363
336
|
const blankIsHome = !localesSlug[routing.defaultLocale];
|
|
@@ -412,25 +385,31 @@ async function renderWWWDataModule(data, {
|
|
|
412
385
|
import { jsx as jsx7, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
413
386
|
function createCollectionPageExports({
|
|
414
387
|
slug: collectionSlug = "pages",
|
|
415
|
-
|
|
388
|
+
_payloadConfig,
|
|
416
389
|
importMap,
|
|
417
390
|
routing,
|
|
418
391
|
slugShape = "single"
|
|
419
392
|
}, {
|
|
420
393
|
getServerSideURL,
|
|
421
|
-
pagePathPrefix
|
|
394
|
+
pagePathPrefix,
|
|
395
|
+
fallback
|
|
422
396
|
}) {
|
|
397
|
+
seedPayloadCache({ config: _payloadConfig });
|
|
423
398
|
const siteUrl = getServerSideURL();
|
|
424
399
|
async function fetchDoc(locale, slug) {
|
|
425
400
|
return queryDoc({
|
|
426
401
|
slug,
|
|
427
402
|
locale,
|
|
428
403
|
collectionSlug
|
|
429
|
-
}, {
|
|
430
|
-
config: configPromise
|
|
431
404
|
});
|
|
432
405
|
}
|
|
433
|
-
const default_ =
|
|
406
|
+
const default_ = (props) => /* @__PURE__ */ jsx7(React.Suspense, {
|
|
407
|
+
fallback: fallback ?? null,
|
|
408
|
+
children: /* @__PURE__ */ jsx7(CollectionDocument, {
|
|
409
|
+
...props
|
|
410
|
+
})
|
|
411
|
+
});
|
|
412
|
+
const CollectionDocument = async (props) => {
|
|
434
413
|
const params = await props.params;
|
|
435
414
|
const locale = params.locale;
|
|
436
415
|
if (!routing.locales.includes(locale)) {
|
|
@@ -444,22 +423,25 @@ function createCollectionPageExports({
|
|
|
444
423
|
const { notFound } = await import("next/navigation");
|
|
445
424
|
notFound();
|
|
446
425
|
}
|
|
447
|
-
const rendered = renderWWWDataModule(doc, { collectionSlug, config:
|
|
426
|
+
const rendered = renderWWWDataModule(doc, { collectionSlug, config: _payloadConfig, importMap }, { ...props, locale });
|
|
448
427
|
return /* @__PURE__ */ jsx7(Fragment2, {
|
|
449
428
|
children: rendered
|
|
450
429
|
});
|
|
451
430
|
};
|
|
452
431
|
async function generateMetadata(props) {
|
|
453
432
|
const params = await props.params;
|
|
454
|
-
const locale = params.locale
|
|
433
|
+
const locale = params.locale;
|
|
434
|
+
if (!routing.locales.includes(locale)) {
|
|
435
|
+
return {};
|
|
436
|
+
}
|
|
437
|
+
const slug = paramsSlugToSlug(params.slug, slugShape);
|
|
455
438
|
const doc = await fetchDoc(locale, slug);
|
|
456
439
|
const [localesSlug, siteDefaults] = await Promise.all([
|
|
457
440
|
doc ? queryAllLocaleSlugs({
|
|
458
441
|
id: doc.id,
|
|
459
|
-
collectionSlug
|
|
460
|
-
config: configPromise
|
|
442
|
+
collectionSlug
|
|
461
443
|
}) : Promise.resolve({}),
|
|
462
|
-
createSiteDefaults({ config:
|
|
444
|
+
createSiteDefaults({ config: _payloadConfig, locale })
|
|
463
445
|
]);
|
|
464
446
|
if (!doc)
|
|
465
447
|
return {};
|
|
@@ -476,22 +458,23 @@ function createCollectionPageExports({
|
|
|
476
458
|
return { ...meta, alternates };
|
|
477
459
|
}
|
|
478
460
|
async function generateStaticParams(props) {
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
|
|
461
|
+
await props.params;
|
|
462
|
+
const perLocaleEntries = await Promise.all(routing.locales.map(async (locale) => {
|
|
463
|
+
const docs = await queryAllDocs({ locale, collectionSlug });
|
|
464
|
+
return docs.filter((doc) => typeof doc.slug === "string" && doc.slug.length > 0).map((doc) => ({ locale, slug: slugToParamsSlug(doc.slug, slugShape) }));
|
|
465
|
+
}));
|
|
466
|
+
return perLocaleEntries.flat();
|
|
482
467
|
}
|
|
483
468
|
async function generateSitemap() {
|
|
484
469
|
const locale = routing.defaultLocale;
|
|
485
470
|
const docs = await queryAllDocs({
|
|
486
471
|
collectionSlug,
|
|
487
|
-
locale
|
|
488
|
-
config: configPromise
|
|
472
|
+
locale: routing.defaultLocale
|
|
489
473
|
});
|
|
490
474
|
return await Promise.all(docs.map(async (doc) => {
|
|
491
475
|
const localesSlug = await queryAllLocaleSlugs({
|
|
492
476
|
id: doc.id,
|
|
493
|
-
collectionSlug
|
|
494
|
-
config: configPromise
|
|
477
|
+
collectionSlug
|
|
495
478
|
}) ?? {};
|
|
496
479
|
const alternates = buildAlternates(locale, localesSlug, pagePathPrefix, { routing, siteUrl });
|
|
497
480
|
return {
|
|
@@ -502,7 +485,7 @@ function createCollectionPageExports({
|
|
|
502
485
|
}));
|
|
503
486
|
}
|
|
504
487
|
generateSitemap.getServerSideURL = getServerSideURL;
|
|
505
|
-
generateSitemap.pagePathPrefix = pagePathPrefix;
|
|
488
|
+
generateSitemap.pagePathPrefix = resolvePagePathPrefix(pagePathPrefix, routing.defaultLocale, routing);
|
|
506
489
|
return {
|
|
507
490
|
default: default_,
|
|
508
491
|
generateMetadata,
|
|
@@ -526,13 +509,23 @@ ${sitemaps.map((url) => ` <sitemap><loc>${url}</loc></sitemap>`).join(`
|
|
|
526
509
|
}
|
|
527
510
|
|
|
528
511
|
// src/render/pages/createRootLayoutExports.tsx
|
|
529
|
-
import"
|
|
512
|
+
import { Activity } from "react";
|
|
530
513
|
import { setRequestLocale as setRequestLocale2 } from "next-intl/server";
|
|
531
514
|
import { NextIntlClientProvider } from "next-intl";
|
|
532
515
|
import { RootJsonLd } from "@justanarthur/payload-plugin-seo/root-jsonld";
|
|
516
|
+
import * as rootParams from "next/root-params";
|
|
533
517
|
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
518
|
+
var readLocaleRootParam = rootParams.locale;
|
|
519
|
+
async function resolveLocale(props) {
|
|
520
|
+
if (readLocaleRootParam) {
|
|
521
|
+
const locale = await readLocaleRootParam();
|
|
522
|
+
if (locale)
|
|
523
|
+
return locale;
|
|
524
|
+
}
|
|
525
|
+
return (await props.params).locale;
|
|
526
|
+
}
|
|
534
527
|
function createRootLayoutExports({
|
|
535
|
-
|
|
528
|
+
_payloadConfig,
|
|
536
529
|
importMap,
|
|
537
530
|
routing
|
|
538
531
|
}, {
|
|
@@ -540,9 +533,9 @@ function createRootLayoutExports({
|
|
|
540
533
|
htmlAttrs,
|
|
541
534
|
getServerSideURL
|
|
542
535
|
} = {}) {
|
|
536
|
+
seedPayloadCache({ config: _payloadConfig });
|
|
543
537
|
async function RootLayout(props) {
|
|
544
|
-
const
|
|
545
|
-
const locale = params.locale;
|
|
538
|
+
const locale = await resolveLocale(props);
|
|
546
539
|
if (!routing.locales.includes(locale)) {
|
|
547
540
|
const { notFound } = await import("next/navigation");
|
|
548
541
|
return notFound();
|
|
@@ -552,17 +545,17 @@ function createRootLayoutExports({
|
|
|
552
545
|
header,
|
|
553
546
|
footer
|
|
554
547
|
] = await Promise.all([
|
|
555
|
-
queryDoc({ globalSlug: "header", locale }
|
|
556
|
-
queryDoc({ globalSlug: "footer", locale }
|
|
548
|
+
queryDoc({ globalSlug: "header", locale }),
|
|
549
|
+
queryDoc({ globalSlug: "footer", locale })
|
|
557
550
|
]);
|
|
558
|
-
const renderedHeader = renderWWWDataModule(header, { collectionSlug: "header", configPath: "globals", config:
|
|
551
|
+
const renderedHeader = renderWWWDataModule(header, { collectionSlug: "header", configPath: "globals", config: _payloadConfig, importMap }, { ...props, locale }), renderedFooter = renderWWWDataModule(footer, { collectionSlug: "footer", configPath: "globals", config: _payloadConfig, importMap }, { ...props, locale });
|
|
559
552
|
const mergedHtmlAttrs = {
|
|
560
553
|
lang: locale,
|
|
561
554
|
suppressHydrationWarning: true,
|
|
562
555
|
...htmlAttrs?.(locale) ?? {}
|
|
563
556
|
};
|
|
564
557
|
const rootJsonLd = getServerSideURL ? /* @__PURE__ */ jsx8(RootJsonLd, {
|
|
565
|
-
config:
|
|
558
|
+
config: _payloadConfig,
|
|
566
559
|
locale,
|
|
567
560
|
getServerSideURL,
|
|
568
561
|
locales: routing.locales
|
|
@@ -573,9 +566,13 @@ function createRootLayoutExports({
|
|
|
573
566
|
children: /* @__PURE__ */ jsxs4(NextIntlClientProvider, {
|
|
574
567
|
children: [
|
|
575
568
|
rootJsonLd,
|
|
576
|
-
|
|
569
|
+
/* @__PURE__ */ jsx8(Activity, {
|
|
570
|
+
children: renderedHeader
|
|
571
|
+
}),
|
|
577
572
|
providers ? providers({ children: props.children, locale }) : props.children,
|
|
578
|
-
|
|
573
|
+
/* @__PURE__ */ jsx8(Activity, {
|
|
574
|
+
children: renderedFooter
|
|
575
|
+
})
|
|
579
576
|
]
|
|
580
577
|
})
|
|
581
578
|
})
|
|
@@ -592,12 +589,12 @@ import { RootJsonLd as RootJsonLd2 } from "@justanarthur/payload-plugin-seo/root
|
|
|
592
589
|
var renderPages = { createCollectionPageExports, createRootLayoutExports, PagesPage, PostsPage, HeaderPage, FooterPage, RootJsonLd: RootJsonLd2 };
|
|
593
590
|
var render_pages_default = renderPages;
|
|
594
591
|
export {
|
|
595
|
-
|
|
596
|
-
createRootLayoutExports,
|
|
597
|
-
createCollectionPageExports,
|
|
598
|
-
RootJsonLd2 as RootJsonLd,
|
|
599
|
-
PostsPage,
|
|
600
|
-
PagesPage,
|
|
592
|
+
FooterPage,
|
|
601
593
|
HeaderPage,
|
|
602
|
-
|
|
594
|
+
PagesPage,
|
|
595
|
+
PostsPage,
|
|
596
|
+
RootJsonLd2 as RootJsonLd,
|
|
597
|
+
createCollectionPageExports,
|
|
598
|
+
createRootLayoutExports,
|
|
599
|
+
render_pages_default as default
|
|
603
600
|
};
|
package/dist/sitemap.d.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
|
+
import { ReactNode as ReactNode2 } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* URL segment a collection is mounted under. A string is used for every locale; a record
|
|
4
|
+
* localizes it (`{ en: 'posts', sk: 'prispevky' }`), so a host serving localized routes
|
|
5
|
+
* gets canonical/hreflang URLs that match the URLs it actually serves. Locales missing
|
|
6
|
+
* from the record fall back to the default locale.
|
|
7
|
+
*/
|
|
8
|
+
type PagePathPrefix = string | Record<string, string>;
|
|
1
9
|
type CreateCollectionPageExportsDeps<S extends string> = {
|
|
2
10
|
getServerSideURL: () => string;
|
|
3
|
-
pagePathPrefix?:
|
|
11
|
+
pagePathPrefix?: PagePathPrefix;
|
|
12
|
+
/** Rendered while the document streams. Defaults to nothing. */
|
|
13
|
+
fallback?: ReactNode2;
|
|
4
14
|
};
|
|
5
15
|
type GenerateSitemapPageExportsArgs = CreateCollectionPageExportsDeps<any>;
|
|
6
16
|
declare function createSitemapFromCollections(...args: GenerateSitemapPageExportsArgs[]): () => Response;
|
|
17
|
+
import { SanitizedConfig as SanitizedConfig2 } from "payload";
|
|
18
|
+
type SeedPayloadCacheArgs = {
|
|
19
|
+
config: SanitizedConfig2 | Promise<SanitizedConfig2>;
|
|
20
|
+
};
|
|
21
|
+
declare function seedPayloadCache({ config }: SeedPayloadCacheArgs): void;
|
|
7
22
|
declare const _default: {
|
|
8
23
|
createSitemapFromCollections: typeof createSitemapFromCollections;
|
|
24
|
+
seedPayloadCache: typeof seedPayloadCache;
|
|
9
25
|
};
|
|
10
|
-
export { _default as default,
|
|
26
|
+
export { createSitemapFromCollections, _default as default, seedPayloadCache };
|