@@ -11,7 +11,7 @@ import {getThemeMode, setInlineStyle} from "../../util/assets";
1111import { fetchPost , fetchSyncPost } from "../../util/fetch" ;
1212import { Dialog } from "../../dialog" ;
1313import { replaceLocalPath } from "../../editor/rename" ;
14- import { isInAndroid , setStorageVal } from "../util/compatibility" ;
14+ import { getScreenWidth , isInAndroid , isInHarmony , setStorageVal } from "../util/compatibility" ;
1515import { getFrontend } from "../../util/functions" ;
1616
1717const getPluginStyle = async ( ) => {
@@ -669,7 +669,8 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
669669 if ( ! isDefault ) {
670670 themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${ servePath } appearance/themes/${ themeName } /theme.css?${ Constants . SIYUAN_VERSION } "/>` ;
671671 }
672- const minWidthHtml = isInAndroid ( ) ? `document.body.style.minWidth = "${ window . JSAndroid . getScreenWidthPx ( ) } px"` : "" ;
672+ let screenWidth = getScreenWidth ( ) ;
673+ const minWidthHtml = isInAndroid ( ) || isInHarmony ( ) ? `document.body.style.minWidth = "${ screenWidth } px"` : "" ;
673674 const html = `<!DOCTYPE html>
674675<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 } ">
675676<head>
@@ -694,7 +695,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
694695</head>
695696<body>
696697<div class="${ [ "htmlmd" , "word" ] . includes ( exportOption . type ) ? "b3-typography" : "protyle-wysiwyg" + ( window . siyuan . config . editor . displayBookmarkIcon ? " protyle-wysiwyg--attr" : "" ) } "
697- style="${ isInAndroid ( ) ? "margin: 0 16px;" : "max-width: 800px;margin: 0 auto;" } " id="preview">${ data . data . content } </div>
698+ style="${ isInAndroid ( ) || isInHarmony ( ) ? "margin: 0 16px;" : "max-width: 800px;margin: 0 auto;" } " id="preview">${ data . data . content } </div>
698699<script src="${ servePath } /appearance/icons/${ window . siyuan . config . appearance . icon } /icon.js?v=${ Constants . SIYUAN_VERSION } "></script>
699700<script src="${ servePath } /stage/build/export/protyle-method.js?v=${ Constants . SIYUAN_VERSION } "></script>
700701<script src="${ servePath } /stage/protyle/js/lute/lute.min.js?v=${ Constants . SIYUAN_VERSION } "></script>
0 commit comments