Skip to content

Commit

Permalink
chore(whiteboard): upgrade window-manager, add more apps (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Aug 31, 2022
1 parent fbef74a commit 75870a3
Show file tree
Hide file tree
Showing 19 changed files with 901 additions and 370 deletions.
1 change: 1 addition & 0 deletions cspell.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module.exports = {
"Buildin", // @netless/widnow-manager
"zindex", // antd
"geogebra", // @netless/app-geogebra
"mindmap", // @netless/app-mindmap
"commitlintrc", // @commitlint/cli
"unpublish", // agora-rtc-sdk-ng
"multipass", // svgo
Expand Down
18 changes: 11 additions & 7 deletions desktop/renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@netless/app-countdown": "^0.0.2",
"@netless/app-geogebra": "^0.0.4",
"@netless/app-countdown": "^0.0.3",
"@netless/app-dice": "^0.1.0",
"@netless/app-geogebra": "^0.0.5",
"@netless/app-iframe-bridge": "^0.0.2",
"@netless/app-monaco": "^0.1.14-beta.1",
"@netless/app-plyr": "^0.1.3",
"@netless/app-slide": "^0.2.2",
"@netless/app-mindmap": "^0.1.0",
"@netless/app-monaco": "0.2.0-canary.0",
"@netless/app-plyr": "^0.2.2",
"@netless/app-quill": "^0.1.0",
"@netless/app-selector": "^0.0.2",
"@netless/app-slide": "0.3.0-canary.7",
"@netless/combine-player": "^1.1.6",
"@netless/flat-i18n": "workspace:*",
"@netless/flat-pages": "workspace:*",
Expand All @@ -35,7 +39,7 @@
"@netless/flat-services": "workspace:*",
"@videojs/vhs-utils": "^2.3.0",
"agora-rtm-sdk": "^1.4.4",
"antd": "^4.19.2",
"antd": "^4.22.8",
"axios": "^0.26.1",
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
Expand Down Expand Up @@ -71,7 +75,7 @@
"esbuild": "^0.14.27",
"flat-types": "workspace:*",
"monaco-editor": "^0.27.0",
"rc-picker": "^2.6.4",
"rc-picker": "^2.6.10",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-visualizer": "^5.6.0"
}
Expand Down
51 changes: 50 additions & 1 deletion desktop/renderer-app/src/tasks/init-flat-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { FilePreviewPage } from "@netless/flat-pages/src/FilePreviewPage";
import monacoSVG from "@netless/flat-pages/src/assets/image/tool-monaco.svg";
import geogebraSVG from "@netless/flat-pages/src/assets/image/tool-geogebra.svg";
import countdownSVG from "@netless/flat-pages/src/assets/image/tool-countdown.svg";
import selectorSVG from "@netless/flat-pages/src/assets/image/tool-selector.svg";
import diceSVG from "@netless/flat-pages/src/assets/image/tool-dice.svg";
import mindmapSVG from "@netless/flat-pages/src/assets/image/tool-mindmap.svg";
import quillSVG from "@netless/flat-pages/src/assets/image/tool-quill.svg";
import saveSVG from "@netless/flat-pages/src/assets/image/tool-save.svg";
import presetsSVG from "@netless/flat-pages/src/assets/image/tool-presets.svg";

Expand Down Expand Up @@ -132,13 +136,29 @@ export function initFlatServices(): void {
});
void register({
kind: "GeoGebra",
src: async () => import("@netless/app-geogebra"),
src: () => import("@netless/app-geogebra"),
appOptions: {
// TODO: replace it with non-country specific url
HTML5Codebase:
"https://flat-storage-cn-hz.whiteboard.agora.io/GeoGebra/HTML5/5.0/web3d",
},
});
void register({
kind: "Selector",
src: () => import("@netless/app-selector"),
});
void register({
kind: "Dice",
src: () => import("@netless/app-dice"),
});
void register({
kind: "MindMap",
src: () => import("@netless/app-mindmap"),
});
void register({
kind: "Quill",
src: () => import("@netless/app-quill"),
});
void register({
kind: "IframeBridge",
src: () => import("@netless/app-iframe-bridge"),
Expand Down Expand Up @@ -178,6 +198,35 @@ export function initFlatServices(): void {
label: flatI18n.t("tool.countdown"),
onClick: app => app.manager.addApp({ kind: "Countdown" }),
},
{
kind: "Selector",
icon: selectorSVG,
label: flatI18n.t("tool.selector"),
onClick: app => app.manager.addApp({ kind: "Selector" }),
},
{
kind: "Dice",
icon: diceSVG,
label: flatI18n.t("tool.dice"),
onClick: app => app.manager.addApp({ kind: "Dice" }),
},
{
kind: "MindMap",
icon: mindmapSVG,
label: flatI18n.t("tool.mindmap"),
onClick: app => {
// HACK: workaround app-monaco defines a `define` in global scope,
// and mindmap uses an AMD module that will break in this case.
(window as any).define = undefined;
app.manager.addApp({ kind: "MindMap", options: { title: "MindMap" } });
},
},
{
kind: "Quill",
icon: quillSVG,
label: flatI18n.t("tool.quill"),
onClick: app => app.manager.addApp({ kind: "Quill" }),
},
{
kind: "Save",
icon: saveSVG,
Expand Down
4 changes: 2 additions & 2 deletions packages/flat-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"@netless/flat-i18n": "workspace:*",
"@netless/flat-server-api": "workspace:*",
"@netless/flat-services": "workspace:*",
"antd": "^4.19.2",
"antd": "^4.22.8",
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
"mobx": "^6.6.1",
"mobx-react-lite": "^3.4.0",
"p-limit": "^4.0.0",
"pretty-bytes": "^6.0.0",
"rc-picker": "^2.6.4",
"rc-picker": "^2.6.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-resize-detector": "^7.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/flat-i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@
"monaco": "Code Editor",
"geogebra": "GeoGebra",
"countdown": "Countdown",
"selector": "Selector",
"dice": "Dice",
"mindmap": "MindMap",
"quill": "Rich Text Editor",
"save": "Save Annotation",
"presets": "Presets"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/flat-i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@
"monaco": "编辑器",
"geogebra": "几何代数",
"countdown": "计时器",
"selector": "答题器",
"dice": "骰子",
"mindmap": "思维导图",
"quill": "富文本编辑器",
"save": "保存板书",
"presets": "素材库"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/flat-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"license": "MIT",
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@netless/app-countdown": "^0.0.2",
"@netless/app-geogebra": "^0.0.4",
"@netless/app-countdown": "^0.0.3",
"@netless/app-geogebra": "^0.0.5",
"@netless/app-iframe-bridge": "^0.0.2",
"@netless/app-monaco": "^0.1.14-beta.1",
"@netless/app-plyr": "^0.1.3",
"@netless/app-slide": "^0.2.2",
"@netless/app-monaco": "0.2.0-canary.0",
"@netless/app-plyr": "^0.2.2",
"@netless/app-slide": "0.3.0-canary.7",
"@netless/combine-player": "^1.1.6",
"@netless/flat-i18n": "workspace:*",
"@netless/flat-server-api": "workspace:*",
"@netless/flat-service-provider-agora-rtc-web": "workspace:*",
"@netless/flat-service-provider-agora-rtm": "workspace:*",
"@netless/flat-services": "workspace:*",
"@netless/flat-stores": "workspace:*",
"antd": "^4.19.2",
"antd": "^4.22.8",
"axios": "^0.26.1",
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
Expand Down
1 change: 1 addition & 0 deletions packages/flat-pages/src/assets/image/tool-dice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/flat-pages/src/assets/image/tool-mindmap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/flat-pages/src/assets/image/tool-quill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/flat-pages/src/assets/image/tool-selector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/flat-stores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"white-web-sdk": ">=2.16"
},
"devDependencies": {
"@netless/fastboard": "^0.3.6",
"@netless/window-manager": "^0.4.43",
"@netless/fastboard": "1.0.0-canary.5",
"@netless/window-manager": "1.0.0-canary.50",
"mobx": "^6.6.1",
"prettier": "^2.3.0",
"react": "^17.0.2",
Expand Down
11 changes: 0 additions & 11 deletions packages/flat-stores/src/whiteboard-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,6 @@ export class WhiteboardStore {
// @TODO remove me after refactoring
const fastboardAPP = await (this.whiteboard as any)._app$.value;

// Disable scale, fix height.
fastboardAPP.manager.mainView.setCameraBound({
damping: 1,
centerX: 0,
centerY: 0,
minContentMode: () => 1,
maxContentMode: () => 1,
width: 0,
height: 9999,
});

this.updateFastboardAPP(fastboardAPP);

const { room, manager } = fastboardAPP;
Expand Down
Loading

0 comments on commit 75870a3

Please sign in to comment.