- {tpl.spaceId
- ? spaceNamesById.get(tpl.spaceId) ?? t("Space")
- : t("Global")}
-
+
+
handlePick(tpl)}
+ >
+
+ {tpl.icon ? (
+ {tpl.icon}
+ ) : (
+
+ )}
+
+ {tpl.title}
+
+ {tpl.spaceId
+ ? spaceNamesById.get(tpl.spaceId) ?? t("Space")
+ : t("Global")}
+
+
-
+
))
)}
diff --git a/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx b/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx
index 69f7db1e..9dd32687 100644
--- a/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx
+++ b/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx
@@ -8,8 +8,12 @@ import { useBaseQuery } from "@/ee/base/queries/base-query";
import { pinOffsetWatcher } from "@docmost/editor-ext";
import { useHasFeature } from "@/ee/hooks/use-feature";
import { Feature } from "@/ee/features";
-import { IconDots, IconTable, IconX } from "@tabler/icons-react";
+import { IconDots, IconLink, IconTable, IconX } from "@tabler/icons-react";
+import { notifications } from "@mantine/notifications";
import { usePageQuery } from "@/features/page/queries/page-query";
+import { useClipboard } from "@/hooks/use-clipboard";
+import { getAppUrl } from "@/lib/config.ts";
+import { buildPageUrl } from "@/features/page/page.utils.ts";
import classes from "./base-embed.module.css";
const SIDE_GUTTER = 8;
@@ -63,6 +67,14 @@ export function BaseEmbedView({ node, editor, deleteNode }: NodeViewProps) {
pendingKey ? "" : pageId ?? "",
);
const { data: page } = usePageQuery({ pageId: pageId ?? undefined });
+ const clipboard = useClipboard({ timeout: 500 });
+
+ const handleCopyLink = () => {
+ clipboard.copy(
+ getAppUrl() + buildPageUrl(page.space?.slug, page.slugId, page.title),
+ );
+ notifications.show({ message: t("Link copied") });
+ };
useEffect(() => {
const wrapper = wrapperRef.current;
@@ -98,7 +110,8 @@ export function BaseEmbedView({ node, editor, deleteNode }: NodeViewProps) {
// mounts) is reserved only for the skeleton/loading/table states.
const isCompact = !pendingKey && (!pageId || isError);
- const showControls = editor.isEditable && !pendingKey;
+ // Also on the skeleton, so a placeholder stuck pending can still be removed.
+ const showControls = editor.isEditable;
let content: React.ReactNode;
if (pendingKey) {
@@ -159,6 +172,13 @@ export function BaseEmbedView({ node, editor, deleteNode }: NodeViewProps) {