@tiptap/core 2.0.0-beta.142 → 2.0.0-beta.146
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/packages/core/src/commands/focus.d.ts +3 -1
- package/dist/tiptap-core.cjs.js +19 -30
- package/dist/tiptap-core.cjs.js.map +1 -1
- package/dist/tiptap-core.esm.js +19 -30
- package/dist/tiptap-core.esm.js.map +1 -1
- package/dist/tiptap-core.umd.js +19 -30
- package/dist/tiptap-core.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/Extension.ts +7 -14
- package/src/Mark.ts +7 -14
- package/src/Node.ts +7 -14
- package/src/commands/focus.ts +16 -3
- package/src/utilities/isPlainObject.ts +4 -1
package/dist/tiptap-core.umd.js
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
10
10
|
}
|
|
11
11
|
function isPlainObject(value) {
|
|
12
|
-
if (getType(value) !== 'Object')
|
|
12
|
+
if (getType(value) !== 'Object') {
|
|
13
13
|
return false;
|
|
14
|
+
}
|
|
14
15
|
return value.constructor === Object && Object.getPrototypeOf(value) === Object.prototype;
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -125,15 +126,9 @@
|
|
|
125
126
|
if (extendedConfig.defaultOptions) {
|
|
126
127
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
: extension.parent.options;
|
|
132
|
-
if (extendedConfig.addOptions) {
|
|
133
|
-
extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
|
|
134
|
-
name: extension.name,
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
129
|
+
extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
|
|
130
|
+
name: extension.name,
|
|
131
|
+
}));
|
|
137
132
|
extension.storage = callOrReturn(getExtensionField(extension, 'addStorage', {
|
|
138
133
|
name: extension.name,
|
|
139
134
|
options: extension.options,
|
|
@@ -525,7 +520,11 @@
|
|
|
525
520
|
to: position,
|
|
526
521
|
};
|
|
527
522
|
}
|
|
528
|
-
const focus = (position = null) => ({ editor, view, tr, dispatch, }) => {
|
|
523
|
+
const focus = (position = null, options) => ({ editor, view, tr, dispatch, }) => {
|
|
524
|
+
options = {
|
|
525
|
+
scrollIntoView: true,
|
|
526
|
+
...options,
|
|
527
|
+
};
|
|
529
528
|
const delayedFocus = () => {
|
|
530
529
|
// focus within `requestAnimationFrame` breaks focus on iOS
|
|
531
530
|
// so we have to call this
|
|
@@ -537,7 +536,9 @@
|
|
|
537
536
|
requestAnimationFrame(() => {
|
|
538
537
|
if (!editor.isDestroyed) {
|
|
539
538
|
view.focus();
|
|
540
|
-
|
|
539
|
+
if (options === null || options === void 0 ? void 0 : options.scrollIntoView) {
|
|
540
|
+
editor.commands.scrollIntoView();
|
|
541
|
+
}
|
|
541
542
|
}
|
|
542
543
|
});
|
|
543
544
|
};
|
|
@@ -3415,15 +3416,9 @@ img.ProseMirror-separator {
|
|
|
3415
3416
|
if (extendedConfig.defaultOptions) {
|
|
3416
3417
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
|
|
3417
3418
|
}
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
: extension.parent.options;
|
|
3422
|
-
if (extendedConfig.addOptions) {
|
|
3423
|
-
extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
|
|
3424
|
-
name: extension.name,
|
|
3425
|
-
}));
|
|
3426
|
-
}
|
|
3419
|
+
extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
|
|
3420
|
+
name: extension.name,
|
|
3421
|
+
}));
|
|
3427
3422
|
extension.storage = callOrReturn(getExtensionField(extension, 'addStorage', {
|
|
3428
3423
|
name: extension.name,
|
|
3429
3424
|
options: extension.options,
|
|
@@ -3486,15 +3481,9 @@ img.ProseMirror-separator {
|
|
|
3486
3481
|
if (extendedConfig.defaultOptions) {
|
|
3487
3482
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
|
|
3488
3483
|
}
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
: extension.parent.options;
|
|
3493
|
-
if (extendedConfig.addOptions) {
|
|
3494
|
-
extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
|
|
3495
|
-
name: extension.name,
|
|
3496
|
-
}));
|
|
3497
|
-
}
|
|
3484
|
+
extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
|
|
3485
|
+
name: extension.name,
|
|
3486
|
+
}));
|
|
3498
3487
|
extension.storage = callOrReturn(getExtensionField(extension, 'addStorage', {
|
|
3499
3488
|
name: extension.name,
|
|
3500
3489
|
options: extension.options,
|