mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
editor: update tiptap packages to v2.0.3
This commit is contained in:
committed by
Abdullah Atta
parent
b77711a53d
commit
3b727e6f64
658
packages/editor/package-lock.json
generated
658
packages/editor/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,27 +10,27 @@
|
||||
"@social-embed/lib": "^0.0.2-next.1",
|
||||
"@theme-ui/components": "^0.14.7",
|
||||
"@theme-ui/core": "^0.14.7",
|
||||
"@tiptap/core": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-character-count": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-color": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-font-family": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-history": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-link": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-placeholder": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-subscript": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-superscript": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-table": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-table-cell": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-table-header": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-table-row": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-task-item": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-task-list": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-text-align": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-text-style": "^2.0.0-beta.220",
|
||||
"@tiptap/extension-underline": "^2.0.0-beta.220",
|
||||
"@tiptap/pm": "^2.0.0-beta.220",
|
||||
"@tiptap/starter-kit": "^2.0.0-beta.220",
|
||||
"@tiptap/core": "2.0.3",
|
||||
"@tiptap/extension-character-count": "2.0.3",
|
||||
"@tiptap/extension-color": "2.0.3",
|
||||
"@tiptap/extension-font-family": "2.0.3",
|
||||
"@tiptap/extension-history": "2.0.3",
|
||||
"@tiptap/extension-horizontal-rule": "2.0.3",
|
||||
"@tiptap/extension-link": "2.0.3",
|
||||
"@tiptap/extension-placeholder": "2.0.3",
|
||||
"@tiptap/extension-subscript": "2.0.3",
|
||||
"@tiptap/extension-superscript": "2.0.3",
|
||||
"@tiptap/extension-table": "2.0.3",
|
||||
"@tiptap/extension-table-cell": "2.0.3",
|
||||
"@tiptap/extension-table-header": "2.0.3",
|
||||
"@tiptap/extension-table-row": "2.0.3",
|
||||
"@tiptap/extension-task-item": "2.0.3",
|
||||
"@tiptap/extension-task-list": "2.0.3",
|
||||
"@tiptap/extension-text-align": "2.0.3",
|
||||
"@tiptap/extension-text-style": "2.0.3",
|
||||
"@tiptap/extension-underline": "2.0.3",
|
||||
"@tiptap/pm": "2.0.3",
|
||||
"@tiptap/starter-kit": "2.0.3",
|
||||
"detect-indent": "^7.0.0",
|
||||
"katex": "^0.16.2",
|
||||
"nanoid": "^4.0.1",
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
diff --git a/node_modules/@tiptap/core/dist/index.js b/node_modules/@tiptap/core/dist/index.js
|
||||
index 163e352..8cd7ec6 100644
|
||||
--- a/node_modules/@tiptap/core/dist/index.js
|
||||
+++ b/node_modules/@tiptap/core/dist/index.js
|
||||
@@ -3129,8 +3129,7 @@ const Keymap = Extension.create({
|
||||
new Plugin({
|
||||
key: new PluginKey('clearDocument'),
|
||||
appendTransaction: (transactions, oldState, newState) => {
|
||||
- const docChanges = transactions.some(transaction => transaction.docChanged)
|
||||
- && !oldState.doc.eq(newState.doc);
|
||||
+ const docChanges = transactions.some(transaction => transaction.docChanged);
|
||||
if (!docChanges) {
|
||||
return;
|
||||
}
|
||||
@@ -3138,10 +3137,12 @@ const Keymap = Extension.create({
|
||||
const allFrom = Selection.atStart(oldState.doc).from;
|
||||
const allEnd = Selection.atEnd(oldState.doc).to;
|
||||
const allWasSelected = from === allFrom && to === allEnd;
|
||||
- const isEmpty = newState.doc.textBetween(0, newState.doc.content.size, ' ', ' ').length === 0;
|
||||
- if (empty || !allWasSelected || !isEmpty) {
|
||||
+ if (empty || !allWasSelected) {
|
||||
return;
|
||||
}
|
||||
+ const isEmpty = newState.doc.textBetween(0, newState.doc.content.size, ' ', ' ').length === 0;
|
||||
+ if (!isEmpty) return;
|
||||
+
|
||||
const tr = newState.tr;
|
||||
const state = createChainableState({
|
||||
state: newState,
|
||||
@@ -1,39 +0,0 @@
|
||||
diff --git a/node_modules/@tiptap/extension-link/dist/index.cjs b/node_modules/@tiptap/extension-link/dist/index.cjs
|
||||
index a79f326..a5f8fdd 100644
|
||||
--- a/node_modules/@tiptap/extension-link/dist/index.cjs
|
||||
+++ b/node_modules/@tiptap/extension-link/dist/index.cjs
|
||||
@@ -101,6 +101,8 @@ function clickHandler(options) {
|
||||
key: new state.PluginKey('handleClickLink'),
|
||||
props: {
|
||||
handleClick: (view, pos, event) => {
|
||||
+ if (event.button !== 1) return;
|
||||
+
|
||||
var _a, _b, _c;
|
||||
const attrs = core.getAttributes(view.state, options.type.name);
|
||||
const link = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('a');
|
||||
diff --git a/node_modules/@tiptap/extension-link/dist/index.js b/node_modules/@tiptap/extension-link/dist/index.js
|
||||
index d579117..3f6d893 100644
|
||||
--- a/node_modules/@tiptap/extension-link/dist/index.js
|
||||
+++ b/node_modules/@tiptap/extension-link/dist/index.js
|
||||
@@ -97,6 +97,8 @@ function clickHandler(options) {
|
||||
key: new PluginKey('handleClickLink'),
|
||||
props: {
|
||||
handleClick: (view, pos, event) => {
|
||||
+ if (event.button !== 1) return;
|
||||
+
|
||||
var _a, _b, _c;
|
||||
const attrs = getAttributes(view.state, options.type.name);
|
||||
const link = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('a');
|
||||
diff --git a/node_modules/@tiptap/extension-link/dist/index.umd.js b/node_modules/@tiptap/extension-link/dist/index.umd.js
|
||||
index 743ae18..643089d 100644
|
||||
--- a/node_modules/@tiptap/extension-link/dist/index.umd.js
|
||||
+++ b/node_modules/@tiptap/extension-link/dist/index.umd.js
|
||||
@@ -99,6 +99,8 @@
|
||||
key: new state.PluginKey('handleClickLink'),
|
||||
props: {
|
||||
handleClick: (view, pos, event) => {
|
||||
+ if (event.button !== 1) return;
|
||||
+
|
||||
var _a, _b, _c;
|
||||
const attrs = core.getAttributes(view.state, options.type.name);
|
||||
const link = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('a');
|
||||
42
packages/editor/patches/@tiptap+extension-link+2.0.3.patch
Normal file
42
packages/editor/patches/@tiptap+extension-link+2.0.3.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
diff --git a/node_modules/@tiptap/extension-link/dist/index.cjs b/node_modules/@tiptap/extension-link/dist/index.cjs
|
||||
index 301cdb9..1390415 100644
|
||||
--- a/node_modules/@tiptap/extension-link/dist/index.cjs
|
||||
+++ b/node_modules/@tiptap/extension-link/dist/index.cjs
|
||||
@@ -102,6 +102,7 @@ function clickHandler(options) {
|
||||
props: {
|
||||
handleClick: (view, pos, event) => {
|
||||
var _a, _b, _c;
|
||||
+ event.preventDefault()
|
||||
if (event.button !== 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -110,7 +111,7 @@ function clickHandler(options) {
|
||||
const href = (_b = link === null || link === void 0 ? void 0 : link.href) !== null && _b !== void 0 ? _b : attrs.href;
|
||||
const target = (_c = link === null || link === void 0 ? void 0 : link.target) !== null && _c !== void 0 ? _c : attrs.target;
|
||||
if (link && href) {
|
||||
- window.open(href, target);
|
||||
+ if (view.editable) window.open(href, target);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
diff --git a/node_modules/@tiptap/extension-link/dist/index.js b/node_modules/@tiptap/extension-link/dist/index.js
|
||||
index e3b8602..b75336f 100644
|
||||
--- a/node_modules/@tiptap/extension-link/dist/index.js
|
||||
+++ b/node_modules/@tiptap/extension-link/dist/index.js
|
||||
@@ -97,6 +97,7 @@ function clickHandler(options) {
|
||||
key: new PluginKey('handleClickLink'),
|
||||
props: {
|
||||
handleClick: (view, pos, event) => {
|
||||
+ event.preventDefault()
|
||||
var _a, _b, _c;
|
||||
if (event.button !== 0) {
|
||||
return false;
|
||||
@@ -106,7 +107,7 @@ function clickHandler(options) {
|
||||
const href = (_b = link === null || link === void 0 ? void 0 : link.href) !== null && _b !== void 0 ? _b : attrs.href;
|
||||
const target = (_c = link === null || link === void 0 ? void 0 : link.target) !== null && _c !== void 0 ? _c : attrs.target;
|
||||
if (link && href) {
|
||||
- window.open(href, target);
|
||||
+ if (view.editable) window.open(href, target);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
Reference in New Issue
Block a user