@sonicjs-cms/core 2.17.2 → 2.18.0

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 (43) hide show
  1. package/dist/{chunk-P4RAIX7B.cjs → chunk-3XP76LM7.cjs} +8 -8
  2. package/dist/{chunk-P4RAIX7B.cjs.map → chunk-3XP76LM7.cjs.map} +1 -1
  3. package/dist/{chunk-FXWF5D5V.cjs → chunk-56PLLVDG.cjs} +9 -3
  4. package/dist/chunk-56PLLVDG.cjs.map +1 -0
  5. package/dist/{chunk-Q3W6LCEN.cjs → chunk-74BFRAQS.cjs} +3 -3
  6. package/dist/{chunk-Q3W6LCEN.cjs.map → chunk-74BFRAQS.cjs.map} +1 -1
  7. package/dist/{chunk-LVGB5UU5.cjs → chunk-DAESIIWY.cjs} +2 -2
  8. package/dist/{chunk-LVGB5UU5.cjs.map → chunk-DAESIIWY.cjs.map} +1 -1
  9. package/dist/{chunk-K6QVIOTA.js → chunk-GH3HYA7D.js} +4 -4
  10. package/dist/{chunk-K6QVIOTA.js.map → chunk-GH3HYA7D.js.map} +1 -1
  11. package/dist/{chunk-2VY2G7OR.cjs → chunk-LTJ7P7RT.cjs} +242 -124
  12. package/dist/chunk-LTJ7P7RT.cjs.map +1 -0
  13. package/dist/{chunk-I2Z72YTD.js → chunk-NDS4S4AG.js} +3 -3
  14. package/dist/{chunk-I2Z72YTD.js.map → chunk-NDS4S4AG.js.map} +1 -1
  15. package/dist/{chunk-ITGOUYVN.js → chunk-OWJPOVFW.js} +2 -2
  16. package/dist/{chunk-ITGOUYVN.js.map → chunk-OWJPOVFW.js.map} +1 -1
  17. package/dist/{chunk-KJSZMIBF.js → chunk-RYRNZYND.js} +128 -10
  18. package/dist/chunk-RYRNZYND.js.map +1 -0
  19. package/dist/{chunk-NAYUXSNR.js → chunk-YK5IEGQZ.js} +9 -3
  20. package/dist/chunk-YK5IEGQZ.js.map +1 -0
  21. package/dist/index.cjs +196 -153
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +65 -22
  24. package/dist/index.js.map +1 -1
  25. package/dist/middleware.cjs +32 -32
  26. package/dist/middleware.js +3 -3
  27. package/dist/migrations-CW2IT5YP.cjs +13 -0
  28. package/dist/{migrations-Q7C6F2RM.cjs.map → migrations-CW2IT5YP.cjs.map} +1 -1
  29. package/dist/migrations-S42BOXI4.js +4 -0
  30. package/dist/{migrations-IFZLGVV3.js.map → migrations-S42BOXI4.js.map} +1 -1
  31. package/dist/routes.cjs +28 -28
  32. package/dist/routes.js +5 -5
  33. package/dist/services.cjs +23 -23
  34. package/dist/services.js +2 -2
  35. package/dist/utils.cjs +11 -11
  36. package/dist/utils.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-2VY2G7OR.cjs.map +0 -1
  39. package/dist/chunk-FXWF5D5V.cjs.map +0 -1
  40. package/dist/chunk-KJSZMIBF.js.map +0 -1
  41. package/dist/chunk-NAYUXSNR.js.map +0 -1
  42. package/dist/migrations-IFZLGVV3.js +0 -4
  43. package/dist/migrations-Q7C6F2RM.cjs +0 -13
@@ -1,11 +1,11 @@
1
1
  import { getCacheService, CACHE_CONFIGS, SettingsService, getLogger, getAppInstance, buildRouteList, CATEGORY_INFO } from './chunk-QFWHAFEO.js';
2
- import { requireAuth, requireRole, isPluginActive, optionalAuth, rateLimit, AuthManager, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, logActivity, generateCsrfToken } from './chunk-K6QVIOTA.js';
3
- import { PluginService, PLUGIN_REGISTRY, findPluginByCodeName, createContentFromSubmission } from './chunk-NAYUXSNR.js';
4
- import { MigrationService } from './chunk-ITGOUYVN.js';
2
+ import { requireAuth, requireRole, isPluginActive, optionalAuth, rateLimit, AuthManager, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, logActivity, generateCsrfToken } from './chunk-GH3HYA7D.js';
3
+ import { PluginService, PLUGIN_REGISTRY, findPluginByCodeName, createContentFromSubmission } from './chunk-YK5IEGQZ.js';
4
+ import { MigrationService } from './chunk-OWJPOVFW.js';
5
5
  import { renderDesignPage, renderCheckboxPage, renderTestimonialsList, renderCodeExamplesList, renderAlert, renderTable, renderPagination, renderConfirmationDialog, getConfirmationDialogScript, renderAdminLayout, adminLayoutV2, renderForm } from './chunk-XWIA3HVX.js';
6
6
  import { init_admin_layout_catalyst_template, renderAdminLayoutCatalyst } from './chunk-55RDMDOP.js';
7
7
  import { PluginBuilder, TurnstileService } from './chunk-EXNEW5US.js';
8
- import { QueryFilterBuilder, getCoreVersion, getBlocksFieldConfig, parseBlocksValue } from './chunk-I2Z72YTD.js';
8
+ import { QueryFilterBuilder, getCoreVersion, getBlocksFieldConfig, parseBlocksValue } from './chunk-NDS4S4AG.js';
9
9
  import { metricsTracker } from './chunk-FICTAGD4.js';
10
10
  import { escapeHtml, sanitizeRichText, sanitizeInput } from './chunk-TQABQWOP.js';
11
11
  import { Hono } from 'hono';
@@ -2351,7 +2351,7 @@ adminApiRoutes.delete("/collections/:id", async (c) => {
2351
2351
  });
2352
2352
  adminApiRoutes.get("/migrations/status", async (c) => {
2353
2353
  try {
2354
- const { MigrationService: MigrationService2 } = await import('./migrations-IFZLGVV3.js');
2354
+ const { MigrationService: MigrationService2 } = await import('./migrations-S42BOXI4.js');
2355
2355
  const db = c.env.DB;
2356
2356
  const migrationService = new MigrationService2(db);
2357
2357
  const status = await migrationService.getMigrationStatus();
@@ -2376,7 +2376,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
2376
2376
  error: "Unauthorized. Admin access required."
2377
2377
  }, 403);
2378
2378
  }
2379
- const { MigrationService: MigrationService2 } = await import('./migrations-IFZLGVV3.js');
2379
+ const { MigrationService: MigrationService2 } = await import('./migrations-S42BOXI4.js');
2380
2380
  const db = c.env.DB;
2381
2381
  const migrationService = new MigrationService2(db);
2382
2382
  const result = await migrationService.runPendingMigrations();
@@ -2398,7 +2398,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
2398
2398
  });
2399
2399
  adminApiRoutes.get("/migrations/validate", async (c) => {
2400
2400
  try {
2401
- const { MigrationService: MigrationService2 } = await import('./migrations-IFZLGVV3.js');
2401
+ const { MigrationService: MigrationService2 } = await import('./migrations-S42BOXI4.js');
2402
2402
  const db = c.env.DB;
2403
2403
  const migrationService = new MigrationService2(db);
2404
2404
  const validation = await migrationService.validateSchema();
@@ -17731,6 +17731,13 @@ function renderOTPLoginSettingsContent(plugin, settings) {
17731
17731
  const rateLimitPerHour = settings.rateLimitPerHour || 5;
17732
17732
  const allowNewUserRegistration = settings.allowNewUserRegistration || false;
17733
17733
  const logoUrl = settings.logoUrl || "";
17734
+ const logoWidth = Number(settings.logoWidth) || 150;
17735
+ const logoBorderWidth = Number(settings.logoBorderWidth) || 0;
17736
+ const logoBorderColor = settings.logoBorderColor || "#ffffff";
17737
+ const loginUrl = settings.loginUrl || "";
17738
+ const loginButtonText = settings.loginButtonText || "";
17739
+ const previewButtonText = loginButtonText.trim() || `Sign in to ${siteName}`;
17740
+ const previewLogoBorder = logoBorderWidth > 0 && logoBorderColor ? `border: ${logoBorderWidth}px solid ${escapeHtmlAttr(logoBorderColor)}; border-radius: 8px;` : "";
17734
17741
  return `
17735
17742
  <div class="space-y-6">
17736
17743
  <!-- Test OTP Section -->
@@ -17821,6 +17828,109 @@ function renderOTPLoginSettingsContent(plugin, settings) {
17821
17828
  <h3 class="text-lg font-semibold text-white mb-4">Code Settings</h3>
17822
17829
 
17823
17830
  <form id="settings-form" class="space-y-4">
17831
+ <div>
17832
+ <label for="setting_logoUrl" class="block text-sm font-medium text-gray-300 mb-2">
17833
+ Logo URL
17834
+ </label>
17835
+ <input
17836
+ type="url"
17837
+ id="setting_logoUrl"
17838
+ name="setting_logoUrl"
17839
+ value="${escapeHtmlAttr(logoUrl)}"
17840
+ placeholder="https://yourdomain.com/logo.png"
17841
+ class="w-full px-3 py-2 rounded-lg bg-white/5 border border-white/10 focus:border-blue-500 focus:outline-none text-white"
17842
+ />
17843
+ <p class="text-xs text-gray-500 mt-1">Optional. Displayed at the top of the OTP email.</p>
17844
+ </div>
17845
+
17846
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
17847
+ <div>
17848
+ <label for="setting_logoWidth" class="block text-sm font-medium text-gray-300 mb-2">
17849
+ Logo Width (px)
17850
+ </label>
17851
+ <input
17852
+ type="number"
17853
+ id="setting_logoWidth"
17854
+ name="setting_logoWidth"
17855
+ min="20"
17856
+ max="600"
17857
+ value="${logoWidth}"
17858
+ class="w-full px-3 py-2 rounded-lg bg-white/5 border border-white/10 focus:border-blue-500 focus:outline-none text-white"
17859
+ />
17860
+ <p class="text-xs text-gray-500 mt-1">Max width of the logo (20-600).</p>
17861
+ </div>
17862
+
17863
+ <div>
17864
+ <label for="setting_logoBorderWidth" class="block text-sm font-medium text-gray-300 mb-2">
17865
+ Border Thickness (px)
17866
+ </label>
17867
+ <input
17868
+ type="number"
17869
+ id="setting_logoBorderWidth"
17870
+ name="setting_logoBorderWidth"
17871
+ min="0"
17872
+ max="20"
17873
+ value="${logoBorderWidth}"
17874
+ class="w-full px-3 py-2 rounded-lg bg-white/5 border border-white/10 focus:border-blue-500 focus:outline-none text-white"
17875
+ />
17876
+ <p class="text-xs text-gray-500 mt-1">0 disables the border.</p>
17877
+ </div>
17878
+
17879
+ <div>
17880
+ <label for="setting_logoBorderColor" class="block text-sm font-medium text-gray-300 mb-2">
17881
+ Border Color
17882
+ </label>
17883
+ <div class="flex gap-2">
17884
+ <input
17885
+ type="color"
17886
+ id="setting_logoBorderColor_picker"
17887
+ value="${escapeHtmlAttr(/^#[0-9a-fA-F]{6}$/.test(logoBorderColor) ? logoBorderColor : "#ffffff")}"
17888
+ oninput="document.getElementById('setting_logoBorderColor').value = this.value"
17889
+ class="w-12 h-10 rounded-lg bg-white/5 border border-white/10 cursor-pointer"
17890
+ />
17891
+ <input
17892
+ type="text"
17893
+ id="setting_logoBorderColor"
17894
+ name="setting_logoBorderColor"
17895
+ value="${escapeHtmlAttr(logoBorderColor)}"
17896
+ placeholder="#ffffff"
17897
+ class="flex-1 px-3 py-2 rounded-lg bg-white/5 border border-white/10 focus:border-blue-500 focus:outline-none text-white"
17898
+ />
17899
+ </div>
17900
+ <p class="text-xs text-gray-500 mt-1">Hex, rgb(), or named color.</p>
17901
+ </div>
17902
+ </div>
17903
+
17904
+ <div>
17905
+ <label for="setting_loginUrl" class="block text-sm font-medium text-gray-300 mb-2">
17906
+ Login URL
17907
+ </label>
17908
+ <input
17909
+ type="url"
17910
+ id="setting_loginUrl"
17911
+ name="setting_loginUrl"
17912
+ value="${escapeHtmlAttr(loginUrl)}"
17913
+ placeholder="https://yourdomain.com/login"
17914
+ class="w-full px-3 py-2 rounded-lg bg-white/5 border border-white/10 focus:border-blue-500 focus:outline-none text-white"
17915
+ />
17916
+ <p class="text-xs text-gray-500 mt-1">Optional. If set, a "Sign in" button is added to the email.</p>
17917
+ </div>
17918
+
17919
+ <div>
17920
+ <label for="setting_loginButtonText" class="block text-sm font-medium text-gray-300 mb-2">
17921
+ Login Button Text
17922
+ </label>
17923
+ <input
17924
+ type="text"
17925
+ id="setting_loginButtonText"
17926
+ name="setting_loginButtonText"
17927
+ value="${escapeHtmlAttr(loginButtonText)}"
17928
+ placeholder="Sign in to ${escapeHtmlAttr(siteName)}"
17929
+ class="w-full px-3 py-2 rounded-lg bg-white/5 border border-white/10 focus:border-blue-500 focus:outline-none text-white"
17930
+ />
17931
+ <p class="text-xs text-gray-500 mt-1">Optional. Defaults to "Sign in to ${siteName}".</p>
17932
+ </div>
17933
+
17824
17934
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
17825
17935
  <div>
17826
17936
  <label for="setting_codeLength" class="block text-sm font-medium text-gray-300 mb-2">
@@ -17914,7 +18024,7 @@ function renderOTPLoginSettingsContent(plugin, settings) {
17914
18024
 
17915
18025
  <div class="bg-white rounded-lg overflow-hidden shadow-lg">
17916
18026
  <div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px 20px; text-align: center;">
17917
- ${logoUrl ? `<img src="${logoUrl}" alt="Logo" style="max-width: 150px; height: auto; margin: 0 auto 16px;">` : ""}
18027
+ ${logoUrl ? `<img src="${escapeHtmlAttr(logoUrl)}" alt="Logo" style="max-width: ${logoWidth}px; width: 100%; height: auto; margin: 0 auto 16px; ${previewLogoBorder}">` : ""}
17918
18028
  <h3 style="margin: 0 0 8px 0; font-size: 24px; font-weight: 600;">Your Login Code</h3>
17919
18029
  <p style="margin: 0; opacity: 0.95; font-size: 14px;">Enter this code to sign in to ${siteName}</p>
17920
18030
  </div>
@@ -17926,6 +18036,14 @@ function renderOTPLoginSettingsContent(plugin, settings) {
17926
18036
  </div>
17927
18037
  </div>
17928
18038
 
18039
+ ${loginUrl ? `
18040
+ <div style="text-align: center; margin: 0 0 20px 0;">
18041
+ <a href="${escapeHtmlAttr(loginUrl)}" style="display: inline-block; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; text-decoration: none; padding: 12px 28px; border-radius: 6px; font-weight: 600; font-size: 14px;">
18042
+ ${escapeHtmlAttr(previewButtonText)}
18043
+ </a>
18044
+ </div>
18045
+ ` : ""}
18046
+
17929
18047
  <div style="background: #fff3cd; border-left: 4px solid #ffc107; padding: 12px 16px; margin: 0 0 20px 0; border-radius: 4px;">
17930
18048
  <p style="margin: 0; font-size: 13px; color: #856404;">
17931
18049
  <strong>\u26A0\uFE0F This code expires in ${codeExpiryMinutes} minutes</strong>
@@ -29134,5 +29252,5 @@ var ROUTES_INFO = {
29134
29252
  };
29135
29253
 
29136
29254
  export { ROUTES_INFO, adminCheckboxRoutes, adminCollectionsRoutes, adminDesignRoutes, adminFormsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_api_default, admin_code_examples_default, admin_content_default, admin_testimonials_default, api_content_crud_default, api_default, api_media_default, api_system_default, auth_default, createUserProfilesPlugin, defineUserProfile, getConfirmationDialogScript2 as getConfirmationDialogScript, getUserProfileConfig, public_forms_default, renderConfirmationDialog2 as renderConfirmationDialog, router, router2, test_cleanup_default, userProfilesPlugin, userRoutes };
29137
- //# sourceMappingURL=chunk-KJSZMIBF.js.map
29138
- //# sourceMappingURL=chunk-KJSZMIBF.js.map
29255
+ //# sourceMappingURL=chunk-RYRNZYND.js.map
29256
+ //# sourceMappingURL=chunk-RYRNZYND.js.map