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