-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/Hi-Windom/Sillot-android/issues/71
- Loading branch information
Showing
14 changed files
with
1,806 additions
and
1,842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,66 @@ | ||
import { highlightRender } from "../protyle/render/highlightRender"; | ||
const lodash = require("lodash"); | ||
import { exAce } from "./ace"; | ||
import { Toastify } from "./react-toastify"; | ||
import { HotToast } from "./react-hot-toast"; | ||
import * as React from "react"; // 兼容性好 | ||
import * as ReactDOM from "react-dom"; // 兼容性好 | ||
import Swal from "sweetalert2"; | ||
import {sout} from 'sofill/core' | ||
import { MusicPlayer } from "./react-music-player"; | ||
import VConsole from 'vconsole'; | ||
import { | ||
focusBlock, | ||
focusByOffset, | ||
focusSideBlock, | ||
focusByRange, | ||
} from "../protyle/util/selection"; | ||
import { bS } from "./bridge"; | ||
|
||
export class SillotEnv { | ||
constructor() { | ||
window.sout = sout(); | ||
window.Sillot = { | ||
status: { IDBloaded: false, disableDocSetPadding: false }, | ||
funs: { hljsRender: highlightRender }, | ||
lute: null, | ||
androidRestartSiYuan: null, | ||
}; | ||
window.__ = { | ||
ace: null, | ||
Swal: Swal, | ||
toastify: new Toastify({ id: "app1", limit: 5, theme: "colored" }), | ||
hottt: new HotToast({ id: "app3" }), | ||
}; | ||
window._ = lodash; | ||
window.React = React; | ||
window.ReactDOM = ReactDOM; | ||
exAce(); | ||
// new MusicPlayer({id: 'app4'}) | ||
window.nodebugger = { | ||
focusBlock: focusBlock, | ||
focusByOffset: focusByOffset, | ||
focusSideBlock: focusSideBlock, | ||
focusByRange: focusByRange, | ||
/// #if !BROWSER | ||
bS: new bS(), | ||
///#endif | ||
}; | ||
window.vConsole = new VConsole({ theme: 'dark' }); | ||
window.vConsole.hideSwitch(); | ||
|
||
// 接下来即可照常使用 `console` 等方法 | ||
console.log(window.vConsole.version); | ||
document.querySelector("#toolbarConsole")?.addEventListener("click", () => { | ||
if (document.querySelector("#toolbarConsole")?.getAttribute("data-mode") === "0") { | ||
window.vConsole?.showSwitch(); | ||
document.querySelector("#toolbarConsole")?.setAttribute("data-mode", "1"); | ||
} else { | ||
window.vConsole?.hideSwitch(); | ||
document.querySelector("#toolbarConsole")?.setAttribute("data-mode", "0"); | ||
} | ||
}); | ||
// 结束调试后,可移除掉 | ||
// window.vConsole.destroy(); | ||
|
||
} | ||
} | ||
import { highlightRender } from "../protyle/render/highlightRender"; | ||
const lodash = require("lodash"); | ||
import { exAce } from "./ace"; | ||
import { Toastify } from "./react-toastify"; | ||
import { HotToast } from "./react-hot-toast"; | ||
import * as React from "react"; // 兼容性好 | ||
import * as ReactDOM from "react-dom"; // 兼容性好 | ||
import Swal from "sweetalert2"; | ||
import {sout} from 'sofill/core' | ||
import { MusicPlayer } from "./react-music-player"; | ||
import VConsole from 'vconsole'; | ||
import { | ||
focusBlock, | ||
focusByOffset, | ||
focusSideBlock, | ||
focusByRange, | ||
} from "../protyle/util/selection"; | ||
import { bS } from "./bridge"; | ||
|
||
export class SillotEnv { | ||
constructor() { | ||
window.sout = sout(); | ||
window.Sillot = { | ||
status: { IDBloaded: false, disableDocSetPadding: false }, | ||
funs: { hljsRender: highlightRender }, | ||
lute: null, | ||
}; | ||
window.__ = { | ||
ace: null, | ||
Swal: Swal, | ||
toastify: new Toastify({ id: "app1", limit: 5, theme: "colored" }), | ||
hottt: new HotToast({ id: "app3" }), | ||
}; | ||
window._ = lodash; | ||
window.React = React; | ||
window.ReactDOM = ReactDOM; | ||
exAce(); | ||
// new MusicPlayer({id: 'app4'}) | ||
window.nodebugger = { | ||
focusBlock: focusBlock, | ||
focusByOffset: focusByOffset, | ||
focusSideBlock: focusSideBlock, | ||
focusByRange: focusByRange, | ||
/// #if !BROWSER | ||
bS: new bS(), | ||
///#endif | ||
}; | ||
window.vConsole = new VConsole({ theme: 'dark' }); | ||
window.vConsole.hideSwitch(); | ||
|
||
// 接下来即可照常使用 `console` 等方法 | ||
console.log(window.vConsole.version); | ||
document.querySelector("#toolbarConsole")?.addEventListener("click", () => { | ||
if (document.querySelector("#toolbarConsole")?.getAttribute("data-mode") === "0") { | ||
window.vConsole?.showSwitch(); | ||
document.querySelector("#toolbarConsole")?.setAttribute("data-mode", "1"); | ||
} else { | ||
window.vConsole?.hideSwitch(); | ||
document.querySelector("#toolbarConsole")?.setAttribute("data-mode", "0"); | ||
} | ||
}); | ||
// 结束调试后,可移除掉 | ||
// window.vConsole.destroy(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,54 @@ | ||
// declare module 'react-dom' | ||
declare module "monaco-editor-nls/locale/zh-hans"; | ||
declare module "*.jsx"; | ||
declare module "*.js"; | ||
|
||
// REF https://www.tslang.cn/docs/handbook/declaration-merging.html | ||
interface Window { | ||
// Sillot extend | ||
Sillot: ISillot; | ||
nodebugger: any; | ||
_: any; | ||
__: ISillotDoubleUnderline; | ||
sout: ISout; | ||
React: any; | ||
ReactDOM: any; | ||
vConsole: any; | ||
} | ||
|
||
interface ISillot { | ||
status: { | ||
IDBloaded: boolean; | ||
disableDocSetPadding: boolean; | ||
}; | ||
funs: { | ||
hljsRender: any; | ||
}; | ||
lute: Lute; | ||
androidRestartSiYuan: ()=>void; | ||
} | ||
|
||
interface ISout { | ||
debug: boolean; | ||
showAll(): void; | ||
log(m: any): void; | ||
slog(m: any): void; | ||
print(m: any, head?: string): void; | ||
info(m: any, head?: string): void; | ||
success(m: any, head?: string): void; | ||
warn(m: any, head?: string): void; | ||
unsure(m: any, head?: string): void; | ||
ops(m: any, head?: string): void; | ||
error(m: any, head?: string): void; | ||
good(m: any, head?: string): void; | ||
wink(m: any, head?: string): void; | ||
bad(m: any, head?: string): void; | ||
tracker(m: any, ...additionalMessages: any[]): void; | ||
table(m: Array<object>): void; | ||
} | ||
|
||
interface ISillotDoubleUnderline { | ||
ace: any; | ||
Swal: any; | ||
toastify: any; | ||
hottt: any; | ||
} | ||
// declare module 'react-dom' | ||
declare module "monaco-editor-nls/locale/zh-hans"; | ||
declare module "*.jsx"; | ||
declare module "*.js"; | ||
|
||
// REF https://www.tslang.cn/docs/handbook/declaration-merging.html | ||
interface Window { | ||
// Sillot extend | ||
Sillot: ISillot; | ||
nodebugger: any; | ||
_: any; | ||
__: ISillotDoubleUnderline; | ||
sout: ISout; | ||
React: any; | ||
ReactDOM: any; | ||
vConsole: any; | ||
} | ||
|
||
interface ISillot { | ||
status: { | ||
IDBloaded: boolean; | ||
disableDocSetPadding: boolean; | ||
}; | ||
funs: { | ||
hljsRender: any; | ||
}; | ||
lute: Lute; | ||
} | ||
|
||
interface ISout { | ||
debug: boolean; | ||
showAll(): void; | ||
log(m: any): void; | ||
slog(m: any): void; | ||
print(m: any, head?: string): void; | ||
info(m: any, head?: string): void; | ||
success(m: any, head?: string): void; | ||
warn(m: any, head?: string): void; | ||
unsure(m: any, head?: string): void; | ||
ops(m: any, head?: string): void; | ||
error(m: any, head?: string): void; | ||
good(m: any, head?: string): void; | ||
wink(m: any, head?: string): void; | ||
bad(m: any, head?: string): void; | ||
tracker(m: any, ...additionalMessages: any[]): void; | ||
table(m: Array<object>): void; | ||
} | ||
|
||
interface ISillotDoubleUnderline { | ||
ace: any; | ||
Swal: any; | ||
toastify: any; | ||
hottt: any; | ||
} |
Oops, something went wrong.