@netless/fastboard-react 0.1.0 → 0.1.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/dist/index.js +48 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -97
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/components/Fastboard.tsx +21 -10
- package/src/components/PageControl/PageControl.tsx +2 -4
- package/src/components/PageControl/hooks.ts +18 -61
- package/dist/behaviors/style.d.ts +0 -1
- package/dist/components/Fastboard.d.ts +0 -15
- package/dist/components/PageControl/PageControl.d.ts +0 -5
- package/dist/components/PageControl/hooks.d.ts +0 -9
- package/dist/components/PageControl/index.d.ts +0 -2
- package/dist/components/PlayerControl/PlayerControl.d.ts +0 -9
- package/dist/components/PlayerControl/hooks.d.ts +0 -11
- package/dist/components/PlayerControl/icons/Loading.d.ts +0 -3
- package/dist/components/PlayerControl/icons/Pause.d.ts +0 -3
- package/dist/components/PlayerControl/icons/Play.d.ts +0 -3
- package/dist/components/PlayerControl/icons/index.d.ts +0 -6
- package/dist/components/PlayerControl/index.d.ts +0 -2
- package/dist/components/RedoUndo/RedoUndo.d.ts +0 -5
- package/dist/components/RedoUndo/hooks.d.ts +0 -6
- package/dist/components/RedoUndo/index.d.ts +0 -2
- package/dist/components/Toolbar/Content.d.ts +0 -2
- package/dist/components/Toolbar/Toolbar.d.ts +0 -14
- package/dist/components/Toolbar/components/ApplianceButtons.d.ts +0 -7
- package/dist/components/Toolbar/components/AppsButton.d.ts +0 -6
- package/dist/components/Toolbar/components/ColorBox.d.ts +0 -2
- package/dist/components/Toolbar/components/CutLine.d.ts +0 -2
- package/dist/components/Toolbar/components/Mask.d.ts +0 -7
- package/dist/components/Toolbar/components/PencilButton.d.ts +0 -2
- package/dist/components/Toolbar/components/ShapesButton.d.ts +0 -3
- package/dist/components/Toolbar/components/Slider.d.ts +0 -2
- package/dist/components/Toolbar/components/TextButton.d.ts +0 -2
- package/dist/components/Toolbar/components/UpDownButtons.d.ts +0 -7
- package/dist/components/Toolbar/const.d.ts +0 -18
- package/dist/components/Toolbar/hooks.d.ts +0 -12
- package/dist/components/Toolbar/icons/Apps.d.ts +0 -3
- package/dist/components/Toolbar/icons/Arrow.d.ts +0 -3
- package/dist/components/Toolbar/icons/Circle.d.ts +0 -3
- package/dist/components/Toolbar/icons/Clean.d.ts +0 -3
- package/dist/components/Toolbar/icons/Clicker.d.ts +0 -3
- package/dist/components/Toolbar/icons/Collapse.d.ts +0 -3
- package/dist/components/Toolbar/icons/Diamond.d.ts +0 -3
- package/dist/components/Toolbar/icons/Down.d.ts +0 -3
- package/dist/components/Toolbar/icons/Eraser.d.ts +0 -3
- package/dist/components/Toolbar/icons/Expand.d.ts +0 -3
- package/dist/components/Toolbar/icons/Line.d.ts +0 -3
- package/dist/components/Toolbar/icons/Pencil.d.ts +0 -3
- package/dist/components/Toolbar/icons/Rectangle.d.ts +0 -3
- package/dist/components/Toolbar/icons/Selector.d.ts +0 -3
- package/dist/components/Toolbar/icons/SpeechBalloon.d.ts +0 -3
- package/dist/components/Toolbar/icons/Star.d.ts +0 -3
- package/dist/components/Toolbar/icons/Text.d.ts +0 -3
- package/dist/components/Toolbar/icons/Triangle.d.ts +0 -3
- package/dist/components/Toolbar/icons/Up.d.ts +0 -3
- package/dist/components/Toolbar/icons/index.d.ts +0 -22
- package/dist/components/Toolbar/index.d.ts +0 -2
- package/dist/components/ZoomControl/ZoomControl.d.ts +0 -5
- package/dist/components/ZoomControl/hooks.d.ts +0 -7
- package/dist/components/ZoomControl/index.d.ts +0 -2
- package/dist/components/hooks.d.ts +0 -13
- package/dist/i18n/index.d.ts +0 -12
- package/dist/icons/ChevronLeft.d.ts +0 -3
- package/dist/icons/ChevronRight.d.ts +0 -3
- package/dist/icons/FilePlus.d.ts +0 -3
- package/dist/icons/Minus.d.ts +0 -3
- package/dist/icons/Plus.d.ts +0 -3
- package/dist/icons/Redo.d.ts +0 -3
- package/dist/icons/Reset.d.ts +0 -3
- package/dist/icons/Undo.d.ts +0 -3
- package/dist/icons/index.d.ts +0 -7
- package/dist/index.d.ts +0 -9
- package/dist/internal/helpers.d.ts +0 -16
- package/dist/internal/hooks.d.ts +0 -3
- package/dist/internal/index.d.ts +0 -2
- package/dist/theme.d.ts +0 -16
- package/dist/typings.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A UI kit built on top of @netless/fastboard.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@netless/app-slide": "^0.0.55",
|
|
29
|
-
"@netless/fastboard": "0.1.
|
|
29
|
+
"@netless/fastboard": "0.1.1",
|
|
30
30
|
"@netless/window-manager": "^0.4.0-canary.17",
|
|
31
31
|
"@types/react": "^17.0.38",
|
|
32
32
|
"@types/react-dom": "^17.0.11",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"white-web-sdk": "^2.16.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "tsup"
|
|
39
|
+
"build": "tsup",
|
|
40
|
+
"cleanup": "rimraf dist"
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { FastboardApp } from "@netless/fastboard";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ForwardedRef } from "react";
|
|
3
3
|
import type { Language, Theme } from "../typings";
|
|
4
4
|
|
|
5
|
-
import React, { useCallback, useEffect } from "react";
|
|
6
|
-
|
|
5
|
+
import React, { forwardRef, useCallback, useEffect } from "react";
|
|
7
6
|
import { createI18n, I18nContext } from "../i18n";
|
|
8
7
|
import { useAsyncValue, useForceUpdate } from "../internal";
|
|
9
8
|
import { FastboardAppContext, ThemeContext, useFastboardApp, useHideControls } from "./hooks";
|
|
@@ -19,24 +18,32 @@ export interface FastboardProps {
|
|
|
19
18
|
language?: Language;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export
|
|
21
|
+
export type DivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
22
|
+
export type WithForwardedRef<T = HTMLDivElement> = { forwardedRef: ForwardedRef<T> };
|
|
23
|
+
|
|
24
|
+
export const Fastboard = forwardRef<HTMLDivElement, FastboardProps & DivProps>(function Fastboard(
|
|
25
|
+
{ app, theme, layout, language, ...restProps },
|
|
26
|
+
ref
|
|
27
|
+
) {
|
|
23
28
|
if (!app) {
|
|
24
|
-
return <div className="fastboard-root" />;
|
|
29
|
+
return <div className="fastboard-root" ref={ref} {...restProps} />;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
return (
|
|
28
33
|
<FastboardAppContext.Provider value={app}>
|
|
29
|
-
<FastboardInternal {...restProps} />
|
|
34
|
+
<FastboardInternal forwardedRef={ref} {...{ theme, layout, language }} {...restProps} />
|
|
30
35
|
</FastboardAppContext.Provider>
|
|
31
36
|
);
|
|
32
|
-
}
|
|
37
|
+
});
|
|
33
38
|
|
|
34
39
|
function FastboardInternal({
|
|
40
|
+
forwardedRef,
|
|
35
41
|
language,
|
|
36
42
|
layout = {},
|
|
37
43
|
theme = "light",
|
|
38
44
|
children,
|
|
39
|
-
|
|
45
|
+
...restProps
|
|
46
|
+
}: Omit<FastboardProps, "app"> & DivProps & WithForwardedRef) {
|
|
40
47
|
const app = useFastboardApp();
|
|
41
48
|
const forceUpdate = useForceUpdate();
|
|
42
49
|
const i18n = useAsyncValue(() => createI18n({ language }));
|
|
@@ -46,9 +53,13 @@ function FastboardInternal({
|
|
|
46
53
|
forceUpdate();
|
|
47
54
|
}, [forceUpdate, i18n, language]);
|
|
48
55
|
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
app.manager.setPrefersColorScheme(theme);
|
|
58
|
+
}, [app, theme]);
|
|
59
|
+
|
|
49
60
|
const useWhiteboard = useCallback(
|
|
50
61
|
(container: HTMLDivElement | null) => {
|
|
51
|
-
container && app
|
|
62
|
+
if (container && app) app.manager.bindContainer(container);
|
|
52
63
|
},
|
|
53
64
|
[app]
|
|
54
65
|
);
|
|
@@ -66,7 +77,7 @@ function FastboardInternal({
|
|
|
66
77
|
return (
|
|
67
78
|
<ThemeContext.Provider value={theme}>
|
|
68
79
|
<I18nContext.Provider value={i18n}>
|
|
69
|
-
<div className="fastboard-root">
|
|
80
|
+
<div {...restProps} className="fastboard-root" ref={forwardedRef}>
|
|
70
81
|
<div className="fastboard-view" ref={useWhiteboard} />
|
|
71
82
|
{children ? (
|
|
72
83
|
children
|
|
@@ -10,7 +10,7 @@ import { ChevronLeft } from "../../icons/ChevronLeft";
|
|
|
10
10
|
import { ChevronRight } from "../../icons/ChevronRight";
|
|
11
11
|
import { FilePlus } from "../../icons/FilePlus";
|
|
12
12
|
import { TopOffset } from "../../theme";
|
|
13
|
-
import {
|
|
13
|
+
import { useTheme, useWritable } from "../hooks";
|
|
14
14
|
import { usePageControl } from "./hooks";
|
|
15
15
|
|
|
16
16
|
export const name = "fastboard-page-control";
|
|
@@ -26,13 +26,11 @@ export function PageControl({
|
|
|
26
26
|
nextIcon,
|
|
27
27
|
nextIconDisable,
|
|
28
28
|
}: PageControlProps) {
|
|
29
|
-
const app = useFastboardApp();
|
|
30
|
-
|
|
31
29
|
theme = useTheme(theme);
|
|
32
30
|
const { t } = useTranslation();
|
|
33
31
|
|
|
34
32
|
const writable = useWritable();
|
|
35
|
-
const { pageIndex, pageCount, ...actions } = usePageControl(
|
|
33
|
+
const { pageIndex, pageCount, ...actions } = usePageControl();
|
|
36
34
|
|
|
37
35
|
const disabled = !writable;
|
|
38
36
|
|
|
@@ -1,67 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useFastboardApp, useFastboardValue } from "../hooks";
|
|
4
3
|
|
|
5
|
-
export function usePageControl(
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
export function usePageControl() {
|
|
5
|
+
const app = useFastboardApp();
|
|
6
|
+
const pageIndex = useFastboardValue(app.sceneIndex);
|
|
7
|
+
const pageCount = useFastboardValue(app.sceneLength);
|
|
8
8
|
|
|
9
9
|
const addPage = useCallback(async () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const prevPage = useCallback(() => {
|
|
23
|
-
if (manager) {
|
|
24
|
-
manager.setMainViewSceneIndex(pageIndex - 1);
|
|
25
|
-
} else if (room) {
|
|
26
|
-
room.pptPreviousStep();
|
|
27
|
-
}
|
|
28
|
-
}, [room, manager, pageIndex]);
|
|
29
|
-
|
|
30
|
-
const nextPage = useCallback(() => {
|
|
31
|
-
if (manager) {
|
|
32
|
-
manager.setMainViewSceneIndex(pageIndex + 1);
|
|
33
|
-
} else if (room) {
|
|
34
|
-
room.pptNextStep();
|
|
35
|
-
}
|
|
36
|
-
}, [room, manager, pageIndex]);
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (room) {
|
|
40
|
-
setPageIndex(room.state.sceneState.index);
|
|
41
|
-
setPageCount(room.state.sceneState.scenes.length);
|
|
42
|
-
|
|
43
|
-
if (manager) {
|
|
44
|
-
manager.emitter.on("mainViewSceneIndexChange", setPageIndex);
|
|
45
|
-
|
|
46
|
-
return () => {
|
|
47
|
-
manager.emitter.off("mainViewSceneIndexChange", setPageIndex);
|
|
48
|
-
};
|
|
49
|
-
} else {
|
|
50
|
-
const onRoomStateChanged = (modifyState: Partial<RoomState>) => {
|
|
51
|
-
if (modifyState.sceneState) {
|
|
52
|
-
setPageIndex(modifyState.sceneState.index);
|
|
53
|
-
setPageCount(modifyState.sceneState.scenes.length);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
room.callbacks.on("onRoomStateChanged", onRoomStateChanged);
|
|
58
|
-
|
|
59
|
-
return () => {
|
|
60
|
-
room.callbacks.off("onRoomStateChanged", onRoomStateChanged);
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}, [room, manager]);
|
|
10
|
+
await app.manager.switchMainViewToWriter();
|
|
11
|
+
app.room.putScenes(app.manager.mainViewSceneDir, [{}], pageIndex + 1);
|
|
12
|
+
await app.manager.setMainViewSceneIndex(pageIndex + 1);
|
|
13
|
+
}, [app, pageIndex]);
|
|
14
|
+
|
|
15
|
+
const prevPage = useCallback(async () => {
|
|
16
|
+
await app.manager.setMainViewSceneIndex(pageIndex - 1);
|
|
17
|
+
}, [app, pageIndex]);
|
|
18
|
+
|
|
19
|
+
const nextPage = useCallback(async () => {
|
|
20
|
+
await app.manager.setMainViewSceneIndex(pageIndex + 1);
|
|
21
|
+
}, [app, pageIndex]);
|
|
65
22
|
|
|
66
23
|
return { pageIndex, pageCount, prevPage, nextPage, addPage };
|
|
67
24
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FastboardApp } from "@netless/fastboard";
|
|
2
|
-
import type { PropsWithChildren } from "react";
|
|
3
|
-
import type { Language, Theme } from "../typings";
|
|
4
|
-
export interface FastboardProps {
|
|
5
|
-
app?: FastboardApp | null;
|
|
6
|
-
theme?: Theme;
|
|
7
|
-
layout?: {
|
|
8
|
-
Toolbar?: boolean;
|
|
9
|
-
RedoUndo?: boolean;
|
|
10
|
-
ZoomControl?: boolean;
|
|
11
|
-
PageControl?: boolean;
|
|
12
|
-
};
|
|
13
|
-
language?: Language;
|
|
14
|
-
}
|
|
15
|
-
export declare function Fastboard({ app, ...restProps }: PropsWithChildren<FastboardProps>): JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CommonProps, GenericIcon } from "../../typings";
|
|
3
|
-
export declare const name = "fastboard-page-control";
|
|
4
|
-
export declare type PageControlProps = CommonProps & GenericIcon<"add" | "prev" | "next">;
|
|
5
|
-
export declare function PageControl({ theme, addIcon, addIconDisable, prevIcon, prevIconDisable, nextIcon, nextIconDisable, }: PageControlProps): JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Room } from "white-web-sdk";
|
|
2
|
-
import type { WindowManager } from "@netless/window-manager";
|
|
3
|
-
export declare function usePageControl(room?: Room | null, manager?: WindowManager | null): {
|
|
4
|
-
pageIndex: number;
|
|
5
|
-
pageCount: number;
|
|
6
|
-
prevPage: () => void;
|
|
7
|
-
nextPage: () => void;
|
|
8
|
-
addPage: () => Promise<void>;
|
|
9
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Player } from "white-web-sdk";
|
|
3
|
-
import type { CommonProps, GenericIcon } from "../../typings";
|
|
4
|
-
export declare type PlayerControlProps = {
|
|
5
|
-
autoHide?: boolean;
|
|
6
|
-
player?: Player;
|
|
7
|
-
} & Omit<CommonProps, "room"> & GenericIcon<"play" | "pause" | "loading">;
|
|
8
|
-
export declare const name = "fastboard-player-control";
|
|
9
|
-
export declare function PlayerControl({ theme, autoHide, player: player_, ...icons }: PlayerControlProps): JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Player } from "white-web-sdk";
|
|
2
|
-
import { PlayerPhase } from "white-web-sdk";
|
|
3
|
-
export declare function usePlayerControl(player?: Player | null): {
|
|
4
|
-
phase: PlayerPhase;
|
|
5
|
-
currentTime: number;
|
|
6
|
-
totalTime: number;
|
|
7
|
-
speed: number;
|
|
8
|
-
setSpeed: (speed: number) => void;
|
|
9
|
-
togglePlay: () => void;
|
|
10
|
-
seekToProgressTime: (time: number) => void;
|
|
11
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const Icons: {
|
|
3
|
-
Play: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
4
|
-
Pause: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
5
|
-
Loading: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
6
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CommonProps, GenericIcon } from "../../typings";
|
|
3
|
-
export declare const name = "fastboard-redo-undo";
|
|
4
|
-
export declare type RedoUndoProps = CommonProps & GenericIcon<"undo" | "redo">;
|
|
5
|
-
export declare function RedoUndo({ theme, undoIcon, undoIconDisable, redoIcon, redoIconDisable }: RedoUndoProps): JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CommonProps, GenericIcon, Theme } from "../../typings";
|
|
2
|
-
import type { ToolbarHook } from "./hooks";
|
|
3
|
-
import React from "react";
|
|
4
|
-
export declare type ToolbarProps = CommonProps & {
|
|
5
|
-
icons?: GenericIcon<"clicker" | "selector" | "pencil" | "eraser" | "clean" | "expand" | "collapse" | "up" | "down" | "text" | "apps">;
|
|
6
|
-
};
|
|
7
|
-
declare type ToolbarContextType = ToolbarHook & {
|
|
8
|
-
theme: Theme;
|
|
9
|
-
icons?: ToolbarProps["icons"];
|
|
10
|
-
};
|
|
11
|
-
export declare const ToolbarContext: React.Context<ToolbarContextType>;
|
|
12
|
-
export declare const name = "fastboard-toolbar";
|
|
13
|
-
export declare const Toolbar: ({ theme, icons }: ToolbarProps) => JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { HotKey } from "white-web-sdk";
|
|
3
|
-
export declare function renderToolTip(text: string | undefined, hotkey?: HotKey): string | JSX.Element | undefined;
|
|
4
|
-
export declare function ClickerButton(): JSX.Element;
|
|
5
|
-
export declare function SelectorButton(): JSX.Element;
|
|
6
|
-
export declare function EraserButton(): JSX.Element;
|
|
7
|
-
export declare function CleanButton(): JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface UpButtonProps {
|
|
3
|
-
disabled: boolean;
|
|
4
|
-
scrollTo: (height: number) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function UpButton({ disabled, scrollTo }: UpButtonProps): JSX.Element;
|
|
7
|
-
export declare function DownButton({ disabled, scrollTo }: UpButtonProps): JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ApplianceNames, ShapeType } from "white-web-sdk";
|
|
3
|
-
export declare const ShapesMap: {
|
|
4
|
-
readonly rectangle: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
5
|
-
readonly ellipse: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
6
|
-
readonly straight: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
7
|
-
readonly arrow: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
8
|
-
readonly pentagram: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
9
|
-
readonly rhombus: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
10
|
-
readonly triangle: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
11
|
-
readonly speechBalloon: import("react").MemoExoticComponent<(props: import("../..").IconProps) => JSX.Element>;
|
|
12
|
-
};
|
|
13
|
-
export declare const ApplianceShapes: readonly [ApplianceNames.rectangle, ApplianceNames.ellipse, ApplianceNames.straight, ApplianceNames.arrow];
|
|
14
|
-
export declare const Shapes: readonly [ShapeType.Pentagram, ShapeType.Rhombus, ShapeType.Triangle, ShapeType.SpeechBalloon];
|
|
15
|
-
export declare const ItemHeight: number;
|
|
16
|
-
export declare const ItemsCount = 8;
|
|
17
|
-
export declare const MaxHeight: number;
|
|
18
|
-
export declare const MinHeight: number;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ApplianceNames, Color, MemberState, ShapeType } from "white-web-sdk";
|
|
2
|
-
export interface ToolbarHook {
|
|
3
|
-
readonly writable: boolean;
|
|
4
|
-
readonly memberState: MemberState | undefined;
|
|
5
|
-
cleanCurrentScene(): void;
|
|
6
|
-
setAppliance(appliance: ApplianceNames, shape?: ShapeType): void;
|
|
7
|
-
setStrokeWidth(width: number): void;
|
|
8
|
-
setStrokeColor(color: Color): void;
|
|
9
|
-
}
|
|
10
|
-
export declare function useRoomState(): any;
|
|
11
|
-
export declare function useToolbar(): ToolbarHook;
|
|
12
|
-
export declare const EmptyToolbarHook: ToolbarHook;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const Icons: {
|
|
3
|
-
Clicker: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
4
|
-
Collapse: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
5
|
-
Eraser: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
6
|
-
Expand: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
7
|
-
Pencil: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
8
|
-
Selector: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
9
|
-
Rectangle: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
10
|
-
Text: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
11
|
-
Apps: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
12
|
-
Clean: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
13
|
-
Circle: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
14
|
-
Line: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
15
|
-
Arrow: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
16
|
-
Star: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
17
|
-
Diamond: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
18
|
-
SpeechBalloon: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
19
|
-
Triangle: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
20
|
-
Up: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
21
|
-
Down: import("react").MemoExoticComponent<(props: import("../../..").IconProps) => JSX.Element>;
|
|
22
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CommonProps, GenericIcon } from "../../typings";
|
|
3
|
-
export declare const name = "fastboard-zoom-control";
|
|
4
|
-
export declare type ZoomControlProps = CommonProps & GenericIcon<"reset" | "minus" | "plus">;
|
|
5
|
-
export declare function ZoomControl({ theme, resetIcon, resetIconDisable, minusIcon, minusIconDisable, plusIcon, plusIconDisable, }: ZoomControlProps): JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { FastboardReadable } from "@netless/fastboard";
|
|
3
|
-
import type { Theme } from "../typings";
|
|
4
|
-
export declare const FastboardAppContext: import("react").Context<any>;
|
|
5
|
-
export declare const ThemeContext: import("react").Context<Theme>;
|
|
6
|
-
export declare function useTheme(userTheme?: Theme | null): Theme;
|
|
7
|
-
export declare function useFastboardApp(): any;
|
|
8
|
-
export declare function useFastboardValue<T>(val: FastboardReadable<T>): any;
|
|
9
|
-
export declare function useWritable(): any;
|
|
10
|
-
export declare function useBoxState(): any;
|
|
11
|
-
export declare function useFocusedApp(): any;
|
|
12
|
-
export declare function useMaximized(): boolean;
|
|
13
|
-
export declare function useHideControls(): boolean | "toolbar-only";
|
package/dist/i18n/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { i18n } from "i18next";
|
|
3
|
-
import type { Language } from "../typings";
|
|
4
|
-
export interface CreateI18nParams {
|
|
5
|
-
language?: Language;
|
|
6
|
-
}
|
|
7
|
-
export declare const createI18n: ({ language, }?: CreateI18nParams) => Promise<i18n>;
|
|
8
|
-
export declare const I18nContext: import("react").Context<i18n | null>;
|
|
9
|
-
export declare function useTranslation(): {
|
|
10
|
-
t: import("i18next").TFunction | ((id: string) => string);
|
|
11
|
-
i18n: i18n | null;
|
|
12
|
-
};
|