@argon-router/react 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),ge=require("effector-react");var N={exports:{}},S={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.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
|
|
9
|
+
*/var ve;function Oe(){if(ve)return S;ve=1;var a=Symbol.for("react.transitional.element"),v=Symbol.for("react.fragment");function s(b,l,i){var E=null;if(i!==void 0&&(E=""+i),l.key!==void 0&&(E=""+l.key),"key"in l){i={};for(var m in l)m!=="key"&&(i[m]=l[m])}else i=l;return l=i.ref,{$$typeof:a,type:b,key:E,ref:l!==void 0?l:null,props:i}}return S.Fragment=v,S.jsx=s,S.jsxs=s,S}var O={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,18 +14,18 @@
|
|
|
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
|
|
17
|
+
*/var Ee;function Ae(){return Ee||(Ee=1,process.env.NODE_ENV!=="production"&&function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case Te:return"Portal";case I:return"Profiler";case K:return"StrictMode";case V:return"Suspense";case W:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Q:return(e.displayName||"Context")+".Provider";case Z:return(e._context.displayName||"Context")+".Consumer";case $:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case q:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function v(e){return""+e}function s(e){try{v(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),v(e)}}function b(){}function l(){if(p===0){re=console.log,te=console.info,oe=console.warn,ne=console.error,ae=console.group,ue=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:b,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}p++}function i(){if(p--,p===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:h({},e,{value:re}),info:h({},e,{value:te}),warn:h({},e,{value:oe}),error:h({},e,{value:ne}),group:h({},e,{value:ae}),groupCollapsed:h({},e,{value:ue}),groupEnd:h({},e,{value:se})})}0>p&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function E(e){if(J===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);J=r&&r[1]||"",le=-1<t.stack.indexOf(`
|
|
18
18
|
at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+J+e+
|
|
19
|
+
`+J+e+le}function m(e,r){if(!e||L)return"";var t=G.get(e);if(t!==void 0)return t;L=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var n=null;n=_.H,_.H=null,l();try{var c={DetermineComponentFrameRoot:function(){try{if(r){var x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(w){var A=w}Reflect.construct(e,[],x)}else{try{x.call()}catch(w){A=w}e.call(x.prototype)}}else{try{throw Error()}catch(w){A=w}(x=e())&&typeof x.catch=="function"&&x.catch(function(){})}}catch(w){if(w&&A&&typeof w.stack=="string")return[w.stack,A.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=c.DetermineComponentFrameRoot(),R=o[0],k=o[1];if(R&&k){var f=R.split(`
|
|
20
20
|
`),T=k.split(`
|
|
21
21
|
`);for(o=u=0;u<f.length&&!f[u].includes("DetermineComponentFrameRoot");)u++;for(;o<T.length&&!T[o].includes("DetermineComponentFrameRoot");)o++;if(u===f.length||o===T.length)for(u=f.length-1,o=T.length-1;1<=u&&0<=o&&f[u]!==T[o];)o--;for(;1<=u&&0<=o;u--,o--)if(f[u]!==T[o]){if(u!==1||o!==1)do if(u--,o--,0>o||f[u]!==T[o]){var C=`
|
|
22
|
-
`+f[u].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,C),C}while(1<=u&&0<=o);break}}}finally{L=!1,_.H=n,i(),Error.prepareStackTrace=t}return f=(f=e?e.displayName||e.name:"")?E(f):"",typeof e=="function"&&G.set(e,f),f}function j(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return m(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return E(e);switch(e){case V:return E("Suspense");case W:return E("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case $:return e=m(e.render,!1),e;case U:return j(e.type);case q:r=e._payload,e=e._init;try{return j(e(r))}catch{}}return""}function g(){var e=_.A;return e===null?null:e.getOwner()}function we(e){if(
|
|
22
|
+
`+f[u].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,C),C}while(1<=u&&0<=o);break}}}finally{L=!1,_.H=n,i(),Error.prepareStackTrace=t}return f=(f=e?e.displayName||e.name:"")?E(f):"",typeof e=="function"&&G.set(e,f),f}function j(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return m(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return E(e);switch(e){case V:return E("Suspense");case W:return E("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case $:return e=m(e.render,!1),e;case U:return j(e.type);case q:r=e._payload,e=e._init;try{return j(e(r))}catch{}}return""}function g(){var e=_.A;return e===null?null:e.getOwner()}function we(e){if(ee.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function xe(e,r){function t(){ie||(ie=!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})}function ye(){var e=a(this.type);return ce[e]||(ce[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.")),e=this.props.ref,e!==void 0?e:null}function je(e,r,t,n,c,u){return t=u.ref,e={$$typeof:Y,type:e,key:r,props:u,_owner:c},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:ye}):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.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function H(e,r,t,n,c,u){if(typeof e=="string"||typeof e=="function"||e===M||e===I||e===K||e===V||e===W||e===ke||typeof e=="object"&&e!==null&&(e.$$typeof===q||e.$$typeof===U||e.$$typeof===Q||e.$$typeof===Z||e.$$typeof===$||e.$$typeof===Ce||e.getModuleId!==void 0)){var o=r.children;if(o!==void 0)if(n)if(z(o)){for(n=0;n<o.length;n++)X(o[n],e);Object.freeze&&Object.freeze(o)}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 X(o,e)}else o="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?n="null":z(e)?n="array":e!==void 0&&e.$$typeof===Y?(n="<"+(a(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,o);if(ee.call(r,"key")){o=a(e);var R=Object.keys(r).filter(function(f){return f!=="key"});n=0<R.length?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}",fe[o+n]||(R=0<R.length?"{"+R.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
23
|
let props = %s;
|
|
24
24
|
<%s {...props} />
|
|
25
25
|
React keys must be passed directly to JSX without using spread:
|
|
26
26
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,n,o,R,o),
|
|
27
|
+
<%s key={someKey} {...props} />`,n,o,R,o),fe[o+n]=!0)}if(o=null,t!==void 0&&(s(t),o=""+t),we(r)&&(s(r.key),o=""+r.key),"key"in r){t={};for(var k in r)k!=="key"&&(t[k]=r[k])}else t=r;return o&&xe(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),je(e,o,u,c,g(),t)}function X(e,r){if(typeof e=="object"&&e&&e.$$typeof!==Se){if(z(e))for(var t=0;t<e.length;t++){var n=e[t];P(n)&&B(n,r)}else if(P(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?t=null:(t=D&&e[D]||e["@@iterator"],t=typeof t=="function"?t:null),typeof t=="function"&&t!==e.entries&&(t=t.call(e),t!==e))for(;!(e=t.next()).done;)P(e.value)&&B(e.value,r)}}function P(e){return typeof e=="object"&&e!==null&&e.$$typeof===Y}function B(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=_e(r),!de[r])){de[r]=!0;var t="";e&&e._owner!=null&&e._owner!==g()&&(t=null,typeof e._owner.tag=="number"?t=a(e._owner.type):typeof e._owner.name=="string"&&(t=e._owner.name),t=" It was passed a child from "+t+".");var n=_.getCurrentStack;_.getCurrentStack=function(){var c=j(e.type);return n&&(c+=n()||""),c},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,t),_.getCurrentStack=n}}function _e(e){var r="",t=g();return t&&(t=a(t.type))&&(r=`
|
|
28
28
|
|
|
29
29
|
Check the render method of \``+t+"`."),r||(e=a(e))&&(r=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+e+">."),r}var he=y,Y=Symbol.for("react.transitional.element"),Te=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),
|
|
31
|
+
Check the top-level render call using <`+e+">."),r}var he=y,Y=Symbol.for("react.transitional.element"),Te=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),D=Symbol.iterator,pe=Symbol.for("react.client.reference"),_=he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=Object.prototype.hasOwnProperty,h=Object.assign,Ce=Symbol.for("react.client.reference"),z=Array.isArray,p=0,re,te,oe,ne,ae,ue,se;b.__reactDisabledLog=!0;var J,le,L=!1,G=new(typeof WeakMap=="function"?WeakMap:Map),Se=Symbol.for("react.client.reference"),ie,ce={},fe={},de={};O.Fragment=M,O.jsx=function(e,r,t,n,c){return H(e,r,t,!1,n,c)},O.jsxs=function(e,r,t,n,c){return H(e,r,t,!0,n,c)}}()),O}var be;function Ne(){return be||(be=1,process.env.NODE_ENV==="production"?N.exports=Oe():N.exports=Ae()),N.exports}var d=Ne();const me=y.createContext(null),Pe=a=>d.jsx(me.Provider,{value:a.router,children:a.children});function F(){const a=y.useContext(me);if(!a)throw new Error("[useRouter] Router not found. Add RouterProvider in app root");return a}function Re(){return ge.useUnit(F())}const Ye=y.forwardRef((a,v)=>{const{to:s,params:b,onClick:l,...i}=a,{mappedRoutes:E}=F(),m=E.find(({route:g})=>g===s),{onOpen:j}=ge.useUnit(s);if(!m)throw new Error(`[Link] Route with path "${s.path}" not found. Maybe it is not passed into createRouter?`);return d.jsx("a",{...i,ref:v,href:m.build(b??void 0),onClick:g=>{l==null||l(g),!g.defaultPrevented&&(i.target&&i.target!=="_self"||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey||(g.preventDefault(),j({params:b||{}})))}})}),Me=a=>({route:a.route,view:()=>{const{view:v,layout:s}=a;return s?d.jsx(s,{children:d.jsx(v,{})}):d.jsx(v,{})}}),$e=a=>{const{routes:v,otherwise:s}=a;return()=>{const{activeRoutes:b}=Re(),l=b.reduce((E,m)=>E.filter(j=>j!==m.parent),b),i=v.find(E=>E.route===l.at(-1));return i?y.createElement(i.view):s?d.jsx(s,{}):null}},Ve=a=>{a.route.internal.setAsyncImport(a.view);const v=y.lazy(a.view);return{route:a.route,view:()=>{const{layout:s,fallback:b=()=>d.jsx(d.Fragment,{})}=a;return s?d.jsx(s,{children:d.jsx(y.Suspense,{fallback:d.jsx(b,{}),children:d.jsx(v,{})})}):d.jsx(y.Suspense,{fallback:d.jsx(b,{}),children:d.jsx(v,{})})}}};exports.Link=Ye;exports.RouterProvider=Pe;exports.createLazyRouteView=Ve;exports.createRouteView=Me;exports.createRoutesView=$e;exports.useRouter=Re;exports.useRouterContext=F;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.8.0",
|
|
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.
|
|
47
|
+
"@argon-router/core": "^0.8.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/preset-react": "^7.26.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"effector-react": ">=23",
|
|
60
60
|
"react": "18 || 19"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "1865adb15d9a326bc13d7b4f4a25ef63d14c63ee"
|
|
63
63
|
}
|