@justanarthur/payload-www 0.3.4 → 1.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.
Files changed (62) hide show
  1. package/README.md +317 -307
  2. package/dist/access.d.ts +2 -2
  3. package/dist/access.js +6 -30
  4. package/dist/blocks.d.ts +0 -10
  5. package/dist/blocks.js +8 -33
  6. package/dist/collections.d.ts +33 -225
  7. package/dist/collections.js +186 -661
  8. package/dist/config.d.ts +19 -105
  9. package/dist/config.js +263 -868
  10. package/dist/fields.d.ts +4 -46
  11. package/dist/fields.js +183 -73
  12. package/dist/imagehash.js +0 -15
  13. package/dist/import-map-provider.d.ts +0 -16
  14. package/dist/import-map-provider.js +0 -15
  15. package/dist/metadata.d.ts +24 -89
  16. package/dist/metadata.js +123 -258
  17. package/dist/pages.d.ts +37 -319
  18. package/dist/pages.js +355 -973
  19. package/dist/render-pages.d.ts +69 -564
  20. package/dist/render-pages.js +476 -1502
  21. package/dist/sitemap.d.ts +10 -0
  22. package/dist/sitemap.js +324 -0
  23. package/dist/translator.js +0 -15
  24. package/dist/utils.d.ts +4 -12
  25. package/dist/utils.js +10 -56
  26. package/package.json +75 -178
  27. package/dist/components.d.ts +0 -6
  28. package/dist/components.js +0 -39
  29. package/dist/core-access.d.ts +0 -11
  30. package/dist/core-access.js +0 -44
  31. package/dist/core-blocks.d.ts +0 -24
  32. package/dist/core-blocks.js +0 -89
  33. package/dist/core-fields.d.ts +0 -73
  34. package/dist/core-fields.js +0 -181
  35. package/dist/core-utils.d.ts +0 -16
  36. package/dist/core-utils.js +0 -73
  37. package/dist/data-collections.d.ts +0 -229
  38. package/dist/data-collections.js +0 -697
  39. package/dist/data-seed.d.ts +0 -76
  40. package/dist/data-seed.js +0 -212
  41. package/dist/data-test.d.ts +0 -30
  42. package/dist/data-test.js +0 -1134
  43. package/dist/globals.d.ts +0 -69
  44. package/dist/globals.js +0 -259
  45. package/dist/hooks.d.ts +0 -108
  46. package/dist/hooks.js +0 -228
  47. package/dist/index.d.ts +0 -6
  48. package/dist/index.js +0 -39
  49. package/dist/render-components.d.ts +0 -42
  50. package/dist/render-components.js +0 -154
  51. package/dist/render-metadata.d.ts +0 -122
  52. package/dist/render-metadata.js +0 -393
  53. package/dist/render-utils.d.ts +0 -166
  54. package/dist/render-utils.js +0 -401
  55. package/dist/seed.d.ts +0 -76
  56. package/dist/seed.js +0 -212
  57. package/dist/server.d.ts +0 -980
  58. package/dist/server.js +0 -2265
  59. package/dist/test.d.ts +0 -30
  60. package/dist/test.js +0 -1134
  61. package/dist/with-www-config.d.ts +0 -108
  62. package/dist/with-www-config.js +0 -1030
package/dist/fields.d.ts CHANGED
@@ -7,67 +7,25 @@ declare const appearanceOptions: Record<LinkAppearances, {
7
7
  type LinkOptions = {
8
8
  appearances?: LinkAppearances[] | false;
9
9
  disableLabel?: boolean;
10
- /**
11
- * Collection slugs the link can reference. Payload 3.85 rejects
12
- * empty arrays, so the lib defaults to `['pages']` (its own Pages
13
- * collection). Hosts that reference different collections pass
14
- * their own list.
15
- */
16
10
  relationTo?: string[];
17
- /** Mark the text fields as `localized: true`. */
18
11
  localized?: boolean;
19
- /** Deep-merge into the resulting group. */
20
12
  overrides?: Partial<GroupField>;
21
- /** Legacy alias for the host's custom field overrides. */
22
13
  linkOverrides?: Partial<GroupField>;
23
- /**
24
- * Extra fields appended to the link group — e.g. a `description`
25
- * text field or a `navHover` group for a mega-menu. Lets hosts
26
- * extend the nav link schema without re-implementing the whole
27
- * `link` field. Appended after the standard type/label/appearance
28
- * fields.
29
- */
30
14
  extraFields?: Field[];
31
15
  };
32
16
  declare const link: (options?: LinkOptions) => Field;
33
17
  import { Field as Field2 } from "payload";
34
18
  declare const linkGroup: (options?: LinkOptions) => Field2;
35
19
  import { Field as Field3 } from "payload";
36
- type SlugFieldOptions = {
37
- /** Field name. Default: `'slug'`. */
38
- name?: string;
39
- /**
40
- * Allow the `_` nesting divider in the slug so `about_us` renders at
41
- * `/about/us`. Relaxes validation and documents the convention in the
42
- * admin UI. Pair with `createCollectionPageExports({ nested: true })`.
43
- * Default: `false`.
44
- */
45
- nested?: boolean;
46
- /**
47
- * Localize the slug — one slug per locale (`/about` in `en`, `/o-nas`
48
- * in `sk`), stored in the collection's `_locales` table. This is the
49
- * default: the lib's collections are multilingual, so per-locale slugs
50
- * power localized URLs and hreflang alternates. Pass `false` for a
51
- * single shared slug.
52
- */
53
- localized?: boolean;
54
- };
55
- /**
56
- * The slug field shared by the lib's Pages / Posts collections: a
57
- * required, unique, indexed, sidebar text field, localized by default.
58
- *
59
- * The empty string is reserved for the home page (rendered at
60
- * `/${locale}`), so validation only rejects non-empty malformed values.
61
- */
62
- declare const slugField: (options?: SlugFieldOptions) => Field3;
20
+ declare const slugField: () => Field3;
63
21
  import { Field as Field_14espm } from "payload";
64
- declare const _default: {
22
+ declare const fields: {
65
23
  link: (options?: LinkOptions) => Field_14espm;
66
24
  linkGroup: (options?: LinkOptions) => Field_14espm;
67
25
  appearanceOptions: Record<LinkAppearances, {
68
26
  label: string;
69
27
  value: string;
70
28
  }>;
71
- slugField: (options?: SlugFieldOptions) => Field_14espm;
29
+ slugField: () => Field_14espm;
72
30
  };
73
- export { slugField, linkGroup, link, _default as default, appearanceOptions, SlugFieldOptions, LinkOptions, LinkAppearances };
31
+ export { slugField, linkGroup, link, fields as default, appearanceOptions, LinkOptions, LinkAppearances };
package/dist/fields.js CHANGED
@@ -1,31 +1,182 @@
1
1
 
2
- var __defProp = Object.defineProperty;
3
- var __returnValue = (v) => v;
4
- function __exportSetter(name, newValue) {
5
- this[name] = __returnValue.bind(null, newValue);
2
+
3
+ // package.json
4
+ var name = "@justanarthur/payload-www";
5
+
6
+ // src/collections/hooks/populatePublishedAt.ts
7
+ var populatePublishedAt = ({ data, operation, req }) => {
8
+ if (operation === "create" || operation === "update") {
9
+ if (req.data && !req.data.publishedAt) {
10
+ const now = new Date;
11
+ return {
12
+ ...data,
13
+ publishedAt: now
14
+ };
15
+ }
16
+ }
17
+ return data;
18
+ };
19
+
20
+ // src/collections/hooks/createRevalidateCollectionGlobalHook.ts
21
+ import { revalidateTag } from "next/cache";
22
+ function createRevalidateCollectionGlobalHook() {
23
+ const afterChangeDeleteHook = async ({ doc, req, ...args }) => {
24
+ const previousDoc = "previousDoc" in args ? args.previousDoc : null, locale = req.locale;
25
+ function revalidate(args2) {
26
+ try {
27
+ revalidateTag(createCollectionCacheKey({ ...args2, locale }), "max");
28
+ } catch (error) {
29
+ const msg = error instanceof Error ? error.message : String(error);
30
+ if (msg.includes("static generation store missing"))
31
+ return;
32
+ console.error(error);
33
+ }
34
+ }
35
+ if ("collection" in args) {
36
+ [
37
+ doc && doc._status !== "draft" && doc.slug,
38
+ previousDoc && previousDoc._status === "published" && previousDoc.slug
39
+ ].filter((slug) => slug !== undefined && slug !== false).map((slug) => revalidate({ collectionSlug: args.collection.slug, slug }));
40
+ } else {
41
+ revalidate({ globalSlug: args.global.slug });
42
+ }
43
+ return doc;
44
+ };
45
+ return { afterChange: afterChangeDeleteHook, afterDelete: afterChangeDeleteHook };
6
46
  }
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true,
12
- configurable: true,
13
- set: __exportSetter.bind(all, name)
14
- });
47
+ function createCollectionCacheKey(args) {
48
+ return `${"globalSlug" in args ? args.globalSlug : args.collectionSlug + args.slug}_${args.locale}`;
49
+ }
50
+
51
+ // src/collections/fields/slug.ts
52
+ var slugField = () => ({
53
+ name: "slug",
54
+ type: "text",
55
+ required: true,
56
+ unique: true,
57
+ index: true,
58
+ localized: true,
59
+ admin: {
60
+ position: "sidebar",
61
+ description: "Lowercase, hyphens for words. Use the `_` divider for nesting, e.g. `about_us` → `/about/us`."
62
+ },
63
+ validate: (value) => {
64
+ if (typeof value !== "string")
65
+ return "Slug must be a string";
66
+ if (value !== "" && !/^[a-z0-9_-]+$/.test(value))
67
+ return "Slug must be lowercase, with hyphens (no spaces or special characters).";
68
+ return true;
69
+ }
70
+ });
71
+
72
+ // src/collections/access/index.ts
73
+ var anyone = () => true;
74
+ var authenticated = ({ req: { user } }) => Boolean(user);
75
+ var authenticatedOrPublished = ({ req: { user } }) => {
76
+ if (user)
77
+ return true;
78
+ return { _status: { equals: "published" } };
15
79
  };
16
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
80
 
18
- // src/config/constants.ts
19
- var PAGES_RENDER_PATH = "@justanarthur/payload-www/render-pages#PagesPage";
20
- var POSTS_RENDER_PATH = "@justanarthur/payload-www/render-pages#PostsPage";
21
- var HEADER_RENDER_PATH = "@justanarthur/payload-www/render-pages#HeaderPage";
22
- var FOOTER_RENDER_PATH = "@justanarthur/payload-www/render-pages#FooterPage";
23
- var LIVE_PREVIEW_LISTENER_PATH = "@justanarthur/payload-www/render-components#LivePreviewListener";
81
+ // src/collections/createWWWCollectionGlobal.ts
82
+ function createWWWCollectionGlobal(fields, {
83
+ slug: collectionSlug,
84
+ renderPath,
85
+ isGlobalConfig = false,
86
+ isDraft = true
87
+ }) {
88
+ return {
89
+ slug: collectionSlug,
90
+ fields: isGlobalConfig ? fields : [
91
+ slugField(),
92
+ {
93
+ name: "publishedAt",
94
+ type: "date",
95
+ admin: { position: "sidebar" }
96
+ },
97
+ ...fields
98
+ ],
99
+ custom: { [name]: { path: renderPath } },
100
+ access: {
101
+ create: authenticated,
102
+ delete: authenticated,
103
+ read: isDraft ? authenticatedOrPublished : anyone,
104
+ update: authenticated
105
+ },
106
+ hooks: (() => {
107
+ const { afterChange, afterDelete } = createRevalidateCollectionGlobalHook();
108
+ return {
109
+ afterChange: [afterChange],
110
+ beforeChange: [populatePublishedAt],
111
+ afterDelete: [afterDelete]
112
+ };
113
+ })(),
114
+ ...isDraft && {
115
+ versions: { drafts: { autosave: { interval: 3000 } } }
116
+ }
117
+ };
118
+ }
119
+
120
+ // src/collections/createPagesCollection.ts
24
121
  var PAGES_SLUG = "pages";
122
+ var PAGES_RENDER_PATH = "@justanarthur/payload-www/render-pages#PagesPage";
123
+ var createPagesCollection = (blocks) => createWWWCollectionGlobal([
124
+ {
125
+ name: "title",
126
+ type: "text",
127
+ required: true,
128
+ localized: true
129
+ },
130
+ {
131
+ type: "tabs",
132
+ tabs: [
133
+ {
134
+ fields: [
135
+ {
136
+ name: "blocks",
137
+ type: "blocks",
138
+ blocks,
139
+ required: true,
140
+ admin: { initCollapsed: true }
141
+ }
142
+ ],
143
+ label: "Content"
144
+ }
145
+ ]
146
+ }
147
+ ], {
148
+ slug: PAGES_SLUG,
149
+ renderPath: PAGES_RENDER_PATH
150
+ });
151
+
152
+ // src/collections/createPostsCollection.ts
25
153
  var POSTS_SLUG = "posts";
26
- var STATIC_PAGES_SLUG = "staticPages";
154
+ var POSTS_RENDER_PATH = "@justanarthur/payload-www/render-pages#PostsPage";
155
+ var createPostsCollection = () => createWWWCollectionGlobal([
156
+ {
157
+ name: "title",
158
+ type: "text",
159
+ required: true,
160
+ localized: true
161
+ },
162
+ {
163
+ name: "excerpt",
164
+ type: "text",
165
+ required: false,
166
+ localized: true
167
+ },
168
+ {
169
+ name: "content",
170
+ type: "richText",
171
+ required: false,
172
+ localized: true
173
+ }
174
+ ], {
175
+ slug: POSTS_SLUG,
176
+ renderPath: POSTS_RENDER_PATH
177
+ });
27
178
 
28
- // src/core/fields/link.ts
179
+ // src/collections/fields/link.ts
29
180
  var appearanceOptions = {
30
181
  default: { label: "Default", value: "default" },
31
182
  outline: { label: "Outline", value: "outline" }
@@ -34,18 +185,11 @@ var link = (options = {}) => {
34
185
  const {
35
186
  appearances,
36
187
  disableLabel = false,
37
- relationTo = [PAGES_SLUG],
38
- localized = false,
188
+ relationTo = [PAGES_SLUG, POSTS_SLUG],
189
+ localized = true,
39
190
  overrides = {},
40
191
  extraFields = []
41
192
  } = options;
42
- console.log("[WWW] core/fields:link options=", JSON.stringify({
43
- appearances: appearances === false ? false : appearances ?? "default-set",
44
- disableLabel,
45
- relationTo,
46
- localized,
47
- extraFieldsCount: extraFields.length
48
- }));
49
193
  const result = {
50
194
  name: "link",
51
195
  type: "group",
@@ -124,54 +268,20 @@ var link = (options = {}) => {
124
268
  if (extraFields.length) {
125
269
  result.fields.push(...extraFields);
126
270
  }
127
- console.log("[WWW] core/fields:link built fieldsCount=", result.fields.length);
128
271
  return { ...result, ...overrides };
129
272
  };
130
273
 
131
- // src/core/fields/linkGroup.ts
132
- var linkGroup = (options = {}) => {
133
- console.log("[WWW] core/fields:linkGroup relationTo=", JSON.stringify(options.relationTo ?? "link-default"), "extraFields=", options.extraFields?.length ?? 0);
134
- return {
135
- name: "links",
136
- type: "array",
137
- fields: [link(options)],
138
- admin: { initCollapsed: true }
139
- };
140
- };
141
-
142
- // src/core/fields/slug.ts
143
- var FLAT_PATTERN = /^[a-z0-9-]+$/;
144
- var NESTED_PATTERN = /^[a-z0-9_-]+$/;
145
- var slugField = (options = {}) => {
146
- const { name = "slug", nested = false, localized = true } = options;
147
- const pattern = nested ? NESTED_PATTERN : FLAT_PATTERN;
148
- const invalidMessage = nested ? "Slug must be lowercase, with hyphens or the `_` nesting divider (no spaces or other special characters)" : "Slug must be lowercase, with hyphens (no spaces or special characters)";
149
- console.log("[WWW] core/fields:slugField options=", JSON.stringify({ name, nested, localized }));
150
- return {
151
- name,
152
- type: "text",
153
- required: true,
154
- unique: true,
155
- index: true,
156
- localized,
157
- admin: {
158
- position: "sidebar",
159
- ...nested ? { description: "Lowercase, hyphens for words. Use the `_` divider for nesting, e.g. `about_us` → `/about/us`." } : {}
160
- },
161
- validate: (value) => {
162
- if (typeof value !== "string")
163
- return "Slug must be a string";
164
- if (value !== "" && !pattern.test(value)) {
165
- console.warn("[WWW] core/fields:slugField invalid slug value=", JSON.stringify(value));
166
- return invalidMessage;
167
- }
168
- return true;
169
- }
170
- };
171
- };
274
+ // src/collections/fields/linkGroup.ts
275
+ var linkGroup = (options = {}) => ({
276
+ name: "links",
277
+ type: "array",
278
+ fields: [link(options)],
279
+ admin: { initCollapsed: true }
280
+ });
172
281
 
173
282
  // src/exports/fields.ts
174
- var fields_default = { link, linkGroup, appearanceOptions, slugField };
283
+ var fields = { link, linkGroup, appearanceOptions, slugField };
284
+ var fields_default = fields;
175
285
  export {
176
286
  slugField,
177
287
  linkGroup,
package/dist/imagehash.js CHANGED
@@ -1,19 +1,4 @@
1
1
 
2
- var __defProp = Object.defineProperty;
3
- var __returnValue = (v) => v;
4
- function __exportSetter(name, newValue) {
5
- this[name] = __returnValue.bind(null, newValue);
6
- }
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true,
12
- configurable: true,
13
- set: __exportSetter.bind(all, name)
14
- });
15
- };
16
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
2
 
18
3
  // src/exports/imagehash.ts
19
4
  import { imageHashPlugin } from "@justanarthur/payload-imagehash-plugin";
@@ -1,20 +1,4 @@
1
1
  import { ImportMap } from "payload";
2
- /**
3
- * Marker kept for backwards compatibility with hosts that
4
- * imported `setImportMapProvider` / `getImportMap` from earlier
5
- * versions of the lib. New code should pass the importMap directly
6
- * to `createRootLayoutExports` and `createCollectionPageExports` —
7
- * no global state, no module-load-time coupling.
8
- *
9
- * The functions are no-ops. The lib reads the importMap exclusively
10
- * from the per-factory `importMap` option now.
11
- *
12
- * @deprecated pass `importMap` to the factories instead.
13
- */
14
2
  declare function setImportMapProvider(_provider: () => Promise<ImportMap> | ImportMap): void;
15
- /**
16
- * @deprecated pass `importMap` to the factories instead. Always
17
- * returns `{}` now — the lib never reads global state.
18
- */
19
3
  declare function getImportMap(): Promise<ImportMap>;
20
4
  export { setImportMapProvider, getImportMap };
@@ -1,19 +1,4 @@
1
1
 
2
- var __defProp = Object.defineProperty;
3
- var __returnValue = (v) => v;
4
- function __exportSetter(name, newValue) {
5
- this[name] = __returnValue.bind(null, newValue);
6
- }
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true,
12
- configurable: true,
13
- set: __exportSetter.bind(all, name)
14
- });
15
- };
16
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
2
 
18
3
  // src/exports/import-map-provider.ts
19
4
  function setImportMapProvider(_provider) {}
@@ -16,107 +16,42 @@ declare function buildBreadcrumbsLd({ items, currentUrl }: {
16
16
  items: BreadcrumbItem[];
17
17
  currentUrl: string;
18
18
  }): Record<string, unknown>;
19
- declare function buildOrganizationLd({ siteUrl, name, logo, sameAs }: {
20
- siteUrl: string;
21
- name?: string;
22
- logo?: string;
23
- sameAs?: string[];
24
- }): Record<string, unknown>;
25
- declare function buildHreflangAlternates<L extends string>({ siteUrl, locale, urlPrefix, storedSlug, queryAllLocaleSlugs, nested, homeSlug, defaultLocale, locales, localePrefix }: {
26
- siteUrl: string;
27
- locale: L;
28
- urlPrefix: string;
29
- storedSlug: string;
30
- queryAllLocaleSlugs: (slug: string, locale: L) => Promise<Partial<Record<L, string>> | undefined>;
31
- nested: boolean;
32
- homeSlug: string;
33
- defaultLocale: L;
34
- locales: readonly L[];
35
- /**
36
- * Locale prefix mode — mirrors next-intl's `localePrefix` so each
37
- * alternate URL matches the host's actual route shape:
38
- *
39
- * - `'always'`: every URL is prefixed with `/{locale}/…`
40
- * (e.g. `/en/about`, `/uk/about`). The default — preserves
41
- * the helper's prior behavior.
42
- * - `'as-needed'`: the default locale renders without a prefix
43
- * (e.g. `/about`), other locales are prefixed (`/uk/about`).
44
- * Critical: callers that emit hreflang alongside a canonical
45
- * URL built with `as-needed` mode MUST pass this through,
46
- * otherwise the `en` and `x-default` alternates point to URLs
47
- * the host doesn't actually serve.
48
- * - `'never'`: no locale prefix at all.
49
- */
50
- localePrefix?: "always" | "as-needed" | "never";
51
- }): Promise<Record<string, string>>;
52
- declare function segmentsToStoredSlug(segments: string[] | string, nested?: boolean): string;
53
- declare function segmentsToUrlPath(segments: string[] | string, nested?: boolean): string;
54
- declare function storedSlugToSegments(storedSlug: string, nested?: boolean): string[] | string;
55
- declare function buildCanonicalUrl<L extends string>({ siteUrl, locale, urlPrefix, urlPath }: {
56
- siteUrl: string;
57
- locale: L;
58
- urlPrefix: string;
59
- urlPath: string;
60
- }): string;
61
- declare function getUrlPath(segments: string[] | string, nested: boolean, homeSlug: string): string;
62
- import { DataFromCollectionSlug, ImportMap, SanitizedConfig } from "payload";
63
- declare const queryDocBySlug: <S extends string>({ collectionSlug, slug, slugField, locale, draft, config }: {
19
+ import { BuildOrganizationLdOptions, BuildProductLdOptions, BuildRootJsonLdOptions, BuildWebSiteLdOptions, buildOrganizationLd, buildProductLd, buildRootJsonLd, buildWebSiteLd } from "@justanarthur/payload-plugin-seo/root-jsonld";
20
+ type SlugShape = "single" | "catch-all";
21
+ declare function paramsSlugToSlug(slug: string | string[] | undefined, _shape: SlugShape): string;
22
+ declare function slugToParamsSlug(slug: string, shape: SlugShape): string | string[];
23
+ import { DataFromCollectionSlug, SanitizedConfig } from "payload";
24
+ declare function queryDocBySlug<S extends string>({ collectionSlug, slug, slugField, locale, draft, config }: {
64
25
  collectionSlug: S;
65
26
  slug: string;
66
27
  slugField?: string;
67
28
  locale: string;
68
29
  draft?: boolean;
69
30
  config: Promise<SanitizedConfig>;
70
- }) => Promise<DataFromCollectionSlug<S> | null>;
71
- declare const queryAllDocs: <S extends string>({ collectionSlug, slugField, locale, config }: {
31
+ }): Promise<DataFromCollectionSlug<S> | null>;
32
+ declare function queryAllDocs<S extends string>({ collectionSlug, slugField, locale, config }: {
72
33
  collectionSlug: S;
73
34
  slugField?: string;
74
35
  locale: string;
75
36
  config: Promise<SanitizedConfig>;
76
- }) => Promise<DataFromCollectionSlug<S>[]>;
77
- declare const queryAllLocaleSlugs2: <S extends string>({ collectionSlug, slug, slugField, locale, config }: {
78
- collectionSlug: S;
79
- slug: string;
37
+ }): Promise<DataFromCollectionSlug<S>[]>;
38
+ declare function queryAllLocaleSlugs({ collectionSlug, id, slugField, config }: {
39
+ collectionSlug: string;
40
+ id: number | string;
80
41
  slugField?: string;
81
- locale: string;
82
42
  config: Promise<SanitizedConfig>;
83
- }) => Promise<Record<string, string> | undefined>;
84
- declare function getRenderModuleExports(exportName: string, collection: {
85
- custom?: Record<string, unknown>;
86
- } | undefined, importMap: ImportMap): unknown;
87
- import { SanitizedConfig as SanitizedConfig_ee8ogz } from "payload";
88
- import { DataFromCollectionSlug as DataFromCollectionSlug_2e2bqb } from "payload";
89
- declare const _default: {
43
+ }): Promise<Record<string, string> | null>;
44
+ declare const metadata: {
90
45
  buildArticleLd: typeof buildArticleLd;
91
46
  buildBreadcrumbsLd: typeof buildBreadcrumbsLd;
92
- buildOrganizationLd: typeof buildOrganizationLd;
93
- buildHreflangAlternates: typeof buildHreflangAlternates;
94
- queryDocBySlug: <S extends string>({ collectionSlug, slug, slugField, locale, draft, config }: {
95
- collectionSlug: S;
96
- slug: string;
97
- slugField?: string;
98
- locale: string;
99
- draft?: boolean;
100
- config: Promise<SanitizedConfig_ee8ogz>;
101
- }) => Promise<DataFromCollectionSlug_2e2bqb<S> | null>;
102
- queryAllDocs: <S extends string>({ collectionSlug, slugField, locale, config }: {
103
- collectionSlug: S;
104
- slugField?: string;
105
- locale: string;
106
- config: Promise<SanitizedConfig_ee8ogz>;
107
- }) => Promise<DataFromCollectionSlug_2e2bqb<S>[]>;
108
- queryAllLocaleSlugs2: <S extends string>({ collectionSlug, slug, slugField, locale, config }: {
109
- collectionSlug: S;
110
- slug: string;
111
- slugField?: string;
112
- locale: string;
113
- config: Promise<SanitizedConfig_ee8ogz>;
114
- }) => Promise<Record<string, string> | undefined>;
115
- getUrlPath: typeof getUrlPath;
116
- segmentsToStoredSlug: typeof segmentsToStoredSlug;
117
- segmentsToUrlPath: typeof segmentsToUrlPath;
118
- storedSlugToSegments: typeof storedSlugToSegments;
119
- buildCanonicalUrl: typeof buildCanonicalUrl;
120
- getRenderModuleExports: typeof getRenderModuleExports;
47
+ buildOrganizationLd: any;
48
+ buildWebSiteLd: any;
49
+ buildProductLd: any;
50
+ buildRootJsonLd: any;
51
+ queryDocBySlug: typeof queryDocBySlug;
52
+ queryAllDocs: typeof queryAllDocs;
53
+ queryAllLocaleSlugs: typeof queryAllLocaleSlugs;
54
+ paramsSlugToSlug: typeof paramsSlugToSlug;
55
+ slugToParamsSlug: typeof slugToParamsSlug;
121
56
  };
122
- export { storedSlugToSegments, segmentsToUrlPath, segmentsToStoredSlug, queryDocBySlug, queryAllLocaleSlugs2 as queryAllLocaleSlugs, queryAllDocs, getUrlPath, getRenderModuleExports, _default as default, buildOrganizationLd, buildHreflangAlternates, buildCanonicalUrl, buildBreadcrumbsLd, buildArticleLd, BreadcrumbItem, ArticleLdOptions };
57
+ export { slugToParamsSlug, queryDocBySlug, queryAllLocaleSlugs, queryAllDocs, paramsSlugToSlug, metadata as default, buildWebSiteLd, buildRootJsonLd, buildProductLd, buildOrganizationLd, buildBreadcrumbsLd, buildArticleLd, SlugShape, BuildWebSiteLdOptions, BuildRootJsonLdOptions, BuildProductLdOptions, BuildOrganizationLdOptions, BreadcrumbItem, ArticleLdOptions };