nextjs-cms 0.6.1 → 0.6.3
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/lib/serverActions.d.ts.map +1 -1
- package/dist/api/lib/serverActions.js +18 -12
- package/dist/api/trpc/server.d.ts +2 -2
- package/dist/api/trpc/server.d.ts.map +1 -1
- package/dist/api/trpc.d.ts.map +1 -1
- package/dist/api/trpc.js +5 -0
- package/dist/auth/react.d.ts.map +1 -1
- package/dist/auth/react.js +9 -0
- package/dist/core/config/config-loader.d.ts +18 -0
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +32 -0
- package/dist/core/fields/photo.d.ts +6 -6
- package/dist/core/fields/richText.d.ts +9 -9
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/sections/category.d.ts +38 -38
- package/dist/core/sections/hasItems.d.ts +44 -44
- package/dist/core/sections/section.d.ts +19 -19
- package/dist/core/sections/simple.d.ts +8 -8
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +0 -1
- package/dist/plugins/loader.d.ts +20 -3
- package/dist/plugins/loader.d.ts.map +1 -1
- package/dist/plugins/loader.js +38 -3
- package/dist/translations/dictionaries/ar.d.ts +11 -0
- package/dist/translations/dictionaries/ar.d.ts.map +1 -1
- package/dist/translations/dictionaries/ar.js +361 -350
- package/dist/translations/dictionaries/en.d.ts +11 -0
- package/dist/translations/dictionaries/en.d.ts.map +1 -1
- package/dist/translations/dictionaries/en.js +361 -350
- package/dist/translations/index.d.ts +1 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +1 -1
- package/dist/translations/locale-cookie.d.ts +13 -0
- package/dist/translations/locale-cookie.d.ts.map +1 -1
- package/dist/translations/locale-cookie.js +29 -0
- package/package.json +7 -7
|
@@ -135,7 +135,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
135
135
|
size: number;
|
|
136
136
|
unit: "kb" | "mb";
|
|
137
137
|
} | undefined;
|
|
138
|
-
fileType?: ("
|
|
138
|
+
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
139
139
|
removeExtension?: boolean | undefined;
|
|
140
140
|
label?: string | Record<string, string> | undefined;
|
|
141
141
|
required?: boolean | undefined;
|
|
@@ -164,7 +164,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
164
164
|
size: number;
|
|
165
165
|
unit: "kb" | "mb";
|
|
166
166
|
} | undefined;
|
|
167
|
-
fileType?: ("
|
|
167
|
+
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
168
168
|
removeExtension?: boolean | undefined;
|
|
169
169
|
label?: string | Record<string, string> | undefined;
|
|
170
170
|
required?: boolean | undefined;
|
|
@@ -329,7 +329,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
329
329
|
size: number;
|
|
330
330
|
unit: "kb" | "mb";
|
|
331
331
|
} | undefined;
|
|
332
|
-
fileType?: ("
|
|
332
|
+
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
333
333
|
removeExtension?: boolean | undefined;
|
|
334
334
|
label?: string | Record<string, string> | undefined;
|
|
335
335
|
required?: boolean | undefined;
|
|
@@ -358,7 +358,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
358
358
|
size: number;
|
|
359
359
|
unit: "kb" | "mb";
|
|
360
360
|
} | undefined;
|
|
361
|
-
fileType?: ("
|
|
361
|
+
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
362
362
|
removeExtension?: boolean | undefined;
|
|
363
363
|
label?: string | Record<string, string> | undefined;
|
|
364
364
|
required?: boolean | undefined;
|
|
@@ -369,10 +369,24 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
369
369
|
}>>;
|
|
370
370
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
371
371
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
372
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
373
372
|
name: z.ZodString;
|
|
374
|
-
|
|
375
|
-
|
|
373
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
374
|
+
db: z.ZodObject<{
|
|
375
|
+
tableName: z.ZodString;
|
|
376
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
377
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
378
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
379
|
+
}, z.core.$strict>;
|
|
380
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
381
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
382
|
+
width: z.ZodNumber;
|
|
383
|
+
height: z.ZodNumber;
|
|
384
|
+
crop: z.ZodBoolean;
|
|
385
|
+
quality: z.ZodNumber;
|
|
386
|
+
}, z.core.$strict>>;
|
|
387
|
+
}, z.core.$strict>>;
|
|
388
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
389
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
376
390
|
db: z.ZodObject<{
|
|
377
391
|
table: z.ZodString;
|
|
378
392
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -396,22 +410,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
396
410
|
name: z.ZodOptional<z.ZodString>;
|
|
397
411
|
}, z.core.$strict>>>;
|
|
398
412
|
}, z.core.$strict>;
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
db: z.ZodObject<{
|
|
402
|
-
tableName: z.ZodString;
|
|
403
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
404
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
405
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
406
|
-
}, z.core.$strict>;
|
|
407
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
409
|
-
width: z.ZodNumber;
|
|
410
|
-
height: z.ZodNumber;
|
|
411
|
-
crop: z.ZodBoolean;
|
|
412
|
-
quality: z.ZodNumber;
|
|
413
|
-
}, z.core.$strict>>;
|
|
414
|
-
}, z.core.$strict>>;
|
|
413
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
414
|
+
order: z.ZodNumber;
|
|
415
415
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
416
416
|
}, z.core.$strict>;
|
|
417
417
|
declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
@@ -547,7 +547,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
547
547
|
size: number;
|
|
548
548
|
unit: "kb" | "mb";
|
|
549
549
|
} | undefined;
|
|
550
|
-
fileType?: ("
|
|
550
|
+
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
551
551
|
removeExtension?: boolean | undefined;
|
|
552
552
|
label?: string | Record<string, string> | undefined;
|
|
553
553
|
required?: boolean | undefined;
|
|
@@ -576,7 +576,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
576
576
|
size: number;
|
|
577
577
|
unit: "kb" | "mb";
|
|
578
578
|
} | undefined;
|
|
579
|
-
fileType?: ("
|
|
579
|
+
fileType?: ("webp" | "jpg" | "jpeg" | "png")[] | undefined;
|
|
580
580
|
removeExtension?: boolean | undefined;
|
|
581
581
|
label?: string | Record<string, string> | undefined;
|
|
582
582
|
required?: boolean | undefined;
|
|
@@ -586,10 +586,24 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
586
586
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
587
587
|
}>>;
|
|
588
588
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
589
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
590
589
|
name: z.ZodString;
|
|
591
|
-
|
|
592
|
-
|
|
590
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
591
|
+
db: z.ZodObject<{
|
|
592
|
+
tableName: z.ZodString;
|
|
593
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
594
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
595
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
596
|
+
}, z.core.$strict>;
|
|
597
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
598
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
599
|
+
width: z.ZodNumber;
|
|
600
|
+
height: z.ZodNumber;
|
|
601
|
+
crop: z.ZodBoolean;
|
|
602
|
+
quality: z.ZodNumber;
|
|
603
|
+
}, z.core.$strict>>;
|
|
604
|
+
}, z.core.$strict>>;
|
|
605
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
606
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
593
607
|
db: z.ZodObject<{
|
|
594
608
|
table: z.ZodString;
|
|
595
609
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -613,22 +627,8 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
613
627
|
name: z.ZodOptional<z.ZodString>;
|
|
614
628
|
}, z.core.$strict>>>;
|
|
615
629
|
}, z.core.$strict>;
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
db: z.ZodObject<{
|
|
619
|
-
tableName: z.ZodString;
|
|
620
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
621
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
622
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
623
|
-
}, z.core.$strict>;
|
|
624
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
625
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
626
|
-
width: z.ZodNumber;
|
|
627
|
-
height: z.ZodNumber;
|
|
628
|
-
crop: z.ZodBoolean;
|
|
629
|
-
quality: z.ZodNumber;
|
|
630
|
-
}, z.core.$strict>>;
|
|
631
|
-
}, z.core.$strict>>;
|
|
630
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
631
|
+
order: z.ZodNumber;
|
|
632
632
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
633
633
|
}, z.core.$strict>;
|
|
634
634
|
export type HasItemsSectionOptions = z.infer<typeof optionsSchema>;
|
|
@@ -62,10 +62,24 @@ 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
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
66
65
|
name: z.ZodString;
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
db: z.ZodObject<{
|
|
68
|
+
tableName: z.ZodString;
|
|
69
|
+
identifierField: z.ZodOptional<z.ZodString>;
|
|
70
|
+
photoNameField: z.ZodOptional<z.ZodString>;
|
|
71
|
+
metaField: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
width: z.ZodNumber;
|
|
76
|
+
height: z.ZodNumber;
|
|
77
|
+
crop: z.ZodBoolean;
|
|
78
|
+
quality: z.ZodNumber;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
82
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
69
83
|
db: z.ZodObject<{
|
|
70
84
|
table: z.ZodString;
|
|
71
85
|
identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
|
|
@@ -89,22 +103,8 @@ export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
|
89
103
|
name: z.ZodOptional<z.ZodString>;
|
|
90
104
|
}, z.core.$strict>>>;
|
|
91
105
|
}, z.core.$strict>;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
db: z.ZodObject<{
|
|
95
|
-
tableName: z.ZodString;
|
|
96
|
-
identifierField: z.ZodOptional<z.ZodString>;
|
|
97
|
-
photoNameField: z.ZodOptional<z.ZodString>;
|
|
98
|
-
metaField: z.ZodOptional<z.ZodString>;
|
|
99
|
-
}, z.core.$strict>;
|
|
100
|
-
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
-
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
102
|
-
width: z.ZodNumber;
|
|
103
|
-
height: z.ZodNumber;
|
|
104
|
-
crop: z.ZodBoolean;
|
|
105
|
-
quality: z.ZodNumber;
|
|
106
|
-
}, z.core.$strict>>;
|
|
107
|
-
}, z.core.$strict>>;
|
|
106
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<Variant, Variant>>>;
|
|
107
|
+
order: z.ZodNumber;
|
|
108
108
|
hooks: z.ZodOptional<z.ZodCustom<Hooks, Hooks>>;
|
|
109
109
|
}, z.core.$strict>;
|
|
110
110
|
export declare function validateSectionConfig(config: BaseSectionOptions): void;
|
|
@@ -23,11 +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
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
30
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
31
27
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
32
28
|
db: z.ZodObject<{
|
|
33
29
|
tableName: z.ZodString;
|
|
@@ -43,6 +39,10 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
43
39
|
quality: z.ZodNumber;
|
|
44
40
|
}, z.core.$strict>>;
|
|
45
41
|
}, z.core.$strict>>;
|
|
42
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
43
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
44
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
45
|
+
order: z.ZodNumber;
|
|
46
46
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
47
47
|
}, z.core.$strict>;
|
|
48
48
|
declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
@@ -54,11 +54,7 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
54
54
|
db: z.ZodObject<{
|
|
55
55
|
table: z.ZodString;
|
|
56
56
|
}, z.core.$strict>;
|
|
57
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
58
57
|
name: z.ZodString;
|
|
59
|
-
order: z.ZodNumber;
|
|
60
|
-
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
61
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
62
58
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
63
59
|
db: z.ZodObject<{
|
|
64
60
|
tableName: z.ZodString;
|
|
@@ -74,6 +70,10 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
74
70
|
quality: z.ZodNumber;
|
|
75
71
|
}, z.core.$strict>>;
|
|
76
72
|
}, z.core.$strict>>;
|
|
73
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
74
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
75
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
76
|
+
order: z.ZodNumber;
|
|
77
77
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
78
78
|
}, z.core.$strict>;
|
|
79
79
|
export type SimpleSectionOptions = z.infer<typeof optionsSchema>;
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { CMSPlugin, CMSPluginMultiRoute, CMSPluginSingleRoute, LoadedPlugin, LoadedPluginRoute, PluginInitContext, PluginModule, PluginRoute, PluginRouteWithoutComponent, PluginRouteWithComponent, } from './loader.js';
|
|
2
|
-
export {
|
|
2
|
+
export type { LocalizedString } from '../translations/localization.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,2BAA2B,EAC3B,wBAAwB,GAC3B,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,2BAA2B,EAC3B,wBAAwB,GAC3B,MAAM,aAAa,CAAA;AAGpB,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
|
package/dist/plugins/index.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { definePlugin } from './loader.js';
|
package/dist/plugins/loader.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { PluginConfigEntry } from '../core/config/config-loader.js';
|
|
2
|
+
import type { LocalizedString } from '../translations/localization.js';
|
|
2
3
|
export interface CMSPlugin {
|
|
3
4
|
/**
|
|
4
5
|
* The human facing title of the plugin.
|
|
6
|
+
* Can be a plain string or a localized object with language codes as keys.
|
|
5
7
|
* @example 'Some Plugin Title'
|
|
8
|
+
* @example { en: 'Some Plugin Title', ar: 'عنوان الإضافة' }
|
|
6
9
|
*/
|
|
7
|
-
title:
|
|
10
|
+
title: LocalizedString;
|
|
8
11
|
/**
|
|
9
12
|
* The internal name of the plugin.
|
|
10
13
|
* It should start with 'plugin_' and be in snake_case.
|
|
@@ -33,7 +36,11 @@ export interface PluginModule {
|
|
|
33
36
|
}
|
|
34
37
|
export interface PluginRoute {
|
|
35
38
|
path: string;
|
|
36
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The title of the route.
|
|
41
|
+
* Can be a plain string or a localized object with language codes as keys.
|
|
42
|
+
*/
|
|
43
|
+
title: LocalizedString;
|
|
37
44
|
icon?: string;
|
|
38
45
|
component?: string;
|
|
39
46
|
}
|
|
@@ -47,7 +54,6 @@ export interface LoadedPluginRoute extends PluginRoute {
|
|
|
47
54
|
pluginId: string;
|
|
48
55
|
pluginName: string;
|
|
49
56
|
pluginRegistryName: string;
|
|
50
|
-
pluginTitle: string;
|
|
51
57
|
}
|
|
52
58
|
type CMSPluginBase = Omit<CMSPlugin, 'routes'>;
|
|
53
59
|
export type CMSPluginSingleRoute = CMSPluginBase & {
|
|
@@ -62,5 +68,16 @@ export declare const loadPluginModule: (pluginPackage: string) => Promise<unknow
|
|
|
62
68
|
export declare function loadPlugins(): Promise<LoadedPlugin[]>;
|
|
63
69
|
export declare function getPluginRoutes(): Promise<LoadedPluginRoute[]>;
|
|
64
70
|
export declare function findPluginRouteByPath(path: string): Promise<LoadedPluginRoute | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Gets the dashboard override plugin route if configured.
|
|
73
|
+
* @returns The LoadedPluginRoute for the dashboard override, or null if not configured
|
|
74
|
+
*/
|
|
75
|
+
export declare function getDashboardOverride(): Promise<LoadedPluginRoute | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Checks if a plugin is the dashboard override plugin.
|
|
78
|
+
* @param pluginName - The internal name of the plugin (e.g., 'plugin_cpanel_dashboard')
|
|
79
|
+
* @returns true if this plugin is configured as the dashboard override
|
|
80
|
+
*/
|
|
81
|
+
export declare function isDashboardOverridePlugin(pluginName: string): Promise<boolean>;
|
|
65
82
|
export {};
|
|
66
83
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"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"}
|
package/dist/plugins/loader.js
CHANGED
|
@@ -77,13 +77,29 @@ function resolvePluginInstance(registration, mod) {
|
|
|
77
77
|
console.warn(`[plugins] Plugin "${registration.package}" is missing required "name" or "title". Skipping.`);
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
|
+
// Apply config-level title override if provided
|
|
81
|
+
const resolvedTitle = registration.title ?? candidate.title;
|
|
82
|
+
// Apply route-level title overrides if provided
|
|
83
|
+
// For single-route plugins, the config-level title also applies to the route
|
|
84
|
+
const isSingleRoute = (candidate.routes?.length ?? 0) <= 1;
|
|
85
|
+
const resolvedRoutes = (candidate.routes ?? []).map((route) => {
|
|
86
|
+
const routeOverride = registration.routes?.[route.path];
|
|
87
|
+
// Priority: route-specific override > config title (single-route only) > route default
|
|
88
|
+
const effectiveTitle = routeOverride?.title
|
|
89
|
+
?? (isSingleRoute ? registration.title : undefined)
|
|
90
|
+
?? route.title;
|
|
91
|
+
return {
|
|
92
|
+
...route,
|
|
93
|
+
title: effectiveTitle,
|
|
94
|
+
};
|
|
95
|
+
});
|
|
80
96
|
return {
|
|
81
|
-
title:
|
|
97
|
+
title: resolvedTitle,
|
|
82
98
|
name: candidate.name,
|
|
83
99
|
registryName: candidate.registryName,
|
|
84
100
|
version: candidate.version,
|
|
85
101
|
router: candidate.router,
|
|
86
|
-
routes:
|
|
102
|
+
routes: resolvedRoutes,
|
|
87
103
|
init: candidate.init,
|
|
88
104
|
};
|
|
89
105
|
}
|
|
@@ -165,10 +181,10 @@ export async function getPluginRoutes() {
|
|
|
165
181
|
}
|
|
166
182
|
return {
|
|
167
183
|
...route,
|
|
184
|
+
title: route.title,
|
|
168
185
|
pluginId: entry.config.package,
|
|
169
186
|
pluginName: entry.plugin.name,
|
|
170
187
|
pluginRegistryName: entry.plugin.registryName,
|
|
171
|
-
pluginTitle: entry.plugin.title,
|
|
172
188
|
};
|
|
173
189
|
});
|
|
174
190
|
});
|
|
@@ -178,3 +194,22 @@ export async function findPluginRouteByPath(path) {
|
|
|
178
194
|
const routes = await getPluginRoutes();
|
|
179
195
|
return routes.find((route) => route.path === normalized) ?? null;
|
|
180
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Gets the dashboard override plugin route if configured.
|
|
199
|
+
* @returns The LoadedPluginRoute for the dashboard override, or null if not configured
|
|
200
|
+
*/
|
|
201
|
+
export async function getDashboardOverride() {
|
|
202
|
+
const config = await getCMSConfig();
|
|
203
|
+
if (!config.dashboard?.override)
|
|
204
|
+
return null;
|
|
205
|
+
return findPluginRouteByPath(config.dashboard.override);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Checks if a plugin is the dashboard override plugin.
|
|
209
|
+
* @param pluginName - The internal name of the plugin (e.g., 'plugin_cpanel_dashboard')
|
|
210
|
+
* @returns true if this plugin is configured as the dashboard override
|
|
211
|
+
*/
|
|
212
|
+
export async function isDashboardOverridePlugin(pluginName) {
|
|
213
|
+
const override = await getDashboardOverride();
|
|
214
|
+
return override?.pluginName === pluginName;
|
|
215
|
+
}
|
|
@@ -321,6 +321,7 @@ declare const _default: {
|
|
|
321
321
|
readonly readonly: "للقراءة فقط";
|
|
322
322
|
readonly mysqlDatabases: "قواعد بيانات MySQL/MariaDB";
|
|
323
323
|
readonly phpVersion: "إصدار PHP";
|
|
324
|
+
readonly nodeVersion: "إصدار Node.js";
|
|
324
325
|
readonly documentRoot: "المجلد الرئيسي";
|
|
325
326
|
readonly version: "الإصدار";
|
|
326
327
|
readonly remote: "بعيد";
|
|
@@ -349,6 +350,16 @@ declare const _default: {
|
|
|
349
350
|
readonly categorySections: "أقسام التصنيفات";
|
|
350
351
|
readonly sectionsWithItems: "أقسام ذات عناصر";
|
|
351
352
|
readonly simpleSections: "أقسام بسيطة";
|
|
353
|
+
readonly cpanelPluginMisconfigured: "إضافة لوحة تحكم cPanel غير مهيأة بشكل صحيح: عميل tRPC مفقود.";
|
|
354
|
+
readonly loadingCpanelData: "جاري تحميل بيانات cPanel…";
|
|
355
|
+
readonly unableToLoadCpanelData: "تعذر تحميل بيانات cPanel";
|
|
356
|
+
readonly usedLabel: "المستخدم";
|
|
357
|
+
readonly totalLabel: "الإجمالي";
|
|
358
|
+
readonly databases: "قواعد البيانات";
|
|
359
|
+
readonly pnpmVersion: "إصدار pnpm";
|
|
360
|
+
readonly npmVersion: "إصدار npm";
|
|
361
|
+
readonly bunVersion: "إصدار bun";
|
|
362
|
+
readonly cPanelDashboard: "لوحة التحكم في cPanel";
|
|
352
363
|
};
|
|
353
364
|
export default _default;
|
|
354
365
|
//# sourceMappingURL=ar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/translations/dictionaries/ar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/translations/dictionaries/ar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA0WU"}
|