@sonicjs-cms/core 3.0.0-beta.14 → 3.0.0-beta.16

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.
Files changed (87) hide show
  1. package/dist/{app-Bo0X1OWX.d.ts → app-01M0dIwt.d.ts} +1 -1
  2. package/dist/{app-Do66yCcV.d.cts → app-aj39TGHB.d.cts} +1 -1
  3. package/dist/{chunk-SIPBHWMG.cjs → chunk-3XFA3E2F.cjs} +4 -4
  4. package/dist/{chunk-SIPBHWMG.cjs.map → chunk-3XFA3E2F.cjs.map} +1 -1
  5. package/dist/{chunk-QNPT6BQP.js → chunk-7P2IJM4K.js} +3 -3
  6. package/dist/{chunk-QNPT6BQP.js.map → chunk-7P2IJM4K.js.map} +1 -1
  7. package/dist/{chunk-32SDMKZ7.js → chunk-HYO2MSFI.js} +2 -2
  8. package/dist/{chunk-32SDMKZ7.js.map → chunk-HYO2MSFI.js.map} +1 -1
  9. package/dist/{chunk-H5FB6GKR.cjs → chunk-IA24HACT.cjs} +2 -2
  10. package/dist/{chunk-H5FB6GKR.cjs.map → chunk-IA24HACT.cjs.map} +1 -1
  11. package/dist/{chunk-75JKPNUZ.js → chunk-IQZA2OY5.js} +3 -3
  12. package/dist/{chunk-75JKPNUZ.js.map → chunk-IQZA2OY5.js.map} +1 -1
  13. package/dist/{chunk-5L6EMI7A.js → chunk-IXUNNFZZ.js} +6 -5
  14. package/dist/chunk-IXUNNFZZ.js.map +1 -0
  15. package/dist/{chunk-U7T5EOHJ.js → chunk-JRMBHDGM.js} +4 -4
  16. package/dist/{chunk-U7T5EOHJ.js.map → chunk-JRMBHDGM.js.map} +1 -1
  17. package/dist/{chunk-INE5E3SL.js → chunk-KIB7K5LV.js} +27 -2
  18. package/dist/chunk-KIB7K5LV.js.map +1 -0
  19. package/dist/{chunk-ZTEJHSYS.cjs → chunk-KMCLNO4K.cjs} +5 -5
  20. package/dist/{chunk-ZTEJHSYS.cjs.map → chunk-KMCLNO4K.cjs.map} +1 -1
  21. package/dist/{chunk-L3KHLEHL.cjs → chunk-KMM45BTY.cjs} +53 -15
  22. package/dist/chunk-KMM45BTY.cjs.map +1 -0
  23. package/dist/{chunk-4YRYGDCQ.cjs → chunk-KOXFYFOF.cjs} +4 -4
  24. package/dist/{chunk-4YRYGDCQ.cjs.map → chunk-KOXFYFOF.cjs.map} +1 -1
  25. package/dist/{chunk-WIV3R2MJ.cjs → chunk-KZIBF2EV.cjs} +27 -2
  26. package/dist/chunk-KZIBF2EV.cjs.map +1 -0
  27. package/dist/{chunk-G5LC7MYH.cjs → chunk-LXYDJU6U.cjs} +12 -11
  28. package/dist/chunk-LXYDJU6U.cjs.map +1 -0
  29. package/dist/{chunk-O32IZ6JS.js → chunk-PA2UIFB7.js} +43 -5
  30. package/dist/chunk-PA2UIFB7.js.map +1 -0
  31. package/dist/{chunk-SSOP7G4R.cjs → chunk-SC2WZFNQ.cjs} +309 -243
  32. package/dist/chunk-SC2WZFNQ.cjs.map +1 -0
  33. package/dist/{chunk-HNUGMALL.js → chunk-UOFRE5PY.js} +104 -39
  34. package/dist/chunk-UOFRE5PY.js.map +1 -0
  35. package/dist/{chunk-IESEVHXL.js → chunk-VVYVFCML.js} +12 -3
  36. package/dist/chunk-VVYVFCML.js.map +1 -0
  37. package/dist/{chunk-HIKBY7MS.cjs → chunk-XWVDSM2L.cjs} +12 -3
  38. package/dist/chunk-XWVDSM2L.cjs.map +1 -0
  39. package/dist/config-SM2UWSDN.js +6 -0
  40. package/dist/{config-PLJTDINX.js.map → config-SM2UWSDN.js.map} +1 -1
  41. package/dist/config-YCRSU7ZP.cjs +19 -0
  42. package/dist/{config-FLOUCYHH.cjs.map → config-YCRSU7ZP.cjs.map} +1 -1
  43. package/dist/{define-plugin-BzNHc1ZI.d.ts → define-plugin-BYIey6sp.d.ts} +1 -1
  44. package/dist/{define-plugin-IWDKYaVm.d.cts → define-plugin-DsKiGu1q.d.cts} +1 -1
  45. package/dist/index.cjs +775 -297
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.cts +194 -7
  48. package/dist/index.d.ts +194 -7
  49. package/dist/index.js +527 -59
  50. package/dist/index.js.map +1 -1
  51. package/dist/middleware.cjs +33 -33
  52. package/dist/middleware.d.cts +2 -2
  53. package/dist/middleware.d.ts +2 -2
  54. package/dist/middleware.js +4 -4
  55. package/dist/migrations-F4LBAHQN.js +4 -0
  56. package/dist/{migrations-DOPZXFK3.js.map → migrations-F4LBAHQN.js.map} +1 -1
  57. package/dist/migrations-KMCULV6H.cjs +13 -0
  58. package/dist/{migrations-TYYC66P4.cjs.map → migrations-KMCULV6H.cjs.map} +1 -1
  59. package/dist/plugins.cjs +40 -40
  60. package/dist/plugins.d.cts +2 -2
  61. package/dist/plugins.d.ts +2 -2
  62. package/dist/plugins.js +3 -3
  63. package/dist/routes.cjs +27 -27
  64. package/dist/routes.d.cts +2 -2
  65. package/dist/routes.d.ts +2 -2
  66. package/dist/routes.js +7 -7
  67. package/dist/services.cjs +18 -18
  68. package/dist/services.js +2 -2
  69. package/dist/{types-Dea1eNxU.d.cts → types-DT7XN5TX.d.cts} +1 -1
  70. package/dist/{types-Dea1eNxU.d.ts → types-DT7XN5TX.d.ts} +1 -1
  71. package/dist/utils.cjs +3 -3
  72. package/dist/utils.js +1 -1
  73. package/package.json +2 -2
  74. package/dist/chunk-5L6EMI7A.js.map +0 -1
  75. package/dist/chunk-G5LC7MYH.cjs.map +0 -1
  76. package/dist/chunk-HIKBY7MS.cjs.map +0 -1
  77. package/dist/chunk-HNUGMALL.js.map +0 -1
  78. package/dist/chunk-IESEVHXL.js.map +0 -1
  79. package/dist/chunk-INE5E3SL.js.map +0 -1
  80. package/dist/chunk-L3KHLEHL.cjs.map +0 -1
  81. package/dist/chunk-O32IZ6JS.js.map +0 -1
  82. package/dist/chunk-SSOP7G4R.cjs.map +0 -1
  83. package/dist/chunk-WIV3R2MJ.cjs.map +0 -1
  84. package/dist/config-FLOUCYHH.cjs +0 -19
  85. package/dist/config-PLJTDINX.js +0 -6
  86. package/dist/migrations-DOPZXFK3.js +0 -4
  87. package/dist/migrations-TYYC66P4.cjs +0 -13
@@ -1,18 +1,18 @@
1
- import { isFirstUserRegistration, isRegistrationEnabled, authValidationService } from './chunk-IESEVHXL.js';
1
+ import { isFirstUserRegistration, isRegistrationEnabled, authValidationService } from './chunk-VVYVFCML.js';
2
2
  import { renderDocumentFormPage, renderAlert } from './chunk-RMRJGMDE.js';
3
3
  import { getCacheService, CACHE_CONFIGS, SettingsService, getLogger, getAppInstance, buildRouteList, CATEGORY_INFO } from './chunk-RQ6N3FTV.js';
4
- import { DocumentTypeRegistry, requireAuth, requireRole, optionalAuth, isPluginActive, rateLimit, AuthManager, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, logActivity, generateCsrfToken } from './chunk-O32IZ6JS.js';
4
+ import { DocumentTypeRegistry, requireAuth, requireRole, optionalAuth, isPluginActive, rateLimit, AuthManager, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, logActivity, generateCsrfToken } from './chunk-PA2UIFB7.js';
5
5
  import { DocumentsService, documentSecondsToMs, RbacService } from './chunk-PDC7DLOV.js';
6
6
  import { nanoid } from './chunk-GCDZZNIN.js';
7
- import { getCollectionRegistry, collectionRecordToRow, loadCollectionConfigs, getVisibleCollections, PluginService, PLUGIN_REGISTRY, findPluginByCodeName, isCodeCollectionInternal, isDbDocTypeInternal, invalidateTenantCache } from './chunk-INE5E3SL.js';
8
- import { MigrationService } from './chunk-32SDMKZ7.js';
7
+ import { getCollectionRegistry, collectionRecordToRow, loadCollectionConfigs, getVisibleCollections, PluginService, PLUGIN_REGISTRY, findPluginByCodeName, isCodeCollectionInternal, isDbDocTypeInternal, invalidateTenantCache } from './chunk-KIB7K5LV.js';
8
+ import { MigrationService } from './chunk-HYO2MSFI.js';
9
9
  import { renderCheckboxPage, renderAlert as renderAlert$1, renderTable, renderPagination, renderConfirmationDialog, getConfirmationDialogScript, renderAdminLayout, adminLayoutV2, renderForm } from './chunk-OBA2RYZN.js';
10
10
  import { init_admin_layout_catalyst_template, renderAdminLayoutCatalyst } from './chunk-5V62WT6M.js';
11
- import { createServiceSingleton, definePlugin, getPluginDefinition, applySchemaDefaults, renderSchemaFields, parseFormDataToSettings } from './chunk-QNPT6BQP.js';
11
+ import { createServiceSingleton, definePlugin, getPluginDefinition, applySchemaDefaults, renderSchemaFields, parseFormDataToSettings } from './chunk-7P2IJM4K.js';
12
12
  import { hasHookSystem, getTypedHooks } from './chunk-RNZFGN4R.js';
13
13
  import { QueryFilterBuilder, getBlocksFieldConfig, parseBlocksValue } from './chunk-QZGABF2M.js';
14
14
  import { metricsTracker } from './chunk-FICTAGD4.js';
15
- import { getCoreVersion } from './chunk-U7T5EOHJ.js';
15
+ import { getCoreVersion } from './chunk-JRMBHDGM.js';
16
16
  import { escapeHtml, sanitizeRichText, sanitizeInput } from './chunk-TQABQWOP.js';
17
17
  import { Hono } from 'hono';
18
18
  import { z } from 'zod';
@@ -3389,7 +3389,7 @@ adminApiRoutes.patch("/collections/:id", collectionsReadOnly);
3389
3389
  adminApiRoutes.delete("/collections/:id", collectionsReadOnly);
3390
3390
  adminApiRoutes.get("/migrations/status", async (c) => {
3391
3391
  try {
3392
- const { MigrationService: MigrationService2 } = await import('./migrations-DOPZXFK3.js');
3392
+ const { MigrationService: MigrationService2 } = await import('./migrations-F4LBAHQN.js');
3393
3393
  const db = c.env.DB;
3394
3394
  const migrationService = new MigrationService2(db);
3395
3395
  const status = await migrationService.getMigrationStatus();
@@ -3432,7 +3432,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
3432
3432
  });
3433
3433
  adminApiRoutes.get("/migrations/validate", async (c) => {
3434
3434
  try {
3435
- const { MigrationService: MigrationService2 } = await import('./migrations-DOPZXFK3.js');
3435
+ const { MigrationService: MigrationService2 } = await import('./migrations-F4LBAHQN.js');
3436
3436
  const db = c.env.DB;
3437
3437
  const migrationService = new MigrationService2(db);
3438
3438
  const validation = await migrationService.validateSchema();
@@ -7271,7 +7271,7 @@ authRoutes.post(
7271
7271
  }
7272
7272
  const { email, password } = validation.data;
7273
7273
  const normalizedEmail = email.toLowerCase();
7274
- const { createAuth } = await import('./config-PLJTDINX.js');
7274
+ const { createAuth } = await import('./config-SM2UWSDN.js');
7275
7275
  const auth = createAuth(c.env);
7276
7276
  const baReq = new Request(new URL("/auth/sign-in/email", c.req.url).href, {
7277
7277
  method: "POST",
@@ -7325,7 +7325,7 @@ authRoutes.post(
7325
7325
  );
7326
7326
  authRoutes.post("/logout", async (c) => {
7327
7327
  try {
7328
- const { createAuth } = await import('./config-PLJTDINX.js');
7328
+ const { createAuth } = await import('./config-SM2UWSDN.js');
7329
7329
  const auth = createAuth(c.env);
7330
7330
  const baReq = new Request(new URL("/auth/sign-out", c.req.url).href, {
7331
7331
  method: "POST",
@@ -7341,7 +7341,7 @@ authRoutes.post("/logout", async (c) => {
7341
7341
  });
7342
7342
  authRoutes.get("/logout", async (c) => {
7343
7343
  try {
7344
- const { createAuth } = await import('./config-PLJTDINX.js');
7344
+ const { createAuth } = await import('./config-SM2UWSDN.js');
7345
7345
  const auth = createAuth(c.env);
7346
7346
  const baReq = new Request(new URL("/auth/sign-out", c.req.url).href, {
7347
7347
  method: "POST",
@@ -7548,7 +7548,7 @@ authRoutes.post(
7548
7548
  </div>
7549
7549
  `);
7550
7550
  }
7551
- const { createAuth } = await import('./config-PLJTDINX.js');
7551
+ const { createAuth } = await import('./config-SM2UWSDN.js');
7552
7552
  const auth = createAuth(c.env);
7553
7553
  const baReq = new Request(new URL("/auth/sign-in/email", c.req.url).href, {
7554
7554
  method: "POST",
@@ -19332,6 +19332,8 @@ function escapeHtmlAttr(value) {
19332
19332
  }
19333
19333
  function renderPluginSettingsPage(data) {
19334
19334
  const { plugin, activity = [], user } = data;
19335
+ const hasUserSettings = Object.keys(plugin.settings || {}).some((k) => !k.startsWith("_"));
19336
+ const defaultTab = "info";
19335
19337
  const pageContent = `
19336
19338
  <div class="w-full px-4 sm:px-6 lg:px-8 py-6">
19337
19339
  <!-- Header with Back Button -->
@@ -19342,13 +19344,24 @@ function renderPluginSettingsPage(data) {
19342
19344
  ${plugin.description}
19343
19345
  </p>
19344
19346
  </div>
19345
- <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
19347
+ <div class="mt-4 sm:mt-0 sm:ml-16 flex items-center gap-3">
19346
19348
  <a href="/admin/plugins" class="inline-flex items-center justify-center rounded-lg bg-white dark:bg-zinc-800 px-3.5 py-2.5 text-sm font-semibold text-zinc-950 dark:text-white ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors shadow-sm">
19347
19349
  <svg class="-ml-0.5 mr-1.5 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
19348
19350
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
19349
19351
  </svg>
19350
19352
  Back to Plugins
19351
19353
  </a>
19354
+ ${plugin.settings?._adminPath ? `
19355
+ <a
19356
+ href="${plugin.settings._adminPath}"
19357
+ class="inline-flex items-center justify-center gap-1.5 rounded-lg bg-gradient-to-r from-cyan-500 to-purple-600 hover:from-cyan-400 hover:to-purple-500 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm transition-all duration-200"
19358
+ >
19359
+ <svg class="-ml-0.5 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
19360
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
19361
+ </svg>
19362
+ View Page
19363
+ </a>
19364
+ ` : ""}
19352
19365
  </div>
19353
19366
  </div>
19354
19367
 
@@ -19381,23 +19394,25 @@ function renderPluginSettingsPage(data) {
19381
19394
  <!-- Tabs -->
19382
19395
  <div class="mb-6">
19383
19396
  <nav class="flex space-x-8" aria-label="Tabs">
19384
- <button onclick="showTab('settings')" id="settings-tab" class="tab-button active border-b-2 border-blue-400 py-2 px-1 text-sm font-medium text-blue-400">
19397
+ <a href="#info" onclick="showTab('info')" id="info-tab" class="tab-button border-b-2 border-transparent py-2 px-1 text-sm font-medium text-gray-400 hover:text-gray-300">
19398
+ Information
19399
+ </a>
19400
+ ${hasUserSettings ? `
19401
+ <a href="#settings" onclick="showTab('settings')" id="settings-tab" class="tab-button border-b-2 border-transparent py-2 px-1 text-sm font-medium text-gray-400 hover:text-gray-300">
19385
19402
  Settings
19386
- </button>
19387
- <button onclick="showTab('activity')" id="activity-tab" class="tab-button border-b-2 border-transparent py-2 px-1 text-sm font-medium text-gray-400 hover:text-gray-300">
19403
+ </a>
19404
+ ` : ""}
19405
+ <a href="#activity" onclick="showTab('activity')" id="activity-tab" class="tab-button border-b-2 border-transparent py-2 px-1 text-sm font-medium text-gray-400 hover:text-gray-300">
19388
19406
  Activity Log
19389
- </button>
19390
- <button onclick="showTab('info')" id="info-tab" class="tab-button border-b-2 border-transparent py-2 px-1 text-sm font-medium text-gray-400 hover:text-gray-300">
19391
- Information
19392
- </button>
19407
+ </a>
19393
19408
  </nav>
19394
19409
  </div>
19395
19410
 
19396
19411
  <!-- Tab Content -->
19397
19412
  <div id="tab-content">
19398
19413
  <!-- Settings Tab -->
19399
- <div id="settings-content" class="tab-content">
19400
- ${renderSettingsTab(plugin)}
19414
+ <div id="settings-content" class="tab-content hidden">
19415
+ ${hasUserSettings ? renderSettingsTab(plugin) : ""}
19401
19416
  </div>
19402
19417
 
19403
19418
  <!-- Activity Tab -->
@@ -19413,27 +19428,42 @@ function renderPluginSettingsPage(data) {
19413
19428
  </div>
19414
19429
 
19415
19430
  <script>
19431
+ const VALID_TABS = [${hasUserSettings ? "'settings', " : ""}'activity', 'info'];
19432
+
19416
19433
  function showTab(tabName) {
19417
- // Hide all tab contents
19434
+ if (!VALID_TABS.includes(tabName)) tabName = '${defaultTab}';
19435
+
19418
19436
  document.querySelectorAll('.tab-content').forEach(content => {
19419
19437
  content.classList.add('hidden');
19420
19438
  });
19421
-
19422
- // Remove active class from all tabs
19439
+
19423
19440
  document.querySelectorAll('.tab-button').forEach(tab => {
19424
19441
  tab.classList.remove('active', 'border-blue-400', 'text-blue-400');
19425
19442
  tab.classList.add('border-transparent', 'text-gray-400');
19426
19443
  });
19427
-
19428
- // Show selected tab content
19429
- document.getElementById(tabName + '-content').classList.remove('hidden');
19430
-
19431
- // Add active class to selected tab
19444
+
19445
+ const contentEl = document.getElementById(tabName + '-content');
19446
+ if (contentEl) contentEl.classList.remove('hidden');
19447
+
19432
19448
  const activeTab = document.getElementById(tabName + '-tab');
19433
- activeTab.classList.add('active', 'border-blue-400', 'text-blue-400');
19434
- activeTab.classList.remove('border-transparent', 'text-gray-400');
19449
+ if (activeTab) {
19450
+ activeTab.classList.add('active', 'border-blue-400', 'text-blue-400');
19451
+ activeTab.classList.remove('border-transparent', 'text-gray-400');
19452
+ }
19453
+
19454
+ if (window.location.hash !== '#' + tabName) {
19455
+ history.replaceState(null, '', '#' + tabName);
19456
+ }
19457
+ }
19458
+
19459
+ function initTabFromHash() {
19460
+ const hash = window.location.hash.replace('#', '');
19461
+ showTab(VALID_TABS.includes(hash) ? hash : '${defaultTab}');
19435
19462
  }
19436
19463
 
19464
+ window.addEventListener('hashchange', initTabFromHash);
19465
+ initTabFromHash();
19466
+
19437
19467
  async function togglePlugin(pluginId, action) {
19438
19468
  const button = event.target;
19439
19469
  const originalText = button.textContent;
@@ -19606,6 +19636,7 @@ function renderToggleButton(plugin) {
19606
19636
  function renderSettingsTab(plugin) {
19607
19637
  const settings = plugin.settings || {};
19608
19638
  const pluginId = plugin.id || plugin.name;
19639
+ const hasUserKeys = Object.keys(settings).some((k) => !k.startsWith("_"));
19609
19640
  const customRenderer = pluginSettingsComponents[pluginId];
19610
19641
  if (customRenderer) {
19611
19642
  return `
@@ -19641,9 +19672,9 @@ function renderSettingsTab(plugin) {
19641
19672
  `}
19642
19673
 
19643
19674
  <form id="settings-form" class="space-y-6">
19644
- ${isAuthPlugin && Object.keys(settings).length > 0 ? renderAuthSettingsForm(settings) : isTurnstilePlugin && Object.keys(settings).length > 0 ? renderTurnstileSettingsForm(settings) : Object.keys(settings).length > 0 ? renderSettingsFields(settings) : renderNoSettings(plugin)}
19675
+ ${isAuthPlugin && hasUserKeys ? renderAuthSettingsForm(settings) : isTurnstilePlugin && hasUserKeys ? renderTurnstileSettingsForm(settings) : hasUserKeys ? renderSettingsFields(settings) : renderNoSettings(plugin)}
19645
19676
 
19646
- ${Object.keys(settings).length > 0 ? `
19677
+ ${hasUserKeys ? `
19647
19678
  <div class="flex items-center justify-end pt-6 border-t border-white/10">
19648
19679
  <button
19649
19680
  type="button"
@@ -19660,7 +19691,7 @@ function renderSettingsTab(plugin) {
19660
19691
  `;
19661
19692
  }
19662
19693
  function renderSettingsFields(settings) {
19663
- return Object.entries(settings).map(([key, value]) => {
19694
+ return Object.entries(settings).filter(([key]) => !key.startsWith("_")).map(([key, value]) => {
19664
19695
  const fieldId = `setting_${key}`;
19665
19696
  const displayName = key.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
19666
19697
  if (typeof value === "boolean") {
@@ -19849,6 +19880,38 @@ function renderActivityTab(activity) {
19849
19880
  }
19850
19881
  function renderInformationTab(plugin) {
19851
19882
  return `
19883
+ ${plugin.description ? `
19884
+ <!-- About -->
19885
+ <div class="backdrop-blur-md bg-black/20 rounded-xl border border-white/10 shadow-xl p-6 mb-6">
19886
+ <h2 class="text-xl font-semibold text-white mb-3">About</h2>
19887
+ <p class="text-gray-300 leading-relaxed">${plugin.description}</p>
19888
+ </div>
19889
+ ` : ""}
19890
+
19891
+ ${(plugin.settings?._routes?.length ?? 0) > 0 ? `
19892
+ <!-- Routes -->
19893
+ <div class="backdrop-blur-md bg-black/20 rounded-xl border border-white/10 shadow-xl p-6 mb-6">
19894
+ <h2 class="text-xl font-semibold text-white mb-4">Routes</h2>
19895
+ <div class="space-y-2">
19896
+ ${plugin.settings._routes.map((r) => {
19897
+ const badge = r.method === "GET" ? "bg-emerald-500/20 text-emerald-300 border border-emerald-500/30" : r.method === "POST" ? "bg-blue-500/20 text-blue-300 border border-blue-500/30" : r.method === "DELETE" ? "bg-red-500/20 text-red-300 border border-red-500/30" : "bg-white/10 text-gray-300 border border-white/20";
19898
+ const pathHtml = r.method === "GET" ? `<a href="${r.path}" class="font-mono text-sm text-blue-400 hover:text-blue-300 hover:underline">${r.path}</a>` : `<span class="font-mono text-sm text-gray-200">${r.path}</span>`;
19899
+ const authBadge = r.requiresAuth ? `<span class="ml-2 text-xs text-amber-400/80">\u{1F512} auth</span>` : "";
19900
+ return `
19901
+ <div class="flex items-start gap-3 py-2 border-b border-white/5 last:border-0">
19902
+ <span class="shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold ${badge}">${r.method}</span>
19903
+ <div class="min-w-0">
19904
+ <div class="flex items-center gap-1 flex-wrap">
19905
+ ${pathHtml}${authBadge}
19906
+ </div>
19907
+ ${r.description ? `<p class="text-xs text-gray-400 mt-0.5">${r.description}</p>` : ""}
19908
+ </div>
19909
+ </div>`;
19910
+ }).join("")}
19911
+ </div>
19912
+ </div>
19913
+ ` : ""}
19914
+
19852
19915
  <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
19853
19916
  <!-- Plugin Details -->
19854
19917
  <div class="backdrop-blur-md bg-black/20 rounded-xl border border-white/10 shadow-xl p-6">
@@ -20879,7 +20942,9 @@ adminPluginRoutes.post("/:id/configure", async (c) => {
20879
20942
  description: def.description,
20880
20943
  author: typeof def.author === "object" ? def.author?.name : def.author
20881
20944
  });
20882
- await pluginService.updatePluginSettings(pluginId, parsed);
20945
+ const existingPlugin = await pluginService.getPlugin(pluginId);
20946
+ const existingSettings = existingPlugin?.settings ?? {};
20947
+ await pluginService.updatePluginSettings(pluginId, { ...existingSettings, ...parsed });
20883
20948
  return c.redirect(`/admin/plugins/${encodeURIComponent(pluginId)}/configure`);
20884
20949
  } catch (error) {
20885
20950
  console.error("Error saving schema settings:", error);
@@ -26833,6 +26898,6 @@ var ROUTES_INFO = {
26833
26898
  reference: "https://github.com/sonicjs/sonicjs"
26834
26899
  };
26835
26900
 
26836
- export { DocumentRepository, ROUTES_INFO, TenantService, VALID_MEMBER_ROLES, adminCheckboxRoutes, adminCollectionsRoutes, adminDocumentsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_api_default, admin_content_default, apiDocumentsRoutes, api_content_crud_default, api_default, api_media_default, api_system_default, auth_default, createUserProfilesPlugin, defineUserProfile, denyIfNotAllowed, dispatchHookEvent, getConfirmationDialogScript2 as getConfirmationDialogScript, getCustomData, getEmailService, getUserProfileConfig, getVariablesCached, hasEmailService, invalidateVariablesCache, isValidMemberRole, lexicalEditorPlugin, renderConfirmationDialog2 as renderConfirmationDialog, renderTable2 as renderTable, resolveDocScope, resolveVariablesInObject, router, router2, setEmailService, setVariablesCache, test_cleanup_default, userProfilesPlugin, userRoutes };
26837
- //# sourceMappingURL=chunk-HNUGMALL.js.map
26838
- //# sourceMappingURL=chunk-HNUGMALL.js.map
26901
+ export { DocumentRepository, ROUTES_INFO, TenantService, VALID_MEMBER_ROLES, adminCheckboxRoutes, adminCollectionsRoutes, adminDocumentsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_api_default, admin_content_default, apiDocumentsRoutes, api_content_crud_default, api_default, api_media_default, api_system_default, auth_default, createDocumentSchema, createUserProfilesPlugin, defineUserProfile, denyIfNotAllowed, dispatchHookEvent, getConfirmationDialogScript2 as getConfirmationDialogScript, getCustomData, getEmailService, getUserProfileConfig, getVariablesCached, hasEmailService, invalidateVariablesCache, isValidMemberRole, lexicalEditorPlugin, renderConfirmationDialog2 as renderConfirmationDialog, renderTable2 as renderTable, resolveDocScope, resolveVariablesInObject, router, router2, setEmailService, setVariablesCache, test_cleanup_default, userProfilesPlugin, userRoutes };
26902
+ //# sourceMappingURL=chunk-UOFRE5PY.js.map
26903
+ //# sourceMappingURL=chunk-UOFRE5PY.js.map