@moneko/react 1.7.4 → 1.7.6
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/lib/activity.d.tsx +11 -0
- package/lib/activity.js +1 -0
- package/lib/index.d.ts +5 -4
- package/lib/index.js +1 -1
- package/lib/link.d.tsx +1 -1
- package/lib/parse-reserved-word.d.ts +2 -2
- package/lib/parse-reserved-word.js +1 -1
- package/lib/use-navgate.js +1 -1
- package/lib/use-query.d.ts +1 -1
- package/lib/use-query.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ActivityMode = 'visible' | 'hidden';
|
|
3
|
+
export interface ActivityProps {
|
|
4
|
+
mode: ActivityMode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
type ActivityComponent = React.ExoticComponent<ActivityProps>;
|
|
8
|
+
declare const ReactActivity: ActivityComponent | null;
|
|
9
|
+
declare const Repeater: React.FC<ActivityProps>;
|
|
10
|
+
declare const Activity: React.FC<ActivityProps>;
|
|
11
|
+
export default Activity;
|
package/lib/activity.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import*as t from"react";let n="Activity"in t&&t.Activity||"unstable_Activity"in t&&t.unstable_Activity||null,r=e=>{let{mode:n,children:r}=e,l=t.useRef(null),u=t.useRef(null),i=t.useCallback(()=>{"function"==typeof u.current&&(u.current(),u.current=null,l.current=null)},[]);if(t.useEffect(()=>i,[i]),"hidden"===n){null===u.current&&(l.current=new Promise(e=>u.current=e));let e=l.current;if("use"in t&&"function"==typeof t.use)t.use(e);else throw e}return"visible"===n&&i(),r};export default(l=>n?e(n,{mode:l.mode,children:l.children}):e(t.Suspense,{fallback:null,children:e(r,{mode:l.mode,children:l.children})}));
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export * from 'react-router-dom';
|
|
3
|
-
export { default as
|
|
3
|
+
export { default as ErrorBoundary, type ErrorBoundaryProps, type ErrorBoundaryState } from './error-boundary.js';
|
|
4
4
|
export { default as Link } from './link.js';
|
|
5
|
-
export { default as useQuery } from './use-query.js';
|
|
6
5
|
export { default as parseToByReservedWord, type To } from './parse-reserved-word.js';
|
|
7
|
-
export {
|
|
8
|
-
export { default as
|
|
6
|
+
export { default as useNavigate } from './use-navgate.js';
|
|
7
|
+
export { default as useQuery } from './use-query.js';
|
|
8
|
+
export { Link as LinkReactRouter, useNavigate as useNavigateReactRouter } from 'react-router-dom';
|
|
9
9
|
export type RenderAppProps = {
|
|
10
10
|
container?: HTMLElement;
|
|
11
11
|
basename?: string;
|
|
12
12
|
fallback?: React.JSX.Element;
|
|
13
13
|
language?: string;
|
|
14
14
|
};
|
|
15
|
+
export { default as Activity, type ActivityMode, type ActivityProps } from './activity.js';
|
|
15
16
|
export default React;
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";export*from"react-router-dom";export{default as
|
|
1
|
+
import*as e from"react";export*from"react-router-dom";export{default as ErrorBoundary}from"./error-boundary.js";export{default as Link}from"./link.js";export{default as parseToByReservedWord}from"./parse-reserved-word.js";export{default as useNavigate}from"./use-navgate.js";export{default as useQuery}from"./use-query.js";export{Link as LinkReactRouter,useNavigate as useNavigateReactRouter}from"react-router-dom";export{default as Activity}from"./activity.js";export default e;
|
package/lib/link.d.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { Link as ReactRouterLink, type LinkProps as ReactRouterLinkProps } from 'react-router-dom';
|
|
3
3
|
import parseToByReservedWord, { type To } from './parse-reserved-word.js';
|
|
4
4
|
export interface LinkProps extends Omit<ReactRouterLinkProps, 'to'> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Path } from 'react-router-dom';
|
|
2
|
-
declare function parse(reserved?: string | string[]);
|
|
2
|
+
declare function parse(reserved?: string | string[]): string[];
|
|
3
3
|
declare function parseReservedWord(reserved?: string | string[]): string[];
|
|
4
4
|
export interface IPath extends Partial<Omit<Path, 'search'>> {
|
|
5
5
|
search?: string | URLSearchParams | string[][] | Record<string, string>;
|
|
6
6
|
}
|
|
7
7
|
export type To = string | IPath;
|
|
8
|
-
declare const parseToByReservedWord: (to: To, reserved?: string | string[]) => Partial<Path>;
|
|
8
|
+
declare const parseToByReservedWord: (to: To | number, reserved?: string | string[]) => Partial<Path>;
|
|
9
9
|
export default parseToByReservedWord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default((e,
|
|
1
|
+
export default((e,r)=>{let a,t,n;if("number"==typeof e)return e;if("string"==typeof e){let r=e.split("?");t=r[0],a=new URLSearchParams(r[1])}else t=e.pathname,a=new URLSearchParams(e.search),n=e.hash;let s=new URLSearchParams(location.search);return Array.from(new Set(["menuId","dynamicTitle",...(Array.isArray(r)?r:[r]).filter(Boolean)])).forEach(e=>{s.has(e)&&!a.has(e)&&a.set(e,s.get(e)??"")}),{pathname:t,search:a.toString(),hash:n}});
|
package/lib/use-navgate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useNavigate as r}from"react-router-dom";import e from"./parse-reserved-word.js";export default(t=>{let o=r();return(r,a)=>
|
|
1
|
+
import{useNavigate as r}from"react-router-dom";import e from"./parse-reserved-word.js";export default(t=>{let o=r();return(r,a)=>o(e(r,t),a)});
|
package/lib/use-query.d.ts
CHANGED
package/lib/use-query.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import*as r from"react";import{useLocation as e}from"react-router-dom";export default(()=>{let t=e();return r.useMemo(()=>Object.fromEntries(new URLSearchParams(t.search)),[t.search])});
|