@argon-router/react 0.1.1 → 0.1.3

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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),re=require("effector-react");var ee={exports:{}},$={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),re=require("effector-react");var ee={exports:{}},W={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Se;function pr(){if(Se)return $;Se=1;var d=K,g=Symbol.for("react.element"),E=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,v=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function h(m,s,x){var b,O={},S=null,V=null;x!==void 0&&(S=""+x),s.key!==void 0&&(S=""+s.key),s.ref!==void 0&&(V=s.ref);for(b in s)y.call(s,b)&&!w.hasOwnProperty(b)&&(O[b]=s[b]);if(m&&m.defaultProps)for(b in s=m.defaultProps,s)O[b]===void 0&&(O[b]=s[b]);return{$$typeof:g,type:m,key:S,ref:V,props:O,_owner:v.current}}return $.Fragment=E,$.jsx=h,$.jsxs=h,$}var L={};/**
9
+ */var je;function pr(){if(je)return W;je=1;var d=K,g=Symbol.for("react.element"),b=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,h=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S={key:!0,ref:!0,__self:!0,__source:!0};function m(E,u,T){var v,w={},j=null,V=null;T!==void 0&&(j=""+T),u.key!==void 0&&(j=""+u.key),u.ref!==void 0&&(V=u.ref);for(v in u)y.call(u,v)&&!S.hasOwnProperty(v)&&(w[v]=u[v]);if(E&&E.defaultProps)for(v in u=E.defaultProps,u)w[v]===void 0&&(w[v]=u[v]);return{$$typeof:g,type:E,key:j,ref:V,props:w,_owner:h.current}}return W.Fragment=b,W.jsx=m,W.jsxs=m,W}var L={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,17 +14,17 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var je;function yr(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var d=K,g=Symbol.for("react.element"),E=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),m=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),te=Symbol.iterator,ke="@@iterator";function De(e){if(e===null||typeof e!="object")return null;var r=te&&e[te]||e[ke];return typeof r=="function"?r:null}var k=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Fe("error",e,t)}}function Fe(e,r,t){{var n=k.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Ae=!1,Ie=!1,We=!1,$e=!1,Le=!1,ne;ne=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===w||Le||e===v||e===x||e===b||$e||e===V||Ae||Ie||We||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===O||e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===ne||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ae(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case E:return"Portal";case w:return"Profiler";case v:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ae(r)+".Consumer";case h:var t=e;return ae(t._context)+".Provider";case s:return Ye(e,e.render,"ForwardRef");case O:var n=e.displayName||null;return n!==null?n:T(e.type)||"Memo";case S:{var i=e,u=i._payload,o=i._init;try{return T(o(u))}catch{return null}}}return null}var j=Object.assign,A=0,oe,ie,ue,se,fe,le,ce;function de(){}de.__reactDisabledLog=!0;function Ue(){{if(A===0){oe=console.log,ie=console.info,ue=console.warn,se=console.error,fe=console.group,le=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function Me(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:oe}),info:j({},e,{value:ie}),warn:j({},e,{value:ue}),error:j({},e,{value:se}),group:j({},e,{value:fe}),groupCollapsed:j({},e,{value:le}),groupEnd:j({},e,{value:ce})})}A<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=k.ReactCurrentDispatcher,B;function Y(e,r,t){{if(B===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
18
- `+B+e}}var J=!1,U;{var Ne=typeof WeakMap=="function"?WeakMap:Map;U=new Ne}function ve(e,r){if(!e||J)return"";{var t=U.get(e);if(t!==void 0)return t}var n;J=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=q.current,q.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(R){n=R}Reflect.construct(e,[],o)}else{try{o.call()}catch(R){n=R}e.call(o.prototype)}}else{try{throw Error()}catch(R){n=R}e()}}catch(R){if(R&&n&&typeof R.stack=="string"){for(var a=R.stack.split(`
17
+ */var Ce;function yr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var d=K,g=Symbol.for("react.element"),b=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),E=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),ne=Symbol.iterator,ke="@@iterator";function De(e){if(e===null||typeof e!="object")return null;var r=ne&&e[ne]||e[ke];return typeof r=="function"?r:null}var k=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Fe("error",e,t)}}function Fe(e,r,t){{var n=k.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ae=!1,Ie=!1,$e=!1,We=!1,Le=!1,ae;ae=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===S||Le||e===h||e===T||e===v||We||e===V||Ae||Ie||$e||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===w||e.$$typeof===m||e.$$typeof===E||e.$$typeof===u||e.$$typeof===ae||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function oe(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case b:return"Portal";case S:return"Profiler";case h:return"StrictMode";case T:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return oe(r)+".Consumer";case m:var t=e;return oe(t._context)+".Provider";case u:return Ye(e,e.render,"ForwardRef");case w:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case j:{var i=e,s=i._payload,o=i._init;try{return P(o(s))}catch{return null}}}return null}var C=Object.assign,A=0,ie,ue,se,le,fe,ce,de;function ve(){}ve.__reactDisabledLog=!0;function Ue(){{if(A===0){ie=console.log,ue=console.info,se=console.warn,le=console.error,fe=console.group,ce=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function Me(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:ie}),info:C({},e,{value:ue}),warn:C({},e,{value:se}),error:C({},e,{value:le}),group:C({},e,{value:fe}),groupCollapsed:C({},e,{value:ce}),groupEnd:C({},e,{value:de})})}A<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=k.ReactCurrentDispatcher,B;function Y(e,r,t){{if(B===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
18
+ `+B+e}}var J=!1,U;{var Ne=typeof WeakMap=="function"?WeakMap:Map;U=new Ne}function pe(e,r){if(!e||J)return"";{var t=U.get(e);if(t!==void 0)return t}var n;J=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=q.current,q.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(R){n=R}Reflect.construct(e,[],o)}else{try{o.call()}catch(R){n=R}e.call(o.prototype)}}else{try{throw Error()}catch(R){n=R}e()}}catch(R){if(R&&n&&typeof R.stack=="string"){for(var a=R.stack.split(`
19
19
  `),p=n.stack.split(`
20
- `),f=a.length-1,l=p.length-1;f>=1&&l>=0&&a[f]!==p[l];)l--;for(;f>=1&&l>=0;f--,l--)if(a[f]!==p[l]){if(f!==1||l!==1)do if(f--,l--,l<0||a[f]!==p[l]){var _=`
21
- `+a[f].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,_),_}while(f>=1&&l>=0);break}}}finally{J=!1,q.current=u,Me(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",C=F?Y(F):"";return typeof e=="function"&&U.set(e,C),C}function Ke(e,r,t){return ve(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,qe(e));if(typeof e=="string")return Y(e);switch(e){case x:return Y("Suspense");case b:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return Ke(e.render);case O:return M(e.type,r,t);case S:{var n=e,i=n._payload,u=n._init;try{return M(u(i),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,pe={},ye=k.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Be(e,r,t,n,i){{var u=Function.call.bind(I);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){a=f}a&&!(a instanceof Error)&&(N(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),N(null)),a instanceof Error&&!(a.message in pe)&&(pe[a.message]=!0,N(i),c("Failed %s type: %s",t,a.message),N(null))}}}var Je=Array.isArray;function G(e){return Je(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ze(e){try{return Re(e),!1}catch{return!0}}function Re(e){return""+e}function ge(e){if(ze(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),Re(e)}var W=k.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},he,be,z;z={};function He(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&W.current&&r&&W.current.stateNode!==r){var t=T(W.current.type);z[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(W.current.type),e.ref),z[t]=!0)}}function er(e,r){{var t=function(){he||(he=!0,c("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){be||(be=!0,c("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,i,u,o){var a={$$typeof:g,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,i){{var u,o={},a=null,p=null;t!==void 0&&(ge(t),a=""+t),Ze(r)&&(ge(r.key),a=""+r.key),He(r)&&(p=r.ref,Qe(r,i));for(u in r)I.call(r,u)&&!Xe.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var f=e.defaultProps;for(u in f)o[u]===void 0&&(o[u]=f[u])}if(a||p){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(o,l),p&&rr(o,l)}return tr(e,a,p,i,n,W.current,o)}}var X=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function _e(){{if(X.current){var e=T(X.current.type);if(e)return`
20
+ `),l=a.length-1,f=p.length-1;l>=1&&f>=0&&a[l]!==p[f];)f--;for(;l>=1&&f>=0;l--,f--)if(a[l]!==p[f]){if(l!==1||f!==1)do if(l--,f--,f<0||a[l]!==p[f]){var _=`
21
+ `+a[l].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,_),_}while(l>=1&&f>=0);break}}}finally{J=!1,q.current=s,Me(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",x=F?Y(F):"";return typeof e=="function"&&U.set(e,x),x}function Ke(e,r,t){return pe(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,qe(e));if(typeof e=="string")return Y(e);switch(e){case T:return Y("Suspense");case v:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Ke(e.render);case w:return M(e.type,r,t);case j:{var n=e,i=n._payload,s=n._init;try{return M(s(i),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,ye={},Re=k.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}function Be(e,r,t,n,i){{var s=Function.call.bind(I);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(N(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),N(null)),a instanceof Error&&!(a.message in ye)&&(ye[a.message]=!0,N(i),c("Failed %s type: %s",t,a.message),N(null))}}}var Je=Array.isArray;function G(e){return Je(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ze(e){try{return ge(e),!1}catch{return!0}}function ge(e){return""+e}function he(e){if(ze(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),ge(e)}var $=k.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},be,Ee,z;z={};function He(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=P($.current.type);z[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P($.current.type),e.ref),z[t]=!0)}}function er(e,r){{var t=function(){be||(be=!0,c("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){Ee||(Ee=!0,c("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,i,s,o){var a={$$typeof:g,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,i){{var s,o={},a=null,p=null;t!==void 0&&(he(t),a=""+t),Ze(r)&&(he(r.key),a=""+r.key),He(r)&&(p=r.ref,Qe(r,i));for(s in r)I.call(r,s)&&!Xe.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)o[s]===void 0&&(o[s]=l[s])}if(a||p){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(o,f),p&&rr(o,f)}return tr(e,a,p,i,n,$.current,o)}}var X=k.ReactCurrentOwner,_e=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function me(){{if(X.current){var e=P(X.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function ar(e){return""}var me={};function or(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
23
+ Check the render method of \``+e+"`."}return""}}function ar(e){return""}var we={};function or(e){{var r=me();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
24
 
25
- Check the top-level render call using <`+t+">.")}return r}}function we(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(me[t])return;me[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+T(e._owner.type)+"."),D(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function Te(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&we(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=De(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)Z(o.value)&&we(o.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===s||r.$$typeof===O))t=r.propTypes;else return;if(t){var n=T(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var i=T(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Oe={};function Pe(e,r,t,n,i,u){{var o=Ve(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=ar();p?a+=p:a+=_e();var f;e===null?f="null":G(e)?f="array":e!==void 0&&e.$$typeof===g?(f="<"+(T(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,a)}var l=nr(e,r,t,i,u);if(l==null)return l;if(o){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var F=0;F<_.length;F++)Te(_[F],e);Object.freeze&&Object.freeze(_)}else c("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 Te(_,e)}if(I.call(r,"key")){var C=T(e),R=Object.keys(r).filter(function(vr){return vr!=="key"}),Q=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[C+Q]){var dr=R.length>0?"{"+R.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(we[t])return;we[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),D(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function Pe(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&Te(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=De(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)Z(o.value)&&Te(o.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===w))t=r.propTypes;else return;if(t){var n=P(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var i=P(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Oe={};function Se(e,r,t,n,i,s){{var o=Ve(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=ar();p?a+=p:a+=me();var l;e===null?l="null":G(e)?l="array":e!==void 0&&e.$$typeof===g?(l="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=nr(e,r,t,i,s);if(f==null)return f;if(o){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var F=0;F<_.length;F++)Pe(_[F],e);Object.freeze&&Object.freeze(_)}else c("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 Pe(_,e)}if(I.call(r,"key")){var x=P(e),R=Object.keys(r).filter(function(vr){return vr!=="key"}),Q=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[x+Q]){var dr=R.length>0?"{"+R.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Q,C,dr,C),Oe[C+Q]=!0}}return e===y?ur(l):ir(l),l}}function sr(e,r,t){return Pe(e,r,t,!0)}function fr(e,r,t){return Pe(e,r,t,!1)}var lr=fr,cr=sr;L.Fragment=y,L.jsx=lr,L.jsxs=cr}()),L}process.env.NODE_ENV==="production"?ee.exports=pr():ee.exports=yr();var P=ee.exports;const Ce=K.createContext(null),Rr=d=>P.jsx(Ce.Provider,{value:d.router,children:d.children});function xe(){const d=K.useContext(Ce);if(!d)throw new Error("[useRouter] Router not found. Insert RouterProvider in app root");return d}function gr(d){const{to:g,params:E,onClick:y,...v}=d,h=xe().mappedRoutes.find(({route:s})=>s===g),{onOpen:m}=re.useUnit(g);if(!h)throw new Error("[Link] Route not found. Maybe it is not passed into createRouter?");return P.jsx("a",{...v,href:h.toPath(E??void 0),onClick:s=>{y==null||y(s),!s.defaultPrevented&&(v.target&&v.target!=="_self"||s.metaKey||s.altKey||s.ctrlKey||s.shiftKey||(s.preventDefault(),m({params:E||{}})))}})}const hr=d=>()=>{const{view:g,layout:E,route:y}=d,{isOpened:v}=re.useUnit(y);return v?E?P.jsx(E,{children:P.jsx(g,{})}):P.jsx(g,{}):null},br=d=>{const{routes:g,otherwise:E}=d;return()=>{const y=g.map(({route:v,view:w,layout:h})=>{const{isOpened:m}=re.useUnit(v);return{view:w,layout:h,isOpened:m}});for(const v of y){if(!v.isOpened)continue;const{view:w,layout:h}=v;return h?P.jsx(h,{children:P.jsx(w,{})}):P.jsx(w,{})}return E?P.jsx(E,{}):null}};exports.Link=gr;exports.RouterProvider=Rr;exports.createRouteView=hr;exports.createRoutesView=br;exports.useRouter=xe;
30
+ <%s key={someKey} {...props} />`,Q,x,dr,x),Oe[x+Q]=!0}}return e===y?ur(f):ir(f),f}}function sr(e,r,t){return Se(e,r,t,!0)}function lr(e,r,t){return Se(e,r,t,!1)}var fr=lr,cr=sr;L.Fragment=y,L.jsx=fr,L.jsxs=cr}()),L}process.env.NODE_ENV==="production"?ee.exports=pr():ee.exports=yr();var O=ee.exports;const xe=K.createContext(null),Rr=d=>O.jsx(xe.Provider,{value:d.router,children:d.children});function te(){const d=K.useContext(xe);if(!d)throw new Error("[useRouter] Router not found. Insert RouterProvider in app root");return d}function gr(d){const{to:g,params:b,onClick:y,...h}=d,m=te().mappedRoutes.find(({route:u})=>u===g),{onOpen:E}=re.useUnit(g);if(!m)throw new Error("[Link] Route not found. Maybe it is not passed into createRouter?");return O.jsx("a",{...h,href:m.toPath(b??void 0),onClick:u=>{y==null||y(u),!u.defaultPrevented&&(h.target&&h.target!=="_self"||u.metaKey||u.altKey||u.ctrlKey||u.shiftKey||(u.preventDefault(),E({params:b||{}})))}})}const hr=d=>()=>{const{view:g,layout:b,route:y}=d,{isOpened:h}=re.useUnit(y);return h?b?O.jsx(b,{children:O.jsx(g,{})}):O.jsx(g,{}):null},br=d=>{const{routes:g,otherwise:b}=d;return()=>{const y=te(),h=re.useUnit(y.$activeRoutes),S=h.reduce((T,v)=>T.filter(w=>w!==v.internal.parent),h),m=g.find(T=>T.route===S.at(-1));if(!m)return b?O.jsx(b,{}):null;const{view:E,layout:u}=m;return u?O.jsx(u,{children:O.jsx(E,{})}):O.jsx(E,{})}};exports.Link=gr;exports.RouterProvider=Rr;exports.createRouteView=hr;exports.createRoutesView=br;exports.useRouter=te;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import Ce, { createContext as vr, useContext as pr } from "react";
1
+ import Ce, { createContext as pr, useContext as yr } from "react";
2
2
  import { useUnit as ee } from "effector-react";
3
- var Q = { exports: {} }, $ = {};
3
+ var Q = { exports: {} }, W = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -11,18 +11,18 @@ var Q = { exports: {} }, $ = {};
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
13
  var Pe;
14
- function yr() {
15
- if (Pe) return $;
14
+ function hr() {
15
+ if (Pe) return W;
16
16
  Pe = 1;
17
- var d = Ce, g = Symbol.for("react.element"), E = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, v = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function R(m, s, x) {
19
- var b, O = {}, j = null, L = null;
20
- x !== void 0 && (j = "" + x), s.key !== void 0 && (j = "" + s.key), s.ref !== void 0 && (L = s.ref);
21
- for (b in s) y.call(s, b) && !T.hasOwnProperty(b) && (O[b] = s[b]);
22
- if (m && m.defaultProps) for (b in s = m.defaultProps, s) O[b] === void 0 && (O[b] = s[b]);
23
- return { $$typeof: g, type: m, key: j, ref: L, props: O, _owner: v.current };
17
+ var d = Ce, R = Symbol.for("react.element"), b = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, g = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function m(E, u, w) {
19
+ var v, T = {}, C = null, L = null;
20
+ w !== void 0 && (C = "" + w), u.key !== void 0 && (C = "" + u.key), u.ref !== void 0 && (L = u.ref);
21
+ for (v in u) y.call(u, v) && !j.hasOwnProperty(v) && (T[v] = u[v]);
22
+ if (E && E.defaultProps) for (v in u = E.defaultProps, u) T[v] === void 0 && (T[v] = u[v]);
23
+ return { $$typeof: R, type: E, key: C, ref: L, props: T, _owner: g.current };
24
24
  }
25
- return $.Fragment = E, $.jsx = R, $.jsxs = R, $;
25
+ return W.Fragment = b, W.jsx = m, W.jsxs = m, W;
26
26
  }
27
27
  var Y = {};
28
28
  /**
@@ -35,13 +35,13 @@ var Y = {};
35
35
  * LICENSE file in the root directory of this source tree.
36
36
  */
37
37
  var je;
38
- function hr() {
38
+ function Rr() {
39
39
  return je || (je = 1, process.env.NODE_ENV !== "production" && function() {
40
- var d = Ce, g = Symbol.for("react.element"), E = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), m = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), re = Symbol.iterator, xe = "@@iterator";
41
- function ke(e) {
40
+ var d = Ce, R = Symbol.for("react.element"), b = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), E = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), re = Symbol.iterator, ke = "@@iterator";
41
+ function De(e) {
42
42
  if (e === null || typeof e != "object")
43
43
  return null;
44
- var r = re && e[re] || e[xe];
44
+ var r = re && e[re] || e[ke];
45
45
  return typeof r == "function" ? r : null;
46
46
  }
47
47
  var k = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
@@ -49,29 +49,29 @@ function hr() {
49
49
  {
50
50
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
51
51
  t[n - 1] = arguments[n];
52
- De("error", e, t);
52
+ Fe("error", e, t);
53
53
  }
54
54
  }
55
- function De(e, r, t) {
55
+ function Fe(e, r, t) {
56
56
  {
57
57
  var n = k.ReactDebugCurrentFrame, i = n.getStackAddendum();
58
58
  i !== "" && (r += "%s", t = t.concat([i]));
59
- var u = t.map(function(o) {
59
+ var s = t.map(function(o) {
60
60
  return String(o);
61
61
  });
62
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
62
+ s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
63
63
  }
64
64
  }
65
- var Fe = !1, Ae = !1, Ie = !1, We = !1, $e = !1, te;
65
+ var Ae = !1, Ie = !1, $e = !1, We = !1, Ye = !1, te;
66
66
  te = Symbol.for("react.module.reference");
67
- function Ye(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === y || e === T || $e || e === v || e === x || e === b || We || e === L || Fe || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === O || e.$$typeof === R || e.$$typeof === m || e.$$typeof === s || // This needs to include all possible module reference object
67
+ function Le(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === y || e === j || Ye || e === g || e === w || e === v || We || e === L || Ae || Ie || $e || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === T || e.$$typeof === m || e.$$typeof === E || e.$$typeof === u || // This needs to include all possible module reference object
69
69
  // types supported by any Flight configuration anywhere since
70
70
  // we don't know which Flight build this will end up being used
71
71
  // with.
72
72
  e.$$typeof === te || e.getModuleId !== void 0));
73
73
  }
74
- function Le(e, r, t) {
74
+ function Ve(e, r, t) {
75
75
  var n = e.displayName;
76
76
  if (n)
77
77
  return n;
@@ -81,7 +81,7 @@ function hr() {
81
81
  function ne(e) {
82
82
  return e.displayName || "Context";
83
83
  }
84
- function w(e) {
84
+ function O(e) {
85
85
  if (e == null)
86
86
  return null;
87
87
  if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
@@ -91,34 +91,34 @@ function hr() {
91
91
  switch (e) {
92
92
  case y:
93
93
  return "Fragment";
94
- case E:
94
+ case b:
95
95
  return "Portal";
96
- case T:
96
+ case j:
97
97
  return "Profiler";
98
- case v:
98
+ case g:
99
99
  return "StrictMode";
100
- case x:
100
+ case w:
101
101
  return "Suspense";
102
- case b:
102
+ case v:
103
103
  return "SuspenseList";
104
104
  }
105
105
  if (typeof e == "object")
106
106
  switch (e.$$typeof) {
107
- case m:
107
+ case E:
108
108
  var r = e;
109
109
  return ne(r) + ".Consumer";
110
- case R:
110
+ case m:
111
111
  var t = e;
112
112
  return ne(t._context) + ".Provider";
113
- case s:
114
- return Le(e, e.render, "ForwardRef");
115
- case O:
113
+ case u:
114
+ return Ve(e, e.render, "ForwardRef");
115
+ case T:
116
116
  var n = e.displayName || null;
117
- return n !== null ? n : w(e.type) || "Memo";
118
- case j: {
119
- var i = e, u = i._payload, o = i._init;
117
+ return n !== null ? n : O(e.type) || "Memo";
118
+ case C: {
119
+ var i = e, s = i._payload, o = i._init;
120
120
  try {
121
- return w(o(u));
121
+ return O(o(s));
122
122
  } catch {
123
123
  return null;
124
124
  }
@@ -126,11 +126,11 @@ function hr() {
126
126
  }
127
127
  return null;
128
128
  }
129
- var C = Object.assign, A = 0, ae, oe, ie, ue, se, fe, le;
129
+ var S = Object.assign, A = 0, ae, oe, ie, ue, se, fe, le;
130
130
  function ce() {
131
131
  }
132
132
  ce.__reactDisabledLog = !0;
133
- function Ve() {
133
+ function Me() {
134
134
  {
135
135
  if (A === 0) {
136
136
  ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, fe = console.groupCollapsed, le = console.groupEnd;
@@ -153,7 +153,7 @@ function hr() {
153
153
  A++;
154
154
  }
155
155
  }
156
- function Me() {
156
+ function Ue() {
157
157
  {
158
158
  if (A--, A === 0) {
159
159
  var e = {
@@ -162,25 +162,25 @@ function hr() {
162
162
  writable: !0
163
163
  };
164
164
  Object.defineProperties(console, {
165
- log: C({}, e, {
165
+ log: S({}, e, {
166
166
  value: ae
167
167
  }),
168
- info: C({}, e, {
168
+ info: S({}, e, {
169
169
  value: oe
170
170
  }),
171
- warn: C({}, e, {
171
+ warn: S({}, e, {
172
172
  value: ie
173
173
  }),
174
- error: C({}, e, {
174
+ error: S({}, e, {
175
175
  value: ue
176
176
  }),
177
- group: C({}, e, {
177
+ group: S({}, e, {
178
178
  value: se
179
179
  }),
180
- groupCollapsed: C({}, e, {
180
+ groupCollapsed: S({}, e, {
181
181
  value: fe
182
182
  }),
183
- groupEnd: C({}, e, {
183
+ groupEnd: S({}, e, {
184
184
  value: le
185
185
  })
186
186
  });
@@ -204,8 +204,8 @@ function hr() {
204
204
  }
205
205
  var J = !1, M;
206
206
  {
207
- var Ue = typeof WeakMap == "function" ? WeakMap : Map;
208
- M = new Ue();
207
+ var Ne = typeof WeakMap == "function" ? WeakMap : Map;
208
+ M = new Ne();
209
209
  }
210
210
  function de(e, r) {
211
211
  if (!e || J)
@@ -219,8 +219,8 @@ function hr() {
219
219
  J = !0;
220
220
  var i = Error.prepareStackTrace;
221
221
  Error.prepareStackTrace = void 0;
222
- var u;
223
- u = K.current, K.current = null, Ve();
222
+ var s;
223
+ s = K.current, K.current = null, Me();
224
224
  try {
225
225
  if (r) {
226
226
  var o = function() {
@@ -273,15 +273,15 @@ function hr() {
273
273
  }
274
274
  }
275
275
  } finally {
276
- J = !1, K.current = u, Me(), Error.prepareStackTrace = i;
276
+ J = !1, K.current = s, Ue(), Error.prepareStackTrace = i;
277
277
  }
278
- var F = e ? e.displayName || e.name : "", S = F ? V(F) : "";
279
- return typeof e == "function" && M.set(e, S), S;
278
+ var F = e ? e.displayName || e.name : "", x = F ? V(F) : "";
279
+ return typeof e == "function" && M.set(e, x), x;
280
280
  }
281
- function Ne(e, r, t) {
281
+ function Ke(e, r, t) {
282
282
  return de(e, !1);
283
283
  }
284
- function Ke(e) {
284
+ function Be(e) {
285
285
  var r = e.prototype;
286
286
  return !!(r && r.isReactComponent);
287
287
  }
@@ -289,25 +289,25 @@ function hr() {
289
289
  if (e == null)
290
290
  return "";
291
291
  if (typeof e == "function")
292
- return de(e, Ke(e));
292
+ return de(e, Be(e));
293
293
  if (typeof e == "string")
294
294
  return V(e);
295
295
  switch (e) {
296
- case x:
296
+ case w:
297
297
  return V("Suspense");
298
- case b:
298
+ case v:
299
299
  return V("SuspenseList");
300
300
  }
301
301
  if (typeof e == "object")
302
302
  switch (e.$$typeof) {
303
- case s:
304
- return Ne(e.render);
305
- case O:
303
+ case u:
304
+ return Ke(e.render);
305
+ case T:
306
306
  return U(e.type, r, t);
307
- case j: {
308
- var n = e, i = n._payload, u = n._init;
307
+ case C: {
308
+ var n = e, i = n._payload, s = n._init;
309
309
  try {
310
- return U(u(i), r, t);
310
+ return U(s(i), r, t);
311
311
  } catch {
312
312
  }
313
313
  }
@@ -322,11 +322,11 @@ function hr() {
322
322
  } else
323
323
  pe.setExtraStackFrame(null);
324
324
  }
325
- function Be(e, r, t, n, i) {
325
+ function Je(e, r, t, n, i) {
326
326
  {
327
- var u = Function.call.bind(I);
327
+ var s = Function.call.bind(I);
328
328
  for (var o in e)
329
- if (u(e, o)) {
329
+ if (s(e, o)) {
330
330
  var a = void 0;
331
331
  try {
332
332
  if (typeof e[o] != "function") {
@@ -341,17 +341,17 @@ function hr() {
341
341
  }
342
342
  }
343
343
  }
344
- var Je = Array.isArray;
344
+ var qe = Array.isArray;
345
345
  function q(e) {
346
- return Je(e);
346
+ return qe(e);
347
347
  }
348
- function qe(e) {
348
+ function Ge(e) {
349
349
  {
350
350
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
351
  return t;
352
352
  }
353
353
  }
354
- function Ge(e) {
354
+ function ze(e) {
355
355
  try {
356
356
  return ye(e), !1;
357
357
  } catch {
@@ -362,17 +362,17 @@ function hr() {
362
362
  return "" + e;
363
363
  }
364
364
  function he(e) {
365
- if (Ge(e))
366
- return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ye(e);
365
+ if (ze(e))
366
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), ye(e);
367
367
  }
368
- var W = k.ReactCurrentOwner, ze = {
368
+ var $ = k.ReactCurrentOwner, Xe = {
369
369
  key: !0,
370
370
  ref: !0,
371
371
  __self: !0,
372
372
  __source: !0
373
- }, ge, Re, G;
373
+ }, Re, ge, G;
374
374
  G = {};
375
- function Xe(e) {
375
+ function He(e) {
376
376
  if (I.call(e, "ref")) {
377
377
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
378
378
  if (r && r.isReactWarning)
@@ -380,7 +380,7 @@ function hr() {
380
380
  }
381
381
  return e.ref !== void 0;
382
382
  }
383
- function He(e) {
383
+ function Ze(e) {
384
384
  if (I.call(e, "key")) {
385
385
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
386
386
  if (r && r.isReactWarning)
@@ -388,16 +388,16 @@ function hr() {
388
388
  }
389
389
  return e.key !== void 0;
390
390
  }
391
- function Ze(e, r) {
392
- if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
393
- var t = w(W.current.type);
394
- G[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w(W.current.type), e.ref), G[t] = !0);
391
+ function Qe(e, r) {
392
+ if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
393
+ var t = O($.current.type);
394
+ G[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O($.current.type), e.ref), G[t] = !0);
395
395
  }
396
396
  }
397
- function Qe(e, r) {
397
+ function er(e, r) {
398
398
  {
399
399
  var t = function() {
400
- ge || (ge = !0, c("%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://reactjs.org/link/special-props)", r));
400
+ Re || (Re = !0, c("%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://reactjs.org/link/special-props)", r));
401
401
  };
402
402
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
403
403
  get: t,
@@ -405,10 +405,10 @@ function hr() {
405
405
  });
406
406
  }
407
407
  }
408
- function er(e, r) {
408
+ function rr(e, r) {
409
409
  {
410
410
  var t = function() {
411
- Re || (Re = !0, c("%s: `ref` 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://reactjs.org/link/special-props)", r));
411
+ ge || (ge = !0, c("%s: `ref` 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://reactjs.org/link/special-props)", r));
412
412
  };
413
413
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
414
414
  get: t,
@@ -416,17 +416,17 @@ function hr() {
416
416
  });
417
417
  }
418
418
  }
419
- var rr = function(e, r, t, n, i, u, o) {
419
+ var tr = function(e, r, t, n, i, s, o) {
420
420
  var a = {
421
421
  // This tag allows us to uniquely identify this as a React Element
422
- $$typeof: g,
422
+ $$typeof: R,
423
423
  // Built-in properties that belong on the element
424
424
  type: e,
425
425
  key: r,
426
426
  ref: t,
427
427
  props: o,
428
428
  // Record the component responsible for creating this element.
429
- _owner: u
429
+ _owner: s
430
430
  };
431
431
  return a._store = {}, Object.defineProperty(a._store, "validated", {
432
432
  configurable: !1,
@@ -445,22 +445,22 @@ function hr() {
445
445
  value: i
446
446
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
447
447
  };
448
- function tr(e, r, t, n, i) {
448
+ function nr(e, r, t, n, i) {
449
449
  {
450
- var u, o = {}, a = null, p = null;
451
- t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Xe(r) && (p = r.ref, Ze(r, i));
452
- for (u in r)
453
- I.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
450
+ var s, o = {}, a = null, p = null;
451
+ t !== void 0 && (he(t), a = "" + t), Ze(r) && (he(r.key), a = "" + r.key), He(r) && (p = r.ref, Qe(r, i));
452
+ for (s in r)
453
+ I.call(r, s) && !Xe.hasOwnProperty(s) && (o[s] = r[s]);
454
454
  if (e && e.defaultProps) {
455
455
  var f = e.defaultProps;
456
- for (u in f)
457
- o[u] === void 0 && (o[u] = f[u]);
456
+ for (s in f)
457
+ o[s] === void 0 && (o[s] = f[s]);
458
458
  }
459
459
  if (a || p) {
460
460
  var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
461
- a && Qe(o, l), p && er(o, l);
461
+ a && er(o, l), p && rr(o, l);
462
462
  }
463
- return rr(e, a, p, i, n, W.current, o);
463
+ return tr(e, a, p, i, n, $.current, o);
464
464
  }
465
465
  }
466
466
  var z = k.ReactCurrentOwner, be = k.ReactDebugCurrentFrame;
@@ -474,12 +474,12 @@ function hr() {
474
474
  var X;
475
475
  X = !1;
476
476
  function H(e) {
477
- return typeof e == "object" && e !== null && e.$$typeof === g;
477
+ return typeof e == "object" && e !== null && e.$$typeof === R;
478
478
  }
479
479
  function Ee() {
480
480
  {
481
481
  if (z.current) {
482
- var e = w(z.current.type);
482
+ var e = O(z.current.type);
483
483
  if (e)
484
484
  return `
485
485
 
@@ -488,11 +488,11 @@ Check the render method of \`` + e + "`.";
488
488
  return "";
489
489
  }
490
490
  }
491
- function nr(e) {
491
+ function ar(e) {
492
492
  return "";
493
493
  }
494
494
  var _e = {};
495
- function ar(e) {
495
+ function or(e) {
496
496
  {
497
497
  var r = Ee();
498
498
  if (!r) {
@@ -509,12 +509,12 @@ Check the top-level render call using <` + t + ">.");
509
509
  if (!e._store || e._store.validated || e.key != null)
510
510
  return;
511
511
  e._store.validated = !0;
512
- var t = ar(r);
512
+ var t = or(r);
513
513
  if (_e[t])
514
514
  return;
515
515
  _e[t] = !0;
516
516
  var n = "";
517
- e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + w(e._owner.type) + "."), D(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
517
+ e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + O(e._owner.type) + "."), D(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
518
518
  }
519
519
  }
520
520
  function Te(e, r) {
@@ -529,14 +529,14 @@ Check the top-level render call using <` + t + ">.");
529
529
  else if (H(e))
530
530
  e._store && (e._store.validated = !0);
531
531
  else if (e) {
532
- var i = ke(e);
532
+ var i = De(e);
533
533
  if (typeof i == "function" && i !== e.entries)
534
- for (var u = i.call(e), o; !(o = u.next()).done; )
534
+ for (var s = i.call(e), o; !(o = s.next()).done; )
535
535
  H(o.value) && me(o.value, r);
536
536
  }
537
537
  }
538
538
  }
539
- function or(e) {
539
+ function ir(e) {
540
540
  {
541
541
  var r = e.type;
542
542
  if (r == null || typeof r == "string")
@@ -544,24 +544,24 @@ Check the top-level render call using <` + t + ">.");
544
544
  var t;
545
545
  if (typeof r == "function")
546
546
  t = r.propTypes;
547
- else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
547
+ else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
548
548
  // Inner props are checked in the reconciler.
549
- r.$$typeof === O))
549
+ r.$$typeof === T))
550
550
  t = r.propTypes;
551
551
  else
552
552
  return;
553
553
  if (t) {
554
- var n = w(r);
555
- Be(t, e.props, "prop", n, e);
554
+ var n = O(r);
555
+ Je(t, e.props, "prop", n, e);
556
556
  } else if (r.PropTypes !== void 0 && !X) {
557
557
  X = !0;
558
- var i = w(r);
558
+ var i = O(r);
559
559
  c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
560
560
  }
561
561
  typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
562
562
  }
563
563
  }
564
- function ir(e) {
564
+ function ur(e) {
565
565
  {
566
566
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
567
567
  var n = r[t];
@@ -574,18 +574,18 @@ Check the top-level render call using <` + t + ">.");
574
574
  }
575
575
  }
576
576
  var we = {};
577
- function Oe(e, r, t, n, i, u) {
577
+ function Oe(e, r, t, n, i, s) {
578
578
  {
579
- var o = Ye(e);
579
+ var o = Le(e);
580
580
  if (!o) {
581
581
  var a = "";
582
582
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
583
- var p = nr();
583
+ var p = ar();
584
584
  p ? a += p : a += Ee();
585
585
  var f;
586
- e === null ? f = "null" : q(e) ? f = "array" : e !== void 0 && e.$$typeof === g ? (f = "<" + (w(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a);
586
+ e === null ? f = "null" : q(e) ? f = "array" : e !== void 0 && e.$$typeof === R ? (f = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a);
587
587
  }
588
- var l = tr(e, r, t, i, u);
588
+ var l = nr(e, r, t, i, s);
589
589
  if (l == null)
590
590
  return l;
591
591
  if (o) {
@@ -602,37 +602,37 @@ Check the top-level render call using <` + t + ">.");
602
602
  Te(_, e);
603
603
  }
604
604
  if (I.call(r, "key")) {
605
- var S = w(e), h = Object.keys(r).filter(function(dr) {
606
- return dr !== "key";
605
+ var x = O(e), h = Object.keys(r).filter(function(vr) {
606
+ return vr !== "key";
607
607
  }), Z = h.length > 0 ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}";
608
- if (!we[S + Z]) {
609
- var cr = h.length > 0 ? "{" + h.join(": ..., ") + ": ...}" : "{}";
608
+ if (!we[x + Z]) {
609
+ var dr = h.length > 0 ? "{" + h.join(": ..., ") + ": ...}" : "{}";
610
610
  c(`A props object containing a "key" prop is being spread into JSX:
611
611
  let props = %s;
612
612
  <%s {...props} />
613
613
  React keys must be passed directly to JSX without using spread:
614
614
  let props = %s;
615
- <%s key={someKey} {...props} />`, Z, S, cr, S), we[S + Z] = !0;
615
+ <%s key={someKey} {...props} />`, Z, x, dr, x), we[x + Z] = !0;
616
616
  }
617
617
  }
618
- return e === y ? ir(l) : or(l), l;
618
+ return e === y ? ur(l) : ir(l), l;
619
619
  }
620
620
  }
621
- function ur(e, r, t) {
621
+ function sr(e, r, t) {
622
622
  return Oe(e, r, t, !0);
623
623
  }
624
- function sr(e, r, t) {
624
+ function fr(e, r, t) {
625
625
  return Oe(e, r, t, !1);
626
626
  }
627
- var fr = sr, lr = ur;
628
- Y.Fragment = y, Y.jsx = fr, Y.jsxs = lr;
627
+ var lr = fr, cr = sr;
628
+ Y.Fragment = y, Y.jsx = lr, Y.jsxs = cr;
629
629
  }()), Y;
630
630
  }
631
- process.env.NODE_ENV === "production" ? Q.exports = yr() : Q.exports = hr();
631
+ process.env.NODE_ENV === "production" ? Q.exports = hr() : Q.exports = Rr();
632
632
  var P = Q.exports;
633
- const Se = vr(null), Er = (d) => /* @__PURE__ */ P.jsx(Se.Provider, { value: d.router, children: d.children });
634
- function gr() {
635
- const d = pr(Se);
633
+ const Se = pr(null), Er = (d) => /* @__PURE__ */ P.jsx(Se.Provider, { value: d.router, children: d.children });
634
+ function xe() {
635
+ const d = yr(Se);
636
636
  if (!d)
637
637
  throw new Error(
638
638
  "[useRouter] Router not found. Insert RouterProvider in app root"
@@ -640,43 +640,37 @@ function gr() {
640
640
  return d;
641
641
  }
642
642
  function _r(d) {
643
- const { to: g, params: E, onClick: y, ...v } = d, R = gr().mappedRoutes.find(({ route: s }) => s === g), { onOpen: m } = ee(g);
644
- if (!R)
643
+ const { to: R, params: b, onClick: y, ...g } = d, m = xe().mappedRoutes.find(({ route: u }) => u === R), { onOpen: E } = ee(R);
644
+ if (!m)
645
645
  throw new Error(
646
646
  "[Link] Route not found. Maybe it is not passed into createRouter?"
647
647
  );
648
648
  return /* @__PURE__ */ P.jsx(
649
649
  "a",
650
650
  {
651
- ...v,
652
- href: R.toPath(E ?? void 0),
653
- onClick: (s) => {
654
- y == null || y(s), !s.defaultPrevented && (v.target && v.target !== "_self" || s.metaKey || s.altKey || s.ctrlKey || s.shiftKey || (s.preventDefault(), m({ params: E || {} })));
651
+ ...g,
652
+ href: m.toPath(b ?? void 0),
653
+ onClick: (u) => {
654
+ y == null || y(u), !u.defaultPrevented && (g.target && g.target !== "_self" || u.metaKey || u.altKey || u.ctrlKey || u.shiftKey || (u.preventDefault(), E({ params: b || {} })));
655
655
  }
656
656
  }
657
657
  );
658
658
  }
659
659
  const mr = (d) => () => {
660
- const { view: g, layout: E, route: y } = d, { isOpened: v } = ee(y);
661
- return v ? E ? /* @__PURE__ */ P.jsx(E, { children: /* @__PURE__ */ P.jsx(g, {}) }) : /* @__PURE__ */ P.jsx(g, {}) : null;
660
+ const { view: R, layout: b, route: y } = d, { isOpened: g } = ee(y);
661
+ return g ? b ? /* @__PURE__ */ P.jsx(b, { children: /* @__PURE__ */ P.jsx(R, {}) }) : /* @__PURE__ */ P.jsx(R, {}) : null;
662
662
  }, Tr = (d) => {
663
- const { routes: g, otherwise: E } = d;
663
+ const { routes: R, otherwise: b } = d;
664
664
  return () => {
665
- const y = g.map(({ route: v, view: T, layout: R }) => {
666
- const { isOpened: m } = ee(v);
667
- return {
668
- view: T,
669
- layout: R,
670
- isOpened: m
671
- };
672
- });
673
- for (const v of y) {
674
- if (!v.isOpened)
675
- continue;
676
- const { view: T, layout: R } = v;
677
- return R ? /* @__PURE__ */ P.jsx(R, { children: /* @__PURE__ */ P.jsx(T, {}) }) : /* @__PURE__ */ P.jsx(T, {});
678
- }
679
- return E ? /* @__PURE__ */ P.jsx(E, {}) : null;
665
+ const y = xe(), g = ee(y.$activeRoutes), j = g.reduce((w, v) => w.filter(
666
+ (T) => T !== v.internal.parent
667
+ ), g), m = R.find(
668
+ (w) => w.route === j.at(-1)
669
+ );
670
+ if (!m)
671
+ return b ? /* @__PURE__ */ P.jsx(b, {}) : null;
672
+ const { view: E, layout: u } = m;
673
+ return u ? /* @__PURE__ */ P.jsx(u, { children: /* @__PURE__ */ P.jsx(E, {}) }) : /* @__PURE__ */ P.jsx(E, {});
680
674
  };
681
675
  };
682
676
  export {
@@ -684,5 +678,5 @@ export {
684
678
  Er as RouterProvider,
685
679
  mr as createRouteView,
686
680
  Tr as createRoutesView,
687
- gr as useRouter
681
+ xe as useRouter
688
682
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
7
7
  "private": false,
8
- "version": "0.1.1",
8
+ "version": "0.1.3",
9
9
  "description": "React bindings for argon router",
10
10
  "keywords": [
11
11
  "effector",
@@ -44,7 +44,7 @@
44
44
  "url": "https://github.com/movpushmov/argon-router/issues"
45
45
  },
46
46
  "dependencies": {
47
- "@argon-router/core": "^0.1.0"
47
+ "@argon-router/core": "^0.1.3"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/preset-react": "^7.24.1",
@@ -60,5 +60,5 @@
60
60
  "effector-react": "^23.2.1",
61
61
  "react": "^18.2.0"
62
62
  },
63
- "gitHead": "738d08af7dede9d39220c03153494bc467ffbeb7"
63
+ "gitHead": "1b46e0c9601dbefe0ba9c29b062237403e5502c3"
64
64
  }