fix(editor): refine body color palettes

This commit is contained in:
tianma-if committed 2026-09-30 23:17:21 +08:00
1 parent 146637d60e
commit c97bb7f0ff
5 files changed
+7 -18

No files matched your search

-1
View File
@@ -790,7 +790,6 @@ export const enUS = {
teal: "Teal",
azure: "Blue",
violet: "Purple",
plum: "Wine",
pink: "Pink",
slate: "Gray",
},
-1
View File
@@ -790,7 +790,6 @@ export const ja = {
teal: "青緑",
azure: "青",
violet: "紫",
plum: "ワイン",
pink: "ピンク",
slate: "グレー",
},
-1
View File
@@ -790,7 +790,6 @@ export const zhCN = {
teal: "青色",
azure: "蓝色",
violet: "紫色",
plum: "酒红",
pink: "粉色",
slate: "灰色",
},
+4
View File
@@ -31,6 +31,10 @@ describe("note prose", () => {
expect(paletteForLegacyEditorTheme("wechat-green")).toBeNull();
expect(paletteForLegacyEditorTheme("modern-mint")).toBeNull();
expect(parseNoteProsePalette("emerald")).toBe("native");
expect(parseNoteProsePalette("green")).toBe("native");
expect(NoteProseUpdateSchema.safeParse({ palette: "green" }).success).toBe(false);
expect(parseNoteProsePalette("plum")).toBe("native");
expect(NoteProseUpdateSchema.safeParse({ palette: "plum" }).success).toBe(false);
expect(resolveNoteProse({ palette: "emerald" }).palette).toBe("native");
expect(paletteForLegacyEditorTheme("brief")).toBe("teal");
expect(paletteForLegacyEditorTheme("zen")).toBe("teal");
+3 -15
View File
@@ -13,7 +13,6 @@ export const NOTE_PROSE_PALETTE_IDS = [
"teal",
"azure",
"violet",
"plum",
"pink",
"slate",
] as const;
@@ -166,7 +165,7 @@ export const NOTE_PROSE_PALETTES: Record<NoteProsePaletteId, NoteProsePaletteCol
background: "#FFFFFF",
}),
violet: palette({
accent: "#7567F8",
accent: "#656FE6",
text: "#3F3F46",
muted: "#3F3F46",
surface: "#F4F4F5",
@@ -176,17 +175,6 @@ export const NOTE_PROSE_PALETTES: Record<NoteProsePaletteId, NoteProsePaletteCol
codeText: "#5B4EE0",
background: "#FFFFFF",
}),
plum: palette({
accent: "#7A4E6E",
text: "#3A2E36",
muted: "#746068",
surface: "#FBF7F9",
divider: "#E8D7E0",
link: "#5E3A54",
codeBackground: "#F4ECF1",
codeText: "#5E3A54",
background: "#FFFFFF",
}),
pink: palette({
accent: "#D4537E",
text: "#3A2E34",
@@ -262,8 +250,8 @@ export const parseNoteProseLineHeight = (value: unknown): NoteProseLineHeight |
};
export const parseNoteProsePalette = (value: unknown): NoteProsePaletteChoice | null => {
// Green and the custom color editor were removed. Stored rows read as native.
if (value === "emerald" || value === "custom") return "native";
// Removed palettes and the custom color editor read as native.
if (value === "emerald" || value === "green" || value === "plum" || value === "custom") return "native";
return typeof value === "string" && (NOTE_PROSE_PALETTE_CHOICES as readonly string[]).includes(value)
? value as NoteProsePaletteChoice
: null;