@tiptap/extension-unique-id 2.0.0-beta.4 → 2.22.1

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 (31) hide show
  1. package/README.md +14 -0
  2. package/dist/helpers/findDuplicates.d.ts +5 -0
  3. package/dist/helpers/findDuplicates.d.ts.map +1 -0
  4. package/dist/helpers/removeDuplicates.d.ts +9 -0
  5. package/dist/helpers/removeDuplicates.d.ts.map +1 -0
  6. package/dist/{tiptap-extension-unique-id.cjs.js → index.cjs} +253 -282
  7. package/dist/index.cjs.map +1 -0
  8. package/dist/index.d.ts +4 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/{tiptap-extension-unique-id.esm.js → index.js} +253 -282
  11. package/dist/index.js.map +1 -0
  12. package/dist/{tiptap-extension-unique-id.umd.js → index.umd.js} +255 -283
  13. package/dist/index.umd.js.map +1 -0
  14. package/dist/{tiptap-pro/packages/extension-unique-id/src/unique-id.d.ts → unique-id.d.ts} +10 -9
  15. package/dist/unique-id.d.ts.map +1 -0
  16. package/package.json +31 -13
  17. package/src/helpers/findDuplicates.ts +2 -2
  18. package/src/helpers/removeDuplicates.ts +1 -1
  19. package/src/index.ts +2 -2
  20. package/src/unique-id.ts +97 -33
  21. package/dist/tiptap-extension-unique-id.cjs.js.map +0 -1
  22. package/dist/tiptap-extension-unique-id.esm.js.map +0 -1
  23. package/dist/tiptap-extension-unique-id.umd.js.map +0 -1
  24. package/dist/tiptap-pro/packages/extension-unique-id/src/helpers/combineTransactionSteps.d.ts +0 -7
  25. package/dist/tiptap-pro/packages/extension-unique-id/src/helpers/findDuplicates.d.ts +0 -4
  26. package/dist/tiptap-pro/packages/extension-unique-id/src/helpers/getChangedRanges.d.ts +0 -12
  27. package/dist/tiptap-pro/packages/extension-unique-id/src/helpers/removeDuplicates.d.ts +0 -8
  28. package/dist/tiptap-pro/packages/extension-unique-id/src/index.d.ts +0 -3
  29. package/src/helpers/arrayDifference.ts +0 -35
  30. package/src/helpers/combineTransactionSteps.ts +0 -18
  31. package/src/helpers/getChangedRanges.ts +0 -78
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # @tiptap/extension-unique-id
2
+ [![Version](https://img.shields.io/npm/v/@tiptap/extension-unique-id.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-unique-id)
3
+ [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-unique-id.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
4
+ [![License](https://img.shields.io/npm/l/@tiptap/extension-unique-id.svg)](https://www.npmjs.com/package/@tiptap/extension-unique-id)
5
+ [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
6
+
7
+ ## Introduction
8
+ Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
9
+
10
+ ## Official Documentation
11
+ Documentation can be found on the [Tiptap website](https://tiptap.dev).
12
+
13
+ ## License
14
+ Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns a list of duplicated items within an array.
3
+ */
4
+ export declare function findDuplicates(items: any[]): any[];
5
+ //# sourceMappingURL=findDuplicates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findDuplicates.d.ts","sourceRoot":"","sources":["../../src/helpers/findDuplicates.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAKlD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Removes duplicated values within an array.
3
+ * Supports numbers, strings and objects.
4
+ */
5
+ export declare function removeDuplicates<T>(array: T[], by?: {
6
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
7
+ (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
8
+ }): T[];
9
+ //# sourceMappingURL=removeDuplicates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeDuplicates.d.ts","sourceRoot":"","sources":["../../src/helpers/removeDuplicates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;;;CAAiB,GAAG,CAAC,EAAE,CAUxE"}
@@ -3,294 +3,265 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@tiptap/core');
6
- var prosemirrorState = require('prosemirror-state');
7
- var prosemirrorModel = require('prosemirror-model');
6
+ var model = require('@tiptap/pm/model');
7
+ var state = require('@tiptap/pm/state');
8
8
  var uuid = require('uuid');
9
- var prosemirrorTransform = require('prosemirror-transform');
10
9
 
11
- /**
12
- * Returns a new `Transform` based on all steps of the passed transactions.
13
- */
14
- function combineTransactionSteps(oldDoc, transactions) {
15
- const transform = new prosemirrorTransform.Transform(oldDoc);
16
- transactions.forEach(transaction => {
17
- transaction.steps.forEach(step => {
18
- transform.step(step);
19
- });
20
- });
21
- return transform;
10
+ /**
11
+ * Removes duplicated values within an array.
12
+ * Supports numbers, strings and objects.
13
+ */
14
+ function removeDuplicates(array, by = JSON.stringify) {
15
+ const seen = {};
16
+ return array.filter(item => {
17
+ const key = by(item);
18
+ return Object.prototype.hasOwnProperty.call(seen, key)
19
+ ? false
20
+ : (seen[key] = true);
21
+ });
22
22
  }
23
23
 
24
- /**
25
- * Removes duplicated values within an array.
26
- * Supports numbers, strings and objects.
27
- */
28
- function removeDuplicates(array, by = JSON.stringify) {
29
- const seen = {};
30
- return array.filter(item => {
31
- const key = by(item);
32
- return Object.prototype.hasOwnProperty.call(seen, key)
33
- ? false
34
- : (seen[key] = true);
35
- });
24
+ /**
25
+ * Returns a list of duplicated items within an array.
26
+ */
27
+ function findDuplicates(items) {
28
+ const filtered = items.filter((el, index) => items.indexOf(el) !== index);
29
+ const duplicates = removeDuplicates(filtered);
30
+ return duplicates;
36
31
  }
37
32
 
38
- /**
39
- * Removes duplicated ranges and ranges that are
40
- * fully captured by other ranges.
41
- */
42
- function simplifyChangedRanges(changes) {
43
- const uniqueChanges = removeDuplicates(changes);
44
- return uniqueChanges.length === 1
45
- ? uniqueChanges
46
- : uniqueChanges.filter((change, index) => {
47
- const rest = uniqueChanges.filter((_, i) => i !== index);
48
- return !rest.some(otherChange => {
49
- return change.oldStart >= otherChange.oldStart
50
- && change.oldEnd <= otherChange.oldEnd
51
- && change.newStart >= otherChange.newStart
52
- && change.newEnd <= otherChange.newEnd;
53
- });
54
- });
55
- }
56
- /**
57
- * Returns a list of changed ranges
58
- * based on the first and last state of all steps.
59
- */
60
- function getChangedRanges(transform) {
61
- const { mapping, steps } = transform;
62
- const changes = [];
63
- mapping.maps.forEach((stepMap, index) => {
64
- // This accounts for step changes where no range was actually altered
65
- // e.g. when setting a mark, node attribute, etc.
66
- // @ts-ignore
67
- if (!stepMap.ranges.length) {
68
- const step = steps[index];
69
- if (step.from === undefined || step.to === undefined) {
70
- return;
71
- }
72
- changes.push({
73
- oldStart: step.from,
74
- oldEnd: step.to,
75
- newStart: step.from,
76
- newEnd: step.to,
77
- });
78
- }
79
- else {
80
- stepMap.forEach((from, to) => {
81
- const newStart = mapping.slice(index).map(from, -1);
82
- const newEnd = mapping.slice(index).map(to);
83
- const oldStart = mapping.invert().map(newStart, -1);
84
- const oldEnd = mapping.invert().map(newEnd);
85
- changes.push({
86
- oldStart,
87
- oldEnd,
88
- newStart,
89
- newEnd,
90
- });
91
- });
92
- }
93
- });
94
- return simplifyChangedRanges(changes);
95
- }
96
-
97
- /**
98
- * Returns a list of duplicated items within an array.
99
- */
100
- function findDuplicates(items) {
101
- const filtered = items.filter((el, index) => items.indexOf(el) !== index);
102
- const duplicates = removeDuplicates(filtered);
103
- return duplicates;
104
- }
105
-
106
- const UniqueID = core.Extension.create({
107
- name: 'uniqueID',
108
- // we’ll set a very high priority to make sure this runs first
109
- // and is compatible with `appendTransaction` hooks of other extensions
110
- priority: 10000,
111
- addOptions() {
112
- return {
113
- attributeName: 'id',
114
- types: [],
115
- generateID: () => uuid.v4(),
116
- filterTransaction: null,
117
- };
118
- },
119
- addGlobalAttributes() {
120
- return [
121
- {
122
- types: this.options.types,
123
- attributes: {
124
- [this.options.attributeName]: {
125
- default: null,
126
- parseHTML: element => element.getAttribute(`data-${this.options.attributeName}`),
127
- renderHTML: attributes => {
128
- if (!attributes[this.options.attributeName]) {
129
- return {};
130
- }
131
- return {
132
- [`data-${this.options.attributeName}`]: attributes[this.options.attributeName],
133
- };
134
- },
135
- },
136
- },
137
- },
138
- ];
139
- },
140
- // check initial content for missing ids
141
- onCreate() {
142
- const { view, state } = this.editor;
143
- const { tr, doc } = state;
144
- const { types, attributeName, generateID } = this.options;
145
- const nodesWithoutId = core.findChildren(doc, node => {
146
- return types.includes(node.type.name)
147
- && node.attrs[attributeName] === null;
148
- });
149
- nodesWithoutId.forEach(({ node, pos }) => {
150
- tr.setNodeMarkup(pos, undefined, {
151
- ...node.attrs,
152
- [attributeName]: generateID(),
153
- });
154
- });
155
- view.dispatch(tr);
156
- },
157
- addProseMirrorPlugins() {
158
- let dragSourceElement = null;
159
- let transformPasted = false;
160
- return [
161
- new prosemirrorState.Plugin({
162
- key: new prosemirrorState.PluginKey('uniqueID'),
163
- appendTransaction: (transactions, oldState, newState) => {
164
- const docChanges = transactions.some(transaction => transaction.docChanged)
165
- && !oldState.doc.eq(newState.doc);
166
- const filterTransactions = this.options.filterTransaction
167
- && transactions.some(tr => { var _a, _b; return !((_b = (_a = this.options).filterTransaction) === null || _b === void 0 ? void 0 : _b.call(_a, tr)); });
168
- if (!docChanges || filterTransactions) {
169
- return;
170
- }
171
- const { tr } = newState;
172
- const { types, attributeName, generateID } = this.options;
173
- const transform = combineTransactionSteps(oldState.doc, transactions);
174
- const { mapping } = transform;
175
- // get changed ranges based on the old state
176
- const changes = getChangedRanges(transform);
177
- changes.forEach(change => {
178
- const newRange = {
179
- from: change.newStart,
180
- to: change.newEnd,
181
- };
182
- const newNodes = core.findChildrenInRange(newState.doc, newRange, node => {
183
- return types.includes(node.type.name);
184
- });
185
- const newIds = newNodes
186
- .map(({ node }) => node.attrs[attributeName])
187
- .filter(id => id !== null);
188
- const duplicatedNewIds = findDuplicates(newIds);
189
- newNodes.forEach(({ node, pos }) => {
190
- var _a;
191
- // instead of checking `node.attrs[attributeName]` directly
192
- // we look at the current state of the node within `tr.doc`.
193
- // this helps to prevent adding new ids to the same node
194
- // if the node changed multiple times within one transaction
195
- const id = (_a = tr.doc.nodeAt(pos)) === null || _a === void 0 ? void 0 : _a.attrs[attributeName];
196
- if (id === null) {
197
- tr.setNodeMarkup(pos, undefined, {
198
- ...node.attrs,
199
- [attributeName]: generateID(),
200
- });
201
- return;
202
- }
203
- // check if the node doesn’t exist in the old state
204
- const { deleted } = mapping.invert().mapResult(pos);
205
- const newNode = deleted && duplicatedNewIds.includes(id);
206
- if (newNode) {
207
- tr.setNodeMarkup(pos, undefined, {
208
- ...node.attrs,
209
- [attributeName]: generateID(),
210
- });
211
- }
212
- });
213
- });
214
- if (!tr.steps.length) {
215
- return;
216
- }
217
- return tr;
218
- },
219
- // we register a global drag handler to track the current drag source element
220
- view(view) {
221
- const handleDragstart = (event) => {
222
- var _a;
223
- dragSourceElement = ((_a = view.dom.parentElement) === null || _a === void 0 ? void 0 : _a.contains(event.target))
224
- ? view.dom.parentElement
225
- : null;
226
- };
227
- window.addEventListener('dragstart', handleDragstart);
228
- return {
229
- destroy() {
230
- window.removeEventListener('dragstart', handleDragstart);
231
- },
232
- };
233
- },
234
- props: {
235
- // `handleDOMEvents` is called before `transformPasted`
236
- // so we can do some checks before
237
- handleDOMEvents: {
238
- // only create new ids for dropped content while holding `alt`
239
- // or content is dragged from another editor
240
- drop: (view, event) => {
241
- var _a;
242
- if (dragSourceElement !== view.dom.parentElement
243
- || ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.effectAllowed) === 'copy') {
244
- dragSourceElement = null;
245
- transformPasted = true;
246
- }
247
- return false;
248
- },
249
- // always create new ids on pasted content
250
- paste: () => {
251
- transformPasted = true;
252
- return false;
253
- },
254
- },
255
- // we’ll remove ids for every pasted node
256
- // so we can create a new one within `appendTransaction`
257
- transformPasted: slice => {
258
- if (!transformPasted) {
259
- return slice;
260
- }
261
- const { types, attributeName } = this.options;
262
- const removeId = (fragment) => {
263
- const list = [];
264
- fragment.forEach(node => {
265
- // don’t touch text nodes
266
- if (node.isText) {
267
- list.push(node);
268
- return;
269
- }
270
- // check for any other child nodes
271
- if (!types.includes(node.type.name)) {
272
- list.push(node.copy(removeId(node.content)));
273
- return;
274
- }
275
- // remove id
276
- const nodeWithoutId = node.type.create({
277
- ...node.attrs,
278
- [attributeName]: null,
279
- }, removeId(node.content), node.marks);
280
- list.push(nodeWithoutId);
281
- });
282
- return prosemirrorModel.Fragment.from(list);
283
- };
284
- // reset check
285
- transformPasted = false;
286
- return new prosemirrorModel.Slice(removeId(slice.content), slice.openStart, slice.openEnd);
287
- },
288
- },
289
- }),
290
- ];
291
- },
33
+ const UniqueID = core.Extension.create({
34
+ name: 'uniqueID',
35
+ // we’ll set a very high priority to make sure this runs first
36
+ // and is compatible with `appendTransaction` hooks of other extensions
37
+ priority: 10000,
38
+ addOptions() {
39
+ return {
40
+ attributeName: 'id',
41
+ types: [],
42
+ generateID: () => uuid.v4(),
43
+ filterTransaction: null,
44
+ };
45
+ },
46
+ addGlobalAttributes() {
47
+ return [
48
+ {
49
+ types: this.options.types,
50
+ attributes: {
51
+ [this.options.attributeName]: {
52
+ default: null,
53
+ parseHTML: element => element.getAttribute(`data-${this.options.attributeName}`),
54
+ renderHTML: attributes => {
55
+ if (!attributes[this.options.attributeName]) {
56
+ return {};
57
+ }
58
+ return {
59
+ [`data-${this.options.attributeName}`]: attributes[this.options.attributeName],
60
+ };
61
+ },
62
+ },
63
+ },
64
+ },
65
+ ];
66
+ },
67
+ // check initial content for missing ids
68
+ onCreate() {
69
+ const collab = this.editor.extensionManager.extensions.find(ext => ext.name === 'collaboration');
70
+ const provider = (collab === null || collab === void 0 ? void 0 : collab.options) ? collab.options.provider : undefined;
71
+ const createIds = () => {
72
+ const { view, state } = this.editor;
73
+ const { tr, doc } = state;
74
+ const { types, attributeName, generateID } = this.options;
75
+ const nodesWithoutId = core.findChildren(doc, node => {
76
+ return types.includes(node.type.name) && node.attrs[attributeName] === null;
77
+ });
78
+ nodesWithoutId.forEach(({ node, pos }) => {
79
+ tr.setNodeMarkup(pos, undefined, {
80
+ ...node.attrs,
81
+ [attributeName]: generateID(),
82
+ });
83
+ });
84
+ tr.setMeta('addToHistory', false);
85
+ view.dispatch(tr);
86
+ if (provider) {
87
+ provider.off('synced', createIds);
88
+ }
89
+ };
90
+ /**
91
+ * We need to handle collaboration a bit different here
92
+ * because we can't automatically add IDs when the provider is not yet synced
93
+ * otherwise we end up with empty paragraphs
94
+ */
95
+ if (collab) {
96
+ if (!provider) {
97
+ return createIds();
98
+ }
99
+ provider.on('synced', createIds);
100
+ }
101
+ else {
102
+ return createIds();
103
+ }
104
+ },
105
+ addProseMirrorPlugins() {
106
+ let dragSourceElement = null;
107
+ let transformPasted = false;
108
+ return [
109
+ new state.Plugin({
110
+ key: new state.PluginKey('uniqueID'),
111
+ appendTransaction: (transactions, oldState, newState) => {
112
+ const hasDocChanges = transactions.some(transaction => transaction.docChanged)
113
+ && !oldState.doc.eq(newState.doc);
114
+ const filterTransactions = this.options.filterTransaction
115
+ && transactions.some(tr => { var _a, _b; return !((_b = (_a = this.options).filterTransaction) === null || _b === void 0 ? void 0 : _b.call(_a, tr)); });
116
+ const isCollabTransaction = transactions.find(tr => tr.getMeta('y-sync$'));
117
+ if (isCollabTransaction) {
118
+ return;
119
+ }
120
+ if (!hasDocChanges || filterTransactions) {
121
+ return;
122
+ }
123
+ const { tr } = newState;
124
+ const { types, attributeName, generateID } = this.options;
125
+ const transform = core.combineTransactionSteps(oldState.doc, transactions);
126
+ const { mapping } = transform;
127
+ // get changed ranges based on the old state
128
+ const changes = core.getChangedRanges(transform);
129
+ changes.forEach(({ newRange }) => {
130
+ const newNodes = core.findChildrenInRange(newState.doc, newRange, node => {
131
+ return types.includes(node.type.name);
132
+ });
133
+ const newIds = newNodes
134
+ .map(({ node }) => node.attrs[attributeName])
135
+ .filter(id => id !== null);
136
+ newNodes.forEach(({ node, pos }, i) => {
137
+ var _a;
138
+ // instead of checking `node.attrs[attributeName]` directly
139
+ // we look at the current state of the node within `tr.doc`.
140
+ // this helps to prevent adding new ids to the same node
141
+ // if the node changed multiple times within one transaction
142
+ const id = (_a = tr.doc.nodeAt(pos)) === null || _a === void 0 ? void 0 : _a.attrs[attributeName];
143
+ if (id === null) {
144
+ tr.setNodeMarkup(pos, undefined, {
145
+ ...node.attrs,
146
+ [attributeName]: generateID(),
147
+ });
148
+ return;
149
+ }
150
+ const nextNode = newNodes[i + 1];
151
+ if (nextNode && node.content.size === 0) {
152
+ tr.setNodeMarkup(nextNode.pos, undefined, {
153
+ ...nextNode.node.attrs,
154
+ [attributeName]: id,
155
+ });
156
+ newIds[i + 1] = id;
157
+ if (nextNode.node.attrs[attributeName]) {
158
+ return;
159
+ }
160
+ const generatedId = generateID();
161
+ tr.setNodeMarkup(pos, undefined, {
162
+ ...node.attrs,
163
+ [attributeName]: generatedId,
164
+ });
165
+ newIds[i] = generatedId;
166
+ return tr;
167
+ }
168
+ const duplicatedNewIds = findDuplicates(newIds);
169
+ // check if the node doesn’t exist in the old state
170
+ const { deleted } = mapping.invert().mapResult(pos);
171
+ const newNode = deleted && duplicatedNewIds.includes(id);
172
+ if (newNode) {
173
+ tr.setNodeMarkup(pos, undefined, {
174
+ ...node.attrs,
175
+ [attributeName]: generateID(),
176
+ });
177
+ }
178
+ });
179
+ });
180
+ if (!tr.steps.length) {
181
+ return;
182
+ }
183
+ // `tr.setNodeMarkup` resets the stored marks
184
+ // so we’ll restore them if they exist
185
+ tr.setStoredMarks(newState.tr.storedMarks);
186
+ return tr;
187
+ },
188
+ // we register a global drag handler to track the current drag source element
189
+ view(view) {
190
+ const handleDragstart = (event) => {
191
+ var _a;
192
+ dragSourceElement = ((_a = view.dom.parentElement) === null || _a === void 0 ? void 0 : _a.contains(event.target))
193
+ ? view.dom.parentElement
194
+ : null;
195
+ };
196
+ window.addEventListener('dragstart', handleDragstart);
197
+ return {
198
+ destroy() {
199
+ window.removeEventListener('dragstart', handleDragstart);
200
+ },
201
+ };
202
+ },
203
+ props: {
204
+ // `handleDOMEvents` is called before `transformPasted`
205
+ // so we can do some checks before
206
+ handleDOMEvents: {
207
+ // only create new ids for dropped content
208
+ // or dropped content while holding `alt`
209
+ // or content is dragged from another editor
210
+ drop: (view, event) => {
211
+ var _a, _b;
212
+ if (dragSourceElement !== view.dom.parentElement
213
+ || ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.effectAllowed) === 'copyMove'
214
+ || ((_b = event.dataTransfer) === null || _b === void 0 ? void 0 : _b.effectAllowed) === 'copy') {
215
+ dragSourceElement = null;
216
+ transformPasted = true;
217
+ }
218
+ return false;
219
+ },
220
+ // always create new ids on pasted content
221
+ paste: () => {
222
+ transformPasted = true;
223
+ return false;
224
+ },
225
+ },
226
+ // we’ll remove ids for every pasted node
227
+ // so we can create a new one within `appendTransaction`
228
+ transformPasted: slice => {
229
+ if (!transformPasted) {
230
+ return slice;
231
+ }
232
+ const { types, attributeName } = this.options;
233
+ const removeId = (fragment) => {
234
+ const list = [];
235
+ fragment.forEach(node => {
236
+ // don’t touch text nodes
237
+ if (node.isText) {
238
+ list.push(node);
239
+ return;
240
+ }
241
+ // check for any other child nodes
242
+ if (!types.includes(node.type.name)) {
243
+ list.push(node.copy(removeId(node.content)));
244
+ return;
245
+ }
246
+ // remove id
247
+ const nodeWithoutId = node.type.create({
248
+ ...node.attrs,
249
+ [attributeName]: null,
250
+ }, removeId(node.content), node.marks);
251
+ list.push(nodeWithoutId);
252
+ });
253
+ return model.Fragment.from(list);
254
+ };
255
+ // reset check
256
+ transformPasted = false;
257
+ return new model.Slice(removeId(slice.content), slice.openStart, slice.openEnd);
258
+ },
259
+ },
260
+ }),
261
+ ];
262
+ },
292
263
  });
293
264
 
294
265
  exports.UniqueID = UniqueID;
295
- exports["default"] = UniqueID;
296
- //# sourceMappingURL=tiptap-extension-unique-id.cjs.js.map
266
+ exports.default = UniqueID;
267
+ //# sourceMappingURL=index.cjs.map