@netless/fastboard-ui 1.0.0-canary.9 → 1.0.1-beta.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.
Files changed (65) hide show
  1. package/dist/full.d.ts +178 -0
  2. package/dist/index.d.ts +74 -75
  3. package/dist/index.js +4200 -3679
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +4188 -3650
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/index.svelte.mjs +6102 -6540
  8. package/dist/index.svelte.mjs.map +1 -0
  9. package/dist/lite.d.ts +178 -0
  10. package/full.d.ts +1 -0
  11. package/lite.d.ts +1 -0
  12. package/package.json +24 -10
  13. package/src/actions/tippy.ts +6 -11
  14. package/src/behaviors/apps.ts +38 -4
  15. package/src/components/Button/Button.svelte +1 -4
  16. package/src/components/Button/Button.svelte.d.ts +1 -2
  17. package/src/components/Fastboard/Fastboard.scss +14 -2
  18. package/src/components/Fastboard/Fastboard.svelte +15 -5
  19. package/src/components/Fastboard/Fastboard.svelte.d.ts +6 -2
  20. package/src/components/Fastboard/ReplayFastboard.svelte +2 -2
  21. package/src/components/Fastboard/ReplayFastboard.svelte.d.ts +3 -3
  22. package/src/components/Icon/Icon.svelte.d.ts +1 -1
  23. package/src/components/Icons/{PencilEraser.svelte → Drag.svelte} +2 -2
  24. package/src/components/Icons/{PencilEraserFilled.svelte → DragFilled.svelte} +1 -3
  25. package/src/components/Icons/Eraser.svelte +1 -35
  26. package/src/components/Icons/EraserFilled.svelte +2 -2
  27. package/src/components/Icons/Laser.svelte +21 -0
  28. package/src/components/Icons/LaserFilled.svelte +14 -0
  29. package/src/components/Icons/LaserPen.svelte +20 -0
  30. package/src/components/Icons/LaserPenFilled.svelte +20 -0
  31. package/src/components/Icons/index.ts +12 -11
  32. package/src/components/PageControl/PageControl.svelte +4 -3
  33. package/src/components/PageControl/PageControl.svelte.d.ts +1 -1
  34. package/src/components/PlayerControl/PlayerControl.svelte.d.ts +1 -1
  35. package/src/components/RedoUndo/RedoUndo.svelte +2 -1
  36. package/src/components/RedoUndo/RedoUndo.svelte.d.ts +1 -1
  37. package/src/components/Toolbar/Toolbar.scss +14 -4
  38. package/src/components/Toolbar/Toolbar.svelte +34 -27
  39. package/src/components/Toolbar/Toolbar.svelte.d.ts +2 -19
  40. package/src/components/Toolbar/components/Contents.scss +19 -14
  41. package/src/components/Toolbar/components/Contents.svelte +98 -235
  42. package/src/components/Toolbar/components/Slider.scss +3 -1
  43. package/src/components/Toolbar/components/StrokeColor.svelte +12 -7
  44. package/src/components/Toolbar/components/TextColor.svelte +12 -7
  45. package/src/components/Toolbar/components/constants.ts +22 -36
  46. package/src/components/Toolbar/components/helper.ts +24 -2
  47. package/src/components/Toolbar/definitions/Clear.svelte +13 -0
  48. package/src/components/Toolbar/definitions/Clicker.svelte +19 -0
  49. package/src/components/Toolbar/definitions/Eraser.svelte +19 -0
  50. package/src/components/Toolbar/definitions/Hand.svelte +19 -0
  51. package/src/components/Toolbar/definitions/Laser.svelte +19 -0
  52. package/src/components/Toolbar/definitions/Pencil.svelte +23 -0
  53. package/src/components/Toolbar/definitions/Selector.svelte +19 -0
  54. package/src/components/Toolbar/definitions/Shapes.svelte +41 -0
  55. package/src/components/Toolbar/definitions/Text.svelte +20 -0
  56. package/src/components/ZoomControl/ZoomControl.svelte +5 -6
  57. package/src/components/ZoomControl/ZoomControl.svelte.d.ts +1 -1
  58. package/src/components/theme.scss +4 -11
  59. package/src/helpers/index.ts +60 -64
  60. package/src/typings.ts +42 -25
  61. package/dist/index.css +0 -888
  62. package/src/components/Icons/Curve.svelte +0 -10
  63. package/src/components/Icons/CurveDashed.svelte +0 -16
  64. package/src/components/Toolbar/components/PencilEraserSize.svelte +0 -27
  65. /package/src/components/Toolbar/components/{Shapes.svelte → SelectShapes.svelte} +0 -0
package/dist/lite.d.ts ADDED
@@ -0,0 +1,178 @@
1
+ import { Color, FastboardApp, FastboardPlayer } from '@netless/fastboard-core/lite';
2
+ import { SvelteComponentTyped } from 'svelte/internal';
3
+ export { SvelteComponentTyped } from 'svelte/internal';
4
+
5
+ interface SvelteAction<T = void> {
6
+ (node: HTMLElement, parameters: T): void | {
7
+ update?: (parameters: T) => void;
8
+ destroy?: () => void;
9
+ };
10
+ }
11
+ type Theme = "light" | "dark";
12
+ type Language = "en" | "zh-CN";
13
+ type IconType = "normal" | "disable";
14
+ type GenericIcon<K extends string, E extends string = IconType> = {
15
+ [key in K]: {
16
+ [kind in E]: string;
17
+ };
18
+ };
19
+ type I18nData<T extends string> = Record<Language, Record<T, string>>;
20
+ type ToolbarItem = "clicker" | "selector" | "pencil" | "text" | "shapes" | "eraser" | "clear" | "hand" | "laserPointer";
21
+ interface ToolbarConfig {
22
+ /** @default "left" */
23
+ placement?: "left" | "right";
24
+ /** @default ["clicker", "selector", "pencil", "text", "shapes", "eraser", "clear"] */
25
+ items?: ToolbarItem[];
26
+ /**
27
+ * Note: updating this option does not take effect when the element was mounted.
28
+ * Make sure to set this option in `UI.mount(div, { configs: { toolbar: { collapsed: true } } })`.
29
+ * @default false
30
+ */
31
+ collapsed?: boolean;
32
+ /** Control the last button which opens apps stock on toolbar. */
33
+ apps?: {
34
+ enable?: boolean;
35
+ };
36
+ /** 颜色 */
37
+ colors?: Color[];
38
+ }
39
+ interface FastboardUIConfig {
40
+ toolbar?: {
41
+ enable?: boolean;
42
+ } & ToolbarConfig;
43
+ redo_undo?: {
44
+ enable?: boolean;
45
+ };
46
+ zoom_control?: {
47
+ enable?: boolean;
48
+ };
49
+ page_control?: {
50
+ enable?: boolean;
51
+ };
52
+ }
53
+ interface ReplayFastboardUIConfig {
54
+ player_control?: {
55
+ enable?: boolean;
56
+ };
57
+ }
58
+
59
+ declare interface RedoUndoProps {
60
+ app?: FastboardApp | null;
61
+ theme?: Theme;
62
+ language?: Language;
63
+ icons?: GenericIcon<"undo" | "redo">;
64
+ }
65
+
66
+ declare class RedoUndo extends SvelteComponentTyped<RedoUndoProps> {}
67
+
68
+ declare interface PageControlProps {
69
+ app?: FastboardApp | null;
70
+ theme?: Theme;
71
+ language?: Language;
72
+ icons?: GenericIcon<"prev" | "next" | "add">;
73
+ }
74
+
75
+ declare class PageControl extends SvelteComponentTyped<PageControlProps> {}
76
+
77
+ declare interface ZoomControlProps {
78
+ app?: FastboardApp | null;
79
+ theme?: Theme;
80
+ language?: Language;
81
+ icons?: GenericIcon<"plus" | "minus" | "reset">;
82
+ }
83
+
84
+ declare class ZoomControl extends SvelteComponentTyped<ZoomControlProps> {}
85
+
86
+ declare interface ToolbarProps {
87
+ app?: FastboardApp | null;
88
+ theme?: Theme;
89
+ language?: Language;
90
+ config?: ToolbarConfig;
91
+ }
92
+
93
+ declare class Toolbar extends SvelteComponentTyped<ToolbarProps> {}
94
+
95
+ declare interface PlayerControlProps {
96
+ player?: FastboardPlayer | null;
97
+ theme?: Theme;
98
+ language?: Language;
99
+ icons?: GenericIcon<"play" | "pause" | "loading">;
100
+ }
101
+
102
+ declare class PlayerControl extends SvelteComponentTyped<PlayerControlProps> {}
103
+
104
+ declare interface ReplayFastboardProps {
105
+ player?: FastboardPlayer | null;
106
+ theme?: Theme;
107
+ language?: Language;
108
+ containerRef?: (container: HTMLDivElement | null) => void;
109
+ config?: ReplayFastboardUIConfig;
110
+ }
111
+
112
+ declare class ReplayFastboard extends SvelteComponentTyped<ReplayFastboardProps> {}
113
+
114
+ declare interface FastboardProps {
115
+ app?: FastboardApp | null;
116
+ theme?: Theme;
117
+ language?: Language;
118
+ /**
119
+ * Note: updating this option does not take effect when the element was mounted.
120
+ * Make sure to set this option in `UI.mount(div, { containerRef })`.
121
+ */
122
+ containerRef?: (container: HTMLDivElement | null) => void;
123
+ config?: FastboardUIConfig;
124
+ }
125
+
126
+ declare class Fastboard extends SvelteComponentTyped<FastboardProps> {}
127
+
128
+ interface UI {
129
+ /** render UI to div */
130
+ mount(div: Element, props?: FastboardProps): UI;
131
+ /** update UI (theme, language, etc.) */
132
+ update(props?: FastboardProps): void;
133
+ /** remove UI */
134
+ destroy(): void;
135
+ }
136
+ /**
137
+ * @example
138
+ * let ui = createUI(fastboardApp, document.getElementById("whiteboard"));
139
+ * ui.update({ theme: "dark" })
140
+ */
141
+ declare function createUI(app?: FastboardApp | null, div?: Element): UI;
142
+ interface ReplayUI {
143
+ /** render UI to div */
144
+ mount(div: Element, props?: ReplayFastboardProps): ReplayUI;
145
+ /** update UI (theme, language, etc.) */
146
+ update(props?: ReplayFastboardProps): void;
147
+ /** remove UI */
148
+ destroy(): void;
149
+ }
150
+ /**
151
+ * @example
152
+ * let ui = createReplayUI(fastboardPlayer, document.getElementById("whiteboard"));
153
+ * ui.update({ theme: "dark" })
154
+ */
155
+ declare function createReplayUI(player?: FastboardPlayer | null, div?: Element): ReplayUI;
156
+
157
+ interface AppInToolbar {
158
+ kind: string;
159
+ icon: string;
160
+ label: string;
161
+ onClick: (app: FastboardApp) => void;
162
+ }
163
+ declare class AppsInToolbar {
164
+ private _data;
165
+ _listeners: Array<(data: AppInToolbar[]) => void>;
166
+ constructor(_data: AppInToolbar[]);
167
+ get data(): AppInToolbar[];
168
+ get length(): number;
169
+ subscribe(fn: (data: AppInToolbar[]) => void): () => void;
170
+ push(...data: AppInToolbar[]): void;
171
+ insert(data: AppInToolbar, index: number): void;
172
+ delete(filter: (data: AppInToolbar) => boolean): void;
173
+ clear(): void;
174
+ }
175
+
176
+ declare const apps: AppsInToolbar;
177
+
178
+ export { AppInToolbar, AppsInToolbar, Fastboard, FastboardProps, FastboardUIConfig, GenericIcon, I18nData, IconType, Language, PageControl, PageControlProps, PlayerControl, PlayerControlProps, RedoUndo, RedoUndoProps, ReplayFastboard, ReplayFastboardProps, ReplayFastboardUIConfig, ReplayUI, SvelteAction, Theme, Toolbar, ToolbarConfig, ToolbarItem, ToolbarProps, UI, ZoomControl, ZoomControlProps, apps, createReplayUI, createUI };
package/full.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./dist/full";
package/lite.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./dist/lite";
package/package.json CHANGED
@@ -1,34 +1,48 @@
1
1
  {
2
2
  "name": "@netless/fastboard-ui",
3
- "version": "1.0.0-canary.9",
3
+ "version": "1.0.1-beta.0",
4
4
  "description": "The front-end of @netless/fastboard-core.",
5
5
  "main": "dist/index.js",
6
6
  "svelte": "dist/index.svelte.mjs",
7
7
  "files": [
8
8
  "src",
9
- "dist"
10
- ],
11
- "sideEffects": [
12
- "dist/index.css"
9
+ "dist",
10
+ "lite.d.ts",
11
+ "full.d.ts"
13
12
  ],
14
13
  "repository": "netless-io/fastboard",
15
14
  "peerDependencies": {
16
- "@netless/fastboard-core": "1.0.0-canary.9"
15
+ "@netless/fastboard-core": "1.0.1-beta.0"
17
16
  },
18
17
  "dependencies": {
19
18
  "tippy.js": "^6.3.7"
20
19
  },
21
20
  "devDependencies": {
22
- "@netless/esbuild-plugin-inline-sass": "0.1.0",
23
- "@netless/fastboard-core": "1.0.0-canary.9"
21
+ "@netless/fastboard-core": "1.0.1-beta.0",
22
+ "@netless/buildtool": "0.1.0",
23
+ "@netless/esbuild-plugin-inline-sass": "0.1.0"
24
24
  },
25
25
  "scripts": {
26
26
  "cleanup": "rimraf dist",
27
27
  "check": "tsc --noEmit && svelte-check",
28
- "build": "tsup",
28
+ "build": "buildtool",
29
29
  "dev": "vite",
30
30
  "test:ssr": "esbuild-dev test/ssr.ts"
31
31
  },
32
32
  "module": "dist/index.mjs",
33
- "types": "dist/index.d.ts"
33
+ "types": "dist/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.mjs"
38
+ },
39
+ "./lite": {
40
+ "types": "./dist/lite.d.ts",
41
+ "default": "./dist/index.mjs"
42
+ },
43
+ "./full": {
44
+ "types": "./dist/full.d.ts",
45
+ "default": "./dist/index.mjs"
46
+ }
47
+ }
34
48
  }
@@ -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 (is_client) {
6
+ if (typeof window !== "undefined") {
8
7
  Tippy.setDefaultProps({
9
8
  delay: [1000, 400],
10
9
  duration: 300,
@@ -19,7 +18,7 @@ if (is_client) {
19
18
  const el = instance.popper.firstElementChild;
20
19
  if (el) {
21
20
  el.classList.add("fastboard-tip");
22
-
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
22
  const extra = ((instance.props as any).className || "").trim();
24
23
  if (extra) {
25
24
  el.classList.add(extra);
@@ -56,14 +55,10 @@ export const tippy: SvelteAction<Partial<Props & { className: string }>> = funct
56
55
  };
57
56
 
58
57
  export function tippy_hide_all() {
59
- document.querySelectorAll("[data-tippy-root]").forEach(tippy_hide);
60
- }
61
-
62
- export function tippy_hide(el: Element) {
63
- const instance = (el as unknown as { _tippy: Instance })._tippy;
64
- if (instance) {
65
- instance.hide();
66
- }
58
+ document.querySelectorAll("[data-tippy-root]").forEach(el => {
59
+ const instance = (el as unknown as { _tippy: Instance })._tippy;
60
+ if (instance) instance.hide();
61
+ });
67
62
  }
68
63
 
69
64
  export const tippy_menu: Partial<Props> = {
@@ -1,7 +1,7 @@
1
1
  import type { FastboardApp } from "@netless/fastboard-core";
2
- // import code_editor_svg from "./icons/visual-studio-code.svg";
3
- // import geogebra_svg from "./icons/geogebra.svg";
4
- // import countdown_svg from "./icons/countdown.svg";
2
+ import code_editor_svg from "./icons/visual-studio-code.svg";
3
+ import geogebra_svg from "./icons/geogebra.svg";
4
+ import countdown_svg from "./icons/countdown.svg";
5
5
 
6
6
  export interface AppInToolbar {
7
7
  kind: string;
@@ -46,4 +46,38 @@ class AppsInToolbar {
46
46
 
47
47
  export type { AppsInToolbar };
48
48
 
49
- export const stockedApps = new AppsInToolbar([]);
49
+ export const apps = new AppsInToolbar([
50
+ {
51
+ kind: "Monaco",
52
+ icon: code_editor_svg,
53
+ label: "Code Editor",
54
+ onClick(app) {
55
+ app.manager.addApp({
56
+ kind: "Monaco",
57
+ options: { title: "Code Editor" },
58
+ });
59
+ },
60
+ },
61
+ {
62
+ kind: "GeoGebra",
63
+ icon: geogebra_svg,
64
+ label: "GeoGebra",
65
+ onClick(app) {
66
+ app.manager.addApp({
67
+ kind: "GeoGebra",
68
+ options: { title: "GeoGebra" },
69
+ });
70
+ },
71
+ },
72
+ {
73
+ kind: "Countdown",
74
+ icon: countdown_svg,
75
+ label: "Countdown",
76
+ onClick(app) {
77
+ app.manager.addApp({
78
+ kind: "Countdown",
79
+ options: { title: "Countdown" },
80
+ });
81
+ },
82
+ },
83
+ ]);
@@ -7,7 +7,6 @@
7
7
  export { className as class };
8
8
  export let name = "fastboard-ui";
9
9
  export let theme: Theme = "light";
10
- export let active = false;
11
10
  export let disabled = false;
12
11
  export let content: Content = "";
13
12
  export let placement: Placement = "top";
@@ -20,7 +19,6 @@
20
19
  <span class="{name}-btn-interactive {theme}" use:tippy={{ content, placement, className }}>
21
20
  <button
22
21
  class="{name}-btn {className} {theme}"
23
- class:is-active={active}
24
22
  {disabled}
25
23
  on:click
26
24
  use:tippy={{
@@ -39,7 +37,6 @@
39
37
  {:else}
40
38
  <button
41
39
  class="{name}-btn {className} {theme}"
42
- class:is-active={active}
43
40
  {disabled}
44
41
  on:click
45
42
  use:tippy={{ content, placement, className }}
@@ -48,7 +45,7 @@
48
45
  </button>
49
46
  {/if}
50
47
  {:else}
51
- <button class="{name}-btn {className} {theme}" class:is-active={active} {disabled} on:click>
48
+ <button class="{name}-btn {className} {theme}" {disabled} on:click>
52
49
  <slot />
53
50
  </button>
54
51
  {/if}
@@ -1,12 +1,11 @@
1
- import { SvelteComponentTyped } from "svelte";
2
1
  import type { Content, Placement } from "tippy.js";
3
2
  import type { Theme } from "../../typings";
3
+ import { SvelteComponentTyped } from "../../typings";
4
4
 
5
5
  export declare interface ButtonProps {
6
6
  class?: string;
7
7
  name?: string;
8
8
  theme?: Theme;
9
- active?: boolean;
10
9
  disabled?: boolean;
11
10
  content?: Content;
12
11
  placement?: Placement;
@@ -17,14 +17,25 @@
17
17
  display: flex;
18
18
  align-items: center;
19
19
  position: absolute;
20
- bottom: 50px;
20
+ bottom: 62px;
21
21
  top: 8px;
22
22
  left: 0;
23
23
  z-index: 200;
24
24
  pointer-events: none;
25
25
 
26
26
  .fastboard-toolbar {
27
- padding-left: 8px;
27
+ padding-left: 16px;
28
+ }
29
+ }
30
+
31
+ .fastboard-right {
32
+ @extend .fastboard-left;
33
+ left: auto;
34
+ right: 0;
35
+
36
+ .fastboard-toolbar {
37
+ padding-left: 0;
38
+ padding-right: 16px;
28
39
  }
29
40
  }
30
41
 
@@ -34,6 +45,7 @@
34
45
  position: absolute;
35
46
  bottom: 8px;
36
47
  left: 8px;
48
+ padding: 8px;
37
49
  z-index: 200;
38
50
  pointer-events: none;
39
51
  }
@@ -39,6 +39,13 @@
39
39
  layout = "visible";
40
40
  }
41
41
 
42
+ $: toolbar_has_items =
43
+ !config.toolbar ||
44
+ !config.toolbar.items ||
45
+ !config.toolbar.apps ||
46
+ config.toolbar.items.length > 0 ||
47
+ config.toolbar.apps.enable !== false;
48
+
42
49
  $: try {
43
50
  if (app && container) {
44
51
  app.bindContainer(container);
@@ -72,22 +79,25 @@
72
79
 
73
80
  <div class="{name}-root" class:loading={!app}>
74
81
  <div class="{name}-view" bind:this={container} on:touchstart|capture={focus_me} />
75
- <div class="{name}-left" class:hidden={!(layout === "visible" || layout === "toolbar-only")}>
82
+ <div
83
+ class="{name}-{config.toolbar?.placement || 'left'}"
84
+ class:hidden={!toolbar_has_items || !(layout === "visible" || layout === "toolbar-only")}
85
+ >
76
86
  {#if config.toolbar?.enable !== false}
77
- <Toolbar {app} {theme} {language} config={config.toolbar} />
87
+ <Toolbar {app} {theme} {language} config={config.toolbar || {}} />
78
88
  {/if}
79
89
  </div>
80
90
  <div class="{name}-bottom-left" class:hidden={layout !== "visible"}>
81
91
  {#if config.redo_undo?.enable !== false}
82
- <RedoUndo {app} {theme} {language} icons={config.redo_undo?.icons} />
92
+ <RedoUndo {app} {theme} {language} />
83
93
  {/if}
84
94
  {#if config.zoom_control?.enable !== false}
85
- <ZoomControl {app} {theme} {language} icons={config.zoom_control?.icons} />
95
+ <ZoomControl {app} {theme} {language} />
86
96
  {/if}
87
97
  </div>
88
98
  <div class="{name}-bottom-right" class:hidden={layout !== "visible"}>
89
99
  {#if config.page_control?.enable !== false}
90
- <PageControl {app} {theme} {language} icons={config.page_control?.icons} />
100
+ <PageControl {app} {theme} {language} />
91
101
  {/if}
92
102
  </div>
93
103
  </div>
@@ -1,11 +1,15 @@
1
1
  import type { FastboardApp } from "@netless/fastboard-core";
2
- import type { FastboardUIConfig, Language, Theme } from "../../typings";
3
- import { SvelteComponentTyped } from "svelte";
2
+ import type { Theme, Language, FastboardUIConfig } from "../../typings";
3
+ import { SvelteComponentTyped } from "../../typings";
4
4
 
5
5
  export declare interface FastboardProps {
6
6
  app?: FastboardApp | null;
7
7
  theme?: Theme;
8
8
  language?: Language;
9
+ /**
10
+ * Note: updating this option does not take effect when the element was mounted.
11
+ * Make sure to set this option in `UI.mount(div, { containerRef })`.
12
+ */
9
13
  containerRef?: (container: HTMLDivElement | null) => void;
10
14
  config?: FastboardUIConfig;
11
15
  }
@@ -10,8 +10,8 @@
10
10
  export let player: FastboardPlayer | null | undefined = null;
11
11
  export let theme: Theme = "light";
12
12
  export let language: Language = "en";
13
- export let config: ReplayFastboardUIConfig = {};
14
13
  export let containerRef: ((element: HTMLDivElement | null) => void) | undefined = undefined;
14
+ export let config: ReplayFastboardUIConfig = {};
15
15
 
16
16
  const name = "fastboard";
17
17
 
@@ -53,7 +53,7 @@
53
53
  <div class="{name}-view" bind:this={container} on:touchstart|capture={focus_me} />
54
54
  <div class="{name}-bottom">
55
55
  {#if config.player_control?.enable !== false}
56
- <PlayerControl {player} {theme} {language} icons={config.player_control?.icons} />
56
+ <PlayerControl {player} {theme} {language} />
57
57
  {/if}
58
58
  </div>
59
59
  </div>
@@ -1,13 +1,13 @@
1
1
  import type { FastboardPlayer } from "@netless/fastboard-core";
2
- import type { Language, ReplayFastboardUIConfig, Theme } from "../../typings";
3
- import { SvelteComponentTyped } from "svelte";
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
- config?: ReplayFastboardUIConfig;
10
9
  containerRef?: (container: HTMLDivElement | null) => void;
10
+ config?: ReplayFastboardUIConfig;
11
11
  }
12
12
 
13
13
  declare class ReplayFastboard extends SvelteComponentTyped<ReplayFastboardProps> {}
@@ -1,4 +1,4 @@
1
- import { SvelteComponentTyped } from "svelte";
1
+ import { SvelteComponentTyped } from "../../typings";
2
2
 
3
3
  export declare interface IconProps {
4
4
  src?: string;
@@ -7,10 +7,10 @@
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="M17.143 8.143v2.571h-3.857V6.857h2.571L12 3 8.143 6.857h2.571v3.857H6.857V8.143L3 12l1.286 1.286 2.571 2.571v-2.571h3.857v3.857H8.143L12 21l1.286-1.286 2.571-2.571h-2.571v-3.857h3.857v2.571L21 12l-3.857-3.857Z"
10
11
  stroke="#5D6066"
11
- stroke-linejoin="round"
12
12
  stroke-width="1.25"
13
- d="M13.414 4.929a2 2 0 0 1 2.829 0l2.828 2.828a2 2 0 0 1 0 2.829L12 17.656a4 4 0 0 1-5.657 0L4.93 16.244a2 2 0 0 1 0-2.829l8.485-8.485ZM12 6.343 17.657 12m-1.414-7.071-2.829 2.828m4.243-1.414-2.829 2.829m4.243-1.415-2.828 2.829"
13
+ stroke-linejoin="round"
14
14
  class="fastboard-icon-stroke-color"
15
15
  />
16
16
  </svg>
@@ -7,10 +7,8 @@
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="M17.143 8.143v2.571h-3.857V6.857h2.571L12 3 8.143 6.857h2.571v3.857H6.857V8.143L3 12l1.286 1.286 2.571 2.571v-2.571h3.857v3.857H8.143L12 21l1.286-1.286 2.571-2.571h-2.571v-3.857h3.857v2.571L21 12l-3.857-3.857Z"
10
11
  fill="#5D6066"
11
- fill-rule="evenodd"
12
- d="M16.242 4.929a2 2 0 0 0-2.828 0L4.93 13.414a2 2 0 0 0 0 2.829l1.414 1.414a4 4 0 0 0 5.657 0l5.215-5.215-5.657-5.657.884-.884 5.657 5.657.972-.972a2 2 0 0 0 0-2.829l-2.83-2.827Z"
13
- clip-rule="evenodd"
14
12
  class="fastboard-icon-fill-color"
15
13
  />
16
14
  </svg>
@@ -7,44 +7,10 @@
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="M16 16L20 20M20 16L16 20"
11
10
  stroke="#5D6066"
12
- class="fastboard-icon-stroke-color"
13
- stroke-width="1.25"
14
- />
15
- <path
16
- d="M13.4139 4.92898C14.195 4.14794 15.4613 4.14794 16.2423 4.92898L19.0708 7.75741C19.8518 8.53846 19.8518 9.80479 19.0708 10.5858L11.9997 17.6569C10.4376 19.219 7.90494 19.219 6.34284 17.6569L4.92863 16.2427C4.14758 15.4616 4.14758 14.1953 4.92863 13.4143L13.4139 4.92898Z"
17
- stroke="#5D6066"
18
- class="fastboard-icon-stroke-color"
19
- stroke-width="1.25"
20
11
  stroke-linejoin="round"
21
- />
22
- <path
23
- d="M12 6.34314L17.6569 12"
24
- stroke="#5D6066"
25
- class="fastboard-icon-stroke-color"
26
12
  stroke-width="1.25"
27
- stroke-linejoin="round"
28
- />
29
- <path
30
- d="M16.2422 4.92896L13.4138 7.75738"
31
- stroke="#5D6066"
13
+ d="M13.414 4.929a2 2 0 0 1 2.829 0l2.828 2.828a2 2 0 0 1 0 2.829L12 17.656a4 4 0 0 1-5.657 0L4.93 16.244a2 2 0 0 1 0-2.829l8.485-8.485ZM12 6.343 17.657 12m-1.414-7.071-2.829 2.828m4.243-1.414-2.829 2.829m4.243-1.415-2.828 2.829"
32
14
  class="fastboard-icon-stroke-color"
33
- stroke-width="1.25"
34
- stroke-linejoin="round"
35
- />
36
- <path
37
- d="M17.6572 6.34314L14.8288 9.17157"
38
- stroke="#5D6066"
39
- class="fastboard-icon-stroke-color"
40
- stroke-width="1.25"
41
- stroke-linejoin="round"
42
- />
43
- <path
44
- d="M19.0713 7.75732L16.2429 10.5858"
45
- stroke="#5D6066"
46
- class="fastboard-icon-stroke-color"
47
- stroke-width="1.25"
48
- stroke-linejoin="round"
49
15
  />
50
16
  </svg>
@@ -7,10 +7,10 @@
7
7
 
8
8
  <svg fill="none" viewBox="0 0 24 24" class="fastboard-icon {theme}" class:is-active={active}>
9
9
  <path
10
+ fill="#5D6066"
10
11
  fill-rule="evenodd"
12
+ d="M16.242 4.929a2 2 0 0 0-2.828 0L4.93 13.414a2 2 0 0 0 0 2.829l1.414 1.414a4 4 0 0 0 5.657 0l5.215-5.215-5.657-5.657.884-.884 5.657 5.657.972-.972a2 2 0 0 0 0-2.829l-2.83-2.827Z"
11
13
  clip-rule="evenodd"
12
- d="M16.2423 4.92893C15.4612 4.14788 14.1949 4.14788 13.4138 4.92893L4.92856 13.4142C4.14751 14.1953 4.14751 15.4616 4.92856 16.2426L6.34277 17.6568C7.90487 19.2189 10.4375 19.2189 11.9996 17.6568L17.2146 12.4419L11.5577 6.78508L12.4416 5.9012L18.0985 11.558L19.0707 10.5858C19.8517 9.80473 19.8517 8.5384 19.0707 7.75735L16.2423 4.92893ZM17.1161 18L15.5581 16.4419L16.4419 15.5581L18 17.1161L19.5581 15.5581L20.4419 16.4419L18.8839 18L20.4419 19.5581L19.5581 20.4419L18 18.8839L16.4419 20.4419L15.5581 19.5581L17.1161 18Z"
13
- fill="#3381FF"
14
14
  class="fastboard-icon-fill-color"
15
15
  />
16
16
  </svg>
@@ -0,0 +1,21 @@
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
+ d="m11.48 10.033 2.695 2.696m-2.695-2.696-7.375 7.379a.364.364 0 0 0 0 .515l2.18 2.182a.361.361 0 0 0 .514 0l7.376-7.38m-2.695-2.696 2.438-2.438a.363.363 0 0 1 .514 0l2.18 2.182v-.001a.363.363 0 0 1 0 .514l-2.437 2.439"
11
+ stroke="#5D6066"
12
+ stroke-width="1.25"
13
+ stroke-linejoin="round"
14
+ class="fastboard-icon-stroke-color"
15
+ />
16
+ <path
17
+ d="M10.895 6.652a.363.363 0 0 0-.13-.182c-.348-.399-.338-1.264.032-1.634a.362.362 0 1 0-.513-.514c-.18.18-.491.286-.834.286-.343 0-.654-.107-.833-.286a.363.363 0 1 0-.514.514c.38.382.38 1.286 0 1.667a.364.364 0 0 0 .514.515c.179-.18.49-.287.833-.287.343 0 .654.107.834.287a.362.362 0 0 0 .256.106h.008a.363.363 0 0 0 .347-.472Zm6.294-.149a.366.366 0 0 0 .118.594.363.363 0 0 0 .396-.079c.18-.18.49-.287.834-.287.343 0 .654.107.832.287a.362.362 0 0 0 .258.106h.007a.363.363 0 0 0 .218-.654c-.35-.399-.338-1.264.032-1.634a.363.363 0 1 0-.515-.514c-.178.18-.49.286-.832.286-.343 0-.654-.107-.834-.286a.364.364 0 0 0-.514.514c.382.382.382 1.286 0 1.667Zm2.794 9.239a.363.363 0 0 0-.13-.182c-.35-.398-.34-1.263.03-1.633a.363.363 0 1 0-.514-.515c-.178.18-.49.287-.832.287-.343 0-.654-.107-.834-.287a.365.365 0 0 0-.514.515c.382.38.382 1.285 0 1.667a.364.364 0 0 0 .514.514c.18-.18.49-.286.834-.286.343 0 .654.107.832.286a.363.363 0 0 0 .258.107h.007a.363.363 0 0 0 .349-.473Z"
18
+ fill="#5D6066"
19
+ class="fastboard-icon-fill-color"
20
+ />
21
+ </svg>
@@ -0,0 +1,14 @@
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
+ d="m11.48 10.033 2.695 2.696-7.376 7.38a.361.361 0 0 1-.514 0l-2.18-2.182a.362.362 0 0 1 0-.515l7.375-7.379Zm5.133-.257a.363.363 0 0 1 0 .514l-1.925 1.925-2.694-2.696 1.924-1.924a.363.363 0 0 1 .514 0l2.18 2.182v-.001Zm-5.718-3.124a.363.363 0 0 0-.13-.182c-.348-.399-.338-1.264.032-1.634a.362.362 0 1 0-.513-.514c-.18.18-.491.286-.834.286-.343 0-.654-.107-.833-.286a.363.363 0 1 0-.514.514c.38.382.38 1.286 0 1.667a.364.364 0 0 0 .514.515c.179-.18.49-.287.833-.287.343 0 .654.107.834.287a.362.362 0 0 0 .256.106h.008a.363.363 0 0 0 .347-.472Zm6.294-.149a.366.366 0 0 0 .118.594.363.363 0 0 0 .396-.079c.18-.18.49-.287.834-.287.343 0 .654.107.832.287a.362.362 0 0 0 .258.106h.007a.363.363 0 0 0 .218-.654c-.35-.399-.338-1.264.032-1.634a.363.363 0 1 0-.515-.514c-.178.18-.49.286-.832.286-.343 0-.654-.107-.834-.286a.364.364 0 0 0-.514.514c.382.382.382 1.286 0 1.667Zm2.794 9.239a.363.363 0 0 0-.13-.182c-.35-.398-.34-1.263.03-1.633a.363.363 0 1 0-.514-.515c-.178.18-.49.287-.832.287-.343 0-.654-.107-.834-.287a.365.365 0 0 0-.514.515c.382.38.382 1.285 0 1.667a.364.364 0 0 0 .514.514c.18-.18.49-.286.834-.286.343 0 .654.107.832.286a.363.363 0 0 0 .258.107h.007a.363.363 0 0 0 .349-.473Z"
11
+ fill="#5D6066"
12
+ class="fastboard-icon-fill-color"
13
+ />
14
+ </svg>