@@ -67,7 +67,11 @@ export interface BlockConfigMeta {
6767export interface BlockConfig <
6868 T extends string = string ,
6969 PS extends PropSchema = PropSchema ,
70- C extends "inline" | "none" | "table" = "inline" | "none" | "table" ,
70+ C extends "inline" | "none" | "table" | "plain" =
71+ | "inline"
72+ | "none"
73+ | "table"
74+ | "plain" ,
7175> {
7276 /**
7377 * The type of the block (unique identifier within a schema)
@@ -93,7 +97,7 @@ export interface BlockConfig<
9397export type BlockConfigOrCreator <
9498 TName extends string = string ,
9599 TProps extends PropSchema = PropSchema ,
96- TContent extends "inline" | "none" = "inline" | "none" ,
100+ TContent extends "inline" | "none" | "plain" = "inline" | "none" | "plain ",
97101 TOptions extends Record < string , any > | undefined =
98102 | Record < string , any >
99103 | undefined ,
@@ -108,8 +112,10 @@ export type BlockConfigOrCreator<
108112 */
109113export type ExtractBlockConfigFromConfigOrCreator <
110114 ConfigOrCreator extends
111- | BlockConfig < string , PropSchema , "inline" | "none" >
112- | ( ( ...args : any [ ] ) => BlockConfig < string , PropSchema , "inline" | "none" > ) ,
115+ | BlockConfig < string , PropSchema , "inline" | "none" | "plain" >
116+ | ( (
117+ ...args : any [ ]
118+ ) => BlockConfig < string , PropSchema , "inline" | "none" | "plain" > ) ,
113119> = ConfigOrCreator extends ( ...args : any [ ] ) => infer Config
114120 ? Config
115121 : ConfigOrCreator ;
@@ -118,14 +124,18 @@ export type ExtractBlockConfigFromConfigOrCreator<
118124export type CustomBlockConfig <
119125 T extends string = string ,
120126 PS extends PropSchema = PropSchema ,
121- C extends "inline" | "none" = "inline" | "none" ,
127+ C extends "inline" | "none" | "plain" = "inline" | "none" | "plain ",
122128> = BlockConfig < T , PS , C > ;
123129
124130// A Spec contains both the Config and Implementation
125131export type BlockSpec <
126132 T extends string = string ,
127133 PS extends PropSchema = PropSchema ,
128- C extends "inline" | "none" | "table" = "inline" | "none" | "table" ,
134+ C extends "inline" | "none" | "table" | "plain" =
135+ | "inline"
136+ | "none"
137+ | "table"
138+ | "plain" ,
129139> = {
130140 config : BlockConfig < T , PS , C > ;
131141 implementation : BlockImplementation < T , PS , C > ;
@@ -139,7 +149,11 @@ export type BlockSpec<
139149export type BlockSpecOrCreator <
140150 T extends string = string ,
141151 PS extends PropSchema = PropSchema ,
142- C extends "inline" | "none" | "table" = "inline" | "none" | "table" ,
152+ C extends "inline" | "none" | "table" | "plain" =
153+ | "inline"
154+ | "none"
155+ | "table"
156+ | "plain" ,
143157 TOptions extends Record < string , any > | undefined =
144158 | Record < string , any >
145159 | undefined ,
@@ -154,8 +168,10 @@ export type BlockSpecOrCreator<
154168 */
155169export type ExtractBlockSpecFromSpecOrCreator <
156170 SpecOrCreator extends
157- | BlockSpec < string , PropSchema , "inline" | "none" >
158- | ( ( ...args : any [ ] ) => BlockSpec < string , PropSchema , "inline" | "none" > ) ,
171+ | BlockSpec < string , PropSchema , "inline" | "none" | "plain" >
172+ | ( (
173+ ...args : any [ ]
174+ ) => BlockSpec < string , PropSchema , "inline" | "none" | "plain" > ) ,
159175> = SpecOrCreator extends ( ...args : any [ ] ) => infer Spec ? Spec : SpecOrCreator ;
160176
161177/**
@@ -167,7 +183,11 @@ export type ExtractBlockSpecFromSpecOrCreator<
167183export type LooseBlockSpec <
168184 T extends string = string ,
169185 PS extends PropSchema = PropSchema ,
170- C extends "inline" | "none" | "table" = "inline" | "none" | "table" ,
186+ C extends "inline" | "none" | "table" | "plain" =
187+ | "inline"
188+ | "none"
189+ | "table"
190+ | "plain" ,
171191> = {
172192 config : BlockConfig < T , PS , C > ;
173193 implementation : Omit <
@@ -336,9 +356,11 @@ export type BlockFromConfigNoChildren<
336356 ? InlineContent < I , S > [ ]
337357 : B [ "content" ] extends "table"
338358 ? TableContent < I , S >
339- : B [ "content" ] extends "none"
340- ? undefined
341- : never ;
359+ : B [ "content" ] extends "plain"
360+ ? string
361+ : B [ "content" ] extends "none"
362+ ? undefined
363+ : never ;
342364} ;
343365
344366export type BlockFromConfig <
@@ -420,9 +442,11 @@ type PartialBlockFromConfigNoChildren<
420442 ? PartialInlineContent < I , S >
421443 : B [ "content" ] extends "table"
422444 ? PartialTableContent < I , S >
423- : B [ "content" ] extends "none"
424- ? undefined
425- : never ;
445+ : B [ "content" ] extends "plain"
446+ ? string
447+ : B [ "content" ] extends "none"
448+ ? undefined
449+ : never ;
426450} ;
427451
428452type PartialBlocksWithoutChildren <
@@ -472,7 +496,11 @@ export type BlockIdentifier = { id: string } | string;
472496export type BlockImplementation <
473497 TName extends string = string ,
474498 TProps extends PropSchema = PropSchema ,
475- TContent extends "inline" | "none" | "table" = "inline" | "none" | "table" ,
499+ TContent extends "inline" | "none" | "table" | "plain" =
500+ | "inline"
501+ | "none"
502+ | "table"
503+ | "plain" ,
476504> = {
477505 /**
478506 * Metadata
@@ -589,10 +617,14 @@ export type BlockImplementationOrCreator<
589617 */
590618export type ExtractBlockImplementationFromImplementationOrCreator <
591619 ImplementationOrCreator extends
592- | BlockImplementation < string , PropSchema , "inline" | "none" >
620+ | BlockImplementation < string , PropSchema , "inline" | "none" | "plain" >
593621 | ( (
594622 ...args : any [ ]
595- ) => BlockImplementation < string , PropSchema , "inline" | "none" > ) ,
623+ ) => BlockImplementation <
624+ string ,
625+ PropSchema ,
626+ "inline" | "none" | "plain"
627+ > ) ,
596628> = ImplementationOrCreator extends ( ...args : any [ ] ) => infer Implementation
597629 ? Implementation
598630 : ImplementationOrCreator ;
@@ -601,5 +633,5 @@ export type ExtractBlockImplementationFromImplementationOrCreator<
601633export type CustomBlockImplementation <
602634 T extends string = string ,
603635 PS extends PropSchema = PropSchema ,
604- C extends "inline" | "none" = "inline" | "none" ,
636+ C extends "inline" | "none" | "plain" = "inline" | "none" | "plain ",
605637> = BlockImplementation < T , PS , C > ;
0 commit comments