react-modal-navigation 1.1.9 → 1.1.11

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
@@ -109,3 +109,22 @@
109
109
 
110
110
  /* Top offset must reduce available dialog height, not just move its starting point. */
111
111
  .pmn-place-top .pmn-dialog{max-height:min(calc(100dvh - var(--pmn-top-offset, var(--pmn-gap)) - var(--pmn-gap)),var(--pmn-max-height,100dvh))}
112
+
113
+ /* v1.1.10: Custom Tailwind backgrounds live on an independent paint layer.
114
+ Header, body, footer and route snapshots remain transparent over that layer.
115
+ No Tailwind runtime or computed-style reads are needed. */
116
+ .pmn-dialog.pmn-has-custom-background{isolation:isolate;--pmn-body:transparent}
117
+ .pmn-custom-background-layer{position:absolute;inset:0;z-index:0;pointer-events:none}
118
+ .pmn-dialog.pmn-has-custom-background > :not(.pmn-custom-background-layer){position:relative;z-index:1}
119
+ .pmn-dialog.pmn-has-custom-background .pmn-main > .pmn-body{background:transparent}
120
+ .pmn-overlay.pmn-fullscreen{padding:0!important;align-items:stretch;justify-content:stretch}
121
+ .pmn-overlay.pmn-fullscreen .pmn-dialog{width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0!important}
122
+ .pmn-place-left .pmn-dialog,.pmn-place-right .pmn-dialog{height:100%;max-height:100%}
123
+ .pmn-place-center .pmn-dialog{max-height:100%}
124
+ .pmn-dialog{max-width:min(100%,var(--pmn-drag-width,var(--pmn-max-width,var(--pmn-width))));max-height:min(100%,var(--pmn-max-height,100dvh))}
125
+ .pmn-dialog .pmn-resize-handle{position:absolute;z-index:5;top:0;bottom:0;width:10px;cursor:ew-resize;touch-action:none;user-select:none}
126
+ .pmn-resize-left{right:0}.pmn-resize-right{left:0}
127
+ .pmn-resize-handle:hover,.pmn-resize-handle:focus-visible{background:var(--pmn-border)}
128
+ @media(max-width:640px){.pmn-mobile-fullscreen .pmn-resize-handle{display:none}}
129
+ .pmn-dialog{max-width:min(100%,var(--pmn-max-width,100%),var(--pmn-drag-width,var(--pmn-width)))}
130
+ .pmn-overlay.pmn-fullscreen .pmn-dialog{max-width:100%}
@@ -0,0 +1,5 @@
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.
@@ -0,0 +1,10 @@
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.
@@ -0,0 +1,5 @@
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.
@@ -0,0 +1,9 @@
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.
@@ -0,0 +1,7 @@
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.
@@ -0,0 +1,18 @@
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-modal-navigation",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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",