@rkrupinski/stan 1.2.0 → 1.2.1

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/react.js CHANGED
@@ -1,10 +1 @@
1
- import e,{createContext as r,useContext as t,useMemo as n,useRef as o,useState as a,useEffect as s,useCallback as c}from"react";import{D as i,m as l,r as u,e as f}from"./store-C_86rrYV.js";var y,p={exports:{}},m={};var b,d,v={};
2
- /**
3
- * @license React
4
- * react-jsx-runtime.development.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */function g(){return b||(b=1,"production"!==process.env.NODE_ENV&&function(){function r(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===w?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case p:return"Fragment";case b:return"Profiler";case m:return"StrictMode";case S:return"Suspense";case j:return"SuspenseList";case O:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case y:return"Portal";case g:return(e.displayName||"Context")+".Provider";case d:return(e._context.displayName||"Context")+".Consumer";case k:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case h:return null!==(t=e.displayName||null)?t:r(e.type)||"Memo";case _:t=e._payload,e=e._init;try{return r(e(t))}catch(e){}}return null}function t(e){return""+e}function n(e){try{t(e);var r=!1}catch(e){r=!0}if(r){var n=(r=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function o(e){if(e===p)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===_)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function a(){return Error("react-stack-top-frame")}function s(){var e=r(this.type);return P[e]||(P[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function c(e,t,o,a,c,u,y,p){var m,b=t.children;if(void 0!==b)if(a)if(R(b)){for(a=0;a<b.length;a++)i(b[a]);Object.freeze&&Object.freeze(b)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else i(b);if(N.call(t,"key")){b=r(e);var d=Object.keys(t).filter((function(e){return"key"!==e}));a=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",A[b+a]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,b,d,b),A[b+a]=!0)}if(b=null,void 0!==o&&(n(o),b=""+o),function(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return void 0!==e.key}(t)&&(n(t.key),b=""+t.key),"key"in t)for(var v in o={},t)"key"!==v&&(o[v]=t[v]);else o=t;return b&&function(e,r){function t(){l||(l=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,r,t,n,o,a,c,i){return t=a.ref,e={$$typeof:f,type:e,key:r,props:a,_owner:o},null!==(void 0!==t?t:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:s}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:c}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,b,u,0,null===(m=x.A)?null:m.getOwner(),o,y,p)}function i(e){"object"==typeof e&&null!==e&&e.$$typeof===f&&e._store&&(e._store.validated=1)}var l,u=e,f=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),g=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),w=Symbol.for("react.client.reference"),x=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,R=Array.isArray,E=console.createTask?console.createTask:function(){return null},P={},T=(u={"react-stack-bottom-frame":function(e){return e()}})["react-stack-bottom-frame"].bind(u,a)(),$=E(o(a)),A={};v.Fragment=p,v.jsx=function(e,r,t,n,a){var s=1e4>x.recentlyCreatedOwnerStacks++;return c(e,r,t,!1,0,a,s?Error("react-stack-top-frame"):T,s?E(o(e)):$)},v.jsxs=function(e,r,t,n,a){var s=1e4>x.recentlyCreatedOwnerStacks++;return c(e,r,t,!0,0,a,s?Error("react-stack-top-frame"):T,s?E(o(e)):$)}}()),v}var k=(d||(d=1,"production"===process.env.NODE_ENV?p.exports=function(){if(y)return m;y=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function t(r,t,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:e,type:r,key:o,ref:void 0!==t?t:null,props:n}}return m.Fragment=r,m.jsx=t,m.jsxs=t,m}():p.exports=g()),p.exports);const S=r({store:i}),j=({store:e,children:r})=>{const t=n((()=>({store:e??l()})),[e]);return k.jsx(S.Provider,{value:t,children:r})},h=()=>t(S),_=e=>{const{store:r}=h(),t=e(r),n=o(t),[c,i]=a(t.get());return s((()=>(t!==n.current&&(i(t.get()),n.current=t),t.subscribe(i))),[t]),c},O=e=>{const{store:r}=h();return e(r).set},w=e=>[_(e),O(e)],x=e=>{const r=_(e),[t,n]=a({type:"loading"});return s((()=>{let e=!0;return"loading"!==t.type&&n({type:"loading"}),r.then((r=>{e&&n({type:"ready",value:r})}),(r=>{e&&n({type:"error",reason:r?.message??"unknown"})})),()=>{e=!1}}),[r]),t},N=e=>{const{store:r}=h(),t=e(r);return c((()=>{u(t)}),[t])},R=e=>{const{store:r}=h(),t=e(r);return c((()=>{f(t)}),[t])};export{j as StanProvider,O as useSetStanValue,w as useStan,h as useStanCtx,N as useStanRefresher,R as useStanReset,_ as useStanValue,x as useStanValueAsync};
1
+ import{jsx as r}from"react/jsx-runtime";import{createContext as e,useContext as t,useMemo as o,useRef as n,useState as s,useEffect as a,useCallback as c}from"react";import{D as u,m as i,r as m,e as p}from"./store-C_86rrYV.js";const l=e({store:u}),d=({store:e,children:t})=>{const n=o((()=>({store:e??i()})),[e]);return r(l.Provider,{value:n,children:t})},g=()=>t(l),y=r=>{const{store:e}=g(),t=r(e),o=n(t),[c,u]=s(t.get());return a((()=>(t!==o.current&&(u(t.get()),o.current=t),t.subscribe(u))),[t]),c},f=r=>{const{store:e}=g();return r(e).set},h=r=>[y(r),f(r)],v=r=>{const e=y(r),[t,o]=s({type:"loading"});return a((()=>{let r=!0;return"loading"!==t.type&&o({type:"loading"}),e.then((e=>{r&&o({type:"ready",value:e})}),(e=>{r&&o({type:"error",reason:e?.message??"unknown"})})),()=>{r=!1}}),[e]),t},b=r=>{const{store:e}=g(),t=r(e);return c((()=>{m(t)}),[t])},j=r=>{const{store:e}=g(),t=r(e);return c((()=>{p(t)}),[t])};export{d as StanProvider,f as useSetStanValue,h as useStan,g as useStanCtx,b as useStanRefresher,j as useStanReset,y as useStanValue,v as useStanValueAsync};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rkrupinski/stan",
3
3
  "description": "Minimal, type-safe state management",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
@@ -1,4 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- export {};