nextjs-cms 0.5.21 → 0.5.24
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/core/factories/SectionFactory.js +3 -3
- package/dist/core/fields/date.d.ts +14 -2
- package/dist/core/fields/date.d.ts.map +1 -1
- package/dist/core/fields/date.js +40 -12
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/fields/tags.d.ts +4 -0
- package/dist/core/fields/tags.d.ts.map +1 -1
- package/dist/core/fields/tags.js +10 -4
- package/dist/core/sections/category.d.ts +6 -6
- package/dist/core/sections/hasItems.d.ts +6 -6
- package/dist/core/sections/section.d.ts +3 -3
- package/dist/core/sections/simple.d.ts +2 -2
- package/dist/translations/dictionaries/ar.json +2 -1
- package/dist/translations/dictionaries/en.json +2 -1
- package/package.json +9 -21
|
@@ -10,7 +10,7 @@ import { db } from '../../db/client.js';
|
|
|
10
10
|
import { AdminPrivilegesTable } from '../../db/schema.js';
|
|
11
11
|
import { getCMSConfig } from '../config/index.js';
|
|
12
12
|
const cmsConfig = getCMSConfig();
|
|
13
|
-
const hotMarkerFile = resolve(process.cwd(), 'components/form/helpers/_section-hot-reload.
|
|
13
|
+
const hotMarkerFile = resolve(process.cwd(), 'components/form/helpers/_section-hot-reload.js');
|
|
14
14
|
// Create a require function that works in ES modules
|
|
15
15
|
const safeRequire = createRequire(import.meta.url);
|
|
16
16
|
/**
|
|
@@ -122,10 +122,10 @@ export class SectionFactory {
|
|
|
122
122
|
`export const sectionSchemaLastUpdated = ${Date.now()}\n`;
|
|
123
123
|
try {
|
|
124
124
|
fs.writeFileSync(hotMarkerFile, content, 'utf8');
|
|
125
|
-
log('Bumped _section-hot-reload.
|
|
125
|
+
log('Bumped _section-hot-reload.js to trigger Next Fast Refresh');
|
|
126
126
|
}
|
|
127
127
|
catch (err) {
|
|
128
|
-
console.error('Failed to bump _section-hot-reload.
|
|
128
|
+
console.error('Failed to bump _section-hot-reload.js:', err);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
// ---------- PUBLIC API ----------
|
|
@@ -18,13 +18,24 @@ declare const configSchema: z.ZodObject<{
|
|
|
18
18
|
type Config = z.infer<typeof configSchema>;
|
|
19
19
|
export declare class DateField extends Field<'date', Config> {
|
|
20
20
|
static readonly [entityKind]: string;
|
|
21
|
+
/**
|
|
22
|
+
* TODO:
|
|
23
|
+
* 1- timestamp should only be allowed when adminGenerated is false.
|
|
24
|
+
* 2- time format should be added as well.
|
|
25
|
+
*/
|
|
21
26
|
readonly format: 'date' | 'datetime' | 'timestamp';
|
|
22
27
|
private readonly _defaultValue;
|
|
23
28
|
constructor(config: BaseFieldConfig<Config>);
|
|
24
29
|
/**
|
|
25
|
-
*
|
|
30
|
+
* Parse the raw value into a Date object
|
|
31
|
+
* Returns null if the value is not a valid date
|
|
32
|
+
*/
|
|
33
|
+
private parseDate;
|
|
34
|
+
/**
|
|
35
|
+
* Get the value of the field in the required format
|
|
36
|
+
* Returns the value formatted according to the field's format setting
|
|
26
37
|
*/
|
|
27
|
-
getValue(): string;
|
|
38
|
+
getValue(): string | null;
|
|
28
39
|
exportForClient(): {
|
|
29
40
|
format: "date" | "datetime" | "timestamp";
|
|
30
41
|
type: "date";
|
|
@@ -40,6 +51,7 @@ export declare class DateField extends Field<'date', Config> {
|
|
|
40
51
|
hasSqlNameAndValue(): boolean;
|
|
41
52
|
/**
|
|
42
53
|
* Prepare the field for submission
|
|
54
|
+
* Normalizes the value to ISO string format for storage
|
|
43
55
|
*/
|
|
44
56
|
prepareForSubmission(): Promise<void>;
|
|
45
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/core/fields/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,KAAK,EAAyB,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,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KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GAAG,eAAe,CAmB/E"}
|
package/dist/core/fields/date.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Field, baseFieldConfigSchema } from './field.js';
|
|
2
2
|
import { entityKind } from '../helpers/index.js';
|
|
3
3
|
import * as z from 'zod';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
4
5
|
const configSchema = z.strictObject({
|
|
5
6
|
format: z.enum(['date', 'datetime', 'timestamp']).optional().describe('The format of the date field'),
|
|
6
7
|
/**
|
|
@@ -12,6 +13,11 @@ const configSchema = z.strictObject({
|
|
|
12
13
|
});
|
|
13
14
|
export class DateField extends Field {
|
|
14
15
|
static [entityKind] = 'DateField';
|
|
16
|
+
/**
|
|
17
|
+
* TODO:
|
|
18
|
+
* 1- timestamp should only be allowed when adminGenerated is false.
|
|
19
|
+
* 2- time format should be added as well.
|
|
20
|
+
*/
|
|
15
21
|
format;
|
|
16
22
|
_defaultValue;
|
|
17
23
|
constructor(config) {
|
|
@@ -20,21 +26,42 @@ export class DateField extends Field {
|
|
|
20
26
|
/**
|
|
21
27
|
* Set the default date if not provided
|
|
22
28
|
*/
|
|
23
|
-
this.value = config.defaultValue ??
|
|
29
|
+
this.value = config.defaultValue ?? undefined;
|
|
24
30
|
this._defaultValue = config.defaultValue;
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
27
|
-
*
|
|
33
|
+
* Parse the raw value into a Date object
|
|
34
|
+
* Returns null if the value is not a valid date
|
|
35
|
+
*/
|
|
36
|
+
parseDate() {
|
|
37
|
+
if (this.value === undefined || this.value === null || this.value === '') {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const date = new Date(this.value);
|
|
41
|
+
return isNaN(date.getTime()) ? null : date;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the value of the field in the required format
|
|
45
|
+
* Returns the value formatted according to the field's format setting
|
|
28
46
|
*/
|
|
29
47
|
getValue() {
|
|
48
|
+
const date = this.parseDate();
|
|
49
|
+
if (!date) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
30
52
|
switch (this.format) {
|
|
31
53
|
case 'timestamp':
|
|
32
|
-
return
|
|
54
|
+
return dayjs(date).format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
33
55
|
case 'datetime':
|
|
34
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Return the date in ISO string format
|
|
58
|
+
* Example: 2025-12-18T12:00:00.000Z
|
|
59
|
+
*/
|
|
60
|
+
return dayjs(date).format('YYYY-MM-DD HH:mm:ss');
|
|
35
61
|
case 'date':
|
|
36
62
|
default:
|
|
37
|
-
|
|
63
|
+
// Return YYYY-MM-DD format
|
|
64
|
+
return dayjs(date).format('YYYY-MM-DD');
|
|
38
65
|
}
|
|
39
66
|
}
|
|
40
67
|
exportForClient() {
|
|
@@ -48,7 +75,8 @@ export class DateField extends Field {
|
|
|
48
75
|
* Check if the field is required
|
|
49
76
|
*/
|
|
50
77
|
if (this.required) {
|
|
51
|
-
|
|
78
|
+
const date = this.parseDate();
|
|
79
|
+
if (!date) {
|
|
52
80
|
throw new Error(`Field ${this.label} is required`);
|
|
53
81
|
}
|
|
54
82
|
}
|
|
@@ -61,17 +89,17 @@ export class DateField extends Field {
|
|
|
61
89
|
}
|
|
62
90
|
/**
|
|
63
91
|
* Prepare the field for submission
|
|
92
|
+
* Normalizes the value to ISO string format for storage
|
|
64
93
|
*/
|
|
65
94
|
async prepareForSubmission() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
this.value = new Date(this.value).toISOString();
|
|
95
|
+
const date = this.parseDate();
|
|
96
|
+
if (date) {
|
|
97
|
+
this.value = date.toISOString();
|
|
71
98
|
}
|
|
72
|
-
|
|
99
|
+
else if (this.required) {
|
|
73
100
|
throw new Error(`Field ${this.label}: Invalid date, please provide a valid date`);
|
|
74
101
|
}
|
|
102
|
+
// If not required and no valid date, keep value as-is (null/undefined)
|
|
75
103
|
}
|
|
76
104
|
}
|
|
77
105
|
const optionsSchema = z.strictObject({
|
|
@@ -346,8 +346,8 @@ declare const selectFieldConfigSchema: z.ZodIntersection<z.ZodUnion<readonly [z.
|
|
|
346
346
|
}, z.core.$strict>]>, z.ZodObject<{
|
|
347
347
|
type: z.ZodLiteral<"select">;
|
|
348
348
|
optionsType: z.ZodEnum<{
|
|
349
|
-
db: "db";
|
|
350
349
|
section: "section";
|
|
350
|
+
db: "db";
|
|
351
351
|
static: "static";
|
|
352
352
|
}>;
|
|
353
353
|
build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<SelectField, SelectField>>;
|
|
@@ -50,6 +50,10 @@ export declare class TagsField extends Field<'tags', Config> {
|
|
|
50
50
|
value: any;
|
|
51
51
|
};
|
|
52
52
|
checkRequired(): void;
|
|
53
|
+
/**
|
|
54
|
+
* TODO: This is a temporary solution to convert the value to an array of tags
|
|
55
|
+
* The tags class is not complete
|
|
56
|
+
*/
|
|
53
57
|
prepareForSubmission(): Promise<void>;
|
|
54
58
|
}
|
|
55
59
|
export type TagsFieldClientConfig = ReturnType<TagsField['exportForClient']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/core/fields/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,KAAK,EAAyB,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;IACd;;;OAGG;;;;;;;;;;;IAiBH;;;;;OAKG;;kBAEL,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAA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eAAe,CAAC,MAAM,CAAC;IAO3C,QAAQ;IAGQ,eAAe;;;;;;;;;;;;IAQ/B,aAAa;IAMb;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;CAe9C;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAE5E,QAAA,MAAM,aAAa;IAxFf;;;OAGG;;;;;;;;;;;IAiBH;;;;;OAKG;;;;;;;;;kBAkEL,CAAA;AAEF,QAAA,MAAM,qBAAqB;;;IA7FvB;;;OAGG;;;;;;;;;;;IAiBH;;;;;OAKG;;;;;;;;;kBAwEL,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GAAG,eAAe,CAmB/E"}
|
package/dist/core/fields/tags.js
CHANGED
|
@@ -39,7 +39,7 @@ export class TagsField extends Field {
|
|
|
39
39
|
constructor(config) {
|
|
40
40
|
super(config, 'tags');
|
|
41
41
|
this.destinationDb = config.destinationDb;
|
|
42
|
-
this.placeholder = config.placeholder || '';
|
|
42
|
+
this.placeholder = config.placeholder || 'Hit enter or comma to add a tag...';
|
|
43
43
|
this.sanitize = config.sanitize ?? false;
|
|
44
44
|
}
|
|
45
45
|
getValue() {
|
|
@@ -57,16 +57,22 @@ export class TagsField extends Field {
|
|
|
57
57
|
throw new Error(`Field ${this.label} is required`);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* TODO: This is a temporary solution to convert the value to an array of tags
|
|
62
|
+
* The tags class is not complete
|
|
63
|
+
*/
|
|
60
64
|
async prepareForSubmission() {
|
|
61
65
|
if (this.value) {
|
|
62
|
-
|
|
66
|
+
let _tags = this.value.split(',');
|
|
67
|
+
if (!Array.isArray(_tags)) {
|
|
63
68
|
throw new Error(`Field ${this.label} must be an array of tags`);
|
|
64
69
|
}
|
|
65
|
-
if (
|
|
70
|
+
if (_tags.some((tag) => typeof tag !== 'string')) {
|
|
66
71
|
throw new Error(`Field ${this.label} must contain only string tags`);
|
|
67
72
|
}
|
|
68
73
|
if (this.sanitize) {
|
|
69
|
-
|
|
74
|
+
_tags = _tags.map((tag) => escapeHTML(tag) || tag);
|
|
75
|
+
this.value = _tags.join(',');
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
78
|
}
|
|
@@ -117,10 +117,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
117
117
|
*/
|
|
118
118
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
119
119
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
120
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
121
120
|
name: z.ZodString;
|
|
122
|
-
order: z.ZodNumber;
|
|
123
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
124
121
|
db: z.ZodObject<{
|
|
125
122
|
table: z.ZodString;
|
|
126
123
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -144,6 +141,9 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
144
141
|
name: z.ZodOptional<z.ZodString>;
|
|
145
142
|
}, z.core.$strict>>>;
|
|
146
143
|
}, z.core.$strict>;
|
|
144
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
145
|
+
order: z.ZodNumber;
|
|
146
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
147
147
|
icon: z.ZodOptional<z.ZodString>;
|
|
148
148
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
149
149
|
db: z.ZodObject<{
|
|
@@ -214,10 +214,7 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
214
214
|
* @default false
|
|
215
215
|
*/
|
|
216
216
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
218
217
|
name: z.ZodString;
|
|
219
|
-
order: z.ZodNumber;
|
|
220
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
221
218
|
db: z.ZodObject<{
|
|
222
219
|
table: z.ZodString;
|
|
223
220
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -241,6 +238,9 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
241
238
|
name: z.ZodOptional<z.ZodString>;
|
|
242
239
|
}, z.core.$strict>>>;
|
|
243
240
|
}, z.core.$strict>;
|
|
241
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
242
|
+
order: z.ZodNumber;
|
|
243
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
244
244
|
icon: z.ZodOptional<z.ZodString>;
|
|
245
245
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
246
246
|
db: z.ZodObject<{
|
|
@@ -355,10 +355,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
355
355
|
}>>;
|
|
356
356
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
357
357
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
358
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
359
358
|
name: z.ZodString;
|
|
360
|
-
order: z.ZodNumber;
|
|
361
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
362
359
|
db: z.ZodObject<{
|
|
363
360
|
table: z.ZodString;
|
|
364
361
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -382,6 +379,9 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
382
379
|
name: z.ZodOptional<z.ZodString>;
|
|
383
380
|
}, z.core.$strict>>>;
|
|
384
381
|
}, z.core.$strict>;
|
|
382
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
383
|
+
order: z.ZodNumber;
|
|
384
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
385
385
|
icon: z.ZodOptional<z.ZodString>;
|
|
386
386
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
387
387
|
db: z.ZodObject<{
|
|
@@ -569,10 +569,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
569
569
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
570
570
|
}>>;
|
|
571
571
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
572
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
573
572
|
name: z.ZodString;
|
|
574
|
-
order: z.ZodNumber;
|
|
575
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
576
573
|
db: z.ZodObject<{
|
|
577
574
|
table: z.ZodString;
|
|
578
575
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -596,6 +593,9 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
596
593
|
name: z.ZodOptional<z.ZodString>;
|
|
597
594
|
}, z.core.$strict>>>;
|
|
598
595
|
}, z.core.$strict>;
|
|
596
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
597
|
+
order: z.ZodNumber;
|
|
598
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
599
599
|
icon: z.ZodOptional<z.ZodString>;
|
|
600
600
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
601
601
|
db: z.ZodObject<{
|
|
@@ -62,10 +62,7 @@ export declare const baseSectionOptionsSchema: z.ZodObject<{
|
|
|
62
62
|
*/
|
|
63
63
|
export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
64
64
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
65
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<Variant, Variant>>>;
|
|
66
65
|
name: z.ZodString;
|
|
67
|
-
order: z.ZodNumber;
|
|
68
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
69
66
|
db: z.ZodObject<{
|
|
70
67
|
table: z.ZodString;
|
|
71
68
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -89,6 +86,9 @@ export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
|
89
86
|
name: z.ZodOptional<z.ZodString>;
|
|
90
87
|
}, z.core.$strict>>>;
|
|
91
88
|
}, z.core.$strict>;
|
|
89
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<Variant, Variant>>>;
|
|
90
|
+
order: z.ZodNumber;
|
|
91
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
92
92
|
icon: z.ZodOptional<z.ZodString>;
|
|
93
93
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
94
94
|
db: z.ZodObject<{
|
|
@@ -22,8 +22,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
22
22
|
table: z.ZodString;
|
|
23
23
|
}, z.core.$strict>;
|
|
24
24
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
25
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
26
25
|
name: z.ZodString;
|
|
26
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
27
27
|
order: z.ZodNumber;
|
|
28
28
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
29
29
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -53,8 +53,8 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
53
53
|
db: z.ZodObject<{
|
|
54
54
|
table: z.ZodString;
|
|
55
55
|
}, z.core.$strict>;
|
|
56
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
57
56
|
name: z.ZodString;
|
|
57
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
58
58
|
order: z.ZodNumber;
|
|
59
59
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
60
60
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -275,5 +275,6 @@
|
|
|
275
275
|
"seeAll": "عرض الكل",
|
|
276
276
|
"allowedExtensions": "الامتدادات المسموح بها",
|
|
277
277
|
"recursiveCategoryDelete": "حذف الأقسام الفرعية أيضاً",
|
|
278
|
-
"recursiveCategoryDeleteWarning": "انتباه! سيتم حذف جميع الأقسام الفرعية"
|
|
278
|
+
"recursiveCategoryDeleteWarning": "انتباه! سيتم حذف جميع الأقسام الفرعية",
|
|
279
|
+
"unset": "إلغاء"
|
|
279
280
|
}
|
|
@@ -275,5 +275,6 @@
|
|
|
275
275
|
"seeAll": "See All",
|
|
276
276
|
"allowedExtensions": "Allowed extensions",
|
|
277
277
|
"recursiveCategoryDelete": "Delete this category and all its children",
|
|
278
|
-
"recursiveCategoryDeleteWarning": "Warning! All child items will be deleted as well"
|
|
278
|
+
"recursiveCategoryDeleteWarning": "Warning! All child items will be deleted as well",
|
|
279
|
+
"unset": "Unset"
|
|
279
280
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.24",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -105,56 +105,44 @@
|
|
|
105
105
|
"LICENSE"
|
|
106
106
|
],
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"@clack/prompts": "^0.10.0",
|
|
109
|
-
"@google-cloud/language": "^7.0.2",
|
|
110
|
-
"@t3-oss/env-nextjs": "^0.13.8",
|
|
111
108
|
"@trpc/server": "^11.4.2",
|
|
112
109
|
"axios": "^1.8.4",
|
|
113
110
|
"bcrypt": "^6.0.0",
|
|
114
111
|
"chalk": "^5.4.1",
|
|
115
112
|
"chokidar": "3.6.0",
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"dotenv": "^16.4.7",
|
|
113
|
+
"dayjs": "^1.11.19",
|
|
114
|
+
"dotenv": "^17.2.3",
|
|
119
115
|
"drizzle-orm": "^0.44.6",
|
|
120
|
-
"drizzle-zod": "^0.7.0",
|
|
121
116
|
"esbuild-register": "^3.6.0",
|
|
122
117
|
"glob": "^11.0.3",
|
|
123
|
-
"i18next": "^25.2.1",
|
|
124
118
|
"jose": "^6.0.11",
|
|
125
119
|
"jsonwebtoken": "^9.0.2",
|
|
126
120
|
"lodash-es": "^4.17.21",
|
|
127
121
|
"mysql2": "^3.12.0",
|
|
128
122
|
"next": "^15.5.5",
|
|
129
|
-
"next-intl": "^4.1.0",
|
|
130
|
-
"nodemailer": "^7.0.3",
|
|
131
123
|
"react": "19.0.0",
|
|
132
124
|
"react-dom": "19.0.0",
|
|
133
125
|
"superjson": "^2.2.2",
|
|
134
|
-
"
|
|
135
|
-
"zod
|
|
126
|
+
"through2": "^4.0.2",
|
|
127
|
+
"zod": "4.1.12"
|
|
136
128
|
},
|
|
137
129
|
"devDependencies": {
|
|
138
130
|
"@types/bcrypt": "^6.0.0",
|
|
139
131
|
"@types/jsonwebtoken": "^9.0.9",
|
|
140
132
|
"@types/lodash-es": "^4.17.12",
|
|
141
|
-
"@types/nodemailer": "^6.4.17",
|
|
142
133
|
"@types/react": "~19.0.0",
|
|
143
134
|
"@types/react-dom": "^19.0.0",
|
|
144
|
-
"
|
|
135
|
+
"@types/through2": "^2.0.41",
|
|
145
136
|
"dotenv-cli": "^7.4.4",
|
|
146
137
|
"drizzle-kit": "^0.31.5",
|
|
147
138
|
"eslint": "^9.12.0",
|
|
148
|
-
"i18n-js": "^4.5.1",
|
|
149
139
|
"nanoid": "^5.1.5",
|
|
150
140
|
"prettier": "^3.3.3",
|
|
151
|
-
"recast": "^0.23.11",
|
|
152
|
-
"tsup": "^8.3.6",
|
|
153
141
|
"tsx": "^4.20.6",
|
|
154
142
|
"typescript": "^5.9.2",
|
|
155
143
|
"@lzcms/eslint-config": "0.3.0",
|
|
156
|
-
"@lzcms/
|
|
157
|
-
"@lzcms/
|
|
144
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
145
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
158
146
|
},
|
|
159
147
|
"license": "MIT",
|
|
160
148
|
"keywords": [
|
|
@@ -171,7 +159,7 @@
|
|
|
171
159
|
"scripts": {
|
|
172
160
|
"build": "tsc",
|
|
173
161
|
"dev": "tsc",
|
|
174
|
-
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
|
162
|
+
"clean": "git clean -xdf .cache .turbo dist node_modules tsconfig.tsbuildinfo",
|
|
175
163
|
"typecheck": "tsc --noEmit"
|
|
176
164
|
}
|
|
177
165
|
}
|