@moneko/react 1.4.7 → 1.4.8
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 +11 -15
- package/lib/index.d.ts +8 -0
- package/lib/index.js +1 -1
- package/mdx.d.ts +1 -1
- package/mdx.js +1 -1
- package/package.json +5 -5
package/env.d.ts
CHANGED
|
@@ -53,8 +53,10 @@ declare module '*.mdx' {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
declare module '@app/docs' {
|
|
56
|
+
import { JSX } from 'react';
|
|
57
|
+
|
|
56
58
|
interface ApiEntry {
|
|
57
|
-
[key: string]: (() =>
|
|
59
|
+
[key: string]: (() => JSX.Element)[];
|
|
58
60
|
}
|
|
59
61
|
const entry: ApiEntry;
|
|
60
62
|
|
|
@@ -89,18 +91,12 @@ declare module '@app/info' {
|
|
|
89
91
|
prefixCls?: string;
|
|
90
92
|
theme?: string;
|
|
91
93
|
projectName: string;
|
|
94
|
+
ssr: boolean;
|
|
92
95
|
}
|
|
93
96
|
const app: App;
|
|
94
97
|
|
|
95
98
|
export default app;
|
|
96
99
|
}
|
|
97
|
-
declare const layoutSider:
|
|
98
|
-
| false
|
|
99
|
-
| {
|
|
100
|
-
theme?: 'light' | 'dark';
|
|
101
|
-
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
102
|
-
};
|
|
103
|
-
|
|
104
100
|
declare module '@app/routes' {
|
|
105
101
|
export interface RouteConfig {
|
|
106
102
|
/** 菜单id */
|
|
@@ -119,15 +115,13 @@ declare module '@app/routes' {
|
|
|
119
115
|
parentId?: string;
|
|
120
116
|
/** 可否关闭标签 */
|
|
121
117
|
closable?: boolean;
|
|
118
|
+
/** 子菜单 */
|
|
119
|
+
children?: RouteConfig[];
|
|
122
120
|
props?: {
|
|
123
121
|
path: string;
|
|
124
122
|
[key: string]: Any;
|
|
125
123
|
};
|
|
126
124
|
metadata?: Record<string, string | number | boolean>;
|
|
127
|
-
/** 子菜单 */
|
|
128
|
-
children?: RouteConfig[];
|
|
129
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
130
|
-
[key: string]: any;
|
|
131
125
|
}
|
|
132
126
|
const routes: RouteConfig[];
|
|
133
127
|
|
|
@@ -214,8 +208,7 @@ declare module '@app/locales' {
|
|
|
214
208
|
}
|
|
215
209
|
/** 获取当前项目的语言列表 */
|
|
216
210
|
export const locales: Pick<Locale, 'language' | 'icon' | 'title'>[] = [];
|
|
217
|
-
const resources: Partial<LocaleConfigMap> = {};
|
|
218
|
-
|
|
211
|
+
export const resources: Partial<LocaleConfigMap> = {};
|
|
219
212
|
/**
|
|
220
213
|
* 插值字符串; 替换字符串中的占位符 `${}` 为对应的值
|
|
221
214
|
* @param {string} str 包含占位符的字符串
|
|
@@ -235,6 +228,10 @@ declare module '@app/locales' {
|
|
|
235
228
|
* ```
|
|
236
229
|
*/
|
|
237
230
|
export function setLang(localeName: string): void;
|
|
231
|
+
/** 使用的语言 */
|
|
232
|
+
export const lang: Omit<Locale, 'translation'>;
|
|
233
|
+
/** 映射 */
|
|
234
|
+
export const t: Record<string, string>;
|
|
238
235
|
/** 设置 */
|
|
239
236
|
const localizable: SSO<{
|
|
240
237
|
lang: Omit<Locale, 'translation'>;
|
|
@@ -264,7 +261,6 @@ interface Window {
|
|
|
264
261
|
__POWERED_BY_QIANKUN__?: boolean;
|
|
265
262
|
mainApp?: {
|
|
266
263
|
container?: HTMLElement;
|
|
267
|
-
currentTarget?: Record<string, unknown>;
|
|
268
264
|
[key: string]: unknown;
|
|
269
265
|
};
|
|
270
266
|
H5RemoteRuntime: {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export * from 'react-router-dom';
|
|
2
3
|
export { default as LinkWithMenuId } from './link.js';
|
|
3
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
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"react-router-dom";export{default as LinkWithMenuId}from"./link.js";export{default as useNavigateWithMenuId}from"./use-navgate.js";
|
|
1
|
+
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";
|
package/mdx.d.ts
CHANGED
package/mdx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"react";let n={},o=t.createContext(n);export function useMDXComponents(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}export function MDXProvider(t){let r;return r=t.disableParentContext?"function"==typeof t.components?t.components(n):t.components||n:useMDXComponents(t.components),e(o.Provider,{value:r,children:t.children})}
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import*as t from"react";let n={},o=t.createContext(n);export function useMDXComponents(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}export function MDXProvider(t){let r;return r=t.disableParentContext?"function"==typeof t.components?t.components(n):t.components||n:useMDXComponents(t.components),e(o.Provider,{value:r,children:t.children})}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"description": "react",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prebuild": "rm -rf ./lib",
|
|
8
|
-
"postbuild": "tsc && tsc --jsx react
|
|
8
|
+
"postbuild": "tsc && tsc mdx.tsx --jsx react --lib es2015 --declaration --emitDeclarationOnly",
|
|
9
9
|
"build": "swc src -d lib --strip-leading-paths -D && swc mdx.tsx -o mdx.js"
|
|
10
10
|
},
|
|
11
11
|
"author": "moneko",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.
|
|
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
18
|
"react-router": "6.23.1",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@moneko/transform-imports": "0.5.1",
|
|
24
24
|
"@swc/cli": "0.3.12",
|
|
25
|
-
"@swc/core": "1.5.
|
|
26
|
-
"@types/react": "18.3.
|
|
25
|
+
"@swc/core": "1.5.29",
|
|
26
|
+
"@types/react": "18.3.3",
|
|
27
27
|
"@types/react-dom": "18.3.0",
|
|
28
28
|
"eslint-config-neko": "2.7.6",
|
|
29
29
|
"react": "18.3.1",
|