Rename lines to content

This commit is contained in:
DrMint 2024-03-01 00:26:15 +01:00
parent 18142c7f31
commit 63e00a9b9d
4 changed files with 6 additions and 7 deletions

View File

@ -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 }),
},
],
};

View File

@ -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,

View File

@ -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 = ({

View File

@ -1343,7 +1343,7 @@ export interface TranscriptBlock {
* via the `definition` "SectionBlock".
*/
export interface SectionBlock {
lines: {
content: {
root: {
children: {
type: string;