nextjs-cms 0.5.100 → 0.5.101
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/api/index.d.ts +42 -4
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/lib/serverActions.d.ts +5 -5
- package/dist/api/lib/serverActions.d.ts.map +1 -1
- package/dist/api/lib/serverActions.js +60 -13
- package/dist/api/root.d.ts +84 -8
- package/dist/api/root.d.ts.map +1 -1
- package/dist/api/root.js +2 -0
- package/dist/api/routers/accountSettings.d.ts +7 -0
- package/dist/api/routers/accountSettings.d.ts.map +1 -1
- package/dist/api/routers/accountSettings.js +32 -0
- package/dist/api/routers/admins.js +2 -2
- package/dist/api/routers/categorySection.d.ts +1 -1
- package/dist/api/routers/config.d.ts +35 -0
- package/dist/api/routers/config.d.ts.map +1 -0
- package/dist/api/routers/config.js +14 -0
- package/dist/api/routers/hasItemsSection.d.ts +2 -2
- package/dist/api/routers/simpleSection.d.ts +1 -1
- package/dist/auth/lib/actions.d.ts +2 -1
- package/dist/auth/lib/actions.d.ts.map +1 -1
- package/dist/auth/lib/actions.js +19 -8
- package/dist/auth/react.d.ts +2 -1
- package/dist/auth/react.d.ts.map +1 -1
- package/dist/auth/react.js +5 -2
- package/dist/core/config/config-loader.d.ts +17 -0
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +54 -0
- package/dist/core/config/index.d.ts +3 -2
- package/dist/core/config/index.d.ts.map +1 -1
- package/dist/core/config/index.js +1 -1
- package/dist/core/factories/FieldFactory.d.ts +10 -3
- package/dist/core/factories/FieldFactory.d.ts.map +1 -1
- package/dist/core/factories/FieldFactory.js +28 -2
- package/dist/core/fields/checkbox.d.ts +3 -3
- package/dist/core/fields/color.d.ts +3 -3
- package/dist/core/fields/date.d.ts +3 -3
- package/dist/core/fields/document.d.ts +3 -3
- package/dist/core/fields/field.d.ts +4 -3
- package/dist/core/fields/field.d.ts.map +1 -1
- package/dist/core/fields/field.js +7 -1
- package/dist/core/fields/map.d.ts +3 -3
- package/dist/core/fields/number.d.ts +5 -5
- package/dist/core/fields/password.d.ts +3 -3
- package/dist/core/fields/photo.d.ts +3 -3
- package/dist/core/fields/richText.d.ts +5 -5
- package/dist/core/fields/select.d.ts +7 -7
- package/dist/core/fields/selectMultiple.d.ts +4 -4
- package/dist/core/fields/tags.d.ts +3 -3
- package/dist/core/fields/text.d.ts +3 -3
- package/dist/core/fields/textArea.d.ts +3 -3
- package/dist/core/fields/video.d.ts +3 -3
- package/dist/core/helpers/i18n.d.ts +2 -0
- package/dist/core/helpers/i18n.d.ts.map +1 -0
- package/dist/core/helpers/i18n.js +3 -0
- package/dist/core/localization.d.ts +40 -0
- package/dist/core/localization.d.ts.map +1 -0
- package/dist/core/localization.js +48 -0
- package/dist/core/sections/category.d.ts +21 -20
- package/dist/core/sections/category.d.ts.map +1 -1
- package/dist/core/sections/category.js +10 -3
- package/dist/core/sections/hasItems.d.ts +39 -38
- package/dist/core/sections/hasItems.d.ts.map +1 -1
- package/dist/core/sections/hasItems.js +10 -3
- package/dist/core/sections/section.d.ts +1 -1
- package/dist/core/sections/simple.d.ts +7 -6
- package/dist/core/sections/simple.d.ts.map +1 -1
- package/dist/core/sections/simple.js +4 -1
- package/dist/translations/client.d.ts +1 -1
- package/dist/translations/client.d.ts.map +1 -1
- package/dist/translations/client.js +1 -1
- package/dist/translations/dict-store.d.ts +12 -0
- package/dist/translations/dict-store.d.ts.map +1 -0
- package/dist/translations/dict-store.js +21 -0
- package/dist/translations/dictionaries/ar.d.ts +2 -0
- package/dist/translations/dictionaries/ar.d.ts.map +1 -1
- package/dist/translations/dictionaries/ar.js +2 -0
- package/dist/translations/dictionaries/en.d.ts +2 -0
- package/dist/translations/dictionaries/en.d.ts.map +1 -1
- package/dist/translations/dictionaries/en.js +2 -0
- package/dist/translations/index.d.ts +10 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +12 -6
- package/dist/translations/locale-cookie.d.ts +11 -0
- package/dist/translations/locale-cookie.d.ts.map +1 -0
- package/dist/translations/locale-cookie.js +15 -0
- package/dist/translations/locale-utils.d.ts +8 -0
- package/dist/translations/locale-utils.d.ts.map +1 -0
- package/dist/translations/locale-utils.js +11 -0
- package/dist/translations/localization.d.ts +40 -0
- package/dist/translations/localization.d.ts.map +1 -0
- package/dist/translations/localization.js +48 -0
- package/dist/translations/localized-string.d.ts +17 -0
- package/dist/translations/localized-string.d.ts.map +1 -0
- package/dist/translations/localized-string.js +32 -0
- package/dist/translations/types.d.ts +6 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/dist/translations/types.js +0 -0
- package/dist/translations/use-project-translation.d.ts +19 -0
- package/dist/translations/use-project-translation.d.ts.map +1 -0
- package/dist/translations/use-project-translation.js +25 -0
- package/package.json +11 -3
|
@@ -4,6 +4,7 @@ import { Section } from './section.js';
|
|
|
4
4
|
import type { TextFieldConfig } from '../fields/index.js';
|
|
5
5
|
import { entityKind } from '../helpers/index.js';
|
|
6
6
|
import type { FieldConfig } from '../fields/index.js';
|
|
7
|
+
import type { LocalizedString } from '../../translations/localization.js';
|
|
7
8
|
import * as z from 'zod';
|
|
8
9
|
declare const configSchema: z.ZodObject<{
|
|
9
10
|
headingField: z.ZodCustom<{
|
|
@@ -15,7 +16,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
15
16
|
maxLength?: number | undefined;
|
|
16
17
|
defaultValue?: string | undefined;
|
|
17
18
|
sanitize?: boolean | undefined;
|
|
18
|
-
label?: string | undefined;
|
|
19
|
+
label?: string | Record<string, string> | undefined;
|
|
19
20
|
required?: boolean | undefined;
|
|
20
21
|
order?: number | undefined;
|
|
21
22
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -29,16 +30,16 @@ declare const configSchema: z.ZodObject<{
|
|
|
29
30
|
maxLength?: number | undefined;
|
|
30
31
|
defaultValue?: string | undefined;
|
|
31
32
|
sanitize?: boolean | undefined;
|
|
32
|
-
label?: string | undefined;
|
|
33
|
+
label?: string | Record<string, string> | undefined;
|
|
33
34
|
required?: boolean | undefined;
|
|
34
35
|
order?: number | undefined;
|
|
35
36
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
36
37
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
37
38
|
}>;
|
|
38
39
|
title: z.ZodObject<{
|
|
39
|
-
section: z.ZodString
|
|
40
|
-
singular: z.ZodString
|
|
41
|
-
plural: z.ZodString
|
|
40
|
+
section: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
41
|
+
singular: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
42
|
+
plural: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
42
43
|
}, z.core.$strict>;
|
|
43
44
|
/**
|
|
44
45
|
* The depth of the category section is the number of nested levels of categories that can be created.
|
|
@@ -59,9 +60,9 @@ export declare class CategorySection extends Section<Config> {
|
|
|
59
60
|
static readonly [entityKind] = "CategorySection";
|
|
60
61
|
readonly type = "category";
|
|
61
62
|
readonly title: {
|
|
62
|
-
section:
|
|
63
|
-
singular:
|
|
64
|
-
plural:
|
|
63
|
+
section: LocalizedString;
|
|
64
|
+
singular: LocalizedString;
|
|
65
|
+
plural: LocalizedString;
|
|
65
66
|
};
|
|
66
67
|
readonly headingField: TextFieldConfig;
|
|
67
68
|
readonly depth: number;
|
|
@@ -78,7 +79,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
78
79
|
maxLength?: number | undefined;
|
|
79
80
|
defaultValue?: string | undefined;
|
|
80
81
|
sanitize?: boolean | undefined;
|
|
81
|
-
label?: string | undefined;
|
|
82
|
+
label?: string | Record<string, string> | undefined;
|
|
82
83
|
required?: boolean | undefined;
|
|
83
84
|
order?: number | undefined;
|
|
84
85
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -92,16 +93,16 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
92
93
|
maxLength?: number | undefined;
|
|
93
94
|
defaultValue?: string | undefined;
|
|
94
95
|
sanitize?: boolean | undefined;
|
|
95
|
-
label?: string | undefined;
|
|
96
|
+
label?: string | Record<string, string> | undefined;
|
|
96
97
|
required?: boolean | undefined;
|
|
97
98
|
order?: number | undefined;
|
|
98
99
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
99
100
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
100
101
|
}>;
|
|
101
102
|
title: z.ZodObject<{
|
|
102
|
-
section: z.ZodString
|
|
103
|
-
singular: z.ZodString
|
|
104
|
-
plural: z.ZodString
|
|
103
|
+
section: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
104
|
+
singular: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
105
|
+
plural: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
105
106
|
}, z.core.$strict>;
|
|
106
107
|
/**
|
|
107
108
|
* The depth of the category section is the number of nested levels of categories that can be created.
|
|
@@ -119,6 +120,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
119
120
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
120
121
|
name: z.ZodString;
|
|
121
122
|
order: z.ZodNumber;
|
|
123
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
122
124
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
123
125
|
db: z.ZodObject<{
|
|
124
126
|
table: z.ZodString;
|
|
@@ -143,7 +145,6 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
143
145
|
name: z.ZodOptional<z.ZodString>;
|
|
144
146
|
}, z.core.$strict>>>;
|
|
145
147
|
}, z.core.$strict>;
|
|
146
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
147
148
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
148
149
|
db: z.ZodObject<{
|
|
149
150
|
tableName: z.ZodString;
|
|
@@ -176,7 +177,7 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
176
177
|
maxLength?: number | undefined;
|
|
177
178
|
defaultValue?: string | undefined;
|
|
178
179
|
sanitize?: boolean | undefined;
|
|
179
|
-
label?: string | undefined;
|
|
180
|
+
label?: string | Record<string, string> | undefined;
|
|
180
181
|
required?: boolean | undefined;
|
|
181
182
|
order?: number | undefined;
|
|
182
183
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -190,16 +191,16 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
190
191
|
maxLength?: number | undefined;
|
|
191
192
|
defaultValue?: string | undefined;
|
|
192
193
|
sanitize?: boolean | undefined;
|
|
193
|
-
label?: string | undefined;
|
|
194
|
+
label?: string | Record<string, string> | undefined;
|
|
194
195
|
required?: boolean | undefined;
|
|
195
196
|
order?: number | undefined;
|
|
196
197
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
197
198
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
198
199
|
}>;
|
|
199
200
|
title: z.ZodObject<{
|
|
200
|
-
section: z.ZodString
|
|
201
|
-
singular: z.ZodString
|
|
202
|
-
plural: z.ZodString
|
|
201
|
+
section: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
202
|
+
singular: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
203
|
+
plural: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
203
204
|
}, z.core.$strict>;
|
|
204
205
|
/**
|
|
205
206
|
* The depth of the category section is the number of nested levels of categories that can be created.
|
|
@@ -216,6 +217,7 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
216
217
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
217
218
|
name: z.ZodString;
|
|
218
219
|
order: z.ZodNumber;
|
|
220
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
219
221
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
220
222
|
db: z.ZodObject<{
|
|
221
223
|
table: z.ZodString;
|
|
@@ -240,7 +242,6 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
240
242
|
name: z.ZodOptional<z.ZodString>;
|
|
241
243
|
}, z.core.$strict>>>;
|
|
242
244
|
}, z.core.$strict>;
|
|
243
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
244
245
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
245
246
|
db: z.ZodObject<{
|
|
246
247
|
tableName: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../src/core/sections/category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,OAAO,EAA8E,MAAM,cAAc,CAAA;AAClH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../src/core/sections/category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,OAAO,EAA8E,MAAM,cAAc,CAAA;AAClH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEzE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBd;;;;OAIG;;IAEH;;;;;OAKG;;kBAGL,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,eAAgB,SAAQ,OAAO,CAAC,MAAM,CAAC;IAChD,gBAAyB,CAAC,UAAU,CAAC,qBAAoB;IACzD,SAAkB,IAAI,cAAa;IACnC,SAAkB,KAAK,EAAE;QACrB,OAAO,EAAE,eAAe,CAAA;QACxB,QAAQ,EAAE,eAAe,CAAA;QACzB,MAAM,EAAE,eAAe,CAAA;KAC1B,CAAA;IACD,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAI;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAA;gBAE1B,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;CA2CjD;AAED,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA3Ef;;;;OAIG;;IAEH;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmEL,CAAA;AAOF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IArFpC;;;;OAIG;;IAEH;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFL,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAElE;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CA6CtF"}
|
|
@@ -8,9 +8,15 @@ const configSchema = z.strictObject({
|
|
|
8
8
|
.describe('Heading field must be a config - will be resolved during instantiation'),
|
|
9
9
|
title: z
|
|
10
10
|
.strictObject({
|
|
11
|
-
section: z
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
section: z
|
|
12
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
13
|
+
.describe('The section title. Can be a string or an object with language codes as keys (e.g., { en: "Categories", ar: "الفئات" })'),
|
|
14
|
+
singular: z
|
|
15
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
16
|
+
.describe('The singular form of the title. Can be a string or an object with language codes as keys'),
|
|
17
|
+
plural: z
|
|
18
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
19
|
+
.describe('The plural form of the title. Can be a string or an object with language codes as keys'),
|
|
14
20
|
})
|
|
15
21
|
.describe('The title configuration for the category section'),
|
|
16
22
|
/**
|
|
@@ -38,6 +44,7 @@ export class CategorySection extends Section {
|
|
|
38
44
|
// private requirePublishPermission: boolean
|
|
39
45
|
constructor(config) {
|
|
40
46
|
super(config);
|
|
47
|
+
// Store the raw title (can be string or localized object)
|
|
41
48
|
this.title = config.title;
|
|
42
49
|
this.depth = config.depth ?? 1;
|
|
43
50
|
this.headingField = config.headingField;
|
|
@@ -4,6 +4,7 @@ import type { BaseSectionOptions } from './section.js';
|
|
|
4
4
|
import type { FieldGroupConfig } from '../fields/field-group.js';
|
|
5
5
|
import { Section } from './section.js';
|
|
6
6
|
import type { FieldConfig } from '../fields/index.js';
|
|
7
|
+
import type { LocalizedString } from '../../translations/localization.js';
|
|
7
8
|
import * as z from 'zod';
|
|
8
9
|
declare const configSchema: z.ZodObject<{
|
|
9
10
|
headingField: z.ZodCustom<{
|
|
@@ -15,7 +16,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
15
16
|
maxLength?: number | undefined;
|
|
16
17
|
defaultValue?: string | undefined;
|
|
17
18
|
sanitize?: boolean | undefined;
|
|
18
|
-
label?: string | undefined;
|
|
19
|
+
label?: string | Record<string, string> | undefined;
|
|
19
20
|
required?: boolean | undefined;
|
|
20
21
|
order?: number | undefined;
|
|
21
22
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -31,7 +32,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
31
32
|
minLength?: undefined;
|
|
32
33
|
maxLength?: undefined;
|
|
33
34
|
defaultValue?: undefined;
|
|
34
|
-
label?: string | undefined;
|
|
35
|
+
label?: string | Record<string, string> | undefined;
|
|
35
36
|
required?: boolean | undefined;
|
|
36
37
|
order?: number | undefined;
|
|
37
38
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -46,7 +47,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
46
47
|
minLength?: number | undefined;
|
|
47
48
|
maxLength?: number | undefined;
|
|
48
49
|
defaultValue?: number | undefined;
|
|
49
|
-
label?: string | undefined;
|
|
50
|
+
label?: string | Record<string, string> | undefined;
|
|
50
51
|
required?: boolean | undefined;
|
|
51
52
|
order?: number | undefined;
|
|
52
53
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -62,7 +63,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
62
63
|
maxLength?: number | undefined;
|
|
63
64
|
defaultValue?: string | undefined;
|
|
64
65
|
sanitize?: boolean | undefined;
|
|
65
|
-
label?: string | undefined;
|
|
66
|
+
label?: string | Record<string, string> | undefined;
|
|
66
67
|
required?: boolean | undefined;
|
|
67
68
|
order?: number | undefined;
|
|
68
69
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -78,7 +79,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
78
79
|
minLength?: undefined;
|
|
79
80
|
maxLength?: undefined;
|
|
80
81
|
defaultValue?: undefined;
|
|
81
|
-
label?: string | undefined;
|
|
82
|
+
label?: string | Record<string, string> | undefined;
|
|
82
83
|
required?: boolean | undefined;
|
|
83
84
|
order?: number | undefined;
|
|
84
85
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -93,7 +94,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
93
94
|
minLength?: number | undefined;
|
|
94
95
|
maxLength?: number | undefined;
|
|
95
96
|
defaultValue?: number | undefined;
|
|
96
|
-
label?: string | undefined;
|
|
97
|
+
label?: string | Record<string, string> | undefined;
|
|
97
98
|
required?: boolean | undefined;
|
|
98
99
|
order?: number | undefined;
|
|
99
100
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -102,9 +103,9 @@ declare const configSchema: z.ZodObject<{
|
|
|
102
103
|
build: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodCustom<import("../index.js").NumberField, import("../index.js").NumberField>>;
|
|
103
104
|
})>;
|
|
104
105
|
title: z.ZodObject<{
|
|
105
|
-
section: z.ZodString
|
|
106
|
-
singular: z.ZodString
|
|
107
|
-
plural: z.ZodString
|
|
106
|
+
section: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
107
|
+
singular: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
108
|
+
plural: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
108
109
|
}, z.core.$strict>;
|
|
109
110
|
requirePublishPermission: z.ZodOptional<z.ZodBoolean>;
|
|
110
111
|
search: z.ZodOptional<z.ZodObject<{
|
|
@@ -136,7 +137,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
136
137
|
} | undefined;
|
|
137
138
|
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
138
139
|
removeExtension?: boolean | undefined;
|
|
139
|
-
label?: string | undefined;
|
|
140
|
+
label?: string | Record<string, string> | undefined;
|
|
140
141
|
required?: boolean | undefined;
|
|
141
142
|
defaultValue?: any;
|
|
142
143
|
order?: number | undefined;
|
|
@@ -165,7 +166,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
165
166
|
} | undefined;
|
|
166
167
|
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
167
168
|
removeExtension?: boolean | undefined;
|
|
168
|
-
label?: string | undefined;
|
|
169
|
+
label?: string | Record<string, string> | undefined;
|
|
169
170
|
required?: boolean | undefined;
|
|
170
171
|
defaultValue?: any;
|
|
171
172
|
order?: number | undefined;
|
|
@@ -180,9 +181,9 @@ export declare class HasItemsSection extends Section<Config> {
|
|
|
180
181
|
readonly type = "has_items";
|
|
181
182
|
headingField: TextFieldConfig | NumberFieldConfigType;
|
|
182
183
|
title: {
|
|
183
|
-
section:
|
|
184
|
-
singular:
|
|
185
|
-
plural:
|
|
184
|
+
section: LocalizedString;
|
|
185
|
+
singular: LocalizedString;
|
|
186
|
+
plural: LocalizedString;
|
|
186
187
|
};
|
|
187
188
|
requirePublishPermission: boolean;
|
|
188
189
|
search?: {
|
|
@@ -209,7 +210,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
209
210
|
maxLength?: number | undefined;
|
|
210
211
|
defaultValue?: string | undefined;
|
|
211
212
|
sanitize?: boolean | undefined;
|
|
212
|
-
label?: string | undefined;
|
|
213
|
+
label?: string | Record<string, string> | undefined;
|
|
213
214
|
required?: boolean | undefined;
|
|
214
215
|
order?: number | undefined;
|
|
215
216
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -225,7 +226,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
225
226
|
minLength?: undefined;
|
|
226
227
|
maxLength?: undefined;
|
|
227
228
|
defaultValue?: undefined;
|
|
228
|
-
label?: string | undefined;
|
|
229
|
+
label?: string | Record<string, string> | undefined;
|
|
229
230
|
required?: boolean | undefined;
|
|
230
231
|
order?: number | undefined;
|
|
231
232
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -240,7 +241,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
240
241
|
minLength?: number | undefined;
|
|
241
242
|
maxLength?: number | undefined;
|
|
242
243
|
defaultValue?: number | undefined;
|
|
243
|
-
label?: string | undefined;
|
|
244
|
+
label?: string | Record<string, string> | undefined;
|
|
244
245
|
required?: boolean | undefined;
|
|
245
246
|
order?: number | undefined;
|
|
246
247
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -256,7 +257,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
256
257
|
maxLength?: number | undefined;
|
|
257
258
|
defaultValue?: string | undefined;
|
|
258
259
|
sanitize?: boolean | undefined;
|
|
259
|
-
label?: string | undefined;
|
|
260
|
+
label?: string | Record<string, string> | undefined;
|
|
260
261
|
required?: boolean | undefined;
|
|
261
262
|
order?: number | undefined;
|
|
262
263
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -272,7 +273,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
272
273
|
minLength?: undefined;
|
|
273
274
|
maxLength?: undefined;
|
|
274
275
|
defaultValue?: undefined;
|
|
275
|
-
label?: string | undefined;
|
|
276
|
+
label?: string | Record<string, string> | undefined;
|
|
276
277
|
required?: boolean | undefined;
|
|
277
278
|
order?: number | undefined;
|
|
278
279
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -287,7 +288,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
287
288
|
minLength?: number | undefined;
|
|
288
289
|
maxLength?: number | undefined;
|
|
289
290
|
defaultValue?: number | undefined;
|
|
290
|
-
label?: string | undefined;
|
|
291
|
+
label?: string | Record<string, string> | undefined;
|
|
291
292
|
required?: boolean | undefined;
|
|
292
293
|
order?: number | undefined;
|
|
293
294
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -296,9 +297,9 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
296
297
|
build: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodCustom<import("../index.js").NumberField, import("../index.js").NumberField>>;
|
|
297
298
|
})>;
|
|
298
299
|
title: z.ZodObject<{
|
|
299
|
-
section: z.ZodString
|
|
300
|
-
singular: z.ZodString
|
|
301
|
-
plural: z.ZodString
|
|
300
|
+
section: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
301
|
+
singular: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
302
|
+
plural: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
302
303
|
}, z.core.$strict>;
|
|
303
304
|
requirePublishPermission: z.ZodOptional<z.ZodBoolean>;
|
|
304
305
|
search: z.ZodOptional<z.ZodObject<{
|
|
@@ -330,7 +331,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
330
331
|
} | undefined;
|
|
331
332
|
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
332
333
|
removeExtension?: boolean | undefined;
|
|
333
|
-
label?: string | undefined;
|
|
334
|
+
label?: string | Record<string, string> | undefined;
|
|
334
335
|
required?: boolean | undefined;
|
|
335
336
|
defaultValue?: any;
|
|
336
337
|
order?: number | undefined;
|
|
@@ -359,7 +360,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
359
360
|
} | undefined;
|
|
360
361
|
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
361
362
|
removeExtension?: boolean | undefined;
|
|
362
|
-
label?: string | undefined;
|
|
363
|
+
label?: string | Record<string, string> | undefined;
|
|
363
364
|
required?: boolean | undefined;
|
|
364
365
|
defaultValue?: any;
|
|
365
366
|
order?: number | undefined;
|
|
@@ -370,6 +371,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
370
371
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
371
372
|
name: z.ZodString;
|
|
372
373
|
order: z.ZodNumber;
|
|
374
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
373
375
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
374
376
|
db: z.ZodObject<{
|
|
375
377
|
table: z.ZodString;
|
|
@@ -394,7 +396,6 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
394
396
|
name: z.ZodOptional<z.ZodString>;
|
|
395
397
|
}, z.core.$strict>>>;
|
|
396
398
|
}, z.core.$strict>;
|
|
397
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
398
399
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
399
400
|
db: z.ZodObject<{
|
|
400
401
|
tableName: z.ZodString;
|
|
@@ -427,7 +428,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
427
428
|
maxLength?: number | undefined;
|
|
428
429
|
defaultValue?: string | undefined;
|
|
429
430
|
sanitize?: boolean | undefined;
|
|
430
|
-
label?: string | undefined;
|
|
431
|
+
label?: string | Record<string, string> | undefined;
|
|
431
432
|
required?: boolean | undefined;
|
|
432
433
|
order?: number | undefined;
|
|
433
434
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -443,7 +444,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
443
444
|
minLength?: undefined;
|
|
444
445
|
maxLength?: undefined;
|
|
445
446
|
defaultValue?: undefined;
|
|
446
|
-
label?: string | undefined;
|
|
447
|
+
label?: string | Record<string, string> | undefined;
|
|
447
448
|
required?: boolean | undefined;
|
|
448
449
|
order?: number | undefined;
|
|
449
450
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -458,7 +459,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
458
459
|
minLength?: number | undefined;
|
|
459
460
|
maxLength?: number | undefined;
|
|
460
461
|
defaultValue?: number | undefined;
|
|
461
|
-
label?: string | undefined;
|
|
462
|
+
label?: string | Record<string, string> | undefined;
|
|
462
463
|
required?: boolean | undefined;
|
|
463
464
|
order?: number | undefined;
|
|
464
465
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -474,7 +475,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
474
475
|
maxLength?: number | undefined;
|
|
475
476
|
defaultValue?: string | undefined;
|
|
476
477
|
sanitize?: boolean | undefined;
|
|
477
|
-
label?: string | undefined;
|
|
478
|
+
label?: string | Record<string, string> | undefined;
|
|
478
479
|
required?: boolean | undefined;
|
|
479
480
|
order?: number | undefined;
|
|
480
481
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -490,7 +491,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
490
491
|
minLength?: undefined;
|
|
491
492
|
maxLength?: undefined;
|
|
492
493
|
defaultValue?: undefined;
|
|
493
|
-
label?: string | undefined;
|
|
494
|
+
label?: string | Record<string, string> | undefined;
|
|
494
495
|
required?: boolean | undefined;
|
|
495
496
|
order?: number | undefined;
|
|
496
497
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -505,7 +506,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
505
506
|
minLength?: number | undefined;
|
|
506
507
|
maxLength?: number | undefined;
|
|
507
508
|
defaultValue?: number | undefined;
|
|
508
|
-
label?: string | undefined;
|
|
509
|
+
label?: string | Record<string, string> | undefined;
|
|
509
510
|
required?: boolean | undefined;
|
|
510
511
|
order?: number | undefined;
|
|
511
512
|
conditionalRules?: import("../types/index.js").ConditionalRule[] | undefined;
|
|
@@ -514,9 +515,9 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
514
515
|
build: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodCustom<import("../index.js").NumberField, import("../index.js").NumberField>>;
|
|
515
516
|
})>;
|
|
516
517
|
title: z.ZodObject<{
|
|
517
|
-
section: z.ZodString
|
|
518
|
-
singular: z.ZodString
|
|
519
|
-
plural: z.ZodString
|
|
518
|
+
section: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
519
|
+
singular: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
520
|
+
plural: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
520
521
|
}, z.core.$strict>;
|
|
521
522
|
requirePublishPermission: z.ZodOptional<z.ZodBoolean>;
|
|
522
523
|
search: z.ZodOptional<z.ZodObject<{
|
|
@@ -548,7 +549,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
548
549
|
} | undefined;
|
|
549
550
|
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
550
551
|
removeExtension?: boolean | undefined;
|
|
551
|
-
label?: string | undefined;
|
|
552
|
+
label?: string | Record<string, string> | undefined;
|
|
552
553
|
required?: boolean | undefined;
|
|
553
554
|
defaultValue?: any;
|
|
554
555
|
order?: number | undefined;
|
|
@@ -577,7 +578,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
577
578
|
} | undefined;
|
|
578
579
|
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
579
580
|
removeExtension?: boolean | undefined;
|
|
580
|
-
label?: string | undefined;
|
|
581
|
+
label?: string | Record<string, string> | undefined;
|
|
581
582
|
required?: boolean | undefined;
|
|
582
583
|
defaultValue?: any;
|
|
583
584
|
order?: number | undefined;
|
|
@@ -587,6 +588,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
587
588
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
588
589
|
name: z.ZodString;
|
|
589
590
|
order: z.ZodNumber;
|
|
591
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
590
592
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
591
593
|
db: z.ZodObject<{
|
|
592
594
|
table: z.ZodString;
|
|
@@ -611,7 +613,6 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
611
613
|
name: z.ZodOptional<z.ZodString>;
|
|
612
614
|
}, z.core.$strict>>>;
|
|
613
615
|
}, z.core.$strict>;
|
|
614
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
615
616
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
616
617
|
db: z.ZodObject<{
|
|
617
618
|
tableName: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasItems.d.ts","sourceRoot":"","sources":["../../../src/core/sections/hasItems.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACtG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,OAAO,EAA8E,MAAM,cAAc,CAAA;AAClH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"hasItems.d.ts","sourceRoot":"","sources":["../../../src/core/sections/hasItems.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACtG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,OAAO,EAA8E,MAAM,cAAc,CAAA;AAClH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGzE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmDhB,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,eAAgB,SAAQ,OAAO,CAAC,MAAM,CAAC;IAChD,gBAAyB,CAAC,UAAU,CAAC,qBAAoB;IACzD,SAAkB,IAAI,eAAc;IACpC,YAAY,EAAE,eAAe,GAAG,qBAAqB,CAAA;IAC5C,KAAK,EAAE;QAAE,OAAO,EAAE,eAAe,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,CAAA;IAChG,wBAAwB,EAAE,OAAO,CAAA;IACjC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,GAAG,SAAS,CAAA;IACtE;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,GAAG,SAAS,CAAA;IAChE,eAAe,CAAC,EAAE,oBAAoB,CAAA;IACtC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;gBAGpB,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;CAYjD;AAED,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGjB,CAAA;AAOF,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQ/B,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAElE;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAmEtF"}
|
|
@@ -9,9 +9,15 @@ const configSchema = z.strictObject({
|
|
|
9
9
|
.describe('Heading field must be a config - will be resolved during instantiation'),
|
|
10
10
|
title: z
|
|
11
11
|
.strictObject({
|
|
12
|
-
section: z
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
section: z
|
|
13
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
14
|
+
.describe('The section title. Can be a string or an object with language codes as keys (e.g., { en: "Articles", ar: "المقالات" })'),
|
|
15
|
+
singular: z
|
|
16
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
17
|
+
.describe('The singular form of the title. Can be a string or an object with language codes as keys'),
|
|
18
|
+
plural: z
|
|
19
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
20
|
+
.describe('The plural form of the title. Can be a string or an object with language codes as keys'),
|
|
15
21
|
})
|
|
16
22
|
.describe('The title configuration for the has items section'),
|
|
17
23
|
requirePublishPermission: z.boolean().optional().describe('Require publish permission'),
|
|
@@ -59,6 +65,7 @@ export class HasItemsSection extends Section {
|
|
|
59
65
|
constructor(config) {
|
|
60
66
|
super(config);
|
|
61
67
|
this.headingField = config.headingField;
|
|
68
|
+
// Store the raw title (can be string or localized object)
|
|
62
69
|
this.title = config.title;
|
|
63
70
|
this.requirePublishPermission = config.requirePublishPermission ?? false;
|
|
64
71
|
this.search = config.search;
|
|
@@ -64,6 +64,7 @@ export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
|
64
64
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
65
65
|
name: z.ZodString;
|
|
66
66
|
order: z.ZodNumber;
|
|
67
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
67
68
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
68
69
|
db: z.ZodObject<{
|
|
69
70
|
table: z.ZodString;
|
|
@@ -88,7 +89,6 @@ export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
|
88
89
|
name: z.ZodOptional<z.ZodString>;
|
|
89
90
|
}, z.core.$strict>>>;
|
|
90
91
|
}, z.core.$strict>;
|
|
91
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
92
92
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
93
93
|
db: z.ZodObject<{
|
|
94
94
|
tableName: z.ZodString;
|
|
@@ -2,9 +2,10 @@ import { entityKind } from '../helpers/index.js';
|
|
|
2
2
|
import type { BaseSectionOptions } from './section.js';
|
|
3
3
|
import { Section } from './section.js';
|
|
4
4
|
import type { FieldGroupConfig, FieldConfig } from '../fields/index.js';
|
|
5
|
+
import type { LocalizedString } from '../../translations/localization.js';
|
|
5
6
|
import * as z from 'zod';
|
|
6
7
|
declare const configSchema: z.ZodObject<{
|
|
7
|
-
title: z.ZodString
|
|
8
|
+
title: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
8
9
|
db: z.ZodObject<{
|
|
9
10
|
table: z.ZodString;
|
|
10
11
|
}, z.core.$strict>;
|
|
@@ -13,19 +14,19 @@ type Config = z.infer<typeof configSchema>;
|
|
|
13
14
|
export declare class SimpleSection extends Section<Config> {
|
|
14
15
|
static readonly [entityKind] = "SimpleSection";
|
|
15
16
|
readonly type = "simple";
|
|
16
|
-
title:
|
|
17
|
+
title: LocalizedString;
|
|
17
18
|
constructor(config: BaseSectionOptions<Config>);
|
|
18
19
|
}
|
|
19
20
|
declare const optionsSchema: z.ZodObject<{
|
|
20
|
-
title: z.ZodString
|
|
21
|
+
title: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
21
22
|
db: z.ZodObject<{
|
|
22
23
|
table: z.ZodString;
|
|
23
24
|
}, z.core.$strict>;
|
|
24
25
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
25
26
|
name: z.ZodString;
|
|
26
27
|
order: z.ZodNumber;
|
|
27
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
28
28
|
icon: z.ZodOptional<z.ZodString>;
|
|
29
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
29
30
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
30
31
|
db: z.ZodObject<{
|
|
31
32
|
tableName: z.ZodString;
|
|
@@ -49,14 +50,14 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
49
50
|
fields: z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
50
51
|
build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<SimpleSection, SimpleSection>>;
|
|
51
52
|
fieldGroups: z.ZodOptional<z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>>;
|
|
52
|
-
title: z.ZodString
|
|
53
|
+
title: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
53
54
|
db: z.ZodObject<{
|
|
54
55
|
table: z.ZodString;
|
|
55
56
|
}, z.core.$strict>;
|
|
56
57
|
name: z.ZodString;
|
|
57
58
|
order: z.ZodNumber;
|
|
58
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
59
59
|
icon: z.ZodOptional<z.ZodString>;
|
|
60
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
60
61
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
61
62
|
db: z.ZodObject<{
|
|
62
63
|
tableName: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../src/core/sections/simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,OAAO,EAAmC,MAAM,cAAc,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;;;;;
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../src/core/sections/simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,OAAO,EAAmC,MAAM,cAAc,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;;;;;kBAqBhB,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,aAAc,SAAQ,OAAO,CAAC,MAAM,CAAC;IAC9C,gBAAyB,CAAC,UAAU,CAAC,mBAAkB;IACvD,SAAkB,IAAI,YAAW;IACxB,KAAK,EAAE,eAAe,CAAA;gBAEnB,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;CAKjD;AAED,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGjB,CAAA;AAOF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK7B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEhE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA6ChF"}
|
|
@@ -3,7 +3,9 @@ import { Section, baseHelperFunctionOptionsSchema } from './section.js';
|
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import { FieldGroupConfigSchema, fieldConfigSchema } from './section.js';
|
|
5
5
|
const configSchema = z.strictObject({
|
|
6
|
-
title: z
|
|
6
|
+
title: z
|
|
7
|
+
.union([z.string(), z.record(z.string(), z.string())])
|
|
8
|
+
.describe('The title of the section. Can be a string or an object with language codes as keys (e.g., { en: "Settings", ar: "الإعدادات" })'),
|
|
7
9
|
db: z
|
|
8
10
|
.strictObject({
|
|
9
11
|
table: z
|
|
@@ -21,6 +23,7 @@ export class SimpleSection extends Section {
|
|
|
21
23
|
title;
|
|
22
24
|
constructor(config) {
|
|
23
25
|
super(config);
|
|
26
|
+
// Store the raw title (can be string or localized object)
|
|
24
27
|
this.title = config.title;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useI18n: any, useScopedI18n: any, I18nProviderClient: any;
|
|
1
|
+
export declare const useI18n: any, useScopedI18n: any, useCurrentLocale: any, I18nProviderClient: any;
|
|
2
2
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/translations/client.ts"],"names":[],"mappings":"AAGA,eAAO,MAAQ,OAAO,OAAE,aAAa,OAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/translations/client.ts"],"names":[],"mappings":"AAGA,eAAO,MAAQ,OAAO,OAAE,aAAa,OAAE,gBAAgB,OAAE,kBAAkB,KAUzE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createI18nClient } from 'next-international/client';
|
|
3
|
-
export const { useI18n, useScopedI18n, I18nProviderClient } = createI18nClient({
|
|
3
|
+
export const { useI18n, useScopedI18n, useCurrentLocale, I18nProviderClient } = createI18nClient({
|
|
4
4
|
en: () => import('./dictionaries/en.js'),
|
|
5
5
|
ar: () => import('./dictionaries/ar.js')
|
|
6
6
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TranslationDictionary } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set dictionaries from config (supportedLanguages record).
|
|
4
|
+
* Called by config loader when user provides i18n.supportedLanguages.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setConfigDicts(dicts: Record<string, TranslationDictionary>): void;
|
|
7
|
+
/**
|
|
8
|
+
* Get the dictionary for a locale. Used by getString.
|
|
9
|
+
* Falls back to 'en' from store, then to built-in en.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getDict(locale: string): TranslationDictionary;
|
|
12
|
+
//# sourceMappingURL=dict-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dict-store.d.ts","sourceRoot":"","sources":["../../src/translations/dict-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AASvD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,IAAI,CAEjF;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,CAE7D"}
|