@silverbulletmd/silverbullet 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/client/markdown_parser/constants.ts +1 -0
- package/client/plugos/hooks/command.ts +46 -16
- package/client/plugos/hooks/slash_command.ts +3 -1
- package/client/plugos/plug.ts +5 -2
- package/client/plugos/plug_compile.ts +52 -2
- package/client/plugos/sandboxes/worker_sandbox.ts +11 -1
- package/client/plugos/syscalls/client_code_widget.ts +3 -1
- package/client/plugos/syscalls/config.ts +9 -2
- package/client/plugos/syscalls/editor.ts +147 -0
- package/client/plugos/syscalls/index.ts +8 -1
- package/client/plugos/syscalls/jsonschema.ts +1 -19
- package/client/plugos/syscalls/system.ts +13 -0
- package/client/plugos/system.ts +14 -10
- package/client/plugos/types.ts +25 -0
- package/client/plugos/util.ts +20 -0
- package/client/space_lua/aggregates.ts +2 -2
- package/client/space_lua/query_collection.ts +4 -4
- package/client/space_lua/render_lua_markdown.ts +1 -1
- package/client/space_lua/runtime.ts +1 -1
- package/client/space_lua/{liq_null.ts → sliq_null.ts} +2 -2
- package/client/space_lua/stdlib/space_lua.ts +1 -1
- package/client/space_lua/stdlib.ts +1 -1
- package/dist/plug-compile.js +44 -2
- package/package.json +1 -1
- package/plug-api/constants.ts +20 -0
- package/plug-api/lib/ref.ts +9 -2
- package/plug-api/lib/shortcut.ts +16 -0
- package/plug-api/lib/tree.ts +35 -4
- package/plug-api/syscalls/config.ts +37 -0
- package/plug-api/syscalls/editor.ts +160 -0
- package/plug-api/syscalls/index.ts +30 -0
- package/plug-api/syscalls/system.ts +15 -0
- package/plug-api/types/client.ts +12 -0
- package/plug-api/types/manifest.ts +63 -0
- package/plugs/builtin_plugs.ts +1 -1
- package/client/plugos/sandboxes/web_worker_sandbox.ts +0 -17
|
@@ -6,6 +6,48 @@ export type CodeWidgetT = {
|
|
|
6
6
|
renderMode?: "iframe";
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Predefined native menu items. Ignored in PWA builds; used by the
|
|
11
|
+
* SilverBullet desktop app to emit OS-native menu items (Cut/Copy/Paste,
|
|
12
|
+
* Quit, About, etc.) instead of a command-dispatching item.
|
|
13
|
+
*/
|
|
14
|
+
export type PredefinedMenuKind =
|
|
15
|
+
| "quit" | "about" | "services" | "hide" | "hideOthers" | "showAll"
|
|
16
|
+
| "closeWindow" | "minimize" | "maximize" | "fullscreen"
|
|
17
|
+
| "separator"
|
|
18
|
+
| "undo" | "redo" | "cut" | "copy" | "paste" | "selectAll";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A single native-menu placement for a command or submenu.
|
|
22
|
+
* Desktop-app only; ignored in PWA builds.
|
|
23
|
+
*
|
|
24
|
+
* - `location`: id of the target menu or submenu (e.g. "file",
|
|
25
|
+
* "edit.format").
|
|
26
|
+
* - `group`: sort-prefix convention "1_new", "2_dashboard", "9_close". Items
|
|
27
|
+
* are partitioned by group within a location; groups sort alphabetically
|
|
28
|
+
* with separators auto-inserted between them.
|
|
29
|
+
* - `order`: ascending within a group; tiebreak by label.
|
|
30
|
+
* - `label`: overrides the command's display label in the menu only.
|
|
31
|
+
* - `predefined`: emit an OS-native predefined item instead of a
|
|
32
|
+
* command-dispatching item.
|
|
33
|
+
* - `icon`: optional icon identifier; platform support varies.
|
|
34
|
+
*/
|
|
35
|
+
export type MenuContribution = {
|
|
36
|
+
location: string;
|
|
37
|
+
group?: string;
|
|
38
|
+
order?: number;
|
|
39
|
+
label?: string;
|
|
40
|
+
predefined?: PredefinedMenuKind;
|
|
41
|
+
icon?: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A menu placement value: a single contribution, an array (multiple
|
|
46
|
+
* placements), or `null` (hide this entry on the matching platform).
|
|
47
|
+
* Desktop-app only.
|
|
48
|
+
*/
|
|
49
|
+
export type MenuPlacement = MenuContribution | MenuContribution[] | null;
|
|
50
|
+
|
|
9
51
|
export type CommandDef = {
|
|
10
52
|
name: string;
|
|
11
53
|
|
|
@@ -21,6 +63,27 @@ export type CommandDef = {
|
|
|
21
63
|
hide?: boolean;
|
|
22
64
|
requireMode?: "rw" | "ro";
|
|
23
65
|
requireEditor?: "any" | "page" | "notpage" | string;
|
|
66
|
+
|
|
67
|
+
// When true, this binding is NOT registered while vim mode is active,
|
|
68
|
+
// so the key falls through to vim.
|
|
69
|
+
disableInVim?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Desktop-app only. Native menu placement for this command.
|
|
73
|
+
*
|
|
74
|
+
* Naming note: the existing `key`/`mac` pair uses a bare platform name
|
|
75
|
+
* for the override. That pattern doesn't extend cleanly here — bare
|
|
76
|
+
* `mac` is already taken by the keybinding override, and `windows` /
|
|
77
|
+
* `linux` as top-level fields would be ambiguous. The `menu` + capital
|
|
78
|
+
* platform suffix pattern keeps overrides unambiguous.
|
|
79
|
+
*/
|
|
80
|
+
menu?: MenuPlacement;
|
|
81
|
+
/** Platform-specific override: replaces `menu` on macOS. */
|
|
82
|
+
menuMac?: MenuPlacement;
|
|
83
|
+
/** Platform-specific override: replaces `menu` on Windows. */
|
|
84
|
+
menuWindows?: MenuPlacement;
|
|
85
|
+
/** Platform-specific override: replaces `menu` on Linux. */
|
|
86
|
+
menuLinux?: MenuPlacement;
|
|
24
87
|
};
|
|
25
88
|
export type CommandHookT = {
|
|
26
89
|
command?: CommandDef;
|
package/plugs/builtin_plugs.ts
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { WorkerSandbox } from "./worker_sandbox.ts";
|
|
2
|
-
import type { Plug } from "../plug.ts";
|
|
3
|
-
import type { SandboxFactory } from "./sandbox.ts";
|
|
4
|
-
import { fsEndpoint } from "../../spaces/constants.ts";
|
|
5
|
-
|
|
6
|
-
export function createWorkerSandboxFromLocalPath<HookT>(
|
|
7
|
-
name: string,
|
|
8
|
-
): SandboxFactory<HookT> {
|
|
9
|
-
return (plug: Plug<HookT>) =>
|
|
10
|
-
new WorkerSandbox(
|
|
11
|
-
plug,
|
|
12
|
-
new URL(
|
|
13
|
-
name,
|
|
14
|
-
`${document.baseURI.slice(0, -1) + fsEndpoint}/`, // We're NOT striping trailing '/', this used to be `location.origin`
|
|
15
|
-
),
|
|
16
|
-
);
|
|
17
|
-
}
|