@blocknote/core 0.40.0 → 0.41.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.
- package/dist/BlockNoteSchema-COA0fsXW.cjs +11 -0
- package/dist/BlockNoteSchema-COA0fsXW.cjs.map +1 -0
- package/dist/{BlockNoteSchema-oR047ACf.js → BlockNoteSchema-CYRHak18.js} +681 -581
- package/dist/BlockNoteSchema-CYRHak18.js.map +1 -0
- package/dist/blocknote.cjs +4 -4
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +3663 -2817
- package/dist/blocknote.js.map +1 -1
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +51 -49
- package/dist/en-Cl87Uuyf.cjs +2 -0
- package/dist/en-Cl87Uuyf.cjs.map +1 -0
- package/dist/{en-Bq3Es3Np.js → en-njEqD7AG.js} +9 -3
- package/dist/en-njEqD7AG.js.map +1 -0
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +122 -2
- 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 +4 -3
- package/src/api/exporters/html/externalHTMLExporter.ts +1 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +2 -1
- package/src/api/exporters/markdown/markdownExporter.ts +3 -1
- package/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts +19 -0
- package/src/api/parsers/markdown/parseMarkdown.ts +31 -0
- package/src/blocks/Code/block.ts +14 -14
- package/src/blocks/Divider/block.ts +49 -0
- package/src/blocks/ListItem/BulletListItem/block.ts +9 -1
- package/src/blocks/ListItem/CheckListItem/block.ts +1 -0
- package/src/blocks/ListItem/NumberedListItem/block.ts +9 -1
- package/src/blocks/Table/block.ts +56 -1
- package/src/blocks/ToggleWrapper/createToggleWrapper.ts +1 -1
- package/src/blocks/defaultBlocks.ts +16 -14
- package/src/blocks/index.ts +1 -0
- package/src/editor/Block.css +14 -20
- package/src/editor/BlockNoteEditor.test.ts +40 -0
- package/src/editor/BlockNoteEditor.ts +248 -465
- package/src/editor/BlockNoteExtensions.ts +3 -1
- package/src/editor/managers/BlockManager.ts +251 -0
- package/src/editor/managers/CollaborationManager.ts +212 -0
- package/src/editor/managers/EventManager.ts +134 -0
- package/src/editor/managers/ExportManager.ts +137 -0
- package/src/editor/managers/ExtensionManager.ts +130 -0
- package/src/editor/managers/SelectionManager.ts +114 -0
- package/src/editor/managers/StateManager.ts +238 -0
- package/src/editor/managers/StyleManager.ts +182 -0
- package/src/editor/managers/index.ts +11 -0
- package/src/extensions/Comments/CommentsPlugin.ts +7 -4
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +10 -0
- package/src/i18n/locales/ar.ts +6 -0
- package/src/i18n/locales/de.ts +6 -0
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +6 -0
- package/src/i18n/locales/fr.ts +6 -0
- package/src/i18n/locales/he.ts +6 -0
- package/src/i18n/locales/hr.ts +6 -0
- package/src/i18n/locales/is.ts +6 -0
- package/src/i18n/locales/it.ts +6 -0
- package/src/i18n/locales/ja.ts +6 -0
- package/src/i18n/locales/ko.ts +6 -0
- package/src/i18n/locales/nl.ts +6 -0
- package/src/i18n/locales/no.ts +6 -0
- package/src/i18n/locales/pl.ts +6 -0
- package/src/i18n/locales/pt.ts +6 -0
- package/src/i18n/locales/ru.ts +6 -0
- package/src/i18n/locales/sk.ts +6 -0
- package/src/i18n/locales/uk.ts +6 -0
- package/src/i18n/locales/vi.ts +6 -0
- package/src/i18n/locales/zh-tw.ts +6 -0
- package/src/i18n/locales/zh.ts +6 -0
- package/src/schema/blocks/createSpec.ts +1 -0
- package/src/util/string.ts +21 -0
- package/types/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.d.ts +2 -0
- package/types/src/blocks/Divider/block.d.ts +3 -0
- package/types/src/blocks/Heading/block.d.ts +3 -3
- package/types/src/blocks/defaultBlocks.d.ts +2 -1
- package/types/src/blocks/index.d.ts +1 -0
- package/types/src/editor/BlockNoteEditor.d.ts +68 -47
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -1
- package/types/src/editor/managers/BlockManager.d.ts +114 -0
- package/types/src/editor/managers/CollaborationManager.d.ts +115 -0
- package/types/src/editor/managers/EventManager.d.ts +58 -0
- package/types/src/editor/managers/ExportManager.d.ts +64 -0
- package/types/src/editor/managers/ExtensionManager.d.ts +68 -0
- package/types/src/editor/managers/SelectionManager.d.ts +54 -0
- package/types/src/editor/managers/StateManager.d.ts +115 -0
- package/types/src/editor/managers/StyleManager.d.ts +48 -0
- package/types/src/editor/managers/index.d.ts +8 -0
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +4 -3
- package/types/src/i18n/locales/en.d.ts +6 -0
- package/types/src/i18n/locales/sk.d.ts +6 -0
- package/types/src/util/string.d.ts +1 -0
- package/dist/BlockNoteSchema-DmZ6UQfY.cjs +0 -11
- package/dist/BlockNoteSchema-DmZ6UQfY.cjs.map +0 -1
- package/dist/BlockNoteSchema-oR047ACf.js.map +0 -1
- package/dist/en-Bq3Es3Np.js.map +0 -1
- package/dist/en-D3B48eJ7.cjs +0 -2
- package/dist/en-D3B48eJ7.cjs.map +0 -1
- /package/src/api/exporters/markdown/{removeUnderlinesRehypePlugin.ts → util/removeUnderlinesRehypePlugin.ts} +0 -0
- /package/types/src/api/exporters/markdown/{removeUnderlinesRehypePlugin.d.ts → util/removeUnderlinesRehypePlugin.d.ts} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BlockIdentifier, BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
|
|
2
|
+
import { DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema } from "../../blocks/defaultBlocks.js";
|
|
3
|
+
import { Selection } from "../selectionTypes.js";
|
|
4
|
+
import { TextCursorPosition } from "../cursorPositionTypes.js";
|
|
5
|
+
import { BlockNoteEditor } from "../BlockNoteEditor.js";
|
|
6
|
+
export declare class SelectionManager<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema> {
|
|
7
|
+
private editor;
|
|
8
|
+
constructor(editor: BlockNoteEditor<BSchema, ISchema, SSchema>);
|
|
9
|
+
/**
|
|
10
|
+
* Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
|
|
11
|
+
* that the selection spans across.
|
|
12
|
+
*
|
|
13
|
+
* If the selection starts / ends halfway through a block, the returned data will contain the entire block.
|
|
14
|
+
*/
|
|
15
|
+
getSelection(): Selection<BSchema, ISchema, SSchema> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
|
|
18
|
+
* that the selection spans across.
|
|
19
|
+
*
|
|
20
|
+
* If the selection starts / ends halfway through a block, the returned block will be
|
|
21
|
+
* only the part of the block that is included in the selection.
|
|
22
|
+
*/
|
|
23
|
+
getSelectionCutBlocks(): {
|
|
24
|
+
blocks: import("../../index.js").Block<Record<string, import("../../index.js").BlockConfig<string, import("../../index.js").PropSchema, "inline" | "none" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
25
|
+
blockCutAtStart: string | undefined;
|
|
26
|
+
blockCutAtEnd: string | undefined;
|
|
27
|
+
_meta: {
|
|
28
|
+
startPos: number;
|
|
29
|
+
endPos: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Sets the selection to a range of blocks.
|
|
34
|
+
* @param startBlock The identifier of the block that should be the start of the selection.
|
|
35
|
+
* @param endBlock The identifier of the block that should be the end of the selection.
|
|
36
|
+
*/
|
|
37
|
+
setSelection(startBlock: BlockIdentifier, endBlock: BlockIdentifier): void;
|
|
38
|
+
/**
|
|
39
|
+
* Gets a snapshot of the current text cursor position.
|
|
40
|
+
* @returns A snapshot of the current text cursor position.
|
|
41
|
+
*/
|
|
42
|
+
getTextCursorPosition(): TextCursorPosition<BSchema, ISchema, SSchema>;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the text cursor position to the start or end of an existing block. Throws an error if the target block could
|
|
45
|
+
* not be found.
|
|
46
|
+
* @param targetBlock The identifier of an existing block that the text cursor should be moved to.
|
|
47
|
+
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
48
|
+
*/
|
|
49
|
+
setTextCursorPosition(targetBlock: BlockIdentifier, placement?: "start" | "end"): void;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the bounding box of the current selection.
|
|
52
|
+
*/
|
|
53
|
+
getSelectionBoundingBox(): DOMRect | undefined;
|
|
54
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { redo, undo } from "@tiptap/pm/history";
|
|
2
|
+
import { Command, Transaction } from "prosemirror-state";
|
|
3
|
+
import { BlockNoteEditor } from "../BlockNoteEditor.js";
|
|
4
|
+
export declare class StateManager {
|
|
5
|
+
private editor;
|
|
6
|
+
private options?;
|
|
7
|
+
constructor(editor: BlockNoteEditor, options?: {
|
|
8
|
+
/**
|
|
9
|
+
* Swap the default undo command with a custom command.
|
|
10
|
+
*/
|
|
11
|
+
undo?: typeof undo;
|
|
12
|
+
/**
|
|
13
|
+
* Swap the default redo command with a custom command.
|
|
14
|
+
*/
|
|
15
|
+
redo?: typeof redo;
|
|
16
|
+
} | undefined);
|
|
17
|
+
/**
|
|
18
|
+
* Stores the currently active transaction, which is the accumulated transaction from all {@link dispatch} calls during a {@link transact} calls
|
|
19
|
+
*/
|
|
20
|
+
private activeTransaction;
|
|
21
|
+
/**
|
|
22
|
+
* For any command that can be executed, you can check if it can be executed by calling `editor.can(command)`.
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* if (editor.can(editor.undo)) {
|
|
26
|
+
* // show button
|
|
27
|
+
* } else {
|
|
28
|
+
* // hide button
|
|
29
|
+
* }
|
|
30
|
+
*/
|
|
31
|
+
can(cb: () => boolean): boolean;
|
|
32
|
+
private isInCan;
|
|
33
|
+
/**
|
|
34
|
+
* Execute a prosemirror command. This is mostly for backwards compatibility with older code.
|
|
35
|
+
*
|
|
36
|
+
* @note You should prefer the {@link transact} method when possible, as it will automatically handle the dispatching of the transaction and work across blocknote transactions.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* editor.exec((state, dispatch, view) => {
|
|
41
|
+
* dispatch(state.tr.insertText("Hello, world!"));
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
exec(command: Command): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Check if a command can be executed. A command should return `false` if it is not valid in the current state.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* if (editor.canExec(command)) {
|
|
52
|
+
* // show button
|
|
53
|
+
* } else {
|
|
54
|
+
* // hide button
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
canExec(command: Command): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Execute a function within a "blocknote transaction".
|
|
61
|
+
* All changes to the editor within the transaction will be grouped together, so that
|
|
62
|
+
* we can dispatch them as a single operation (thus creating only a single undo step)
|
|
63
|
+
*
|
|
64
|
+
* @note There is no need to dispatch the transaction, as it will be automatically dispatched when the callback is complete.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* // All changes to the editor will be grouped together
|
|
69
|
+
* editor.transact((tr) => {
|
|
70
|
+
* tr.insertText("Hello, world!");
|
|
71
|
+
* // These two operations will be grouped together in a single undo step
|
|
72
|
+
* editor.transact((tr) => {
|
|
73
|
+
* tr.insertText("Hello, world!");
|
|
74
|
+
* });
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
transact<T>(callback: (
|
|
79
|
+
/**
|
|
80
|
+
* The current active transaction, this will automatically be dispatched to the editor when the callback is complete
|
|
81
|
+
* If another `transact` call is made within the callback, it will be passed the same transaction as the parent call.
|
|
82
|
+
*/
|
|
83
|
+
tr: Transaction) => T): T;
|
|
84
|
+
/**
|
|
85
|
+
* Get the underlying prosemirror state
|
|
86
|
+
* @note Prefer using `editor.transact` to read the current editor state, as that will ensure the state is up to date
|
|
87
|
+
* @see https://prosemirror.net/docs/ref/#state.EditorState
|
|
88
|
+
*/
|
|
89
|
+
get prosemirrorState(): import("prosemirror-state").EditorState;
|
|
90
|
+
/**
|
|
91
|
+
* Get the underlying prosemirror view
|
|
92
|
+
* @see https://prosemirror.net/docs/ref/#view.EditorView
|
|
93
|
+
*/
|
|
94
|
+
get prosemirrorView(): import("prosemirror-view").EditorView;
|
|
95
|
+
isFocused(): boolean;
|
|
96
|
+
focus(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Checks if the editor is currently editable, or if it's locked.
|
|
99
|
+
* @returns True if the editor is editable, false otherwise.
|
|
100
|
+
*/
|
|
101
|
+
get isEditable(): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Makes the editor editable or locks it, depending on the argument passed.
|
|
104
|
+
* @param editable True to make the editor editable, or false to lock it.
|
|
105
|
+
*/
|
|
106
|
+
set isEditable(editable: boolean);
|
|
107
|
+
/**
|
|
108
|
+
* Undo the last action.
|
|
109
|
+
*/
|
|
110
|
+
undo(): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Redo the last action.
|
|
113
|
+
*/
|
|
114
|
+
redo(): boolean;
|
|
115
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BlockSchema, InlineContentSchema, PartialInlineContent, StyleSchema, Styles } from "../../schema/index.js";
|
|
2
|
+
import { DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema } from "../../blocks/defaultBlocks.js";
|
|
3
|
+
import { BlockNoteEditor } from "../BlockNoteEditor.js";
|
|
4
|
+
export declare class StyleManager<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema> {
|
|
5
|
+
private editor;
|
|
6
|
+
constructor(editor: BlockNoteEditor<BSchema, ISchema, SSchema>);
|
|
7
|
+
/**
|
|
8
|
+
* Insert a piece of content at the current cursor position.
|
|
9
|
+
*
|
|
10
|
+
* @param content can be a string, or array of partial inline content elements
|
|
11
|
+
*/
|
|
12
|
+
insertInlineContent(content: PartialInlineContent<ISchema, SSchema>, { updateSelection }?: {
|
|
13
|
+
updateSelection?: boolean;
|
|
14
|
+
}): void;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the active text styles at the text cursor position or at the end of the current selection if it's active.
|
|
17
|
+
*/
|
|
18
|
+
getActiveStyles(): Styles<SSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Adds styles to the currently selected content.
|
|
21
|
+
* @param styles The styles to add.
|
|
22
|
+
*/
|
|
23
|
+
addStyles(styles: Styles<SSchema>): void;
|
|
24
|
+
/**
|
|
25
|
+
* Removes styles from the currently selected content.
|
|
26
|
+
* @param styles The styles to remove.
|
|
27
|
+
*/
|
|
28
|
+
removeStyles(styles: Styles<SSchema>): void;
|
|
29
|
+
/**
|
|
30
|
+
* Toggles styles on the currently selected content.
|
|
31
|
+
* @param styles The styles to toggle.
|
|
32
|
+
*/
|
|
33
|
+
toggleStyles(styles: Styles<SSchema>): void;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the currently selected text.
|
|
36
|
+
*/
|
|
37
|
+
getSelectedText(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the URL of the last link in the current selection, or `undefined` if there are no links in the selection.
|
|
40
|
+
*/
|
|
41
|
+
getSelectedLinkUrl(): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new link to replace the selected content.
|
|
44
|
+
* @param url The link URL.
|
|
45
|
+
* @param text The text to display the link with.
|
|
46
|
+
*/
|
|
47
|
+
createLink(url: string, text?: string): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BlockManager } from "./BlockManager.js";
|
|
2
|
+
export { CollaborationManager, type CollaborationOptions, } from "./CollaborationManager.js";
|
|
3
|
+
export { EventManager } from "./EventManager.js";
|
|
4
|
+
export { ExportManager } from "./ExportManager.js";
|
|
5
|
+
export { ExtensionManager } from "./ExtensionManager.js";
|
|
6
|
+
export { SelectionManager } from "./SelectionManager.js";
|
|
7
|
+
export { StateManager } from "./StateManager.js";
|
|
8
|
+
export { StyleManager } from "./StyleManager.js";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { CommentBody, ThreadStore, User } from "../../comments/index.js";
|
|
2
2
|
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
3
3
|
import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CustomBlockNoteSchema } from "../../schema/schema.js";
|
|
5
5
|
import { UserStore } from "./userstore/UserStore.js";
|
|
6
6
|
export declare class CommentsPlugin extends BlockNoteExtension {
|
|
7
7
|
private readonly editor;
|
|
8
8
|
readonly threadStore: ThreadStore;
|
|
9
9
|
private readonly markType;
|
|
10
|
-
readonly
|
|
10
|
+
readonly resolveUsers: undefined | ((userIds: string[]) => Promise<User[]>);
|
|
11
|
+
readonly commentEditorSchema?: CustomBlockNoteSchema<any, any, any> | undefined;
|
|
11
12
|
static key(): string;
|
|
12
13
|
readonly userStore: UserStore<User>;
|
|
13
14
|
/**
|
|
@@ -28,7 +29,7 @@ export declare class CommentsPlugin extends BlockNoteExtension {
|
|
|
28
29
|
* when a thread is resolved or deleted, we need to update the marks to reflect the new state
|
|
29
30
|
*/
|
|
30
31
|
private updateMarksFromThreads;
|
|
31
|
-
constructor(editor: BlockNoteEditor<any, any, any>, threadStore: ThreadStore, markType: string, commentEditorSchema?:
|
|
32
|
+
constructor(editor: BlockNoteEditor<any, any, any>, threadStore: ThreadStore, markType: string, resolveUsers: undefined | ((userIds: string[]) => Promise<User[]>), commentEditorSchema?: CustomBlockNoteSchema<any, any, any> | undefined);
|
|
32
33
|
/**
|
|
33
34
|
* Subscribe to state updates
|
|
34
35
|
*/
|
|
@@ -138,6 +138,12 @@ export declare const en: {
|
|
|
138
138
|
aliases: string[];
|
|
139
139
|
group: string;
|
|
140
140
|
};
|
|
141
|
+
divider: {
|
|
142
|
+
title: string;
|
|
143
|
+
subtext: string;
|
|
144
|
+
aliases: string[];
|
|
145
|
+
group: string;
|
|
146
|
+
};
|
|
141
147
|
};
|
|
142
148
|
placeholders: Record<string | "default" | "emptyDocument", string | undefined>;
|
|
143
149
|
file_blocks: {
|
|
@@ -138,6 +138,12 @@ export declare const sk: {
|
|
|
138
138
|
aliases: string[];
|
|
139
139
|
group: string;
|
|
140
140
|
};
|
|
141
|
+
divider: {
|
|
142
|
+
title: string;
|
|
143
|
+
subtext: string;
|
|
144
|
+
aliases: string[];
|
|
145
|
+
group: string;
|
|
146
|
+
};
|
|
141
147
|
};
|
|
142
148
|
placeholders: Record<string | "default" | "emptyDocument", string | undefined>;
|
|
143
149
|
file_blocks: {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var Cn=Object.defineProperty;var yn=(e,t,n)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var x=(e,t,n)=>yn(e,typeof t!="symbol"?t+"":t,n);const P=require("prosemirror-tables"),wn=require("@tiptap/extension-bold"),vn=require("@tiptap/extension-code"),Sn=require("@tiptap/extension-italic"),En=require("@tiptap/extension-strike"),xn=require("@tiptap/extension-underline"),E=require("@tiptap/core"),B=require("prosemirror-model"),W=require("prosemirror-state"),Bn=require("uuid"),Tn=require("prosemirror-highlight"),Mn=require("prosemirror-highlight/shiki"),Ln=require("prosemirror-transform"),Ce=require("prosemirror-view"),ee=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},An=ee(wn),Nn=ee(vn),In=ee(Sn),Pn=ee(En),On=ee(xn);function Hn(e,t=JSON.stringify){const n={};return e.filter(o=>{const r=t(o);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Dn(e){const t=e.filter((o,r)=>e.indexOf(o)!==r);return Hn(t)}const xe=E.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){const e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return Bn.v4()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{const t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new W.Plugin({key:new W.PluginKey("uniqueID"),appendTransaction:(n,o,r)=>{const s=n.some(h=>h.docChanged)&&!o.doc.eq(r.doc),a=this.options.filterTransaction&&n.some(h=>{var k,g;return!((g=(k=this.options).filterTransaction)!=null&&g.call(k,h))});if(!s||a)return;const{tr:i}=r,{types:c,attributeName:l,generateID:d}=this.options,u=E.combineTransactionSteps(o.doc,n),{mapping:p}=u;if(E.getChangedRanges(u).forEach(({newRange:h})=>{const k=E.findChildrenInRange(r.doc,h,y=>c.includes(y.type.name)),g=k.map(({node:y})=>y.attrs[l]).filter(y=>y!==null),b=Dn(g);k.forEach(({node:y,pos:m})=>{var X;const v=(X=i.doc.nodeAt(m))==null?void 0:X.attrs[l];if(v===null){const J=o.doc.type.createAndFill().content;if(o.doc.content.findDiffStart(J)===null){const je=JSON.parse(JSON.stringify(r.doc.toJSON()));if(je.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(je.content)===JSON.stringify(J.toJSON())){i.setNodeMarkup(m,void 0,{...y.attrs,[l]:"initialBlockId"});return}}i.setNodeMarkup(m,void 0,{...y.attrs,[l]:d()});return}const{deleted:M}=p.invert().mapResult(m);M&&b.includes(v)&&i.setNodeMarkup(m,void 0,{...y.attrs,[l]:d()})})}),!!i.steps.length)return i.setMeta("uniqueID",!0),i},view(n){const o=r=>{let s;e=!((s=n.dom.parentElement)===null||s===void 0)&&s.contains(r.target)?n.dom.parentElement:null};return window.addEventListener("dragstart",o),{destroy(){window.removeEventListener("dragstart",o)}}},props:{handleDOMEvents:{drop:(n,o)=>{let r;return e!==n.dom.parentElement||((r=o.dataTransfer)===null||r===void 0?void 0:r.effectAllowed)==="copy"?t=!0:t=!1,e=null,!1},paste:()=>(t=!0,!1)},transformPasted:n=>{if(!t)return n;const{types:o,attributeName:r}=this.options,s=a=>{const i=[];return a.forEach(c=>{if(c.isText){i.push(c);return}if(!o.includes(c.type.name)){i.push(c.copy(s(c.content)));return}const l=c.type.create({...c.attrs,[r]:null},s(c.content),c.marks);i.push(l)}),B.Fragment.from(i)};return t=!1,new B.Slice(s(n.content),n.openStart,n.openEnd)}}})]}});function ye(e){return e.type==="link"}function Be(e){return typeof e!="string"&&e.type==="link"}function O(e){return typeof e!="string"&&e.type==="text"}function ne(e){var t,n,o,r,s;return se(e)?{...e}:j(e)?{type:"tableCell",content:[].concat(e.content),props:{backgroundColor:((t=e.props)==null?void 0:t.backgroundColor)??"default",textColor:((n=e.props)==null?void 0:n.textColor)??"default",textAlignment:((o=e.props)==null?void 0:o.textAlignment)??"left",colspan:((r=e.props)==null?void 0:r.colspan)??1,rowspan:((s=e.props)==null?void 0:s.rowspan)??1}}:{type:"tableCell",content:[].concat(e),props:{backgroundColor:"default",textColor:"default",textAlignment:"left",colspan:1,rowspan:1}}}function j(e){return e!=null&&typeof e!="string"&&!Array.isArray(e)&&e.type==="tableCell"}function se(e){return j(e)&&e.props!==void 0&&e.content!==void 0}function $(e){return se(e)?e.props.colspan??1:1}function oe(e){return se(e)?e.props.rowspan??1:1}class z extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function _n(e,t=!0){const{"data-test":n,...o}=e;if(Object.keys(o).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}const Ye=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function N(e,t="Ctrl"){return Ye()?e.replace("Mod","⌘"):e.replace("Mod",t)}function U(...e){return[...new Set(e.filter(t=>t).join(" ").split(" "))].join(" ")}const Rn=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Qe(e,t,n,o){const r=document.createElement("div");r.className=U("bn-block-content",n.class),r.setAttribute("data-content-type",e);for(const[a,i]of Object.entries(n))a!=="class"&&r.setAttribute(a,i);const s=document.createElement(t);s.className=U("bn-inline-content",o.class);for(const[a,i]of Object.entries(o))a!=="class"&&s.setAttribute(a,i);return r.appendChild(s),{dom:r,contentDOM:s}}const we=(e,t)=>{let n=te(e,t.pmSchema);n.type.name==="blockContainer"&&(n=n.firstChild);const o=t.pmSchema.nodes[n.type.name].spec.toDOM;if(o===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const r=o(n);if(typeof r!="object"||!("dom"in r))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return r};function et(e,t="<br>"){const n=e.querySelectorAll("p");if(n.length>1){const o=n[0];for(let r=1;r<n.length;r++){const s=n[r];o.innerHTML+=t+s.innerHTML,s.remove()}}}function Y(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Vn(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function tt(e){const t={};return Object.entries(e).forEach(([n,o])=>{t[n]={default:o.default,keepOnSplit:!0,parseHTML:r=>{const s=r.getAttribute(Y(n));if(s===null)return null;if(o.default===void 0&&o.type==="boolean"||o.default!==void 0&&typeof o.default=="boolean")return s==="true"?!0:s==="false"?!1:null;if(o.default===void 0&&o.type==="number"||o.default!==void 0&&typeof o.default=="number"){const a=parseFloat(s);return!Number.isNaN(a)&&Number.isFinite(a)?a:null}return s},renderHTML:r=>r[n]!==o.default?{[Y(n)]:r[n]}:{}}}),t}function nt(e,t,n,o){const r=e();if(r===void 0)throw new Error("Cannot find node position");const a=n.state.doc.resolve(r).node().attrs.id;if(!a)throw new Error("Block doesn't have id");const i=t.getBlock(a);if(i.type!==o)throw new Error("Block type does not match");return i}function re(e,t,n,o,r=!1,s){const a=document.createElement("div");if(s!==void 0)for(const[i,c]of Object.entries(s))i!=="class"&&a.setAttribute(i,c);a.className=U("bn-block-content",(s==null?void 0:s.class)||""),a.setAttribute("data-content-type",t);for(const[i,c]of Object.entries(n)){const d=o[i].default;c!==d&&a.setAttribute(Y(i),c)}return r&&a.setAttribute("data-file-block",""),a.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=U("bn-inline-content",e.contentDOM.className)),{...e,dom:a}}function ot(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,render:we,toExternalHTML:we},extensions:n}}function rt(e,t){e.stopEvent=n=>(n.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function st(e,t){const n=[{tag:"[data-content-type="+e.type+"]",contentElement:".bn-inline-content"}];return t.parse&&n.push({tag:"*",getAttrs(o){var s;if(typeof o=="string")return!1;const r=(s=t.parse)==null?void 0:s.call(t,o);return r===void 0?!1:r},getContent:e.content==="inline"||e.content==="none"?(o,r)=>{var s;if(t.parseContent)return t.parseContent({el:o,schema:r});if(e.content==="inline"){const i=o.cloneNode(!0);return et(i,(s=t.meta)!=null&&s.code?`
|
|
2
|
-
`:"<br>"),B.DOMParser.fromSchema(r).parse(i,{topNode:r.nodes.paragraph.create()}).content}return B.Fragment.empty}:void 0}),n}function at(e,t,n,o){var s,a,i,c;const r=t.node||E.Node.create({name:e.type,content:e.content==="inline"?"inline*":e.content==="none"?"":e.content,group:"blockContent",selectable:((s=t.meta)==null?void 0:s.selectable)??!0,isolating:((a=t.meta)==null?void 0:a.isolating)??!0,code:((i=t.meta)==null?void 0:i.code)??!1,defining:((c=t.meta)==null?void 0:c.defining)??!0,priority:o,addAttributes(){return tt(e.propSchema)},parseHTML(){return st(e,t)},renderHTML({HTMLAttributes:l}){var u;const d=document.createElement("div");return re({dom:d,contentDOM:e.content==="inline"?d:void 0},e.type,{},e.propSchema,((u=t.meta)==null?void 0:u.fileBlockAccept)!==void 0,l)},addNodeView(){return l=>{var h,k;const d=this.options.editor,u=nt(l.getPos,d,this.editor,e.type),p=((h=this.options.domAttributes)==null?void 0:h.blockContent)||{},f=t.render.call({blockContentDOMAttributes:p,props:l,renderType:"nodeView"},u,d);return((k=t.meta)==null?void 0:k.selectable)===!1&&rt(f,this.editor),f}}});if(r.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return{config:e,implementation:{node:r,render(l,d){var p;const u=((p=r.options.domAttributes)==null?void 0:p.blockContent)||{};return t.render.call({blockContentDOMAttributes:u,props:void 0,renderType:"dom"},l,d)},toExternalHTML:(l,d)=>{var p,f;const u=((p=r.options.domAttributes)==null?void 0:p.blockContent)||{};return((f=t.toExternalHTML)==null?void 0:f.call({blockContentDOMAttributes:u},l,d))??t.render.call({blockContentDOMAttributes:u,renderType:"dom",props:void 0},l,d)}},extensions:n}}function Fn(e){return e}function L(e,t,n){return(o={})=>{const r=typeof e=="function"?e(o):e,s=typeof t=="function"?t(o):t,a=n?typeof n=="function"?n(o):n:void 0;return{config:r,implementation:{...s,toExternalHTML(i,c){var d,u;const l=(d=s.toExternalHTML)==null?void 0:d.call({blockContentDOMAttributes:this.blockContentDOMAttributes},i,c);if(l!==void 0)return re(l,i.type,i.props,r.propSchema,((u=s.meta)==null?void 0:u.fileBlockAccept)!==void 0)},render(i,c){var u;const l=s.render.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},i,c);return re(l,i.type,i.props,r.propSchema,((u=s.meta)==null?void 0:u.fileBlockAccept)!==void 0,this.blockContentDOMAttributes)}},extensions:a}}}function ae(e,t){const n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:n.pos,node:n.nodeAfter};let o=n.depth,r=n.node(o);for(;o>0;){if(r.type.isInGroup("bnBlock"))return{posBeforeNode:n.before(o),node:r};o--,r=n.node(o)}const s=[];e.descendants((i,c)=>{i.type.isInGroup("bnBlock")&&s.push(c)}),console.warn(`Position ${t} is not within a blockContainer node.`);const a=e.resolve(s.find(i=>i>=t)||s[s.length-1]);return{posBeforeNode:a.pos,node:a.nodeAfter}}function ie(e,t){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type.name}`);const n=e,o=t,r=o+n.nodeSize,s={node:n,beforePos:o,afterPos:r};if(n.type.name==="blockContainer"){let a,i;if(n.forEach((c,l)=>{if(c.type.spec.group==="blockContent"){const d=c,u=o+l+1,p=u+c.nodeSize;a={node:d,beforePos:u,afterPos:p}}else if(c.type.name==="blockGroup"){const d=c,u=o+l+1,p=u+c.nodeSize;i={node:d,beforePos:u,afterPos:p}}}),!a)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${n}`);return{isBlockContainer:!0,bnBlock:s,blockContent:a,childContainer:i,blockNoteType:a.node.type.name}}else{if(!s.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${s.node}`);return{isBlockContainer:!1,bnBlock:s,childContainer:s,blockNoteType:s.node.type.name}}}function q(e){return ie(e.node,e.posBeforeNode)}function it(e){if(!e.nodeAfter)throw new Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return ie(e.nodeAfter,e.pos)}function Wn(e){const t=ae(e.doc,e.selection.anchor);return q(t)}function ct(e){const t=ae(e.doc,e.selection.anchor);return q(t)}function G(e){return"doc"in e?e.doc.type.schema:e.type.schema}function lt(e){return e.cached.blockNoteEditor}function ce(e){return lt(e).schema}function le(e){return ce(e).blockSchema}function ue(e){return ce(e).inlineContentSchema}function V(e){return ce(e).styleSchema}function de(e){return lt(e).blockCache}function ut(e,t,n){var s,a;const o={type:"tableContent",columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},r=[];e.content.forEach((i,c,l)=>{const d={cells:[]};l===0&&i.content.forEach(u=>{let p=u.attrs.colwidth;p==null&&(p=new Array(u.attrs.colspan??1).fill(void 0)),o.columnWidths.push(...p)}),d.cells=i.content.content.map((u,p)=>(r[l]||(r[l]=[]),r[l][p]=u.type.name==="tableHeader",{type:"tableCell",content:u.content.content.map(h=>pe(h,t,n)).reduce((h,k)=>{if(!h.length)return k;const g=h[h.length-1],b=k[0];return b&&O(g)&&O(b)&&JSON.stringify(g.styles)===JSON.stringify(b.styles)?(g.text+=`
|
|
3
|
-
`+b.text,h.push(...k.slice(1)),h):(h.push(...k),h)},[]),props:{colspan:u.attrs.colspan,rowspan:u.attrs.rowspan,backgroundColor:u.attrs.backgroundColor,textColor:u.attrs.textColor,textAlignment:u.attrs.textAlignment}})),o.rows.push(d)});for(let i=0;i<r.length;i++)(s=r[i])!=null&&s.every(c=>c)&&(o.headerRows=(o.headerRows??0)+1);for(let i=0;i<((a=r[0])==null?void 0:a.length);i++)r!=null&&r.every(c=>c[i])&&(o.headerCols=(o.headerCols??0)+1);return o}function pe(e,t,n){const o=[];let r;return e.content.forEach(s=>{if(s.type.name==="hardBreak"){if(r)if(O(r))r.text+=`
|
|
4
|
-
`;else if(ye(r))r.content[r.content.length-1].text+=`
|
|
5
|
-
`;else throw new Error("unexpected");else r={type:"text",text:`
|
|
6
|
-
`,styles:{}};return}if(s.type.name!=="link"&&s.type.name!=="text"){if(!t[s.type.name]){console.warn("unrecognized inline content type",s.type.name);return}r&&(o.push(r),r=void 0),o.push(dt(s,t,n));return}const a={};let i;for(const c of s.marks)if(c.type.name==="link")i=c;else{const l=n[c.type.name];if(!l){if(c.type.spec.blocknoteIgnore)continue;throw new Error(`style ${c.type.name} not found in styleSchema`)}if(l.propSchema==="boolean")a[l.type]=!0;else if(l.propSchema==="string")a[l.type]=c.attrs.stringValue;else throw new z(l.propSchema)}r?O(r)?i?(o.push(r),r={type:"link",href:i.attrs.href,content:[{type:"text",text:s.textContent,styles:a}]}):JSON.stringify(r.styles)===JSON.stringify(a)?r.text+=s.textContent:(o.push(r),r={type:"text",text:s.textContent,styles:a}):ye(r)&&(i?r.href===i.attrs.href?JSON.stringify(r.content[r.content.length-1].styles)===JSON.stringify(a)?r.content[r.content.length-1].text+=s.textContent:r.content.push({type:"text",text:s.textContent,styles:a}):(o.push(r),r={type:"link",href:i.attrs.href,content:[{type:"text",text:s.textContent,styles:a}]}):(o.push(r),r={type:"text",text:s.textContent,styles:a})):i?r={type:"link",href:i.attrs.href,content:[{type:"text",text:s.textContent,styles:a}]}:r={type:"text",text:s.textContent,styles:a}}),r&&o.push(r),o}function dt(e,t,n){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const o={},r=t[e.type.name];for(const[i,c]of Object.entries(e.attrs)){if(!r)throw Error("ic node is of an unrecognized type: "+e.type.name);const l=r.propSchema;i in l&&(o[i]=c)}let s;return r.content==="styled"?s=pe(e,t,n):s=void 0,{type:e.type.name,props:o,content:s}}function Z(e,t,n=le(t),o=ue(t),r=V(t),s=de(t)){var k;if(!e.type.isInGroup("bnBlock"))throw Error("Node should be a bnBlock, but is instead: "+e.type.name);const a=s==null?void 0:s.get(e);if(a)return a;const i=ie(e,0);let c=i.bnBlock.node.attrs.id;c===null&&(c=xe.options.generateID());const l=n[i.blockNoteType];if(!l)throw Error("Block is of an unrecognized type: "+i.blockNoteType);const d={};for(const[g,b]of Object.entries({...e.attrs,...i.isBlockContainer?i.blockContent.node.attrs:{}})){const y=l.propSchema;g in y&&!(y[g].default===void 0&&b===void 0)&&(d[g]=b)}const u=n[i.blockNoteType],p=[];(k=i.childContainer)==null||k.node.forEach(g=>{p.push(Z(g,t,n,o,r,s))});let f;if(u.content==="inline"){if(!i.isBlockContainer)throw new Error("impossible");f=pe(i.blockContent.node,o,r)}else if(u.content==="table"){if(!i.isBlockContainer)throw new Error("impossible");f=ut(i.blockContent.node,o,r)}else if(u.content==="none")f=void 0;else throw new z(u.content);const h={id:c,type:u.type,props:d,content:f,children:p};return s==null||s.set(e,h),h}function jn(e,t,n=le(t),o=ue(t),r=V(t),s=de(t)){const a=[];return e.firstChild.descendants(i=>(a.push(Z(i,t,n,o,r,s)),!1)),a}function $n(e,t,n=le(t),o=ue(t),r=V(t),s=de(t)){function a(i,c,l){if(i.type.name!=="blockGroup")throw new Error("unexpected");const d=[];let u,p;return i.forEach((f,h,k)=>{if(f.type.name!=="blockContainer")throw new Error("unexpected");if(f.childCount===0)return;if(f.childCount===0||f.childCount>2)throw new Error("unexpected, blockContainer.childCount: "+f.childCount);const g=k===0,b=k===i.childCount-1;if(f.firstChild.type.name==="blockGroup"){if(!g)throw new Error("unexpected");const M=a(f.firstChild,Math.max(0,c-1),b?Math.max(0,l-1):0);u=M.blockCutAtStart,b&&(p=M.blockCutAtEnd),d.push(...M.blocks);return}const y=Z(f,t,n,o,r,s),m=f.childCount>1?f.child(1):void 0;let v=[];if(m){const M=a(m,0,b?Math.max(0,l-1):0);v=M.blocks,b&&(p=M.blockCutAtEnd)}b&&!m&&l>1&&(p=y.id),g&&c>1&&(u=y.id),d.push({...y,children:v})}),{blocks:d,blockCutAtStart:u,blockCutAtEnd:p}}if(e.content.childCount===0)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(e.content.childCount!==1)throw new Error("slice must be a single block, did you forget includeParents=true?");return a(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function Un(e,t,n,o){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(n).filter(([r,s])=>{const a=o[r];return s!==a.default}).map(([r,s])=>[Y(r),s]).forEach(([r,s])=>e.dom.setAttribute(r,s)),e.contentDOM&&e.contentDOM.setAttribute("data-editable",""),e}function qn(e){return{Backspace:({editor:t})=>{const n=t.state.selection.$from;return t.state.selection.empty&&n.node().type.name===e.type&&n.parentOffset===0}}}function pt(e,t){return{config:e,implementation:t}}function zn(e,t,n){return pt({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{...n,node:e})}function Te(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.config]))}function ft(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:t=>t.getAttribute("data-value"),renderHTML:t=>t.stringValue!==void 0?{"data-value":t.stringValue}:{}}}}function K(e,t,n,o){return e.dom.setAttribute("data-style-type",t),o==="string"&&e.dom.setAttribute("data-value",n),e.contentDOM&&e.contentDOM.setAttribute("data-editable",""),e}function Me(e,t){return{config:e,implementation:t}}function F(e,t){return Me({type:e.name,propSchema:t},{mark:e,render(n,o){const r=o.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const s=o.pmSchema.mark(e.name,{stringValue:n}),a=B.DOMSerializer.renderSpec(document,r(s,!0));if(typeof a!="object"||!("dom"in a))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a},toExternalHTML(n,o){const r=o.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const s=o.pmSchema.mark(e.name,{stringValue:n}),a=B.DOMSerializer.renderSpec(document,r(s,!0));if(typeof a!="object"||!("dom"in a))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a}})}function Le(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.config]))}function ht(e,t){const n=[{tag:`[data-style-type="${e.type}"]`,contentElement:o=>{const r=o;return r.matches("[data-editable]")?r:r.querySelector("[data-editable]")||r}}];return t&&n.push({tag:"*",getAttrs(o){if(typeof o=="string")return!1;const r=t==null?void 0:t(o);return r===void 0?!1:{stringValue:r}}}),n}function Ae(e,t){const n=E.Mark.create({name:e.type,addAttributes(){return ft(e.propSchema)},parseHTML(){return ht(e,t.parse)},renderHTML({mark:o}){const r=(t.toExternalHTML||t.render)(o.attrs.stringValue);return K(r,e.type,o.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:o})=>{const r=t.render(o.attrs.stringValue);return K(r,e.type,o.attrs.stringValue,e.propSchema)}}});return Me(e,{mark:n,render:o=>{const r=t.render(o);return K(r,e.type,o,e.propSchema)},toExternalHTML:o=>{const r=(t.toExternalHTML||t.render)(o);return K(r,e.type,o,e.propSchema)}})}function Gn(e){const t=Xn(e);let{roots:n,nonRoots:o}=$e(t);const r=[];for(;n.size;){r.push(n);const s=new Set;for(const a of n){const i=e.get(a);if(i)for(const c of i){const l=t.get(c);if(l===void 0)continue;const d=l-1;t.set(c,d),d===0&&s.add(c)}}n=s}if(o=$e(t).nonRoots,o.size)throw new Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(o).join(", ")}`);return r}function Zn(e){const t=Jn(e);return Gn(t)}function Xn(e){const t=new Map;for(const[n,o]of e.entries()){t.has(n)||t.set(n,0);for(const r of o){const s=t.get(r)??0;t.set(r,s+1)}}return t}function $e(e){const t=new Set,n=new Set;for(const[o,r]of e.entries())r===0?t.add(o):n.add(o);return{roots:t,nonRoots:n}}function Jn(e){const t=new Map;for(const[n,o]of e.entries()){t.has(n)||t.set(n,new Set);for(const r of o)t.has(r)||t.set(r,new Set),t.get(r).add(n)}return t}function Kn(){return new Map}function Ue(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class gt{constructor(t){x(this,"BlockNoteEditor","only for types");x(this,"Block","only for types");x(this,"PartialBlock","only for types");x(this,"inlineContentSpecs");x(this,"styleSpecs");x(this,"blockSpecs");x(this,"blockSchema");x(this,"inlineContentSchema");x(this,"styleSchema");this.opts=t;const{blockSpecs:n,inlineContentSpecs:o,styleSpecs:r,blockSchema:s,inlineContentSchema:a,styleSchema:i}=this.init();this.blockSpecs=n,this.styleSpecs=r,this.styleSchema=i,this.inlineContentSpecs=o,this.blockSchema=s,this.inlineContentSchema=a}init(){const t=Kn(),n=new Set;t.set("default",n);for(const[i,c]of Object.entries(this.opts.blockSpecs))c.implementation.runsBefore?t.set(i,new Set(c.implementation.runsBefore)):n.add(i);const o=Zn(t),r=o.findIndex(i=>i.has("default")),s=i=>91+(o.findIndex(l=>l.has(i))+r)*10,a=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([i,c])=>[i,at(c.config,c.implementation,c.extensions,s(i))]));return{blockSpecs:a,blockSchema:Object.fromEntries(Object.entries(a).map(([i,c])=>[i,c.config])),inlineContentSpecs:Ue(this.opts.inlineContentSpecs),styleSpecs:Ue(this.opts.styleSpecs),inlineContentSchema:Te(this.opts.inlineContentSpecs),styleSchema:Le(this.opts.styleSpecs)}}extend(t){Object.assign(this.opts.blockSpecs,t.blockSpecs),Object.assign(this.opts.inlineContentSpecs,t.inlineContentSpecs),Object.assign(this.opts.styleSpecs,t.styleSpecs);const{blockSpecs:n,inlineContentSpecs:o,styleSpecs:r,blockSchema:s,inlineContentSchema:a,styleSchema:i}=this.init();return this.blockSpecs=n,this.styleSpecs=r,this.styleSchema=i,this.inlineContentSpecs=o,this.blockSchema=s,this.inlineContentSchema=a,this}}function H(e){const{height:t,width:n}=Ne(e),o=new Array(t).fill(!1).map(()=>new Array(n).fill(null)),r=(s,a)=>{for(let i=s;i<t;i++)for(let c=a;c<n;c++)if(!o[i][c])return{row:i,col:c};throw new Error("Unable to create occupancy grid for table, no more available cells")};for(let s=0;s<e.content.rows.length;s++)for(let a=0;a<e.content.rows[s].cells.length;a++){const i=ne(e.content.rows[s].cells[a]),c=oe(i),l=$(i),{row:d,col:u}=r(s,a);for(let p=d;p<d+c;p++)for(let f=u;f<u+l;f++){if(o[p][f])throw new Error(`Unable to create occupancy grid for table, cell at ${p},${f} is already occupied`);o[p][f]={row:s,col:a,rowspan:c,colspan:l,cell:i}}}return o}function Q(e){const t=new Set;return e.map(n=>({cells:n.map(o=>t.has(o.row+":"+o.col)?!1:(t.add(o.row+":"+o.col),o.cell)).filter(o=>o!==!1)}))}function _(e,t,n=H(t)){for(let o=0;o<n.length;o++)for(let r=0;r<n[o].length;r++){const s=n[o][r];if(s.row===e.row&&s.col===e.col)return{row:o,col:r,cell:s.cell}}throw new Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function Ne(e){const t=e.content.rows.length;let n=0;return e.content.rows.forEach(o=>{let r=0;o.cells.forEach(s=>{r+=$(s)}),n=Math.max(n,r)}),{height:t,width:n}}function mt(e,t,n=H(t)){var r;const o=(r=n[e.row])==null?void 0:r[e.col];if(o)return{row:o.row,col:o.col,cell:o.cell}}function bt(e,t){var s;const n=H(e);if(t<0||t>=n.length)return[];let o=0;for(let a=0;a<t;a++){const i=(s=n[o])==null?void 0:s[0];if(!i)return[];o+=i.rowspan}const r=new Array(n[0].length).fill(!1).map((a,i)=>mt({row:o,col:i},e,n)).filter(a=>a!==void 0);return r.filter((a,i)=>r.findIndex(c=>c.row===a.row&&c.col===a.col)===i)}function kt(e,t){var s;const n=H(e);if(t<0||t>=n[0].length)return[];let o=0;for(let a=0;a<t;a++){const i=(s=n[0])==null?void 0:s[o];if(!i)return[];o+=i.colspan}const r=new Array(n.length).fill(!1).map((a,i)=>mt({row:i,col:o},e,n)).filter(a=>a!==void 0);return r.filter((a,i)=>r.findIndex(c=>c.row===a.row&&c.col===a.col)===i)}function Yn(e,t,n,o=H(e)){const{col:r}=_({row:0,col:t},e,o),{col:s}=_({row:0,col:n},e,o);return o.forEach(a=>{const[i]=a.splice(r,1);a.splice(s,0,i)}),Q(o)}function Qn(e,t,n,o=H(e)){const{row:r}=_({row:t,col:0},e,o),{row:s}=_({row:n,col:0},e,o),[a]=o.splice(r,1);return o.splice(s,0,a),Q(o)}function ve(e){return e?j(e)?ve(e.content):typeof e=="string"?e.length===0:Array.isArray(e)?e.every(t=>typeof t=="string"?t.length===0:O(t)?t.text.length===0:Be(t)?typeof t.content=="string"?t.content.length===0:t.content.every(n=>n.text.length===0):!1):!1:!0}function eo(e,t,n=H(e)){if(t==="columns"){let s=0;for(let a=n[0].length-1;a>=0&&n.every(c=>ve(c[a].cell)&&c[a].colspan===1);a--)s++;for(let a=n.length-1;a>=0;a--){const i=Math.max(n[a].length-s,1);n[a]=n[a].slice(0,i)}return Q(n)}let o=0;for(let s=n.length-1;s>=0&&n[s].every(i=>ve(i.cell)&&i.rowspan===1);s--)o++;const r=Math.min(o,n.length-1);return n.splice(n.length-r,r),Q(n)}function to(e,t,n,o=H(e)){const{width:r,height:s}=Ne(e);if(t==="columns")o.forEach((a,i)=>{if(n>=0)for(let c=0;c<n;c++)a.push({row:i,col:Math.max(...a.map(l=>l.col))+1,rowspan:1,colspan:1,cell:ne("")});else a.splice(r+n,-1*n)});else if(n>0)for(let a=0;a<n;a++){const i=new Array(r).fill(null).map((c,l)=>({row:s+a,col:l,rowspan:1,colspan:1,cell:ne("")}));o.push(i)}else n<0&&o.splice(s+n,-1*n);return Q(o)}function no(e,t,n){const o=bt(e,n);if(!o.some(c=>oe(c.cell)>1))return!0;let s=n,a=n;return o.forEach(c=>{const l=oe(c.cell);s=Math.max(s,c.row+l-1),a=Math.min(a,c.row)}),t<n?n===s:n===a}function oo(e,t,n){const o=kt(e,n);if(!o.some(c=>$(c.cell)>1))return!0;let s=n,a=n;return o.forEach(c=>{const l=$(c.cell);s=Math.max(s,c.col+l-1),a=Math.min(a,c.col)}),t<n?n===s:n===a}function ro(e,t,n){const o=_(e,n),r=_(t,n);return o.col===r.col}function qe(e,t,n,o){const r=[];for(const[a,i]of Object.entries(e.styles||{})){const c=n[a];if(!c)throw new Error(`style ${a} not found in styleSchema`);if(c.propSchema==="boolean")i&&r.push(t.mark(a));else if(c.propSchema==="string")i&&r.push(t.mark(a,{stringValue:i}));else throw new z(c.propSchema)}return!o||!t.nodes[o].spec.code?e.text.split(/(\n)/g).filter(a=>a.length>0).map(a=>a===`
|
|
7
|
-
`?t.nodes.hardBreak.createChecked():t.text(a,r)):e.text.length>0?[t.text(e.text,r)]:[]}function so(e,t,n){const o=t.marks.link.create({href:e.href});return Se(e.content,t,n).map(r=>{if(r.type.name==="text")return r.mark([...r.marks,o]);if(r.type.name==="hardBreak")return r;throw new Error("unexpected node type")})}function Se(e,t,n,o){const r=[];if(typeof e=="string")return r.push(...qe({text:e,styles:{}},t,n,o)),r;for(const s of e)r.push(...qe(s,t,n,o));return r}function R(e,t,n,o=V(t)){const r=[];for(const s of e)typeof s=="string"?r.push(...Se(s,t,o,n)):Be(s)?r.push(...so(s,t,o)):O(s)?r.push(...Se([s],t,o,n)):r.push(Ct(s,t,o));return r}function Ie(e,t,n=V(t)){const o=[],r=new Array(e.headerRows??0).fill(!0),s=new Array(e.headerCols??0).fill(!0),a=e.columnWidths??[];for(let i=0;i<e.rows.length;i++){const c=e.rows[i],l=[],d=r[i];for(let p=0;p<c.cells.length;p++){const f=c.cells[p],h=s[p],k=void 0;let g=null;const b=_({row:i,col:p},{content:e});let y=a[b.col]?[a[b.col]]:null;if(f)if(typeof f=="string")g=t.text(f);else if(j(f)){f.content&&(g=R(f.content,t,"tableParagraph",n));const v=$(f);v>1&&(y=new Array(v).fill(!1).map((M,be)=>a[b.col+be]??void 0))}else g=R(f,t,"tableParagraph",n);const m=t.nodes[h||d?"tableHeader":"tableCell"].createChecked({...j(f)?f.props:{},colwidth:y},t.nodes.tableParagraph.createChecked(k,g));l.push(m)}const u=t.nodes.tableRow.createChecked({},l);o.push(u)}return o}function Ct(e,t,n){let o,r=e.type;if(r===void 0&&(r="paragraph"),!t.nodes[r])throw new Error(`node type ${r} not found in schema`);if(!e.content)o=t.nodes[r].createChecked(e.props);else if(typeof e.content=="string"){const s=R([e.content],t,r,n);o=t.nodes[r].createChecked(e.props,s)}else if(Array.isArray(e.content)){const s=R(e.content,t,r,n);o=t.nodes[r].createChecked(e.props,s)}else if(e.content.type==="tableContent"){const s=Ie(e.content,t,n);o=t.nodes[r].createChecked(e.props,s)}else throw new z(e.content.type);return o}function te(e,t,n=V(t)){let o=e.id;o===void 0&&(o=xe.options.generateID());const r=[];if(e.children)for(const a of e.children)r.push(te(a,t,n));if(!e.type||t.nodes[e.type].isInGroup("blockContent")){const a=Ct(e,t,n),i=r.length>0?t.nodes.blockGroup.createChecked({},r):void 0;return t.nodes.blockContainer.createChecked({id:o,...e.props},i?[a,i]:a)}else{if(t.nodes[e.type].isInGroup("bnBlock"))return t.nodes[e.type].createChecked({id:o,...e.props},r);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function yt(e,t){let n,o;if(t.firstChild.descendants((r,s)=>n?!1:!wt(r)||r.attrs.id!==e?!0:(n=r,o=s+1,!1)),!(n===void 0||o===void 0))return{node:n,posBeforeNode:o}}function wt(e){return e.type.isInGroup("bnBlock")}const ao=(e,t)=>({tr:n,dispatch:o})=>(o&&fe(n,e,t),!0);function fe(e,t,n,o,r){const s=it(e.doc.resolve(t));let a=null;s.blockNoteType==="table"&&(a=vt(e));const i=G(e);if(o!==void 0&&r!==void 0&&o>r)throw new Error("Invalid replaceFromPos or replaceToPos");const c=i.nodes[s.blockNoteType],l=i.nodes[n.type||s.blockNoteType],d=l.isInGroup("bnBlock")?l:i.nodes.blockContainer;if(s.isBlockContainer&&l.isInGroup("blockContent")){const u=o!==void 0&&o>s.blockContent.beforePos&&o<s.blockContent.afterPos?o-s.blockContent.beforePos-1:void 0,p=r!==void 0&&r>s.blockContent.beforePos&&r<s.blockContent.afterPos?r-s.blockContent.beforePos-1:void 0;ze(n,e,s),io(n,e,c,l,s,u,p)}else if(!s.isBlockContainer&&l.isInGroup("bnBlock"))ze(n,e,s);else{const u=Z(s.bnBlock.node,i);e.replaceWith(s.bnBlock.beforePos,s.bnBlock.afterPos,te({children:u.children,...n},i));return}e.setNodeMarkup(s.bnBlock.beforePos,d,{...s.bnBlock.node.attrs,...n.props}),a&&lo(e,s,a)}function io(e,t,n,o,r,s,a){const i=G(t);let c="keep";if(e.content)if(typeof e.content=="string")c=R([e.content],i,o.name);else if(Array.isArray(e.content))c=R(e.content,i,o.name);else if(e.content.type==="tableContent")c=Ie(e.content,i);else throw new z(e.content.type);else n.spec.content===""||o.spec.content!==n.spec.content&&(c=[]);if(c==="keep")t.setNodeMarkup(r.blockContent.beforePos,o,{...r.blockContent.node.attrs,...e.props});else if(s!==void 0||a!==void 0){t.setNodeMarkup(r.blockContent.beforePos,o,{...r.blockContent.node.attrs,...e.props});const l=r.blockContent.beforePos+1+(s??0),d=r.blockContent.beforePos+1+(a??r.blockContent.node.content.size),u=t.doc.resolve(r.blockContent.beforePos).depth,p=t.doc.resolve(l).depth,f=t.doc.resolve(d).depth;t.replace(l,d,new B.Slice(B.Fragment.from(c),p-u-1,f-u-1))}else t.replaceWith(r.blockContent.beforePos,r.blockContent.afterPos,o.createChecked({...r.blockContent.node.attrs,...e.props},c))}function ze(e,t,n){const o=G(t);if(e.children!==void 0&&e.children.length>0){const r=e.children.map(s=>te(s,o));if(n.childContainer)t.step(new Ln.ReplaceStep(n.childContainer.beforePos+1,n.childContainer.afterPos-1,new B.Slice(B.Fragment.from(r),0,0)));else{if(!n.isBlockContainer)throw new Error("impossible");t.insert(n.blockContent.afterPos,o.nodes.blockGroup.createChecked({},r))}}}function co(e,t,n,o,r){const s=typeof t=="string"?t:t.id,a=yt(s,e.doc);if(!a)throw new Error(`Block with ID ${s} not found`);fe(e,a.posBeforeNode,n,o,r);const i=e.doc.resolve(a.posBeforeNode+1).node(),c=G(e);return Z(i,c)}function vt(e){const t="selection"in e?e.selection:null;if(!(t instanceof W.TextSelection))return null;const n=e.doc.resolve(t.head);let o=-1,r=-1;for(let g=n.depth;g>=0;g--){const b=n.node(g).type.name;if(o<0&&(b==="tableCell"||b==="tableHeader")&&(o=g),b==="table"){r=g;break}}if(o<0||r<0)return null;const s=n.before(o),a=n.before(r),i=e.doc.nodeAt(a);if(!i||i.type.name!=="table")return null;const c=P.TableMap.get(i),l=s-(a+1),d=c.map.indexOf(l);if(d<0)return null;const u=Math.floor(d/c.width),p=d%c.width,h=s+1+1,k=Math.max(0,t.head-h);return{row:u,col:p,offset:k}}function lo(e,t,n){var g;if(t.blockNoteType!=="table")return!1;let o=-1;if(t.isBlockContainer)o=e.mapping.map(t.blockContent.beforePos);else{const b=e.mapping.map(t.bnBlock.beforePos),y=b+(((g=e.doc.nodeAt(b))==null?void 0:g.nodeSize)||0);e.doc.nodesBetween(b,y,(m,v)=>m.type.name==="table"?(o=v,!1):!0)}const r=o>=0?e.doc.nodeAt(o):null;if(!r||r.type.name!=="table")return!1;const s=P.TableMap.get(r),a=Math.max(0,Math.min(n.row,s.height-1)),i=Math.max(0,Math.min(n.col,s.width-1)),c=a*s.width+i,l=s.map[c];if(l==null)return!1;const u=o+1+l+1,p=e.doc.nodeAt(u),f=u+1,h=p?p.content.size:0,k=f+Math.max(0,Math.min(n.offset,h));return"selection"in e&&e.setSelection(W.TextSelection.create(e.doc,k)),!0}const I={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},uo={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}},C={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},T=e=>{const t={};return e.hasAttribute("data-background-color")?t.backgroundColor=e.getAttribute("data-background-color"):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute("data-text-color")?t.textColor=e.getAttribute("data-text-color"):e.style.color&&(t.textColor=e.style.color),t.textAlignment=C.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},D=(e,t)=>{e.backgroundColor&&e.backgroundColor!==C.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in I?I[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==C.textColor.default&&(t.style.color=e.textColor in I?I[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==C.textAlignment.default&&(t.style.textAlign=e.textAlignment)},po=(e="backgroundColor")=>({default:C.backgroundColor.default,parseHTML:t=>t.hasAttribute("data-background-color")?t.getAttribute("data-background-color"):t.style.backgroundColor?t.style.backgroundColor:C.backgroundColor.default,renderHTML:t=>t[e]===C.backgroundColor.default?{}:{"data-background-color":t[e]}}),fo=(e="textColor")=>({default:C.textColor.default,parseHTML:t=>t.hasAttribute("data-text-color")?t.getAttribute("data-text-color"):t.style.color?t.style.color:C.textColor.default,renderHTML:t=>t[e]===C.textColor.default?{}:{"data-text-color":t[e]}}),ho=(e="textAlignment")=>({default:C.textAlignment.default,parseHTML:t=>t.hasAttribute("data-text-alignment")?t.getAttribute("data-text-alignment"):t.style.textAlign?t.style.textAlign:C.textAlignment.default,renderHTML:t=>t[e]===C.textAlignment.default?{}:{"data-text-alignment":t[e]}}),he=(e,t)=>{const n=e.querySelector(t);if(!n)return;const o=e.querySelector("figcaption"),r=(o==null?void 0:o.textContent)??void 0;return{targetElement:n,caption:r}},go=(e,t,n)=>{const o=document.createElement("div");o.className="bn-add-file-button";const r=document.createElement("div");r.className="bn-add-file-button-icon",n?r.appendChild(n):r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',o.appendChild(r);const s=document.createElement("p");s.className="bn-add-file-button-text",s.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,o.appendChild(s);const a=c=>{c.preventDefault()},i=()=>{t.transact(c=>c.setMeta(t.filePanel.plugins[0],{block:e}))};return o.addEventListener("mousedown",a,!0),o.addEventListener("click",i,!0),{dom:o,destroy:()=>{o.removeEventListener("mousedown",a,!0),o.removeEventListener("click",i,!0)}}},mo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',bo=e=>{const t=document.createElement("div");t.className="bn-file-name-with-icon";const n=document.createElement("div");n.className="bn-file-icon",n.innerHTML=mo,t.appendChild(n);const o=document.createElement("p");return o.className="bn-file-name",o.textContent=e.props.name,t.appendChild(o),{dom:t}},Pe=(e,t,n,o)=>{const r=document.createElement("div");if(r.className="bn-file-block-content-wrapper",e.props.url===""){const a=go(e,t,o);r.appendChild(a.dom);const i=t.onUploadStart(c=>{if(c===e.id){r.removeChild(a.dom);const l=document.createElement("div");l.className="bn-file-loading-preview",l.textContent="Loading...",r.appendChild(l)}});return{dom:r,destroy:()=>{i(),a.destroy()}}}const s={dom:r};if(e.props.showPreview===!1||!n){const a=bo(e);r.appendChild(a.dom),s.destroy=()=>{var i;(i=a.destroy)==null||i.call(a)}}else r.appendChild(n.dom);if(e.props.caption){const a=document.createElement("p");a.className="bn-file-caption",a.textContent=e.props.caption,r.appendChild(a)}return s},Oe=(e,t)=>{const n=document.createElement("figure"),o=document.createElement("figcaption");return o.textContent=t,n.appendChild(e),n.appendChild(o),{dom:n}},ge=(e,t)=>{const n=document.createElement("div"),o=document.createElement("p");return o.textContent=t,n.appendChild(e),n.appendChild(o),{dom:n}},Ee=e=>({url:e.src||void 0}),St='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>',Et=e=>({type:"audio",propSchema:{backgroundColor:C.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},content:"none"}),xt=(e={})=>t=>{if(t.tagName==="AUDIO"){if(t.closest("figure"))return;const{backgroundColor:n}=T(t);return{...Ee(t),backgroundColor:n}}if(t.tagName==="FIGURE"){const n=he(t,"audio");if(!n)return;const{targetElement:o,caption:r}=n,{backgroundColor:s}=T(t);return{...Ee(o),backgroundColor:s,caption:r}}},Bt=(e={})=>(t,n)=>{const o=document.createElement("div");o.innerHTML=e.icon??St;const r=document.createElement("audio");return r.className="bn-audio",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(s=>{r.src=s}):r.src=t.props.url,r.controls=!0,r.contentEditable="false",r.draggable=!1,Pe(t,n,{dom:r},o.firstElementChild)},Tt=(e={})=>(t,n)=>{if(!t.props.url){const r=document.createElement("p");return r.textContent="Add audio",{dom:r}}let o;return t.props.showPreview?(o=document.createElement("audio"),o.src=t.props.url):(o=document.createElement("a"),o.href=t.props.url,o.textContent=t.props.name||t.props.url),t.props.caption?t.props.showPreview?Oe(o,t.props.caption):ge(o,t.props.caption):{dom:o}},Mt=L(Et,e=>({meta:{fileBlockAccept:["audio/*"]},parse:xt(e),render:Bt(e),toExternalHTML:Tt(e),runsBefore:["file"]}));class Lt{constructor(){x(this,"callbacks",{})}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),()=>this.off(t,n)}emit(t,...n){const o=this.callbacks[t];o&&o.forEach(r=>r.apply(this,n))}off(t,n){const o=this.callbacks[t];o&&(n?this.callbacks[t]=o.filter(r=>r!==n):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class At extends Lt{constructor(...n){super();x(this,"plugins",[]);x(this,"inputRules");x(this,"keyboardShortcuts");x(this,"tiptapExtensions")}static key(){throw new Error("You must implement the key method in your extension")}addProsemirrorPlugin(n){this.plugins.push(n)}get priority(){}}function A(e){const t=Object.create(At.prototype);return t.key=e.key,t.inputRules=e.inputRules,t.keyboardShortcuts=e.keyboardShortcuts,t.plugins=e.plugins??[],t.tiptapExtensions=e.tiptapExtensions,t}const Ge=Symbol.for("blocknote.shikiParser"),ke=Symbol.for("blocknote.shikiHighlighterPromise");function ko(e){const t=globalThis;let n,o,r=!1;const s=a=>{if(!e.createHighlighter)return process.env.NODE_ENV==="development"&&!r&&(console.log("For syntax highlighting of code blocks, you must provide a `createCodeBlockSpec({ createHighlighter: () => ... })` function"),r=!0),[];if(!n)return t[ke]=t[ke]||e.createHighlighter(),t[ke].then(c=>{n=c});const i=He(e,a.language);return!i||i==="text"||i==="none"||i==="plaintext"||i==="txt"?[]:n.getLoadedLanguages().includes(i)?(o||(o=t[Ge]||Mn.createParser(n),t[Ge]=o),o(a)):n.loadLanguage(i)};return Tn.createHighlightPlugin({parser:s,languageExtractor:a=>a.attrs.language,nodeTypes:["codeBlock"]})}const Nt=({defaultLanguage:e="text"})=>({type:"codeBlock",propSchema:{language:{default:e}},content:"inline"}),It=L(Nt,e=>({meta:{code:!0,defining:!0,isolating:!1},parse:t=>{var r,s;if(t.tagName!=="PRE"||t.childElementCount!==1||((r=t.firstElementChild)==null?void 0:r.tagName)!=="CODE")return;const n=t.firstElementChild;return{language:n.getAttribute("data-language")||((s=n.className.split(" ").find(a=>a.includes("language-")))==null?void 0:s.replace("language-",""))}},parseContent:({el:t,schema:n})=>{const o=B.DOMParser.fromSchema(n),r=t.firstElementChild;return o.parse(r,{topNode:n.nodes.codeBlock.create()}).content},render(t,n){const o=document.createDocumentFragment(),r=document.createElement("pre"),s=document.createElement("code");r.appendChild(s);let a;if(e.supportedLanguages){const i=document.createElement("select"),c=d=>{const u=d.target.value;n.updateBlock(t.id,{props:{language:u}})};i.addEventListener("change",c);const l=document.createElement("div");l.contentEditable="false",i.value=t.props.language||e.defaultLanguage||"text",Object.entries(e.supportedLanguages??{}).forEach(([d,{name:u}])=>{const p=document.createElement("option");p.value=d,p.text=u,i.appendChild(p)}),l.appendChild(i),o.appendChild(l),a=()=>i.removeEventListener("change",c)}return o.appendChild(r),{dom:o,contentDOM:s,destroy:()=>{a==null||a()}}},toExternalHTML(t){const n=document.createElement("pre"),o=document.createElement("code");return o.className=`language-${t.props.language}`,o.dataset.language=t.props.language,n.appendChild(o),{dom:n,contentDOM:o}}}),e=>[A({key:"code-block-highlighter",plugins:[ko(e)]}),A({key:"code-block-keyboard-shortcuts",keyboardShortcuts:{Delete:({editor:t})=>t.transact(n=>{const{block:o}=t.getTextCursorPosition();if(o.type!=="codeBlock")return!1;const{$from:r}=n.selection;return r.parent.textContent?!1:(t.removeBlocks([o]),!0)}),Tab:({editor:t})=>e.indentLineWithTab===!1?!1:t.transact(n=>{const{block:o}=t.getTextCursorPosition();return o.type==="codeBlock"?(n.insertText(" "),!0):!1}),Enter:({editor:t})=>t.transact(n=>{const{block:o,nextBlock:r}=t.getTextCursorPosition();if(o.type!=="codeBlock")return!1;const{$from:s}=n.selection,a=s.parentOffset===s.parent.nodeSize-2,i=s.parent.textContent.endsWith(`
|
|
8
|
-
|
|
9
|
-
`);if(a&&i){if(n.delete(s.pos-2,s.pos),r)return t.setTextCursorPosition(r,"start"),!0;const[c]=t.insertBlocks([{type:"paragraph"}],o,"after");return t.setTextCursorPosition(c,"start"),!0}return n.insertText(`
|
|
10
|
-
`),!0}),"Shift-Enter":({editor:t})=>t.transact(()=>{const{block:n}=t.getTextCursorPosition();if(n.type!=="codeBlock")return!1;const[o]=t.insertBlocks([{type:"paragraph"}],n,"after");return t.setTextCursorPosition(o,"start"),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{const n=t[1].trim();return{type:"codeBlock",props:{language:{language:He(e,n)??n}.language},content:[]}}}]})]);function He(e,t){var n;return(n=Object.entries(e.supportedLanguages??{}).find(([o,{aliases:r}])=>(r==null?void 0:r.includes(t))||o===t))==null?void 0:n[0]}const Ze=e=>({url:e.src||void 0}),Pt=()=>({type:"file",propSchema:{backgroundColor:C.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},content:"none"}),Ot=()=>e=>{if(e.tagName==="EMBED"){if(e.closest("figure"))return;const{backgroundColor:t}=T(e);return{...Ze(e),backgroundColor:t}}if(e.tagName==="FIGURE"){const t=he(e,"embed");if(!t)return;const{targetElement:n,caption:o}=t,{backgroundColor:r}=T(e);return{...Ze(n),backgroundColor:r,caption:o}}},Ht=L(Pt,{meta:{fileBlockAccept:["*/*"]},parse:Ot(),render(e,t){return Pe(e,t)},toExternalHTML(e){if(!e.props.url){const n=document.createElement("p");return n.textContent="Add file",{dom:n}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?ge(t,e.props.caption):{dom:t}}}),Dt={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?"true":"false"),get:e=>window.localStorage.getItem(`toggle-${e.id}`)==="true"},De=(e,t,n,o=Dt)=>{if(!("isToggleable"in e.props)||!e.props.isToggleable)return{dom:n};const r=document.createElement("div"),s=document.createElement("div");s.className="bn-toggle-wrapper";const a=document.createElement("button");a.className="bn-toggle-button",a.type="button",a.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>';const i=h=>h.preventDefault();a.addEventListener("mousedown",i);const c=()=>{var h;s.getAttribute("data-show-children")==="true"?(s.setAttribute("data-show-children","false"),o.set(t.getBlock(e),!1),r.contains(l)&&r.removeChild(l)):(s.setAttribute("data-show-children","true"),o.set(t.getBlock(e),!0),((h=t.getBlock(e))==null?void 0:h.children.length)===0&&!r.contains(l)&&r.appendChild(l))};a.addEventListener("click",c),s.appendChild(a),s.appendChild(n);const l=document.createElement("button");l.className="bn-toggle-add-block-button",l.type="button",l.textContent=t.dictionary.toggle_blocks.add_block_button;const d=h=>h.preventDefault();l.addEventListener("mousedown",d);const u=()=>{t.transact(()=>{const h=t.updateBlock(e,{children:[{}]});t.setTextCursorPosition(h.children[0].id,"end"),t.focus()})};l.addEventListener("click",u),r.appendChild(s);let p=e.children.length;const f=t.onChange(()=>{var k;const h=((k=t.getBlock(e))==null?void 0:k.children.length)??0;h>p?(s.getAttribute("data-show-children")==="false"&&(s.setAttribute("data-show-children","true"),o.set(t.getBlock(e),!0)),r.contains(l)&&r.removeChild(l)):h===0&&h<p&&(s.getAttribute("data-show-children")==="true"&&(s.setAttribute("data-show-children","false"),o.set(t.getBlock(e),!1)),r.contains(l)&&r.removeChild(l)),p=h});return o.get(e)?(s.setAttribute("data-show-children","true"),e.children.length===0&&r.appendChild(l)):s.setAttribute("data-show-children","false"),{dom:r,ignoreMutation:h=>h instanceof MutationRecord&&(h.type==="attributes"&&h.target===s&&h.attributeName==="data-show-children"||h.type==="childList"&&(h.addedNodes[0]===l||h.removedNodes[0]===l)),destroy:()=>{a.removeEventListener("mousedown",i),a.removeEventListener("click",c),l.removeEventListener("mousedown",d),l.removeEventListener("click",u),f==null||f()}}},_t=[1,2,3,4,5,6],Rt=({defaultLevel:e=1,levels:t=_t,allowToggleHeadings:n=!0}={})=>({type:"heading",propSchema:{...C,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:"inline"}),Vt=L(Rt,({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1},parse(t){let n;switch(t.tagName){case"H1":n=1;break;case"H2":n=2;break;case"H3":n=3;break;case"H4":n=4;break;case"H5":n=5;break;case"H6":n=6;break;default:return}return{...T(t),level:n}},render(t,n){const o=document.createElement(`h${t.props.level}`);return e?{...De(t,n,o),contentDOM:o}:{dom:o,contentDOM:o}},toExternalHTML(t){const n=document.createElement(`h${t.props.level}`);return D(t.props,n),{dom:n,contentDOM:n}}}),({levels:e=_t}={})=>[A({key:"heading-shortcuts",keyboardShortcuts:Object.fromEntries(e.map(t=>[`Mod-Alt-${t}`,({editor:n})=>{const o=n.getTextCursorPosition();return n.schema.blockSchema[o.block.type].content!=="inline"?!1:(n.updateBlock(o.block,{type:"heading",props:{level:t}}),!0)}])??[]),inputRules:e.map(t=>({find:new RegExp(`^(#{${t}})\\s$`),replace({match:n}){return{type:"heading",props:{level:n[1].length}}}}))})]),Ft=(e,t,n,o,r)=>{const{dom:s,destroy:a}=Pe(e,t,n,r),i=s;i.style.position="relative",e.props.url&&e.props.showPreview&&(e.props.previewWidth?i.style.width=`${e.props.previewWidth}px`:i.style.width="fit-content");const c=document.createElement("div");c.className="bn-resize-handle",c.style.left="4px";const l=document.createElement("div");l.className="bn-resize-handle",l.style.right="4px";const d=document.createElement("div");d.style.position="absolute",d.style.height="100%",d.style.width="100%";let u,p=e.props.previewWidth;const f=m=>{var X,J;if(!u){!t.isEditable&&o.contains(c)&&o.contains(l)&&(o.removeChild(c),o.removeChild(l));return}let v;const M="touches"in m?m.touches[0].clientX:m.clientX;e.props.textAlignment==="center"?u.handleUsed==="left"?v=u.initialWidth+(u.initialClientX-M)*2:v=u.initialWidth+(M-u.initialClientX)*2:u.handleUsed==="left"?v=u.initialWidth+u.initialClientX-M:v=u.initialWidth+M-u.initialClientX,p=Math.min(Math.max(v,64),((J=(X=t.domElement)==null?void 0:X.firstElementChild)==null?void 0:J.clientWidth)||Number.MAX_VALUE),i.style.width=`${p}px`},h=m=>{(!m.target||!i.contains(m.target)||!t.isEditable)&&o.contains(c)&&o.contains(l)&&(o.removeChild(c),o.removeChild(l)),u&&(u=void 0,i.contains(d)&&i.removeChild(d),t.updateBlock(e,{props:{previewWidth:p}}))},k=()=>{t.isEditable&&(o.appendChild(c),o.appendChild(l))},g=m=>{m.relatedTarget===c||m.relatedTarget===l||u||t.isEditable&&o.contains(c)&&o.contains(l)&&(o.removeChild(c),o.removeChild(l))},b=m=>{m.preventDefault(),i.contains(d)||i.appendChild(d);const v="touches"in m?m.touches[0].clientX:m.clientX;u={handleUsed:"left",initialWidth:i.clientWidth,initialClientX:v}},y=m=>{m.preventDefault(),i.contains(d)||i.appendChild(d);const v="touches"in m?m.touches[0].clientX:m.clientX;u={handleUsed:"right",initialWidth:i.clientWidth,initialClientX:v}};return window.addEventListener("mousemove",f),window.addEventListener("touchmove",f),window.addEventListener("mouseup",h),window.addEventListener("touchend",h),i.addEventListener("mouseenter",k),i.addEventListener("mouseleave",g),c.addEventListener("mousedown",b),c.addEventListener("touchstart",b),l.addEventListener("mousedown",y),l.addEventListener("touchstart",y),{dom:i,destroy:()=>{a==null||a(),window.removeEventListener("mousemove",f),window.removeEventListener("touchmove",f),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h),i.removeEventListener("mouseenter",k),i.removeEventListener("mouseleave",g),c.removeEventListener("mousedown",b),c.removeEventListener("touchstart",b),l.removeEventListener("mousedown",y),l.removeEventListener("touchstart",y)}}},Xe=e=>{const t=e.src||void 0,n=e.width||void 0,o=e.alt||void 0;return{url:t,previewWidth:n,name:o}},Wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>',jt=(e={})=>({type:"image",propSchema:{textAlignment:C.textAlignment,backgroundColor:C.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:void 0,type:"number"}},content:"none"}),$t=(e={})=>t=>{if(t.tagName==="IMG"){if(t.closest("figure"))return;const{backgroundColor:n}=T(t);return{...Xe(t),backgroundColor:n}}if(t.tagName==="FIGURE"){const n=he(t,"img");if(!n)return;const{targetElement:o,caption:r}=n,{backgroundColor:s}=T(t);return{...Xe(o),backgroundColor:s,caption:r}}},Ut=(e={})=>(t,n)=>{const o=document.createElement("div");o.innerHTML=e.icon??Wt;const r=document.createElement("div");r.className="bn-visual-media-wrapper";const s=document.createElement("img");return s.className="bn-visual-media",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(a=>{s.src=a}):s.src=t.props.url,s.alt=t.props.name||t.props.caption||"BlockNote image",s.contentEditable="false",s.draggable=!1,r.appendChild(s),Ft(t,n,{dom:r},r,o.firstElementChild)},qt=(e={})=>(t,n)=>{if(!t.props.url){const r=document.createElement("p");return r.textContent="Add image",{dom:r}}let o;return t.props.showPreview?(o=document.createElement("img"),o.src=t.props.url,o.alt=t.props.name||t.props.caption||"BlockNote image",t.props.previewWidth&&(o.width=t.props.previewWidth)):(o=document.createElement("a"),o.href=t.props.url,o.textContent=t.props.name||t.props.url),t.props.caption?t.props.showPreview?Oe(o,t.props.caption):ge(o,t.props.caption):{dom:o}},zt=L(jt,e=>({meta:{fileBlockAccept:["image/*"]},parse:$t(e),render:Ut(e),toExternalHTML:qt(e),runsBefore:["file"]})),Co=(e,t,n)=>({state:o,dispatch:r})=>r?Gt(o.tr,e,t,n):!0,Gt=(e,t,n,o)=>{const r=ae(e.doc,t),s=q(r);if(!s.isBlockContainer)return!1;const a=G(e),i=[{type:s.bnBlock.node.type,attrs:o?{...s.bnBlock.node.attrs,id:void 0}:{}},{type:n?s.blockContent.node.type:a.nodes.paragraph,attrs:o?{...s.blockContent.node.attrs}:{}}];return e.split(t,2,i),!0},me=(e,t)=>{const{blockInfo:n,selectionEmpty:o}=e.transact(a=>({blockInfo:ct(a),selectionEmpty:a.selection.anchor===a.selection.head}));if(!n.isBlockContainer)return!1;const{bnBlock:r,blockContent:s}=n;return s.node.type.name!==t||!o?!1:s.node.childCount===0?(e.transact(a=>{fe(a,r.beforePos,{type:"paragraph",props:{}})}),!0):s.node.childCount>0?e.transact(a=>(a.deleteSelection(),Gt(a,a.selection.from,!0))):!1};function _e(e,t,n){var u,p,f;const o=B.DOMParser.fromSchema(t),r=e,s=document.createElement("div");s.setAttribute("data-node-type","blockGroup");for(const h of Array.from(r.childNodes))s.appendChild(h.cloneNode(!0));let a=o.parse(s,{topNode:t.nodes.blockGroup.create()});((p=(u=a.firstChild)==null?void 0:u.firstChild)==null?void 0:p.type.name)==="checkListItem"&&(a=a.copy(a.content.cut(a.firstChild.firstChild.nodeSize+2)));const i=(f=a.firstChild)==null?void 0:f.firstChild;if(!(i!=null&&i.isTextblock))return B.Fragment.from(a);const c=t.nodes[n].create({},i.content),l=a.content.cut(i.nodeSize+2);if(l.size>0){const h=a.copy(l);return c.content.addToEnd(h)}return c.content}const Zt=()=>({type:"bulletListItem",propSchema:{...C},content:"inline"}),Xt=L(Zt,{meta:{isolating:!1},parse(e){var n;if(e.tagName!=="LI")return;const t=e.parentElement;if(t!==null&&(t.tagName==="UL"||t.tagName==="DIV"&&((n=t.parentElement)==null?void 0:n.tagName)==="UL"))return T(e)},parseContent:({el:e,schema:t})=>_e(e,t,"bulletListItem"),render(){const e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML(e){const t=document.createElement("li"),n=document.createElement("p");return D(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[A({key:"bullet-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>me(e,"bulletListItem"),"Mod-Shift-8":({editor:e})=>{const t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content!=="inline"?!1:(e.updateBlock(t.block,{type:"bulletListItem",props:{}}),!0)}},inputRules:[{find:new RegExp("^[-+*]\\s$"),replace(){return{type:"bulletListItem",props:{}}}}]})]),Jt=()=>({type:"checkListItem",propSchema:{...C,checked:{default:!1,type:"boolean"}},content:"inline"}),Kt=L(Jt,{meta:{isolating:!1},parse(e){var n;if(e.tagName==="input")return e.closest("[data-content-type]")||e.closest("li")?void 0:e.type==="checkbox"?{checked:e.checked}:void 0;if(e.tagName!=="LI")return;const t=e.parentElement;if(t!==null&&(t.tagName==="UL"||t.tagName==="DIV"&&((n=t.parentElement)==null?void 0:n.tagName)==="UL")){const o=e.querySelector("input[type=checkbox]")||null;return o===null?void 0:{...T(e),checked:o.checked}}},parseContent:({el:e,schema:t})=>_e(e,t,"checkListItem"),render(e,t){const n=document.createDocumentFragment(),o=document.createElement("input");o.type="checkbox",o.checked=e.props.checked,e.props.checked&&o.setAttribute("checked",""),o.addEventListener("change",()=>{t.updateBlock(e,{props:{checked:!e.props.checked}})});const r=document.createElement("p");return n.appendChild(o),n.appendChild(r),{dom:n,contentDOM:r}},toExternalHTML(e){const t=document.createElement("li"),n=document.createElement("input");n.type="checkbox",n.checked=e.props.checked,e.props.checked&&n.setAttribute("checked","");const o=document.createElement("p");return D(e.props,t),t.appendChild(n),t.appendChild(o),{dom:t,contentDOM:o}},runsBefore:["bulletListItem"]},[A({key:"check-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>me(e,"checkListItem"),"Mod-Shift-9":({editor:e})=>{const t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content!=="inline"?!1:(e.updateBlock(t.block,{type:"checkListItem",props:{}}),!0)}},inputRules:[{find:new RegExp("\\[\\s*\\]\\s$"),replace(){return{type:"checkListItem",props:{checked:!1},content:[]}}},{find:new RegExp("\\[[Xx]\\]\\s$"),replace(){return{type:"checkListItem",props:{checked:!0}}}}]})]);function Yt(e,t,n,o){let r=e.firstChild.attrs.start||1,s=!0;const a=!!e.firstChild.attrs.start,i=q({posBeforeNode:t,node:e});if(!i.isBlockContainer)throw new Error("impossible");const c=n.doc.resolve(i.bnBlock.beforePos).nodeBefore,l=c?o.get(c):void 0;return l!==void 0?(r=l+1,s=!1):c&&q({posBeforeNode:i.bnBlock.beforePos-c.nodeSize,node:c}).blockNoteType==="numberedListItem"&&(r=Yt(c,i.bnBlock.beforePos-c.nodeSize,n,o).index+1,s=!1),o.set(e,r),{index:r,isFirst:s,hasStart:a}}function Je(e,t){const n=new Map,o=t.decorations.map(e.mapping,e.doc),r=[];e.doc.nodesBetween(0,e.doc.nodeSize-2,(a,i)=>{if(a.type.name==="blockContainer"&&a.firstChild.type.name==="numberedListItem"){const{index:c,isFirst:l,hasStart:d}=Yt(a,i,e,n);o.find(i,i+a.nodeSize,p=>p.index===c&&p.isFirst===l&&p.hasStart===d).length===0&&r.push(Ce.Decoration.node(i+1,i+a.nodeSize-1,{"data-index":c.toString()}))}});const s=r.flatMap(a=>o.find(a.from,a.to));return{decorations:o.remove(s).add(e.doc,r)}}const yo=()=>new W.Plugin({key:new W.PluginKey("numbered-list-indexing-decorations"),state:{init(e,t){return Je(t.tr,{decorations:Ce.DecorationSet.empty})},apply(e,t){return!e.docChanged&&!e.selectionSet&&t.decorations?t:Je(e,t)}},props:{decorations(e){var t;return((t=this.getState(e))==null?void 0:t.decorations)??Ce.DecorationSet.empty}}}),Qt=()=>({type:"numberedListItem",propSchema:{...C,start:{default:void 0,type:"number"}},content:"inline"}),en=L(Qt,{meta:{isolating:!1},parse(e){var n;if(e.tagName!=="LI")return;const t=e.parentElement;if(t!==null&&(t.tagName==="OL"||t.tagName==="DIV"&&((n=t.parentElement)==null?void 0:n.tagName)==="OL")){const o=parseInt(t.getAttribute("start")||"1"),r=T(e);return e.previousElementSibling||o===1?r:{...r,start:o}}},parseContent:({el:e,schema:t})=>_e(e,t,"numberedListItem"),render(){const e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML(e){const t=document.createElement("li"),n=document.createElement("p");return D(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[A({key:"numbered-list-item-shortcuts",inputRules:[{find:new RegExp("^(\\d+)\\.\\s$"),replace({match:e}){const t=parseInt(e[1]);return{type:"numberedListItem",props:{start:t!==1?t:void 0}}}}],keyboardShortcuts:{Enter:({editor:e})=>me(e,"numberedListItem"),"Mod-Shift-7":({editor:e})=>{const t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content!=="inline"?!1:(e.updateBlock(t.block,{type:"numberedListItem",props:{}}),!0)}},plugins:[yo()]})]),tn=()=>({type:"toggleListItem",propSchema:{...C},content:"inline"}),nn=L(tn,{meta:{isolating:!1},render(e,t){const n=document.createElement("p");return{...De(e,t,n),contentDOM:n}},toExternalHTML(e){const t=document.createElement("li"),n=document.createElement("p");return D(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[A({key:"toggle-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>me(e,"toggleListItem"),"Mod-Shift-6":({editor:e})=>{const t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content!=="inline"?!1:(e.updateBlock(t.block,{type:"toggleListItem",props:{}}),!0)}}})]),on=()=>({type:"pageBreak",propSchema:{},content:"none"}),rn=L(on,{parse(e){if(e.tagName==="DIV"&&e.hasAttribute("data-page-break"))return{}},render(){const e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}},toExternalHTML(){const e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}}}),wo=e=>e.extend({blockSpecs:{pageBreak:rn()}}),sn=()=>({type:"paragraph",propSchema:C,content:"inline"}),an=L(sn,{meta:{isolating:!1},parse:e=>{var t;if(e.tagName==="P"&&(t=e.textContent)!=null&&t.trim())return T(e)},render:()=>{const e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML:e=>{const t=document.createElement("p");return D(e.props,t),{dom:t,contentDOM:t}},runsBefore:["default"]},[A({key:"paragraph-shortcuts",keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{const t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content!=="inline"?!1:(e.updateBlock(t.block,{type:"paragraph",props:{}}),!0)}}})]),cn=()=>({type:"quote",propSchema:{backgroundColor:C.backgroundColor,textColor:C.textColor},content:"inline"}),ln=L(cn,{meta:{isolating:!1},parse(e){if(e.tagName==="BLOCKQUOTE"){const{backgroundColor:t,textColor:n}=T(e);return{backgroundColor:t,textColor:n}}},render(){const e=document.createElement("blockquote");return{dom:e,contentDOM:e}},toExternalHTML(e){const t=document.createElement("blockquote");return D(e.props,t),{dom:t,contentDOM:t}}},[A({key:"quote-block-shortcuts",keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{const t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content!=="inline"?!1:(e.updateBlock(t.block,{type:"quote",props:{}}),!0)}},inputRules:[{find:new RegExp("^>\\s$"),replace(){return{type:"quote",props:{}}}}]})]),vo=35,Re=120,So=31,Eo=E.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[P.columnResizing({cellMinWidth:vo,defaultCellMinWidth:Re,View:null}),P.tableEditing()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name==="tableParagraph"?(this.editor.commands.insertContent({type:"hardBreak"}),!0):!1,Backspace:()=>{const e=this.editor.state.selection,t=e.empty,n=e.$head.parentOffset===0,o=e.$head.node().type.name==="tableParagraph";return t&&n&&o},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>P.goToNextCell(1)(e,t,n)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>P.goToNextCell(-1)(e,t,n))}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:E.callOrReturn(E.getExtensionField(e,"tableRole",t))}}}),un={textColor:C.textColor},xo=E.Node.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"tableContent+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(o=>parseInt(o,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getContent:(e,t)=>dn(e,t)}]},renderHTML({HTMLAttributes:e}){return["th",E.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Bo=E.Node.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"tableContent+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(o=>parseInt(o,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getContent:(e,t)=>dn(e,t)}]},renderHTML({HTMLAttributes:e}){return["td",E.mergeAttributes(this.options.HTMLAttributes,e),0]}}),To=E.Node.create({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",marks:"deletion insertion modification",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){var r,s,a;const n=Qe(this.name,"table",{...((r=this.options.domAttributes)==null?void 0:r.blockContent)||{},...t},((s=this.options.domAttributes)==null?void 0:s.inlineContent)||{}),o=document.createElement("colgroup");for(const i of e.children[0].children)if(i.attrs.colwidth)for(const l of i.attrs.colwidth){const d=document.createElement("col");l&&(d.style=`width: ${l}px`),o.appendChild(d)}else o.appendChild(document.createElement("col"));return(a=n.dom.firstChild)==null||a.appendChild(o),n},addNodeView(){return({node:e,HTMLAttributes:t})=>{var o;class n extends P.TableView{constructor(s,a,i){super(s,a),this.node=s,this.cellMinWidth=a,this.blockContentHTMLAttributes=i;const c=document.createElement("div");c.className=U("bn-block-content",i.class),c.setAttribute("data-content-type","table");for(const[p,f]of Object.entries(i))p!=="class"&&c.setAttribute(p,f);const l=this.dom,d=document.createElement("div");d.className="tableWrapper-inner",d.appendChild(l.firstChild),l.appendChild(d),c.appendChild(l);const u=document.createElement("div");u.className="table-widgets-container",u.style.position="relative",l.appendChild(u),this.dom=c}ignoreMutation(s){return!s.target.closest(".tableWrapper-inner")||super.ignoreMutation(s)}}return new n(e,Re,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t})}}}),Mo=E.Node.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{tag:"p",getAttrs:e=>{if(typeof e=="string"||!e.textContent||!e.closest("[data-content-type]"))return!1;const t=e.parentElement;return t===null?!1:t.tagName==="TD"||t.tagName==="TH"?{}:!1},node:"tableParagraph"}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),Lo=E.Node.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)+",tableRole:"row",marks:"deletion insertion modification",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",E.mergeAttributes(this.options.HTMLAttributes,e),0]}});function dn(e,t){const o=B.DOMParser.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return o.content.descendants(s=>{if(s.isInline)return r.push(s),!1}),B.Fragment.fromArray(r)}const pn=()=>ot({node:To,type:"table",content:"table"},un,[A({key:"table-extensions",tiptapExtensions:[Eo,Mo,xo,Bo,Lo]})]),Ke=e=>{const t=e.src||void 0,n=e.width||void 0;return{url:t,previewWidth:n}},fn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>',hn=e=>({type:"video",propSchema:{textAlignment:C.textAlignment,backgroundColor:C.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:void 0,type:"number"}},content:"none"}),gn=e=>t=>{if(t.tagName==="VIDEO"){if(t.closest("figure"))return;const{backgroundColor:n}=T(t);return{...Ke(t),backgroundColor:n}}if(t.tagName==="FIGURE"){const n=he(t,"video");if(!n)return;const{targetElement:o,caption:r}=n,{backgroundColor:s}=T(t);return{...Ke(o),backgroundColor:s,caption:r}}},mn=L(hn,e=>({meta:{fileBlockAccept:["video/*"]},parse:gn(),render(t,n){const o=document.createElement("div");o.innerHTML=e.icon??fn;const r=document.createElement("div");r.className="bn-visual-media-wrapper";const s=document.createElement("video");return s.className="bn-visual-media",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(a=>{s.src=a}):s.src=t.props.url,s.controls=!0,s.contentEditable="false",s.draggable=!1,s.width=t.props.previewWidth,r.appendChild(s),Ft(t,n,{dom:r},r,o.firstElementChild)},toExternalHTML(t){if(!t.props.url){const o=document.createElement("p");return o.textContent="Add video",{dom:o}}let n;return t.props.showPreview?(n=document.createElement("video"),n.src=t.props.url,t.props.previewWidth&&(n.width=t.props.previewWidth)):(n=document.createElement("a"),n.href=t.props.url,n.textContent=t.props.name||t.props.url),t.props.caption?t.props.showPreview?Oe(n,t.props.caption):ge(n,t.props.caption):{dom:n}},runsBefore:["file"]})),Ao=async e=>{const t=new FormData;return t.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:t})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")};function S(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(const[o,r]of Object.entries(n)){if(!(o in e.schema.blockSpecs[t].config.propSchema))return!1;if(typeof r=="string"){if(e.schema.blockSpecs[t].config.propSchema[o].default&&typeof e.schema.blockSpecs[t].config.propSchema[o].default!==r||e.schema.blockSpecs[t].config.propSchema[o].type&&e.schema.blockSpecs[t].config.propSchema[o].type!==r)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[o].default!==r.default||e.schema.blockSpecs[t].config.propSchema[o].default===void 0&&r.default===void 0&&e.schema.blockSpecs[t].config.propSchema[o].type!==r.type||typeof e.schema.blockSpecs[t].config.propSchema[o].values!=typeof r.values)return!1;if(typeof e.schema.blockSpecs[t].config.propSchema[o].values=="object"&&typeof r.values=="object"){if(e.schema.blockSpecs[t].config.propSchema[o].values.length!==r.values.length)return!1;for(let s=0;s<e.schema.blockSpecs[t].config.propSchema[o].values.length;s++)if(e.schema.blockSpecs[t].config.propSchema[o].values[s]!==r.values[s])return!1}}}return!0}function No(e,t,n,o){return S(t,n,o)&&e.type===n}function Io(e){return e instanceof P.CellSelection}function Po(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;n==="none";){if(t=e.getTextCursorPosition().nextBlock,t===void 0)return;n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}}function w(e,t){const n=e.getTextCursorPosition().block;if(n.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let o;return Array.isArray(n.content)&&(n.content.length===1&&O(n.content[0])&&n.content[0].type==="text"&&n.content[0].text==="/"||n.content.length===0)?(o=e.updateBlock(n,t),e.setTextCursorPosition(o)):(o=e.insertBlocks([t],n,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),Po(e),o}function Oo(e){const t=[];return S(e,"heading",{level:"number"})&&t.push({onItemClick:()=>{w(e,{type:"heading",props:{level:1}})},badge:N("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{w(e,{type:"heading",props:{level:2}})},badge:N("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{w(e,{type:"heading",props:{level:3}})},badge:N("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),S(e,"quote")&&t.push({onItemClick:()=>{w(e,{type:"quote"})},key:"quote",...e.dictionary.slash_menu.quote}),S(e,"toggleListItem")&&t.push({onItemClick:()=>{w(e,{type:"toggleListItem"})},badge:N("Mod-Shift-6"),key:"toggle_list",...e.dictionary.slash_menu.toggle_list}),S(e,"numberedListItem")&&t.push({onItemClick:()=>{w(e,{type:"numberedListItem"})},badge:N("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),S(e,"bulletListItem")&&t.push({onItemClick:()=>{w(e,{type:"bulletListItem"})},badge:N("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),S(e,"checkListItem")&&t.push({onItemClick:()=>{w(e,{type:"checkListItem"})},badge:N("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),S(e,"paragraph")&&t.push({onItemClick:()=>{w(e,{type:"paragraph"})},badge:N("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),S(e,"codeBlock")&&t.push({onItemClick:()=>{w(e,{type:"codeBlock"})},badge:N("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),S(e,"table")&&t.push({onItemClick:()=>{w(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),S(e,"image",{url:"string"})&&t.push({onItemClick:()=>{const n=w(e,{type:"image"});e.transact(o=>o.setMeta(e.filePanel.plugins[0],{block:n}))},key:"image",...e.dictionary.slash_menu.image}),S(e,"video",{url:"string"})&&t.push({onItemClick:()=>{const n=w(e,{type:"video"});e.transact(o=>o.setMeta(e.filePanel.plugins[0],{block:n}))},key:"video",...e.dictionary.slash_menu.video}),S(e,"audio",{url:"string"})&&t.push({onItemClick:()=>{const n=w(e,{type:"audio"});e.transact(o=>o.setMeta(e.filePanel.plugins[0],{block:n}))},key:"audio",...e.dictionary.slash_menu.audio}),S(e,"file",{url:"string"})&&t.push({onItemClick:()=>{const n=w(e,{type:"file"});e.transact(o=>o.setMeta(e.filePanel.plugins[0],{block:n}))},key:"file",...e.dictionary.slash_menu.file}),S(e,"heading",{level:"number",isToggleable:"boolean"})&&t.push({onItemClick:()=>{w(e,{type:"heading",props:{level:1,isToggleable:!0}})},key:"toggle_heading",...e.dictionary.slash_menu.toggle_heading},{onItemClick:()=>{w(e,{type:"heading",props:{level:2,isToggleable:!0}})},key:"toggle_heading_2",...e.dictionary.slash_menu.toggle_heading_2},{onItemClick:()=>{w(e,{type:"heading",props:{level:3,isToggleable:!0}})},key:"toggle_heading_3",...e.dictionary.slash_menu.toggle_heading_3}),S(e,"heading",{level:"number"})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(n=>n>3).forEach(n=>{t.push({onItemClick:()=>{w(e,{type:"heading",props:{level:n}})},key:`heading_${n}`,...e.dictionary.slash_menu[`heading_${n}`]})}),t.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function Ho(e,t){return e.filter(({title:n,aliases:o})=>n.toLowerCase().includes(t.toLowerCase())||o&&o.filter(r=>r.toLowerCase().includes(t.toLowerCase())).length!==0)}function bn(e){return"pageBreak"in e.schema.blockSchema}function Do(e){const t=[];return bn(e)&&t.push({...e.dictionary.slash_menu.page_break,onItemClick:()=>{w(e,{type:"pageBreak"})},key:"page_break"}),t}const kn={audio:Mt(),bulletListItem:Xt(),checkListItem:Kt(),codeBlock:It(),file:Ht(),heading:Vt(),image:zt(),numberedListItem:en(),paragraph:an(),quote:ln(),table:pn(),toggleListItem:nn(),video:mn()},_o=Ae({type:"textColor",propSchema:"string"},{render:()=>{const e=document.createElement("span");return{dom:e,contentDOM:e}},toExternalHTML:e=>{const t=document.createElement("span");return e!==C.textColor.default&&(t.style.color=e in I?I[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName==="SPAN"&&e.style.color)return e.style.color}}),Ro=Ae({type:"backgroundColor",propSchema:"string"},{render:()=>{const e=document.createElement("span");return{dom:e,contentDOM:e}},toExternalHTML:e=>{const t=document.createElement("span");return e!==C.backgroundColor.default&&(t.style.backgroundColor=e in I?I[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName==="SPAN"&&e.style.backgroundColor)return e.style.backgroundColor}}),Ve={bold:F(An.default,"boolean"),italic:F(In.default,"boolean"),underline:F(On.default,"boolean"),strike:F(Pn.default,"boolean"),code:F(Nn.default,"boolean"),textColor:_o,backgroundColor:Ro},Vo=Le(Ve),Fe={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},Fo=Te(Fe);class We extends gt{static create(t){return new We({blockSpecs:(t==null?void 0:t.blockSpecs)??kn,inlineContentSpecs:(t==null?void 0:t.inlineContentSpecs)??Fe,styleSpecs:(t==null?void 0:t.styleSpecs)??Ve})}}exports.BlockNoteExtension=At;exports.BlockNoteSchema=We;exports.COLORS_DARK_MODE_DEFAULT=uo;exports.COLORS_DEFAULT=I;exports.CustomBlockNoteSchema=gt;exports.EMPTY_CELL_HEIGHT=So;exports.EMPTY_CELL_WIDTH=Re;exports.EventEmitter=Lt;exports.FILE_AUDIO_ICON_SVG=St;exports.FILE_IMAGE_ICON_SVG=Wt;exports.FILE_VIDEO_ICON_SVG=fn;exports.UniqueID=xe;exports.UnreachableCaseError=z;exports.addDefaultPropsExternalHTML=D;exports.addInlineContentAttributes=Un;exports.addInlineContentKeyboardShortcuts=qn;exports.addNodeAndExtensionsToSpec=at;exports.addRowsOrColumns=to;exports.addStyleAttributes=K;exports.applyNonSelectableBlockFix=rt;exports.areInSameColumn=ro;exports.assertEmpty=_n;exports.audioParse=xt;exports.audioRender=Bt;exports.audioToExternalHTML=Tt;exports.blockHasType=No;exports.blockToNode=te;exports.camelToDataKebab=Y;exports.canColumnBeDraggedInto=oo;exports.canRowBeDraggedInto=no;exports.captureCellAnchor=vt;exports.checkPageBreakBlocksInSchema=bn;exports.contentNodeToInlineContent=pe;exports.contentNodeToTableContent=ut;exports.createAudioBlockConfig=Et;exports.createAudioBlockSpec=Mt;exports.createBlockConfig=Fn;exports.createBlockNoteExtension=A;exports.createBlockSpec=L;exports.createBlockSpecFromTiptapNode=ot;exports.createBulletListItemBlockConfig=Zt;exports.createBulletListItemBlockSpec=Xt;exports.createCheckListItemBlockSpec=Kt;exports.createCheckListItemConfig=Jt;exports.createCodeBlockConfig=Nt;exports.createCodeBlockSpec=It;exports.createDefaultBlockDOMOutputSpec=Qe;exports.createFileBlockConfig=Pt;exports.createFileBlockSpec=Ht;exports.createHeadingBlockConfig=Rt;exports.createHeadingBlockSpec=Vt;exports.createImageBlockConfig=jt;exports.createImageBlockSpec=zt;exports.createInlineContentSpecFromTipTapNode=zn;exports.createInternalInlineContentSpec=pt;exports.createInternalStyleSpec=Me;exports.createNumberedListItemBlockConfig=Qt;exports.createNumberedListItemBlockSpec=en;exports.createPageBreakBlockConfig=on;exports.createPageBreakBlockSpec=rn;exports.createParagraphBlockConfig=sn;exports.createParagraphBlockSpec=an;exports.createQuoteBlockConfig=cn;exports.createQuoteBlockSpec=ln;exports.createStyleSpec=Ae;exports.createStyleSpecFromTipTapMark=F;exports.createTableBlockSpec=pn;exports.createToggleListItemBlockConfig=tn;exports.createToggleListItemBlockSpec=nn;exports.createToggleWrapper=De;exports.createVideoBlockConfig=hn;exports.createVideoBlockSpec=mn;exports.cropEmptyRowsOrColumns=eo;exports.defaultBlockSpecs=kn;exports.defaultBlockToHTML=we;exports.defaultInlineContentSchema=Fo;exports.defaultInlineContentSpecs=Fe;exports.defaultProps=C;exports.defaultStyleSchema=Vo;exports.defaultStyleSpecs=Ve;exports.defaultToggledState=Dt;exports.docToBlocks=jn;exports.editorHasBlockWithType=S;exports.fileParse=Ot;exports.filenameFromURL=Vn;exports.filterSuggestionItems=Ho;exports.formatKeyboardShortcut=N;exports.getBackgroundColorAttribute=po;exports.getBlockCache=de;exports.getBlockFromPos=nt;exports.getBlockInfo=q;exports.getBlockInfoFromResolvedPos=it;exports.getBlockInfoFromSelection=Wn;exports.getBlockInfoFromTransaction=ct;exports.getBlockInfoWithManualOffset=ie;exports.getBlockNoteSchema=ce;exports.getBlockSchema=le;exports.getCellsAtColumnHandle=kt;exports.getCellsAtRowHandle=bt;exports.getColspan=$;exports.getDefaultSlashMenuItems=Oo;exports.getDimensionsOfTable=Ne;exports.getInlineContentSchema=ue;exports.getInlineContentSchemaFromSpecs=Te;exports.getLanguageId=He;exports.getNearestBlockPos=ae;exports.getNodeById=yt;exports.getPageBreakSlashMenuItems=Do;exports.getParseRules=st;exports.getPmSchema=G;exports.getRowspan=oe;exports.getStyleParseRules=ht;exports.getStyleSchema=V;exports.getStyleSchemaFromSpecs=Le;exports.getTextAlignmentAttribute=ho;exports.getTextColorAttribute=fo;exports.imageParse=$t;exports.imageRender=Ut;exports.imageToExternalHTML=qt;exports.inlineContentToNodes=R;exports.insertOrUpdateBlock=w;exports.isAppleOS=Ye;exports.isLinkInlineContent=ye;exports.isNodeBlock=wt;exports.isPartialLinkInlineContent=Be;exports.isPartialTableCell=j;exports.isSafari=Rn;exports.isStyledTextInlineContent=O;exports.isTableCell=se;exports.isTableCellSelection=Io;exports.mapTableCell=ne;exports.mergeCSSClasses=U;exports.mergeParagraphs=et;exports.moveColumn=Yn;exports.moveRow=Qn;exports.nodeToBlock=Z;exports.nodeToCustomInlineContent=dt;exports.parseAudioElement=Ee;exports.parseDefaultProps=T;exports.propsToAttributes=tt;exports.prosemirrorSliceToSlicedBlocks=$n;exports.splitBlockCommand=Co;exports.stylePropsToAttributes=ft;exports.tableContentToNodes=Ie;exports.tablePropSchema=un;exports.updateBlock=co;exports.updateBlockCommand=ao;exports.updateBlockTr=fe;exports.uploadToTmpFilesDotOrg_DEV_ONLY=Ao;exports.videoParse=gn;exports.withPageBreak=wo;exports.wrapInBlockStructure=re;
|
|
11
|
-
//# sourceMappingURL=BlockNoteSchema-DmZ6UQfY.cjs.map
|