@tiptap/core 2.11.0 → 2.11.2
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.
- package/dist/Editor.d.ts +1 -1
- package/dist/Editor.d.ts.map +1 -1
- package/dist/EventEmitter.d.ts.map +1 -1
- package/dist/Mark.d.ts.map +1 -1
- package/dist/Node.d.ts.map +1 -1
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +6 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities/isFunction.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Editor.ts +2 -1
- package/src/EventEmitter.ts +1 -1
- package/src/Mark.ts +1 -0
- package/src/Node.ts +1 -0
- package/src/PasteRule.ts +2 -2
- package/src/commands/joinItemBackward.ts +1 -1
- package/src/commands/joinItemForward.ts +1 -1
- package/src/helpers/getSchemaByResolvedExtensions.ts +1 -1
- package/src/types.ts +1 -1
- package/src/utilities/isFunction.ts +1 -0
- package/src/utilities/mergeAttributes.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -320,7 +320,7 @@ function mergeAttributes(...objects) {
|
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
322
|
if (key === 'class') {
|
|
323
|
-
const valueClasses = value ? value.split(' ') : [];
|
|
323
|
+
const valueClasses = value ? String(value).split(' ') : [];
|
|
324
324
|
const existingClasses = mergedAttributes[key] ? mergedAttributes[key].split(' ') : [];
|
|
325
325
|
const insertClasses = valueClasses.filter(valueClass => !existingClasses.includes(valueClass));
|
|
326
326
|
mergedAttributes[key] = [...existingClasses, ...insertClasses].join(' ');
|
|
@@ -362,6 +362,7 @@ function getRenderedAttributes(nodeOrMark, extensionAttributes) {
|
|
|
362
362
|
.reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
365
366
|
function isFunction(value) {
|
|
366
367
|
return typeof value === 'function';
|
|
367
368
|
}
|
|
@@ -1021,7 +1022,7 @@ function pasteRulesPlugin(props) {
|
|
|
1021
1022
|
try {
|
|
1022
1023
|
dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
1023
1024
|
}
|
|
1024
|
-
catch
|
|
1025
|
+
catch {
|
|
1025
1026
|
dropEvent = null;
|
|
1026
1027
|
}
|
|
1027
1028
|
const processEvent = ({ state, from, to, rule, pasteEvt, }) => {
|
|
@@ -1045,7 +1046,7 @@ function pasteRulesPlugin(props) {
|
|
|
1045
1046
|
try {
|
|
1046
1047
|
dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
1047
1048
|
}
|
|
1048
|
-
catch
|
|
1049
|
+
catch {
|
|
1049
1050
|
dropEvent = null;
|
|
1050
1051
|
}
|
|
1051
1052
|
pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
@@ -2160,7 +2161,7 @@ const joinItemBackward = () => ({ state, dispatch, tr, }) => {
|
|
|
2160
2161
|
}
|
|
2161
2162
|
return true;
|
|
2162
2163
|
}
|
|
2163
|
-
catch
|
|
2164
|
+
catch {
|
|
2164
2165
|
return false;
|
|
2165
2166
|
}
|
|
2166
2167
|
};
|
|
@@ -2177,7 +2178,7 @@ const joinItemForward = () => ({ state, dispatch, tr, }) => {
|
|
|
2177
2178
|
}
|
|
2178
2179
|
return true;
|
|
2179
2180
|
}
|
|
2180
|
-
catch
|
|
2181
|
+
catch {
|
|
2181
2182
|
return false;
|
|
2182
2183
|
}
|
|
2183
2184
|
};
|