@netless/fastboard-ui 0.3.8 → 0.3.9
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.d.ts +9 -2
- package/dist/index.js +3936 -1451
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3918 -1423
- package/dist/index.mjs.map +1 -1
- package/dist/index.svelte.mjs +5839 -4305
- package/dist/index.svelte.mjs.map +1 -1
- package/package.json +6 -5
- package/src/actions/tippy.ts +1 -2
- package/src/components/Button/Button.svelte.d.ts +1 -1
- package/src/components/Fastboard/Fastboard.svelte.d.ts +1 -1
- package/src/components/Fastboard/ReplayFastboard.svelte +5 -2
- package/src/components/Fastboard/ReplayFastboard.svelte.d.ts +3 -2
- package/src/components/Icon/Icon.svelte.d.ts +1 -1
- package/src/components/PageControl/PageControl.svelte.d.ts +1 -1
- package/src/components/PlayerControl/PlayerControl.svelte.d.ts +1 -1
- package/src/components/RedoUndo/RedoUndo.svelte.d.ts +1 -1
- package/src/components/Toolbar/Toolbar.svelte.d.ts +1 -1
- package/src/components/Toolbar/components/Slider.scss +3 -1
- package/src/components/Toolbar/components/Slider.svelte +0 -1
- package/src/components/Toolbar/components/constants.ts +1 -1
- package/src/components/ZoomControl/ZoomControl.svelte.d.ts +1 -1
- package/src/helpers/index.ts +2 -2
- package/src/typings.ts +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "The front-end of @netless/fastboard-core.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"svelte": "dist/index.svelte.mjs",
|
|
@@ -10,19 +10,20 @@
|
|
|
10
10
|
],
|
|
11
11
|
"repository": "netless-io/fastboard",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@netless/fastboard-core": "0.3.
|
|
13
|
+
"@netless/fastboard-core": "0.3.9"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"tippy.js": "^6.3.7"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@netless/fastboard-core": "0.3.
|
|
20
|
-
"@netless/esbuild-plugin-inline-sass": "0.1.0"
|
|
19
|
+
"@netless/fastboard-core": "0.3.9",
|
|
20
|
+
"@netless/esbuild-plugin-inline-sass": "0.1.0",
|
|
21
|
+
"@netless/buildtool": "0.1.0"
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
24
|
"cleanup": "rimraf dist",
|
|
24
25
|
"check": "tsc --noEmit && svelte-check",
|
|
25
|
-
"build": "
|
|
26
|
+
"build": "buildtool",
|
|
26
27
|
"dev": "vite",
|
|
27
28
|
"test:ssr": "esbuild-dev test/ssr.ts"
|
|
28
29
|
},
|
package/src/actions/tippy.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Instance, Props } from "tippy.js";
|
|
2
2
|
import type { SvelteAction } from "../typings";
|
|
3
|
-
import { is_client } from "svelte/internal";
|
|
4
3
|
|
|
5
4
|
import Tippy from "tippy.js";
|
|
6
5
|
|
|
7
|
-
if (
|
|
6
|
+
if (typeof window !== "undefined") {
|
|
8
7
|
Tippy.setDefaultProps({
|
|
9
8
|
delay: [1000, 400],
|
|
10
9
|
duration: 300,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
2
|
import type { Theme, Language, FastboardUIConfig } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface FastboardProps {
|
|
6
6
|
app?: FastboardApp | null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
5
|
-
import type { Language, Theme } from "../../typings";
|
|
5
|
+
import type { Language, ReplayFastboardUIConfig, Theme } from "../../typings";
|
|
6
6
|
import { onMount } from "svelte";
|
|
7
7
|
import { tippy_hide_all } from "../../actions/tippy";
|
|
8
8
|
import PlayerControl from "../PlayerControl";
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export let theme: Theme = "light";
|
|
12
12
|
export let language: Language = "en";
|
|
13
13
|
export let containerRef: ((element: HTMLDivElement | null) => void) | undefined = undefined;
|
|
14
|
+
export let config: ReplayFastboardUIConfig = {};
|
|
14
15
|
|
|
15
16
|
const name = "fastboard";
|
|
16
17
|
|
|
@@ -51,6 +52,8 @@
|
|
|
51
52
|
<div class="{name}-root" class:loading={!player}>
|
|
52
53
|
<div class="{name}-view" bind:this={container} on:touchstart|capture={focus_me} />
|
|
53
54
|
<div class="{name}-bottom">
|
|
54
|
-
|
|
55
|
+
{#if config.player_control?.enable !== false}
|
|
56
|
+
<PlayerControl {player} {theme} {language} />
|
|
57
|
+
{/if}
|
|
55
58
|
</div>
|
|
56
59
|
</div>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
2
|
-
import type { Theme, Language } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
2
|
+
import type { Theme, Language, ReplayFastboardUIConfig } from "../../typings";
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface ReplayFastboardProps {
|
|
6
6
|
player?: FastboardPlayer | null;
|
|
7
7
|
theme?: Theme;
|
|
8
8
|
language?: Language;
|
|
9
9
|
containerRef?: (container: HTMLDivElement | null) => void;
|
|
10
|
+
config?: ReplayFastboardUIConfig;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
declare class ReplayFastboard extends SvelteComponentTyped<ReplayFastboardProps> {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
2
|
import type { Theme, Language, GenericIcon } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface PageControlProps {
|
|
6
6
|
app?: FastboardApp | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
2
2
|
import type { Theme, Language, GenericIcon } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface PlayerControlProps {
|
|
6
6
|
player?: FastboardPlayer | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
2
|
import type { Theme, Language, GenericIcon } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface RedoUndoProps {
|
|
6
6
|
app?: FastboardApp | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
2
|
import type { Theme, Language, ToolbarConfig } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface ToolbarProps {
|
|
6
6
|
app?: FastboardApp | null;
|
|
@@ -22,7 +22,9 @@ $thumb-color: white;
|
|
|
22
22
|
background: $thumb-color;
|
|
23
23
|
border: 0;
|
|
24
24
|
border-radius: 100%;
|
|
25
|
-
box-shadow:
|
|
25
|
+
box-shadow:
|
|
26
|
+
0 1px 1px rgba($shadow-color, 0.15),
|
|
27
|
+
0 0 0 1px rgba($shadow-color, 0.2);
|
|
26
28
|
width: $thumb-height;
|
|
27
29
|
height: $thumb-height;
|
|
28
30
|
position: relative;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastboardApp } from "@netless/fastboard-core";
|
|
2
2
|
import type { Theme, Language, GenericIcon } from "../../typings";
|
|
3
|
-
import { SvelteComponentTyped } from "
|
|
3
|
+
import { SvelteComponentTyped } from "../../typings";
|
|
4
4
|
|
|
5
5
|
export declare interface ZoomControlProps {
|
|
6
6
|
app?: FastboardApp | null;
|
package/src/helpers/index.ts
CHANGED
|
@@ -29,7 +29,7 @@ export function createUI(app?: FastboardApp | null, div?: Element): UI {
|
|
|
29
29
|
return ui;
|
|
30
30
|
},
|
|
31
31
|
update(props?: FastboardProps) {
|
|
32
|
-
if (fastboard) {
|
|
32
|
+
if (fastboard && props) {
|
|
33
33
|
fastboard.$set(props);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -74,7 +74,7 @@ export function createReplayUI(player?: FastboardPlayer | null, div?: Element):
|
|
|
74
74
|
return ui;
|
|
75
75
|
},
|
|
76
76
|
update(props?: ReplayFastboardProps) {
|
|
77
|
-
if (fastboard) {
|
|
77
|
+
if (fastboard && props) {
|
|
78
78
|
fastboard.$set(props);
|
|
79
79
|
}
|
|
80
80
|
},
|
package/src/typings.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/// <reference types="svelte/types/runtime/ambient.d.ts" />
|
|
2
|
+
|
|
3
|
+
export { SvelteComponentTyped } from "svelte/internal";
|
|
4
|
+
|
|
1
5
|
export interface SvelteAction<T = void> {
|
|
2
|
-
(
|
|
6
|
+
(
|
|
7
|
+
node: HTMLElement,
|
|
8
|
+
parameters: T
|
|
9
|
+
): void | {
|
|
3
10
|
update?: (parameters: T) => void;
|
|
4
11
|
destroy?: () => void;
|
|
5
12
|
};
|
|
@@ -36,3 +43,9 @@ export interface FastboardUIConfig {
|
|
|
36
43
|
enable?: boolean;
|
|
37
44
|
};
|
|
38
45
|
}
|
|
46
|
+
|
|
47
|
+
export interface ReplayFastboardUIConfig {
|
|
48
|
+
player_control?: {
|
|
49
|
+
enable?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|