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.
@@ -142,7 +142,7 @@ declare class MindCache {
142
142
  private rootMap;
143
143
  private listeners;
144
144
  private globalListeners;
145
- readonly version = "3.1.0";
145
+ readonly version = "3.3.1";
146
146
  private _isRemoteUpdate;
147
147
  private normalizeSystemTags;
148
148
  private _cloudAdapter;
@@ -142,7 +142,7 @@ declare class MindCache {
142
142
  private rootMap;
143
143
  private listeners;
144
144
  private globalListeners;
145
- readonly version = "3.1.0";
145
+ readonly version = "3.3.1";
146
146
  private _isRemoteUpdate;
147
147
  private normalizeSystemTags;
148
148
  private _cloudAdapter;
@@ -1,5 +1,5 @@
1
- import { M as MindCache, h as CloudConfig, C as CloudAdapter } from '../CloudAdapter-CSncOr3V.mjs';
2
- export { m as ClearOperation, j as CloudAdapterEvents, i as ConnectionState, l as DeleteOperation, O as Operation, k as SetOperation } from '../CloudAdapter-CSncOr3V.mjs';
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
  /**
@@ -1,5 +1,5 @@
1
- import { M as MindCache, h as CloudConfig, C as CloudAdapter } from '../CloudAdapter-CSncOr3V.js';
2
- export { m as ClearOperation, j as CloudAdapterEvents, i as ConnectionState, l as DeleteOperation, O as Operation, k as SetOperation } from '../CloudAdapter-CSncOr3V.js';
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
  /**
@@ -428,7 +428,7 @@ var MindCache = class {
428
428
  listeners = {};
429
429
  globalListeners = [];
430
430
  // Metadata
431
- version = "3.1.0";
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.observe((event) => {
492
- event.keysChanged.forEach((key) => {
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();