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.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MindCache, h as CloudConfig, C as CloudAdapter } from '../CloudAdapter-
|
|
2
|
-
export { m as ClearOperation, j as CloudAdapterEvents, i as ConnectionState, l as DeleteOperation, O as Operation, k as SetOperation } from '../CloudAdapter-
|
|
1
|
+
import { M as MindCache, h as CloudConfig, C as CloudAdapter } from '../CloudAdapter-BgpqZE00.mjs';
|
|
2
|
+
export { m as ClearOperation, j as CloudAdapterEvents, i as ConnectionState, l as DeleteOperation, O as Operation, k as SetOperation } from '../CloudAdapter-BgpqZE00.mjs';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MindCache, h as CloudConfig, C as CloudAdapter } from '../CloudAdapter-
|
|
2
|
-
export { m as ClearOperation, j as CloudAdapterEvents, i as ConnectionState, l as DeleteOperation, O as Operation, k as SetOperation } from '../CloudAdapter-
|
|
1
|
+
import { M as MindCache, h as CloudConfig, C as CloudAdapter } from '../CloudAdapter-BgpqZE00.js';
|
|
2
|
+
export { m as ClearOperation, j as CloudAdapterEvents, i as ConnectionState, l as DeleteOperation, O as Operation, k as SetOperation } from '../CloudAdapter-BgpqZE00.js';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/cloud/index.js
CHANGED
|
@@ -428,7 +428,7 @@ var MindCache = class {
|
|
|
428
428
|
listeners = {};
|
|
429
429
|
globalListeners = [];
|
|
430
430
|
// Metadata
|
|
431
|
-
version = "3.1
|
|
431
|
+
version = "3.3.1";
|
|
432
432
|
// Internal flag to prevent sync loops when receiving remote updates
|
|
433
433
|
// (Less critical with Yjs but kept for API compat)
|
|
434
434
|
_isRemoteUpdate = false;
|
|
@@ -488,8 +488,22 @@ var MindCache = class {
|
|
|
488
488
|
constructor(options) {
|
|
489
489
|
this.doc = new Y__namespace.Doc();
|
|
490
490
|
this.rootMap = this.doc.getMap("mindcache");
|
|
491
|
-
this.rootMap.
|
|
492
|
-
|
|
491
|
+
this.rootMap.observeDeep((events) => {
|
|
492
|
+
const keysAffected = /* @__PURE__ */ new Set();
|
|
493
|
+
events.forEach((event) => {
|
|
494
|
+
if (event.target === this.rootMap) {
|
|
495
|
+
const mapEvent = event;
|
|
496
|
+
mapEvent.keysChanged.forEach((key) => keysAffected.add(key));
|
|
497
|
+
} else if (event.target.parent === this.rootMap) {
|
|
498
|
+
for (const [key, val] of this.rootMap) {
|
|
499
|
+
if (val === event.target) {
|
|
500
|
+
keysAffected.add(key);
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
keysAffected.forEach((key) => {
|
|
493
507
|
const entryMap = this.rootMap.get(key);
|
|
494
508
|
if (entryMap) {
|
|
495
509
|
const value = entryMap.get("value");
|
|
@@ -502,8 +516,6 @@ var MindCache = class {
|
|
|
502
516
|
}
|
|
503
517
|
}
|
|
504
518
|
});
|
|
505
|
-
});
|
|
506
|
-
this.rootMap.observeDeep((_events) => {
|
|
507
519
|
this.notifyGlobalListeners();
|
|
508
520
|
});
|
|
509
521
|
this.initGlobalUndoManager();
|