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";
export const breakBlock: Block = {
export const breakBlock: LexicalBlock = {
slug: "breakBlock",
interfaceName: "BreakBlock",
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 { breakBlock } from "./breakBlock";
import { transcriptBlock } from "./transcriptBlock";
const generateRecursiveSectionBlock = (depth = 1, maxDepth = 5): Block => ({
const generateRecursiveSectionBlock = (depth = 1, maxDepth = 5): LexicalBlock => ({
slug: "sectionBlock",
interfaceName: "SectionBlock",
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 { lineBlock } from "./lineBlock";
export const transcriptBlock: Block = {
export const transcriptBlock: LexicalBlock = {
slug: "transcriptBlock",
interfaceName: "TranscriptBlock",
labels: { singular: "Transcript", plural: "Transcripts" },

View File

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