@justanarthur/payload-www 0.2.0 → 0.3.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/dist/data-test.js CHANGED
@@ -29,7 +29,6 @@ var authenticatedOrPublished = ({ req: { user } }) => {
29
29
  return true;
30
30
  return { _status: { equals: "published" } };
31
31
  };
32
-
33
32
  // src/render/_locale.ts
34
33
  function prefixFor(locale, defaultLocale, mode) {
35
34
  if (mode === "never")
@@ -204,26 +203,6 @@ var createPagesCollection = (blocks, options = {}) => {
204
203
  defaultLocale,
205
204
  nested = false
206
205
  } = options;
207
- const slugPattern = nested ? /^[a-z0-9_-]+$/ : /^[a-z0-9-]+$/;
208
- const slugField = {
209
- name: "slug",
210
- type: "text",
211
- required: true,
212
- unique: true,
213
- index: true,
214
- admin: {
215
- position: "sidebar",
216
- ...nested ? { description: "Lowercase, hyphens for words. Use the `_` divider for nesting, e.g. `about_us` → `/about/us`." } : {}
217
- },
218
- validate: (value) => {
219
- if (typeof value !== "string")
220
- return "Slug must be a string";
221
- if (value !== "" && !slugPattern.test(value)) {
222
- return 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)";
223
- }
224
- return true;
225
- }
226
- };
227
206
  const baseFields = [
228
207
  {
229
208
  name: "title",
@@ -253,7 +232,7 @@ var createPagesCollection = (blocks, options = {}) => {
253
232
  type: "date",
254
233
  admin: { position: "sidebar" }
255
234
  },
256
- slugField
235
+ slugField({ nested })
257
236
  ];
258
237
  const { afterChange: revalidateAfterChange, afterDelete: revalidateAfterDelete } = createRevalidateCollectionHook({
259
238
  collectionSlug,
@@ -288,14 +267,6 @@ var createPostsCollection = (options = {}) => {
288
267
  localePrefix,
289
268
  defaultLocale
290
269
  } = options;
291
- const slugField = {
292
- name: "slug",
293
- type: "text",
294
- required: true,
295
- unique: true,
296
- index: true,
297
- admin: { position: "sidebar" }
298
- };
299
270
  const baseFields = [
300
271
  {
301
272
  name: "title",
@@ -320,7 +291,7 @@ var createPostsCollection = (options = {}) => {
320
291
  type: "date",
321
292
  admin: { position: "sidebar" }
322
293
  },
323
- slugField
294
+ slugField()
324
295
  ];
325
296
  const { afterChange, afterDelete } = createRevalidateCollectionHook({
326
297
  collectionSlug,
@@ -421,11 +392,11 @@ var createStaticPagesCollection = (blocks) => {
421
392
  };
422
393
 
423
394
  // src/core/fields/link.ts
424
- var appearanceOptions = {
395
+ var appearanceOptions2 = {
425
396
  default: { label: "Default", value: "default" },
426
397
  outline: { label: "Outline", value: "outline" }
427
398
  };
428
- var link = (options = {}) => {
399
+ var link2 = (options = {}) => {
429
400
  const {
430
401
  appearances,
431
402
  disableLabel = false,
@@ -500,7 +471,7 @@ var link = (options = {}) => {
500
471
  result.fields = [...result.fields, ...linkTypes];
501
472
  }
502
473
  if (appearances !== false) {
503
- const opts = appearances ? appearances.map((a) => appearanceOptions[a]) : [appearanceOptions.default, appearanceOptions.outline];
474
+ const opts = appearances ? appearances.map((a) => appearanceOptions2[a]) : [appearanceOptions2.default, appearanceOptions2.outline];
504
475
  result.fields.push({
505
476
  name: "appearance",
506
477
  type: "select",
@@ -541,12 +512,12 @@ var createHeaderGlobal = (options = {}) => {
541
512
  slug: "navColumn",
542
513
  fields: [
543
514
  { name: "title", type: "text", required: true, localized: true },
544
- { name: "links", type: "array", fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
515
+ { name: "links", type: "array", fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
545
516
  ]
546
517
  };
547
518
  const navItemBlock = {
548
519
  slug: "navItem",
549
- fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
520
+ fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
550
521
  };
551
522
  return {
552
523
  slug: "header",
@@ -578,12 +549,12 @@ var createFooterGlobal = (options = {}) => {
578
549
  slug: "navColumn",
579
550
  fields: [
580
551
  { name: "title", type: "text", required: true, localized: true },
581
- { name: "links", type: "array", fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
552
+ { name: "links", type: "array", fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
582
553
  ]
583
554
  };
584
555
  const navItemBlock = {
585
556
  slug: "navItem",
586
- fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
557
+ fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
587
558
  };
588
559
  return {
589
560
  slug: "footer",
@@ -672,7 +643,7 @@ function getFromImportMap(key, importMap) {
672
643
  var queryDocBySlug = cache(async function queryDocBySlug2({
673
644
  collectionSlug,
674
645
  slug,
675
- slugField = "slug",
646
+ slugField: slugField2 = "slug",
676
647
  locale,
677
648
  draft = false,
678
649
  config
@@ -684,14 +655,14 @@ var queryDocBySlug = cache(async function queryDocBySlug2({
684
655
  limit: 1,
685
656
  pagination: false,
686
657
  overrideAccess: draft,
687
- where: { [slugField]: { equals: slug } },
658
+ where: { [slugField2]: { equals: slug } },
688
659
  locale
689
660
  });
690
661
  return result.docs?.[0] ?? null;
691
662
  });
692
663
  var queryAllDocs = cache(async function queryAllDocs2({
693
664
  collectionSlug,
694
- slugField = "slug",
665
+ slugField: slugField2 = "slug",
695
666
  locale,
696
667
  config
697
668
  }) {
@@ -702,7 +673,7 @@ var queryAllDocs = cache(async function queryAllDocs2({
702
673
  limit: 1000,
703
674
  pagination: false,
704
675
  overrideAccess: false,
705
- select: { [slugField]: true },
676
+ select: { [slugField2]: true },
706
677
  locale
707
678
  });
708
679
  return result.docs ?? [];
@@ -710,7 +681,7 @@ var queryAllDocs = cache(async function queryAllDocs2({
710
681
  var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
711
682
  collectionSlug,
712
683
  slug,
713
- slugField = "slug",
684
+ slugField: slugField2 = "slug",
714
685
  locale,
715
686
  config
716
687
  }) {
@@ -722,13 +693,25 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
722
693
  pagination: false,
723
694
  overrideAccess: false,
724
695
  locale,
725
- where: { [slugField]: { equals: slug } },
726
- select: { [slugField]: true }
696
+ where: { [slugField2]: { equals: slug } },
697
+ select: { [slugField2]: true }
727
698
  });
728
699
  const doc = result.docs?.[0];
729
700
  if (!doc)
730
701
  return;
731
- const fieldValue = doc?.[slugField];
702
+ let fieldValue = doc[slugField2];
703
+ if (doc.id != null) {
704
+ const allLocales2 = await payload.findByID({
705
+ collection: collectionSlug,
706
+ id: doc.id,
707
+ locale: "all",
708
+ draft: false,
709
+ overrideAccess: false,
710
+ select: { [slugField2]: true }
711
+ }).catch(() => null);
712
+ if (allLocales2)
713
+ fieldValue = allLocales2[slugField2];
714
+ }
732
715
  if (fieldValue && typeof fieldValue === "object") {
733
716
  return fieldValue;
734
717
  }
package/dist/fields.d.ts CHANGED
@@ -32,6 +32,34 @@ type LinkOptions = {
32
32
  declare const link: (options?: LinkOptions) => Field;
33
33
  import { Field as Field2 } from "payload";
34
34
  declare const linkGroup: (options?: LinkOptions) => Field2;
35
+ 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;
35
63
  import { Field as Field_14espm } from "payload";
36
64
  declare const _default: {
37
65
  link: (options?: LinkOptions) => Field_14espm;
@@ -40,5 +68,6 @@ declare const _default: {
40
68
  label: string;
41
69
  value: string;
42
70
  }>;
71
+ slugField: (options?: SlugFieldOptions) => Field_14espm;
43
72
  };
44
- export { linkGroup, link, _default as default, appearanceOptions, LinkOptions, LinkAppearances };
73
+ export { slugField, linkGroup, link, _default as default, appearanceOptions, SlugFieldOptions, LinkOptions, LinkAppearances };
package/dist/fields.js CHANGED
@@ -128,9 +128,38 @@ var linkGroup = (options = {}) => ({
128
128
  admin: { initCollapsed: true }
129
129
  });
130
130
 
131
+ // src/core/fields/slug.ts
132
+ var FLAT_PATTERN = /^[a-z0-9-]+$/;
133
+ var NESTED_PATTERN = /^[a-z0-9_-]+$/;
134
+ var slugField = (options = {}) => {
135
+ const { name = "slug", nested = false, localized = true } = options;
136
+ const pattern = nested ? NESTED_PATTERN : FLAT_PATTERN;
137
+ 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)";
138
+ return {
139
+ name,
140
+ type: "text",
141
+ required: true,
142
+ unique: true,
143
+ index: true,
144
+ localized,
145
+ admin: {
146
+ position: "sidebar",
147
+ ...nested ? { description: "Lowercase, hyphens for words. Use the `_` divider for nesting, e.g. `about_us` → `/about/us`." } : {}
148
+ },
149
+ validate: (value) => {
150
+ if (typeof value !== "string")
151
+ return "Slug must be a string";
152
+ if (value !== "" && !pattern.test(value))
153
+ return invalidMessage;
154
+ return true;
155
+ }
156
+ };
157
+ };
158
+
131
159
  // src/exports/fields.ts
132
- var fields_default = { link, linkGroup, appearanceOptions };
160
+ var fields_default = { link, linkGroup, appearanceOptions, slugField };
133
161
  export {
162
+ slugField,
134
163
  linkGroup,
135
164
  link,
136
165
  fields_default as default,
package/dist/metadata.js CHANGED
@@ -262,7 +262,19 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
262
262
  const doc = result.docs?.[0];
263
263
  if (!doc)
264
264
  return;
265
- const fieldValue = doc?.[slugField];
265
+ let fieldValue = doc[slugField];
266
+ if (doc.id != null) {
267
+ const allLocales = await payload.findByID({
268
+ collection: collectionSlug,
269
+ id: doc.id,
270
+ locale: "all",
271
+ draft: false,
272
+ overrideAccess: false,
273
+ select: { [slugField]: true }
274
+ }).catch(() => null);
275
+ if (allLocales)
276
+ fieldValue = allLocales[slugField];
277
+ }
266
278
  if (fieldValue && typeof fieldValue === "object") {
267
279
  return fieldValue;
268
280
  }
package/dist/pages.js CHANGED
@@ -639,7 +639,19 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
639
639
  const doc = result.docs?.[0];
640
640
  if (!doc)
641
641
  return;
642
- const fieldValue = doc?.[slugField];
642
+ let fieldValue = doc[slugField];
643
+ if (doc.id != null) {
644
+ const allLocales = await payload.findByID({
645
+ collection: collectionSlug,
646
+ id: doc.id,
647
+ locale: "all",
648
+ draft: false,
649
+ overrideAccess: false,
650
+ select: { [slugField]: true }
651
+ }).catch(() => null);
652
+ if (allLocales)
653
+ fieldValue = allLocales[slugField];
654
+ }
643
655
  if (fieldValue && typeof fieldValue === "object") {
644
656
  return fieldValue;
645
657
  }
@@ -262,7 +262,19 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
262
262
  const doc = result.docs?.[0];
263
263
  if (!doc)
264
264
  return;
265
- const fieldValue = doc?.[slugField];
265
+ let fieldValue = doc[slugField];
266
+ if (doc.id != null) {
267
+ const allLocales = await payload.findByID({
268
+ collection: collectionSlug,
269
+ id: doc.id,
270
+ locale: "all",
271
+ draft: false,
272
+ overrideAccess: false,
273
+ select: { [slugField]: true }
274
+ }).catch(() => null);
275
+ if (allLocales)
276
+ fieldValue = allLocales[slugField];
277
+ }
266
278
  if (fieldValue && typeof fieldValue === "object") {
267
279
  return fieldValue;
268
280
  }
@@ -460,7 +460,19 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
460
460
  const doc = result.docs?.[0];
461
461
  if (!doc)
462
462
  return;
463
- const fieldValue = doc?.[slugField];
463
+ let fieldValue = doc[slugField];
464
+ if (doc.id != null) {
465
+ const allLocales = await payload.findByID({
466
+ collection: collectionSlug,
467
+ id: doc.id,
468
+ locale: "all",
469
+ draft: false,
470
+ overrideAccess: false,
471
+ select: { [slugField]: true }
472
+ }).catch(() => null);
473
+ if (allLocales)
474
+ fieldValue = allLocales[slugField];
475
+ }
464
476
  if (fieldValue && typeof fieldValue === "object") {
465
477
  return fieldValue;
466
478
  }
@@ -226,7 +226,19 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
226
226
  const doc = result.docs?.[0];
227
227
  if (!doc)
228
228
  return;
229
- const fieldValue = doc?.[slugField];
229
+ let fieldValue = doc[slugField];
230
+ if (doc.id != null) {
231
+ const allLocales2 = await payload.findByID({
232
+ collection: collectionSlug,
233
+ id: doc.id,
234
+ locale: "all",
235
+ draft: false,
236
+ overrideAccess: false,
237
+ select: { [slugField]: true }
238
+ }).catch(() => null);
239
+ if (allLocales2)
240
+ fieldValue = allLocales2[slugField];
241
+ }
230
242
  if (fieldValue && typeof fieldValue === "object") {
231
243
  return fieldValue;
232
244
  }
package/dist/server.js CHANGED
@@ -192,7 +192,6 @@ var authenticatedOrPublished = ({ req: { user } }) => {
192
192
  return true;
193
193
  return { _status: { equals: "published" } };
194
194
  };
195
-
196
195
  // src/render/_locale.ts
197
196
  function prefixFor(locale, defaultLocale, mode) {
198
197
  if (mode === "never")
@@ -367,26 +366,6 @@ var createPagesCollection = (blocks, options = {}) => {
367
366
  defaultLocale,
368
367
  nested = false
369
368
  } = options;
370
- const slugPattern = nested ? /^[a-z0-9_-]+$/ : /^[a-z0-9-]+$/;
371
- const slugField = {
372
- name: "slug",
373
- type: "text",
374
- required: true,
375
- unique: true,
376
- index: true,
377
- admin: {
378
- position: "sidebar",
379
- ...nested ? { description: "Lowercase, hyphens for words. Use the `_` divider for nesting, e.g. `about_us` → `/about/us`." } : {}
380
- },
381
- validate: (value) => {
382
- if (typeof value !== "string")
383
- return "Slug must be a string";
384
- if (value !== "" && !slugPattern.test(value)) {
385
- return 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)";
386
- }
387
- return true;
388
- }
389
- };
390
369
  const baseFields = [
391
370
  {
392
371
  name: "title",
@@ -416,7 +395,7 @@ var createPagesCollection = (blocks, options = {}) => {
416
395
  type: "date",
417
396
  admin: { position: "sidebar" }
418
397
  },
419
- slugField
398
+ slugField({ nested })
420
399
  ];
421
400
  const { afterChange: revalidateAfterChange, afterDelete: revalidateAfterDelete } = createRevalidateCollectionHook({
422
401
  collectionSlug,
@@ -451,14 +430,6 @@ var createPostsCollection = (options = {}) => {
451
430
  localePrefix,
452
431
  defaultLocale
453
432
  } = options;
454
- const slugField = {
455
- name: "slug",
456
- type: "text",
457
- required: true,
458
- unique: true,
459
- index: true,
460
- admin: { position: "sidebar" }
461
- };
462
433
  const baseFields = [
463
434
  {
464
435
  name: "title",
@@ -483,7 +454,7 @@ var createPostsCollection = (options = {}) => {
483
454
  type: "date",
484
455
  admin: { position: "sidebar" }
485
456
  },
486
- slugField
457
+ slugField()
487
458
  ];
488
459
  const { afterChange, afterDelete } = createRevalidateCollectionHook({
489
460
  collectionSlug,
@@ -584,11 +555,11 @@ var createStaticPagesCollection = (blocks) => {
584
555
  };
585
556
 
586
557
  // src/core/fields/link.ts
587
- var appearanceOptions = {
558
+ var appearanceOptions2 = {
588
559
  default: { label: "Default", value: "default" },
589
560
  outline: { label: "Outline", value: "outline" }
590
561
  };
591
- var link = (options = {}) => {
562
+ var link2 = (options = {}) => {
592
563
  const {
593
564
  appearances,
594
565
  disableLabel = false,
@@ -663,7 +634,7 @@ var link = (options = {}) => {
663
634
  result.fields = [...result.fields, ...linkTypes];
664
635
  }
665
636
  if (appearances !== false) {
666
- const opts = appearances ? appearances.map((a) => appearanceOptions[a]) : [appearanceOptions.default, appearanceOptions.outline];
637
+ const opts = appearances ? appearances.map((a) => appearanceOptions2[a]) : [appearanceOptions2.default, appearanceOptions2.outline];
667
638
  result.fields.push({
668
639
  name: "appearance",
669
640
  type: "select",
@@ -704,12 +675,12 @@ var createHeaderGlobal = (options = {}) => {
704
675
  slug: "navColumn",
705
676
  fields: [
706
677
  { name: "title", type: "text", required: true, localized: true },
707
- { name: "links", type: "array", fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
678
+ { name: "links", type: "array", fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
708
679
  ]
709
680
  };
710
681
  const navItemBlock = {
711
682
  slug: "navItem",
712
- fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
683
+ fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
713
684
  };
714
685
  return {
715
686
  slug: "header",
@@ -741,12 +712,12 @@ var createFooterGlobal = (options = {}) => {
741
712
  slug: "navColumn",
742
713
  fields: [
743
714
  { name: "title", type: "text", required: true, localized: true },
744
- { name: "links", type: "array", fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
715
+ { name: "links", type: "array", fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navColumnLinkFields })] }
745
716
  ]
746
717
  };
747
718
  const navItemBlock = {
748
719
  slug: "navItem",
749
- fields: [link({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
720
+ fields: [link2({ appearances: false, localized: true, relationTo: linkRelationTo, extraFields: navItemLinkFields })]
750
721
  };
751
722
  return {
752
723
  slug: "footer",
@@ -835,7 +806,7 @@ function getFromImportMap(key, importMap) {
835
806
  var queryDocBySlug = cache(async function queryDocBySlug2({
836
807
  collectionSlug,
837
808
  slug,
838
- slugField = "slug",
809
+ slugField: slugField2 = "slug",
839
810
  locale,
840
811
  draft = false,
841
812
  config
@@ -847,14 +818,14 @@ var queryDocBySlug = cache(async function queryDocBySlug2({
847
818
  limit: 1,
848
819
  pagination: false,
849
820
  overrideAccess: draft,
850
- where: { [slugField]: { equals: slug } },
821
+ where: { [slugField2]: { equals: slug } },
851
822
  locale
852
823
  });
853
824
  return result.docs?.[0] ?? null;
854
825
  });
855
826
  var queryAllDocs = cache(async function queryAllDocs2({
856
827
  collectionSlug,
857
- slugField = "slug",
828
+ slugField: slugField2 = "slug",
858
829
  locale,
859
830
  config
860
831
  }) {
@@ -865,7 +836,7 @@ var queryAllDocs = cache(async function queryAllDocs2({
865
836
  limit: 1000,
866
837
  pagination: false,
867
838
  overrideAccess: false,
868
- select: { [slugField]: true },
839
+ select: { [slugField2]: true },
869
840
  locale
870
841
  });
871
842
  return result.docs ?? [];
@@ -873,7 +844,7 @@ var queryAllDocs = cache(async function queryAllDocs2({
873
844
  var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
874
845
  collectionSlug,
875
846
  slug,
876
- slugField = "slug",
847
+ slugField: slugField2 = "slug",
877
848
  locale,
878
849
  config
879
850
  }) {
@@ -885,13 +856,25 @@ var queryAllLocaleSlugs = cache(async function queryAllLocaleSlugs2({
885
856
  pagination: false,
886
857
  overrideAccess: false,
887
858
  locale,
888
- where: { [slugField]: { equals: slug } },
889
- select: { [slugField]: true }
859
+ where: { [slugField2]: { equals: slug } },
860
+ select: { [slugField2]: true }
890
861
  });
891
862
  const doc = result.docs?.[0];
892
863
  if (!doc)
893
864
  return;
894
- const fieldValue = doc?.[slugField];
865
+ let fieldValue = doc[slugField2];
866
+ if (doc.id != null) {
867
+ const allLocales2 = await payload.findByID({
868
+ collection: collectionSlug,
869
+ id: doc.id,
870
+ locale: "all",
871
+ draft: false,
872
+ overrideAccess: false,
873
+ select: { [slugField2]: true }
874
+ }).catch(() => null);
875
+ if (allLocales2)
876
+ fieldValue = allLocales2[slugField2];
877
+ }
895
878
  if (fieldValue && typeof fieldValue === "object") {
896
879
  return fieldValue;
897
880
  }
@@ -1098,10 +1081,10 @@ function createWWWConfig(options) {
1098
1081
  }
1099
1082
 
1100
1083
  // src/core/fields/linkGroup.ts
1101
- var linkGroup = (options = {}) => ({
1084
+ var linkGroup2 = (options = {}) => ({
1102
1085
  name: "links",
1103
1086
  type: "array",
1104
- fields: [link(options)],
1087
+ fields: [link2(options)],
1105
1088
  admin: { initCollapsed: true }
1106
1089
  });
1107
1090
 
@@ -2037,8 +2020,8 @@ export {
2037
2020
  queryDocBySlug,
2038
2021
  queryAllLocaleSlugs,
2039
2022
  queryAllDocs,
2040
- linkGroup,
2041
- link,
2023
+ linkGroup2 as linkGroup,
2024
+ link2 as link,
2042
2025
  getUrlPath,
2043
2026
  getRenderModuleExports,
2044
2027
  getFromImportMap,
@@ -2066,7 +2049,7 @@ export {
2066
2049
  buildArticleLd,
2067
2050
  authenticatedOrPublished,
2068
2051
  authenticated,
2069
- appearanceOptions,
2052
+ appearanceOptions2 as appearanceOptions,
2070
2053
  anyone,
2071
2054
  addCollectionsToSitemap,
2072
2055
  STATIC_PAGES_SLUG,