Skip to content

Commit 5c22a6c

Browse files
authored
[WIKI-484] chore: update editor packages (#7265)
1 parent 4c3af7f commit 5c22a6c

File tree

17 files changed

+514
-598
lines changed

17 files changed

+514
-598
lines changed

apps/live/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"@hocuspocus/server": "^2.15.0",
2727
"@plane/editor": "*",
2828
"@plane/types": "*",
29-
"@tiptap/core": "2.10.4",
30-
"@tiptap/html": "2.11.0",
29+
"@tiptap/core": "^2.22.3",
30+
"@tiptap/html": "^2.22.3",
3131
"axios": "^1.8.3",
3232
"compression": "1.8.1",
3333
"cors": "^2.8.5",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"@babel/helpers": "7.26.10",
3030
"@babel/runtime": "7.26.10",
3131
"chokidar": "3.6.0",
32-
"tar-fs": "3.0.9"
32+
"tar-fs": "3.0.9",
33+
"prosemirror-view": "1.40.0"
3334
},
3435
"packageManager": "[email protected]"
3536
}

packages/editor/package.json

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,31 @@
4545
"@plane/types": "*",
4646
"@plane/ui": "*",
4747
"@plane/utils": "*",
48-
"@tiptap/core": "2.10.4",
49-
"@tiptap/extension-blockquote": "2.10.4",
50-
"@tiptap/extension-character-count": "2.11.0",
51-
"@tiptap/extension-collaboration": "2.11.0",
48+
"@tiptap/core": "^2.22.3",
49+
"@tiptap/extension-blockquote": "^2.22.3",
50+
"@tiptap/extension-character-count": "^2.22.3",
51+
"@tiptap/extension-collaboration": "^2.22.3",
5252
"@tiptap/extension-emoji": "^2.22.3",
53-
"@tiptap/extension-image": "2.11.0",
54-
"@tiptap/extension-list-item": "2.11.0",
55-
"@tiptap/extension-mention": "2.11.0",
56-
"@tiptap/extension-placeholder": "2.11.0",
57-
"@tiptap/extension-task-item": "2.11.0",
58-
"@tiptap/extension-task-list": "2.11.0",
59-
"@tiptap/extension-text-align": "2.11.0",
60-
"@tiptap/extension-text-style": "2.11.0",
61-
"@tiptap/extension-underline": "2.11.0",
62-
"@tiptap/html": "2.11.0",
63-
"@tiptap/pm": "2.11.0",
64-
"@tiptap/react": "2.11.0",
65-
"@tiptap/starter-kit": "2.11.0",
66-
"@tiptap/suggestion": "2.11.0",
67-
"class-variance-authority": "^0.7.0",
53+
"@tiptap/extension-image": "^2.22.3",
54+
"@tiptap/extension-list-item": "^2.22.3",
55+
"@tiptap/extension-mention": "^2.22.3",
56+
"@tiptap/extension-placeholder": "^2.22.3",
57+
"@tiptap/extension-task-item": "^2.22.3",
58+
"@tiptap/extension-task-list": "^2.22.3",
59+
"@tiptap/extension-text-align": "^2.22.3",
60+
"@tiptap/extension-text-style": "^2.22.3",
61+
"@tiptap/extension-underline": "^2.22.3",
62+
"@tiptap/html": "^2.22.3",
63+
"@tiptap/pm": "^2.22.3",
64+
"@tiptap/react": "^2.22.3",
65+
"@tiptap/starter-kit": "^2.22.3",
66+
"@tiptap/suggestion": "^2.22.3",
6867
"highlight.js": "^11.8.0",
6968
"jsx-dom-cjs": "^8.0.3",
7069
"linkifyjs": "^4.1.3",
7170
"lowlight": "^3.0.0",
7271
"lucide-react": "^0.469.0",
7372
"prosemirror-codemark": "^0.4.2",
74-
"prosemirror-utils": "^1.2.2",
7573
"tippy.js": "^6.3.7",
7674
"tiptap-markdown": "^0.8.10",
7775
"uuid": "^10.0.0",

packages/editor/src/core/extensions/callout/block.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import { EAttributeNames, TCalloutBlockAttributes } from "./types";
1010
// utils
1111
import { updateStoredBackgroundColor } from "./utils";
1212

13-
type Props = NodeViewProps & {
13+
export type CustomCalloutNodeViewProps = NodeViewProps & {
1414
node: NodeViewProps["node"] & {
1515
attrs: TCalloutBlockAttributes;
1616
};
1717
updateAttributes: (attrs: Partial<TCalloutBlockAttributes>) => void;
1818
};
1919

20-
export const CustomCalloutBlock: React.FC<Props> = (props) => {
20+
export const CustomCalloutBlock: React.FC<CustomCalloutNodeViewProps> = (props) => {
2121
const { editor, node, updateAttributes } = props;
2222
// states
2323
const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState(false);

packages/editor/src/core/extensions/callout/extension.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { findParentNodeClosestToPos, Predicate, ReactNodeViewRenderer } from "@tiptap/react";
22
// extensions
3-
import { CustomCalloutBlock } from "@/extensions";
3+
import { CustomCalloutBlock, CustomCalloutNodeViewProps } from "@/extensions/callout";
44
// helpers
55
import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary";
66
// config
@@ -63,6 +63,8 @@ export const CustomCalloutExtension = CustomCalloutExtensionConfig.extend({
6363
},
6464

6565
addNodeView() {
66-
return ReactNodeViewRenderer(CustomCalloutBlock);
66+
return ReactNodeViewRenderer((props) => (
67+
<CustomCalloutBlock {...props} node={props.node as CustomCalloutNodeViewProps["node"]} />
68+
));
6769
},
6870
});
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactNodeViewRenderer } from "@tiptap/react";
22
// extensions
3-
import { CustomCalloutBlock } from "@/extensions";
3+
import { CustomCalloutBlock, CustomCalloutNodeViewProps } from "@/extensions/callout";
44
// config
55
import { CustomCalloutExtensionConfig } from "./extension-config";
66

@@ -9,6 +9,8 @@ export const CustomCalloutReadOnlyExtension = CustomCalloutExtensionConfig.exten
99
draggable: false,
1010

1111
addNodeView() {
12-
return ReactNodeViewRenderer(CustomCalloutBlock);
12+
return ReactNodeViewRenderer((props) => (
13+
<CustomCalloutBlock {...props} node={props.node as CustomCalloutNodeViewProps["node"]} />
14+
));
1315
},
1416
});

packages/editor/src/core/extensions/custom-image/extension.ts renamed to packages/editor/src/core/extensions/custom-image/extension.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-par
88
// types
99
import type { TFileHandler, TReadOnlyFileHandler } from "@/types";
1010
// local imports
11-
import { CustomImageNodeView } from "./components/node-view";
11+
import { CustomImageNodeView, CustomImageNodeViewProps } from "./components/node-view";
1212
import { CustomImageExtensionConfig } from "./extension-config";
1313
import { getImageComponentImageFileMap } from "./utils";
1414

@@ -116,7 +116,9 @@ export const CustomImageExtension = (props: Props) => {
116116
},
117117

118118
addNodeView() {
119-
return ReactNodeViewRenderer(CustomImageNodeView);
119+
return ReactNodeViewRenderer((props) => (
120+
<CustomImageNodeView {...props} node={props.node as CustomImageNodeViewProps["node"]} />
121+
));
120122
},
121123
});
122124
};

packages/editor/src/core/extensions/extensions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,5 @@ export const CoreEditorExtensions = (args: TArguments): Extensions => {
122122
);
123123
}
124124

125-
// @ts-expect-error tiptap types are incorrect
126125
return extensions;
127126
};

packages/editor/src/core/extensions/image/extension.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-par
44
// types
55
import type { TFileHandler, TReadOnlyFileHandler } from "@/types";
66
// local imports
7-
import { CustomImageNodeView } from "../custom-image/components/node-view";
7+
import { CustomImageNodeView, CustomImageNodeViewProps } from "../custom-image/components/node-view";
88
import { ImageExtensionConfig } from "./extension-config";
99

1010
export type ImageExtensionStorage = {
@@ -47,7 +47,9 @@ export const ImageExtension = (props: Props) => {
4747

4848
// render custom image node
4949
addNodeView() {
50-
return ReactNodeViewRenderer(CustomImageNodeView);
50+
return ReactNodeViewRenderer((props) => (
51+
<CustomImageNodeView {...props} node={props.node as CustomImageNodeViewProps["node"]} />
52+
));
5153
},
5254
});
5355
};

packages/editor/src/core/extensions/mentions/extension.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { TMentionHandler } from "@/types";
44
// extension config
55
import { CustomMentionExtensionConfig } from "./extension-config";
66
// node view
7-
import { MentionNodeView } from "./mention-node-view";
7+
import { MentionNodeView, MentionNodeViewProps } from "./mention-node-view";
88
// utils
99
import { renderMentionsDropdown } from "./utils";
1010

@@ -20,7 +20,9 @@ export const CustomMentionExtension = (props: TMentionHandler) => {
2020
},
2121

2222
addNodeView() {
23-
return ReactNodeViewRenderer(MentionNodeView);
23+
return ReactNodeViewRenderer((props) => (
24+
<MentionNodeView {...props} node={props.node as MentionNodeViewProps["node"]} />
25+
));
2426
},
2527
}).configure({
2628
suggestion: {

0 commit comments

Comments
 (0)