Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat: add centralized memo share management

tianma-ife59d48b78605
diff --git a/apps/api/src/share-routes.test.mjs b/apps/api/src/share-routes.test.mjs
index fa6af76f..ef00550c 100644
--- a/apps/api/src/share-routes.test.mjs
+++ b/apps/api/src/share-routes.test.mjs
@@ -335,6 +335,55 @@ const readCookieValue = (response, name) => {
return part ? part.trim().slice(prefix.length) : "";
};
+describe("memo share management", () => {
+ test("lists only live shares from the signed-in workspace without exposing passwords", async () => {
+ const { sqlite, environment } = createDatabaseEnvironment();
+ sqlite.query("INSERT INTO workspaces (id, name, is_personal) VALUES (?, ?, 1)").run("ws_other", "Other workspace");
+ sqlite.query("INSERT INTO notebooks (id, workspace_id, name) VALUES (?, ?, ?)").run("nb_other", "ws_other", "Private");
+ sqlite.query("INSERT INTO memos (id, workspace_id, notebook_id, title) VALUES (?, ?, ?, ?)").run("memo_other", "ws_other", "nb_other", "Other note");
+ sqlite.query("INSERT INTO memo_shares (id, memo_id, workspace_id, token) VALUES (?, ?, ?, ?)").run("share_other", "memo_other", "ws_other", "o".repeat(43));
+ sqlite.query("UPDATE memo_shares SET password_hash = ? WHERE memo_id = ?").run("private-hash", "memo_source");
+ sqlite.query("UPDATE memos SET is_deleted = 1 WHERE id = ?").run("memo_target");
+
+ const response = await createShareApp(environment).request("/api/v1/memo-shares", {}, environment);
+ expect(response.status).toBe(200);
+ expect(response.headers.get("Cache-Control")).toBe("private, no-store");
+ const body = await response.json();
+ expect(body.nextOffset).toBeNull();
+ expect(body.shares).toEqual([expect.objectContaining({
+ memoId: "memo_source",
+ memoTitle: "Source",
+ notebookId: "nb_member",
+ notebookName: "Inbox",
+ passwordProtected: true,
+ })]);
+ expect(JSON.stringify(body)).not.toContain("private-hash");
+ expect(JSON.stringify(body)).not.toContain("memo_other");
+ sqlite.close();
+ });
+
+ test("paginates shares and requires an interactive user session", async () => {
+ const { sqlite, environment } = createDatabaseEnvironment();
+ const app = createShareApp(environment);
+ const first = await app.request("/api/v1/memo-shares?limit=1", {}, environment);
+ expect(first.status).toBe(200);
+ const firstBody = await first.json();
+ expect(firstBody.shares).toHaveLength(1);
+ expect(firstBody.nextOffset).toBe(1);
+ const second = await app.request(`/api/v1/memo-shares?limit=1&offset=${firstBody.nextOffset}`, {}, environment);
+ const secondBody = await second.json();
+ expect(secondBody.shares).toHaveLength(1);
+ expect(secondBody.shares[0].memoId).not.toBe(firstBody.shares[0].memoId);
+ expect(secondBody.nextOffset).toBeNull();
+
+ const unauthenticated = new Hono();
+ registerMemoShareRoutes(unauthenticated);
+ const denied = await unauthenticated.request("/api/v1/memo-shares", {}, environment);
+ expect(denied.status).toBe(403);
+ sqlite.close();
+ });
+});
+
describe("password-protected memo shares", () => {
test("keeps existing shares public until a password is enabled", async () => {
const { sqlite, environment } = createDatabaseEnvironment();
diff --git a/apps/api/src/share-routes.ts b/apps/api/src/share-routes.ts
index ac439431..83a0202b 100644
--- a/apps/api/src/share-routes.ts
+++ b/apps/api/src/share-routes.ts
@@ -1,4 +1,4 @@
-import { accountNoteProseFromRow, collectMemoLinkIds, isPdfAttachment, MemoShareUpdateSchema, NoteBodyFontUpdateSchema, NoteProseUpdateSchema, parsePublishedNoteBodyFont, publicNoteProseFromAccount, PublicShareUnlockSchema, resolveMemoContentDoc, resolvePlayableMediaMimeType, sanitizeNoteProseCss, type AccountNoteProse, type MemoShare, type NoteProseAccountRow, type PublicMemoShare, type TiptapDoc } from "@edgeever/shared";
+import { accountNoteProseFromRow, collectMemoLinkIds, isPdfAttachment, MemoShareUpdateSchema, NoteBodyFontUpdateSchema, NoteProseUpdateSchema, parsePublishedNoteBodyFont, publicNoteProseFromAccount, PublicShareUnlockSchema, resolveMemoContentDoc, resolvePlayableMediaMimeType, sanitizeNoteProseCss, type AccountNoteProse, type ManagedMemoShare, type MemoShare, type NoteProseAccountRow, type PublicMemoShare, type TiptapDoc } from "@edgeever/shared";
import { zValidator } from "@hono/zod-validator";
import type { Hono } from "hono";
import { getCookie, setCookie } from "hono/cookie";
@@ -32,6 +32,11 @@ type MemoShareRow = {
updated_at: string;
password_hash: string | null;
};
+type ManagedMemoShareRow = MemoShareRow & {
+ title: string | null;
+ notebook_id: string;
+ notebook_name: string | null;
+};
type PublicMemoShareRow = {
workspace_id: string;
title: string | null;
@@ -296,6 +301,34 @@ export const registerPublicShareRoutes = (app: Hono<AppEnv>) => {
};
export const registerMemoShareRoutes = (app: Hono<AppEnv>) => {
+ app.get("/api/v1/memo-shares", async (c) => {
+ const denied = requireUser(c);
+ if (denied) return denied;
+
+ const parsedLimit = Number(c.req.query("limit") ?? 50);
+ const parsedOffset = Number(c.req.query("offset") ?? 0);
+ const limit = Number.isSafeInteger(parsedLimit) ? Math.min(100, Math.max(1, parsedLimit)) : 50;
+ const offset = Number.isSafeInteger(parsedOffset) ? Math.min(1_000_000, Math.max(0, parsedOffset)) : 0;
+ const rows = await c.env.storage.db.prepare(
+ `SELECT ms.memo_id, ms.token, ms.created_at, ms.updated_at, ms.password_hash,
+ m.title, m.notebook_id, n.name AS notebook_name
+ FROM memo_shares ms
+ INNER JOIN memos m ON m.id = ms.memo_id AND m.workspace_id = ms.workspace_id
+ LEFT JOIN notebooks n ON n.id = m.notebook_id AND n.workspace_id = m.workspace_id
+ WHERE ms.workspace_id = ? AND m.is_deleted = 0
+ ORDER BY ms.updated_at DESC, ms.id DESC
+ LIMIT ? OFFSET ?`
+ ).bind(getWorkspaceId(c), limit + 1, offset).all<ManagedMemoShareRow>();
+ const shares: ManagedMemoShare[] = rows.results.slice(0, limit).map((row) => ({
+ ...mapMemoShare(row),
+ memoTitle: row.title,
+ notebookId: row.notebook_id,
+ notebookName: row.notebook_name,
+ }));
+ c.header("Cache-Control", "private, no-store");
+ return c.json({ shares, nextOffset: rows.results.length > limit ? offset + limit : null });
+ });
+
app.put("/api/v1/me/note-body-font", zValidator("json", NoteBodyFontUpdateSchema), async (c) => {
const denied = requireUser(c);
if (denied) return denied;
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 680f3e1b..405679f0 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -7,6 +7,7 @@ import {
Keyboard,
KeyRound,
LayoutTemplate,
+ Share2,
Shield,
SlidersHorizontal,
Sparkles,
@@ -14,8 +15,9 @@ import {
Users,
Wrench,
} from "lucide-react";
-import { useState, type ReactNode } from "react";
+import type { ReactNode } from "react";
import { useTranslation } from "react-i18next";
+import { useSearchParams } from "react-router";
import * as m from "motion/react-m";
import { Button } from "@/components/ui/button";
@@ -28,6 +30,7 @@ import { AccountInfoCard } from "./settings/AccountInfoCard";
import { DataExportCard } from "./settings/DataExportCard";
import { DesktopLocalDataCard } from "./settings/DesktopLocalDataCard";
import { LoginDevicesCard } from "./settings/LoginDevicesCard";
+import { ShareManagementCard } from "./settings/ShareManagementCard";
import { EvernoteImportGuideCard } from "./settings/EvernoteImportGuideCard";
import { FeedbackLink } from "./settings/FeedbackLink";
import { SystemInfoPanel } from "./settings/SystemInfoPanel";
@@ -66,6 +69,7 @@ interface SettingsPaneProps {
user: AuthUser | null;
refreshWorkspaceAfterImport: () => Promise<void>;
onOpenExecutionCenter: () => void;
+ onOpenMemo: (memoId: string, notebookId: string) => void;
}
// Slate and brand color variables already switch values with the root theme.
@@ -75,7 +79,7 @@ const SettingsGroup = ({ children }: { children: ReactNode }) => (
</div>
);
-type TabKey = "general" | "shortcuts" | "users" | "data" | "ai" | "mcp" | "speech" | "advanced" | "account" | "system";
+type TabKey = "general" | "shortcuts" | "users" | "data" | "ai" | "mcp" | "speech" | "sharing" | "advanced" | "account" | "system";
interface TabItem {
key: TabKey;
@@ -104,10 +108,12 @@ export const SettingsPane = ({
user,
refreshWorkspaceAfterImport,
onOpenExecutionCenter,
+ onOpenMemo,
}: SettingsPaneProps) => {
const { t } = useTranslation();
- const [activeTab, setActiveTab] = useState<TabKey>("general");
- const [activeMobileTab, setActiveMobileTab] = useState<TabKey | null>(null);
+ const [searchParams, setSearchParams] = useSearchParams();
+ const requestedTab = searchParams.get("tab");
+ const selectTab = (tab: TabKey | null) => setSearchParams(tab ? { tab } : {}, { replace: true });
const { unseen: deployedUpdateUnseen } = useDeployedUpdateNotice();
const canClearLocalData = Boolean(window.edgeeverDesktop?.canClearLocalData);
@@ -142,6 +148,11 @@ export const SettingsPane = ({
label: t("settings.tabs.data"),
icon: Database,
},
+ {
+ key: "sharing",
+ label: t("sharing.managementTitle"),
+ icon: Share2,
+ },
...(isOwner
? [
{
@@ -172,11 +183,15 @@ export const SettingsPane = ({
},
];
+ const selectedTab = tabItems.find((item) => item.key === requestedTab)?.key ?? null;
+ const activeTab = selectedTab ?? "general";
+ const activeMobileTab = selectedTab;
+
const mobileTabItems = tabItems.filter((item) => item.key !== "shortcuts");
const handleBack = () => {
- if (activeMobileTab !== null) {
- setActiveMobileTab(null);
+ if (window.matchMedia("(max-width: 1023px)").matches && activeMobileTab !== null) {
+ selectTab(null);
} else {
onClose();
}
@@ -236,6 +251,8 @@ export const SettingsPane = ({
<EvernoteImportGuideCard />
</SettingsGroup>
);
+ case "sharing":
+ return <ShareManagementCard userId={user?.id ?? null} onOpenMemo={onOpenMemo} />;
case "ai":
return (
<SettingsGroup>
@@ -322,7 +339,7 @@ export const SettingsPane = ({
<button
key={item.key}
type="button"
- onClick={() => setActiveTab(item.key)}
+ onClick={() => selectTab(item.key)}
className={cn(
"flex items-center gap-3 px-3.5 py-2.5 rounded-xl text-xs leading-5 transition-all duration-150 text-left w-full",
isSelected
@@ -400,7 +417,7 @@ export const SettingsPane = ({
<button
key={item.key}
type="button"
- onClick={() => setActiveMobileTab(item.key)}
+ onClick={() => selectTab(item.key)}
className="flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-slate-50/50"
>
<div className="flex items-center gap-3">
diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsx
index 275a163b..4a91672e 100644
--- a/apps/web/src/components/WorkspaceApp.tsx
+++ b/apps/web/src/components/WorkspaceApp.tsx
@@ -3290,7 +3290,8 @@ export const WorkspaceApp = ({
onOpenExecutionCenter={handleOpenExecutionCenter}
onClose={handleCloseSettings}
onOpenTemplates={handleOpenTemplates}
- onOpenAiPrompts={handleOpenAiPrompts}
+ onOpenAiPrompts={handleOpenAiPrompts}
+ onOpenMemo={handleOpenPluginNote}
imageCompressionEnabled={imageCompressionEnabled}
onImageCompressionChange={setImageCompressionEnabled}
shortcutSettings={shortcutSettings}
diff --git a/apps/web/src/components/dialogs/ShareMemoDialog.tsx b/apps/web/src/components/dialogs/ShareMemoDialog.tsx
index da34eea1..f748dad3 100644
--- a/apps/web/src/components/dialogs/ShareMemoDialog.tsx
+++ b/apps/web/src/components/dialogs/ShareMemoDialog.tsx
@@ -2,6 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { Check, Copy, ExternalLink, Link2, LoaderCircle, RefreshCw, Share2, Trash2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
+import { useLocation, useNavigate } from "react-router";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
@@ -9,7 +10,7 @@ import { Switch } from "@/components/ui/switch";
import { api, getConfiguredDesktopApiBaseUrl } from "@/lib/api";
import { copyTextToClipboard } from "@/lib/clipboard";
-const getPublicShareUrl = (token: string) => {
+export const getPublicShareUrl = (token: string) => {
const baseUrl = getConfiguredDesktopApiBaseUrl() || window.location.origin;
return `${baseUrl.replace(/\/$/, "")}/share/${encodeURIComponent(token)}`;
};
@@ -55,6 +56,8 @@ export const ShareMemoDialog = ({
onOpenChange: (open: boolean) => void;
}) => {
const { t } = useTranslation();
+ const navigate = useNavigate();
+ const location = useLocation();
const queryClient = useQueryClient();
const [copyState, setCopyState] = useState<"idle" | "copied" | "error">("idle");
const [copyTarget, setCopyTarget] = useState<"link" | "password" | "both">("link");
@@ -69,12 +72,16 @@ export const ShareMemoDialog = ({
});
const createMutation = useMutation({
mutationFn: () => api.createMemoShare(memoId),
- onSuccess: (data) => queryClient.setQueryData(queryKey, data),
+ onSuccess: (data) => {
+ queryClient.setQueryData(queryKey, data);
+ void queryClient.invalidateQueries({ queryKey: ["memo-shares"] });
+ },
});
const passwordMutation = useMutation({
mutationFn: (passwordProtected: boolean) => api.updateMemoShare(memoId, { passwordProtected }),
onSuccess: (data) => {
queryClient.setQueryData(queryKey, { share: { ...data.share, password: undefined } });
+ void queryClient.invalidateQueries({ queryKey: ["memo-shares"] });
if (data.share.password) {
writeStoredSharePassword(memoId, data.share.token, data.share.password);
setRevealedPassword(data.share.password);
@@ -90,6 +97,7 @@ export const ShareMemoDialog = ({
clearStoredSharePassword(memoId);
setRevealedPassword("");
queryClient.setQueryData(queryKey, { share: null });
+ void queryClient.invalidateQueries({ queryKey: ["memo-shares"] });
},
});
useEffect(() => {
@@ -249,6 +257,13 @@ export const ShareMemoDialog = ({
)}
{error ? <p className="text-xs leading-5 text-rose-600" role="alert">{t("sharing.error")}</p> : null}
</div>
+ {location.pathname !== "/settings" ? (
+ <div className="border-t border-slate-200 px-5 py-3">
+ <Button variant="ghost" className="w-full" onClick={() => navigate("/settings?tab=sharing")}>
+ {t("sharing.viewAll")}
+ </Button>
+ </div>
+ ) : null}
</DialogContent>
</Dialog>
);
diff --git a/apps/web/src/components/settings/ShareManagementCard.tsx b/apps/web/src/components/settings/ShareManagementCard.tsx
new file mode 100644
index 00000000..cc016ce2
--- /dev/null
+++ b/apps/web/src/components/settings/ShareManagementCard.tsx
@@ -0,0 +1,120 @@
+import { useInfiniteQuery } from "@tanstack/react-query";
+import { Copy, ExternalLink, Link2, LoaderCircle, LockKeyhole, Settings2 } from "lucide-react";
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
+import type { ManagedMemoShare } from "@edgeever/shared";
+import { Button } from "@/components/ui/button";
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
+import { getPublicShareUrl, ShareMemoDialog } from "@/components/dialogs/ShareMemoDialog";
+import { api, getConfiguredDesktopApiBaseUrl } from "@/lib/api";
+import { copyTextToClipboard } from "@/lib/clipboard";
+import {
+ SETTINGS_CARD_DESCRIPTION_CLASSNAME,
+ SETTINGS_CARD_HEADER_CLASSNAME,
+ SETTINGS_CARD_ICON_CLASSNAME,
+ SETTINGS_CARD_TITLE_CLASSNAME,
+} from "./settings-ui";
+
+type Props = {
+ userId: string | null;
+ onOpenMemo: (memoId: string, notebookId: string) => void;
+};
+
+export const ShareManagementCard = ({ userId, onOpenMemo }: Props) => {
+ const { t, i18n } = useTranslation();
+ const [managedMemoId, setManagedMemoId] = useState<string | null>(null);
+ const [copyResult, setCopyResult] = useState<{ memoId: string; success: boolean } | null>(null);
+ const origin = getConfiguredDesktopApiBaseUrl() || window.location.origin;
+ const sharesQuery = useInfiniteQuery({
+ queryKey: ["memo-shares", origin, userId],
+ queryFn: ({ pageParam }) => api.listMemoShares(pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (page) => page.nextOffset ?? undefined,
+ retry: false,
+ refetchOnMount: "always",
+ });
+ const shares = sharesQuery.data?.pages.flatMap((page) => page.shares) ?? [];
+ const locale = i18n.resolvedLanguage || i18n.language;
+ const formatDate = (value: string) => new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(new Date(value));
+ const copyLink = async (share: ManagedMemoShare) => {
+ setCopyResult({ memoId: share.memoId, success: await copyTextToClipboard(getPublicShareUrl(share.token)) });
+ };
+
+ return (
+ <Card className="w-full min-w-0 overflow-hidden shadow-none">
+ <CardHeader className={SETTINGS_CARD_HEADER_CLASSNAME}>
+ <CardTitle className={SETTINGS_CARD_TITLE_CLASSNAME}>
+ <Link2 className={SETTINGS_CARD_ICON_CLASSNAME} />
+ {t("sharing.managementTitle")}
+ </CardTitle>
+ <CardDescription className={SETTINGS_CARD_DESCRIPTION_CLASSNAME}>
+ {t("sharing.managementDescription")}
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="p-0">
+ {sharesQuery.isPending || (sharesQuery.isFetching && !sharesQuery.isFetchingNextPage) ? (
+ <div className="flex min-h-32 items-center justify-center text-slate-500" role="status">
+ <LoaderCircle className="h-5 w-5 animate-spin" />
+ <span className="sr-only">{t("sharing.managementLoading")}</span>
+ </div>
+ ) : sharesQuery.isError ? (
+ <div className="space-y-3 border-t border-slate-100 p-4">
+ <p className="text-xs leading-5 text-rose-600" role="alert">{t("sharing.managementLoadFailed")}</p>
+ <Button size="sm" variant="outline" onClick={() => void sharesQuery.refetch()}>{t("sharing.retry")}</Button>
+ </div>
+ ) : shares.length === 0 ? (
+ <p className="border-t border-slate-100 p-4 text-xs leading-5 text-slate-500">{t("sharing.managementEmpty")}</p>
+ ) : (
+ <div className="divide-y divide-slate-100 border-t border-slate-100">
+ {shares.map((share) => (
+ <div key={share.memoId} className="flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between">
+ <div className="min-w-0">
+ <button
+ type="button"
+ className="block max-w-full truncate text-left text-xs font-medium text-slate-900 hover:text-emerald-700 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500"
+ onClick={() => onOpenMemo(share.memoId, share.notebookId)}
+ >
+ {share.memoTitle?.trim() || t("common.untitledMemo")}
+ </button>
+ <p className="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-slate-500">
+ <span>{share.notebookName || t("sharing.unknownNotebook")}</span>
+ <span aria-hidden="true">·</span>
+ <span>{t("sharing.sharedOn", { date: formatDate(share.createdAt) })}</span>
+ {share.passwordProtected ? (
+ <span className="inline-flex items-center gap-1 text-slate-600">
+ <LockKeyhole className="h-3 w-3" />{t("sharing.passwordProtected")}
+ </span>
+ ) : null}
+ </p>
+ </div>
+ <div className="flex shrink-0 flex-wrap gap-2">
+ <Button size="sm" variant="outline" onClick={() => void copyLink(share)}>
+ <Copy className="h-3.5 w-3.5" />
+ {copyResult?.memoId === share.memoId ? t(copyResult.success ? "sharing.copied" : "sharing.copyFailed") : t("sharing.copy")}
+ </Button>
+ <Button size="sm" variant="outline" onClick={() => window.open(getPublicShareUrl(share.token), "_blank", "noopener,noreferrer")}>
+ <ExternalLink className="h-3.5 w-3.5" />{t("sharing.open")}
+ </Button>
+ <Button size="sm" variant="soft" onClick={() => setManagedMemoId(share.memoId)}>
+ <Settings2 className="h-3.5 w-3.5" />{t("sharing.manage")}
+ </Button>
+ </div>
+ </div>
+ ))}
+ {sharesQuery.hasNextPage ? (
+ <div className="flex justify-center p-4">
+ <Button size="sm" variant="outline" disabled={sharesQuery.isFetchingNextPage} onClick={() => void sharesQuery.fetchNextPage()}>
+ {sharesQuery.isFetchingNextPage ? <LoaderCircle className="h-3.5 w-3.5 animate-spin" /> : null}
+ {t("sharing.loadMore")}
+ </Button>
+ </div>
+ ) : null}
+ </div>
+ )}
+ </CardContent>
+ {managedMemoId ? (
+ <ShareMemoDialog memoId={managedMemoId} open onOpenChange={(open) => { if (!open) setManagedMemoId(null); }} />
+ ) : null}
+ </Card>
+ );
+};
diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts
index e961520e..a4501e78 100644
--- a/packages/client/src/index.ts
+++ b/packages/client/src/index.ts
@@ -34,6 +34,7 @@ import type {
MemoRevision,
MemoSummary,
MemoShare,
+ ManagedMemoShare,
PublicTableForm,
TableFormSettings,
TableFormUpdateInput,
@@ -253,6 +254,11 @@ export type MemoShareResponse = {
share: MemoShare | null;
};
+export type ListMemoSharesResponse = {
+ shares: ManagedMemoShare[];
+ nextOffset: number | null;
+};
+
export type PublicMemoShareResponse = {
share: PublicMemoShare;
};
@@ -1592,6 +1598,9 @@ export const createEdgeEverClient = (options: EdgeEverClientOptions = {}) => {
getMemoShare: (memoId: string) =>
request<MemoShareResponse>(`/api/v1/memos/${memoId}/share`),
+ listMemoShares: (offset = 0, limit = 50) =>
+ request<ListMemoSharesResponse>(`/api/v1/memo-shares?offset=${offset}&limit=${limit}`),
+
createMemoShare: (memoId: string) =>
request<{ share: MemoShare }>(`/api/v1/memos/${memoId}/share`, {
method: "POST",
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 2f1f55be..f974e714 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -2289,6 +2289,17 @@ export const enUS = {
expandOutlineHeading: "Expand {{name}}",
},
sharing: {
+ managementTitle: "Share management",
+ managementDescription: "See notes currently accessible through public links and manage each share.",
+ managementLoading: "Loading shared notes",
+ managementLoadFailed: "Could not load the latest shares. Check your connection and try again.",
+ managementEmpty: "No notes are currently shared.",
+ viewAll: "View all shares",
+ retry: "Retry",
+ loadMore: "Load more",
+ sharedOn: "Shared {{date}}",
+ passwordProtected: "Password protected",
+ unknownNotebook: "Unknown notebook",
action: "Share note",
afterSync: "Share note after sync",
active: "Shared",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index ce0d0491..90707877 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -2289,6 +2289,17 @@ export const ja = {
expandOutlineHeading: "{{name}} を開く",
},
sharing: {
+ managementTitle: "共有の管理",
+ managementDescription: "公開リンクでアクセスできるノートを確認し、共有設定を管理します。",
+ managementLoading: "共有ノートを読み込み中",
+ managementLoadFailed: "最新の共有一覧を読み込めませんでした。接続を確認して再試行してください。",
+ managementEmpty: "現在共有中のノートはありません。",
+ viewAll: "すべての共有を見る",
+ retry: "再試行",
+ loadMore: "さらに読み込む",
+ sharedOn: "共有日 {{date}}",
+ passwordProtected: "パスワード保護あり",
+ unknownNotebook: "不明なノートブック",
action: "ノートを共有",
afterSync: "同期後にノートを共有",
active: "共有中",
diff --git a/packages/shared/src/i18n/pl.ts b/packages/shared/src/i18n/pl.ts
index eb850181..e98624dc 100644
--- a/packages/shared/src/i18n/pl.ts
+++ b/packages/shared/src/i18n/pl.ts
@@ -2289,6 +2289,17 @@ export const pl = {
expandOutlineHeading: "Rozwiń {{name}}",
},
sharing: {
+ managementTitle: "Zarządzanie udostępnianiem",
+ managementDescription: "Zobacz notatki dostępne przez publiczne linki i zarządzaj ich udostępnianiem.",
+ managementLoading: "Wczytywanie udostępnionych notatek",
+ managementLoadFailed: "Nie udało się pobrać aktualnej listy. Sprawdź połączenie i spróbuj ponownie.",
+ managementEmpty: "Żadna notatka nie jest obecnie udostępniana.",
+ viewAll: "Zobacz wszystkie udostępnienia",
+ retry: "Spróbuj ponownie",
+ loadMore: "Wczytaj więcej",
+ sharedOn: "Udostępniono {{date}}",
+ passwordProtected: "Chroniona hasłem",
+ unknownNotebook: "Nieznany notatnik",
action: "Udostępnij notatkę",
afterSync: "Udostępnij notatkę po synchronizacji",
active: "Udostępniona",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 314cc438..f36708d0 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -2287,6 +2287,17 @@ export const zhCN = {
expandOutlineHeading: "展开 {{name}}",
},
sharing: {
+ managementTitle: "分享管理",
+ managementDescription: "查看当前仍可通过公开链接访问的笔记,并管理各自的分享设置。",
+ managementLoading: "正在读取分享列表",
+ managementLoadFailed: "无法获取最新分享列表,请检查网络后重试。",
+ managementEmpty: "当前没有正在分享的笔记。",
+ viewAll: "查看全部分享",
+ retry: "重试",
+ loadMore: "加载更多",
+ sharedOn: "分享于 {{date}}",
+ passwordProtected: "已设密码",
+ unknownNotebook: "未知笔记本",
action: "分享笔记",
afterSync: "同步后可分享笔记",
active: "正在分享",
diff --git a/packages/shared/src/sharing.ts b/packages/shared/src/sharing.ts
index 20d163aa..e0a857fe 100644
--- a/packages/shared/src/sharing.ts
+++ b/packages/shared/src/sharing.ts
@@ -12,6 +12,12 @@ export type MemoShare = {
password?: string;
};
+export type ManagedMemoShare = MemoShare & {
+ memoTitle: string | null;
+ notebookId: string;
+ notebookName: string | null;
+};
+
export const PUBLISHED_NOTE_BODY_FONTS = [
"wenkai",
"wenkai-screen",