Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-10-20 00:10:24 +08:00
commit a3f2da83d1
16 changed files with 18 additions and 2 deletions

View file

@ -767,7 +767,7 @@ export const exportMd = (id: string) => {
merge: localData.mergeSubdocs,
}, async response => {
const html = await onExport(response, undefined, {type: "pdf", id});
window.JSAndroid.exportPDF(html);
window.JSAndroid.print(html);
});
}
},

View file

@ -649,6 +649,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
if (!isDefault) {
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
}
const screenWidth = window.JSAndroid.getScreenWidthPx();
const html = `<!DOCTYPE html>
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
<head>
@ -678,6 +679,7 @@ style="max-width: 800px;margin: 0 auto;" id="preview">${data.data.content}</div>
<script src="${servePath}/stage/build/export/protyle-method.js?v=${Constants.SIYUAN_VERSION}"></script>
<script src="${servePath}/stage/protyle/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}"></script>
<script>
document.body.style.minWidth = ${screenWidth} + "px";
window.siyuan = {
config: {
appearance: { mode: ${mode}, codeBlockThemeDark: "${window.siyuan.config.appearance.codeBlockThemeDark}", codeBlockThemeLight: "${window.siyuan.config.appearance.codeBlockThemeLight}" },

View file

@ -245,7 +245,8 @@ interface Window {
readHTMLClipboard(): string
getBlockURL(): string
hideKeyboard(): void
exportPDF(html: string): void
print(html: string): void
getScreenWidthPx(): number
};
JSHarmony: {
openExternal(url: string): void