{"_id":"@academix-admin/state-stack","_rev":"8-fd4e4ff35a2986c8b4d9b4120b2f3c0e","name":"@academix-admin/state-stack","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@academix-admin/state-stack","version":"0.1.0","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.1.0","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"79b579edddfe0d14575235178518f0f3c10e520b","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.1.0.tgz","fileCount":16,"integrity":"sha512-4E7DOOGRiUynf49XrEkBBXxaOS9pCAaq9xndW/dOtNYtq2nxJn9h7TtTxFHw9vJYxonlHZ7dFiu3uEi9ilK8cw==","signatures":[{"sig":"MEYCIQDlg7RbsLFR5dHHVgHM7MdCpAgIWcK5Rf52svuBpc1fmwIhAIK5D09r/I5n9JUiE6E06StLhldKucKEUeMuY29h/Fq0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":376437},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"22fcc5fea088a5b2c708d09013f62309af1e9b79","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.1.0_1784656998333_0.9671202360535587","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@academix-admin/state-stack","version":"0.1.1","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.1.1","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"fdcce94f09a439f990007857f16717ae9489af4e","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.1.1.tgz","fileCount":16,"integrity":"sha512-Brpchv1u4H+T8g7jWCg7o32P3kNlpi61vpdyEdsCojWVZQH/PvMi+UFpItH8zQbIQOfT/XrMEPdGJ2QyyVB3Sg==","signatures":[{"sig":"MEUCIH1ZTn1QDkGxpu3Zvyxz+MXwu/cmTaYnJ20MERFEqsopAiEAlj+KVSQPgE9tCJK+4bBa6nSbkK4QAlY6JwtrZrAUL9Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":382069},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"d1cb1f0036eb447e42dccf3b840c1dec759cc00f","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.1.1_1785335712310_0.9867234816168255","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@academix-admin/state-stack","version":"0.1.2","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.1.2","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"8bb3df2343409d663486fcf767c0e573355b1a24","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.1.2.tgz","fileCount":16,"integrity":"sha512-xvu83wMCt3HEm8/Ck4Wms6DLz6HkqIczg00QB+cLxdvORfq8nduQYWsF1olwKp2nF6F5A8U6ODNlzPy3Dc64Sg==","signatures":[{"sig":"MEUCIHWZPLFxn5MhZdJA4M/VYi0ahDZs4CjlLV57oShufWzhAiEA4kUI0JDcd5BZcNr+MPMGlQc5tEQxociw9wkA8sjuEJk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":384543},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"d1cb1f0036eb447e42dccf3b840c1dec759cc00f","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.1.2_1785336049024_0.6337928531987951","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@academix-admin/state-stack","version":"0.2.0","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.2.0","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"c83235f5d482dd2fc42c5d2ac96c00775dc9760c","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.2.0.tgz","fileCount":16,"integrity":"sha512-cZarD3HOEduxPtKRBzCR3VXhwr4yBNrfN4Wz4K2u+pgD3waVWXgbQelsbSQq6ygoeOCPz+oXlvKse0DmfkrV5g==","signatures":[{"sig":"MEUCIC8+UxTkOxxmILM03Z74G5MhiO3M2N7QhPixND/gkTO2AiEAkidTykeDzPGLfYvMSl5ietSCjpHVIvuXX5SyoICn5Lg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":418959},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"f89e0e1edaced8185558f34f11e53b3f1180b2fa","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.2.0_1785338366967_0.8176832690037628","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@academix-admin/state-stack","version":"0.2.1","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.2.1","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"020db6f3c5e749700fa641d93c9728a30b8133d1","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.2.1.tgz","fileCount":16,"integrity":"sha512-vg4tPYiLvODZsJnCwJ1rlNmS41Os3PNVQ8p3dCph14q0a3WZw6kHGbPcaqnBxFlWi1MprSkTZUMnCFaBbTi0Gw==","signatures":[{"sig":"MEUCIDhlpGoH2BNloTTEAlpUqNAVxBYz1btPdov+AJL0EQ/AAiEAyUORYWY3jzxhmK6IZ5ig+wfUhhNzXnKJb5WJYoE2Sfw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":430564},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"8ec75f5ab533b7d4831f381750bf0dc6e09da1b5","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.2.1_1785351771378_0.7312634712077859","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@academix-admin/state-stack","version":"0.2.2","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.2.2","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"fd5fcd4616d65f0c75436b75b63c0b1a7fd76feb","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.2.2.tgz","fileCount":16,"integrity":"sha512-xJzsX3kr4AggfxAhTRox+XDlxVzI5tSSHHFOqNnH74ehRn7T94StGkBBr2E8E+7gqn6998dIDRa+4/tbb7cVcg==","signatures":[{"sig":"MEYCIQCQ4MMnZazuhMnjkBjDxKWsKs+kvVfaAujdqGioNej7mwIhAJH7Hkg1KPdCbYJfbaPF8elmvX7Pk6zIG8UMFQw7HqBl","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":436382},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"a3b55b323e693960a4c4d2ac072198d5f16ac8c1","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.2.2_1786798299294_0.32590905771038137","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@academix-admin/state-stack","version":"0.2.3","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"author":{"name":"Academix"},"license":"MIT","_id":"@academix-admin/state-stack@0.2.3","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"dist":{"shasum":"93e0732cedd9f77c8146200296c3c5510d334b8f","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.2.3.tgz","fileCount":16,"integrity":"sha512-A6uSlZUMoVpu9ziJuDobn5QLbeOaNgIyOCzN1fT8RiowK8QEDxcYm79h4gPOrbhhSY34P9tU6UeAF7Gyy7rkLA==","signatures":[{"sig":"MEQCIDpN0KWKYvoGob8cikXN8OJkU0cifuUgWS4Ga6sU3TuqAiB8yTVLQMLZljhdQSAVwJz9+qVCMq4upCMxkPe8gSN9Vw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":444105},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"gitHead":"81bae83ca05e84fe5f0c72f25ce57da568da07a5","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"repository":{"url":"git+https://github.com/academix-admin/academix-ui.git","type":"git","directory":"packages/state-stack"},"_npmVersion":"11.13.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.9","tsup":"^8.3.5","react":"^18.3.1","rimraf":"^6.0.1","react-dom":"^18.3.1","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/state-stack_0.2.3_1787805951005_0.36935113191795255","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@academix-admin/state-stack","version":"0.3.0","description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"license":"MIT","author":{"name":"Academix"},"repository":{"type":"git","url":"git+https://github.com/academix-admin/academix-ui.git","directory":"packages/state-stack"},"homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/next.d.ts","default":"./dist/next.js"},"require":{"types":"./dist/next.d.cts","default":"./dist/next.cjs"}},"./package.json":"./package.json"},"scripts":{"build":"tsup","clean":"rimraf dist","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"peerDependencies":{"next":">=13.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"devDependencies":{"@types/react":"^19.0.0","@types/react-dom":"^19.0.0","next":"^15.5.9","react":"^18.3.1","react-dom":"^18.3.1","rimraf":"^6.0.1","tsup":"^8.3.5","typescript":"^5.9.3"},"publishConfig":{"access":"public"},"gitHead":"36b9a618700732adad6a80bfc0725855eb2e443f","_id":"@academix-admin/state-stack@0.3.0","_nodeVersion":"24.15.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-PjB2jehmTZdnWoRXEZ0FNCmRkxPPAnGlvtKFrfExrIPVE7ys8U7cU++6S6Bi+9xN54FnSajJOWeCCEb8T+75Ow==","shasum":"c9e81477a50f23d267a7c0c7621221eacd8b4c02","tarball":"https://registry.npmjs.org/@academix-admin/state-stack/-/state-stack-0.3.0.tgz","fileCount":16,"unpackedSize":460975,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDpBEuxe1kzMVy/LKgqVN6bCnTHkO8Ij6zJABA3Vmr/FwIgG3Jvq5sb760b78cd04eujYI9VRk8h1GNZewXTPtLFqU="}]},"_npmUser":{"name":"academix-group","email":"academix.tech4u@gmail.com"},"directories":{},"maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/state-stack_0.3.0_1788215362796_0.13883419779864803"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-21T18:03:18.228Z","modified":"2026-08-31T22:29:23.138Z","0.1.0":"2026-07-21T18:03:18.496Z","0.1.1":"2026-07-29T14:35:12.445Z","0.1.2":"2026-07-29T14:40:49.159Z","0.2.0":"2026-07-29T15:19:27.167Z","0.2.1":"2026-07-29T19:02:51.541Z","0.2.2":"2026-08-15T12:51:39.438Z","0.2.3":"2026-08-27T04:45:51.177Z","0.3.0":"2026-08-31T22:29:22.942Z"},"bugs":{"url":"https://github.com/academix-admin/academix-ui/issues"},"author":{"name":"Academix"},"license":"MIT","homepage":"https://github.com/academix-admin/academix-ui/tree/main/packages/state-stack#readme","keywords":["react","state-management","cross-tab","broadcastchannel","indexeddb","persistence","undo-redo","atoms","usesyncexternalstore"],"repository":{"type":"git","url":"git+https://github.com/academix-admin/academix-ui.git","directory":"packages/state-stack"},"description":"Production-ready, framework-agnostic cross-tab React state: IndexedDB-first persistence, BroadcastChannel sync, undo/redo, TTL, atoms and route-scoped demand state.","maintainers":[{"name":"academix-group","email":"academix.tech4u@gmail.com"}],"readme":"# @academix-admin/state-stack\n\nProduction-ready, **framework-agnostic** cross-tab state management for React.\n\n- 🗂️ **IndexedDB-first persistence** with automatic `localStorage` fallback\n- 📡 **Cross-tab sync** via `BroadcastChannel` (self-message suppression)\n- ⏪ **Undo / redo** for both persistent and ephemeral state\n- ⏱️ **TTL** expiry per key\n- 🧵 **Serialized updates** — per-key promise chain, no dropped concurrent writes\n- ⚛️ **Atoms, computed, demand-state** — pick the primitive that fits\n- 🧭 **Route-scoped state** — framework-agnostic, with an optional Next.js adapter\n- 🔒 **React 18 safe** — built on `useSyncExternalStore`\n\n> `react` / `react-dom` are peer deps. `next` is an **optional** peer dep, used\n> only if you import the `/next` adapter.\n\n> 📖 **[More real-world examples →](./EXAMPLES.md)** — typed stores, demand\n> state, atoms, undo/redo and router wiring, adapted from a production app.\n\n## Install\n\n```bash\nnpm install @academix-admin/state-stack\nnpm install react react-dom\n```\n\n## Primitives at a glance\n\n| Hook | Scope | Persists? | Use it for |\n|------|-------|-----------|------------|\n| `useAtom(key, initial)` | Global by key | No | Simple shared in-memory value |\n| `useComputed(fn, default, deps)` | Local | No | Derived values, no stale flash |\n| `useToggle(initial)` / `useList(initial)` | Local | No | Ergonomic local state |\n| `useDemandState(initial, opts)` | Route (default) or custom | Optional | Per-page state, persistence, undo/redo, TTL |\n| `createStateStack(blueprints)` | Custom scope | Optional | Redux-like typed stores with methods + middleware |\n\n## `useDemandState` — route-scoped persistent state\n\n```tsx\n'use client';\nimport { useDemandState } from '@academix-admin/state-stack';\n\nfunction SearchPage() {\n  const [query, load, setQuery, ctl] = useDemandState('', {\n    key: 'search',\n    persist: true,     // survives reloads (IndexedDB → localStorage)\n    ttl: 60_000,       // optional expiry\n    historyDepth: 10,  // undo/redo depth\n  });\n\n  return (\n    <input\n      value={query}\n      onChange={(e) => setQuery(e.target.value)}\n      // ctl.clear(), ctl.clearByScope(), ctl.isHydrated, …\n    />\n  );\n}\n```\n\nReturns a tuple: `[value, load, set, controls]`.\n\n- `value` — current state\n- `load(loader)` — async loader with `{ get, set }` helpers (e.g. fetch-then-set)\n- `set(next | prev => next)` — update the value\n- `controls` — `{ clear, clearByScope, clearByPathname, clearByPrefix, clearByCondition, isHydrated }`\n\nState is scoped to the current route by default (`route:<pathname>`). Provide an\nexplicit `scope` to share across routes, or configure route resolution (below).\n\n## Atoms & derived state\n\n```tsx\nimport { useAtom, useComputed } from '@academix-admin/state-stack';\n\nconst [count, setCount] = useAtom('counter', 0);\nconst doubled = useComputed(() => count * 2, 0, [count]);\n```\n\n## Typed stores with methods — `createStateStack`\n\n```tsx\nimport { createStateStack } from '@academix-admin/state-stack';\n\nconst { useStack } = createStateStack({\n  cart: {\n    addItem: (state: { items: string[] }, item: string) => ({\n      items: [...state.items, item],\n    }),\n    clear: () => ({ items: [] }),\n  },\n});\n\nfunction Cart() {\n  const { cart, cart$, __meta } = useStack('cart', {\n    initial: { items: [] },\n    persist: true,\n    historyDepth: 50,\n  });\n\n  return (\n    <>\n      <span>{cart.items.length} items</span>\n      <button onClick={() => cart$.addItem('Book')}>Add</button>\n      <button onClick={() => __meta.undo()} disabled={!__meta.canUndo()}>Undo</button>\n    </>\n  );\n}\n```\n\n`useStack('cart', …)` returns `{ cart, cart$, __meta }` — the state, its method\nobject (each method returns a `Promise<void>`), and metadata\n(`undo`, `redo`, `canUndo`, `canRedo`, `clear`, `clearByScope`, `isHydrated`).\n\n## The `StateStack` façade\n\n```ts\nimport { StateStack } from '@academix-admin/state-stack';\n\nStateStack.init({ storagePrefix: 'myapp', preferredStorage: 'auto' });\nStateStack.clearScope('route:/checkout');\nStateStack.clearCurrentPath();\nStateStack.clearByPrefix('search');\n```\n\n## Configuration — `initStateStack`\n\nCall once at startup (before any state hooks render):\n\n```ts\nimport { initStateStack } from '@academix-admin/state-stack';\n\ninitStateStack({\n  storagePrefix: 'myapp',        // namespace persisted keys\n  preferredStorage: 'auto',      // 'indexeddb' | 'localstorage' | 'auto'\n  crossTabSync: true,\n  debug: false,\n  // usePathname: myRouterHook,   // see route scoping below\n});\n```\n\n## Route scoping (framework-agnostic)\n\nBy default, route-scoped state reads the pathname from `window.location` and\ntracks History API navigations (`pushState`/`replaceState`/`popstate`). That\nworks in any React app with **no configuration**.\n\nTo align scoping with your router, inject its pathname hook once:\n\n```ts\ninitStateStack({ usePathname: myRouterUsePathnameHook });\n```\n\n### Next.js App Router adapter\n\n```tsx\n'use client';\nimport { connectNextRouter } from '@academix-admin/state-stack/next';\n\nconnectNextRouter(); // wires next/navigation's usePathname\n```\n\nCall it once in a client boundary (e.g. a providers component) before rendering\ncomponents that use `useDemandState`. `next` is an optional peer dependency —\nonly required if you import this adapter.\n\n## Storage adapters\n\n`indexedDBAdapter`, `browserStorageAdapter`, `defaultStorageAdapter` (IndexedDB\n→ localStorage) and `fallbackStorageAdapter` (no-op) are exported. Implement the\n`StorageAdapter` interface for custom backends and pass it via `storage`.\n\n## Dev inspector\n\nIn development, `window.__STATE_STACK__` exposes `core`, `atomStore`, adapters\nand a `debug()` snapshot. Stripped in production builds.\n\n## License\n\nMIT © Academix\n","readmeFilename":"README.md"}