jotai-state-tree 1.7.3 → 1.7.5

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.
@@ -1821,9 +1821,6 @@ var ModelType = class _ModelType {
1821
1821
  }
1822
1822
  return descriptor.value;
1823
1823
  }
1824
- if (propStr === "toggle") {
1825
- console.log("PROXY GET toggle:", propStr, "in allActions:", propStr in allActions, "keys:", Object.keys(allActions), "node alive:", node.$isAlive);
1826
- }
1827
1824
  if (propStr in allActions) {
1828
1825
  return allActions[propStr];
1829
1826
  }
@@ -3800,7 +3797,7 @@ var RouterModel = model("RouterModel", {
3800
3797
  if (res === false) {
3801
3798
  revert();
3802
3799
  } else if (typeof res === "string") {
3803
- self.push(res);
3800
+ self.replace(res);
3804
3801
  } else {
3805
3802
  proceed();
3806
3803
  }
@@ -3811,7 +3808,7 @@ var RouterModel = model("RouterModel", {
3811
3808
  if (result === false) {
3812
3809
  revert();
3813
3810
  } else if (typeof result === "string") {
3814
- self.push(result);
3811
+ self.replace(result);
3815
3812
  } else {
3816
3813
  proceed();
3817
3814
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as ILiteralType, a as IEnumerationType, b as IFrozenType, c as IType, d as ISimpleType, e as IIdentifierType, f as IIdentifierNumberType, M as ModelProperties, g as IModelType, h as MixinConfig, i as IMixin, j as IAnyType, k as IArrayType, l as IMapType, m as IOptionalType, n as IMaybeType, o as IMaybeNullType, p as IUnionType, U as UnionOptions, q as ILateType, r as IAnyModelType, R as ReferenceOptions, s as IReferenceType, t as ISafeReferenceType, u as IRefinementType, v as IDisposer, S as SnapshotIn, w as Instance } from './router-DzUdXVV7.mjs';
2
- export { L as CustomTypeOptions, aG as IActionRecorder, aH as IActionRecording, C as IAnyComplexType, D as IAnyMixin, aE as IHistoryEntry, F as IJsonPatch, y as IMSTArray, z as IMSTMap, G as IReversibleJsonPatch, x as IStateTreeNode, aF as ITimeTravelManager, aC as IUndoManager, aD as IUndoManagerOptions, H as IValidationContext, K as IValidationError, J as IValidationResult, A as ModelInstance, E as ModelSelf, aJ as RouteDefinition, aI as RouterModel, B as SnapshotOut, T as applyPatch, O as applySnapshot, aw as cleanupStaleEntries, ax as clearAllRegistries, aa as clone, aq as cloneDeep, aB as createActionRecorder, aK as createRouter, aA as createTimeTravelManager, az as createUndoManager, a8 as destroy, a9 as detach, am as findAll, an as findFirst, as as freeze, a2 as getEnv, ag as getGlobalStore, a4 as getIdentifier, af as getMembers, ar as getOrCreatePath, Y as getParent, $ as getParentOfType, a0 as getPath, a1 as getPathParts, av as getRegistryStats, aj as getRelativePath, X as getRoot, N as getSnapshot, ap as getTreeStats, a3 as getType, _ as hasParent, al as haveSameRoot, a5 as isAlive, ak as isAncestor, at as isFrozen, a6 as isRoot, a7 as isStateTreeNode, ao as isValidReference, W as onAction, ay as onLifecycleChange, Q as onPatch, P as onSnapshot, V as recordPatches, ai as resetGlobalStore, ae as resolveIdentifier, ac as resolvePath, ah as setGlobalStore, Z as tryGetParent, ad as tryResolve, au as unfreeze, ab as walk } from './router-DzUdXVV7.mjs';
1
+ import { I as IType, a as ISimpleType, b as ILiteralType, c as IEnumerationType, d as IFrozenType, e as IIdentifierType, f as IIdentifierNumberType, M as ModelProperties, g as IModelType, h as MixinConfig, i as IMixin, j as IAnyType, k as IArrayType, l as IMapType, m as IOptionalType, n as IMaybeType, o as IMaybeNullType, p as IUnionType, U as UnionOptions, q as ILateType, r as IAnyModelType, R as ReferenceOptions, s as IReferenceType, t as ISafeReferenceType, u as IRefinementType, v as IDisposer, S as SnapshotIn, w as Instance } from './router-DwXAzNVB.mjs';
2
+ export { C as CustomTypeOptions, x as IActionRecorder, y as IActionRecording, z as IAnyComplexType, A as IAnyMixin, B as IHistoryEntry, D as IJsonPatch, E as IMSTArray, F as IMSTMap, G as IReversibleJsonPatch, H as IStateTreeNode, J as ITimeTravelManager, K as IUndoManager, L as IUndoManagerOptions, N as IValidationContext, O as IValidationError, P as IValidationResult, Q as ModelInstance, T as ModelSelf, V as RouteDefinition, W as RouterModel, X as SnapshotOut, Y as applyPatch, Z as applySnapshot, _ as cleanupStaleEntries, $ as clearAllRegistries, a0 as clone, a1 as cloneDeep, a2 as createActionRecorder, a3 as createRouter, a4 as createTimeTravelManager, a5 as createUndoManager, a6 as destroy, a7 as detach, a8 as findAll, a9 as findFirst, aa as freeze, ab as getEnv, ac as getGlobalStore, ad as getIdentifier, ae as getMembers, af as getOrCreatePath, ag as getParent, ah as getParentOfType, ai as getPath, aj as getPathParts, ak as getRegistryStats, al as getRelativePath, am as getRoot, an as getSnapshot, ao as getTreeStats, ap as getType, aq as hasParent, ar as haveSameRoot, as as isAlive, at as isAncestor, au as isFrozen, av as isRoot, aw as isStateTreeNode, ax as isValidReference, ay as onAction, az as onLifecycleChange, aA as onPatch, aB as onSnapshot, aC as recordPatches, aD as resetGlobalStore, aE as resolveIdentifier, aF as resolvePath, aG as setGlobalStore, aH as tryGetParent, aI as tryResolve, aJ as unfreeze, aK as walk } from './router-DwXAzNVB.mjs';
3
3
  import 'jotai/vanilla/internals';
4
4
  import 'jotai';
5
5
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as ILiteralType, a as IEnumerationType, b as IFrozenType, c as IType, d as ISimpleType, e as IIdentifierType, f as IIdentifierNumberType, M as ModelProperties, g as IModelType, h as MixinConfig, i as IMixin, j as IAnyType, k as IArrayType, l as IMapType, m as IOptionalType, n as IMaybeType, o as IMaybeNullType, p as IUnionType, U as UnionOptions, q as ILateType, r as IAnyModelType, R as ReferenceOptions, s as IReferenceType, t as ISafeReferenceType, u as IRefinementType, v as IDisposer, S as SnapshotIn, w as Instance } from './router-DzUdXVV7.js';
2
- export { L as CustomTypeOptions, aG as IActionRecorder, aH as IActionRecording, C as IAnyComplexType, D as IAnyMixin, aE as IHistoryEntry, F as IJsonPatch, y as IMSTArray, z as IMSTMap, G as IReversibleJsonPatch, x as IStateTreeNode, aF as ITimeTravelManager, aC as IUndoManager, aD as IUndoManagerOptions, H as IValidationContext, K as IValidationError, J as IValidationResult, A as ModelInstance, E as ModelSelf, aJ as RouteDefinition, aI as RouterModel, B as SnapshotOut, T as applyPatch, O as applySnapshot, aw as cleanupStaleEntries, ax as clearAllRegistries, aa as clone, aq as cloneDeep, aB as createActionRecorder, aK as createRouter, aA as createTimeTravelManager, az as createUndoManager, a8 as destroy, a9 as detach, am as findAll, an as findFirst, as as freeze, a2 as getEnv, ag as getGlobalStore, a4 as getIdentifier, af as getMembers, ar as getOrCreatePath, Y as getParent, $ as getParentOfType, a0 as getPath, a1 as getPathParts, av as getRegistryStats, aj as getRelativePath, X as getRoot, N as getSnapshot, ap as getTreeStats, a3 as getType, _ as hasParent, al as haveSameRoot, a5 as isAlive, ak as isAncestor, at as isFrozen, a6 as isRoot, a7 as isStateTreeNode, ao as isValidReference, W as onAction, ay as onLifecycleChange, Q as onPatch, P as onSnapshot, V as recordPatches, ai as resetGlobalStore, ae as resolveIdentifier, ac as resolvePath, ah as setGlobalStore, Z as tryGetParent, ad as tryResolve, au as unfreeze, ab as walk } from './router-DzUdXVV7.js';
1
+ import { I as IType, a as ISimpleType, b as ILiteralType, c as IEnumerationType, d as IFrozenType, e as IIdentifierType, f as IIdentifierNumberType, M as ModelProperties, g as IModelType, h as MixinConfig, i as IMixin, j as IAnyType, k as IArrayType, l as IMapType, m as IOptionalType, n as IMaybeType, o as IMaybeNullType, p as IUnionType, U as UnionOptions, q as ILateType, r as IAnyModelType, R as ReferenceOptions, s as IReferenceType, t as ISafeReferenceType, u as IRefinementType, v as IDisposer, S as SnapshotIn, w as Instance } from './router-DwXAzNVB.js';
2
+ export { C as CustomTypeOptions, x as IActionRecorder, y as IActionRecording, z as IAnyComplexType, A as IAnyMixin, B as IHistoryEntry, D as IJsonPatch, E as IMSTArray, F as IMSTMap, G as IReversibleJsonPatch, H as IStateTreeNode, J as ITimeTravelManager, K as IUndoManager, L as IUndoManagerOptions, N as IValidationContext, O as IValidationError, P as IValidationResult, Q as ModelInstance, T as ModelSelf, V as RouteDefinition, W as RouterModel, X as SnapshotOut, Y as applyPatch, Z as applySnapshot, _ as cleanupStaleEntries, $ as clearAllRegistries, a0 as clone, a1 as cloneDeep, a2 as createActionRecorder, a3 as createRouter, a4 as createTimeTravelManager, a5 as createUndoManager, a6 as destroy, a7 as detach, a8 as findAll, a9 as findFirst, aa as freeze, ab as getEnv, ac as getGlobalStore, ad as getIdentifier, ae as getMembers, af as getOrCreatePath, ag as getParent, ah as getParentOfType, ai as getPath, aj as getPathParts, ak as getRegistryStats, al as getRelativePath, am as getRoot, an as getSnapshot, ao as getTreeStats, ap as getType, aq as hasParent, ar as haveSameRoot, as as isAlive, at as isAncestor, au as isFrozen, av as isRoot, aw as isStateTreeNode, ax as isValidReference, ay as onAction, az as onLifecycleChange, aA as onPatch, aB as onSnapshot, aC as recordPatches, aD as resetGlobalStore, aE as resolveIdentifier, aF as resolvePath, aG as setGlobalStore, aH as tryGetParent, aI as tryResolve, aJ as unfreeze, aK as walk } from './router-DwXAzNVB.js';
3
3
  import 'jotai/vanilla/internals';
4
4
  import 'jotai';
5
5
  import 'react';
package/dist/index.js CHANGED
@@ -1982,9 +1982,6 @@ var ModelType = class _ModelType {
1982
1982
  }
1983
1983
  return descriptor.value;
1984
1984
  }
1985
- if (propStr === "toggle") {
1986
- console.log("PROXY GET toggle:", propStr, "in allActions:", propStr in allActions, "keys:", Object.keys(allActions), "node alive:", node.$isAlive);
1987
- }
1988
1985
  if (propStr in allActions) {
1989
1986
  return allActions[propStr];
1990
1987
  }
@@ -4622,7 +4619,7 @@ var RouterModel = model("RouterModel", {
4622
4619
  if (res === false) {
4623
4620
  revert();
4624
4621
  } else if (typeof res === "string") {
4625
- self.push(res);
4622
+ self.replace(res);
4626
4623
  } else {
4627
4624
  proceed();
4628
4625
  }
@@ -4633,7 +4630,7 @@ var RouterModel = model("RouterModel", {
4633
4630
  if (result === false) {
4634
4631
  revert();
4635
4632
  } else if (typeof result === "string") {
4636
- self.push(result);
4633
+ self.replace(result);
4637
4634
  } else {
4638
4635
  proceed();
4639
4636
  }
package/dist/index.mjs CHANGED
@@ -96,7 +96,7 @@ import {
96
96
  union,
97
97
  unprotect,
98
98
  walk
99
- } from "./chunk-HHDXRF6H.mjs";
99
+ } from "./chunk-I2ZPT6O4.mjs";
100
100
 
101
101
  // src/map.ts
102
102
  var MSTMap = class extends Map {
package/dist/react.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import React, { ComponentType, FC, ReactNode } from 'react';
2
- import { ag as getGlobalStore, aD as IUndoManagerOptions, aC as IUndoManager, aF as ITimeTravelManager } from './router-DzUdXVV7.mjs';
3
- export { aM as RouterContext, aL as hasStateTreeNode, aN as useRouter } from './router-DzUdXVV7.mjs';
1
+ import React, { FC, ReactNode, ComponentType } from 'react';
2
+ import { ac as getGlobalStore, J as ITimeTravelManager, L as IUndoManagerOptions, K as IUndoManager } from './router-DwXAzNVB.mjs';
3
+ export { aL as RouterContext, aM as hasStateTreeNode, aN as useRouter } from './router-DwXAzNVB.mjs';
4
4
  import 'jotai/vanilla/internals';
5
5
  import 'jotai';
6
6
 
package/dist/react.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import React, { ComponentType, FC, ReactNode } from 'react';
2
- import { ag as getGlobalStore, aD as IUndoManagerOptions, aC as IUndoManager, aF as ITimeTravelManager } from './router-DzUdXVV7.js';
3
- export { aM as RouterContext, aL as hasStateTreeNode, aN as useRouter } from './router-DzUdXVV7.js';
1
+ import React, { FC, ReactNode, ComponentType } from 'react';
2
+ import { ac as getGlobalStore, J as ITimeTravelManager, L as IUndoManagerOptions, K as IUndoManager } from './router-DwXAzNVB.js';
3
+ export { aL as RouterContext, aM as hasStateTreeNode, aN as useRouter } from './router-DwXAzNVB.js';
4
4
  import 'jotai/vanilla/internals';
5
5
  import 'jotai';
6
6
 
package/dist/react.js CHANGED
@@ -1595,9 +1595,6 @@ var ModelType = class _ModelType {
1595
1595
  }
1596
1596
  return descriptor.value;
1597
1597
  }
1598
- if (propStr === "toggle") {
1599
- console.log("PROXY GET toggle:", propStr, "in allActions:", propStr in allActions, "keys:", Object.keys(allActions), "node alive:", node.$isAlive);
1600
- }
1601
1598
  if (propStr in allActions) {
1602
1599
  return allActions[propStr];
1603
1600
  }
@@ -2751,7 +2748,7 @@ var RouterModel = model("RouterModel", {
2751
2748
  if (res === false) {
2752
2749
  revert();
2753
2750
  } else if (typeof res === "string") {
2754
- self.push(res);
2751
+ self.replace(res);
2755
2752
  } else {
2756
2753
  proceed();
2757
2754
  }
@@ -2762,7 +2759,7 @@ var RouterModel = model("RouterModel", {
2762
2759
  if (result === false) {
2763
2760
  revert();
2764
2761
  } else if (typeof result === "string") {
2765
- self.push(result);
2762
+ self.replace(result);
2766
2763
  } else {
2767
2764
  proceed();
2768
2765
  }
package/dist/react.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  setActiveTrackingFn,
13
13
  setIsApplyingSnapshotOrPatch,
14
14
  useRouter
15
- } from "./chunk-HHDXRF6H.mjs";
15
+ } from "./chunk-I2ZPT6O4.mjs";
16
16
 
17
17
  // src/react.ts
18
18
  import React, {
@@ -725,4 +725,4 @@ declare function createRouter(config: {
725
725
  declare const RouterContext: React.Context<any>;
726
726
  declare function useRouter(): any;
727
727
 
728
- export { getParentOfType as $, type ModelInstance as A, type SnapshotOut as B, type IAnyComplexType as C, type IAnyMixin as D, type ModelSelf as E, type IJsonPatch as F, type IReversibleJsonPatch as G, type IValidationContext as H, type ILiteralType as I, type IValidationResult as J, type IValidationError as K, type CustomTypeOptions as L, type ModelProperties as M, getSnapshot as N, applySnapshot as O, onSnapshot as P, onPatch as Q, type ReferenceOptions as R, type SnapshotIn as S, applyPatch as T, type UnionOptions as U, recordPatches as V, onAction as W, getRoot as X, getParent as Y, tryGetParent as Z, hasParent as _, type IEnumerationType as a, getPath as a0, getPathParts as a1, getEnv as a2, getType as a3, getIdentifier as a4, isAlive as a5, isRoot as a6, isStateTreeNode as a7, destroy as a8, detach as a9, createTimeTravelManager as aA, createActionRecorder as aB, type IUndoManager as aC, type IUndoManagerOptions as aD, type IHistoryEntry as aE, type ITimeTravelManager as aF, type IActionRecorder as aG, type IActionRecording as aH, RouterModel as aI, RouteDefinition as aJ, createRouter as aK, hasStateTreeNode as aL, RouterContext as aM, useRouter as aN, clone as aa, walk as ab, resolvePath as ac, tryResolve as ad, resolveIdentifier as ae, getMembers as af, getGlobalStore as ag, setGlobalStore as ah, resetGlobalStore as ai, getRelativePath as aj, isAncestor as ak, haveSameRoot as al, findAll as am, findFirst as an, isValidReference as ao, getTreeStats as ap, cloneDeep as aq, getOrCreatePath as ar, freeze as as, isFrozen as at, unfreeze as au, getRegistryStats as av, cleanupStaleEntries as aw, clearAllRegistries as ax, onLifecycleChange as ay, createUndoManager as az, type IFrozenType as b, type IType as c, type ISimpleType as d, type IIdentifierType as e, type IIdentifierNumberType as f, type IModelType as g, type MixinConfig as h, type IMixin as i, type IAnyType as j, type IArrayType as k, type IMapType as l, type IOptionalType as m, type IMaybeType as n, type IMaybeNullType as o, type IUnionType as p, type ILateType as q, type IAnyModelType as r, type IReferenceType as s, type ISafeReferenceType as t, type IRefinementType as u, type IDisposer as v, type Instance as w, type IStateTreeNode as x, type IMSTArray as y, type IMSTMap as z };
728
+ export { clearAllRegistries as $, type IAnyMixin as A, type IHistoryEntry as B, type CustomTypeOptions as C, type IJsonPatch as D, type IMSTArray as E, type IMSTMap as F, type IReversibleJsonPatch as G, type IStateTreeNode as H, type IType as I, type ITimeTravelManager as J, type IUndoManager as K, type IUndoManagerOptions as L, type ModelProperties as M, type IValidationContext as N, type IValidationError as O, type IValidationResult as P, type ModelInstance as Q, type ReferenceOptions as R, type SnapshotIn as S, type ModelSelf as T, type UnionOptions as U, RouteDefinition as V, RouterModel as W, type SnapshotOut as X, applyPatch as Y, applySnapshot as Z, cleanupStaleEntries as _, type ISimpleType as a, clone as a0, cloneDeep as a1, createActionRecorder as a2, createRouter as a3, createTimeTravelManager as a4, createUndoManager as a5, destroy as a6, detach as a7, findAll as a8, findFirst as a9, onPatch as aA, onSnapshot as aB, recordPatches as aC, resetGlobalStore as aD, resolveIdentifier as aE, resolvePath as aF, setGlobalStore as aG, tryGetParent as aH, tryResolve as aI, unfreeze as aJ, walk as aK, RouterContext as aL, hasStateTreeNode as aM, useRouter as aN, freeze as aa, getEnv as ab, getGlobalStore as ac, getIdentifier as ad, getMembers as ae, getOrCreatePath as af, getParent as ag, getParentOfType as ah, getPath as ai, getPathParts as aj, getRegistryStats as ak, getRelativePath as al, getRoot as am, getSnapshot as an, getTreeStats as ao, getType as ap, hasParent as aq, haveSameRoot as ar, isAlive as as, isAncestor as at, isFrozen as au, isRoot as av, isStateTreeNode as aw, isValidReference as ax, onAction as ay, onLifecycleChange as az, type ILiteralType as b, type IEnumerationType as c, type IFrozenType as d, type IIdentifierType as e, type IIdentifierNumberType as f, type IModelType as g, type MixinConfig as h, type IMixin as i, type IAnyType as j, type IArrayType as k, type IMapType as l, type IOptionalType as m, type IMaybeType as n, type IMaybeNullType as o, type IUnionType as p, type ILateType as q, type IAnyModelType as r, type IReferenceType as s, type ISafeReferenceType as t, type IRefinementType as u, type IDisposer as v, type Instance as w, type IActionRecorder as x, type IActionRecording as y, type IAnyComplexType as z };
@@ -725,4 +725,4 @@ declare function createRouter(config: {
725
725
  declare const RouterContext: React.Context<any>;
726
726
  declare function useRouter(): any;
727
727
 
728
- export { getParentOfType as $, type ModelInstance as A, type SnapshotOut as B, type IAnyComplexType as C, type IAnyMixin as D, type ModelSelf as E, type IJsonPatch as F, type IReversibleJsonPatch as G, type IValidationContext as H, type ILiteralType as I, type IValidationResult as J, type IValidationError as K, type CustomTypeOptions as L, type ModelProperties as M, getSnapshot as N, applySnapshot as O, onSnapshot as P, onPatch as Q, type ReferenceOptions as R, type SnapshotIn as S, applyPatch as T, type UnionOptions as U, recordPatches as V, onAction as W, getRoot as X, getParent as Y, tryGetParent as Z, hasParent as _, type IEnumerationType as a, getPath as a0, getPathParts as a1, getEnv as a2, getType as a3, getIdentifier as a4, isAlive as a5, isRoot as a6, isStateTreeNode as a7, destroy as a8, detach as a9, createTimeTravelManager as aA, createActionRecorder as aB, type IUndoManager as aC, type IUndoManagerOptions as aD, type IHistoryEntry as aE, type ITimeTravelManager as aF, type IActionRecorder as aG, type IActionRecording as aH, RouterModel as aI, RouteDefinition as aJ, createRouter as aK, hasStateTreeNode as aL, RouterContext as aM, useRouter as aN, clone as aa, walk as ab, resolvePath as ac, tryResolve as ad, resolveIdentifier as ae, getMembers as af, getGlobalStore as ag, setGlobalStore as ah, resetGlobalStore as ai, getRelativePath as aj, isAncestor as ak, haveSameRoot as al, findAll as am, findFirst as an, isValidReference as ao, getTreeStats as ap, cloneDeep as aq, getOrCreatePath as ar, freeze as as, isFrozen as at, unfreeze as au, getRegistryStats as av, cleanupStaleEntries as aw, clearAllRegistries as ax, onLifecycleChange as ay, createUndoManager as az, type IFrozenType as b, type IType as c, type ISimpleType as d, type IIdentifierType as e, type IIdentifierNumberType as f, type IModelType as g, type MixinConfig as h, type IMixin as i, type IAnyType as j, type IArrayType as k, type IMapType as l, type IOptionalType as m, type IMaybeType as n, type IMaybeNullType as o, type IUnionType as p, type ILateType as q, type IAnyModelType as r, type IReferenceType as s, type ISafeReferenceType as t, type IRefinementType as u, type IDisposer as v, type Instance as w, type IStateTreeNode as x, type IMSTArray as y, type IMSTMap as z };
728
+ export { clearAllRegistries as $, type IAnyMixin as A, type IHistoryEntry as B, type CustomTypeOptions as C, type IJsonPatch as D, type IMSTArray as E, type IMSTMap as F, type IReversibleJsonPatch as G, type IStateTreeNode as H, type IType as I, type ITimeTravelManager as J, type IUndoManager as K, type IUndoManagerOptions as L, type ModelProperties as M, type IValidationContext as N, type IValidationError as O, type IValidationResult as P, type ModelInstance as Q, type ReferenceOptions as R, type SnapshotIn as S, type ModelSelf as T, type UnionOptions as U, RouteDefinition as V, RouterModel as W, type SnapshotOut as X, applyPatch as Y, applySnapshot as Z, cleanupStaleEntries as _, type ISimpleType as a, clone as a0, cloneDeep as a1, createActionRecorder as a2, createRouter as a3, createTimeTravelManager as a4, createUndoManager as a5, destroy as a6, detach as a7, findAll as a8, findFirst as a9, onPatch as aA, onSnapshot as aB, recordPatches as aC, resetGlobalStore as aD, resolveIdentifier as aE, resolvePath as aF, setGlobalStore as aG, tryGetParent as aH, tryResolve as aI, unfreeze as aJ, walk as aK, RouterContext as aL, hasStateTreeNode as aM, useRouter as aN, freeze as aa, getEnv as ab, getGlobalStore as ac, getIdentifier as ad, getMembers as ae, getOrCreatePath as af, getParent as ag, getParentOfType as ah, getPath as ai, getPathParts as aj, getRegistryStats as ak, getRelativePath as al, getRoot as am, getSnapshot as an, getTreeStats as ao, getType as ap, hasParent as aq, haveSameRoot as ar, isAlive as as, isAncestor as at, isFrozen as au, isRoot as av, isStateTreeNode as aw, isValidReference as ax, onAction as ay, onLifecycleChange as az, type ILiteralType as b, type IEnumerationType as c, type IFrozenType as d, type IIdentifierType as e, type IIdentifierNumberType as f, type IModelType as g, type MixinConfig as h, type IMixin as i, type IAnyType as j, type IArrayType as k, type IMapType as l, type IOptionalType as m, type IMaybeType as n, type IMaybeNullType as o, type IUnionType as p, type ILateType as q, type IAnyModelType as r, type IReferenceType as s, type ISafeReferenceType as t, type IRefinementType as u, type IDisposer as v, type Instance as w, type IActionRecorder as x, type IActionRecording as y, type IAnyComplexType as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jotai-state-tree",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "MobX-State-Tree API compatible library powered by Jotai",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -77,7 +77,7 @@
77
77
  "semantic-release": "^25.0.2",
78
78
  "tsup": "^8.0.0",
79
79
  "typedoc": "^0.28.15",
80
- "typescript": "^5.3.0",
80
+ "typescript": "^6.0.3",
81
81
  "vitest": "^4.0.16"
82
82
  },
83
83
  "repository": {
@@ -421,6 +421,8 @@ describe('State Router', () => {
421
421
  popStateCallback(new PopStateEvent('popstate', { state: null }));
422
422
  });
423
423
  expect(router.pathname).toBe('/users/redirected');
424
+ expect(window.history.replaceState).toHaveBeenCalledWith(undefined, '', '/users/redirected');
425
+ expect(window.history.pushState).not.toHaveBeenCalled();
424
426
 
425
427
  // 2. PopState promise rejection (should revert URL)
426
428
  vi.stubGlobal('location', { pathname: '/files/error', search: '', hash: '' });
@@ -533,6 +535,8 @@ describe('State Router', () => {
533
535
  popStateCallback(new PopStateEvent('popstate', { state: null }));
534
536
  });
535
537
  expect(r4.pathname).toBe('/users/redirected');
538
+ expect(window.history.replaceState).toHaveBeenCalledWith(undefined, '', '/users/redirected');
539
+ expect(window.history.pushState).not.toHaveBeenCalled();
536
540
 
537
541
  // 5. popstate with async beforeNavigate resolving to false
538
542
  const r5 = createRouter({
package/src/model.ts CHANGED
@@ -359,9 +359,6 @@ class ModelType<
359
359
  }
360
360
 
361
361
  // Check actions
362
- if (propStr === "toggle") {
363
- console.log("PROXY GET toggle:", propStr, "in allActions:", propStr in allActions, "keys:", Object.keys(allActions), "node alive:", node.$isAlive);
364
- }
365
362
  if (propStr in allActions) {
366
363
  return allActions[propStr];
367
364
  }
package/src/router.ts CHANGED
@@ -349,7 +349,7 @@ export const RouterModel = model("RouterModel", {
349
349
  if (res === false) {
350
350
  revert();
351
351
  } else if (typeof res === "string") {
352
- self.push(res);
352
+ self.replace(res);
353
353
  } else {
354
354
  proceed();
355
355
  }
@@ -360,7 +360,7 @@ export const RouterModel = model("RouterModel", {
360
360
  if (result === false) {
361
361
  revert();
362
362
  } else if (typeof result === "string") {
363
- self.push(result);
363
+ self.replace(result);
364
364
  } else {
365
365
  proceed();
366
366
  }