@netless/forge-whiteboard 0.1.11 → 0.1.13
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/changelog.md +5 -1
- package/dist/WhiteboardApplication.d.ts +2 -3
- package/dist/WhiteboardApplication.d.ts.map +1 -1
- package/dist/whiteboard.esm.js +27 -26
- package/dist/whiteboard.esm.js.map +2 -2
- package/dist/whiteboard.js +27 -26
- package/dist/whiteboard.js.map +2 -2
- package/package.json +3 -4
package/dist/whiteboard.js
CHANGED
|
@@ -30710,12 +30710,12 @@ var WhiteboardApplication = class extends import_forge_room3.AbstractApplication
|
|
|
30710
30710
|
_defineProperty40(this, "resizeObserver", void 0);
|
|
30711
30711
|
_defineProperty40(this, "option", void 0);
|
|
30712
30712
|
_defineProperty40(this, "permissions", void 0);
|
|
30713
|
-
_defineProperty40(this, "linkTarget", null);
|
|
30714
30713
|
_defineProperty40(this, "inputType", "any");
|
|
30715
30714
|
_defineProperty40(this, "isPenEvent", false);
|
|
30716
30715
|
_defineProperty40(this, "hasPenInput", null);
|
|
30717
30716
|
_defineProperty40(this, "disableViewModelUpdate", false);
|
|
30718
30717
|
_defineProperty40(this, "internalResizeObserver", true);
|
|
30718
|
+
_defineProperty40(this, "linkTarget", null);
|
|
30719
30719
|
_defineProperty40(this, "enableToolEvent", () => {
|
|
30720
30720
|
return !(this.inputType === "pen" && !this.isPenEvent);
|
|
30721
30721
|
});
|
|
@@ -30897,20 +30897,20 @@ var WhiteboardApplication = class extends import_forge_room3.AbstractApplication
|
|
|
30897
30897
|
this.emitter.emit("elementDeselected", userId);
|
|
30898
30898
|
}
|
|
30899
30899
|
});
|
|
30900
|
-
_defineProperty40(this, "
|
|
30901
|
-
|
|
30902
|
-
|
|
30903
|
-
|
|
30904
|
-
|
|
30905
|
-
|
|
30906
|
-
|
|
30907
|
-
|
|
30908
|
-
|
|
30909
|
-
|
|
30910
|
-
|
|
30911
|
-
|
|
30912
|
-
this.permissions.addPermission(
|
|
30913
|
-
}
|
|
30900
|
+
_defineProperty40(this, "handleLinkedMapChange", (evt) => {
|
|
30901
|
+
for (const [key, value] of evt.changes.keys.entries()) {
|
|
30902
|
+
if (Object.keys(TOOLBAR_KEYS).indexOf(key) >= 0 && (value.action === "add" || value.action === "update")) {
|
|
30903
|
+
this.toolbarModel.currentTool = evt.target.get(TOOLBAR_KEYS.tool);
|
|
30904
|
+
this.toolbarModel.strokeColor = evt.target.get(TOOLBAR_KEYS.strokeColor);
|
|
30905
|
+
this.toolbarModel.fillColor = evt.target.get(TOOLBAR_KEYS.fillColor);
|
|
30906
|
+
this.toolbarModel.fontSize = evt.target.get(TOOLBAR_KEYS.fontSize);
|
|
30907
|
+
this.toolbarModel.fontFamily = evt.target.get(TOOLBAR_KEYS.fontFamily);
|
|
30908
|
+
this.toolbarModel.strokeWidth = evt.target.get(TOOLBAR_KEYS.strokeWidth);
|
|
30909
|
+
this.toolbarModel.dashArray = evt.target.get(TOOLBAR_KEYS.dashArray);
|
|
30910
|
+
}
|
|
30911
|
+
if (key === "permission" && (value.action === "add" || value.action === "update")) {
|
|
30912
|
+
this.permissions.addPermission(evt.target.get("permission"), this.userId);
|
|
30913
|
+
}
|
|
30914
30914
|
}
|
|
30915
30915
|
});
|
|
30916
30916
|
_defineProperty40(this, "adjustByOutFrame", (frameWidth, frameHeight) => {
|
|
@@ -31500,22 +31500,26 @@ var WhiteboardApplication = class extends import_forge_room3.AbstractApplication
|
|
|
31500
31500
|
this.disableViewModelUpdate = true;
|
|
31501
31501
|
}
|
|
31502
31502
|
linkToWhiteboard(targetId) {
|
|
31503
|
-
console.log("linkToWhiteboard, linkToWhiteboard, linkToWhiteboard");
|
|
31504
31503
|
if (this.linkTarget) {
|
|
31505
31504
|
this.unlink();
|
|
31506
31505
|
}
|
|
31507
|
-
this.
|
|
31506
|
+
this.userMap(this.userId);
|
|
31507
|
+
this.linkTarget = this.roomDoc.getMap(`@app/${this.name}/${targetId}/user/${this.userId}`);
|
|
31508
31508
|
if (this.linkTarget) {
|
|
31509
|
-
this.
|
|
31510
|
-
this.
|
|
31511
|
-
|
|
31512
|
-
|
|
31509
|
+
this.toolbarModel.currentTool = this.linkTarget.get(TOOLBAR_KEYS.tool);
|
|
31510
|
+
this.toolbarModel.strokeColor = this.linkTarget.get(TOOLBAR_KEYS.strokeColor);
|
|
31511
|
+
this.toolbarModel.fillColor = this.linkTarget.get(TOOLBAR_KEYS.fillColor);
|
|
31512
|
+
this.toolbarModel.fontSize = this.linkTarget.get(TOOLBAR_KEYS.fontSize);
|
|
31513
|
+
this.toolbarModel.fontFamily = this.linkTarget.get(TOOLBAR_KEYS.fontFamily);
|
|
31514
|
+
this.toolbarModel.strokeWidth = this.linkTarget.get(TOOLBAR_KEYS.strokeWidth);
|
|
31515
|
+
this.toolbarModel.dashArray = this.linkTarget.get(TOOLBAR_KEYS.dashArray);
|
|
31516
|
+
this.permissions.addPermission(this.linkTarget.get("permission"), this.userId);
|
|
31517
|
+
this.linkTarget.observe(this.handleLinkedMapChange);
|
|
31513
31518
|
}
|
|
31514
31519
|
}
|
|
31515
31520
|
unlink() {
|
|
31516
31521
|
if (this.linkTarget) {
|
|
31517
|
-
this.linkTarget.
|
|
31518
|
-
this.linkTarget.permissions.off("change", this.onLinkTargetPermissionChange);
|
|
31522
|
+
this.linkTarget.unobserve(this.handleLinkedMapChange);
|
|
31519
31523
|
}
|
|
31520
31524
|
}
|
|
31521
31525
|
setViewSize(width, height) {
|
|
@@ -31537,9 +31541,6 @@ var WhiteboardApplication = class extends import_forge_room3.AbstractApplication
|
|
|
31537
31541
|
async dispose() {
|
|
31538
31542
|
this.selectElementsModel.dispose();
|
|
31539
31543
|
this.trashedElementsModel.dispose();
|
|
31540
|
-
for (const key of this.layers.keys()) {
|
|
31541
|
-
this.layers.get(key)?.dispose();
|
|
31542
|
-
}
|
|
31543
31544
|
this.paperScope.view.remove();
|
|
31544
31545
|
this.shadowScope.view.remove();
|
|
31545
31546
|
this.rootElement.removeChild(this.canvasElement);
|