@tiptap/extensions 3.0.0-beta.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.
Files changed (74) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +18 -0
  3. package/dist/character-count/index.cjs +129 -0
  4. package/dist/character-count/index.cjs.map +1 -0
  5. package/dist/character-count/index.d.cts +62 -0
  6. package/dist/character-count/index.d.ts +62 -0
  7. package/dist/character-count/index.js +102 -0
  8. package/dist/character-count/index.js.map +1 -0
  9. package/dist/drop-cursor/index.cjs +47 -0
  10. package/dist/drop-cursor/index.cjs.map +1 -0
  11. package/dist/drop-cursor/index.d.cts +31 -0
  12. package/dist/drop-cursor/index.d.ts +31 -0
  13. package/dist/drop-cursor/index.js +20 -0
  14. package/dist/drop-cursor/index.js.map +1 -0
  15. package/dist/focus/index.cjs +95 -0
  16. package/dist/focus/index.cjs.map +1 -0
  17. package/dist/focus/index.d.cts +28 -0
  18. package/dist/focus/index.d.ts +28 -0
  19. package/dist/focus/index.js +68 -0
  20. package/dist/focus/index.js.map +1 -0
  21. package/dist/gap-cursor/index.cjs +51 -0
  22. package/dist/gap-cursor/index.cjs.map +1 -0
  23. package/dist/gap-cursor/index.d.cts +25 -0
  24. package/dist/gap-cursor/index.d.ts +25 -0
  25. package/dist/gap-cursor/index.js +24 -0
  26. package/dist/gap-cursor/index.js.map +1 -0
  27. package/dist/index.cjs +421 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/index.d.cts +272 -0
  30. package/dist/index.d.ts +272 -0
  31. package/dist/index.js +387 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/placeholder/index.cjs +88 -0
  34. package/dist/placeholder/index.cjs.map +1 -0
  35. package/dist/placeholder/index.d.cts +59 -0
  36. package/dist/placeholder/index.d.ts +59 -0
  37. package/dist/placeholder/index.js +61 -0
  38. package/dist/placeholder/index.js.map +1 -0
  39. package/dist/selection/index.cjs +63 -0
  40. package/dist/selection/index.cjs.map +1 -0
  41. package/dist/selection/index.d.cts +17 -0
  42. package/dist/selection/index.d.ts +17 -0
  43. package/dist/selection/index.js +36 -0
  44. package/dist/selection/index.js.map +1 -0
  45. package/dist/trailing-node/index.cjs +78 -0
  46. package/dist/trailing-node/index.cjs.map +1 -0
  47. package/dist/trailing-node/index.d.cts +28 -0
  48. package/dist/trailing-node/index.d.ts +28 -0
  49. package/dist/trailing-node/index.js +51 -0
  50. package/dist/trailing-node/index.js.map +1 -0
  51. package/dist/undo-redo/index.cjs +66 -0
  52. package/dist/undo-redo/index.cjs.map +1 -0
  53. package/dist/undo-redo/index.d.cts +44 -0
  54. package/dist/undo-redo/index.d.ts +44 -0
  55. package/dist/undo-redo/index.js +39 -0
  56. package/dist/undo-redo/index.js.map +1 -0
  57. package/package.json +114 -0
  58. package/src/character-count/character-count.ts +195 -0
  59. package/src/character-count/index.ts +1 -0
  60. package/src/drop-cursor/drop-cursor.ts +47 -0
  61. package/src/drop-cursor/index.ts +1 -0
  62. package/src/focus/focus.ts +110 -0
  63. package/src/focus/index.ts +1 -0
  64. package/src/gap-cursor/gap-cursor.ts +47 -0
  65. package/src/gap-cursor/index.ts +1 -0
  66. package/src/index.ts +8 -0
  67. package/src/placeholder/index.ts +1 -0
  68. package/src/placeholder/placeholder.ts +129 -0
  69. package/src/selection/index.ts +1 -0
  70. package/src/selection/selection.ts +51 -0
  71. package/src/trailing-node/index.ts +1 -0
  72. package/src/trailing-node/trailing-node.ts +84 -0
  73. package/src/undo-redo/index.ts +1 -0
  74. package/src/undo-redo/undo-redo.ts +86 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,421 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ CharacterCount: () => CharacterCount,
24
+ Dropcursor: () => Dropcursor,
25
+ Focus: () => Focus,
26
+ Gapcursor: () => Gapcursor,
27
+ Placeholder: () => Placeholder,
28
+ Selection: () => Selection,
29
+ TrailingNode: () => TrailingNode,
30
+ UndoRedo: () => UndoRedo
31
+ });
32
+ module.exports = __toCommonJS(index_exports);
33
+
34
+ // src/character-count/character-count.ts
35
+ var import_core = require("@tiptap/core");
36
+ var import_state = require("@tiptap/pm/state");
37
+ var CharacterCount = import_core.Extension.create({
38
+ name: "characterCount",
39
+ addOptions() {
40
+ return {
41
+ limit: null,
42
+ mode: "textSize",
43
+ textCounter: (text) => text.length,
44
+ wordCounter: (text) => text.split(" ").filter((word) => word !== "").length
45
+ };
46
+ },
47
+ addStorage() {
48
+ return {
49
+ characters: () => 0,
50
+ words: () => 0
51
+ };
52
+ },
53
+ onBeforeCreate() {
54
+ this.storage.characters = (options) => {
55
+ const node = (options == null ? void 0 : options.node) || this.editor.state.doc;
56
+ const mode = (options == null ? void 0 : options.mode) || this.options.mode;
57
+ if (mode === "textSize") {
58
+ const text = node.textBetween(0, node.content.size, void 0, " ");
59
+ return this.options.textCounter(text);
60
+ }
61
+ return node.nodeSize;
62
+ };
63
+ this.storage.words = (options) => {
64
+ const node = (options == null ? void 0 : options.node) || this.editor.state.doc;
65
+ const text = node.textBetween(0, node.content.size, " ", " ");
66
+ return this.options.wordCounter(text);
67
+ };
68
+ },
69
+ addProseMirrorPlugins() {
70
+ let initialEvaluationDone = false;
71
+ return [
72
+ new import_state.Plugin({
73
+ key: new import_state.PluginKey("characterCount"),
74
+ appendTransaction: (transactions, oldState, newState) => {
75
+ if (initialEvaluationDone) {
76
+ return;
77
+ }
78
+ const limit = this.options.limit;
79
+ if (limit === null || limit === void 0 || limit === 0) {
80
+ initialEvaluationDone = true;
81
+ return;
82
+ }
83
+ const initialContentSize = this.storage.characters({ node: newState.doc });
84
+ if (initialContentSize > limit) {
85
+ const over = initialContentSize - limit;
86
+ const from = 0;
87
+ const to = over;
88
+ console.warn(
89
+ `[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`
90
+ );
91
+ const tr = newState.tr.deleteRange(from, to);
92
+ initialEvaluationDone = true;
93
+ return tr;
94
+ }
95
+ initialEvaluationDone = true;
96
+ },
97
+ filterTransaction: (transaction, state) => {
98
+ const limit = this.options.limit;
99
+ if (!transaction.docChanged || limit === 0 || limit === null || limit === void 0) {
100
+ return true;
101
+ }
102
+ const oldSize = this.storage.characters({ node: state.doc });
103
+ const newSize = this.storage.characters({ node: transaction.doc });
104
+ if (newSize <= limit) {
105
+ return true;
106
+ }
107
+ if (oldSize > limit && newSize > limit && newSize <= oldSize) {
108
+ return true;
109
+ }
110
+ if (oldSize > limit && newSize > limit && newSize > oldSize) {
111
+ return false;
112
+ }
113
+ const isPaste = transaction.getMeta("paste");
114
+ if (!isPaste) {
115
+ return false;
116
+ }
117
+ const pos = transaction.selection.$head.pos;
118
+ const over = newSize - limit;
119
+ const from = pos - over;
120
+ const to = pos;
121
+ transaction.deleteRange(from, to);
122
+ const updatedSize = this.storage.characters({ node: transaction.doc });
123
+ if (updatedSize > limit) {
124
+ return false;
125
+ }
126
+ return true;
127
+ }
128
+ })
129
+ ];
130
+ }
131
+ });
132
+
133
+ // src/drop-cursor/drop-cursor.ts
134
+ var import_core2 = require("@tiptap/core");
135
+ var import_dropcursor = require("@tiptap/pm/dropcursor");
136
+ var Dropcursor = import_core2.Extension.create({
137
+ name: "dropCursor",
138
+ addOptions() {
139
+ return {
140
+ color: "currentColor",
141
+ width: 1,
142
+ class: void 0
143
+ };
144
+ },
145
+ addProseMirrorPlugins() {
146
+ return [(0, import_dropcursor.dropCursor)(this.options)];
147
+ }
148
+ });
149
+
150
+ // src/focus/focus.ts
151
+ var import_core3 = require("@tiptap/core");
152
+ var import_state2 = require("@tiptap/pm/state");
153
+ var import_view = require("@tiptap/pm/view");
154
+ var Focus = import_core3.Extension.create({
155
+ name: "focus",
156
+ addOptions() {
157
+ return {
158
+ className: "has-focus",
159
+ mode: "all"
160
+ };
161
+ },
162
+ addProseMirrorPlugins() {
163
+ return [
164
+ new import_state2.Plugin({
165
+ key: new import_state2.PluginKey("focus"),
166
+ props: {
167
+ decorations: ({ doc, selection }) => {
168
+ const { isEditable, isFocused } = this.editor;
169
+ const { anchor } = selection;
170
+ const decorations = [];
171
+ if (!isEditable || !isFocused) {
172
+ return import_view.DecorationSet.create(doc, []);
173
+ }
174
+ let maxLevels = 0;
175
+ if (this.options.mode === "deepest") {
176
+ doc.descendants((node, pos) => {
177
+ if (node.isText) {
178
+ return;
179
+ }
180
+ const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1;
181
+ if (!isCurrent) {
182
+ return false;
183
+ }
184
+ maxLevels += 1;
185
+ });
186
+ }
187
+ let currentLevel = 0;
188
+ doc.descendants((node, pos) => {
189
+ if (node.isText) {
190
+ return false;
191
+ }
192
+ const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1;
193
+ if (!isCurrent) {
194
+ return false;
195
+ }
196
+ currentLevel += 1;
197
+ const outOfScope = this.options.mode === "deepest" && maxLevels - currentLevel > 0 || this.options.mode === "shallowest" && currentLevel > 1;
198
+ if (outOfScope) {
199
+ return this.options.mode === "deepest";
200
+ }
201
+ decorations.push(
202
+ import_view.Decoration.node(pos, pos + node.nodeSize, {
203
+ class: this.options.className
204
+ })
205
+ );
206
+ });
207
+ return import_view.DecorationSet.create(doc, decorations);
208
+ }
209
+ }
210
+ })
211
+ ];
212
+ }
213
+ });
214
+
215
+ // src/gap-cursor/gap-cursor.ts
216
+ var import_core4 = require("@tiptap/core");
217
+ var import_gapcursor = require("@tiptap/pm/gapcursor");
218
+ var Gapcursor = import_core4.Extension.create({
219
+ name: "gapCursor",
220
+ addProseMirrorPlugins() {
221
+ return [(0, import_gapcursor.gapCursor)()];
222
+ },
223
+ extendNodeSchema(extension) {
224
+ var _a;
225
+ const context = {
226
+ name: extension.name,
227
+ options: extension.options,
228
+ storage: extension.storage
229
+ };
230
+ return {
231
+ allowGapCursor: (_a = (0, import_core4.callOrReturn)((0, import_core4.getExtensionField)(extension, "allowGapCursor", context))) != null ? _a : null
232
+ };
233
+ }
234
+ });
235
+
236
+ // src/placeholder/placeholder.ts
237
+ var import_core5 = require("@tiptap/core");
238
+ var import_state3 = require("@tiptap/pm/state");
239
+ var import_view2 = require("@tiptap/pm/view");
240
+ var Placeholder = import_core5.Extension.create({
241
+ name: "placeholder",
242
+ addOptions() {
243
+ return {
244
+ emptyEditorClass: "is-editor-empty",
245
+ emptyNodeClass: "is-empty",
246
+ placeholder: "Write something \u2026",
247
+ showOnlyWhenEditable: true,
248
+ showOnlyCurrent: true,
249
+ includeChildren: false
250
+ };
251
+ },
252
+ addProseMirrorPlugins() {
253
+ return [
254
+ new import_state3.Plugin({
255
+ key: new import_state3.PluginKey("placeholder"),
256
+ props: {
257
+ decorations: ({ doc, selection }) => {
258
+ const active = this.editor.isEditable || !this.options.showOnlyWhenEditable;
259
+ const { anchor } = selection;
260
+ const decorations = [];
261
+ if (!active) {
262
+ return null;
263
+ }
264
+ const isEmptyDoc = this.editor.isEmpty;
265
+ doc.descendants((node, pos) => {
266
+ const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
267
+ const isEmpty = !node.isLeaf && (0, import_core5.isNodeEmpty)(node);
268
+ if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
269
+ const classes = [this.options.emptyNodeClass];
270
+ if (isEmptyDoc) {
271
+ classes.push(this.options.emptyEditorClass);
272
+ }
273
+ const decoration = import_view2.Decoration.node(pos, pos + node.nodeSize, {
274
+ class: classes.join(" "),
275
+ "data-placeholder": typeof this.options.placeholder === "function" ? this.options.placeholder({
276
+ editor: this.editor,
277
+ node,
278
+ pos,
279
+ hasAnchor
280
+ }) : this.options.placeholder
281
+ });
282
+ decorations.push(decoration);
283
+ }
284
+ return this.options.includeChildren;
285
+ });
286
+ return import_view2.DecorationSet.create(doc, decorations);
287
+ }
288
+ }
289
+ })
290
+ ];
291
+ }
292
+ });
293
+
294
+ // src/selection/selection.ts
295
+ var import_core6 = require("@tiptap/core");
296
+ var import_state4 = require("@tiptap/pm/state");
297
+ var import_view3 = require("@tiptap/pm/view");
298
+ var Selection = import_core6.Extension.create({
299
+ name: "selection",
300
+ addOptions() {
301
+ return {
302
+ className: "selection"
303
+ };
304
+ },
305
+ addProseMirrorPlugins() {
306
+ const { editor, options } = this;
307
+ return [
308
+ new import_state4.Plugin({
309
+ key: new import_state4.PluginKey("selection"),
310
+ props: {
311
+ decorations(state) {
312
+ if (state.selection.empty || editor.isFocused || !editor.isEditable || (0, import_core6.isNodeSelection)(state.selection)) {
313
+ return null;
314
+ }
315
+ return import_view3.DecorationSet.create(state.doc, [
316
+ import_view3.Decoration.inline(state.selection.from, state.selection.to, {
317
+ class: options.className
318
+ })
319
+ ]);
320
+ }
321
+ }
322
+ })
323
+ ];
324
+ }
325
+ });
326
+
327
+ // src/trailing-node/trailing-node.ts
328
+ var import_core7 = require("@tiptap/core");
329
+ var import_state5 = require("@tiptap/pm/state");
330
+ function nodeEqualsType({ types, node }) {
331
+ return node && Array.isArray(types) && types.includes(node.type) || (node == null ? void 0 : node.type) === types;
332
+ }
333
+ var TrailingNode = import_core7.Extension.create({
334
+ name: "trailingNode",
335
+ addOptions() {
336
+ return {
337
+ node: "paragraph",
338
+ notAfter: []
339
+ };
340
+ },
341
+ addProseMirrorPlugins() {
342
+ const plugin = new import_state5.PluginKey(this.name);
343
+ const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(this.options.node).includes(node.name));
344
+ return [
345
+ new import_state5.Plugin({
346
+ key: plugin,
347
+ appendTransaction: (_, __, state) => {
348
+ const { doc, tr, schema } = state;
349
+ const shouldInsertNodeAtEnd = plugin.getState(state);
350
+ const endPosition = doc.content.size;
351
+ const type = schema.nodes[this.options.node];
352
+ if (!shouldInsertNodeAtEnd) {
353
+ return;
354
+ }
355
+ return tr.insert(endPosition, type.create());
356
+ },
357
+ state: {
358
+ init: (_, state) => {
359
+ const lastNode = state.tr.doc.lastChild;
360
+ return !nodeEqualsType({ node: lastNode, types: disabledNodes });
361
+ },
362
+ apply: (tr, value) => {
363
+ if (!tr.docChanged) {
364
+ return value;
365
+ }
366
+ const lastNode = tr.doc.lastChild;
367
+ return !nodeEqualsType({ node: lastNode, types: disabledNodes });
368
+ }
369
+ }
370
+ })
371
+ ];
372
+ }
373
+ });
374
+
375
+ // src/undo-redo/undo-redo.ts
376
+ var import_core8 = require("@tiptap/core");
377
+ var import_history = require("@tiptap/pm/history");
378
+ var UndoRedo = import_core8.Extension.create({
379
+ name: "undoRedo",
380
+ addOptions() {
381
+ return {
382
+ depth: 100,
383
+ newGroupDelay: 500
384
+ };
385
+ },
386
+ addCommands() {
387
+ return {
388
+ undo: () => ({ state, dispatch }) => {
389
+ return (0, import_history.undo)(state, dispatch);
390
+ },
391
+ redo: () => ({ state, dispatch }) => {
392
+ return (0, import_history.redo)(state, dispatch);
393
+ }
394
+ };
395
+ },
396
+ addProseMirrorPlugins() {
397
+ return [(0, import_history.history)(this.options)];
398
+ },
399
+ addKeyboardShortcuts() {
400
+ return {
401
+ "Mod-z": () => this.editor.commands.undo(),
402
+ "Shift-Mod-z": () => this.editor.commands.redo(),
403
+ "Mod-y": () => this.editor.commands.redo(),
404
+ // Russian keyboard layouts
405
+ "Mod-\u044F": () => this.editor.commands.undo(),
406
+ "Shift-Mod-\u044F": () => this.editor.commands.redo()
407
+ };
408
+ }
409
+ });
410
+ // Annotate the CommonJS export names for ESM import in node:
411
+ 0 && (module.exports = {
412
+ CharacterCount,
413
+ Dropcursor,
414
+ Focus,
415
+ Gapcursor,
416
+ Placeholder,
417
+ Selection,
418
+ TrailingNode,
419
+ UndoRedo
420
+ });
421
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/character-count/character-count.ts","../src/drop-cursor/drop-cursor.ts","../src/focus/focus.ts","../src/gap-cursor/gap-cursor.ts","../src/placeholder/placeholder.ts","../src/selection/selection.ts","../src/trailing-node/trailing-node.ts","../src/undo-redo/undo-redo.ts"],"sourcesContent":["export * from './character-count/index.js'\nexport * from './drop-cursor/index.js'\nexport * from './focus/index.js'\nexport * from './gap-cursor/index.js'\nexport * from './placeholder/index.js'\nexport * from './selection/index.js'\nexport * from './trailing-node/index.js'\nexport * from './undo-redo/index.js'\n","import { Extension } from '@tiptap/core'\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\n\nexport interface CharacterCountOptions {\n /**\n * The maximum number of characters that should be allowed. Defaults to `0`.\n * @default null\n * @example 180\n */\n limit: number | null | undefined\n /**\n * The mode by which the size is calculated. If set to `textSize`, the textContent of the document is used.\n * If set to `nodeSize`, the nodeSize of the document is used.\n * @default 'textSize'\n * @example 'textSize'\n */\n mode: 'textSize' | 'nodeSize'\n /**\n * The text counter function to use. Defaults to a simple character count.\n * @default (text) => text.length\n * @example (text) => [...new Intl.Segmenter().segment(text)].length\n */\n textCounter: (text: string) => number\n /**\n * The word counter function to use. Defaults to a simple word count.\n * @default (text) => text.split(' ').filter(word => word !== '').length\n * @example (text) => text.split(/\\s+/).filter(word => word !== '').length\n */\n wordCounter: (text: string) => number\n}\n\nexport interface CharacterCountStorage {\n /**\n * Get the number of characters for the current document.\n * @param options The options for the character count. (optional)\n * @param options.node The node to get the characters from. Defaults to the current document.\n * @param options.mode The mode by which the size is calculated. If set to `textSize`, the textContent of the document is used.\n */\n characters: (options?: { node?: ProseMirrorNode; mode?: 'textSize' | 'nodeSize' }) => number\n\n /**\n * Get the number of words for the current document.\n * @param options The options for the character count. (optional)\n * @param options.node The node to get the words from. Defaults to the current document.\n */\n words: (options?: { node?: ProseMirrorNode }) => number\n}\n\ndeclare module '@tiptap/core' {\n interface Storage {\n characterCount: CharacterCountStorage\n }\n}\n\n/**\n * This extension allows you to count the characters and words of your document.\n * @see https://tiptap.dev/api/extensions/character-count\n */\nexport const CharacterCount = Extension.create<CharacterCountOptions, CharacterCountStorage>({\n name: 'characterCount',\n\n addOptions() {\n return {\n limit: null,\n mode: 'textSize',\n textCounter: text => text.length,\n wordCounter: text => text.split(' ').filter(word => word !== '').length,\n }\n },\n\n addStorage() {\n return {\n characters: () => 0,\n words: () => 0,\n }\n },\n\n onBeforeCreate() {\n this.storage.characters = options => {\n const node = options?.node || this.editor.state.doc\n const mode = options?.mode || this.options.mode\n\n if (mode === 'textSize') {\n const text = node.textBetween(0, node.content.size, undefined, ' ')\n\n return this.options.textCounter(text)\n }\n\n return node.nodeSize\n }\n\n this.storage.words = options => {\n const node = options?.node || this.editor.state.doc\n const text = node.textBetween(0, node.content.size, ' ', ' ')\n\n return this.options.wordCounter(text)\n }\n },\n\n addProseMirrorPlugins() {\n let initialEvaluationDone = false\n\n return [\n new Plugin({\n key: new PluginKey('characterCount'),\n appendTransaction: (transactions, oldState, newState) => {\n if (initialEvaluationDone) {\n return\n }\n\n const limit = this.options.limit\n\n if (limit === null || limit === undefined || limit === 0) {\n initialEvaluationDone = true\n return\n }\n\n const initialContentSize = this.storage.characters({ node: newState.doc })\n\n if (initialContentSize > limit) {\n const over = initialContentSize - limit\n const from = 0\n const to = over\n\n console.warn(\n `[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`,\n )\n const tr = newState.tr.deleteRange(from, to)\n\n initialEvaluationDone = true\n return tr\n }\n\n initialEvaluationDone = true\n },\n filterTransaction: (transaction, state) => {\n const limit = this.options.limit\n\n // Nothing has changed or no limit is defined. Ignore it.\n if (!transaction.docChanged || limit === 0 || limit === null || limit === undefined) {\n return true\n }\n\n const oldSize = this.storage.characters({ node: state.doc })\n const newSize = this.storage.characters({ node: transaction.doc })\n\n // Everything is in the limit. Good.\n if (newSize <= limit) {\n return true\n }\n\n // The limit has already been exceeded but will be reduced.\n if (oldSize > limit && newSize > limit && newSize <= oldSize) {\n return true\n }\n\n // The limit has already been exceeded and will be increased further.\n if (oldSize > limit && newSize > limit && newSize > oldSize) {\n return false\n }\n\n const isPaste = transaction.getMeta('paste')\n\n // Block all exceeding transactions that were not pasted.\n if (!isPaste) {\n return false\n }\n\n // For pasted content, we try to remove the exceeding content.\n const pos = transaction.selection.$head.pos\n const over = newSize - limit\n const from = pos - over\n const to = pos\n\n // It’s probably a bad idea to mutate transactions within `filterTransaction`\n // but for now this is working fine.\n transaction.deleteRange(from, to)\n\n // In some situations, the limit will continue to be exceeded after trimming.\n // This happens e.g. when truncating within a complex node (e.g. table)\n // and ProseMirror has to close this node again.\n // If this is the case, we prevent the transaction completely.\n const updatedSize = this.storage.characters({ node: transaction.doc })\n\n if (updatedSize > limit) {\n return false\n }\n\n return true\n },\n }),\n ]\n },\n})\n","import { Extension } from '@tiptap/core'\nimport { dropCursor } from '@tiptap/pm/dropcursor'\n\nexport interface DropcursorOptions {\n /**\n * The color of the drop cursor\n * @default 'currentColor'\n * @example 'red'\n */\n color: string | undefined\n\n /**\n * The width of the drop cursor\n * @default 1\n * @example 2\n */\n width: number | undefined\n\n /**\n * The class of the drop cursor\n * @default undefined\n * @example 'drop-cursor'\n */\n class: string | undefined\n}\n\n/**\n * This extension allows you to add a drop cursor to your editor.\n * A drop cursor is a line that appears when you drag and drop content\n * in-between nodes.\n * @see https://tiptap.dev/api/extensions/dropcursor\n */\nexport const Dropcursor = Extension.create<DropcursorOptions>({\n name: 'dropCursor',\n\n addOptions() {\n return {\n color: 'currentColor',\n width: 1,\n class: undefined,\n }\n },\n\n addProseMirrorPlugins() {\n return [dropCursor(this.options)]\n },\n})\n","import { Extension } from '@tiptap/core'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport { Decoration, DecorationSet } from '@tiptap/pm/view'\n\nexport interface FocusOptions {\n /**\n * The class name that should be added to the focused node.\n * @default 'has-focus'\n * @example 'is-focused'\n */\n className: string\n\n /**\n * The mode by which the focused node is determined.\n * - All: All nodes are marked as focused.\n * - Deepest: Only the deepest node is marked as focused.\n * - Shallowest: Only the shallowest node is marked as focused.\n *\n * @default 'all'\n * @example 'deepest'\n * @example 'shallowest'\n */\n mode: 'all' | 'deepest' | 'shallowest'\n}\n\n/**\n * This extension allows you to add a class to the focused node.\n * @see https://www.tiptap.dev/api/extensions/focus\n */\nexport const Focus = Extension.create<FocusOptions>({\n name: 'focus',\n\n addOptions() {\n return {\n className: 'has-focus',\n mode: 'all',\n }\n },\n\n addProseMirrorPlugins() {\n return [\n new Plugin({\n key: new PluginKey('focus'),\n props: {\n decorations: ({ doc, selection }) => {\n const { isEditable, isFocused } = this.editor\n const { anchor } = selection\n const decorations: Decoration[] = []\n\n if (!isEditable || !isFocused) {\n return DecorationSet.create(doc, [])\n }\n\n // Maximum Levels\n let maxLevels = 0\n\n if (this.options.mode === 'deepest') {\n doc.descendants((node, pos) => {\n if (node.isText) {\n return\n }\n\n const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1\n\n if (!isCurrent) {\n return false\n }\n\n maxLevels += 1\n })\n }\n\n // Loop through current\n let currentLevel = 0\n\n doc.descendants((node, pos) => {\n if (node.isText) {\n return false\n }\n\n const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1\n\n if (!isCurrent) {\n return false\n }\n\n currentLevel += 1\n\n const outOfScope =\n (this.options.mode === 'deepest' && maxLevels - currentLevel > 0) ||\n (this.options.mode === 'shallowest' && currentLevel > 1)\n\n if (outOfScope) {\n return this.options.mode === 'deepest'\n }\n\n decorations.push(\n Decoration.node(pos, pos + node.nodeSize, {\n class: this.options.className,\n }),\n )\n })\n\n return DecorationSet.create(doc, decorations)\n },\n },\n }),\n ]\n },\n})\n","import type { ParentConfig } from '@tiptap/core'\nimport { callOrReturn, Extension, getExtensionField } from '@tiptap/core'\nimport { gapCursor } from '@tiptap/pm/gapcursor'\n\ndeclare module '@tiptap/core' {\n interface NodeConfig<Options, Storage> {\n /**\n * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.\n * @default null\n */\n allowGapCursor?:\n | boolean\n | null\n | ((this: {\n name: string\n options: Options\n storage: Storage\n parent: ParentConfig<NodeConfig<Options>>['allowGapCursor']\n }) => boolean | null)\n }\n}\n\n/**\n * This extension allows you to add a gap cursor to your editor.\n * A gap cursor is a cursor that appears when you click on a place\n * where no content is present, for example inbetween nodes.\n * @see https://tiptap.dev/api/extensions/gapcursor\n */\nexport const Gapcursor = Extension.create({\n name: 'gapCursor',\n\n addProseMirrorPlugins() {\n return [gapCursor()]\n },\n\n extendNodeSchema(extension) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n }\n\n return {\n allowGapCursor: callOrReturn(getExtensionField(extension, 'allowGapCursor', context)) ?? null,\n }\n },\n})\n","import type { Editor } from '@tiptap/core'\nimport { Extension, isNodeEmpty } from '@tiptap/core'\nimport type { Node as ProsemirrorNode } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport { Decoration, DecorationSet } from '@tiptap/pm/view'\n\nexport interface PlaceholderOptions {\n /**\n * **The class name for the empty editor**\n * @default 'is-editor-empty'\n */\n emptyEditorClass: string\n\n /**\n * **The class name for empty nodes**\n * @default 'is-empty'\n */\n emptyNodeClass: string\n\n /**\n * **The placeholder content**\n *\n * You can use a function to return a dynamic placeholder or a string.\n * @default 'Write something …'\n */\n placeholder:\n | ((PlaceholderProps: { editor: Editor; node: ProsemirrorNode; pos: number; hasAnchor: boolean }) => string)\n | string\n\n /**\n * **Checks if the placeholder should be only shown when the editor is editable.**\n *\n * If true, the placeholder will only be shown when the editor is editable.\n * If false, the placeholder will always be shown.\n * @default true\n */\n showOnlyWhenEditable: boolean\n\n /**\n * **Checks if the placeholder should be only shown when the current node is empty.**\n *\n * If true, the placeholder will only be shown when the current node is empty.\n * If false, the placeholder will be shown when any node is empty.\n * @default true\n */\n showOnlyCurrent: boolean\n\n /**\n * **Controls if the placeholder should be shown for all descendents.**\n *\n * If true, the placeholder will be shown for all descendents.\n * If false, the placeholder will only be shown for the current node.\n * @default false\n */\n includeChildren: boolean\n}\n\n/**\n * This extension allows you to add a placeholder to your editor.\n * A placeholder is a text that appears when the editor or a node is empty.\n * @see https://www.tiptap.dev/api/extensions/placeholder\n */\nexport const Placeholder = Extension.create<PlaceholderOptions>({\n name: 'placeholder',\n\n addOptions() {\n return {\n emptyEditorClass: 'is-editor-empty',\n emptyNodeClass: 'is-empty',\n placeholder: 'Write something …',\n showOnlyWhenEditable: true,\n showOnlyCurrent: true,\n includeChildren: false,\n }\n },\n\n addProseMirrorPlugins() {\n return [\n new Plugin({\n key: new PluginKey('placeholder'),\n props: {\n decorations: ({ doc, selection }) => {\n const active = this.editor.isEditable || !this.options.showOnlyWhenEditable\n const { anchor } = selection\n const decorations: Decoration[] = []\n\n if (!active) {\n return null\n }\n\n const isEmptyDoc = this.editor.isEmpty\n\n doc.descendants((node, pos) => {\n const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize\n const isEmpty = !node.isLeaf && isNodeEmpty(node)\n\n if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {\n const classes = [this.options.emptyNodeClass]\n\n if (isEmptyDoc) {\n classes.push(this.options.emptyEditorClass)\n }\n\n const decoration = Decoration.node(pos, pos + node.nodeSize, {\n class: classes.join(' '),\n 'data-placeholder':\n typeof this.options.placeholder === 'function'\n ? this.options.placeholder({\n editor: this.editor,\n node,\n pos,\n hasAnchor,\n })\n : this.options.placeholder,\n })\n\n decorations.push(decoration)\n }\n\n return this.options.includeChildren\n })\n\n return DecorationSet.create(doc, decorations)\n },\n },\n }),\n ]\n },\n})\n","import { Extension, isNodeSelection } from '@tiptap/core'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport { Decoration, DecorationSet } from '@tiptap/pm/view'\n\nexport type SelectionOptions = {\n /**\n * The class name that should be added to the selected text.\n * @default 'selection'\n * @example 'is-selected'\n */\n className: string\n}\n\n/**\n * This extension allows you to add a class to the selected text.\n * @see https://www.tiptap.dev/api/extensions/selection\n */\nexport const Selection = Extension.create({\n name: 'selection',\n\n addOptions() {\n return {\n className: 'selection',\n }\n },\n\n addProseMirrorPlugins() {\n const { editor, options } = this\n\n return [\n new Plugin({\n key: new PluginKey('selection'),\n props: {\n decorations(state) {\n if (state.selection.empty || editor.isFocused || !editor.isEditable || isNodeSelection(state.selection)) {\n return null\n }\n\n return DecorationSet.create(state.doc, [\n Decoration.inline(state.selection.from, state.selection.to, {\n class: options.className,\n }),\n ])\n },\n },\n }),\n ]\n },\n})\n\nexport default Selection\n","import { Extension } from '@tiptap/core'\nimport type { Node, NodeType } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\n\nfunction nodeEqualsType({ types, node }: { types: NodeType | NodeType[]; node: Node | null | undefined }) {\n return (node && Array.isArray(types) && types.includes(node.type)) || node?.type === types\n}\n\n/**\n * Extension based on:\n * - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js\n * - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts\n */\n\nexport interface TrailingNodeOptions {\n /**\n * The node type that should be inserted at the end of the document.\n * @note the node will always be added to the `notAfter` lists to\n * prevent an infinite loop.\n * @default 'paragraph'\n */\n node: string\n /**\n * The node types after which the trailing node should not be inserted.\n * @default ['paragraph']\n */\n notAfter?: string | string[]\n}\n\n/**\n * This extension allows you to add an extra node at the end of the document.\n * @see https://www.tiptap.dev/api/extensions/trailing-node\n */\nexport const TrailingNode = Extension.create<TrailingNodeOptions>({\n name: 'trailingNode',\n\n addOptions() {\n return {\n node: 'paragraph',\n notAfter: [],\n }\n },\n\n addProseMirrorPlugins() {\n const plugin = new PluginKey(this.name)\n const disabledNodes = Object.entries(this.editor.schema.nodes)\n .map(([, value]) => value)\n .filter(node => (this.options.notAfter || []).concat(this.options.node).includes(node.name))\n\n return [\n new Plugin({\n key: plugin,\n appendTransaction: (_, __, state) => {\n const { doc, tr, schema } = state\n const shouldInsertNodeAtEnd = plugin.getState(state)\n const endPosition = doc.content.size\n const type = schema.nodes[this.options.node]\n\n if (!shouldInsertNodeAtEnd) {\n return\n }\n\n return tr.insert(endPosition, type.create())\n },\n state: {\n init: (_, state) => {\n const lastNode = state.tr.doc.lastChild\n\n return !nodeEqualsType({ node: lastNode, types: disabledNodes })\n },\n apply: (tr, value) => {\n if (!tr.docChanged) {\n return value\n }\n\n const lastNode = tr.doc.lastChild\n\n return !nodeEqualsType({ node: lastNode, types: disabledNodes })\n },\n },\n }),\n ]\n },\n})\n","import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface UndoRedoOptions {\n /**\n * The amount of history events that are collected before the oldest events are discarded.\n * @default 100\n * @example 50\n */\n depth: number\n\n /**\n * The delay (in milliseconds) between changes after which a new group should be started.\n * @default 500\n * @example 1000\n */\n newGroupDelay: number\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n undoRedo: {\n /**\n * Undo recent changes\n * @example editor.commands.undo()\n */\n undo: () => ReturnType\n /**\n * Reapply reverted changes\n * @example editor.commands.redo()\n */\n redo: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to undo and redo recent changes.\n * @see https://www.tiptap.dev/api/extensions/undo-redo\n *\n * **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove\n * the `undo-redo` extension, as it is not compatible with the `collaboration` extension.\n *\n * `@tiptap/extension-collaboration` uses its own history implementation.\n */\nexport const UndoRedo = Extension.create<UndoRedoOptions>({\n name: 'undoRedo',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo:\n () =>\n ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo:\n () =>\n ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [history(this.options)]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n 'Mod-y': () => this.editor.commands.redo(),\n\n // Russian keyboard layouts\n 'Mod-я': () => this.editor.commands.undo(),\n 'Shift-Mod-я': () => this.editor.commands.redo(),\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA0B;AAE1B,mBAAkC;AAyD3B,IAAM,iBAAiB,sBAAU,OAAqD;AAAA,EAC3F,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,aAAa,UAAQ,KAAK;AAAA,MAC1B,aAAa,UAAQ,KAAK,MAAM,GAAG,EAAE,OAAO,UAAQ,SAAS,EAAE,EAAE;AAAA,IACnE;AAAA,EACF;AAAA,EAEA,aAAa;AACX,WAAO;AAAA,MACL,YAAY,MAAM;AAAA,MAClB,OAAO,MAAM;AAAA,IACf;AAAA,EACF;AAAA,EAEA,iBAAiB;AACf,SAAK,QAAQ,aAAa,aAAW;AACnC,YAAM,QAAO,mCAAS,SAAQ,KAAK,OAAO,MAAM;AAChD,YAAM,QAAO,mCAAS,SAAQ,KAAK,QAAQ;AAE3C,UAAI,SAAS,YAAY;AACvB,cAAM,OAAO,KAAK,YAAY,GAAG,KAAK,QAAQ,MAAM,QAAW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ClB,qBAAO;AAAA,YACT;AAEA,kBAAM,WAAW,GAAG,IAAI;AAExB,mBAAO,CAAC,eAAe,EAAE,MAAM,UAAU,OAAO,cAAc,CAAC;AAAA,UACjE;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;;;ACnFD,IAAAC,eAA0B;AAC1B,qBAAoC;AA4C7B,IAAM,WAAW,uBAAU,OAAwB;AAAA,EACxD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,OAAO;AAAA,MACP,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,MACE,MACA,CAAC,EAAE,OAAO,SAAS,MAAM;AACvB,mBAAO,qBAAK,OAAO,QAAQ;AAAA,MAC7B;AAAA,MACF,MACE,MACA,CAAC,EAAE,OAAO,SAAS,MAAM;AACvB,mBAAO,qBAAK,OAAO,QAAQ;AAAA,MAC7B;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,wBAAwB;AACtB,WAAO,KAAC,wBAAQ,KAAK,OAAO,CAAC;AAAA,EAC/B;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,SAAS,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,MACzC,eAAe,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,MAC/C,SAAS,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA;AAAA,MAGzC,cAAS,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,MACzC,oBAAe,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,IACjD;AAAA,EACF;AACF,CAAC;","names":["import_core","import_core","import_state","import_core","import_core","import_state","import_view","import_core","import_state","import_view","import_core","import_state","import_core"]}