@netless/fastboard-ui 0.3.2-canary.5 → 0.3.3
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/LICENSE.txt +21 -21
- package/README.md +7 -7
- package/dist/index.d.ts +102 -102
- package/dist/index.js +30 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -23
- package/dist/index.mjs.map +1 -1
- package/dist/index.svelte.mjs +22 -17
- package/dist/index.svelte.mjs.map +1 -1
- package/package.json +4 -5
- package/src/actions/height.ts +43 -43
- package/src/actions/scroll.ts +31 -31
- package/src/actions/tippy.ts +71 -71
- package/src/behaviors/apps.ts +74 -74
- package/src/behaviors/index.ts +1 -1
- package/src/components/Button/Button.svelte +51 -51
- package/src/components/Button/Button.svelte.d.ts +26 -26
- package/src/components/Button/index.ts +2 -2
- package/src/components/Fastboard/Fastboard.scss +61 -61
- package/src/components/Fastboard/Fastboard.svelte +80 -80
- package/src/components/Fastboard/Fastboard.svelte.ts +14 -14
- package/src/components/Fastboard/ReplayFastboard.svelte +43 -43
- package/src/components/Fastboard/ReplayFastboard.svelte.ts +13 -13
- package/src/components/Fastboard/index.ts +5 -5
- package/src/components/Icon/Icon.svelte +11 -11
- package/src/components/Icon/Icon.svelte.d.ts +10 -10
- package/src/components/Icon/index.ts +2 -2
- package/src/components/Icons/Apps.svelte +49 -49
- package/src/components/Icons/Arrow.svelte +16 -16
- package/src/components/Icons/ArrowBolded.svelte +17 -17
- package/src/components/Icons/Balloon.svelte +16 -16
- package/src/components/Icons/BalloonBolded.svelte +16 -16
- package/src/components/Icons/Circle.svelte +20 -20
- package/src/components/Icons/CircleBolded.svelte +20 -20
- package/src/components/Icons/Clean.svelte +14 -14
- package/src/components/Icons/Clear.svelte +16 -16
- package/src/components/Icons/Click.svelte +16 -16
- package/src/components/Icons/ClickFilled.svelte +10 -10
- package/src/components/Icons/Diamond.svelte +16 -16
- package/src/components/Icons/Down.svelte +16 -16
- package/src/components/Icons/Eraser.svelte +16 -16
- package/src/components/Icons/EraserFilled.svelte +16 -16
- package/src/components/Icons/Icons.scss +20 -20
- package/src/components/Icons/Left.svelte +16 -16
- package/src/components/Icons/Line.svelte +16 -16
- package/src/components/Icons/LineBolded.svelte +16 -16
- package/src/components/Icons/Loading.svelte +10 -10
- package/src/components/Icons/Minus.svelte +16 -16
- package/src/components/Icons/Pause.svelte +10 -10
- package/src/components/Icons/Pencil.svelte +29 -29
- package/src/components/Icons/PencilFilled.svelte +16 -16
- package/src/components/Icons/Play.svelte +10 -10
- package/src/components/Icons/Plus.svelte +16 -16
- package/src/components/Icons/Rectangle.svelte +16 -16
- package/src/components/Icons/RectangleBolded.svelte +16 -16
- package/src/components/Icons/Redo.svelte +15 -15
- package/src/components/Icons/Reset.svelte +26 -26
- package/src/components/Icons/Rhombus.svelte +16 -16
- package/src/components/Icons/RhombusBolded.svelte +16 -16
- package/src/components/Icons/Right.svelte +16 -16
- package/src/components/Icons/Selector.svelte +24 -24
- package/src/components/Icons/SelectorFilled.svelte +18 -18
- package/src/components/Icons/SpeechBalloon.svelte +16 -16
- package/src/components/Icons/Star.svelte +16 -16
- package/src/components/Icons/StarBolded.svelte +16 -16
- package/src/components/Icons/Text.svelte +16 -16
- package/src/components/Icons/TextFilled.svelte +17 -17
- package/src/components/Icons/Triangle.svelte +16 -16
- package/src/components/Icons/TriangleBolded.svelte +16 -16
- package/src/components/Icons/Undo.svelte +15 -15
- package/src/components/Icons/Up.svelte +16 -16
- package/src/components/Icons/WhiteboardAdd.svelte +34 -34
- package/src/components/Icons/index.ts +93 -93
- package/src/components/PageControl/PageControl.scss +15 -15
- package/src/components/PageControl/PageControl.svelte +79 -79
- package/src/components/PageControl/PageControl.svelte.d.ts +13 -13
- package/src/components/PageControl/index.ts +2 -2
- package/src/components/PlayerControl/PlayerControl.scss +57 -57
- package/src/components/PlayerControl/PlayerControl.svelte +153 -153
- package/src/components/PlayerControl/PlayerControl.svelte.d.ts +13 -13
- package/src/components/PlayerControl/index.ts +2 -2
- package/src/components/RedoUndo/RedoUndo.scss +11 -11
- package/src/components/RedoUndo/RedoUndo.svelte +60 -60
- package/src/components/RedoUndo/RedoUndo.svelte.d.ts +13 -13
- package/src/components/RedoUndo/index.ts +2 -2
- package/src/components/Toolbar/README.md +57 -57
- package/src/components/Toolbar/Toolbar.scss +78 -78
- package/src/components/Toolbar/Toolbar.svelte +62 -62
- package/src/components/Toolbar/Toolbar.svelte.d.ts +13 -13
- package/src/components/Toolbar/components/Contents.scss +168 -168
- package/src/components/Toolbar/components/Contents.svelte +202 -197
- package/src/components/Toolbar/components/Shapes.svelte +85 -85
- package/src/components/Toolbar/components/Slider.scss +119 -119
- package/src/components/Toolbar/components/Slider.svelte +54 -54
- package/src/components/Toolbar/components/StrokeColor.svelte +39 -39
- package/src/components/Toolbar/components/StrokeWidth.svelte +20 -20
- package/src/components/Toolbar/components/TextColor.svelte +39 -39
- package/src/components/Toolbar/components/constants.ts +80 -80
- package/src/components/Toolbar/components/helper.ts +24 -24
- package/src/components/Toolbar/index.ts +2 -2
- package/src/components/ZoomControl/ZoomControl.scss +15 -15
- package/src/components/ZoomControl/ZoomControl.svelte +99 -99
- package/src/components/ZoomControl/ZoomControl.svelte.d.ts +13 -13
- package/src/components/ZoomControl/index.ts +2 -2
- package/src/components/helpers.ts +3 -3
- package/src/components/theme.scss +92 -92
- package/src/components/variables.scss +69 -69
- package/src/index.ts +13 -13
- package/src/style.scss +36 -36
- package/src/typings.ts +38 -38
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
.fastboard-root {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.fastboard-view {
|
|
9
|
-
position: absolute;
|
|
10
|
-
top: 0;
|
|
11
|
-
left: 0;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.fastboard-left {
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
position: absolute;
|
|
20
|
-
bottom: 62px;
|
|
21
|
-
top: 8px;
|
|
22
|
-
left: 0;
|
|
23
|
-
z-index: 200;
|
|
24
|
-
pointer-events: none;
|
|
25
|
-
|
|
26
|
-
.fastboard-toolbar {
|
|
27
|
-
padding-left: 16px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.fastboard-bottom-left {
|
|
32
|
-
display: flex;
|
|
33
|
-
gap: 10px;
|
|
34
|
-
position: absolute;
|
|
35
|
-
bottom: 8px;
|
|
36
|
-
left: 8px;
|
|
37
|
-
padding: 8px;
|
|
38
|
-
z-index: 200;
|
|
39
|
-
pointer-events: none;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.fastboard-bottom-right {
|
|
43
|
-
@extend .fastboard-bottom-left;
|
|
44
|
-
left: auto;
|
|
45
|
-
right: 8px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.fastboard-bottom {
|
|
49
|
-
@extend .fastboard-bottom-left;
|
|
50
|
-
right: 8px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.fastboard-left,
|
|
54
|
-
.fastboard-bottom,
|
|
55
|
-
.fastboard-bottom-left,
|
|
56
|
-
.fastboard-bottom-right {
|
|
57
|
-
&.hidden * {
|
|
58
|
-
opacity: 0;
|
|
59
|
-
pointer-events: none;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
1
|
+
.fastboard-root {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.fastboard-view {
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.fastboard-left {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
position: absolute;
|
|
20
|
+
bottom: 62px;
|
|
21
|
+
top: 8px;
|
|
22
|
+
left: 0;
|
|
23
|
+
z-index: 200;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
|
|
26
|
+
.fastboard-toolbar {
|
|
27
|
+
padding-left: 16px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.fastboard-bottom-left {
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 10px;
|
|
34
|
+
position: absolute;
|
|
35
|
+
bottom: 8px;
|
|
36
|
+
left: 8px;
|
|
37
|
+
padding: 8px;
|
|
38
|
+
z-index: 200;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.fastboard-bottom-right {
|
|
43
|
+
@extend .fastboard-bottom-left;
|
|
44
|
+
left: auto;
|
|
45
|
+
right: 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.fastboard-bottom {
|
|
49
|
+
@extend .fastboard-bottom-left;
|
|
50
|
+
right: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.fastboard-left,
|
|
54
|
+
.fastboard-bottom,
|
|
55
|
+
.fastboard-bottom-left,
|
|
56
|
+
.fastboard-bottom-right {
|
|
57
|
+
&.hidden * {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { FastboardApp } from "@netless/fastboard-core";
|
|
3
|
-
import type { Language, Theme, FastboardUIConfig } from "../../typings";
|
|
4
|
-
import { onMount } from "svelte";
|
|
5
|
-
import { tippy_hide_all } from "../../actions/tippy";
|
|
6
|
-
import RedoUndo from "../RedoUndo";
|
|
7
|
-
import ZoomControl from "../ZoomControl";
|
|
8
|
-
import PageControl from "../PageControl";
|
|
9
|
-
import Toolbar from "../Toolbar";
|
|
10
|
-
|
|
11
|
-
export let app: FastboardApp | null | undefined = null;
|
|
12
|
-
export let theme: Theme = "light";
|
|
13
|
-
export let language: Language = "en";
|
|
14
|
-
export let containerRef: ((element: HTMLDivElement | null) => void) | undefined = undefined;
|
|
15
|
-
export let config: FastboardUIConfig = {};
|
|
16
|
-
|
|
17
|
-
const name = "fastboard";
|
|
18
|
-
const AppsShowToolbar = ["DocsViewer", "Slide"];
|
|
19
|
-
|
|
20
|
-
let container: HTMLDivElement;
|
|
21
|
-
let layout: "hidden" | "toolbar-only" | "visible" = "hidden";
|
|
22
|
-
|
|
23
|
-
$: writable = app?.writable;
|
|
24
|
-
$: boxState = app?.boxState;
|
|
25
|
-
$: focusedApp = app?.focusedApp;
|
|
26
|
-
|
|
27
|
-
$: if (!$writable) {
|
|
28
|
-
layout = "hidden";
|
|
29
|
-
} else if ($boxState === "maximized") {
|
|
30
|
-
if ($focusedApp && AppsShowToolbar.some(kind => ($focusedApp || "").includes(kind))) {
|
|
31
|
-
layout = "toolbar-only";
|
|
32
|
-
} else {
|
|
33
|
-
layout = "hidden";
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
layout = "visible";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
$: try {
|
|
40
|
-
if (app && container) app.bindContainer(container);
|
|
41
|
-
} catch (err) {
|
|
42
|
-
console.error("[fastboard] An error occurred while binding container");
|
|
43
|
-
console.error(err);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
$: if (app && theme) {
|
|
47
|
-
app.manager.setPrefersColorScheme(theme);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
onMount(() => {
|
|
51
|
-
if (containerRef) {
|
|
52
|
-
containerRef(container);
|
|
53
|
-
return () => {
|
|
54
|
-
if (containerRef) containerRef(null);
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<div class="{name}-root" class:loading={!app}>
|
|
61
|
-
<div class="{name}-view" bind:this={container} on:touchstart|capture={tippy_hide_all} />
|
|
62
|
-
<div class="{name}-left" class:hidden={!(layout === "visible" || layout === "toolbar-only")}>
|
|
63
|
-
{#if config.toolbar?.enable !== false}
|
|
64
|
-
<Toolbar {app} {theme} {language} config={config.toolbar} />
|
|
65
|
-
{/if}
|
|
66
|
-
</div>
|
|
67
|
-
<div class="{name}-bottom-left" class:hidden={layout !== "visible"}>
|
|
68
|
-
{#if config.redo_undo?.enable !== false}
|
|
69
|
-
<RedoUndo {app} {theme} {language} />
|
|
70
|
-
{/if}
|
|
71
|
-
{#if config.zoom_control?.enable !== false}
|
|
72
|
-
<ZoomControl {app} {theme} {language} />
|
|
73
|
-
{/if}
|
|
74
|
-
</div>
|
|
75
|
-
<div class="{name}-bottom-right" class:hidden={layout !== "visible"}>
|
|
76
|
-
{#if config.page_control?.enable !== false}
|
|
77
|
-
<PageControl {app} {theme} {language} />
|
|
78
|
-
{/if}
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { FastboardApp } from "@netless/fastboard-core";
|
|
3
|
+
import type { Language, Theme, FastboardUIConfig } from "../../typings";
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
import { tippy_hide_all } from "../../actions/tippy";
|
|
6
|
+
import RedoUndo from "../RedoUndo";
|
|
7
|
+
import ZoomControl from "../ZoomControl";
|
|
8
|
+
import PageControl from "../PageControl";
|
|
9
|
+
import Toolbar from "../Toolbar";
|
|
10
|
+
|
|
11
|
+
export let app: FastboardApp | null | undefined = null;
|
|
12
|
+
export let theme: Theme = "light";
|
|
13
|
+
export let language: Language = "en";
|
|
14
|
+
export let containerRef: ((element: HTMLDivElement | null) => void) | undefined = undefined;
|
|
15
|
+
export let config: FastboardUIConfig = {};
|
|
16
|
+
|
|
17
|
+
const name = "fastboard";
|
|
18
|
+
const AppsShowToolbar = ["DocsViewer", "Slide"];
|
|
19
|
+
|
|
20
|
+
let container: HTMLDivElement;
|
|
21
|
+
let layout: "hidden" | "toolbar-only" | "visible" = "hidden";
|
|
22
|
+
|
|
23
|
+
$: writable = app?.writable;
|
|
24
|
+
$: boxState = app?.boxState;
|
|
25
|
+
$: focusedApp = app?.focusedApp;
|
|
26
|
+
|
|
27
|
+
$: if (!$writable) {
|
|
28
|
+
layout = "hidden";
|
|
29
|
+
} else if ($boxState === "maximized") {
|
|
30
|
+
if ($focusedApp && AppsShowToolbar.some(kind => ($focusedApp || "").includes(kind))) {
|
|
31
|
+
layout = "toolbar-only";
|
|
32
|
+
} else {
|
|
33
|
+
layout = "hidden";
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
layout = "visible";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$: try {
|
|
40
|
+
if (app && container) app.bindContainer(container);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.error("[fastboard] An error occurred while binding container");
|
|
43
|
+
console.error(err);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
$: if (app && theme) {
|
|
47
|
+
app.manager.setPrefersColorScheme(theme);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onMount(() => {
|
|
51
|
+
if (containerRef) {
|
|
52
|
+
containerRef(container);
|
|
53
|
+
return () => {
|
|
54
|
+
if (containerRef) containerRef(null);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<div class="{name}-root" class:loading={!app}>
|
|
61
|
+
<div class="{name}-view" bind:this={container} on:touchstart|capture|passive={tippy_hide_all} />
|
|
62
|
+
<div class="{name}-left" class:hidden={!(layout === "visible" || layout === "toolbar-only")}>
|
|
63
|
+
{#if config.toolbar?.enable !== false}
|
|
64
|
+
<Toolbar {app} {theme} {language} config={config.toolbar} />
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
67
|
+
<div class="{name}-bottom-left" class:hidden={layout !== "visible"}>
|
|
68
|
+
{#if config.redo_undo?.enable !== false}
|
|
69
|
+
<RedoUndo {app} {theme} {language} />
|
|
70
|
+
{/if}
|
|
71
|
+
{#if config.zoom_control?.enable !== false}
|
|
72
|
+
<ZoomControl {app} {theme} {language} />
|
|
73
|
+
{/if}
|
|
74
|
+
</div>
|
|
75
|
+
<div class="{name}-bottom-right" class:hidden={layout !== "visible"}>
|
|
76
|
+
{#if config.page_control?.enable !== false}
|
|
77
|
+
<PageControl {app} {theme} {language} />
|
|
78
|
+
{/if}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
|
-
import type { Theme, Language, FastboardUIConfig } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "svelte";
|
|
4
|
-
|
|
5
|
-
export declare interface FastboardProps {
|
|
6
|
-
app?: FastboardApp | null;
|
|
7
|
-
theme?: Theme;
|
|
8
|
-
language?: Language;
|
|
9
|
-
containerRef?: (container: HTMLDivElement | null) => void;
|
|
10
|
-
config?: FastboardUIConfig;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare class Fastboard extends SvelteComponentTyped<FastboardProps> {}
|
|
14
|
-
export default Fastboard;
|
|
1
|
+
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
|
+
import type { Theme, Language, FastboardUIConfig } from "../../typings";
|
|
3
|
+
import { SvelteComponentTyped } from "svelte";
|
|
4
|
+
|
|
5
|
+
export declare interface FastboardProps {
|
|
6
|
+
app?: FastboardApp | null;
|
|
7
|
+
theme?: Theme;
|
|
8
|
+
language?: Language;
|
|
9
|
+
containerRef?: (container: HTMLDivElement | null) => void;
|
|
10
|
+
config?: FastboardUIConfig;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare class Fastboard extends SvelteComponentTyped<FastboardProps> {}
|
|
14
|
+
export default Fastboard;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
3
|
-
import type { Language, Theme } from "../../typings";
|
|
4
|
-
import { onMount } from "svelte";
|
|
5
|
-
import { tippy_hide_all } from "../../actions/tippy";
|
|
6
|
-
import PlayerControl from "../PlayerControl";
|
|
7
|
-
|
|
8
|
-
export let player: FastboardPlayer | null | undefined = null;
|
|
9
|
-
export let theme: Theme = "light";
|
|
10
|
-
export let language: Language = "en";
|
|
11
|
-
export let containerRef: ((element: HTMLDivElement | null) => void) | undefined = undefined;
|
|
12
|
-
|
|
13
|
-
const name = "fastboard";
|
|
14
|
-
|
|
15
|
-
let container: HTMLDivElement;
|
|
16
|
-
|
|
17
|
-
$: try {
|
|
18
|
-
if (player && container) player.bindContainer(container);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
console.error("[fastboard] An error occurred while binding container");
|
|
21
|
-
console.error(err);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
$: if (player && theme) {
|
|
25
|
-
player.manager.setPrefersColorScheme(theme);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
onMount(() => {
|
|
29
|
-
if (containerRef) {
|
|
30
|
-
containerRef(container);
|
|
31
|
-
return () => {
|
|
32
|
-
if (containerRef) containerRef(null);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<div class="{name}-root" class:loading={!player}>
|
|
39
|
-
<div class="{name}-view" bind:this={container} on:touchstart|capture={tippy_hide_all} />
|
|
40
|
-
<div class="{name}-bottom">
|
|
41
|
-
<PlayerControl {player} {theme} {language} />
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
3
|
+
import type { Language, Theme } from "../../typings";
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
import { tippy_hide_all } from "../../actions/tippy";
|
|
6
|
+
import PlayerControl from "../PlayerControl";
|
|
7
|
+
|
|
8
|
+
export let player: FastboardPlayer | null | undefined = null;
|
|
9
|
+
export let theme: Theme = "light";
|
|
10
|
+
export let language: Language = "en";
|
|
11
|
+
export let containerRef: ((element: HTMLDivElement | null) => void) | undefined = undefined;
|
|
12
|
+
|
|
13
|
+
const name = "fastboard";
|
|
14
|
+
|
|
15
|
+
let container: HTMLDivElement;
|
|
16
|
+
|
|
17
|
+
$: try {
|
|
18
|
+
if (player && container) player.bindContainer(container);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error("[fastboard] An error occurred while binding container");
|
|
21
|
+
console.error(err);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
$: if (player && theme) {
|
|
25
|
+
player.manager.setPrefersColorScheme(theme);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
onMount(() => {
|
|
29
|
+
if (containerRef) {
|
|
30
|
+
containerRef(container);
|
|
31
|
+
return () => {
|
|
32
|
+
if (containerRef) containerRef(null);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div class="{name}-root" class:loading={!player}>
|
|
39
|
+
<div class="{name}-view" bind:this={container} on:touchstart|capture|passive={tippy_hide_all} />
|
|
40
|
+
<div class="{name}-bottom">
|
|
41
|
+
<PlayerControl {player} {theme} {language} />
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
2
|
-
import type { Theme, Language } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "svelte";
|
|
4
|
-
|
|
5
|
-
export declare interface ReplayFastboardProps {
|
|
6
|
-
player?: FastboardPlayer | null;
|
|
7
|
-
theme?: Theme;
|
|
8
|
-
language?: Language;
|
|
9
|
-
containerRef?: (container: HTMLDivElement | null) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare class ReplayFastboard extends SvelteComponentTyped<ReplayFastboardProps> {}
|
|
13
|
-
export default ReplayFastboard;
|
|
1
|
+
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
2
|
+
import type { Theme, Language } from "../../typings";
|
|
3
|
+
import { SvelteComponentTyped } from "svelte";
|
|
4
|
+
|
|
5
|
+
export declare interface ReplayFastboardProps {
|
|
6
|
+
player?: FastboardPlayer | null;
|
|
7
|
+
theme?: Theme;
|
|
8
|
+
language?: Language;
|
|
9
|
+
containerRef?: (container: HTMLDivElement | null) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare class ReplayFastboard extends SvelteComponentTyped<ReplayFastboardProps> {}
|
|
13
|
+
export default ReplayFastboard;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as ReplayFastboard } from "./ReplayFastboard.svelte";
|
|
2
|
-
export * from "./ReplayFastboard.svelte";
|
|
3
|
-
|
|
4
|
-
export { default as Fastboard } from "./Fastboard.svelte";
|
|
5
|
-
export * from "./Fastboard.svelte";
|
|
1
|
+
export { default as ReplayFastboard } from "./ReplayFastboard.svelte";
|
|
2
|
+
export * from "./ReplayFastboard.svelte";
|
|
3
|
+
|
|
4
|
+
export { default as Fastboard } from "./Fastboard.svelte";
|
|
5
|
+
export * from "./Fastboard.svelte";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
export let src = "";
|
|
3
|
-
export let alt = "";
|
|
4
|
-
export let title = "";
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
{#if src}
|
|
8
|
-
<img {src} {alt} title={title || alt} />
|
|
9
|
-
{:else}
|
|
10
|
-
<slot />
|
|
11
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let src = "";
|
|
3
|
+
export let alt = "";
|
|
4
|
+
export let title = "";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
{#if src}
|
|
8
|
+
<img {src} {alt} title={title || alt} />
|
|
9
|
+
{:else}
|
|
10
|
+
<slot />
|
|
11
|
+
{/if}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
|
|
3
|
-
export declare interface IconProps {
|
|
4
|
-
src?: string;
|
|
5
|
-
alt?: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare class Icon extends SvelteComponentTyped<IconProps> {}
|
|
10
|
-
export default Icon;
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export declare interface IconProps {
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare class Icon extends SvelteComponentTyped<IconProps> {}
|
|
10
|
+
export default Icon;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./Icon.svelte";
|
|
2
|
-
export * from "./Icon.svelte";
|
|
1
|
+
export { default } from "./Icon.svelte";
|
|
2
|
+
export * from "./Icon.svelte";
|
|
@@ -1,49 +1,49 @@
|
|
|
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
|
-
<rect
|
|
10
|
-
x="5"
|
|
11
|
-
y="5"
|
|
12
|
-
width="6"
|
|
13
|
-
height="6"
|
|
14
|
-
stroke="#5D6066"
|
|
15
|
-
stroke-width="1.25"
|
|
16
|
-
stroke-linejoin="round"
|
|
17
|
-
class="fastboard-icon-stroke-color"
|
|
18
|
-
/>
|
|
19
|
-
<rect
|
|
20
|
-
x="13"
|
|
21
|
-
y="5"
|
|
22
|
-
width="6"
|
|
23
|
-
height="6"
|
|
24
|
-
stroke="#5D6066"
|
|
25
|
-
stroke-width="1.25"
|
|
26
|
-
stroke-linejoin="round"
|
|
27
|
-
class="fastboard-icon-stroke-color"
|
|
28
|
-
/>
|
|
29
|
-
<rect
|
|
30
|
-
x="5"
|
|
31
|
-
y="13"
|
|
32
|
-
width="6"
|
|
33
|
-
height="6"
|
|
34
|
-
stroke="#5D6066"
|
|
35
|
-
stroke-width="1.25"
|
|
36
|
-
stroke-linejoin="round"
|
|
37
|
-
class="fastboard-icon-stroke-color"
|
|
38
|
-
/>
|
|
39
|
-
<rect
|
|
40
|
-
x="13"
|
|
41
|
-
y="13"
|
|
42
|
-
width="6"
|
|
43
|
-
height="6"
|
|
44
|
-
stroke="#5D6066"
|
|
45
|
-
stroke-width="1.25"
|
|
46
|
-
stroke-linejoin="round"
|
|
47
|
-
class="fastboard-icon-stroke-color"
|
|
48
|
-
/>
|
|
49
|
-
</svg>
|
|
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
|
+
<rect
|
|
10
|
+
x="5"
|
|
11
|
+
y="5"
|
|
12
|
+
width="6"
|
|
13
|
+
height="6"
|
|
14
|
+
stroke="#5D6066"
|
|
15
|
+
stroke-width="1.25"
|
|
16
|
+
stroke-linejoin="round"
|
|
17
|
+
class="fastboard-icon-stroke-color"
|
|
18
|
+
/>
|
|
19
|
+
<rect
|
|
20
|
+
x="13"
|
|
21
|
+
y="5"
|
|
22
|
+
width="6"
|
|
23
|
+
height="6"
|
|
24
|
+
stroke="#5D6066"
|
|
25
|
+
stroke-width="1.25"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
class="fastboard-icon-stroke-color"
|
|
28
|
+
/>
|
|
29
|
+
<rect
|
|
30
|
+
x="5"
|
|
31
|
+
y="13"
|
|
32
|
+
width="6"
|
|
33
|
+
height="6"
|
|
34
|
+
stroke="#5D6066"
|
|
35
|
+
stroke-width="1.25"
|
|
36
|
+
stroke-linejoin="round"
|
|
37
|
+
class="fastboard-icon-stroke-color"
|
|
38
|
+
/>
|
|
39
|
+
<rect
|
|
40
|
+
x="13"
|
|
41
|
+
y="13"
|
|
42
|
+
width="6"
|
|
43
|
+
height="6"
|
|
44
|
+
stroke="#5D6066"
|
|
45
|
+
stroke-width="1.25"
|
|
46
|
+
stroke-linejoin="round"
|
|
47
|
+
class="fastboard-icon-stroke-color"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
stroke="#5D6066"
|
|
11
|
-
stroke-linejoin="round"
|
|
12
|
-
stroke-width="1.25"
|
|
13
|
-
d="M5 19 15.5 8.5M17 12l2-7-7 2 3.5 1.5L17 12Z"
|
|
14
|
-
class="fastboard-icon-stroke-color"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
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
|
+
stroke="#5D6066"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
stroke-width="1.25"
|
|
13
|
+
d="M5 19 15.5 8.5M17 12l2-7-7 2 3.5 1.5L17 12Z"
|
|
14
|
+
class="fastboard-icon-stroke-color"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
stroke="#5D6066"
|
|
11
|
-
stroke-linejoin="round"
|
|
12
|
-
stroke-width="1.75"
|
|
13
|
-
d="M5 19 15.5 8.5"
|
|
14
|
-
class="fastboard-icon-stroke-color"
|
|
15
|
-
/>
|
|
16
|
-
<path fill="#5D6066" d="m17 12 2-7-7 2 3.5 1.5L17 12Z" class="fastboard-icon-fill-color" />
|
|
17
|
-
</svg>
|
|
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
|
+
stroke="#5D6066"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
stroke-width="1.75"
|
|
13
|
+
d="M5 19 15.5 8.5"
|
|
14
|
+
class="fastboard-icon-stroke-color"
|
|
15
|
+
/>
|
|
16
|
+
<path fill="#5D6066" d="m17 12 2-7-7 2 3.5 1.5L17 12Z" class="fastboard-icon-fill-color" />
|
|
17
|
+
</svg>
|