Default shared note image cards to wide width

This commit is contained in:
tianma-if committed 2026-10-08 22:08:59 +08:00
1 parent 20ab8ee313
commit 58904d6f7b
9 files changed
+572 -572

No files matched your search

@@ -26,7 +26,7 @@ struct MemoDetailView: View {
@State private var imageShareTheme = "aurora"
@State private var imageShareFontStyle = "serif"
@State private var imageShareFontSize = "lg"
@State private var imageShareCardWidth = "standard"
@State private var imageShareCardWidth = "wide"
@State private var imageShareTitle = true
@State private var imageShareNotebook = false
@State private var imageShareTags = false
@@ -1151,7 +1151,7 @@ struct MemoDetailView: View {
theme: String = "aurora",
fontStyle: String = "serif",
fontSize: String = "lg",
cardWidth: String = "standard",
cardWidth: String = "wide",
showTitle: Bool = true,
showNotebook: Bool = false,
showTags: Bool = false,
File diff suppressed because it is too large. Load diff
+279 -279
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1235,8 +1235,8 @@ async function exportNoteImage(request: ImageExportRequest) {
const resolvedTheme = resolveTheme(request.background, request.theme);
const fontStyle = request.fontStyle ?? "serif";
const fontSize = request.fontSize ?? "lg";
const cardWidth = request.cardWidth ?? "standard";
const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;
const cardWidth = request.cardWidth ?? "wide";
const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || NOTE_IMAGE_CARD_WIDTH_PIXELS.wide;
const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme] || NOTE_IMAGE_THEMES.aurora;
const editorClone = editor.view.dom.cloneNode(true) as HTMLElement;
@@ -1252,8 +1252,8 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
const resolvedTheme = resolveTheme(request.background, request.theme);
const fontStyle = request.fontStyle ?? "serif";
const fontSize = request.fontSize ?? "lg";
const cardWidth = request.cardWidth ?? "standard";
const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;
const cardWidth = request.cardWidth ?? "wide";
const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || NOTE_IMAGE_CARD_WIDTH_PIXELS.wide;
const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme] || NOTE_IMAGE_THEMES.aurora;
const editorClone = editor.view.dom.cloneNode(true) as HTMLElement;
@@ -510,7 +510,7 @@ export const MemoDetailModal = ({
const [imageShareTheme, setImageShareTheme] = useState<NoteImageTheme>("aurora");
const [imageShareFontStyle, setImageShareFontStyle] = useState<NoteImageFontStyle>("serif");
const [imageShareFontSize, setImageShareFontSize] = useState<NoteImageFontSize>("lg");
const [imageShareCardWidth, setImageShareCardWidth] = useState<NoteImageCardWidth>("standard");
const [imageShareCardWidth, setImageShareCardWidth] = useState<NoteImageCardWidth>("wide");
const [imageShareTitle, setImageShareTitle] = useState(true);
const [imageShareNotebook, setImageShareNotebook] = useState(false);
const [imageShareTags, setImageShareTags] = useState(false);
@@ -971,7 +971,7 @@ export const MemoDetailModal = ({
theme: options.theme ?? "aurora",
fontStyle: options.fontStyle ?? "serif",
fontSize: options.fontSize ?? "lg",
cardWidth: options.cardWidth ?? "standard",
cardWidth: options.cardWidth ?? "wide",
showTitle: options.showTitle ?? true,
showNotebook: options.showNotebook ?? false,
showTags: options.showTags ?? false,
@@ -76,7 +76,7 @@ export const ShareNoteImageDialog = ({
const [theme, setTheme] = useState<NoteImageTheme>("aurora");
const [fontStyle, setFontStyle] = useState<NoteImageFontStyle>("serif");
const [fontSize, setFontSize] = useState<NoteImageFontSize>("lg");
const [cardWidth, setCardWidth] = useState<NoteImageCardWidth>("standard");
const [cardWidth, setCardWidth] = useState<NoteImageCardWidth>("wide");
const [showTitle, setShowTitle] = useState(true);
const [showNotebook, setShowNotebook] = useState(false);
const [showTags, setShowTags] = useState(false);
@@ -95,7 +95,7 @@ export const ShareNoteImageDialog = ({
setTheme("aurora");
setFontStyle("serif");
setFontSize("lg");
setCardWidth("standard");
setCardWidth("wide");
setShowTitle(true);
setShowNotebook(false);
setShowTags(false);
+2 -2
View File
@@ -131,7 +131,7 @@ export const createNoteImage = async ({
theme,
fontStyle = "serif",
fontSize = "lg",
cardWidth = "standard",
cardWidth = "wide",
showTitle = true,
showNotebook = false,
showTags = false,
@@ -139,7 +139,7 @@ export const createNoteImage = async ({
styles,
}: DownloadNoteImageOptions): Promise<PreparedNoteImage> => {
const resolvedTheme = resolveTheme(background, theme);
const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;
const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || NOTE_IMAGE_CARD_WIDTH_PIXELS.wide;
const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme];
const prepared = await prepareNoteBodyHtmlForExport(bodyHtml);
+2 -2
View File
@@ -445,7 +445,7 @@ export const generateCardCss = ({
theme = "aurora",
fontStyle = "serif",
fontSize = "lg",
cardWidth = "standard",
cardWidth = "wide",
}: {
theme: NoteImageTheme;
fontStyle: NoteImageFontStyle;
@@ -455,7 +455,7 @@ export const generateCardCss = ({
const themeCfg = NOTE_IMAGE_THEMES[theme] || NOTE_IMAGE_THEMES.aurora;
const fontFam = NOTE_IMAGE_FONT_FAMILIES[fontStyle] || NOTE_IMAGE_FONT_FAMILIES.sans;
const sizeCfg = NOTE_IMAGE_FONT_SIZES[fontSize] || NOTE_IMAGE_FONT_SIZES.md;
const widthPx = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;
const widthPx = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || NOTE_IMAGE_CARD_WIDTH_PIXELS.wide;
return `
:root {