Skip to content

Commit

Permalink
Change definition type
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Jan 9, 2024
1 parent 9c8529b commit 2662556
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/slate-utils/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
Block as FieldBlock,
BlockType,
Blockquote as FieldBlockquote,
BlockquoteType,
BlockType,
Code as FieldCode,
CodeType,
DefaultMark,
Expand Down Expand Up @@ -155,17 +155,17 @@ type ReplaceSlateWithFieldTypes<T> = ReplaceType<

export type Definition = {
type: NodeType;
accepts: 'text' | 'inlineNodesAndText' | NodeType[];
accepts: Array<NodeType | 'textWithMarks' | 'text'>;
};

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 = {
Expand All @@ -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 = {
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 2662556

Please sign in to comment.