@netless/fastboard-react 0.1.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/LICENSE.txt +21 -0
- package/dist/behaviors/style.d.ts +1 -0
- package/dist/components/Fastboard.d.ts +15 -0
- package/dist/components/PageControl/PageControl.d.ts +5 -0
- package/dist/components/PageControl/hooks.d.ts +9 -0
- package/dist/components/PageControl/index.d.ts +2 -0
- package/dist/components/PlayerControl/PlayerControl.d.ts +9 -0
- package/dist/components/PlayerControl/hooks.d.ts +11 -0
- package/dist/components/PlayerControl/icons/Loading.d.ts +3 -0
- package/dist/components/PlayerControl/icons/Pause.d.ts +3 -0
- package/dist/components/PlayerControl/icons/Play.d.ts +3 -0
- package/dist/components/PlayerControl/icons/index.d.ts +6 -0
- package/dist/components/PlayerControl/index.d.ts +2 -0
- package/dist/components/RedoUndo/RedoUndo.d.ts +5 -0
- package/dist/components/RedoUndo/hooks.d.ts +6 -0
- package/dist/components/RedoUndo/index.d.ts +2 -0
- package/dist/components/Toolbar/Content.d.ts +2 -0
- package/dist/components/Toolbar/Toolbar.d.ts +14 -0
- package/dist/components/Toolbar/components/ApplianceButtons.d.ts +7 -0
- package/dist/components/Toolbar/components/AppsButton.d.ts +6 -0
- package/dist/components/Toolbar/components/ColorBox.d.ts +2 -0
- package/dist/components/Toolbar/components/CutLine.d.ts +2 -0
- package/dist/components/Toolbar/components/Mask.d.ts +7 -0
- package/dist/components/Toolbar/components/PencilButton.d.ts +2 -0
- package/dist/components/Toolbar/components/ShapesButton.d.ts +3 -0
- package/dist/components/Toolbar/components/Slider.d.ts +2 -0
- package/dist/components/Toolbar/components/TextButton.d.ts +2 -0
- package/dist/components/Toolbar/components/UpDownButtons.d.ts +7 -0
- package/dist/components/Toolbar/const.d.ts +18 -0
- package/dist/components/Toolbar/hooks.d.ts +12 -0
- package/dist/components/Toolbar/icons/Apps.d.ts +3 -0
- package/dist/components/Toolbar/icons/Arrow.d.ts +3 -0
- package/dist/components/Toolbar/icons/Circle.d.ts +3 -0
- package/dist/components/Toolbar/icons/Clean.d.ts +3 -0
- package/dist/components/Toolbar/icons/Clicker.d.ts +3 -0
- package/dist/components/Toolbar/icons/Collapse.d.ts +3 -0
- package/dist/components/Toolbar/icons/Diamond.d.ts +3 -0
- package/dist/components/Toolbar/icons/Down.d.ts +3 -0
- package/dist/components/Toolbar/icons/Eraser.d.ts +3 -0
- package/dist/components/Toolbar/icons/Expand.d.ts +3 -0
- package/dist/components/Toolbar/icons/Line.d.ts +3 -0
- package/dist/components/Toolbar/icons/Pencil.d.ts +3 -0
- package/dist/components/Toolbar/icons/Rectangle.d.ts +3 -0
- package/dist/components/Toolbar/icons/Selector.d.ts +3 -0
- package/dist/components/Toolbar/icons/SpeechBalloon.d.ts +3 -0
- package/dist/components/Toolbar/icons/Star.d.ts +3 -0
- package/dist/components/Toolbar/icons/Text.d.ts +3 -0
- package/dist/components/Toolbar/icons/Triangle.d.ts +3 -0
- package/dist/components/Toolbar/icons/Up.d.ts +3 -0
- package/dist/components/Toolbar/icons/index.d.ts +22 -0
- package/dist/components/Toolbar/index.d.ts +2 -0
- package/dist/components/ZoomControl/ZoomControl.d.ts +5 -0
- package/dist/components/ZoomControl/hooks.d.ts +7 -0
- package/dist/components/ZoomControl/index.d.ts +2 -0
- package/dist/components/hooks.d.ts +13 -0
- package/dist/i18n/index.d.ts +12 -0
- package/dist/icons/ChevronLeft.d.ts +3 -0
- package/dist/icons/ChevronRight.d.ts +3 -0
- package/dist/icons/FilePlus.d.ts +3 -0
- package/dist/icons/Minus.d.ts +3 -0
- package/dist/icons/Plus.d.ts +3 -0
- package/dist/icons/Redo.d.ts +3 -0
- package/dist/icons/Reset.d.ts +3 -0
- package/dist/icons/Undo.d.ts +3 -0
- package/dist/icons/index.d.ts +7 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +2116 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2083 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal/helpers.d.ts +16 -0
- package/dist/internal/hooks.d.ts +3 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/theme.d.ts +16 -0
- package/dist/typings.d.ts +10 -0
- package/package.json +41 -0
- package/src/behaviors/style.ts +4 -0
- package/src/components/Fastboard.scss +41 -0
- package/src/components/Fastboard.tsx +97 -0
- package/src/components/PageControl/PageControl.scss +80 -0
- package/src/components/PageControl/PageControl.tsx +105 -0
- package/src/components/PageControl/hooks.ts +67 -0
- package/src/components/PageControl/index.ts +2 -0
- package/src/components/PlayerControl/PlayerControl.scss +145 -0
- package/src/components/PlayerControl/PlayerControl.tsx +131 -0
- package/src/components/PlayerControl/components/Button.tsx +45 -0
- package/src/components/PlayerControl/hooks.ts +88 -0
- package/src/components/PlayerControl/icons/Loading.tsx +13 -0
- package/src/components/PlayerControl/icons/Pause.tsx +13 -0
- package/src/components/PlayerControl/icons/Play.tsx +13 -0
- package/src/components/PlayerControl/icons/index.ts +10 -0
- package/src/components/PlayerControl/index.ts +2 -0
- package/src/components/RedoUndo/RedoUndo.scss +56 -0
- package/src/components/RedoUndo/RedoUndo.tsx +76 -0
- package/src/components/RedoUndo/hooks.ts +18 -0
- package/src/components/RedoUndo/index.ts +2 -0
- package/src/components/Toolbar/Content.tsx +74 -0
- package/src/components/Toolbar/Toolbar.scss +281 -0
- package/src/components/Toolbar/Toolbar.tsx +116 -0
- package/src/components/Toolbar/components/ApplianceButtons.tsx +108 -0
- package/src/components/Toolbar/components/AppsButton.tsx +101 -0
- package/src/components/Toolbar/components/Button.tsx +46 -0
- package/src/components/Toolbar/components/ColorBox.tsx +55 -0
- package/src/components/Toolbar/components/CutLine.tsx +8 -0
- package/src/components/Toolbar/components/Mask.tsx +44 -0
- package/src/components/Toolbar/components/PencilButton.tsx +66 -0
- package/src/components/Toolbar/components/ShapesButton.tsx +128 -0
- package/src/components/Toolbar/components/Slider.tsx +26 -0
- package/src/components/Toolbar/components/TextButton.tsx +62 -0
- package/src/components/Toolbar/components/UpDownButtons.tsx +49 -0
- package/src/components/Toolbar/components/assets/cocos.png +0 -0
- package/src/components/Toolbar/components/assets/collapsed.png +0 -0
- package/src/components/Toolbar/components/assets/countdown.png +0 -0
- package/src/components/Toolbar/components/assets/expanded.png +0 -0
- package/src/components/Toolbar/components/assets/geogebra.png +0 -0
- package/src/components/Toolbar/components/assets/vscode.png +0 -0
- package/src/components/Toolbar/const.ts +32 -0
- package/src/components/Toolbar/hooks.ts +68 -0
- package/src/components/Toolbar/icons/Apps.tsx +16 -0
- package/src/components/Toolbar/icons/Arrow.tsx +13 -0
- package/src/components/Toolbar/icons/Circle.tsx +13 -0
- package/src/components/Toolbar/icons/Clean.tsx +16 -0
- package/src/components/Toolbar/icons/Clicker.tsx +19 -0
- package/src/components/Toolbar/icons/Collapse.tsx +13 -0
- package/src/components/Toolbar/icons/Diamond.tsx +13 -0
- package/src/components/Toolbar/icons/Down.tsx +13 -0
- package/src/components/Toolbar/icons/Eraser.tsx +16 -0
- package/src/components/Toolbar/icons/Expand.tsx +13 -0
- package/src/components/Toolbar/icons/Line.tsx +13 -0
- package/src/components/Toolbar/icons/Pencil.tsx +16 -0
- package/src/components/Toolbar/icons/Rectangle.tsx +13 -0
- package/src/components/Toolbar/icons/Selector.tsx +13 -0
- package/src/components/Toolbar/icons/SpeechBalloon.tsx +17 -0
- package/src/components/Toolbar/icons/Star.tsx +17 -0
- package/src/components/Toolbar/icons/Text.tsx +13 -0
- package/src/components/Toolbar/icons/Triangle.tsx +13 -0
- package/src/components/Toolbar/icons/Up.tsx +13 -0
- package/src/components/Toolbar/icons/index.ts +42 -0
- package/src/components/Toolbar/index.ts +2 -0
- package/src/components/ZoomControl/ZoomControl.scss +80 -0
- package/src/components/ZoomControl/ZoomControl.tsx +94 -0
- package/src/components/ZoomControl/hooks.ts +52 -0
- package/src/components/ZoomControl/index.ts +2 -0
- package/src/components/hooks.ts +59 -0
- package/src/i18n/en.json +31 -0
- package/src/i18n/index.ts +29 -0
- package/src/i18n/zh-CN.json +32 -0
- package/src/icons/ChevronLeft.tsx +21 -0
- package/src/icons/ChevronRight.tsx +21 -0
- package/src/icons/FilePlus.tsx +18 -0
- package/src/icons/Minus.tsx +15 -0
- package/src/icons/Plus.tsx +15 -0
- package/src/icons/Redo.tsx +18 -0
- package/src/icons/Reset.tsx +19 -0
- package/src/icons/Undo.tsx +18 -0
- package/src/icons/index.tsx +11 -0
- package/src/index.ts +10 -0
- package/src/internal/helpers.ts +31 -0
- package/src/internal/hooks.ts +23 -0
- package/src/internal/index.ts +2 -0
- package/src/style.scss +29 -0
- package/src/theme.ts +36 -0
- package/src/typings.ts +15 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 netless
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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";
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./behaviors/style";
|
|
2
|
+
export * from "./typings";
|
|
3
|
+
export * from "./components/hooks";
|
|
4
|
+
export * from "./components/RedoUndo";
|
|
5
|
+
export * from "./components/ZoomControl";
|
|
6
|
+
export * from "./components/PageControl";
|
|
7
|
+
export * from "./components/Toolbar";
|
|
8
|
+
export * from "./components/PlayerControl";
|
|
9
|
+
export * from "./components/Fastboard";
|