nextjs-cms 0.7.8 → 0.7.10
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/lib/update-sections.d.ts.map +1 -1
- package/dist/cli/lib/update-sections.js +45 -11
- package/dist/cli/utils/schema-generator.d.ts +20 -4
- package/dist/cli/utils/schema-generator.d.ts.map +1 -1
- package/dist/cli/utils/schema-generator.js +27 -24
- package/dist/core/sections/category.d.ts +42 -42
- package/dist/core/sections/hasItems.d.ts +42 -42
- package/dist/core/sections/section.d.ts +21 -21
- package/dist/core/sections/simple.d.ts +6 -6
- package/dist/translations/base/en.d.ts +16 -0
- package/dist/translations/base/en.d.ts.map +1 -1
- package/dist/translations/base/en.js +17 -0
- package/dist/translations/client.d.ts +196 -4
- package/dist/translations/client.d.ts.map +1 -1
- package/dist/translations/server.d.ts +196 -4
- package/dist/translations/server.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/update-sections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/update-sections.ts"],"names":[],"mappings":"AAolCA,wBAAsB,cAAc,CAAC,SAAS,UAAQ,iBAoBrD"}
|
|
@@ -11,7 +11,7 @@ import { FileField } from '../../core/fields/index.js';
|
|
|
11
11
|
import chalk from 'chalk';
|
|
12
12
|
import { intro, select, spinner, log } from '@clack/prompts';
|
|
13
13
|
import { MysqlTableChecker } from '../../core/db/index.js';
|
|
14
|
-
import { generateDrizzleSchema } from '../utils/schema-generator.js';
|
|
14
|
+
import { generateDrizzleSchema, resolveCaseStyleFns } from '../utils/schema-generator.js';
|
|
15
15
|
import { addTableKeys } from '../utils/add-table-keys.js';
|
|
16
16
|
function generateFieldSQL(input) {
|
|
17
17
|
let fieldSQL = `\`${input.name}\` `;
|
|
@@ -525,8 +525,9 @@ const main = async (s) => {
|
|
|
525
525
|
else {
|
|
526
526
|
console.log(chalk.yellow(`Schema generation is disabled. Skipping Drizzle schema generation.`));
|
|
527
527
|
}
|
|
528
|
+
const caseStyleFns = resolveCaseStyleFns(cmsConfig.schemaGeneration.drizzle.naming);
|
|
528
529
|
const drizzleTableSchemas = [];
|
|
529
|
-
const
|
|
530
|
+
const drizzleImports = new Set(['mysqlTable']);
|
|
530
531
|
let sections = [];
|
|
531
532
|
const desiredTables = [];
|
|
532
533
|
let existingTables = [];
|
|
@@ -556,17 +557,13 @@ const main = async (s) => {
|
|
|
556
557
|
/**
|
|
557
558
|
* Generate the Drizzle schema for the table
|
|
558
559
|
*/
|
|
559
|
-
const drizzleSchema =
|
|
560
|
+
const drizzleSchema = generateDrizzleSchema({
|
|
560
561
|
name: s.db.table,
|
|
561
562
|
fields: s.fieldConfigs,
|
|
562
563
|
identifier: s.db.identifier,
|
|
563
|
-
});
|
|
564
|
+
}, caseStyleFns);
|
|
564
565
|
drizzleTableSchemas.push(drizzleSchema.schema);
|
|
565
|
-
drizzleSchema.
|
|
566
|
-
if (!drizzleColumnTypes.includes(type)) {
|
|
567
|
-
drizzleColumnTypes.push(type);
|
|
568
|
-
}
|
|
569
|
-
});
|
|
566
|
+
drizzleSchema.drizzleImports.forEach((type) => drizzleImports.add(type));
|
|
570
567
|
desiredTables.push({
|
|
571
568
|
name: s.db.table,
|
|
572
569
|
fields: s.fields,
|
|
@@ -614,6 +611,17 @@ const main = async (s) => {
|
|
|
614
611
|
*/
|
|
615
612
|
primaryKey: [referenceIdFieldConfig, selectIdFieldConfig],
|
|
616
613
|
});
|
|
614
|
+
const destDbFields = [
|
|
615
|
+
{ name: field.destinationDb.itemIdentifier, type: 'text', required: true },
|
|
616
|
+
{ name: field.destinationDb.selectIdentifier, type: 'text', required: true },
|
|
617
|
+
];
|
|
618
|
+
const destDbSchema = generateDrizzleSchema({
|
|
619
|
+
name: field.destinationDb.table,
|
|
620
|
+
fields: destDbFields,
|
|
621
|
+
compositePrimaryKey: destDbFields,
|
|
622
|
+
}, caseStyleFns);
|
|
623
|
+
drizzleTableSchemas.push(destDbSchema.schema);
|
|
624
|
+
destDbSchema.drizzleImports.forEach((type) => drizzleImports.add(type));
|
|
617
625
|
}
|
|
618
626
|
}
|
|
619
627
|
/**
|
|
@@ -654,6 +662,32 @@ const main = async (s) => {
|
|
|
654
662
|
identifier: photoField,
|
|
655
663
|
primaryKey: [photoField],
|
|
656
664
|
});
|
|
665
|
+
const gallerySchema = generateDrizzleSchema({
|
|
666
|
+
name: gallery.db.tableName,
|
|
667
|
+
fields: [
|
|
668
|
+
{
|
|
669
|
+
name: gallery.db.referenceIdentifierField || 'reference_id',
|
|
670
|
+
type: 'text',
|
|
671
|
+
required: true,
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
name: gallery.db.photoNameField || 'photo',
|
|
675
|
+
type: 'text',
|
|
676
|
+
required: true,
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
name: gallery.db.metaField || 'meta',
|
|
680
|
+
type: 'textarea',
|
|
681
|
+
required: false,
|
|
682
|
+
},
|
|
683
|
+
],
|
|
684
|
+
identifier: {
|
|
685
|
+
name: gallery.db.photoNameField || 'photo',
|
|
686
|
+
type: 'text',
|
|
687
|
+
},
|
|
688
|
+
}, caseStyleFns);
|
|
689
|
+
drizzleTableSchemas.push(gallerySchema.schema);
|
|
690
|
+
gallerySchema.drizzleImports.forEach((type) => drizzleImports.add(type));
|
|
657
691
|
}
|
|
658
692
|
}
|
|
659
693
|
/**
|
|
@@ -667,9 +701,9 @@ const main = async (s) => {
|
|
|
667
701
|
fs.mkdirSync(schemaOutDir, { recursive: true });
|
|
668
702
|
}
|
|
669
703
|
/**
|
|
670
|
-
* Append the Drizzle
|
|
704
|
+
* Append the Drizzle imports to the schema file
|
|
671
705
|
*/
|
|
672
|
-
fs.appendFileSync(schemaFilePath, 'import {' +
|
|
706
|
+
fs.appendFileSync(schemaFilePath, 'import {' + [...drizzleImports].join(',') + "} from 'drizzle-orm/mysql-core'\n\n");
|
|
673
707
|
/**
|
|
674
708
|
* Append the Drizzle table schemas to the schema file
|
|
675
709
|
*/
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import type { FieldConfig } from '../../core/fields/index.js';
|
|
2
|
+
export interface CaseStyleFns {
|
|
3
|
+
tableCaseStyleFn: (str: string) => string;
|
|
4
|
+
columnCaseStyleFn: (str: string) => string;
|
|
5
|
+
}
|
|
6
|
+
export interface NamingConfig {
|
|
7
|
+
tables: 'camelCase' | 'snakeCase' | 'pascalCase';
|
|
8
|
+
columns: 'camelCase' | 'snakeCase' | 'pascalCase';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Resolves case-style functions from the naming configuration.
|
|
12
|
+
* Centralises the switch logic that was previously duplicated across generators.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveCaseStyleFns(naming: NamingConfig): CaseStyleFns;
|
|
2
15
|
export declare function generateDrizzleSchema(table: {
|
|
3
16
|
name: string;
|
|
4
17
|
fields: FieldConfig[];
|
|
5
|
-
identifier
|
|
6
|
-
|
|
18
|
+
identifier?: FieldConfig;
|
|
19
|
+
compositePrimaryKey?: {
|
|
20
|
+
name: string;
|
|
21
|
+
}[];
|
|
22
|
+
}, caseStyleFns: CaseStyleFns): {
|
|
7
23
|
schema: string;
|
|
8
|
-
|
|
9
|
-
}
|
|
24
|
+
drizzleImports: string[];
|
|
25
|
+
};
|
|
10
26
|
//# sourceMappingURL=schema-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-generator.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/schema-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAoB7D,
|
|
1
|
+
{"version":3,"file":"schema-generator.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/schema-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAoB7D,MAAM,WAAW,YAAY;IACzB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACzC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,CAAA;IAChD,OAAO,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,CAAA;CACpD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CA8BtE;AAED,wBAAgB,qBAAqB,CACjC,KAAK,EAAE;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,WAAW,CAAA;IACxB,mBAAmB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC3C,EACD,YAAY,EAAE,YAAY,GAC3B;IACC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,EAAE,CAAA;CAC3B,CAwIA"}
|
|
@@ -13,12 +13,13 @@ function toSnakeCase(str) {
|
|
|
13
13
|
.replace(/^_/, '') // Remove leading underscore if any
|
|
14
14
|
.toLowerCase();
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Resolves case-style functions from the naming configuration.
|
|
18
|
+
* Centralises the switch logic that was previously duplicated across generators.
|
|
19
|
+
*/
|
|
20
|
+
export function resolveCaseStyleFns(naming) {
|
|
18
21
|
let tableCaseStyleFn;
|
|
19
|
-
|
|
20
|
-
const lzConfig = await getCMSConfig();
|
|
21
|
-
switch (lzConfig.schemaGeneration.drizzle.naming.tables) {
|
|
22
|
+
switch (naming.tables) {
|
|
22
23
|
case 'snakeCase':
|
|
23
24
|
tableCaseStyleFn = toSnakeCase;
|
|
24
25
|
break;
|
|
@@ -30,7 +31,8 @@ export async function generateDrizzleSchema(table) {
|
|
|
30
31
|
tableCaseStyleFn = toPascalCase;
|
|
31
32
|
break;
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
let columnCaseStyleFn;
|
|
35
|
+
switch (naming.columns) {
|
|
34
36
|
case 'snakeCase':
|
|
35
37
|
columnCaseStyleFn = toSnakeCase;
|
|
36
38
|
break;
|
|
@@ -42,12 +44,11 @@ export async function generateDrizzleSchema(table) {
|
|
|
42
44
|
columnCaseStyleFn = toCamelCase;
|
|
43
45
|
break;
|
|
44
46
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const drizzleColumnTypes = [];
|
|
47
|
+
return { tableCaseStyleFn, columnCaseStyleFn };
|
|
48
|
+
}
|
|
49
|
+
export function generateDrizzleSchema(table, caseStyleFns) {
|
|
50
|
+
const { tableCaseStyleFn, columnCaseStyleFn } = caseStyleFns;
|
|
51
|
+
const drizzleImports = [];
|
|
51
52
|
let schema = '';
|
|
52
53
|
const schemaName = tableCaseStyleFn(`${table.name}_table`);
|
|
53
54
|
schema += `export const ${schemaName} = mysqlTable('${table.name}', {\n`;
|
|
@@ -58,7 +59,6 @@ export async function generateDrizzleSchema(table) {
|
|
|
58
59
|
continue;
|
|
59
60
|
let columnType;
|
|
60
61
|
let drizzleColumnType;
|
|
61
|
-
// let columnOptions = ''
|
|
62
62
|
switch (input.type) {
|
|
63
63
|
case 'text':
|
|
64
64
|
columnType = `varchar('${input.name}', { length: ${input.maxLength ?? 255} })`;
|
|
@@ -145,27 +145,30 @@ export async function generateDrizzleSchema(table) {
|
|
|
145
145
|
if (input.required) {
|
|
146
146
|
columnType += `.notNull()`;
|
|
147
147
|
}
|
|
148
|
-
if (input === table.identifier) {
|
|
148
|
+
if (table.identifier && input === table.identifier) {
|
|
149
149
|
columnType += `.primaryKey()`;
|
|
150
150
|
}
|
|
151
151
|
/*if (input.type === 'date') {
|
|
152
152
|
columnType += `.defaultNow()`
|
|
153
153
|
}*/
|
|
154
154
|
schema += ` ${columnCaseStyleFn(input.name)}: ${columnType},\n`;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*/
|
|
158
|
-
if (drizzleColumnType && !drizzleColumnTypes.includes(drizzleColumnType)) {
|
|
159
|
-
/**
|
|
160
|
-
* If it's not, add it to the array
|
|
161
|
-
*/
|
|
162
|
-
drizzleColumnTypes.push(drizzleColumnType);
|
|
155
|
+
if (drizzleColumnType && !drizzleImports.includes(drizzleColumnType)) {
|
|
156
|
+
drizzleImports.push(drizzleColumnType);
|
|
163
157
|
}
|
|
164
158
|
}
|
|
165
159
|
schema = schema.slice(0, -2); // Remove the last comma and newline
|
|
166
|
-
|
|
160
|
+
if (table.compositePrimaryKey && table.compositePrimaryKey.length > 1) {
|
|
161
|
+
const pkCols = table.compositePrimaryKey.map((f) => `table.${columnCaseStyleFn(f.name)}`).join(', ');
|
|
162
|
+
schema += `\n}, (table) => [primaryKey({ columns: [${pkCols}] })]);\n\n`;
|
|
163
|
+
if (!drizzleImports.includes('primaryKey')) {
|
|
164
|
+
drizzleImports.push('primaryKey');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
schema += `\n});\n\n`;
|
|
169
|
+
}
|
|
167
170
|
return {
|
|
168
171
|
schema: schema,
|
|
169
|
-
|
|
172
|
+
drizzleImports,
|
|
170
173
|
};
|
|
171
174
|
}
|
|
@@ -118,9 +118,27 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
118
118
|
*/
|
|
119
119
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
120
120
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
121
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
122
121
|
name: z.ZodString;
|
|
123
|
-
|
|
122
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
db: z.ZodObject<{
|
|
124
|
+
tableName: z.ZodString;
|
|
125
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
126
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
127
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
width: z.ZodNumber;
|
|
132
|
+
height: z.ZodNumber;
|
|
133
|
+
fit: z.ZodEnum<{
|
|
134
|
+
cover: "cover";
|
|
135
|
+
contain: "contain";
|
|
136
|
+
}>;
|
|
137
|
+
quality: z.ZodNumber;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
}, z.core.$strict>>;
|
|
140
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
141
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
124
142
|
db: z.ZodObject<{
|
|
125
143
|
table: z.ZodString;
|
|
126
144
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -144,26 +162,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
144
162
|
name: z.ZodOptional<z.ZodString>;
|
|
145
163
|
}, z.core.$strict>>>;
|
|
146
164
|
}, z.core.$strict>;
|
|
147
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
148
|
-
gallery: z.ZodOptional<z.ZodObject<{
|
|
149
|
-
db: z.ZodObject<{
|
|
150
|
-
tableName: z.ZodString;
|
|
151
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
152
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
153
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
154
|
-
}, z.core.$strict>;
|
|
155
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
157
|
-
width: z.ZodNumber;
|
|
158
|
-
height: z.ZodNumber;
|
|
159
|
-
fit: z.ZodEnum<{
|
|
160
|
-
cover: "cover";
|
|
161
|
-
contain: "contain";
|
|
162
|
-
}>;
|
|
163
|
-
quality: z.ZodNumber;
|
|
164
|
-
}, z.core.$strict>>;
|
|
165
|
-
}, z.core.$strict>>;
|
|
166
165
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
166
|
+
order: z.ZodNumber;
|
|
167
167
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
168
168
|
}, z.core.$strict>;
|
|
169
169
|
export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
@@ -218,9 +218,27 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
218
218
|
* @default false
|
|
219
219
|
*/
|
|
220
220
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
222
221
|
name: z.ZodString;
|
|
223
|
-
|
|
222
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
db: z.ZodObject<{
|
|
224
|
+
tableName: z.ZodString;
|
|
225
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
226
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
227
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
228
|
+
}, z.core.$strict>;
|
|
229
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
230
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
width: z.ZodNumber;
|
|
232
|
+
height: z.ZodNumber;
|
|
233
|
+
fit: z.ZodEnum<{
|
|
234
|
+
cover: "cover";
|
|
235
|
+
contain: "contain";
|
|
236
|
+
}>;
|
|
237
|
+
quality: z.ZodNumber;
|
|
238
|
+
}, z.core.$strict>>;
|
|
239
|
+
}, z.core.$strict>>;
|
|
240
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
241
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
224
242
|
db: z.ZodObject<{
|
|
225
243
|
table: z.ZodString;
|
|
226
244
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -244,26 +262,8 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
244
262
|
name: z.ZodOptional<z.ZodString>;
|
|
245
263
|
}, z.core.$strict>>>;
|
|
246
264
|
}, z.core.$strict>;
|
|
247
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
248
|
-
gallery: z.ZodOptional<z.ZodObject<{
|
|
249
|
-
db: z.ZodObject<{
|
|
250
|
-
tableName: z.ZodString;
|
|
251
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
252
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
253
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
254
|
-
}, z.core.$strict>;
|
|
255
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
257
|
-
width: z.ZodNumber;
|
|
258
|
-
height: z.ZodNumber;
|
|
259
|
-
fit: z.ZodEnum<{
|
|
260
|
-
cover: "cover";
|
|
261
|
-
contain: "contain";
|
|
262
|
-
}>;
|
|
263
|
-
quality: z.ZodNumber;
|
|
264
|
-
}, z.core.$strict>>;
|
|
265
|
-
}, z.core.$strict>>;
|
|
266
265
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
266
|
+
order: z.ZodNumber;
|
|
267
267
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
268
268
|
}, z.core.$strict>;
|
|
269
269
|
export type CategorySectionOptions = z.infer<typeof optionsSchema>;
|
|
@@ -481,9 +481,27 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
481
481
|
}>>;
|
|
482
482
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
483
483
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
484
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
485
484
|
name: z.ZodString;
|
|
486
|
-
|
|
485
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
486
|
+
db: z.ZodObject<{
|
|
487
|
+
tableName: z.ZodString;
|
|
488
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
489
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
490
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strict>;
|
|
492
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
493
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
494
|
+
width: z.ZodNumber;
|
|
495
|
+
height: z.ZodNumber;
|
|
496
|
+
fit: z.ZodEnum<{
|
|
497
|
+
cover: "cover";
|
|
498
|
+
contain: "contain";
|
|
499
|
+
}>;
|
|
500
|
+
quality: z.ZodNumber;
|
|
501
|
+
}, z.core.$strict>>;
|
|
502
|
+
}, z.core.$strict>>;
|
|
503
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
504
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
487
505
|
db: z.ZodObject<{
|
|
488
506
|
table: z.ZodString;
|
|
489
507
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -507,26 +525,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
507
525
|
name: z.ZodOptional<z.ZodString>;
|
|
508
526
|
}, z.core.$strict>>>;
|
|
509
527
|
}, z.core.$strict>;
|
|
510
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
511
|
-
gallery: z.ZodOptional<z.ZodObject<{
|
|
512
|
-
db: z.ZodObject<{
|
|
513
|
-
tableName: z.ZodString;
|
|
514
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
515
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
516
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
517
|
-
}, z.core.$strict>;
|
|
518
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
519
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
520
|
-
width: z.ZodNumber;
|
|
521
|
-
height: z.ZodNumber;
|
|
522
|
-
fit: z.ZodEnum<{
|
|
523
|
-
cover: "cover";
|
|
524
|
-
contain: "contain";
|
|
525
|
-
}>;
|
|
526
|
-
quality: z.ZodNumber;
|
|
527
|
-
}, z.core.$strict>>;
|
|
528
|
-
}, z.core.$strict>>;
|
|
529
528
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
529
|
+
order: z.ZodNumber;
|
|
530
530
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
531
531
|
}, z.core.$strict>;
|
|
532
532
|
declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
@@ -757,9 +757,27 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
757
757
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
758
758
|
}>>;
|
|
759
759
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
760
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
761
760
|
name: z.ZodString;
|
|
762
|
-
|
|
761
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
762
|
+
db: z.ZodObject<{
|
|
763
|
+
tableName: z.ZodString;
|
|
764
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
765
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
766
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
767
|
+
}, z.core.$strict>;
|
|
768
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
769
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
770
|
+
width: z.ZodNumber;
|
|
771
|
+
height: z.ZodNumber;
|
|
772
|
+
fit: z.ZodEnum<{
|
|
773
|
+
cover: "cover";
|
|
774
|
+
contain: "contain";
|
|
775
|
+
}>;
|
|
776
|
+
quality: z.ZodNumber;
|
|
777
|
+
}, z.core.$strict>>;
|
|
778
|
+
}, z.core.$strict>>;
|
|
779
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
780
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
763
781
|
db: z.ZodObject<{
|
|
764
782
|
table: z.ZodString;
|
|
765
783
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -783,26 +801,8 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
783
801
|
name: z.ZodOptional<z.ZodString>;
|
|
784
802
|
}, z.core.$strict>>>;
|
|
785
803
|
}, z.core.$strict>;
|
|
786
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
787
|
-
gallery: z.ZodOptional<z.ZodObject<{
|
|
788
|
-
db: z.ZodObject<{
|
|
789
|
-
tableName: z.ZodString;
|
|
790
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
791
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
792
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
793
|
-
}, z.core.$strict>;
|
|
794
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
795
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
796
|
-
width: z.ZodNumber;
|
|
797
|
-
height: z.ZodNumber;
|
|
798
|
-
fit: z.ZodEnum<{
|
|
799
|
-
cover: "cover";
|
|
800
|
-
contain: "contain";
|
|
801
|
-
}>;
|
|
802
|
-
quality: z.ZodNumber;
|
|
803
|
-
}, z.core.$strict>>;
|
|
804
|
-
}, z.core.$strict>>;
|
|
805
804
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
805
|
+
order: z.ZodNumber;
|
|
806
806
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
807
807
|
}, z.core.$strict>;
|
|
808
808
|
export type HasItemsSectionOptions = z.infer<typeof optionsSchema>;
|
|
@@ -65,9 +65,27 @@ export declare const baseSectionOptionsSchema: z.ZodObject<{
|
|
|
65
65
|
*/
|
|
66
66
|
export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
67
67
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
68
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
69
68
|
name: z.ZodString;
|
|
70
|
-
|
|
69
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
db: z.ZodObject<{
|
|
71
|
+
tableName: z.ZodString;
|
|
72
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
73
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
74
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
width: z.ZodNumber;
|
|
79
|
+
height: z.ZodNumber;
|
|
80
|
+
fit: z.ZodEnum<{
|
|
81
|
+
cover: "cover";
|
|
82
|
+
contain: "contain";
|
|
83
|
+
}>;
|
|
84
|
+
quality: z.ZodNumber;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
88
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
71
89
|
db: z.ZodObject<{
|
|
72
90
|
table: z.ZodString;
|
|
73
91
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -91,26 +109,8 @@ export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
|
91
109
|
name: z.ZodOptional<z.ZodString>;
|
|
92
110
|
}, z.core.$strict>>>;
|
|
93
111
|
}, z.core.$strict>;
|
|
94
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
95
|
-
gallery: z.ZodOptional<z.ZodObject<{
|
|
96
|
-
db: z.ZodObject<{
|
|
97
|
-
tableName: z.ZodString;
|
|
98
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
99
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
100
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
101
|
-
}, z.core.$strict>;
|
|
102
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
104
|
-
width: z.ZodNumber;
|
|
105
|
-
height: z.ZodNumber;
|
|
106
|
-
fit: z.ZodEnum<{
|
|
107
|
-
cover: "cover";
|
|
108
|
-
contain: "contain";
|
|
109
|
-
}>;
|
|
110
|
-
quality: z.ZodNumber;
|
|
111
|
-
}, z.core.$strict>>;
|
|
112
|
-
}, z.core.$strict>>;
|
|
113
112
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<Variant, Variant>>>;
|
|
113
|
+
order: z.ZodNumber;
|
|
114
114
|
hooks: z.ZodOptional<z.ZodCustom<Hooks, Hooks>>;
|
|
115
115
|
}, z.core.$strict>;
|
|
116
116
|
export declare function validateSectionConfig(config: BaseSectionOptions): void;
|
|
@@ -23,10 +23,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
23
23
|
table: z.ZodString;
|
|
24
24
|
}, z.core.$strict>;
|
|
25
25
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
26
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
27
26
|
name: z.ZodString;
|
|
28
|
-
order: z.ZodNumber;
|
|
29
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
30
27
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
31
28
|
db: z.ZodObject<{
|
|
32
29
|
tableName: z.ZodString;
|
|
@@ -45,7 +42,10 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
45
42
|
quality: z.ZodNumber;
|
|
46
43
|
}, z.core.$strict>>;
|
|
47
44
|
}, z.core.$strict>>;
|
|
45
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
46
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
48
47
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
48
|
+
order: z.ZodNumber;
|
|
49
49
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
50
50
|
}, z.core.$strict>;
|
|
51
51
|
declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
@@ -57,10 +57,7 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
57
57
|
db: z.ZodObject<{
|
|
58
58
|
table: z.ZodString;
|
|
59
59
|
}, z.core.$strict>;
|
|
60
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
61
60
|
name: z.ZodString;
|
|
62
|
-
order: z.ZodNumber;
|
|
63
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
64
61
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
65
62
|
db: z.ZodObject<{
|
|
66
63
|
tableName: z.ZodString;
|
|
@@ -79,7 +76,10 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
79
76
|
quality: z.ZodNumber;
|
|
80
77
|
}, z.core.$strict>>;
|
|
81
78
|
}, z.core.$strict>>;
|
|
79
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
80
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
82
81
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
82
|
+
order: z.ZodNumber;
|
|
83
83
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
84
84
|
}, z.core.$strict>;
|
|
85
85
|
export type SimpleSectionOptions = z.infer<typeof optionsSchema>;
|
|
@@ -248,6 +248,7 @@ declare const _default: {
|
|
|
248
248
|
readonly log: "Log";
|
|
249
249
|
readonly logs: "Logs";
|
|
250
250
|
readonly select: "Select";
|
|
251
|
+
readonly selectOptions: "Select options";
|
|
251
252
|
readonly settings: "Settings";
|
|
252
253
|
readonly deleteItemText: "Are you sure you want to delete this item?";
|
|
253
254
|
readonly deleteEmailText: "Are you sure you want to delete this email account?";
|
|
@@ -429,6 +430,21 @@ declare const _default: {
|
|
|
429
430
|
readonly sqlQueryNotDefined: "SQL query is not defined";
|
|
430
431
|
readonly galleryTableNotSetUp: "Gallery table is not set up correctly, gallery photos were not saved.";
|
|
431
432
|
readonly useVideoApiRoute: "Please use the /api/video route";
|
|
433
|
+
readonly searchDots: "Search...";
|
|
434
|
+
readonly noItemFound: "No item found";
|
|
435
|
+
readonly searchOptionsDots: "Search options...";
|
|
436
|
+
readonly availableOptions: "Available options";
|
|
437
|
+
readonly searchThroughOptions: "Search through available options";
|
|
438
|
+
readonly filterOptionsHint: "Type to filter options. Use arrow keys to navigate results.";
|
|
439
|
+
readonly openMainMenu: "Open main menu";
|
|
440
|
+
readonly openUserMenu: "Open user menu";
|
|
441
|
+
readonly profileImage: "Profile image";
|
|
442
|
+
readonly logo: "Logo";
|
|
443
|
+
readonly newImage: "New image";
|
|
444
|
+
readonly autoGeneratedFromLinkedField: "Auto-generated from linked field";
|
|
445
|
+
readonly clear: "Clear";
|
|
446
|
+
readonly close: "Close";
|
|
447
|
+
readonly clearAllSelectedOptions: "Clear all {count} selected options";
|
|
432
448
|
};
|
|
433
449
|
export default _default;
|
|
434
450
|
//# sourceMappingURL=en.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/base/en.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/base/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA6dU"}
|
|
@@ -248,6 +248,7 @@ export default {
|
|
|
248
248
|
log: 'Log',
|
|
249
249
|
logs: 'Logs',
|
|
250
250
|
select: 'Select',
|
|
251
|
+
selectOptions: 'Select options',
|
|
251
252
|
settings: 'Settings',
|
|
252
253
|
deleteItemText: 'Are you sure you want to delete this item?',
|
|
253
254
|
deleteEmailText: 'Are you sure you want to delete this email account?',
|
|
@@ -442,4 +443,20 @@ export default {
|
|
|
442
443
|
galleryTableNotSetUp: 'Gallery table is not set up correctly, gallery photos were not saved.',
|
|
443
444
|
// Server Action Errors
|
|
444
445
|
useVideoApiRoute: 'Please use the /api/video route',
|
|
446
|
+
// UI / Accessibility
|
|
447
|
+
searchDots: 'Search...',
|
|
448
|
+
noItemFound: 'No item found',
|
|
449
|
+
searchOptionsDots: 'Search options...',
|
|
450
|
+
availableOptions: 'Available options',
|
|
451
|
+
searchThroughOptions: 'Search through available options',
|
|
452
|
+
filterOptionsHint: 'Type to filter options. Use arrow keys to navigate results.',
|
|
453
|
+
openMainMenu: 'Open main menu',
|
|
454
|
+
openUserMenu: 'Open user menu',
|
|
455
|
+
profileImage: 'Profile image',
|
|
456
|
+
logo: 'Logo',
|
|
457
|
+
newImage: 'New image',
|
|
458
|
+
autoGeneratedFromLinkedField: 'Auto-generated from linked field',
|
|
459
|
+
clear: 'Clear',
|
|
460
|
+
close: 'Close',
|
|
461
|
+
clearAllSelectedOptions: 'Clear all {count} selected options',
|
|
445
462
|
};
|