@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
|
@@ -7,6 +7,6 @@ export function MissionSection({ section }) {
|
|
|
7
7
|
const align = alignment === 'left' ? 'text-left' : 'text-center mx-auto';
|
|
8
8
|
const heading = str(c, 'heading');
|
|
9
9
|
const body = str(c, 'body');
|
|
10
|
-
return (_jsxs("div", { className: `max-w-3xl px-6 ${align}`, children: [heading && (_jsx("h2", { className: "text-foreground text-2xl font-semibold tracking-tight
|
|
10
|
+
return (_jsxs("div", { className: `max-w-3xl px-6 ${align}`, children: [heading && (_jsx("h2", { className: "text-foreground @pv-md:text-3xl @pv-2xl:text-4xl text-2xl font-semibold tracking-tight", children: heading })), body && (_jsx("p", { className: "text-muted-foreground @pv-md:text-lg mt-4 text-base leading-relaxed", children: body }))] }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=MissionSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissionSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/MissionSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEhC,wDAAwD;AACxD,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAA4B;IAClE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,CAAA;IACxE,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAE3B,OAAO,CACL,eAAK,SAAS,EAAE,kBAAkB,KAAK,EAAE,aACtC,OAAO,IAAI,CACV,aAAI,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"MissionSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/MissionSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEhC,wDAAwD;AACxD,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAA4B;IAClE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,CAAA;IACxE,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAE3B,OAAO,CACL,eAAK,SAAS,EAAE,kBAAkB,KAAK,EAAE,aACtC,OAAO,IAAI,CACV,aAAI,SAAS,EAAC,wFAAwF,YACnG,OAAO,GACL,CACN,EACA,IAAI,IAAI,CACP,YAAG,SAAS,EAAC,qEAAqE,YAC/E,IAAI,GACH,CACL,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PullQuoteSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/PullQuoteSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"PullQuoteSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/PullQuoteSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,kDAwBrE"}
|
|
@@ -8,6 +8,6 @@ export function PullQuoteSection({ section }) {
|
|
|
8
8
|
const role = str(c, 'role');
|
|
9
9
|
if (!quote)
|
|
10
10
|
return null;
|
|
11
|
-
return (_jsxs("figure", { className: "mx-auto max-w-3xl px-6", children: [_jsx("blockquote", { className: "border-brand border-l-4 pl-6", children: _jsxs("p", { className: "text-foreground text-xl leading-relaxed font-medium
|
|
11
|
+
return (_jsxs("figure", { className: "mx-auto max-w-3xl px-6", children: [_jsx("blockquote", { className: "border-brand border-l-4 pl-6", children: _jsxs("p", { className: "text-foreground @pv-md:text-2xl text-xl leading-relaxed font-medium", children: ["\u201C", quote, "\u201D"] }) }), (attribution || role) && (_jsxs("figcaption", { className: "text-muted-foreground mt-3 pl-6 text-sm", children: [attribution && _jsx("span", { className: "text-foreground font-medium", children: attribution }), attribution && role && _jsx("span", { "aria-hidden": true, children: " \u00B7 " }), role] }))] }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=PullQuoteSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PullQuoteSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/PullQuoteSection.tsx"],"names":[],"mappings":";AACA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C,yCAAyC,aAC5D,WAAW,IAAI,eAAM,SAAS,EAAC,6BAA6B,YAAE,WAAW,GAAQ,EACjF,WAAW,IAAI,IAAI,IAAI,2DAA4B,EACnD,IAAI,IACM,CACd,IACM,CACV,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedPostsSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/RelatedPostsSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAO,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAExD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAC5B,
|
|
1
|
+
{"version":3,"file":"RelatedPostsSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/RelatedPostsSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAO,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAExD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAC5B,2CAyCA"}
|
|
@@ -17,7 +17,7 @@ export function RelatedPostsSection({ section, context, }) {
|
|
|
17
17
|
excerpt: 'A short summary of the related post will appear here.',
|
|
18
18
|
url: undefined,
|
|
19
19
|
}));
|
|
20
|
-
const cols = count >= 4 ? 'sm:grid-cols-2
|
|
20
|
+
const cols = count >= 4 ? '@pv-sm:grid-cols-2 @pv-xl:grid-cols-4' : '@pv-sm:grid-cols-2 @pv-lg:grid-cols-3';
|
|
21
21
|
return (_jsxs("div", { className: "mx-auto max-w-5xl px-6", children: [heading && (_jsx("h2", { className: "text-foreground mb-6 text-2xl font-semibold tracking-tight", children: heading })), _jsx("div", { className: `grid grid-cols-1 gap-4 ${cols}`, children: cards.map((post, i) => (_jsxs("div", { className: "border-border bg-card overflow-hidden rounded-xl border shadow-sm", children: [_jsx("div", { className: "bg-muted aspect-[16/9]", "aria-hidden": true }), _jsxs("div", { className: "p-4", children: [_jsx("p", { className: "text-foreground text-base font-medium", children: post.title }), post.excerpt && (_jsx("p", { className: "text-muted-foreground mt-1 line-clamp-2 text-sm", children: post.excerpt }))] })] }, i))) })] }));
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=RelatedPostsSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedPostsSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/RelatedPostsSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAA0B,MAAM,YAAY,CAAA;AAExD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,GAIR;IACC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAA;IAClD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;IAE5D,MAAM,QAAQ,GAAG,OAAO,EAAE,YAAY,IAAI,EAAE,CAAA;IAC5C,MAAM,KAAK,GACT,QAAQ,CAAC,MAAM,GAAG,CAAC;QACjB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;QAC1B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACvC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE;YAC9B,OAAO,EAAE,uDAAuD;YAChE,GAAG,EAAE,SAA+B;SACrC,CAAC,CAAC,CAAA;IAET,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"RelatedPostsSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/RelatedPostsSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAA0B,MAAM,YAAY,CAAA;AAExD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,GAIR;IACC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAA;IAClD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;IAE5D,MAAM,QAAQ,GAAG,OAAO,EAAE,YAAY,IAAI,EAAE,CAAA;IAC5C,MAAM,KAAK,GACT,QAAQ,CAAC,MAAM,GAAG,CAAC;QACjB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;QAC1B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACvC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE;YAC9B,OAAO,EAAE,uDAAuD;YAChE,GAAG,EAAE,SAA+B;SACrC,CAAC,CAAC,CAAA;IAET,MAAM,IAAI,GACR,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,uCAAuC,CAAA;IAEhG,OAAO,CACL,eAAK,SAAS,EAAC,wBAAwB,aACpC,OAAO,IAAI,CACV,aAAI,SAAS,EAAC,4DAA4D,YAAE,OAAO,GAAM,CAC1F,EACD,cAAK,SAAS,EAAE,0BAA0B,IAAI,EAAE,YAC7C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,eAEE,SAAS,EAAC,mEAAmE,aAE7E,cAAK,SAAS,EAAC,wBAAwB,wBAAe,EACtD,eAAK,SAAS,EAAC,KAAK,aAClB,YAAG,SAAS,EAAC,uCAAuC,YAAE,IAAI,CAAC,KAAK,GAAK,EACpE,IAAI,CAAC,OAAO,IAAI,CACf,YAAG,SAAS,EAAC,iDAAiD,YAAE,IAAI,CAAC,OAAO,GAAK,CAClF,IACG,KATD,CAAC,CAUF,CACP,CAAC,GACE,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -13,6 +13,18 @@ export interface SectionRendererProps {
|
|
|
13
13
|
registerRef?: (id: string, el: HTMLElement | null) => void;
|
|
14
14
|
/** Live post data for post-oriented section renderers (pages omit this). */
|
|
15
15
|
context?: PostRenderContext;
|
|
16
|
+
/**
|
|
17
|
+
* Reviewing a past version: the canvas is a read-only render of a snapshot.
|
|
18
|
+
*
|
|
19
|
+
* A SEPARATE flag from `editable`, not a second use of it. Both modes
|
|
20
|
+
* suppress click-to-select and the hover outline, so it is tempting to fold
|
|
21
|
+
* them together — but review mode has to keep showing a label on the
|
|
22
|
+
* sections that changed, which is the entire reason it exists. One shared
|
|
23
|
+
* suppression rule hides exactly the thing the mode is for.
|
|
24
|
+
*/
|
|
25
|
+
reviewing?: boolean;
|
|
26
|
+
/** This section differs from the version immediately before the one shown. */
|
|
27
|
+
changed?: boolean;
|
|
16
28
|
}
|
|
17
29
|
/**
|
|
18
30
|
* Renders one section with its background + padding, dispatching to the
|
|
@@ -20,5 +32,5 @@ export interface SectionRendererProps {
|
|
|
20
32
|
* (outline + a small purple type label) on top of the same markup the
|
|
21
33
|
* public preview uses — so what you edit is what ships.
|
|
22
34
|
*/
|
|
23
|
-
export declare function SectionRenderer({ section, editable, selected, onSelect, registerRef, context, }: SectionRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function SectionRenderer({ section, editable, selected, onSelect, registerRef, context, reviewing, changed, }: SectionRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
24
36
|
//# sourceMappingURL=SectionRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/SectionRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAItE,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAmClF,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE9D;
|
|
1
|
+
{"version":3,"file":"SectionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/SectionRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAItE,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAmClF,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE9D;AA8GD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,WAAW,CAAA;IACpB;kEAC8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,mEAAmE;IACnE,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC1D,4EAA4E;IAC5E,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,QAAgB,EAChB,QAAgB,EAChB,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAiB,EACjB,OAAe,GAChB,EAAE,oBAAoB,2CAqEtB"}
|
|
@@ -41,9 +41,46 @@ const CANVAS_RENDERED_TYPES = new Set([
|
|
|
41
41
|
export function hasCanvasRenderer(sectionType) {
|
|
42
42
|
return CANVAS_RENDERED_TYPES.has(sectionType);
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Dispatch a section's body component by type. Shared by editor + preview.
|
|
46
|
+
*
|
|
47
|
+
* RESOLUTION ORDER — consumer-supplied renderer, then built-in, then
|
|
48
|
+
* placeholder. The consumer's renderer wins for EVERY type, including the
|
|
49
|
+
* built-ins, because that is the whole point of the `sectionRenderers` prop:
|
|
50
|
+
* hand the admin the same components the public site registers and the canvas
|
|
51
|
+
* shows what actually ships.
|
|
52
|
+
*
|
|
53
|
+
* Until this order was corrected the map was consulted only for types the
|
|
54
|
+
* switch below did not know, so a consumer passing
|
|
55
|
+
* `DEFAULT_SECTION_RENDERERS` from `@prenta/sections-react` had their hero,
|
|
56
|
+
* text, feature, stats and cta silently ignored — the canvas rendered the
|
|
57
|
+
* admin's own approximations while claiming to preview the page. Those
|
|
58
|
+
* approximations differ in font size, weight and breakpoint, so copy that fit
|
|
59
|
+
* on two lines in the canvas could wrap to three on the site.
|
|
60
|
+
*
|
|
61
|
+
* The built-ins below remain the fallback for consumers who pass nothing.
|
|
62
|
+
*/
|
|
45
63
|
function SectionBody({ section, context }) {
|
|
46
64
|
const customRenderers = useAdminSectionRenderers();
|
|
65
|
+
const Supplied = customRenderers[section.sectionType];
|
|
66
|
+
if (Supplied) {
|
|
67
|
+
// The renderer contract types `settings` as an open record (matching the
|
|
68
|
+
// sections-react wire shape); the admin's concrete `SectionSettings`
|
|
69
|
+
// interface is the same object at runtime but has no index signature, so
|
|
70
|
+
// bridge the nominal gap here.
|
|
71
|
+
const wireSection = {
|
|
72
|
+
...section,
|
|
73
|
+
settings: { ...section.settings },
|
|
74
|
+
};
|
|
75
|
+
// Rendered as a component (not invoked inline) so a throw happens inside
|
|
76
|
+
// the boundary's subtree and is actually caught. A consumer renderer that
|
|
77
|
+
// breaks falls back to the built-in rather than blanking the editor.
|
|
78
|
+
return (_jsx(ErrorBoundary, { fallback: _jsx(BuiltInSectionBody, { section: section, context: context }), children: _jsx(Supplied, { section: wireSection, ctx: context, options: ADMIN_RENDER_OPTIONS }) }, section.id));
|
|
79
|
+
}
|
|
80
|
+
return _jsx(BuiltInSectionBody, { section: section, context: context });
|
|
81
|
+
}
|
|
82
|
+
/** The admin's own approximations, used when the consumer supplies nothing. */
|
|
83
|
+
function BuiltInSectionBody({ section, context, }) {
|
|
47
84
|
switch (section.sectionType) {
|
|
48
85
|
case 'hero':
|
|
49
86
|
return _jsx(HeroBannerSection, { section: section });
|
|
@@ -69,29 +106,11 @@ function SectionBody({ section, context }) {
|
|
|
69
106
|
return _jsx(EmbedSection, { section: section });
|
|
70
107
|
case 'widget-embed':
|
|
71
108
|
return _jsx(WidgetEmbedSection, { section: section });
|
|
72
|
-
default:
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
// to the structural placeholder instead of taking down the editor.
|
|
77
|
-
const Custom = customRenderers[section.sectionType];
|
|
78
|
-
if (Custom) {
|
|
79
|
-
// The renderer contract types `settings` as an open record (matching
|
|
80
|
-
// the sections-react wire shape); the admin's concrete
|
|
81
|
-
// `SectionSettings` interface is the same object at runtime but has
|
|
82
|
-
// no index signature, so bridge the nominal gap here.
|
|
83
|
-
const wireSection = {
|
|
84
|
-
...section,
|
|
85
|
-
settings: { ...section.settings },
|
|
86
|
-
};
|
|
87
|
-
// Rendered as a component (not invoked inline) so a throw happens
|
|
88
|
-
// inside the boundary's subtree and is actually caught.
|
|
89
|
-
return (_jsx(ErrorBoundary, { fallback: _jsx(PlaceholderSection, { section: section }), children: _jsx(Custom, { section: wireSection, ctx: context, options: ADMIN_RENDER_OPTIONS }) }, section.id));
|
|
90
|
-
}
|
|
91
|
-
// No renderer registered: a neutral placeholder keeps the canvas
|
|
92
|
-
// reflecting the section's presence + order instead of a blank gap.
|
|
109
|
+
default:
|
|
110
|
+
// Config-declared custom types and unmanaged sections with no supplied
|
|
111
|
+
// renderer: a neutral placeholder keeps the canvas reflecting the
|
|
112
|
+
// section's presence and order instead of leaving a blank gap.
|
|
93
113
|
return _jsx(PlaceholderSection, { section: section });
|
|
94
|
-
}
|
|
95
114
|
}
|
|
96
115
|
}
|
|
97
116
|
/** Fallback canvas card for section types without a built-in renderer. */
|
|
@@ -108,9 +127,30 @@ function PlaceholderSection({ section }) {
|
|
|
108
127
|
* (outline + a small purple type label) on top of the same markup the
|
|
109
128
|
* public preview uses — so what you edit is what ships.
|
|
110
129
|
*/
|
|
111
|
-
export function SectionRenderer({ section, editable = false, selected = false, onSelect, registerRef, context, }) {
|
|
130
|
+
export function SectionRenderer({ section, editable = false, selected = false, onSelect, registerRef, context, reviewing = false, changed = false, }) {
|
|
112
131
|
const settings = section.settings ?? {};
|
|
113
|
-
|
|
114
|
-
|
|
132
|
+
// A snapshot's hidden sections stay muted: the page is still being shown as
|
|
133
|
+
// the editor's own view of it, and a hidden section that rendered solid here
|
|
134
|
+
// would misreport what was live at that moment.
|
|
135
|
+
const chromed = editable || reviewing;
|
|
136
|
+
const hidden = chromed && !section.visible;
|
|
137
|
+
// Review mode is read-only. Click-to-select would edit the CURRENT page
|
|
138
|
+
// while the canvas shows a past one.
|
|
139
|
+
const interactive = editable && !reviewing;
|
|
140
|
+
return (_jsxs("section", { ref: (el) => registerRef?.(section.id, el), "data-section-id": section.id, "data-editable": interactive ? 'true' : undefined, "data-selected": interactive && selected ? 'true' : undefined, "data-reviewing": reviewing ? 'true' : undefined, "data-changed": reviewing && changed ? 'true' : undefined, id: settings.anchorId || undefined, className: `relative ${backgroundClass(settings)} ${paddingClass(settings)} ${settings.cssClass ?? ''} ${hidden ? 'opacity-40' : ''} ${interactive
|
|
141
|
+
? 'cursor-pointer outline-2 -outline-offset-2 motion-safe:transition-[outline-color] motion-safe:duration-150'
|
|
142
|
+
: ''} ${reviewing
|
|
143
|
+
? changed
|
|
144
|
+
? 'outline-warning outline-2 -outline-offset-2 outline-dashed'
|
|
145
|
+
: 'outline-transparent'
|
|
146
|
+
: selected
|
|
147
|
+
? 'outline outline-violet-500'
|
|
148
|
+
: interactive
|
|
149
|
+
? 'outline-transparent hover:outline hover:outline-[color-mix(in_oklab,var(--acc)_40%,transparent)]'
|
|
150
|
+
: 'outline-transparent'}`, onClick: interactive ? () => onSelect?.(section.id) : undefined, "aria-label": reviewing && changed
|
|
151
|
+
? `${section.name} section — changed in this version`
|
|
152
|
+
: interactive
|
|
153
|
+
? `${section.name} section`
|
|
154
|
+
: undefined, children: [interactive && selected && (_jsx("span", { className: "bg-brand pointer-events-none absolute top-0 left-0 z-10 rounded-br-md px-2 py-0.5 text-xs font-medium text-white", children: section.name })), reviewing && changed && (_jsxs("span", { className: "bg-warning text-warning-foreground pointer-events-none absolute top-0 left-0 z-10 rounded-br-md px-2 py-0.5 text-xs font-medium", children: [section.name, " \u2014 changed"] })), chromed && hidden && (_jsx("span", { className: "bg-foreground pointer-events-none absolute top-0 right-0 z-10 rounded-bl-md px-2 py-0.5 text-xs font-medium text-white", children: "Hidden" })), _jsx(SectionBody, { section: section, context: context })] }));
|
|
115
155
|
}
|
|
116
156
|
//# sourceMappingURL=SectionRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionRenderer.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/SectionRenderer.tsx"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,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AAC/C,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"SectionRenderer.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/SectionRenderer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AACrF,OAAO,EAAE,eAAe,EAAE,YAAY,EAA0B,MAAM,YAAY,CAAA;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC;IACzD,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,KAAK;IACL,cAAc;IACd,OAAO;IACP,Y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,OAAO,EAAE,OAAO,GAAI,IAC3C,CACX,CAAA;AACH,CAAC"}
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pluggable canvas renderers for
|
|
2
|
+
* Pluggable canvas renderers for the editor canvas and the eye preview.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* RESOLUTION ORDER — supplied renderer → built-in → placeholder.
|
|
5
|
+
*
|
|
6
|
+
* A renderer passed to `<AdminRoot sectionRenderers>` wins for EVERY section
|
|
7
|
+
* type, including the built-ins. Before v0.93 the map was consulted only for
|
|
8
|
+
* types the canvas did not already know, so a consumer passing the public
|
|
9
|
+
* renderer map had their hero, text, feature, stats and cta silently ignored
|
|
10
|
+
* while the canvas rendered the admin's own approximations — different font
|
|
11
|
+
* size, weight and breakpoints — and presented itself as a preview.
|
|
12
|
+
*
|
|
13
|
+
* With nothing supplied, built-in types fall back to those approximations and
|
|
14
|
+
* custom (config-declared) or unmanaged types render as a structural
|
|
15
|
+
* placeholder.
|
|
9
16
|
*
|
|
10
17
|
* The renderer signature is a structural mirror of `SectionRenderer` from
|
|
11
|
-
* `@prenta/sections-react` (cms-admin depends on cms-core only, so the
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the public site:
|
|
18
|
+
* `@prenta/sections-react` (cms-admin depends on cms-core only, so the type is
|
|
19
|
+
* duplicated rather than imported). `admin-renderer-compat.test.ts` performs
|
|
20
|
+
* the assignment that keeps the two shapes compatible.
|
|
15
21
|
*
|
|
16
22
|
* ```tsx
|
|
17
|
-
* import {
|
|
18
|
-
*
|
|
23
|
+
* import { DEFAULT_SECTION_RENDERERS } from '@prenta/sections-react'
|
|
24
|
+
* import { OPAL_RENDERERS } from './sections'
|
|
25
|
+
* <AdminRoot sectionRenderers={{ ...DEFAULT_SECTION_RENDERERS, ...OPAL_RENDERERS }} />
|
|
19
26
|
* ```
|
|
20
27
|
*
|
|
21
28
|
* Renderers run inside the admin bundle, so they must be client-safe (no
|
|
22
|
-
* server-only imports). Each
|
|
23
|
-
* renderer falls back to the
|
|
24
|
-
* the editor.
|
|
29
|
+
* server-only imports). Each is wrapped in an error boundary — a throwing
|
|
30
|
+
* renderer falls back to the built-in for that type, or to the placeholder if
|
|
31
|
+
* the type has no built-in, instead of taking down the editor.
|
|
25
32
|
*/
|
|
26
33
|
import { type ReactNode } from 'react';
|
|
27
34
|
/** Structural mirror of `RenderImageProps` from `@prenta/sections-react`. */
|
|
@@ -53,6 +60,15 @@ export interface AdminSectionPostContext {
|
|
|
53
60
|
excerpt?: string;
|
|
54
61
|
}>;
|
|
55
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Structural mirror of `LcpController`. The canvas has no Largest-Contentful-
|
|
65
|
+
* Paint budget to protect, but sections-react renderers call `claim()` during
|
|
66
|
+
* render, so the shape must exist or a real renderer throws on its first image.
|
|
67
|
+
*/
|
|
68
|
+
export interface AdminLcpController {
|
|
69
|
+
claim(): boolean;
|
|
70
|
+
readonly claimed: boolean;
|
|
71
|
+
}
|
|
56
72
|
/** Props passed to an admin section renderer (mirrors `SectionRendererProps`). */
|
|
57
73
|
export interface AdminSectionRendererProps {
|
|
58
74
|
section: {
|
|
@@ -68,6 +84,22 @@ export interface AdminSectionRendererProps {
|
|
|
68
84
|
sanitizeHtml: (html: string) => string;
|
|
69
85
|
baseUrl: string;
|
|
70
86
|
renderImage: (props: AdminRenderImageProps) => ReactNode;
|
|
87
|
+
/** Mirrors `ResolvedRenderOptions.lcp`. */
|
|
88
|
+
lcp: AdminLcpController;
|
|
89
|
+
/**
|
|
90
|
+
* Mirrors `ResolvedRenderOptions.prefetchedForms`. Always empty in the
|
|
91
|
+
* canvas: the admin does not prefetch form schemas, so a form section
|
|
92
|
+
* falls back to its client island exactly as an un-prefetched page does.
|
|
93
|
+
*
|
|
94
|
+
* Typed `any` rather than `unknown` deliberately. Renderers are function
|
|
95
|
+
* types, so `strictFunctionTypes` compares their parameters
|
|
96
|
+
* contravariantly — a `Record<string, unknown>` here would make
|
|
97
|
+
* `SectionRendererMap` from @prenta/sections-react UNASSIGNABLE to this
|
|
98
|
+
* map, defeating the entire point of the mirror. The value is never read
|
|
99
|
+
* in the canvas, so the looser type costs nothing.
|
|
100
|
+
* See `admin-renderer-compat.test.ts`.
|
|
101
|
+
*/
|
|
102
|
+
prefetchedForms: Record<string, any>;
|
|
71
103
|
};
|
|
72
104
|
}
|
|
73
105
|
/** A canvas renderer for one custom section type. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-renderers.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/admin-renderers.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"admin-renderers.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/admin-renderers.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjE,6EAA6E;AAC7E,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wEAAwE;AACxE,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ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;AAElF,yCAAyC;AACzC,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,CAAC,SAAS,CAkBrE,CAAA;AAID,eAAO,MAAM,6BAA6B,mDAAwC,CAAA;AAElF,oFAAoF;AACpF,wBAAgB,wBAAwB,IAAI,uBAAuB,CAElE"}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* Pluggable canvas renderers for
|
|
4
|
+
* Pluggable canvas renderers for the editor canvas and the eye preview.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* RESOLUTION ORDER — supplied renderer → built-in → placeholder.
|
|
7
|
+
*
|
|
8
|
+
* A renderer passed to `<AdminRoot sectionRenderers>` wins for EVERY section
|
|
9
|
+
* type, including the built-ins. Before v0.93 the map was consulted only for
|
|
10
|
+
* types the canvas did not already know, so a consumer passing the public
|
|
11
|
+
* renderer map had their hero, text, feature, stats and cta silently ignored
|
|
12
|
+
* while the canvas rendered the admin's own approximations — different font
|
|
13
|
+
* size, weight and breakpoints — and presented itself as a preview.
|
|
14
|
+
*
|
|
15
|
+
* With nothing supplied, built-in types fall back to those approximations and
|
|
16
|
+
* custom (config-declared) or unmanaged types render as a structural
|
|
17
|
+
* placeholder.
|
|
11
18
|
*
|
|
12
19
|
* The renderer signature is a structural mirror of `SectionRenderer` from
|
|
13
|
-
* `@prenta/sections-react` (cms-admin depends on cms-core only, so the
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the public site:
|
|
20
|
+
* `@prenta/sections-react` (cms-admin depends on cms-core only, so the type is
|
|
21
|
+
* duplicated rather than imported). `admin-renderer-compat.test.ts` performs
|
|
22
|
+
* the assignment that keeps the two shapes compatible.
|
|
17
23
|
*
|
|
18
24
|
* ```tsx
|
|
19
|
-
* import {
|
|
20
|
-
*
|
|
25
|
+
* import { DEFAULT_SECTION_RENDERERS } from '@prenta/sections-react'
|
|
26
|
+
* import { OPAL_RENDERERS } from './sections'
|
|
27
|
+
* <AdminRoot sectionRenderers={{ ...DEFAULT_SECTION_RENDERERS, ...OPAL_RENDERERS }} />
|
|
21
28
|
* ```
|
|
22
29
|
*
|
|
23
30
|
* Renderers run inside the admin bundle, so they must be client-safe (no
|
|
24
|
-
* server-only imports). Each
|
|
25
|
-
* renderer falls back to the
|
|
26
|
-
* the editor.
|
|
31
|
+
* server-only imports). Each is wrapped in an error boundary — a throwing
|
|
32
|
+
* renderer falls back to the built-in for that type, or to the placeholder if
|
|
33
|
+
* the type has no built-in, instead of taking down the editor.
|
|
27
34
|
*/
|
|
28
35
|
import { createContext, useContext } from 'react';
|
|
29
36
|
/**
|
|
@@ -35,6 +42,11 @@ import { createContext, useContext } from 'react';
|
|
|
35
42
|
export const ADMIN_RENDER_OPTIONS = {
|
|
36
43
|
sanitizeHtml: (html) => html,
|
|
37
44
|
baseUrl: '',
|
|
45
|
+
// Never grants the priority slot. On a public page exactly one image may
|
|
46
|
+
// load eagerly; in the canvas nothing competes for bandwidth and every
|
|
47
|
+
// image should lazy-load, so `claim()` always declines.
|
|
48
|
+
lcp: { claim: () => false, claimed: true },
|
|
49
|
+
prefetchedForms: {},
|
|
38
50
|
renderImage: ({ src, alt, className, priority, width, height }) => (_jsx("img", { src: src, alt: alt, className: className, width: width ?? undefined, height: height ?? undefined, loading: priority ? undefined : 'lazy' })),
|
|
39
51
|
};
|
|
40
52
|
const AdminSectionRenderersContext = createContext({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-renderers.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/admin-renderers.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ
|
|
1
|
+
{"version":3,"file":"admin-renderers.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/admin-renderers.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAA;AA4EjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyC;IACxE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;IAC5B,OAAO,EAAE,EAAE;IACX,yEAAyE;IACzE,uEAAuE;IACvE,wDAAwD;IACxD,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;IAC1C,eAAe,EAAE,EAAE;IACnB,WAAW,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACjE,cACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,MAAM,EAAE,MAAM,IAAI,SAAS,EAC3B,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GACtC,CACH;CACF,CAAA;AAED,MAAM,4BAA4B,GAAG,aAAa,CAA0B,EAAE,CAAC,CAAA;AAE/E,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC,QAAQ,CAAA;AAElF,oFAAoF;AACpF,MAAM,UAAU,wBAAwB;IACtC,OAAO,UAAU,CAAC,4BAA4B,CAAC,CAAA;AACjD,CAAC"}
|
|
@@ -40,7 +40,6 @@ export declare function bool(content: Record<string, unknown>, key: string, fall
|
|
|
40
40
|
export declare function paddingClass(settings: SectionSettings): string;
|
|
41
41
|
/** Returns true when the section background is the dark/purple treatment. */
|
|
42
42
|
export declare function isDarkBackground(settings: SectionSettings): boolean;
|
|
43
|
-
/** Background utility classes derived from settings. */
|
|
44
43
|
export declare function backgroundClass(settings: SectionSettings): string;
|
|
45
44
|
/**
|
|
46
45
|
* Preview-only button. `tone="onDark"` renders the white-on-purple button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/parts.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/parts.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAO1D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5D,2DAA2D;IAC3D,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACxE;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,MAAM,CAGxF;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAG7F;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAY9D;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAEnE;AAoCD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,IAAgB,GACjB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;CACtC,kDAwBA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { backgroundPreset, isDarkBackground as coreIsDarkBackground, } from '@prenta/core/page-sections';
|
|
2
3
|
export function str(content, key, fallback = '') {
|
|
3
4
|
const v = content[key];
|
|
4
5
|
return typeof v === 'string' ? v : fallback;
|
|
@@ -15,29 +16,51 @@ export function paddingClass(settings) {
|
|
|
15
16
|
case 'md':
|
|
16
17
|
return 'py-12';
|
|
17
18
|
case 'xl':
|
|
18
|
-
return 'py-20
|
|
19
|
+
return 'py-20 @pv-md:py-28 @pv-2xl:py-36';
|
|
19
20
|
case 'lg':
|
|
20
21
|
default:
|
|
21
|
-
return 'py-16
|
|
22
|
+
return 'py-16 @pv-md:py-20 @pv-2xl:py-28';
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
/** Returns true when the section background is the dark/purple treatment. */
|
|
25
26
|
export function isDarkBackground(settings) {
|
|
26
|
-
return (
|
|
27
|
-
settings.backgroundColor === 'purple');
|
|
27
|
+
return coreIsDarkBackground(settings);
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* The canvas's section backgrounds — deliberately the SITE's palette, not the
|
|
31
|
+
* admin's theme tokens.
|
|
32
|
+
*
|
|
33
|
+
* ── Why not theme tokens ──────────────────────────────────────────────────
|
|
34
|
+
*
|
|
35
|
+
* They were, and it made the canvas lie. `bg-card` and `bg-brand` follow the
|
|
36
|
+
* admin's light/dark theme, so an editor working in dark mode saw a hero in
|
|
37
|
+
* `#9D71F0` and body sections on a dark surface — while the live page renders
|
|
38
|
+
* `violet-600` on white, whatever theme the editor happens to prefer. The
|
|
39
|
+
* canvas exists to show the page as visitors get it; tracking the chrome's
|
|
40
|
+
* theme is the one thing it must not do.
|
|
41
|
+
*
|
|
42
|
+
* In light mode this changes almost nothing: `--brand` resolves to `#7C3AED`,
|
|
43
|
+
* which is `violet-600`. The whole difference was in dark mode, which is
|
|
44
|
+
* exactly where it was least likely to be noticed.
|
|
45
|
+
*
|
|
46
|
+
* ── Why the strings are duplicated from sections-react ────────────────────
|
|
47
|
+
*
|
|
48
|
+
* They have to be. Tailwind generates utilities by scanning source text, and
|
|
49
|
+
* the admin's stylesheet scans only the admin's `src/` tree. Importing the
|
|
50
|
+
* literals from sections-react (or from core) would leave them generated by
|
|
51
|
+
* nobody, and every canvas section would render with no background — silently,
|
|
52
|
+
* with correct markup. `backgroundPreset` in core owns the DECISION so the two
|
|
53
|
+
* cannot diverge, the `Record` below is exhaustive over it, and
|
|
54
|
+
* `section-class-parity.test.ts` asserts the strings still match the site's.
|
|
55
|
+
*/
|
|
56
|
+
const PRESET_CLASSES = {
|
|
57
|
+
'gradient-purple': 'bg-gradient-to-br from-violet-600 to-violet-700 text-white',
|
|
58
|
+
'solid-purple': 'bg-violet-600 text-white',
|
|
59
|
+
'solid-muted': 'bg-zinc-50 text-zinc-900',
|
|
60
|
+
plain: 'bg-white text-zinc-900',
|
|
61
|
+
};
|
|
30
62
|
export function backgroundClass(settings) {
|
|
31
|
-
|
|
32
|
-
return 'bg-gradient-to-br from-violet-600 to-violet-700 text-white';
|
|
33
|
-
}
|
|
34
|
-
if (settings.backgroundType === 'solid' && settings.backgroundColor === 'purple') {
|
|
35
|
-
return 'bg-brand text-white';
|
|
36
|
-
}
|
|
37
|
-
if (settings.backgroundType === 'solid' && settings.backgroundColor === 'muted') {
|
|
38
|
-
return 'bg-muted text-foreground';
|
|
39
|
-
}
|
|
40
|
-
return 'bg-card text-foreground';
|
|
63
|
+
return PRESET_CLASSES[backgroundPreset(settings)];
|
|
41
64
|
}
|
|
42
65
|
/**
|
|
43
66
|
* Preview-only button. `tone="onDark"` renders the white-on-purple button
|
|
@@ -47,7 +70,9 @@ export function backgroundClass(settings) {
|
|
|
47
70
|
export function PreviewButton({ label, href, tone = 'primary', }) {
|
|
48
71
|
if (!label)
|
|
49
72
|
return null;
|
|
50
|
-
|
|
73
|
+
// Handoff: buttons go full width below 460. `w-full` on an inline-flex
|
|
74
|
+
// element still fills its line box, so the narrow case needs no extra wrapper.
|
|
75
|
+
const base = '@pv-sm:w-auto inline-flex w-full items-center justify-center rounded-lg px-5 py-2.5 text-sm font-medium transition-colors';
|
|
51
76
|
const toneClass = tone === 'onDark'
|
|
52
77
|
? 'bg-card text-brand hover:bg-brand/10'
|
|
53
78
|
: tone === 'ghost'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/parts.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/parts.tsx"],"names":[],"mappings":";AAWA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,IAAI,oBAAoB,GAEzC,MAAM,4BAA4B,CAAA;AAoBnC,MAAM,UAAU,GAAG,CAAC,OAAgC,EAAE,GAAW,EAA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,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,uEAAuE;IACvE,+EAA+E;IAC/E,MAAM,IAAI,GACR,2HAA2H,CAAA;IAC7H,MAAM,SAAS,GACb,IAAI,KAAK,QAAQ;QACf,CAAC,CAAC,sCAAsC;QACxC,CAAC,CAAC,IAAI,KAAK,OAAO;YAChB,CAAC,CAAC,qDAAqD;YACvD,CAAC,CAAC,oCAAoC,CAAA;IAC5C,uEAAuE;IACvE,kDAAkD;IAClD,OAAO,CACL,YACE,IAAI,EAAE,IAAI,IAAI,GAAG,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EAClC,SAAS,EAAE,GAAG,IAAI,IAAI,SAAS,EAAE,EACjC,QAAQ,EAAE,CAAC,CAAC,YAEX,KAAK,GACJ,CACL,CAAA;AACH,CAAC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** logical CSS width of the preview surface, in px */
|
|
9
|
-
width: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const VIEWPORTS: Viewport[];
|
|
12
|
-
/** Default working width — near 1:1 in a typical editor pane; device toggles scale-to-fit. */
|
|
13
|
-
export declare const DEFAULT_VIEWPORT: ViewportId;
|
|
14
|
-
export declare function getViewport(id: ViewportId): Viewport;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Moved to `src/lib/breakpoints.ts` when the post editor adopted
|
|
3
|
+
* the same canvas — presets are shared editor infrastructure, not a page-editor
|
|
4
|
+
* detail. This module re-exports under the old names so nothing breaks
|
|
5
|
+
* mid-migration; import from `../../lib/breakpoints.js` in new code.
|
|
6
|
+
*/
|
|
7
|
+
export { BREAKPOINTS as VIEWPORTS, DEFAULT_BREAKPOINT as DEFAULT_VIEWPORT, getBreakpoint as getViewport, type Breakpoint as Viewport, type BreakpointId as ViewportId, } from '../../lib/breakpoints.js';
|
|
15
8
|
//# sourceMappingURL=viewports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewports.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/viewports.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"viewports.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/viewports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,WAAW,IAAI,SAAS,EACxB,kBAAkB,IAAI,gBAAgB,EACtC,aAAa,IAAI,WAAW,EAC5B,KAAK,UAAU,IAAI,QAAQ,EAC3B,KAAK,YAAY,IAAI,UAAU,GAChC,MAAM,0BAA0B,CAAA"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** Default working width — near 1:1 in a typical editor pane; device toggles scale-to-fit. */
|
|
9
|
-
export const DEFAULT_VIEWPORT = '1080p';
|
|
10
|
-
export function getViewport(id) {
|
|
11
|
-
return VIEWPORTS.find((v) => v.id === id) ?? VIEWPORTS[1];
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Moved to `src/lib/breakpoints.ts` when the post editor adopted
|
|
3
|
+
* the same canvas — presets are shared editor infrastructure, not a page-editor
|
|
4
|
+
* detail. This module re-exports under the old names so nothing breaks
|
|
5
|
+
* mid-migration; import from `../../lib/breakpoints.js` in new code.
|
|
6
|
+
*/
|
|
7
|
+
export { BREAKPOINTS as VIEWPORTS, DEFAULT_BREAKPOINT as DEFAULT_VIEWPORT, getBreakpoint as getViewport, } from '../../lib/breakpoints.js';
|
|
13
8
|
//# sourceMappingURL=viewports.js.map
|