jotai-state-tree 1.7.4 → 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.
@@ -3797,7 +3797,7 @@ var RouterModel = model("RouterModel", {
3797
3797
  if (res === false) {
3798
3798
  revert();
3799
3799
  } else if (typeof res === "string") {
3800
- self.push(res);
3800
+ self.replace(res);
3801
3801
  } else {
3802
3802
  proceed();
3803
3803
  }
@@ -3808,7 +3808,7 @@ var RouterModel = model("RouterModel", {
3808
3808
  if (result === false) {
3809
3809
  revert();
3810
3810
  } else if (typeof result === "string") {
3811
- self.push(result);
3811
+ self.replace(result);
3812
3812
  } else {
3813
3813
  proceed();
3814
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
@@ -4619,7 +4619,7 @@ var RouterModel = model("RouterModel", {
4619
4619
  if (res === false) {
4620
4620
  revert();
4621
4621
  } else if (typeof res === "string") {
4622
- self.push(res);
4622
+ self.replace(res);
4623
4623
  } else {
4624
4624
  proceed();
4625
4625
  }
@@ -4630,7 +4630,7 @@ var RouterModel = model("RouterModel", {
4630
4630
  if (result === false) {
4631
4631
  revert();
4632
4632
  } else if (typeof result === "string") {
4633
- self.push(result);
4633
+ self.replace(result);
4634
4634
  } else {
4635
4635
  proceed();
4636
4636
  }
package/dist/index.mjs CHANGED
@@ -96,7 +96,7 @@ import {
96
96
  union,
97
97
  unprotect,
98
98
  walk
99
- } from "./chunk-WEWWBVTQ.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
@@ -2748,7 +2748,7 @@ var RouterModel = model("RouterModel", {
2748
2748
  if (res === false) {
2749
2749
  revert();
2750
2750
  } else if (typeof res === "string") {
2751
- self.push(res);
2751
+ self.replace(res);
2752
2752
  } else {
2753
2753
  proceed();
2754
2754
  }
@@ -2759,7 +2759,7 @@ var RouterModel = model("RouterModel", {
2759
2759
  if (result === false) {
2760
2760
  revert();
2761
2761
  } else if (typeof result === "string") {
2762
- self.push(result);
2762
+ self.replace(result);
2763
2763
  } else {
2764
2764
  proceed();
2765
2765
  }
package/dist/react.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  setActiveTrackingFn,
13
13
  setIsApplyingSnapshotOrPatch,
14
14
  useRouter
15
- } from "./chunk-WEWWBVTQ.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.4",
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/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
  }