@moneko/react 2.1.1 → 2.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/env.d.ts CHANGED
@@ -9,11 +9,7 @@ declare module '*.ts';
9
9
  declare module '*.png';
10
10
  declare module '*.svg';
11
11
  declare module '*.woff2';
12
- declare module './index.less' {
13
- const styles: { readonly [key: string]: string };
14
-
15
- export default styles;
16
- }
12
+ declare module './index.less';
17
13
 
18
14
  declare module '*?raw' {
19
15
  export default string;
package/lib/activity.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  export type ActivityMode = 'visible' | 'hidden';
3
3
  export interface ActivityProps {
4
4
  mode: ActivityMode;
package/lib/activity.js CHANGED
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import 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})}));
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})}));
@@ -1,8 +1,10 @@
1
1
  import type { Path } from 'react-router-dom';
2
2
  declare function parse(reserved?: string | string[]): string[];
3
3
  declare function parseReservedWord(reserved?: string | string[]): string[];
4
+ type SearchParams = ConstructorParameters<typeof URLSearchParams>[0];
5
+ type NormalRecord = Record<string, string | number | boolean | undefined | null>;
4
6
  export interface IPath extends Partial<Omit<Path, 'search'>> {
5
- search?: string | URLSearchParams | string[][] | Record<string, string>;
7
+ search?: SearchParams | NormalRecord;
6
8
  }
7
9
  export type To = string | IPath;
8
10
  declare const parseToByReservedWord: (to: To | number, reserved?: string | string[]) => Partial<Path>;
@@ -1 +1 @@
1
- export default((e,a)=>{let r,t,s;if("number"==typeof e)return e;if("string"==typeof e){let a=e.split("?");t=a[0],r=new URLSearchParams(a[1])}else{let a=e.pathname?e.pathname.split("?"):[];t=a[0],r=new URLSearchParams(e.search),a[1]&&new URLSearchParams(a[1]).forEach((e,a)=>{r.has(a)||r.set(a,e)}),s=e.hash}let h=new URLSearchParams(location.search);return Array.from(new Set(["menuId","dynamicTitle"].concat(Array.isArray(a)?a:a?[a]:[]))).forEach(e=>{if(h.has(e)&&!r.has(e)){let a=h.get(e);void 0===a?r.delete(e):r.set(e,a??"")}}),{pathname:t,search:r.toString(),hash:s}});
1
+ export default((e,a)=>{let r,t,s;if("number"==typeof e)return e;if("string"==typeof e){let a=e.split("?");t=a[0],r=new URLSearchParams(a[1])}else{let a=e.pathname?e.pathname.split("?"):[];t=a[0],r=new URLSearchParams(e.search),a[1]&&new URLSearchParams(a[1]).forEach((e,a)=>{r.has(a)||r.set(a,e)}),s=e.hash}let h=new URLSearchParams(location.search);return Array.from(new Set(["menuId","dynamicTitle"].concat(Array.isArray(a)?a:a?[a]:[]))).forEach(e=>{h.has(e)&&!r.has(e)&&(r.has(e)?"undefined"===r.get(e)&&r.delete(e):h.has(e)&&r.set(e,h.get(e)??""))}),{pathname:t,search:r.toString(),hash:s}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/react",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "react",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {