better-react-email-editor 0.1.7 → 0.1.8

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/index.js CHANGED
@@ -400,15 +400,23 @@ var wt = /* @__PURE__ */ new Set(["columnsColumn", "codeBlock"]), Tt = te.create
400
400
  }), Et = te.create({
401
401
  name: "focusedSpellcheck",
402
402
  addProseMirrorPlugins() {
403
- let { editor: e } = this;
403
+ let e = new k("focusedSpellcheck"), t = typeof navigator < "u" && /firefox/i.test(navigator.userAgent), n = !1;
404
404
  return [new O({
405
- key: new k("focusedSpellcheck"),
405
+ key: e,
406
+ state: {
407
+ init: () => !1,
408
+ apply: (e, t) => e.getMeta("focus") ? t : n
409
+ },
406
410
  props: {
407
411
  attributes: { spellcheck: "false" },
408
- decorations: (t) => {
409
- if (!e.isFocused) return ae.empty;
410
- let { from: n, to: r, $from: i } = t.selection, a = [];
411
- return t.doc.nodesBetween(n, r, (e, t) => !e.isTextblock || (a.push(ie.node(t, t + e.nodeSize, { spellcheck: "true" })), !1)), !a.length && i.parent.isTextblock && i.depth > 0 && a.push(ie.node(i.before(), i.after(), { spellcheck: "true" })), ae.create(t.doc, a);
412
+ handleDOMEvents: {
413
+ focus: () => (n = !0, !1),
414
+ blur: (e) => (n = !1, e.dispatch(e.state.tr.setMeta("addToHistory", !1)), !1)
415
+ },
416
+ decorations: (n) => {
417
+ if (t || !e.getState(n)) return ae.empty;
418
+ let { from: r, to: i, $from: a } = n.selection, o = [];
419
+ return n.doc.nodesBetween(r, i, (e, t) => !e.isTextblock || (o.push(ie.node(t, t + e.nodeSize, { spellcheck: "true" })), !1)), !o.length && a.parent.isTextblock && a.depth > 0 && o.push(ie.node(a.before(), a.after(), { spellcheck: "true" })), ae.create(n.doc, o);
412
420
  }
413
421
  }
414
422
  })];