@prenta/admin 0.94.0 → 0.95.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 +41 -0
- package/dist/__tests__/lib/page-editor-service-api.test.js +37 -0
- package/dist/__tests__/lib/page-editor-service-api.test.js.map +1 -1
- package/dist/__tests__/views/section-edit-form.render.test.d.ts +2 -0
- package/dist/__tests__/views/section-edit-form.render.test.d.ts.map +1 -0
- package/dist/__tests__/views/section-edit-form.render.test.js +124 -0
- package/dist/__tests__/views/section-edit-form.render.test.js.map +1 -0
- package/dist/__tests__/views/section-inspector-media.test.js +1 -1
- package/dist/__tests__/views/section-inspector-media.test.js.map +1 -1
- package/dist/__tests__/views/section-inspector-repeater.render.test.js +2 -1
- package/dist/__tests__/views/section-inspector-repeater.render.test.js.map +1 -1
- package/dist/components/CanvasEditTip.js +1 -1
- package/dist/components/CanvasEditTip.js.map +1 -1
- package/dist/prenta-admin.css +1 -1
- package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.js +16 -10
- package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
- package/dist/views/page-editor/SectionEditForm.d.ts +42 -0
- package/dist/views/page-editor/SectionEditForm.d.ts.map +1 -0
- package/dist/views/page-editor/SectionEditForm.js +48 -0
- package/dist/views/page-editor/SectionEditForm.js.map +1 -0
- package/dist/views/page-editor/SectionInspector.d.ts +0 -20
- package/dist/views/page-editor/SectionInspector.d.ts.map +1 -1
- package/dist/views/page-editor/SectionInspector.js +5 -223
- package/dist/views/page-editor/SectionInspector.js.map +1 -1
- package/dist/views/page-editor/SectionsPanel.d.ts +10 -1
- package/dist/views/page-editor/SectionsPanel.d.ts.map +1 -1
- package/dist/views/page-editor/SectionsPanel.js +11 -5
- package/dist/views/page-editor/SectionsPanel.js.map +1 -1
- package/dist/views/page-editor/section-fields.d.ts +43 -0
- package/dist/views/page-editor/section-fields.d.ts.map +1 -0
- package/dist/views/page-editor/section-fields.js +236 -0
- package/dist/views/page-editor/section-fields.js.map +1 -0
- package/dist/views/page-editor/sections/ArticleBodySection.js +1 -1
- package/dist/views/page-editor/sections/ArticleBodySection.js.map +1 -1
- package/dist/views/post-editor/PostEditorCanvas.js +1 -1
- 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 +11 -9
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/lib/page-editor-service-api.test.ts +44 -0
- package/src/__tests__/views/section-edit-form.render.test.tsx +162 -0
- package/src/__tests__/views/section-inspector-media.test.ts +1 -1
- package/src/__tests__/views/section-inspector-repeater.render.test.tsx +2 -1
- package/src/components/CanvasEditTip.tsx +3 -3
- package/src/views/page-editor/PageSectionEditor.tsx +22 -24
- package/src/views/page-editor/SectionEditForm.tsx +161 -0
- package/src/views/page-editor/SectionInspector.tsx +7 -552
- package/src/views/page-editor/SectionsPanel.tsx +70 -14
- package/src/views/page-editor/section-fields.tsx +563 -0
- package/src/views/page-editor/sections/ArticleBodySection.tsx +1 -1
- package/src/views/post-editor/PostEditorCanvas.tsx +1 -1
- package/src/views/post-editor/PostSectionEditor.tsx +18 -26
|
@@ -42,7 +42,7 @@ export function ArticleBodySection({
|
|
|
42
42
|
<p className="text-muted-foreground text-base leading-relaxed italic">
|
|
43
43
|
{source === 'field'
|
|
44
44
|
? "This will show the post's Body content."
|
|
45
|
-
: 'Add body copy in the
|
|
45
|
+
: 'Add body copy in the section list.'}
|
|
46
46
|
</p>
|
|
47
47
|
)}
|
|
48
48
|
</div>
|
|
@@ -129,7 +129,7 @@ function EmptyBody({ onAddSection }: { onAddSection?: () => void }) {
|
|
|
129
129
|
</span>
|
|
130
130
|
<p className="text-muted-foreground text-sm">
|
|
131
131
|
{onAddSection
|
|
132
|
-
? 'The header is set by the template. Add body sections to build out this post. Hover sections for a light outline, click to
|
|
132
|
+
? 'The header is set by the template. Add body sections to build out this post. Hover sections for a light outline, click to open its editor in the section list — or use Site preview to click text and images in place.'
|
|
133
133
|
: 'This post’s template renders no body sections. Layout is design-owned — sections come from the template in code. Pick a different template in Post settings, or edit the template itself.'}
|
|
134
134
|
</p>
|
|
135
135
|
{onAddSection && (
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
updateSectionContent,
|
|
21
21
|
updateSectionContentAtPath,
|
|
22
22
|
updateSectionMeta,
|
|
23
|
-
updateSectionSettings,
|
|
24
23
|
validatePost,
|
|
25
24
|
type EditorPost,
|
|
26
25
|
type PostHeaderConfig,
|
|
@@ -34,7 +33,6 @@ import {
|
|
|
34
33
|
createPreviewToken,
|
|
35
34
|
} from '../../lib/preview-link.js'
|
|
36
35
|
import { usePublicSiteUrl } from '../../hooks/usePublicSiteUrl.js'
|
|
37
|
-
import type { SectionSettings } from '../page-editor/section-types.js'
|
|
38
36
|
import {
|
|
39
37
|
hasCanvasRenderer,
|
|
40
38
|
useAdminSectionRenderers,
|
|
@@ -45,7 +43,7 @@ import { EditorTopBar, type SaveState } from '../page-editor/EditorTopBar.js'
|
|
|
45
43
|
import { SitePreviewFrame } from '../page-editor/SitePreviewFrame.js'
|
|
46
44
|
import { useSitePreview } from '../page-editor/useSitePreview.js'
|
|
47
45
|
import { SectionsPanel } from '../page-editor/SectionsPanel.js'
|
|
48
|
-
import {
|
|
46
|
+
import { SectionEditForm } from '../page-editor/SectionEditForm.js'
|
|
49
47
|
import { ValidationSummary } from '../page-editor/ValidationSummary.js'
|
|
50
48
|
import { resolveDefaultSitePreview } from '../../lib/editor-preview.js'
|
|
51
49
|
import { computeLiveSeoScore } from '../../lib/editor-seo-content.js'
|
|
@@ -271,13 +269,9 @@ export function PostSectionEditor({
|
|
|
271
269
|
},
|
|
272
270
|
[selectedId, mutateSections],
|
|
273
271
|
)
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
mutateSections((s) => updateSectionSettings(s, selectedId, patch))
|
|
278
|
-
},
|
|
279
|
-
[selectedId, mutateSections],
|
|
280
|
-
)
|
|
272
|
+
// No `handleSettingsChange`: background, spacing, anchor and CSS class are
|
|
273
|
+
// template-authored (docs/design-owned-sections.md). Values round-trip on
|
|
274
|
+
// save untouched; the post TEMPLATE editor still edits them.
|
|
281
275
|
const handleMetaChange = useCallback(
|
|
282
276
|
(patch: { name?: string; internalLabel?: string }) => {
|
|
283
277
|
if (!selectedId) return
|
|
@@ -590,8 +584,6 @@ export function PostSectionEditor({
|
|
|
590
584
|
)
|
|
591
585
|
}
|
|
592
586
|
|
|
593
|
-
const selected = post.sections.find((s) => s.id === selectedId) ?? null
|
|
594
|
-
|
|
595
587
|
// Sections whose type has no registered definition (seed/code-owned, e.g.
|
|
596
588
|
// `opal-*`). They are preserved verbatim on save but can't be edited here.
|
|
597
589
|
const unmanagedTypes = Array.from(
|
|
@@ -677,6 +669,20 @@ export function PostSectionEditor({
|
|
|
677
669
|
canEdit={canEdit}
|
|
678
670
|
onSelect={handleSelectSection}
|
|
679
671
|
onToggleVisibility={handleToggleVisibility}
|
|
672
|
+
// Same inline editor as the page editor. The post editor still has
|
|
673
|
+
// its own standalone panel rather than the rail (followup 20), but
|
|
674
|
+
// where the FORM lives is a separate question from what contains
|
|
675
|
+
// the list, and the answer is the same on both screens.
|
|
676
|
+
renderEditor={(section) => (
|
|
677
|
+
<SectionEditForm
|
|
678
|
+
section={section}
|
|
679
|
+
canEdit={canEdit}
|
|
680
|
+
onContentChange={handleContentChange}
|
|
681
|
+
onMetaChange={handleMetaChange}
|
|
682
|
+
postBody={post.body}
|
|
683
|
+
onPostBodyChange={handlePostBodyChange}
|
|
684
|
+
/>
|
|
685
|
+
)}
|
|
680
686
|
/>
|
|
681
687
|
|
|
682
688
|
<div className="flex-1 overflow-hidden">
|
|
@@ -707,20 +713,6 @@ export function PostSectionEditor({
|
|
|
707
713
|
)}
|
|
708
714
|
</div>
|
|
709
715
|
|
|
710
|
-
{selected && !seoOpen && (
|
|
711
|
-
<SectionInspector
|
|
712
|
-
section={selected}
|
|
713
|
-
canEdit={canEdit}
|
|
714
|
-
onClose={() => setSelectedId(null)}
|
|
715
|
-
onContentChange={handleContentChange}
|
|
716
|
-
onSettingsChange={handleSettingsChange}
|
|
717
|
-
onMetaChange={handleMetaChange}
|
|
718
|
-
onToggleVisibility={() => handleToggleVisibility(selected.id)}
|
|
719
|
-
postBody={post.body}
|
|
720
|
-
onPostBodyChange={handlePostBodyChange}
|
|
721
|
-
/>
|
|
722
|
-
)}
|
|
723
|
-
|
|
724
716
|
{seoOpen && (
|
|
725
717
|
<EditorSeoAside
|
|
726
718
|
entityType="post"
|