@ainsleydev/payload-helper 0.0.23 → 0.0.25
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/cli/bin.js +1 -9
- package/dist/cli/bin.js.map +1 -1
- package/dist/collections/Media.d.ts +10 -6
- package/dist/collections/Media.js +165 -134
- package/dist/collections/Media.js.map +1 -1
- package/dist/gen/types.d.ts +6 -0
- package/dist/{cli → gen}/types.js +9 -18
- package/dist/gen/types.js.map +1 -0
- package/dist/globals/Navigation.js.map +1 -1
- package/dist/globals/Settings.d.ts +1 -1
- package/dist/globals/Settings.js.map +1 -1
- package/dist/index.js +29 -32
- package/dist/index.js.map +1 -1
- package/dist/plugin/hooks.js.map +1 -1
- package/dist/plugin/schema.d.ts +10 -3
- package/dist/plugin/schema.js +106 -93
- package/dist/plugin/schema.js.map +1 -1
- package/dist/seed/media.js.map +1 -1
- package/dist/seed/seed.d.ts +6 -11
- package/dist/seed/seed.js +7 -24
- package/dist/seed/seed.js.map +1 -1
- package/dist/util/env.js.map +1 -1
- package/package.json +20 -10
- package/dist/cli/types.d.ts +0 -4
- package/dist/cli/types.js.map +0 -1
package/dist/cli/bin.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import chalk from 'chalk';
|
|
3
2
|
import { Command } from 'commander';
|
|
4
|
-
import { generateTypes } from './types.js';
|
|
5
3
|
const program = new Command();
|
|
6
|
-
program.command('generate-types').description('Generate JSON schema types for Payload CMS')
|
|
7
|
-
try {
|
|
8
|
-
await generateTypes('');
|
|
9
|
-
} catch (error) {
|
|
10
|
-
console.log(chalk.red(error));
|
|
11
|
-
}
|
|
12
|
-
});
|
|
4
|
+
program.command('generate-types').description('Generate JSON schema types for Payload CMS');
|
|
13
5
|
export const bin = async ()=>{
|
|
14
6
|
await program.parseAsync(process.argv);
|
|
15
7
|
};
|
package/dist/cli/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\nimport { Command } from 'commander';\
|
|
1
|
+
{"version":3,"sources":["../../src/cli/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\nimport { Command } from 'commander';\n\nconst program = new Command();\n\nprogram\n\t.command('generate-types')\n\t.description('Generate JSON schema types for Payload CMS')\n\n\nexport const bin = async () => {\n\tawait program.parseAsync(process.argv);\n};\n"],"names":["Command","program","command","description","bin","parseAsync","process","argv"],"mappings":";AAEA,SAASA,OAAO,QAAQ,YAAY;AAEpC,MAAMC,UAAU,IAAID;AAEpBC,QACEC,OAAO,CAAC,kBACRC,WAAW,CAAC;AAGd,OAAO,MAAMC,MAAM;IAClB,MAAMH,QAAQI,UAAU,CAACC,QAAQC,IAAI;AACtC,EAAE"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { CollectionConfig, Field } from 'payload';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { CollectionConfig, Field, UploadConfig } from 'payload';
|
|
2
|
+
import type { ImageSize } from "payload";
|
|
3
|
+
export interface MediaArgs {
|
|
4
|
+
includeAvif?: boolean;
|
|
5
|
+
additionalFields?: Field[];
|
|
6
|
+
uploadOverrides?: Partial<UploadConfig>;
|
|
7
|
+
}
|
|
8
|
+
export declare const imageSizes: ImageSize[];
|
|
9
|
+
export declare const imageSizesWithAvif: () => ImageSize[];
|
|
10
|
+
export declare const Media: (args?: MediaArgs) => CollectionConfig;
|
|
@@ -1,10 +1,167 @@
|
|
|
1
1
|
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
2
2
|
import * as mime from 'mime-types';
|
|
3
3
|
import env from '../util/env.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export const imageSizes = [
|
|
5
|
+
{
|
|
6
|
+
name: 'webp',
|
|
7
|
+
width: undefined,
|
|
8
|
+
height: undefined,
|
|
9
|
+
formatOptions: {
|
|
10
|
+
format: 'webp',
|
|
11
|
+
options: {
|
|
12
|
+
quality: 80
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'thumbnail',
|
|
18
|
+
width: 200,
|
|
19
|
+
height: undefined,
|
|
20
|
+
position: 'centre'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'thumbnail_webp',
|
|
24
|
+
width: 200,
|
|
25
|
+
height: undefined,
|
|
26
|
+
position: 'centre',
|
|
27
|
+
formatOptions: {
|
|
28
|
+
format: 'webp',
|
|
29
|
+
options: {
|
|
30
|
+
quality: 80
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'mobile',
|
|
36
|
+
width: 500,
|
|
37
|
+
height: undefined
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'mobile_webp',
|
|
41
|
+
width: 500,
|
|
42
|
+
height: undefined,
|
|
43
|
+
formatOptions: {
|
|
44
|
+
format: 'webp',
|
|
45
|
+
options: {
|
|
46
|
+
quality: 80
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'tablet',
|
|
52
|
+
width: 800,
|
|
53
|
+
height: undefined
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'tablet_webp',
|
|
57
|
+
width: 800,
|
|
58
|
+
height: undefined,
|
|
59
|
+
formatOptions: {
|
|
60
|
+
format: 'webp',
|
|
61
|
+
options: {
|
|
62
|
+
quality: 80
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'desktop',
|
|
68
|
+
width: 1200,
|
|
69
|
+
height: undefined
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'desktop_webp',
|
|
73
|
+
width: 1200,
|
|
74
|
+
height: undefined,
|
|
75
|
+
formatOptions: {
|
|
76
|
+
format: 'webp',
|
|
77
|
+
options: {
|
|
78
|
+
quality: 80
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
export const imageSizesWithAvif = ()=>{
|
|
84
|
+
return [
|
|
85
|
+
...imageSizes,
|
|
86
|
+
{
|
|
87
|
+
name: 'avif',
|
|
88
|
+
width: undefined,
|
|
89
|
+
height: undefined,
|
|
90
|
+
formatOptions: {
|
|
91
|
+
format: 'avif',
|
|
92
|
+
options: {
|
|
93
|
+
quality: 60,
|
|
94
|
+
effort: 1,
|
|
95
|
+
chromaSubsampling: '4:4:4',
|
|
96
|
+
bitdepth: 8,
|
|
97
|
+
lossless: false
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'thumbnail_avif',
|
|
103
|
+
width: 200,
|
|
104
|
+
height: undefined,
|
|
105
|
+
position: 'centre',
|
|
106
|
+
formatOptions: {
|
|
107
|
+
format: 'avif',
|
|
108
|
+
options: {
|
|
109
|
+
quality: 60,
|
|
110
|
+
effort: 1,
|
|
111
|
+
chromaSubsampling: '4:4:4',
|
|
112
|
+
bitdepth: 8,
|
|
113
|
+
lossless: false
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'mobile_avif',
|
|
119
|
+
width: 500,
|
|
120
|
+
height: undefined,
|
|
121
|
+
formatOptions: {
|
|
122
|
+
format: 'avif',
|
|
123
|
+
options: {
|
|
124
|
+
quality: 60,
|
|
125
|
+
effort: 1,
|
|
126
|
+
chromaSubsampling: '4:4:4',
|
|
127
|
+
bitdepth: 8,
|
|
128
|
+
lossless: false
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'tablet_avif',
|
|
134
|
+
width: 800,
|
|
135
|
+
height: undefined,
|
|
136
|
+
formatOptions: {
|
|
137
|
+
format: 'avif',
|
|
138
|
+
options: {
|
|
139
|
+
quality: 60,
|
|
140
|
+
effort: 1,
|
|
141
|
+
chromaSubsampling: '4:4:4',
|
|
142
|
+
bitdepth: 8,
|
|
143
|
+
lossless: false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'desktop_avif',
|
|
149
|
+
width: 1200,
|
|
150
|
+
height: undefined,
|
|
151
|
+
formatOptions: {
|
|
152
|
+
format: 'avif',
|
|
153
|
+
options: {
|
|
154
|
+
quality: 80
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
};
|
|
160
|
+
export const Media = (args = {})=>{
|
|
161
|
+
let sizes = imageSizes;
|
|
162
|
+
if (args.includeAvif) {
|
|
163
|
+
sizes = imageSizesWithAvif();
|
|
164
|
+
}
|
|
8
165
|
return {
|
|
9
166
|
slug: 'media',
|
|
10
167
|
access: {
|
|
@@ -28,11 +185,11 @@ import env from '../util/env.js';
|
|
|
28
185
|
}
|
|
29
186
|
})
|
|
30
187
|
},
|
|
31
|
-
...additionalFields ? additionalFields : []
|
|
188
|
+
...args.additionalFields ? args.additionalFields : []
|
|
32
189
|
],
|
|
33
190
|
upload: {
|
|
34
191
|
staticDir: 'media',
|
|
35
|
-
adminThumbnail: '
|
|
192
|
+
adminThumbnail: 'tablet',
|
|
36
193
|
disableLocalStorage: env.isProduction,
|
|
37
194
|
handlers: [
|
|
38
195
|
async (req, args)=>{
|
|
@@ -53,134 +210,8 @@ import env from '../util/env.js';
|
|
|
53
210
|
req.responseHeaders = headers;
|
|
54
211
|
}
|
|
55
212
|
],
|
|
56
|
-
imageSizes:
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
name: 'webp',
|
|
60
|
-
width: undefined,
|
|
61
|
-
height: undefined,
|
|
62
|
-
formatOptions: {
|
|
63
|
-
format: 'webp',
|
|
64
|
-
options: {
|
|
65
|
-
quality: 80
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'avif',
|
|
71
|
-
width: undefined,
|
|
72
|
-
height: undefined,
|
|
73
|
-
formatOptions: {
|
|
74
|
-
format: 'avif',
|
|
75
|
-
options: {
|
|
76
|
-
quality: 60,
|
|
77
|
-
effort: 1,
|
|
78
|
-
chromaSubsampling: '4:4:4',
|
|
79
|
-
bitdepth: 8,
|
|
80
|
-
lossless: false
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
// Thumbnail Sizes
|
|
85
|
-
{
|
|
86
|
-
name: 'thumbnail',
|
|
87
|
-
width: 200,
|
|
88
|
-
height: undefined,
|
|
89
|
-
position: 'centre'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'thumbnail_webp',
|
|
93
|
-
width: 200,
|
|
94
|
-
height: undefined,
|
|
95
|
-
position: 'centre',
|
|
96
|
-
formatOptions: {
|
|
97
|
-
format: 'webp',
|
|
98
|
-
options: {
|
|
99
|
-
quality: 80
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: 'thumbnail_avif',
|
|
105
|
-
width: 200,
|
|
106
|
-
height: undefined,
|
|
107
|
-
position: 'centre',
|
|
108
|
-
formatOptions: {
|
|
109
|
-
format: 'avif',
|
|
110
|
-
options: {
|
|
111
|
-
quality: 60,
|
|
112
|
-
effort: 1,
|
|
113
|
-
chromaSubsampling: '4:4:4',
|
|
114
|
-
bitdepth: 8,
|
|
115
|
-
lossless: false
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
// Mobile Sizes
|
|
120
|
-
{
|
|
121
|
-
name: 'mobile',
|
|
122
|
-
width: 500,
|
|
123
|
-
height: undefined
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: 'mobile_webp',
|
|
127
|
-
width: 500,
|
|
128
|
-
height: undefined,
|
|
129
|
-
formatOptions: {
|
|
130
|
-
format: 'webp',
|
|
131
|
-
options: {
|
|
132
|
-
quality: 80
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: 'mobile_avif',
|
|
138
|
-
width: 500,
|
|
139
|
-
height: undefined,
|
|
140
|
-
formatOptions: {
|
|
141
|
-
format: 'avif',
|
|
142
|
-
options: {
|
|
143
|
-
quality: 60,
|
|
144
|
-
effort: 1,
|
|
145
|
-
chromaSubsampling: '4:4:4',
|
|
146
|
-
bitdepth: 8,
|
|
147
|
-
lossless: false
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
// Tablet Sizes
|
|
152
|
-
{
|
|
153
|
-
name: 'tablet',
|
|
154
|
-
width: 800,
|
|
155
|
-
height: undefined
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: 'tablet_webp',
|
|
159
|
-
width: 800,
|
|
160
|
-
height: undefined,
|
|
161
|
-
formatOptions: {
|
|
162
|
-
format: 'webp',
|
|
163
|
-
options: {
|
|
164
|
-
quality: 80
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'tablet_avif',
|
|
170
|
-
width: 800,
|
|
171
|
-
height: undefined,
|
|
172
|
-
formatOptions: {
|
|
173
|
-
format: 'avif',
|
|
174
|
-
options: {
|
|
175
|
-
quality: 60,
|
|
176
|
-
effort: 1,
|
|
177
|
-
chromaSubsampling: '4:4:4',
|
|
178
|
-
bitdepth: 8,
|
|
179
|
-
lossless: false
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
]
|
|
213
|
+
imageSizes: sizes,
|
|
214
|
+
...args.uploadOverrides ? args.uploadOverrides : {}
|
|
184
215
|
}
|
|
185
216
|
};
|
|
186
217
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/Media.ts"],"sourcesContent":["import { lexicalEditor } from '@payloadcms/richtext-lexical';\nimport * as mime from 'mime-types';\nimport type { CollectionConfig, Field, PayloadRequest } from 'payload';\nimport env from '../util/env.js';\
|
|
1
|
+
{"version":3,"sources":["../../src/collections/Media.ts"],"sourcesContent":["import { lexicalEditor } from '@payloadcms/richtext-lexical';\nimport * as mime from 'mime-types';\nimport type { CollectionConfig, Field, PayloadRequest, UploadConfig } from 'payload';\nimport env from '../util/env.js';\nimport type { ImageSize } from \"payload\";\n\nexport interface MediaArgs {\n\tincludeAvif?: boolean\n\tadditionalFields?: Field[],\n\tuploadOverrides?: Partial<UploadConfig>\n}\n\nexport const imageSizes: ImageSize[] = [\n\t{\n\t\tname: 'webp',\n\t\twidth: undefined,\n\t\theight: undefined,\n\t\tformatOptions: {\n\t\t\tformat: 'webp',\n\t\t\toptions: {\n\t\t\t\tquality: 80,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: 'thumbnail',\n\t\twidth: 200,\n\t\theight: undefined,\n\t\tposition: 'centre',\n\t},\n\t{\n\t\tname: 'thumbnail_webp',\n\t\twidth: 200,\n\t\theight: undefined,\n\t\tposition: 'centre',\n\t\tformatOptions: {\n\t\t\tformat: 'webp',\n\t\t\toptions: {\n\t\t\t\tquality: 80,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: 'mobile',\n\t\twidth: 500,\n\t\theight: undefined,\n\t},\n\t{\n\t\tname: 'mobile_webp',\n\t\twidth: 500,\n\t\theight: undefined,\n\t\tformatOptions: {\n\t\t\tformat: 'webp',\n\t\t\toptions: {\n\t\t\t\tquality: 80,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: 'tablet',\n\t\twidth: 800,\n\t\theight: undefined,\n\t},\n\t{\n\t\tname: 'tablet_webp',\n\t\twidth: 800,\n\t\theight: undefined,\n\t\tformatOptions: {\n\t\t\tformat: 'webp',\n\t\t\toptions: {\n\t\t\t\tquality: 80,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: 'desktop',\n\t\twidth: 1200,\n\t\theight: undefined,\n\t},\n\t{\n\t\tname: 'desktop_webp',\n\t\twidth: 1200,\n\t\theight: undefined,\n\t\tformatOptions: {\n\t\t\tformat: 'webp',\n\t\t\toptions: {\n\t\t\t\tquality: 80,\n\t\t\t},\n\t\t},\n\t},\n];\n\nexport const imageSizesWithAvif = (): ImageSize[] => {\n\treturn [\n\t\t...imageSizes,\n\t\t{\n\t\t\tname: 'avif',\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tformatOptions: {\n\t\t\t\tformat: 'avif',\n\t\t\t\toptions: {\n\t\t\t\t\tquality: 60,\n\t\t\t\t\teffort: 1,\n\t\t\t\t\tchromaSubsampling: '4:4:4',\n\t\t\t\t\tbitdepth: 8,\n\t\t\t\t\tlossless: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: 'thumbnail_avif',\n\t\t\twidth: 200,\n\t\t\theight: undefined,\n\t\t\tposition: 'centre',\n\t\t\tformatOptions: {\n\t\t\t\tformat: 'avif',\n\t\t\t\toptions: {\n\t\t\t\t\tquality: 60,\n\t\t\t\t\teffort: 1,\n\t\t\t\t\tchromaSubsampling: '4:4:4',\n\t\t\t\t\tbitdepth: 8,\n\t\t\t\t\tlossless: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: 'mobile_avif',\n\t\t\twidth: 500,\n\t\t\theight: undefined,\n\t\t\tformatOptions: {\n\t\t\t\tformat: 'avif',\n\t\t\t\toptions: {\n\t\t\t\t\tquality: 60,\n\t\t\t\t\teffort: 1,\n\t\t\t\t\tchromaSubsampling: '4:4:4',\n\t\t\t\t\tbitdepth: 8,\n\t\t\t\t\tlossless: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: 'tablet_avif',\n\t\t\twidth: 800,\n\t\t\theight: undefined,\n\t\t\tformatOptions: {\n\t\t\t\tformat: 'avif',\n\t\t\t\toptions: {\n\t\t\t\t\tquality: 60,\n\t\t\t\t\teffort: 1,\n\t\t\t\t\tchromaSubsampling: '4:4:4',\n\t\t\t\t\tbitdepth: 8,\n\t\t\t\t\tlossless: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: 'desktop_avif',\n\t\t\twidth: 1200,\n\t\t\theight: undefined,\n\t\t\tformatOptions: {\n\t\t\t\tformat: 'avif',\n\t\t\t\toptions: {\n\t\t\t\t\tquality: 80,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t]\n}\n\nexport const Media = (args: MediaArgs = {}): CollectionConfig => {\n\tlet sizes = imageSizes;\n\tif (args.includeAvif) {\n\t\tsizes = imageSizesWithAvif();\n\t}\n\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\teditor: lexicalEditor({\n\t\t\t\t\tfeatures: ({ defaultFeatures }) => {\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...(args.additionalFields ? args.additionalFields : []),\n\t\t],\n\t\tupload: {\n\t\t\tstaticDir: 'media',\n\t\t\tadminThumbnail: 'tablet',\n\t\t\tdisableLocalStorage: env.isProduction,\n\t\t\thandlers: [\n\t\t\t\tasync (req: PayloadRequest, args) => {\n\t\t\t\t\tconst logger = req.payload.logger;\n\t\t\t\t\tconst { params } = args;\n\t\t\t\t\tconst { collection, filename } = params;\n\n\t\t\t\t\tif (collection !== 'media') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst contentType = mime.lookup(filename);\n\t\t\t\t\tif (!contentType) {\n\t\t\t\t\t\tlogger.error(`Unable to find mime type for file: ${filename}`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst headers = new Headers();\n\t\t\t\t\theaders.set('Content-Type', contentType);\n\t\t\t\t\theaders.set('Cache-Control', 'public, max-age=31536000');\n\n\t\t\t\t\treq.responseHeaders = headers;\n\t\t\t\t},\n\t\t\t],\n\t\t\timageSizes: sizes,\n\t\t\t...(args.uploadOverrides ? args.uploadOverrides : {}),\n\t\t},\n\t};\n};\n"],"names":["lexicalEditor","mime","env","imageSizes","name","width","undefined","height","formatOptions","format","options","quality","position","imageSizesWithAvif","effort","chromaSubsampling","bitdepth","lossless","Media","args","sizes","includeAvif","slug","access","read","fields","type","required","editor","features","defaultFeatures","filter","feature","key","additionalFields","upload","staticDir","adminThumbnail","disableLocalStorage","isProduction","handlers","req","logger","payload","params","collection","filename","contentType","lookup","error","headers","Headers","set","responseHeaders","uploadOverrides"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA+B;AAC7D,YAAYC,UAAU,aAAa;AAEnC,OAAOC,SAAS,iBAAiB;AASjC,OAAO,MAAMC,aAA0B;IACtC;QACCC,MAAM;QACNC,OAAOC;QACPC,QAAQD;QACRE,eAAe;YACdC,QAAQ;YACRC,SAAS;gBACRC,SAAS;YACV;QACD;IACD;IACA;QACCP,MAAM;QACNC,OAAO;QACPE,QAAQD;QACRM,UAAU;IACX;IACA;QACCR,MAAM;QACNC,OAAO;QACPE,QAAQD;QACRM,UAAU;QACVJ,eAAe;YACdC,QAAQ;YACRC,SAAS;gBACRC,SAAS;YACV;QACD;IACD;IACA;QACCP,MAAM;QACNC,OAAO;QACPE,QAAQD;IACT;IACA;QACCF,MAAM;QACNC,OAAO;QACPE,QAAQD;QACRE,eAAe;YACdC,QAAQ;YACRC,SAAS;gBACRC,SAAS;YACV;QACD;IACD;IACA;QACCP,MAAM;QACNC,OAAO;QACPE,QAAQD;IACT;IACA;QACCF,MAAM;QACNC,OAAO;QACPE,QAAQD;QACRE,eAAe;YACdC,QAAQ;YACRC,SAAS;gBACRC,SAAS;YACV;QACD;IACD;IACA;QACCP,MAAM;QACNC,OAAO;QACPE,QAAQD;IACT;IACA;QACCF,MAAM;QACNC,OAAO;QACPE,QAAQD;QACRE,eAAe;YACdC,QAAQ;YACRC,SAAS;gBACRC,SAAS;YACV;QACD;IACD;CACA,CAAC;AAEF,OAAO,MAAME,qBAAqB;IACjC,OAAO;WACHV;QACH;YACCC,MAAM;YACNC,OAAOC;YACPC,QAAQD;YACRE,eAAe;gBACdC,QAAQ;gBACRC,SAAS;oBACRC,SAAS;oBACTG,QAAQ;oBACRC,mBAAmB;oBACnBC,UAAU;oBACVC,UAAU;gBACX;YACD;QACD;QACA;YACCb,MAAM;YACNC,OAAO;YACPE,QAAQD;YACRM,UAAU;YACVJ,eAAe;gBACdC,QAAQ;gBACRC,SAAS;oBACRC,SAAS;oBACTG,QAAQ;oBACRC,mBAAmB;oBACnBC,UAAU;oBACVC,UAAU;gBACX;YACD;QACD;QACA;YACCb,MAAM;YACNC,OAAO;YACPE,QAAQD;YACRE,eAAe;gBACdC,QAAQ;gBACRC,SAAS;oBACRC,SAAS;oBACTG,QAAQ;oBACRC,mBAAmB;oBACnBC,UAAU;oBACVC,UAAU;gBACX;YACD;QACD;QACA;YACCb,MAAM;YACNC,OAAO;YACPE,QAAQD;YACRE,eAAe;gBACdC,QAAQ;gBACRC,SAAS;oBACRC,SAAS;oBACTG,QAAQ;oBACRC,mBAAmB;oBACnBC,UAAU;oBACVC,UAAU;gBACX;YACD;QACD;QACA;YACCb,MAAM;YACNC,OAAO;YACPE,QAAQD;YACRE,eAAe;gBACdC,QAAQ;gBACRC,SAAS;oBACRC,SAAS;gBACV;YACD;QACD;KACA;AACF,EAAC;AAED,OAAO,MAAMO,QAAQ,CAACC,OAAkB,CAAC,CAAC;IACzC,IAAIC,QAAQjB;IACZ,IAAIgB,KAAKE,WAAW,EAAE;QACrBD,QAAQP;IACT;IAEA,OAAO;QACNS,MAAM;QACNC,QAAQ;YACPC,MAAM,IAAM;QACb;QACAC,QAAQ;YACP;gBACCrB,MAAM;gBACNsB,MAAM;gBACNC,UAAU;YACX;YACA;gBACCvB,MAAM;gBACNsB,MAAM;gBACNC,UAAU;gBACVC,QAAQ5B,cAAc;oBACrB6B,UAAU,CAAC,EAAEC,eAAe,EAAE;wBAC7B,OAAOA,gBAAgBC,MAAM,CAAC,CAACC;4BAC9B,OAAOA,QAAQC,GAAG,KAAK,eAAeD,QAAQC,GAAG,KAAK;wBACvD;oBACD;gBACD;YACD;eACId,KAAKe,gBAAgB,GAAGf,KAAKe,gBAAgB,GAAG,EAAE;SACtD;QACDC,QAAQ;YACPC,WAAW;YACXC,gBAAgB;YAChBC,qBAAqBpC,IAAIqC,YAAY;YACrCC,UAAU;gBACT,OAAOC,KAAqBtB;oBAC3B,MAAMuB,SAASD,IAAIE,OAAO,CAACD,MAAM;oBACjC,MAAM,EAAEE,MAAM,EAAE,GAAGzB;oBACnB,MAAM,EAAE0B,UAAU,EAAEC,QAAQ,EAAE,GAAGF;oBAEjC,IAAIC,eAAe,SAAS;wBAC3B;oBACD;oBAEA,MAAME,cAAc9C,KAAK+C,MAAM,CAACF;oBAChC,IAAI,CAACC,aAAa;wBACjBL,OAAOO,KAAK,CAAC,CAAC,mCAAmC,EAAEH,UAAU;wBAC7D;oBACD;oBAEA,MAAMI,UAAU,IAAIC;oBACpBD,QAAQE,GAAG,CAAC,gBAAgBL;oBAC5BG,QAAQE,GAAG,CAAC,iBAAiB;oBAE7BX,IAAIY,eAAe,GAAGH;gBACvB;aACA;YACD/C,YAAYiB;YACZ,GAAID,KAAKmC,eAAe,GAAGnC,KAAKmC,eAAe,GAAG,CAAC,CAAC;QACrD;IACD;AACD,EAAE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SanitizedConfig } from 'payload';
|
|
2
|
+
import { type SchemaOptions } from '../plugin/schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates JSON schema types of Payloads Collections & Globals
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateTypes(config: SanitizedConfig, opts: SchemaOptions): Promise<void>;
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import { configToJSONSchema, getPayload } from 'payload';
|
|
3
|
-
import {
|
|
3
|
+
import { fieldMapper, schemas } from '../plugin/schema.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates JSON schema types of Payloads Collections & Globals
|
|
6
|
-
*/ export async function generateTypes(
|
|
6
|
+
*/ export async function generateTypes(config, opts) {
|
|
7
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
8
|
const outputFile = (process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile).replace('.ts', '.json');
|
|
9
|
+
config.typescript = {
|
|
10
|
+
...config.typescript,
|
|
11
|
+
schema: schemas(opts)
|
|
12
|
+
};
|
|
13
|
+
// biome-ignore lint/style/noParameterAssign: Need to change field mapper.
|
|
14
|
+
config = fieldMapper(config, opts);
|
|
19
15
|
const payload = await getPayload({
|
|
20
|
-
config
|
|
21
|
-
disableDBConnect: true,
|
|
22
|
-
disableOnInit: true,
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
local: true,
|
|
25
|
-
secret: '--unused--'
|
|
16
|
+
config
|
|
26
17
|
});
|
|
27
18
|
const jsonSchema = configToJSONSchema(payload.config, payload.db.defaultIDType);
|
|
28
19
|
const prettyJSON = JSON.stringify(jsonSchema, null, 4);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/gen/types.ts"],"sourcesContent":["import * as fs from 'node:fs';\nimport { type SanitizedConfig, configToJSONSchema, getPayload } from 'payload';\nimport { type SchemaOptions, fieldMapper, schemas } from '../plugin/schema.js';\n\n/**\n * Creates JSON schema types of Payloads Collections & Globals\n */\nexport async function generateTypes(config: SanitizedConfig, opts: SchemaOptions): Promise<void> {\n\tconsole.log('Compiling JSON types for Collections and Globals...');\n\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\tconfig.typescript = {\n\t\t...config.typescript,\n\t\tschema: schemas(opts),\n\t};\n\n\t// biome-ignore lint/style/noParameterAssign: Need to change field mapper.\n\tconfig = fieldMapper(config, opts);\n\n\tconst payload = await getPayload({\n\t\tconfig,\n\t\t//disableDBConnect: true,\n\t\t//disableOnInit: true,\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","fieldMapper","schemas","generateTypes","config","opts","console","log","outputFile","process","env","PAYLOAD_TS_OUTPUT_PATH","typescript","replace","schema","payload","jsonSchema","db","defaultIDType","prettyJSON","JSON","stringify","writeFileSync","GEN_GOLANG"],"mappings":"AAAA,YAAYA,QAAQ,UAAU;AAC9B,SAA+BC,kBAAkB,EAAEC,UAAU,QAAQ,UAAU;AAC/E,SAA6BC,WAAW,EAAEC,OAAO,QAAQ,sBAAsB;AAE/E;;CAEC,GACD,OAAO,eAAeC,cAAcC,MAAuB,EAAEC,IAAmB;IAC/EC,QAAQC,GAAG,CAAC;IAEZ,MAAMC,aAAa,AAACC,CAAAA,QAAQC,GAAG,CAACC,sBAAsB,IAAIP,OAAOQ,UAAU,CAACJ,UAAU,AAAD,EAAGK,OAAO,CAC9F,OACA;IAGDT,OAAOQ,UAAU,GAAG;QACnB,GAAGR,OAAOQ,UAAU;QACpBE,QAAQZ,QAAQG;IACjB;IAEA,0EAA0E;IAC1ED,SAASH,YAAYG,QAAQC;IAE7B,MAAMU,UAAU,MAAMf,WAAW;QAChCI;IAGD;IAEA,MAAMY,aAAajB,mBAAmBgB,QAAQX,MAAM,EAAEW,QAAQE,EAAE,CAACC,aAAa;IAC9E,MAAMC,aAAaC,KAAKC,SAAS,CAACL,YAAY,MAAM;IAEpDlB,GAAGwB,aAAa,CAACd,YAAYW;IAE7Bb,QAAQC,GAAG,CAAC,CAAC,uBAAuB,EAAEC,YAAY;IAElD,OAAOC,QAAQC,GAAG,CAACa,UAAU;AAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/globals/Navigation.ts"],"sourcesContent":["import type { ArrayField, Field, GlobalConfig, Tab } 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,
|
|
1
|
+
{"version":3,"sources":["../../src/globals/Navigation.ts"],"sourcesContent":["import type { ArrayField, Field, GlobalConfig, Tab } 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,GAAG;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/globals/Settings.ts"],"sourcesContent":["import type { GlobalConfig, GroupField, Tab, UploadField } from 'payload';\nimport { validatePostcode, validateURL } from '../util/validation.js';\nimport { countries } from './countries.js';\nimport { languages } from './locales.js';\n\n/**\n * Settings Global Configuration\n * Additional tabs will be appended to the settings page.\n * TODO, type error in here somewhere.\n *\n * @param additionalTabs\n * @constructor\n */\nexport const Settings = (additionalTabs: Tab[]): GlobalConfig => {\n\treturn {\n\t\tslug: 'settings',\n\t\ttypescript: {\n\t\t\tinterface: 'Settings',\n\t\t},\n\t\tgraphQL: {\n\t\t\tname: 'Settings',\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: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Global',\n\t\t\t\t\t\tdescription: 'Configure global settings for the website.',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'siteName',\n\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Site Name',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Add a site name for the website, this will be outputted in the Open Graph schema as well as a suffix for the meta title.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'locale',\n\t\t\t\t\t\t\t\t\t\ttype: 'select',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Locale',\n\t\t\t\t\t\t\t\t\t\tdefaultValue: 'en_GB',\n\t\t\t\t\t\t\t\t\t\toptions: languages.map((l) => {\n\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: l.name,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: l.code,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Add a locale for the website, this will be outputted in the Open Graph schema and the top level HTML tag. Defaults to en_GB.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttypescriptSchema: [\n\t\t\t\t\t\t\t\t\t\t\t() => ({\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'tagLine',\n\t\t\t\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\t\t\t\tlabel: 'Tag Line',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\tdescription: 'In a few words, explain what this site is about',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'logo',\n\t\t\t\t\t\t\t\ttype: 'upload',\n\t\t\t\t\t\t\t\trelationTo: 'media',\n\t\t\t\t\t\t\t\tfilterOptions: {\n\t\t\t\t\t\t\t\t\tmimeType: {\n\t\t\t\t\t\t\t\t\t\tcontains: 'image',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t'Add a logo for the website that will be displayed in the header & across the website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} as UploadField,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'robots',\n\t\t\t\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\t\t\t\tlabel: 'Robots.txt',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t'Robots.txt is a text file webmasters create to instruct web robots (typically search engine robots) how to crawl pages on their website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Code Injection',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Code injection allows you to inject a small snippet of HTML into your site. It can be a css override, analytics of a block javascript.',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'codeInjection',\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'head',\n\t\t\t\t\t\t\t\t\t\ttype: 'code',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Head',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tlanguage: 'html',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Outputs code within the <head> of the website.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'footer',\n\t\t\t\t\t\t\t\t\t\ttype: 'code',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Footer',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tlanguage: 'html',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Outputs code in the footer of the website.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Contact Details',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'contact',\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\thideGutter: true,\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t'Add global contact details for the website that will be used in schema & contact pages.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'email',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'email',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Email',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'telephone',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Telephone',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t} as GroupField,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tname: 'address',\n\t\t\t\t\t\t\t\tlabel: 'Address',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\thideGutter: true,\n\t\t\t\t\t\t\t\t\tdescription: 'Add an address for the website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'line1',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Line 1',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'line2',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Line 2',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'city',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'City',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'county',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'County',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'postcode',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Postcode',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validatePostcode,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'country',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'select',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Country',\n\t\t\t\t\t\t\t\t\t\t\t\toptions: countries.map((c) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: c,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: c,\n\t\t\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t} as GroupField,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tname: 'social',\n\t\t\t\t\t\t\t\tlabel: 'Social Links',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\thideGutter: true,\n\t\t\t\t\t\t\t\t\tdescription: 'Add social links for the website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'linkedIn',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'LinkedIn',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'x',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'X',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'facebook',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Facebook',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'instagram',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Instagram',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'youtube',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Youtube',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'tiktok',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'TikTok',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t} as GroupField,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Maintenance',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'maintenance',\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'enabled',\n\t\t\t\t\t\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Enable',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Enable maintenance mode for the site, this will use a maintenance page template and not include any of the sites functioanlity.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'title',\n\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Title',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tdescription: 'Add a title for the maintenance page.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'content',\n\t\t\t\t\t\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Content',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Add content for the maintenance page, it will appear beneath the title.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t...(additionalTabs ? additionalTabs : []),\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n};\n"],"names":["validatePostcode","validateURL","countries","languages","Settings","additionalTabs","slug","typescript","interface","graphQL","name","access","read","fields","type","tabs","label","description","admin","width","defaultValue","options","map","l","value","code","typescriptSchema","relationTo","filterOptions","mimeType","contains","language","hideGutter","validate","c"],"mappings":"AACA,SAASA,gBAAgB,EAAEC,WAAW,QAAQ,wBAAwB;AACtE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,QAAQ,eAAe;AAEzC;;;;;;;CAOC,GACD,OAAO,MAAMC,WAAW,CAACC;IACxB,OAAO;QACNC,MAAM;QACNC,YAAY;YACXC,WAAW;QACZ;QACAC,SAAS;YACRC,MAAM;QACP;QACAC,QAAQ;YACPC,MAAM,IAAM;QACb;QACAC,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;oBACL;wBACCC,OAAO;wBACPC,aAAa;wBACbJ,QAAQ;4BACP;gCACCC,MAAM;gCACND,QAAQ;oCACP;wCACCH,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACNC,OAAO;4CACPF,aACC;wCACF;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPI,cAAc;wCACdC,SAASlB,UAAUmB,GAAG,CAAC,CAACC;4CACvB,OAAO;gDACNP,OAAOO,EAAEb,IAAI;gDACbc,OAAOD,EAAEE,IAAI;4CACd;wCACD;wCACAP,OAAO;4CACNC,OAAO;4CACPF,aACC;wCACF;wCACAS,kBAAkB;4CACjB,IAAO,CAAA;oDACNZ,MAAM;gDACP,CAAA;yCACA;oCACF;iCACA;4BACF;4BACA;gCACCJ,MAAM;gCACNI,MAAM;gCACNE,OAAO;gCACPE,OAAO;oCACND,aAAa;gCACd;4BACD;4BACA;gCACCP,MAAM;gCACNI,MAAM;gCACNa,YAAY;gCACZC,eAAe;oCACdC,UAAU;wCACTC,UAAU;oCACX;gCACD;gCACAZ,OAAO;oCACND,aACC;gCACF;4BACD;4BACA;gCACCP,MAAM;gCACNI,MAAM;gCACNE,OAAO;gCACPE,OAAO;oCACND,aACC;gCACF;4BACD;yBACA;oBACF;oBACA;wBACCD,OAAO;wBACPC,aACC;wBACDJ,QAAQ;4BACP;gCACCH,MAAM;gCACNI,MAAM;gCACND,QAAQ;oCACP;wCACCH,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACNa,UAAU;4CACVd,aACC;wCACF;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACNa,UAAU;4CACVd,aACC;wCACF;oCACD;iCACA;4BACF;yBACA;oBACF;oBACA;wBACCD,OAAO;wBACPH,QAAQ;4BACP;gCACCH,MAAM;gCACNI,MAAM;gCACNI,OAAO;oCACNc,YAAY;oCACZf,aACC;gCACF;gCACAJ,QAAQ;oCACP;wCACCC,MAAM;wCACND,QAAQ;4CACP;gDACCH,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;yCACA;oCACF;iCACA;4BACF;4BACA;gCACCL,MAAM;gCACNJ,MAAM;gCACNM,OAAO;gCACPE,OAAO;oCACNc,YAAY;oCACZf,aAAa;gCACd;gCACAJ,QAAQ;oCACP;wCACCC,MAAM;wCACND,QAAQ;4CACP;gDACCH,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUjC;gDACVkB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPK,SAASnB,UAAUoB,GAAG,CAAC,CAACY;oDACvB,OAAO;wDACNlB,OAAOkB;wDACPV,OAAOU;oDACR;gDACD;gDACAhB,OAAO;oDACNC,OAAO;gDACR;4CACD;yCACA;oCACF;iCACA;4BACF;4BACA;gCACCL,MAAM;gCACNJ,MAAM;gCACNM,OAAO;gCACPE,OAAO;oCACNc,YAAY;oCACZf,aAAa;gCACd;gCACAJ,QAAQ;oCACP;wCACCC,MAAM;wCACND,QAAQ;4CACP;gDACCH,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;yCACA;oCACF;iCACA;4BACF;yBACA;oBACF;oBACA;wBACCH,OAAO;wBACPH,QAAQ;4BACP;gCACCH,MAAM;gCACNI,MAAM;gCACND,QAAQ;oCACP;wCACCH,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACND,aACC;wCACF;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACND,aAAa;wCACd;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACND,aACC;wCACF;oCACD;iCACA;4BACF;yBACA;oBACF;uBACIZ,iBAAiBA,iBAAiB,EAAE;iBACxC;YACF;SACA;IACF;AACD,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../src/globals/Settings.ts"],"sourcesContent":["import type { GlobalConfig, GroupField, Tab, UploadField } from 'payload';\nimport { validatePostcode, validateURL } from '../util/validation.js';\nimport { countries } from './countries.js';\nimport { languages } from './locales.js';\n\n/**\n * Settings Global Configuration\n * Additional tabs will be appended to the settings page.\n * TODO, type error in here somewhere.\n *\n * @param additionalTabs\n * @constructor\n */\nexport const Settings = (additionalTabs?: Tab[]): GlobalConfig => {\n\treturn {\n\t\tslug: 'settings',\n\t\ttypescript: {\n\t\t\tinterface: 'Settings',\n\t\t},\n\t\tgraphQL: {\n\t\t\tname: 'Settings',\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: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Global',\n\t\t\t\t\t\tdescription: 'Configure global settings for the website.',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'siteName',\n\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Site Name',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Add a site name for the website, this will be outputted in the Open Graph schema as well as a suffix for the meta title.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'locale',\n\t\t\t\t\t\t\t\t\t\ttype: 'select',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Locale',\n\t\t\t\t\t\t\t\t\t\tdefaultValue: 'en_GB',\n\t\t\t\t\t\t\t\t\t\toptions: languages.map((l) => {\n\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: l.name,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: l.code,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Add a locale for the website, this will be outputted in the Open Graph schema and the top level HTML tag. Defaults to en_GB.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttypescriptSchema: [\n\t\t\t\t\t\t\t\t\t\t\t() => ({\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'tagLine',\n\t\t\t\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\t\t\t\tlabel: 'Tag Line',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\tdescription: 'In a few words, explain what this site is about',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'logo',\n\t\t\t\t\t\t\t\ttype: 'upload',\n\t\t\t\t\t\t\t\trelationTo: 'media',\n\t\t\t\t\t\t\t\tfilterOptions: {\n\t\t\t\t\t\t\t\t\tmimeType: {\n\t\t\t\t\t\t\t\t\t\tcontains: 'image',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t'Add a logo for the website that will be displayed in the header & across the website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} as UploadField,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'robots',\n\t\t\t\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\t\t\t\tlabel: 'Robots.txt',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t'Robots.txt is a text file webmasters create to instruct web robots (typically search engine robots) how to crawl pages on their website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Code Injection',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Code injection allows you to inject a small snippet of HTML into your site. It can be a css override, analytics of a block javascript.',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'codeInjection',\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'head',\n\t\t\t\t\t\t\t\t\t\ttype: 'code',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Head',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tlanguage: 'html',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Outputs code within the <head> of the website.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'footer',\n\t\t\t\t\t\t\t\t\t\ttype: 'code',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Footer',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tlanguage: 'html',\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Outputs code in the footer of the website.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Contact Details',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'contact',\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\thideGutter: true,\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t'Add global contact details for the website that will be used in schema & contact pages.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'email',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'email',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Email',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'telephone',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Telephone',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t} as GroupField,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tname: 'address',\n\t\t\t\t\t\t\t\tlabel: 'Address',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\thideGutter: true,\n\t\t\t\t\t\t\t\t\tdescription: 'Add an address for the website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'line1',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Line 1',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'line2',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Line 2',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'city',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'City',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'county',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'County',\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'postcode',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Postcode',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validatePostcode,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'country',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'select',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Country',\n\t\t\t\t\t\t\t\t\t\t\t\toptions: countries.map((c) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: c,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: c,\n\t\t\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t} as GroupField,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tname: 'social',\n\t\t\t\t\t\t\t\tlabel: 'Social Links',\n\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\thideGutter: true,\n\t\t\t\t\t\t\t\t\tdescription: 'Add social links for the website.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'linkedIn',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'LinkedIn',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'x',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'X',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'facebook',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Facebook',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'instagram',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Instagram',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'youtube',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'Youtube',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: 'tiktok',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: 'TikTok',\n\t\t\t\t\t\t\t\t\t\t\t\tvalidate: validateURL,\n\t\t\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '50%',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t} as GroupField,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Maintenance',\n\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'maintenance',\n\t\t\t\t\t\t\t\ttype: 'group',\n\t\t\t\t\t\t\t\tfields: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'enabled',\n\t\t\t\t\t\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Enable',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Enable maintenance mode for the site, this will use a maintenance page template and not include any of the sites functioanlity.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'title',\n\t\t\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Title',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tdescription: 'Add a title for the maintenance page.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'content',\n\t\t\t\t\t\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\t\t\t\t\t\tlabel: 'Content',\n\t\t\t\t\t\t\t\t\t\tadmin: {\n\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t'Add content for the maintenance page, it will appear beneath the title.',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t...(additionalTabs ? additionalTabs : []),\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n};\n"],"names":["validatePostcode","validateURL","countries","languages","Settings","additionalTabs","slug","typescript","interface","graphQL","name","access","read","fields","type","tabs","label","description","admin","width","defaultValue","options","map","l","value","code","typescriptSchema","relationTo","filterOptions","mimeType","contains","language","hideGutter","validate","c"],"mappings":"AACA,SAASA,gBAAgB,EAAEC,WAAW,QAAQ,wBAAwB;AACtE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,QAAQ,eAAe;AAEzC;;;;;;;CAOC,GACD,OAAO,MAAMC,WAAW,CAACC;IACxB,OAAO;QACNC,MAAM;QACNC,YAAY;YACXC,WAAW;QACZ;QACAC,SAAS;YACRC,MAAM;QACP;QACAC,QAAQ;YACPC,MAAM,IAAM;QACb;QACAC,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;oBACL;wBACCC,OAAO;wBACPC,aAAa;wBACbJ,QAAQ;4BACP;gCACCC,MAAM;gCACND,QAAQ;oCACP;wCACCH,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACNC,OAAO;4CACPF,aACC;wCACF;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPI,cAAc;wCACdC,SAASlB,UAAUmB,GAAG,CAAC,CAACC;4CACvB,OAAO;gDACNP,OAAOO,EAAEb,IAAI;gDACbc,OAAOD,EAAEE,IAAI;4CACd;wCACD;wCACAP,OAAO;4CACNC,OAAO;4CACPF,aACC;wCACF;wCACAS,kBAAkB;4CACjB,IAAO,CAAA;oDACNZ,MAAM;gDACP,CAAA;yCACA;oCACF;iCACA;4BACF;4BACA;gCACCJ,MAAM;gCACNI,MAAM;gCACNE,OAAO;gCACPE,OAAO;oCACND,aAAa;gCACd;4BACD;4BACA;gCACCP,MAAM;gCACNI,MAAM;gCACNa,YAAY;gCACZC,eAAe;oCACdC,UAAU;wCACTC,UAAU;oCACX;gCACD;gCACAZ,OAAO;oCACND,aACC;gCACF;4BACD;4BACA;gCACCP,MAAM;gCACNI,MAAM;gCACNE,OAAO;gCACPE,OAAO;oCACND,aACC;gCACF;4BACD;yBACA;oBACF;oBACA;wBACCD,OAAO;wBACPC,aACC;wBACDJ,QAAQ;4BACP;gCACCH,MAAM;gCACNI,MAAM;gCACND,QAAQ;oCACP;wCACCH,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACNa,UAAU;4CACVd,aACC;wCACF;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACNa,UAAU;4CACVd,aACC;wCACF;oCACD;iCACA;4BACF;yBACA;oBACF;oBACA;wBACCD,OAAO;wBACPH,QAAQ;4BACP;gCACCH,MAAM;gCACNI,MAAM;gCACNI,OAAO;oCACNc,YAAY;oCACZf,aACC;gCACF;gCACAJ,QAAQ;oCACP;wCACCC,MAAM;wCACND,QAAQ;4CACP;gDACCH,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;yCACA;oCACF;iCACA;4BACF;4BACA;gCACCL,MAAM;gCACNJ,MAAM;gCACNM,OAAO;gCACPE,OAAO;oCACNc,YAAY;oCACZf,aAAa;gCACd;gCACAJ,QAAQ;oCACP;wCACCC,MAAM;wCACND,QAAQ;4CACP;gDACCH,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPE,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUjC;gDACVkB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPK,SAASnB,UAAUoB,GAAG,CAAC,CAACY;oDACvB,OAAO;wDACNlB,OAAOkB;wDACPV,OAAOU;oDACR;gDACD;gDACAhB,OAAO;oDACNC,OAAO;gDACR;4CACD;yCACA;oCACF;iCACA;4BACF;4BACA;gCACCL,MAAM;gCACNJ,MAAM;gCACNM,OAAO;gCACPE,OAAO;oCACNc,YAAY;oCACZf,aAAa;gCACd;gCACAJ,QAAQ;oCACP;wCACCC,MAAM;wCACND,QAAQ;4CACP;gDACCH,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;4CACA;gDACCT,MAAM;gDACNI,MAAM;gDACNE,OAAO;gDACPiB,UAAUhC;gDACViB,OAAO;oDACNC,OAAO;gDACR;4CACD;yCACA;oCACF;iCACA;4BACF;yBACA;oBACF;oBACA;wBACCH,OAAO;wBACPH,QAAQ;4BACP;gCACCH,MAAM;gCACNI,MAAM;gCACND,QAAQ;oCACP;wCACCH,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACND,aACC;wCACF;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACND,aAAa;wCACd;oCACD;oCACA;wCACCP,MAAM;wCACNI,MAAM;wCACNE,OAAO;wCACPE,OAAO;4CACND,aACC;wCACF;oCACD;iCACA;4BACF;yBACA;oBACF;uBACIZ,iBAAiBA,iBAAiB,EAAE;iBACxC;YACF;SACA;IACF;AACD,EAAE"}
|