From 266255697302acd761ee8766cabaa0d92e86002e Mon Sep 17 00:00:00 2001 From: Stefano Verna Date: Tue, 9 Jan 2024 06:17:10 +0100 Subject: [PATCH] Change definition type --- packages/slate-utils/src/types.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/slate-utils/src/types.ts b/packages/slate-utils/src/types.ts index 71c6ba1..6c39e50 100644 --- a/packages/slate-utils/src/types.ts +++ b/packages/slate-utils/src/types.ts @@ -1,8 +1,8 @@ import { Block as FieldBlock, - BlockType, Blockquote as FieldBlockquote, BlockquoteType, + BlockType, Code as FieldCode, CodeType, DefaultMark, @@ -155,17 +155,17 @@ type ReplaceSlateWithFieldTypes = ReplaceType< export type Definition = { type: NodeType; - accepts: 'text' | 'inlineNodesAndText' | NodeType[]; + accepts: Array; }; export const paragraphDef: Definition = { type: 'paragraph', - accepts: 'inlineNodesAndText', + accepts: ['link', 'itemLink', 'inlineItem', 'textWithMarks', 'text'], }; export const headingDef: Definition = { type: 'heading', - accepts: 'inlineNodesAndText', + accepts: ['link', 'itemLink', 'inlineItem', 'textWithMarks', 'text'], }; export const thematicBreakDef: Definition = { @@ -175,12 +175,12 @@ export const thematicBreakDef: Definition = { export const linkDef: Definition = { type: 'link', - accepts: 'text', + accepts: ['textWithMarks', 'text'], }; export const itemLinkDef: Definition = { type: 'itemLink', - accepts: 'text', + accepts: ['textWithMarks', 'text'], }; export const inlineItemDef: Definition = { @@ -210,12 +210,12 @@ export const blockquoteDef: Definition = { export const blockquoteSourceDef: Definition = { type: 'blockquoteSource', - accepts: 'text', + accepts: ['text'], }; export const codeDef: Definition = { type: 'code', - accepts: 'text', + accepts: ['text'], }; type BlockquoteSourceType = 'blockquoteSource';