@blocknote/core 0.19.0 → 0.19.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 (97) hide show
  1. package/README.md +2 -0
  2. package/dist/blocknote.js +2549 -2497
  3. package/dist/blocknote.js.map +1 -1
  4. package/dist/blocknote.umd.cjs +6 -6
  5. package/dist/blocknote.umd.cjs.map +1 -1
  6. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js +5 -1
  7. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js.map +1 -1
  8. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +2 -40
  9. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +1 -1
  10. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +4 -0
  11. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +1 -1
  12. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +51 -9
  13. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +1 -1
  14. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +2 -2
  15. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +1 -1
  16. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +1 -1
  17. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +1 -1
  18. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +4 -2
  19. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -1
  20. package/dist/src/api/getBlockInfoFromPos.js +19 -25
  21. package/dist/src/api/getBlockInfoFromPos.js.map +1 -1
  22. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +8 -4
  23. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +1 -1
  24. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +5 -3
  25. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +1 -1
  26. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +12 -6
  27. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +1 -1
  28. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +5 -1
  29. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +1 -1
  30. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +4 -2
  31. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +1 -1
  32. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +2 -1
  33. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +1 -1
  34. package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -1
  35. package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +1 -1
  36. package/dist/src/editor/BlockNoteEditor.js +39 -43
  37. package/dist/src/editor/BlockNoteEditor.js.map +1 -1
  38. package/dist/src/editor/BlockNoteEditor.test.js +2 -2
  39. package/dist/src/editor/BlockNoteEditor.test.js.map +1 -1
  40. package/dist/src/editor/BlockNoteExtensions.js +52 -6
  41. package/dist/src/editor/BlockNoteExtensions.js.map +1 -1
  42. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +36 -6
  43. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +1 -1
  44. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +35 -32
  45. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +1 -1
  46. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +74 -71
  47. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -1
  48. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +153 -149
  49. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/dist/webpack-stats.json +1 -1
  52. package/package.json +2 -2
  53. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +0 -6
  54. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +0 -5
  55. package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +0 -8
  56. package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +7 -3
  57. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +439 -2
  58. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +6 -0
  59. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +2 -82
  60. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +0 -8
  61. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +96 -20
  62. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +0 -6
  63. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +2 -5
  64. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +0 -490
  65. package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -1
  66. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +6 -5
  67. package/src/api/getBlockInfoFromPos.ts +20 -30
  68. package/src/api/parsers/html/__snapshots__/parse-notion-html.json +1 -2
  69. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +16 -4
  70. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +9 -3
  71. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +22 -6
  72. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +5 -3
  73. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +8 -2
  74. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +4 -1
  75. package/src/blocks/TableBlockContent/TableBlockContent.ts +0 -1
  76. package/src/editor/BlockNoteEditor.test.ts +2 -5
  77. package/src/editor/BlockNoteEditor.ts +71 -42
  78. package/src/editor/BlockNoteExtensions.ts +90 -14
  79. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +36 -9
  80. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
  81. package/src/extensions/Placeholder/PlaceholderPlugin.ts +94 -90
  82. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +173 -169
  83. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +0 -3
  84. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -0
  85. package/types/src/api/blockManipulation/setupTestEnv.d.ts +0 -6
  86. package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
  87. package/types/src/api/getBlockInfoFromPos.d.ts +9 -34
  88. package/types/src/api/testUtil/cases/customBlocks.d.ts +0 -6
  89. package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -6
  90. package/types/src/api/testUtil/cases/customStyles.d.ts +0 -6
  91. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -9
  92. package/types/src/blocks/defaultBlocks.d.ts +0 -12
  93. package/types/src/editor/BlockNoteEditor.d.ts +19 -2
  94. package/types/src/editor/BlockNoteExtensions.d.ts +14 -7
  95. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +4 -1
  96. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +4 -1
  97. package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +4 -5
@@ -20,164 +20,168 @@ const nodeAttributes = {
20
20
  *
21
21
  * Solution: When attributes change on a node, this plugin sets a data-* attribute with the "previous" value. This way we can still use CSS transitions. (See block.module.css)
22
22
  */
23
- export const PreviousBlockTypePlugin = () => {
24
- let timeout;
25
- return new Plugin({
26
- key: PLUGIN_KEY,
27
- view(_editorView) {
28
- return {
29
- update: async (view, _prevState) => {
30
- if (this.key?.getState(view.state).updatedBlocks.size > 0) {
31
- // use setTimeout 0 to clear the decorations so that at least
32
- // for one DOM-render the decorations have been applied
33
- timeout = setTimeout(() => {
34
- view.dispatch(view.state.tr.setMeta(PLUGIN_KEY, { clearUpdate: true }));
35
- }, 0);
36
- }
37
- },
38
- destroy: () => {
39
- if (timeout) {
40
- clearTimeout(timeout);
41
- }
42
- },
43
- };
44
- },
45
- state: {
46
- init() {
23
+ export class PreviousBlockTypePlugin {
24
+ plugin;
25
+ constructor() {
26
+ let timeout;
27
+ this.plugin = new Plugin({
28
+ key: PLUGIN_KEY,
29
+ view(_editorView) {
47
30
  return {
48
- // Block attributes, by block ID, from just before the previous transaction.
49
- prevTransactionOldBlockAttrs: {},
50
- // Block attributes, by block ID, from just before the current transaction.
51
- currentTransactionOldBlockAttrs: {},
52
- // Set of IDs of blocks whose attributes changed from the current transaction.
53
- updatedBlocks: new Set(),
31
+ update: async (view, _prevState) => {
32
+ if (this.key?.getState(view.state).updatedBlocks.size > 0) {
33
+ // use setTimeout 0 to clear the decorations so that at least
34
+ // for one DOM-render the decorations have been applied
35
+ timeout = setTimeout(() => {
36
+ view.dispatch(view.state.tr.setMeta(PLUGIN_KEY, { clearUpdate: true }));
37
+ }, 0);
38
+ }
39
+ },
40
+ destroy: () => {
41
+ if (timeout) {
42
+ clearTimeout(timeout);
43
+ }
44
+ },
54
45
  };
55
46
  },
56
- apply(transaction, prev, oldState, newState) {
57
- prev.currentTransactionOldBlockAttrs = {};
58
- prev.updatedBlocks.clear();
59
- if (!transaction.docChanged || oldState.doc.eq(newState.doc)) {
60
- return prev;
61
- }
62
- // TODO: Instead of iterating through the entire document, only check nodes affected by the transactions. Will
63
- // also probably require checking nodes affected by the previous transaction too.
64
- // We didn't get this to work yet:
65
- // const transform = combineTransactionSteps(oldState.doc, [transaction]);
66
- // // const { mapping } = transform;
67
- // const changes = getChangedRanges(transform);
68
- //
69
- // changes.forEach(({ oldRange, newRange }) => {
70
- // const oldNodes = findChildrenInRange(
71
- // oldState.doc,
72
- // oldRange,
73
- // (node) => node.attrs.id
74
- // );
75
- //
76
- // const newNodes = findChildrenInRange(
77
- // newState.doc,
78
- // newRange,
79
- // (node) => node.attrs.id
80
- // );
81
- const currentTransactionOriginalOldBlockAttrs = {};
82
- const oldNodes = findChildren(oldState.doc, (node) => node.attrs.id);
83
- const oldNodesById = new Map(oldNodes.map((node) => [node.node.attrs.id, node]));
84
- const newNodes = findChildren(newState.doc, (node) => node.attrs.id);
85
- // Traverses all block containers in the new editor state.
86
- for (const node of newNodes) {
87
- const oldNode = oldNodesById.get(node.node.attrs.id);
88
- const oldContentNode = oldNode?.node.firstChild;
89
- const newContentNode = node.node.firstChild;
90
- if (oldNode && oldContentNode && newContentNode) {
91
- const newAttrs = {
92
- index: newContentNode.attrs.index,
93
- level: newContentNode.attrs.level,
94
- type: newContentNode.type.name,
95
- depth: newState.doc.resolve(node.pos).depth,
96
- };
97
- let oldAttrs = {
98
- index: oldContentNode.attrs.index,
99
- level: oldContentNode.attrs.level,
100
- type: oldContentNode.type.name,
101
- depth: oldState.doc.resolve(oldNode.pos).depth,
102
- };
103
- currentTransactionOriginalOldBlockAttrs[node.node.attrs.id] =
104
- oldAttrs;
105
- // Whenever a transaction is appended by the OrderedListItemIndexPlugin, it's given the metadata:
106
- // { "orderedListIndexing": true }
107
- // These appended transactions happen immediately after any transaction which causes ordered list item
108
- // indices to require updating, including those which trigger animations. Therefore, these animations are
109
- // immediately overridden when the PreviousBlockTypePlugin processes the appended transaction, despite only
110
- // the listItemIndex attribute changing. To solve this, oldAttrs must be edited for transactions with the
111
- // "orderedListIndexing" metadata, so the correct animation can be re-triggered.
112
- if (transaction.getMeta("numberedListIndexing")) {
113
- // If the block existed before the transaction, gets the attributes from before the previous transaction
114
- // (i.e. the transaction that caused list item indices to need updating).
115
- if (node.node.attrs.id in prev.prevTransactionOldBlockAttrs) {
116
- oldAttrs =
117
- prev.prevTransactionOldBlockAttrs[node.node.attrs.id];
47
+ state: {
48
+ init() {
49
+ return {
50
+ // Block attributes, by block ID, from just before the previous transaction.
51
+ prevTransactionOldBlockAttrs: {},
52
+ // Block attributes, by block ID, from just before the current transaction.
53
+ currentTransactionOldBlockAttrs: {},
54
+ // Set of IDs of blocks whose attributes changed from the current transaction.
55
+ updatedBlocks: new Set(),
56
+ };
57
+ },
58
+ apply(transaction, prev, oldState, newState) {
59
+ prev.currentTransactionOldBlockAttrs = {};
60
+ prev.updatedBlocks.clear();
61
+ if (!transaction.docChanged || oldState.doc.eq(newState.doc)) {
62
+ return prev;
63
+ }
64
+ // TODO: Instead of iterating through the entire document, only check nodes affected by the transactions. Will
65
+ // also probably require checking nodes affected by the previous transaction too.
66
+ // We didn't get this to work yet:
67
+ // const transform = combineTransactionSteps(oldState.doc, [transaction]);
68
+ // // const { mapping } = transform;
69
+ // const changes = getChangedRanges(transform);
70
+ //
71
+ // changes.forEach(({ oldRange, newRange }) => {
72
+ // const oldNodes = findChildrenInRange(
73
+ // oldState.doc,
74
+ // oldRange,
75
+ // (node) => node.attrs.id
76
+ // );
77
+ //
78
+ // const newNodes = findChildrenInRange(
79
+ // newState.doc,
80
+ // newRange,
81
+ // (node) => node.attrs.id
82
+ // );
83
+ const currentTransactionOriginalOldBlockAttrs = {};
84
+ const oldNodes = findChildren(oldState.doc, (node) => node.attrs.id);
85
+ const oldNodesById = new Map(oldNodes.map((node) => [node.node.attrs.id, node]));
86
+ const newNodes = findChildren(newState.doc, (node) => node.attrs.id);
87
+ // Traverses all block containers in the new editor state.
88
+ for (const node of newNodes) {
89
+ const oldNode = oldNodesById.get(node.node.attrs.id);
90
+ const oldContentNode = oldNode?.node.firstChild;
91
+ const newContentNode = node.node.firstChild;
92
+ if (oldNode && oldContentNode && newContentNode) {
93
+ const newAttrs = {
94
+ index: newContentNode.attrs.index,
95
+ level: newContentNode.attrs.level,
96
+ type: newContentNode.type.name,
97
+ depth: newState.doc.resolve(node.pos).depth,
98
+ };
99
+ let oldAttrs = {
100
+ index: oldContentNode.attrs.index,
101
+ level: oldContentNode.attrs.level,
102
+ type: oldContentNode.type.name,
103
+ depth: oldState.doc.resolve(oldNode.pos).depth,
104
+ };
105
+ currentTransactionOriginalOldBlockAttrs[node.node.attrs.id] =
106
+ oldAttrs;
107
+ // Whenever a transaction is appended by the OrderedListItemIndexPlugin, it's given the metadata:
108
+ // { "orderedListIndexing": true }
109
+ // These appended transactions happen immediately after any transaction which causes ordered list item
110
+ // indices to require updating, including those which trigger animations. Therefore, these animations are
111
+ // immediately overridden when the PreviousBlockTypePlugin processes the appended transaction, despite only
112
+ // the listItemIndex attribute changing. To solve this, oldAttrs must be edited for transactions with the
113
+ // "orderedListIndexing" metadata, so the correct animation can be re-triggered.
114
+ if (transaction.getMeta("numberedListIndexing")) {
115
+ // If the block existed before the transaction, gets the attributes from before the previous transaction
116
+ // (i.e. the transaction that caused list item indices to need updating).
117
+ if (node.node.attrs.id in prev.prevTransactionOldBlockAttrs) {
118
+ oldAttrs =
119
+ prev.prevTransactionOldBlockAttrs[node.node.attrs.id];
120
+ }
121
+ // Stops list item indices themselves being animated (looks smoother), unless the block's content type is
122
+ // changing from a numbered list item to something else.
123
+ if (newAttrs.type === "numberedListItem") {
124
+ oldAttrs.index = newAttrs.index;
125
+ }
118
126
  }
119
- // Stops list item indices themselves being animated (looks smoother), unless the block's content type is
120
- // changing from a numbered list item to something else.
121
- if (newAttrs.type === "numberedListItem") {
122
- oldAttrs.index = newAttrs.index;
127
+ prev.currentTransactionOldBlockAttrs[node.node.attrs.id] =
128
+ oldAttrs;
129
+ // TODO: faster deep equal?
130
+ if (JSON.stringify(oldAttrs) !== JSON.stringify(newAttrs)) {
131
+ oldAttrs["depth-change"] =
132
+ oldAttrs.depth - newAttrs.depth;
133
+ // for debugging:
134
+ // console.log(
135
+ // "id:",
136
+ // node.node.attrs.id,
137
+ // "previousBlockTypePlugin changes detected, oldAttrs",
138
+ // oldAttrs,
139
+ // "new",
140
+ // newAttrs
141
+ // );
142
+ prev.updatedBlocks.add(node.node.attrs.id);
123
143
  }
124
144
  }
125
- prev.currentTransactionOldBlockAttrs[node.node.attrs.id] = oldAttrs;
126
- // TODO: faster deep equal?
127
- if (JSON.stringify(oldAttrs) !== JSON.stringify(newAttrs)) {
128
- oldAttrs["depth-change"] =
129
- oldAttrs.depth - newAttrs.depth;
130
- // for debugging:
131
- // console.log(
132
- // "id:",
133
- // node.node.attrs.id,
134
- // "previousBlockTypePlugin changes detected, oldAttrs",
135
- // oldAttrs,
136
- // "new",
137
- // newAttrs
138
- // );
139
- prev.updatedBlocks.add(node.node.attrs.id);
140
- }
141
145
  }
142
- }
143
- prev.prevTransactionOldBlockAttrs =
144
- currentTransactionOriginalOldBlockAttrs;
145
- return prev;
146
+ prev.prevTransactionOldBlockAttrs =
147
+ currentTransactionOriginalOldBlockAttrs;
148
+ return prev;
149
+ },
146
150
  },
147
- },
148
- props: {
149
- decorations(state) {
150
- const pluginState = this.getState(state);
151
- if (pluginState.updatedBlocks.size === 0) {
152
- return undefined;
153
- }
154
- const decorations = [];
155
- state.doc.descendants((node, pos) => {
156
- if (!node.attrs.id) {
157
- return;
151
+ props: {
152
+ decorations(state) {
153
+ const pluginState = this.getState(state);
154
+ if (pluginState.updatedBlocks.size === 0) {
155
+ return undefined;
158
156
  }
159
- if (!pluginState.updatedBlocks.has(node.attrs.id)) {
160
- return;
161
- }
162
- const prevAttrs = pluginState.currentTransactionOldBlockAttrs[node.attrs.id];
163
- const decorationAttrs = {};
164
- for (const [nodeAttr, val] of Object.entries(prevAttrs)) {
165
- decorationAttrs["data-prev-" + nodeAttributes[nodeAttr]] =
166
- val || "none";
167
- }
168
- // for debugging:
169
- // console.log(
170
- // "previousBlockTypePlugin committing decorations",
171
- // decorationAttrs
172
- // );
173
- const decoration = Decoration.node(pos, pos + node.nodeSize, {
174
- ...decorationAttrs,
157
+ const decorations = [];
158
+ state.doc.descendants((node, pos) => {
159
+ if (!node.attrs.id) {
160
+ return;
161
+ }
162
+ if (!pluginState.updatedBlocks.has(node.attrs.id)) {
163
+ return;
164
+ }
165
+ const prevAttrs = pluginState.currentTransactionOldBlockAttrs[node.attrs.id];
166
+ const decorationAttrs = {};
167
+ for (const [nodeAttr, val] of Object.entries(prevAttrs)) {
168
+ decorationAttrs["data-prev-" + nodeAttributes[nodeAttr]] =
169
+ val || "none";
170
+ }
171
+ // for debugging:
172
+ // console.log(
173
+ // "previousBlockTypePlugin committing decorations",
174
+ // decorationAttrs
175
+ // );
176
+ const decoration = Decoration.node(pos, pos + node.nodeSize, {
177
+ ...decorationAttrs,
178
+ });
179
+ decorations.push(decoration);
175
180
  });
176
- decorations.push(decoration);
177
- });
178
- return DecorationSet.create(state.doc, decorations);
181
+ return DecorationSet.create(state.doc, decorations);
182
+ },
179
183
  },
180
- },
181
- });
182
- };
184
+ });
185
+ }
186
+ }
183
187
  //# sourceMappingURL=PreviousBlockTypePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PreviousBlockTypePlugin.js","sourceRoot":"","sources":["../../../../src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,UAAU,GAAG,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAEpD,MAAM,cAAc,GAA2B;IAC7C,sBAAsB;IACtB,KAAK,EAAE,OAAO;IACd,WAAW;IACX,KAAK,EAAE,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