Work
This commit is contained in:
@@ -92,6 +92,18 @@ export function editorSyscalls(editor: Editor): SysCallMapping {
|
||||
type: "hide-lhs",
|
||||
});
|
||||
},
|
||||
"editor.showBhs": (ctx, html: string, flex: number) => {
|
||||
editor.viewDispatch({
|
||||
type: "show-bhs",
|
||||
flex,
|
||||
html,
|
||||
});
|
||||
},
|
||||
"editor.hideBhs": (ctx) => {
|
||||
editor.viewDispatch({
|
||||
type: "hide-bhs",
|
||||
});
|
||||
},
|
||||
"editor.insertAtPos": (ctx, text: string, pos: number) => {
|
||||
editor.editorView!.dispatch({
|
||||
changes: {
|
||||
|
||||
@@ -4,8 +4,8 @@ import { PageMeta } from "@silverbulletmd/common/types";
|
||||
|
||||
export function spaceSyscalls(editor: Editor): SysCallMapping {
|
||||
return {
|
||||
"space.listPages": async (): Promise<PageMeta[]> => {
|
||||
return [...(await editor.space.listPages())];
|
||||
"space.listPages": async (ctx, unfiltered = false): Promise<PageMeta[]> => {
|
||||
return [...(await editor.space.listPages(unfiltered))];
|
||||
},
|
||||
"space.readPage": async (
|
||||
ctx,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SysCallMapping } from "@plugos/plugos/system";
|
||||
import { Space } from "@silverbulletmd/common/spaces/space";
|
||||
import type { Editor } from "../editor";
|
||||
|
||||
export function systemSyscalls(space: Space): SysCallMapping {
|
||||
export function systemSyscalls(editor: Editor): SysCallMapping {
|
||||
return {
|
||||
"system.invokeFunction": async (
|
||||
ctx,
|
||||
@@ -17,7 +17,10 @@ export function systemSyscalls(space: Space): SysCallMapping {
|
||||
return ctx.plug.invoke(name, args);
|
||||
}
|
||||
|
||||
return space.invokeFunction(ctx.plug, env, name, args);
|
||||
return editor.space.invokeFunction(ctx.plug, env, name, args);
|
||||
},
|
||||
"system.reloadPlugs": async () => {
|
||||
return editor.reloadPlugs();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user