@netless/fastboard 0.0.11 → 0.2.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.
Files changed (113) hide show
  1. package/LICENSE.txt +1 -1
  2. package/dist/index.js +32 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.mjs +7 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/package.json +24 -85
  7. package/src/index.ts +2 -49
  8. package/README.md +0 -136
  9. package/dist/index.cjs.js +0 -14
  10. package/dist/index.cjs.js.map +0 -1
  11. package/dist/index.es.js +0 -2804
  12. package/dist/index.es.js.map +0 -1
  13. package/dist/svelte.cjs.js +0 -2
  14. package/dist/svelte.cjs.js.map +0 -1
  15. package/dist/svelte.es.js +0 -32
  16. package/dist/svelte.es.js.map +0 -1
  17. package/dist/vue.cjs.js +0 -2
  18. package/dist/vue.cjs.js.map +0 -1
  19. package/dist/vue.es.js +0 -43
  20. package/dist/vue.es.js.map +0 -1
  21. package/src/WhiteboardApp.ts +0 -146
  22. package/src/behaviors/register-apps.ts +0 -39
  23. package/src/behaviors/style.ts +0 -17
  24. package/src/components/PageControl/PageControl.scss +0 -80
  25. package/src/components/PageControl/PageControl.tsx +0 -110
  26. package/src/components/PageControl/hooks.ts +0 -70
  27. package/src/components/PageControl/index.ts +0 -2
  28. package/src/components/PlayerControl/PlayerControl.scss +0 -145
  29. package/src/components/PlayerControl/PlayerControl.tsx +0 -157
  30. package/src/components/PlayerControl/components/Button.tsx +0 -55
  31. package/src/components/PlayerControl/hooks.ts +0 -88
  32. package/src/components/PlayerControl/icons/Loading.tsx +0 -13
  33. package/src/components/PlayerControl/icons/Pause.tsx +0 -13
  34. package/src/components/PlayerControl/icons/Play.tsx +0 -13
  35. package/src/components/PlayerControl/icons/index.ts +0 -10
  36. package/src/components/PlayerControl/index.ts +0 -2
  37. package/src/components/RedoUndo/RedoUndo.scss +0 -56
  38. package/src/components/RedoUndo/RedoUndo.tsx +0 -79
  39. package/src/components/RedoUndo/hooks.ts +0 -50
  40. package/src/components/RedoUndo/index.ts +0 -2
  41. package/src/components/Root.scss +0 -55
  42. package/src/components/Root.tsx +0 -65
  43. package/src/components/Toolbar/Content.tsx +0 -94
  44. package/src/components/Toolbar/Toolbar.scss +0 -281
  45. package/src/components/Toolbar/Toolbar.tsx +0 -132
  46. package/src/components/Toolbar/components/ApplianceButtons.tsx +0 -132
  47. package/src/components/Toolbar/components/AppsButton.tsx +0 -106
  48. package/src/components/Toolbar/components/Button.tsx +0 -54
  49. package/src/components/Toolbar/components/ColorBox.tsx +0 -56
  50. package/src/components/Toolbar/components/CutLine.tsx +0 -8
  51. package/src/components/Toolbar/components/Mask.tsx +0 -44
  52. package/src/components/Toolbar/components/PencilButton.tsx +0 -70
  53. package/src/components/Toolbar/components/ShapesButton.tsx +0 -143
  54. package/src/components/Toolbar/components/Slider.tsx +0 -27
  55. package/src/components/Toolbar/components/TextButton.tsx +0 -66
  56. package/src/components/Toolbar/components/UpDownButtons.tsx +0 -49
  57. package/src/components/Toolbar/components/assets/cocos.png +0 -0
  58. package/src/components/Toolbar/components/assets/collapsed.png +0 -0
  59. package/src/components/Toolbar/components/assets/countdown.png +0 -0
  60. package/src/components/Toolbar/components/assets/expanded.png +0 -0
  61. package/src/components/Toolbar/components/assets/geogebra.png +0 -0
  62. package/src/components/Toolbar/components/assets/vscode.png +0 -0
  63. package/src/components/Toolbar/const.ts +0 -32
  64. package/src/components/Toolbar/hooks.ts +0 -112
  65. package/src/components/Toolbar/icons/Apps.tsx +0 -16
  66. package/src/components/Toolbar/icons/Arrow.tsx +0 -16
  67. package/src/components/Toolbar/icons/Circle.tsx +0 -21
  68. package/src/components/Toolbar/icons/Clean.tsx +0 -16
  69. package/src/components/Toolbar/icons/Clicker.tsx +0 -19
  70. package/src/components/Toolbar/icons/Collapse.tsx +0 -17
  71. package/src/components/Toolbar/icons/Diamond.tsx +0 -17
  72. package/src/components/Toolbar/icons/Down.tsx +0 -17
  73. package/src/components/Toolbar/icons/Eraser.tsx +0 -16
  74. package/src/components/Toolbar/icons/Expand.tsx +0 -17
  75. package/src/components/Toolbar/icons/Line.tsx +0 -13
  76. package/src/components/Toolbar/icons/Pencil.tsx +0 -16
  77. package/src/components/Toolbar/icons/Rectangle.tsx +0 -13
  78. package/src/components/Toolbar/icons/Selector.tsx +0 -16
  79. package/src/components/Toolbar/icons/SpeechBalloon.tsx +0 -17
  80. package/src/components/Toolbar/icons/Star.tsx +0 -17
  81. package/src/components/Toolbar/icons/Text.tsx +0 -16
  82. package/src/components/Toolbar/icons/Triangle.tsx +0 -17
  83. package/src/components/Toolbar/icons/Up.tsx +0 -17
  84. package/src/components/Toolbar/icons/index.ts +0 -42
  85. package/src/components/Toolbar/index.ts +0 -2
  86. package/src/components/ZoomControl/ZoomControl.scss +0 -80
  87. package/src/components/ZoomControl/ZoomControl.tsx +0 -109
  88. package/src/components/ZoomControl/hooks.ts +0 -111
  89. package/src/components/ZoomControl/index.ts +0 -2
  90. package/src/components/hooks.ts +0 -80
  91. package/src/i18n/en.json +0 -31
  92. package/src/i18n/index.ts +0 -22
  93. package/src/i18n/zh-CN.json +0 -32
  94. package/src/icons/ChevronLeft.tsx +0 -21
  95. package/src/icons/ChevronRight.tsx +0 -21
  96. package/src/icons/FilePlus.tsx +0 -18
  97. package/src/icons/Minus.tsx +0 -21
  98. package/src/icons/Plus.tsx +0 -21
  99. package/src/icons/Redo.tsx +0 -24
  100. package/src/icons/Reset.tsx +0 -23
  101. package/src/icons/Undo.tsx +0 -24
  102. package/src/icons/index.tsx +0 -11
  103. package/src/internal/Instance.tsx +0 -275
  104. package/src/internal/helpers.ts +0 -86
  105. package/src/internal/hooks.ts +0 -9
  106. package/src/internal/index.ts +0 -3
  107. package/src/internal/mount-whiteboard.ts +0 -90
  108. package/src/react.tsx +0 -52
  109. package/src/style.scss +0 -35
  110. package/src/svelte.ts +0 -45
  111. package/src/theme/index.ts +0 -36
  112. package/src/types/index.ts +0 -22
  113. package/src/vue.ts +0 -74
@@ -1,109 +0,0 @@
1
- import type { CommonProps, GenericIcon } from "../../types";
2
-
3
- import clsx from "clsx";
4
- import React from "react";
5
- import Tippy from "@tippyjs/react";
6
-
7
- import { TopOffset } from "../../theme";
8
- import { Icon } from "../../icons";
9
- import { Minus } from "../../icons/Minus";
10
- import { Plus } from "../../icons/Plus";
11
- import { Reset } from "../../icons/Reset";
12
- import { useWritable } from "../hooks";
13
- import { useZoomControl } from "./hooks";
14
-
15
- export const name = "fastboard-zoom-control";
16
-
17
- export type ZoomControlProps = CommonProps &
18
- GenericIcon<"reset" | "minus" | "plus">;
19
-
20
- export function ZoomControl({
21
- room,
22
- manager,
23
- theme = "light",
24
- resetIcon,
25
- resetIconDisable,
26
- minusIcon,
27
- minusIconDisable,
28
- plusIcon,
29
- plusIconDisable,
30
- i18n,
31
- }: ZoomControlProps) {
32
- const writable = useWritable(room);
33
- const { scale, resetCamera, zoomIn, zoomOut } = useZoomControl(room, manager);
34
-
35
- const disabled = !writable;
36
-
37
- return (
38
- <div className={clsx(name, theme)}>
39
- {/* <span className={clsx(`${name}-cut-line`, theme)} /> */}
40
- <Tippy
41
- className="fastboard-tip"
42
- content={i18n?.t("zoomOut")}
43
- theme={theme}
44
- disabled={disabled}
45
- placement="top"
46
- duration={300}
47
- offset={TopOffset}
48
- >
49
- <button
50
- className={clsx(`${name}-btn`, "minus", theme)}
51
- disabled={disabled}
52
- onClick={zoomOut}
53
- >
54
- <Icon
55
- fallback={<Minus theme={theme} />}
56
- src={disabled ? minusIconDisable : minusIcon}
57
- alt="[minus]"
58
- />
59
- </button>
60
- </Tippy>
61
- <span className={clsx(`${name}-scale`, theme)}>
62
- {Math.ceil(scale * 100)}
63
- </span>
64
- <span className={clsx(`${name}-percent`, theme)}>%</span>
65
- <Tippy
66
- className="fastboard-tip"
67
- content={i18n?.t("zoomIn")}
68
- theme={theme}
69
- disabled={disabled}
70
- placement="top"
71
- duration={300}
72
- offset={TopOffset}
73
- >
74
- <button
75
- className={clsx(`${name}-btn`, "plus", theme)}
76
- disabled={disabled}
77
- onClick={zoomIn}
78
- >
79
- <Icon
80
- fallback={<Plus theme={theme} />}
81
- src={disabled ? plusIconDisable : plusIcon}
82
- alt="[plus]"
83
- />
84
- </button>
85
- </Tippy>
86
- <Tippy
87
- className="fastboard-tip"
88
- content={i18n?.t("reset")}
89
- theme={theme}
90
- disabled={disabled}
91
- placement="top"
92
- duration={300}
93
- offset={TopOffset}
94
- >
95
- <button
96
- className={clsx(`${name}-btn`, "reset", theme)}
97
- disabled={disabled}
98
- onClick={resetCamera}
99
- >
100
- <Icon
101
- fallback={<Reset theme={theme} />}
102
- src={disabled ? resetIconDisable : resetIcon}
103
- alt="[reset]"
104
- />
105
- </button>
106
- </Tippy>
107
- </div>
108
- );
109
- }
@@ -1,111 +0,0 @@
1
- import type { Room, RoomState } from "white-web-sdk";
2
- import type { WindowManager } from "@netless/window-manager";
3
- import { useCallback, useEffect, useState } from "react";
4
- import { clamp } from "../../internal";
5
-
6
- export const ScalePoints: readonly number[] = [
7
- 0.10737418240000011, 0.13421772800000012, 0.16777216000000014,
8
- 0.20971520000000016, 0.26214400000000015, 0.3276800000000002,
9
- 0.4096000000000002, 0.5120000000000001, 0.6400000000000001, 0.8, 1, 1.26,
10
- 1.5876000000000001, 2.000376, 2.5204737600000002, 3.1757969376000004,
11
- 4.001504141376, 5.041895218133761, 6.352787974848539, 8.00451284830916, 10,
12
- ];
13
-
14
- function nextScale(scale: number, delta: 1 | -1) {
15
- const { length } = ScalePoints;
16
- const last = length - 1;
17
- if (scale < ScalePoints[0]) return ScalePoints[0];
18
- if (scale > ScalePoints[last]) return ScalePoints[last];
19
- for (let i = 0; i < length; ++i) {
20
- const curr = ScalePoints[i];
21
- const prev = i === 0 ? -Infinity : (ScalePoints[i - 1] + curr) / 2;
22
- const next = i === last ? Infinity : (ScalePoints[i + 1] + curr) / 2;
23
- if (prev <= scale && scale <= next)
24
- return ScalePoints[clamp(i + delta, 0, last)];
25
- }
26
- return 1;
27
- }
28
-
29
- export function useZoomControl(
30
- room?: Room | null,
31
- manager?: WindowManager | null
32
- ) {
33
- const [scale, setScale] = useState(1);
34
-
35
- const resetCamera = useCallback(() => {
36
- if (manager) {
37
- manager.mainView.moveCamera({ scale: 1, centerX: 0, centerY: 0 });
38
- } else if (room) {
39
- const { scenes, index } = room.state.sceneState;
40
- if (scenes[index].ppt) {
41
- room.scalePptToFit();
42
- } else {
43
- room.moveCamera({ scale: 1, centerX: 0, centerY: 0 });
44
- }
45
- }
46
- }, [room, manager]);
47
-
48
- const zoomIn = useCallback(() => {
49
- if (manager) {
50
- manager.mainView.moveCamera({
51
- scale: nextScale(scale, 1),
52
- centerX: 0,
53
- centerY: 0,
54
- });
55
- } else if (room) {
56
- room.moveCamera({
57
- scale: nextScale(scale, 1),
58
- centerX: 0,
59
- centerY: 0,
60
- });
61
- }
62
- }, [room, manager, scale]);
63
-
64
- const zoomOut = useCallback(() => {
65
- if (manager) {
66
- manager.mainView.moveCamera({
67
- scale: nextScale(scale, -1),
68
- centerX: 0,
69
- centerY: 0,
70
- });
71
- } else if (room) {
72
- room.moveCamera({
73
- scale: nextScale(scale, -1),
74
- centerX: 0,
75
- centerY: 0,
76
- });
77
- }
78
- }, [room, manager, scale]);
79
-
80
- useEffect(() => {
81
- if (manager) {
82
- setScale(manager.mainView.camera.scale);
83
-
84
- const onCameraUpdated = ({ scale }: { scale: number }) => setScale(scale);
85
-
86
- manager.mainView.callbacks.on("onCameraUpdated", onCameraUpdated);
87
-
88
- return () => {
89
- manager.mainView.callbacks.off("onCameraUpdated", onCameraUpdated);
90
- };
91
- }
92
-
93
- if (room) {
94
- setScale(room.state.cameraState.scale);
95
-
96
- const onRoomStateChanged = (modifyState: Partial<RoomState>) => {
97
- if (modifyState.cameraState) {
98
- setScale(modifyState.cameraState.scale);
99
- }
100
- };
101
-
102
- room.callbacks.on("onRoomStateChanged", onRoomStateChanged);
103
-
104
- return () => {
105
- room.callbacks.off("onRoomStateChanged", onRoomStateChanged);
106
- };
107
- }
108
- }, [room, manager]);
109
-
110
- return { scale, resetCamera, zoomIn, zoomOut };
111
- }
@@ -1,2 +0,0 @@
1
- export * from "./hooks";
2
- export { name, ZoomControl, type ZoomControlProps } from "./ZoomControl";
@@ -1,80 +0,0 @@
1
- import type { Room, WindowManager } from "@netless/window-manager";
2
- import { BuiltinApps } from "@netless/window-manager";
3
- import { useEffect, useState } from "react";
4
-
5
- export function useWritable(room?: Room | null) {
6
- const [writable, setWritable] = useState(false);
7
-
8
- useEffect(() => {
9
- if (room) {
10
- setWritable(room.isWritable);
11
- room.isWritable && (room.disableSerialization = false);
12
-
13
- const updateWritable = () => setWritable(room.isWritable);
14
- room.callbacks.on("onEnableWriteNowChanged", updateWritable);
15
-
16
- return () => {
17
- room.callbacks.off("onEnableWriteNowChanged", updateWritable);
18
- };
19
- }
20
- }, [room]);
21
-
22
- return writable;
23
- }
24
-
25
- export type BoxState = "normal" | "minimized" | "maximized";
26
-
27
- export function useBoxState(manager?: WindowManager | null) {
28
- const [boxState, setBoxState] = useState<BoxState | undefined>();
29
-
30
- useEffect(() => {
31
- if (manager) {
32
- setBoxState(manager.boxState);
33
-
34
- manager.emitter.on("boxStateChange", setBoxState);
35
-
36
- return () => {
37
- manager.emitter.off("boxStateChange", setBoxState);
38
- };
39
- }
40
- }, [manager]);
41
-
42
- return boxState;
43
- }
44
-
45
- export function useFocusedApp(manager?: WindowManager | null) {
46
- const [focused, setFocused] = useState<string | undefined>();
47
-
48
- useEffect(() => {
49
- if (manager) {
50
- setFocused(manager.focused);
51
-
52
- manager.emitter.on("focusedChange", setFocused);
53
-
54
- return () => {
55
- manager.emitter.off("focusedChange", setFocused);
56
- };
57
- }
58
- }, [manager]);
59
-
60
- return focused;
61
- }
62
-
63
- export function useMaximized(manager?: WindowManager | null) {
64
- return useBoxState(manager) === "maximized";
65
- }
66
-
67
- export function useHideControls(manager?: WindowManager | null) {
68
- const maximized = useMaximized(manager);
69
- const focusedApp = useFocusedApp(manager);
70
-
71
- if (maximized) {
72
- if (Object.values(BuiltinApps).some(kind => focusedApp?.includes(kind))) {
73
- return "toolbar-only";
74
- } else {
75
- return true;
76
- }
77
- }
78
-
79
- return false;
80
- }
package/src/i18n/en.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "translation": {
3
- "clicker": "clicker",
4
- "selector": "selector",
5
- "text": "text",
6
- "pencil": "pencil",
7
- "arrow": "arrow",
8
- "hand": "hand",
9
- "eraser": "eraser",
10
- "laser": "laser",
11
- "collapse": "Collapse",
12
- "expand": "Expand",
13
- "zoomIn": "Zoom In",
14
- "zoomOut": "Zoom Out",
15
- "reset": "Reset",
16
- "prevPage": "Prev Page",
17
- "nextPage": "Next Page",
18
- "addPage": "Add Page",
19
- "redo": "Redo",
20
- "undo": "Undo",
21
- "shape": "Shape",
22
- "triangle": "Triangle",
23
- "rhombus": "Rhombus",
24
- "pentagram": "Pentagram",
25
- "speechBalloon": "Speech Balloon",
26
- "rectangle": "Rectangle",
27
- "ellipse": "Ellipse",
28
- "straight": "Straight",
29
- "speed": "Speed"
30
- }
31
- }
package/src/i18n/index.ts DELETED
@@ -1,22 +0,0 @@
1
- import i18next from "i18next";
2
- import en from "./en.json";
3
- import zhCN from "./zh-CN.json";
4
-
5
- export type CreateI18nParams = {
6
- language?: string;
7
- };
8
-
9
- export const createI18n = async (params: CreateI18nParams) => {
10
- const defaultLang = navigator.language || "zh-CN";
11
- const lng = params.language || defaultLang;
12
-
13
- await i18next.init({
14
- lng,
15
- resources: {
16
- en: en,
17
- "zh-CN": zhCN,
18
- },
19
- });
20
-
21
- return i18next;
22
- };
@@ -1,32 +0,0 @@
1
- {
2
- "translation": {
3
- "clicker": "点击",
4
- "selector": "选择",
5
- "text": "文字",
6
- "pencil": "铅笔",
7
- "arrow": "箭头",
8
- "hand": "抓手",
9
- "eraser": "橡皮",
10
- "laser": "激光笔",
11
- "zoomIn": "放大",
12
- "zoomOut": "缩小",
13
- "reset": "重置",
14
- "prevPage": "上一页",
15
- "nextPage": "下一页",
16
- "addPage": "添加页面",
17
- "redo": "重做",
18
- "undo": "撤销",
19
- "collapse": "收起",
20
- "expand": "展开",
21
- "clean": "清屏",
22
- "shape": "形状",
23
- "triangle": "三角形",
24
- "rhombus": "菱形",
25
- "pentagram": "五角星",
26
- "speechBalloon": "气球",
27
- "rectangle": "矩形",
28
- "ellipse": "椭圆",
29
- "straight": "直线",
30
- "speed": "速度"
31
- }
32
- }
@@ -1,21 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function ChevronLeft({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <path
13
- fill="none"
14
- stroke={stroke}
15
- strokeLinecap="round"
16
- strokeLinejoin="round"
17
- d="m14 16-2-2-2-2 2-2 2-2"
18
- />
19
- </svg>
20
- );
21
- }
@@ -1,21 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function ChevronRight({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <path
13
- fill="none"
14
- stroke={stroke}
15
- strokeLinecap="round"
16
- strokeLinejoin="round"
17
- d="m10 16 2-2 2-2-2-2-2-2"
18
- />
19
- </svg>
20
- );
21
- }
@@ -1,18 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function FilePlus({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <path
13
- fill={stroke}
14
- d="M12 7.5a.5.5 0 0 1 .09.992L12 8.5H8a1.5 1.5 0 0 0-1.493 1.356L6.5 10v6a1.5 1.5 0 0 0 1.356 1.493L8 17.5h6a1.5 1.5 0 0 0 1.493-1.356L15.5 16v-4a.5.5 0 0 1 .992-.09l.008.09v4a2.5 2.5 0 0 1-2.336 2.495L14 18.5H8a2.5 2.5 0 0 1-2.495-2.336L5.5 16v-6a2.5 2.5 0 0 1 2.336-2.495L8 7.5h4Zm4-2a.5.5 0 0 1 .492.41L16.5 6v1.5H18a.5.5 0 0 1 .09.992L18 8.5h-1.5V10a.5.5 0 0 1-.992.09L15.5 10V8.5H14a.5.5 0 0 1-.09-.992L14 7.5h1.5V6a.5.5 0 0 1 .5-.5Z"
15
- />
16
- </svg>
17
- );
18
- }
@@ -1,21 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function Minus({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <path
13
- fill="none"
14
- stroke={stroke}
15
- strokeLinecap="round"
16
- strokeLinejoin="round"
17
- d="M7 12h10"
18
- />
19
- </svg>
20
- );
21
- }
@@ -1,21 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function Plus({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <path
13
- fill="none"
14
- stroke={stroke}
15
- strokeLinecap="round"
16
- strokeLinejoin="round"
17
- d="M12 7v10m-5-5h10"
18
- />
19
- </svg>
20
- );
21
- }
@@ -1,24 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function Redo({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <g
13
- fill="none"
14
- fillRule="evenodd"
15
- stroke={stroke}
16
- strokeLinecap="round"
17
- strokeLinejoin="round"
18
- >
19
- <path d="M14 14h4v-4" />
20
- <path d="m18 14-.788-.9A7.005 7.005 0 0 0 6 14h0" />
21
- </g>
22
- </svg>
23
- );
24
- }
@@ -1,23 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function Reset({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <g fill="none" fillRule="evenodd" transform="translate(-176 -684)">
13
- <path
14
- stroke={stroke}
15
- strokeLinejoin="round"
16
- d="M188 688v4m0 8v4m8-8h-4m-8 0h-4"
17
- />
18
- <circle cx="188" cy="696" r="6" stroke={stroke} />
19
- <circle cx="188" cy="696" r="1" fill={stroke} />
20
- </g>
21
- </svg>
22
- );
23
- }
@@ -1,24 +0,0 @@
1
- import type { IconProps } from "../types";
2
-
3
- import React from "react";
4
- import { themes } from "../theme";
5
-
6
- export function Undo({ theme = "light", active }: IconProps) {
7
- const config = themes[theme];
8
- const stroke = active ? config.activeColor : config.color;
9
-
10
- return (
11
- <svg viewBox="0 0 24 24">
12
- <g
13
- fill="none"
14
- fillRule="evenodd"
15
- stroke={stroke}
16
- strokeLinecap="round"
17
- strokeLinejoin="round"
18
- >
19
- <path d="M10 14H6v-4" />
20
- <path d="m6 14 .788-.9A7.005 7.005 0 0 1 18 14h0" />
21
- </g>
22
- </svg>
23
- );
24
- }
@@ -1,11 +0,0 @@
1
- import React from "react";
2
-
3
- export interface IconPropsWithFallback {
4
- fallback: React.ReactElement;
5
- src?: string;
6
- alt?: string;
7
- }
8
-
9
- export function Icon({ fallback, src, alt = "[icon]" }: IconPropsWithFallback) {
10
- return src ? <img src={src} alt={alt} title={alt} /> : fallback;
11
- }