@blocknote/core 0.9.2 → 0.9.4

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 (58) hide show
  1. package/dist/blocknote.js +1562 -1240
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +5 -5
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +2 -2
  7. package/src/BlockNoteEditor.ts +44 -12
  8. package/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap +21 -21
  9. package/src/api/blockManipulation/blockManipulation.test.ts +8 -11
  10. package/src/api/formatConversions/__snapshots__/formatConversions.test.ts.snap +3 -3
  11. package/src/api/formatConversions/formatConversions.test.ts +5 -5
  12. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +3 -3
  13. package/src/api/nodeConversions/nodeConversions.test.ts +10 -4
  14. package/src/api/nodeConversions/nodeConversions.ts +9 -7
  15. package/src/api/nodeConversions/testUtil.ts +3 -3
  16. package/src/editor.module.css +1 -1
  17. package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +5 -3
  18. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +2 -1
  19. package/src/extensions/Blocks/NonEditableBlockPlugin.ts +17 -0
  20. package/src/extensions/Blocks/api/block.ts +29 -16
  21. package/src/extensions/Blocks/api/blockTypes.ts +79 -27
  22. package/src/extensions/Blocks/api/defaultBlocks.ts +13 -41
  23. package/src/extensions/Blocks/api/defaultProps.ts +16 -0
  24. package/src/extensions/Blocks/nodes/Block.module.css +78 -24
  25. package/src/extensions/Blocks/nodes/BlockContainer.ts +45 -45
  26. package/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.ts +61 -13
  27. package/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.ts +305 -0
  28. package/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +13 -0
  29. package/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +26 -2
  30. package/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +146 -118
  31. package/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.ts +12 -2
  32. package/src/extensions/ImageToolbar/ImageToolbarPlugin.ts +239 -0
  33. package/src/extensions/SlashMenu/defaultSlashMenuItems.ts +47 -6
  34. package/src/extensions/TextColor/TextColorExtension.ts +4 -3
  35. package/src/extensions/TextColor/TextColorMark.ts +2 -1
  36. package/src/extensions/TrailingNode/TrailingNodeExtension.ts +13 -1
  37. package/src/index.ts +4 -0
  38. package/types/src/BlockNoteEditor.d.ts +9 -0
  39. package/types/src/BlockNoteExtensions.d.ts +1 -1
  40. package/types/src/extensions/Blocks/NonEditableBlockPlugin.d.ts +2 -0
  41. package/types/src/extensions/Blocks/api/block.d.ts +7 -8
  42. package/types/src/extensions/Blocks/api/blockTypes.d.ts +29 -20
  43. package/types/src/extensions/Blocks/api/defaultBlocks.d.ts +55 -51
  44. package/types/src/extensions/Blocks/api/defaultProps.d.ts +14 -0
  45. package/types/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.d.ts +43 -9
  46. package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/Image.d.ts +6 -0
  47. package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.d.ts +37 -0
  48. package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +1 -0
  49. package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/uploadToTmpFilesOrg_DEV_ONLY.d.ts +1 -0
  50. package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +35 -9
  51. package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +35 -9
  52. package/types/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.d.ts +36 -1
  53. package/types/src/extensions/ImageToolbar/ImageToolbarPlugin.d.ts +36 -0
  54. package/types/src/extensions/SlashMenu/defaultSlashMenuItems.d.ts +1 -1
  55. package/types/src/index.d.ts +4 -0
  56. package/types/src/shared/plugins/suggestion/SuggestionPlugin.d.ts +1 -1
  57. package/types/src/extensions/Blocks/nodes/TableCell.d.ts +0 -5
  58. package/types/src/extensions/Blocks/nodes/TableRow.d.ts +0 -5
@@ -1,4 +1,5 @@
1
1
  import { Mark } from "@tiptap/core";
2
+ import { defaultProps } from "../Blocks/api/defaultProps";
2
3
 
3
4
  declare module "@tiptap/core" {
4
5
  interface Commands<ReturnType> {
@@ -51,7 +52,7 @@ export const TextColorMark = Mark.create({
51
52
  setTextColor:
52
53
  (color) =>
53
54
  ({ commands }) => {
54
- if (color !== "default") {
55
+ if (color !== defaultProps.textColor.default) {
55
56
  return commands.setMark(this.name, { color: color });
56
57
  }
57
58
 
@@ -64,7 +64,19 @@ export const TrailingNode = Extension.create<TrailingNodeOptions>({
64
64
  if (!lastNode || lastNode.type.name !== "blockContainer") {
65
65
  throw new Error("Expected blockContainer");
66
66
  }
67
- return lastNode.nodeSize > 4; // empty <block><content/></block> is length 4
67
+
68
+ const lastContentNode = lastNode.firstChild;
69
+
70
+ if (!lastContentNode) {
71
+ throw new Error("Expected blockContent");
72
+ }
73
+
74
+ // If last node is not empty (size > 4) or it doesn't contain
75
+ // inline content, we need to add a trailing node.
76
+ return (
77
+ lastNode.nodeSize > 4 ||
78
+ lastContentNode.type.spec.content !== "inline*"
79
+ );
68
80
  },
69
81
  },
70
82
  }),
package/src/index.ts CHANGED
@@ -2,12 +2,16 @@ export * from "./BlockNoteEditor";
2
2
  export * from "./BlockNoteExtensions";
3
3
  export * from "./extensions/Blocks/api/block";
4
4
  export * from "./extensions/Blocks/api/blockTypes";
5
+ export * from "./extensions/Blocks/api/defaultProps";
5
6
  export * from "./extensions/Blocks/api/defaultBlocks";
6
7
  export * from "./extensions/Blocks/api/inlineContentTypes";
8
+ export * from "./extensions/Blocks/api/selectionTypes";
7
9
  export * from "./extensions/Blocks/api/serialization";
8
10
  export * as blockStyles from "./extensions/Blocks/nodes/Block.module.css";
11
+ export * from "./extensions/Blocks/nodes/BlockContent/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY";
9
12
  export * from "./extensions/FormattingToolbar/FormattingToolbarPlugin";
10
13
  export * from "./extensions/HyperlinkToolbar/HyperlinkToolbarPlugin";
14
+ export * from "./extensions/ImageToolbar/ImageToolbarPlugin";
11
15
  export * from "./extensions/SideMenu/SideMenuPlugin";
12
16
  export * from "./extensions/SlashMenu/BaseSlashMenuItem";
13
17
  export * from "./extensions/SlashMenu/SlashMenuPlugin";
@@ -8,6 +8,7 @@ import { Styles } from "./extensions/Blocks/api/inlineContentTypes";
8
8
  import { Selection } from "./extensions/Blocks/api/selectionTypes";
9
9
  import { FormattingToolbarProsemirrorPlugin } from "./extensions/FormattingToolbar/FormattingToolbarPlugin";
10
10
  import { HyperlinkToolbarProsemirrorPlugin } from "./extensions/HyperlinkToolbar/HyperlinkToolbarPlugin";
11
+ import { ImageToolbarProsemirrorPlugin } from "./extensions/ImageToolbar/ImageToolbarPlugin";
11
12
  import { SideMenuProsemirrorPlugin } from "./extensions/SideMenu/SideMenuPlugin";
12
13
  import { BaseSlashMenuItem } from "./extensions/SlashMenu/BaseSlashMenuItem";
13
14
  import { SlashMenuProsemirrorPlugin } from "./extensions/SlashMenu/SlashMenuPlugin";
@@ -62,6 +63,12 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema> = {
62
63
  * A list of block types that should be available in the editor.
63
64
  */
64
65
  blockSchema: BSchema;
66
+ /**
67
+ * A custom function to handle file uploads.
68
+ * @param file The file that should be uploaded.
69
+ * @returns The URL of the uploaded file.
70
+ */
71
+ uploadFile: (file: File) => Promise<string>;
65
72
  /**
66
73
  * When enabled, allows for collaboration between multiple users.
67
74
  */
@@ -100,6 +107,8 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
100
107
  readonly formattingToolbar: FormattingToolbarProsemirrorPlugin<BSchema>;
101
108
  readonly slashMenu: SlashMenuProsemirrorPlugin<BSchema, any>;
102
109
  readonly hyperlinkToolbar: HyperlinkToolbarProsemirrorPlugin<BSchema>;
110
+ readonly imageToolbar: ImageToolbarProsemirrorPlugin<BSchema>;
111
+ readonly uploadFile: ((file: File) => Promise<string>) | undefined;
103
112
  constructor(options?: Partial<BlockNoteEditorOptions<BSchema>>);
104
113
  get prosemirrorView(): import("prosemirror-view").EditorView;
105
114
  get domElement(): HTMLDivElement;
@@ -5,7 +5,7 @@ import { BlockNoteDOMAttributes } from "./extensions/Blocks/api/blockTypes";
5
5
  /**
6
6
  * Get all the Tiptap extensions BlockNote is configured with by default
7
7
  */
8
- export declare const getBlockNoteExtensions: <BSchema extends Record<string, import("./extensions/Blocks/api/blockTypes").BlockSpec<string, import("./extensions/Blocks/api/blockTypes").PropSchema>>>(opts: {
8
+ export declare const getBlockNoteExtensions: <BSchema extends Record<string, import("./extensions/Blocks/api/blockTypes").BlockSpec<string, import("./extensions/Blocks/api/blockTypes").PropSchema, boolean>>>(opts: {
9
9
  editor: BlockNoteEditor<BSchema>;
10
10
  domAttributes: Partial<BlockNoteDOMAttributes>;
11
11
  blockSchema: BSchema;
@@ -0,0 +1,2 @@
1
+ import { Plugin } from "prosemirror-state";
2
+ export declare const NonEditableBlockPlugin: () => Plugin<any>;
@@ -1,11 +1,10 @@
1
- import { Attribute } from "@tiptap/core";
1
+ import { Attributes } from "@tiptap/core";
2
2
  import { BlockNoteDOMAttributes } from "../../..";
3
3
  import { BlockConfig, BlockSchema, BlockSpec, PropSchema, TipTapNode, TipTapNodeConfig } from "./blockTypes";
4
+ import { ParseRule } from "prosemirror-model";
4
5
  export declare function camelToDataKebab(str: string): string;
5
- export declare function propsToAttributes<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema>(blockConfig: Omit<BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>, "render">): Record<string, Attribute>;
6
- export declare function parse<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema>(blockConfig: Omit<BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>, "render">): {
7
- tag: string;
8
- }[];
6
+ export declare function propsToAttributes<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema>(blockConfig: Omit<BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>, "render">): Attributes;
7
+ export declare function parse<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema>(blockConfig: Omit<BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>, "render">): ParseRule[];
9
8
  export declare function render<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema>(blockConfig: Omit<BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>, "render">, HTMLAttributes: Record<string, any>): {
10
9
  dom: HTMLDivElement;
11
10
  contentDOM: HTMLDivElement;
@@ -13,9 +12,9 @@ export declare function render<BType extends string, PSchema extends PropSchema,
13
12
  dom: HTMLDivElement;
14
13
  contentDOM?: undefined;
15
14
  };
16
- export declare function createBlockSpec<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema>(blockConfig: BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>): BlockSpec<BType, PSchema>;
17
- export declare function createTipTapBlock<Type extends string, Options extends {
15
+ export declare function createBlockSpec<BType extends string, PSchema extends PropSchema, ContainsInlineContent extends false, BSchema extends BlockSchema>(blockConfig: BlockConfig<BType, PSchema, ContainsInlineContent, BSchema>): BlockSpec<BType, PSchema, ContainsInlineContent>;
16
+ export declare function createTipTapBlock<Type extends string, ContainsInlineContent extends boolean, Options extends {
18
17
  domAttributes?: BlockNoteDOMAttributes;
19
18
  } = {
20
19
  domAttributes?: BlockNoteDOMAttributes;
21
- }, Storage = any>(config: TipTapNodeConfig<Type, Options, Storage>): TipTapNode<Type, Options, Storage>;
20
+ }, Storage = any>(config: TipTapNodeConfig<Type, ContainsInlineContent, Options, Storage>): TipTapNode<Type, ContainsInlineContent, Options, Storage>;
@@ -7,28 +7,35 @@ export type BlockNoteDOMElement = "editor" | "blockContainer" | "blockGroup" | "
7
7
  export type BlockNoteDOMAttributes = Partial<{
8
8
  [DOMElement in BlockNoteDOMElement]: Record<string, string>;
9
9
  }>;
10
- export type TipTapNodeConfig<Name extends string, Options extends {
10
+ export type TipTapNodeConfig<Name extends string, ContainsInlineContent extends boolean, Options extends {
11
11
  domAttributes?: BlockNoteDOMAttributes;
12
12
  } = {
13
13
  domAttributes?: BlockNoteDOMAttributes;
14
14
  }, Storage = any> = {
15
- [K in keyof NodeConfig<Options, Storage>]: K extends "name" ? Name : K extends "group" ? never : NodeConfig<Options, Storage>[K];
15
+ [K in keyof NodeConfig<Options, Storage>]: K extends "name" ? Name : K extends "content" ? ContainsInlineContent extends true ? "inline*" : "" : K extends "group" ? never : NodeConfig<Options, Storage>[K];
16
+ } & {
17
+ name: Name;
18
+ content: ContainsInlineContent extends true ? "inline*" : "";
16
19
  };
17
- export type TipTapNode<Name extends string, Options extends {
20
+ export type TipTapNode<Name extends string, ContainsInlineContent extends boolean, Options extends {
18
21
  domAttributes?: BlockNoteDOMAttributes;
19
22
  } = {
20
23
  domAttributes?: BlockNoteDOMAttributes;
21
- }, Storage = any> = Node<Options, Storage> & {
22
- name: Name;
23
- group: "blockContent";
24
+ }, Storage = any> = {
25
+ [Key in keyof Node<Options, Storage>]: Key extends "name" ? Name : Key extends "config" ? {
26
+ [ConfigKey in keyof Node<Options, Storage>["config"]]: ConfigKey extends "group" ? "blockContent" : ConfigKey extends "content" ? ContainsInlineContent extends true ? "inline*" : "" : NodeConfig<Options, Storage>["config"][ConfigKey];
27
+ } & {
28
+ group: "blockContent";
29
+ content: ContainsInlineContent extends true ? "inline*" : "";
30
+ } : Node<Options, Storage>["config"][Key];
24
31
  };
25
- export type PropSpec = {
26
- values?: readonly string[];
27
- default: string;
32
+ export type PropSpec<PType extends boolean | number | string> = {
33
+ values?: readonly PType[];
34
+ default: PType;
28
35
  };
29
- export type PropSchema = Record<string, PropSpec>;
36
+ export type PropSchema = Record<string, PropSpec<boolean | number | string>>;
30
37
  export type Props<PSchema extends PropSchema> = {
31
- [PType in keyof PSchema]: PSchema[PType]["values"] extends readonly string[] ? PSchema[PType]["values"][number] : string;
38
+ [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;
32
39
  };
33
40
  export type BlockConfig<Type extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean, BSchema extends BlockSchema> = {
34
41
  type: Type;
@@ -39,7 +46,7 @@ export type BlockConfig<Type extends string, PSchema extends PropSchema, Contain
39
46
  * The custom block to render
40
47
  */
41
48
  block: SpecificBlock<BSchema & {
42
- [k in Type]: BlockSpec<Type, PSchema>;
49
+ [k in Type]: BlockSpec<Type, PSchema, ContainsInlineContent>;
43
50
  }, Type>,
44
51
  /**
45
52
  * The BlockNote editor instance
@@ -47,28 +54,30 @@ export type BlockConfig<Type extends string, PSchema extends PropSchema, Contain
47
54
  * cast it manually, e.g.: `const e = editor as BlockNoteEditor<typeof mySchema>;`
48
55
  */
49
56
  editor: BlockNoteEditor<BSchema & {
50
- [k in Type]: BlockSpec<Type, PSchema>;
57
+ [k in Type]: BlockSpec<Type, PSchema, ContainsInlineContent>;
51
58
  }>) => ContainsInlineContent extends true ? {
52
59
  dom: HTMLElement;
53
60
  contentDOM: HTMLElement;
61
+ destroy?: () => void;
54
62
  } : {
55
63
  dom: HTMLElement;
64
+ destroy?: () => void;
56
65
  };
57
66
  };
58
- export type BlockSpec<Type extends string, PSchema extends PropSchema> = {
67
+ export type BlockSpec<Type extends string, PSchema extends PropSchema, ContainsInlineContent extends boolean> = {
68
+ node: TipTapNode<Type, ContainsInlineContent, any>;
59
69
  readonly propSchema: PSchema;
60
- node: TipTapNode<Type, any>;
61
70
  };
62
- export type TypesMatch<Blocks extends Record<string, BlockSpec<string, PropSchema>>> = Blocks extends {
63
- [Type in keyof Blocks]: Type extends string ? Blocks[Type] extends BlockSpec<Type, PropSchema> ? Blocks[Type] : never : never;
71
+ type NamesMatch<Blocks extends Record<string, BlockSpec<string, PropSchema, boolean>>> = Blocks extends {
72
+ [Type in keyof Blocks]: Type extends string ? Blocks[Type] extends BlockSpec<Type, PropSchema, boolean> ? Blocks[Type] : never : never;
64
73
  } ? Blocks : never;
65
- export type BlockSchema = TypesMatch<Record<string, BlockSpec<string, PropSchema>>>;
74
+ export type BlockSchema = NamesMatch<Record<string, BlockSpec<string, PropSchema, boolean>>>;
66
75
  type BlocksWithoutChildren<BSchema extends BlockSchema> = {
67
76
  [BType in keyof BSchema]: {
68
77
  id: string;
69
78
  type: BType;
70
79
  props: Props<BSchema[BType]["propSchema"]>;
71
- content: InlineContent[];
80
+ content: BSchema[BType]["node"]["config"]["content"] extends "inline*" ? InlineContent[] : undefined;
72
81
  };
73
82
  };
74
83
  export type Block<BSchema extends BlockSchema = DefaultBlockSchema> = BlocksWithoutChildren<BSchema>[keyof BlocksWithoutChildren<BSchema>] & {
@@ -82,7 +91,7 @@ type PartialBlocksWithoutChildren<BSchema extends BlockSchema> = {
82
91
  id: string;
83
92
  type: BType;
84
93
  props: Partial<Props<BSchema[BType]["propSchema"]>>;
85
- content: PartialInlineContent[] | string;
94
+ content: BSchema[BType]["node"]["config"]["content"] extends "inline*" ? PartialInlineContent[] | string : undefined;
86
95
  }>;
87
96
  };
88
97
  export type PartialBlock<BSchema extends BlockSchema = DefaultBlockSchema> = PartialBlocksWithoutChildren<BSchema>[keyof PartialBlocksWithoutChildren<BSchema>] & Partial<{
@@ -1,32 +1,29 @@
1
- import { TypesMatch } from "./blockTypes";
2
- export declare const defaultProps: {
3
- backgroundColor: {
4
- default: "transparent";
5
- };
6
- textColor: {
7
- default: "black";
8
- };
9
- textAlignment: {
10
- default: "left";
11
- values: readonly ["left", "center", "right", "justify"];
12
- };
13
- };
14
- export type DefaultProps = typeof defaultProps;
15
1
  export declare const defaultBlockSchema: {
16
2
  readonly paragraph: {
17
- readonly propSchema: {
3
+ node: import("./blockTypes").TipTapNode<"paragraph", true, {
4
+ domAttributes?: Partial<{
5
+ blockContainer: Record<string, string>;
6
+ blockGroup: Record<string, string>;
7
+ editor: Record<string, string>;
8
+ blockContent: Record<string, string>;
9
+ inlineContent: Record<string, string>;
10
+ }> | undefined;
11
+ }, any>;
12
+ propSchema: {
18
13
  backgroundColor: {
19
- default: "transparent";
14
+ default: "default";
20
15
  };
21
16
  textColor: {
22
- default: "black";
17
+ default: "default";
23
18
  };
24
19
  textAlignment: {
25
20
  default: "left";
26
21
  values: readonly ["left", "center", "right", "justify"];
27
22
  };
28
23
  };
29
- readonly node: import("./blockTypes").TipTapNode<"paragraph", {
24
+ };
25
+ readonly heading: {
26
+ node: import("./blockTypes").TipTapNode<"heading", true, {
30
27
  domAttributes?: Partial<{
31
28
  blockContainer: Record<string, string>;
32
29
  blockGroup: Record<string, string>;
@@ -35,25 +32,25 @@ export declare const defaultBlockSchema: {
35
32
  inlineContent: Record<string, string>;
36
33
  }> | undefined;
37
34
  }, any>;
38
- };
39
- readonly heading: {
40
- readonly propSchema: {
41
- readonly level: {
42
- readonly default: "1";
43
- readonly values: readonly ["1", "2", "3"];
35
+ propSchema: {
36
+ level: {
37
+ default: number;
38
+ values: readonly [1, 2, 3];
44
39
  };
45
- readonly backgroundColor: {
46
- default: "transparent";
40
+ backgroundColor: {
41
+ default: "default";
47
42
  };
48
- readonly textColor: {
49
- default: "black";
43
+ textColor: {
44
+ default: "default";
50
45
  };
51
- readonly textAlignment: {
46
+ textAlignment: {
52
47
  default: "left";
53
48
  values: readonly ["left", "center", "right", "justify"];
54
49
  };
55
50
  };
56
- readonly node: import("./blockTypes").TipTapNode<"heading", {
51
+ };
52
+ readonly bulletListItem: {
53
+ node: import("./blockTypes").TipTapNode<"bulletListItem", true, {
57
54
  domAttributes?: Partial<{
58
55
  blockContainer: Record<string, string>;
59
56
  blockGroup: Record<string, string>;
@@ -62,21 +59,21 @@ export declare const defaultBlockSchema: {
62
59
  inlineContent: Record<string, string>;
63
60
  }> | undefined;
64
61
  }, any>;
65
- };
66
- readonly bulletListItem: {
67
- readonly propSchema: {
62
+ propSchema: {
68
63
  backgroundColor: {
69
- default: "transparent";
64
+ default: "default";
70
65
  };
71
66
  textColor: {
72
- default: "black";
67
+ default: "default";
73
68
  };
74
69
  textAlignment: {
75
70
  default: "left";
76
71
  values: readonly ["left", "center", "right", "justify"];
77
72
  };
78
73
  };
79
- readonly node: import("./blockTypes").TipTapNode<"bulletListItem", {
74
+ };
75
+ readonly numberedListItem: {
76
+ node: import("./blockTypes").TipTapNode<"numberedListItem", true, {
80
77
  domAttributes?: Partial<{
81
78
  blockContainer: Record<string, string>;
82
79
  blockGroup: Record<string, string>;
@@ -85,29 +82,36 @@ export declare const defaultBlockSchema: {
85
82
  inlineContent: Record<string, string>;
86
83
  }> | undefined;
87
84
  }, any>;
88
- };
89
- readonly numberedListItem: {
90
- readonly propSchema: {
85
+ propSchema: {
91
86
  backgroundColor: {
92
- default: "transparent";
87
+ default: "default";
93
88
  };
94
89
  textColor: {
95
- default: "black";
90
+ default: "default";
96
91
  };
97
92
  textAlignment: {
98
93
  default: "left";
99
94
  values: readonly ["left", "center", "right", "justify"];
100
95
  };
101
96
  };
102
- readonly node: import("./blockTypes").TipTapNode<"numberedListItem", {
103
- domAttributes?: Partial<{
104
- blockContainer: Record<string, string>;
105
- blockGroup: Record<string, string>;
106
- editor: Record<string, string>;
107
- blockContent: Record<string, string>;
108
- inlineContent: Record<string, string>;
109
- }> | undefined;
110
- }, any>;
111
97
  };
98
+ readonly image: import("./blockTypes").BlockSpec<"image", {
99
+ textAlignment: {
100
+ default: "left";
101
+ values: readonly ["left", "center", "right", "justify"];
102
+ };
103
+ backgroundColor: {
104
+ default: "default";
105
+ };
106
+ url: {
107
+ default: "";
108
+ };
109
+ caption: {
110
+ default: "";
111
+ };
112
+ width: {
113
+ default: 512;
114
+ };
115
+ }, false>;
112
116
  };
113
- export type DefaultBlockSchema = TypesMatch<typeof defaultBlockSchema>;
117
+ export type DefaultBlockSchema = typeof defaultBlockSchema;
@@ -0,0 +1,14 @@
1
+ import { Props } from "./blockTypes";
2
+ export declare const defaultProps: {
3
+ backgroundColor: {
4
+ default: "default";
5
+ };
6
+ textColor: {
7
+ default: "default";
8
+ };
9
+ textAlignment: {
10
+ default: "left";
11
+ values: readonly ["left", "center", "right", "justify"];
12
+ };
13
+ };
14
+ export type DefaultProps = Props<typeof defaultProps>;
@@ -1,9 +1,43 @@
1
- export declare const HeadingBlockContent: import("../../../api/blockTypes").TipTapNode<"heading", {
2
- domAttributes?: Partial<{
3
- blockContainer: Record<string, string>;
4
- blockGroup: Record<string, string>;
5
- editor: Record<string, string>;
6
- blockContent: Record<string, string>;
7
- inlineContent: Record<string, string>;
8
- }> | undefined;
9
- }, any>;
1
+ export declare const headingPropSchema: {
2
+ level: {
3
+ default: number;
4
+ values: readonly [1, 2, 3];
5
+ };
6
+ backgroundColor: {
7
+ default: "default";
8
+ };
9
+ textColor: {
10
+ default: "default";
11
+ };
12
+ textAlignment: {
13
+ default: "left";
14
+ values: readonly ["left", "center", "right", "justify"];
15
+ };
16
+ };
17
+ export declare const Heading: {
18
+ node: import("../../../api/blockTypes").TipTapNode<"heading", true, {
19
+ domAttributes?: Partial<{
20
+ blockContainer: Record<string, string>;
21
+ blockGroup: Record<string, string>;
22
+ editor: Record<string, string>;
23
+ blockContent: Record<string, string>;
24
+ inlineContent: Record<string, string>;
25
+ }> | undefined;
26
+ }, any>;
27
+ propSchema: {
28
+ level: {
29
+ default: number;
30
+ values: readonly [1, 2, 3];
31
+ };
32
+ backgroundColor: {
33
+ default: "default";
34
+ };
35
+ textColor: {
36
+ default: "default";
37
+ };
38
+ textAlignment: {
39
+ default: "left";
40
+ values: readonly ["left", "center", "right", "justify"];
41
+ };
42
+ };
43
+ };
@@ -0,0 +1,6 @@
1
+ import "@uppy/core/dist/style.css";
2
+ import "@uppy/dashboard/dist/style.css";
3
+ import "@uppy/drag-drop/dist/style.css";
4
+ import "@uppy/file-input/dist/style.css";
5
+ import "@uppy/progress-bar/dist/style.css";
6
+ export declare const Image: BlockSpec<BType, PSchema, ContainsInlineContent>;
@@ -0,0 +1,37 @@
1
+ import { BlockSpec } from "../../../api/blockTypes";
2
+ export declare const imagePropSchema: {
3
+ textAlignment: {
4
+ default: "left";
5
+ values: readonly ["left", "center", "right", "justify"];
6
+ };
7
+ backgroundColor: {
8
+ default: "default";
9
+ };
10
+ url: {
11
+ default: "";
12
+ };
13
+ caption: {
14
+ default: "";
15
+ };
16
+ width: {
17
+ default: 512;
18
+ };
19
+ };
20
+ export declare const Image: BlockSpec<"image", {
21
+ textAlignment: {
22
+ default: "left";
23
+ values: readonly ["left", "center", "right", "justify"];
24
+ };
25
+ backgroundColor: {
26
+ default: "default";
27
+ };
28
+ url: {
29
+ default: "";
30
+ };
31
+ caption: {
32
+ default: "";
33
+ };
34
+ width: {
35
+ default: 512;
36
+ };
37
+ }, false>;
@@ -0,0 +1 @@
1
+ export declare const uploadToTmpFilesDotOrg_DEV_ONLY: (file: File) => Promise<any>;
@@ -0,0 +1 @@
1
+ export declare const uploadToTmpFilesOrg: (file: File) => Promise<any>;
@@ -1,9 +1,35 @@
1
- export declare const BulletListItemBlockContent: import("../../../../api/blockTypes").TipTapNode<"bulletListItem", {
2
- domAttributes?: Partial<{
3
- blockContainer: Record<string, string>;
4
- blockGroup: Record<string, string>;
5
- editor: Record<string, string>;
6
- blockContent: Record<string, string>;
7
- inlineContent: Record<string, string>;
8
- }> | undefined;
9
- }, any>;
1
+ export declare const bulletListItemPropSchema: {
2
+ backgroundColor: {
3
+ default: "default";
4
+ };
5
+ textColor: {
6
+ default: "default";
7
+ };
8
+ textAlignment: {
9
+ default: "left";
10
+ values: readonly ["left", "center", "right", "justify"];
11
+ };
12
+ };
13
+ export declare const BulletListItem: {
14
+ node: import("../../../../api/blockTypes").TipTapNode<"bulletListItem", true, {
15
+ domAttributes?: Partial<{
16
+ blockContainer: Record<string, string>;
17
+ blockGroup: Record<string, string>;
18
+ editor: Record<string, string>;
19
+ blockContent: Record<string, string>;
20
+ inlineContent: Record<string, string>;
21
+ }> | undefined;
22
+ }, any>;
23
+ propSchema: {
24
+ backgroundColor: {
25
+ default: "default";
26
+ };
27
+ textColor: {
28
+ default: "default";
29
+ };
30
+ textAlignment: {
31
+ default: "left";
32
+ values: readonly ["left", "center", "right", "justify"];
33
+ };
34
+ };
35
+ };
@@ -1,9 +1,35 @@
1
- export declare const NumberedListItemBlockContent: import("../../../../api/blockTypes").TipTapNode<"numberedListItem", {
2
- domAttributes?: Partial<{
3
- blockContainer: Record<string, string>;
4
- blockGroup: Record<string, string>;
5
- editor: Record<string, string>;
6
- blockContent: Record<string, string>;
7
- inlineContent: Record<string, string>;
8
- }> | undefined;
9
- }, any>;
1
+ export declare const numberedListItemPropSchema: {
2
+ backgroundColor: {
3
+ default: "default";
4
+ };
5
+ textColor: {
6
+ default: "default";
7
+ };
8
+ textAlignment: {
9
+ default: "left";
10
+ values: readonly ["left", "center", "right", "justify"];
11
+ };
12
+ };
13
+ export declare const NumberedListItem: {
14
+ node: import("../../../../api/blockTypes").TipTapNode<"numberedListItem", true, {
15
+ domAttributes?: Partial<{
16
+ blockContainer: Record<string, string>;
17
+ blockGroup: Record<string, string>;
18
+ editor: Record<string, string>;
19
+ blockContent: Record<string, string>;
20
+ inlineContent: Record<string, string>;
21
+ }> | undefined;
22
+ }, any>;
23
+ propSchema: {
24
+ backgroundColor: {
25
+ default: "default";
26
+ };
27
+ textColor: {
28
+ default: "default";
29
+ };
30
+ textAlignment: {
31
+ default: "left";
32
+ values: readonly ["left", "center", "right", "justify"];
33
+ };
34
+ };
35
+ };