@netless/fastboard-ui 0.3.11 → 0.3.12-alpha.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/dist/index.js +38 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -29
- package/dist/index.mjs.map +1 -1
- package/dist/index.svelte.mjs +38 -29
- package/dist/index.svelte.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/Fastboard/Fastboard.svelte +1 -1
- package/src/components/Toolbar/Toolbar.svelte +2 -1
- package/src/components/Toolbar/components/Contents.svelte +2 -2
- package/src/components/Toolbar/components/constants.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12-alpha.0",
|
|
4
4
|
"description": "The front-end of @netless/fastboard-core.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"svelte": "dist/index.svelte.mjs",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"repository": "netless-io/fastboard",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@netless/fastboard-core": "0.3.
|
|
13
|
+
"@netless/fastboard-core": "0.3.12-alpha.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"tippy.js": "^6.3.7"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@netless/buildtool": "0.1.0",
|
|
20
20
|
"@netless/esbuild-plugin-inline-sass": "0.1.0",
|
|
21
|
-
"@netless/fastboard-core": "0.3.
|
|
21
|
+
"@netless/fastboard-core": "0.3.12-alpha.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"cleanup": "rimraf dist",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
class:hidden={!toolbar_has_items || !(layout === "visible" || layout === "toolbar-only")}
|
|
85
85
|
>
|
|
86
86
|
{#if config.toolbar?.enable !== false}
|
|
87
|
-
<Toolbar {app} {theme} {language} config={config.toolbar} />
|
|
87
|
+
<Toolbar {app} {theme} {language} config={config.toolbar || {}} />
|
|
88
88
|
{/if}
|
|
89
89
|
</div>
|
|
90
90
|
<div class="{name}-bottom-left" class:hidden={layout !== "visible"}>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { writable as svelte_writable } from "svelte/store";
|
|
5
5
|
import { height } from "../../actions/height";
|
|
6
6
|
import { clamp } from "../helpers";
|
|
7
|
+
import { default_items } from "./components/constants";
|
|
7
8
|
import Contents from "./components/Contents.svelte";
|
|
8
9
|
|
|
9
10
|
export let app: FastboardApp | null | undefined = null;
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
$: scrollable = $scroll_height + extra_height > $container_height;
|
|
26
27
|
|
|
27
28
|
$: placement = config.placement || "left";
|
|
28
|
-
$: items = config.items;
|
|
29
|
+
$: items = config.items || default_items;
|
|
29
30
|
$: hide_apps = config.apps?.enable === false;
|
|
30
31
|
</script>
|
|
31
32
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { scrollTop } from "../../../actions/scroll";
|
|
8
8
|
import { tippy_hide_all } from "../../../actions/tippy";
|
|
9
9
|
import { clamp } from "../../helpers";
|
|
10
|
-
import { i18n } from "./constants";
|
|
10
|
+
import { default_items, i18n } from "./constants";
|
|
11
11
|
import { apps } from "../../../behaviors";
|
|
12
12
|
import { tooltip } from "./helper";
|
|
13
13
|
import Icons from "../../Icons";
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
export let computed_height = 0;
|
|
37
37
|
export let scrollable = false;
|
|
38
38
|
export let placement: "left" | "right" = "left";
|
|
39
|
-
export let items: ToolbarItem[] =
|
|
39
|
+
export let items: ToolbarItem[] = default_items;
|
|
40
40
|
export let hide_apps = false;
|
|
41
41
|
|
|
42
42
|
const name = "fastboard-toolbar";
|
|
@@ -2,6 +2,16 @@ import type { Appliance, Color } from "@netless/fastboard-core";
|
|
|
2
2
|
import type { I18nData, ToolbarItem } from "../../../typings";
|
|
3
3
|
import Icons from "../../Icons";
|
|
4
4
|
|
|
5
|
+
export const default_items: ToolbarItem[] = [
|
|
6
|
+
"clicker",
|
|
7
|
+
"selector",
|
|
8
|
+
"pencil",
|
|
9
|
+
"text",
|
|
10
|
+
"shapes",
|
|
11
|
+
"eraser",
|
|
12
|
+
"clear",
|
|
13
|
+
];
|
|
14
|
+
|
|
5
15
|
export const colors: Record<string, Color> = {
|
|
6
16
|
"#E02020": [224, 32, 32],
|
|
7
17
|
"#F7B500": [247, 181, 0],
|