@netless/fastboard-ui 0.3.0-canary.5 → 0.3.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.d.ts +1 -1
- package/dist/index.js +165 -111
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +156 -95
- package/dist/index.mjs.map +1 -1
- package/dist/index.svelte.mjs +161 -105
- package/dist/index.svelte.mjs.map +1 -1
- package/package.json +3 -3
- package/src/actions/tippy.ts +1 -0
- package/src/behaviors/index.ts +2 -2
- package/src/components/Fastboard/Fastboard.svelte +10 -1
- package/src/components/Fastboard/ReplayFastboard.svelte +20 -2
- package/src/components/PageControl/PageControl.svelte +1 -0
- package/src/components/PlayerControl/PlayerControl.svelte +1 -1
- package/src/components/Toolbar/components/Contents.scss +4 -2
- package/src/components/Toolbar/components/Contents.svelte +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard-ui",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.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,14 +10,14 @@
|
|
|
10
10
|
],
|
|
11
11
|
"repository": "netless-io/fastboard",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@netless/fastboard-core": "0.3.0
|
|
13
|
+
"@netless/fastboard-core": "0.3.0"
|
|
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.0
|
|
20
|
+
"@netless/fastboard-core": "0.3.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"cleanup": "rimraf dist",
|
package/src/actions/tippy.ts
CHANGED
package/src/behaviors/index.ts
CHANGED
|
@@ -26,8 +26,8 @@ class AppsInToolbar {
|
|
|
26
26
|
this._listeners = this._listeners.filter(item => item !== fn);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
push(data: AppInToolbar) {
|
|
30
|
-
this._data.push(data);
|
|
29
|
+
push(...data: AppInToolbar[]) {
|
|
30
|
+
this._data.push(...data);
|
|
31
31
|
this._listeners.forEach(fn => fn(this._data));
|
|
32
32
|
}
|
|
33
33
|
insert(data: AppInToolbar, index: number) {
|
|
@@ -17,7 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
let container: HTMLDivElement;
|
|
19
19
|
|
|
20
|
-
$:
|
|
20
|
+
$: try {
|
|
21
|
+
if (app && container) app.bindContainer(container);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
console.error("[fastboard] An error occurred while binding container");
|
|
24
|
+
console.error(err);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
$: if (app && theme) {
|
|
28
|
+
app.manager.setPrefersColorScheme(theme);
|
|
29
|
+
}
|
|
21
30
|
|
|
22
31
|
onMount(() => {
|
|
23
32
|
if (containerRef) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FastboardPlayer } from "@netless/fastboard-core";
|
|
3
3
|
import type { Language, Theme } from "../../typings";
|
|
4
|
+
import { onMount } from "svelte";
|
|
4
5
|
import { tippy_hide_all } from "../../actions/tippy";
|
|
5
6
|
import PlayerControl from "../PlayerControl";
|
|
6
7
|
|
|
@@ -13,8 +14,25 @@
|
|
|
13
14
|
|
|
14
15
|
let container: HTMLDivElement;
|
|
15
16
|
|
|
16
|
-
$:
|
|
17
|
-
|
|
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
|
+
});
|
|
18
36
|
</script>
|
|
19
37
|
|
|
20
38
|
<div class="{name}-root" class:loading={!player}>
|
|
@@ -112,14 +112,15 @@ $name: "fastboard-toolbar";
|
|
|
112
112
|
|
|
113
113
|
.#{$name}-panel.apps {
|
|
114
114
|
display: grid;
|
|
115
|
-
grid-template-columns: repeat(3, 1fr);
|
|
115
|
+
grid-template-columns: repeat(min(var(--n, 3), 3), minmax(max-content, 1fr));
|
|
116
116
|
gap: 4px;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.#{$name}-app-btn {
|
|
120
120
|
margin: 0;
|
|
121
121
|
border: 0;
|
|
122
|
-
|
|
122
|
+
border-radius: 2px;
|
|
123
|
+
padding: 4px 6px;
|
|
123
124
|
background-color: transparent;
|
|
124
125
|
display: inline-flex;
|
|
125
126
|
flex-direction: column;
|
|
@@ -139,6 +140,7 @@ $name: "fastboard-toolbar";
|
|
|
139
140
|
|
|
140
141
|
&-text {
|
|
141
142
|
font-size: 14px;
|
|
143
|
+
line-height: 1;
|
|
142
144
|
max-width: 100%;
|
|
143
145
|
overflow: hidden;
|
|
144
146
|
text-overflow: ellipsis;
|
|
@@ -172,8 +172,8 @@
|
|
|
172
172
|
<div class="{name}-panel-divider" />
|
|
173
173
|
<StrokeColor {app} {theme} {disabled} />
|
|
174
174
|
</div>
|
|
175
|
-
<div class="{name}-panel apps" bind:this={apps_panel}>
|
|
176
|
-
{#each apps
|
|
175
|
+
<div class="{name}-panel apps" style="--n:{$apps.length}" bind:this={apps_panel}>
|
|
176
|
+
{#each $apps as netless_app}
|
|
177
177
|
{@const { icon, label, kind, onClick } = netless_app}
|
|
178
178
|
{@const state = $status && $status[kind]}
|
|
179
179
|
<button
|