@sonicjs-cms/core 2.8.1 → 2.8.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/{app-CYEm1ytG.d.cts → app-DnQ26Lho.d.cts} +3 -0
- package/dist/{app-CYEm1ytG.d.ts → app-DnQ26Lho.d.ts} +3 -0
- package/dist/{chunk-S6K2H2TS.cjs → chunk-3G7XX4UI.cjs} +9 -9
- package/dist/{chunk-S6K2H2TS.cjs.map → chunk-3G7XX4UI.cjs.map} +1 -1
- package/dist/{chunk-KAT3OKHE.js → chunk-5XAI2XUF.js} +33 -37
- package/dist/chunk-5XAI2XUF.js.map +1 -0
- package/dist/{chunk-H7AMQWVI.js → chunk-74XCYEI7.js} +3 -3
- package/dist/{chunk-H7AMQWVI.js.map → chunk-74XCYEI7.js.map} +1 -1
- package/dist/{chunk-FZRZYQYU.js → chunk-CH5UHZVM.js} +2604 -2364
- package/dist/chunk-CH5UHZVM.js.map +1 -0
- package/dist/{chunk-7Q2XPM2U.js → chunk-GTFMI24U.js} +21 -2
- package/dist/chunk-GTFMI24U.js.map +1 -0
- package/dist/{chunk-SKLRRFJJ.cjs → chunk-HXHVU5GM.cjs} +21 -2
- package/dist/chunk-HXHVU5GM.cjs.map +1 -0
- package/dist/{chunk-WDQZYCQO.cjs → chunk-JDIM5AG7.cjs} +32 -39
- package/dist/chunk-JDIM5AG7.cjs.map +1 -0
- package/dist/{chunk-VCH6HXVP.js → chunk-JJS7JZCH.js} +58 -4
- package/dist/chunk-JJS7JZCH.js.map +1 -0
- package/dist/chunk-K4Q4SFJJ.cjs +568 -0
- package/dist/chunk-K4Q4SFJJ.cjs.map +1 -0
- package/dist/{chunk-SHCYIZAN.cjs → chunk-LTKV7AE5.cjs} +58 -4
- package/dist/chunk-LTKV7AE5.cjs.map +1 -0
- package/dist/chunk-MNWKYY5E.cjs +44 -0
- package/dist/chunk-MNWKYY5E.cjs.map +1 -0
- package/dist/{chunk-JVRRG36J.cjs → chunk-R4WR3VTN.cjs} +2393 -2153
- package/dist/chunk-R4WR3VTN.cjs.map +1 -0
- package/dist/chunk-TQABQWOP.js +39 -0
- package/dist/chunk-TQABQWOP.js.map +1 -0
- package/dist/chunk-Y3VMEGY2.js +541 -0
- package/dist/chunk-Y3VMEGY2.js.map +1 -0
- package/dist/{collection-config-BF95LgQb.d.cts → collection-config-i8EaAF7z.d.cts} +2 -1
- package/dist/{collection-config-BF95LgQb.d.ts → collection-config-i8EaAF7z.d.ts} +2 -1
- package/dist/{filter-bar.template-By4jeiw_.d.cts → filter-bar.template-Daw8ZDoq.d.cts} +1 -0
- package/dist/{filter-bar.template-By4jeiw_.d.ts → filter-bar.template-Daw8ZDoq.d.ts} +1 -0
- package/dist/index.cjs +112 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +43 -23
- package/dist/middleware.d.cts +86 -6
- package/dist/middleware.d.ts +86 -6
- package/dist/middleware.js +2 -2
- package/dist/migrations-7X4RPH7O.cjs +13 -0
- package/dist/{migrations-76NR5BVF.cjs.map → migrations-7X4RPH7O.cjs.map} +1 -1
- package/dist/migrations-KHWFJ2HN.js +4 -0
- package/dist/{migrations-2NTJ44OR.js.map → migrations-KHWFJ2HN.js.map} +1 -1
- package/dist/{plugin-bootstrap-C7Mj00Ud.d.ts → plugin-bootstrap-CJozpgmI.d.cts} +1 -1
- package/dist/{plugin-bootstrap-DKB5f8-E.d.cts → plugin-bootstrap-DU5VmuHZ.d.ts} +1 -1
- package/dist/routes.cjs +29 -28
- package/dist/routes.d.cts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +6 -5
- package/dist/services.cjs +2 -2
- package/dist/services.d.cts +2 -2
- package/dist/services.d.ts +2 -2
- package/dist/services.js +1 -1
- package/dist/templates.cjs +20 -19
- package/dist/templates.d.cts +1 -1
- package/dist/templates.d.ts +1 -1
- package/dist/templates.js +3 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +24 -23
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +2 -1
- package/dist/{version-vktVAxhe.d.cts → version-C_CXrN_T.d.cts} +5 -0
- package/dist/{version-vktVAxhe.d.ts → version-C_CXrN_T.d.ts} +5 -0
- package/migrations/032_user_profiles.sql +36 -0
- package/package.json +2 -2
- package/dist/chunk-7Q2XPM2U.js.map +0 -1
- package/dist/chunk-FZRZYQYU.js.map +0 -1
- package/dist/chunk-GIWIJNBH.cjs +0 -243
- package/dist/chunk-GIWIJNBH.cjs.map +0 -1
- package/dist/chunk-JVRRG36J.cjs.map +0 -1
- package/dist/chunk-KAT3OKHE.js.map +0 -1
- package/dist/chunk-QWTS6NSP.js +0 -221
- package/dist/chunk-QWTS6NSP.js.map +0 -1
- package/dist/chunk-SHCYIZAN.cjs.map +0 -1
- package/dist/chunk-SKLRRFJJ.cjs.map +0 -1
- package/dist/chunk-VCH6HXVP.js.map +0 -1
- package/dist/chunk-WDQZYCQO.cjs.map +0 -1
- package/dist/migrations-2NTJ44OR.js +0 -4
- package/dist/migrations-76NR5BVF.cjs +0 -13
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { escapeHtml } from './chunk-TQABQWOP.js';
|
|
1
2
|
import { __esm, __export, __toCommonJS } from './chunk-V4OQ3NZ2.js';
|
|
2
3
|
|
|
3
4
|
// src/templates/components/logo.template.ts
|
|
@@ -225,6 +226,58 @@ function renderAdminLayoutCatalyst(data) {
|
|
|
225
226
|
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
|
226
227
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
|
|
227
228
|
|
|
229
|
+
<!-- CSRF: Auto-attach token to all HTMX and fetch requests -->
|
|
230
|
+
<script>
|
|
231
|
+
function getCsrfToken() {
|
|
232
|
+
var cookie = document.cookie.split('; ')
|
|
233
|
+
.find(function(row) { return row.startsWith('csrf_token='); });
|
|
234
|
+
return cookie ? cookie.substring(cookie.indexOf('=') + 1) : '';
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
document.addEventListener('htmx:configRequest', function(event) {
|
|
238
|
+
var token = getCsrfToken();
|
|
239
|
+
if (token) {
|
|
240
|
+
event.detail.headers['X-CSRF-Token'] = token;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
(function() {
|
|
245
|
+
var originalFetch = window.fetch;
|
|
246
|
+
window.fetch = function(url, options) {
|
|
247
|
+
options = options || {};
|
|
248
|
+
var method = (options.method || 'GET').toUpperCase();
|
|
249
|
+
if (method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS') {
|
|
250
|
+
options.headers = options.headers || {};
|
|
251
|
+
if (options.headers instanceof Headers) {
|
|
252
|
+
if (!options.headers.has('X-CSRF-Token')) {
|
|
253
|
+
options.headers.set('X-CSRF-Token', getCsrfToken());
|
|
254
|
+
}
|
|
255
|
+
} else if (!Array.isArray(options.headers) && !options.headers['X-CSRF-Token']) {
|
|
256
|
+
options.headers['X-CSRF-Token'] = getCsrfToken();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return originalFetch.call(this, url, options);
|
|
260
|
+
};
|
|
261
|
+
})();
|
|
262
|
+
|
|
263
|
+
// Inject _csrf hidden field into regular form submissions (non-HTMX)
|
|
264
|
+
document.addEventListener('submit', function(event) {
|
|
265
|
+
var form = event.target;
|
|
266
|
+
if (!form || !form.tagName || form.tagName !== 'FORM') return;
|
|
267
|
+
var method = (form.method || 'GET').toUpperCase();
|
|
268
|
+
if (method === 'GET') return;
|
|
269
|
+
if (form.hasAttribute('hx-post') || form.hasAttribute('hx-put') ||
|
|
270
|
+
form.hasAttribute('hx-delete') || form.hasAttribute('hx-patch')) return;
|
|
271
|
+
if (!form.querySelector('input[name="_csrf"]')) {
|
|
272
|
+
var input = document.createElement('input');
|
|
273
|
+
input.type = 'hidden';
|
|
274
|
+
input.name = '_csrf';
|
|
275
|
+
input.value = getCsrfToken();
|
|
276
|
+
form.appendChild(input);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
</script>
|
|
280
|
+
|
|
228
281
|
${data.styles ? data.styles.map((style) => `<link rel="stylesheet" href="${style}">`).join("\n ") : ""}
|
|
229
282
|
${data.scripts ? data.scripts.map((script) => `<script src="${script}"></script>`).join("\n ") : ""}
|
|
230
283
|
</head>
|
|
@@ -666,11 +719,11 @@ function renderAlert(data) {
|
|
|
666
719
|
<div class="${data.icon !== false ? "ml-3" : ""}">
|
|
667
720
|
${data.title ? `
|
|
668
721
|
<h3 class="text-sm font-semibold ${textClasses[data.type]}">
|
|
669
|
-
${data.title}
|
|
722
|
+
${escapeHtml(data.title)}
|
|
670
723
|
</h3>
|
|
671
724
|
` : ""}
|
|
672
725
|
<div class="${data.title ? "mt-1 text-sm" : "text-sm"} ${messageTextClasses[data.type]}">
|
|
673
|
-
<p>${data.message}</p>
|
|
726
|
+
<p>${escapeHtml(data.message)}</p>
|
|
674
727
|
</div>
|
|
675
728
|
</div>
|
|
676
729
|
${data.dismissible ? `
|
|
@@ -3365,6 +3418,7 @@ function renderForm(data) {
|
|
|
3365
3418
|
class="${data.className || "space-y-6"}"
|
|
3366
3419
|
${data.fields.some((f) => f.type === "file") ? 'enctype="multipart/form-data"' : ""}
|
|
3367
3420
|
>
|
|
3421
|
+
${data.csrfToken ? `<input type="hidden" name="_csrf" value="${data.csrfToken}">` : ""}
|
|
3368
3422
|
${data.title ? `
|
|
3369
3423
|
<div class="mb-6">
|
|
3370
3424
|
<h2 class="text-lg font-medium text-gray-1">${data.title}</h2>
|
|
@@ -3543,5 +3597,5 @@ function renderFormField(field) {
|
|
|
3543
3597
|
}
|
|
3544
3598
|
|
|
3545
3599
|
export { adminLayoutV2, getConfirmationDialogScript, init_admin_layout_catalyst_template, init_logo_template, renderAdminLayout, renderAdminLayoutCatalyst, renderAlert, renderCheckboxPage, renderCodeExamplesList, renderConfirmationDialog, renderDesignPage, renderForm, renderFormField, renderLogo, renderPagination, renderTable, renderTestimonialsList };
|
|
3546
|
-
//# sourceMappingURL=chunk-
|
|
3547
|
-
//# sourceMappingURL=chunk-
|
|
3600
|
+
//# sourceMappingURL=chunk-JJS7JZCH.js.map
|
|
3601
|
+
//# sourceMappingURL=chunk-JJS7JZCH.js.map
|