@blocknote/core 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/dist/blocknote.js +1536 -1458
  3. package/dist/blocknote.js.map +1 -1
  4. package/dist/blocknote.umd.cjs +6 -6
  5. package/dist/blocknote.umd.cjs.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/webpack-stats.json +1 -1
  8. package/package.json +5 -3
  9. package/src/api/blockManipulation/blockManipulation.ts +144 -30
  10. package/src/api/exporters/copyExtension.ts +97 -24
  11. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
  12. package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -1
  13. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
  14. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  15. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
  16. package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
  17. package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -1
  18. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  19. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
  20. package/src/api/exporters/html/util/sharedHTMLConversion.ts +1 -0
  21. package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +0 -1
  22. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +9 -0
  23. package/src/api/parsers/pasteExtension.ts +0 -1
  24. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +19 -19
  25. package/src/editor/Block.css +19 -14
  26. package/src/editor/BlockNoteEditor.ts +11 -12
  27. package/src/editor/editor.css +1 -0
  28. package/src/extensions/NonEditableBlocks/NonEditableBlockPlugin.ts +12 -1
  29. package/src/extensions/SideMenu/SideMenuPlugin.ts +2 -2
  30. package/src/extensions/TableHandles/TableHandlesPlugin.ts +3 -1
  31. package/src/pm-nodes/BlockContainer.ts +1 -1
  32. package/types/src/api/blockManipulation/blockManipulation.d.ts +8 -6
  33. package/types/src/editor/BlockNoteEditor.d.ts +9 -7
  34. package/types/src/BlockNoteEditor.d.ts +0 -300
  35. package/types/src/BlockNoteEditor.test.d.ts +0 -1
  36. package/types/src/BlockNoteExtensions.d.ts +0 -26
  37. package/types/src/api/nodeConversions/testUtil.d.ts +0 -7
  38. package/types/src/api/testCases/cases/customBlocks.d.ts +0 -345
  39. package/types/src/api/testCases/cases/customInlineContent.d.ts +0 -29
  40. package/types/src/api/testCases/cases/customStyles.d.ts +0 -64
  41. package/types/src/api/testCases/cases/defaultSchema.d.ts +0 -3
  42. package/types/src/api/testCases/index.d.ts +0 -12
  43. package/types/src/api/util/nodeUtil.d.ts +0 -8
  44. package/types/src/extensions/Blocks/NonEditableBlockPlugin.d.ts +0 -2
  45. package/types/src/extensions/Blocks/PreviousBlockTypePlugin.d.ts +0 -14
  46. package/types/src/extensions/Blocks/api/blocks/createSpec.d.ts +0 -35
  47. package/types/src/extensions/Blocks/api/blocks/internal.d.ts +0 -45
  48. package/types/src/extensions/Blocks/api/blocks/types.d.ts +0 -114
  49. package/types/src/extensions/Blocks/api/cursorPositionTypes.d.ts +0 -8
  50. package/types/src/extensions/Blocks/api/defaultBlocks.d.ts +0 -577
  51. package/types/src/extensions/Blocks/api/defaultProps.d.ts +0 -15
  52. package/types/src/extensions/Blocks/api/inlineContent/createSpec.d.ts +0 -21
  53. package/types/src/extensions/Blocks/api/inlineContent/internal.d.ts +0 -25
  54. package/types/src/extensions/Blocks/api/inlineContent/types.d.ts +0 -62
  55. package/types/src/extensions/Blocks/api/selectionTypes.d.ts +0 -6
  56. package/types/src/extensions/Blocks/api/styles/createSpec.d.ts +0 -13
  57. package/types/src/extensions/Blocks/api/styles/internal.d.ts +0 -22
  58. package/types/src/extensions/Blocks/api/styles/types.d.ts +0 -21
  59. package/types/src/extensions/Blocks/helpers/findBlock.d.ts +0 -6
  60. package/types/src/extensions/Blocks/helpers/getBlockInfoFromPos.d.ts +0 -27
  61. package/types/src/extensions/Blocks/index.d.ts +0 -4
  62. package/types/src/extensions/Blocks/nodes/BlockAttributes.d.ts +0 -2
  63. package/types/src/extensions/Blocks/nodes/BlockContainer.d.ts +0 -30
  64. package/types/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.d.ts +0 -58
  65. package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.d.ts +0 -95
  66. package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -1
  67. package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +0 -46
  68. package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +0 -2
  69. package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.d.ts +0 -2
  70. package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +0 -46
  71. package/types/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.d.ts +0 -52
  72. package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableBlockContent.d.ts +0 -53
  73. package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableExtension.d.ts +0 -2
  74. package/types/src/extensions/Blocks/nodes/BlockContent/defaultBlockHelpers.d.ts +0 -12
  75. package/types/src/extensions/Blocks/nodes/BlockGroup.d.ts +0 -10
  76. package/types/src/shared/BaseUiElementTypes.d.ts +0 -7
  77. package/types/src/shared/EditorElement.d.ts +0 -0
  78. package/types/src/shared/EventEmitter.d.ts +0 -11
  79. package/types/src/shared/plugins/suggestion/SuggestionItem.d.ts +0 -3
  80. package/types/src/shared/plugins/suggestion/SuggestionPlugin.d.ts +0 -37
  81. package/types/src/shared/utils.d.ts +0 -6
@@ -1,29 +0,0 @@
1
- import { EditorTestCases } from "..";
2
- import { DefaultBlockSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
3
- import { InlineContentSchemaFromSpecs } from "../../../extensions/Blocks/api/inlineContent/types";
4
- declare const customInlineContent: {
5
- mention: import("../../../extensions/Blocks/api/inlineContent/types").InlineContentSpec<{
6
- type: "mention";
7
- propSchema: {
8
- user: {
9
- default: string;
10
- };
11
- };
12
- content: "none";
13
- }>;
14
- tag: import("../../../extensions/Blocks/api/inlineContent/types").InlineContentSpec<{
15
- type: "tag";
16
- propSchema: {};
17
- content: "styled";
18
- }>;
19
- text: {
20
- config: "text";
21
- implementation: any;
22
- };
23
- link: {
24
- config: "link";
25
- implementation: any;
26
- };
27
- };
28
- export declare const customInlineContentTestCases: EditorTestCases<DefaultBlockSchema, InlineContentSchemaFromSpecs<typeof customInlineContent>, DefaultStyleSchema>;
29
- export {};
@@ -1,64 +0,0 @@
1
- import { EditorTestCases } from "..";
2
- import { DefaultBlockSchema, DefaultInlineContentSchema } from "../../../extensions/Blocks/api/defaultBlocks";
3
- import { StyleSchemaFromSpecs } from "../../../extensions/Blocks/api/styles/types";
4
- declare const customStyles: {
5
- small: import("../../../extensions/Blocks/api/styles/types").StyleSpec<{
6
- type: string;
7
- propSchema: "boolean";
8
- }>;
9
- fontSize: import("../../../extensions/Blocks/api/styles/types").StyleSpec<{
10
- type: string;
11
- propSchema: "string";
12
- }>;
13
- bold: {
14
- config: {
15
- type: string;
16
- propSchema: "boolean";
17
- };
18
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
19
- };
20
- italic: {
21
- config: {
22
- type: string;
23
- propSchema: "boolean";
24
- };
25
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
26
- };
27
- underline: {
28
- config: {
29
- type: string;
30
- propSchema: "boolean";
31
- };
32
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
33
- };
34
- strike: {
35
- config: {
36
- type: string;
37
- propSchema: "boolean";
38
- };
39
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
40
- };
41
- code: {
42
- config: {
43
- type: string;
44
- propSchema: "boolean";
45
- };
46
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
47
- };
48
- textColor: {
49
- config: {
50
- type: string;
51
- propSchema: "string";
52
- };
53
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
54
- };
55
- backgroundColor: {
56
- config: {
57
- type: string;
58
- propSchema: "string";
59
- };
60
- implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
61
- };
62
- };
63
- export declare const customStylesTestCases: EditorTestCases<DefaultBlockSchema, DefaultInlineContentSchema, StyleSchemaFromSpecs<typeof customStyles>>;
64
- export {};
@@ -1,3 +0,0 @@
1
- import { EditorTestCases } from "..";
2
- import { DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
3
- export declare const defaultSchemaTestCases: EditorTestCases<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
@@ -1,12 +0,0 @@
1
- import { BlockNoteEditor } from "../../BlockNoteEditor";
2
- import { BlockSchema, PartialBlock } from "../../extensions/Blocks/api/blocks/types";
3
- import { InlineContentSchema } from "../../extensions/Blocks/api/inlineContent/types";
4
- import { StyleSchema } from "../../extensions/Blocks/api/styles/types";
5
- export type EditorTestCases<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
6
- name: string;
7
- createEditor: () => BlockNoteEditor<B, I, S>;
8
- documents: Array<{
9
- name: string;
10
- blocks: PartialBlock<B, I, S>[];
11
- }>;
12
- };
@@ -1,8 +0,0 @@
1
- import { Node } from "prosemirror-model";
2
- /**
3
- * Get a TipTap node by id
4
- */
5
- export declare function getNodeById(id: string, doc: Node): {
6
- node: Node;
7
- posBeforeNode: number;
8
- };
@@ -1,2 +0,0 @@
1
- import { Plugin } from "prosemirror-state";
2
- export declare const NonEditableBlockPlugin: () => Plugin<any>;
@@ -1,14 +0,0 @@
1
- import { Plugin } from "prosemirror-state";
2
- /**
3
- * This plugin tracks transformation of Block node attributes, so we can support CSS transitions.
4
- *
5
- * Problem it solves: ProseMirror recreates the DOM when transactions happen. So when a transaction changes a Node attribute,
6
- * it results in a completely new DOM element. This means CSS transitions don't work.
7
- *
8
- * Solution: When attributes change on a node, this plugin sets a data-* attribute with the "previous" value. This way we can still use CSS transitions. (See block.module.css)
9
- */
10
- export declare const PreviousBlockTypePlugin: () => Plugin<{
11
- prevTransactionOldBlockAttrs: any;
12
- currentTransactionOldBlockAttrs: any;
13
- updatedBlocks: Set<string>;
14
- }>;
@@ -1,35 +0,0 @@
1
- import { ParseRule } from "@tiptap/pm/model";
2
- import { BlockNoteEditor } from "../../../../BlockNoteEditor";
3
- import { InlineContentSchema } from "../inlineContent/types";
4
- import { StyleSchema } from "../styles/types";
5
- import { BlockConfig, BlockFromConfig, BlockSchemaWithBlock, PartialBlockFromConfig } from "./types";
6
- export type CustomBlockConfig = BlockConfig & {
7
- content: "inline" | "none";
8
- };
9
- export type CustomBlockImplementation<T extends CustomBlockConfig, I extends InlineContentSchema, S extends StyleSchema> = {
10
- render: (
11
- /**
12
- * The custom block to render
13
- */
14
- block: BlockFromConfig<T, I, S>,
15
- /**
16
- * The BlockNote editor instance
17
- * This is typed generically. If you want an editor with your custom schema, you need to
18
- * cast it manually, e.g.: `const e = editor as BlockNoteEditor<typeof mySchema>;`
19
- */
20
- editor: BlockNoteEditor<BlockSchemaWithBlock<T["type"], T>, I, S>) => {
21
- dom: HTMLElement;
22
- contentDOM?: HTMLElement;
23
- destroy?: () => void;
24
- };
25
- toExternalHTML?: (block: BlockFromConfig<T, I, S>, editor: BlockNoteEditor<BlockSchemaWithBlock<T["type"], T>, I, S>) => {
26
- dom: HTMLElement;
27
- contentDOM?: HTMLElement;
28
- };
29
- parse?: (el: HTMLElement) => PartialBlockFromConfig<T, I, S>["props"] | undefined;
30
- };
31
- export declare function getParseRules(config: BlockConfig, customParseFunction: CustomBlockImplementation<any, any, any>["parse"]): ParseRule[];
32
- export declare function createBlockSpec<T extends CustomBlockConfig, I extends InlineContentSchema, S extends StyleSchema>(blockConfig: T, blockImplementation: CustomBlockImplementation<T, I, S>): {
33
- config: T;
34
- implementation: import("./types").TiptapBlockImplementation<T, any, InlineContentSchema, StyleSchema>;
35
- };
@@ -1,45 +0,0 @@
1
- import { Attributes, Editor, Extension, Node, NodeConfig } from "@tiptap/core";
2
- import { BlockNoteEditor } from "../../../../BlockNoteEditor";
3
- import { InlineContentSchema } from "../inlineContent/types";
4
- import { StyleSchema } from "../styles/types";
5
- import { BlockConfig, BlockSchemaFromSpecs, BlockSchemaWithBlock, BlockSpecs, Props, PropSchema, SpecificBlock, TiptapBlockImplementation } from "./types";
6
- export declare function camelToDataKebab(str: string): string;
7
- export declare function propsToAttributes(propSchema: PropSchema): Attributes;
8
- export declare function getBlockFromPos<BType extends string, Config extends BlockConfig, BSchema extends BlockSchemaWithBlock<BType, Config>, I extends InlineContentSchema, S extends StyleSchema>(getPos: (() => number) | boolean, editor: BlockNoteEditor<BSchema, I, S>, tipTapEditor: Editor, type: BType): SpecificBlock<BSchema, BType, I, S>;
9
- export declare function wrapInBlockStructure<BType extends string, PSchema extends PropSchema>(element: {
10
- dom: HTMLElement;
11
- contentDOM?: HTMLElement;
12
- destroy?: () => void;
13
- }, blockType: BType, blockProps: Props<PSchema>, propSchema: PSchema, domAttributes?: Record<string, string>): {
14
- dom: HTMLElement;
15
- contentDOM?: HTMLElement;
16
- destroy?: () => void;
17
- };
18
- type StronglyTypedTipTapNode<Name extends string, Content extends "inline*" | "tableRow+" | ""> = Node & {
19
- name: Name;
20
- config: {
21
- content: Content;
22
- };
23
- };
24
- export declare function createStronglyTypedTiptapNode<Name extends string, Content extends "inline*" | "tableRow+" | "">(config: NodeConfig & {
25
- name: Name;
26
- content: Content;
27
- }): StronglyTypedTipTapNode<Name, Content>;
28
- export declare function createInternalBlockSpec<T extends BlockConfig>(config: T, implementation: TiptapBlockImplementation<T, any, InlineContentSchema, StyleSchema>): {
29
- config: T;
30
- implementation: TiptapBlockImplementation<T, any, InlineContentSchema, StyleSchema>;
31
- };
32
- export declare function createBlockSpecFromStronglyTypedTiptapNode<T extends Node, P extends PropSchema>(node: T, propSchema: P, requiredExtensions?: Array<Extension | Node>): {
33
- config: {
34
- type: T["name"];
35
- content: T["config"]["content"] extends "inline*" ? "inline" : T["config"]["content"] extends "tableRow+" ? "table" : "none";
36
- propSchema: P;
37
- };
38
- implementation: TiptapBlockImplementation<{
39
- type: T["name"];
40
- content: T["config"]["content"] extends "inline*" ? "inline" : T["config"]["content"] extends "tableRow+" ? "table" : "none";
41
- propSchema: P;
42
- }, any, InlineContentSchema, StyleSchema>;
43
- };
44
- export declare function getBlockSchemaFromSpecs<T extends BlockSpecs>(specs: T): BlockSchemaFromSpecs<T>;
45
- export {};
@@ -1,114 +0,0 @@
1
- /** Define the main block types **/
2
- import { Extension, Node } from "@tiptap/core";
3
- import { BlockNoteEditor } from "../../../../BlockNoteEditor";
4
- import { InlineContent, InlineContentSchema, PartialInlineContent } from "../inlineContent/types";
5
- import { StyleSchema } from "../styles/types";
6
- export type BlockNoteDOMElement = "editor" | "blockContainer" | "blockGroup" | "blockContent" | "inlineContent";
7
- export type BlockNoteDOMAttributes = Partial<{
8
- [DOMElement in BlockNoteDOMElement]: Record<string, string>;
9
- }>;
10
- export type PropSpec<PType extends boolean | number | string> = {
11
- values?: readonly PType[];
12
- default: PType;
13
- };
14
- export type PropSchema = Record<string, PropSpec<boolean | number | string>>;
15
- export type Props<PSchema extends PropSchema> = {
16
- [PName in keyof PSchema]: PSchema[PName]["default"] extends boolean ? PSchema[PName]["values"] extends readonly boolean[] ? PSchema[PName]["values"][number] : boolean : PSchema[PName]["default"] extends number ? PSchema[PName]["values"] extends readonly number[] ? PSchema[PName]["values"][number] : number : PSchema[PName]["default"] extends string ? PSchema[PName]["values"] extends readonly string[] ? PSchema[PName]["values"][number] : string : never;
17
- };
18
- export type BlockConfig = {
19
- type: string;
20
- readonly propSchema: PropSchema;
21
- content: "inline" | "none" | "table";
22
- };
23
- export type TiptapBlockImplementation<T extends BlockConfig, B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
24
- requiredExtensions?: Array<Extension | Node>;
25
- node: Node;
26
- toInternalHTML: (block: BlockFromConfigNoChildren<T, I, S> & {
27
- children: Block<B, I, S>[];
28
- }, editor: BlockNoteEditor<B, I, S>) => {
29
- dom: HTMLElement;
30
- contentDOM?: HTMLElement;
31
- };
32
- toExternalHTML: (block: BlockFromConfigNoChildren<T, I, S> & {
33
- children: Block<B, I, S>[];
34
- }, editor: BlockNoteEditor<B, I, S>) => {
35
- dom: HTMLElement;
36
- contentDOM?: HTMLElement;
37
- };
38
- };
39
- export type BlockSpec<T extends BlockConfig, B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
40
- config: T;
41
- implementation: TiptapBlockImplementation<T, B, I, S>;
42
- };
43
- type NamesMatch<Blocks extends Record<string, BlockConfig>> = Blocks extends {
44
- [Type in keyof Blocks]: Type extends string ? Blocks[Type] extends {
45
- type: Type;
46
- } ? Blocks[Type] : never : never;
47
- } ? Blocks : never;
48
- export type BlockSchema = NamesMatch<Record<string, BlockConfig>>;
49
- export type BlockSpecs = Record<string, BlockSpec<any, any, InlineContentSchema, StyleSchema>>;
50
- export type BlockImplementations = Record<string, TiptapBlockImplementation<any, any, any, any>>;
51
- export type BlockSchemaFromSpecs<T extends BlockSpecs> = {
52
- [K in keyof T]: T[K]["config"];
53
- };
54
- export type BlockSchemaWithBlock<BType extends string, C extends BlockConfig> = {
55
- [k in BType]: C;
56
- };
57
- export type TableContent<I extends InlineContentSchema, S extends StyleSchema = StyleSchema> = {
58
- type: "tableContent";
59
- rows: {
60
- cells: InlineContent<I, S>[][];
61
- }[];
62
- };
63
- export type BlockFromConfigNoChildren<B extends BlockConfig, I extends InlineContentSchema, S extends StyleSchema> = {
64
- id: string;
65
- type: B["type"];
66
- props: Props<B["propSchema"]>;
67
- content: B["content"] extends "inline" ? InlineContent<I, S>[] : B["content"] extends "table" ? TableContent<I, S> : B["content"] extends "none" ? undefined : never;
68
- };
69
- export type BlockFromConfig<B extends BlockConfig, I extends InlineContentSchema, S extends StyleSchema> = BlockFromConfigNoChildren<B, I, S> & {
70
- children: Block<BlockSchema, I, S>[];
71
- };
72
- type BlocksWithoutChildren<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
73
- [BType in keyof BSchema]: BlockFromConfigNoChildren<BSchema[BType], I, S>;
74
- };
75
- export type Block<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = BlocksWithoutChildren<BSchema, I, S>[keyof BSchema] & {
76
- children: Block<BSchema, I, S>[];
77
- };
78
- export type SpecificBlock<BSchema extends BlockSchema, BType extends keyof BSchema, I extends InlineContentSchema, S extends StyleSchema> = BlocksWithoutChildren<BSchema, I, S>[BType] & {
79
- children: Block<BSchema, I, S>[];
80
- };
81
- /** CODE FOR PARTIAL BLOCKS, analogous to above
82
- *
83
- * Partial blocks are convenience-wrappers to make it easier to
84
- *create/update blocks in the editor.
85
- *
86
- */
87
- export type PartialTableContent<I extends InlineContentSchema, S extends StyleSchema = StyleSchema> = {
88
- type: "tableContent";
89
- rows: {
90
- cells: PartialInlineContent<I, S>[];
91
- }[];
92
- };
93
- type PartialBlockFromConfigNoChildren<B extends BlockConfig, I extends InlineContentSchema, S extends StyleSchema> = {
94
- id?: string;
95
- type?: B["type"];
96
- props?: Partial<Props<B["propSchema"]>>;
97
- content?: B["content"] extends "inline" ? PartialInlineContent<I, S> : B["content"] extends "table" ? PartialTableContent<I, S> : undefined;
98
- };
99
- type PartialBlocksWithoutChildren<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
100
- [BType in keyof BSchema]: PartialBlockFromConfigNoChildren<BSchema[BType], I, S>;
101
- };
102
- export type PartialBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = PartialBlocksWithoutChildren<BSchema, I, S>[keyof PartialBlocksWithoutChildren<BSchema, I, S>] & Partial<{
103
- children: PartialBlock<BSchema, I, S>[];
104
- }>;
105
- export type SpecificPartialBlock<BSchema extends BlockSchema, I extends InlineContentSchema, BType extends keyof BSchema, S extends StyleSchema> = PartialBlocksWithoutChildren<BSchema, I, S>[BType] & {
106
- children?: Block<BSchema, I, S>[];
107
- };
108
- export type PartialBlockFromConfig<B extends BlockConfig, I extends InlineContentSchema, S extends StyleSchema> = PartialBlockFromConfigNoChildren<B, I, S> & {
109
- children?: Block<BlockSchema, I, S>[];
110
- };
111
- export type BlockIdentifier = {
112
- id: string;
113
- } | string;
114
- export {};
@@ -1,8 +0,0 @@
1
- import { Block, BlockSchema } from "./blocks/types";
2
- import { InlineContentSchema } from "./inlineContent/types";
3
- import { StyleSchema } from "./styles/types";
4
- export type TextCursorPosition<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
5
- block: Block<BSchema, I, S>;
6
- prevBlock: Block<BSchema, I, S> | undefined;
7
- nextBlock: Block<BSchema, I, S> | undefined;
8
- };