@blocknote/core 0.43.0 → 0.44.1
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-D8TyvlfU.cjs → BlockNoteSchema-B4gm-Qco.cjs} +2 -2
- package/dist/{BlockNoteSchema-D8TyvlfU.cjs.map → BlockNoteSchema-B4gm-Qco.cjs.map} +1 -1
- package/dist/{BlockNoteSchema-CbSavEwr.js → BlockNoteSchema-C-l154WP.js} +2 -2
- package/dist/{BlockNoteSchema-CbSavEwr.js.map → BlockNoteSchema-C-l154WP.js.map} +1 -1
- package/dist/{TrailingNode-BUhuMJrB.js → TrailingNode-B_zPMWxw.js} +235 -233
- package/dist/{TrailingNode-BUhuMJrB.js.map → TrailingNode-B_zPMWxw.js.map} +1 -1
- package/dist/TrailingNode-CRHrgOnK.cjs +2 -0
- package/dist/{TrailingNode-CaT_wbho.cjs.map → TrailingNode-CRHrgOnK.cjs.map} +1 -1
- package/dist/blocknote.cjs +4 -4
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +508 -506
- package/dist/blocknote.js.map +1 -1
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +2 -2
- package/dist/defaultBlocks-DLJ4Q1_J.cjs +6 -0
- package/dist/{defaultBlocks-BxFclIGP.cjs.map → defaultBlocks-DLJ4Q1_J.cjs.map} +1 -1
- package/dist/{defaultBlocks-BJtxTOM2.js → defaultBlocks-DgA_mtQV.js} +463 -460
- package/dist/{defaultBlocks-BJtxTOM2.js.map → defaultBlocks-DgA_mtQV.js.map} +1 -1
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.js +3 -3
- package/dist/webpack-stats.json +1 -1
- package/package.json +1 -1
- package/dist/TrailingNode-CaT_wbho.cjs +0 -2
- package/dist/defaultBlocks-BxFclIGP.cjs +0 -6
package/dist/extensions.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var E=Object.create;var u=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var g=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of x(t))!S.call(n,s)&&s!==o&&u(n,s,{get:()=>t[s],enumerable:!(i=d(t,s))||i.enumerable});return n};var c=(n,t,o)=>(o=n!=null?E(m(n)):{},g(t||!n||!n.__esModule?u(o,"default",{value:n,enumerable:!0}):o,n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TrailingNode-
|
|
1
|
+
"use strict";var E=Object.create;var u=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var g=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of x(t))!S.call(n,s)&&s!==o&&u(n,s,{get:()=>t[s],enumerable:!(i=d(t,s))||i.enumerable});return n};var c=(n,t,o)=>(o=n!=null?E(m(n)):{},g(t||!n||!n.__esModule?u(o,"default",{value:n,enumerable:!0}):o,n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TrailingNode-CRHrgOnK.cjs"),a=require("./defaultBlocks-DLJ4Q1_J.cjs"),h=require("./ShowSelection-BW37oJ6h.cjs");let l;async function T(){return l||(l=(async()=>{const[n,t]=await Promise.all([import("emoji-mart"),import("@emoji-mart/data")]),o="default"in n?n.default:n,i="default"in t?t.default:t;return await o.init({data:i}),{emojiMart:o,emojiData:i}})(),l)}async function M(n,t){if(!("text"in n.schema.inlineContentSchema)||n.schema.inlineContentSchema.text!==a.defaultInlineContentSchema.text)return[];const{emojiData:o,emojiMart:i}=await T();return(t.trim()===""?Object.values(o.emojis):await i.SearchIndex.search(t)).map(r=>({id:r.skins[0].native,onItemClick:()=>n.insertInlineContent(r.skins[0].native+" ")}))}exports.BlockChangeExtension=e.BlockChangeExtension;exports.DEFAULT_LINK_PROTOCOL=e.DEFAULT_LINK_PROTOCOL;exports.DropCursorExtension=e.DropCursorExtension;exports.ForkYDocExtension=e.ForkYDocExtension;exports.FormattingToolbarExtension=e.FormattingToolbarExtension;exports.HistoryExtension=e.HistoryExtension;exports.LinkToolbarExtension=e.LinkToolbarExtension;exports.NodeSelectionKeyboardExtension=e.NodeSelectionKeyboardExtension;exports.PlaceholderExtension=e.PlaceholderExtension;exports.PreviousBlockTypeExtension=e.PreviousBlockTypeExtension;exports.SchemaMigration=e.SchemaMigration;exports.SideMenuExtension=e.SideMenuExtension;exports.SideMenuView=e.SideMenuView;exports.TableHandlesExtension=e.TableHandlesExtension;exports.TableHandlesView=e.TableHandlesView;exports.TrailingNodeExtension=e.TrailingNodeExtension;exports.VALID_LINK_PROTOCOLS=e.VALID_LINK_PROTOCOLS;exports.YCursorExtension=e.YCursorExtension;exports.YSyncExtension=e.YSyncExtension;exports.YUndoExtension=e.YUndoExtension;exports.sideMenuPluginKey=e.sideMenuPluginKey;exports.tableHandlesPluginKey=e.tableHandlesPluginKey;exports.FilePanelExtension=a.FilePanelExtension;exports.SuggestionMenu=a.SuggestionMenu;exports.filterSuggestionItems=a.filterSuggestionItems;exports.getDefaultSlashMenuItems=a.getDefaultSlashMenuItems;exports.insertOrUpdateBlockForSlashMenu=a.insertOrUpdateBlockForSlashMenu;exports.ShowSelectionExtension=h.ShowSelectionExtension;exports.getDefaultEmojiPickerItems=M;
|
|
2
2
|
//# sourceMappingURL=extensions.cjs.map
|
package/dist/extensions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as d, d as E, D as S, F as f, c as h, H as g, L as M, N as j, P as T, e as p, S as P, g as C, f as D, h as I, T as b, i as k, V as w, Y as L, a as y, b as O, s as F, t as H } from "./TrailingNode-
|
|
2
|
-
import { _ as i } from "./defaultBlocks-
|
|
3
|
-
import { a8 as N, a9 as Y, ac as _, ab as v, aa as B } from "./defaultBlocks-
|
|
1
|
+
import { B as d, d as E, D as S, F as f, c as h, H as g, L as M, N as j, P as T, e as p, S as P, g as C, f as D, h as I, T as b, i as k, V as w, Y as L, a as y, b as O, s as F, t as H } from "./TrailingNode-B_zPMWxw.js";
|
|
2
|
+
import { _ as i } from "./defaultBlocks-DgA_mtQV.js";
|
|
3
|
+
import { a8 as N, a9 as Y, ac as _, ab as v, aa as B } from "./defaultBlocks-DgA_mtQV.js";
|
|
4
4
|
import { S as U } from "./ShowSelection-Dz-NEase.js";
|
|
5
5
|
let o;
|
|
6
6
|
async function r() {
|
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":1764616653299,"assets":[{"name":"blocks.cjs","size":3901},{"name":"extensions.cjs","size":2787},{"name":"yjs.cjs","size":882},{"name":"comments.cjs","size":16658},{"name":"locales.cjs","size":161252},{"name":"blocknote.cjs","size":71834},{"name":"EventEmitter-CLwfmbqG.cjs","size":614},{"name":"en-Cl87Uuyf.cjs","size":6760},{"name":"ShowSelection-BW37oJ6h.cjs","size":708},{"name":"BlockNoteExtension-BWw0r8Gy.cjs","size":497},{"name":"BlockNoteSchema-D8TyvlfU.cjs","size":5031},{"name":"blockToNode-w7H99R6p.cjs","size":19430},{"name":"TrailingNode-CaT_wbho.cjs","size":45802},{"name":"defaultBlocks-BxFclIGP.cjs","size":66689},{"name":"EventEmitter-CLwfmbqG.cjs.map","size":2377},{"name":"ShowSelection-BW37oJ6h.cjs.map","size":2445},{"name":"en-Cl87Uuyf.cjs.map","size":15254},{"name":"BlockNoteExtension-BWw0r8Gy.cjs.map","size":9597},{"name":"BlockNoteSchema-D8TyvlfU.cjs.map","size":25059},{"name":"blockToNode-w7H99R6p.cjs.map","size":122134},{"name":"defaultBlocks-BxFclIGP.cjs.map","size":291837},{"name":"TrailingNode-CaT_wbho.cjs.map","size":216856},{"name":"yjs.cjs.map","size":5601},{"name":"extensions.cjs.map","size":3397},{"name":"blocks.cjs.map","size":91},{"name":"comments.cjs.map","size":69837},{"name":"blocknote.cjs.map","size":330614},{"name":"locales.cjs.map","size":331893}],"chunks":[{"id":"c90dbef","entry":true,"initial":true,"files":["blocks.cjs"],"names":["blocks"]},{"id":"f16e717","entry":true,"initial":true,"files":["extensions.cjs"],"names":["extensions"]},{"id":"526cf7b","entry":true,"initial":true,"files":["yjs.cjs"],"names":["yjs"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]},{"id":"9eaffe2","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"c302b40","entry":false,"initial":true,"files":["EventEmitter-CLwfmbqG.cjs"],"names":["EventEmitter"]},{"id":"a1e239a","entry":false,"initial":true,"files":["en-Cl87Uuyf.cjs"],"names":["en"]},{"id":"da3865a","entry":false,"initial":true,"files":["ShowSelection-BW37oJ6h.cjs"],"names":["ShowSelection"]},{"id":"9db21a2","entry":false,"initial":true,"files":["BlockNoteExtension-BWw0r8Gy.cjs"],"names":["BlockNoteExtension"]},{"id":"7515671","entry":false,"initial":true,"files":["BlockNoteSchema-D8TyvlfU.cjs"],"names":["BlockNoteSchema"]},{"id":"cdc653a","entry":false,"initial":true,"files":["blockToNode-w7H99R6p.cjs"],"names":["blockToNode"]},{"id":"0c166b6","entry":false,"initial":true,"files":["TrailingNode-CaT_wbho.cjs"],"names":["TrailingNode"]},{"id":"5d7fff5","entry":false,"initial":true,"files":["defaultBlocks-BxFclIGP.cjs"],"names":["defaultBlocks"]}],"modules":[{"name":"./src/blocks/index.ts","size":0,"chunks":["c90dbef"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":1294,"chunks":["f16e717"]},{"name":"./src/extensions/index.ts","size":0,"chunks":["f16e717"]},{"name":"./src/yjs/utils.ts","size":1121,"chunks":["526cf7b"]},{"name":"./src/yjs/index.ts","size":0,"chunks":["526cf7b"]},{"name":"./src/comments/mark.ts","size":1428,"chunks":["1627b02"]},{"name":"./src/comments/userstore/UserStore.ts","size":1367,"chunks":["1627b02"]},{"name":"./src/comments/extension.ts","size":8460,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/ThreadStoreAuth.ts","size":25,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/DefaultThreadStoreAuth.ts","size":2014,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/ThreadStore.ts","size":77,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/TipTapThreadStore.ts","size":5321,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/yjsHelpers.ts","size":3002,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStoreBase.ts","size":849,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/RESTYjsThreadStore.ts","size":2069,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStore.ts","size":7267,"chunks":["1627b02"]},{"name":"./src/comments/index.ts","size":0,"chunks":["1627b02"]},{"name":"./src/i18n/locales/ar.ts","size":9531,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":10742,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":10261,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":11221,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/he.ts","size":9268,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":10088,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":10269,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":10687,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":9098,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":8586,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":10215,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":10394,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":9911,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":10066,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":11236,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":9951,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":10896,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":9932,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":8562,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":8602,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":3798,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":835,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts","size":3571,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":2248,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":4945,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts","size":5694,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2059,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":2047,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/BlockManager.ts","size":6463,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/EventManager.ts","size":2277,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2170,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":435,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1768,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExportManager.ts","size":3749,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":4172,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1140,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":661,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":2412,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5222,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/BackgroundColor/BackgroundColorExtension.ts","size":306,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/HardBreak/HardBreak.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":2907,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":15783,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/Suggestions/SuggestionMarks.ts","size":4452,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/TextAlignment/TextAlignmentExtension.ts","size":936,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/TextColor/TextColorExtension.ts","size":291,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2184,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1160,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExtensionManager/extensions.ts","size":4323,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExtensionManager/index.ts","size":11936,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":5253,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition.ts","size":2564,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/SelectionManager.ts","size":2621,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StateManager.ts","size":6203,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1049,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StyleManager.ts","size":4330,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2616,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":26656,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1101,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["c302b40"]},{"name":"./src/i18n/locales/en.ts","size":9591,"chunks":["a1e239a"]},{"name":"./src/extensions/ShowSelection/ShowSelection.ts","size":1097,"chunks":["da3865a"]},{"name":"./src/editor/managers/ExtensionManager/symbol.ts","size":56,"chunks":["9db21a2"]},{"name":"./src/editor/BlockNoteExtension.ts","size":617,"chunks":["9db21a2"]},{"name":"./src/util/topo-sort.ts","size":3045,"chunks":["7515671"]},{"name":"./src/schema/schema.ts","size":4026,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/block.ts","size":911,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/getPageBreakSlashMenuItems.ts","size":473,"chunks":["7515671"]},{"name":"./src/blocks/BlockNoteSchema.ts","size":372,"chunks":["7515671"]},{"name":"./src/extensions/tiptap-extensions/UniqueID/UniqueID.ts","size":8905,"chunks":["cdc653a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["cdc653a"]},{"name":"./src/util/table.ts","size":1212,"chunks":["cdc653a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["cdc653a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3797,"chunks":["cdc653a"]},{"name":"./src/api/pmUtil.ts","size":651,"chunks":["cdc653a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":13078,"chunks":["cdc653a"]},{"name":"./src/api/blockManipulation/tables/tables.ts","size":10346,"chunks":["cdc653a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":7193,"chunks":["cdc653a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":7420,"chunks":["0c166b6"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":904,"chunks":["0c166b6"]},{"name":"./src/api/getBlocksChangedByTransaction.ts","size":6565,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":775,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts","size":470,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":674,"chunks":["0c166b6"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":665,"chunks":["0c166b6"]},{"name":"./src/extensions/BlockChange/BlockChange.ts","size":1090,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/YCursorPlugin.ts","size":4908,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/YSync.ts","size":228,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/YUndo.ts","size":317,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/ForkYDoc.ts","size":3456,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts","size":1684,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/index.ts","size":45,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/schemaMigration/SchemaMigration.ts","size":1365,"chunks":["0c166b6"]},{"name":"./src/extensions/DropCursor/DropCursor.ts","size":333,"chunks":["0c166b6"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbar.ts","size":2236,"chunks":["0c166b6"]},{"name":"./src/extensions/History/History.ts","size":246,"chunks":["0c166b6"]},{"name":"./src/extensions/LinkToolbar/LinkToolbar.ts","size":2883,"chunks":["0c166b6"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["0c166b6"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.ts","size":1380,"chunks":["0c166b6"]},{"name":"./src/extensions/Placeholder/Placeholder.ts","size":4034,"chunks":["0c166b6"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockType.ts","size":4792,"chunks":["0c166b6"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["0c166b6"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1700,"chunks":["0c166b6"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4742,"chunks":["0c166b6"]},{"name":"./src/extensions/SideMenu/SideMenu.ts","size":16246,"chunks":["0c166b6"]},{"name":"./src/extensions/TableHandles/TableHandles.ts","size":27681,"chunks":["0c166b6"]},{"name":"./src/extensions/TrailingNode/TrailingNode.ts","size":1589,"chunks":["0c166b6"]},{"name":"./src/util/browser.ts","size":643,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":2115,"chunks":["5d7fff5"]},{"name":"./src/util/string.ts","size":656,"chunks":["5d7fff5"]},{"name":"./src/schema/blocks/internal.ts","size":3387,"chunks":["5d7fff5"]},{"name":"./src/schema/blocks/createSpec.ts","size":6665,"chunks":["5d7fff5"]},{"name":"./src/schema/inlineContent/internal.ts","size":1428,"chunks":["5d7fff5"]},{"name":"./src/schema/styles/internal.ts","size":2909,"chunks":["5d7fff5"]},{"name":"./src/schema/styles/createSpec.ts","size":2498,"chunks":["5d7fff5"]},{"name":"./src/api/nodeUtil.ts","size":549,"chunks":["5d7fff5"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":8527,"chunks":["5d7fff5"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultProps.ts","size":3350,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/parse/parseFigureElement.ts","size":342,"chunks":["5d7fff5"]},{"name":"./src/extensions/FilePanel/FilePanel.ts","size":822,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createAddFileButton.ts","size":1846,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createFileNameWithIcon.ts","size":753,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createFileBlockWrapper.ts","size":1374,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createFigureWithCaption.ts","size":307,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createLinkWithCaption.ts","size":294,"chunks":["5d7fff5"]},{"name":"./src/blocks/Audio/parseAudioElement.ts","size":108,"chunks":["5d7fff5"]},{"name":"./src/blocks/Audio/block.ts","size":3593,"chunks":["5d7fff5"]},{"name":"./src/blocks/Code/shiki.ts","size":1699,"chunks":["5d7fff5"]},{"name":"./src/blocks/Code/block.ts","size":6559,"chunks":["5d7fff5"]},{"name":"./src/blocks/Divider/block.ts","size":757,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/block.ts","size":1766,"chunks":["5d7fff5"]},{"name":"./src/blocks/ToggleWrapper/createToggleWrapper.ts","size":5246,"chunks":["5d7fff5"]},{"name":"./src/blocks/Heading/block.ts","size":2606,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createResizableFileBlockWrapper.ts","size":6266,"chunks":["5d7fff5"]},{"name":"./src/blocks/Image/parseImageElement.ts","size":224,"chunks":["5d7fff5"]},{"name":"./src/blocks/Image/block.ts","size":3777,"chunks":["5d7fff5"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":945,"chunks":["5d7fff5"]},{"name":"./src/blocks/utils/listItemEnterHandler.ts","size":892,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/getListItemContent.ts","size":1425,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/BulletListItem/block.ts","size":2421,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/CheckListItem/block.ts","size":3834,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts","size":3203,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/NumberedListItem/block.ts","size":2962,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/ToggleListItem/block.ts","size":1468,"chunks":["5d7fff5"]},{"name":"./src/blocks/Paragraph/block.ts","size":1347,"chunks":["5d7fff5"]},{"name":"./src/blocks/Quote/block.ts","size":1664,"chunks":["5d7fff5"]},{"name":"./src/blocks/Table/TableExtension.ts","size":2297,"chunks":["5d7fff5"]},{"name":"./src/blocks/Table/block.ts","size":9812,"chunks":["5d7fff5"]},{"name":"./src/blocks/Video/parseVideoElement.ts","size":175,"chunks":["5d7fff5"]},{"name":"./src/blocks/Video/block.ts","size":3577,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":2005,"chunks":["5d7fff5"]},{"name":"./src/api/positionMapping.ts","size":1639,"chunks":["5d7fff5"]},{"name":"./src/extensions/SuggestionMenu/SuggestionMenu.ts","size":9455,"chunks":["5d7fff5"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":9058,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultBlocks.ts","size":2851,"chunks":["5d7fff5"]}]}
|
|
1
|
+
{"builtAt":1765212962038,"assets":[{"name":"blocks.cjs","size":3901},{"name":"extensions.cjs","size":2787},{"name":"yjs.cjs","size":882},{"name":"comments.cjs","size":16658},{"name":"locales.cjs","size":161252},{"name":"blocknote.cjs","size":71898},{"name":"EventEmitter-CLwfmbqG.cjs","size":614},{"name":"en-Cl87Uuyf.cjs","size":6760},{"name":"ShowSelection-BW37oJ6h.cjs","size":708},{"name":"BlockNoteExtension-BWw0r8Gy.cjs","size":497},{"name":"BlockNoteSchema-B4gm-Qco.cjs","size":5031},{"name":"blockToNode-w7H99R6p.cjs","size":19430},{"name":"TrailingNode-CRHrgOnK.cjs","size":45867},{"name":"defaultBlocks-DLJ4Q1_J.cjs","size":66789},{"name":"EventEmitter-CLwfmbqG.cjs.map","size":2377},{"name":"en-Cl87Uuyf.cjs.map","size":15254},{"name":"BlockNoteExtension-BWw0r8Gy.cjs.map","size":9597},{"name":"ShowSelection-BW37oJ6h.cjs.map","size":2445},{"name":"BlockNoteSchema-B4gm-Qco.cjs.map","size":25059},{"name":"blockToNode-w7H99R6p.cjs.map","size":122134},{"name":"TrailingNode-CRHrgOnK.cjs.map","size":216856},{"name":"defaultBlocks-DLJ4Q1_J.cjs.map","size":291837},{"name":"blocks.cjs.map","size":91},{"name":"yjs.cjs.map","size":5601},{"name":"extensions.cjs.map","size":3397},{"name":"comments.cjs.map","size":69837},{"name":"locales.cjs.map","size":331893},{"name":"blocknote.cjs.map","size":330614}],"chunks":[{"id":"c90dbef","entry":true,"initial":true,"files":["blocks.cjs"],"names":["blocks"]},{"id":"f16e717","entry":true,"initial":true,"files":["extensions.cjs"],"names":["extensions"]},{"id":"526cf7b","entry":true,"initial":true,"files":["yjs.cjs"],"names":["yjs"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]},{"id":"9eaffe2","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"c302b40","entry":false,"initial":true,"files":["EventEmitter-CLwfmbqG.cjs"],"names":["EventEmitter"]},{"id":"a1e239a","entry":false,"initial":true,"files":["en-Cl87Uuyf.cjs"],"names":["en"]},{"id":"da3865a","entry":false,"initial":true,"files":["ShowSelection-BW37oJ6h.cjs"],"names":["ShowSelection"]},{"id":"9db21a2","entry":false,"initial":true,"files":["BlockNoteExtension-BWw0r8Gy.cjs"],"names":["BlockNoteExtension"]},{"id":"7515671","entry":false,"initial":true,"files":["BlockNoteSchema-B4gm-Qco.cjs"],"names":["BlockNoteSchema"]},{"id":"cdc653a","entry":false,"initial":true,"files":["blockToNode-w7H99R6p.cjs"],"names":["blockToNode"]},{"id":"0c166b6","entry":false,"initial":true,"files":["TrailingNode-CRHrgOnK.cjs"],"names":["TrailingNode"]},{"id":"5d7fff5","entry":false,"initial":true,"files":["defaultBlocks-DLJ4Q1_J.cjs"],"names":["defaultBlocks"]}],"modules":[{"name":"./src/blocks/index.ts","size":0,"chunks":["c90dbef"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":1294,"chunks":["f16e717"]},{"name":"./src/extensions/index.ts","size":0,"chunks":["f16e717"]},{"name":"./src/yjs/utils.ts","size":1121,"chunks":["526cf7b"]},{"name":"./src/yjs/index.ts","size":0,"chunks":["526cf7b"]},{"name":"./src/comments/mark.ts","size":1428,"chunks":["1627b02"]},{"name":"./src/comments/userstore/UserStore.ts","size":1367,"chunks":["1627b02"]},{"name":"./src/comments/extension.ts","size":8460,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/ThreadStoreAuth.ts","size":25,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/DefaultThreadStoreAuth.ts","size":2014,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/ThreadStore.ts","size":77,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/TipTapThreadStore.ts","size":5321,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/yjsHelpers.ts","size":3002,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStoreBase.ts","size":849,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/RESTYjsThreadStore.ts","size":2069,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStore.ts","size":7267,"chunks":["1627b02"]},{"name":"./src/comments/index.ts","size":0,"chunks":["1627b02"]},{"name":"./src/i18n/locales/ar.ts","size":9531,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":10742,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":10261,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":11221,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/he.ts","size":9268,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":10088,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":10269,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":10687,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":9098,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":8586,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":10215,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":10394,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":9911,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":10066,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":11236,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":9951,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":10896,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":9932,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":8562,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":8602,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":3798,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":835,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts","size":3571,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":2248,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":4945,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts","size":5694,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2059,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":2047,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/BlockManager.ts","size":6463,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/EventManager.ts","size":2277,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2170,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":435,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1768,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExportManager.ts","size":3749,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":4172,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1140,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":661,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":2412,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5222,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/BackgroundColor/BackgroundColorExtension.ts","size":306,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/HardBreak/HardBreak.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":2907,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":15783,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/Suggestions/SuggestionMarks.ts","size":4452,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/TextAlignment/TextAlignmentExtension.ts","size":936,"chunks":["a1ee98a"]},{"name":"./src/extensions/tiptap-extensions/TextColor/TextColorExtension.ts","size":291,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2184,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1160,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExtensionManager/extensions.ts","size":4323,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExtensionManager/index.ts","size":11925,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":5253,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition.ts","size":2564,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/SelectionManager.ts","size":2621,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StateManager.ts","size":6203,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1049,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StyleManager.ts","size":4319,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2561,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":26656,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1101,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["c302b40"]},{"name":"./src/i18n/locales/en.ts","size":9591,"chunks":["a1e239a"]},{"name":"./src/extensions/ShowSelection/ShowSelection.ts","size":1097,"chunks":["da3865a"]},{"name":"./src/editor/managers/ExtensionManager/symbol.ts","size":56,"chunks":["9db21a2"]},{"name":"./src/editor/BlockNoteExtension.ts","size":617,"chunks":["9db21a2"]},{"name":"./src/util/topo-sort.ts","size":3045,"chunks":["7515671"]},{"name":"./src/schema/schema.ts","size":4026,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/block.ts","size":911,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/getPageBreakSlashMenuItems.ts","size":473,"chunks":["7515671"]},{"name":"./src/blocks/BlockNoteSchema.ts","size":372,"chunks":["7515671"]},{"name":"./src/extensions/tiptap-extensions/UniqueID/UniqueID.ts","size":8905,"chunks":["cdc653a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["cdc653a"]},{"name":"./src/util/table.ts","size":1212,"chunks":["cdc653a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["cdc653a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3797,"chunks":["cdc653a"]},{"name":"./src/api/pmUtil.ts","size":651,"chunks":["cdc653a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":13078,"chunks":["cdc653a"]},{"name":"./src/api/blockManipulation/tables/tables.ts","size":10346,"chunks":["cdc653a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":7193,"chunks":["cdc653a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":7420,"chunks":["0c166b6"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":904,"chunks":["0c166b6"]},{"name":"./src/api/getBlocksChangedByTransaction.ts","size":6565,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":775,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts","size":470,"chunks":["0c166b6"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":674,"chunks":["0c166b6"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":665,"chunks":["0c166b6"]},{"name":"./src/extensions/BlockChange/BlockChange.ts","size":1090,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/YCursorPlugin.ts","size":4908,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/YSync.ts","size":228,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/YUndo.ts","size":317,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/ForkYDoc.ts","size":3456,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts","size":1684,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/index.ts","size":45,"chunks":["0c166b6"]},{"name":"./src/extensions/Collaboration/schemaMigration/SchemaMigration.ts","size":1343,"chunks":["0c166b6"]},{"name":"./src/extensions/DropCursor/DropCursor.ts","size":333,"chunks":["0c166b6"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbar.ts","size":2236,"chunks":["0c166b6"]},{"name":"./src/extensions/History/History.ts","size":213,"chunks":["0c166b6"]},{"name":"./src/extensions/LinkToolbar/LinkToolbar.ts","size":2883,"chunks":["0c166b6"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["0c166b6"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.ts","size":1380,"chunks":["0c166b6"]},{"name":"./src/extensions/Placeholder/Placeholder.ts","size":4034,"chunks":["0c166b6"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockType.ts","size":4792,"chunks":["0c166b6"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["0c166b6"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1700,"chunks":["0c166b6"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4742,"chunks":["0c166b6"]},{"name":"./src/extensions/SideMenu/SideMenu.ts","size":16191,"chunks":["0c166b6"]},{"name":"./src/extensions/TableHandles/TableHandles.ts","size":27681,"chunks":["0c166b6"]},{"name":"./src/extensions/TrailingNode/TrailingNode.ts","size":1589,"chunks":["0c166b6"]},{"name":"./src/util/browser.ts","size":643,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":2115,"chunks":["5d7fff5"]},{"name":"./src/util/string.ts","size":656,"chunks":["5d7fff5"]},{"name":"./src/schema/blocks/internal.ts","size":3387,"chunks":["5d7fff5"]},{"name":"./src/schema/blocks/createSpec.ts","size":6643,"chunks":["5d7fff5"]},{"name":"./src/schema/inlineContent/internal.ts","size":1428,"chunks":["5d7fff5"]},{"name":"./src/schema/styles/internal.ts","size":2887,"chunks":["5d7fff5"]},{"name":"./src/schema/styles/createSpec.ts","size":2498,"chunks":["5d7fff5"]},{"name":"./src/api/nodeUtil.ts","size":549,"chunks":["5d7fff5"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":8527,"chunks":["5d7fff5"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultProps.ts","size":3350,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/parse/parseFigureElement.ts","size":342,"chunks":["5d7fff5"]},{"name":"./src/extensions/FilePanel/FilePanel.ts","size":822,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createAddFileButton.ts","size":1846,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createFileNameWithIcon.ts","size":753,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createFileBlockWrapper.ts","size":1374,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createFigureWithCaption.ts","size":307,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createLinkWithCaption.ts","size":294,"chunks":["5d7fff5"]},{"name":"./src/blocks/Audio/parseAudioElement.ts","size":108,"chunks":["5d7fff5"]},{"name":"./src/blocks/Audio/block.ts","size":3593,"chunks":["5d7fff5"]},{"name":"./src/blocks/Code/shiki.ts","size":1699,"chunks":["5d7fff5"]},{"name":"./src/blocks/Code/block.ts","size":6548,"chunks":["5d7fff5"]},{"name":"./src/blocks/Divider/block.ts","size":757,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/block.ts","size":1766,"chunks":["5d7fff5"]},{"name":"./src/blocks/ToggleWrapper/createToggleWrapper.ts","size":5246,"chunks":["5d7fff5"]},{"name":"./src/blocks/Heading/block.ts","size":2606,"chunks":["5d7fff5"]},{"name":"./src/blocks/File/helpers/render/createResizableFileBlockWrapper.ts","size":6266,"chunks":["5d7fff5"]},{"name":"./src/blocks/Image/parseImageElement.ts","size":224,"chunks":["5d7fff5"]},{"name":"./src/blocks/Image/block.ts","size":3777,"chunks":["5d7fff5"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":945,"chunks":["5d7fff5"]},{"name":"./src/blocks/utils/listItemEnterHandler.ts","size":892,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/getListItemContent.ts","size":1425,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/BulletListItem/block.ts","size":2421,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/CheckListItem/block.ts","size":3834,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts","size":3148,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/NumberedListItem/block.ts","size":2962,"chunks":["5d7fff5"]},{"name":"./src/blocks/ListItem/ToggleListItem/block.ts","size":1468,"chunks":["5d7fff5"]},{"name":"./src/blocks/Paragraph/block.ts","size":1347,"chunks":["5d7fff5"]},{"name":"./src/blocks/Quote/block.ts","size":1664,"chunks":["5d7fff5"]},{"name":"./src/blocks/Table/TableExtension.ts","size":2297,"chunks":["5d7fff5"]},{"name":"./src/blocks/Table/block.ts","size":9812,"chunks":["5d7fff5"]},{"name":"./src/blocks/Video/parseVideoElement.ts","size":175,"chunks":["5d7fff5"]},{"name":"./src/blocks/Video/block.ts","size":3577,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":2005,"chunks":["5d7fff5"]},{"name":"./src/api/positionMapping.ts","size":1639,"chunks":["5d7fff5"]},{"name":"./src/extensions/SuggestionMenu/SuggestionMenu.ts","size":9455,"chunks":["5d7fff5"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":9058,"chunks":["5d7fff5"]},{"name":"./src/blocks/defaultBlocks.ts","size":2851,"chunks":["5d7fff5"]}]}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var fe=Object.defineProperty;var ge=(n,e,o)=>e in n?fe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o;var b=(n,e,o)=>ge(n,typeof e!="symbol"?e+"":e,o);const C=require("prosemirror-state"),V=require("@tiptap/core"),we=require("fast-deep-equal"),k=require("./blockToNode-w7H99R6p.cjs"),O=require("./defaultBlocks-BxFclIGP.cjs"),v=require("./BlockNoteExtension-BWw0r8Gy.cjs"),M=require("y-prosemirror"),ye=require("yjs"),be=require("prosemirror-dropcursor"),$=require("prosemirror-history"),D=require("prosemirror-view"),ke=require("uuid"),L=require("prosemirror-model"),Ce=require("rehype-parse"),ve=require("rehype-remark"),xe=require("remark-gfm"),Se=require("remark-stringify"),Ee=require("unified"),Ie=require("hast-util-from-dom"),Pe=require("unist-util-visit"),T=require("prosemirror-tables"),H=n=>n&&typeof n=="object"&&"default"in n?n:{default:n};function Te(n){if(n&&typeof n=="object"&&"default"in n)return n;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const t=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(e,o,t.get?t:{enumerable:!0,get:()=>n[o]})}}return e.default=n,Object.freeze(e)}const Be=H(we),B=Te(ye),De=H(Ce),Oe=H(ve),Me=H(xe),Ae=H(Se);function re(n){const e=Array.from(n.classList).filter(o=>!o.startsWith("bn-"))||[];e.length>0?n.className=e.join(" "):n.removeAttribute("class")}function se(n,e,o,t){var a;let r;if(e)if(typeof e=="string")r=k.inlineContentToNodes([e],n.pmSchema);else if(Array.isArray(e))r=k.inlineContentToNodes(e,n.pmSchema);else if(e.type==="tableContent")r=k.tableContentToNodes(e,n.pmSchema);else throw new k.UnreachableCaseError(e.type);else throw new Error("blockContent is required");const i=((t==null?void 0:t.document)??document).createDocumentFragment();for(const c of r)if(c.type.name!=="text"&&n.schema.inlineContentSchema[c.type.name]){const l=n.schema.inlineContentSpecs[c.type.name].implementation;if(l){const m=k.nodeToCustomInlineContent(c,n.schema.inlineContentSchema,n.schema.styleSchema),h=l.toExternalHTML?l.toExternalHTML(m,n):l.render.call({renderType:"dom",props:void 0},m,()=>{},n);if(h){if(i.appendChild(h.dom),h.contentDOM){const f=o.serializeFragment(c.content,t);h.contentDOM.dataset.editable="",h.contentDOM.appendChild(f)}continue}}}else if(c.type.name==="text"){let l=document.createTextNode(c.textContent);for(const m of c.marks.toReversed())if(m.type.name in n.schema.styleSpecs){const h=(n.schema.styleSpecs[m.type.name].implementation.toExternalHTML??n.schema.styleSpecs[m.type.name].implementation.render)(m.attrs.stringValue,n);h.contentDOM.appendChild(l),l=h.dom}else{const h=m.type.spec.toDOM(m,!0),f=L.DOMSerializer.renderSpec(document,h);f.contentDOM.appendChild(l),l=f.dom}i.appendChild(l)}else{const l=o.serializeFragment(L.Fragment.from([c]),t);i.appendChild(l)}return i.childNodes.length===1&&((a=i.firstChild)==null?void 0:a.nodeType)===1&&re(i.firstChild),i}function Le(n,e,o,t,r,s,i){var p,w,y,P,R,j,X,W,G;const a=(i==null?void 0:i.document)??document,c=e.pmSchema.nodes.blockContainer,l=o.props||{};for(const[x,E]of Object.entries(e.schema.blockSchema[o.type].propSchema))!(x in l)&&E.default!==void 0&&(l[x]=E.default);const m=(w=(p=c.spec)==null?void 0:p.toDOM)==null?void 0:w.call(p,c.create({id:o.id,...l})),h=Array.from(m.dom.attributes),f=e.blockImplementations[o.type].implementation,u=((y=f.toExternalHTML)==null?void 0:y.call({},{...o,props:l},e))||f.render.call({},{...o,props:l},e),g=a.createDocumentFragment();if(u.dom.classList.contains("bn-block-content")){const x=[...h,...Array.from(u.dom.attributes)].filter(E=>E.name.startsWith("data")&&E.name!=="data-content-type"&&E.name!=="data-file-block"&&E.name!=="data-node-view-wrapper"&&E.name!=="data-node-type"&&E.name!=="data-id"&&E.name!=="data-editable");for(const E of x)u.dom.firstChild.setAttribute(E.name,E.value);re(u.dom.firstChild),g.append(...Array.from(u.dom.childNodes))}else g.append(u.dom);if(u.contentDOM&&o.content){const x=se(e,o.content,t,i);u.contentDOM.appendChild(x)}let d;if(r.has(o.type)?d="OL":s.has(o.type)&&(d="UL"),d){if(((P=n.lastChild)==null?void 0:P.nodeName)!==d){const x=a.createElement(d);d==="OL"&&"start"in l&&l.start&&(l==null?void 0:l.start)!==1&&x.setAttribute("start",l.start+""),n.append(x)}n.lastChild.appendChild(g)}else n.append(g);if(o.children&&o.children.length>0){const x=a.createDocumentFragment();if(ie(x,e,o.children,t,r,s,i),((R=n.lastChild)==null?void 0:R.nodeName)==="UL"||((j=n.lastChild)==null?void 0:j.nodeName)==="OL")for(;((X=x.firstChild)==null?void 0:X.nodeName)==="UL"||((W=x.firstChild)==null?void 0:W.nodeName)==="OL";)n.lastChild.lastChild.appendChild(x.firstChild);e.pmSchema.nodes[o.type].isInGroup("blockContent")?n.append(x):(G=u.contentDOM)==null||G.append(x)}}const ie=(n,e,o,t,r,s,i)=>{for(const a of o)Le(n,e,a,t,r,s,i)},Ne=(n,e,o,t,r,s)=>{const a=((s==null?void 0:s.document)??document).createDocumentFragment();return ie(a,n,e,o,t,r,s),a},K=(n,e)=>{const o=L.DOMSerializer.fromSchema(n);return{exportBlocks:(t,r)=>{const s=Ne(e,t,o,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem","toggleListItem"]),r),i=document.createElement("div");return i.append(s),i.innerHTML},exportInlineContent:(t,r)=>{const s=se(e,t,o,r),i=document.createElement("div");return i.append(s.cloneNode(!0)),i.innerHTML}}};function Re(n,e){if(e===0)return;const o=n.resolve(e);for(let t=o.depth;t>0;t--){const r=o.node(t);if(O.isNodeBlock(r))return r.attrs.id}}function Ve(n){return n.getMeta("paste")?{type:"paste"}:n.getMeta("uiEvent")==="drop"?{type:"drop"}:n.getMeta("history$")?{type:n.getMeta("history$").redo?"redo":"undo"}:n.getMeta("y-sync$")?n.getMeta("y-sync$").isUndoRedoOperation?{type:"undo-redo"}:{type:"yjs-remote"}:{type:"local"}}function J(n){const e="__root__",o={},t={},r=k.getPmSchema(n);return n.descendants((s,i)=>{if(!O.isNodeBlock(s))return!0;const a=Re(n,i),c=a??e;t[c]||(t[c]=[]);const l=k.nodeToBlock(s,r);return o[s.attrs.id]={block:l,parentId:a},t[c].push(s.attrs.id),!0}),{byId:o,childrenByParent:t}}function He(n,e){const o=new Set;if(!n||!e)return o;const t=new Set(n),r=e.filter(d=>t.has(d)),s=n.filter(d=>r.includes(d));if(s.length<=1||r.length<=1)return o;const i={};for(let d=0;d<s.length;d++)i[s[d]]=d;const a=r.map(d=>i[d]),c=a.length,l=[],m=[],h=new Array(c).fill(-1),f=(d,p)=>{let w=0,y=d.length;for(;w<y;){const P=w+y>>>1;d[P]<p?w=P+1:y=P}return w};for(let d=0;d<c;d++){const p=a[d],w=f(l,p);w>0&&(h[d]=m[w-1]),w===l.length?(l.push(p),m.push(d)):(l[w]=p,m[w]=d)}const u=new Set;let g=m[m.length-1]??-1;for(;g!==-1;)u.add(g),g=h[g];for(let d=0;d<r.length;d++)u.has(d)||o.add(r[d]);return o}function ae(n,e=[]){const o=Ve(n),t=V.combineTransactionSteps(n.before,[n,...e]),r=J(t.before),s=J(t.doc),i=[],a=new Set;Object.keys(s.byId).filter(u=>!(u in r.byId)).forEach(u=>{i.push({type:"insert",block:s.byId[u].block,source:o,prevBlock:void 0}),a.add(u)}),Object.keys(r.byId).filter(u=>!(u in s.byId)).forEach(u=>{i.push({type:"delete",block:r.byId[u].block,source:o,prevBlock:void 0}),a.add(u)}),Object.keys(s.byId).filter(u=>u in r.byId).forEach(u=>{var w,y;const g=r.byId[u],d=s.byId[u];g.parentId!==d.parentId?(i.push({type:"move",block:d.block,prevBlock:g.block,source:o,prevParent:g.parentId?(w=r.byId[g.parentId])==null?void 0:w.block:void 0,currentParent:d.parentId?(y=s.byId[d.parentId])==null?void 0:y.block:void 0}),a.add(u)):Be.default({...g.block,children:void 0},{...d.block,children:void 0})||(i.push({type:"update",block:d.block,prevBlock:g.block,source:o}),a.add(u))});const c=r.childrenByParent,l=s.childrenByParent,m="__root__",h=new Set([...Object.keys(c),...Object.keys(l)]),f=new Set;return h.forEach(u=>{const g=He(c[u],l[u]);g.size!==0&&g.forEach(d=>{var P,R;const p=r.byId[d],w=s.byId[d];!p||!w||p.parentId!==w.parentId||a.has(d)||(p.parentId??m)!==u||f.has(d)||(f.add(d),i.push({type:"move",block:w.block,prevBlock:p.block,source:o,prevParent:p.parentId?(P=r.byId[p.parentId])==null?void 0:P.block:void 0,currentParent:w.parentId?(R=s.byId[w.parentId])==null?void 0:R.block:void 0}),a.add(d))})}),i}function Fe(){const n=e=>{let o=e.children.length;for(let t=0;t<o;t++){const r=e.children[t];if(r.type==="element"&&(n(r),r.tagName==="u"))if(r.children.length>0){e.children.splice(t,1,...r.children);const s=r.children.length-1;o+=s,t+=s}else e.children.splice(t,1),o--,t--}};return n}function _e(){const n=e=>{var o;if(e.children&&"length"in e.children&&e.children.length)for(let t=e.children.length-1;t>=0;t--){const r=e.children[t],s=t+1<e.children.length?e.children[t+1]:void 0;r.type==="element"&&r.tagName==="input"&&((o=r.properties)==null?void 0:o.type)==="checkbox"&&(s==null?void 0:s.type)==="element"&&s.tagName==="p"?(s.tagName="span",s.children.splice(0,0,Ie.fromDom(document.createTextNode(" ")))):n(r)}};return n}function Ue(){return n=>{Pe.visit(n,"element",(e,o,t)=>{var r,s,i,a;if(t&&e.tagName==="video"){const c=((r=e.properties)==null?void 0:r.src)||((s=e.properties)==null?void 0:s["data-url"])||"",l=((i=e.properties)==null?void 0:i.title)||((a=e.properties)==null?void 0:a["data-name"])||"";t.children[o]={type:"text",value:``}}})}}function Y(n){return Ee.unified().use(De.default,{fragment:!0}).use(Ue).use(Fe).use(_e).use(Oe.default).use(Me.default).use(Ae.default,{handlers:{text:o=>o.value}}).processSync(n).value}function $e(n,e,o,t){const s=K(e,o).exportBlocks(n,t);return Y(s)}function le(n){const e=[];return n.descendants(o=>{var r,s;const t=k.getPmSchema(o);return o.type.name==="blockContainer"&&((r=o.firstChild)==null?void 0:r.type.name)==="blockGroup"?!0:o.type.name==="columnList"&&o.childCount===1?((s=o.firstChild)==null||s.forEach(i=>{e.push(k.nodeToBlock(i,t))}),!1):o.type.isInGroup("bnBlock")?(e.push(k.nodeToBlock(o,t)),!1):!0}),e}const ze=v.createExtension(()=>{const n=[];return{key:"blockChange",prosemirrorPlugins:[new C.Plugin({key:new C.PluginKey("blockChange"),filterTransaction:e=>{let o;return n.reduce((t,r)=>t===!1?t:r({getChanges(){return o||(o=ae(e),o)},tr:e})!==!1,!0)}})],subscribe(e){return n.push(e),()=>{n.splice(n.indexOf(e),1)}}}});function Q(n){const e=n.charAt(0)==="#"?n.substring(1,7):n,o=parseInt(e.substring(0,2),16),t=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16),i=[o/255,t/255,r/255].map(c=>c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]<=.179}function qe(n){const e=document.createElement("span");e.classList.add("bn-collaboration-cursor__base");const o=document.createElement("span");o.setAttribute("contentedEditable","false"),o.classList.add("bn-collaboration-cursor__caret"),o.setAttribute("style",`background-color: ${n.color}; color: ${Q(n.color)?"white":"black"}`);const t=document.createElement("span");return t.classList.add("bn-collaboration-cursor__label"),t.setAttribute("style",`background-color: ${n.color}; color: ${Q(n.color)?"white":"black"}`),t.insertBefore(document.createTextNode(n.name),null),o.insertBefore(t,null),e.insertBefore(document.createTextNode(""),null),e.insertBefore(o,null),e.insertBefore(document.createTextNode(""),null),e}const z=v.createExtension(({options:n})=>{const e=new Map;return n.provider&&"awareness"in n.provider&&typeof n.provider.awareness=="object"&&("setLocalStateField"in n.provider.awareness&&typeof n.provider.awareness.setLocalStateField=="function"&&n.provider.awareness.setLocalStateField("user",n.user),"on"in n.provider.awareness&&typeof n.provider.awareness.on=="function"&&n.showCursorLabels!=="always"&&n.provider.awareness.on("change",({updated:o})=>{for(const t of o){const r=e.get(t);r&&(r.element.setAttribute("data-active",""),r.hideTimeout&&clearTimeout(r.hideTimeout),e.set(t,{element:r.element,hideTimeout:setTimeout(()=>{r.element.removeAttribute("data-active")},2e3)}))}})),{key:"yCursor",prosemirrorPlugins:[M.yCursorPlugin(n.provider.awareness,{selectionBuilder:M.defaultSelectionBuilder,cursorBuilder(o,t){let r=e.get(t);if(!r){const s=(n.renderCursor??qe)(o);n.showCursorLabels!=="always"&&(s.addEventListener("mouseenter",()=>{const i=e.get(t);i.element.setAttribute("data-active",""),i.hideTimeout&&(clearTimeout(i.hideTimeout),e.set(t,{element:i.element,hideTimeout:void 0}))}),s.addEventListener("mouseleave",()=>{const i=e.get(t);e.set(t,{element:i.element,hideTimeout:setTimeout(()=>{i.element.removeAttribute("data-active")},2e3)})})),r={element:s,hideTimeout:void 0},e.set(t,r)}return r.element}})],dependsOn:["ySync"],updateUser(o){n.provider.awareness.setLocalStateField("user",o)}}}),_=v.createExtension(({options:n})=>({key:"ySync",prosemirrorPlugins:[M.ySyncPlugin(n.fragment)],runsBefore:["default"]})),U=v.createExtension(({editor:n})=>({key:"yUndo",prosemirrorPlugins:[M.yUndoPlugin({trackedOrigins:[n]})],dependsOn:["yCursor","ySync"],undoCommand:M.undoCommand,redoCommand:M.redoCommand}));function Ke(n,e){const o=n.doc;if(n._item===null){const t=Array.from(o.share.keys()).find(r=>o.share.get(r)===n);if(t==null)throw new Error("type does not exist in other ydoc");return e.get(t,n.constructor)}else{const t=n._item,r=e.store.clients.get(t.id.client)??[],s=B.findIndexSS(r,t.id.clock);return r[s].content.type}}const Ye=v.createExtension(({editor:n,options:e})=>{let o;const t=v.createStore({isForked:!1});return{key:"yForkDoc",store:t,fork(){if(o)return;const r=e.fragment;if(!r)throw new Error("No fragment to fork from");const s=new B.Doc;B.applyUpdate(s,B.encodeStateAsUpdate(r.doc));const i=Ke(r,s);o={undoStack:M.yUndoPluginKey.getState(n.prosemirrorState).undoManager.undoStack,originalFragment:r,forkedFragment:i},n.unregisterExtension([U,z,_]);const a={...e,fragment:i};n.registerExtension([_(a),U({})]),t.setState({isForked:!0})},merge({keepChanges:r}){if(!o)return;n.unregisterExtension(["ySync","yCursor","yUndo"]);const{originalFragment:s,forkedFragment:i,undoStack:a}=o;if(n.registerExtension([_(e),z(e),U({})]),M.yUndoPluginKey.getState(n.prosemirrorState).undoManager.undoStack=a,r){const c=B.encodeStateAsUpdate(i.doc,B.encodeStateVector(s.doc));B.applyUpdate(s.doc,c,n)}o=void 0,t.setState({isForked:!1})}}}),ce=(n,e)=>{e(n),n.forEach(o=>{o instanceof B.XmlElement&&ce(o,e)})},je=(n,e)=>{const o=new Map;return n.forEach(t=>{t instanceof B.XmlElement&&ce(t,r=>{if(r.nodeName==="blockContainer"&&r.hasAttribute("id")){const s=r.getAttribute("textColor"),i=r.getAttribute("backgroundColor"),a={textColor:s===O.defaultProps.textColor.default?void 0:s,backgroundColor:i===O.defaultProps.backgroundColor.default?void 0:i};(a.textColor||a.backgroundColor)&&o.set(r.getAttribute("id"),a)}})}),o.size===0?!1:(e.doc.descendants((t,r)=>{if(t.type.name==="blockContainer"&&o.has(t.attrs.id)){const s=e.doc.nodeAt(r+1);if(!s)throw new Error("No element found");e.setNodeMarkup(r+1,void 0,{...s.attrs,...o.get(t.attrs.id)})}}),!0)},Xe=[je],We=v.createExtension(({options:n})=>{let e=!1;const o=new C.PluginKey("schemaMigration");return{key:"schemaMigration",prosemirrorPlugins:[new C.Plugin({key:o,appendTransaction:(t,r,s)=>{if(e||!t.some(a=>a.getMeta("y-sync$"))||t.every(a=>!a.docChanged)||!n.fragment.firstChild)return;const i=s.tr;for(const a of Xe)a(n.fragment,i);if(e=!0,!!i.docChanged)return i}})]}}),Ge=v.createExtension(({editor:n,options:e})=>({key:"dropCursor",prosemirrorPlugins:[(e.dropCursor??be.dropCursor)({width:5,color:"#ddeeff",editor:n})]})),Je=v.createExtension(({editor:n})=>{const e=v.createStore(!1),o=()=>n.transact(t=>{var s;if(t.selection.empty||t.selection instanceof C.NodeSelection&&(t.selection.node.type.spec.content==="inline*"||((s=t.selection.node.firstChild)==null?void 0:s.type.spec.content)==="inline*")||t.selection instanceof C.TextSelection&&t.doc.textBetween(t.selection.from,t.selection.to).length===0)return!1;let r=!1;return t.selection.content().content.descendants(i=>(i.type.spec.code&&(r=!0),!r)),!r});return{key:"formattingToolbar",store:e,mount({dom:t,signal:r}){let s=!1;const i=n.onChange(()=>{s||e.setState(o())}),a=n.onSelectionChange(()=>{s||e.setState(o())});t.addEventListener("pointerdown",()=>{s=!0,e.setState(!1)},{signal:r}),n.prosemirrorView.root.addEventListener("pointerup",()=>{s=!1,n.isFocused()&&e.setState(o())},{signal:r,capture:!0}),t.addEventListener("pointercancel",()=>{s=!1},{signal:r,capture:!0}),r.addEventListener("abort",()=>{i(),a()})}}}),Qe=v.createExtension(()=>({key:"history",prosemirrorPlugins:[$.history()],undoCommand:$.undo,redoCommand:$.redo})),Ze=v.createExtension(({editor:n})=>{function e(r){let s=n.prosemirrorView.nodeDOM(r);for(;s&&s.parentElement;){if(s.nodeName==="A")return s;s=s.parentElement}return null}function o(r,s){return n.transact(i=>{const a=i.doc.resolve(r),c=a.marks().find(m=>m.type.name===s);if(!c)return;const l=V.getMarkRange(a,c.type);if(l)return{range:l,mark:c,get text(){return i.doc.textBetween(l.from,l.to)},get position(){return V.posToDOMRect(n.prosemirrorView,l.from,l.to).toJSON()}}})}function t(){return n.transact(r=>{const s=r.selection;if(s.empty)return o(s.anchor,"link")})}return{key:"linkToolbar",getLinkAtSelection:t,getLinkElementAtPos:e,getMarkAtPos:o,getLinkAtElement(r){return n.transact(()=>{const s=n.prosemirrorView.posAtDOM(r,0)+1;return o(s,"link")})},editLink(r,s,i=n.transact(a=>a.selection.anchor)){n.transact(a=>{const c=k.getPmSchema(a),{range:l}=o(i+1,"link")||{range:{from:a.selection.from,to:a.selection.to}};l&&(a.insertText(s,l.from,l.to),a.addMark(l.from,l.from+s.length,c.mark("link",{href:r})))}),n.prosemirrorView.focus()},deleteLink(r=n.transact(s=>s.selection.anchor)){n.transact(s=>{const i=k.getPmSchema(s),{range:a}=o(r+1,"link")||{range:{from:s.selection.from,to:s.selection.to}};a&&s.removeMark(a.from,a.to,i.marks.link).setMeta("preventAutolink",!0)}),n.prosemirrorView.focus()}}}),et=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],tt="https",ot=new C.PluginKey("node-selection-keyboard"),nt=v.createExtension(()=>({key:"nodeSelectionKeyboard",prosemirrorPlugins:[new C.Plugin({key:ot,props:{handleKeyDown:(n,e)=>{if("node"in n.state.selection){if(e.ctrlKey||e.metaKey)return!1;if(e.key.length===1)return e.preventDefault(),!0;if(e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){const o=n.state.tr;return n.dispatch(o.insert(n.state.tr.selection.$to.after(),n.state.schema.nodes.paragraph.createChecked()).setSelection(new C.TextSelection(o.doc.resolve(n.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),rt=new C.PluginKey("blocknote-placeholder"),st=v.createExtension(({editor:n,options:e})=>{const o=e.placeholders;return{key:"placeholder",prosemirrorPlugins:[new C.Plugin({key:rt,view:t=>{const r=`placeholder-selector-${ke.v4()}`;t.dom.classList.add(r);const s=document.createElement("style"),i=n._tiptapEditor.options.injectNonce;i&&s.setAttribute("nonce",i),t.root instanceof window.ShadowRoot?t.root.append(s):t.root.head.appendChild(s);const a=s.sheet,c=(l="")=>`.${r} .bn-block-content${l} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;try{const{default:l,emptyDocument:m,...h}=o||{};for(const[g,d]of Object.entries(h)){const p=`[data-content-type="${g}"]`;a.insertRule(`${c(p)} { content: ${JSON.stringify(d)}; }`)}const f="[data-is-only-empty-block]",u="[data-is-empty-and-focused]";a.insertRule(`${c(f)} { content: ${JSON.stringify(m)}; }`),a.insertRule(`${c(u)} { content: ${JSON.stringify(l)}; }`)}catch(l){console.warn("Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",l)}return{destroy:()=>{t.root instanceof window.ShadowRoot?t.root.removeChild(s):t.root.head.removeChild(s)}}},props:{decorations:t=>{const{doc:r,selection:s}=t;if(!n.isEditable||!s.empty||s.$from.parent.type.spec.code)return;const i=[];t.doc.content.size===6&&i.push(D.Decoration.node(2,4,{"data-is-only-empty-block":"true"}));const a=s.$anchor,c=a.parent;if(c.content.size===0){const l=a.before();i.push(D.Decoration.node(l,l+c.nodeSize,{"data-is-empty-and-focused":"true"}))}return D.DecorationSet.create(r,i)}}})]}}),Z=new C.PluginKey("previous-blocks"),it={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"},at=v.createExtension(()=>{let n;return{key:"previousBlockType",prosemirrorPlugins:[new C.Plugin({key:Z,view(e){return{update:async(o,t)=>{var r;((r=this.key)==null?void 0:r.getState(o.state).updatedBlocks.size)>0&&(n=setTimeout(()=>{o.dispatch(o.state.tr.setMeta(Z,{clearUpdate:!0}))},0))},destroy:()=>{n&&clearTimeout(n)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(e,o,t,r){if(o.currentTransactionOldBlockAttrs={},o.updatedBlocks.clear(),!e.docChanged||t.doc.eq(r.doc))return o;const s={},i=V.findChildren(t.doc,l=>l.attrs.id),a=new Map(i.map(l=>[l.node.attrs.id,l])),c=V.findChildren(r.doc,l=>l.attrs.id);for(const l of c){const m=a.get(l.node.attrs.id),h=m==null?void 0:m.node.firstChild,f=l.node.firstChild;if(m&&h&&f){const u={index:f.attrs.index,level:f.attrs.level,type:f.type.name,depth:r.doc.resolve(l.pos).depth},g={index:h.attrs.index,level:h.attrs.level,type:h.type.name,depth:t.doc.resolve(m.pos).depth};s[l.node.attrs.id]=g,o.currentTransactionOldBlockAttrs[l.node.attrs.id]=g,JSON.stringify(g)!==JSON.stringify(u)&&(g["depth-change"]=g.depth-u.depth,o.updatedBlocks.add(l.node.attrs.id))}}return o.prevTransactionOldBlockAttrs=s,o}},props:{decorations(e){const o=this.getState(e);if(o.updatedBlocks.size===0)return;const t=[];return e.doc.descendants((r,s)=>{if(!r.attrs.id||!o.updatedBlocks.has(r.attrs.id))return;const i=o.currentTransactionOldBlockAttrs[r.attrs.id],a={};for(const[l,m]of Object.entries(i))a["data-prev-"+it[l]]=m||"none";const c=D.Decoration.node(s,s+r.nodeSize,{...a});t.push(c)}),D.DecorationSet.create(e.doc,t)}}})]}});function de(n,e){var o,t;for(;n&&n.parentElement&&n.parentElement!==e.dom&&((o=n.getAttribute)==null?void 0:o.call(n,"data-node-type"))!=="blockContainer";)n=n.parentElement;if(((t=n.getAttribute)==null?void 0:t.call(n,"data-node-type"))==="blockContainer")return{node:n,id:n.getAttribute("data-id")}}class A extends C.Selection{constructor(o,t){super(o,t);b(this,"nodes");const r=o.node();this.nodes=[],o.doc.nodesBetween(o.pos,t.pos,(s,i,a)=>{if(a!==null&&a.eq(r))return this.nodes.push(s),!1})}static create(o,t,r=t){return new A(o.resolve(t),o.resolve(r))}content(){return new L.Slice(L.Fragment.from(this.nodes),0,0)}eq(o){if(!(o instanceof A)||this.nodes.length!==o.nodes.length||this.from!==o.from||this.to!==o.to)return!1;for(let t=0;t<this.nodes.length;t++)if(!this.nodes[t].eq(o.nodes[t]))return!1;return!0}map(o,t){const r=t.mapResult(this.from),s=t.mapResult(this.to);return s.deleted?C.Selection.near(o.resolve(r.pos)):r.deleted?C.Selection.near(o.resolve(s.pos)):new A(o.resolve(r.pos),o.resolve(s.pos))}toJSON(){return{type:"multiple-node",anchor:this.anchor,head:this.head}}}C.Selection.jsonID("multiple-node",A);let I;function lt(n,e){let o,t;const r=e.resolve(n.from).node().type.spec.group==="blockContent",s=e.resolve(n.to).node().type.spec.group==="blockContent",i=Math.min(n.$anchor.depth,n.$head.depth);if(r&&s){const a=n.$from.start(i-1),c=n.$to.end(i-1);o=e.resolve(a-1).pos,t=e.resolve(c+1).pos}else o=n.from,t=n.to;return{from:o,to:t}}function ee(n,e,o=e){e===o&&(o+=n.state.doc.resolve(e+1).node().nodeSize);const t=n.domAtPos(e).node.cloneNode(!0),r=n.domAtPos(e).node,s=(h,f)=>Array.prototype.indexOf.call(h.children,f),i=s(r,n.domAtPos(e+1).node.parentElement),a=s(r,n.domAtPos(o-1).node.parentElement);for(let h=r.childElementCount-1;h>=0;h--)(h>a||h<i)&&t.removeChild(t.children[h]);ue(n.root),I=t;const c=I.getElementsByTagName("iframe");for(let h=0;h<c.length;h++){const f=c[h],u=f.parentElement;u&&u.removeChild(f)}const m=n.dom.className.split(" ").filter(h=>h!=="ProseMirror"&&h!=="bn-root"&&h!=="bn-editor").join(" ");I.className=I.className+" bn-drag-preview "+m,n.root instanceof ShadowRoot?n.root.appendChild(I):n.root.body.appendChild(I)}function ue(n){I!==void 0&&(n instanceof ShadowRoot?n.removeChild(I):n.body.removeChild(I),I=void 0)}function ct(n,e,o){if(!n.dataTransfer||o.headless)return;const t=o.prosemirrorView,r=O.getNodeById(e.id,t.state.doc);if(!r)throw new Error(`Block with ID ${e.id} not found`);const s=r.posBeforeNode;if(s!=null){const i=t.state.selection,a=t.state.doc,{from:c,to:l}=lt(i,a),m=c<=s&&s<l,h=i.$anchor.node()!==i.$head.node()||i instanceof A;m&&h?(t.dispatch(t.state.tr.setSelection(A.create(a,c,l))),ee(t,c,l)):(t.dispatch(t.state.tr.setSelection(C.NodeSelection.create(t.state.doc,s))),ee(t,s));const f=t.state.selection.content(),u=o.pmSchema,g=t.serializeForClipboard(f).dom.innerHTML,d=K(u,o),p=le(f.content),w=d.exportBlocks(p,{}),y=Y(w);n.dataTransfer.clearData(),n.dataTransfer.setData("blocknote/html",g),n.dataTransfer.setData("text/html",w),n.dataTransfer.setData("text/plain",y),n.dataTransfer.effectAllowed="move",n.dataTransfer.setDragImage(I,0,0)}}const te=250;function q(n,e,o=!0){const t=n.root.elementsFromPoint(e.left,e.top);for(const r of t)if(n.dom.contains(r))return o&&r.closest("[data-node-type=columnList]")?q(n,{left:e.left+50,top:e.top},!1):de(r,n)}function dt(n,e){if(!e.dom.firstChild)return;const o=e.dom.firstChild.getBoundingClientRect(),t={left:Math.min(Math.max(o.left+10,n.x),o.right-10),top:n.y},r=q(e,t);if(!r)return;const s=r.node.getBoundingClientRect();return q(e,{left:s.right-10,top:n.y},!1)}class he{constructor(e,o,t){b(this,"state");b(this,"emitUpdate");b(this,"mousePos");b(this,"hoveredBlock");b(this,"menuFrozen",!1);b(this,"isDragOrigin",!1);b(this,"updateState",e=>{this.state=e,this.emitUpdate(this.state)});b(this,"updateStateFromMousePos",()=>{var t,r,s,i,a;if(this.menuFrozen||!this.mousePos)return;const e=this.findClosestEditorElement({clientX:this.mousePos.x,clientY:this.mousePos.y});if((e==null?void 0:e.element)!==this.pmView.dom||e.distance>te){(t=this.state)!=null&&t.show&&(this.state.show=!1,this.updateState(this.state));return}const o=dt(this.mousePos,this.pmView);if(!o||!this.editor.isEditable){(r=this.state)!=null&&r.show&&(this.state.show=!1,this.updateState(this.state));return}if(!((s=this.state)!=null&&s.show&&((i=this.hoveredBlock)!=null&&i.hasAttribute("data-id"))&&((a=this.hoveredBlock)==null?void 0:a.getAttribute("data-id"))===o.id)&&(this.hoveredBlock=o.node,this.editor.isEditable)){const c=o.node.getBoundingClientRect(),l=o.node.closest("[data-node-type=column]");this.state={show:!0,referencePos:new DOMRect(l?l.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,c.y,c.width,c.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))},this.updateState(this.state)}});b(this,"onDragStart",e=>{var i;const o=(i=e.dataTransfer)==null?void 0:i.getData("blocknote/html");if(!o||this.pmView.dragging)return;const t=document.createElement("div");t.innerHTML=o;const s=L.DOMParser.fromSchema(this.pmView.state.schema).parse(t,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new L.Slice(s.content,0,0),move:!0}});b(this,"findClosestEditorElement",e=>{const o=Array.from(this.pmView.root.querySelectorAll(".bn-editor"));if(o.length===0)return null;let t=o[0],r=Number.MAX_VALUE;return o.forEach(s=>{const i=s.querySelector(".bn-block-group").getBoundingClientRect(),a=e.clientX<i.left?i.left-e.clientX:e.clientX>i.right?e.clientX-i.right:0,c=e.clientY<i.top?i.top-e.clientY:e.clientY>i.bottom?e.clientY-i.bottom:0,l=Math.sqrt(Math.pow(a,2)+Math.pow(c,2));l<r&&(r=l,t=s)}),{element:t,distance:r}});b(this,"onDragOver",e=>{if(e.synthetic)return;const o=this.getDragEventContext(e);if(!o||!o.isDropPoint){this.closeDropCursor();return}o.isDropPoint&&!o.isDropWithinEditorBounds&&this.dispatchSyntheticEvent(e)});b(this,"closeDropCursor",()=>{const e=new Event("dragleave",{bubbles:!1});e.synthetic=!0,this.pmView.dom.dispatchEvent(e)});b(this,"getDragEventContext",e=>{var c;const o=!((c=e.dataTransfer)!=null&&c.types.includes("blocknote/html"))&&!!this.pmView.dragging,t=!!this.isDragOrigin,r=o||t,s=this.findClosestEditorElement(e);if(!s||s.distance>te)return;const i=s.element===this.pmView.dom,a=i&&s.distance===0;if(!(!i&&!r))return{isDropPoint:i,isDropWithinEditorBounds:a,isDragOrigin:r}});b(this,"onDrop",e=>{if(e.synthetic)return;const o=this.getDragEventContext(e);if(!o){this.closeDropCursor();return}const{isDropPoint:t,isDropWithinEditorBounds:r,isDragOrigin:s}=o;if(!r&&t&&this.dispatchSyntheticEvent(e),t){if(this.pmView.dragging)return;this.pmView.dispatch(this.pmView.state.tr.setSelection(C.TextSelection.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.anchor)));return}else if(s){setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0);return}});b(this,"onDragEnd",e=>{e.synthetic||(this.pmView.dragging=null)});b(this,"onKeyDown",e=>{var o;(o=this.state)!=null&&o.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});b(this,"onMouseMove",e=>{var s;if(this.menuFrozen)return;this.mousePos={x:e.clientX,y:e.clientY};const o=this.pmView.dom.getBoundingClientRect(),t=this.mousePos.x>o.left&&this.mousePos.x<o.right&&this.mousePos.y>o.top&&this.mousePos.y<o.bottom,r=this.pmView.dom.parentElement;if(t&&e&&e.target&&!(r===e.target||r.contains(e.target))){(s=this.state)!=null&&s.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});this.editor=e,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");t(this.state)},this.pmView.root.addEventListener("dragstart",this.onDragStart),this.pmView.root.addEventListener("dragover",this.onDragOver),this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragend",this.onDragEnd,!0),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0)}dispatchSyntheticEvent(e){const o=new Event(e.type,e),t=this.pmView.dom.firstChild.getBoundingClientRect();o.clientX=e.clientX,o.clientY=e.clientY,o.clientX=Math.min(Math.max(e.clientX,t.left),t.left+t.width),o.clientY=Math.min(Math.max(e.clientY,t.top),t.top+t.height),o.dataTransfer=e.dataTransfer,o.preventDefault=()=>e.preventDefault(),o.synthetic=!0,this.pmView.dom.dispatchEvent(o)}update(e,o){var r;!o.doc.eq(this.pmView.state.doc)&&((r=this.state)!=null&&r.show)&&this.updateStateFromMousePos()}destroy(){var e;(e=this.state)!=null&&e.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragstart",this.onDragStart),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("dragend",this.onDragEnd,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}}const me=new C.PluginKey("SideMenuPlugin"),ut=v.createExtension(({editor:n})=>{let e;const o=v.createStore(void 0);return{key:"sideMenu",store:o,prosemirrorPlugins:[new C.Plugin({key:me,view:t=>(e=new he(n,t,r=>{o.setState({...r})}),e)})],blockDragStart(t,r){e&&(e.isDragOrigin=!0),ct(t,r,n)},blockDragEnd(){ue(n.prosemirrorView.root),e&&(e.isDragOrigin=!1),n.blur()},freezeMenu(){e.menuFrozen=!0,e.state.show=!0,e.emitUpdate(e.state)},unfreezeMenu(){e.menuFrozen=!1,e.state.show=!1,e.emitUpdate(e.state)}}});let S;function oe(n){S||(S=document.createElement("div"),S.innerHTML="_",S.style.opacity="0",S.style.height="1px",S.style.width="1px",n instanceof Document?n.body.appendChild(S):n.appendChild(S))}function ht(n){S&&(n instanceof Document?n.body.removeChild(S):n.removeChild(S),S=void 0)}function F(n){return Array.prototype.indexOf.call(n.parentElement.childNodes,n)}function mt(n){let e=n;for(;e&&e.nodeName!=="TD"&&e.nodeName!=="TH"&&!e.classList.contains("tableWrapper");){if(e.classList.contains("ProseMirror"))return;const o=e.parentNode;if(!o||!(o instanceof Element))return;e=o}return e.nodeName==="TD"||e.nodeName==="TH"?{type:"cell",domNode:e,tbodyNode:e.closest("tbody")}:{type:"wrapper",domNode:e,tbodyNode:e.querySelector("tbody")}}function pt(n,e){const o=e.querySelectorAll(n);for(let t=0;t<o.length;t++)o[t].style.visibility="hidden"}class pe{constructor(e,o,t){b(this,"state");b(this,"emitUpdate");b(this,"tableId");b(this,"tablePos");b(this,"tableElement");b(this,"menuFrozen",!1);b(this,"mouseState","up");b(this,"prevWasEditable",null);b(this,"viewMousedownHandler",()=>{this.mouseState="down"});b(this,"mouseUpHandler",e=>{this.mouseState="up",this.mouseMoveHandler(e)});b(this,"mouseMoveHandler",e=>{var l,m,h,f,u,g,d;if(this.menuFrozen||this.mouseState==="selecting"||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;const o=mt(e.target);if((o==null?void 0:o.type)==="cell"&&this.mouseState==="down"&&!((l=this.state)!=null&&l.draggingState)){this.mouseState="selecting",(m=this.state)!=null&&m.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o||!this.editor.isEditable){(h=this.state)!=null&&h.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o.tbodyNode)return;const t=o.tbodyNode.getBoundingClientRect(),r=de(o.domNode,this.pmView);if(!r)return;this.tableElement=r.node;let s;const i=this.editor.transact(p=>O.getNodeById(r.id,p.doc));if(!i)throw new Error(`Block with ID ${r.id} not found`);const a=k.nodeToBlock(i.node,this.editor.pmSchema,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema);if(O.editorHasBlockWithType(this.editor,"table")&&(this.tablePos=i.posBeforeNode+1,s=a),!s)return;this.tableId=r.id;const c=(f=o.domNode.closest(".tableWrapper"))==null?void 0:f.querySelector(".table-widgets-container");if((o==null?void 0:o.type)==="wrapper"){const p=e.clientY>=t.bottom-1&&e.clientY<t.bottom+20,w=e.clientX>=t.right-1&&e.clientX<t.right+20,y=e.clientX>t.right||e.clientY>t.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:p,showAddOrRemoveColumnsButton:w,referencePosTable:t,block:s,widgetContainer:c,colIndex:y||(u=this.state)==null?void 0:u.colIndex,rowIndex:y||(g=this.state)==null?void 0:g.rowIndex,referencePosCell:y||(d=this.state)==null?void 0:d.referencePosCell}}else{const p=F(o.domNode),w=F(o.domNode.parentElement),y=o.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===r.id&&this.state.rowIndex===w&&this.state.colIndex===p)return;this.state={show:!0,showAddOrRemoveColumnsButton:p===s.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:w===s.content.rows.length-1,referencePosTable:t,block:s,draggingState:void 0,referencePosCell:y,colIndex:p,rowIndex:w,widgetContainer:c}}return this.emitUpdate(),!1});b(this,"dragOverHandler",e=>{var f;if(((f=this.state)==null?void 0:f.draggingState)===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect="move",pt(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const o={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},t=this.pmView.root.elementsFromPoint(o.left,o.top).filter(u=>u.tagName==="TD"||u.tagName==="TH");if(t.length===0)return;const r=t[0];let s=!1;const i=F(r.parentElement),a=F(r),c=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,m=(this.state.draggingState.draggedCellOrientation==="row"?i:a)!==c;(this.state.rowIndex!==i||this.state.colIndex!==a)&&(this.state.rowIndex=i,this.state.colIndex=a,this.state.referencePosCell=r.getBoundingClientRect(),s=!0);const h=this.state.draggingState.draggedCellOrientation==="row"?o.top:o.left;this.state.draggingState.mousePos!==h&&(this.state.draggingState.mousePos=h,s=!0),s&&this.emitUpdate(),m&&this.editor.transact(u=>u.setMeta(N,!0))});b(this,"dropHandler",e=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");e.preventDefault();const{draggingState:o,colIndex:t,rowIndex:r}=this.state,s=this.state.block.content.columnWidths;if(o.draggedCellOrientation==="row"){if(!k.canRowBeDraggedInto(this.state.block,o.originalIndex,r))return!1;const i=k.moveRow(this.state.block,o.originalIndex,r);this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,rows:i}})}else{if(!k.canColumnBeDraggedInto(this.state.block,o.originalIndex,t))return!1;const i=k.moveColumn(this.state.block,o.originalIndex,t),[a]=s.splice(o.originalIndex,1);s.splice(t,0,a),this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,columnWidths:s,rows:i}})}return this.editor.setTextCursorPosition(this.state.block.id),!0});this.editor=e,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");t(this.state)},o.dom.addEventListener("mousemove",this.mouseMoveHandler),o.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),o.root.addEventListener("dragover",this.dragOverHandler),o.root.addEventListener("drop",this.dropHandler)}update(){var r;if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block||this.state.block.type!=="table"||!((r=this.tableElement)!=null&&r.isConnected)){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}const{height:e,width:o}=k.getDimensionsOfTable(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=e&&(this.state.rowIndex=e-1),this.state.colIndex>=o&&(this.state.colIndex=o-1));const t=this.tableElement.querySelector("tbody");if(!t)throw new Error("Table block does not contain a 'tbody' HTML element. This should never happen.");if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){const i=t.children[this.state.rowIndex].children[this.state.colIndex];i?this.state.referencePosCell=i.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=t.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}}const N=new C.PluginKey("TableHandlesPlugin"),ft=v.createExtension(({editor:n})=>{let e;const o=v.createStore(void 0);return{key:"tableHandles",store:o,prosemirrorPlugins:[new C.Plugin({key:N,view:t=>(e=new pe(n,t,r=>{o.setState({...r,draggingState:r.draggingState?{...r.draggingState}:void 0})}),e),props:{decorations:t=>{if(e===void 0||e.state===void 0||e.state.draggingState===void 0||e.tablePos===void 0)return;const r=e.state.draggingState.draggedCellOrientation==="row"?e.state.rowIndex:e.state.colIndex;if(r===void 0)return;const s=[],{block:i,draggingState:a}=e.state,{originalIndex:c,draggedCellOrientation:l}=a;if(r===c||!i||l==="row"&&!k.canRowBeDraggedInto(i,c,r)||l==="col"&&!k.canColumnBeDraggedInto(i,c,r))return D.DecorationSet.create(t.doc,s);const m=t.doc.resolve(e.tablePos+1);return e.state.draggingState.draggedCellOrientation==="row"?k.getCellsAtRowHandle(e.state.block,r).forEach(({row:f,col:u})=>{const g=t.doc.resolve(m.posAtIndex(f)+1),d=t.doc.resolve(g.posAtIndex(u)+1),p=d.node(),w=d.pos+(r>c?p.nodeSize-2:0);s.push(D.Decoration.widget(w,()=>{const y=document.createElement("div");return y.className="bn-table-drop-cursor",y.style.left="0",y.style.right="0",r>c?y.style.bottom="-2px":y.style.top="-3px",y.style.height="4px",y}))}):k.getCellsAtColumnHandle(e.state.block,r).forEach(({row:f,col:u})=>{const g=t.doc.resolve(m.posAtIndex(f)+1),d=t.doc.resolve(g.posAtIndex(u)+1),p=d.node(),w=d.pos+(r>c?p.nodeSize-2:0);s.push(D.Decoration.widget(w,()=>{const y=document.createElement("div");return y.className="bn-table-drop-cursor",y.style.top="0",y.style.bottom="0",r>c?y.style.right="-2px":y.style.left="-3px",y.style.width="4px",y}))}),D.DecorationSet.create(t.doc,s)}}})],colDragStart(t){if(e===void 0||e.state===void 0||e.state.colIndex===void 0)throw new Error("Attempted to drag table column, but no table block was hovered prior.");e.state.draggingState={draggedCellOrientation:"col",originalIndex:e.state.colIndex,mousePos:t.clientX},e.emitUpdate(),n.transact(r=>r.setMeta(N,{draggedCellOrientation:e.state.draggingState.draggedCellOrientation,originalIndex:e.state.colIndex,newIndex:e.state.colIndex,tablePos:e.tablePos})),!n.headless&&(oe(n.prosemirrorView.root),t.dataTransfer.setDragImage(S,0,0),t.dataTransfer.effectAllowed="move")},rowDragStart(t){if(e.state===void 0||e.state.rowIndex===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");e.state.draggingState={draggedCellOrientation:"row",originalIndex:e.state.rowIndex,mousePos:t.clientY},e.emitUpdate(),n.transact(r=>r.setMeta(N,{draggedCellOrientation:e.state.draggingState.draggedCellOrientation,originalIndex:e.state.rowIndex,newIndex:e.state.rowIndex,tablePos:e.tablePos})),!n.headless&&(oe(n.prosemirrorView.root),t.dataTransfer.setDragImage(S,0,0),t.dataTransfer.effectAllowed="copyMove")},dragEnd(){if(e.state===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");e.state.draggingState=void 0,e.emitUpdate(),n.transact(t=>t.setMeta(N,null)),!n.headless&&ht(n.prosemirrorView.root)},freezeHandles(){e.menuFrozen=!0},unfreezeHandles(){e.menuFrozen=!1},getCellsAtRowHandle(t,r){return k.getCellsAtRowHandle(t,r)},getCellsAtColumnHandle(t,r){return k.getCellsAtColumnHandle(t,r)},setCellSelection(t,r,s=r){if(!e)throw new Error("Table handles view not initialized");const i=t.doc.resolve(e.tablePos+1),a=t.doc.resolve(i.posAtIndex(r.row)+1),c=t.doc.resolve(a.posAtIndex(r.col)),l=t.doc.resolve(i.posAtIndex(s.row)+1),m=t.doc.resolve(l.posAtIndex(s.col)),h=t.tr;return h.setSelection(new T.CellSelection(c,m)),t.apply(h)},addRowOrColumn(t,r){n.exec((s,i)=>{const a=this.setCellSelection(s,r.orientation==="row"?{row:t,col:0}:{row:0,col:t});return r.orientation==="row"?r.side==="above"?T.addRowBefore(a,i):T.addRowAfter(a,i):r.side==="left"?T.addColumnBefore(a,i):T.addColumnAfter(a,i)})},removeRowOrColumn(t,r){return r==="row"?n.exec((s,i)=>{const a=this.setCellSelection(s,{row:t,col:0});return T.deleteRow(a,i)}):n.exec((s,i)=>{const a=this.setCellSelection(s,{row:0,col:t});return T.deleteColumn(a,i)})},mergeCells(t){return n.exec((r,s)=>{const i=t?this.setCellSelection(r,t.relativeStartCell,t.relativeEndCell):r;return T.mergeCells(i,s)})},splitCell(t){return n.exec((r,s)=>{const i=t?this.setCellSelection(r,t):r;return T.splitCell(i,s)})},getCellSelection(){return n.transact(t=>{const r=t.selection;let s=r.$from,i=r.$to;if(O.isTableCellSelection(r)){const{ranges:d}=r;d.forEach(p=>{s=p.$from.min(s??p.$from),i=p.$to.max(i??p.$to)})}else if(s=t.doc.resolve(r.$from.pos-r.$from.parentOffset-1),i=t.doc.resolve(r.$to.pos-r.$to.parentOffset-1),s.pos===0||i.pos===0)return;const a=t.doc.resolve(s.pos-s.parentOffset-1),c=t.doc.resolve(i.pos-i.parentOffset-1),l=t.doc.resolve(a.pos-a.parentOffset-1),m=s.index(a.depth),h=a.index(l.depth),f=i.index(c.depth),u=c.index(l.depth),g=[];for(let d=h;d<=u;d++)for(let p=m;p<=f;p++)g.push({row:d,col:p});return{from:{row:h,col:m},to:{row:u,col:f},cells:g}})},getMergeDirection(t){return n.transact(r=>{const s=O.isTableCellSelection(r.selection)?r.selection:void 0;if(!s||!t||s.ranges.length<=1)return;const i=this.getCellSelection();if(i)return k.areInSameColumn(i.from,i.to,t)?"vertical":"horizontal"})},cropEmptyRowsOrColumns(t,r){return k.cropEmptyRowsOrColumns(t,r)},addRowsOrColumns(t,r,s){return k.addRowsOrColumns(t,r,s)}}}),ne=new C.PluginKey("trailingNode"),gt=v.createExtension(()=>({key:"trailingNode",prosemirrorPlugins:[new C.Plugin({key:ne,appendTransaction:(n,e,o)=>{const{doc:t,tr:r,schema:s}=o,i=ne.getState(o),a=t.content.size-2,c=s.nodes.blockContainer,l=s.nodes.paragraph;if(i)return r.insert(a,c.create(void 0,l.create()))},state:{init:(n,e)=>{},apply:(n,e)=>{if(!n.docChanged)return e;let o=n.doc.lastChild;if(!o||o.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(o=o.lastChild,!o||o.type.name!=="blockContainer")return!0;const t=o.firstChild;if(!t)throw new Error("Expected blockContent");return o.nodeSize>4||t.type.spec.content!=="inline*"}}})]}));exports.BlockChangeExtension=ze;exports.DEFAULT_LINK_PROTOCOL=tt;exports.DropCursorExtension=Ge;exports.ForkYDocExtension=Ye;exports.FormattingToolbarExtension=Je;exports.HistoryExtension=Qe;exports.LinkToolbarExtension=Ze;exports.NodeSelectionKeyboardExtension=nt;exports.PlaceholderExtension=st;exports.PreviousBlockTypeExtension=at;exports.SchemaMigration=We;exports.SideMenuExtension=ut;exports.SideMenuView=he;exports.TableHandlesExtension=ft;exports.TableHandlesView=pe;exports.TrailingNodeExtension=gt;exports.VALID_LINK_PROTOCOLS=et;exports.YCursorExtension=z;exports.YSyncExtension=_;exports.YUndoExtension=U;exports.blocksToMarkdown=$e;exports.cleanHTMLToMarkdown=Y;exports.createExternalHTMLExporter=K;exports.fragmentToBlocks=le;exports.getBlocksChangedByTransaction=ae;exports.sideMenuPluginKey=me;exports.tableHandlesPluginKey=N;
|
|
2
|
-
//# sourceMappingURL=TrailingNode-CaT_wbho.cjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";var Tt=Object.defineProperty;var At=(e,t,n)=>t in e?Tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var P=(e,t,n)=>At(e,typeof t!="symbol"?t+"":t,n);const A=require("prosemirror-tables"),S=require("@tiptap/core"),R=require("prosemirror-state"),H=require("prosemirror-view"),be=require("prosemirror-transform"),j=require("y-prosemirror"),y=require("./BlockNoteExtension-BWw0r8Gy.cjs"),m=require("./blockToNode-w7H99R6p.cjs"),It=require("@tiptap/extension-bold"),Pt=require("@tiptap/extension-code"),Nt=require("@tiptap/extension-italic"),Ht=require("@tiptap/extension-strike"),_t=require("@tiptap/extension-underline"),x=require("prosemirror-model"),Dt=require("prosemirror-highlight"),Ot=require("prosemirror-highlight/shiki"),U=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},Vt=U(It),Rt=U(Pt),Ft=U(Nt),Wt=U(Ht),qt=U(_t),Ce=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function T(e,t="Ctrl"){return Ce()?e.replace("Mod","⌘"):e.replace("Mod",t)}function F(...e){return[...new Set(e.filter(t=>t).join(" ").split(" "))].join(" ")}const Ut=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function ke(e,t,n,o){const r=document.createElement("div");r.className=F("bn-block-content",n.class),r.setAttribute("data-content-type",e);for(const[i,s]of Object.entries(n))i!=="class"&&r.setAttribute(i,s);const a=document.createElement(t);a.className=F("bn-inline-content",o.class);for(const[i,s]of Object.entries(o))i!=="class"&&a.setAttribute(i,s);return r.appendChild(a),{dom:r,contentDOM:a}}const J=(e,t)=>{let n=m.blockToNode(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 ye(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 a=n[r];o.innerHTML+=t+a.innerHTML,a.remove()}}}function q(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $t(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function jt(e){var n;const t=["mp4","webm","ogg","mov","mkv","flv","avi","wmv","m4v"];try{const r=((n=new URL(e).pathname.split(".").pop())==null?void 0:n.toLowerCase())||"";return t.includes(r)}catch{return!1}}function ve(e){const t={};return Object.entries(e).forEach(([n,o])=>{t[n]={default:o.default,keepOnSplit:!0,parseHTML:r=>{const a=r.getAttribute(q(n));if(a===null)return null;if(o.default===void 0&&o.type==="boolean"||o.default!==void 0&&typeof o.default=="boolean")return a==="true"?!0:a==="false"?!1:null;if(o.default===void 0&&o.type==="number"||o.default!==void 0&&typeof o.default=="number"){const i=parseFloat(a);return!Number.isNaN(i)&&Number.isFinite(i)?i:null}return a},renderHTML:r=>r[n]!==o.default?{[q(n)]:r[n]}:{}}}),t}function Se(e,t,n,o){const r=e();if(r===void 0)throw new Error("Cannot find node position");const i=n.state.doc.resolve(r).node().attrs.id;if(!i)throw new Error("Block doesn't have id");const s=t.getBlock(i);if(s.type!==o)throw new Error("Block type does not match");return s}function Z(e,t,n,o,r=!1,a){const i=document.createElement("div");if(a!==void 0)for(const[s,c]of Object.entries(a))s!=="class"&&i.setAttribute(s,c);i.className=F("bn-block-content",(a==null?void 0:a.class)||""),i.setAttribute("data-content-type",t);for(const[s,c]of Object.entries(n)){const u=o[s].default;c!==u&&i.setAttribute(q(s),c)}return r&&i.setAttribute("data-file-block",""),i.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=F("bn-inline-content",e.contentDOM.className)),{...e,dom:i}}function Ee(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,render:J,toExternalHTML:J},extensions:n}}function xe(e,t){e.stopEvent=n=>(n.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function Me(e,t){const n=[{tag:"[data-content-type="+e.type+"]",contentElement:".bn-inline-content"}];return t.parse&&n.push({tag:"*",getAttrs(o){var a;if(typeof o=="string")return!1;const r=(a=t.parse)==null?void 0:a.call(t,o);return r===void 0?!1:r},getContent:e.content==="inline"||e.content==="none"?(o,r)=>{var a;if(t.parseContent)return t.parseContent({el:o,schema:r});if(e.content==="inline"){const s=o.cloneNode(!0);return ye(s,(a=t.meta)!=null&&a.code?`
|
|
2
|
-
`:"<br>"),x.DOMParser.fromSchema(r).parse(s,{topNode:r.nodes.paragraph.create()}).content}return x.Fragment.empty}:void 0}),n}function Gt(e,t,n,o){var a,i,s,c;const r=t.node||S.Node.create({name:e.type,content:e.content==="inline"?"inline*":e.content==="none"?"":e.content,group:"blockContent",selectable:((a=t.meta)==null?void 0:a.selectable)??!0,isolating:((i=t.meta)==null?void 0:i.isolating)??!0,code:((s=t.meta)==null?void 0:s.code)??!1,defining:((c=t.meta)==null?void 0:c.defining)??!0,priority:o,addAttributes(){return ve(e.propSchema)},parseHTML(){return Me(e,t)},renderHTML({HTMLAttributes:l}){var d;const u=document.createElement("div");return Z({dom:u,contentDOM:e.content==="inline"?u:void 0},e.type,{},e.propSchema,((d=t.meta)==null?void 0:d.fileBlockAccept)!==void 0,l)},addNodeView(){return l=>{var f,M;const u=this.options.editor,d=Se(l.getPos,u,this.editor,e.type),p=((f=this.options.domAttributes)==null?void 0:f.blockContent)||{},h=t.render.call({blockContentDOMAttributes:p,props:l,renderType:"nodeView"},d,u);return((M=t.meta)==null?void 0:M.selectable)===!1&&xe(h,this.editor),h}}});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:{...t,node:r,render(l,u){var p;const d=((p=r.options.domAttributes)==null?void 0:p.blockContent)||{};return t.render.call({blockContentDOMAttributes:d,props:void 0,renderType:"dom"},l,u)},toExternalHTML:(l,u)=>{var p,h;const d=((p=r.options.domAttributes)==null?void 0:p.blockContent)||{};return((h=t.toExternalHTML)==null?void 0:h.call({blockContentDOMAttributes:d},l,u))??t.render.call({blockContentDOMAttributes:d,renderType:"dom",props:void 0},l,u)}},extensions:n}}function Zt(e){return e}function E(e,t,n){return(o={})=>{const r=typeof e=="function"?e(o):e,a=typeof t=="function"?t(o):t,i=n?typeof n=="function"?n(o):n:void 0;return{config:r,implementation:{...a,toExternalHTML(s,c){var u,d;const l=(u=a.toExternalHTML)==null?void 0:u.call({blockContentDOMAttributes:this.blockContentDOMAttributes},s,c);if(l!==void 0)return Z(l,s.type,s.props,r.propSchema,((d=a.meta)==null?void 0:d.fileBlockAccept)!==void 0)},render(s,c){var d;const l=a.render.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},s,c);return Z(l,s.type,s.props,r.propSchema,((d=a.meta)==null?void 0:d.fileBlockAccept)!==void 0,this.blockContentDOMAttributes)}},extensions:i}}}function zt(e,t,n,o){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(n).filter(([r,a])=>{const i=o[r];return a!==i.default}).map(([r,a])=>[q(r),a]).forEach(([r,a])=>e.dom.setAttribute(r,a)),e.contentDOM&&e.contentDOM.setAttribute("data-editable",""),e}function Kt(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 Le(e,t){return{config:e,implementation:t}}function Xt(e,t,n){return Le({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{...n,node:e})}function we(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.config]))}function Be(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 W(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 te(e,t){return{config:e,implementation:t}}function O(e,t){return te({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 a=o.pmSchema.mark(e.name,{stringValue:n}),i=x.DOMSerializer.renderSpec(document,r(a,!0));if(typeof i!="object"||!("dom"in i))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 i},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 a=o.pmSchema.mark(e.name,{stringValue:n}),i=x.DOMSerializer.renderSpec(document,r(a,!0));if(typeof i!="object"||!("dom"in i))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 i}})}function Te(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.config]))}function Ae(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:"*",consuming:!1,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 ne(e,t){const n=S.Mark.create({name:e.type,addAttributes(){return Be(e.propSchema)},parseHTML(){return Ae(e,t.parse)},renderHTML({mark:o}){const r=(t.toExternalHTML||t.render)(o.attrs.stringValue);return W(r,e.type,o.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:o})=>{const r=t.render(o.attrs.stringValue);return W(r,e.type,o.attrs.stringValue,e.propSchema)}}});return te(e,{...t,mark:n,render:o=>{const r=t.render(o);return W(r,e.type,o,e.propSchema)},toExternalHTML:o=>{const r=(t.toExternalHTML||t.render)(o);return W(r,e.type,o,e.propSchema)}})}function Ie(e,t){let n,o;if(t.firstChild.descendants((r,a)=>n?!1:!Pe(r)||r.attrs.id!==e?!0:(n=r,o=a+1,!1)),!(n===void 0||o===void 0))return{node:n,posBeforeNode:o}}function Pe(e){return e.type.isInGroup("bnBlock")}const Qt=(e,t)=>({tr:n,dispatch:o})=>(o&&z(n,e,t),!0);function z(e,t,n,o,r){const a=m.getBlockInfoFromResolvedPos(e.doc.resolve(t));let i=null;a.blockNoteType==="table"&&(i=Ne(e));const s=m.getPmSchema(e);if(o!==void 0&&r!==void 0&&o>r)throw new Error("Invalid replaceFromPos or replaceToPos");const c=s.nodes[a.blockNoteType],l=s.nodes[n.type||a.blockNoteType],u=l.isInGroup("bnBlock")?l:s.nodes.blockContainer;if(a.isBlockContainer&&l.isInGroup("blockContent")){const d=o!==void 0&&o>a.blockContent.beforePos&&o<a.blockContent.afterPos?o-a.blockContent.beforePos-1:void 0,p=r!==void 0&&r>a.blockContent.beforePos&&r<a.blockContent.afterPos?r-a.blockContent.beforePos-1:void 0;ue(n,e,a),Yt(n,e,c,l,a,d,p)}else if(!a.isBlockContainer&&l.isInGroup("bnBlock"))ue(n,e,a);else{const d=m.nodeToBlock(a.bnBlock.node,s);e.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,m.blockToNode({children:d.children,...n},s));return}e.setNodeMarkup(a.bnBlock.beforePos,u,{...a.bnBlock.node.attrs,...n.props}),i&&en(e,a,i)}function Yt(e,t,n,o,r,a,i){const s=m.getPmSchema(t);let c="keep";if(e.content)if(typeof e.content=="string")c=m.inlineContentToNodes([e.content],s,o.name);else if(Array.isArray(e.content))c=m.inlineContentToNodes(e.content,s,o.name);else if(e.content.type==="tableContent")c=m.tableContentToNodes(e.content,s);else throw new m.UnreachableCaseError(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(a!==void 0||i!==void 0){t.setNodeMarkup(r.blockContent.beforePos,o,{...r.blockContent.node.attrs,...e.props});const l=r.blockContent.beforePos+1+(a??0),u=r.blockContent.beforePos+1+(i??r.blockContent.node.content.size),d=t.doc.resolve(r.blockContent.beforePos).depth,p=t.doc.resolve(l).depth,h=t.doc.resolve(u).depth;t.replace(l,u,new x.Slice(x.Fragment.from(c),p-d-1,h-d-1))}else t.replaceWith(r.blockContent.beforePos,r.blockContent.afterPos,o.createChecked({...r.blockContent.node.attrs,...e.props},c))}function ue(e,t,n){const o=m.getPmSchema(t);if(e.children!==void 0&&e.children.length>0){const r=e.children.map(a=>m.blockToNode(a,o));if(n.childContainer)t.step(new be.ReplaceStep(n.childContainer.beforePos+1,n.childContainer.afterPos-1,new x.Slice(x.Fragment.from(r),0,0)));else{if(!n.isBlockContainer)throw new Error("impossible");t.insert(n.blockContent.afterPos,o.nodes.blockGroup.createChecked({},r))}}}function Jt(e,t,n,o,r){const a=typeof t=="string"?t:t.id,i=Ie(a,e.doc);if(!i)throw new Error(`Block with ID ${a} not found`);z(e,i.posBeforeNode,n,o,r);const s=e.doc.resolve(i.posBeforeNode+1).node(),c=m.getPmSchema(e);return m.nodeToBlock(s,c)}function Ne(e){const t="selection"in e?e.selection:null;if(!(t instanceof R.TextSelection))return null;const n=e.doc.resolve(t.head);let o=-1,r=-1;for(let w=n.depth;w>=0;w--){const L=n.node(w).type.name;if(o<0&&(L==="tableCell"||L==="tableHeader")&&(o=w),L==="table"){r=w;break}}if(o<0||r<0)return null;const a=n.before(o),i=n.before(r),s=e.doc.nodeAt(i);if(!s||s.type.name!=="table")return null;const c=A.TableMap.get(s),l=a-(i+1),u=c.map.indexOf(l);if(u<0)return null;const d=Math.floor(u/c.width),p=u%c.width,f=a+1+1,M=Math.max(0,t.head-f);return{row:d,col:p,offset:M}}function en(e,t,n){var w;if(t.blockNoteType!=="table")return!1;let o=-1;if(t.isBlockContainer)o=e.mapping.map(t.blockContent.beforePos);else{const L=e.mapping.map(t.bnBlock.beforePos),D=L+(((w=e.doc.nodeAt(L))==null?void 0:w.nodeSize)||0);e.doc.nodesBetween(L,D,(b,B)=>b.type.name==="table"?(o=B,!1):!0)}const r=o>=0?e.doc.nodeAt(o):null;if(!r||r.type.name!=="table")return!1;const a=A.TableMap.get(r),i=Math.max(0,Math.min(n.row,a.height-1)),s=Math.max(0,Math.min(n.col,a.width-1)),c=i*a.width+s,l=a.map[c];if(l==null)return!1;const d=o+1+l+1,p=e.doc.nodeAt(d),h=d+1,f=p?p.content.size:0,M=h+Math.max(0,Math.min(n.offset,f));return"selection"in e&&e.setSelection(R.TextSelection.create(e.doc,M)),!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"}},tn={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"}},g={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},v=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=g.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},N=(e,t)=>{e.backgroundColor&&e.backgroundColor!==g.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in I?I[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==g.textColor.default&&(t.style.color=e.textColor in I?I[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==g.textAlignment.default&&(t.style.textAlign=e.textAlignment)},nn=(e="backgroundColor")=>({default:g.backgroundColor.default,parseHTML:t=>t.hasAttribute("data-background-color")?t.getAttribute("data-background-color"):t.style.backgroundColor?t.style.backgroundColor:g.backgroundColor.default,renderHTML:t=>t[e]===g.backgroundColor.default?{}:{"data-background-color":t[e]}}),on=(e="textColor")=>({default:g.textColor.default,parseHTML:t=>t.hasAttribute("data-text-color")?t.getAttribute("data-text-color"):t.style.color?t.style.color:g.textColor.default,renderHTML:t=>t[e]===g.textColor.default?{}:{"data-text-color":t[e]}}),rn=(e="textAlignment")=>({default:g.textAlignment.default,parseHTML:t=>t.hasAttribute("data-text-alignment")?t.getAttribute("data-text-alignment"):t.style.textAlign?t.style.textAlign:g.textAlignment.default,renderHTML:t=>t[e]===g.textAlignment.default?{}:{"data-text-alignment":t[e]}}),K=(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}},V=y.createExtension(({editor:e})=>{const t=y.createStore(void 0);function n(){t.setState(void 0)}return{key:"filePanel",store:t,mount({signal:o}){const r=e.onChange(n,!1),a=e.onSelectionChange(n,!1);o.addEventListener("abort",()=>{r(),a()})},closeMenu:n,showMenu(o){t.setState(o)}}}),an=(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 a=document.createElement("p");a.className="bn-add-file-button-text",a.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(a);const i=c=>{c.preventDefault(),c.stopPropagation()},s=()=>{var c;t.isEditable&&((c=t.getExtension(V))==null||c.showMenu(e.id))};return o.addEventListener("mousedown",i,!0),o.addEventListener("click",s,!0),{dom:o,destroy:()=>{o.removeEventListener("mousedown",i,!0),o.removeEventListener("click",s,!0)}}},sn='<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>',cn=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=sn,t.appendChild(n);const o=document.createElement("p");return o.className="bn-file-name",o.textContent=e.props.name,t.appendChild(o),{dom:t}},oe=(e,t,n,o)=>{const r=document.createElement("div");if(r.className="bn-file-block-content-wrapper",e.props.url===""){const i=an(e,t,o);r.appendChild(i.dom);const s=t.onUploadStart(c=>{if(c===e.id){r.removeChild(i.dom);const l=document.createElement("div");l.className="bn-file-loading-preview",l.textContent="Loading...",r.appendChild(l)}});return{dom:r,destroy:()=>{s(),i.destroy()}}}const a={dom:r};if(e.props.showPreview===!1||!n){const i=cn(e);r.appendChild(i.dom),a.destroy=()=>{var s;(s=i.destroy)==null||s.call(i)}}else r.appendChild(n.dom);if(e.props.caption){const i=document.createElement("p");i.className="bn-file-caption",i.textContent=e.props.caption,r.appendChild(i)}return a},re=(e,t)=>{const n=document.createElement("figure"),o=document.createElement("figcaption");return o.textContent=t,n.appendChild(e),n.appendChild(o),{dom:n}},X=(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}),He='<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>',_e=e=>({type:"audio",propSchema:{backgroundColor:g.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},content:"none"}),De=(e={})=>t=>{if(t.tagName==="AUDIO"){if(t.closest("figure"))return;const{backgroundColor:n}=v(t);return{...ee(t),backgroundColor:n}}if(t.tagName==="FIGURE"){const n=K(t,"audio");if(!n)return;const{targetElement:o,caption:r}=n,{backgroundColor:a}=v(t);return{...ee(o),backgroundColor:a,caption:r}}},Oe=(e={})=>(t,n)=>{const o=document.createElement("div");o.innerHTML=e.icon??He;const r=document.createElement("audio");return r.className="bn-audio",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(a=>{r.src=a}):r.src=t.props.url,r.controls=!0,r.contentEditable="false",r.draggable=!1,oe(t,n,{dom:r},o.firstElementChild)},Ve=(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?re(o,t.props.caption):X(o,t.props.caption):{dom:o}},Re=E(_e,e=>({meta:{fileBlockAccept:["audio/*"]},parse:De(e),render:Oe(e),toExternalHTML:Ve(e),runsBefore:["file"]})),pe=Symbol.for("blocknote.shikiParser"),Y=Symbol.for("blocknote.shikiHighlighterPromise");function ln(e){const t=globalThis;let n,o,r=!1;const a=i=>{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[Y]=t[Y]||e.createHighlighter(),t[Y].then(c=>{n=c});const s=ae(e,i.language);return!s||s==="text"||s==="none"||s==="plaintext"||s==="txt"?[]:n.getLoadedLanguages().includes(s)?(o||(o=t[pe]||Ot.createParser(n),t[pe]=o),o(i)):n.loadLanguage(s)};return Dt.createHighlightPlugin({parser:a,languageExtractor:i=>i.attrs.language,nodeTypes:["codeBlock"]})}const Fe=({defaultLanguage:e="text"})=>({type:"codeBlock",propSchema:{language:{default:e}},content:"inline"}),We=E(Fe,e=>({meta:{code:!0,defining:!0,isolating:!1},parse:t=>{var r,a;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")||((a=n.className.split(" ").find(i=>i.includes("language-")))==null?void 0:a.replace("language-",""))}},parseContent:({el:t,schema:n})=>{const o=x.DOMParser.fromSchema(n),r=t.firstElementChild;return o.parse(r,{preserveWhitespace:"full",topNode:n.nodes.codeBlock.create()}).content},render(t,n){const o=document.createDocumentFragment(),r=document.createElement("pre"),a=document.createElement("code");r.appendChild(a);let i;if(e.supportedLanguages){const s=document.createElement("select");Object.entries(e.supportedLanguages??{}).forEach(([u,{name:d}])=>{const p=document.createElement("option");p.value=u,p.text=d,s.appendChild(p)}),s.value=t.props.language||e.defaultLanguage||"text";const c=u=>{const d=u.target.value;n.updateBlock(t.id,{props:{language:d}})};s.addEventListener("change",c),i=()=>s.removeEventListener("change",c);const l=document.createElement("div");l.contentEditable="false",l.appendChild(s),o.appendChild(l)}return o.appendChild(r),{dom:o,contentDOM:a,destroy:()=>{i==null||i()}}},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=>[y.createExtension({key:"code-block-highlighter",prosemirrorPlugins:[ln(e)]}),y.createExtension({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:a}=n.selection,i=a.parentOffset===a.parent.nodeSize-2,s=a.parent.textContent.endsWith(`
|
|
3
|
-
|
|
4
|
-
`);if(i&&s){if(n.delete(a.pos-2,a.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(`
|
|
5
|
-
`),!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:ae(e,n)??n}.language},content:[]}}}]})]);function ae(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 qe=()=>({type:"divider",propSchema:{},content:"none"}),Ue=E(qe,{meta:{isolating:!1},parse(e){if(e.tagName==="HR")return{}},render(){return{dom:document.createElement("hr")}}},[y.createExtension({key:"divider-block-shortcuts",inputRules:[{find:new RegExp("^---$"),replace(){return{type:"divider",props:{},content:[]}}}]})]),fe=e=>({url:e.src||void 0}),$e=()=>({type:"file",propSchema:{backgroundColor:g.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},content:"none"}),je=()=>e=>{if(e.tagName==="EMBED"){if(e.closest("figure"))return;const{backgroundColor:t}=v(e);return{...fe(e),backgroundColor:t}}if(e.tagName==="FIGURE"){const t=K(e,"embed");if(!t)return;const{targetElement:n,caption:o}=t,{backgroundColor:r}=v(e);return{...fe(n),backgroundColor:r,caption:o}}},Ge=E($e,{meta:{fileBlockAccept:["*/*"]},parse:je(),render(e,t){return oe(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?X(t,e.props.caption):{dom:t}}}),Ze={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?"true":"false"),get:e=>window.localStorage.getItem(`toggle-${e.id}`)==="true"},ie=(e,t,n,o=Ze)=>{if("isToggleable"in e.props&&!e.props.isToggleable)return{dom:n};const r=document.createElement("div"),a=document.createElement("div");a.className="bn-toggle-wrapper";const i=document.createElement("button");i.className="bn-toggle-button",i.type="button",i.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 s=f=>f.preventDefault();i.addEventListener("mousedown",s);const c=()=>{var f;a.getAttribute("data-show-children")==="true"?(a.setAttribute("data-show-children","false"),o.set(t.getBlock(e),!1),r.contains(l)&&r.removeChild(l)):(a.setAttribute("data-show-children","true"),o.set(t.getBlock(e),!0),t.isEditable&&((f=t.getBlock(e))==null?void 0:f.children.length)===0&&!r.contains(l)&&r.appendChild(l))};i.addEventListener("click",c),a.appendChild(i),a.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 u=f=>f.preventDefault();l.addEventListener("mousedown",u);const d=()=>{t.transact(()=>{const f=t.updateBlock(e,{children:[{}]});t.setTextCursorPosition(f.children[0].id,"end"),t.focus()})};l.addEventListener("click",d),r.appendChild(a);let p=e.children.length;const h=t.onChange(()=>{var M;const f=((M=t.getBlock(e))==null?void 0:M.children.length)??0;f>p?(a.getAttribute("data-show-children")==="false"&&(a.setAttribute("data-show-children","true"),o.set(t.getBlock(e),!0)),r.contains(l)&&r.removeChild(l)):f===0&&f<p&&(a.getAttribute("data-show-children")==="true"&&(a.setAttribute("data-show-children","false"),o.set(t.getBlock(e),!1)),r.contains(l)&&r.removeChild(l)),p=f});return o.get(e)?(a.setAttribute("data-show-children","true"),t.isEditable&&e.children.length===0&&r.appendChild(l)):a.setAttribute("data-show-children","false"),{dom:r,ignoreMutation:f=>f instanceof MutationRecord&&(f.type==="attributes"&&f.target===a&&f.attributeName==="data-show-children"||f.type==="childList"&&(f.addedNodes[0]===l||f.removedNodes[0]===l)),destroy:()=>{i.removeEventListener("mousedown",s),i.removeEventListener("click",c),l.removeEventListener("mousedown",u),l.removeEventListener("click",d),h==null||h()}}},ze=[1,2,3,4,5,6],dn=e=>({editor:t})=>{const n=t.getTextCursorPosition();return t.schema.blockSchema[n.block.type].content!=="inline"?!1:(t.updateBlock(n.block,{type:"heading",props:{level:e}}),!0)},Ke=({defaultLevel:e=1,levels:t=ze,allowToggleHeadings:n=!0}={})=>({type:"heading",propSchema:{...g,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:"inline"}),Xe=E(Ke,({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{...v(t),level:n}},render(t,n){const o=document.createElement(`h${t.props.level}`);return e?{...ie(t,n,o),contentDOM:o}:{dom:o,contentDOM:o}},toExternalHTML(t){const n=document.createElement(`h${t.props.level}`);return N(t.props,n),{dom:n,contentDOM:n}}}),({levels:e=ze}={})=>[y.createExtension({key:"heading-shortcuts",keyboardShortcuts:Object.fromEntries(e.map(t=>[`Mod-Alt-${t}`,dn(t)])??[]),inputRules:e.map(t=>({find:new RegExp(`^(#{${t}})\\s$`),replace({match:n}){return{type:"heading",props:{level:n[1].length}}}}))})]),Qe=(e,t,n,o,r)=>{const{dom:a,destroy:i}=oe(e,t,n,r),s=a;s.style.position="relative",e.props.url&&e.props.showPreview&&(e.props.previewWidth?s.style.width=`${e.props.previewWidth}px`:s.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 u=document.createElement("div");u.style.position="absolute",u.style.height="100%",u.style.width="100%";let d,p=e.props.previewWidth;const h=b=>{var le,de;if(!d){!t.isEditable&&o.contains(c)&&o.contains(l)&&(o.removeChild(c),o.removeChild(l));return}let B;const $="touches"in b?b.touches[0].clientX:b.clientX;e.props.textAlignment==="center"?d.handleUsed==="left"?B=d.initialWidth+(d.initialClientX-$)*2:B=d.initialWidth+($-d.initialClientX)*2:d.handleUsed==="left"?B=d.initialWidth+d.initialClientX-$:B=d.initialWidth+$-d.initialClientX,p=Math.min(Math.max(B,64),((de=(le=t.domElement)==null?void 0:le.firstElementChild)==null?void 0:de.clientWidth)||Number.MAX_VALUE),s.style.width=`${p}px`},f=b=>{(!b.target||!s.contains(b.target)||!t.isEditable)&&o.contains(c)&&o.contains(l)&&(o.removeChild(c),o.removeChild(l)),d&&(d=void 0,s.contains(u)&&s.removeChild(u),t.updateBlock(e,{props:{previewWidth:p}}))},M=()=>{t.isEditable&&(o.appendChild(c),o.appendChild(l))},w=b=>{b.relatedTarget===c||b.relatedTarget===l||d||t.isEditable&&o.contains(c)&&o.contains(l)&&(o.removeChild(c),o.removeChild(l))},L=b=>{b.preventDefault(),s.contains(u)||s.appendChild(u);const B="touches"in b?b.touches[0].clientX:b.clientX;d={handleUsed:"left",initialWidth:s.clientWidth,initialClientX:B}},D=b=>{b.preventDefault(),s.contains(u)||s.appendChild(u);const B="touches"in b?b.touches[0].clientX:b.clientX;d={handleUsed:"right",initialWidth:s.clientWidth,initialClientX:B}};return window.addEventListener("mousemove",h),window.addEventListener("touchmove",h),window.addEventListener("mouseup",f),window.addEventListener("touchend",f),s.addEventListener("mouseenter",M),s.addEventListener("mouseleave",w),c.addEventListener("mousedown",L),c.addEventListener("touchstart",L),l.addEventListener("mousedown",D),l.addEventListener("touchstart",D),{dom:s,destroy:()=>{i==null||i(),window.removeEventListener("mousemove",h),window.removeEventListener("touchmove",h),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),s.removeEventListener("mouseenter",M),s.removeEventListener("mouseleave",w),c.removeEventListener("mousedown",L),c.removeEventListener("touchstart",L),l.removeEventListener("mousedown",D),l.removeEventListener("touchstart",D)}}},ge=e=>{const t=e.src||void 0,n=e.width||void 0,o=e.alt||void 0;return{url:t,previewWidth:n,name:o}},Ye='<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>',Je=(e={})=>({type:"image",propSchema:{textAlignment:g.textAlignment,backgroundColor:g.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:void 0,type:"number"}},content:"none"}),et=(e={})=>t=>{if(t.tagName==="IMG"){if(t.closest("figure"))return;const{backgroundColor:n}=v(t);return{...ge(t),backgroundColor:n}}if(t.tagName==="FIGURE"){const n=K(t,"img");if(!n)return;const{targetElement:o,caption:r}=n,{backgroundColor:a}=v(t);return{...ge(o),backgroundColor:a,caption:r}}},tt=(e={})=>(t,n)=>{const o=document.createElement("div");o.innerHTML=e.icon??Ye;const r=document.createElement("div");r.className="bn-visual-media-wrapper";const a=document.createElement("img");return a.className="bn-visual-media",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(i=>{a.src=i}):a.src=t.props.url,a.alt=t.props.name||t.props.caption||"BlockNote image",a.contentEditable="false",a.draggable=!1,r.appendChild(a),Qe(t,n,{dom:r},r,o.firstElementChild)},nt=(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?re(o,t.props.caption):X(o,t.props.caption):{dom:o}},ot=E(Je,e=>({meta:{fileBlockAccept:["image/*"]},parse:et(e),render:tt(e),toExternalHTML:nt(e),runsBefore:["file"]})),un=(e,t,n)=>({state:o,dispatch:r})=>r?rt(o.tr,e,t,n):!0,rt=(e,t,n,o)=>{const r=m.getNearestBlockPos(e.doc,t),a=m.getBlockInfo(r);if(!a.isBlockContainer)return!1;const i=m.getPmSchema(e),s=[{type:a.bnBlock.node.type,attrs:o?{...a.bnBlock.node.attrs,id:void 0}:{}},{type:n?a.blockContent.node.type:i.nodes.paragraph,attrs:o?{...a.blockContent.node.attrs}:{}}];return e.split(t,2,s),!0},Q=(e,t)=>{const{blockInfo:n,selectionEmpty:o}=e.transact(i=>({blockInfo:m.getBlockInfoFromTransaction(i),selectionEmpty:i.selection.anchor===i.selection.head}));if(!n.isBlockContainer)return!1;const{bnBlock:r,blockContent:a}=n;return a.node.type.name!==t||!o?!1:a.node.childCount===0?(e.transact(i=>{z(i,r.beforePos,{type:"paragraph",props:{}})}),!0):a.node.childCount>0?e.transact(i=>(i.deleteSelection(),rt(i,i.selection.from,!0))):!1};function se(e,t,n){var d,p,h;const o=x.DOMParser.fromSchema(t),r=e,a=document.createElement("div");a.setAttribute("data-node-type","blockGroup");for(const f of Array.from(r.childNodes))a.appendChild(f.cloneNode(!0));let i=o.parse(a,{topNode:t.nodes.blockGroup.create()});((p=(d=i.firstChild)==null?void 0:d.firstChild)==null?void 0:p.type.name)==="checkListItem"&&(i=i.copy(i.content.cut(i.firstChild.firstChild.nodeSize+2)));const s=(h=i.firstChild)==null?void 0:h.firstChild;if(!(s!=null&&s.isTextblock))return x.Fragment.from(i);const c=t.nodes[n].create({},s.content),l=i.content.cut(s.nodeSize+2);if(l.size>0){const f=i.copy(l);return c.content.addToEnd(f)}return c.content}const at=()=>({type:"bulletListItem",propSchema:{...g},content:"inline"}),it=E(at,{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 v(e)},parseContent:({el:e,schema:t})=>se(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 N(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[y.createExtension({key:"bullet-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>Q(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({editor:e}){if(m.getBlockInfoFromSelection(e.prosemirrorState).blockNoteType!=="heading")return{type:"bulletListItem",props:{}}}}]})]),st=()=>({type:"checkListItem",propSchema:{...g,checked:{default:!1,type:"boolean"}},content:"inline"}),ct=E(st,{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:{...v(e),checked:o.checked}}},parseContent:({el:e,schema:t})=>se(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 N(e.props,t),t.appendChild(n),t.appendChild(o),{dom:t,contentDOM:o}},runsBefore:["bulletListItem"]},[y.createExtension({key:"check-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>Q(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 lt(e,t,n,o){let r=e.firstChild.attrs.start||1,a=!0;const i=!!e.firstChild.attrs.start,s=m.getBlockInfo({posBeforeNode:t,node:e});if(!s.isBlockContainer)throw new Error("impossible");const c=n.doc.resolve(s.bnBlock.beforePos).nodeBefore,l=c?o.get(c):void 0;return l!==void 0?(r=l+1,a=!1):c&&m.getBlockInfo({posBeforeNode:s.bnBlock.beforePos-c.nodeSize,node:c}).blockNoteType==="numberedListItem"&&(r=lt(c,s.bnBlock.beforePos-c.nodeSize,n,o).index+1,a=!1),o.set(e,r),{index:r,isFirst:a,hasStart:i}}function he(e,t){const n=new Map,o=t.decorations.map(e.mapping,e.doc),r=[];e.doc.nodesBetween(0,e.doc.nodeSize-2,(i,s)=>{if(i.type.name==="blockContainer"&&i.firstChild.type.name==="numberedListItem"){const{index:c,isFirst:l,hasStart:u}=lt(i,s,e,n);if(o.find(s,s+i.nodeSize,p=>p.index===c&&p.isFirst===l&&p.hasStart===u).length===0){const p=e.doc.nodeAt(s+1);r.push(H.Decoration.node(s+1,s+1+p.nodeSize,{"data-index":c.toString()}))}}});const a=r.flatMap(i=>o.find(i.from,i.to));return{decorations:o.remove(a).add(e.doc,r)}}const pn=()=>new R.Plugin({key:new R.PluginKey("numbered-list-indexing-decorations"),state:{init(e,t){return he(t.tr,{decorations:H.DecorationSet.empty})},apply(e,t){return!e.docChanged&&!e.selectionSet&&t.decorations?t:he(e,t)}},props:{decorations(e){var t;return((t=this.getState(e))==null?void 0:t.decorations)??H.DecorationSet.empty}}}),dt=()=>({type:"numberedListItem",propSchema:{...g,start:{default:void 0,type:"number"}},content:"inline"}),ut=E(dt,{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=v(e);return e.previousElementSibling||o===1?r:{...r,start:o}}},parseContent:({el:e,schema:t})=>se(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 N(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[y.createExtension({key:"numbered-list-item-shortcuts",inputRules:[{find:new RegExp("^(\\d+)\\.\\s$"),replace({match:e,editor:t}){if(m.getBlockInfoFromSelection(t.prosemirrorState).blockNoteType==="heading")return;const o=parseInt(e[1]);return{type:"numberedListItem",props:{start:o!==1?o:void 0}}}}],keyboardShortcuts:{Enter:({editor:e})=>Q(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)}},prosemirrorPlugins:[pn()]})]),pt=()=>({type:"toggleListItem",propSchema:{...g},content:"inline"}),ft=E(pt,{meta:{isolating:!1},render(e,t){const n=document.createElement("p");return{...ie(e,t,n),contentDOM:n}},toExternalHTML(e){const t=document.createElement("li"),n=document.createElement("p");return N(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[y.createExtension({key:"toggle-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>Q(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)}}})]),gt=()=>({type:"paragraph",propSchema:g,content:"inline"}),ht=E(gt,{meta:{isolating:!1},parse:e=>{var t;if(e.tagName==="P"&&(t=e.textContent)!=null&&t.trim())return v(e)},render:()=>{const e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML:e=>{const t=document.createElement("p");return N(e.props,t),{dom:t,contentDOM:t}},runsBefore:["default"]},[y.createExtension({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)}}})]),mt=()=>({type:"quote",propSchema:{backgroundColor:g.backgroundColor,textColor:g.textColor},content:"inline"}),bt=E(mt,{meta:{isolating:!1},parse(e){if(e.tagName==="BLOCKQUOTE"){const{backgroundColor:t,textColor:n}=v(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 N(e.props,t),{dom:t,contentDOM:t}}},[y.createExtension({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:{}}}}]})]),fn=35,ce=120,gn=31,hn=S.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[A.columnResizing({cellMinWidth:fn,defaultCellMinWidth:ce,View:null}),A.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})=>A.goToNextCell(1)(e,t,n)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>A.goToNextCell(-1)(e,t,n))}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:S.callOrReturn(S.getExtensionField(e,"tableRole",t))}}}),Ct={textColor:g.textColor},mn=S.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)=>kt(e,t)}]},renderHTML({HTMLAttributes:e}){return["th",S.mergeAttributes(this.options.HTMLAttributes,e),0]}}),bn=S.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)=>kt(e,t)}]},renderHTML({HTMLAttributes:e}){return["td",S.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Cn=S.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,a,i;const n=ke(this.name,"table",{...((r=this.options.domAttributes)==null?void 0:r.blockContent)||{},...t},((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{}),o=document.createElement("colgroup");for(const s of e.children[0].children)if(s.attrs.colwidth)for(const l of s.attrs.colwidth){const u=document.createElement("col");l&&(u.style=`width: ${l}px`),o.appendChild(u)}else o.appendChild(document.createElement("col"));return(i=n.dom.firstChild)==null||i.appendChild(o),n},addNodeView(){return({node:e,HTMLAttributes:t})=>{var o;class n extends A.TableView{constructor(a,i,s){super(a,i),this.node=a,this.cellMinWidth=i,this.blockContentHTMLAttributes=s;const c=document.createElement("div");c.className=F("bn-block-content",s.class),c.setAttribute("data-content-type","table");for(const[p,h]of Object.entries(s))p!=="class"&&c.setAttribute(p,h);const l=this.dom,u=document.createElement("div");u.className="tableWrapper-inner",u.appendChild(l.firstChild),l.appendChild(u),c.appendChild(l);const d=document.createElement("div");d.className="table-widgets-container",d.style.position="relative",l.appendChild(d),this.dom=c}ignoreMutation(a){return!a.target.closest(".tableWrapper-inner")||super.ignoreMutation(a)}}return new n(e,ce,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t})}}}),kn=S.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]}}),yn=S.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",S.mergeAttributes(this.options.HTMLAttributes,e),0]}});function kt(e,t){const o=x.DOMParser.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return o.content.descendants(a=>{if(a.isInline)return r.push(a),!1}),x.Fragment.fromArray(r)}const yt=()=>Ee({node:Cn,type:"table",content:"table"},Ct,[y.createExtension({key:"table-extensions",tiptapExtensions:[hn,kn,mn,bn,yn]}),y.createExtension({key:"table-keyboard-delete",keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof A.CellSelection))return!1;const t=e.getTextCursorPosition().block,n=t.content;let o=0;for(const a of n.rows)for(const i of a.cells){if("type"in i&&i.content.length>0||!("type"in i)&&i.length>0)return!1;o++}let r=0;return e.prosemirrorState.selection.forEachCell(()=>{r++}),r<o?!1:(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})]),me=e=>{const t=e.src||void 0,n=e.width||void 0;return{url:t,previewWidth:n}},vt='<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>',St=e=>({type:"video",propSchema:{textAlignment:g.textAlignment,backgroundColor:g.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:void 0,type:"number"}},content:"none"}),Et=e=>t=>{if(t.tagName==="VIDEO"){if(t.closest("figure"))return;const{backgroundColor:n}=v(t);return{...me(t),backgroundColor:n}}if(t.tagName==="FIGURE"){const n=K(t,"video");if(!n)return;const{targetElement:o,caption:r}=n,{backgroundColor:a}=v(t);return{...me(o),backgroundColor:a,caption:r}}},xt=E(St,e=>({meta:{fileBlockAccept:["video/*"]},parse:Et(),render(t,n){const o=document.createElement("div");o.innerHTML=e.icon??vt;const r=document.createElement("div");r.className="bn-visual-media-wrapper";const a=document.createElement("video");return a.className="bn-visual-media",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(i=>{a.src=i}):a.src=t.props.url,a.controls=!0,a.contentEditable="false",a.draggable=!1,a.width=t.props.previewWidth,r.appendChild(a),Qe(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?re(n,t.props.caption):X(n,t.props.caption):{dom:n}},runsBefore:["file"]}));function k(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!==void 0&&typeof e.schema.blockSpecs[t].config.propSchema[o].default!==r||e.schema.blockSpecs[t].config.propSchema[o].type!==void 0&&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"){for(const a of r.values)if(!e.schema.blockSpecs[t].config.propSchema[o].values.includes(a))return!1}}}return!0}function vn(e,t,n,o){return k(t,n,o)&&e.type===n}function Sn(e){return e instanceof A.CellSelection}const G=new Map;function En(e){if(G.has(e))return G.get(e);const t=new be.Mapping;return e._tiptapEditor.on("transaction",({transaction:n})=>{t.appendMapping(n.mapping)}),e._tiptapEditor.on("destroy",()=>{G.delete(e)}),G.set(e,t),t}function Mt(e,t,n="left"){const o=j.ySyncPluginKey.getState(e.prosemirrorState);if(!o){const a=En(e),i=a.maps.length;return()=>a.slice(i).map(t,n==="left"?-1:1)}const r=j.absolutePositionToRelativePosition(t+(n==="right"?1:-1),o.binding.type,o.binding.mapping);return()=>{const a=j.ySyncPluginKey.getState(e.prosemirrorState),i=j.relativePositionToAbsolutePosition(a.doc,a.binding.type,r,a.binding.mapping);if(i===null)throw new Error("Position not found, cannot track positions");return i+(n==="right"?-1:1)}}const xn=S.findParentNode(e=>e.type.name==="blockContainer");class Mn{constructor(t,n,o){P(this,"state");P(this,"emitUpdate");P(this,"rootEl");P(this,"pluginState");P(this,"handleScroll",()=>{var t,n;if((t=this.state)!=null&&t.show){const o=(n=this.rootEl)==null?void 0:n.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!o)return;this.state.referencePos=o.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter)}});P(this,"closeMenu",()=>{this.editor.transact(t=>t.setMeta(_,null))});P(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(t=>t.selection.from)}).run()});var r;this.editor=t,this.pluginState=void 0,this.emitUpdate=a=>{var i;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");n(a,{...this.state,ignoreQueryLength:(i=this.pluginState)==null?void 0:i.ignoreQueryLength})},this.rootEl=o.root,(r=this.rootEl)==null||r.addEventListener("scroll",this.handleScroll,!0)}update(t,n){var l;const o=_.getState(n),r=_.getState(t.state),a=o===void 0&&r!==void 0,i=o!==void 0&&r===void 0;if(!a&&!(o!==void 0&&r!==void 0)&&!i)return;if(this.pluginState=i?o:r,i||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}const c=(l=this.rootEl)==null?void 0:l.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&c&&(this.state={show:!0,referencePos:c.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var t;(t=this.rootEl)==null||t.removeEventListener("scroll",this.handleScroll,!0)}}const _=new R.PluginKey("SuggestionMenuPlugin"),Lt=y.createExtension(({editor:e})=>{const t=[];let n;const o=y.createStore(void 0);return{key:"suggestionMenu",store:o,addTriggerCharacter:r=>{t.push(r)},removeTriggerCharacter:r=>{t.splice(t.indexOf(r),1)},closeMenu:()=>{n==null||n.closeMenu()},clearQuery:()=>{n==null||n.clearQuery()},shown:()=>{var r;return((r=n==null?void 0:n.state)==null?void 0:r.show)||!1},openSuggestionMenu:(r,a)=>{e.headless||(e.focus(),e.transact(i=>{a!=null&&a.deleteTriggerCharacter&&i.insertText(r),i.scrollIntoView().setMeta(_,{triggerCharacter:r,deleteTriggerCharacter:(a==null?void 0:a.deleteTriggerCharacter)||!1,ignoreQueryLength:(a==null?void 0:a.ignoreQueryLength)||!1})}))},prosemirrorPlugins:[new R.Plugin({key:_,view:r=>(n=new Mn(e,(a,i)=>{o.setState({...i,triggerCharacter:a})},r),n),state:{init(){},apply:(r,a,i,s)=>{if(r.selection.$from.parent.type.spec.code)return a;const c=r.getMeta(_);if(typeof c=="object"&&c!==null){a&&(n==null||n.closeMenu());const u=Mt(e,s.selection.from-c.triggerCharacter.length);return{triggerCharacter:c.triggerCharacter,deleteTriggerCharacter:c.deleteTriggerCharacter!==!1,queryStartPos:()=>u()+c.triggerCharacter.length,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:c==null?void 0:c.ignoreQueryLength}}if(a===void 0)return a;if(s.selection.from!==s.selection.to||c===null||r.getMeta("focus")||r.getMeta("blur")||r.getMeta("pointer")||a.triggerCharacter!==void 0&&s.selection.from<a.queryStartPos()||!s.selection.$from.sameParent(s.doc.resolve(a.queryStartPos())))return;const l={...a};return l.query=s.doc.textBetween(a.queryStartPos(),s.selection.from),l}},props:{handleTextInput(r,a,i,s){if(a===i){const c=r.state.doc;for(const l of t){const u=l.length>1?c.textBetween(a-l.length,a)+s:s;if(l===u)return r.dispatch(r.state.tr.insertText(s)),r.dispatch(r.state.tr.setMeta(_,{triggerCharacter:u}).scrollIntoView()),!0}}return!1},decorations(r){const a=this.getState(r);if(a===void 0)return null;if(!a.deleteTriggerCharacter){const i=xn(r.selection);if(i)return H.DecorationSet.create(r.doc,[H.Decoration.node(i.pos,i.pos+i.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}return H.DecorationSet.create(r.doc,[H.Decoration.inline(a.queryStartPos()-a.triggerCharacter.length,a.queryStartPos(),{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}}})]}});function Ln(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 C(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&&m.isStyledTextInlineContent(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)),Ln(e),o}function wn(e){const t=[];return k(e,"heading",{level:"number"})&&t.push({onItemClick:()=>{C(e,{type:"heading",props:{level:1}})},badge:T("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{C(e,{type:"heading",props:{level:2}})},badge:T("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{C(e,{type:"heading",props:{level:3}})},badge:T("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),k(e,"quote")&&t.push({onItemClick:()=>{C(e,{type:"quote"})},key:"quote",...e.dictionary.slash_menu.quote}),k(e,"toggleListItem")&&t.push({onItemClick:()=>{C(e,{type:"toggleListItem"})},badge:T("Mod-Shift-6"),key:"toggle_list",...e.dictionary.slash_menu.toggle_list}),k(e,"numberedListItem")&&t.push({onItemClick:()=>{C(e,{type:"numberedListItem"})},badge:T("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),k(e,"bulletListItem")&&t.push({onItemClick:()=>{C(e,{type:"bulletListItem"})},badge:T("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),k(e,"checkListItem")&&t.push({onItemClick:()=>{C(e,{type:"checkListItem"})},badge:T("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),k(e,"paragraph")&&t.push({onItemClick:()=>{C(e,{type:"paragraph"})},badge:T("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),k(e,"codeBlock")&&t.push({onItemClick:()=>{C(e,{type:"codeBlock"})},badge:T("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),k(e,"divider")&&t.push({onItemClick:()=>{C(e,{type:"divider"})},key:"divider",...e.dictionary.slash_menu.divider}),k(e,"table")&&t.push({onItemClick:()=>{C(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),k(e,"image",{url:"string"})&&t.push({onItemClick:()=>{var o;const n=C(e,{type:"image"});(o=e.getExtension(V))==null||o.showMenu(n.id)},key:"image",...e.dictionary.slash_menu.image}),k(e,"video",{url:"string"})&&t.push({onItemClick:()=>{var o;const n=C(e,{type:"video"});(o=e.getExtension(V))==null||o.showMenu(n.id)},key:"video",...e.dictionary.slash_menu.video}),k(e,"audio",{url:"string"})&&t.push({onItemClick:()=>{var o;const n=C(e,{type:"audio"});(o=e.getExtension(V))==null||o.showMenu(n.id)},key:"audio",...e.dictionary.slash_menu.audio}),k(e,"file",{url:"string"})&&t.push({onItemClick:()=>{var o;const n=C(e,{type:"file"});(o=e.getExtension(V))==null||o.showMenu(n.id)},key:"file",...e.dictionary.slash_menu.file}),k(e,"heading",{level:"number",isToggleable:"boolean"})&&t.push({onItemClick:()=>{C(e,{type:"heading",props:{level:1,isToggleable:!0}})},key:"toggle_heading",...e.dictionary.slash_menu.toggle_heading},{onItemClick:()=>{C(e,{type:"heading",props:{level:2,isToggleable:!0}})},key:"toggle_heading_2",...e.dictionary.slash_menu.toggle_heading_2},{onItemClick:()=>{C(e,{type:"heading",props:{level:3,isToggleable:!0}})},key:"toggle_heading_3",...e.dictionary.slash_menu.toggle_heading_3}),k(e,"heading",{level:"number"})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(n=>n>3).forEach(n=>{t.push({onItemClick:()=>{C(e,{type:"heading",props:{level:n}})},key:`heading_${n}`,...e.dictionary.slash_menu[`heading_${n}`]})}),t.push({onItemClick:()=>{var n;(n=e.getExtension(Lt))==null||n.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function Bn(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)}const Tn={audio:Re(),bulletListItem:it(),checkListItem:ct(),codeBlock:We(),divider:Ue(),file:Ge(),heading:Xe(),image:ot(),numberedListItem:ut(),paragraph:ht(),quote:bt(),table:yt(),toggleListItem:ft(),video:xt()},An=ne({type:"textColor",propSchema:"string"},{render:()=>{const e=document.createElement("span");return{dom:e,contentDOM:e}},toExternalHTML:e=>{const t=document.createElement("span");return e!==g.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}}),In=ne({type:"backgroundColor",propSchema:"string"},{render:()=>{const e=document.createElement("span");return{dom:e,contentDOM:e}},toExternalHTML:e=>{const t=document.createElement("span");return e!==g.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}}),wt={bold:O(Vt.default,"boolean"),italic:O(Ft.default,"boolean"),underline:O(qt.default,"boolean"),strike:O(Wt.default,"boolean"),code:O(Rt.default,"boolean"),textColor:An,backgroundColor:In},Pn=Te(wt),Bt={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},Nn=we(Bt);exports.COLORS_DARK_MODE_DEFAULT=tn;exports.COLORS_DEFAULT=I;exports.EMPTY_CELL_HEIGHT=gn;exports.EMPTY_CELL_WIDTH=ce;exports.FILE_AUDIO_ICON_SVG=He;exports.FILE_IMAGE_ICON_SVG=Ye;exports.FILE_VIDEO_ICON_SVG=vt;exports.FilePanelExtension=V;exports.SuggestionMenu=Lt;exports.addDefaultPropsExternalHTML=N;exports.addInlineContentAttributes=zt;exports.addInlineContentKeyboardShortcuts=Kt;exports.addNodeAndExtensionsToSpec=Gt;exports.addStyleAttributes=W;exports.applyNonSelectableBlockFix=xe;exports.audioParse=De;exports.audioRender=Oe;exports.audioToExternalHTML=Ve;exports.blockHasType=vn;exports.camelToDataKebab=q;exports.captureCellAnchor=Ne;exports.createAudioBlockConfig=_e;exports.createAudioBlockSpec=Re;exports.createBlockConfig=Zt;exports.createBlockSpec=E;exports.createBlockSpecFromTiptapNode=Ee;exports.createBulletListItemBlockConfig=at;exports.createBulletListItemBlockSpec=it;exports.createCheckListItemBlockSpec=ct;exports.createCheckListItemConfig=st;exports.createCodeBlockConfig=Fe;exports.createCodeBlockSpec=We;exports.createDefaultBlockDOMOutputSpec=ke;exports.createDividerBlockConfig=qe;exports.createDividerBlockSpec=Ue;exports.createFileBlockConfig=$e;exports.createFileBlockSpec=Ge;exports.createHeadingBlockConfig=Ke;exports.createHeadingBlockSpec=Xe;exports.createImageBlockConfig=Je;exports.createImageBlockSpec=ot;exports.createInlineContentSpecFromTipTapNode=Xt;exports.createInternalInlineContentSpec=Le;exports.createInternalStyleSpec=te;exports.createNumberedListItemBlockConfig=dt;exports.createNumberedListItemBlockSpec=ut;exports.createParagraphBlockConfig=gt;exports.createParagraphBlockSpec=ht;exports.createQuoteBlockConfig=mt;exports.createQuoteBlockSpec=bt;exports.createStyleSpec=ne;exports.createStyleSpecFromTipTapMark=O;exports.createTableBlockSpec=yt;exports.createToggleListItemBlockConfig=pt;exports.createToggleListItemBlockSpec=ft;exports.createToggleWrapper=ie;exports.createVideoBlockConfig=St;exports.createVideoBlockSpec=xt;exports.defaultBlockSpecs=Tn;exports.defaultBlockToHTML=J;exports.defaultInlineContentSchema=Nn;exports.defaultInlineContentSpecs=Bt;exports.defaultProps=g;exports.defaultStyleSchema=Pn;exports.defaultStyleSpecs=wt;exports.defaultToggledState=Ze;exports.editorHasBlockWithType=k;exports.fileParse=je;exports.filenameFromURL=$t;exports.filterSuggestionItems=Bn;exports.formatKeyboardShortcut=T;exports.getBackgroundColorAttribute=nn;exports.getBlockFromPos=Se;exports.getDefaultSlashMenuItems=wn;exports.getInlineContentSchemaFromSpecs=we;exports.getLanguageId=ae;exports.getNodeById=Ie;exports.getParseRules=Me;exports.getStyleParseRules=Ae;exports.getStyleSchemaFromSpecs=Te;exports.getTextAlignmentAttribute=rn;exports.getTextColorAttribute=on;exports.imageParse=et;exports.imageRender=tt;exports.imageToExternalHTML=nt;exports.insertOrUpdateBlockForSlashMenu=C;exports.isAppleOS=Ce;exports.isNodeBlock=Pe;exports.isSafari=Ut;exports.isTableCellSelection=Sn;exports.isVideoUrl=jt;exports.mergeCSSClasses=F;exports.mergeParagraphs=ye;exports.parseAudioElement=ee;exports.parseDefaultProps=v;exports.propsToAttributes=ve;exports.splitBlockCommand=un;exports.stylePropsToAttributes=Be;exports.tablePropSchema=Ct;exports.trackPosition=Mt;exports.updateBlock=Jt;exports.updateBlockCommand=Qt;exports.updateBlockTr=z;exports.videoParse=Et;exports.wrapInBlockStructure=Z;
|
|
6
|
-
//# sourceMappingURL=defaultBlocks-BxFclIGP.cjs.map
|