@prenta/admin 0.92.0 → 0.94.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.
- package/CHANGELOG.md +663 -0
- package/design-system/tokens.css +173 -71
- package/design-system/tokens.json +244 -63
- package/design-system/tokens.scss +203 -98
- package/design-system/tokens.tailwind.cjs +93 -38
- package/dist/AdminRoot.d.ts +27 -6
- package/dist/AdminRoot.d.ts.map +1 -1
- package/dist/AdminRoot.js.map +1 -1
- package/dist/__tests__/components/breakpoint-controls.render.test.d.ts +2 -0
- package/dist/__tests__/components/breakpoint-controls.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/breakpoint-controls.render.test.js +51 -0
- package/dist/__tests__/components/breakpoint-controls.render.test.js.map +1 -0
- package/dist/__tests__/components/canvas-edit-tip.render.test.d.ts +2 -0
- package/dist/__tests__/components/canvas-edit-tip.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/canvas-edit-tip.render.test.js +37 -0
- package/dist/__tests__/components/canvas-edit-tip.render.test.js.map +1 -0
- package/dist/__tests__/components/editor-rail.render.test.d.ts +2 -0
- package/dist/__tests__/components/editor-rail.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/editor-rail.render.test.js +138 -0
- package/dist/__tests__/components/editor-rail.render.test.js.map +1 -0
- package/dist/__tests__/components/media-block.render.test.d.ts +2 -0
- package/dist/__tests__/components/media-block.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/media-block.render.test.js +108 -0
- package/dist/__tests__/components/media-block.render.test.js.map +1 -0
- package/dist/__tests__/components/page-audit-panel.render.test.d.ts +2 -0
- package/dist/__tests__/components/page-audit-panel.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/page-audit-panel.render.test.js +59 -0
- package/dist/__tests__/components/page-audit-panel.render.test.js.map +1 -0
- package/dist/__tests__/components/reflow-meter.render.test.d.ts +2 -0
- package/dist/__tests__/components/reflow-meter.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/reflow-meter.render.test.js +94 -0
- package/dist/__tests__/components/reflow-meter.render.test.js.map +1 -0
- package/dist/__tests__/components/seo-char-count.test.js +24 -6
- package/dist/__tests__/components/seo-char-count.test.js.map +1 -1
- package/dist/__tests__/components/serp-preview.render.test.d.ts +2 -0
- package/dist/__tests__/components/serp-preview.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/serp-preview.render.test.js +25 -0
- package/dist/__tests__/components/serp-preview.render.test.js.map +1 -0
- package/dist/__tests__/lib/breakpoints.test.d.ts +2 -0
- package/dist/__tests__/lib/breakpoints.test.d.ts.map +1 -0
- package/dist/__tests__/lib/breakpoints.test.js +67 -0
- package/dist/__tests__/lib/breakpoints.test.js.map +1 -0
- package/dist/__tests__/lib/canvas-edit-chrome.test.d.ts +2 -0
- package/dist/__tests__/lib/canvas-edit-chrome.test.d.ts.map +1 -0
- package/dist/__tests__/lib/canvas-edit-chrome.test.js +44 -0
- package/dist/__tests__/lib/canvas-edit-chrome.test.js.map +1 -0
- package/dist/__tests__/lib/media-format.test.d.ts +2 -0
- package/dist/__tests__/lib/media-format.test.d.ts.map +1 -0
- package/dist/__tests__/lib/media-format.test.js +70 -0
- package/dist/__tests__/lib/media-format.test.js.map +1 -0
- package/dist/__tests__/lib/page-audit-input.test.d.ts +2 -0
- package/dist/__tests__/lib/page-audit-input.test.d.ts.map +1 -0
- package/dist/__tests__/lib/page-audit-input.test.js +122 -0
- package/dist/__tests__/lib/page-audit-input.test.js.map +1 -0
- package/dist/__tests__/lib/page-editor-service.test.js +2 -0
- package/dist/__tests__/lib/page-editor-service.test.js.map +1 -1
- package/dist/__tests__/lib/page-redirect.test.d.ts +2 -0
- package/dist/__tests__/lib/page-redirect.test.d.ts.map +1 -0
- package/dist/__tests__/lib/page-redirect.test.js +26 -0
- package/dist/__tests__/lib/page-redirect.test.js.map +1 -0
- package/dist/__tests__/lib/rail-width.test.d.ts +2 -0
- package/dist/__tests__/lib/rail-width.test.d.ts.map +1 -0
- package/dist/__tests__/lib/rail-width.test.js +69 -0
- package/dist/__tests__/lib/rail-width.test.js.map +1 -0
- package/dist/__tests__/lib/reflow-baseline.test.d.ts +2 -0
- package/dist/__tests__/lib/reflow-baseline.test.d.ts.map +1 -0
- package/dist/__tests__/lib/reflow-baseline.test.js +56 -0
- package/dist/__tests__/lib/reflow-baseline.test.js.map +1 -0
- package/dist/__tests__/lib/reflow-probe.test.d.ts +2 -0
- package/dist/__tests__/lib/reflow-probe.test.d.ts.map +1 -0
- package/dist/__tests__/lib/reflow-probe.test.js +73 -0
- package/dist/__tests__/lib/reflow-probe.test.js.map +1 -0
- package/dist/__tests__/lib/version-diff.test.d.ts +2 -0
- package/dist/__tests__/lib/version-diff.test.d.ts.map +1 -0
- package/dist/__tests__/lib/version-diff.test.js +230 -0
- package/dist/__tests__/lib/version-diff.test.js.map +1 -0
- package/dist/__tests__/lib/version-history.test.d.ts +2 -0
- package/dist/__tests__/lib/version-history.test.d.ts.map +1 -0
- package/dist/__tests__/lib/version-history.test.js +125 -0
- package/dist/__tests__/lib/version-history.test.js.map +1 -0
- package/dist/__tests__/styles/canvas-container-queries.test.d.ts +2 -0
- package/dist/__tests__/styles/canvas-container-queries.test.d.ts.map +1 -0
- package/dist/__tests__/styles/canvas-container-queries.test.js +87 -0
- package/dist/__tests__/styles/canvas-container-queries.test.js.map +1 -0
- package/dist/__tests__/styles/packaging.test.d.ts +2 -0
- package/dist/__tests__/styles/packaging.test.d.ts.map +1 -0
- package/dist/__tests__/styles/packaging.test.js +31 -0
- package/dist/__tests__/styles/packaging.test.js.map +1 -0
- package/dist/__tests__/styles/responsive-layer.test.d.ts +2 -0
- package/dist/__tests__/styles/responsive-layer.test.d.ts.map +1 -0
- package/dist/__tests__/styles/responsive-layer.test.js +127 -0
- package/dist/__tests__/styles/responsive-layer.test.js.map +1 -0
- package/dist/__tests__/styles/tokens-drift.test.d.ts +2 -0
- package/dist/__tests__/styles/tokens-drift.test.d.ts.map +1 -0
- package/dist/__tests__/styles/tokens-drift.test.js +92 -0
- package/dist/__tests__/styles/tokens-drift.test.js.map +1 -0
- package/dist/__tests__/views/admin-renderer-compat.test.d.ts +2 -0
- package/dist/__tests__/views/admin-renderer-compat.test.d.ts.map +1 -0
- package/dist/__tests__/views/admin-renderer-compat.test.js +43 -0
- package/dist/__tests__/views/admin-renderer-compat.test.js.map +1 -0
- package/dist/__tests__/views/admin-section-renderers.test.js +52 -4
- package/dist/__tests__/views/admin-section-renderers.test.js.map +1 -1
- package/dist/__tests__/views/canvas-review-mode.render.test.d.ts +2 -0
- package/dist/__tests__/views/canvas-review-mode.render.test.d.ts.map +1 -0
- package/dist/__tests__/views/canvas-review-mode.render.test.js +70 -0
- package/dist/__tests__/views/canvas-review-mode.render.test.js.map +1 -0
- package/dist/__tests__/views/editor-top-bar.render.test.js +30 -1
- package/dist/__tests__/views/editor-top-bar.render.test.js.map +1 -1
- package/dist/__tests__/views/page-tab.render.test.d.ts +2 -0
- package/dist/__tests__/views/page-tab.render.test.d.ts.map +1 -0
- package/dist/__tests__/views/page-tab.render.test.js +151 -0
- package/dist/__tests__/views/page-tab.render.test.js.map +1 -0
- package/dist/__tests__/views/section-class-parity.test.d.ts +2 -0
- package/dist/__tests__/views/section-class-parity.test.d.ts.map +1 -0
- package/dist/__tests__/views/section-class-parity.test.js +81 -0
- package/dist/__tests__/views/section-class-parity.test.js.map +1 -0
- package/dist/__tests__/views/sections-panel-design-owned.render.test.d.ts +2 -0
- package/dist/__tests__/views/sections-panel-design-owned.render.test.d.ts.map +1 -0
- package/dist/__tests__/views/sections-panel-design-owned.render.test.js +86 -0
- package/dist/__tests__/views/sections-panel-design-owned.render.test.js.map +1 -0
- package/dist/__tests__/views/version-history-panel.render.test.d.ts +2 -0
- package/dist/__tests__/views/version-history-panel.render.test.d.ts.map +1 -0
- package/dist/__tests__/views/version-history-panel.render.test.js +153 -0
- package/dist/__tests__/views/version-history-panel.render.test.js.map +1 -0
- package/dist/components/BreakpointPicker.d.ts +18 -0
- package/dist/components/BreakpointPicker.d.ts.map +1 -0
- package/dist/components/BreakpointPicker.js +31 -0
- package/dist/components/BreakpointPicker.js.map +1 -0
- package/dist/components/CanvasEditTip.d.ts +6 -0
- package/dist/components/CanvasEditTip.d.ts.map +1 -0
- package/dist/components/CanvasEditTip.js +22 -0
- package/dist/components/CanvasEditTip.js.map +1 -0
- package/dist/components/EditorRail.d.ts +36 -0
- package/dist/components/EditorRail.d.ts.map +1 -0
- package/dist/components/EditorRail.js +104 -0
- package/dist/components/EditorRail.js.map +1 -0
- package/dist/components/EditorRailTabs.d.ts +32 -0
- package/dist/components/EditorRailTabs.d.ts.map +1 -0
- package/dist/components/EditorRailTabs.js +45 -0
- package/dist/components/EditorRailTabs.js.map +1 -0
- package/dist/components/MediaBlock.d.ts +49 -0
- package/dist/components/MediaBlock.d.ts.map +1 -0
- package/dist/components/MediaBlock.js +50 -0
- package/dist/components/MediaBlock.js.map +1 -0
- package/dist/components/ReflowMeter.d.ts +28 -0
- package/dist/components/ReflowMeter.d.ts.map +1 -0
- package/dist/components/ReflowMeter.js +42 -0
- package/dist/components/ReflowMeter.js.map +1 -0
- package/dist/components/ZoomChip.d.ts +17 -0
- package/dist/components/ZoomChip.d.ts.map +1 -0
- package/dist/components/ZoomChip.js +17 -0
- package/dist/components/ZoomChip.js.map +1 -0
- package/dist/components/breakpoint-icons.d.ts +3 -0
- package/dist/components/breakpoint-icons.d.ts.map +1 -0
- package/dist/components/breakpoint-icons.js +16 -0
- package/dist/components/breakpoint-icons.js.map +1 -0
- package/dist/components/page-tab/AuthorPicker.d.ts +31 -0
- package/dist/components/page-tab/AuthorPicker.d.ts.map +1 -0
- package/dist/components/page-tab/AuthorPicker.js +95 -0
- package/dist/components/page-tab/AuthorPicker.js.map +1 -0
- package/dist/components/page-tab/DirectiveSwitch.d.ts +38 -0
- package/dist/components/page-tab/DirectiveSwitch.d.ts.map +1 -0
- package/dist/components/page-tab/DirectiveSwitch.js +33 -0
- package/dist/components/page-tab/DirectiveSwitch.js.map +1 -0
- package/dist/components/seo/EditorSeoScoreBadge.d.ts +8 -1
- package/dist/components/seo/EditorSeoScoreBadge.d.ts.map +1 -1
- package/dist/components/seo/EditorSeoScoreBadge.js +2 -2
- package/dist/components/seo/EditorSeoScoreBadge.js.map +1 -1
- package/dist/components/seo/PageAuditPanel.d.ts +14 -0
- package/dist/components/seo/PageAuditPanel.d.ts.map +1 -0
- package/dist/components/seo/PageAuditPanel.js +59 -0
- package/dist/components/seo/PageAuditPanel.js.map +1 -0
- package/dist/components/seo/SeoCharCount.d.ts +19 -7
- package/dist/components/seo/SeoCharCount.d.ts.map +1 -1
- package/dist/components/seo/SeoCharCount.js +30 -16
- package/dist/components/seo/SeoCharCount.js.map +1 -1
- package/dist/components/seo/SeoEditorPane.d.ts +15 -1
- package/dist/components/seo/SeoEditorPane.d.ts.map +1 -1
- package/dist/components/seo/SeoEditorPane.js +118 -21
- package/dist/components/seo/SeoEditorPane.js.map +1 -1
- package/dist/components/seo/SerpPreview.d.ts +20 -0
- package/dist/components/seo/SerpPreview.d.ts.map +1 -0
- package/dist/components/seo/SerpPreview.js +6 -0
- package/dist/components/seo/SerpPreview.js.map +1 -0
- package/dist/hooks/usePageAudit.d.ts +41 -0
- package/dist/hooks/usePageAudit.d.ts.map +1 -0
- package/dist/hooks/usePageAudit.js +68 -0
- package/dist/hooks/usePageAudit.js.map +1 -0
- package/dist/hooks/useReflowGuard.d.ts +47 -0
- package/dist/hooks/useReflowGuard.d.ts.map +1 -0
- package/dist/hooks/useReflowGuard.js +52 -0
- package/dist/hooks/useReflowGuard.js.map +1 -0
- package/dist/layout/primitives/AdminShell.d.ts.map +1 -1
- package/dist/layout/primitives/AdminShell.js +2 -2
- package/dist/layout/primitives/AdminShell.js.map +1 -1
- package/dist/lib/breakpoints.d.ts +51 -0
- package/dist/lib/breakpoints.d.ts.map +1 -0
- package/dist/lib/breakpoints.js +84 -0
- package/dist/lib/breakpoints.js.map +1 -0
- package/dist/lib/canvas-edit-chrome.d.ts +22 -0
- package/dist/lib/canvas-edit-chrome.d.ts.map +1 -0
- package/dist/lib/canvas-edit-chrome.js +81 -0
- package/dist/lib/canvas-edit-chrome.js.map +1 -0
- package/dist/lib/media-format.d.ts +55 -0
- package/dist/lib/media-format.d.ts.map +1 -0
- package/dist/lib/media-format.js +93 -0
- package/dist/lib/media-format.js.map +1 -0
- package/dist/lib/page-audit-input.d.ts +45 -0
- package/dist/lib/page-audit-input.d.ts.map +1 -0
- package/dist/lib/page-audit-input.js +53 -0
- package/dist/lib/page-audit-input.js.map +1 -0
- package/dist/lib/page-editor-service.d.ts +12 -0
- package/dist/lib/page-editor-service.d.ts.map +1 -1
- package/dist/lib/page-editor-service.js +6 -0
- package/dist/lib/page-editor-service.js.map +1 -1
- package/dist/lib/page-redirect.d.ts +39 -0
- package/dist/lib/page-redirect.d.ts.map +1 -0
- package/dist/lib/page-redirect.js +38 -0
- package/dist/lib/page-redirect.js.map +1 -0
- package/dist/lib/rail-width.d.ts +23 -0
- package/dist/lib/rail-width.d.ts.map +1 -0
- package/dist/lib/rail-width.js +59 -0
- package/dist/lib/rail-width.js.map +1 -0
- package/dist/lib/reflow-baseline.d.ts +45 -0
- package/dist/lib/reflow-baseline.d.ts.map +1 -0
- package/dist/lib/reflow-baseline.js +38 -0
- package/dist/lib/reflow-baseline.js.map +1 -0
- package/dist/lib/reflow-probe.d.ts +159 -0
- package/dist/lib/reflow-probe.d.ts.map +1 -0
- package/dist/lib/reflow-probe.js +228 -0
- package/dist/lib/reflow-probe.js.map +1 -0
- package/dist/lib/seo-service.d.ts +10 -0
- package/dist/lib/seo-service.d.ts.map +1 -1
- package/dist/lib/seo-service.js.map +1 -1
- package/dist/lib/version-diff.d.ts +50 -0
- package/dist/lib/version-diff.d.ts.map +1 -0
- package/dist/lib/version-diff.js +294 -0
- package/dist/lib/version-diff.js.map +1 -0
- package/dist/lib/version-history.d.ts +73 -0
- package/dist/lib/version-history.d.ts.map +1 -0
- package/dist/lib/version-history.js +126 -0
- package/dist/lib/version-history.js.map +1 -0
- package/dist/prenta-admin.css +1 -1
- package/dist/views/page-editor/CanvasMetaLine.d.ts +19 -0
- package/dist/views/page-editor/CanvasMetaLine.d.ts.map +1 -0
- package/dist/views/page-editor/CanvasMetaLine.js +23 -0
- package/dist/views/page-editor/CanvasMetaLine.js.map +1 -0
- package/dist/views/page-editor/EditorCanvas.d.ts +47 -8
- package/dist/views/page-editor/EditorCanvas.d.ts.map +1 -1
- package/dist/views/page-editor/EditorCanvas.js +68 -34
- package/dist/views/page-editor/EditorCanvas.js.map +1 -1
- package/dist/views/page-editor/EditorTopBar.d.ts +21 -2
- package/dist/views/page-editor/EditorTopBar.d.ts.map +1 -1
- package/dist/views/page-editor/EditorTopBar.js +13 -20
- package/dist/views/page-editor/EditorTopBar.js.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.js +383 -78
- package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
- package/dist/views/page-editor/PageTab.d.ts +36 -0
- package/dist/views/page-editor/PageTab.d.ts.map +1 -0
- package/dist/views/page-editor/PageTab.js +65 -0
- package/dist/views/page-editor/PageTab.js.map +1 -0
- package/dist/views/page-editor/ReviewBar.d.ts +21 -0
- package/dist/views/page-editor/ReviewBar.d.ts.map +1 -0
- package/dist/views/page-editor/ReviewBar.js +22 -0
- package/dist/views/page-editor/ReviewBar.js.map +1 -0
- package/dist/views/page-editor/SectionInspector.d.ts.map +1 -1
- package/dist/views/page-editor/SectionInspector.js +64 -20
- package/dist/views/page-editor/SectionInspector.js.map +1 -1
- package/dist/views/page-editor/SectionsPanel.d.ts +30 -5
- package/dist/views/page-editor/SectionsPanel.d.ts.map +1 -1
- package/dist/views/page-editor/SectionsPanel.js +38 -7
- package/dist/views/page-editor/SectionsPanel.js.map +1 -1
- package/dist/views/page-editor/SitePreviewFrame.d.ts.map +1 -1
- package/dist/views/page-editor/SitePreviewFrame.js +3 -0
- package/dist/views/page-editor/SitePreviewFrame.js.map +1 -1
- package/dist/views/page-editor/VersionHistoryPanel.d.ts +29 -0
- package/dist/views/page-editor/VersionHistoryPanel.d.ts.map +1 -0
- package/dist/views/page-editor/VersionHistoryPanel.js +81 -0
- package/dist/views/page-editor/VersionHistoryPanel.js.map +1 -0
- package/dist/views/page-editor/reflow-context.d.ts +28 -0
- package/dist/views/page-editor/reflow-context.d.ts.map +1 -0
- package/dist/views/page-editor/reflow-context.js +14 -0
- package/dist/views/page-editor/reflow-context.js.map +1 -0
- package/dist/views/page-editor/sections/ByTheNumbersSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/ByTheNumbersSection.js +1 -1
- package/dist/views/page-editor/sections/ByTheNumbersSection.js.map +1 -1
- package/dist/views/page-editor/sections/CtaBannerSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/CtaBannerSection.js +1 -1
- package/dist/views/page-editor/sections/CtaBannerSection.js.map +1 -1
- package/dist/views/page-editor/sections/FeatureHighlightSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/FeatureHighlightSection.js +2 -2
- package/dist/views/page-editor/sections/FeatureHighlightSection.js.map +1 -1
- package/dist/views/page-editor/sections/GallerySection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/GallerySection.js +7 -3
- package/dist/views/page-editor/sections/GallerySection.js.map +1 -1
- package/dist/views/page-editor/sections/HeroBannerSection.js +1 -1
- package/dist/views/page-editor/sections/HeroBannerSection.js.map +1 -1
- package/dist/views/page-editor/sections/MissionSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/MissionSection.js +1 -1
- package/dist/views/page-editor/sections/MissionSection.js.map +1 -1
- package/dist/views/page-editor/sections/PullQuoteSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/PullQuoteSection.js +1 -1
- package/dist/views/page-editor/sections/PullQuoteSection.js.map +1 -1
- package/dist/views/page-editor/sections/RelatedPostsSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/RelatedPostsSection.js +1 -1
- package/dist/views/page-editor/sections/RelatedPostsSection.js.map +1 -1
- package/dist/views/page-editor/sections/SectionRenderer.d.ts +13 -1
- package/dist/views/page-editor/sections/SectionRenderer.d.ts.map +1 -1
- package/dist/views/page-editor/sections/SectionRenderer.js +66 -26
- package/dist/views/page-editor/sections/SectionRenderer.js.map +1 -1
- package/dist/views/page-editor/sections/admin-renderers.d.ts +47 -15
- package/dist/views/page-editor/sections/admin-renderers.d.ts.map +1 -1
- package/dist/views/page-editor/sections/admin-renderers.js +27 -15
- package/dist/views/page-editor/sections/admin-renderers.js.map +1 -1
- package/dist/views/page-editor/sections/parts.d.ts +0 -1
- package/dist/views/page-editor/sections/parts.d.ts.map +1 -1
- package/dist/views/page-editor/sections/parts.js +41 -16
- package/dist/views/page-editor/sections/parts.js.map +1 -1
- package/dist/views/page-editor/viewports.d.ts +7 -14
- package/dist/views/page-editor/viewports.d.ts.map +1 -1
- package/dist/views/page-editor/viewports.js +7 -12
- package/dist/views/page-editor/viewports.js.map +1 -1
- package/dist/views/post-editor/PostEditorCanvas.d.ts +2 -1
- package/dist/views/post-editor/PostEditorCanvas.d.ts.map +1 -1
- package/dist/views/post-editor/PostEditorCanvas.js +5 -2
- package/dist/views/post-editor/PostEditorCanvas.js.map +1 -1
- package/dist/views/post-editor/PostSectionEditor.d.ts.map +1 -1
- package/dist/views/post-editor/PostSectionEditor.js +2 -20
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
- package/dist/views/post-editor/PostTemplateEditor.d.ts.map +1 -1
- package/dist/views/post-editor/PostTemplateEditor.js +4 -1
- package/dist/views/post-editor/PostTemplateEditor.js.map +1 -1
- package/package.json +5 -3
- package/src/AdminRoot.tsx +27 -6
- package/src/__tests__/components/breakpoint-controls.render.test.tsx +57 -0
- package/src/__tests__/components/canvas-edit-tip.render.test.tsx +41 -0
- package/src/__tests__/components/editor-rail.render.test.tsx +192 -0
- package/src/__tests__/components/media-block.render.test.tsx +126 -0
- package/src/__tests__/components/page-audit-panel.render.test.tsx +64 -0
- package/src/__tests__/components/reflow-meter.render.test.tsx +144 -0
- package/src/__tests__/components/seo-char-count.test.tsx +26 -6
- package/src/__tests__/components/serp-preview.render.test.tsx +32 -0
- package/src/__tests__/lib/breakpoints.test.ts +84 -0
- package/src/__tests__/lib/canvas-edit-chrome.test.ts +56 -0
- package/src/__tests__/lib/media-format.test.ts +89 -0
- package/src/__tests__/lib/page-audit-input.test.ts +144 -0
- package/src/__tests__/lib/page-editor-service.test.ts +2 -0
- package/src/__tests__/lib/page-redirect.test.ts +29 -0
- package/src/__tests__/lib/rail-width.test.ts +86 -0
- package/src/__tests__/lib/reflow-baseline.test.ts +64 -0
- package/src/__tests__/lib/reflow-probe.test.ts +95 -0
- package/src/__tests__/lib/version-diff.test.ts +278 -0
- package/src/__tests__/lib/version-history.test.ts +166 -0
- package/src/__tests__/styles/canvas-container-queries.test.ts +103 -0
- package/src/__tests__/styles/packaging.test.ts +38 -0
- package/src/__tests__/styles/responsive-layer.test.ts +152 -0
- package/src/__tests__/styles/tokens-drift.test.ts +110 -0
- package/src/__tests__/views/admin-renderer-compat.test.ts +48 -0
- package/src/__tests__/views/admin-section-renderers.test.tsx +70 -4
- package/src/__tests__/views/canvas-review-mode.render.test.tsx +94 -0
- package/src/__tests__/views/editor-top-bar.render.test.tsx +43 -1
- package/src/__tests__/views/page-tab.render.test.tsx +226 -0
- package/src/__tests__/views/section-class-parity.test.ts +98 -0
- package/src/__tests__/views/sections-panel-design-owned.render.test.tsx +104 -0
- package/src/__tests__/views/version-history-panel.render.test.tsx +195 -0
- package/src/components/BreakpointPicker.tsx +114 -0
- package/src/components/CanvasEditTip.tsx +46 -0
- package/src/components/EditorRail.tsx +219 -0
- package/src/components/EditorRailTabs.tsx +117 -0
- package/src/components/MediaBlock.tsx +223 -0
- package/src/components/ReflowMeter.tsx +125 -0
- package/src/components/ZoomChip.tsx +39 -0
- package/src/components/breakpoint-icons.ts +17 -0
- package/src/components/page-tab/AuthorPicker.tsx +240 -0
- package/src/components/page-tab/DirectiveSwitch.tsx +89 -0
- package/src/components/seo/EditorSeoScoreBadge.tsx +9 -1
- package/src/components/seo/PageAuditPanel.tsx +192 -0
- package/src/components/seo/SeoCharCount.tsx +55 -24
- package/src/components/seo/SeoEditorPane.tsx +213 -31
- package/src/components/seo/SerpPreview.tsx +41 -0
- package/src/hooks/usePageAudit.ts +98 -0
- package/src/hooks/useReflowGuard.ts +96 -0
- package/src/layout/primitives/AdminShell.tsx +13 -1
- package/src/lib/breakpoints.ts +107 -0
- package/src/lib/canvas-edit-chrome.ts +82 -0
- package/src/lib/media-format.ts +99 -0
- package/src/lib/page-audit-input.ts +104 -0
- package/src/lib/page-editor-service.ts +18 -0
- package/src/lib/page-redirect.ts +60 -0
- package/src/lib/rail-width.ts +58 -0
- package/src/lib/reflow-baseline.ts +70 -0
- package/src/lib/reflow-probe.ts +299 -0
- package/src/lib/seo-service.ts +10 -0
- package/src/lib/version-diff.ts +376 -0
- package/src/lib/version-history.ts +192 -0
- package/src/styles/prenta-tokens.css +120 -42
- package/src/styles/responsive.css +281 -0
- package/src/styles/theme.css +138 -0
- package/src/views/page-editor/CanvasMetaLine.tsx +50 -0
- package/src/views/page-editor/EditorCanvas.tsx +140 -54
- package/src/views/page-editor/EditorTopBar.tsx +55 -51
- package/src/views/page-editor/PageSectionEditor.tsx +575 -185
- package/src/views/page-editor/PageTab.tsx +433 -0
- package/src/views/page-editor/ReviewBar.tsx +76 -0
- package/src/views/page-editor/SectionInspector.tsx +84 -42
- package/src/views/page-editor/SectionsPanel.tsx +282 -141
- package/src/views/page-editor/SitePreviewFrame.tsx +3 -0
- package/src/views/page-editor/VersionHistoryPanel.tsx +302 -0
- package/src/views/page-editor/reflow-context.ts +43 -0
- package/src/views/page-editor/sections/ByTheNumbersSection.tsx +3 -2
- package/src/views/page-editor/sections/CtaBannerSection.tsx +3 -1
- package/src/views/page-editor/sections/FeatureHighlightSection.tsx +3 -2
- package/src/views/page-editor/sections/GallerySection.tsx +7 -3
- package/src/views/page-editor/sections/HeroBannerSection.tsx +2 -2
- package/src/views/page-editor/sections/MissionSection.tsx +4 -2
- package/src/views/page-editor/sections/PullQuoteSection.tsx +3 -1
- package/src/views/page-editor/sections/RelatedPostsSection.tsx +2 -1
- package/src/views/page-editor/sections/SectionRenderer.tsx +115 -34
- package/src/views/page-editor/sections/admin-renderers.tsx +54 -15
- package/src/views/page-editor/sections/parts.tsx +46 -18
- package/src/views/page-editor/viewports.ts +13 -26
- package/src/views/post-editor/PostEditorCanvas.tsx +18 -11
- package/src/views/post-editor/PostSectionEditor.tsx +1 -56
- package/src/views/post-editor/PostTemplateEditor.tsx +3 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Prenta admin — responsive + accessibility layer.
|
|
3
|
+
*
|
|
4
|
+
* Port of `design-system/cms-responsive.css` from the page-builder design
|
|
5
|
+
* bundle. The prototype's own selectors (`.ni`, `.sec-panel`, `.icbtn`) do not
|
|
6
|
+
* exist here — this admin is Tailwind over the same tokens — so what is ported
|
|
7
|
+
* is the RULES, re-expressed against this codebase's real structure.
|
|
8
|
+
*
|
|
9
|
+
* Loaded after `theme.css`'s token blocks so it can adapt them, and scoped to
|
|
10
|
+
* `.prenta-admin` throughout: the admin renders inside consumer applications
|
|
11
|
+
* and must not restyle the host.
|
|
12
|
+
*
|
|
13
|
+
* Two rules from the source deliberately did NOT come across:
|
|
14
|
+
*
|
|
15
|
+
* - The prototype turns the sidebar into a fixed bottom bar under 768px.
|
|
16
|
+
* `AdminShell` already solves that size with a slide-in overlay driven by
|
|
17
|
+
* `matchMedia`, which the whole admin is built around; replacing a working
|
|
18
|
+
* navigation pattern was not part of finishing the page builder.
|
|
19
|
+
* - The blanket `min-height: 44px` on a list of prototype control classes.
|
|
20
|
+
* The equivalent here is `.prenta-touch-target`, applied per control —
|
|
21
|
+
* see the coarse-pointer block below for why a blanket `button` rule is
|
|
22
|
+
* the wrong shape.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/* ── Accessibility: applies at every size ─────────────────────────── */
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* A visible focus ring on everything, as a floor.
|
|
29
|
+
*
|
|
30
|
+
* `:focus-visible` rather than `:focus` so pointer users never see it. This
|
|
31
|
+
* sits in the base layer, so any component that opts into its own ring
|
|
32
|
+
* (`focus-visible:ring-2 focus-visible:outline-none`) still wins — utilities
|
|
33
|
+
* are a later layer — and this only fills in for the controls that have none.
|
|
34
|
+
*/
|
|
35
|
+
.prenta-admin :focus-visible {
|
|
36
|
+
outline: var(--bw-focus, 2px) solid var(--acc);
|
|
37
|
+
outline-offset: 2px;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Controls flush against a panel edge draw the ring inside their own box, or
|
|
42
|
+
it is clipped by the scroll container they sit in. */
|
|
43
|
+
.prenta-admin [role='tab']:focus-visible,
|
|
44
|
+
.prenta-admin [role='separator']:focus-visible {
|
|
45
|
+
outline-offset: -2px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* Skip link. Rendered as the first child of the admin root by `AdminShell`,
|
|
50
|
+
* which also owns the `#prenta-main` target.
|
|
51
|
+
*/
|
|
52
|
+
.prenta-admin .prenta-skip-link {
|
|
53
|
+
position: absolute;
|
|
54
|
+
left: -9999px;
|
|
55
|
+
top: 0;
|
|
56
|
+
z-index: 999;
|
|
57
|
+
padding: 10px 16px;
|
|
58
|
+
background: var(--acc);
|
|
59
|
+
color: #fff;
|
|
60
|
+
font-size: var(--fs-body, 13px);
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
border-radius: 0 0 8px 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.prenta-admin .prenta-skip-link:focus {
|
|
66
|
+
left: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* Honour a stated preference for less motion.
|
|
71
|
+
*
|
|
72
|
+
* Tailwind's `motion-safe:` variant already covers the transitions written
|
|
73
|
+
* with it, but plenty of the admin's motion is unconditional, and a preference
|
|
74
|
+
* that holds for most of a screen is not honoured. `.reduce-motion` (an
|
|
75
|
+
* explicit Appearance setting, in theme.css) is the same rule by another
|
|
76
|
+
* trigger.
|
|
77
|
+
*/
|
|
78
|
+
@media (prefers-reduced-motion: reduce) {
|
|
79
|
+
.prenta-admin,
|
|
80
|
+
.prenta-admin *,
|
|
81
|
+
.prenta-admin *::before,
|
|
82
|
+
.prenta-admin *::after {
|
|
83
|
+
animation-duration: 0.01ms !important;
|
|
84
|
+
animation-iteration-count: 1 !important;
|
|
85
|
+
transition-duration: 0.01ms !important;
|
|
86
|
+
scroll-behavior: auto !important;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Honour a stated preference for more contrast.
|
|
92
|
+
*
|
|
93
|
+
* Only the three tertiary tokens move, and only in the direction of more
|
|
94
|
+
* contrast than the shipped values — which are already an AA correction over
|
|
95
|
+
* the handoff's own numbers (see the `--muted` note in prenta-tokens.css).
|
|
96
|
+
* Set here rather than in the token file because that file is generated.
|
|
97
|
+
*/
|
|
98
|
+
@media (prefers-contrast: more) {
|
|
99
|
+
.prenta-admin {
|
|
100
|
+
--muted: #5a5770;
|
|
101
|
+
--sub: #3d3a52;
|
|
102
|
+
--bdr: #c9c5dc;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dark .prenta-admin,
|
|
106
|
+
.prenta-admin.dark,
|
|
107
|
+
.prenta-admin[data-theme='dark'] {
|
|
108
|
+
--muted: #a9a6c0;
|
|
109
|
+
--sub: #c4c1d8;
|
|
110
|
+
--bdr: #454263;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Touch devices: named controls clear the 44px target minimum.
|
|
116
|
+
*
|
|
117
|
+
* Opt-in per control rather than a blanket `button { min-height: 44px }`.
|
|
118
|
+
* The admin is full of dense tables and inline row actions where growing
|
|
119
|
+
* every button reflows the layout it sits in, and the prototype hit the same
|
|
120
|
+
* wall — it carries a curated list for exactly this reason. `.prenta-touch-target`
|
|
121
|
+
* is that list, expressed where the control is written instead of in a
|
|
122
|
+
* stylesheet that has to be kept in sync with class names.
|
|
123
|
+
*
|
|
124
|
+
* Pointer-based sizing is untouched: a 26px button is right with a mouse and
|
|
125
|
+
* wrong with a thumb.
|
|
126
|
+
*/
|
|
127
|
+
@media (pointer: coarse) {
|
|
128
|
+
.prenta-admin .prenta-touch-target {
|
|
129
|
+
min-height: 44px;
|
|
130
|
+
min-width: 44px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
* The exception, and the reason this is not one rule: a switch positions its
|
|
135
|
+
* knob against the track's own box, so stretching the track to 44px leaves
|
|
136
|
+
* the knob floating in the middle of dead space. Grow the HIT AREA instead
|
|
137
|
+
* and let the control paint at its designed size. Use this for any small
|
|
138
|
+
* control whose internals are positioned against its box.
|
|
139
|
+
*
|
|
140
|
+
* The insets are sized for the 34×19 directive switch: 19 + 26 = 45 tall,
|
|
141
|
+
* 34 + 12 = 46 wide.
|
|
142
|
+
*/
|
|
143
|
+
.prenta-admin .prenta-touch-hit {
|
|
144
|
+
position: relative;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.prenta-admin .prenta-touch-hit::after {
|
|
148
|
+
content: '';
|
|
149
|
+
position: absolute;
|
|
150
|
+
inset-block: -13px;
|
|
151
|
+
inset-inline: -6px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* ── 4K / Retina (≥2000px) ────────────────────────────────────────── */
|
|
156
|
+
/* Stop the chrome thinning out to a ribbon on a very wide display. */
|
|
157
|
+
@media (min-width: 2000px) {
|
|
158
|
+
.prenta-admin {
|
|
159
|
+
--sbw: 280px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* ── Editor header (≤1180px): let the action cluster wrap ─────────── */
|
|
164
|
+
/*
|
|
165
|
+
* The breakpoint picker and zoom chip already hide below `md`. What remains
|
|
166
|
+
* still outgrows the bar before then, and a fixed-height flex row resolves
|
|
167
|
+
* that by crushing the title. Wrapping keeps the title readable and gives the
|
|
168
|
+
* actions a second line.
|
|
169
|
+
*/
|
|
170
|
+
@media (max-width: 1180px) {
|
|
171
|
+
.prenta-admin .prenta-editor-header {
|
|
172
|
+
height: auto;
|
|
173
|
+
min-height: 0;
|
|
174
|
+
flex-wrap: wrap;
|
|
175
|
+
row-gap: 8px;
|
|
176
|
+
padding-top: 8px;
|
|
177
|
+
padding-bottom: 8px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.prenta-admin .prenta-editor-header > * {
|
|
181
|
+
min-width: 0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ── Tablet portrait (≤900px): the two-pane editor stacks ─────────── */
|
|
186
|
+
/*
|
|
187
|
+
* Side by side stops working before the canvas becomes useless, so the rail
|
|
188
|
+
* moves ABOVE the canvas and both take the full width. `!important` is
|
|
189
|
+
* required on the width: the rail's is an inline style (it is drag-resizable
|
|
190
|
+
* and persisted), and at this size a stored pixel width is meaningless anyway.
|
|
191
|
+
*/
|
|
192
|
+
@media (max-width: 900px) {
|
|
193
|
+
.prenta-admin .prenta-editor-body {
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.prenta-admin .prenta-editor-rail {
|
|
198
|
+
width: 100% !important;
|
|
199
|
+
min-width: 0 !important;
|
|
200
|
+
max-height: 46vh;
|
|
201
|
+
border-right: none;
|
|
202
|
+
border-bottom: 1px solid var(--bdr);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Dragging a horizontal edge to set a width that no longer applies. */
|
|
206
|
+
.prenta-admin .prenta-editor-rail [role='separator'] {
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* The collapsed strip's vertical label has no room to be vertical. */
|
|
211
|
+
.prenta-admin .prenta-editor-rail-collapsed {
|
|
212
|
+
width: 100% !important;
|
|
213
|
+
flex-direction: row;
|
|
214
|
+
align-items: center;
|
|
215
|
+
justify-content: flex-start;
|
|
216
|
+
gap: 10px;
|
|
217
|
+
padding: 0 12px;
|
|
218
|
+
height: 44px;
|
|
219
|
+
border-right: none;
|
|
220
|
+
border-bottom: 1px solid var(--bdr);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.prenta-admin .prenta-editor-rail-collapsed .prenta-rail-label {
|
|
224
|
+
writing-mode: horizontal-tb;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* The inspector is a third column that no longer fits beside two others. */
|
|
228
|
+
.prenta-admin .prenta-editor-inspector {
|
|
229
|
+
width: 100% !important;
|
|
230
|
+
max-height: 46vh;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ── Mobile (≤460px) ──────────────────────────────────────────────── */
|
|
235
|
+
@media (max-width: 460px) {
|
|
236
|
+
/* Buttons that read as a pair go full width rather than shrinking to
|
|
237
|
+
nothing — the review bar's Restore / Back to current, in particular. */
|
|
238
|
+
.prenta-admin .prenta-editor-header button {
|
|
239
|
+
flex: 1 1 auto;
|
|
240
|
+
justify-content: center;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Landscape phones are short, not narrow — reclaim vertical space. */
|
|
245
|
+
@media (max-height: 520px) and (orientation: landscape) {
|
|
246
|
+
.prenta-admin .prenta-editor-rail {
|
|
247
|
+
max-height: none;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.prenta-admin .prenta-editor-header {
|
|
251
|
+
padding-top: 4px;
|
|
252
|
+
padding-bottom: 4px;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/*
|
|
257
|
+
* Printing a CMS screen is almost always a mistake. If it happens, drop the
|
|
258
|
+
* chrome and let the canvas print at its natural size rather than as a
|
|
259
|
+
* transformed, clipped thumbnail.
|
|
260
|
+
*/
|
|
261
|
+
@media print {
|
|
262
|
+
.prenta-admin .prenta-editor-header,
|
|
263
|
+
.prenta-admin .prenta-editor-rail,
|
|
264
|
+
.prenta-admin .prenta-editor-rail-collapsed,
|
|
265
|
+
.prenta-admin .prenta-skip-link {
|
|
266
|
+
display: none !important;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.prenta-admin .prenta-canvas-scroll {
|
|
270
|
+
overflow: visible !important;
|
|
271
|
+
padding: 0 !important;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.prenta-admin .prenta-canvas-fit,
|
|
275
|
+
.prenta-admin .prenta-canvas {
|
|
276
|
+
width: auto !important;
|
|
277
|
+
height: auto !important;
|
|
278
|
+
transform: none !important;
|
|
279
|
+
box-shadow: none !important;
|
|
280
|
+
}
|
|
281
|
+
}
|
package/src/styles/theme.css
CHANGED
|
@@ -162,6 +162,29 @@
|
|
|
162
162
|
--text-xs: var(--fs-hint);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
/*
|
|
166
|
+
* Canvas reflow steps — the container-query breakpoints the previewed PAGE
|
|
167
|
+
* reflows at, as distinct from Tailwind's `sm:`/`md:` viewport breakpoints,
|
|
168
|
+
* which describe the admin chrome around it.
|
|
169
|
+
*
|
|
170
|
+
* The canvas renders at a device's real CSS width and is scaled with a
|
|
171
|
+
* transform, so a viewport query there is meaningless: it would report the
|
|
172
|
+
* editor window's width, and picking "Mobile" on a wide monitor would render
|
|
173
|
+
* a 390px-wide canvas still laid out for desktop. Section renderers under
|
|
174
|
+
* `views/page-editor/sections/` must use `@pv-*`, never `sm:`/`md:`/`lg:`.
|
|
175
|
+
*
|
|
176
|
+
* Values come from the page-builder design handoff. Any element carrying
|
|
177
|
+
* these variants needs an ancestor with `@container` — EditorCanvas,
|
|
178
|
+
* PostEditorCanvas, PagePreview and PostPreview all declare it.
|
|
179
|
+
*/
|
|
180
|
+
@theme {
|
|
181
|
+
--container-pv-sm: 460px; /* below: stats 1-up, buttons full width */
|
|
182
|
+
--container-pv-md: 700px; /* below: image+text stacks, quotes 1-up */
|
|
183
|
+
--container-pv-lg: 900px; /* below: quote grid 2-up, stats collapse */
|
|
184
|
+
--container-pv-xl: 1100px; /* below: general step-down */
|
|
185
|
+
--container-pv-2xl: 2000px; /* above: type and padding scale up */
|
|
186
|
+
}
|
|
187
|
+
|
|
165
188
|
@layer base {
|
|
166
189
|
.prenta-admin * {
|
|
167
190
|
@apply border-border outline-ring/50;
|
|
@@ -255,6 +278,23 @@
|
|
|
255
278
|
* The canvas re-establishes the site's typographic context: headings and
|
|
256
279
|
* body text fall back to inheritance rather than the admin scale above.
|
|
257
280
|
*/
|
|
281
|
+
/*
|
|
282
|
+
* The canvas is the query container for every previewed section (`@pv-*`
|
|
283
|
+
* variants — see the step scale above). It lives here rather than as an
|
|
284
|
+
* `@container` utility on each host because FOUR surfaces render these
|
|
285
|
+
* sections — EditorCanvas, PostEditorCanvas, PagePreview, PostPreview — and
|
|
286
|
+
* a host that forgets it degrades silently: with no container ancestor,
|
|
287
|
+
* every `@pv-*` variant simply never matches and the page renders at its
|
|
288
|
+
* narrowest layout regardless of the selected breakpoint. Tying containment
|
|
289
|
+
* to the class that defines the surface makes that unforgettable.
|
|
290
|
+
*
|
|
291
|
+
* `inline-size` only: the canvas must stay free to grow as tall as its
|
|
292
|
+
* content, which `size` containment would prevent.
|
|
293
|
+
*/
|
|
294
|
+
.prenta-admin .prenta-canvas {
|
|
295
|
+
container-type: inline-size;
|
|
296
|
+
}
|
|
297
|
+
|
|
258
298
|
.prenta-admin .prenta-canvas :is(h1, h2, h3, h4) {
|
|
259
299
|
font-size: revert-layer;
|
|
260
300
|
font-weight: revert-layer;
|
|
@@ -383,6 +423,96 @@
|
|
|
383
423
|
border-radius: var(--radius-md);
|
|
384
424
|
margin: 1em 0;
|
|
385
425
|
}
|
|
426
|
+
|
|
427
|
+
/*
|
|
428
|
+
* Structure canvas — lite hover outline on editable sections.
|
|
429
|
+
* Selected section chrome stays on the element (Tailwind outline-violet).
|
|
430
|
+
* Field-level chrome applies when renderers expose data-cms-field.
|
|
431
|
+
*/
|
|
432
|
+
.prenta-admin .prenta-canvas [data-section-id][data-editable='true']:not([data-selected='true']) {
|
|
433
|
+
outline: 1px solid transparent;
|
|
434
|
+
outline-offset: -1px;
|
|
435
|
+
transition: outline-color 120ms ease;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.prenta-admin
|
|
439
|
+
.prenta-canvas
|
|
440
|
+
[data-section-id][data-editable='true']:not([data-selected='true']):hover {
|
|
441
|
+
outline-color: color-mix(in oklab, var(--acc) 40%, transparent);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.prenta-admin .prenta-canvas [data-cms-field] {
|
|
445
|
+
outline: 1px solid transparent;
|
|
446
|
+
outline-offset: 2px;
|
|
447
|
+
border-radius: 2px;
|
|
448
|
+
transition: outline-color 120ms ease;
|
|
449
|
+
cursor: text;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.prenta-admin .prenta-canvas [data-cms-field]:hover,
|
|
453
|
+
.prenta-admin .prenta-canvas [data-cms-field]:focus,
|
|
454
|
+
.prenta-admin .prenta-canvas [data-cms-field]:focus-within {
|
|
455
|
+
outline-color: color-mix(in oklab, var(--acc) 45%, transparent);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.prenta-admin .prenta-canvas [data-cms-field][data-cms-field-kind='media'] {
|
|
459
|
+
cursor: pointer;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
@media (prefers-reduced-motion: reduce) {
|
|
463
|
+
.prenta-admin .prenta-canvas [data-section-id][data-editable='true'],
|
|
464
|
+
.prenta-admin .prenta-canvas [data-cms-field] {
|
|
465
|
+
transition: none;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/*
|
|
471
|
+
* Restore the stock Tailwind type scale inside the canvas.
|
|
472
|
+
*
|
|
473
|
+
* The `@theme inline` block above deliberately remaps six size keys onto admin
|
|
474
|
+
* design tokens so `text-base` means "admin body text, 13px" across the shell.
|
|
475
|
+
* That aliasing is right for admin chrome and wrong for the canvas, which
|
|
476
|
+
* renders the consumer's WEBSITE: there, `text-base` must mean 16px, the size
|
|
477
|
+
* a visitor actually reads. Left unscoped, every section renderer styles
|
|
478
|
+
* website copy on the admin scale — body text 3px small, `text-2xl` headings
|
|
479
|
+
* at 21px instead of 24px.
|
|
480
|
+
*
|
|
481
|
+
* This matters beyond looks. The reflow guard measures how copy wraps by
|
|
482
|
+
* laying it out in the canvas's own class chain; if the canvas renders type at
|
|
483
|
+
* the admin scale, every line count it reports is measured against a font size
|
|
484
|
+
* the live page never uses, and the guard is confidently wrong.
|
|
485
|
+
*
|
|
486
|
+
* Must live in `@layer utilities`, not `@layer base`: layer order beats
|
|
487
|
+
* specificity, so a base-layer rule — however specific — loses to the utility
|
|
488
|
+
* it is trying to correct. Inside the same layer, specificity decides, and
|
|
489
|
+
* three classes beat one.
|
|
490
|
+
*
|
|
491
|
+
* Only `font-size` is restated. The line-height half of each utility is a
|
|
492
|
+
* unitless ratio that scales correctly on its own.
|
|
493
|
+
*
|
|
494
|
+
* Values are Tailwind's defaults; the remapped keys are the only ones listed,
|
|
495
|
+
* because every other step (`text-3xl` and up) was never aliased.
|
|
496
|
+
*/
|
|
497
|
+
@layer utilities {
|
|
498
|
+
.prenta-admin .prenta-canvas .text-xs {
|
|
499
|
+
font-size: 0.75rem;
|
|
500
|
+
}
|
|
501
|
+
.prenta-admin .prenta-canvas .text-sm {
|
|
502
|
+
font-size: 0.875rem;
|
|
503
|
+
}
|
|
504
|
+
.prenta-admin .prenta-canvas .text-base {
|
|
505
|
+
font-size: 1rem;
|
|
506
|
+
}
|
|
507
|
+
.prenta-admin .prenta-canvas .text-lg {
|
|
508
|
+
font-size: 1.125rem;
|
|
509
|
+
}
|
|
510
|
+
.prenta-admin .prenta-canvas .text-xl {
|
|
511
|
+
font-size: 1.25rem;
|
|
512
|
+
}
|
|
513
|
+
.prenta-admin .prenta-canvas .text-2xl {
|
|
514
|
+
font-size: 1.5rem;
|
|
515
|
+
}
|
|
386
516
|
}
|
|
387
517
|
|
|
388
518
|
.prenta-admin.reduce-motion,
|
|
@@ -394,3 +524,11 @@
|
|
|
394
524
|
transition-duration: 0.001ms;
|
|
395
525
|
scroll-behavior: auto;
|
|
396
526
|
}
|
|
527
|
+
|
|
528
|
+
/*
|
|
529
|
+
* Responsive + accessibility layer. LAST on purpose: it adapts the tokens and
|
|
530
|
+
* rules above (the `prefers-contrast` block overrides token values, the
|
|
531
|
+
* editor-stacking rules override the rail's own borders), so it has to come
|
|
532
|
+
* after them.
|
|
533
|
+
*/
|
|
534
|
+
@import './responsive.css';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Laptop, Monitor, Smartphone, Tablet, type LucideIcon } from 'lucide-react'
|
|
4
|
+
import type { Breakpoint } from '../../lib/breakpoints.js'
|
|
5
|
+
|
|
6
|
+
const ICONS: Record<string, LucideIcon> = {
|
|
7
|
+
monitor: Monitor,
|
|
8
|
+
laptop: Laptop,
|
|
9
|
+
tablet: Tablet,
|
|
10
|
+
smartphone: Smartphone,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface CanvasMetaLineProps {
|
|
14
|
+
breakpoint: Breakpoint
|
|
15
|
+
/** Unscaled page height in px, measured from the canvas surface. */
|
|
16
|
+
pageHeight: number
|
|
17
|
+
/** Current transform scale, 0–1. */
|
|
18
|
+
scale: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Reads out what the canvas is currently showing:
|
|
23
|
+
* `▣ Wide Screen | 1920 × 2174 px | 42% scale`.
|
|
24
|
+
*
|
|
25
|
+
* The dimensions are the page's own, before scaling — the number an editor
|
|
26
|
+
* needs when reasoning about the live page. The scale is the separate fact
|
|
27
|
+
* that the preview is shrunk to fit.
|
|
28
|
+
*/
|
|
29
|
+
export function CanvasMetaLine({ breakpoint, pageHeight, scale }: CanvasMetaLineProps) {
|
|
30
|
+
const Icon = ICONS[breakpoint.icon] ?? Monitor
|
|
31
|
+
const percent = Math.round(scale * 100)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<p
|
|
35
|
+
className="text-muted-foreground mb-3 inline-flex items-center gap-1.5 text-[11px] font-semibold tracking-[0.3px] whitespace-nowrap"
|
|
36
|
+
// The canvas is decorative chrome around the real content; announcing
|
|
37
|
+
// these numbers on every keystroke would flood a screen reader.
|
|
38
|
+
aria-hidden
|
|
39
|
+
>
|
|
40
|
+
<Icon className="h-3 w-3" />
|
|
41
|
+
<span className="text-foreground/70">{breakpoint.name}</span>
|
|
42
|
+
<span aria-hidden>|</span>
|
|
43
|
+
<span className="tabular-nums">
|
|
44
|
+
{breakpoint.width} × {pageHeight ? Math.round(pageHeight) : '—'} px
|
|
45
|
+
</span>
|
|
46
|
+
<span aria-hidden>|</span>
|
|
47
|
+
<span className="tabular-nums">{percent}% scale</span>
|
|
48
|
+
</p>
|
|
49
|
+
)
|
|
50
|
+
}
|