Files
cms-onpageeditor/src/main.ts
T
matsandClaude Sonnet 5.5 ec4212c113 Device preview + responsive spacing in the Style panel
Style panel gets a real-viewport iframe preview (390/820/1280px) tied to the
breakpoint tab, reloaded after each edit, and spacing/gap controls per
breakpoint. The editor does not boot inside the preview frame. Mock and
tests mirror the new k6n layout template.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 11:02:20 +01:00

14 lines
607 B
TypeScript

// Production entry: served as /editor/onpage-editor.js and loaded by the page's
// own loader only when the preview cookie is set (docs/onpage-editor.md §2).
// It re-checks, so loading it by mistake never shows editor UI to visitors.
import { boot } from './boot'
import { PREVIEW_FRAME_NAME } from './style/DevicePreview'
export const previewEnabled = () => /(?:^|;\s*)cms_preview=1/.test(document.cookie)
// The device-preview iframe shows the page only; it must not boot a second editor.
if (previewEnabled() && window.name !== PREVIEW_FRAME_NAME) boot()
export { boot }
export * from './registry'