Rename lines to content
This commit is contained in:
parent
18142c7f31
commit
63e00a9b9d
|
@ -1,6 +1,5 @@
|
|||
import { Block } from "payload/types";
|
||||
import { createEditor } from "../utils/editor";
|
||||
import { cueBlock } from "./cueBlock";
|
||||
|
||||
export const lineBlock: Block = {
|
||||
slug: "lineBlock",
|
||||
|
@ -15,7 +14,7 @@ export const lineBlock: Block = {
|
|||
admin: {
|
||||
className: "reduced-margins",
|
||||
},
|
||||
editor: createEditor({ inlines: true, lists: true, links: true, blocks: [cueBlock] }),
|
||||
editor: createEditor({ inlines: true, lists: true, links: true }),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ const generateRecursiveSectionBlock = (depth = 1, maxDepth = 5): Block => ({
|
|||
labels: { singular: "Section", plural: "Sections" },
|
||||
fields: [
|
||||
{
|
||||
name: "lines",
|
||||
name: "content",
|
||||
type: "richText",
|
||||
label: false,
|
||||
required: true,
|
||||
|
|
|
@ -78,7 +78,7 @@ const handleContent = (
|
|||
fields: {
|
||||
...node.fields,
|
||||
anchorHash,
|
||||
lines: handleContent(node.fields.lines, anchorHash),
|
||||
content: handleContent(node.fields.content, anchorHash),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ const handleToc = (content: RichTextContent, parentPrefix = ""): TableOfContentE
|
|||
.filter(isBlockNodeSectionBlock)
|
||||
.map(({ fields }, index) => ({
|
||||
prefix: `${parentPrefix}${index + 1}.`,
|
||||
title: fields.blockName,
|
||||
children: handleToc(fields.lines, `${index + 1}.`),
|
||||
title: fields.blockName ?? "",
|
||||
children: handleToc(fields.content, `${index + 1}.`),
|
||||
}));
|
||||
|
||||
const handleParentPages = ({
|
||||
|
|
|
@ -1343,7 +1343,7 @@ export interface TranscriptBlock {
|
|||
* via the `definition` "SectionBlock".
|
||||
*/
|
||||
export interface SectionBlock {
|
||||
lines: {
|
||||
content: {
|
||||
root: {
|
||||
children: {
|
||||
type: string;
|
||||
|
|
Loading…
Reference in New Issue