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