This commit is contained in:
DrMint 2024-05-05 08:21:57 +02:00
parent de599cfcd7
commit 11ac215611
4 changed files with 10 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import { Block } from "payload/types"; import { LexicalBlock } from "@payloadcms/richtext-lexical";
import { BreakBlockType } from "../constants"; import { BreakBlockType } from "../constants";
export const breakBlock: Block = { export const breakBlock: LexicalBlock = {
slug: "breakBlock", slug: "breakBlock",
interfaceName: "BreakBlock", interfaceName: "BreakBlock",
labels: { singular: "Break", plural: "Breaks" }, labels: { singular: "Break", plural: "Breaks" },

View File

@ -1,9 +1,9 @@
import { Block } from "payload/types"; import { LexicalBlock } from "@payloadcms/richtext-lexical";
import { createEditor } from "../utils/editor"; import { createEditor } from "../utils/editor";
import { breakBlock } from "./breakBlock"; import { breakBlock } from "./breakBlock";
import { transcriptBlock } from "./transcriptBlock"; import { transcriptBlock } from "./transcriptBlock";
const generateRecursiveSectionBlock = (depth = 1, maxDepth = 5): Block => ({ const generateRecursiveSectionBlock = (depth = 1, maxDepth = 5): LexicalBlock => ({
slug: "sectionBlock", slug: "sectionBlock",
interfaceName: "SectionBlock", interfaceName: "SectionBlock",
labels: { singular: "Section", plural: "Sections" }, labels: { singular: "Section", plural: "Sections" },
@ -33,4 +33,4 @@ const generateRecursiveSectionBlock = (depth = 1, maxDepth = 5): Block => ({
], ],
}); });
export const sectionBlock: Block = generateRecursiveSectionBlock(); export const sectionBlock: LexicalBlock = generateRecursiveSectionBlock();

View File

@ -1,8 +1,8 @@
import { Block } from "payload/types"; import { LexicalBlock } from "@payloadcms/richtext-lexical";
import { cueBlock } from "./cueBlock"; import { cueBlock } from "./cueBlock";
import { lineBlock } from "./lineBlock"; import { lineBlock } from "./lineBlock";
export const transcriptBlock: Block = { export const transcriptBlock: LexicalBlock = {
slug: "transcriptBlock", slug: "transcriptBlock",
interfaceName: "TranscriptBlock", interfaceName: "TranscriptBlock",
labels: { singular: "Transcript", plural: "Transcripts" }, labels: { singular: "Transcript", plural: "Transcripts" },

View File

@ -8,6 +8,7 @@ import {
HeadingFeature, HeadingFeature,
InlineCodeTextFeature, InlineCodeTextFeature,
ItalicTextFeature, ItalicTextFeature,
LexicalBlock,
LinkFeature, LinkFeature,
// BlockQuoteFeature, // BlockQuoteFeature,
OrderedListFeature, OrderedListFeature,
@ -22,11 +23,11 @@ import {
UploadFeature, UploadFeature,
lexicalEditor, lexicalEditor,
} from "@payloadcms/richtext-lexical"; } from "@payloadcms/richtext-lexical";
import { Block, RichTextAdapter } from "payload/types"; import { RichTextAdapter } from "payload/types";
interface EditorOptions { interface EditorOptions {
debugs: boolean; debugs: boolean;
blocks: Block[]; blocks: LexicalBlock[];
headings: boolean; headings: boolean;
lists: boolean; lists: boolean;
inlines: boolean; inlines: boolean;