MCPcopy
hub / github.com/makeplane/plane / CoreEditorProps

Function CoreEditorProps

packages/editor/src/core/props.ts:17–49  ·  view source on GitHub ↗
(props: TArgs)

Source from the content-addressed store, hash-verified

15};
16
17export const CoreEditorProps = (props: TArgs): EditorProps => {
18 const { editorClassName } = props;
19
20 return {
21 attributes: {
22 class: cn(
23 "prose-brand prose-headings:font-display font-default max-w-full prose focus:outline-none",
24 editorClassName
25 ),
26 },
27 handleDOMEvents: {
28 keydown: (_view, event) => {
29 // prevent default event listeners from firing when slash command is active
30 if (["ArrowUp", "ArrowDown", "Enter"].includes(event.key)) {
31 const slashCommand = document.querySelector("#slash-command");
32 if (slashCommand) {
33 return true;
34 }
35 }
36 },
37 },
38 handlePaste: (view, event) => {
39 if (!event.clipboardData) return false;
40
41 const htmlContent = event.clipboardData.getData("text/plane-editor-html");
42 if (!htmlContent) return false;
43
44 const { processedHtml } = processAssetDuplication(htmlContent);
45 view.pasteHTML(processedHtml);
46 return true;
47 },
48 };
49};

Callers 1

useEditorFunction · 0.90

Calls 2

cnFunction · 0.90
processAssetDuplicationFunction · 0.90

Tested by

no test coverage detected