Ver código fonte

:rotating_light:

Vanessa 6 meses atrás
pai
commit
812a5e392a

+ 7 - 7
app/src/protyle/util/compatibility.ts

@@ -139,17 +139,17 @@ export const isMac = () => {
 };
 
 export const isWin11 = async () => {
-    if (!navigator.userAgentData || !navigator.userAgentData.getHighEntropyValues) {
+    if (!(navigator as any).userAgentData || !(navigator as any).userAgentData.getHighEntropyValues) {
         return false;
     }
-    const ua = await navigator.userAgentData.getHighEntropyValues(["platformVersion"])
-    if (navigator.userAgentData.platform === "Windows") {
-        if (parseInt(ua.platformVersion.split('.')[0]) >= 13) {
-           return true
+    const ua = await (navigator as any).userAgentData.getHighEntropyValues(["platformVersion"]);
+    if ((navigator as any).userAgentData.platform === "Windows") {
+        if (parseInt(ua.platformVersion.split(".")[0]) >= 13) {
+           return true;
         }
     }
-    return false
-}
+    return false;
+};
 
 export const isInAndroid = () => {
     return window.siyuan.config.system.container === "android" && window.JSAndroid;

+ 1 - 1
app/src/protyle/wysiwyg/keydown.ts

@@ -855,7 +855,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                             if (nextSibling.nodeType === 3 && nextSibling.textContent === Constants.ZWSP) {
                                 if (!nextSibling.nextSibling) {
                                     // https://github.com/siyuan-note/siyuan/issues/13524
-                                    const nextBlockElement = getNextBlock(nodeElement)
+                                    const nextBlockElement = getNextBlock(nodeElement);
                                     if (nextBlockElement) {
                                         removeBlock(protyle, nextBlockElement, range, "remove");
                                     }

+ 0 - 44
app/src/types/user-agent.d.ts

@@ -1,44 +0,0 @@
-// WICG Spec: https://wicg.github.io/ua-client-hints
-
-declare interface Navigator extends NavigatorUA {}
-declare interface WorkerNavigator extends NavigatorUA {}
-
-// https://wicg.github.io/ua-client-hints/#navigatorua
-declare interface NavigatorUA {
-    readonly userAgentData?: NavigatorUAData;
-}
-
-// https://wicg.github.io/ua-client-hints/#dictdef-navigatoruabrandversion
-interface NavigatorUABrandVersion {
-    readonly brand: string;
-    readonly version: string;
-}
-
-// https://wicg.github.io/ua-client-hints/#dictdef-uadatavalues
-interface UADataValues {
-    readonly brands?: NavigatorUABrandVersion[];
-    readonly mobile?: boolean;
-    readonly platform?: string;
-    readonly architecture?: string;
-    readonly bitness?: string;
-    readonly formFactor?: string[];
-    readonly model?: string;
-    readonly platformVersion?: string;
-    /** @deprecated in favour of fullVersionList */
-    readonly uaFullVersion?: string;
-    readonly fullVersionList?: NavigatorUABrandVersion[];
-    readonly wow64?: boolean;
-}
-
-// https://wicg.github.io/ua-client-hints/#dictdef-ualowentropyjson
-interface UALowEntropyJSON {
-    readonly brands: NavigatorUABrandVersion[];
-    readonly mobile: boolean;
-    readonly platform: string;
-}
-
-// https://wicg.github.io/ua-client-hints/#navigatoruadata
-interface NavigatorUAData extends UALowEntropyJSON {
-    getHighEntropyValues(hints: string[]): Promise<UADataValues>;
-    toJSON(): UALowEntropyJSON;
-}

+ 1 - 1
app/src/util/assets.ts

@@ -225,7 +225,7 @@ export const setInlineStyle = async (set = true) => {
   src: local("Apple Color Emoji"),
   local("Segoe UI Emoji"),
   local("Segoe UI Symbol");
-}`
+}`;
     } else {
         const isWin11Browser = await isWin11();
         if (isWin11Browser) {