@ainsleydev/payload-helper 0.0.7 → 0.0.8

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 (66) hide show
  1. package/package.json +2 -2
  2. package/dist/cli/bin.d.ts +0 -2
  3. package/dist/cli/bin.js +0 -17
  4. package/dist/cli/bin.js.map +0 -1
  5. package/dist/cli/types.d.ts +0 -4
  6. package/dist/cli/types.js +0 -34
  7. package/dist/cli/types.js.map +0 -1
  8. package/dist/collections/Media.d.ts +0 -10
  9. package/dist/collections/Media.js +0 -150
  10. package/dist/collections/Media.js.map +0 -1
  11. package/dist/collections/Redirects.d.ts +0 -10
  12. package/dist/collections/Redirects.js +0 -72
  13. package/dist/collections/Redirects.js.map +0 -1
  14. package/dist/common/SEO.d.ts +0 -6
  15. package/dist/common/SEO.js +0 -45
  16. package/dist/common/SEO.js.map +0 -1
  17. package/dist/endpoints/slug.d.ts +0 -7
  18. package/dist/endpoints/slug.js +0 -39
  19. package/dist/endpoints/slug.js.map +0 -1
  20. package/dist/globals/Navigation.d.ts +0 -28
  21. package/dist/globals/Navigation.js +0 -138
  22. package/dist/globals/Navigation.js.map +0 -1
  23. package/dist/globals/Settings.d.ts +0 -10
  24. package/dist/globals/Settings.js +0 -346
  25. package/dist/globals/Settings.js.map +0 -1
  26. package/dist/globals/countries.d.ts +0 -1
  27. package/dist/globals/countries.js +0 -198
  28. package/dist/globals/countries.js.map +0 -1
  29. package/dist/globals/locales.d.ts +0 -7
  30. package/dist/globals/locales.js +0 -2664
  31. package/dist/globals/locales.js.map +0 -1
  32. package/dist/index.d.ts +0 -9
  33. package/dist/index.js +0 -22
  34. package/dist/index.js.map +0 -1
  35. package/dist/plugin/schema.d.ts +0 -21
  36. package/dist/plugin/schema.js +0 -239
  37. package/dist/plugin/schema.js.map +0 -1
  38. package/dist/seed/down.d.ts +0 -13
  39. package/dist/seed/down.js +0 -35
  40. package/dist/seed/down.js.map +0 -1
  41. package/dist/seed/seed.d.ts +0 -31
  42. package/dist/seed/seed.js +0 -58
  43. package/dist/seed/seed.js.map +0 -1
  44. package/dist/seed/types.d.ts +0 -125
  45. package/dist/seed/types.js +0 -3
  46. package/dist/seed/types.js.map +0 -1
  47. package/dist/seed/up.d.ts +0 -23
  48. package/dist/seed/up.js +0 -55
  49. package/dist/seed/up.js.map +0 -1
  50. package/dist/types.d.ts +0 -10
  51. package/dist/types.js +0 -4
  52. package/dist/types.js.map +0 -1
  53. package/dist/util/env.d.ts +0 -12
  54. package/dist/util/env.js +0 -75
  55. package/dist/util/env.js.map +0 -1
  56. package/dist/util/fields.d.ts +0 -7
  57. package/dist/util/fields.js +0 -12
  58. package/dist/util/fields.js.map +0 -1
  59. package/dist/util/lexical.d.ts +0 -15
  60. package/dist/util/lexical.js +0 -87
  61. package/dist/util/lexical.js.map +0 -1
  62. package/dist/util/lexical.test.js +0 -21
  63. package/dist/util/lexical.test.js.map +0 -1
  64. package/dist/util/validation.d.ts +0 -2
  65. package/dist/util/validation.js +0 -23
  66. package/dist/util/validation.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainsleydev/payload-helper",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Payload CMS utilities, collections and global types for ainsley.dev builds",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
24
24
  "format": "biome format --write . --apply-unsafe --organise-imports",
25
25
  "lint": "biome lint --write .",
26
- "release": "npm publish --access public",
26
+ "release": "pnpm build & npm publish --access public",
27
27
  "clean": "rimraf {dist,*.tsbuildinfo}",
28
28
  "test": "jest"
29
29
  },
package/dist/cli/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare const bin: () => Promise<void>;
package/dist/cli/bin.js DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import { generateTypes } from './types.js';
4
- import chalk from 'chalk';
5
- const program = new Command();
6
- program.command('generate-types').description('Generate JSON schema types for Payload CMS').action(async ()=>{
7
- try {
8
- await generateTypes('');
9
- } catch (error) {
10
- console.log(chalk.red(error));
11
- }
12
- });
13
- export const bin = async ()=>{
14
- await program.parseAsync(process.argv);
15
- };
16
-
17
- //# sourceMappingURL=bin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cli/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport { generateTypes } from './types.js';\nimport chalk from 'chalk';\n\nconst program = new Command();\n\nprogram\n\t.command('generate-types')\n\t.description('Generate JSON schema types for Payload CMS')\n\t.action(async () => {\n\t\ttry {\n\t\t\tawait generateTypes('');\n\t\t} catch (error) {\n\t\t\tconsole.log(chalk.red(error));\n\t\t}\n\t});\n\nexport const bin = async () => {\n\tawait program.parseAsync(process.argv);\n};\n"],"names":["Command","generateTypes","chalk","program","command","description","action","error","console","log","red","bin","parseAsync","process","argv"],"mappings":";AACA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,aAAa,QAAQ,aAAa;AAC3C,OAAOC,WAAW,QAAQ;AAE1B,MAAMC,UAAU,IAAIH;AAEpBG,QACEC,OAAO,CAAC,kBACRC,WAAW,CAAC,8CACZC,MAAM,CAAC;IACP,IAAI;QACH,MAAML,cAAc;IACrB,EAAE,OAAOM,OAAO;QACfC,QAAQC,GAAG,CAACP,MAAMQ,GAAG,CAACH;IACvB;AACD;AAED,OAAO,MAAMI,MAAM;IAClB,MAAMR,QAAQS,UAAU,CAACC,QAAQC,IAAI;AACtC,EAAE"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Creates JSON schema types of Payloads Collections & Globals
3
- */
4
- export declare function generateTypes(outFile: string): Promise<void>;
package/dist/cli/types.js DELETED
@@ -1,34 +0,0 @@
1
- import * as fs from 'node:fs';
2
- import { configToJSONSchema, getPayload } from 'payload';
3
- import { findConfig, importConfig } from 'payload/node';
4
- /**
5
- * Creates JSON schema types of Payloads Collections & Globals
6
- */ export async function generateTypes(outFile) {
7
- console.log('Compiling JSON types for Collections and Globals...');
8
- let configPath = '';
9
- try {
10
- configPath = findConfig();
11
- } catch (e) {
12
- console.log(`Error finding config: ${e}`);
13
- return;
14
- }
15
- // Set the environment variable to generate Golang types.
16
- process.env.GEN_GOLANG = 'true';
17
- const config = await importConfig(configPath);
18
- const outputFile = (process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile).replace('.ts', '.json');
19
- const payload = await getPayload({
20
- config,
21
- disableDBConnect: true,
22
- disableOnInit: true,
23
- // @ts-ignore
24
- local: true,
25
- secret: '--unused--'
26
- });
27
- const jsonSchema = configToJSONSchema(payload.config, payload.db.defaultIDType);
28
- const prettyJSON = JSON.stringify(jsonSchema, null, 4);
29
- fs.writeFileSync(outputFile, prettyJSON);
30
- console.log(`JSON types written to: ${outputFile}`);
31
- delete process.env.GEN_GOLANG;
32
- }
33
-
34
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cli/types.ts"],"sourcesContent":["import * as fs from 'node:fs';\nimport { configToJSONSchema, getPayload } from 'payload';\nimport { findConfig, importConfig } from 'payload/node';\n\n/**\n * Creates JSON schema types of Payloads Collections & Globals\n */\nexport async function generateTypes(outFile: string): Promise<void> {\n\tconsole.log('Compiling JSON types for Collections and Globals...');\n\n\tlet configPath = '';\n\ttry {\n\t\tconfigPath = findConfig();\n\t} catch (e) {\n\t\tconsole.log(`Error finding config: ${e}`);\n\t\treturn;\n\t}\n\n\t// Set the environment variable to generate Golang types.\n\tprocess.env.GEN_GOLANG = 'true';\n\n\tconst config = await importConfig(configPath);\n\tconst outputFile = (process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile).replace(\n\t\t'.ts',\n\t\t'.json',\n\t);\n\n\tconst payload = await getPayload({\n\t\tconfig,\n\t\tdisableDBConnect: true,\n\t\tdisableOnInit: true,\n\t\t// @ts-ignore\n\t\tlocal: true,\n\t\tsecret: '--unused--',\n\t});\n\n\tconst jsonSchema = configToJSONSchema(payload.config, payload.db.defaultIDType);\n\tconst prettyJSON = JSON.stringify(jsonSchema, null, 4);\n\n\tfs.writeFileSync(outputFile, prettyJSON);\n\n\tconsole.log(`JSON types written to: ${outputFile}`);\n\n\tdelete process.env.GEN_GOLANG;\n}\n"],"names":["fs","configToJSONSchema","getPayload","findConfig","importConfig","generateTypes","outFile","console","log","configPath","e","process","env","GEN_GOLANG","config","outputFile","PAYLOAD_TS_OUTPUT_PATH","typescript","replace","payload","disableDBConnect","disableOnInit","local","secret","jsonSchema","db","defaultIDType","prettyJSON","JSON","stringify","writeFileSync"],"mappings":"AAAA,YAAYA,QAAQ,UAAU;AAC9B,SAASC,kBAAkB,EAAEC,UAAU,QAAQ,UAAU;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,eAAe;AAExD;;CAEC,GACD,OAAO,eAAeC,cAAcC,OAAe;IAClDC,QAAQC,GAAG,CAAC;IAEZ,IAAIC,aAAa;IACjB,IAAI;QACHA,aAAaN;IACd,EAAE,OAAOO,GAAG;QACXH,QAAQC,GAAG,CAAC,CAAC,sBAAsB,EAAEE,EAAE,CAAC;QACxC;IACD;IAEA,yDAAyD;IACzDC,QAAQC,GAAG,CAACC,UAAU,GAAG;IAEzB,MAAMC,SAAS,MAAMV,aAAaK;IAClC,MAAMM,aAAa,AAACJ,CAAAA,QAAQC,GAAG,CAACI,sBAAsB,IAAIF,OAAOG,UAAU,CAACF,UAAU,AAAD,EAAGG,OAAO,CAC9F,OACA;IAGD,MAAMC,UAAU,MAAMjB,WAAW;QAChCY;QACAM,kBAAkB;QAClBC,eAAe;QACf,aAAa;QACbC,OAAO;QACPC,QAAQ;IACT;IAEA,MAAMC,aAAavB,mBAAmBkB,QAAQL,MAAM,EAAEK,QAAQM,EAAE,CAACC,aAAa;IAC9E,MAAMC,aAAaC,KAAKC,SAAS,CAACL,YAAY,MAAM;IAEpDxB,GAAG8B,aAAa,CAACf,YAAYY;IAE7BpB,QAAQC,GAAG,CAAC,CAAC,uBAAuB,EAAEO,WAAW,CAAC;IAElD,OAAOJ,QAAQC,GAAG,CAACC,UAAU;AAC9B"}
@@ -1,10 +0,0 @@
1
- import type { CollectionConfig, Field } from 'payload';
2
- /**
3
- * Media Collection Configuration
4
- * Additional fields will be appended to the media collection.
5
- *
6
- * @constructor
7
- * @param editor
8
- * @param additionalFields
9
- */
10
- export declare const Media: (additionalFields?: Field[]) => CollectionConfig;
@@ -1,150 +0,0 @@
1
- // import type {
2
- // LexicalRichTextAdapterProvider,
3
- // LexicalEditorProps,
4
- // } from '@payloadcms/richtext-lexical';
5
- /**
6
- * Media Collection Configuration
7
- * Additional fields will be appended to the media collection.
8
- *
9
- * @constructor
10
- * @param editor
11
- * @param additionalFields
12
- */ export const Media = (//editor?: (props?: LexicalEditorProps) => LexicalRichTextAdapterProvider,
13
- additionalFields)=>{
14
- return {
15
- slug: 'media',
16
- access: {
17
- read: ()=>true
18
- },
19
- fields: [
20
- {
21
- name: 'alt',
22
- type: 'text',
23
- required: true
24
- },
25
- {
26
- name: 'caption',
27
- type: 'richText',
28
- required: false
29
- },
30
- ...additionalFields ? additionalFields : []
31
- ],
32
- upload: {
33
- staticDir: 'media',
34
- imageSizes: [
35
- // Original Size (for WebP & Avif)
36
- {
37
- name: 'webp',
38
- width: undefined,
39
- height: undefined,
40
- formatOptions: {
41
- format: 'webp',
42
- options: {
43
- quality: 80
44
- }
45
- }
46
- },
47
- {
48
- name: 'avif',
49
- width: undefined,
50
- height: undefined,
51
- formatOptions: {
52
- format: 'avif',
53
- options: {
54
- quality: 80
55
- }
56
- }
57
- },
58
- // Thumbnail Sizes
59
- {
60
- name: 'thumbnail',
61
- width: 400,
62
- height: 300,
63
- position: 'centre'
64
- },
65
- {
66
- name: 'thumbnail_webp',
67
- width: 400,
68
- height: 300,
69
- position: 'centre',
70
- formatOptions: {
71
- format: 'webp',
72
- options: {
73
- quality: 80
74
- }
75
- }
76
- },
77
- {
78
- name: 'thumbnail_avif',
79
- width: 400,
80
- height: 300,
81
- position: 'centre',
82
- formatOptions: {
83
- format: 'avif',
84
- options: {
85
- quality: 80
86
- }
87
- }
88
- },
89
- // Mobile Sizes
90
- {
91
- name: 'mobile',
92
- width: 768,
93
- height: undefined
94
- },
95
- {
96
- name: 'mobile_webp',
97
- width: 768,
98
- height: undefined,
99
- formatOptions: {
100
- format: 'webp',
101
- options: {
102
- quality: 80
103
- }
104
- }
105
- },
106
- {
107
- name: 'mobile_avif',
108
- width: 768,
109
- height: undefined,
110
- formatOptions: {
111
- format: 'avif',
112
- options: {
113
- quality: 80
114
- }
115
- }
116
- },
117
- // Tablet Sizes
118
- {
119
- name: 'tablet',
120
- width: 1024,
121
- height: undefined
122
- },
123
- {
124
- name: 'tablet_webp',
125
- width: 1024,
126
- height: undefined,
127
- formatOptions: {
128
- format: 'webp',
129
- options: {
130
- quality: 80
131
- }
132
- }
133
- },
134
- {
135
- name: 'tablet_avif',
136
- width: 1024,
137
- height: undefined,
138
- formatOptions: {
139
- format: 'avif',
140
- options: {
141
- quality: 80
142
- }
143
- }
144
- }
145
- ]
146
- }
147
- };
148
- };
149
-
150
- //# sourceMappingURL=Media.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/collections/Media.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload';\n// import type {\n// \tLexicalRichTextAdapterProvider,\n// \tLexicalEditorProps,\n// } from '@payloadcms/richtext-lexical';\n\n/**\n * Media Collection Configuration\n * Additional fields will be appended to the media collection.\n *\n * @constructor\n * @param editor\n * @param additionalFields\n */\nexport const Media = (\n\t//editor?: (props?: LexicalEditorProps) => LexicalRichTextAdapterProvider,\n\tadditionalFields?: Field[],\n): CollectionConfig => {\n\treturn {\n\t\tslug: 'media',\n\t\taccess: {\n\t\t\tread: () => true,\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'alt',\n\t\t\t\ttype: 'text',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'caption',\n\t\t\t\ttype: 'richText',\n\t\t\t\trequired: false,\n\t\t\t\t// editor: editor({\n\t\t\t\t// \t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// \t// @ts-ignore\n\t\t\t\t// \tfeatures: ({ defaultFeatures }) => {\n\t\t\t\t// \t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// \t\t// @ts-ignore\n\t\t\t\t// \t\treturn defaultFeatures.filter((feature) => {\n\t\t\t\t// \t\t\treturn feature.key === 'paragraph' || feature.key === 'link';\n\t\t\t\t// \t\t});\n\t\t\t\t// \t},\n\t\t\t\t// }),\n\t\t\t},\n\t\t\t...(additionalFields ? additionalFields : []),\n\t\t],\n\t\tupload: {\n\t\t\tstaticDir: 'media',\n\t\t\timageSizes: [\n\t\t\t\t// Original Size (for WebP & Avif)\n\t\t\t\t{\n\t\t\t\t\tname: 'webp',\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'avif',\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Thumbnail Sizes\n\t\t\t\t{\n\t\t\t\t\tname: 'thumbnail',\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 300,\n\t\t\t\t\tposition: 'centre',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'thumbnail_webp',\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 300,\n\t\t\t\t\tposition: 'centre',\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'thumbnail_avif',\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 300,\n\t\t\t\t\tposition: 'centre',\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Mobile Sizes\n\t\t\t\t{\n\t\t\t\t\tname: 'mobile',\n\t\t\t\t\twidth: 768,\n\t\t\t\t\theight: undefined,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'mobile_webp',\n\t\t\t\t\twidth: 768,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'mobile_avif',\n\t\t\t\t\twidth: 768,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Tablet Sizes\n\t\t\t\t{\n\t\t\t\t\tname: 'tablet',\n\t\t\t\t\twidth: 1024,\n\t\t\t\t\theight: undefined,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'tablet_webp',\n\t\t\t\t\twidth: 1024,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'tablet_avif',\n\t\t\t\t\twidth: 1024,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n};\n"],"names":["Media","additionalFields","slug","access","read","fields","name","type","required","upload","staticDir","imageSizes","width","undefined","height","formatOptions","format","options","quality","position"],"mappings":"AACA,gBAAgB;AAChB,mCAAmC;AACnC,uBAAuB;AACvB,yCAAyC;AAEzC;;;;;;;CAOC,GACD,OAAO,MAAMA,QAAQ,CACpB,0EAA0E;AAC1EC;IAEA,OAAO;QACNC,MAAM;QACNC,QAAQ;YACPC,MAAM,IAAM;QACb;QACAC,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACX;YACA;gBACCF,MAAM;gBACNC,MAAM;gBACNC,UAAU;YAYX;eACIP,mBAAmBA,mBAAmB,EAAE;SAC5C;QACDQ,QAAQ;YACPC,WAAW;YACXC,YAAY;gBACX,kCAAkC;gBAClC;oBACCL,MAAM;oBACNM,OAAOC;oBACPC,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAOC;oBACPC,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA,kBAAkB;gBAClB;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQ;oBACRK,UAAU;gBACX;gBACA;oBACCb,MAAM;oBACNM,OAAO;oBACPE,QAAQ;oBACRK,UAAU;oBACVJ,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQ;oBACRK,UAAU;oBACVJ,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA,eAAe;gBACf;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;gBACT;gBACA;oBACCP,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA,eAAe;gBACf;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;gBACT;gBACA;oBACCP,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;aACA;QACF;IACD;AACD,EAAE"}
@@ -1,10 +0,0 @@
1
- import type { CollectionConfig } from 'payload';
2
- /**
3
- * Redirects Collection Configuration
4
- * In favour of the native plugin for more granular control.
5
- *
6
- * TODO: Potential to add regex redirects here, i.e product-category/(.*)$ => /category/$1
7
- *
8
- * @constructor
9
- */
10
- export declare const Redirects: (overrides?: Partial<CollectionConfig>) => CollectionConfig;
@@ -1,72 +0,0 @@
1
- /**
2
- * Redirects Collection Configuration
3
- * In favour of the native plugin for more granular control.
4
- *
5
- * TODO: Potential to add regex redirects here, i.e product-category/(.*)$ => /category/$1
6
- *
7
- * @constructor
8
- */ export const Redirects = (overrides)=>{
9
- return {
10
- slug: 'redirects',
11
- admin: {
12
- useAsTitle: 'from'
13
- },
14
- fields: [
15
- {
16
- name: 'from',
17
- type: 'text',
18
- label: 'From URL',
19
- required: true,
20
- index: true,
21
- admin: {
22
- description: 'The URL you want to redirect from, ensure it starts with a /'
23
- }
24
- },
25
- {
26
- name: 'to',
27
- type: 'text',
28
- label: 'Destination URL',
29
- required: true,
30
- admin: {
31
- description: 'The URL you want to redirect to, can be a relative or absolute URL'
32
- }
33
- },
34
- {
35
- name: 'code',
36
- type: 'select',
37
- label: 'Redirect Code',
38
- required: true,
39
- defaultValue: '301',
40
- options: [
41
- {
42
- label: '301 - Permanent',
43
- value: '301'
44
- },
45
- {
46
- label: '302 - Temporary',
47
- value: '302'
48
- },
49
- {
50
- label: '307 - Temporary Redirect',
51
- value: '307'
52
- },
53
- {
54
- label: '308 - Permanent Redirect',
55
- value: '308'
56
- },
57
- {
58
- label: '410 - Content Deleted',
59
- value: '410'
60
- },
61
- {
62
- label: '451 - Unavailable For Legal Reasons',
63
- value: '451'
64
- }
65
- ]
66
- }
67
- ],
68
- ...overrides ? overrides : {}
69
- };
70
- };
71
-
72
- //# sourceMappingURL=Redirects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/collections/Redirects.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload';\n\n/**\n * Redirects Collection Configuration\n * In favour of the native plugin for more granular control.\n *\n * TODO: Potential to add regex redirects here, i.e product-category/(.*)$ => /category/$1\n *\n * @constructor\n */\nexport const Redirects = (overrides?: Partial<CollectionConfig>): CollectionConfig => {\n\treturn {\n\t\tslug: 'redirects',\n\t\tadmin: {\n\t\t\tuseAsTitle: 'from',\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'from',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'From URL',\n\t\t\t\trequired: true,\n\t\t\t\tindex: true,\n\t\t\t\tadmin: {\n\t\t\t\t\tdescription: 'The URL you want to redirect from, ensure it starts with a /',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'to',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'Destination URL',\n\t\t\t\trequired: true,\n\t\t\t\tadmin: {\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The URL you want to redirect to, can be a relative or absolute URL',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'code',\n\t\t\t\ttype: 'select',\n\t\t\t\tlabel: 'Redirect Code',\n\t\t\t\trequired: true,\n\t\t\t\tdefaultValue: '301',\n\t\t\t\toptions: [\n\t\t\t\t\t{ label: '301 - Permanent', value: '301' },\n\t\t\t\t\t{ label: '302 - Temporary', value: '302' },\n\t\t\t\t\t{ label: '307 - Temporary Redirect', value: '307' },\n\t\t\t\t\t{ label: '308 - Permanent Redirect', value: '308' },\n\t\t\t\t\t{ label: '410 - Content Deleted', value: '410' },\n\t\t\t\t\t{ label: '451 - Unavailable For Legal Reasons', value: '451' },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t\t...(overrides ? overrides : {}),\n\t};\n};\n"],"names":["Redirects","overrides","slug","admin","useAsTitle","fields","name","type","label","required","index","description","defaultValue","options","value"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,YAAY,CAACC;IACzB,OAAO;QACNC,MAAM;QACNC,OAAO;YACNC,YAAY;QACb;QACAC,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;gBACVC,OAAO;gBACPP,OAAO;oBACNQ,aAAa;gBACd;YACD;YACA;gBACCL,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;gBACVN,OAAO;oBACNQ,aACC;gBACF;YACD;YACA;gBACCL,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;gBACVG,cAAc;gBACdC,SAAS;oBACR;wBAAEL,OAAO;wBAAmBM,OAAO;oBAAM;oBACzC;wBAAEN,OAAO;wBAAmBM,OAAO;oBAAM;oBACzC;wBAAEN,OAAO;wBAA4BM,OAAO;oBAAM;oBAClD;wBAAEN,OAAO;wBAA4BM,OAAO;oBAAM;oBAClD;wBAAEN,OAAO;wBAAyBM,OAAO;oBAAM;oBAC/C;wBAAEN,OAAO;wBAAuCM,OAAO;oBAAM;iBAC7D;YACF;SACA;QACD,GAAIb,YAAYA,YAAY,CAAC,CAAC;IAC/B;AACD,EAAE"}
@@ -1,6 +0,0 @@
1
- import { Field } from 'payload';
2
- /**
3
- * SEO Fields define the additional fields that appear
4
- * within the Payload SEO plugin.
5
- */
6
- export declare const SEOFields: Field[];
@@ -1,45 +0,0 @@
1
- // @ts-ignore
2
- import { validateURL } from '../util/validation';
3
- /**
4
- * SEO Fields define the additional fields that appear
5
- * within the Payload SEO plugin.
6
- */ export const SEOFields = [
7
- {
8
- type: 'row',
9
- fields: [
10
- {
11
- name: 'private',
12
- type: 'checkbox',
13
- label: 'Private',
14
- defaultValue: false,
15
- admin: {
16
- width: '50%',
17
- description: 'Enable private mode to prevent robots from crawling the page or website. When enabled it will output <meta name="robots" content="noindex" /> on the frontend.'
18
- }
19
- },
20
- {
21
- name: 'canonicalURL',
22
- type: 'text',
23
- label: 'Canonical',
24
- admin: {
25
- width: '50%',
26
- description: 'A canonical URL is the version of a webpage chosen by search engines like Google as the main version when there are duplicates.'
27
- },
28
- validate: validateURL
29
- }
30
- ]
31
- },
32
- {
33
- name: 'structuredData',
34
- type: 'json',
35
- label: 'Structured Data',
36
- // typescriptSchema: [
37
- // () => ({...addGoJSONSchema('[]byte', false)}),
38
- // ],
39
- admin: {
40
- description: 'Structured data is a standardized format for providing information about a page and classifying the page content. The site Schema.org contains a standardised list of markup that the major search engines — Google, Bing, Yahoo and Yandex — have collectively agreed to support.'
41
- }
42
- }
43
- ];
44
-
45
- //# sourceMappingURL=SEO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/common/SEO.ts"],"sourcesContent":["import { Field } from 'payload';\n// @ts-ignore\nimport { validateURL } from '../util/validation';\n\n/**\n * SEO Fields define the additional fields that appear\n * within the Payload SEO plugin.\n */\nexport const SEOFields: Field[] = [\n\t{\n\t\ttype: 'row',\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'private',\n\t\t\t\ttype: 'checkbox',\n\t\t\t\tlabel: 'Private',\n\t\t\t\tdefaultValue: false,\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Enable private mode to prevent robots from crawling the page or website. When enabled it will output <meta name=\"robots\" content=\"noindex\" /> on the frontend.',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'canonicalURL',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'Canonical',\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'A canonical URL is the version of a webpage chosen by search engines like Google as the main version when there are duplicates.',\n\t\t\t\t},\n\t\t\t\tvalidate: validateURL,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'structuredData',\n\t\ttype: 'json',\n\t\tlabel: 'Structured Data',\n\t\t// typescriptSchema: [\n\t\t// \t() => ({...addGoJSONSchema('[]byte', false)}),\n\t\t// ],\n\t\tadmin: {\n\t\t\tdescription:\n\t\t\t\t'Structured data is a standardized format for providing information about a page and classifying the page content. The site Schema.org contains a standardised list of markup that the major search engines — Google, Bing, Yahoo and Yandex — have collectively agreed to support.',\n\t\t},\n\t},\n];\n"],"names":["validateURL","SEOFields","type","fields","name","label","defaultValue","admin","width","description","validate"],"mappings":"AACA,aAAa;AACb,SAASA,WAAW,QAAQ,qBAAqB;AAEjD;;;CAGC,GACD,OAAO,MAAMC,YAAqB;IACjC;QACCC,MAAM;QACNC,QAAQ;YACP;gBACCC,MAAM;gBACNF,MAAM;gBACNG,OAAO;gBACPC,cAAc;gBACdC,OAAO;oBACNC,OAAO;oBACPC,aACC;gBACF;YACD;YACA;gBACCL,MAAM;gBACNF,MAAM;gBACNG,OAAO;gBACPE,OAAO;oBACNC,OAAO;oBACPC,aACC;gBACF;gBACAC,UAAUV;YACX;SACA;IACF;IACA;QACCI,MAAM;QACNF,MAAM;QACNG,OAAO;QACP,sBAAsB;QACtB,kDAAkD;QAClD,KAAK;QACLE,OAAO;YACNE,aACC;QACF;IACD;CACA,CAAC"}
@@ -1,7 +0,0 @@
1
- import { PayloadHandler } from 'payload';
2
- /**
3
- * Find a document in the given collection by its slug.
4
- *
5
- * @param collection
6
- */
7
- export declare const findBySlug: (collection: string) => PayloadHandler;
@@ -1,39 +0,0 @@
1
- /**
2
- * Find a document in the given collection by its slug.
3
- *
4
- * @param collection
5
- */ export const findBySlug = (collection)=>{
6
- return async (req)=>{
7
- try {
8
- const data = await req.payload.find({
9
- collection,
10
- where: {
11
- slug: {
12
- equals: req?.routeParams?.slug ?? ''
13
- }
14
- },
15
- limit: 1
16
- });
17
- if (data.docs.length === 0) {
18
- return new Response(JSON.stringify({
19
- error: 'not found'
20
- }), {
21
- status: 404
22
- });
23
- } else {
24
- return new Response(JSON.stringify(data.docs[0]), {
25
- status: 200
26
- });
27
- }
28
- } catch (error) {
29
- console.error('Error occurred while fetching document:', error);
30
- return new Response(JSON.stringify({
31
- error: 'Internal server error'
32
- }), {
33
- status: 500
34
- });
35
- }
36
- };
37
- };
38
-
39
- //# sourceMappingURL=slug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/endpoints/slug.ts"],"sourcesContent":["import { PayloadHandler, PayloadRequest } from 'payload';\n\n/**\n * Find a document in the given collection by its slug.\n *\n * @param collection\n */\nexport const findBySlug = (collection: string): PayloadHandler => {\n\treturn async (req: PayloadRequest): Promise<Response> => {\n\t\ttry {\n\t\t\tconst data = await req.payload.find({\n\t\t\t\tcollection,\n\t\t\t\twhere: {\n\t\t\t\t\tslug: {\n\t\t\t\t\t\tequals: req?.routeParams?.slug ?? '',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlimit: 1,\n\t\t\t});\n\t\t\tif (data.docs.length === 0) {\n\t\t\t\treturn new Response(JSON.stringify({ error: 'not found' }), { status: 404 });\n\t\t\t} else {\n\t\t\t\treturn new Response(JSON.stringify(data.docs[0]), { status: 200 });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error('Error occurred while fetching document:', error);\n\t\t\treturn new Response(JSON.stringify({ error: 'Internal server error' }), {\n\t\t\t\tstatus: 500,\n\t\t\t});\n\t\t}\n\t};\n};\n"],"names":["findBySlug","collection","req","data","payload","find","where","slug","equals","routeParams","limit","docs","length","Response","JSON","stringify","error","status","console"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,aAAa,CAACC;IAC1B,OAAO,OAAOC;QACb,IAAI;YACH,MAAMC,OAAO,MAAMD,IAAIE,OAAO,CAACC,IAAI,CAAC;gBACnCJ;gBACAK,OAAO;oBACNC,MAAM;wBACLC,QAAQN,KAAKO,aAAaF,QAAQ;oBACnC;gBACD;gBACAG,OAAO;YACR;YACA,IAAIP,KAAKQ,IAAI,CAACC,MAAM,KAAK,GAAG;gBAC3B,OAAO,IAAIC,SAASC,KAAKC,SAAS,CAAC;oBAAEC,OAAO;gBAAY,IAAI;oBAAEC,QAAQ;gBAAI;YAC3E,OAAO;gBACN,OAAO,IAAIJ,SAASC,KAAKC,SAAS,CAACZ,KAAKQ,IAAI,CAAC,EAAE,GAAG;oBAAEM,QAAQ;gBAAI;YACjE;QACD,EAAE,OAAOD,OAAO;YACfE,QAAQF,KAAK,CAAC,2CAA2CA;YACzD,OAAO,IAAIH,SAASC,KAAKC,SAAS,CAAC;gBAAEC,OAAO;YAAwB,IAAI;gBACvEC,QAAQ;YACT;QACD;IACD;AACD,EAAE"}
@@ -1,28 +0,0 @@
1
- import type { GlobalConfig, Tab, Field } from 'payload';
2
- /**
3
- * Navigation Configuration for the header and footer
4
- * nav links.
5
- */
6
- interface NavigationConfig {
7
- includeFooter?: boolean;
8
- header?: NavigationMenuConfig;
9
- footer?: NavigationMenuConfig;
10
- additionalTabs?: Tab[];
11
- }
12
- /**
13
- * Navigation Menu Configuration defines the config for an
14
- * individual navigation menu, i.e Header or Footer.
15
- */
16
- interface NavigationMenuConfig {
17
- maxDepth?: number;
18
- additionalFields?: Field[];
19
- }
20
- /**
21
- * Navigation Global Configuration
22
- * Additional fields will be appended to each navigation item.
23
- *
24
- * @constructor
25
- * @param config
26
- */
27
- export declare const Navigation: (config?: NavigationConfig) => GlobalConfig;
28
- export {};
@@ -1,138 +0,0 @@
1
- /**
2
- * Function to generate children structure recursively.
3
- *
4
- * @param depth Current depth
5
- * @param maxDepth Maximum depth to generate children
6
- * @param fields Fields to include at each level
7
- */ const generateChildren = (depth, maxDepth, fields)=>{
8
- if (depth >= maxDepth) {
9
- return [];
10
- }
11
- // Only generate children if depth is less than maxDepth
12
- if (depth < maxDepth - 1) {
13
- return [
14
- {
15
- name: 'children',
16
- type: 'array',
17
- label: `Children Level ${depth + 1}`,
18
- fields: [
19
- ...fields,
20
- ...generateChildren(depth + 1, maxDepth, fields)
21
- ]
22
- }
23
- ];
24
- }
25
- return [];
26
- };
27
- /**
28
- * The default navigation field links.
29
- */ const navFields = [
30
- {
31
- type: 'row',
32
- fields: [
33
- {
34
- name: 'title',
35
- type: 'text',
36
- label: 'Title',
37
- required: true,
38
- admin: {
39
- width: '50%'
40
- }
41
- },
42
- {
43
- name: 'url',
44
- type: 'text',
45
- label: 'URL',
46
- required: true,
47
- admin: {
48
- width: '50%'
49
- }
50
- }
51
- ]
52
- }
53
- ];
54
- /**
55
- * Navigation Global Configuration
56
- * Additional fields will be appended to each navigation item.
57
- *
58
- * @constructor
59
- * @param config
60
- */ export const Navigation = (config)=>{
61
- const tabs = [
62
- {
63
- label: 'Header',
64
- fields: [
65
- {
66
- name: 'header',
67
- type: 'array',
68
- label: 'Items',
69
- interfaceName: 'NavigationHeaderLinks',
70
- maxRows: 8,
71
- labels: {
72
- singular: 'Link',
73
- plural: 'Links'
74
- },
75
- admin: {
76
- initCollapsed: true,
77
- isSortable: true
78
- },
79
- fields: [
80
- ...navFields,
81
- ...config?.header?.maxDepth ? generateChildren(0, config.header.maxDepth, navFields) : [],
82
- ...config?.header?.additionalFields ? config.header.additionalFields : []
83
- ]
84
- }
85
- ]
86
- }
87
- ];
88
- if (config?.includeFooter) {
89
- tabs.push({
90
- label: 'Footer',
91
- fields: [
92
- {
93
- name: 'footer',
94
- type: 'array',
95
- label: 'Items',
96
- interfaceName: 'NavigationFooterLinks',
97
- maxRows: 8,
98
- labels: {
99
- singular: 'Link',
100
- plural: 'Links'
101
- },
102
- admin: {
103
- initCollapsed: true,
104
- isSortable: true
105
- },
106
- fields: [
107
- ...navFields,
108
- ...config?.footer?.maxDepth ? generateChildren(0, config.footer.maxDepth, navFields) : [],
109
- ...config?.footer?.additionalFields ? config.footer.additionalFields : []
110
- ]
111
- }
112
- ]
113
- });
114
- }
115
- return {
116
- slug: 'navigation',
117
- typescript: {
118
- interface: 'Navigation'
119
- },
120
- graphQL: {
121
- name: 'Navigation'
122
- },
123
- access: {
124
- read: ()=>true
125
- },
126
- fields: [
127
- {
128
- type: 'tabs',
129
- tabs: [
130
- ...tabs,
131
- ...config?.additionalTabs ? config.additionalTabs : []
132
- ]
133
- }
134
- ]
135
- };
136
- };
137
-
138
- //# sourceMappingURL=Navigation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/globals/Navigation.ts"],"sourcesContent":["import type { GlobalConfig, Tab, Field, ArrayField } from 'payload';\n\n/**\n * Navigation Configuration for the header and footer\n * nav links.\n */\ninterface NavigationConfig {\n\tincludeFooter?: boolean;\n\theader?: NavigationMenuConfig;\n\tfooter?: NavigationMenuConfig;\n\tadditionalTabs?: Tab[];\n}\n\n/**\n * Navigation Menu Configuration defines the config for an\n * individual navigation menu, i.e Header or Footer.\n */\ninterface NavigationMenuConfig {\n\tmaxDepth?: number;\n\tadditionalFields?: Field[];\n}\n\n/**\n * Function to generate children structure recursively.\n *\n * @param depth Current depth\n * @param maxDepth Maximum depth to generate children\n * @param fields Fields to include at each level\n */\nconst generateChildren = (depth: number, maxDepth: number, fields: Field[]): Field[] => {\n\tif (depth >= maxDepth) {\n\t\treturn [];\n\t}\n\n\t// Only generate children if depth is less than maxDepth\n\tif (depth < maxDepth - 1) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'children',\n\t\t\t\ttype: 'array',\n\t\t\t\tlabel: `Children Level ${depth + 1}`,\n\t\t\t\tfields: [...fields, ...generateChildren(depth + 1, maxDepth, fields)],\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [];\n};\n\n/**\n * The default navigation field links.\n */\nconst navFields: Field[] = [\n\t{\n\t\ttype: 'row',\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'title',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'Title',\n\t\t\t\trequired: true,\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'url',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'URL',\n\t\t\t\trequired: true,\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\n/**\n * Navigation Global Configuration\n * Additional fields will be appended to each navigation item.\n *\n * @constructor\n * @param config\n */\nexport const Navigation = (config?: NavigationConfig): GlobalConfig => {\n\tconst tabs: Tab[] = [\n\t\t{\n\t\t\tlabel: 'Header',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tname: 'header',\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tlabel: 'Items',\n\t\t\t\t\tinterfaceName: 'NavigationHeaderLinks',\n\t\t\t\t\tmaxRows: 8,\n\t\t\t\t\tlabels: {\n\t\t\t\t\t\tsingular: 'Link',\n\t\t\t\t\t\tplural: 'Links',\n\t\t\t\t\t},\n\t\t\t\t\tadmin: {\n\t\t\t\t\t\tinitCollapsed: true,\n\t\t\t\t\t\tisSortable: true,\n\t\t\t\t\t},\n\t\t\t\t\tfields: [\n\t\t\t\t\t\t...navFields,\n\t\t\t\t\t\t...(config?.header?.maxDepth\n\t\t\t\t\t\t\t? generateChildren(0, config.header.maxDepth, navFields)\n\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t...(config?.header?.additionalFields ? config.header.additionalFields : []),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t} as ArrayField,\n\t];\n\n\tif (config?.includeFooter) {\n\t\ttabs.push({\n\t\t\tlabel: 'Footer',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tname: 'footer',\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tlabel: 'Items',\n\t\t\t\t\tinterfaceName: 'NavigationFooterLinks',\n\t\t\t\t\tmaxRows: 8,\n\t\t\t\t\tlabels: {\n\t\t\t\t\t\tsingular: 'Link',\n\t\t\t\t\t\tplural: 'Links',\n\t\t\t\t\t},\n\t\t\t\t\tadmin: {\n\t\t\t\t\t\tinitCollapsed: true,\n\t\t\t\t\t\tisSortable: true,\n\t\t\t\t\t},\n\t\t\t\t\tfields: [\n\t\t\t\t\t\t...navFields,\n\t\t\t\t\t\t...(config?.footer?.maxDepth\n\t\t\t\t\t\t\t? generateChildren(0, config.footer.maxDepth, navFields)\n\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t...(config?.footer?.additionalFields ? config.footer.additionalFields : []),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t} as ArrayField);\n\t}\n\n\treturn {\n\t\tslug: 'navigation',\n\t\ttypescript: {\n\t\t\tinterface: 'Navigation',\n\t\t},\n\t\tgraphQL: {\n\t\t\tname: 'Navigation',\n\t\t},\n\t\taccess: {\n\t\t\tread: () => true,\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\ttype: 'tabs',\n\t\t\t\ttabs: [...tabs, ...(config?.additionalTabs ? config.additionalTabs : [])],\n\t\t\t},\n\t\t],\n\t};\n};\n"],"names":["generateChildren","depth","maxDepth","fields","name","type","label","navFields","required","admin","width","Navigation","config","tabs","interfaceName","maxRows","labels","singular","plural","initCollapsed","isSortable","header","additionalFields","includeFooter","push","footer","slug","typescript","interface","graphQL","access","read","additionalTabs"],"mappings":"AAsBA;;;;;;CAMC,GACD,MAAMA,mBAAmB,CAACC,OAAeC,UAAkBC;IAC1D,IAAIF,SAASC,UAAU;QACtB,OAAO,EAAE;IACV;IAEA,wDAAwD;IACxD,IAAID,QAAQC,WAAW,GAAG;QACzB,OAAO;YACN;gBACCE,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,eAAe,EAAEL,QAAQ,EAAE,CAAC;gBACpCE,QAAQ;uBAAIA;uBAAWH,iBAAiBC,QAAQ,GAAGC,UAAUC;iBAAQ;YACtE;SACA;IACF;IAEA,OAAO,EAAE;AACV;AAEA;;CAEC,GACD,MAAMI,YAAqB;IAC1B;QACCF,MAAM;QACNF,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPE,UAAU;gBACVC,OAAO;oBACNC,OAAO;gBACR;YACD;YACA;gBACCN,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPE,UAAU;gBACVC,OAAO;oBACNC,OAAO;gBACR;YACD;SACA;IACF;CACA;AAED;;;;;;CAMC,GACD,OAAO,MAAMC,aAAa,CAACC;IAC1B,MAAMC,OAAc;QACnB;YACCP,OAAO;YACPH,QAAQ;gBACP;oBACCC,MAAM;oBACNC,MAAM;oBACNC,OAAO;oBACPQ,eAAe;oBACfC,SAAS;oBACTC,QAAQ;wBACPC,UAAU;wBACVC,QAAQ;oBACT;oBACAT,OAAO;wBACNU,eAAe;wBACfC,YAAY;oBACb;oBACAjB,QAAQ;2BACJI;2BACCK,QAAQS,QAAQnB,WACjBF,iBAAiB,GAAGY,OAAOS,MAAM,CAACnB,QAAQ,EAAEK,aAC5C,EAAE;2BACDK,QAAQS,QAAQC,mBAAmBV,OAAOS,MAAM,CAACC,gBAAgB,GAAG,EAAE;qBAC1E;gBACF;aACA;QACF;KACA;IAED,IAAIV,QAAQW,eAAe;QAC1BV,KAAKW,IAAI,CAAC;YACTlB,OAAO;YACPH,QAAQ;gBACP;oBACCC,MAAM;oBACNC,MAAM;oBACNC,OAAO;oBACPQ,eAAe;oBACfC,SAAS;oBACTC,QAAQ;wBACPC,UAAU;wBACVC,QAAQ;oBACT;oBACAT,OAAO;wBACNU,eAAe;wBACfC,YAAY;oBACb;oBACAjB,QAAQ;2BACJI;2BACCK,QAAQa,QAAQvB,WACjBF,iBAAiB,GAAGY,OAAOa,MAAM,CAACvB,QAAQ,EAAEK,aAC5C,EAAE;2BACDK,QAAQa,QAAQH,mBAAmBV,OAAOa,MAAM,CAACH,gBAAgB,GAAG,EAAE;qBAC1E;gBACF;aACA;QACF;IACD;IAEA,OAAO;QACNI,MAAM;QACNC,YAAY;YACXC,WAAW;QACZ;QACAC,SAAS;YACRzB,MAAM;QACP;QACA0B,QAAQ;YACPC,MAAM,IAAM;QACb;QACA5B,QAAQ;YACP;gBACCE,MAAM;gBACNQ,MAAM;uBAAIA;uBAAUD,QAAQoB,iBAAiBpB,OAAOoB,cAAc,GAAG,EAAE;iBAAE;YAC1E;SACA;IACF;AACD,EAAE"}