@netless/forge-whiteboard 1.0.3 → 1.0.4
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/whiteboard.js
CHANGED
|
@@ -28893,12 +28893,19 @@ var SelectElementsModel = class extends import_eventemitter33.default {
|
|
|
28893
28893
|
hasEditSelfPermission,
|
|
28894
28894
|
hasEditOthersPermission
|
|
28895
28895
|
} = this;
|
|
28896
|
+
if (!this.requestUserMap(this.userManager.selfId).has(WhiteboardKeys.selectElements)) {
|
|
28897
|
+
return;
|
|
28898
|
+
}
|
|
28896
28899
|
const ids = this.requestUserMap(this.userManager.selfId).get(WhiteboardKeys.selectElements);
|
|
28897
28900
|
const ignoreIds = /* @__PURE__ */ new Set();
|
|
28898
28901
|
for (const userId of this.userManager.userIdList()) {
|
|
28899
28902
|
if (userId !== this.userManager.selfId) {
|
|
28900
|
-
const
|
|
28901
|
-
|
|
28903
|
+
const userMap = this.requestUserMap(userId);
|
|
28904
|
+
if (!userMap.has("trashedElements") || !userMap.has(WhiteboardKeys.selectElements)) {
|
|
28905
|
+
continue;
|
|
28906
|
+
}
|
|
28907
|
+
const trashedIds = userMap.get("trashedElements");
|
|
28908
|
+
const selectedIds = userMap.get(WhiteboardKeys.selectElements);
|
|
28902
28909
|
Array.from(trashedIds.keys()).forEach((key) => ignoreIds.add(key));
|
|
28903
28910
|
Array.from(selectedIds.keys()).forEach((key) => ignoreIds.add(key));
|
|
28904
28911
|
}
|
|
@@ -28922,7 +28929,7 @@ var SelectElementsModel = class extends import_eventemitter33.default {
|
|
|
28922
28929
|
}
|
|
28923
28930
|
clearSelectElementForSelf() {
|
|
28924
28931
|
const ids = this.requestUserMap(this.userManager.selfId).get(WhiteboardKeys.selectElements);
|
|
28925
|
-
ids
|
|
28932
|
+
ids?.doc?.transact(() => {
|
|
28926
28933
|
ids.clear();
|
|
28927
28934
|
ids.set("inner-map-id", WhiteboardKeys.selectElements);
|
|
28928
28935
|
});
|
|
@@ -30611,9 +30618,16 @@ var TrashedElementsModel = class extends import_eventemitter39.default {
|
|
|
30611
30618
|
if (ownerId !== this.userManager.selfId && !this.hasDeleteOthersPermission) {
|
|
30612
30619
|
return;
|
|
30613
30620
|
}
|
|
30621
|
+
if (!this.requestUserMap(this.userManager.selfId).has("trashedElements")) {
|
|
30622
|
+
return;
|
|
30623
|
+
}
|
|
30614
30624
|
const ids = this.requestUserMap(this.userManager.selfId).get("trashedElements");
|
|
30615
30625
|
for (const userId of this.userManager.userIdList()) {
|
|
30616
30626
|
if (userId !== this.userManager.selfId) {
|
|
30627
|
+
const userMap = this.requestUserMap(userId);
|
|
30628
|
+
if (!userMap.has("trashedElements") || !userMap.has(WhiteboardKeys.selectElements)) {
|
|
30629
|
+
continue;
|
|
30630
|
+
}
|
|
30617
30631
|
const trashedIds = this.requestUserMap(userId).get("trashedElements");
|
|
30618
30632
|
const selectedIds = this.requestUserMap(userId).get(WhiteboardKeys.selectElements);
|
|
30619
30633
|
if (selectedIds.has(elementId) || trashedIds.has(elementId)) {
|