@netless/fastboard-ui 0.3.2 → 0.3.4-canary.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/fastboard-ui",
3
- "version": "0.3.2",
3
+ "version": "0.3.4-canary.1",
4
4
  "description": "The front-end of @netless/fastboard-core.",
5
5
  "main": "dist/index.js",
6
6
  "svelte": "dist/index.svelte.mjs",
@@ -10,14 +10,14 @@
10
10
  ],
11
11
  "repository": "netless-io/fastboard",
12
12
  "peerDependencies": {
13
- "@netless/fastboard-core": "0.3.2"
13
+ "@netless/fastboard-core": "0.3.4-canary.1"
14
14
  },
15
15
  "dependencies": {
16
16
  "tippy.js": "^6.3.7"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@netless/esbuild-plugin-inline-sass": "0.1.0",
20
- "@netless/fastboard-core": "0.3.2"
20
+ "@netless/fastboard-core": "0.3.4-canary.1"
21
21
  },
22
22
  "scripts": {
23
23
  "cleanup": "rimraf dist",
@@ -27,6 +27,5 @@
27
27
  "test:ssr": "esbuild-dev test/ssr.ts"
28
28
  },
29
29
  "module": "dist/index.mjs",
30
- "types": "dist/index.d.ts",
31
- "readme": "## @netless/fastboard-ui\n\nThe front-end of [@netless/fastboard-core](https://github.com/netless-io/fastboard/tree/main/packages/fastboard-core).\n\n### License\n\nMIT @ [netless](https://github.com/netless-io)\n"
30
+ "types": "dist/index.d.ts"
32
31
  }
@@ -52,7 +52,10 @@ export const apps = new AppsInToolbar([
52
52
  icon: code_editor_svg,
53
53
  label: "Code Editor",
54
54
  onClick(app) {
55
- app.insertCodeEditor();
55
+ app.manager.addApp({
56
+ kind: "Monaco",
57
+ options: { title: "Code Editor" },
58
+ });
56
59
  },
57
60
  },
58
61
  {
@@ -60,7 +63,10 @@ export const apps = new AppsInToolbar([
60
63
  icon: geogebra_svg,
61
64
  label: "GeoGebra",
62
65
  onClick(app) {
63
- app.insertGeoGebra();
66
+ app.manager.addApp({
67
+ kind: "GeoGebra",
68
+ options: { title: "GeoGebra" },
69
+ });
64
70
  },
65
71
  },
66
72
  {
@@ -68,7 +74,10 @@ export const apps = new AppsInToolbar([
68
74
  icon: countdown_svg,
69
75
  label: "Countdown",
70
76
  onClick(app) {
71
- app.insertCountdown();
77
+ app.manager.addApp({
78
+ kind: "Countdown",
79
+ options: { title: "Countdown" },
80
+ });
72
81
  },
73
82
  },
74
83
  ]);
@@ -1,3 +1,5 @@
1
+ <svelte:options immutable />
2
+
1
3
  <script lang="ts">
2
4
  import type { FastboardApp } from "@netless/fastboard-core";
3
5
  import type { Language, Theme, FastboardUIConfig } from "../../typings";
@@ -58,7 +60,7 @@
58
60
  </script>
59
61
 
60
62
  <div class="{name}-root" class:loading={!app}>
61
- <div class="{name}-view" bind:this={container} on:touchstart|capture={tippy_hide_all} />
63
+ <div class="{name}-view" bind:this={container} on:touchstart|capture|passive={tippy_hide_all} />
62
64
  <div class="{name}-left" class:hidden={!(layout === "visible" || layout === "toolbar-only")}>
63
65
  {#if config.toolbar?.enable !== false}
64
66
  <Toolbar {app} {theme} {language} config={config.toolbar} />
@@ -1,3 +1,5 @@
1
+ <svelte:options immutable />
2
+
1
3
  <script lang="ts">
2
4
  import type { FastboardPlayer } from "@netless/fastboard-core";
3
5
  import type { Language, Theme } from "../../typings";
@@ -36,7 +38,7 @@
36
38
  </script>
37
39
 
38
40
  <div class="{name}-root" class:loading={!player}>
39
- <div class="{name}-view" bind:this={container} on:touchstart|capture={tippy_hide_all} />
41
+ <div class="{name}-view" bind:this={container} on:touchstart|capture|passive={tippy_hide_all} />
40
42
  <div class="{name}-bottom">
41
43
  <PlayerControl {player} {theme} {language} />
42
44
  </div>
@@ -7,10 +7,24 @@
7
7
 
8
8
  <svg fill="none" viewBox="0 0 24 24" class="fastboard-icon {theme}" class:is-active={active}>
9
9
  <path
10
+ d="M19.6567 4.34323L13.9999 10.0001"
10
11
  stroke="#5D6066"
12
+ stroke-width="1.25"
13
+ stroke-linejoin="round"
14
+ class="fastboard-icon-stroke-color"
15
+ />
16
+ <path
17
+ d="M8.34296 10.0001C9.90506 8.43799 12.4377 8.43799 13.9998 10.0001V10.0001C15.5619 11.5622 15.5619 14.0948 13.9998 15.6569V15.6569L8.34296 10.0001V10.0001Z"
18
+ stroke="#5D6066"
19
+ stroke-width="1.25"
11
20
  stroke-linejoin="round"
21
+ class="fastboard-icon-stroke-color"
22
+ />
23
+ <path
24
+ d="M8.34292 10.0001L13.9998 15.6569L11.5856 19.8996L4.10028 11.4143L8.34292 10.0001Z"
25
+ stroke="#5D6066"
12
26
  stroke-width="1.25"
13
- d="m17.95 4.636-2.83 2.828-1.413-1.414a2 2 0 0 0-2.829 0l-.707.707 7.071 7.071.707-.707a2 2 0 0 0 0-2.828l-1.414-1.414 2.829-2.829-1.415-1.414Zm-1.415 9.9-5.656 5.656-.707-.707 1.767-3.182-3.182 1.768.707-2.121-2.121.707 1.768-3.182-3.182 1.768.707-2.122-2.121.707-.707-.707 5.656-5.657"
27
+ stroke-linejoin="round"
14
28
  class="fastboard-icon-stroke-color"
15
29
  />
16
30
  </svg>
@@ -5,7 +5,6 @@ import Balloon from "./Balloon.svelte";
5
5
  import BalloonBolded from "./BalloonBolded.svelte";
6
6
  import Circle from "./Circle.svelte";
7
7
  import CircleBolded from "./CircleBolded.svelte";
8
- import Clean from "./Clean.svelte";
9
8
  import Clear from "./Clear.svelte";
10
9
  import Click from "./Click.svelte";
11
10
  import ClickFilled from "./ClickFilled.svelte";
@@ -51,7 +50,6 @@ const Icons = {
51
50
  BalloonBolded,
52
51
  Circle,
53
52
  CircleBolded,
54
- Clean,
55
53
  Clear,
56
54
  Click,
57
55
  ClickFilled,
@@ -18,6 +18,7 @@
18
18
  import StrokeColor from "./StrokeColor.svelte";
19
19
  import TextColor from "./TextColor.svelte";
20
20
  import Shapes from "./Shapes.svelte";
21
+ import { tippy_hide_all } from "../../../actions/tippy";
21
22
 
22
23
  export let app: FastboardApp | null | undefined = null;
23
24
  export let theme: Theme = "light";
@@ -180,6 +181,10 @@
180
181
  {#each $apps as netless_app}
181
182
  {@const { icon, label, kind, onClick } = netless_app}
182
183
  {@const state = $status && $status[kind]}
184
+ {@const on_click = () => {
185
+ app && onClick(app);
186
+ tippy_hide_all();
187
+ }}
183
188
  <button
184
189
  class="{name}-app-btn {kind} {theme}"
185
190
  class:is-loading={state && state.status === "loading"}
@@ -187,7 +192,7 @@
187
192
  title={label + (state && state.reason ? ": " + state.reason : "")}
188
193
  data-app-kind={netless_app.kind}
189
194
  disabled={state && state.status !== "idle"}
190
- on:click={app && onClick.bind(null, app)}
195
+ on:click={on_click}
191
196
  >
192
197
  <img class="{name}-app-btn-icon {theme}" src={icon} alt={kind} title={label} />
193
198
  <span class="{name}-app-btn-text {theme}">{label}</span>
@@ -1,14 +0,0 @@
1
- <script lang="ts">
2
- import type { Theme } from "../../typings";
3
-
4
- export let theme: Theme = "light";
5
- export let active = false;
6
- </script>
7
-
8
- <svg fill="none" viewBox="0 0 24 24" class="fastboard-icon {theme}" class:is-active={active}>
9
- <path
10
- fill="#5D6066"
11
- d="M9.754 11.99c0 1.856-.711 3.62-1.96 4.951l-.151.155h1.403l.855-.853h.707l.853.853h2.635l.094-.064a6.237 6.237 0 0 0 2.559-4.781l.005-.26h1a7.237 7.237 0 0 1-2.994 5.862l-.229.16-.277.083h-3l-.353-.146-.647-.647-.646.647-.354.146h-3l-.286-.91.214-.148a6.237 6.237 0 0 0 2.567-4.787l.005-.26h1Zm4.772-6.502v2l.35.039a2.98 2.98 0 0 1 2.644 2.78l.006.181h-8a2.98 2.98 0 0 1 2.65-2.961l.35-.039v-2h2Z"
12
- class="fastboard-icon-fill-color"
13
- />
14
- </svg>