@netless/fastboard-react 0.2.5 → 0.2.6
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 +186 -186
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +114 -114
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/Toolbar/components/ShapesButton.tsx +2 -3
- package/src/components/Toolbar/hooks.ts +13 -1
- package/src/components/ZoomControl/hooks.ts +2 -4
package/dist/index.mjs
CHANGED
|
@@ -377,12 +377,7 @@ function RedoUndo({ theme, undoIcon, undoIconDisable, redoIcon, redoIconDisable
|
|
|
377
377
|
// src/components/ZoomControl/hooks.ts
|
|
378
378
|
import { useCallback as useCallback3 } from "react";
|
|
379
379
|
var ScalePoints = [
|
|
380
|
-
0.
|
|
381
|
-
0.13421772800000012,
|
|
382
|
-
0.16777216000000014,
|
|
383
|
-
0.20971520000000016,
|
|
384
|
-
0.26214400000000015,
|
|
385
|
-
0.3276800000000002,
|
|
380
|
+
0.3,
|
|
386
381
|
0.4096000000000002,
|
|
387
382
|
0.5120000000000001,
|
|
388
383
|
0.6400000000000001,
|
|
@@ -392,12 +387,7 @@ var ScalePoints = [
|
|
|
392
387
|
1.5876000000000001,
|
|
393
388
|
2.000376,
|
|
394
389
|
2.5204737600000002,
|
|
395
|
-
3
|
|
396
|
-
4.001504141376,
|
|
397
|
-
5.041895218133761,
|
|
398
|
-
6.352787974848539,
|
|
399
|
-
8.00451284830916,
|
|
400
|
-
10
|
|
390
|
+
3
|
|
401
391
|
];
|
|
402
392
|
function nextScale(scale, delta) {
|
|
403
393
|
const { length } = ScalePoints;
|
|
@@ -740,59 +730,10 @@ function PageControl({
|
|
|
740
730
|
}
|
|
741
731
|
|
|
742
732
|
// src/components/Toolbar/hooks.ts
|
|
743
|
-
import { useCallback as useCallback5 } from "react";
|
|
744
|
-
function useRoomState() {
|
|
745
|
-
return useFastboardValue(useFastboardApp().memberState);
|
|
746
|
-
}
|
|
747
|
-
function useToolbar() {
|
|
748
|
-
const app = useFastboardApp();
|
|
749
|
-
const writable = useWritable();
|
|
750
|
-
const memberState = useRoomState();
|
|
751
|
-
const cleanCurrentScene = useCallback5(() => {
|
|
752
|
-
app.cleanCurrentScene();
|
|
753
|
-
}, [app]);
|
|
754
|
-
const setAppliance = useCallback5((appliance, shape) => {
|
|
755
|
-
app.setAppliance(appliance, shape);
|
|
756
|
-
}, [app]);
|
|
757
|
-
const setStrokeWidth = useCallback5((strokeWidth) => {
|
|
758
|
-
app.setStrokeWidth(strokeWidth);
|
|
759
|
-
}, [app]);
|
|
760
|
-
const setStrokeColor = useCallback5((strokeColor) => {
|
|
761
|
-
app.setStrokeColor(strokeColor);
|
|
762
|
-
}, [app]);
|
|
763
|
-
return {
|
|
764
|
-
writable,
|
|
765
|
-
memberState,
|
|
766
|
-
cleanCurrentScene,
|
|
767
|
-
setAppliance,
|
|
768
|
-
setStrokeWidth,
|
|
769
|
-
setStrokeColor
|
|
770
|
-
};
|
|
771
|
-
}
|
|
772
|
-
var EmptyToolbarHook = {
|
|
773
|
-
writable: false,
|
|
774
|
-
memberState: void 0,
|
|
775
|
-
cleanCurrentScene: noop,
|
|
776
|
-
setAppliance: noop,
|
|
777
|
-
setStrokeWidth: noop,
|
|
778
|
-
setStrokeColor: noop
|
|
779
|
-
};
|
|
733
|
+
import { useCallback as useCallback5, useState as useState3 } from "react";
|
|
780
734
|
|
|
781
|
-
// src/components/Toolbar/
|
|
782
|
-
import
|
|
783
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
784
|
-
import React43, { createContext as createContext3, useState as useState4 } from "react";
|
|
785
|
-
|
|
786
|
-
// src/components/Toolbar/components/assets/expanded.png
|
|
787
|
-
var expanded_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAB8CAYAAAAMw2JFAAAAAXNSR0IArs4c6QAAA5xJREFUeF7tnL9v00AUx5/TlRkJMSAxZ+jYCf4GtopK6dB2qBBsjshaJErboWVJpYaNLGDaIR2YYAFXqlxhlvzAJkhGJGlyDhVNSpWgyOiqBJnQ+urznW2Jy1JVVnKffv3x8yV9LxLE5CEBwFUA6ALAzyiZJFVVX21ubj7N5/MmACAAGEQBJDWbzQZCqGcYRm52dlbpdDpNAPgRNozkOE691+tBo9FItNtto1AorC0tLX0EAAzUDwvoDGS02NHREU4IarXatizLOV3XvwHAdwBweAP9BYIXGwwGcHh4mLBtG2matrGwsPB2mA5Xmf8BGf3lJycn+HRNtFqtd2HIfCEIBnIcBxBCEkKobxjGFk+ZPUFG6YQh86VAPGSuAUCbhcy+QMZktjVNW2cls28QD5k/A0CLtjJTg4zLbJpmLpVKvaStzIFAWMrMBISFzExBgsjMHIRWZm4gfmXmCnKezIqiLK+srOjDG+mfu3ooIG6Z6/X6r/39/Udzc3OvAQBX5jOYUEHwgqenp2BZlrS7u/sgnU6/Ge53wgfBMN1uV6pWq/b09PTdSqVSwtU49ERGp8myrISqqsszMzPPcSqRgRwfH0vlcvnD1NTUIgB8jQyk3+9DuVy2Jycn7wBANTIQvPsrlUqJZDJ5GwA+RQaCXSkWixPJZPKWABldOSKR8XeLIhGRCOkTBOGIcEQ4QkpAOEJKSNQR4YhwhJSAcISUkKgjTBy5fuPmNfxCNetLA/98srp25WFaxv+UpH5QnZpxEPz7/XuLnSAwzEBwFEFgmIIEgWEOQgvDBYQGhhuIXxiuIH5g/g8QP5czt0T8QFB/mHdeZXXXdr8QXEBoIJiD0EIwBQkCwQwksm0A9abD44lUl68A4ZEAkz0rDzDhiDg1JK+EI8IR4QgpAeEIKSFRR4QjwhFSAsIRUkKijsTSkdi0f8WmIS42LYKxaJqMRRtpLBpr8URTpK3GrrEYU1GUx6E3X7sHhUzTfJZKpV5cNFvBrY10NDqFEFKz2ex6Pp/3nDZhDuIaJrMPDg425ufncac3HrXzHCZjCuIar9vJZDI5TdPweN2lJpKYgLhlLBQKqzQDh4FA/MhI2ptQg/iVkTkIrYxMQdwyyrK8pet6uONxLGQMlAhLGalBXDK+z2azG6TKSFqIdNxrzNZXZSQtRDp+0eDxDmsZLwUSxvQqEWQ4nN4n3aZJLxT0uLS3t7cdhowk0Ph8gQGJNKzjvwGKWUjXcvHclAAAAABJRU5ErkJggg==";
|
|
788
|
-
|
|
789
|
-
// src/components/Toolbar/Content.tsx
|
|
790
|
-
import clsx8 from "clsx";
|
|
791
|
-
import React42, { useCallback as useCallback10, useContext as useContext13, useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
|
|
792
|
-
|
|
793
|
-
// src/components/Toolbar/components/ApplianceButtons.tsx
|
|
794
|
-
import React33, { useCallback as useCallback6, useContext as useContext4 } from "react";
|
|
795
|
-
import { ApplianceNames } from "white-web-sdk";
|
|
735
|
+
// src/components/Toolbar/const.ts
|
|
736
|
+
import { ApplianceNames, ShapeType } from "white-web-sdk";
|
|
796
737
|
|
|
797
738
|
// src/components/Toolbar/icons/index.ts
|
|
798
739
|
import { memo } from "react";
|
|
@@ -1069,6 +1010,96 @@ var Icons = {
|
|
|
1069
1010
|
Down: memo(Down)
|
|
1070
1011
|
};
|
|
1071
1012
|
|
|
1013
|
+
// src/components/Toolbar/const.ts
|
|
1014
|
+
var ShapesMap = {
|
|
1015
|
+
[ApplianceNames.rectangle]: Icons.Rectangle,
|
|
1016
|
+
[ApplianceNames.ellipse]: Icons.Circle,
|
|
1017
|
+
[ApplianceNames.straight]: Icons.Line,
|
|
1018
|
+
[ApplianceNames.arrow]: Icons.Arrow,
|
|
1019
|
+
[ShapeType.Pentagram]: Icons.Star,
|
|
1020
|
+
[ShapeType.Rhombus]: Icons.Diamond,
|
|
1021
|
+
[ShapeType.Triangle]: Icons.Triangle,
|
|
1022
|
+
[ShapeType.SpeechBalloon]: Icons.SpeechBalloon
|
|
1023
|
+
};
|
|
1024
|
+
var ApplianceShapes = [
|
|
1025
|
+
ApplianceNames.rectangle,
|
|
1026
|
+
ApplianceNames.ellipse,
|
|
1027
|
+
ApplianceNames.straight,
|
|
1028
|
+
ApplianceNames.arrow
|
|
1029
|
+
];
|
|
1030
|
+
var Shapes = [
|
|
1031
|
+
ShapeType.Pentagram,
|
|
1032
|
+
ShapeType.Rhombus,
|
|
1033
|
+
ShapeType.Triangle,
|
|
1034
|
+
ShapeType.SpeechBalloon
|
|
1035
|
+
];
|
|
1036
|
+
var ItemHeight = 32 + 4;
|
|
1037
|
+
var ItemsCount = 8;
|
|
1038
|
+
var MaxHeight = ItemHeight * ItemsCount - 4;
|
|
1039
|
+
var MinHeight = ItemHeight * 2 - 4;
|
|
1040
|
+
|
|
1041
|
+
// src/components/Toolbar/hooks.ts
|
|
1042
|
+
function useRoomState() {
|
|
1043
|
+
return useFastboardValue(useFastboardApp().memberState);
|
|
1044
|
+
}
|
|
1045
|
+
function useToolbar() {
|
|
1046
|
+
const app = useFastboardApp();
|
|
1047
|
+
const writable = useWritable();
|
|
1048
|
+
const memberState = useRoomState();
|
|
1049
|
+
const [lastShape, setLastShape] = useState3("rectangle");
|
|
1050
|
+
const cleanCurrentScene = useCallback5(() => {
|
|
1051
|
+
app.cleanCurrentScene();
|
|
1052
|
+
}, [app]);
|
|
1053
|
+
const setAppliance = useCallback5((appliance, shape) => {
|
|
1054
|
+
app.setAppliance(appliance, shape);
|
|
1055
|
+
if (shape) {
|
|
1056
|
+
setLastShape(shape);
|
|
1057
|
+
} else if (appliance in ShapesMap) {
|
|
1058
|
+
setLastShape(appliance);
|
|
1059
|
+
}
|
|
1060
|
+
}, [app]);
|
|
1061
|
+
const setStrokeWidth = useCallback5((strokeWidth) => {
|
|
1062
|
+
app.setStrokeWidth(strokeWidth);
|
|
1063
|
+
}, [app]);
|
|
1064
|
+
const setStrokeColor = useCallback5((strokeColor) => {
|
|
1065
|
+
app.setStrokeColor(strokeColor);
|
|
1066
|
+
}, [app]);
|
|
1067
|
+
return {
|
|
1068
|
+
writable,
|
|
1069
|
+
memberState,
|
|
1070
|
+
lastShape,
|
|
1071
|
+
cleanCurrentScene,
|
|
1072
|
+
setAppliance,
|
|
1073
|
+
setStrokeWidth,
|
|
1074
|
+
setStrokeColor
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
var EmptyToolbarHook = {
|
|
1078
|
+
writable: false,
|
|
1079
|
+
memberState: void 0,
|
|
1080
|
+
lastShape: "rectangle",
|
|
1081
|
+
cleanCurrentScene: noop,
|
|
1082
|
+
setAppliance: noop,
|
|
1083
|
+
setStrokeWidth: noop,
|
|
1084
|
+
setStrokeColor: noop
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
// src/components/Toolbar/Toolbar.tsx
|
|
1088
|
+
import clsx9 from "clsx";
|
|
1089
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
1090
|
+
import React43, { createContext as createContext3, useState as useState5 } from "react";
|
|
1091
|
+
|
|
1092
|
+
// src/components/Toolbar/components/assets/expanded.png
|
|
1093
|
+
var expanded_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAB8CAYAAAAMw2JFAAAAAXNSR0IArs4c6QAAA5xJREFUeF7tnL9v00AUx5/TlRkJMSAxZ+jYCf4GtopK6dB2qBBsjshaJErboWVJpYaNLGDaIR2YYAFXqlxhlvzAJkhGJGlyDhVNSpWgyOiqBJnQ+urznW2Jy1JVVnKffv3x8yV9LxLE5CEBwFUA6ALAzyiZJFVVX21ubj7N5/MmACAAGEQBJDWbzQZCqGcYRm52dlbpdDpNAPgRNozkOE691+tBo9FItNtto1AorC0tLX0EAAzUDwvoDGS02NHREU4IarXatizLOV3XvwHAdwBweAP9BYIXGwwGcHh4mLBtG2matrGwsPB2mA5Xmf8BGf3lJycn+HRNtFqtd2HIfCEIBnIcBxBCEkKobxjGFk+ZPUFG6YQh86VAPGSuAUCbhcy+QMZktjVNW2cls28QD5k/A0CLtjJTg4zLbJpmLpVKvaStzIFAWMrMBISFzExBgsjMHIRWZm4gfmXmCnKezIqiLK+srOjDG+mfu3ooIG6Z6/X6r/39/Udzc3OvAQBX5jOYUEHwgqenp2BZlrS7u/sgnU6/Ge53wgfBMN1uV6pWq/b09PTdSqVSwtU49ERGp8myrISqqsszMzPPcSqRgRwfH0vlcvnD1NTUIgB8jQyk3+9DuVy2Jycn7wBANTIQvPsrlUqJZDJ5GwA+RQaCXSkWixPJZPKWABldOSKR8XeLIhGRCOkTBOGIcEQ4QkpAOEJKSNQR4YhwhJSAcISUkKgjTBy5fuPmNfxCNetLA/98srp25WFaxv+UpH5QnZpxEPz7/XuLnSAwzEBwFEFgmIIEgWEOQgvDBYQGhhuIXxiuIH5g/g8QP5czt0T8QFB/mHdeZXXXdr8QXEBoIJiD0EIwBQkCwQwksm0A9abD44lUl68A4ZEAkz0rDzDhiDg1JK+EI8IR4QgpAeEIKSFRR4QjwhFSAsIRUkKijsTSkdi0f8WmIS42LYKxaJqMRRtpLBpr8URTpK3GrrEYU1GUx6E3X7sHhUzTfJZKpV5cNFvBrY10NDqFEFKz2ex6Pp/3nDZhDuIaJrMPDg425ufncac3HrXzHCZjCuIar9vJZDI5TdPweN2lJpKYgLhlLBQKqzQDh4FA/MhI2ptQg/iVkTkIrYxMQdwyyrK8pet6uONxLGQMlAhLGalBXDK+z2azG6TKSFqIdNxrzNZXZSQtRDp+0eDxDmsZLwUSxvQqEWQ4nN4n3aZJLxT0uLS3t7cdhowk0Ph8gQGJNKzjvwGKWUjXcvHclAAAAABJRU5ErkJggg==";
|
|
1094
|
+
|
|
1095
|
+
// src/components/Toolbar/Content.tsx
|
|
1096
|
+
import clsx8 from "clsx";
|
|
1097
|
+
import React42, { useCallback as useCallback10, useContext as useContext13, useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
|
|
1098
|
+
|
|
1099
|
+
// src/components/Toolbar/components/ApplianceButtons.tsx
|
|
1100
|
+
import React33, { useCallback as useCallback6, useContext as useContext4 } from "react";
|
|
1101
|
+
import { ApplianceNames as ApplianceNames2 } from "white-web-sdk";
|
|
1102
|
+
|
|
1072
1103
|
// src/components/Toolbar/components/Button.tsx
|
|
1073
1104
|
import clsx4 from "clsx";
|
|
1074
1105
|
import React32, { forwardRef, useContext as useContext3 } from "react";
|
|
@@ -1109,10 +1140,10 @@ function ClickerButton() {
|
|
|
1109
1140
|
const app = useFastboardApp();
|
|
1110
1141
|
const { t } = useTranslation();
|
|
1111
1142
|
const { theme, icons, writable, setAppliance, memberState } = useContext4(ToolbarContext);
|
|
1112
|
-
const changeAppliance = useCallback6(() => setAppliance(
|
|
1143
|
+
const changeAppliance = useCallback6(() => setAppliance(ApplianceNames2.clicker), [setAppliance]);
|
|
1113
1144
|
const shortcut = (_a = app.hotKeys) == null ? void 0 : _a.changeToClick;
|
|
1114
1145
|
const appliance = memberState == null ? void 0 : memberState.currentApplianceName;
|
|
1115
|
-
const active = appliance ===
|
|
1146
|
+
const active = appliance === ApplianceNames2.clicker;
|
|
1116
1147
|
const disabled = !writable;
|
|
1117
1148
|
return /* @__PURE__ */ React33.createElement(Button, {
|
|
1118
1149
|
content: renderToolTip(t("clicker"), shortcut),
|
|
@@ -1131,9 +1162,9 @@ function SelectorButton() {
|
|
|
1131
1162
|
const app = useFastboardApp();
|
|
1132
1163
|
const { t } = useTranslation();
|
|
1133
1164
|
const { theme, icons, writable, setAppliance, memberState } = useContext4(ToolbarContext);
|
|
1134
|
-
const changeAppliance = useCallback6(() => setAppliance(
|
|
1165
|
+
const changeAppliance = useCallback6(() => setAppliance(ApplianceNames2.selector), [setAppliance]);
|
|
1135
1166
|
const appliance = memberState == null ? void 0 : memberState.currentApplianceName;
|
|
1136
|
-
const active = appliance ===
|
|
1167
|
+
const active = appliance === ApplianceNames2.selector;
|
|
1137
1168
|
const disabled = !writable;
|
|
1138
1169
|
const shortcut = (app.hotKeys || defaultHotKeys).changeToSelector;
|
|
1139
1170
|
return /* @__PURE__ */ React33.createElement(Button, {
|
|
@@ -1153,9 +1184,9 @@ function EraserButton() {
|
|
|
1153
1184
|
const app = useFastboardApp();
|
|
1154
1185
|
const { t } = useTranslation();
|
|
1155
1186
|
const { theme, icons, writable, setAppliance, memberState } = useContext4(ToolbarContext);
|
|
1156
|
-
const changeAppliance = useCallback6(() => setAppliance(
|
|
1187
|
+
const changeAppliance = useCallback6(() => setAppliance(ApplianceNames2.eraser), [setAppliance]);
|
|
1157
1188
|
const appliance = memberState == null ? void 0 : memberState.currentApplianceName;
|
|
1158
|
-
const active = appliance ===
|
|
1189
|
+
const active = appliance === ApplianceNames2.eraser;
|
|
1159
1190
|
const disabled = !writable;
|
|
1160
1191
|
const shortcut = ((app == null ? void 0 : app.hotKeys) || defaultHotKeys).changeToEraser;
|
|
1161
1192
|
return /* @__PURE__ */ React33.createElement(Button, {
|
|
@@ -1272,7 +1303,7 @@ function AppIcon({ title, src, alt, onClick }) {
|
|
|
1272
1303
|
// src/components/Toolbar/components/PencilButton.tsx
|
|
1273
1304
|
import Tippy6 from "@tippyjs/react";
|
|
1274
1305
|
import React38, { useCallback as useCallback7, useContext as useContext9 } from "react";
|
|
1275
|
-
import { ApplianceNames as
|
|
1306
|
+
import { ApplianceNames as ApplianceNames3 } from "white-web-sdk";
|
|
1276
1307
|
|
|
1277
1308
|
// src/components/Toolbar/components/ColorBox.tsx
|
|
1278
1309
|
import clsx5 from "clsx";
|
|
@@ -1349,10 +1380,10 @@ function PencilButton() {
|
|
|
1349
1380
|
const { t } = useTranslation();
|
|
1350
1381
|
const { theme, icons, writable, setAppliance, memberState } = useContext9(ToolbarContext);
|
|
1351
1382
|
const changeAppliance = useCallback7(() => {
|
|
1352
|
-
setAppliance(
|
|
1383
|
+
setAppliance(ApplianceNames3.pencil);
|
|
1353
1384
|
}, [setAppliance]);
|
|
1354
1385
|
const appliance = memberState == null ? void 0 : memberState.currentApplianceName;
|
|
1355
|
-
const active = appliance ===
|
|
1386
|
+
const active = appliance === ApplianceNames3.pencil;
|
|
1356
1387
|
const disabled = !writable;
|
|
1357
1388
|
const shortcut = ((app == null ? void 0 : app.hotKeys) || defaultHotKeys).changeToPencil;
|
|
1358
1389
|
return /* @__PURE__ */ React38.createElement("span", {
|
|
@@ -1391,46 +1422,15 @@ function renderPencilButtonContent() {
|
|
|
1391
1422
|
import Tippy7 from "@tippyjs/react";
|
|
1392
1423
|
import React39, { useContext as useContext10 } from "react";
|
|
1393
1424
|
import { ApplianceNames as ApplianceNames4 } from "white-web-sdk";
|
|
1394
|
-
|
|
1395
|
-
// src/components/Toolbar/const.ts
|
|
1396
|
-
import { ApplianceNames as ApplianceNames3, ShapeType } from "white-web-sdk";
|
|
1397
|
-
var ShapesMap = {
|
|
1398
|
-
[ApplianceNames3.rectangle]: Icons.Rectangle,
|
|
1399
|
-
[ApplianceNames3.ellipse]: Icons.Circle,
|
|
1400
|
-
[ApplianceNames3.straight]: Icons.Line,
|
|
1401
|
-
[ApplianceNames3.arrow]: Icons.Arrow,
|
|
1402
|
-
[ShapeType.Pentagram]: Icons.Star,
|
|
1403
|
-
[ShapeType.Rhombus]: Icons.Diamond,
|
|
1404
|
-
[ShapeType.Triangle]: Icons.Triangle,
|
|
1405
|
-
[ShapeType.SpeechBalloon]: Icons.SpeechBalloon
|
|
1406
|
-
};
|
|
1407
|
-
var ApplianceShapes = [
|
|
1408
|
-
ApplianceNames3.rectangle,
|
|
1409
|
-
ApplianceNames3.ellipse,
|
|
1410
|
-
ApplianceNames3.straight,
|
|
1411
|
-
ApplianceNames3.arrow
|
|
1412
|
-
];
|
|
1413
|
-
var Shapes = [
|
|
1414
|
-
ShapeType.Pentagram,
|
|
1415
|
-
ShapeType.Rhombus,
|
|
1416
|
-
ShapeType.Triangle,
|
|
1417
|
-
ShapeType.SpeechBalloon
|
|
1418
|
-
];
|
|
1419
|
-
var ItemHeight = 32 + 4;
|
|
1420
|
-
var ItemsCount = 8;
|
|
1421
|
-
var MaxHeight = ItemHeight * ItemsCount - 4;
|
|
1422
|
-
var MinHeight = ItemHeight * 2 - 4;
|
|
1423
|
-
|
|
1424
|
-
// src/components/Toolbar/components/ShapesButton.tsx
|
|
1425
1425
|
var ShapeTypes = /* @__PURE__ */ new Set([...ApplianceShapes, ...Shapes]);
|
|
1426
1426
|
function ShapesButton() {
|
|
1427
1427
|
const { t } = useTranslation();
|
|
1428
|
-
const { theme, memberState } = useContext10(ToolbarContext);
|
|
1428
|
+
const { theme, memberState, lastShape } = useContext10(ToolbarContext);
|
|
1429
1429
|
const appliance = memberState == null ? void 0 : memberState.currentApplianceName;
|
|
1430
1430
|
const shape = memberState == null ? void 0 : memberState.shapeType;
|
|
1431
1431
|
const key = appliance === ApplianceNames4.shape ? shape : appliance;
|
|
1432
1432
|
const active = ShapeTypes.has(key);
|
|
1433
|
-
const CurrentIcon = ShapesMap[
|
|
1433
|
+
const CurrentIcon = ShapesMap[lastShape];
|
|
1434
1434
|
return /* @__PURE__ */ React39.createElement("span", {
|
|
1435
1435
|
className: "fastboard-toolbar-btn-interactive"
|
|
1436
1436
|
}, /* @__PURE__ */ React39.createElement(Tippy7, {
|
|
@@ -1590,8 +1590,8 @@ var collapsed_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAB8C
|
|
|
1590
1590
|
function Content({ onCollapse }) {
|
|
1591
1591
|
const { theme, icons, writable } = useContext13(ToolbarContext);
|
|
1592
1592
|
const ref = useRef2(null);
|
|
1593
|
-
const [scrollTop, setScrollTop] =
|
|
1594
|
-
const [parentHeight, setParentHeight] =
|
|
1593
|
+
const [scrollTop, setScrollTop] = useState4(0);
|
|
1594
|
+
const [parentHeight, setParentHeight] = useState4(0);
|
|
1595
1595
|
const disabled = !writable;
|
|
1596
1596
|
const needScroll = parentHeight < ItemHeight * ItemsCount + 48;
|
|
1597
1597
|
const sectionHeight = clamp(parentHeight - 48 * (needScroll ? 3 : 1), MinHeight, MaxHeight);
|
|
@@ -1653,8 +1653,8 @@ var name4 = "fastboard-toolbar";
|
|
|
1653
1653
|
function Toolbar({ theme, icons }) {
|
|
1654
1654
|
theme = useTheme(theme);
|
|
1655
1655
|
const hook = useToolbar();
|
|
1656
|
-
const [expanded, setExpanded] =
|
|
1657
|
-
const [pointerEvents, setPointerEvents] =
|
|
1656
|
+
const [expanded, setExpanded] = useState5(true);
|
|
1657
|
+
const [pointerEvents, setPointerEvents] = useState5("auto");
|
|
1658
1658
|
const disabled = !hook.writable;
|
|
1659
1659
|
return /* @__PURE__ */ React43.createElement(ToolbarContext.Provider, {
|
|
1660
1660
|
value: __spreadValues({ theme, icons }, hook)
|
|
@@ -1686,11 +1686,11 @@ function Toolbar({ theme, icons }) {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
|
|
1688
1688
|
// src/components/PlayerControl/hooks.ts
|
|
1689
|
-
import { useCallback as useCallback11, useEffect as useEffect4, useState as
|
|
1689
|
+
import { useCallback as useCallback11, useEffect as useEffect4, useState as useState6 } from "react";
|
|
1690
1690
|
import { PlayerPhase } from "white-web-sdk";
|
|
1691
1691
|
var EMPTY_ARRAY = [];
|
|
1692
1692
|
function useForceUpdate2() {
|
|
1693
|
-
const [, forceUpdate_] =
|
|
1693
|
+
const [, forceUpdate_] = useState6({});
|
|
1694
1694
|
return useCallback11(() => forceUpdate_({}), EMPTY_ARRAY);
|
|
1695
1695
|
}
|
|
1696
1696
|
function usePlayerControl(player) {
|
|
@@ -1757,7 +1757,7 @@ function usePlayerControl(player) {
|
|
|
1757
1757
|
import Tippy10 from "@tippyjs/react";
|
|
1758
1758
|
import clsx11 from "clsx";
|
|
1759
1759
|
import RcSlider2 from "rc-slider";
|
|
1760
|
-
import React48, { useEffect as useEffect5, useState as
|
|
1760
|
+
import React48, { useEffect as useEffect5, useState as useState7 } from "react";
|
|
1761
1761
|
import { PlayerPhase as PlayerPhase2 } from "white-web-sdk";
|
|
1762
1762
|
|
|
1763
1763
|
// src/components/PlayerControl/components/Button.tsx
|
|
@@ -1836,7 +1836,7 @@ function PlayerControl(_a) {
|
|
|
1836
1836
|
var _b = _a, { theme, autoHide = false, player: player_ } = _b, icons = __objRest(_b, ["theme", "autoHide", "player"]);
|
|
1837
1837
|
theme = useTheme(theme);
|
|
1838
1838
|
const { t } = useTranslation();
|
|
1839
|
-
const [currentTime, setCurrentTime] =
|
|
1839
|
+
const [currentTime, setCurrentTime] = useState7(0);
|
|
1840
1840
|
const player = usePlayerControl(player_);
|
|
1841
1841
|
useEffect5(() => {
|
|
1842
1842
|
setCurrentTime(player.currentTime);
|