nextjs-cms 0.6.0 → 0.6.2
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/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.js +3 -3
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/sections/category.d.ts +34 -34
- package/dist/core/sections/hasItems.d.ts +34 -34
- package/dist/core/sections/section.d.ts +17 -17
- package/dist/core/sections/simple.d.ts +6 -6
- 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/package.json +6 -6
|
@@ -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":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAGxE,OAAO,KAAK,EA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CAAA;AAE1E,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IAClD,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,MAAM,CAAA;CAC7B;AAED,KAAK,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;AAE9C,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IAC/C,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,2BAA2B,CAAC,CAAA;CAC9C,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAC9C,MAAM,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;CAC9F,CAAA;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAAA;AAChF,wBAAgB,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAAA;AA2C9E,eAAO,MAAM,gBAAgB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,OAAO,CAwB7E,CAAA;AAiDD,wBAAsB,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAyE3D;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA8BpE;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAI3F;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAI9E;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGpF"}
|
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"}
|