@argon-router/react 0.1.4 → 0.2.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 +6 -6
- package/dist/index.d.ts +7 -1
- package/dist/index.js +110 -105
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -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 je;function pr(){if(je)return W;je=1;var
|
|
9
|
+
*/var je;function pr(){if(je)return W;je=1;var c=K,y=Symbol.for("react.element"),b=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,g=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S={key:!0,ref:!0,__self:!0,__source:!0};function m(E,i,T){var v,w={},j=null,V=null;T!==void 0&&(j=""+T),i.key!==void 0&&(j=""+i.key),i.ref!==void 0&&(V=i.ref);for(v in i)R.call(i,v)&&!S.hasOwnProperty(v)&&(w[v]=i[v]);if(E&&E.defaultProps)for(v in i=E.defaultProps,i)w[v]===void 0&&(w[v]=i[v]);return{$$typeof:y,type:E,key:j,ref:V,props:w,_owner:g.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 Ce;function yr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var
|
|
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
|
|
17
|
+
*/var Ce;function yr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var c=K,y=Symbol.for("react.element"),b=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),E=Symbol.for("react.context"),i=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=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(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,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));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===R||e===S||Le||e===g||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===i||e.$$typeof===ae||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function oe(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&d("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 R:return"Fragment";case b:return"Portal";case S:return"Profiler";case g: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 i:return Ye(e,e.render,"ForwardRef");case w:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case j:{var u=e,s=u._payload,o=u._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&&d("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(u){var n=u.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 u=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(h){n=h}Reflect.construct(e,[],o)}else{try{o.call()}catch(h){n=h}e.call(o.prototype)}}else{try{throw Error()}catch(h){n=h}e()}}catch(h){if(h&&n&&typeof h.stack=="string"){for(var a=h.stack.split(`
|
|
19
19
|
`),p=n.stack.split(`
|
|
20
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=
|
|
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=u}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 i:return Ke(e.render);case w:return M(e.type,r,t);case j:{var n=e,u=n._payload,s=n._init;try{return M(s(u),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,u){{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(u),d("%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(u),d("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 he(e),!1}catch{return!0}}function he(e){return""+e}function ge(e){if(ze(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),he(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]||(d('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,d("%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,d("%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,u,s,o){var a={$$typeof:y,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:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,u){{var s,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,u));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,u,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===y}function me(){{if(X.current){var e=P(X.current.type);if(e)return`
|
|
22
22
|
|
|
23
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 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),
|
|
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),d('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 u=De(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.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===i||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 u=P(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("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),d("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),d("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Oe={};function Se(e,r,t,n,u,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===y?(l="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,d("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,u,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 d("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),h=Object.keys(r).filter(function(vr){return vr!=="key"}),Q=h.length>0?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[x+Q]){var dr=h.length>0?"{"+h.join(": ..., ")+": ...}":"{}";d(`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,x,dr,x),Oe[x+Q]=!0}}return e===
|
|
30
|
+
<%s key={someKey} {...props} />`,Q,x,dr,x),Oe[x+Q]=!0}}return e===R?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=R,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=c=>O.jsx(xe.Provider,{value:c.router,children:c.children});function te(){const c=K.useContext(xe);if(!c)throw new Error("[useRouter] Router not found. Insert RouterProvider in app root");return c}function hr(c){const{to:y,params:b,onClick:R,...g}=c,m=te().mappedRoutes.find(({route:i})=>i===y),{onOpen:E}=re.useUnit(y);if(!m){const{internal:i}=y;throw new Error(`[Link] Route with path "${i.path}" not found. Maybe it is not passed into createRouter?`)}return O.jsx("a",{...g,href:m.toPath(b??void 0),onClick:i=>{R==null||R(i),!i.defaultPrevented&&(g.target&&g.target!=="_self"||i.metaKey||i.altKey||i.ctrlKey||i.shiftKey||(i.preventDefault(),E({params:b||{}})))}})}const gr=c=>({...c,view:()=>{const{view:y,layout:b,route:R}=c,{isOpened:g}=re.useUnit(R);return g?b?O.jsx(b,{children:O.jsx(y,{})}):O.jsx(y,{}):null}}),br=c=>{const{routes:y,otherwise:b}=c;return()=>{const R=te(),g=re.useUnit(R.$activeRoutes),S=g.reduce((T,v)=>T.filter(w=>w!==v.internal.parent),g),m=y.find(T=>T.route===S.at(-1));if(!m)return b?O.jsx(b,{}):null;const{view:E,layout:i}=m;return i?O.jsx(i,{children:O.jsx(E,{})}):O.jsx(E,{})}};exports.Link=hr;exports.RouterProvider=Rr;exports.createRouteView=gr;exports.createRoutesView=br;exports.useRouter=te;
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,13 @@ declare interface CreateRoutesViewProps {
|
|
|
19
19
|
otherwise?: ComponentType;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export declare const createRouteView: (props: CreateRouteViewProps) =>
|
|
22
|
+
export declare const createRouteView: (props: CreateRouteViewProps) => {
|
|
23
|
+
view: () => JSX_2.Element | null;
|
|
24
|
+
route: Route<any>;
|
|
25
|
+
layout?: ComponentType<{
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
23
29
|
|
|
24
30
|
declare interface CreateRouteViewProps {
|
|
25
31
|
route: Route<any>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ce, { createContext as pr, useContext as
|
|
1
|
+
import Ce, { createContext as pr, useContext as hr } from "react";
|
|
2
2
|
import { useUnit as ee } from "effector-react";
|
|
3
3
|
var Q = { exports: {} }, W = {};
|
|
4
4
|
/**
|
|
@@ -11,16 +11,16 @@ var Q = { exports: {} }, W = {};
|
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
13
|
var Pe;
|
|
14
|
-
function
|
|
14
|
+
function yr() {
|
|
15
15
|
if (Pe) return W;
|
|
16
16
|
Pe = 1;
|
|
17
|
-
var
|
|
18
|
-
function m(E,
|
|
19
|
-
var v,
|
|
20
|
-
|
|
21
|
-
for (v in
|
|
22
|
-
if (E && E.defaultProps) for (v in
|
|
23
|
-
return { $$typeof:
|
|
17
|
+
var c = Ce, h = Symbol.for("react.element"), b = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, g = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function m(E, i, T) {
|
|
19
|
+
var v, w = {}, C = null, L = null;
|
|
20
|
+
T !== void 0 && (C = "" + T), i.key !== void 0 && (C = "" + i.key), i.ref !== void 0 && (L = i.ref);
|
|
21
|
+
for (v in i) y.call(i, v) && !j.hasOwnProperty(v) && (w[v] = i[v]);
|
|
22
|
+
if (E && E.defaultProps) for (v in i = E.defaultProps, i) w[v] === void 0 && (w[v] = i[v]);
|
|
23
|
+
return { $$typeof: h, type: E, key: C, ref: L, props: w, _owner: g.current };
|
|
24
24
|
}
|
|
25
25
|
return W.Fragment = b, W.jsx = m, W.jsxs = m, W;
|
|
26
26
|
}
|
|
@@ -37,15 +37,15 @@ var Y = {};
|
|
|
37
37
|
var je;
|
|
38
38
|
function Rr() {
|
|
39
39
|
return je || (je = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
|
-
var
|
|
40
|
+
var c = Ce, h = 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"), i = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), re = Symbol.iterator, ke = "@@iterator";
|
|
41
41
|
function De(e) {
|
|
42
42
|
if (e === null || typeof e != "object")
|
|
43
43
|
return null;
|
|
44
44
|
var r = re && e[re] || e[ke];
|
|
45
45
|
return typeof r == "function" ? r : null;
|
|
46
46
|
}
|
|
47
|
-
var k =
|
|
48
|
-
function
|
|
47
|
+
var k = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function d(e) {
|
|
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];
|
|
@@ -54,8 +54,8 @@ function Rr() {
|
|
|
54
54
|
}
|
|
55
55
|
function Fe(e, r, t) {
|
|
56
56
|
{
|
|
57
|
-
var n = k.ReactDebugCurrentFrame,
|
|
58
|
-
|
|
57
|
+
var n = k.ReactDebugCurrentFrame, u = n.getStackAddendum();
|
|
58
|
+
u !== "" && (r += "%s", t = t.concat([u]));
|
|
59
59
|
var s = t.map(function(o) {
|
|
60
60
|
return String(o);
|
|
61
61
|
});
|
|
@@ -65,7 +65,7 @@ function Rr() {
|
|
|
65
65
|
var Ae = !1, Ie = !1, $e = !1, We = !1, Ye = !1, te;
|
|
66
66
|
te = Symbol.for("react.module.reference");
|
|
67
67
|
function Le(e) {
|
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e === y || e === j || Ye || e === g || e ===
|
|
68
|
+
return !!(typeof e == "string" || typeof e == "function" || e === y || e === j || Ye || e === g || e === T || e === v || We || e === L || Ae || Ie || $e || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === w || e.$$typeof === m || e.$$typeof === E || e.$$typeof === i || // 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.
|
|
@@ -75,8 +75,8 @@ function Rr() {
|
|
|
75
75
|
var n = e.displayName;
|
|
76
76
|
if (n)
|
|
77
77
|
return n;
|
|
78
|
-
var
|
|
79
|
-
return
|
|
78
|
+
var u = r.displayName || r.name || "";
|
|
79
|
+
return u !== "" ? t + "(" + u + ")" : t;
|
|
80
80
|
}
|
|
81
81
|
function ne(e) {
|
|
82
82
|
return e.displayName || "Context";
|
|
@@ -84,7 +84,7 @@ function Rr() {
|
|
|
84
84
|
function O(e) {
|
|
85
85
|
if (e == null)
|
|
86
86
|
return null;
|
|
87
|
-
if (typeof e.tag == "number" &&
|
|
87
|
+
if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
88
|
return e.displayName || e.name || null;
|
|
89
89
|
if (typeof e == "string")
|
|
90
90
|
return e;
|
|
@@ -97,7 +97,7 @@ function Rr() {
|
|
|
97
97
|
return "Profiler";
|
|
98
98
|
case g:
|
|
99
99
|
return "StrictMode";
|
|
100
|
-
case
|
|
100
|
+
case T:
|
|
101
101
|
return "Suspense";
|
|
102
102
|
case v:
|
|
103
103
|
return "SuspenseList";
|
|
@@ -110,13 +110,13 @@ function Rr() {
|
|
|
110
110
|
case m:
|
|
111
111
|
var t = e;
|
|
112
112
|
return ne(t._context) + ".Provider";
|
|
113
|
-
case
|
|
113
|
+
case i:
|
|
114
114
|
return Ve(e, e.render, "ForwardRef");
|
|
115
|
-
case
|
|
115
|
+
case w:
|
|
116
116
|
var n = e.displayName || null;
|
|
117
117
|
return n !== null ? n : O(e.type) || "Memo";
|
|
118
118
|
case C: {
|
|
119
|
-
var
|
|
119
|
+
var u = e, s = u._payload, o = u._init;
|
|
120
120
|
try {
|
|
121
121
|
return O(o(s));
|
|
122
122
|
} catch {
|
|
@@ -185,7 +185,7 @@ function Rr() {
|
|
|
185
185
|
})
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
A < 0 &&
|
|
188
|
+
A < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
var K = k.ReactCurrentDispatcher, B;
|
|
@@ -194,8 +194,8 @@ function Rr() {
|
|
|
194
194
|
if (B === void 0)
|
|
195
195
|
try {
|
|
196
196
|
throw Error();
|
|
197
|
-
} catch (
|
|
198
|
-
var n =
|
|
197
|
+
} catch (u) {
|
|
198
|
+
var n = u.stack.trim().match(/\n( *(at )?)/);
|
|
199
199
|
B = n && n[1] || "";
|
|
200
200
|
}
|
|
201
201
|
return `
|
|
@@ -217,7 +217,7 @@ function Rr() {
|
|
|
217
217
|
}
|
|
218
218
|
var n;
|
|
219
219
|
J = !0;
|
|
220
|
-
var
|
|
220
|
+
var u = Error.prepareStackTrace;
|
|
221
221
|
Error.prepareStackTrace = void 0;
|
|
222
222
|
var s;
|
|
223
223
|
s = K.current, K.current = null, Me();
|
|
@@ -233,29 +233,29 @@ function Rr() {
|
|
|
233
233
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
234
|
try {
|
|
235
235
|
Reflect.construct(o, []);
|
|
236
|
-
} catch (
|
|
237
|
-
n =
|
|
236
|
+
} catch (R) {
|
|
237
|
+
n = R;
|
|
238
238
|
}
|
|
239
239
|
Reflect.construct(e, [], o);
|
|
240
240
|
} else {
|
|
241
241
|
try {
|
|
242
242
|
o.call();
|
|
243
|
-
} catch (
|
|
244
|
-
n =
|
|
243
|
+
} catch (R) {
|
|
244
|
+
n = R;
|
|
245
245
|
}
|
|
246
246
|
e.call(o.prototype);
|
|
247
247
|
}
|
|
248
248
|
} else {
|
|
249
249
|
try {
|
|
250
250
|
throw Error();
|
|
251
|
-
} catch (
|
|
252
|
-
n =
|
|
251
|
+
} catch (R) {
|
|
252
|
+
n = R;
|
|
253
253
|
}
|
|
254
254
|
e();
|
|
255
255
|
}
|
|
256
|
-
} catch (
|
|
257
|
-
if (
|
|
258
|
-
for (var a =
|
|
256
|
+
} catch (R) {
|
|
257
|
+
if (R && n && typeof R.stack == "string") {
|
|
258
|
+
for (var a = R.stack.split(`
|
|
259
259
|
`), p = n.stack.split(`
|
|
260
260
|
`), f = a.length - 1, l = p.length - 1; f >= 1 && l >= 0 && a[f] !== p[l]; )
|
|
261
261
|
l--;
|
|
@@ -273,7 +273,7 @@ function Rr() {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
} finally {
|
|
276
|
-
J = !1, K.current = s, Ue(), Error.prepareStackTrace =
|
|
276
|
+
J = !1, K.current = s, Ue(), Error.prepareStackTrace = u;
|
|
277
277
|
}
|
|
278
278
|
var F = e ? e.displayName || e.name : "", x = F ? V(F) : "";
|
|
279
279
|
return typeof e == "function" && M.set(e, x), x;
|
|
@@ -293,21 +293,21 @@ function Rr() {
|
|
|
293
293
|
if (typeof e == "string")
|
|
294
294
|
return V(e);
|
|
295
295
|
switch (e) {
|
|
296
|
-
case
|
|
296
|
+
case T:
|
|
297
297
|
return V("Suspense");
|
|
298
298
|
case v:
|
|
299
299
|
return V("SuspenseList");
|
|
300
300
|
}
|
|
301
301
|
if (typeof e == "object")
|
|
302
302
|
switch (e.$$typeof) {
|
|
303
|
-
case
|
|
303
|
+
case i:
|
|
304
304
|
return Ke(e.render);
|
|
305
|
-
case
|
|
305
|
+
case w:
|
|
306
306
|
return U(e.type, r, t);
|
|
307
307
|
case C: {
|
|
308
|
-
var n = e,
|
|
308
|
+
var n = e, u = n._payload, s = n._init;
|
|
309
309
|
try {
|
|
310
|
-
return U(s(
|
|
310
|
+
return U(s(u), r, t);
|
|
311
311
|
} catch {
|
|
312
312
|
}
|
|
313
313
|
}
|
|
@@ -322,7 +322,7 @@ function Rr() {
|
|
|
322
322
|
} else
|
|
323
323
|
pe.setExtraStackFrame(null);
|
|
324
324
|
}
|
|
325
|
-
function Je(e, r, t, n,
|
|
325
|
+
function Je(e, r, t, n, u) {
|
|
326
326
|
{
|
|
327
327
|
var s = Function.call.bind(I);
|
|
328
328
|
for (var o in e)
|
|
@@ -337,7 +337,7 @@ function Rr() {
|
|
|
337
337
|
} catch (f) {
|
|
338
338
|
a = f;
|
|
339
339
|
}
|
|
340
|
-
a && !(a instanceof Error) && (N(
|
|
340
|
+
a && !(a instanceof Error) && (N(u), d("%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 ve) && (ve[a.message] = !0, N(u), d("Failed %s type: %s", t, a.message), N(null));
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
}
|
|
@@ -353,17 +353,17 @@ function Rr() {
|
|
|
353
353
|
}
|
|
354
354
|
function ze(e) {
|
|
355
355
|
try {
|
|
356
|
-
return
|
|
356
|
+
return he(e), !1;
|
|
357
357
|
} catch {
|
|
358
358
|
return !0;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function he(e) {
|
|
362
362
|
return "" + e;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ye(e) {
|
|
365
365
|
if (ze(e))
|
|
366
|
-
return
|
|
366
|
+
return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), he(e);
|
|
367
367
|
}
|
|
368
368
|
var $ = k.ReactCurrentOwner, Xe = {
|
|
369
369
|
key: !0,
|
|
@@ -391,13 +391,13 @@ function Rr() {
|
|
|
391
391
|
function Qe(e, r) {
|
|
392
392
|
if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
|
|
393
393
|
var t = O($.current.type);
|
|
394
|
-
G[t] || (
|
|
394
|
+
G[t] || (d('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
397
|
function er(e, r) {
|
|
398
398
|
{
|
|
399
399
|
var t = function() {
|
|
400
|
-
Re || (Re = !0,
|
|
400
|
+
Re || (Re = !0, d("%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,
|
|
@@ -408,7 +408,7 @@ function Rr() {
|
|
|
408
408
|
function rr(e, r) {
|
|
409
409
|
{
|
|
410
410
|
var t = function() {
|
|
411
|
-
ge || (ge = !0,
|
|
411
|
+
ge || (ge = !0, d("%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,10 +416,10 @@ function Rr() {
|
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
var tr = function(e, r, t, n,
|
|
419
|
+
var tr = function(e, r, t, n, u, s, o) {
|
|
420
420
|
var a = {
|
|
421
421
|
// This tag allows us to uniquely identify this as a React Element
|
|
422
|
-
$$typeof:
|
|
422
|
+
$$typeof: h,
|
|
423
423
|
// Built-in properties that belong on the element
|
|
424
424
|
type: e,
|
|
425
425
|
key: r,
|
|
@@ -442,13 +442,13 @@ function Rr() {
|
|
|
442
442
|
configurable: !1,
|
|
443
443
|
enumerable: !1,
|
|
444
444
|
writable: !1,
|
|
445
|
-
value:
|
|
445
|
+
value: u
|
|
446
446
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
447
447
|
};
|
|
448
|
-
function nr(e, r, t, n,
|
|
448
|
+
function nr(e, r, t, n, u) {
|
|
449
449
|
{
|
|
450
450
|
var s, o = {}, a = null, p = null;
|
|
451
|
-
t !== void 0 && (
|
|
451
|
+
t !== void 0 && (ye(t), a = "" + t), Ze(r) && (ye(r.key), a = "" + r.key), He(r) && (p = r.ref, Qe(r, u));
|
|
452
452
|
for (s in r)
|
|
453
453
|
I.call(r, s) && !Xe.hasOwnProperty(s) && (o[s] = r[s]);
|
|
454
454
|
if (e && e.defaultProps) {
|
|
@@ -460,7 +460,7 @@ function Rr() {
|
|
|
460
460
|
var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
461
461
|
a && er(o, l), p && rr(o, l);
|
|
462
462
|
}
|
|
463
|
-
return tr(e, a, p,
|
|
463
|
+
return tr(e, a, p, u, n, $.current, o);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
var z = k.ReactCurrentOwner, be = k.ReactDebugCurrentFrame;
|
|
@@ -474,7 +474,7 @@ function Rr() {
|
|
|
474
474
|
var X;
|
|
475
475
|
X = !1;
|
|
476
476
|
function H(e) {
|
|
477
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
477
|
+
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
478
478
|
}
|
|
479
479
|
function Ee() {
|
|
480
480
|
{
|
|
@@ -514,10 +514,10 @@ Check the top-level render call using <` + 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 " + O(e._owner.type) + "."), D(e),
|
|
517
|
+
e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + O(e._owner.type) + "."), D(e), d('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
|
-
function
|
|
520
|
+
function we(e, r) {
|
|
521
521
|
{
|
|
522
522
|
if (typeof e != "object")
|
|
523
523
|
return;
|
|
@@ -529,9 +529,9 @@ 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
|
|
533
|
-
if (typeof
|
|
534
|
-
for (var s =
|
|
532
|
+
var u = De(e);
|
|
533
|
+
if (typeof u == "function" && u !== e.entries)
|
|
534
|
+
for (var s = u.call(e), o; !(o = s.next()).done; )
|
|
535
535
|
H(o.value) && me(o.value, r);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -544,9 +544,9 @@ 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 ===
|
|
547
|
+
else if (typeof r == "object" && (r.$$typeof === i || // Note: Memo only checks outer props here.
|
|
548
548
|
// Inner props are checked in the reconciler.
|
|
549
|
-
r.$$typeof ===
|
|
549
|
+
r.$$typeof === w))
|
|
550
550
|
t = r.propTypes;
|
|
551
551
|
else
|
|
552
552
|
return;
|
|
@@ -555,10 +555,10 @@ Check the top-level render call using <` + t + ">.");
|
|
|
555
555
|
Je(t, e.props, "prop", n, e);
|
|
556
556
|
} else if (r.PropTypes !== void 0 && !X) {
|
|
557
557
|
X = !0;
|
|
558
|
-
var
|
|
559
|
-
|
|
558
|
+
var u = O(r);
|
|
559
|
+
d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
560
560
|
}
|
|
561
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
561
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
function ur(e) {
|
|
@@ -566,15 +566,15 @@ Check the top-level render call using <` + t + ">.");
|
|
|
566
566
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
567
567
|
var n = r[t];
|
|
568
568
|
if (n !== "children" && n !== "key") {
|
|
569
|
-
D(e),
|
|
569
|
+
D(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
570
570
|
break;
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
e.ref !== null && (D(e),
|
|
573
|
+
e.ref !== null && (D(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
function Oe(e, r, t, n,
|
|
576
|
+
var Te = {};
|
|
577
|
+
function Oe(e, r, t, n, u, s) {
|
|
578
578
|
{
|
|
579
579
|
var o = Le(e);
|
|
580
580
|
if (!o) {
|
|
@@ -583,9 +583,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
583
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 ===
|
|
586
|
+
e === null ? f = "null" : q(e) ? f = "array" : e !== void 0 && e.$$typeof === h ? (f = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, d("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 = nr(e, r, t,
|
|
588
|
+
var l = nr(e, r, t, u, s);
|
|
589
589
|
if (l == null)
|
|
590
590
|
return l;
|
|
591
591
|
if (o) {
|
|
@@ -594,25 +594,25 @@ Check the top-level render call using <` + t + ">.");
|
|
|
594
594
|
if (n)
|
|
595
595
|
if (q(_)) {
|
|
596
596
|
for (var F = 0; F < _.length; F++)
|
|
597
|
-
|
|
597
|
+
we(_[F], e);
|
|
598
598
|
Object.freeze && Object.freeze(_);
|
|
599
599
|
} else
|
|
600
|
-
|
|
600
|
+
d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
601
601
|
else
|
|
602
|
-
|
|
602
|
+
we(_, e);
|
|
603
603
|
}
|
|
604
604
|
if (I.call(r, "key")) {
|
|
605
|
-
var x = O(e),
|
|
605
|
+
var x = O(e), R = Object.keys(r).filter(function(vr) {
|
|
606
606
|
return vr !== "key";
|
|
607
|
-
}), Z =
|
|
608
|
-
if (!
|
|
609
|
-
var dr =
|
|
610
|
-
|
|
607
|
+
}), Z = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
608
|
+
if (!Te[x + Z]) {
|
|
609
|
+
var dr = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
|
|
610
|
+
d(`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, x, dr, x),
|
|
615
|
+
<%s key={someKey} {...props} />`, Z, x, dr, x), Te[x + Z] = !0;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
return e === y ? ur(l) : ir(l), l;
|
|
@@ -628,55 +628,60 @@ React keys must be passed directly to JSX without using spread:
|
|
|
628
628
|
Y.Fragment = y, Y.jsx = lr, Y.jsxs = cr;
|
|
629
629
|
}()), Y;
|
|
630
630
|
}
|
|
631
|
-
process.env.NODE_ENV === "production" ? Q.exports =
|
|
631
|
+
process.env.NODE_ENV === "production" ? Q.exports = yr() : Q.exports = Rr();
|
|
632
632
|
var P = Q.exports;
|
|
633
|
-
const Se = pr(null), Er = (
|
|
633
|
+
const Se = pr(null), Er = (c) => /* @__PURE__ */ P.jsx(Se.Provider, { value: c.router, children: c.children });
|
|
634
634
|
function xe() {
|
|
635
|
-
const
|
|
636
|
-
if (!
|
|
635
|
+
const c = hr(Se);
|
|
636
|
+
if (!c)
|
|
637
637
|
throw new Error(
|
|
638
638
|
"[useRouter] Router not found. Insert RouterProvider in app root"
|
|
639
639
|
);
|
|
640
|
-
return
|
|
640
|
+
return c;
|
|
641
641
|
}
|
|
642
|
-
function _r(
|
|
643
|
-
const { to:
|
|
644
|
-
if (!m)
|
|
642
|
+
function _r(c) {
|
|
643
|
+
const { to: h, params: b, onClick: y, ...g } = c, m = xe().mappedRoutes.find(({ route: i }) => i === h), { onOpen: E } = ee(h);
|
|
644
|
+
if (!m) {
|
|
645
|
+
const { internal: i } = h;
|
|
645
646
|
throw new Error(
|
|
646
|
-
|
|
647
|
+
`[Link] Route with path "${i.path}" not found. Maybe it is not passed into createRouter?`
|
|
647
648
|
);
|
|
649
|
+
}
|
|
648
650
|
return /* @__PURE__ */ P.jsx(
|
|
649
651
|
"a",
|
|
650
652
|
{
|
|
651
653
|
...g,
|
|
652
654
|
href: m.toPath(b ?? void 0),
|
|
653
|
-
onClick: (
|
|
654
|
-
y == null || y(
|
|
655
|
+
onClick: (i) => {
|
|
656
|
+
y == null || y(i), !i.defaultPrevented && (g.target && g.target !== "_self" || i.metaKey || i.altKey || i.ctrlKey || i.shiftKey || (i.preventDefault(), E({ params: b || {} })));
|
|
655
657
|
}
|
|
656
658
|
}
|
|
657
659
|
);
|
|
658
660
|
}
|
|
659
|
-
const mr = (
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
},
|
|
663
|
-
|
|
661
|
+
const mr = (c) => ({
|
|
662
|
+
...c,
|
|
663
|
+
view: () => {
|
|
664
|
+
const { view: h, layout: b, route: y } = c, { isOpened: g } = ee(y);
|
|
665
|
+
return g ? b ? /* @__PURE__ */ P.jsx(b, { children: /* @__PURE__ */ P.jsx(h, {}) }) : /* @__PURE__ */ P.jsx(h, {}) : null;
|
|
666
|
+
}
|
|
667
|
+
}), wr = (c) => {
|
|
668
|
+
const { routes: h, otherwise: b } = c;
|
|
664
669
|
return () => {
|
|
665
|
-
const y = xe(), g = ee(y.$activeRoutes), j = g.reduce((
|
|
666
|
-
(
|
|
667
|
-
), g), m =
|
|
668
|
-
(
|
|
670
|
+
const y = xe(), g = ee(y.$activeRoutes), j = g.reduce((T, v) => T.filter(
|
|
671
|
+
(w) => w !== v.internal.parent
|
|
672
|
+
), g), m = h.find(
|
|
673
|
+
(T) => T.route === j.at(-1)
|
|
669
674
|
);
|
|
670
675
|
if (!m)
|
|
671
676
|
return b ? /* @__PURE__ */ P.jsx(b, {}) : null;
|
|
672
|
-
const { view: E, layout:
|
|
673
|
-
return
|
|
677
|
+
const { view: E, layout: i } = m;
|
|
678
|
+
return i ? /* @__PURE__ */ P.jsx(i, { children: /* @__PURE__ */ P.jsx(E, {}) }) : /* @__PURE__ */ P.jsx(E, {});
|
|
674
679
|
};
|
|
675
680
|
};
|
|
676
681
|
export {
|
|
677
682
|
_r as Link,
|
|
678
683
|
Er as RouterProvider,
|
|
679
684
|
mr as createRouteView,
|
|
680
|
-
|
|
685
|
+
wr as createRoutesView,
|
|
681
686
|
xe as useRouter
|
|
682
687
|
};
|
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.2.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.2.0"
|
|
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": "
|
|
63
|
+
"gitHead": "87c99f95636135abeea69f7b870f2b54f6af8850"
|
|
64
64
|
}
|