feat(notification): add admin rest management and deletion

Add revision-safe service and template APIs, channel mapping, and validated admin controls.

Ref: IT-1601
This commit is contained in:
2026-10-17 22:51:01 +03:00
parent 81654c0d33
commit 8e81572386
80 changed files with 2253 additions and 54 deletions
@@ -0,0 +1,40 @@
// Trusted parent-side measurement; template scripts stay disabled by sandbox and CSP.
(() => {
const frame = document.getElementById('previewHtmlFrame');
let observer;
let scheduled = 0;
function resizePreview() {
scheduled = 0;
const document = frame.contentDocument;
if (!document?.body) return;
frame.style.height = '0px';
const height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
frame.style.height = `${Math.max(80, Math.ceil(height) + 2)}px`;
}
function scheduleResize() {
cancelAnimationFrame(scheduled);
scheduled = requestAnimationFrame(resizePreview);
}
function preventLinkNavigation(event) {
if (event.target?.closest?.('a, area')) event.preventDefault();
}
frame.addEventListener('load', () => {
observer?.disconnect();
const document = frame.contentDocument;
if (!document?.body) return;
document.addEventListener('click', preventLinkNavigation, true);
document.addEventListener('submit', event => event.preventDefault(), true);
observer = new ResizeObserver(scheduleResize);
observer.observe(document.body);
scheduleResize();
});
window.addEventListener('resize', scheduleResize);
window.addEventListener('pagehide', () => {
observer?.disconnect();
cancelAnimationFrame(scheduled);
});
})();