reactjs-tiptap-editor-pro 0.2.25 → 0.2.27

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.
@@ -1,5 +1,5 @@
1
1
  import Xe from "tippy.js";
2
- import { E as Qe, a as Ze, P as H, b as $, S as G, k as tn, T as D, D as en, c as Ee, F as V, N as nn, d as xt, w as rn, e as sn, f as on, g as dt, h as tt, s as an, i as te, j as ln, l as cn, m as dn, n as un, o as pn, A as hn, p as fn, q as mn, r as gn, t as yn, u as vn, v as bn, x as Mn, y as Te, z as Sn, B as kn, C as wn, G as En, H as Tn, I as Cn, J as xn, K as zt, R as An, L as On, M as Ln, O as _n, Q as ee, U as Pn, V as Ce, W as Rn, X as Hn, Y as $n, Z as In, _ as Dn, $ as pt, a0 as Vt, a1 as Nn, a2 as Bn, a3 as jn, a4 as xe, a5 as Fn, a6 as ne, a7 as zn, a8 as re, a9 as se, aa as Vn, ab as oe, ac as Wn, ad as Kn, ae as Un, af as qn, ag as Gn, ah as Jn, ai as Yn } from "./vendor-tDefVoN_.js";
2
+ import { E as Qe, a as Ze, P as H, b as $, S as G, k as tn, T as D, D as en, c as Ee, F as V, N as nn, d as xt, w as rn, e as sn, f as on, g as dt, h as tt, s as an, i as te, j as ln, l as cn, m as dn, n as un, o as pn, A as hn, p as fn, q as mn, r as gn, t as yn, u as vn, v as bn, x as Mn, y as Te, z as Sn, B as kn, C as wn, G as En, H as Tn, I as Cn, J as xn, K as zt, R as An, L as On, M as Ln, O as _n, Q as ee, U as Pn, V as Ce, W as Rn, X as Hn, Y as $n, Z as In, _ as Dn, $ as pt, a0 as Vt, a1 as Nn, a2 as Bn, a3 as jn, a4 as xe, a5 as Fn, a6 as ne, a7 as zn, a8 as re, a9 as se, aa as Vn, ab as oe, ac as Wn, ad as Kn, ae as Un, af as qn, ag as Gn, ah as Jn, ai as Yn } from "./vendor-Cpa6z-M0.js";
3
3
  import O, { useRef as Xn, useState as Wt, useDebugValue as Ae, useEffect as Kt, forwardRef as Qn, useLayoutEffect as Zn, useContext as Oe, createContext as Le } from "react";
4
4
  import tr, { flushSync as er } from "react-dom";
5
5
  function gt(e) {
@@ -861,7 +861,7 @@ class Z {
861
861
  });
862
862
  }
863
863
  }
864
- class P {
864
+ class _ {
865
865
  constructor(t = {}) {
866
866
  this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
867
867
  name: this.name,
@@ -877,7 +877,7 @@ class P {
877
877
  })) || {};
878
878
  }
879
879
  static create(t = {}) {
880
- return new P(t);
880
+ return new _(t);
881
881
  }
882
882
  configure(t = {}) {
883
883
  const n = this.extend({
@@ -887,7 +887,7 @@ class P {
887
887
  return n.name = this.name, n.parent = this.parent, n;
888
888
  }
889
889
  extend(t = {}) {
890
- const n = new P({ ...this.config, ...t });
890
+ const n = new _({ ...this.config, ...t });
891
891
  return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = E(S(n, "addOptions", {
892
892
  name: n.name
893
893
  })), n.storage = E(S(n, "addStorage", {
@@ -919,7 +919,7 @@ function He(e, t, n) {
919
919
  function $e(e) {
920
920
  return Object.fromEntries(Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText]));
921
921
  }
922
- const gr = P.create({
922
+ const gr = _.create({
923
923
  name: "clipboardTextSerializer",
924
924
  addOptions() {
925
925
  return {
@@ -1900,14 +1900,14 @@ var $s = /* @__PURE__ */ Object.freeze({
1900
1900
  wrapIn: Rs,
1901
1901
  wrapInList: Hs
1902
1902
  });
1903
- const Is = P.create({
1903
+ const Is = _.create({
1904
1904
  name: "commands",
1905
1905
  addCommands() {
1906
1906
  return {
1907
1907
  ...$s
1908
1908
  };
1909
1909
  }
1910
- }), Ds = P.create({
1910
+ }), Ds = _.create({
1911
1911
  name: "drop",
1912
1912
  addProseMirrorPlugins() {
1913
1913
  return [
@@ -1926,7 +1926,7 @@ const Is = P.create({
1926
1926
  })
1927
1927
  ];
1928
1928
  }
1929
- }), Ns = P.create({
1929
+ }), Ns = _.create({
1930
1930
  name: "editable",
1931
1931
  addProseMirrorPlugins() {
1932
1932
  return [
@@ -1938,7 +1938,7 @@ const Is = P.create({
1938
1938
  })
1939
1939
  ];
1940
1940
  }
1941
- }), Bs = new $("focusEvents"), js = P.create({
1941
+ }), Bs = new $("focusEvents"), js = _.create({
1942
1942
  name: "focusEvents",
1943
1943
  addProseMirrorPlugins() {
1944
1944
  const { editor: e } = this;
@@ -1962,7 +1962,7 @@ const Is = P.create({
1962
1962
  })
1963
1963
  ];
1964
1964
  }
1965
- }), Fs = P.create({
1965
+ }), Fs = _.create({
1966
1966
  name: "keymap",
1967
1967
  addKeyboardShortcuts() {
1968
1968
  const e = () => this.editor.commands.first(({ commands: i }) => [
@@ -2040,7 +2040,7 @@ const Is = P.create({
2040
2040
  })
2041
2041
  ];
2042
2042
  }
2043
- }), zs = P.create({
2043
+ }), zs = _.create({
2044
2044
  name: "paste",
2045
2045
  addProseMirrorPlugins() {
2046
2046
  return [
@@ -2058,7 +2058,7 @@ const Is = P.create({
2058
2058
  })
2059
2059
  ];
2060
2060
  }
2061
- }), Vs = P.create({
2061
+ }), Vs = _.create({
2062
2062
  name: "tabindex",
2063
2063
  addProseMirrorPlugins() {
2064
2064
  return [
@@ -2696,7 +2696,7 @@ function et(e) {
2696
2696
  }
2697
2697
  });
2698
2698
  }
2699
- class _ {
2699
+ class P {
2700
2700
  constructor(t = {}) {
2701
2701
  this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
2702
2702
  name: this.name,
@@ -2712,7 +2712,7 @@ class _ {
2712
2712
  })) || {};
2713
2713
  }
2714
2714
  static create(t = {}) {
2715
- return new _(t);
2715
+ return new P(t);
2716
2716
  }
2717
2717
  configure(t = {}) {
2718
2718
  const n = this.extend({
@@ -2722,7 +2722,7 @@ class _ {
2722
2722
  return n.name = this.name, n.parent = this.parent, n;
2723
2723
  }
2724
2724
  extend(t = {}) {
2725
- const n = new _(t);
2725
+ const n = new P(t);
2726
2726
  return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = E(S(n, "addOptions", {
2727
2727
  name: n.name
2728
2728
  })), n.storage = E(S(n, "addStorage", {
@@ -2957,7 +2957,7 @@ const Ue = (e) => new H({
2957
2957
  key: typeof e.pluginKey == "string" ? new $(e.pluginKey) : e.pluginKey,
2958
2958
  view: (t) => new Js({ view: t, ...e })
2959
2959
  });
2960
- P.create({
2960
+ _.create({
2961
2961
  name: "bubbleMenu",
2962
2962
  addOptions() {
2963
2963
  return {
@@ -4064,7 +4064,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4064
4064
  })
4065
4065
  ];
4066
4066
  }
4067
- }), _o = /^```([a-z]+)?[\s\n]$/, Po = /^~~~([a-z]+)?[\s\n]$/, vi = _.create({
4067
+ }), _o = /^```([a-z]+)?[\s\n]$/, Po = /^~~~([a-z]+)?[\s\n]$/, vi = P.create({
4068
4068
  name: "codeBlock",
4069
4069
  addOptions() {
4070
4070
  return {
@@ -4232,7 +4232,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4232
4232
  }
4233
4233
  };
4234
4234
  }
4235
- }), Mi = P.create({
4235
+ }), Mi = _.create({
4236
4236
  name: "fontFamily",
4237
4237
  addOptions() {
4238
4238
  return {
@@ -4261,7 +4261,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4261
4261
  unsetFontFamily: () => ({ chain: e }) => e().setMark("textStyle", { fontFamily: null }).removeEmptyTextStyle().run()
4262
4262
  };
4263
4263
  }
4264
- }), Si = _.create({
4264
+ }), Si = P.create({
4265
4265
  name: "heading",
4266
4266
  addOptions() {
4267
4267
  return {
@@ -4310,7 +4310,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4310
4310
  }
4311
4311
  }));
4312
4312
  }
4313
- }), ki = P.create({
4313
+ }), ki = _.create({
4314
4314
  name: "textAlign",
4315
4315
  addOptions() {
4316
4316
  return {
@@ -4350,7 +4350,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4350
4350
  "Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
4351
4351
  };
4352
4352
  }
4353
- }), wi = P.create({
4353
+ }), wi = _.create({
4354
4354
  name: "color",
4355
4355
  addOptions() {
4356
4356
  return {
@@ -4440,7 +4440,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4440
4440
  })
4441
4441
  ];
4442
4442
  }
4443
- }), Io = "listItem", ve = "textStyle", be = /^\s*([-+*])\s$/, Ti = _.create({
4443
+ }), Io = "listItem", ve = "textStyle", be = /^\s*([-+*])\s$/, Ti = P.create({
4444
4444
  name: "bulletList",
4445
4445
  addOptions() {
4446
4446
  return {
@@ -4488,7 +4488,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4488
4488
  e
4489
4489
  ];
4490
4490
  }
4491
- }), Do = "listItem", Me = "textStyle", Se = /^(\d+)\.\s$/, Ci = _.create({
4491
+ }), Do = "listItem", Me = "textStyle", Se = /^(\d+)\.\s$/, Ci = P.create({
4492
4492
  name: "orderedList",
4493
4493
  addOptions() {
4494
4494
  return {
@@ -4554,7 +4554,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4554
4554
  e
4555
4555
  ];
4556
4556
  }
4557
- }), No = /^\s*(\[([( |x])?\])\s$/, xi = _.create({
4557
+ }), No = /^\s*(\[([( |x])?\])\s$/, xi = P.create({
4558
4558
  name: "taskItem",
4559
4559
  addOptions() {
4560
4560
  return {
@@ -4661,7 +4661,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4661
4661
  })
4662
4662
  ];
4663
4663
  }
4664
- }), Ai = _.create({
4664
+ }), Ai = P.create({
4665
4665
  name: "taskList",
4666
4666
  addOptions() {
4667
4667
  return {
@@ -4694,7 +4694,7 @@ const bo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mo = /(?:^|\s
4694
4694
  "Mod-Shift-9": () => this.editor.commands.toggleTaskList()
4695
4695
  };
4696
4696
  }
4697
- }), Bo = /^\s*>\s$/, Oi = _.create({
4697
+ }), Bo = /^\s*>\s$/, Oi = P.create({
4698
4698
  name: "blockquote",
4699
4699
  addOptions() {
4700
4700
  return {
@@ -4988,7 +4988,7 @@ const Li = N.create({
4988
4988
  type: this.type
4989
4989
  })), e;
4990
4990
  }
4991
- }), _i = _.create({
4991
+ }), _i = P.create({
4992
4992
  name: "horizontalRule",
4993
4993
  addOptions() {
4994
4994
  return {
@@ -5038,7 +5038,7 @@ const Li = N.create({
5038
5038
  })
5039
5039
  ];
5040
5040
  }
5041
- }), Pi = P.create({
5041
+ }), Pi = _.create({
5042
5042
  name: "history",
5043
5043
  addOptions() {
5044
5044
  return {
@@ -5067,7 +5067,7 @@ const Li = N.create({
5067
5067
  "Shift-Mod-я": () => this.editor.commands.redo()
5068
5068
  };
5069
5069
  }
5070
- }), Ri = P.create({
5070
+ }), Ri = _.create({
5071
5071
  name: "characterCount",
5072
5072
  addOptions() {
5073
5073
  return {
@@ -5133,7 +5133,7 @@ const Li = N.create({
5133
5133
  })
5134
5134
  ];
5135
5135
  }
5136
- }), Hi = P.create({
5136
+ }), Hi = _.create({
5137
5137
  name: "dropCursor",
5138
5138
  addOptions() {
5139
5139
  return {
@@ -5147,7 +5147,7 @@ const Li = N.create({
5147
5147
  Dn(this.options)
5148
5148
  ];
5149
5149
  }
5150
- }), $i = P.create({
5150
+ }), $i = _.create({
5151
5151
  name: "focus",
5152
5152
  addOptions() {
5153
5153
  return {
@@ -5187,7 +5187,7 @@ const Li = N.create({
5187
5187
  })
5188
5188
  ];
5189
5189
  }
5190
- }), Ii = P.create({
5190
+ }), Ii = _.create({
5191
5191
  name: "gapCursor",
5192
5192
  addProseMirrorPlugins() {
5193
5193
  return [
@@ -5205,7 +5205,7 @@ const Li = N.create({
5205
5205
  allowGapCursor: (t = E(S(e, "allowGapCursor", n))) !== null && t !== void 0 ? t : null
5206
5206
  };
5207
5207
  }
5208
- }), Di = _.create({
5208
+ }), Di = P.create({
5209
5209
  name: "hardBreak",
5210
5210
  addOptions() {
5211
5211
  return {
@@ -5255,7 +5255,7 @@ const Li = N.create({
5255
5255
  "Shift-Enter": () => this.editor.commands.setHardBreak()
5256
5256
  };
5257
5257
  }
5258
- }), Ni = _.create({
5258
+ }), Ni = P.create({
5259
5259
  name: "listItem",
5260
5260
  addOptions() {
5261
5261
  return {
@@ -5283,7 +5283,7 @@ const Li = N.create({
5283
5283
  "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
5284
5284
  };
5285
5285
  }
5286
- }), Bi = _.create({
5286
+ }), Bi = P.create({
5287
5287
  name: "paragraph",
5288
5288
  priority: 1e3,
5289
5289
  addOptions() {
@@ -5311,7 +5311,7 @@ const Li = N.create({
5311
5311
  "Mod-Alt-0": () => this.editor.commands.setParagraph()
5312
5312
  };
5313
5313
  }
5314
- }), ji = P.create({
5314
+ }), ji = _.create({
5315
5315
  name: "placeholder",
5316
5316
  addOptions() {
5317
5317
  return {
@@ -5356,10 +5356,10 @@ const Li = N.create({
5356
5356
  })
5357
5357
  ];
5358
5358
  }
5359
- }), Fi = _.create({
5359
+ }), Fi = P.create({
5360
5360
  name: "text",
5361
5361
  group: "inline"
5362
- }), zi = _.create({
5362
+ }), zi = P.create({
5363
5363
  name: "doc",
5364
5364
  topNode: !0,
5365
5365
  content: "block+"
@@ -5559,7 +5559,7 @@ function qo({ pluginKey: e = Uo, editor: t, char: n = "@", allowSpaces: r = !1,
5559
5559
  });
5560
5560
  return g;
5561
5561
  }
5562
- const Go = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Ki = _.create({
5562
+ const Go = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Ki = P.create({
5563
5563
  name: "image",
5564
5564
  addOptions() {
5565
5565
  return {
@@ -5618,7 +5618,7 @@ const Go = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Ki = _.cr
5618
5618
  })
5619
5619
  ];
5620
5620
  }
5621
- }), Ui = _.create({
5621
+ }), Ui = P.create({
5622
5622
  name: "tableRow",
5623
5623
  addOptions() {
5624
5624
  return {
@@ -5737,7 +5737,7 @@ const ct = ({ editor: e }) => {
5737
5737
  return !1;
5738
5738
  ["tableCell", "tableHeader"].includes(o.type.name) && (n += 1);
5739
5739
  }), n === t.ranges.length ? (e.commands.deleteTable(), !0) : !1;
5740
- }, qi = _.create({
5740
+ }, qi = P.create({
5741
5741
  name: "table",
5742
5742
  // @ts-ignore
5743
5743
  addOptions() {
@@ -5842,42 +5842,7 @@ const ct = ({ editor: e }) => {
5842
5842
  tableRole: E(S(e, "tableRole", t))
5843
5843
  };
5844
5844
  }
5845
- }), Gi = _.create({
5846
- name: "tableCell",
5847
- addOptions() {
5848
- return {
5849
- HTMLAttributes: {}
5850
- };
5851
- },
5852
- content: "block+",
5853
- addAttributes() {
5854
- return {
5855
- colspan: {
5856
- default: 1
5857
- },
5858
- rowspan: {
5859
- default: 1
5860
- },
5861
- colwidth: {
5862
- default: null,
5863
- parseHTML: (e) => {
5864
- const t = e.getAttribute("colwidth");
5865
- return t ? t.split(",").map((r) => parseInt(r, 10)) : null;
5866
- }
5867
- }
5868
- };
5869
- },
5870
- tableRole: "cell",
5871
- isolating: !0,
5872
- parseHTML() {
5873
- return [
5874
- { tag: "td" }
5875
- ];
5876
- },
5877
- renderHTML({ HTMLAttributes: e }) {
5878
- return ["td", C(this.options.HTMLAttributes, e), 0];
5879
- }
5880
- }), Ji = _.create({
5845
+ }), Gi = P.create({
5881
5846
  name: "tableHeader",
5882
5847
  addOptions() {
5883
5848
  return {
@@ -5912,7 +5877,7 @@ const ct = ({ editor: e }) => {
5912
5877
  renderHTML({ HTMLAttributes: e }) {
5913
5878
  return ["th", C(this.options.HTMLAttributes, e), 0];
5914
5879
  }
5915
- }), ti = new $("mention"), Yi = _.create({
5880
+ }), ti = new $("mention"), Ji = P.create({
5916
5881
  name: "mention",
5917
5882
  priority: 101,
5918
5883
  addOptions() {
@@ -6037,45 +6002,44 @@ const ct = ({ editor: e }) => {
6037
6002
  }
6038
6003
  });
6039
6004
  export {
6040
- ii as $,
6005
+ fs as $,
6041
6006
  yo as A,
6042
6007
  ci as B,
6043
6008
  yi as C,
6044
6009
  zi as D,
6045
- P as E,
6010
+ _ as E,
6046
6011
  Mi as F,
6047
6012
  Ii as G,
6048
6013
  Si as H,
6049
6014
  fi as I,
6050
- qi as J,
6051
- Ui as K,
6015
+ Yt as J,
6016
+ ue as K,
6052
6017
  Li as L,
6053
6018
  Ji as M,
6054
6019
  ui as N,
6055
6020
  Ci as O,
6056
6021
  ji as P,
6057
- Gi as Q,
6022
+ Ki as Q,
6058
6023
  pi as R,
6059
6024
  gi as S,
6060
6025
  ki as T,
6061
6026
  mi as U,
6062
- Yi as V,
6063
- Yt as W,
6064
- ue as X,
6065
- Ki as Y,
6066
- Ke as Z,
6067
- dr as _,
6027
+ Gi as V,
6028
+ Ui as W,
6029
+ qi as X,
6030
+ Ke as Y,
6031
+ dr as Z,
6032
+ ii as _,
6068
6033
  hi as a,
6069
- fs as a0,
6070
- li as a1,
6071
- ai as a2,
6034
+ li as a0,
6035
+ ai as a1,
6072
6036
  di as b,
6073
6037
  vi as c,
6074
6038
  wi as d,
6075
6039
  Ei as e,
6076
6040
  oi as f,
6077
6041
  Ti as g,
6078
- _ as h,
6042
+ P as h,
6079
6043
  Ai as i,
6080
6044
  xi as j,
6081
6045
  Oi as k,