From 8f94ee3a6f90a0651b6128c6a56bd9308d1fd1a4 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:45:37 -0500 Subject: [PATCH] remove markdown element from menu until fixed. Added copy link & open in new tab options in embedded element URL --- src/App.tsx | 4 +- src/routes/Board.tsx | 4 +- src/shapes/EmbedShapeUtil.tsx | 123 ++++++++++++++++++++++------------ src/ui/CustomContextMenu.tsx | 4 +- src/ui/overrides.tsx | 16 ++--- 5 files changed, 94 insertions(+), 57 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f083919..c219f0e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -28,9 +28,9 @@ const customShapeUtils = [ ChatBoxShape, VideoChatShape, EmbedShape, - MarkdownShape, + //MarkdownShape, ] -const customTools = [ChatBoxTool, VideoChatTool, EmbedTool, MarkdownTool] +const customTools = [ChatBoxTool, VideoChatTool, EmbedTool] //, MarkdownTool] const callObject = Daily.createCallObject() diff --git a/src/routes/Board.tsx b/src/routes/Board.tsx index 503e42d..10049c6 100644 --- a/src/routes/Board.tsx +++ b/src/routes/Board.tsx @@ -21,8 +21,8 @@ import { handleInitialPageLoad } from "@/utils/handleInitialPageLoad" // Default to production URL if env var isn't available export const WORKER_URL = "https://jeffemmett-canvas.jeffemmett.workers.dev" -const shapeUtils = [ChatBoxShape, VideoChatShape, EmbedShape, MarkdownShape] -const tools = [ChatBoxTool, VideoChatTool, EmbedTool, MarkdownTool] // Array of tools +const shapeUtils = [ChatBoxShape, VideoChatShape, EmbedShape] //, MarkdownShape] +const tools = [ChatBoxTool, VideoChatTool, EmbedTool] //, MarkdownTool] export function Board() { const { slug } = useParams<{ slug: string }>() diff --git a/src/shapes/EmbedShapeUtil.tsx b/src/shapes/EmbedShapeUtil.tsx index ca1c7d2..14cc4cf 100644 --- a/src/shapes/EmbedShapeUtil.tsx +++ b/src/shapes/EmbedShapeUtil.tsx @@ -96,6 +96,7 @@ export class EmbedShape extends BaseBoxShapeUtil { component(shape: IEmbedShape) { const [inputUrl, setInputUrl] = useState(shape.props.url || "") const [error, setError] = useState("") + const [copyStatus, setCopyStatus] = useState(false) const handleSubmit = useCallback( (e: React.FormEvent) => { @@ -220,7 +221,7 @@ export class EmbedShape extends BaseBoxShapeUtil {