@blocknote/core 0.15.0 → 0.15.3
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/README.md +1 -1
- package/dist/blocknote.js +596 -574
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +7 -7
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +37 -0
- package/src/extensions/SideMenu/SideMenuPlugin.ts +13 -2
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +23 -11
- package/src/i18n/locales/en.ts +1 -1
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +1 -0
- package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +1 -1
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bn-block-outer{line-height:1.5;transition:margin .2s}.bn-block{display:flex;flex-direction:column}.bn-block-content{display:flex;padding:3px 0;transition:font-size .2s;width:100%}.bn-block-content:before{transition:all .2s}.bn-block-content.ProseMirror-selectednode>*,.ProseMirror-selectednode>.bn-block-content>*{border-radius:4px;outline:4px solid rgb(100,160,255)}.bn-block-group .bn-block-group{margin-left:1.5em}.bn-block-group .bn-block-group>.bn-block-outer{position:relative}.bn-block-group .bn-block-group>.bn-block-outer:not([data-prev-depth-changed]):before{content:" ";display:inline;position:absolute;left:-20px;height:100%;transition:all .2s .1s}.bn-block-group .bn-block-group>.bn-block-outer[data-prev-depth-change="-2"]:before{height:0}.bn-inline-content code{font-family:monospace}[data-prev-depth-change="1"]{--x: 1}[data-prev-depth-change="2"]{--x: 2}[data-prev-depth-change="3"]{--x: 3}[data-prev-depth-change="4"]{--x: 4}[data-prev-depth-change="5"]{--x: 5}[data-prev-depth-change="-1"]{--x: -1}[data-prev-depth-change="-2"]{--x: -2}[data-prev-depth-change="-3"]{--x: -3}[data-prev-depth-change="-4"]{--x: -4}[data-prev-depth-change="-5"]{--x: -5}.bn-block-outer[data-prev-depth-change]{margin-left:calc(10px * var(--x))}.bn-block-outer[data-prev-depth-change] .bn-block-outer[data-prev-depth-change]{margin-left:0}[data-level="1"]{--level: 3em}[data-level="2"]{--level: 2em}[data-level="3"]{--level: 1.3em}[data-prev-level="1"]{--prev-level: 3em}[data-prev-level="2"]{--prev-level: 2em}[data-prev-level="3"]{--prev-level: 1.3em}.bn-block-outer[data-prev-type=heading]>.bn-block>.bn-block-content{font-size:var(--prev-level);font-weight:700}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=heading]{font-size:var(--level);font-weight:700}.bn-block-content:before{margin-right:0;content:""}.bn-block-content[data-content-type=numberedListItem]{display:flex;gap:.5em}[data-content-type=numberedListItem]{--index: attr(data-index)}[data-prev-type=numberedListItem]{--prev-index: attr(data-prev-index)}.bn-block-outer[data-prev-type=numberedListItem]:not([data-prev-index=none])>.bn-block>.bn-block-content:before{content:var(--prev-index) "."}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=numberedListItem]:before{content:var(--index) "."}.bn-block-content[data-content-type=bulletListItem]{display:flex;gap:.5em}.bn-block-content[data-content-type=checkListItem]>div{display:flex}.bn-block-content[data-content-type=checkListItem]>div>div>input{margin:0;margin-inline-end:.5em;cursor:pointer}.bn-block-content[data-content-type=checkListItem][data-checked=true] .bn-inline-content{text-decoration:line-through}.bn-block-content[data-text-alignment=center]{justify-content:center}.bn-block-content[data-text-alignment=right]{justify-content:flex-end}.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before{content:"•"}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before{content:"•"}[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before{content:"◦"}[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before{content:"◦"}[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before{content:"▪"}[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before{content:"▪"}[data-file-block] .bn-file-block-content-wrapper:has(.bn-add-file-button),[data-file-block] .bn-file-block-content-wrapper:has(.bn-file-default-preview){width:100%}[data-file-block] .bn-file-block-content-wrapper{cursor:pointer;display:flex;flex-direction:column;justify-content:stretch;-webkit-user-select:none;user-select:none}[data-file-block] .bn-add-file-button{align-items:center;background-color:#f2f1ee;border-radius:4px;color:#7d797a;display:flex;flex-direction:row;gap:10px;padding:12px;width:100%}.bn-editor[contenteditable=true] [data-file-block] .bn-add-file-button:hover{background-color:#e1e1e1}[data-file-block] .bn-add-file-button-icon{width:24px;height:24px}[data-file-block] .bn-add-file-button .bn-add-file-button-text{font-size:.9rem}[data-file-block] .bn-file-and-caption-wrapper{display:flex;flex-direction:column;border-radius:4px}[data-file-block] .bn-file-default-preview{align-items:center;border-radius:4px;display:flex;flex-direction:row;gap:4px;padding:4px;width:100%}[data-file-block] .bn-file-default-preview:hover,.ProseMirror-selectednode .bn-file-default-preview{background-color:#e1e1e1}[data-file-block] .bn-file-default-preview-icon{width:24px;height:24px}[data-file-block] .bn-visual-media-wrapper{display:flex;flex-direction:row;align-items:center;position:relative;width:fit-content}[data-file-block] .bn-visual-media{border-radius:4px;max-width:100%}[data-file-block] .bn-visual-media-resize-handle{position:absolute;width:8px;height:30px;background-color:#000;border:1px solid white;border-radius:4px;cursor:ew-resize}[data-content-type=audio]>.bn-file-block-content-wrapper,.bn-audio{width:100%}[data-file-block] .bn-file-caption{font-size:.8em;padding-block:4px}[data-file-block] .bn-file-caption:empty{padding-block:0}.bn-inline-content:has(>.ProseMirror-trailingBreak:only-child):before{pointer-events:none;height:0;position:absolute;font-style:italic}[data-text-color=gray]{color:#9b9a97}[data-text-color=brown]{color:#64473a}[data-text-color=red]{color:#e03e3e}[data-text-color=orange]{color:#d9730d}[data-text-color=yellow]{color:#dfab01}[data-text-color=green]{color:#4d6461}[data-text-color=blue]{color:#0b6e99}[data-text-color=purple]{color:#6940a5}[data-text-color=pink]{color:#ad1a72}[data-background-color=gray]{background-color:#ebeced}[data-background-color=brown]{background-color:#e9e5e3}[data-background-color=red]{background-color:#fbe4e4}[data-background-color=orange]{background-color:#faebdd}[data-background-color=yellow]{background-color:#fbf3db}[data-background-color=green]{background-color:#ddedea}[data-background-color=blue]{background-color:#ddebf1}[data-background-color=purple]{background-color:#eae4f2}[data-background-color=pink]{background-color:#f4dfeb}[data-text-alignment=left]{justify-content:flex-start;text-align:left}[data-text-alignment=center]{justify-content:center;text-align:center}[data-text-alignment=right]{justify-content:flex-end;text-align:right}[data-text-alignment=justify]{justify-content:flex-start;text-align:justify}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:"";left:0;right:0;top:0;bottom:0;background
|
|
1
|
+
.bn-block-outer{line-height:1.5;transition:margin .2s}.bn-block{display:flex;flex-direction:column}.bn-block-content{display:flex;padding:3px 0;transition:font-size .2s;width:100%}.bn-block-content:before{transition:all .2s}.bn-block-content.ProseMirror-selectednode>*,.ProseMirror-selectednode>.bn-block-content>*{border-radius:4px;outline:4px solid rgb(100,160,255)}.bn-block-group .bn-block-group{margin-left:1.5em}.bn-block-group .bn-block-group>.bn-block-outer{position:relative}.bn-block-group .bn-block-group>.bn-block-outer:not([data-prev-depth-changed]):before{content:" ";display:inline;position:absolute;left:-20px;height:100%;transition:all .2s .1s}.bn-block-group .bn-block-group>.bn-block-outer[data-prev-depth-change="-2"]:before{height:0}.bn-inline-content code{font-family:monospace}[data-prev-depth-change="1"]{--x: 1}[data-prev-depth-change="2"]{--x: 2}[data-prev-depth-change="3"]{--x: 3}[data-prev-depth-change="4"]{--x: 4}[data-prev-depth-change="5"]{--x: 5}[data-prev-depth-change="-1"]{--x: -1}[data-prev-depth-change="-2"]{--x: -2}[data-prev-depth-change="-3"]{--x: -3}[data-prev-depth-change="-4"]{--x: -4}[data-prev-depth-change="-5"]{--x: -5}.bn-block-outer[data-prev-depth-change]{margin-left:calc(10px * var(--x))}.bn-block-outer[data-prev-depth-change] .bn-block-outer[data-prev-depth-change]{margin-left:0}[data-level="1"]{--level: 3em}[data-level="2"]{--level: 2em}[data-level="3"]{--level: 1.3em}[data-prev-level="1"]{--prev-level: 3em}[data-prev-level="2"]{--prev-level: 2em}[data-prev-level="3"]{--prev-level: 1.3em}.bn-block-outer[data-prev-type=heading]>.bn-block>.bn-block-content{font-size:var(--prev-level);font-weight:700}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=heading]{font-size:var(--level);font-weight:700}.bn-block-content:before{margin-right:0;content:""}.bn-block-content[data-content-type=numberedListItem]{display:flex;gap:.5em}[data-content-type=numberedListItem]{--index: attr(data-index)}[data-prev-type=numberedListItem]{--prev-index: attr(data-prev-index)}.bn-block-outer[data-prev-type=numberedListItem]:not([data-prev-index=none])>.bn-block>.bn-block-content:before{content:var(--prev-index) "."}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=numberedListItem]:before{content:var(--index) "."}.bn-block-content[data-content-type=bulletListItem]{display:flex;gap:.5em}.bn-block-content[data-content-type=checkListItem]>div{display:flex}.bn-block-content[data-content-type=checkListItem]>div>div>input{margin:0;margin-inline-end:.5em;cursor:pointer}.bn-block-content[data-content-type=checkListItem][data-checked=true] .bn-inline-content{text-decoration:line-through}.bn-block-content[data-text-alignment=center]{justify-content:center}.bn-block-content[data-text-alignment=right]{justify-content:flex-end}.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before{content:"•"}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before{content:"•"}[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before{content:"◦"}[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before{content:"◦"}[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before{content:"▪"}[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before{content:"▪"}[data-file-block] .bn-file-block-content-wrapper:has(.bn-add-file-button),[data-file-block] .bn-file-block-content-wrapper:has(.bn-file-default-preview){width:100%}[data-file-block] .bn-file-block-content-wrapper{cursor:pointer;display:flex;flex-direction:column;justify-content:stretch;-webkit-user-select:none;user-select:none}[data-file-block] .bn-add-file-button{align-items:center;background-color:#f2f1ee;border-radius:4px;color:#7d797a;display:flex;flex-direction:row;gap:10px;padding:12px;width:100%}.bn-editor[contenteditable=true] [data-file-block] .bn-add-file-button:hover{background-color:#e1e1e1}[data-file-block] .bn-add-file-button-icon{width:24px;height:24px}[data-file-block] .bn-add-file-button .bn-add-file-button-text{font-size:.9rem}[data-file-block] .bn-file-and-caption-wrapper{display:flex;flex-direction:column;border-radius:4px}[data-file-block] .bn-file-default-preview{align-items:center;border-radius:4px;display:flex;flex-direction:row;gap:4px;padding:4px;width:100%}[data-file-block] .bn-file-default-preview:hover,.ProseMirror-selectednode .bn-file-default-preview{background-color:#e1e1e1}[data-file-block] .bn-file-default-preview-icon{width:24px;height:24px}[data-file-block] .bn-visual-media-wrapper{display:flex;flex-direction:row;align-items:center;position:relative;width:fit-content}[data-file-block] .bn-visual-media{border-radius:4px;max-width:100%}[data-file-block] .bn-visual-media-resize-handle{position:absolute;width:8px;height:30px;background-color:#000;border:1px solid white;border-radius:4px;cursor:ew-resize}[data-content-type=audio]>.bn-file-block-content-wrapper,.bn-audio{width:100%}[data-file-block] .bn-file-caption{font-size:.8em;padding-block:4px}[data-file-block] .bn-file-caption:empty{padding-block:0}.bn-inline-content:has(>.ProseMirror-trailingBreak:only-child):before{pointer-events:none;height:0;position:absolute;font-style:italic}[data-text-color=gray]{color:#9b9a97}[data-text-color=brown]{color:#64473a}[data-text-color=red]{color:#e03e3e}[data-text-color=orange]{color:#d9730d}[data-text-color=yellow]{color:#dfab01}[data-text-color=green]{color:#4d6461}[data-text-color=blue]{color:#0b6e99}[data-text-color=purple]{color:#6940a5}[data-text-color=pink]{color:#ad1a72}[data-background-color=gray]{background-color:#ebeced}[data-background-color=brown]{background-color:#e9e5e3}[data-background-color=red]{background-color:#fbe4e4}[data-background-color=orange]{background-color:#faebdd}[data-background-color=yellow]{background-color:#fbf3db}[data-background-color=green]{background-color:#ddedea}[data-background-color=blue]{background-color:#ddebf1}[data-background-color=purple]{background-color:#eae4f2}[data-background-color=pink]{background-color:#f4dfeb}[data-text-alignment=left]{justify-content:flex-start;text-align:left}[data-text-alignment=center]{justify-content:center;text-align:center}[data-text-alignment=right]{justify-content:flex-end;text-align:right}[data-text-alignment=justify]{justify-content:flex-start;text-align:justify}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:"";left:0;right:0;top:0;bottom:0;background:#c8c8ff66;pointer-events:none}.bn-editor{outline:none;padding-inline:54px;--N800: #172b4d;--N40: #dfe1e6}.bn-root{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bn-root *,.bn-root *:before,.bn-root *:after{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}.bn-default-styles p,.bn-default-styles h1,.bn-default-styles h2,.bn-default-styles h3,.bn-default-styles li{margin:0;padding:0;font-size:inherit;min-width:2px!important}.bn-default-styles{font-size:16px;font-weight:400;font-family:Inter,SF Pro Display,-apple-system,BlinkMacSystemFont,Open Sans,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bn-table-drop-cursor{position:absolute;z-index:20;background-color:#adf;pointer-events:none}.bn-drag-preview{position:absolute;z-index:-1}.collaboration-cursor__caret{border-left:1px solid #0d0d0d;border-right:1px solid #0d0d0d;margin-left:-1px;margin-right:-1px;pointer-events:none;position:relative;word-break:normal}.collaboration-cursor__label{border-radius:3px 3px 3px 0;color:#0d0d0d;font-size:12px;font-style:normal;font-weight:600;left:-1px;line-height:normal;padding:.1rem .3rem;position:absolute;top:-1.4em;-webkit-user-select:none;user-select:none;white-space:nowrap}.bn-editor table{width:auto!important}.bn-editor th,.bn-editor td{min-width:1em;border:1px solid #ddd;padding:3px 5px}.bn-editor .tableWrapper{margin:1em 0}.bn-editor th{font-weight:700;text-align:left}
|
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1721335278382,"assets":[{"name":"blocknote.umd.cjs","size":185797},{"name":"blocknote.umd.cjs.map","size":682960}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":6582,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":6664,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":7294,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":6876,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":6323,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":6146,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":7079,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":6768,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":6965,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":6927,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":6093,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":7638,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8518,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":1691,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeConversions.ts","size":11998,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/sharedHTMLConversion.ts","size":2311,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts","size":3119,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":1161,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":758,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1691,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":299,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":3877,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":2814,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1357,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":1627,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/fileBlockHelpers.ts","size":8574,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/audioBlockHelpers.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/AudioBlockContent.ts","size":3741,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1939,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/imageBlockHelpers.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3959,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/videoBlockHelpers.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3763,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/api/getCurrentBlockContentType.ts","size":192,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3439,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1201,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3122,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":1862,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":3437,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":6423,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1307,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":1462,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":1624,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1123,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1580,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":548,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/blockManipulation.ts","size":5664,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":775,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":640,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1054,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":3480,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":5062,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7365,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":17063,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":7719,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":15235,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/copyExtension.ts","size":2951,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":6319,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/acceptedMIMETypes.ts","size":91,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/handleFileInsertion.ts","size":1983,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/pasteExtension.ts","size":1244,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":791,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":928,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":725,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1594,"chunks":["a1ee98a"]},{"name":"./src/extensions/NonEditableBlocks/NonEditableBlockPlugin.ts","size":1014,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4578,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":18112,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":4243,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":1062,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":2823,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":2758,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":26212,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":700,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":2166,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"homepage": "https://github.com/TypeCellOS/BlockNote",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "0.15.
|
|
6
|
+
"version": "0.15.3",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"types",
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"rimraf": "^5.0.5",
|
|
107
107
|
"rollup-plugin-webpack-stats": "^0.2.2",
|
|
108
108
|
"typescript": "^5.3.3",
|
|
109
|
-
"vite": "^
|
|
109
|
+
"vite": "^5.3.4",
|
|
110
110
|
"vite-plugin-eslint": "^1.8.1",
|
|
111
|
-
"vitest": "^0.
|
|
111
|
+
"vitest": "^2.0.3"
|
|
112
112
|
},
|
|
113
113
|
"eslintConfig": {
|
|
114
114
|
"extends": [
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"access": "public",
|
|
120
120
|
"registry": "https://registry.npmjs.org/"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "34c2039e632d19db79f11adf17b2c2acab33e0bc"
|
|
123
123
|
}
|
|
@@ -5,7 +5,7 @@ exports[`Lift nested lists > Lifts multiple bullet lists 1`] = `
|
|
|
5
5
|
<ul>
|
|
6
6
|
<div>
|
|
7
7
|
<li>Bullet List Item 1</li>
|
|
8
|
-
<div data-node-type
|
|
8
|
+
<div data-node-type="blockGroup">
|
|
9
9
|
<ul>
|
|
10
10
|
<li>Nested Bullet List Item 1</li>
|
|
11
11
|
<li>Nested Bullet List Item 2</li>
|
|
@@ -26,7 +26,7 @@ exports[`Lift nested lists > Lifts multiple bullet lists with content in between
|
|
|
26
26
|
<ul>
|
|
27
27
|
<div>
|
|
28
28
|
<li>Bullet List Item 1</li>
|
|
29
|
-
<div data-node-type
|
|
29
|
+
<div data-node-type="blockGroup">
|
|
30
30
|
<ul>
|
|
31
31
|
<li>Nested Bullet List Item 1</li>
|
|
32
32
|
<li>Nested Bullet List Item 2</li>
|
|
@@ -35,7 +35,7 @@ exports[`Lift nested lists > Lifts multiple bullet lists with content in between
|
|
|
35
35
|
</div>
|
|
36
36
|
<div>
|
|
37
37
|
<li>In between content</li>
|
|
38
|
-
<div data-node-type
|
|
38
|
+
<div data-node-type="blockGroup">
|
|
39
39
|
<ul>
|
|
40
40
|
<li>Nested Bullet List Item 3</li>
|
|
41
41
|
<li>Nested Bullet List Item 4</li>
|
|
@@ -52,7 +52,7 @@ exports[`Lift nested lists > Lifts nested bullet lists 1`] = `
|
|
|
52
52
|
<ul>
|
|
53
53
|
<div>
|
|
54
54
|
<li>Bullet List Item 1</li>
|
|
55
|
-
<div data-node-type
|
|
55
|
+
<div data-node-type="blockGroup">
|
|
56
56
|
<ul>
|
|
57
57
|
<li>Nested Bullet List Item 1</li>
|
|
58
58
|
<li>Nested Bullet List Item 2</li>
|
|
@@ -69,7 +69,7 @@ exports[`Lift nested lists > Lifts nested bullet lists with content after nested
|
|
|
69
69
|
<ul>
|
|
70
70
|
<div>
|
|
71
71
|
<li>Bullet List Item 1</li>
|
|
72
|
-
<div data-node-type
|
|
72
|
+
<div data-node-type="blockGroup">
|
|
73
73
|
<ul>
|
|
74
74
|
<li>Nested Bullet List Item 1</li>
|
|
75
75
|
<li>Nested Bullet List Item 2</li>
|
|
@@ -99,7 +99,7 @@ exports[`Lift nested lists > Lifts nested mixed lists 1`] = `
|
|
|
99
99
|
<ol>
|
|
100
100
|
<div>
|
|
101
101
|
<li>Numbered List Item 1</li>
|
|
102
|
-
<div data-node-type
|
|
102
|
+
<div data-node-type="blockGroup">
|
|
103
103
|
<ul>
|
|
104
104
|
<li>Bullet List Item 1</li>
|
|
105
105
|
<li>Bullet List Item 2</li>
|
|
@@ -116,7 +116,7 @@ exports[`Lift nested lists > Lifts nested numbered lists 1`] = `
|
|
|
116
116
|
<ol>
|
|
117
117
|
<div>
|
|
118
118
|
<li>Numbered List Item 1</li>
|
|
119
|
-
<div data-node-type
|
|
119
|
+
<div data-node-type="blockGroup">
|
|
120
120
|
<ol>
|
|
121
121
|
<li>Nested Numbered List Item 1</li>
|
|
122
122
|
<li>Nested Numbered List Item 2</li>
|
|
@@ -58,6 +58,7 @@ export class FormattingToolbarView implements PluginView {
|
|
|
58
58
|
pmView.dom.addEventListener("mouseup", this.viewMouseupHandler);
|
|
59
59
|
pmView.dom.addEventListener("dragstart", this.dragHandler);
|
|
60
60
|
pmView.dom.addEventListener("dragover", this.dragHandler);
|
|
61
|
+
pmView.dom.addEventListener("blur", this.blurHandler);
|
|
61
62
|
|
|
62
63
|
// Setting capture=true ensures that any parent container of the editor that
|
|
63
64
|
// gets scrolled will trigger the scroll event. Scroll events do not bubble
|
|
@@ -65,6 +66,37 @@ export class FormattingToolbarView implements PluginView {
|
|
|
65
66
|
pmView.root.addEventListener("scroll", this.scrollHandler, true);
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
blurHandler = (event: FocusEvent) => {
|
|
70
|
+
if (this.preventHide) {
|
|
71
|
+
this.preventHide = false;
|
|
72
|
+
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const editorWrapper = this.pmView.dom.parentElement!;
|
|
77
|
+
|
|
78
|
+
// Checks if the focus is moving to an element outside the editor. If it is,
|
|
79
|
+
// the toolbar is hidden.
|
|
80
|
+
if (
|
|
81
|
+
// An element is clicked.
|
|
82
|
+
event &&
|
|
83
|
+
event.relatedTarget &&
|
|
84
|
+
// Element is inside the editor.
|
|
85
|
+
(editorWrapper === (event.relatedTarget as Node) ||
|
|
86
|
+
editorWrapper.contains(event.relatedTarget as Node) ||
|
|
87
|
+
(event.relatedTarget as HTMLElement).matches(
|
|
88
|
+
".bn-ui-container, .bn-ui-container *"
|
|
89
|
+
))
|
|
90
|
+
) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (this.state?.show) {
|
|
95
|
+
this.state.show = false;
|
|
96
|
+
this.emitUpdate();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
68
100
|
viewMousedownHandler = () => {
|
|
69
101
|
this.preventShow = true;
|
|
70
102
|
};
|
|
@@ -90,6 +122,10 @@ export class FormattingToolbarView implements PluginView {
|
|
|
90
122
|
};
|
|
91
123
|
|
|
92
124
|
update(view: EditorView, oldState?: EditorState) {
|
|
125
|
+
// Delays the update to handle edge case with drag and drop, where the view
|
|
126
|
+
// is blurred asynchronously and happens only after the state update.
|
|
127
|
+
// Wrapping in a setTimeout gives enough time to wait for the blur event to
|
|
128
|
+
// occur before updating the toolbar.
|
|
93
129
|
const { state, composing } = view;
|
|
94
130
|
const { doc, selection } = state;
|
|
95
131
|
const isSame =
|
|
@@ -146,6 +182,7 @@ export class FormattingToolbarView implements PluginView {
|
|
|
146
182
|
this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler);
|
|
147
183
|
this.pmView.dom.removeEventListener("dragstart", this.dragHandler);
|
|
148
184
|
this.pmView.dom.removeEventListener("dragover", this.dragHandler);
|
|
185
|
+
this.pmView.dom.removeEventListener("blur", this.blurHandler);
|
|
149
186
|
|
|
150
187
|
this.pmView.root.removeEventListener("scroll", this.scrollHandler, true);
|
|
151
188
|
}
|
|
@@ -441,8 +441,15 @@ export class SideMenuView<
|
|
|
441
441
|
const editorBoundingBox = (
|
|
442
442
|
this.pmView.dom.firstChild! as HTMLElement
|
|
443
443
|
).getBoundingClientRect();
|
|
444
|
-
evt.clientX =
|
|
445
|
-
|
|
444
|
+
evt.clientX =
|
|
445
|
+
event.clientX < editorBoundingBox.left ||
|
|
446
|
+
event.clientX > editorBoundingBox.left + editorBoundingBox.width
|
|
447
|
+
? editorBoundingBox.left + editorBoundingBox.width / 2
|
|
448
|
+
: event.clientX;
|
|
449
|
+
evt.clientY = Math.min(
|
|
450
|
+
Math.max(event.clientY, editorBoundingBox.top),
|
|
451
|
+
editorBoundingBox.top + editorBoundingBox.height
|
|
452
|
+
);
|
|
446
453
|
evt.dataTransfer = event.dataTransfer;
|
|
447
454
|
evt.preventDefault = () => event.preventDefault();
|
|
448
455
|
evt.synthetic = true; // prevent recursion
|
|
@@ -498,6 +505,10 @@ export class SideMenuView<
|
|
|
498
505
|
};
|
|
499
506
|
|
|
500
507
|
onMouseMove = (event: MouseEvent) => {
|
|
508
|
+
if (this.menuFrozen) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
|
|
501
512
|
this.mousePos = { x: event.clientX, y: event.clientY };
|
|
502
513
|
|
|
503
514
|
// We want the full area of the editor to check if the cursor is hovering
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { init, SearchIndex } from "emoji-mart";
|
|
1
|
+
import type { Emoji, EmojiMartData } from "@emoji-mart/data";
|
|
3
2
|
|
|
4
|
-
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
|
|
5
|
-
import { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
6
3
|
import { checkDefaultInlineContentTypeInSchema } from "../../blocks/defaultBlockTypeGuards";
|
|
4
|
+
import { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
5
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
|
|
7
6
|
import { DefaultGridSuggestionItem } from "./DefaultGridSuggestionItem";
|
|
8
7
|
|
|
9
|
-
let
|
|
10
|
-
|
|
8
|
+
let data:
|
|
9
|
+
| Promise<{
|
|
10
|
+
default: EmojiMartData;
|
|
11
|
+
}>
|
|
12
|
+
| undefined;
|
|
13
|
+
|
|
14
|
+
let emojiMart: typeof import("emoji-mart") | undefined;
|
|
11
15
|
|
|
12
16
|
export async function getDefaultEmojiPickerItems<
|
|
13
17
|
BSchema extends BlockSchema,
|
|
@@ -21,17 +25,25 @@ export async function getDefaultEmojiPickerItems<
|
|
|
21
25
|
return [];
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
if (!
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
if (!data) {
|
|
29
|
+
// use a dynamic import to encourage bundle-splitting
|
|
30
|
+
// and a smaller initial client bundle size
|
|
31
|
+
data = import("@emoji-mart/data", { assert: { type: "json" } }) as any;
|
|
32
|
+
|
|
33
|
+
// load dynamically because emoji-mart doesn't specify type: module and breaks in nodejs
|
|
34
|
+
emojiMart = await import("emoji-mart");
|
|
35
|
+
const emojiMartData = (await data)!.default;
|
|
36
|
+
await emojiMart.init({ data: emojiMartData });
|
|
27
37
|
}
|
|
28
38
|
|
|
39
|
+
const emojiMartData = (await data)!.default;
|
|
40
|
+
|
|
29
41
|
const emojisToShow =
|
|
30
42
|
query.trim() === ""
|
|
31
43
|
? Object.values(emojiMartData.emojis)
|
|
32
|
-
: ((await SearchIndex.search(query)) as Emoji[]);
|
|
44
|
+
: ((await emojiMart!.SearchIndex.search(query)) as Emoji[]);
|
|
33
45
|
|
|
34
|
-
return emojisToShow.map((emoji
|
|
46
|
+
return emojisToShow.map((emoji) => ({
|
|
35
47
|
id: emoji.skins[0].native,
|
|
36
48
|
onItemClick: () => editor.insertInlineContent(emoji.skins[0].native + " "),
|
|
37
49
|
}));
|
package/src/i18n/locales/en.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class FormattingToolbarView implements PluginView {
|
|
|
19
19
|
to: number;
|
|
20
20
|
}) => boolean;
|
|
21
21
|
constructor(editor: BlockNoteEditor<BlockSchema, InlineContentSchema, StyleSchema>, pmView: EditorView, emitUpdate: (state: FormattingToolbarState) => void);
|
|
22
|
+
blurHandler: (event: FocusEvent) => void;
|
|
22
23
|
viewMousedownHandler: () => void;
|
|
23
24
|
viewMouseupHandler: () => void;
|
|
24
25
|
dragHandler: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
|
|
2
1
|
import { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
2
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
|
|
3
3
|
import { DefaultGridSuggestionItem } from "./DefaultGridSuggestionItem";
|
|
4
4
|
export declare function getDefaultEmojiPickerItems<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, query: string): Promise<DefaultGridSuggestionItem[]>;
|