Skip to content

Commit 58509da

Browse files
authored
upgrade tiptap (#36)
1 parent 6f778ea commit 58509da

File tree

8 files changed

+1443
-1763
lines changed

8 files changed

+1443
-1763
lines changed

package-lock.json

Lines changed: 1411 additions & 1720 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"overrides": {
2626
"react": "^17.0.2",
27-
"react-dom": "^17.0.2"
27+
"react-dom": "^17.0.2",
28+
"prosemirror-view": "1.26.2"
2829
}
2930
}

packages/core/package.json

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,26 @@
2727
"lint": "eslint src --max-warnings 0"
2828
},
2929
"dependencies": {
30-
"@tiptap/core": "2.0.0-beta.171",
31-
"@tiptap/extension-bubble-menu": "2.0.0-beta.55",
32-
"@tiptap/extension-code-block-lowlight": "2.0.0-beta.68",
33-
"@tiptap/extension-collaboration": "2.0.0-beta.33",
34-
"@tiptap/extension-collaboration-cursor": "2.0.0-beta.34",
35-
"@tiptap/extension-floating-menu": "2.0.0-beta.50",
36-
"@tiptap/extension-image": "2.0.0-beta.25",
37-
"@tiptap/extension-link": "2.0.0-beta.36",
38-
"@tiptap/extension-table": "2.0.0-beta.48",
39-
"@tiptap/extension-table-cell": "2.0.0-beta.20",
40-
"@tiptap/extension-table-header": "2.0.0-beta.22",
41-
"@tiptap/extension-table-row": "2.0.0-beta.19",
42-
"@tiptap/react": "2.0.0-beta.107",
43-
"@tiptap/extension-blockquote": "^2.0.0-beta.26",
44-
"@tiptap/extension-bold": "^2.0.0-beta.26",
45-
"@tiptap/extension-code": "^2.0.0-beta.26",
46-
"@tiptap/extension-dropcursor": "^2.0.0-beta.25",
47-
"@tiptap/extension-gapcursor": "^2.0.0-beta.34",
48-
"@tiptap/extension-hard-break": "^2.0.0-beta.30",
49-
"@tiptap/extension-heading": "^2.0.0-beta.26",
50-
"@tiptap/extension-history": "^2.0.0-beta.21",
51-
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.31",
52-
"@tiptap/extension-italic": "^2.0.0-beta.26",
53-
"@tiptap/extension-paragraph": "^2.0.0-beta.23",
54-
"@tiptap/extension-strike": "^2.0.0-beta.27",
55-
"@tiptap/extension-text": "^2.0.0-beta.15",
56-
"@tiptap/extension-underline": "^2.0.0-beta.23",
57-
"@tiptap/suggestion": "2.0.0-beta.90",
58-
"prosemirror-view": "^1.27.0",
59-
"prosemirror-state": "^1.4.1",
60-
"prosemirror-model": "^1.18.1",
30+
"@tiptap/core": "^2.0.0-beta.182",
31+
"@tiptap/extension-collaboration": "^2.0.0-beta.38",
32+
"@tiptap/extension-collaboration-cursor": "^2.0.0-beta.37",
33+
"@tiptap/extension-link": "^2.0.0-beta.43",
34+
"@tiptap/react": "^2.0.0-beta.114",
35+
"@tiptap/extension-bold": "^2.0.0-beta.28",
36+
"@tiptap/extension-code": "^2.0.0-beta.28",
37+
"@tiptap/extension-dropcursor": "^2.0.0-beta.29",
38+
"@tiptap/extension-gapcursor": "^2.0.0-beta.39",
39+
"@tiptap/extension-hard-break": "^2.0.0-beta.33",
40+
"@tiptap/extension-history": "^2.0.0-beta.26",
41+
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.36",
42+
"@tiptap/extension-italic": "^2.0.0-beta.28",
43+
"@tiptap/extension-paragraph": "^2.0.0-beta.26",
44+
"@tiptap/extension-strike": "^2.0.0-beta.29",
45+
"@tiptap/extension-text": "^2.0.0-beta.17",
46+
"@tiptap/extension-underline": "^2.0.0-beta.25",
47+
"prosemirror-model": "1.18.1",
48+
"prosemirror-state": "1.4.1",
49+
"prosemirror-view": "1.26.2",
6150
"lodash": "^4.17.21",
6251
"uuid": "^8.3.2",
6352
"react-icons": "^4.3.1",
@@ -67,9 +56,6 @@
6756
"@atlaskit/menu": "^1.3.0",
6857
"@atlaskit/dropdown-menu": "^11.1.2",
6958
"styled-components": "^5.3.3",
70-
"react-popper": "^2.2.5",
71-
"warning": "^4.0.3",
72-
"react-fast-compare": "^3.2.0",
7359
"react": "^17.0.2",
7460
"react-dom": "^17.0.2"
7561
},

packages/core/src/extensions/Blocks/PreviousBlockTypePlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const PreviousBlockTypePlugin = () => {
112112
},
113113
props: {
114114
decorations(state) {
115-
const pluginState = this.getState(state);
115+
const pluginState = (this as Plugin).getState(state);
116116
if (!pluginState.needsUpdate) {
117117
return undefined;
118118
}

packages/core/src/extensions/DraggableBlocks/DraggableBlocksPlugin.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ export const createDraggableBlocksPlugin = () => {
187187
// // event.dataTransfer!.;
188188
// return false;
189189
// },
190-
mouseleave(_view, _event) {
190+
mouseleave(_view, _event: any) {
191191
if (!dropElement) {
192192
throw new Error("unexpected");
193193
}
194194
// TODO
195195
// dropElement.style.display = "none";
196196
return true;
197197
},
198-
mousedown(_view, _event) {
198+
mousedown(_view, _event: any) {
199199
if (!dropElement) {
200200
throw new Error("unexpected");
201201
}
@@ -204,7 +204,7 @@ export const createDraggableBlocksPlugin = () => {
204204
ReactDOM.render(<></>, dropElement);
205205
return false;
206206
},
207-
mousemove(view, event) {
207+
mousemove(view, event: any) {
208208
if (!dropElement) {
209209
throw new Error("unexpected");
210210
}

packages/core/src/extensions/Hyperlinks/HyperlinkMenuPlugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export const createHyperlinkMenuPlugin = () => {
177177
props: {
178178
handleDOMEvents: {
179179
// update view when an <a> is hovered over
180-
mouseover(view, event) {
180+
mouseover(view, event: any) {
181181
const newHoveredLink =
182182
event.target instanceof HTMLAnchorElement &&
183183
event.target.nodeName === "A"

packages/core/src/extensions/UniqueID/UniqueID.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const UniqueID = Extension.create({
208208
handleDOMEvents: {
209209
// only create new ids for dropped content while holding `alt`
210210
// or content is dragged from another editor
211-
drop: (view, event) => {
211+
drop: (view, event: any) => {
212212
var _a;
213213
if (
214214
dragSourceElement !== view.dom.parentElement ||

packages/core/src/shared/plugins/suggestion/SuggestionPlugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export function createSuggestionPlugin<T extends SuggestionItem>({
300300

301301
props: {
302302
handleKeyDown(view, event) {
303-
const { active } = this.getState(view.state);
303+
const { active } = (this as Plugin).getState(view.state);
304304

305305
if (!active) {
306306
// activate the popup on 'char' keypress (e.g. '/')
@@ -324,7 +324,9 @@ export function createSuggestionPlugin<T extends SuggestionItem>({
324324

325325
// Setup decorator on the currently active suggestion.
326326
decorations(state) {
327-
const { active, range, decorationId, type } = this.getState(state);
327+
const { active, range, decorationId, type } = (this as Plugin).getState(
328+
state
329+
);
328330

329331
if (!active) {
330332
return null;

0 commit comments

Comments
 (0)