@moneko/react 1.5.7 → 1.6.1

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.
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as t}from"react/jsx-runtime";import*as e from"react";class o extends e.Component{constructor(r){super(r),this.state={}}componentDidCatch(r,t){this.setState({error:r,errorInfo:t})}render(){if(this.state.errorInfo){let e=this.props.fallback;return e?r(e,{error:this.state.error,errorInfo:this.state.errorInfo}):t("div",{children:[r("h2",{children:"Something went wrong."}),t("details",{style:{whiteSpace:"pre-wrap",color:"var(--error-color, red)"},children:[this.state.error&&this.state.error.toString(),r("br",{}),this.state.errorInfo.componentStack]})]})}return this.props.children}}export default o;
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- import*as e from"react";export*from"react-router-dom";export{default as LinkWithMenuId}from"./link.js";export{default as useNavigateWithMenuId}from"./use-navgate.js";export{default as renderApp,App}from"./entry.js";export default e;
1
+ import*as r from"react";export*from"react-router-dom";export{default as LinkWithMenuId}from"./link.js";export{default as useNavigateWithMenuId}from"./use-navgate.js";export{default as renderApp,App}from"./entry.js";export{default as ErrorBoundary}from"./error-boundary.js";export default r;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/react",
3
- "version": "1.5.7",
3
+ "version": "1.6.1",
4
4
  "description": "react",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -15,21 +15,21 @@
15
15
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
16
16
  "react-refresh": "0.14.2",
17
17
  "react-refresh-typescript": "2.0.9",
18
- "react-router": "6.24.1",
19
- "react-router-dom": "6.24.1",
18
+ "react-router": "6.25.1",
19
+ "react-router-dom": "6.25.1",
20
20
  "shared-store-object": "1.1.1"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@moneko/transform-imports": "0.6.0",
24
24
  "@swc/cli": "0.4.0",
25
- "@swc/core": "1.6.13",
26
- "@types/node": "20.14.10",
25
+ "@swc/core": "1.7.3",
26
+ "@types/node": "20.14.12",
27
27
  "@types/react": "18.3.3",
28
28
  "@types/react-dom": "18.3.0",
29
29
  "eslint-config-neko": "2.8.4",
30
30
  "react": "18.3.1",
31
31
  "react-dom": "18.3.1",
32
- "typescript": "5.5.3"
32
+ "typescript": "5.5.4"
33
33
  },
34
34
  "files": [
35
35
  "lib",
package/lib/entry.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- type RenderAppProps = {
3
- container?: HTMLElement;
4
- basename?: string;
5
- fallback?: React.ReactElement;
6
- language?: string;
7
- };
8
- export declare function App(props: RenderAppProps): React.JSX.Element;
9
- declare function renderApp(props?: RenderAppProps): () => void;
10
- export default renderApp;
package/lib/index.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- export * from 'react-router-dom';
3
- export { default as LinkWithMenuId } from './link.js';
4
- export { default as useNavigateWithMenuId } from './use-navgate.js';
5
- export { default as renderApp, App } from './entry.js';
6
- export type RenderAppProps = {
7
- container?: HTMLElement;
8
- basename?: string;
9
- fallback?: JSX.Element;
10
- language?: string;
11
- };
12
- export default React;
@@ -1 +0,0 @@
1
- export declare const injectReactRefresh: () => void;
package/lib/link.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { type FC } from 'react';
2
- import { type LinkProps as ReactRouterLinkProps, type To } from 'react-router-dom';
3
- export interface LinkProps extends Omit<ReactRouterLinkProps, 'to'> {
4
- /** 保留字 */
5
- reserved?: string | string[];
6
- to: To | -1;
7
- }
8
- /** 跳转时继承部分query参数
9
- * @default {string[]} ['menuId', 'dynamicTitle']
10
- */
11
- declare const Link: FC<LinkProps>;
12
- export default Link;
@@ -1,6 +0,0 @@
1
- import { type NavigateOptions, type To } from 'react-router-dom';
2
- /** 跳转时继承部分query参数
3
- * @default {string[]} ['menuId', 'dynamicTitle']
4
- */
5
- declare const useNavigate: (reserved?: string | string[]) => (to: To | -1, options?: NavigateOptions) => void;
6
- export default useNavigate;