diff --git a/apps/roam/src/components/canvas/CanvasEmbed.tsx b/apps/roam/src/components/canvas/CanvasEmbed.tsx index f5b08f02b..c66c9662b 100644 --- a/apps/roam/src/components/canvas/CanvasEmbed.tsx +++ b/apps/roam/src/components/canvas/CanvasEmbed.tsx @@ -1,8 +1,11 @@ import React from "react"; +import { Button } from "@blueprintjs/core"; +import posthog from "posthog-js"; import ExtensionApiContextProvider from "roamjs-components/components/ExtensionApiContext"; import { OnloadArgs } from "roamjs-components/types"; import renderWithUnmount from "roamjs-components/util/renderWithUnmount"; import getBlockUidFromTarget from "roamjs-components/dom/getBlockUidFromTarget"; +import getUids from "roamjs-components/dom/getUids"; import getTextByBlockUid from "roamjs-components/queries/getTextByBlockUid"; import getPageUidByPageTitle from "roamjs-components/queries/getPageUidByPageTitle"; import { TldrawCanvas } from "./Tldraw"; @@ -28,6 +31,36 @@ const CanvasEmbedPlaceholder = ({ message }: { message: string }) => ( ); +const handleEditBlock = (location: { blockUid: string; windowId: string }) => { + posthog.capture("Canvas Embed: Edit Block Clicked"); + void window.roamAlphaAPI.ui.setBlockFocusAndSelection({ + location: { + "block-uid": location.blockUid, + "window-id": location.windowId, + }, + }); +}; + +const CanvasEmbedChrome = ({ + title, + location, +}: { + title: string; + location: { blockUid: string; windowId: string }; +}) => ( +