Skip to content

Commit 8733acb

Browse files
fix: props
1 parent b011100 commit 8733acb

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

packages/editor/src/core/components/menus/block-menu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type { Editor } from "@tiptap/react";
1212
import type { LucideIcon } from "lucide-react";
1313
import { Copy, Trash2 } from "lucide-react";
1414
import { useCallback, useEffect, useRef, useState } from "react";
15+
import type { ISvgIcons } from "@plane/propel/icons";
1516
import { cn } from "@plane/utils";
1617
// constants
1718
import { CORE_EXTENSIONS } from "@/constants/extension";
@@ -27,7 +28,7 @@ type Props = {
2728
workItemIdentifier?: IEditorProps["workItemIdentifier"];
2829
};
2930
export type BlockMenuOption = {
30-
icon: LucideIcon;
31+
icon: LucideIcon | React.FC<ISvgIcons>;
3132
key: string;
3233
label: string;
3334
onClick: (e: React.MouseEvent) => void;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const CoreEditorExtensions = (args: TArguments): Extensions => {
115115
CustomCalloutExtension,
116116
UtilityExtension({
117117
disabledExtensions,
118+
flaggedExtensions,
118119
fileHandler,
119120
getEditorMetaData,
120121
isEditable: editable,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export type UtilityExtensionStorage = {
5151
isTouchDevice: boolean;
5252
};
5353

54-
type Props = Pick<IEditorProps, "disabledExtensions" | "getEditorMetaData"> & {
54+
type Props = Pick<IEditorProps, "disabledExtensions" | "flaggedExtensions" | "getEditorMetaData"> & {
5555
fileHandler: TFileHandler;
5656
isEditable: boolean;
5757
isTouchDevice: boolean;
5858
};
5959

6060
export const UtilityExtension = (props: Props) => {
61-
const { disabledExtensions, fileHandler, getEditorMetaData, isEditable, isTouchDevice } = props;
61+
const { disabledExtensions, flaggedExtensions, fileHandler, getEditorMetaData, isEditable, isTouchDevice } = props;
6262
const { restore } = fileHandler;
6363

6464
return Extension.create<Record<string, unknown>, UtilityExtensionStorage>({
@@ -79,6 +79,7 @@ export const UtilityExtension = (props: Props) => {
7979
}),
8080
DropHandlerPlugin({
8181
disabledExtensions,
82+
flaggedExtensions,
8283
editor: this.editor,
8384
}),
8485
PasteAssetPlugin(),

packages/editor/src/core/plugins/drop.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import type { TEditorCommands, TExtensions } from "@/types";
77

88
type Props = {
99
disabledExtensions?: TExtensions[];
10+
flaggedExtensions?: TExtensions[];
1011
editor: Editor;
1112
};
1213

1314
export const DropHandlerPlugin = (props: Props): Plugin => {
14-
const { disabledExtensions, editor } = props;
15+
const { disabledExtensions, flaggedExtensions, editor } = props;
1516

1617
return new Plugin({
1718
key: new PluginKey("drop-handler-plugin"),
@@ -33,6 +34,7 @@ export const DropHandlerPlugin = (props: Props): Plugin => {
3334
const pos = view.state.selection.from;
3435
insertFilesSafely({
3536
disabledExtensions,
37+
flaggedExtensions,
3638
editor,
3739
files: acceptedFiles,
3840
initialPos: pos,
@@ -84,6 +86,7 @@ export const DropHandlerPlugin = (props: Props): Plugin => {
8486

8587
type InsertFilesSafelyArgs = {
8688
disabledExtensions?: TExtensions[];
89+
flaggedExtensions?: TExtensions[];
8790
editor: Editor;
8891
event: "insert" | "drop";
8992
files: File[];

0 commit comments

Comments
 (0)