@prenta/admin 0.95.1 → 0.97.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 +76 -0
- package/dist/__tests__/lib/page-editor-service.test.js +1 -0
- package/dist/__tests__/lib/page-editor-service.test.js.map +1 -1
- package/dist/__tests__/lib/post-editor-service.test.js +27 -0
- package/dist/__tests__/lib/post-editor-service.test.js.map +1 -1
- package/dist/__tests__/styles/responsive-layer.test.js +2 -2
- package/dist/__tests__/styles/responsive-layer.test.js.map +1 -1
- package/dist/__tests__/views/canvas-surface-shared.test.d.ts +2 -0
- package/dist/__tests__/views/canvas-surface-shared.test.d.ts.map +1 -0
- package/dist/__tests__/views/canvas-surface-shared.test.js +53 -0
- package/dist/__tests__/views/canvas-surface-shared.test.js.map +1 -0
- package/dist/__tests__/views/post-section-editor.test.js +42 -0
- package/dist/__tests__/views/post-section-editor.test.js.map +1 -1
- package/dist/__tests__/views/version-history-panel.render.test.js +23 -2
- package/dist/__tests__/views/version-history-panel.render.test.js.map +1 -1
- package/dist/lib/post-editor-service.d.ts.map +1 -1
- package/dist/lib/post-editor-service.js +7 -0
- package/dist/lib/post-editor-service.js.map +1 -1
- package/dist/prenta-admin.css +1 -1
- package/dist/views/Posts/PostsListView.d.ts.map +1 -1
- package/dist/views/Posts/PostsListView.js +11 -1
- package/dist/views/Posts/PostsListView.js.map +1 -1
- package/dist/views/page-editor/CanvasSurface.d.ts +55 -0
- package/dist/views/page-editor/CanvasSurface.d.ts.map +1 -0
- package/dist/views/page-editor/CanvasSurface.js +94 -0
- package/dist/views/page-editor/CanvasSurface.js.map +1 -0
- package/dist/views/page-editor/EditorCanvas.d.ts +5 -28
- package/dist/views/page-editor/EditorCanvas.d.ts.map +1 -1
- package/dist/views/page-editor/EditorCanvas.js +17 -79
- package/dist/views/page-editor/EditorCanvas.js.map +1 -1
- package/dist/views/page-editor/SectionEditForm.d.ts.map +1 -1
- package/dist/views/page-editor/SectionEditForm.js +6 -1
- package/dist/views/page-editor/SectionEditForm.js.map +1 -1
- package/dist/views/page-editor/SectionInspector.d.ts.map +1 -1
- package/dist/views/page-editor/SectionInspector.js +5 -1
- package/dist/views/page-editor/SectionInspector.js.map +1 -1
- package/dist/views/page-editor/sections/DividerSection.d.ts +14 -0
- package/dist/views/page-editor/sections/DividerSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/DividerSection.js +19 -0
- package/dist/views/page-editor/sections/DividerSection.js.map +1 -0
- package/dist/views/page-editor/sections/EmbedSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/EmbedSection.js +11 -3
- package/dist/views/page-editor/sections/EmbedSection.js.map +1 -1
- package/dist/views/page-editor/sections/SectionRenderer.d.ts.map +1 -1
- package/dist/views/page-editor/sections/SectionRenderer.js +4 -0
- package/dist/views/page-editor/sections/SectionRenderer.js.map +1 -1
- package/dist/views/page-editor/sections/WidgetEmbedSection.d.ts.map +1 -1
- package/dist/views/page-editor/sections/WidgetEmbedSection.js +1 -1
- package/dist/views/page-editor/sections/WidgetEmbedSection.js.map +1 -1
- package/dist/views/post-editor/PostEditorCanvas.d.ts +16 -5
- package/dist/views/post-editor/PostEditorCanvas.d.ts.map +1 -1
- package/dist/views/post-editor/PostEditorCanvas.js +16 -47
- 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 +82 -22
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/lib/page-editor-service.test.ts +1 -0
- package/src/__tests__/lib/post-editor-service.test.ts +30 -0
- package/src/__tests__/styles/responsive-layer.test.ts +2 -2
- package/src/__tests__/views/canvas-surface-shared.test.ts +61 -0
- package/src/__tests__/views/post-section-editor.test.tsx +63 -0
- package/src/__tests__/views/version-history-panel.render.test.tsx +26 -2
- package/src/lib/post-editor-service.ts +7 -0
- package/src/views/Posts/PostsListView.tsx +17 -1
- package/src/views/page-editor/CanvasSurface.tsx +171 -0
- package/src/views/page-editor/EditorCanvas.tsx +46 -144
- package/src/views/page-editor/SectionEditForm.tsx +9 -1
- package/src/views/page-editor/SectionInspector.tsx +7 -2
- package/src/views/page-editor/sections/DividerSection.tsx +31 -0
- package/src/views/page-editor/sections/EmbedSection.tsx +11 -5
- package/src/views/page-editor/sections/SectionRenderer.tsx +4 -0
- package/src/views/page-editor/sections/WidgetEmbedSection.tsx +4 -1
- package/src/views/post-editor/PostEditorCanvas.tsx +54 -74
- package/src/views/post-editor/PostSectionEditor.tsx +180 -81
- package/dist/components/EditorSeoAside.d.ts +0 -23
- package/dist/components/EditorSeoAside.d.ts.map +0 -1
- package/dist/components/EditorSeoAside.js +0 -21
- package/dist/components/EditorSeoAside.js.map +0 -1
- package/src/components/EditorSeoAside.tsx +0 -68
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionInspector.js","sourceRoot":"","sources":["../../../src/views/page-editor/SectionInspector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AAC7F,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAenD,MAAM,KAAK,GAAG,WAAW,CAAA;AACzB,MAAM,KAAK,GAAG,WAAW,CAAA;AACzB,MAAM,eAAe,GACnB,6EAA6E,CAAA;AAE/E,SAAS,sBAAsB,CAAC,EAC9B,OAAO,EACP,UAAU,GAAG,iBAAiB,GAI/B;IACC,OAAO,CACL,eAAK,SAAS,EAAC,oCAAoC,aACjD,KAAC,qBAAqB,KAAG,EACzB,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACJ,UAAU,EACtB,SAAS,EAAC,+HAA+H,YAEzI,KAAC,CAAC,IAAC,SAAS,EAAC,SAAS,wBAAe,GAC9B,IACL,CACP,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,GACM;IACtB,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAA;IAC5D,MAAM,iBAAiB,GACrB,OAAO,CAAC,WAAW,KAAK,cAAc;QACtC,UAAU,KAAK,OAAO;QACtB,gBAAgB,KAAK,SAAS,CAAA;IAChC,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"SectionInspector.js","sourceRoot":"","sources":["../../../src/views/page-editor/SectionInspector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAenD,M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KAAK,EAAC,IAAI,sBAAe,EACjC,iBAAQ,KAAK,EAAC,IAAI,4BAAqB,IAChC,IACL,IACG,EAGX,oBAAU,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,EAAC,WAAW,aACjD,iBAAQ,SAAS,EAAC,6EAA6E,yBAEtF,EACT,0BACE,gBAAO,SAAS,EAAE,KAAK,EAAE,OAAO,EAAC,aAAa,0BAEtC,EACR,gBACE,EAAE,EAAC,aAAa,EAChB,SAAS,EAAE,KAAK,EAChB,WAAW,EAAC,eAAe,EAC3B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,EACtC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAC/D,IACE,EACN,0BACE,gBAAO,SAAS,EAAE,KAAK,EAAE,OAAO,EAAC,UAAU,0BAEnC,EACR,gBACE,EAAE,EAAC,UAAU,EACb,SAAS,EAAE,KAAK,EAChB,WAAW,EAAC,cAAc,EAC1B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,EACtC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAC/D,IACE,IACG,IACP,IACS,CAClB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PageSection } from '../../../lib/page-editor-service.js';
|
|
2
|
+
/**
|
|
3
|
+
* Canvas body for the `divider` section.
|
|
4
|
+
*
|
|
5
|
+
* `space` deliberately renders an empty box rather than nothing: on the public
|
|
6
|
+
* page the section wrapper's padding IS the break, but on the canvas a section
|
|
7
|
+
* that draws nothing at all reads as broken. A faint dashed outline says "this
|
|
8
|
+
* is intentional whitespace" without pretending to be what ships — the canvas
|
|
9
|
+
* shows structure, and empty space is the structure here.
|
|
10
|
+
*/
|
|
11
|
+
export declare function DividerSection({ section }: {
|
|
12
|
+
section: PageSection;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=DividerSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DividerSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/DividerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CAkBnE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { str } from './parts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Canvas body for the `divider` section.
|
|
5
|
+
*
|
|
6
|
+
* `space` deliberately renders an empty box rather than nothing: on the public
|
|
7
|
+
* page the section wrapper's padding IS the break, but on the canvas a section
|
|
8
|
+
* that draws nothing at all reads as broken. A faint dashed outline says "this
|
|
9
|
+
* is intentional whitespace" without pretending to be what ships — the canvas
|
|
10
|
+
* shows structure, and empty space is the structure here.
|
|
11
|
+
*/
|
|
12
|
+
export function DividerSection({ section }) {
|
|
13
|
+
const variant = str(section.content, 'variant') || 'line';
|
|
14
|
+
if (variant === 'space') {
|
|
15
|
+
return (_jsx("div", { className: "mx-auto max-w-3xl px-6", children: _jsx("div", { className: "border-border text-muted-foreground flex h-10 items-center justify-center rounded-md border border-dashed text-xs", children: "Space" }) }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsx("div", { className: "mx-auto max-w-3xl px-6", children: _jsx("hr", { className: "border-0 border-t border-current opacity-15", "aria-hidden": true }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=DividerSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DividerSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/DividerSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEhC;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAA4B;IAClE,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,MAAM,CAAA;IAEzD,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,CACL,cAAK,SAAS,EAAC,wBAAwB,YACrC,cAAK,SAAS,EAAC,mHAAmH,sBAE5H,GACF,CACP,CAAA;IACH,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAC,wBAAwB,YACrC,aAAI,SAAS,EAAC,6CAA6C,wBAAe,GACtE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/EmbedSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAUtE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"EmbedSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/EmbedSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAUtE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CA+BjE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PlayCircle } from 'lucide-react';
|
|
3
|
-
import {
|
|
3
|
+
import { resolveVideo, EMBED_PROVIDER_LABEL } from '@prenta/core/page-sections';
|
|
4
4
|
import { str } from './parts.js';
|
|
5
5
|
const RATIO_CLASS = {
|
|
6
6
|
'16:9': 'aspect-video',
|
|
@@ -15,10 +15,18 @@ const RATIO_CLASS = {
|
|
|
15
15
|
*/
|
|
16
16
|
export function EmbedSection({ section }) {
|
|
17
17
|
const c = section.content;
|
|
18
|
-
const
|
|
18
|
+
const video = resolveVideo(c);
|
|
19
19
|
const ratioClass = RATIO_CLASS[str(c, 'ratio', '16:9')] ?? RATIO_CLASS['16:9'];
|
|
20
20
|
const title = str(c, 'title');
|
|
21
21
|
const caption = str(c, 'caption');
|
|
22
|
-
|
|
22
|
+
// Naming the resolved source is the only confirmation an editor gets that
|
|
23
|
+
// the link they pasted, or the file they picked, actually resolved — the
|
|
24
|
+
// canvas never loads the real video either way.
|
|
25
|
+
const label = !video
|
|
26
|
+
? 'No valid video set'
|
|
27
|
+
: video.kind === 'hosted'
|
|
28
|
+
? 'Uploaded video'
|
|
29
|
+
: `${EMBED_PROVIDER_LABEL[video.provider]} video`;
|
|
30
|
+
return (_jsxs("figure", { className: "mx-auto max-w-3xl px-6", children: [_jsxs("div", { className: `bg-muted text-muted-foreground relative flex w-full flex-col items-center justify-center gap-2 overflow-hidden rounded-xl ${ratioClass}`, children: [_jsx(PlayCircle, { className: "h-10 w-10", "aria-hidden": true }), _jsx("p", { className: "text-foreground text-sm font-medium", children: label }), title && _jsx("p", { className: "text-muted-foreground px-4 text-center text-xs", children: title })] }), caption && (_jsx("figcaption", { className: "text-muted-foreground mt-2 text-center text-sm", children: caption }))] }));
|
|
23
31
|
}
|
|
24
32
|
//# sourceMappingURL=EmbedSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/EmbedSection.tsx"],"names":[],"mappings":";AAAA,O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aAEpJ,KAAC,UAAU,IAAC,SAAS,EAAC,WAAW,wBAAe,EAChD,YAAG,SAAS,EAAC,qCAAqC,YAAE,KAAK,GAAK,EAC7D,KAAK,IAAI,YAAG,SAAS,EAAC,gDAAgD,YAAE,KAAK,GAAK,IAC/E,EACL,OAAO,IAAI,CACV,qBAAY,SAAS,EAAC,gDAAgD,YACnE,OAAO,GACG,CACd,IACM,CACV,CAAA;AACH,CAAC"}
|
|
@@ -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;
|
|
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;AAqClF,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE9D;AAgHD,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"}
|
|
@@ -17,6 +17,7 @@ import { RelatedPostsSection } from './RelatedPostsSection.js';
|
|
|
17
17
|
import { GallerySection } from './GallerySection.js';
|
|
18
18
|
import { EmbedSection } from './EmbedSection.js';
|
|
19
19
|
import { WidgetEmbedSection } from './WidgetEmbedSection.js';
|
|
20
|
+
import { DividerSection } from './DividerSection.js';
|
|
20
21
|
/**
|
|
21
22
|
* Section types with a real canvas body component below. Anything else —
|
|
22
23
|
* config-declared custom types (`opal-*`), unmanaged sections, and the
|
|
@@ -36,6 +37,7 @@ const CANVAS_RENDERED_TYPES = new Set([
|
|
|
36
37
|
'gallery',
|
|
37
38
|
'embed',
|
|
38
39
|
'widget-embed',
|
|
40
|
+
'divider',
|
|
39
41
|
]);
|
|
40
42
|
/** True when the canvas renders this type for real (not as a placeholder). */
|
|
41
43
|
export function hasCanvasRenderer(sectionType) {
|
|
@@ -106,6 +108,8 @@ function BuiltInSectionBody({ section, context, }) {
|
|
|
106
108
|
return _jsx(EmbedSection, { section: section });
|
|
107
109
|
case 'widget-embed':
|
|
108
110
|
return _jsx(WidgetEmbedSection, { section: section });
|
|
111
|
+
case 'divider':
|
|
112
|
+
return _jsx(DividerSection, { section: section });
|
|
109
113
|
default:
|
|
110
114
|
// Config-declared custom types and unmanaged sections with no supplied
|
|
111
115
|
// renderer: a neutral placeholder keeps the canvas reflecting the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionRenderer.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/SectionRenderer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA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AAQ,CAAC,QAAQ,IAAI,EACvB,IAAI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAC5B,WAAW;YACT,CAAC,CAAC,4GAA4G;YAC9G,CAAC,CAAC,EACN,IACE,SAAS;YACP,CAAC,CAAC,OAAO;gBACP,CAAC,CAAC,4DAA4D;gBAC9D,CAAC,CAAC,qBAAqB;YACzB,CAAC,CAAC,QAAQ;gBACR,CAAC,CAAC,4BAA4B;gBAC9B,CAAC,CAAC,WAAW;oBACX,CAAC,CAAC,kGAAkG;oBACpG,CAAC,CAAC,qBACV,EAAE,EACF,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,gBAI7D,SAAS,IAAI,OAAO;YAClB,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,oCAAoC;YACrD,CAAC,CAAC,WAAW;gBACX,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,UAAU;gBAC3B,CAAC,CAAC,SAAS,aAGhB,WAAW,IAAI,QAAQ,IAAI,CAC1B,eAAM,SAAS,EAAC,kHAAkH,YAC/H,OAAO,CAAC,IAAI,GACR,CACR,EAIA,SAAS,IAAI,OAAO,IAAI,CACvB,gBAAM,SAAS,EAAC,iIAAiI,aAC9I,OAAO,CAAC,IAAI,uBACR,CACR,EACA,OAAO,IAAI,MAAM,IAAI,CACpB,eAAM,SAAS,EAAC,wHAAwH,uBAEjI,CACR,EACD,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,IAC3C,CACX,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetEmbedSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/WidgetEmbedSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"WidgetEmbedSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/WidgetEmbedSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CAyBvE"}
|
|
@@ -13,6 +13,6 @@ export function WidgetEmbedSection({ section }) {
|
|
|
13
13
|
const minHeight = parsed?.minHeightPx ?? 280;
|
|
14
14
|
return (_jsx("section", { className: "mx-auto max-w-3xl px-6", "aria-label": title || 'Third-party widget', children: _jsxs("div", { className: "bg-muted text-muted-foreground relative flex w-full flex-col items-center justify-center gap-2 overflow-hidden rounded-xl", style: { minHeight: `${minHeight}px` }, children: [_jsx(Puzzle, { className: "h-8 w-8", "aria-hidden": true }), _jsx("p", { className: "text-foreground text-sm font-medium", children: parsed
|
|
15
15
|
? `${WIDGET_PROVIDER_LABEL[parsed.provider]} widget`
|
|
16
|
-
: '
|
|
16
|
+
: 'Paste embed code to load a widget' }), title && _jsx("p", { className: "text-muted-foreground px-4 text-center text-xs", children: title })] }) }));
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=WidgetEmbedSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetEmbedSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/WidgetEmbedSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEpF,OAAO,EAAE,GAAG,EAAE,MAAM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,EAAE,GAAG,SAAS,IAAI,EAAE,aAEtC,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,wBAAe,EAI1C,YAAG,SAAS,EAAC,qCAAqC,YAC/C,MAAM;wBACL,CAAC,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS;wBACpD,CAAC,CAAC,mCAAmC,GACrC,EACH,KAAK,IAAI,YAAG,SAAS,EAAC,gDAAgD,YAAE,KAAK,GAAK,IAC/E,GACE,CACX,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Zoom } from '../../lib/breakpoints.js';
|
|
1
2
|
import type { PageSection, PostHeaderConfig } from '../../lib/post-editor-service.js';
|
|
2
3
|
import { type PostRenderContext } from '../page-editor/sections/index.js';
|
|
3
4
|
import { type ViewportId } from '../page-editor/viewports.js';
|
|
@@ -7,7 +8,10 @@ interface PostEditorCanvasProps {
|
|
|
7
8
|
context: PostRenderContext;
|
|
8
9
|
selectedId: string | null;
|
|
9
10
|
viewport: ViewportId;
|
|
11
|
+
zoom?: Zoom;
|
|
10
12
|
onSelect: (id: string) => void;
|
|
13
|
+
onScaleChange?: (scale: number) => void;
|
|
14
|
+
onCanvasElement?: (el: HTMLElement | null) => void;
|
|
11
15
|
/** Add-section CTA on the empty canvas. Omitted by design-owned editors. */
|
|
12
16
|
onAddSection?: () => void;
|
|
13
17
|
/** Section types rendered as placeholders — shows the "Structure view" notice. */
|
|
@@ -16,11 +20,18 @@ interface PostEditorCanvasProps {
|
|
|
16
20
|
sitePreviewAvailable?: boolean;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
|
-
* Post preview canvas.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
+
* Post preview canvas.
|
|
24
|
+
*
|
|
25
|
+
* Shares {@link CanvasSurface} with the page editor, so measurement, scaling,
|
|
26
|
+
* the fit box and the meta line are one implementation rather than two. What is
|
|
27
|
+
* post-specific is what goes inside: the post header renders above the body
|
|
28
|
+
* sections, so the editor shows the full layout — header regions plus sections
|
|
29
|
+
* — exactly as it will ship.
|
|
30
|
+
*
|
|
31
|
+
* Before this shared surface the post canvas derived its width from
|
|
32
|
+
* `container.clientWidth - 48`, which disagrees with the canvas's own metrics
|
|
33
|
+
* once a scrollbar appears, and it had no breakpoint/scale readout at all.
|
|
23
34
|
*/
|
|
24
|
-
export declare function PostEditorCanvas({ sections, header, context, selectedId, viewport, onSelect, onAddSection, structuralTypes, sitePreviewAvailable, }: PostEditorCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function PostEditorCanvas({ sections, header, context, selectedId, viewport, zoom, onSelect, onScaleChange, onCanvasElement, onAddSection, structuralTypes, sitePreviewAvailable, }: PostEditorCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
25
36
|
export {};
|
|
26
37
|
//# sourceMappingURL=PostEditorCanvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostEditorCanvas.d.ts","sourceRoot":"","sources":["../../../src/views/post-editor/PostEditorCanvas.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PostEditorCanvas.d.ts","sourceRoot":"","sources":["../../../src/views/post-editor/PostEditorCanvas.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAErF,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAE1F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAG7D,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,MAAM,EAAE,gBAAgB,CAAA;IACxB,OAAO,EAAE,iBAAiB,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,EAAE,UAAU,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAClD,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,IAAY,EACZ,QAAQ,EACR,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAoB,EACpB,oBAA4B,GAC7B,EAAE,qBAAqB,2CAuCvB"}
|
|
@@ -1,58 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { FileText, Plus } from 'lucide-react';
|
|
5
4
|
import { CanvasEditTip } from '../../components/CanvasEditTip.js';
|
|
5
|
+
import { CanvasScroll, CanvasSurface, useSectionRefs } from '../page-editor/CanvasSurface.js';
|
|
6
6
|
import { SectionRenderer } from '../page-editor/sections/index.js';
|
|
7
7
|
import { StructureNotice } from '../page-editor/StructureNotice.js';
|
|
8
|
-
import { getViewport } from '../page-editor/viewports.js';
|
|
9
8
|
import { PostHeader } from './PostHeader.js';
|
|
10
9
|
/**
|
|
11
|
-
* Post preview canvas.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Post preview canvas.
|
|
11
|
+
*
|
|
12
|
+
* Shares {@link CanvasSurface} with the page editor, so measurement, scaling,
|
|
13
|
+
* the fit box and the meta line are one implementation rather than two. What is
|
|
14
|
+
* post-specific is what goes inside: the post header renders above the body
|
|
15
|
+
* sections, so the editor shows the full layout — header regions plus sections
|
|
16
|
+
* — exactly as it will ship.
|
|
17
|
+
*
|
|
18
|
+
* Before this shared surface the post canvas derived its width from
|
|
19
|
+
* `container.clientWidth - 48`, which disagrees with the canvas's own metrics
|
|
20
|
+
* once a scrollbar appears, and it had no breakpoint/scale readout at all.
|
|
15
21
|
*/
|
|
16
|
-
export function PostEditorCanvas({ sections, header, context, selectedId, viewport, onSelect, onAddSection, structuralTypes = [], sitePreviewAvailable = false, }) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const surfaceRef = useRef(null);
|
|
20
|
-
const sectionRefs = useRef(new Map());
|
|
21
|
-
const [scale, setScale] = useState(1);
|
|
22
|
-
const [surfaceHeight, setSurfaceHeight] = useState(null);
|
|
23
|
-
const registerRef = useCallback((id, el) => {
|
|
24
|
-
if (el)
|
|
25
|
-
sectionRefs.current.set(id, el);
|
|
26
|
-
else
|
|
27
|
-
sectionRefs.current.delete(id);
|
|
28
|
-
}, []);
|
|
29
|
-
useLayoutEffect(() => {
|
|
30
|
-
const container = containerRef.current;
|
|
31
|
-
if (!container)
|
|
32
|
-
return;
|
|
33
|
-
const recompute = () => {
|
|
34
|
-
const available = container.clientWidth - 48;
|
|
35
|
-
const next = Math.min(1, available / vp.width);
|
|
36
|
-
setScale(next > 0 ? next : 1);
|
|
37
|
-
if (surfaceRef.current) {
|
|
38
|
-
setSurfaceHeight(surfaceRef.current.offsetHeight * (next > 0 ? next : 1));
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
recompute();
|
|
42
|
-
const ro = new ResizeObserver(recompute);
|
|
43
|
-
ro.observe(container);
|
|
44
|
-
if (surfaceRef.current)
|
|
45
|
-
ro.observe(surfaceRef.current);
|
|
46
|
-
return () => ro.disconnect();
|
|
47
|
-
}, [vp.width, sections, header, context]);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (!selectedId)
|
|
50
|
-
return;
|
|
51
|
-
const el = sectionRefs.current.get(selectedId);
|
|
52
|
-
if (el)
|
|
53
|
-
el.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
54
|
-
}, [selectedId]);
|
|
55
|
-
return (_jsxs("div", { ref: containerRef, className: "bg-muted h-full overflow-auto p-6", children: [sections.length > 0 && _jsx(CanvasEditTip, {}), _jsx(StructureNotice, { structuralTypes: structuralTypes, sitePreviewAvailable: sitePreviewAvailable }), _jsx("div", { className: "mx-auto", style: { width: vp.width * scale, height: surfaceHeight ?? undefined }, children: _jsxs("div", { ref: surfaceRef, className: "prenta-canvas border-border bg-card origin-top overflow-hidden rounded-xl border shadow-sm", style: { width: vp.width, transform: `scale(${scale})`, transformOrigin: 'top left' }, children: [_jsx(PostHeader, { config: header, context: context }), sections.length === 0 ? (_jsx(EmptyBody, { onAddSection: onAddSection })) : (sections.map((section) => (_jsx(SectionRenderer, { section: section, context: context, editable: true, selected: section.id === selectedId, onSelect: onSelect, registerRef: registerRef }, section.id))))] }) })] }));
|
|
22
|
+
export function PostEditorCanvas({ sections, header, context, selectedId, viewport, zoom = 'fit', onSelect, onScaleChange, onCanvasElement, onAddSection, structuralTypes = [], sitePreviewAvailable = false, }) {
|
|
23
|
+
const registerRef = useSectionRefs(selectedId);
|
|
24
|
+
return (_jsx(CanvasScroll, { children: _jsxs(CanvasSurface, { breakpoint: viewport, zoom: zoom, onScaleChange: onScaleChange, onCanvasElement: onCanvasElement, chrome: _jsxs(_Fragment, { children: [sections.length > 0 && _jsx(CanvasEditTip, {}), _jsx(StructureNotice, { structuralTypes: structuralTypes, sitePreviewAvailable: sitePreviewAvailable })] }), children: [_jsx(PostHeader, { config: header, context: context }), sections.length === 0 ? (_jsx(EmptyBody, { onAddSection: onAddSection })) : (sections.map((section) => (_jsx(SectionRenderer, { section: section, context: context, editable: true, selected: section.id === selectedId, onSelect: onSelect, registerRef: registerRef }, section.id))))] }) }));
|
|
56
25
|
}
|
|
57
26
|
function EmptyBody({ onAddSection }) {
|
|
58
27
|
// This block sits inside the fixed-white preview surface, so the neutral
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostEditorCanvas.js","sourceRoot":"","sources":["../../../src/views/post-editor/PostEditorCanvas.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PostEditorCanvas.js","sourceRoot":"","sources":["../../../src/views/post-editor/PostEditorCanvas.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAGjE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC7F,OAAO,EAAE,eAAe,EAA0B,MAAM,kCAAkC,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAoB5C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,IAAI,GAAG,KAAK,EACZ,QAAQ,EACR,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,GAAG,EAAE,EACpB,oBAAoB,GAAG,KAAK,GACN;IACtB,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;IAE9C,OAAO,CACL,KAAC,YAAY,cACX,MAAC,aAAa,IACZ,UAAU,EAAE,QAAQ,EACpB,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IAAI,IAAC,SAAS,EAAC,SAAS,wBAAe,mBAEjC,CACV,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostSectionEditor.d.ts","sourceRoot":"","sources":["../../../src/views/post-editor/PostSectionEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PostSectionEditor.d.ts","sourceRoot":"","sources":["../../../src/views/post-editor/PostSectionEditor.tsx"],"names":[],"mappings":"AAwDA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE5E,8DAA8D;AAC9D,UAAU,YAAY;IACpB,WAAW,CAAC,EAAE,MAAM,CAClB,MAAM,EACJ;QACE,MAAM,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC,CAAA;KACrD,GACD,SAAS,CACZ,CAAA;IACD,GAAG,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1B,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG;gBAAE,KAAK,CAAC,EAAE,OAAO,CAAC;gBAAC,KAAK,CAAC,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAA;CAC7F;AAED,wDAAwD;AACxD,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACxD;AAED,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CACjG;AAgBD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,UAAU,EACV,MAAM,EACN,OAAO,EACP,UAAU,EACV,aAAa,GACd,EAAE,sBAAsB,2CAkyBxB"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { AlertTriangle, Loader2, Lock } from 'lucide-react';
|
|
5
5
|
import { toast } from 'sonner';
|
|
6
6
|
import { ConfirmDialog } from '../../components/ui/ConfirmDialog.js';
|
|
7
7
|
import { useNavigationBlocker } from '../../router/index.js';
|
|
8
8
|
import { SchedulePublishDialog } from '../../components/SchedulePublishDialog.js';
|
|
9
|
-
import {
|
|
9
|
+
import { EditorRail, RailHeader } from '../../components/EditorRail.js';
|
|
10
|
+
import { EditorRailTabs } from '../../components/EditorRailTabs.js';
|
|
11
|
+
import { SeoEditorPane } from '../../components/seo/SeoEditorPane.js';
|
|
10
12
|
import { ErrorBoundary } from '../../components/ErrorBoundary.js';
|
|
11
13
|
import { VersionHistory } from '../../components/VersionHistory.js';
|
|
12
14
|
import { emptyPostFromTemplate, fetchPostForEditor, fetchTemplateForEditor, missingPostFields, publishPost, savePostDraft, toggleSectionVisibility, updateSectionContent, updateSectionContentAtPath, updateSectionMeta, validatePost, } from '../../lib/post-editor-service.js';
|
|
@@ -19,11 +21,13 @@ import { DEFAULT_VIEWPORT } from '../page-editor/viewports.js';
|
|
|
19
21
|
import { EditorTopBar } from '../page-editor/EditorTopBar.js';
|
|
20
22
|
import { SitePreviewFrame } from '../page-editor/SitePreviewFrame.js';
|
|
21
23
|
import { useSitePreview } from '../page-editor/useSitePreview.js';
|
|
22
|
-
import {
|
|
24
|
+
import { SectionsList } from '../page-editor/SectionsPanel.js';
|
|
23
25
|
import { SectionEditForm } from '../page-editor/SectionEditForm.js';
|
|
24
26
|
import { ValidationSummary } from '../page-editor/ValidationSummary.js';
|
|
25
27
|
import { resolveDefaultSitePreview } from '../../lib/editor-preview.js';
|
|
26
|
-
import { computeLiveSeoScore } from '../../lib/editor-seo-content.js';
|
|
28
|
+
import { buildEditorContentHtml, computeLiveSeoScore } from '../../lib/editor-seo-content.js';
|
|
29
|
+
import { snapshotBaseline } from '../../lib/reflow-baseline.js';
|
|
30
|
+
import { ReflowContext } from '../page-editor/reflow-context.js';
|
|
27
31
|
import { companionDimensionPaths, inspectorIdFromFieldPath } from '../../lib/preview-bridge.js';
|
|
28
32
|
import { PostEditorCanvas } from './PostEditorCanvas.js';
|
|
29
33
|
import { PostFieldsModal } from './PostFieldsModal.js';
|
|
@@ -51,16 +55,42 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
51
55
|
/** Canvas image Replace — opens MediaPickerModal for this field path. */
|
|
52
56
|
const [canvasMediaTarget, setCanvasMediaTarget] = useState(null);
|
|
53
57
|
const [viewport, setViewport] = useState(DEFAULT_VIEWPORT);
|
|
58
|
+
const [zoom, setZoom] = useState('fit');
|
|
59
|
+
/** Scale the canvas measured — reported upward so the zoom chip shows a real %. */
|
|
60
|
+
const [canvasScale, setCanvasScale] = useState(1);
|
|
61
|
+
/** The live canvas surface, for the reflow guard to clone. */
|
|
62
|
+
const [canvasEl, setCanvasEl] = useState(null);
|
|
63
|
+
/** Section content as it is on the live site, for the reflow guard's baseline. */
|
|
64
|
+
const [baseline, setBaseline] = useState(null);
|
|
54
65
|
const [dirty, setDirty] = useState(false);
|
|
55
66
|
const [saveState, setSaveState] = useState('idle');
|
|
56
67
|
const [publishing, setPublishing] = useState(false);
|
|
57
68
|
const [fieldsOpen, setFieldsOpen] = useState(false);
|
|
58
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Active rail tab. Replaces the boolean `seoOpen` that drove a right-hand
|
|
71
|
+
* aside — the same aside the page editor retired so the editor has one
|
|
72
|
+
* settings surface rather than two competing ones.
|
|
73
|
+
*/
|
|
74
|
+
const [railTab, setRailTab] = useState('sections');
|
|
75
|
+
const seoOpen = railTab === 'seo';
|
|
59
76
|
const [historyOpen, setHistoryOpen] = useState(false);
|
|
60
77
|
const [confirmPublish, setConfirmPublish] = useState(false);
|
|
61
78
|
const [scheduleOpen, setScheduleOpen] = useState(false);
|
|
62
79
|
const [leaveTarget, setLeaveTarget] = useState(null);
|
|
63
80
|
const [validation, setValidation] = useState(null);
|
|
81
|
+
/**
|
|
82
|
+
* Take delivery of server state.
|
|
83
|
+
*
|
|
84
|
+
* Every path that receives a fresh post from the API goes through here so
|
|
85
|
+
* the reflow baseline is re-captured with it. Saving a PUBLISHED post writes
|
|
86
|
+
* straight through to the live content, so a save moves the baseline exactly
|
|
87
|
+
* as a publish does; missing one would leave the guard comparing against
|
|
88
|
+
* content no longer on the site.
|
|
89
|
+
*/
|
|
90
|
+
const acceptPost = useCallback((p) => {
|
|
91
|
+
setPost(p);
|
|
92
|
+
setBaseline(snapshotBaseline(p.sections, p.status));
|
|
93
|
+
}, []);
|
|
64
94
|
const { canEdit, canPublish } = useMemo(() => deriveCan(session), [session]);
|
|
65
95
|
const customRenderers = useAdminSectionRenderers();
|
|
66
96
|
const { siteUrl: publicSiteUrl } = usePublicSiteUrl(config?.seo?.siteUrl);
|
|
@@ -83,6 +113,33 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
83
113
|
}, [config, postType]);
|
|
84
114
|
const publishCheck = useMemo(() => (post ? validatePost(post, true) : { errors: [''], warnings: [] }), [post]);
|
|
85
115
|
const publishReady = Boolean(post) && publishCheck.errors.length === 0;
|
|
116
|
+
const railTabs = useMemo(() => [
|
|
117
|
+
{
|
|
118
|
+
id: 'sections',
|
|
119
|
+
label: 'Sections',
|
|
120
|
+
title: 'Post content',
|
|
121
|
+
count: post?.sections.length ?? 0,
|
|
122
|
+
},
|
|
123
|
+
// No score dot yet. The page editor's comes from the page audit, which
|
|
124
|
+
// is page-scoped; wiring a number here from `computeLiveSeoScore` would
|
|
125
|
+
// put a different model's score on a tab, which is the disagreement the
|
|
126
|
+
// page editor was rewired to remove.
|
|
127
|
+
{ id: 'seo', label: 'SEO & GEO', title: 'Search & AI readiness' },
|
|
128
|
+
], [post?.sections.length]);
|
|
129
|
+
const activeRailTab = railTabs.find((tab) => tab.id === railTab) ?? railTabs[0];
|
|
130
|
+
// Content the SEO pane analyses — sections plus the post body.
|
|
131
|
+
const seoContentHtml = useMemo(() => buildEditorContentHtml(post?.sections ?? [], post?.body ?? ''), [post?.sections, post?.body]);
|
|
132
|
+
// The reflow guard's inputs, gathered in one place. Memoised because a new
|
|
133
|
+
// object identity on every render would restart the debounce in every guarded
|
|
134
|
+
// field's effect — the measurement would then never settle while typing,
|
|
135
|
+
// which is precisely when it is wanted.
|
|
136
|
+
const reflowContext = useMemo(() => ({
|
|
137
|
+
canvas: canvasEl,
|
|
138
|
+
sectionId: selectedId,
|
|
139
|
+
baseline,
|
|
140
|
+
device: viewport,
|
|
141
|
+
onProof: setViewport,
|
|
142
|
+
}), [canvasEl, selectedId, baseline, viewport]);
|
|
86
143
|
const liveSeoScore = useMemo(() => {
|
|
87
144
|
if (!post)
|
|
88
145
|
return 0;
|
|
@@ -125,7 +182,7 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
125
182
|
.then((p) => {
|
|
126
183
|
if (cancelled)
|
|
127
184
|
return;
|
|
128
|
-
|
|
185
|
+
acceptPost(p);
|
|
129
186
|
setSelectedId(null);
|
|
130
187
|
if (!documentId) {
|
|
131
188
|
setDirty(true);
|
|
@@ -201,7 +258,7 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
201
258
|
setSaveState('saving');
|
|
202
259
|
try {
|
|
203
260
|
const saved = await savePostDraft(post);
|
|
204
|
-
|
|
261
|
+
acceptPost(saved);
|
|
205
262
|
setDirty(false);
|
|
206
263
|
setSaveState('saved');
|
|
207
264
|
setValidation(null);
|
|
@@ -278,7 +335,7 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
278
335
|
setPublishing(true);
|
|
279
336
|
try {
|
|
280
337
|
const published = await publishPost(post);
|
|
281
|
-
|
|
338
|
+
acceptPost(published);
|
|
282
339
|
setDirty(false);
|
|
283
340
|
setSaveState('saved');
|
|
284
341
|
setValidation(null);
|
|
@@ -300,9 +357,9 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
300
357
|
return;
|
|
301
358
|
fetchPostForEditor(postType, post.id)
|
|
302
359
|
.then((p) => {
|
|
303
|
-
|
|
360
|
+
acceptPost(p);
|
|
304
361
|
setSelectedId(null);
|
|
305
|
-
|
|
362
|
+
setRailTab('sections');
|
|
306
363
|
setDirty(false);
|
|
307
364
|
setSaveState('idle');
|
|
308
365
|
setValidation(null);
|
|
@@ -315,20 +372,21 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
315
372
|
if (!post?.id)
|
|
316
373
|
return;
|
|
317
374
|
fetchPostForEditor(postType, post.id)
|
|
318
|
-
.then((p) =>
|
|
375
|
+
.then((p) => acceptPost(p))
|
|
319
376
|
.catch(() => {
|
|
320
377
|
/* SEO API saved; editor meta will sync on next full load */
|
|
321
378
|
});
|
|
322
379
|
}, [postType, post?.id]);
|
|
323
380
|
const handleToggleSeo = useCallback(() => {
|
|
324
|
-
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
|
|
381
|
+
setRailTab((tab) => {
|
|
382
|
+
if (tab === 'seo')
|
|
383
|
+
return 'sections';
|
|
384
|
+
setSelectedId(null);
|
|
385
|
+
return 'seo';
|
|
328
386
|
});
|
|
329
387
|
}, []);
|
|
330
388
|
const handleSelectSection = useCallback((id, fieldPath) => {
|
|
331
|
-
|
|
389
|
+
setRailTab('sections');
|
|
332
390
|
setPendingFocusPath(fieldPath ?? null);
|
|
333
391
|
// Toggles, because selection is now disclosure — see the note on the page
|
|
334
392
|
// editor's copy. A `fieldPath` means the site preview is pointing at a
|
|
@@ -452,12 +510,14 @@ export function PostSectionEditor({ postType, documentId, config, session, onNav
|
|
|
452
510
|
const structuralTypes = Array.from(new Set(post.sections
|
|
453
511
|
.filter((s) => !hasCanvasRenderer(s.sectionType) && !customRenderers[s.sectionType])
|
|
454
512
|
.map((s) => s.sectionType)));
|
|
455
|
-
return (_jsxs(ErrorBoundary, { children: [_jsxs("div", { className: "bg-background flex h-full flex-col overflow-hidden", children: [_jsx(EditorTopBar, { title: post.title || `New ${typeLabel}`, status: post.status, dirty: dirty, saveState: saveState, publishing: publishing, canEdit: canEdit, canPublish: canPublish && canEdit, publishReady: publishReady, publishDisabledReason: publishDisabledReason, viewport: viewport, backLabel: "Posts", onViewport: setViewport,
|
|
456
|
-
|
|
457
|
-
//
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
513
|
+
return (_jsxs(ErrorBoundary, { children: [_jsxs("div", { className: "bg-background flex h-full flex-col overflow-hidden", children: [_jsx(EditorTopBar, { title: post.title || `New ${typeLabel}`, status: post.status, dirty: dirty, saveState: saveState, publishing: publishing, canEdit: canEdit, canPublish: canPublish && canEdit, publishReady: publishReady, publishDisabledReason: publishDisabledReason, viewport: viewport, backLabel: "Posts", onViewport: setViewport, ...(sitePreview.active
|
|
514
|
+
? // The site preview is an iframe of the real front end, not a
|
|
515
|
+
// scaled canvas — a zoom percentage there would be a lie.
|
|
516
|
+
{}
|
|
517
|
+
: { zoom, canvasScale, onZoom: setZoom }), onBack: () => guardedNavigate('/posts'), onPreview: handlePreview, onViewOnSite: post.id ? handleViewOnSite : undefined, sitePreview: sitePreview.active, onToggleSitePreview: post.id && post.slug ? sitePreview.toggle : undefined, onHistory: post.id ? () => setHistoryOpen(true) : undefined, onOpenSettings: () => setFieldsOpen(true), onOpenSeo: handleToggleSeo, seoOpen: seoOpen, seoScore: liveSeoScore, onSaveDraft: handleSaveDraft, onPublish: requestPublish, onSchedule: post.id ? requestSchedule : undefined, scheduleReady: Boolean(post.id), scheduledAt: post.scheduledAt, scheduledUnpublishAt: post.scheduledUnpublishAt, structuralTypes: structuralTypes }), unmanagedTypes.length > 0 && (_jsxs("div", { role: "status", className: "border-border bg-muted/50 flex items-start gap-3 border-b px-4 py-2.5", children: [_jsx(Lock, { className: "text-muted-foreground mt-0.5 shrink-0", size: 16, "aria-hidden": true }), _jsxs("p", { className: "text-muted-foreground flex-1 text-sm", children: ["This post has", ' ', _jsxs("span", { className: "text-foreground font-medium", children: [unmanagedTypes.length, " section type", unmanagedTypes.length > 1 ? 's' : ''] }), ' ', "managed outside the editor (", unmanagedTypes.join(', '), "). They are preserved on save but edited in your seed script or code, not here."] })] })), validation && (_jsx(ValidationSummary, { errors: validation.errors, warnings: validation.warnings, onDismiss: () => setValidation(null) })), _jsx(ReflowContext.Provider, { value: reflowContext, children: _jsxs("div", { className: "prenta-editor-body relative flex flex-1 overflow-hidden", children: [_jsx(EditorRail, { collapsedLabel: activeRailTab.label, children: ({ width, dragging, collapse }) => (_jsxs(_Fragment, { children: [_jsx(EditorRailTabs, { tabs: railTabs, active: railTab, onChange: setRailTab }), _jsx(RailHeader, { title: activeRailTab.title, width: width, dragging: dragging, onCollapse: collapse }), _jsx("div", { role: "tabpanel", id: `rail-panel-${railTab}`, "aria-labelledby": `rail-tab-${railTab}`, className: "flex min-h-0 flex-1 flex-col", children: railTab === 'sections' ? (_jsx(SectionsList, { sections: post.sections, selectedId: selectedId, canEdit: canEdit, onSelect: handleSelectSection, onToggleVisibility: handleToggleVisibility, renderEditor: (section) => (_jsx(SectionEditForm, { section: section, canEdit: canEdit, onContentChange: handleContentChange, onMetaChange: handleMetaChange, postBody: post.body, onPostBodyChange: handlePostBodyChange })) })) : (_jsx(SeoEditorPane, { entityType: "post", entityId: post.id, slug: post.slug, auditSections: post.sections, contentHtml: seoContentHtml, draftMeta: {
|
|
518
|
+
seoTitle: post.seoTitle,
|
|
519
|
+
seoDescription: post.seoDescription,
|
|
520
|
+
}, onDraftChange: handleFields, onClose: () => setRailTab('sections'), onSaved: handleSeoSaved })) })] })) }), _jsx("div", { className: "flex-1 overflow-hidden", children: sitePreview.active ? (_jsx(SitePreviewFrame, { src: sitePreview.url, viewport: viewport, reloadKey: sitePreview.reloadKey, title: `Site preview: ${post.title || `New ${typeLabel}`}`, selectedId: selectedId, sections: post.sections, suppressSectionsEcho: suppressSectionsEcho, onSelectSection: handleSelectSection, onCanvasEdit: handleCanvasEdit, onCanvasRequestMedia: handleCanvasRequestMedia })) : (_jsx(PostEditorCanvas, { sections: post.sections, header: header, context: context, selectedId: selectedId, viewport: viewport, zoom: zoom, onScaleChange: setCanvasScale, onCanvasElement: setCanvasEl, onSelect: handleSelectSection, structuralTypes: structuralTypes, sitePreviewAvailable: sitePreviewAvailable && !sitePreview.active })) })] }) })] }), post.id && (_jsx(VersionHistory, { collectionSlug: postType, documentId: post.id, open: historyOpen, onClose: () => setHistoryOpen(false), onRestore: handleRestored })), _jsx(PostFieldsModal, { open: fieldsOpen, post: post, canEdit: canEdit, fields: config?.collections?.[postType]?.fields, onClose: () => setFieldsOpen(false), onSave: handleFields }), _jsx(ConfirmDialog, { open: confirmPublish, onClose: () => setConfirmPublish(false), onConfirm: doPublish, title: "Publish this post?", description: "The current content will go live and replace the published version.", confirmLabel: "Publish" }), post.id && (_jsx(SchedulePublishDialog, { collectionSlug: postType, documentId: post.id, scheduledAt: post.scheduledAt, scheduledUnpublishAt: post.scheduledUnpublishAt, open: scheduleOpen, onClose: () => setScheduleOpen(false), onScheduled: handleScheduled })), _jsx(ConfirmDialog, { open: leaveTarget !== null, onClose: () => setLeaveTarget(null), onConfirm: () => {
|
|
461
521
|
const target = leaveTarget;
|
|
462
522
|
setLeaveTarget(null);
|
|
463
523
|
setDirty(false);
|