mindcache 3.3.0 → 3.3.1
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/{CloudAdapter-CSncOr3V.d.mts → CloudAdapter-BgpqZE00.d.mts} +1 -1
- package/dist/{CloudAdapter-CSncOr3V.d.ts → CloudAdapter-BgpqZE00.d.ts} +1 -1
- package/dist/cloud/index.d.mts +2 -2
- package/dist/cloud/index.d.ts +2 -2
- package/dist/cloud/index.js +17 -5
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/index.mjs +17 -5
- package/dist/cloud/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cloud/index.mjs
CHANGED
|
@@ -400,7 +400,7 @@ var MindCache = class {
|
|
|
400
400
|
listeners = {};
|
|
401
401
|
globalListeners = [];
|
|
402
402
|
// Metadata
|
|
403
|
-
version = "3.1
|
|
403
|
+
version = "3.3.1";
|
|
404
404
|
// Internal flag to prevent sync loops when receiving remote updates
|
|
405
405
|
// (Less critical with Yjs but kept for API compat)
|
|
406
406
|
_isRemoteUpdate = false;
|
|
@@ -460,8 +460,22 @@ var MindCache = class {
|
|
|
460
460
|
constructor(options) {
|
|
461
461
|
this.doc = new Y.Doc();
|
|
462
462
|
this.rootMap = this.doc.getMap("mindcache");
|
|
463
|
-
this.rootMap.
|
|
464
|
-
|
|
463
|
+
this.rootMap.observeDeep((events) => {
|
|
464
|
+
const keysAffected = /* @__PURE__ */ new Set();
|
|
465
|
+
events.forEach((event) => {
|
|
466
|
+
if (event.target === this.rootMap) {
|
|
467
|
+
const mapEvent = event;
|
|
468
|
+
mapEvent.keysChanged.forEach((key) => keysAffected.add(key));
|
|
469
|
+
} else if (event.target.parent === this.rootMap) {
|
|
470
|
+
for (const [key, val] of this.rootMap) {
|
|
471
|
+
if (val === event.target) {
|
|
472
|
+
keysAffected.add(key);
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
keysAffected.forEach((key) => {
|
|
465
479
|
const entryMap = this.rootMap.get(key);
|
|
466
480
|
if (entryMap) {
|
|
467
481
|
const value = entryMap.get("value");
|
|
@@ -474,8 +488,6 @@ var MindCache = class {
|
|
|
474
488
|
}
|
|
475
489
|
}
|
|
476
490
|
});
|
|
477
|
-
});
|
|
478
|
-
this.rootMap.observeDeep((_events) => {
|
|
479
491
|
this.notifyGlobalListeners();
|
|
480
492
|
});
|
|
481
493
|
this.initGlobalUndoManager();
|