react-modal-navigation 1.2.0 → 1.3.0

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/style.css CHANGED
@@ -128,3 +128,6 @@
128
128
  @media(max-width:640px){.pmn-mobile-fullscreen .pmn-resize-handle{display:none}}
129
129
  .pmn-dialog{max-width:min(100%,var(--pmn-max-width,100%),var(--pmn-drag-width,var(--pmn-width)))}
130
130
  .pmn-overlay.pmn-fullscreen .pmn-dialog{max-width:100%}
131
+
132
+ .pmn-persistent-layout{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
133
+ .pmn-persistent-layout[hidden]{display:none!important}
package/docs/API.md CHANGED
@@ -1,4 +1,4 @@
1
- # API 参考手册(react-modal-navigation@1.0.0)
1
+ # API 参考手册(react-modal-navigation 1.3 系列)
2
2
 
3
3
  > 本文介绍组件库的公开接口、参数、返回值及使用约定。
4
4
 
@@ -643,3 +643,7 @@ type Navigation = TypedModalNavigation<Routes>;
643
643
  ## Single-page registry (v1.1.6)
644
644
 
645
645
  `{ component: AddDevice, title: 'Add device', modalOptions: { placement: 'center' } }` is supported as a registry item. A registry with exactly one `screens` entry is also rendered in lightweight single-page mode. Modal opening and closing APIs remain unchanged. No navigation history, reducer, KeepAlive cache or page transitions are initialized. Navigation-only commands are unavailable in this mode and return `false` (or `{status:'cancelled'}` for `navigateAsync`).
646
+
647
+ ## 嵌套路由
648
+
649
+ 参见 [嵌套路由指南](NESTED-ROUTES.md)。`useModalRouteGroup` 提供 `isFocused`、`isRetained`、`params`、`setParams` 和 `run`;`useModalGroupGuard` 的 `protectCache` 默认开启。
@@ -0,0 +1,136 @@
1
+ # Nested routes
2
+
3
+ Define groups with `screens` and optional React `layout` components. Use slash-qualified names for navigation, initialRoute, explicit screen and preload. Groups without a component or loader are not navigable. A group with a component is also a screen. Layouts receive children, route and navigation; each stack entry owns its layout instances, so sibling routes do not share layout state. Keep shared state outside the route layers. Existing flat names remain valid; duplicate qualified names and cyclic definitions are rejected. Back follows visit history, not path ancestry. Group options are shallowly inherited by descendants. This feature does not create separate navigators or nested modals.
4
+
5
+ ```jsx
6
+ const registry = {
7
+ settings: {
8
+ initialRoute: 'device/general',
9
+ screens: {
10
+ device: {
11
+ layout: ({ children }) => <section>{children}</section>,
12
+ screens: {
13
+ general: { component: General },
14
+ battery: { component: Battery },
15
+ },
16
+ },
17
+ },
18
+ },
19
+ };
20
+ // In General: navigation.navigate('device/battery', { id: 1 });
21
+ ```
22
+
23
+ ## Default children and relative navigation (alpha.2)
24
+
25
+ A group can declare `initialRoute: 'battery'`. Opening or navigating to the group resolves to the canonical leaf path; no extra history entry is created. Defaults may chain through nested groups. A group with a component cannot also declare a default child. Group options are shallowly inherited; child options override parent options. Components and loaders are not inherited.
26
+
27
+ Relative navigation uses the current route's containing directory: from `settings/battery`, `./grid` resolves to `settings/grid`, and `../home` resolves to `home`. This applies to navigate, push, replace, reset, navigateAsync and popTo in the stack navigator. Opening and preload use absolute names or group aliases. Ordinary layouts remain per route instance; persistent layouts are opt-in.
28
+
29
+ ## Persistent layouts and outlets
30
+
31
+ Set `persistentLayout: true` on a route with a `layout` to share one layout instance among its mounted descendant screens. Render either `children` or `<ModalOutlet />` once, not both. The layout remains mounted while at least one descendant is mounted, including cached descendants. When the last descendant is removed or evicted, the layout unmounts. Layouts are scoped to a modal instance and group path. Persistent layouts must precede ordinary layouts in the ancestor chain.
32
+
33
+ ```jsx
34
+ import { ModalOutlet } from 'react-modal-navigation';
35
+ function SettingsLayout() {
36
+ return <section style={{ display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 }}>
37
+ <h2>Settings</h2>
38
+ <ModalOutlet />
39
+ </section>;
40
+ }
41
+ const settings = {
42
+ layout: SettingsLayout,
43
+ persistentLayout: true,
44
+ initialRoute: 'battery',
45
+ screens: { battery: { component: Battery }, grid: { component: Grid } },
46
+ };
47
+ ```
48
+
49
+ The layout receives the active descendant route (or the last mounted descendant when hidden). It does not own a separate navigation stack or screen-scoped guard, footer, task or loading lifecycle. Put screen-scoped hooks in leaf screens. Shared layouts may use route params and navigation commands. Page transition snapshots are disabled for persistent-layout destinations and outgoing persistent leaves; modal animations are unchanged. Ordinary layouts retain their existing behavior.
50
+
51
+ ## Route matches and group parameters
52
+
53
+ A group may declare `initialParams: { deviceId: 1001 }`. These initialize shallow-readonly group snapshots, updated via group.setParams. `useParentParams()` returns the immediate group's defaults (undefined for flat routes); `useParentRoute()` returns its name and params or null. `useModalMatches()` returns the declared groups from outermost to innermost followed by the mounted leaf route. In a layout these hooks describe the selected descendant, not an independent layout route. Leaf params remain unchanged; defaults are not merged into them. Group guards and logical focus/retention are available; independent Layout mounting is not provided.
54
+
55
+ ## Dynamic route groups (1.3.0-alpha.5)
56
+
57
+ `useModalRouteGroup(name)` returns null for unknown groups; otherwise it exposes `params`, `isFocused`, `setParams(patch)` and `run(task)`. Group state belongs to the modal runtime and survives blur while a descendant remains in history; resets when the last descendant is removed. Parameter patches are shallow; `useParentParams()` and `useModalMatches()` observe updates.
58
+
59
+ `useModalGroupGuard(name, guard)` registers a guard for the mounted consumer. Returning false vetoes leaving the active group, closing or replacing the modal. Sibling navigation does not invoke the group guard. Forced disposal bypasses guards. Guards are not retained after their consumer unmounts.
60
+
61
+ `useModalGroupLifecycle(name, { onFocus, onBlur })` observes focus while its consumer is mounted; cleanup also invokes blur. React StrictMode may replay effects. It is not an independent mount/destroy lifecycle.
62
+
63
+ `group.run(signal => fetch(url, { signal }))` starts a task only while the group is focused. Sibling navigation preserves the task; leaving the group or destroying the runtime aborts its signal. Cancellation is cooperative; callers handle rejection. Tasks do not automatically show Loading.
64
+
65
+ ```jsx
66
+ const group = useModalRouteGroup('settings');
67
+ useModalGroupGuard('settings', () => !dirty);
68
+ useModalGroupLifecycle('settings', { onFocus: refresh });
69
+ group?.setParams({ deviceId: 1002 }); // call from an event, not render
70
+ ```
71
+
72
+ ### Alpha.6 stability
73
+
74
+ Group guard checks reject concurrent checks and invalidate pending approval when the active route identity changes or the runtime is destroyed. A rejected or throwing guard releases the check lock. Group lifecycle hooks subscribe only to focus state, not parameter changes. Task cancellation remains cooperative; group parameters retain their runtime lifetime. Cache eviction, persistent layout animation and browser focus behavior require further validation.
75
+
76
+ ## Alpha.7 transaction safety
77
+
78
+ Close, replacement, guarded page navigation and explicit cache clearing share a runtime transaction. Concurrent operations are rejected rather than queued; force disposal still bypasses guards. Group tasks that resolve after their signal was aborted now reject with AbortError, even if the task ignored the signal. This does not undo side effects inside the task. Group parameters still live for the runtime lifetime; automatic cache eviction and nested animation behavior are unchanged.
79
+
80
+ ### Alpha.8 — Group resource lifetime
81
+
82
+ Group parameters survive blur and cache eviction while a descendant remains in navigation history. Removing the last descendant from the stack resets group parameters to their configured initial values. Layout component state still follows mounted-page caching. Explicit cache clearing and stack removal check registered guards of groups losing their last relevant descendant, including inactive groups. Automatic cache eviction is unchanged; group guards are registered by mounted components only. No new public API is introduced.
83
+
84
+ ## Beta.1: cache protection and typed paths
85
+
86
+ Registered group guards conservatively protect their cached descendants from automatic eviction, even if the cache limit is zero or keepAlive is false. Explicit eviction still runs guards and excluded routes are not remounted by protection. Protection ends when the guard unregisters; cache selection is reevaluated on the next navigator render. This policy can exceed the cache limit.
87
+
88
+ Use `useModalNavigation<ModalDefinitionRoutes<typeof definition>>()` to infer absolute leaf paths and default group aliases from a literal `defineModal` configuration. This does not infer parameter schemas, validate default targets, or type relative paths. At eight nesting levels the type falls back to string to bound compiler recursion. Runtime validation remains authoritative.
89
+
90
+ Guard registration changes trigger cache selection again. Explicitly evicted pages remain excluded until reactivated. Each registration has independent cleanup.
91
+
92
+ ### Guard and task safety (1.3.0-rc.3)
93
+
94
+ Changing group guard registrations during an asynchronous guard check invalidates the approval. Navigation, explicit cache clearing, close and replacement also check the registration revision before committing (close checks before its exit animation). Retry the action if registrations changed. Group task promises reject promptly with `AbortError` on blur or destruction, even if the underlying work ignores cancellation; underlying side effects still require cooperative cancellation. Group commands retain their references across parameter and focus updates. Group parameters are shallow immutable snapshots: replace nested values through `setParams` rather than mutating them. Cache protection remains conservative.
95
+
96
+ ### Optional cache protection
97
+
98
+ `useModalGroupGuard(name, guard, { protectCache: false })` registers a navigation guard without pinning the group's cached screens. The default is `true` for compatibility. A navigation-only guard is removed when its owning component unmounts; do not opt out if unsaved local state or continued guard registration must survive eviction. Other protected guards and page-level protection still apply. Group parameters use shallow immutable updates; replace nested objects rather than mutating them.
99
+
100
+ ### Guard transaction consistency
101
+
102
+ Page removal guard registrations and group guard registrations invalidate pending navigation approvals when their membership changes. A close approval is checked again after the exit transition; if stale, the modal remains open. Retry the operation to evaluate the current guards. This does not track arbitrary changes inside a guard callback or the separate unsaved-changes guard state.
103
+
104
+ Route matches subscriptions ignore group focus-only updates; parent parameter updates still notify consumers. Group parameters are shallow immutable snapshots. Layout mounting remains tied to mounted descendants.
105
+
106
+ ### Form guard transaction safety
107
+
108
+ Committed dirty state, discard message and callback availability changes invalidate pending navigation, cache removal, close and replacement approvals. Close also checks after its exit animation. Callback identity alone is not tracked, to avoid invalidating approvals on ordinary inline callback renders. Edits that leave dirty true do not independently invalidate approval; applications should disable editing during asynchronous discard confirmation when needed.
109
+
110
+ ### Structural navigation commit (RC.7)
111
+
112
+ A successful structural navigation schedules a React update. The runtime transaction remains locked until the navigator publishes the matching committed stack in its layout effect. Competing structural operations or close requests before that commit return false; success does not promise that React has committed. Unmount releases a pending lock. Parameter and option updates are not structural transactions. Cache clearing retains its existing transaction behavior.
113
+
114
+ ### Commit safety (RC.8)
115
+
116
+ Explicit `clearCache` holds the structural transaction until the selected pages are absent from the committed mounted-route set. Its resolved boolean indicates acceptance, not completion of the React commit. Competing structural operations may return false during this interval. Group navigation notifications are processed in order even when subscribers publish another navigation snapshot synchronously.
117
+
118
+ ### RC.10 commit behavior
119
+
120
+ Accepted structural navigation and explicit cache eviction use React DOM flushSync after asynchronous guards. This is intended to permit consecutive awaited commands without waiting for a separate React batch. Concurrent commands during guard evaluation remain rejected. Lazy content and passive effects are not guaranteed ready. Synchronous commits may cost more rendering time; React integration and performance validation are required.
121
+
122
+ ### Route group transition safety (RC.11)
123
+
124
+ During synchronous group snapshot propagation, new group tasks and guard checks are rejected until all group snapshots have been processed. Start tasks after the transition, not inside a synchronous internal store notification. Runtime destruction resets group params to their initial values and clears subscriptions. This does not change the mounted Layout lifecycle or guarantee cancellation of non-cooperative underlying work.
125
+
126
+ A cache-protecting group guard registered inside a leaf screen (including its non-persistent layouts) now pins only that screen's route key. A guard in a shared persistent layout retains group-wide protection. Removing a protected owner invokes its guard even when another route in the group remains. Navigation-only guards retain their existing semantics. Explicit eviction still takes precedence after approval. This changes cache retention granularity, not the public hook signature.
127
+
128
+ ### RC.13 guard ownership
129
+
130
+ A mounted leaf-owned guard with `protectCache: false` does not pin its cache, but still participates in explicit owner removal checks even within the same group. Automatic eviction may unmount it without confirmation; it cannot protect state after unmount.
131
+
132
+ The mounted route tree is memoized across unrelated navigator updates. Route object changes (including params and options), mounted membership, focus, and relevant rendering props still propagate. Layouts consuming changing contexts may still render; sibling navigation does not guarantee a render-free parent layout.
133
+
134
+ ### Group retention
135
+
136
+ `useModalRouteGroup(name)` also exposes `isRetained`, which indicates whether at least one route in the group remains in the logical navigation stack. It is independent of React mounting and `isFocused`. Parameters reset when the last route leaves the stack, and retention becomes false on runtime destruction. Persistent layout guards are group-owned in both single and stack rendering modes; leaf guards remain page-owned.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-modal-navigation",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "React 19 modal navigation with automatic built-in CSS, Promise results and typed hooks",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -19,18 +19,32 @@
19
19
  "dist",
20
20
  "README.md",
21
21
  "LICENSE",
22
- "docs",
22
+ "docs/API.md",
23
+ "docs/NESTED-ROUTES.md",
24
+ "docs/PERFORMANCE.md",
25
+ "docs/CACHE-1.2.0.md",
26
+ "docs/DECLARATIVE-1.2.0.md",
27
+ "docs/EVENTS-1.2.0.md",
28
+ "docs/MANAGER-EVENTS-1.2.0.md",
29
+ "docs/ROUTE-EVENTS-1.2.0.md",
30
+ "docs/DEVTOOLS-1.2.0.md",
23
31
  "CHANGELOG.md"
24
32
  ],
25
- "sideEffects": false,
33
+ "sideEffects": [
34
+ "**/*.css"
35
+ ],
26
36
  "scripts": {
27
37
  "build": "vite build && node scripts/copy-types.mjs",
28
- "prepublishOnly": "npm run build",
38
+ "prepublishOnly": "npm run release:full",
29
39
  "pack:check": "npm pack --dry-run",
30
40
  "typecheck": "tsc --noEmit --skipLibCheck --strict types/index.d.ts",
31
41
  "test": "node --test tests/*.test.mjs",
32
- "test:react": "vitest run tests/react-profiler.integration.test.jsx tests/rc2.integration.test.jsx --environment jsdom",
33
- "typecheck:consumer": "tsc --noEmit --strict --lib ES2022,DOM --moduleResolution bundler --module ESNext tests/types-120.ts"
42
+ "test:react": "vitest run tests/react-profiler.integration.test.jsx tests/rc2.integration.test.jsx tests/release.integration.test.jsx --environment jsdom",
43
+ "typecheck:consumer": "tsc --noEmit --strict --lib ES2022,DOM --moduleResolution bundler --module ESNext tests/types-120.ts",
44
+ "release:check": "npm test && npm run typecheck && npm run typecheck:consumer && npm run test:react && npm run build && npm run pack:check && node scripts/check-package.mjs && node scripts/check-installed-package.mjs",
45
+ "test:browser": "playwright test tests/browser/release.spec.mjs",
46
+ "release:full": "npm run release:check && npm run test:browser",
47
+ "test:diagnostics": "playwright test tests/browser/diagnostics.spec.mjs"
34
48
  },
35
49
  "peerDependencies": {
36
50
  "react": "^19.0.0",
@@ -46,7 +60,9 @@
46
60
  "vitest": "^3.2.0",
47
61
  "jsdom": "^26.1.0",
48
62
  "@testing-library/react": "^16.3.0",
49
- "react-test-renderer": "^19.0.0"
63
+ "react-test-renderer": "^19.0.0",
64
+ "@types/react-dom": "^19.0.0",
65
+ "@playwright/test": "^1.51.0"
50
66
  },
51
67
  "publishConfig": {
52
68
  "access": "public"
@@ -1,5 +0,0 @@
1
- # Architecture refactor (1.1.11)
2
-
3
- Provider now owns a stable manager, with separate host and status snapshots. Manager owns registry resolution, queue, guards, lifecycle and instance-bound callbacks. ModalHost selects the existing single/stack navigator. Legacy useModal retains reactive status; command-only consumers should use useModalCommands. Layout updates no longer update Provider state, but still update host/navigator options. Full per-instance Layout/Navigation/Header/Footer runtime migration and button-level isolation are not completed. Selector snapshots are cached per selector identity; use stable selectors and equality functions for best results. SSR hydration and real React/browser profiling remain unverified.
4
-
5
- Validation: npm test: 82 passed, 1 skipped (83 total); typecheck command passed with skipLibCheck. Vite and Vitest unavailable; production build and React integration tests not run.
@@ -1,8 +0,0 @@
1
- # Async race hardening
2
-
3
- - Bind registry cancellation to the exact job; clear pending before abort dispatch, which may synchronously start another job.
4
- - Register the active job before publishing loading; release a token returned after synchronous cancellation.
5
- - Reject reentrant task registration for a route during its synchronous cancellation sweep. This is not a permanent route tombstone.
6
- - Register navigateAsync result requests during navigation commit, before React dispatch, rather than after awaiting navigation.
7
- - Cancellation remains cooperative; a non-settling underlying promise can remain pending.
8
- - React integration and production build require installed development dependencies.
@@ -1,7 +0,0 @@
1
- # Declarative lifecycle hardening
2
-
3
- The controller serializes open/close requests and tracks changes to the requested open state. A rejected request is not retried until the open intent changes. If a close is already committed, a newer open request creates a fresh instance. Normal closes retain guards. Owner unmount forcibly disposes its own instance (no close guards, animation or onClose/onClosed callbacks); the result and manager close event use reason `unmount`. Keep the owner mounted when unsaved data must be protected. Disposal can invalidate a concurrent replacement transition; callers must handle blocked opens.
4
-
5
- `instance.replaceOptions(options)` replaces overrides and clears runtime layout overrides, restoring provider/definition defaults. It may reset imperative layout changes. `instance.dispose()` is explicit forced teardown, not a normal close. Both return false for stale handles. Updates rejected while manager is busy are retried on a subsequent owner render, not automatically. Options use shallow comparison; use immutable values. Host context boundary remains unchanged.
6
-
7
- Node tests exercise the controller with the real manager and simulated navigation registration; React/StrictMode and build remain unverified until dev dependencies are installed.
@@ -1,7 +0,0 @@
1
- # 1.2.0 development candidate — first increment
2
-
3
- Based on 1.1.11 keepalive-test-fix. Adds opt-in typed named modal contracts, typed route parameters, push/pop/popTo/popToTop and cooperative useModalTask cancellation. Legacy untyped calls remain available. Typed modal contracts currently support positional named calls only; they do not validate registry definitions at runtime. navigate retains first-match deduplication; popTo selects the nearest matching route. pop removes pages with status removed; goBack retains returned semantics. Single-page navigation operations return false.
4
-
5
- Task cancel aborts the signal, releases its own loading token, and prevents late callbacks; the task promise settles only when underlying work settles. Existing zero-argument tasks still work. Cancellation adds a cancelled result variant, so exhaustive consumers need to handle it.
6
-
7
- Pending: typed page results, typed object modal calls, lifecycle API, instance API, form guard, cache policy, declarative modal, debugging. React integration/build not verified in this environment. Do not publish before local acceptance.
@@ -1,10 +0,0 @@
1
- # 1.1.11 remaining optimization
2
-
3
- - Container selects only consumed layout fields, preserving screen and runtime overrides and responsive precedence.
4
- - Fullscreen control subscribes independently of the header title.
5
- - Inactive cached layers no longer receive unrelated page motion objects.
6
- - `useModal({ subscribe: false })` provides command-only access; the default remains reactive. Use field-specific hooks for state.
7
- - Restore `useModal().navigation.navigateAsync`; commit the already-calculated stack to preserve route keys for async page requests.
8
- - Ignore old-instance errors and stale single-screen writes; prevent pending action updates after unmount and synchronous default-footer reentry.
9
-
10
- Validation: npm test 86 passed, 1 skipped, 0 failed; typecheck command passed (skipLibCheck). Vite and Vitest unavailable; offline npm installation failed (ENOTCACHED). React integration, browser profiler, StrictMode, SSR, memory and production build are not verified. KeepAlive consumers of legacy reactive navigation/loading still update when subscribed values change. Responsive fullscreen control reflects base store rather than viewport-resolved configuration, as before. No runtime dependencies added.
package/docs/RC1-1.2.0.md DELETED
@@ -1,2 +0,0 @@
1
- # RC-1 hardening
2
- Runtime store event batches are delivered in publication order even when a listener publishes another snapshot. This does not make stores transactional or guarantee per-command React events. Observers must not create unbounded publication loops. Removed asynchronous guards are skipped before invocation; already running guards cannot be cancelled. Registry lookups require own properties. Declarative async error callbacks have rejection handling. No new public API. Node tests: 116 passed, 1 skipped; typecheck with skipLibCheck passed. React tests and build blocked by missing Vitest and Vite. Not a release certification.
package/docs/RC2-1.2.0.md DELETED
@@ -1,3 +0,0 @@
1
- # RC-2 integration preparation
2
-
3
- Feature freeze remains in effect. Manager now skips unregistered dirty guards and rejects inherited initial screen names. Added late-open owner teardown regression and React StrictMode owner/DevTools integration cases. Run `npm install`, `npm test`, `npm run test:react`, `npm run typecheck:consumer`, `npm run build` locally. Node tests: 117 passed, 1 skipped. Declaration check with skipLibCheck passed. Offline dependency installation failed (ENOTCACHED); React tests, strict consumer check and build are blocked by missing dependencies. No release certification or publication.
package/docs/RC3-1.2.0.md DELETED
@@ -1,9 +0,0 @@
1
- # RC-3: subscription efficiency
2
-
3
- `instance.subscribeState(selector, listener, equal?, dependencies?)` optionally subscribes only to named runtime stores. Omit dependencies for the existing all-store behavior. Include every store read by the selector; an empty array subscribes to none. Duplicate names are deduplicated and unknown names rejected. Selectors still receive the complete snapshot.
4
-
5
- ```js
6
- const off = instance.subscribeState(s => s.loading.visible, console.log, Object.is, ['loading']);
7
- ```
8
-
9
- Route events skip Set allocations when ordered route keys and focused key are unchanged. The Node regression test publishes 10,000 unrelated toast snapshots: broad selector runs 10,001 times including initialization, narrow selector once. This is an execution count, not browser timing or heap evidence. React integration, production build and heap profiling remain pending.
@@ -1,7 +0,0 @@
1
- # RC-3B resource hardening
2
-
3
- Instance commands resolve the active runtime by ID rather than capturing the old runtime directly. Destroy clears store payloads and the cached aggregate snapshot without notifying destroyed subscribers. Previously exported snapshots, result promises, caller closures and manager references remain caller-owned; this is not a GC guarantee.
4
-
5
- Committed inactive cache evictions remain excluded until the route becomes active again or is removed. Increasing the cache limit does not remount previously evicted inactive pages. This is not LRU. Automatic eviction does not run asynchronous removal guards. React integration remains unverified.
6
-
7
- Node: 122 tests, 121 passed, 1 skipped. Typecheck with skipLibCheck passed. Vitest and Vite unavailable; browser profiling and heap verification pending.
@@ -1,2 +0,0 @@
1
- # RC-3C
2
- Dirty registered guards protect background routes from automatic eviction, even with keepAlive=false or a zero cache limit. Explicit clearCache still runs guards and explicit exclusions win. Protection is evaluated on navigator renders, not independently reactive; React integration is pending. Loading snapshot tracks latest token and scans only when it disappears; repeated latest-token deletion remains linear. Inspector skips unchanged refreshes but retains all recorded events within its limit. Node: 124 passed, 1 skipped; typecheck passed with skipLibCheck. React and build blocked by missing Vitest/Vite. No release performed.
@@ -1,7 +0,0 @@
1
- # Resource isolation
2
-
3
- - Task cancellation failures no longer interrupt runtime cleanup.
4
- - Store and event listeners removed during dispatch are skipped; sync and async failures are logged independently.
5
- - Explicit cache clearing targets eligible mounted background routes only, and removes their focus history.
6
- - Removed routes release stored result events.
7
- - No new public API or runtime dependencies. React integration and build still require local dependencies. Declarative Modal remains deferred.
@@ -1,5 +0,0 @@
1
- # Instance runtime migration
2
-
3
- Manager creates and disposes one runtime per active modal. Both navigators consume its six stores. Layout updates publish to the runtime without notifying Host; the navigators still subscribe to the full layout snapshot. Route reducer, UI effects, and navigation commands remain in the renderers. Runtime owns loading tokens and pending page requests; toast timer cleanup is registered with runtime. Store destruction rejects subsequent publications. This is not a claim of complete component-level isolation or browser performance validation.
4
-
5
- Validation: Node tests and existing declaration check run locally; Vite and Vitest unavailable in the execution environment. Run npm install, npm run test:react, npm run build before publishing.
@@ -1,9 +0,0 @@
1
- # 1.2.0 stage 2
2
-
3
- `useModalLifecycle` exposes React mount/unmount and focus/blur effects, plus logical removal guards for mounted pages. StrictMode can replay effects. Evicted pages unregister guards; this is not a persistent logical-route lifecycle. Guards run on navigation, close and replacement. Multiple lifecycle guards can coexist.
4
-
5
- `openInstance` adds navigation snapshot `getState`, navigation-only `subscribe`, `navigate`, `setParams`, `setLoading`. Commands require a mounted renderer and active instance; before readiness they return false. Subscribe does not emit a final close event; await `result` for closure.
6
-
7
- `useModalTask` registers jobs in runtime by route key. Removing a route or destroying runtime aborts jobs; blur alone does not. Cancellation remains cooperative; a task ignoring AbortSignal can delay its returned promise. Existing per-hook concurrency policy remains. No global event bus yet.
8
-
9
- Node tests: 95 pass, 1 skip. Type declaration check passes with skipLibCheck. React integration and Vite build blocked by missing tools. No browser performance claims.
@@ -1,9 +0,0 @@
1
- # Stability validation (1.1.11)
2
-
3
- Changes: iterative reuse result settlement; generation and instance guards for stale lifecycle errors; skip zero-duration transition timers.
4
-
5
- Actual Node baseline: 86 passed, 1 skipped (87 total). After changes: 91 passed, 1 skipped (92 total). Includes 1000 Manager open/close cycles checking all six store subscriptions and 10000 reuse results. These are not browser heap or render measurements.
6
-
7
- `npm run typecheck` succeeded using existing skipLibCheck configuration. Offline dependency installation failed (ENOTCACHED); Vite and Vitest unavailable. React StrictMode integration test added but not executed. SSR, browser heap, responsive/drag/animation combinations and actualDuration remain unverified.
8
-
9
- Before publishing: npm install; npm test; npm run typecheck; npm run test:react; npm run build; npm run pack:check. Do not treat source-level tests as browser performance certification.
@@ -1,7 +0,0 @@
1
- # Stage 3 (initial)
2
-
3
- `await instance.ready` returns true when navigation commands first register and the instance is still active, or false if destroyed before registration. It does not wait for lazy screen content or animations. Always check the result and avoid waiting inside a React effect that blocks mounting.
4
-
5
- `useModalFormGuard({values, initialValues, equals, message, onBeforeDiscard})` uses immutable snapshots and Object.is by default; provide a structural comparator for object forms. `markSaved(savedValues)` updates the baseline. It does not reset form values. Initial values are captured once per mount. Existing dirty guards now coexist per route. Guards still unregister when their component unmounts.
6
-
7
- Existing `modal.preload(name, screen)` and `maxCachedScreens` are retained. Events, declarative Modal and expanded cache policies are not implemented in this increment.
@@ -1,7 +0,0 @@
1
- # Component and field subscriptions
2
-
3
- Layout changes now bypass Host and Navigator for width/height and fullscreen. RuntimeContainer reads the layout snapshot and preserves screen/runtime precedence; RuntimeHeader and footer regions select only relevant fields. Navigator retains page animation, lifecycle and cache options. Header fullscreen still updates the header region. Custom footer actions have local pending state; legacy done/cancel retain shared locking. Existing global loading overlay behavior is preserved.
4
-
5
- `useModalLayout(selector?, equal?)` reads instance base options, not responsive or screen-resolved geometry. `useModalNavigationState` and `useModalLoadingState` now accept selectors and equality; `useModalLoading` selects visible only. `shallowEqual` is for flat records. Legacy `useModal()` retains broad reactive subscriptions. KeepAlive route context and navigation reducer are unchanged.
6
-
7
- Validation: Node tests and declaration command executed; React integration and production build require missing Vitest/Vite dependencies. No browser performance measurements claimed.
@@ -1,18 +0,0 @@
1
- # 1.1.11 source upgrade
2
-
3
- Existing named registration and numeric asynchronous open IDs are preserved. The provider still manages one active modal plus a queue, not simultaneous windows.
4
-
5
- ```jsx
6
- import { defineModal, lazyModal, useModal, useModalHeader, useModalFullscreen } from 'react-modal-navigation';
7
- const Create = defineModal({ loader: () => import('./Create.jsx'), title: ({route}) => route.params?.title, modalOptions: { width: 460, fullscreenable: true } });
8
- // Within a component:
9
- const { modal } = useModal();
10
- await modal.preload(Create);
11
- await modal.open(Create, { title: 'Create' });
12
- modal.setOptions({ width: 720 });
13
- modal.toggleFullscreen();
14
- ```
15
-
16
- Inline definitions work with open/openAsync/enqueue/enqueueAsync. A registry may contain `settings: lazyModal(() => import('./settings/index.js'))`. Explicit loader functions must resolve to a default component export. Preload caches successful promises by loader identity and evicts rejected promises; existing React.lazy components have no public preload interface. `useModalHeader({ actions: [{key:'refresh', tooltip:'Refresh', icon: ..., onClick: refresh}] })` adds actions without replacing built-in close/back. Fullscreen uses viewport CSS, not browser fullscreen. Existing Tailwind classes must be generated by the host. Edge offsets are padding-based; top is not applied to bottom placement. `onOpened` is a mount callback, not animation completion; `onClosed` follows the close path.
17
-
18
- Not implemented in this source revision: responsive breakpoint configuration, drag resizing, instance handles, duplicate strategies, full error fallback/retry customization, strict command-only provider subscriptions, complete generic route inference, real browser/Profiler verification. Page layout overrides are preliminary. The package is not a validated production release. Build requires installing dev dependencies.