@caspeco/casper-ui-library 9.10.0 → 9.11.0

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,10 +1,10 @@
1
- import { Extension as h, callOrReturn as M, getExtensionField as A, isNodeEmpty as v, isNodeSelection as x } from "../../core/dist/index.js";
2
- import { PluginKey as y, Plugin as C } from "../../../prosemirror-state/dist/index.js";
3
- import { dropCursor as R } from "../../../prosemirror-dropcursor/dist/index.js";
4
- import { DecorationSet as P, Decoration as w } from "../../../prosemirror-view/dist/index.js";
5
- import { gapCursor as _ } from "../../../prosemirror-gapcursor/dist/index.js";
6
- import { history as O, redo as D, undo as L } from "../../../prosemirror-history/dist/index.js";
7
- h.create({
1
+ import { Extension as p, callOrReturn as x, getExtensionField as O, isNodeSelection as _, isNodeEmpty as T } from "../../core/dist/index.js";
2
+ import { PluginKey as P, Plugin as C } from "../../../prosemirror-state/dist/index.js";
3
+ import { dropCursor as D } from "../../../prosemirror-dropcursor/dist/index.js";
4
+ import { DecorationSet as w, Decoration as b } from "../../../prosemirror-view/dist/index.js";
5
+ import { gapCursor as L } from "../../../prosemirror-gapcursor/dist/index.js";
6
+ import { history as k, redo as B, undo as F } from "../../../prosemirror-history/dist/index.js";
7
+ p.create({
8
8
  name: "characterCount",
9
9
  addOptions() {
10
10
  return {
@@ -25,56 +25,56 @@ h.create({
25
25
  this.storage.characters = (e) => {
26
26
  const t = e?.node || this.editor.state.doc;
27
27
  if ((e?.mode || this.options.mode) === "textSize") {
28
- const n = t.textBetween(0, t.content.size, void 0, " ");
29
- return this.options.textCounter(n);
28
+ const o = t.textBetween(0, t.content.size, void 0, " ");
29
+ return this.options.textCounter(o);
30
30
  }
31
31
  return t.nodeSize;
32
32
  }, this.storage.words = (e) => {
33
- const t = e?.node || this.editor.state.doc, o = t.textBetween(0, t.content.size, " ", " ");
34
- return this.options.wordCounter(o);
33
+ const t = e?.node || this.editor.state.doc, n = t.textBetween(0, t.content.size, " ", " ");
34
+ return this.options.wordCounter(n);
35
35
  };
36
36
  },
37
37
  addProseMirrorPlugins() {
38
38
  let e = !1;
39
39
  return [
40
40
  new C({
41
- key: new y("characterCount"),
42
- appendTransaction: (t, o, n) => {
41
+ key: new P("characterCount"),
42
+ appendTransaction: (t, n, o) => {
43
43
  if (e)
44
44
  return;
45
- const r = this.options.limit, s = this.options.autoTrim;
46
- if (r == null || r === 0 || s === !1) {
45
+ const r = this.options.limit, i = this.options.autoTrim;
46
+ if (r == null || r === 0 || i === !1) {
47
47
  e = !0;
48
48
  return;
49
49
  }
50
- const i = this.storage.characters({ node: n.doc });
51
- if (i > r) {
52
- const d = i - r, a = 0, c = d;
50
+ const a = this.storage.characters({ node: o.doc });
51
+ if (a > r) {
52
+ const l = a - r, s = 0, d = l;
53
53
  console.warn(
54
54
  `[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`
55
55
  );
56
- const l = n.tr.deleteRange(a, c);
57
- return e = !0, l;
56
+ const c = o.tr.deleteRange(s, d);
57
+ return e = !0, c;
58
58
  }
59
59
  e = !0;
60
60
  },
61
- filterTransaction: (t, o) => {
62
- const n = this.options.limit;
63
- if (!t.docChanged || n === 0 || n === null || n === void 0)
61
+ filterTransaction: (t, n) => {
62
+ const o = this.options.limit;
63
+ if (!t.docChanged || o === 0 || o === null || o === void 0)
64
64
  return !0;
65
- const r = this.storage.characters({ node: o.doc }), s = this.storage.characters({ node: t.doc });
66
- if (s <= n || r > n && s > n && s <= r)
65
+ const r = this.storage.characters({ node: n.doc }), i = this.storage.characters({ node: t.doc });
66
+ if (i <= o || r > o && i > o && i <= r)
67
67
  return !0;
68
- if (r > n && s > n && s > r || !t.getMeta("paste"))
68
+ if (r > o && i > o && i > r || !t.getMeta("paste"))
69
69
  return !1;
70
- const d = t.selection.$head.pos, a = s - n, c = d - a, l = d;
71
- return t.deleteRange(c, l), !(this.storage.characters({ node: t.doc }) > n);
70
+ const l = t.selection.$head.pos, s = i - o, d = l - s, c = l;
71
+ return t.deleteRange(d, c), !(this.storage.characters({ node: t.doc }) > o);
72
72
  }
73
73
  })
74
74
  ];
75
75
  }
76
76
  });
77
- var V = h.create({
77
+ var et = p.create({
78
78
  name: "dropCursor",
79
79
  addOptions() {
80
80
  return {
@@ -84,10 +84,10 @@ var V = h.create({
84
84
  };
85
85
  },
86
86
  addProseMirrorPlugins() {
87
- return [R(this.options)];
87
+ return [D(this.options)];
88
88
  }
89
89
  });
90
- h.create({
90
+ p.create({
91
91
  name: "focus",
92
92
  addOptions() {
93
93
  return {
@@ -98,137 +98,238 @@ h.create({
98
98
  addProseMirrorPlugins() {
99
99
  return [
100
100
  new C({
101
- key: new y("focus"),
101
+ key: new P("focus"),
102
102
  props: {
103
103
  decorations: ({ doc: e, selection: t }) => {
104
- const { isEditable: o, isFocused: n } = this.editor, { anchor: r } = t, s = [];
105
- if (!o || !n)
106
- return P.create(e, []);
107
- let i = 0;
108
- this.options.mode === "deepest" && e.descendants((a, c) => {
109
- if (a.isText)
104
+ const { isEditable: n, isFocused: o } = this.editor, { anchor: r } = t, i = [];
105
+ if (!n || !o)
106
+ return w.create(e, []);
107
+ let a = 0;
108
+ this.options.mode === "deepest" && e.descendants((s, d) => {
109
+ if (s.isText)
110
110
  return;
111
- if (!(r >= c && r <= c + a.nodeSize - 1))
111
+ if (!(r >= d && r <= d + s.nodeSize - 1))
112
112
  return !1;
113
- i += 1;
113
+ a += 1;
114
114
  });
115
- let d = 0;
116
- return e.descendants((a, c) => {
117
- if (a.isText || !(r >= c && r <= c + a.nodeSize - 1))
115
+ let l = 0;
116
+ return e.descendants((s, d) => {
117
+ if (s.isText || !(r >= d && r <= d + s.nodeSize - 1))
118
118
  return !1;
119
- if (d += 1, this.options.mode === "deepest" && i - d > 0 || this.options.mode === "shallowest" && d > 1)
119
+ if (l += 1, this.options.mode === "deepest" && a - l > 0 || this.options.mode === "shallowest" && l > 1)
120
120
  return this.options.mode === "deepest";
121
- s.push(
122
- w.node(c, c + a.nodeSize, {
121
+ i.push(
122
+ b.node(d, d + s.nodeSize, {
123
123
  class: this.options.className
124
124
  })
125
125
  );
126
- }), P.create(e, s);
126
+ }), w.create(e, i);
127
127
  }
128
128
  }
129
129
  })
130
130
  ];
131
131
  }
132
132
  });
133
- var X = h.create({
133
+ var ot = p.create({
134
134
  name: "gapCursor",
135
135
  addProseMirrorPlugins() {
136
- return [_()];
136
+ return [L()];
137
137
  },
138
138
  extendNodeSchema(e) {
139
139
  var t;
140
- const o = {
140
+ const n = {
141
141
  name: e.name,
142
142
  options: e.options,
143
143
  storage: e.storage
144
144
  };
145
145
  return {
146
- allowGapCursor: (t = M(A(e, "allowGapCursor", o))) != null ? t : null
146
+ allowGapCursor: (t = x(O(e, "allowGapCursor", n))) != null ? t : null
147
147
  };
148
148
  }
149
- });
150
- function S(e) {
149
+ }), M = "placeholder", y = new P("tiptap__placeholder"), A = 200;
150
+ function N(e) {
151
151
  const {
152
152
  editor: t,
153
- placeholder: o,
154
- dataAttribute: n,
153
+ placeholder: n,
154
+ dataAttribute: o,
155
155
  pos: r,
156
- node: s,
157
- isEmptyDoc: i,
158
- hasAnchor: d,
159
- classes: { emptyNode: a, emptyEditor: c }
160
- } = e, l = [a];
161
- return i && l.push(c), w.node(r, r + s.nodeSize, {
162
- class: l.join(" "),
163
- [n]: typeof o == "function" ? o({
156
+ node: i,
157
+ isEmptyDoc: a,
158
+ hasAnchor: l,
159
+ classes: { emptyNode: s, emptyEditor: d }
160
+ } = e, c = [s];
161
+ return a && c.push(d), b.node(r, r + i.nodeSize, {
162
+ class: c.join(" "),
163
+ [o]: typeof n == "function" ? n({
164
164
  editor: t,
165
- node: s,
165
+ node: i,
166
166
  pos: r,
167
- hasAnchor: d
168
- }) : o
167
+ hasAnchor: l
168
+ }) : n
169
169
  });
170
170
  }
171
- function k(e) {
172
- const t = getComputedStyle(e), o = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
173
- return /auto|scroll|overlay/.test(o);
171
+ function I({
172
+ editor: e,
173
+ options: t,
174
+ dataAttribute: n,
175
+ doc: o,
176
+ selection: r
177
+ }) {
178
+ var i, a;
179
+ if (!(e.isEditable || !t.showOnlyWhenEditable))
180
+ return null;
181
+ const { anchor: s } = r, d = [], c = e.isEmpty, f = {
182
+ emptyEditor: t.emptyEditorClass,
183
+ emptyNode: t.emptyNodeClass
184
+ };
185
+ if (t.showOnlyCurrent && !t.includeChildren) {
186
+ const u = o.resolve(s), m = u.depth > 0 ? u.node(1) : u.nodeAfter, g = u.depth > 0 ? u.before(1) : s;
187
+ if (m && m.type.isTextblock && T(m)) {
188
+ const h = s >= g && s <= g + m.nodeSize;
189
+ d.push(
190
+ N({
191
+ editor: e,
192
+ isEmptyDoc: c,
193
+ dataAttribute: n,
194
+ hasAnchor: h,
195
+ placeholder: t.placeholder,
196
+ classes: f,
197
+ node: m,
198
+ pos: g
199
+ })
200
+ );
201
+ }
202
+ } else {
203
+ const u = y.getState(e.state), m = (i = u?.topPos) != null ? i : 0, g = (a = u?.bottomPos) != null ? a : o.content.size;
204
+ o.nodesBetween(m, g, (h, v) => {
205
+ const E = s >= v && s <= v + h.nodeSize, R = !h.isLeaf && T(h);
206
+ return h.type.isTextblock && (E || !t.showOnlyCurrent) && R && d.push(
207
+ N({
208
+ editor: e,
209
+ isEmptyDoc: c,
210
+ dataAttribute: n,
211
+ hasAnchor: E,
212
+ placeholder: t.placeholder,
213
+ classes: f,
214
+ node: h,
215
+ pos: v
216
+ })
217
+ ), t.includeChildren;
218
+ });
219
+ }
220
+ return w.create(o, d);
221
+ }
222
+ function $(e) {
223
+ return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
224
+ }
225
+ function V(e) {
226
+ const t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
227
+ return /auto|scroll|overlay/.test(n);
174
228
  }
175
- function B(e) {
229
+ function G(e) {
176
230
  let t = e;
177
231
  for (; t; ) {
178
- if (k(t))
232
+ if (V(t))
179
233
  return t;
180
- const o = t.parentElement;
181
- if (!o) {
182
- const n = t.getRootNode();
183
- if (n instanceof ShadowRoot) {
184
- t = n.host;
234
+ const n = t.parentElement;
235
+ if (!n) {
236
+ const o = t.getRootNode();
237
+ if (o instanceof ShadowRoot) {
238
+ t = o.host;
185
239
  continue;
186
240
  }
187
241
  return window;
188
242
  }
189
- t = o;
243
+ t = n;
190
244
  }
191
245
  return window;
192
246
  }
193
- function $(e) {
247
+ function U(e) {
194
248
  return e === window ? { top: 0, bottom: window.innerHeight } : e.getBoundingClientRect();
195
249
  }
196
- function F({
250
+ function W({
197
251
  doc: e,
198
252
  view: t,
199
- scrollContainer: o
253
+ scrollContainer: n
200
254
  }) {
201
- const n = t.dom.getBoundingClientRect(), r = o ? $(o) : { top: 0, bottom: window.innerHeight }, s = Math.max(n.top, r.top), i = Math.min(n.bottom, r.bottom);
202
- if (s >= i)
255
+ const o = t.dom.getBoundingClientRect(), r = n ? U(n) : { top: 0, bottom: window.innerHeight }, i = Math.max(o.top, r.top) - A, a = Math.min(o.bottom, r.bottom) + A;
256
+ if (i >= a)
203
257
  return { top: 0, bottom: e.content.size };
204
- const a = getComputedStyle(t.dom).direction === "rtl" ? Math.max(n.right - 2, n.left + 2) : n.left + 2, c = t.posAtCoords({ left: a, top: s + 2 }), l = t.posAtCoords({ left: a, top: i - 2 });
258
+ const s = getComputedStyle(t.dom).direction === "rtl" ? Math.max(o.right - 2, o.left + 2) : o.left + 2, d = t.posAtCoords({ left: s, top: i + 2 }), c = t.posAtCoords({ left: s, top: a - 2 });
205
259
  return {
206
- top: c ? c.pos : 0,
207
- bottom: l ? l.pos : e.content.size
260
+ top: d ? d.pos : 0,
261
+ bottom: c ? c.pos : e.content.size
208
262
  };
209
263
  }
210
- function U(e, t) {
211
- let o = null;
212
- return { call: ((...s) => {
213
- o || (e(...s), o = setTimeout(() => {
264
+ var q = {
265
+ /**
266
+ * Initialises the viewport state with no known positions.
267
+ * @returns The initial viewport state.
268
+ */
269
+ init() {
270
+ return { topPos: null, bottomPos: null };
271
+ },
272
+ /**
273
+ * Updates the viewport state from incoming transactions.
274
+ * @param tr - The transaction being applied.
275
+ * @param prev - The previous viewport state.
276
+ * @returns The next viewport state.
277
+ */
278
+ apply(e, t) {
279
+ const n = e.getMeta(y);
280
+ return n?.positions ? { topPos: n.positions.top, bottomPos: n.positions.bottom } : e.docChanged ? {
281
+ topPos: t.topPos !== null ? e.mapping.map(t.topPos) : null,
282
+ bottomPos: t.bottomPos !== null ? e.mapping.map(t.bottomPos) : null
283
+ } : t;
284
+ }
285
+ };
286
+ function K(e) {
287
+ const t = G(e.dom), n = () => {
288
+ const l = W({
289
+ view: e,
290
+ doc: e.state.doc,
291
+ scrollContainer: t
292
+ }), s = y.getState(e.state);
293
+ if (s?.topPos === l.top && s?.bottomPos === l.bottom)
294
+ return;
295
+ const d = e.state.tr.setMeta(y, { positions: l });
296
+ e.dispatch(d);
297
+ };
298
+ let o = null, r = 0;
299
+ const i = 150, a = () => {
300
+ o === null && (o = requestAnimationFrame(() => {
214
301
  o = null;
215
- }, t));
216
- }), cancel: () => {
217
- o && (clearTimeout(o), o = null);
218
- } };
302
+ const l = performance.now();
303
+ l - r >= i ? (r = l, n()) : a();
304
+ }));
305
+ };
306
+ return t.addEventListener("scroll", a, { passive: !0 }), n(), {
307
+ update(l, s) {
308
+ e.state.doc.content.size !== s.doc.content.size && a();
309
+ },
310
+ destroy: () => {
311
+ o !== null && cancelAnimationFrame(o), t.removeEventListener("scroll", a);
312
+ }
313
+ };
219
314
  }
220
- var T = "placeholder";
221
- function G(e) {
222
- return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
315
+ function j({ editor: e, options: t }) {
316
+ const n = t.dataAttribute ? `data-${$(t.dataAttribute)}` : `data-${M}`;
317
+ return new C({
318
+ key: y,
319
+ state: q,
320
+ view: K,
321
+ props: {
322
+ decorations: ({ doc: o, selection: r }) => I({ editor: e, options: t, dataAttribute: n, doc: o, selection: r })
323
+ }
324
+ });
223
325
  }
224
- var g = new y("tiptap__placeholder");
225
- h.create({
326
+ p.create({
226
327
  name: "placeholder",
227
328
  addOptions() {
228
329
  return {
229
330
  emptyEditorClass: "is-editor-empty",
230
331
  emptyNodeClass: "is-empty",
231
- dataAttribute: T,
332
+ dataAttribute: M,
232
333
  placeholder: "Write something …",
233
334
  showOnlyWhenEditable: !0,
234
335
  showOnlyCurrent: !0,
@@ -236,108 +337,10 @@ h.create({
236
337
  };
237
338
  },
238
339
  addProseMirrorPlugins() {
239
- const e = this.options.dataAttribute ? `data-${G(this.options.dataAttribute)}` : `data-${T}`;
240
- return [
241
- new C({
242
- state: {
243
- init() {
244
- return {
245
- // null means "no viewport info yet" — decoration callback falls
246
- // back to full document scan until the scroll handler fires.
247
- topPos: null,
248
- bottomPos: null
249
- };
250
- },
251
- apply(t, o) {
252
- const n = t.getMeta(g);
253
- return n?.positions ? {
254
- topPos: n.positions.top,
255
- bottomPos: n.positions.bottom
256
- } : t.docChanged ? {
257
- topPos: o.topPos !== null ? t.mapping.map(o.topPos) : null,
258
- bottomPos: o.bottomPos !== null ? t.mapping.map(o.bottomPos) : null
259
- } : o;
260
- }
261
- },
262
- key: g,
263
- view(t) {
264
- const o = B(t.dom), n = () => {
265
- const d = F({
266
- view: t,
267
- doc: t.state.doc,
268
- scrollContainer: o
269
- }), a = g.getState(t.state);
270
- if (a.topPos === d.top && a.bottomPos === d.bottom)
271
- return;
272
- const c = t.state.tr.setMeta(g, { positions: d }).setMeta("tiptap__viewportUpdate", !0);
273
- t.dispatch(c);
274
- }, { call: r, cancel: s } = U(n, 250), i = o;
275
- return i.addEventListener("scroll", r, { passive: !0 }), n(), {
276
- update(d, a) {
277
- t.state.doc.content.size !== a.doc.content.size && n();
278
- },
279
- destroy: () => {
280
- s(), i.removeEventListener("scroll", r);
281
- }
282
- };
283
- },
284
- props: {
285
- decorations: ({ doc: t, selection: o }) => {
286
- var n, r;
287
- if (!(this.editor.isEditable || !this.options.showOnlyWhenEditable))
288
- return null;
289
- const { anchor: i } = o, d = [], a = this.editor.isEmpty;
290
- if (this.options.showOnlyCurrent && !this.options.includeChildren) {
291
- const l = t.resolve(i);
292
- if (l.depth > 0) {
293
- const u = l.node(1), m = l.before(1);
294
- if (u.type.isTextblock && v(u)) {
295
- const p = i >= m && i <= m + u.nodeSize, f = S({
296
- node: u,
297
- dataAttribute: e,
298
- hasAnchor: p,
299
- placeholder: this.options.placeholder,
300
- classes: {
301
- emptyEditor: this.options.emptyEditorClass,
302
- emptyNode: this.options.emptyNodeClass
303
- },
304
- editor: this.editor,
305
- isEmptyDoc: a,
306
- pos: l.before(1)
307
- });
308
- d.push(f);
309
- }
310
- }
311
- } else {
312
- const l = g.getState(this.editor.state), u = (n = l.topPos) != null ? n : 0, m = (r = l.bottomPos) != null ? r : t.content.size;
313
- t.nodesBetween(u, m, (p, f) => {
314
- const b = i >= f && i <= f + p.nodeSize, z = !p.isLeaf && v(p);
315
- if (!p.type.isTextblock)
316
- return this.options.includeChildren;
317
- if ((b || !this.options.showOnlyCurrent) && z) {
318
- const N = S({
319
- classes: { emptyEditor: this.options.emptyEditorClass, emptyNode: this.options.emptyNodeClass },
320
- editor: this.editor,
321
- isEmptyDoc: a,
322
- dataAttribute: e,
323
- hasAnchor: b,
324
- placeholder: this.options.placeholder,
325
- node: p,
326
- pos: f
327
- });
328
- d.push(N);
329
- }
330
- return this.options.includeChildren;
331
- });
332
- }
333
- return P.create(t, d);
334
- }
335
- }
336
- })
337
- ];
340
+ return [j({ editor: this.editor, options: this.options })];
338
341
  }
339
342
  });
340
- h.create({
343
+ p.create({
341
344
  name: "selection",
342
345
  addOptions() {
343
346
  return {
@@ -348,11 +351,11 @@ h.create({
348
351
  const { editor: e, options: t } = this;
349
352
  return [
350
353
  new C({
351
- key: new y("selection"),
354
+ key: new P("selection"),
352
355
  props: {
353
- decorations(o) {
354
- return o.selection.empty || e.isFocused || !e.isEditable || x(o.selection) || e.view.dragging ? null : P.create(o.doc, [
355
- w.inline(o.selection.from, o.selection.to, {
356
+ decorations(n) {
357
+ return n.selection.empty || e.isFocused || !e.isEditable || _(n.selection) || e.view.dragging ? null : w.create(n.doc, [
358
+ b.inline(n.selection.from, n.selection.to, {
356
359
  class: t.className
357
360
  })
358
361
  ]);
@@ -362,11 +365,14 @@ h.create({
362
365
  ];
363
366
  }
364
367
  });
365
- var I = "skipTrailingNode";
366
- function E({ types: e, node: t }) {
368
+ var H = "skipTrailingNode";
369
+ function z({
370
+ types: e,
371
+ node: t
372
+ }) {
367
373
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
368
374
  }
369
- var Z = h.create({
375
+ var nt = p.create({
370
376
  name: "trailingNode",
371
377
  addOptions() {
372
378
  return {
@@ -376,31 +382,31 @@ var Z = h.create({
376
382
  },
377
383
  addProseMirrorPlugins() {
378
384
  var e;
379
- const t = new y(this.name), o = this.options.node || ((e = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : e.name) || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, r]) => r).filter((r) => (this.options.notAfter || []).concat(o).includes(r.name));
385
+ const t = new P(this.name), n = this.options.node || ((e = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : e.name) || "paragraph", o = Object.entries(this.editor.schema.nodes).map(([, r]) => r).filter((r) => (this.options.notAfter || []).concat(n).includes(r.name));
380
386
  return [
381
387
  new C({
382
388
  key: t,
383
- appendTransaction: (r, s, i) => {
384
- const { doc: d, tr: a, schema: c } = i, l = t.getState(i), u = d.content.size, m = c.nodes[o];
385
- if (!r.some((p) => p.getMeta(I)) && l)
386
- return a.insert(u, m.create());
389
+ appendTransaction: (r, i, a) => {
390
+ const { doc: l, tr: s, schema: d } = a, c = t.getState(a), f = l.content.size, S = d.nodes[n];
391
+ if (!r.some((u) => u.getMeta(H)) && c)
392
+ return s.insert(f, S.create());
387
393
  },
388
394
  state: {
389
- init: (r, s) => {
390
- const i = s.tr.doc.lastChild;
391
- return !E({ node: i, types: n });
395
+ init: (r, i) => {
396
+ const a = i.tr.doc.lastChild;
397
+ return !z({ node: a, types: o });
392
398
  },
393
- apply: (r, s) => {
399
+ apply: (r, i) => {
394
400
  if (!r.docChanged || r.getMeta("__uniqueIDTransaction"))
395
- return s;
396
- const i = r.doc.lastChild;
397
- return !E({ node: i, types: n });
401
+ return i;
402
+ const a = r.doc.lastChild;
403
+ return !z({ node: a, types: o });
398
404
  }
399
405
  }
400
406
  })
401
407
  ];
402
408
  }
403
- }), J = h.create({
409
+ }), rt = p.create({
404
410
  name: "undoRedo",
405
411
  addOptions() {
406
412
  return {
@@ -410,12 +416,12 @@ var Z = h.create({
410
416
  },
411
417
  addCommands() {
412
418
  return {
413
- undo: () => ({ state: e, dispatch: t }) => L(e, t),
414
- redo: () => ({ state: e, dispatch: t }) => D(e, t)
419
+ undo: () => ({ state: e, dispatch: t }) => F(e, t),
420
+ redo: () => ({ state: e, dispatch: t }) => B(e, t)
415
421
  };
416
422
  },
417
423
  addProseMirrorPlugins() {
418
- return [O(this.options)];
424
+ return [k(this.options)];
419
425
  },
420
426
  addKeyboardShortcuts() {
421
427
  return {
@@ -429,11 +435,12 @@ var Z = h.create({
429
435
  }
430
436
  });
431
437
  export {
432
- V as Dropcursor,
433
- X as Gapcursor,
434
- g as PLUGIN_KEY,
435
- Z as TrailingNode,
436
- J as UndoRedo,
437
- G as preparePlaceholderAttribute,
438
- I as skipTrailingNodeMeta
438
+ M as DEFAULT_DATA_ATTRIBUTE,
439
+ et as Dropcursor,
440
+ ot as Gapcursor,
441
+ y as PLUGIN_KEY,
442
+ nt as TrailingNode,
443
+ rt as UndoRedo,
444
+ $ as preparePlaceholderAttribute,
445
+ H as skipTrailingNodeMeta
439
446
  };