@tiptap/extension-unique-id 2.0.0-beta.3 → 2.22.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 (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 -280
  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 -280
  11. package/dist/index.js.map +1 -0
  12. package/dist/{tiptap-extension-unique-id.umd.js → index.umd.js} +255 -281
  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 +104 -38
  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,292 +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
- defaultOptions: {
112
- attributeName: 'id',
113
- types: [],
114
- generateID: () => uuid.v4(),
115
- filterTransaction: null,
116
- },
117
- addGlobalAttributes() {
118
- return [
119
- {
120
- types: this.options.types,
121
- attributes: {
122
- [this.options.attributeName]: {
123
- default: null,
124
- parseHTML: element => element.getAttribute(`data-${this.options.attributeName}`),
125
- renderHTML: attributes => {
126
- if (!attributes[this.options.attributeName]) {
127
- return {};
128
- }
129
- return {
130
- [`data-${this.options.attributeName}`]: attributes[this.options.attributeName],
131
- };
132
- },
133
- },
134
- },
135
- },
136
- ];
137
- },
138
- // check initial content for missing ids
139
- onCreate() {
140
- const { view, state } = this.editor;
141
- const { tr, doc } = state;
142
- const { types, attributeName, generateID } = this.options;
143
- const nodesWithoutId = core.findChildren(doc, node => {
144
- return types.includes(node.type.name)
145
- && node.attrs[attributeName] === null;
146
- });
147
- nodesWithoutId.forEach(({ node, pos }) => {
148
- tr.setNodeMarkup(pos, undefined, {
149
- ...node.attrs,
150
- [attributeName]: generateID(),
151
- });
152
- });
153
- view.dispatch(tr);
154
- },
155
- addProseMirrorPlugins() {
156
- let dragSourceElement = null;
157
- let transformPasted = false;
158
- return [
159
- new prosemirrorState.Plugin({
160
- key: new prosemirrorState.PluginKey('uniqueID'),
161
- appendTransaction: (transactions, oldState, newState) => {
162
- const docChanges = transactions.some(transaction => transaction.docChanged)
163
- && !oldState.doc.eq(newState.doc);
164
- const filterTransactions = this.options.filterTransaction
165
- && transactions.some(tr => { var _a, _b; return !((_b = (_a = this.options).filterTransaction) === null || _b === void 0 ? void 0 : _b.call(_a, tr)); });
166
- if (!docChanges || filterTransactions) {
167
- return;
168
- }
169
- const { tr } = newState;
170
- const { types, attributeName, generateID } = this.options;
171
- const transform = combineTransactionSteps(oldState.doc, transactions);
172
- const { mapping } = transform;
173
- // get changed ranges based on the old state
174
- const changes = getChangedRanges(transform);
175
- changes.forEach(change => {
176
- const newRange = {
177
- from: change.newStart,
178
- to: change.newEnd,
179
- };
180
- const newNodes = core.findChildrenInRange(newState.doc, newRange, node => {
181
- return types.includes(node.type.name);
182
- });
183
- const newIds = newNodes
184
- .map(({ node }) => node.attrs[attributeName])
185
- .filter(id => id !== null);
186
- const duplicatedNewIds = findDuplicates(newIds);
187
- newNodes.forEach(({ node, pos }) => {
188
- var _a;
189
- // instead of checking `node.attrs[attributeName]` directly
190
- // we look at the current state of the node within `tr.doc`.
191
- // this helps to prevent adding new ids to the same node
192
- // if the node changed multiple times within one transaction
193
- const id = (_a = tr.doc.nodeAt(pos)) === null || _a === void 0 ? void 0 : _a.attrs[attributeName];
194
- if (id === null) {
195
- tr.setNodeMarkup(pos, undefined, {
196
- ...node.attrs,
197
- [attributeName]: generateID(),
198
- });
199
- return;
200
- }
201
- // check if the node doesn’t exist in the old state
202
- const { deleted } = mapping.invert().mapResult(pos);
203
- const newNode = deleted && duplicatedNewIds.includes(id);
204
- if (newNode) {
205
- tr.setNodeMarkup(pos, undefined, {
206
- ...node.attrs,
207
- [attributeName]: generateID(),
208
- });
209
- }
210
- });
211
- });
212
- if (!tr.steps.length) {
213
- return;
214
- }
215
- return tr;
216
- },
217
- // we register a global drag handler to track the current drag source element
218
- view(view) {
219
- const handleDragstart = (event) => {
220
- var _a;
221
- dragSourceElement = ((_a = view.dom.parentElement) === null || _a === void 0 ? void 0 : _a.contains(event.target))
222
- ? view.dom.parentElement
223
- : null;
224
- };
225
- window.addEventListener('dragstart', handleDragstart);
226
- return {
227
- destroy() {
228
- window.removeEventListener('dragstart', handleDragstart);
229
- },
230
- };
231
- },
232
- props: {
233
- // `handleDOMEvents` is called before `transformPasted`
234
- // so we can do some checks before
235
- handleDOMEvents: {
236
- // only create new ids for dropped content while holding `alt`
237
- // or content is dragged from another editor
238
- drop: (view, event) => {
239
- var _a;
240
- if (dragSourceElement !== view.dom.parentElement
241
- || ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.effectAllowed) === 'copy') {
242
- dragSourceElement = null;
243
- transformPasted = true;
244
- }
245
- return false;
246
- },
247
- // always create new ids on pasted content
248
- paste: () => {
249
- transformPasted = true;
250
- return false;
251
- },
252
- },
253
- // we’ll remove ids for every pasted node
254
- // so we can create a new one within `appendTransaction`
255
- transformPasted: slice => {
256
- if (!transformPasted) {
257
- return slice;
258
- }
259
- const { types, attributeName } = this.options;
260
- const removeId = (fragment) => {
261
- const list = [];
262
- fragment.forEach(node => {
263
- // don’t touch text nodes
264
- if (node.isText) {
265
- list.push(node);
266
- return;
267
- }
268
- // check for any other child nodes
269
- if (!types.includes(node.type.name)) {
270
- list.push(node.copy(removeId(node.content)));
271
- return;
272
- }
273
- // remove id
274
- const nodeWithoutId = node.type.create({
275
- ...node.attrs,
276
- [attributeName]: null,
277
- }, removeId(node.content), node.marks);
278
- list.push(nodeWithoutId);
279
- });
280
- return prosemirrorModel.Fragment.from(list);
281
- };
282
- // reset check
283
- transformPasted = false;
284
- return new prosemirrorModel.Slice(removeId(slice.content), slice.openStart, slice.openEnd);
285
- },
286
- },
287
- }),
288
- ];
289
- },
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
+ },
290
263
  });
291
264
 
292
265
  exports.UniqueID = UniqueID;
293
- exports["default"] = UniqueID;
294
- //# sourceMappingURL=tiptap-extension-unique-id.cjs.js.map
266
+ exports.default = UniqueID;
267
+ //# sourceMappingURL=index.cjs.map