@blocknote/core 0.42.1 → 0.42.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/dist/blocknote.js CHANGED
@@ -5863,28 +5863,13 @@ class Kt extends Ne {
5863
5863
  * @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
5864
5864
  */
5865
5865
  d(this, "mount", (e) => {
5866
- if (
5867
- // If the editor is scheduled for destruction, and
5868
- this.scheduledDestructionTimeout && // If the editor is being remounted to the same element as the one which is scheduled for destruction,
5869
- // then just cancel the destruction timeout
5870
- this.prosemirrorView.dom === e
5871
- ) {
5872
- clearTimeout(this.scheduledDestructionTimeout), this.scheduledDestructionTimeout = void 0;
5873
- return;
5874
- }
5875
5866
  this._tiptapEditor.mount({ mount: e });
5876
5867
  });
5877
- /**
5878
- * Timeout to schedule the {@link unmount}ing of the editor.
5879
- */
5880
- d(this, "scheduledDestructionTimeout");
5881
5868
  /**
5882
5869
  * Unmount the editor from the DOM element it is bound to
5883
5870
  */
5884
5871
  d(this, "unmount", () => {
5885
- this.scheduledDestructionTimeout = setTimeout(() => {
5886
- this._tiptapEditor.unmount(), this.scheduledDestructionTimeout = void 0;
5887
- }, 1);
5872
+ this._tiptapEditor.unmount();
5888
5873
  });
5889
5874
  this.options = e;
5890
5875
  const o = e;
@@ -6267,11 +6252,12 @@ class Kt extends Ne {
6267
6252
  }
6268
6253
  get domElement() {
6269
6254
  var e;
6270
- return (e = this.prosemirrorView) == null ? void 0 : e.dom;
6255
+ if (!this.headless)
6256
+ return (e = this.prosemirrorView) == null ? void 0 : e.dom;
6271
6257
  }
6272
6258
  isFocused() {
6273
6259
  var e;
6274
- return ((e = this.prosemirrorView) == null ? void 0 : e.hasFocus()) || !1;
6260
+ return this.headless ? !1 : ((e = this.prosemirrorView) == null ? void 0 : e.hasFocus()) || !1;
6275
6261
  }
6276
6262
  get headless() {
6277
6263
  return !this._tiptapEditor.isInitialized;
@@ -6711,7 +6697,7 @@ class Kt extends Ne {
6711
6697
  return e.length === 0 || e.length === 1 && e[0].type === "paragraph" && e[0].content.length === 0;
6712
6698
  }
6713
6699
  openSuggestionMenu(e, o) {
6714
- this.prosemirrorView && (this.focus(), this.transact((r) => {
6700
+ !this.prosemirrorView || this.headless || (this.focus(), this.transact((r) => {
6715
6701
  o != null && o.deleteTriggerCharacter && r.insertText(e), r.scrollIntoView().setMeta(this.suggestionMenus.plugins[0], {
6716
6702
  triggerCharacter: e,
6717
6703
  deleteTriggerCharacter: (o == null ? void 0 : o.deleteTriggerCharacter) || !1,