@argon-router/react 0.11.2 → 1.0.0-rc.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/README.md +0 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +63 -14
- package/dist/index.js +128 -82
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Router without a headache
|
|
4
4
|
|
|
5
|
-
> [!WARNING]
|
|
6
|
-
> argon-router is not production ready yet and still may have bugs and unstable API. If you found bug — please report it on GitHub.
|
|
7
|
-
|
|
8
5
|
## Documentation
|
|
9
6
|
|
|
10
7
|
For additional information, guides and api reference visit [documentation site](https://movpushmov.dev/argon-router/)
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("react"),h=require("effector-react"),w=require("@argon-router/core"),p=require("effector"),b=u.createContext(null),j=u.createContext(null),g=e=>o.jsx(b.Provider,{value:e.router,children:e.children});function x(){const e=u.useContext(b);if(!e)throw new Error("[useRouter] Router not found. Add RouterProvider in app root");return e}function k(){return h.useUnit(x())}function V(e,t){const{knownRoutes:n}=x(),r=n.find(({route:s})=>s===e),{onOpen:i}=h.useUnit(e);if(!r)throw console.error("[useLink route log]",e),new Error("[useLink] Route not found. Maybe it is not passed into createRouter?");return{path:r.build(t??void 0),onOpen:i}}const m=u.forwardRef((e,t)=>{const{to:n,params:r,onClick:i,replace:s,query:c,...a}=e,{path:f,onOpen:d}=V(n,r);return o.jsx("a",{...a,ref:t,href:f,onClick:l=>{i?.(l),!l.defaultPrevented&&(a.target&&a.target!=="_self"||l.metaKey||l.altKey||l.ctrlKey||l.shiftKey||(l.preventDefault(),d({params:r||{},replace:s,query:c})))}})});function L(e){const{layout:t,view:n,children:r}=e,i=t?()=>o.jsx(t,{children:o.jsx(n,{})}):()=>o.jsx(n,{});return{route:e.route,view:i,children:r}}function y(e,t){return t?t.getState(e):e.getState()}function O(e,t){return e.map(n=>w.is.router(n.route)?y(n.route.$activeRoutes,t).length>0:y(n.route.$isOpened,t))}function v(e){const t=h.useProvidedScope(),[n,r]=u.useState(O(e,t));return u.useEffect(()=>{const i=[];for(const[s,c]of e.entries())if(w.is.router(c.route)){const a=c.route,f=p.createWatch({unit:a.$activeRoutes,scope:t??void 0,fn:d=>{r(l=>{const R=[...l];return R[s]=d.length>0,R})}});i.push(f)}else i.push(p.createWatch({unit:c.route.$isOpened,scope:t??void 0,fn:a=>{r(f=>{const d=[...f];return d[s]=a,d})}}));return()=>{for(const s of i)s.unsubscribe()}},[e,t]),u.useMemo(()=>{const i=e.filter((s,c)=>n[c]);return i.reduce((s,c)=>s.filter(a=>a.route!==c.route.parent),i)},[e,n])}const C=e=>{const{routes:t,otherwise:n}=e;return()=>{const r=v(t).at(-1);return r?o.jsx(j.Provider,{value:{children:r.children??[]},children:u.createElement(r.view)}):n?o.jsx(n,{}):null}};function P(e){e.route.internal.setAsyncImport(e.view);const t=u.lazy(e.view),{layout:n,fallback:r=()=>o.jsx(o.Fragment,{})}=e,i=n?()=>o.jsx(n,{children:o.jsx(u.Suspense,{fallback:o.jsx(r,{}),children:o.jsx(t,{})})}):()=>o.jsx(u.Suspense,{fallback:o.jsx(r,{}),children:o.jsx(t,{})});return{route:e.route,view:i}}function S(e,t){const n=e;return t.map(({route:r,view:i})=>({route:r,view:()=>o.jsx(n,{children:u.createElement(i)})}))}const q=()=>{const{children:e}=u.useContext(j)??{children:[]},t=v(e).at(-1);return t?u.createElement(t.view):null};function E(e){return w.is.router(e)?h.useUnit(e.$activeRoutes).length>0:h.useUnit(e.$isOpened)}exports.Link=m;exports.Outlet=q;exports.RouterProvider=g;exports.createLazyRouteView=P;exports.createRouteView=L;exports.createRoutesView=C;exports.useIsOpened=E;exports.useLink=V;exports.useOpenedViews=v;exports.useRouter=k;exports.useRouterContext=x;exports.withLayout=S;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes } from 'react';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
|
+
import { Equal } from 'effector-react';
|
|
3
4
|
import { FC } from 'react';
|
|
4
5
|
import { ForwardedRef } from 'react';
|
|
6
|
+
import { FunctionComponentElement } from 'react';
|
|
5
7
|
import { JSX } from 'react/jsx-runtime';
|
|
6
8
|
import { NavigatePayload } from '@argon-router/core';
|
|
7
9
|
import { OpenPayloadBase } from '@argon-router/core';
|
|
8
10
|
import { Query } from '@argon-router/core';
|
|
9
11
|
import { ReactNode } from 'react';
|
|
10
12
|
import { Route } from '@argon-router/core';
|
|
13
|
+
import { RouteOpenedPayload } from '@argon-router/core';
|
|
11
14
|
import { Router } from '@argon-router/core';
|
|
12
15
|
|
|
13
16
|
declare type AnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;
|
|
14
17
|
|
|
15
|
-
declare type BaseLinkProps<Params> = {
|
|
18
|
+
declare type BaseLinkProps<Params extends object | void = void> = {
|
|
16
19
|
to: Route<Params>;
|
|
17
20
|
children?: ReactNode;
|
|
18
21
|
} & AnchorProps & OpenPayloadBase;
|
|
19
22
|
|
|
20
|
-
declare interface CreateBaseRouteViewProps<T> {
|
|
21
|
-
route: Route<T
|
|
22
|
-
layout?:
|
|
23
|
-
|
|
24
|
-
}>;
|
|
23
|
+
declare interface CreateBaseRouteViewProps<T extends object | void = void> {
|
|
24
|
+
route: Route<T> | Router;
|
|
25
|
+
layout?: LayoutComponent;
|
|
26
|
+
children?: RouteViewWithLayout[];
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
@@ -48,9 +50,9 @@ declare interface CreateBaseRouteViewProps<T> {
|
|
|
48
50
|
* });
|
|
49
51
|
* ```
|
|
50
52
|
*/
|
|
51
|
-
export declare function createLazyRouteView<T>(props: CreateLazyRouteViewProps<T>): RouteView;
|
|
53
|
+
export declare function createLazyRouteView<T extends object | void = void>(props: CreateLazyRouteViewProps<T>): RouteView;
|
|
52
54
|
|
|
53
|
-
export declare interface CreateLazyRouteViewProps<T> extends CreateBaseRouteViewProps<T> {
|
|
55
|
+
export declare interface CreateLazyRouteViewProps<T extends object | void = void> extends CreateBaseRouteViewProps<T> {
|
|
54
56
|
view: () => Promise<{
|
|
55
57
|
default: ComponentType;
|
|
56
58
|
}>;
|
|
@@ -108,16 +110,20 @@ declare interface CreateRoutesViewProps {
|
|
|
108
110
|
* });
|
|
109
111
|
* ```
|
|
110
112
|
*/
|
|
111
|
-
export declare function createRouteView<T>(props: CreateRouteViewProps<T>): RouteView;
|
|
113
|
+
export declare function createRouteView<T extends object | void = void>(props: CreateRouteViewProps<T>): RouteView;
|
|
112
114
|
|
|
113
|
-
export declare interface CreateRouteViewProps<T> extends CreateBaseRouteViewProps<T> {
|
|
115
|
+
export declare interface CreateRouteViewProps<T extends object | void = void> extends CreateBaseRouteViewProps<T> {
|
|
114
116
|
view: ComponentType;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
declare type ForwardedLink = <Params = void>(props: LinkProps<Params> & {
|
|
119
|
+
declare type ForwardedLink = <Params extends object | void = void>(props: LinkProps<Params> & {
|
|
118
120
|
ref?: ForwardedRef<HTMLAnchorElement>;
|
|
119
121
|
}) => ReactNode;
|
|
120
122
|
|
|
123
|
+
declare type LayoutComponent = ComponentType<{
|
|
124
|
+
children: ReactNode;
|
|
125
|
+
}>;
|
|
126
|
+
|
|
121
127
|
/**
|
|
122
128
|
* @description Navigates user to provided route on click
|
|
123
129
|
* @link https://movpushmov.dev/argon-router/react/link.html
|
|
@@ -142,12 +148,41 @@ declare type ForwardedLink = <Params = void>(props: LinkProps<Params> & {
|
|
|
142
148
|
*/
|
|
143
149
|
export declare const Link: ForwardedLink;
|
|
144
150
|
|
|
145
|
-
export declare type LinkProps<Params> = Params extends Record<string, never> | void | undefined ? BaseLinkProps<Params> & {
|
|
151
|
+
export declare type LinkProps<Params extends object | void = void> = Params extends Record<string, never> | void | undefined ? BaseLinkProps<Params> & {
|
|
146
152
|
params?: Params;
|
|
147
153
|
} : BaseLinkProps<Params> & {
|
|
148
154
|
params: Params;
|
|
149
155
|
};
|
|
150
156
|
|
|
157
|
+
/**
|
|
158
|
+
* @description Outlet component for nested routes
|
|
159
|
+
* @link https://movpushmov.dev/argon-router/react/outlet.html
|
|
160
|
+
* @example ```ts
|
|
161
|
+
* export const RoutesView = createRoutesView([
|
|
162
|
+
* createRouteView({
|
|
163
|
+
* route: routes.profile,
|
|
164
|
+
* view: ProfileScreen,
|
|
165
|
+
* children: [
|
|
166
|
+
* createRouteView({ route: routes.settings, view: SettingsScreen }),
|
|
167
|
+
* ]
|
|
168
|
+
* }),
|
|
169
|
+
* ]);
|
|
170
|
+
*
|
|
171
|
+
* // profile.tsx
|
|
172
|
+
* export const ProfileScreen = () => {
|
|
173
|
+
* // will render settings screen when profile route is opened
|
|
174
|
+
* // and settings route is active
|
|
175
|
+
* return (
|
|
176
|
+
* <>
|
|
177
|
+
* <div>Profile</div>
|
|
178
|
+
* <Outlet />
|
|
179
|
+
* </>
|
|
180
|
+
* );
|
|
181
|
+
* };
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export declare const Outlet: () => FunctionComponentElement<{}> | null;
|
|
185
|
+
|
|
151
186
|
/**
|
|
152
187
|
* @description Provides router in React tree
|
|
153
188
|
* @param props Router provider config
|
|
@@ -160,10 +195,24 @@ declare interface RouterProviderProps {
|
|
|
160
195
|
}
|
|
161
196
|
|
|
162
197
|
export declare interface RouteView {
|
|
163
|
-
route: Route<any
|
|
198
|
+
route: Route<any> | Router;
|
|
164
199
|
view: FC;
|
|
200
|
+
children?: RouteView[];
|
|
165
201
|
}
|
|
166
202
|
|
|
203
|
+
declare type RouteViewWithLayout = RouteView & {
|
|
204
|
+
layout?: LayoutComponent;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export declare function useIsOpened(route: Route | Router): boolean;
|
|
208
|
+
|
|
209
|
+
export declare function useLink<T extends object | void = void>(to: Route<T>, params: T): {
|
|
210
|
+
path: string;
|
|
211
|
+
onOpen: Equal<RouteOpenedPayload<T>, void> extends true ? () => void : (payload: RouteOpenedPayload<T>) => RouteOpenedPayload<T>;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export declare function useOpenedViews(routes: RouteView[]): RouteView[];
|
|
215
|
+
|
|
167
216
|
/**
|
|
168
217
|
* @description Use router from provider
|
|
169
218
|
* @returns Router
|
|
@@ -210,7 +259,7 @@ export declare function useRouterContext(): Router;
|
|
|
210
259
|
export declare function withLayout(layout: ComponentType<{
|
|
211
260
|
children: ReactNode;
|
|
212
261
|
}>, views: RouteView[]): {
|
|
213
|
-
route: Route<any>;
|
|
262
|
+
route: Router | Route<any>;
|
|
214
263
|
view: () => JSX.Element;
|
|
215
264
|
}[];
|
|
216
265
|
|
package/dist/index.js
CHANGED
|
@@ -1,107 +1,153 @@
|
|
|
1
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, forwardRef, useMemo, createElement, lazy
|
|
3
|
-
import { useUnit } from "effector-react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as i, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as b, useContext as y, forwardRef as O, useState as P, useEffect as C, useMemo as S, createElement as h, lazy as $, Suspense as v } from "react";
|
|
3
|
+
import { useUnit as d, useProvidedScope as E } from "effector-react";
|
|
4
|
+
import { is as p } from "@argon-router/core";
|
|
5
|
+
import { createWatch as m } from "effector";
|
|
6
|
+
const V = b(null), g = b(
|
|
7
|
+
null
|
|
8
|
+
), j = (e) => /* @__PURE__ */ i(V.Provider, { value: e.router, children: e.children });
|
|
9
|
+
function k() {
|
|
10
|
+
const e = y(V);
|
|
11
|
+
if (!e)
|
|
11
12
|
throw new Error(
|
|
12
13
|
"[useRouter] Router not found. Add RouterProvider in app root"
|
|
13
14
|
);
|
|
14
|
-
|
|
15
|
-
return context;
|
|
15
|
+
return e;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function q() {
|
|
18
|
+
return d(k());
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
`[Link] Route with path "${to.path}" not found. Maybe it is not passed into createRouter?`
|
|
20
|
+
function K(e, t) {
|
|
21
|
+
const { knownRoutes: n } = k(), r = n.find(
|
|
22
|
+
({ route: u }) => u === e
|
|
23
|
+
), { onOpen: o } = d(e);
|
|
24
|
+
if (!r)
|
|
25
|
+
throw console.error("[useLink route log]", e), new Error(
|
|
26
|
+
"[useLink] Route not found. Maybe it is not passed into createRouter?"
|
|
28
27
|
);
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
return {
|
|
29
|
+
path: r.build(t ?? void 0),
|
|
30
|
+
onOpen: o
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const D = O((e, t) => {
|
|
34
|
+
const { to: n, params: r, onClick: o, replace: u, query: s, ...c } = e, { path: f, onOpen: a } = K(n, r);
|
|
35
|
+
return /* @__PURE__ */ i(
|
|
31
36
|
"a",
|
|
32
37
|
{
|
|
33
|
-
...
|
|
34
|
-
ref,
|
|
35
|
-
href:
|
|
36
|
-
onClick: (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
e.preventDefault();
|
|
48
|
-
onOpen({ params: params || {}, replace, query });
|
|
38
|
+
...c,
|
|
39
|
+
ref: t,
|
|
40
|
+
href: f,
|
|
41
|
+
onClick: (l) => {
|
|
42
|
+
o?.(l), !l.defaultPrevented && (c.target && c.target !== "_self" || l.metaKey || l.altKey || l.ctrlKey || l.shiftKey || (l.preventDefault(), a({
|
|
43
|
+
params: r || {},
|
|
44
|
+
replace: u,
|
|
45
|
+
query: s
|
|
46
|
+
})));
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
);
|
|
52
50
|
});
|
|
53
|
-
function
|
|
54
|
-
const { layout:
|
|
55
|
-
const view = Layout ? () => /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx(View, {}) }) : () => /* @__PURE__ */ jsx(View, {});
|
|
51
|
+
function N(e) {
|
|
52
|
+
const { layout: t, view: n, children: r } = e, o = t ? () => /* @__PURE__ */ i(t, { children: /* @__PURE__ */ i(n, {}) }) : () => /* @__PURE__ */ i(n, {});
|
|
56
53
|
return {
|
|
57
|
-
route:
|
|
58
|
-
view
|
|
54
|
+
route: e.route,
|
|
55
|
+
view: o,
|
|
56
|
+
children: r
|
|
59
57
|
};
|
|
60
58
|
}
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
function R(e, t) {
|
|
60
|
+
return t ? t.getState(e) : e.getState();
|
|
61
|
+
}
|
|
62
|
+
function F(e, t) {
|
|
63
|
+
return e.map((n) => p.router(n.route) ? R(n.route.$activeRoutes, t).length > 0 : R(n.route.$isOpened, t));
|
|
64
|
+
}
|
|
65
|
+
function x(e) {
|
|
66
|
+
const t = E(), [n, r] = P(
|
|
67
|
+
F(e, t)
|
|
68
|
+
);
|
|
69
|
+
return C(() => {
|
|
70
|
+
const o = [];
|
|
71
|
+
for (const [u, s] of e.entries())
|
|
72
|
+
if (p.router(s.route)) {
|
|
73
|
+
const c = s.route, f = m({
|
|
74
|
+
unit: c.$activeRoutes,
|
|
75
|
+
scope: t ?? void 0,
|
|
76
|
+
fn: (a) => {
|
|
77
|
+
r((l) => {
|
|
78
|
+
const w = [...l];
|
|
79
|
+
return w[u] = a.length > 0, w;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
o.push(f);
|
|
84
|
+
} else
|
|
85
|
+
o.push(
|
|
86
|
+
m({
|
|
87
|
+
unit: s.route.$isOpened,
|
|
88
|
+
scope: t ?? void 0,
|
|
89
|
+
fn: (c) => {
|
|
90
|
+
r((f) => {
|
|
91
|
+
const a = [...f];
|
|
92
|
+
return a[u] = c, a;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
return () => {
|
|
98
|
+
for (const u of o)
|
|
99
|
+
u.unsubscribe();
|
|
100
|
+
};
|
|
101
|
+
}, [e, t]), S(() => {
|
|
102
|
+
const o = e.filter((u, s) => n[s]);
|
|
103
|
+
return o.reduce(
|
|
104
|
+
(u, s) => u.filter(
|
|
105
|
+
(c) => c.route !== s.route.parent
|
|
106
|
+
),
|
|
107
|
+
o
|
|
108
|
+
);
|
|
109
|
+
}, [e, n]);
|
|
110
|
+
}
|
|
111
|
+
const U = (e) => {
|
|
112
|
+
const { routes: t, otherwise: n } = e;
|
|
63
113
|
return () => {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const filtered = routes.filter((_, i) => visibilities[i]);
|
|
67
|
-
return filtered.reduce(
|
|
68
|
-
(filtered2, view) => filtered2.filter(
|
|
69
|
-
(r) => r.route !== view.route.parent
|
|
70
|
-
),
|
|
71
|
-
filtered
|
|
72
|
-
);
|
|
73
|
-
}, [visibilities]);
|
|
74
|
-
const lastRoute = openedViews.at(-1);
|
|
75
|
-
if (!lastRoute) {
|
|
76
|
-
return NotFound ? /* @__PURE__ */ jsx(NotFound, {}) : null;
|
|
77
|
-
}
|
|
78
|
-
return createElement(lastRoute.view);
|
|
114
|
+
const r = x(t).at(-1);
|
|
115
|
+
return r ? /* @__PURE__ */ i(g.Provider, { value: { children: r.children ?? [] }, children: h(r.view) }) : n ? /* @__PURE__ */ i(n, {}) : null;
|
|
79
116
|
};
|
|
80
117
|
};
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const { layout: Layout, fallback: Fallback = () => /* @__PURE__ */ jsx(Fragment, {}) } = props;
|
|
85
|
-
const view = Layout ? () => /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Fallback, {}), children: /* @__PURE__ */ jsx(View, {}) }) }) : () => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Fallback, {}), children: /* @__PURE__ */ jsx(View, {}) });
|
|
118
|
+
function W(e) {
|
|
119
|
+
e.route.internal.setAsyncImport(e.view);
|
|
120
|
+
const t = $(e.view), { layout: n, fallback: r = () => /* @__PURE__ */ i(L, {}) } = e, o = n ? () => /* @__PURE__ */ i(n, { children: /* @__PURE__ */ i(v, { fallback: /* @__PURE__ */ i(r, {}), children: /* @__PURE__ */ i(t, {}) }) }) : () => /* @__PURE__ */ i(v, { fallback: /* @__PURE__ */ i(r, {}), children: /* @__PURE__ */ i(t, {}) });
|
|
86
121
|
return {
|
|
87
|
-
route:
|
|
88
|
-
view
|
|
122
|
+
route: e.route,
|
|
123
|
+
view: o
|
|
89
124
|
};
|
|
90
125
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
route,
|
|
95
|
-
view: () => /* @__PURE__ */
|
|
126
|
+
function B(e, t) {
|
|
127
|
+
const n = e;
|
|
128
|
+
return t.map(({ route: r, view: o }) => ({
|
|
129
|
+
route: r,
|
|
130
|
+
view: () => /* @__PURE__ */ i(n, { children: h(o) })
|
|
96
131
|
}));
|
|
97
132
|
}
|
|
133
|
+
const G = () => {
|
|
134
|
+
const { children: e } = y(g) ?? { children: [] }, t = x(e).at(-1);
|
|
135
|
+
return t ? h(t.view) : null;
|
|
136
|
+
};
|
|
137
|
+
function H(e) {
|
|
138
|
+
return p.router(e) ? d(e.$activeRoutes).length > 0 : d(e.$isOpened);
|
|
139
|
+
}
|
|
98
140
|
export {
|
|
99
|
-
Link,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
D as Link,
|
|
142
|
+
G as Outlet,
|
|
143
|
+
j as RouterProvider,
|
|
144
|
+
W as createLazyRouteView,
|
|
145
|
+
N as createRouteView,
|
|
146
|
+
U as createRoutesView,
|
|
147
|
+
H as useIsOpened,
|
|
148
|
+
K as useLink,
|
|
149
|
+
x as useOpenedViews,
|
|
150
|
+
q as useRouter,
|
|
151
|
+
k as useRouterContext,
|
|
152
|
+
B as withLayout
|
|
107
153
|
};
|
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": "1.0.0-rc.0",
|
|
9
9
|
"description": "React bindings for argon router",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"effector",
|
|
@@ -36,15 +36,11 @@
|
|
|
36
36
|
"type": "git",
|
|
37
37
|
"url": "git+https://github.com/movpushmov/argon-router.git"
|
|
38
38
|
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "vite build",
|
|
41
|
-
"test": "vitest run"
|
|
42
|
-
},
|
|
43
39
|
"bugs": {
|
|
44
40
|
"url": "https://github.com/movpushmov/argon-router/issues"
|
|
45
41
|
},
|
|
46
42
|
"dependencies": {
|
|
47
|
-
"@argon-router/core": "
|
|
43
|
+
"@argon-router/core": "1.0.0-rc.0"
|
|
48
44
|
},
|
|
49
45
|
"devDependencies": {
|
|
50
46
|
"@babel/preset-react": "^7.26.3",
|
|
@@ -52,6 +48,7 @@
|
|
|
52
48
|
"@testing-library/react": "^16.2.0",
|
|
53
49
|
"@testing-library/user-event": "^14.6.1",
|
|
54
50
|
"@vitejs/plugin-react": "^4.3.4",
|
|
51
|
+
"happy-dom": "^20.8.3",
|
|
55
52
|
"jsdom": "^25.0.1"
|
|
56
53
|
},
|
|
57
54
|
"peerDependencies": {
|
|
@@ -59,5 +56,9 @@
|
|
|
59
56
|
"effector-react": ">=23",
|
|
60
57
|
"react": "18 || 19"
|
|
61
58
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
-
|
|
59
|
+
"gitHead": "9832d6cd282d6abd33c26ba4d03b9a1176110fc4",
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "vite build",
|
|
62
|
+
"test": "vitest run"
|
|
63
|
+
}
|
|
64
|
+
}
|