@netless/forge-whiteboard 0.1.6 → 0.1.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhiteboardApplication.d.ts","sourceRoot":"","sources":["../src/WhiteboardApplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"WhiteboardApplication.d.ts","sourceRoot":"","sources":["../src/WhiteboardApplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAM,MAAM,qBAAqB,CAAC;AAS7D,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAUhE,OAAO,EAAyC,UAAU,EAAC,MAAM,cAAc,CAAC;AAchF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACL,WAAW,GACX,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEb,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAExF,MAAM,CAAC,eAAe,SAAuB;IAE7C,SAAgB,IAAI,EAAE,MAAM,CAAuB;IAC5C,OAAO,EAAE,UAAU,CAAC;IAEpB,YAAY,EAAG,YAAY,CAAC;IACnC,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,oBAAoB,CAAwB;IACpD,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,MAAM,CA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,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA4C9D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAexC"}
|
package/dist/whiteboard.esm.js
CHANGED
|
@@ -25362,7 +25362,7 @@ var require_lodash = __commonJS({
|
|
|
25362
25362
|
|
|
25363
25363
|
// src/WhiteboardApplication.ts
|
|
25364
25364
|
var import_paper = __toESM(require_paper_full(), 1);
|
|
25365
|
-
import { AbstractApplication } from "@netless/forge-room";
|
|
25365
|
+
import { AbstractApplication, log as log3 } from "@netless/forge-room";
|
|
25366
25366
|
import * as Y15 from "yjs";
|
|
25367
25367
|
|
|
25368
25368
|
// src/model/RenderableModel.ts
|
|
@@ -27751,7 +27751,7 @@ var ToolbarModel = class extends EventEmitter3 {
|
|
|
27751
27751
|
this.root = root;
|
|
27752
27752
|
this.root.observe(this.handleRootUpdate);
|
|
27753
27753
|
Object.keys(defaultStyle).forEach((key) => {
|
|
27754
|
-
if (!this.root.has(key)) {
|
|
27754
|
+
if (!this.root.has(key) || this.root.get(key) === void 0) {
|
|
27755
27755
|
this.root.set(key, defaultStyle[key]);
|
|
27756
27756
|
}
|
|
27757
27757
|
});
|
|
@@ -30139,6 +30139,12 @@ var WhiteboardApplication = class extends AbstractApplication {
|
|
|
30139
30139
|
this.inputType = type;
|
|
30140
30140
|
this.emitter.emit("inputTypeChange", this.inputType);
|
|
30141
30141
|
};
|
|
30142
|
+
this.emitter.on("error", (errorCode, errorMessage) => {
|
|
30143
|
+
log3("WhiteboardApplicationError", {
|
|
30144
|
+
errorCode,
|
|
30145
|
+
errorMessage
|
|
30146
|
+
});
|
|
30147
|
+
});
|
|
30142
30148
|
const that = this;
|
|
30143
30149
|
Object.defineProperty(this.emitter, "tool", {
|
|
30144
30150
|
get() {
|
|
@@ -30284,10 +30290,19 @@ var WhiteboardApplication = class extends AbstractApplication {
|
|
|
30284
30290
|
grab: new GrabTool(this.enableToolEvent, this.getCurrentRenderableModel, this.shadowEmitter, this.paperScope, this.camera)
|
|
30285
30291
|
};
|
|
30286
30292
|
this.toolbarModel.on("update", (style) => {
|
|
30287
|
-
|
|
30293
|
+
if (this.tools[style.tool]) {
|
|
30294
|
+
this.paperScope.tool = this.tools[style.tool].tool;
|
|
30295
|
+
} else {
|
|
30296
|
+
this.emitter.emit("error", 300001, `${style.tool} not supported`);
|
|
30297
|
+
}
|
|
30288
30298
|
this.emitter.emit("toolbarStyleChange", style);
|
|
30289
30299
|
});
|
|
30290
|
-
|
|
30300
|
+
if (this.tools[this.toolbarModel.currentTool]) {
|
|
30301
|
+
this.paperScope.tool = this.tools[this.toolbarModel.currentTool].tool;
|
|
30302
|
+
} else {
|
|
30303
|
+
this.paperScope.tool = this.tools["curve"].tool;
|
|
30304
|
+
log3(`${this.toolbarModel.currentTool} not supported, backup to curve`);
|
|
30305
|
+
}
|
|
30291
30306
|
this.selectElementsModel.on("elementsChange", this.handleElementsSelect);
|
|
30292
30307
|
this.trashedElementsModel.on("elementsChange", this.handleElementsTrash);
|
|
30293
30308
|
this.trashedElementsModel.on("removeElementForSelf", this.handleRemoveTrashedElementForSelf);
|
|
@@ -30506,7 +30521,7 @@ var WhiteboardApplication = class extends AbstractApplication {
|
|
|
30506
30521
|
getCurrentRenderableModel = () => {
|
|
30507
30522
|
let layerId = this.userMap(this.userId).get(WhiteboardKeys.currentPage);
|
|
30508
30523
|
if (!this.layers.has(layerId)) {
|
|
30509
|
-
this.emitter.emit("error",
|
|
30524
|
+
this.emitter.emit("error", 300002, `target page: ${layerId} not found`);
|
|
30510
30525
|
}
|
|
30511
30526
|
return this.layers.get(layerId);
|
|
30512
30527
|
};
|