Skip to content

Commit 3e2b08e

Browse files
authored
Merge pull request #2160 from makeplane/sync/ce-ee
Sync: Community Changes
2 parents 22903d7 + ad2d215 commit 3e2b08e

File tree

24 files changed

+564
-532
lines changed

24 files changed

+564
-532
lines changed

apiserver/plane/app/views/workspace/preference.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ def get(self, request, slug):
3131

3232
create_preference_keys = []
3333

34-
keys = [key for key, _ in WorkspaceHomePreference.HomeWidgetKeys.choices]
34+
keys = [
35+
key
36+
for key, _ in WorkspaceHomePreference.HomeWidgetKeys.choices
37+
if key not in ["quick_tutorial", "new_at_plane"]
38+
]
3539

3640
sort_order_counter = 1
3741

apiserver/plane/app/views/workspace/sticky.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ def create(self, request, slug):
3939
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST], level="WORKSPACE"
4040
)
4141
def list(self, request, slug):
42+
query = request.query_params.get("query", False)
43+
stickies = self.get_queryset()
44+
if query:
45+
stickies = stickies.filter(name__icontains=query)
46+
4247
return self.paginate(
4348
request=request,
44-
queryset=(self.get_queryset()),
49+
queryset=(stickies),
4550
on_results=lambda stickies: StickySerializer(stickies, many=True).data,
4651
default_per_page=20,
4752
)
48-
53+
4954
@allow_permission(allowed_roles=[], creator=True, model=Sticky, level="WORKSPACE")
5055
def partial_update(self, request, *args, **kwargs):
5156
return super().partial_update(request, *args, **kwargs)

live/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"@plane/types": "*",
2626
"@sentry/node": "^8.28.0",
2727
"@sentry/profiling-node": "^8.28.0",
28-
"@tiptap/core": "^2.4.0",
29-
"@tiptap/html": "^2.3.0",
28+
"@tiptap/core": "2.10.4",
29+
"@tiptap/html": "2.11.0",
3030
"axios": "^1.7.9",
3131
"compression": "^1.7.4",
3232
"cors": "^2.8.5",

packages/editor/package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@
4141
"@plane/types": "*",
4242
"@plane/ui": "*",
4343
"@plane/utils": "*",
44-
"@tiptap/core": "^2.1.13",
45-
"@tiptap/extension-blockquote": "^2.1.13",
46-
"@tiptap/extension-character-count": "^2.6.5",
47-
"@tiptap/extension-collaboration": "^2.3.2",
48-
"@tiptap/extension-collaboration-cursor": "^2.6.6",
49-
"@tiptap/extension-image": "^2.1.13",
50-
"@tiptap/extension-list-item": "^2.1.13",
51-
"@tiptap/extension-mention": "^2.1.13",
52-
"@tiptap/extension-placeholder": "^2.3.0",
53-
"@tiptap/extension-task-item": "^2.1.13",
54-
"@tiptap/extension-task-list": "^2.1.13",
55-
"@tiptap/extension-text-align": "^2.8.0",
56-
"@tiptap/extension-text-style": "^2.7.1",
57-
"@tiptap/extension-underline": "^2.1.13",
58-
"@tiptap/html": "^2.1.13",
59-
"@tiptap/pm": "^2.1.13",
60-
"@tiptap/react": "^2.1.13",
61-
"@tiptap/starter-kit": "^2.1.13",
62-
"@tiptap/suggestion": "^2.0.13",
44+
"@tiptap/core": "2.10.4",
45+
"@tiptap/extension-blockquote": "2.10.4",
46+
"@tiptap/extension-character-count": "2.11.0",
47+
"@tiptap/extension-collaboration": "2.11.0",
48+
"@tiptap/extension-collaboration-cursor": "2.11.0",
49+
"@tiptap/extension-image": "2.11.0",
50+
"@tiptap/extension-list-item": "2.11.0",
51+
"@tiptap/extension-mention": "2.11.0",
52+
"@tiptap/extension-placeholder": "2.11.0",
53+
"@tiptap/extension-task-item": "2.10.4",
54+
"@tiptap/extension-task-list": "2.11.0",
55+
"@tiptap/extension-text-align": "2.11.0",
56+
"@tiptap/extension-text-style": "2.11.0",
57+
"@tiptap/extension-underline": "2.11.0",
58+
"@tiptap/html": "2.11.0",
59+
"@tiptap/pm": "2.11.0",
60+
"@tiptap/react": "2.11.0",
61+
"@tiptap/starter-kit": "2.11.0",
62+
"@tiptap/suggestion": "2.11.0",
6363
"class-variance-authority": "^0.7.0",
6464
"highlight.js": "^11.8.0",
6565
"jsx-dom-cjs": "^8.0.3",
@@ -68,7 +68,6 @@
6868
"lucide-react": "^0.378.0",
6969
"prosemirror-codemark": "^0.4.2",
7070
"prosemirror-utils": "^1.2.2",
71-
"react-moveable": "^0.54.2",
7271
"smooth-scroll-into-view-if-needed": "^2.0.2",
7372
"tippy.js": "^6.3.7",
7473
"tiptap-markdown": "^0.8.9",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const CoreEditorExtensions = (args: TArguments): Extensions => {
5151
const { disabledExtensions, enableHistory, fileHandler, mentionHandler, placeholder, tabIndex } = args;
5252

5353
return [
54+
// @ts-expect-error tiptap types are incorrect
5455
StarterKit.configure({
5556
bulletList: {
5657
HTMLAttributes: {

packages/editor/src/core/extensions/read-only-extensions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const CoreReadOnlyEditorExtensions = (props: Props): Extensions => {
4242
const { disabledExtensions, fileHandler, mentionHandler } = props;
4343

4444
return [
45+
// @ts-expect-error tiptap types are incorrect
4546
StarterKit.configure({
4647
bulletList: {
4748
HTMLAttributes: {

packages/editor/src/core/helpers/editor-commands.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,51 @@ export const setText = (editor: Editor, range?: Range) => {
1313

1414
export const toggleHeadingOne = (editor: Editor, range?: Range) => {
1515
if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
16+
// @ts-expect-error tiptap types are incorrect
1617
else editor.chain().focus().toggleHeading({ level: 1 }).run();
1718
};
1819

1920
export const toggleHeadingTwo = (editor: Editor, range?: Range) => {
2021
if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
22+
// @ts-expect-error tiptap types are incorrect
2123
else editor.chain().focus().toggleHeading({ level: 2 }).run();
2224
};
2325

2426
export const toggleHeadingThree = (editor: Editor, range?: Range) => {
2527
if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
28+
// @ts-expect-error tiptap types are incorrect
2629
else editor.chain().focus().toggleHeading({ level: 3 }).run();
2730
};
2831

2932
export const toggleHeadingFour = (editor: Editor, range?: Range) => {
3033
if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 4 }).run();
34+
// @ts-expect-error tiptap types are incorrect
3135
else editor.chain().focus().toggleHeading({ level: 4 }).run();
3236
};
3337

3438
export const toggleHeadingFive = (editor: Editor, range?: Range) => {
3539
if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 5 }).run();
40+
// @ts-expect-error tiptap types are incorrect
3641
else editor.chain().focus().toggleHeading({ level: 5 }).run();
3742
};
3843

3944
export const toggleHeadingSix = (editor: Editor, range?: Range) => {
4045
if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 6 }).run();
46+
// @ts-expect-error tiptap types are incorrect
4147
else editor.chain().focus().toggleHeading({ level: 6 }).run();
4248
};
4349

4450
export const toggleBold = (editor: Editor, range?: Range) => {
51+
// @ts-expect-error tiptap types are incorrect
4552
if (range) editor.chain().focus().deleteRange(range).toggleBold().run();
53+
// @ts-expect-error tiptap types are incorrect
4654
else editor.chain().focus().toggleBold().run();
4755
};
4856

4957
export const toggleItalic = (editor: Editor, range?: Range) => {
58+
// @ts-expect-error tiptap types are incorrect
5059
if (range) editor.chain().focus().deleteRange(range).toggleItalic().run();
60+
// @ts-expect-error tiptap types are incorrect
5161
else editor.chain().focus().toggleItalic().run();
5262
};
5363

@@ -86,12 +96,16 @@ export const toggleCodeBlock = (editor: Editor, range?: Range) => {
8696
};
8797

8898
export const toggleOrderedList = (editor: Editor, range?: Range) => {
99+
// @ts-expect-error tiptap types are incorrect
89100
if (range) editor.chain().focus().deleteRange(range).toggleOrderedList().run();
101+
// @ts-expect-error tiptap types are incorrect
90102
else editor.chain().focus().toggleOrderedList().run();
91103
};
92104

93105
export const toggleBulletList = (editor: Editor, range?: Range) => {
106+
// @ts-expect-error tiptap types are incorrect
94107
if (range) editor.chain().focus().deleteRange(range).toggleBulletList().run();
108+
// @ts-expect-error tiptap types are incorrect
95109
else editor.chain().focus().toggleBulletList().run();
96110
};
97111

@@ -101,7 +115,9 @@ export const toggleTaskList = (editor: Editor, range?: Range) => {
101115
};
102116

103117
export const toggleStrike = (editor: Editor, range?: Range) => {
118+
// @ts-expect-error tiptap types are incorrect
104119
if (range) editor.chain().focus().deleteRange(range).toggleStrike().run();
120+
// @ts-expect-error tiptap types are incorrect
105121
else editor.chain().focus().toggleStrike().run();
106122
};
107123

packages/editor/src/core/helpers/yjs-utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import {
1212
const RICH_TEXT_EDITOR_EXTENSIONS = CoreEditorExtensionsWithoutProps;
1313
const DOCUMENT_EDITOR_EXTENSIONS = [...CoreEditorExtensionsWithoutProps, ...DocumentEditorExtensionsWithoutProps];
1414
// editor schemas
15+
// @ts-expect-error tiptap types are incorrect
1516
const richTextEditorSchema = getSchema(RICH_TEXT_EDITOR_EXTENSIONS);
17+
// @ts-expect-error tiptap types are incorrect
1618
const documentEditorSchema = getSchema(DOCUMENT_EDITOR_EXTENSIONS);
1719

1820
/**
@@ -54,6 +56,7 @@ export const convertBase64StringToBinaryData = (document: string): ArrayBuffer =
5456
*/
5557
export const getBinaryDataFromRichTextEditorHTMLString = (descriptionHTML: string): Uint8Array => {
5658
// convert HTML to JSON
59+
// @ts-expect-error tiptap types are incorrect
5760
const contentJSON = generateJSON(descriptionHTML ?? "<p></p>", RICH_TEXT_EDITOR_EXTENSIONS);
5861
// convert JSON to Y.Doc format
5962
const transformedData = prosemirrorJSONToYDoc(richTextEditorSchema, contentJSON, "default");
@@ -69,6 +72,7 @@ export const getBinaryDataFromRichTextEditorHTMLString = (descriptionHTML: strin
6972
*/
7073
export const getBinaryDataFromDocumentEditorHTMLString = (descriptionHTML: string): Uint8Array => {
7174
// convert HTML to JSON
75+
// @ts-expect-error tiptap types are incorrect
7276
const contentJSON = generateJSON(descriptionHTML ?? "<p></p>", DOCUMENT_EDITOR_EXTENSIONS);
7377
// convert JSON to Y.Doc format
7478
const transformedData = prosemirrorJSONToYDoc(documentEditorSchema, contentJSON, "default");
@@ -97,6 +101,7 @@ export const getAllDocumentFormatsFromRichTextEditorBinaryData = (
97101
const type = yDoc.getXmlFragment("default");
98102
const contentJSON = yXmlFragmentToProseMirrorRootNode(type, richTextEditorSchema).toJSON();
99103
// convert to HTML
104+
// @ts-expect-error tiptap types are incorrect
100105
const contentHTML = generateHTML(contentJSON, RICH_TEXT_EDITOR_EXTENSIONS);
101106

102107
return {
@@ -126,6 +131,7 @@ export const getAllDocumentFormatsFromDocumentEditorBinaryData = (
126131
const type = yDoc.getXmlFragment("default");
127132
const contentJSON = yXmlFragmentToProseMirrorRootNode(type, documentEditorSchema).toJSON();
128133
// convert to HTML
134+
// @ts-expect-error tiptap types are incorrect
129135
const contentHTML = generateHTML(contentJSON, DOCUMENT_EDITOR_EXTENSIONS);
130136

131137
return {
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import { ReactNode, useEffect, useRef, useState } from "react";
2+
import { observer } from "mobx-react";
3+
import { cn } from "@plane/utils";
4+
5+
interface IContentOverflowWrapper {
6+
children: ReactNode;
7+
maxHeight?: number;
8+
gradientColor?: string;
9+
buttonClassName?: string;
10+
containerClassName?: string;
11+
fallback?: ReactNode;
12+
}
13+
14+
export const ContentOverflowWrapper = observer((props: IContentOverflowWrapper) => {
15+
const {
16+
children,
17+
maxHeight = 625,
18+
buttonClassName = "text-sm font-medium text-custom-primary-100",
19+
containerClassName,
20+
fallback = null,
21+
} = props;
22+
23+
// states
24+
const [containerHeight, setContainerHeight] = useState(0);
25+
const [showAll, setShowAll] = useState(false);
26+
27+
// refs
28+
const contentRef = useRef<HTMLDivElement>(null);
29+
30+
useEffect(() => {
31+
if (!contentRef?.current) return;
32+
33+
const updateHeight = () => {
34+
if (contentRef.current) {
35+
const height = contentRef.current.getBoundingClientRect().height;
36+
setContainerHeight(height);
37+
}
38+
};
39+
40+
// Initial height measurement
41+
updateHeight();
42+
43+
// Create ResizeObserver for size changes
44+
const resizeObserver = new ResizeObserver(updateHeight);
45+
resizeObserver.observe(contentRef.current);
46+
47+
// Create MutationObserver for content changes
48+
const mutationObserver = new MutationObserver((mutations) => {
49+
const shouldUpdate = mutations.some(
50+
(mutation) =>
51+
mutation.type === "childList" ||
52+
(mutation.type === "attributes" && (mutation.attributeName === "style" || mutation.attributeName === "class"))
53+
);
54+
55+
if (shouldUpdate) {
56+
updateHeight();
57+
}
58+
});
59+
60+
mutationObserver.observe(contentRef.current, {
61+
childList: true,
62+
subtree: true,
63+
attributes: true,
64+
attributeFilter: ["style", "class"],
65+
});
66+
67+
return () => {
68+
resizeObserver.disconnect();
69+
mutationObserver.disconnect();
70+
};
71+
}, [contentRef?.current]);
72+
73+
if (!children) return fallback;
74+
75+
return (
76+
<div
77+
className={cn(
78+
"relative",
79+
{
80+
[`overflow-hidden`]: !showAll,
81+
"overflow-visible": showAll,
82+
},
83+
containerClassName
84+
)}
85+
style={{ maxHeight: showAll ? "100%" : `${maxHeight}px` }}
86+
>
87+
<div ref={contentRef}>{children}</div>
88+
89+
{containerHeight > maxHeight && (
90+
<div
91+
className={cn(
92+
"bottom-0 left-0 w-full",
93+
`bg-gradient-to-t from-custom-background-100 to-transparent flex flex-col items-center justify-end`,
94+
"text-center",
95+
{
96+
"absolute h-[100px]": !showAll,
97+
"h-[30px]": showAll,
98+
}
99+
)}
100+
>
101+
<button
102+
className={cn("gap-1 w-full text-custom-primary-100 text-sm font-medium", buttonClassName)}
103+
onClick={() => setShowAll((prev) => !prev)}
104+
>
105+
{showAll ? "Show less" : "Show all"}
106+
</button>
107+
</div>
108+
)}
109+
</div>
110+
);
111+
});

web/core/components/editor/sticky-editor/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface StickyEditorWrapperProps
2929
uploadFile: (file: File) => Promise<string>;
3030
parentClassName?: string;
3131
handleColorChange: (data: Partial<TSticky>) => Promise<void>;
32-
handleDelete: () => Promise<void>;
32+
handleDelete: () => void;
3333
}
3434

3535
export const StickyEditor = React.forwardRef<EditorRefApi, StickyEditorWrapperProps>((props, ref) => {

0 commit comments

Comments
 (0)