@blocknote/core 0.47.0 → 0.47.2
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.
- package/dist/BlockNoteExtension-BWw0r8Gy.cjs.map +1 -1
- package/dist/BlockNoteExtension-C2X7LW-V.js.map +1 -1
- package/dist/{BlockNoteSchema-DT4bdXj5.cjs → BlockNoteSchema-CCs_V3lo.cjs} +2 -2
- package/dist/{BlockNoteSchema-DT4bdXj5.cjs.map → BlockNoteSchema-CCs_V3lo.cjs.map} +1 -1
- package/dist/{BlockNoteSchema-1r-ln0Q0.js → BlockNoteSchema-ooiKsd5B.js} +2 -2
- package/dist/{BlockNoteSchema-1r-ln0Q0.js.map → BlockNoteSchema-ooiKsd5B.js.map} +1 -1
- package/dist/{TrailingNode-DZag-Nvu.js → TrailingNode-GzE59m_7.js} +588 -416
- package/dist/TrailingNode-GzE59m_7.js.map +1 -0
- package/dist/TrailingNode-n0WdMPUl.cjs +2 -0
- package/dist/TrailingNode-n0WdMPUl.cjs.map +1 -0
- package/dist/blocknote.cjs +4 -4
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +1206 -955
- package/dist/blocknote.js.map +1 -1
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +2 -2
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js.map +1 -1
- package/dist/defaultBlocks-Dg9kQWXm.cjs +6 -0
- package/dist/defaultBlocks-Dg9kQWXm.cjs.map +1 -0
- package/dist/{defaultBlocks-BSOEW3GR.js → defaultBlocks-ZzGbYgQn.js} +627 -543
- package/dist/defaultBlocks-ZzGbYgQn.js.map +1 -0
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.cjs.map +1 -1
- package/dist/extensions.js +33 -54
- package/dist/extensions.js.map +1 -1
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +25 -24
- package/dist/locales.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +1 -10
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +33 -7
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/blocks/Heading/block.ts +48 -1
- package/src/blocks/ListItem/ToggleListItem/block.ts +51 -1
- package/src/blocks/Paragraph/block.ts +1 -1
- package/src/blocks/getDetailsContent.ts +77 -0
- package/src/comments/threadstore/TipTapThreadStore.ts +5 -5
- package/src/comments/threadstore/tiptap/types.ts +131 -0
- package/src/editor/Block.css +6 -0
- package/src/editor/BlockNoteEditor.ts +9 -14
- package/src/editor/managers/ExtensionManager/symbol.ts +0 -1
- package/src/editor/managers/SelectionManager.ts +3 -1
- package/src/extensions/Collaboration/YCursorPlugin.ts +3 -1
- package/src/extensions/DropCursor/DropCursor.ts +262 -25
- package/src/extensions/DropCursor/utils.ts +195 -0
- package/src/extensions/SuggestionMenu/SuggestionMenu.test.ts +191 -0
- package/src/extensions/SuggestionMenu/SuggestionMenu.ts +28 -11
- package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +438 -53
- package/src/i18n/locales/fa.ts +4 -21
- package/src/i18n/locales/index.ts +1 -1
- package/src/i18n/locales/ru.ts +1 -1
- package/src/i18n/locales/uz.ts +22 -4
- package/src/index.ts +1 -0
- package/src/schema/blocks/createSpec.ts +35 -45
- package/src/schema/blocks/types.ts +101 -1
- package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +5 -0
- package/types/src/blocks/getDetailsContent.d.ts +19 -0
- package/types/src/comments/threadstore/TipTapThreadStore.d.ts +1 -1
- package/types/src/comments/threadstore/tiptap/types.d.ts +73 -0
- package/types/src/editor/BlockNoteEditor.d.ts +6 -9
- package/types/src/extensions/DropCursor/DropCursor.d.ts +42 -5
- package/types/src/extensions/DropCursor/utils.d.ts +48 -0
- package/types/src/extensions/SuggestionMenu/SuggestionMenu.d.ts +12 -3
- package/types/src/extensions/SuggestionMenu/SuggestionMenu.test.d.ts +1 -0
- package/types/src/index.d.ts +1 -0
- package/types/src/schema/blocks/createSpec.d.ts +3 -3
- package/types/src/schema/blocks/types.d.ts +31 -1
- package/dist/TrailingNode-DZag-Nvu.js.map +0 -1
- package/dist/TrailingNode-tesI8f7N.cjs +0 -2
- package/dist/TrailingNode-tesI8f7N.cjs.map +0 -1
- package/dist/defaultBlocks-BSOEW3GR.js.map +0 -1
- package/dist/defaultBlocks-D049Pbme.cjs +0 -6
- package/dist/defaultBlocks-D049Pbme.cjs.map +0 -1
|
@@ -57,12 +57,30 @@ export interface BlockConfig<T extends string = string, PS extends PropSchema =
|
|
|
57
57
|
*/
|
|
58
58
|
content: C;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* BlockConfigOrCreator is a union type of BlockConfig and a function that returns a BlockConfig.
|
|
62
|
+
* This is used to create block configs that can be passed to the createBlockSpec function.
|
|
63
|
+
*/
|
|
64
|
+
export type BlockConfigOrCreator<TName extends string = string, TProps extends PropSchema = PropSchema, TContent extends "inline" | "none" = "inline" | "none", TOptions extends Record<string, any> | undefined = Record<string, any> | undefined> = BlockConfig<TName, TProps, TContent> | (TOptions extends undefined ? () => BlockConfig<TName, TProps, TContent> : (options: Partial<TOptions>) => BlockConfig<TName, TProps, TContent>);
|
|
65
|
+
/**
|
|
66
|
+
* ExtractBlockConfigFromConfigOrCreator is a helper type that extracts the BlockConfig type from a BlockConfigOrCreator.
|
|
67
|
+
*/
|
|
68
|
+
export type ExtractBlockConfigFromConfigOrCreator<ConfigOrCreator extends BlockConfig<string, PropSchema, "inline" | "none"> | ((...args: any[]) => BlockConfig<string, PropSchema, "inline" | "none">)> = ConfigOrCreator extends (...args: any[]) => infer Config ? Config : ConfigOrCreator;
|
|
60
69
|
export type CustomBlockConfig<T extends string = string, PS extends PropSchema = PropSchema, C extends "inline" | "none" = "inline" | "none"> = BlockConfig<T, PS, C>;
|
|
61
70
|
export type BlockSpec<T extends string = string, PS extends PropSchema = PropSchema, C extends "inline" | "none" | "table" = "inline" | "none" | "table"> = {
|
|
62
71
|
config: BlockConfig<T, PS, C>;
|
|
63
72
|
implementation: BlockImplementation<T, PS, C>;
|
|
64
73
|
extensions?: (Extension | ExtensionFactoryInstance)[];
|
|
65
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* BlockSpecOrCreator is a union type of BlockSpec and a function that returns a BlockSpec.
|
|
77
|
+
* This is used to create block specs that can be passed to the createBlockSpec function.
|
|
78
|
+
*/
|
|
79
|
+
export type BlockSpecOrCreator<T extends string = string, PS extends PropSchema = PropSchema, C extends "inline" | "none" | "table" = "inline" | "none" | "table", TOptions extends Record<string, any> | undefined = Record<string, any> | undefined> = BlockSpec<T, PS, C> | (TOptions extends undefined ? () => BlockSpec<T, PS, C> : (options: Partial<TOptions>) => BlockSpec<T, PS, C>);
|
|
80
|
+
/**
|
|
81
|
+
* ExtractBlockSpecFromSpecOrCreator is a helper type that extracts the BlockSpec type from a BlockSpecOrCreator.
|
|
82
|
+
*/
|
|
83
|
+
export type ExtractBlockSpecFromSpecOrCreator<SpecOrCreator extends BlockSpec<string, PropSchema, "inline" | "none"> | ((...args: any[]) => BlockSpec<string, PropSchema, "inline" | "none">)> = SpecOrCreator extends (...args: any[]) => infer Spec ? Spec : SpecOrCreator;
|
|
66
84
|
/**
|
|
67
85
|
* This allows de-coupling the types that we display to users versus the types we expose internally.
|
|
68
86
|
*
|
|
@@ -91,6 +109,7 @@ export type LooseBlockSpec<T extends string = string, PS extends PropSchema = Pr
|
|
|
91
109
|
}) => {
|
|
92
110
|
dom: HTMLElement | DocumentFragment;
|
|
93
111
|
contentDOM?: HTMLElement;
|
|
112
|
+
childrenDOM?: HTMLElement;
|
|
94
113
|
} | undefined;
|
|
95
114
|
node: Node;
|
|
96
115
|
};
|
|
@@ -125,6 +144,7 @@ export type BlockSpecs = {
|
|
|
125
144
|
}) => {
|
|
126
145
|
dom: HTMLElement | DocumentFragment;
|
|
127
146
|
contentDOM?: HTMLElement;
|
|
147
|
+
childrenDOM?: HTMLElement;
|
|
128
148
|
} | undefined;
|
|
129
149
|
};
|
|
130
150
|
extensions?: BlockSpec<k>["extensions"];
|
|
@@ -265,6 +285,7 @@ export type BlockImplementation<TName extends string = string, TProps extends Pr
|
|
|
265
285
|
}) => {
|
|
266
286
|
dom: HTMLElement | DocumentFragment;
|
|
267
287
|
contentDOM?: HTMLElement;
|
|
288
|
+
childrenDOM?: HTMLElement;
|
|
268
289
|
} | undefined;
|
|
269
290
|
/**
|
|
270
291
|
* Parses an external HTML element into a block of this type when it returns the block props object, otherwise undefined
|
|
@@ -282,7 +303,16 @@ export type BlockImplementation<TName extends string = string, TProps extends Pr
|
|
|
282
303
|
parseContent?: (options: {
|
|
283
304
|
el: HTMLElement;
|
|
284
305
|
schema: Schema;
|
|
285
|
-
}) => Fragment;
|
|
306
|
+
}) => Fragment | undefined;
|
|
286
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* BlockImplementationOrCreator is a union type of BlockImplementation and a function that returns a BlockImplementation.
|
|
310
|
+
* This is used to create block implementations that can be passed to the createBlockSpec function.
|
|
311
|
+
*/
|
|
312
|
+
export type BlockImplementationOrCreator<ConfigOrCreator extends BlockConfigOrCreator = BlockConfigOrCreator, TOptions extends Record<string, any> | undefined = Record<string, any> | undefined, Config extends ExtractBlockConfigFromConfigOrCreator<ConfigOrCreator> = ExtractBlockConfigFromConfigOrCreator<ConfigOrCreator>> = BlockImplementation<Config["type"], Config["propSchema"], Config["content"]> | (TOptions extends undefined ? () => BlockImplementation<Config["type"], Config["propSchema"], Config["content"]> : (options: Partial<TOptions>) => BlockImplementation<Config["type"], Config["propSchema"], Config["content"]>);
|
|
313
|
+
/**
|
|
314
|
+
* ExtractBlockImplementationFromImplementationOrCreator is a helper type that extracts the BlockImplementation type from a BlockImplementationOrCreator.
|
|
315
|
+
*/
|
|
316
|
+
export type ExtractBlockImplementationFromImplementationOrCreator<ImplementationOrCreator extends BlockImplementation<string, PropSchema, "inline" | "none"> | ((...args: any[]) => BlockImplementation<string, PropSchema, "inline" | "none">)> = ImplementationOrCreator extends (...args: any[]) => infer Implementation ? Implementation : ImplementationOrCreator;
|
|
287
317
|
export type CustomBlockImplementation<T extends string = string, PS extends PropSchema = PropSchema, C extends "inline" | "none" = "inline" | "none"> = BlockImplementation<T, PS, C>;
|
|
288
318
|
export {};
|