idea-react 1.0.0-rc.31 → 2.0.0-rc.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.
- package/ReadMe.md +27 -4
- package/dist/index.d.ts +7 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +34 -37
- package/source/Dialog.tsx +3 -5
- package/source/Editor.tsx +3 -8
- package/source/MonthCalendar.tsx +5 -10
- package/source/PageNav.tsx +6 -11
- package/source/TypeEcho.tsx +8 -5
- package/tsconfig.json +4 -3
- package/.vscode/extensions.json +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idea-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.1",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"author": "shiy2008@gmail.com",
|
|
6
6
|
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"types": "dist/index.d.ts",
|
|
23
23
|
"main": "dist/index.js",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@editorjs/editorjs": "^2.
|
|
25
|
+
"@editorjs/editorjs": "^2.29.0",
|
|
26
26
|
"@editorjs/paragraph": "^2.11.3",
|
|
27
27
|
"@react-editor-js/core": "^2.1.0",
|
|
28
28
|
"@swc/helpers": "^0.5.3",
|
|
29
|
-
"classnames": "^2.
|
|
29
|
+
"classnames": "^2.5.1",
|
|
30
30
|
"editorjs-html": "^3.4.3",
|
|
31
31
|
"iterable-observer": "^1.0.1",
|
|
32
32
|
"lodash": "^4.17.21",
|
|
33
|
-
"mobx": ">=
|
|
34
|
-
"mobx-react": ">=
|
|
35
|
-
"mobx-react-helper": "^0.
|
|
33
|
+
"mobx": ">=6.12.0",
|
|
34
|
+
"mobx-react": ">=9.1.0",
|
|
35
|
+
"mobx-react-helper": "^0.3.1",
|
|
36
36
|
"prismjs": "^1.29.0",
|
|
37
|
-
"react-bootstrap": "^2.
|
|
37
|
+
"react-bootstrap": "^2.10.0",
|
|
38
38
|
"react-editor-js": "^2.1.0",
|
|
39
39
|
"react-element-to-jsx-string": "^15.0.0",
|
|
40
40
|
"web-utility": "^4.1.3"
|
|
@@ -44,54 +44,51 @@
|
|
|
44
44
|
"react-dom": ">=16"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@babel/plugin-proposal-
|
|
48
|
-
"@babel/
|
|
49
|
-
"@microsoft/api-extractor": "^7.39.
|
|
50
|
-
"@parcel/
|
|
51
|
-
"@parcel/
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@storybook/addon-
|
|
55
|
-
"@storybook/addon-
|
|
56
|
-
"@storybook/addon-
|
|
57
|
-
"@storybook/
|
|
58
|
-
"@storybook/
|
|
59
|
-
"@storybook/
|
|
47
|
+
"@babel/plugin-proposal-decorators": "^7.23.9",
|
|
48
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
49
|
+
"@microsoft/api-extractor": "^7.39.4",
|
|
50
|
+
"@parcel/config-default": "~2.11.0",
|
|
51
|
+
"@parcel/packager-ts": "~2.11.0",
|
|
52
|
+
"@parcel/transformer-typescript-tsc": "~2.11.0",
|
|
53
|
+
"@parcel/transformer-typescript-types": "~2.11.0",
|
|
54
|
+
"@storybook/addon-console": "^3.0.0",
|
|
55
|
+
"@storybook/addon-essentials": "^7.6.10",
|
|
56
|
+
"@storybook/addon-interactions": "^7.6.10",
|
|
57
|
+
"@storybook/addon-links": "^7.6.10",
|
|
58
|
+
"@storybook/addon-storysource": "^7.6.10",
|
|
59
|
+
"@storybook/blocks": "^7.6.10",
|
|
60
|
+
"@storybook/react": "^7.6.10",
|
|
61
|
+
"@storybook/react-vite": "^7.6.10",
|
|
60
62
|
"@storybook/testing-library": "^0.2.2",
|
|
61
63
|
"@types/lodash": "^4.14.202",
|
|
62
|
-
"@types/node": "^18.19.
|
|
64
|
+
"@types/node": "^18.19.10",
|
|
63
65
|
"@types/prismjs": "^1.26.3",
|
|
64
|
-
"@types/react": "^18.2.
|
|
66
|
+
"@types/react": "^18.2.48",
|
|
65
67
|
"@types/react-dom": "^18.2.18",
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
67
|
-
"@typescript-eslint/parser": "^6.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
69
|
+
"@typescript-eslint/parser": "^6.20.0",
|
|
68
70
|
"@vitejs/plugin-react": "^4.2.1",
|
|
69
71
|
"eslint": "^8.56.0",
|
|
70
72
|
"eslint-config-prettier": "^9.1.0",
|
|
71
73
|
"eslint-plugin-import": "^2.29.1",
|
|
72
74
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
73
|
-
"husky": "^
|
|
75
|
+
"husky": "^9.0.7",
|
|
74
76
|
"koapache": "^2.2.2",
|
|
75
77
|
"less": "^4.2.0",
|
|
76
78
|
"lint-staged": "^15.2.0",
|
|
77
|
-
"parcel": "~2.
|
|
79
|
+
"parcel": "~2.11.0",
|
|
78
80
|
"postcss-preset-env": "^9.3.0",
|
|
79
|
-
"prettier": "^3.
|
|
81
|
+
"prettier": "^3.2.4",
|
|
80
82
|
"process": "^0.11.10",
|
|
81
83
|
"prop-types": "15.8.1",
|
|
82
84
|
"react": "^18.2.0",
|
|
83
85
|
"react-dom": "^18.2.0",
|
|
84
86
|
"rimraf": "^5.0.5",
|
|
85
|
-
"storybook": "^7.6.
|
|
86
|
-
"typedoc": "^0.25.
|
|
87
|
-
"typedoc-plugin-mdn-links": "^3.1.
|
|
87
|
+
"storybook": "^7.6.10",
|
|
88
|
+
"typedoc": "^0.25.7",
|
|
89
|
+
"typedoc-plugin-mdn-links": "^3.1.14",
|
|
88
90
|
"typescript": "~5.3.3",
|
|
89
|
-
"vite": "^5.0.
|
|
90
|
-
},
|
|
91
|
-
"pnpm": {
|
|
92
|
-
"overrides": {
|
|
93
|
-
"@storybook/addon-actions": "~7.5"
|
|
94
|
-
}
|
|
91
|
+
"vite": "^5.0.12"
|
|
95
92
|
},
|
|
96
93
|
"prettier": {
|
|
97
94
|
"singleQuote": true,
|
|
@@ -110,7 +107,7 @@
|
|
|
110
107
|
}
|
|
111
108
|
},
|
|
112
109
|
"scripts": {
|
|
113
|
-
"prepare": "husky
|
|
110
|
+
"prepare": "husky",
|
|
114
111
|
"test": "lint-staged",
|
|
115
112
|
"api-extractor": "tsc --project tsconfig.build.json --outDir dist/dts && api-extractor run && rimraf dist/dts",
|
|
116
113
|
"pack-preview": "cd preview/ && rimraf ../.parcel-cache dist/ && parcel build --public-url=. --dist-dir=../docs/preview/",
|
package/source/Dialog.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Defer } from 'iterable-observer';
|
|
2
|
-
import
|
|
2
|
+
import { observable } from 'mobx';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { FC } from 'react';
|
|
5
5
|
|
|
@@ -14,14 +14,12 @@ export interface DialogProps<T = any> {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export class Dialog<T = any> {
|
|
17
|
-
@
|
|
18
|
-
defer
|
|
17
|
+
@observable
|
|
18
|
+
accessor defer: Defer<T> | undefined;
|
|
19
19
|
|
|
20
20
|
Component: FC;
|
|
21
21
|
|
|
22
22
|
constructor(Factory: FC<DialogProps<T>>) {
|
|
23
|
-
MobX.makeObservable?.(this);
|
|
24
|
-
|
|
25
23
|
this.Component = observer(() => <Factory defer={this.defer} />);
|
|
26
24
|
this.Component.displayName = 'DialogComponent';
|
|
27
25
|
}
|
package/source/Editor.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorCore, WrapperProps } from '@react-editor-js/core';
|
|
2
|
-
import
|
|
2
|
+
import { observable } from 'mobx';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { InputHTMLAttributes, PropsWithoutRef, PureComponent } from 'react';
|
|
5
5
|
import { createReactEditorJS } from 'react-editor-js';
|
|
@@ -15,15 +15,10 @@ export type EditorProps = PropsWithoutRef<
|
|
|
15
15
|
export class Editor extends PureComponent<EditorProps> {
|
|
16
16
|
static displayName = 'Editor';
|
|
17
17
|
|
|
18
|
-
constructor(props: EditorProps) {
|
|
19
|
-
super(props);
|
|
20
|
-
MobX.makeObservable?.(this);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
private core?: EditorCore;
|
|
24
19
|
|
|
25
|
-
@
|
|
26
|
-
innerValue = this.props.defaultValue;
|
|
20
|
+
@observable
|
|
21
|
+
accessor innerValue = this.props.defaultValue;
|
|
27
22
|
|
|
28
23
|
save = async () => this.core && (this.innerValue = await this.core.save());
|
|
29
24
|
|
package/source/MonthCalendar.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import { computed, observable } from 'mobx';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { observePropsState } from 'mobx-react-helper';
|
|
5
5
|
import { Component, ReactNode } from 'react';
|
|
@@ -38,24 +38,19 @@ export interface MonthCalendarProps
|
|
|
38
38
|
export class MonthCalendar extends Component<MonthCalendarProps> {
|
|
39
39
|
static displayName = 'MonthCalendar';
|
|
40
40
|
|
|
41
|
-
constructor(props: MonthCalendarProps) {
|
|
42
|
-
super(props);
|
|
43
|
-
MobX.makeObservable?.(this);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
41
|
declare observedProps: MonthCalendarProps;
|
|
47
42
|
|
|
48
|
-
@
|
|
43
|
+
@computed
|
|
49
44
|
get weekFormatter() {
|
|
50
45
|
const { locale = globalThis.navigator?.language } = this.observedProps;
|
|
51
46
|
|
|
52
47
|
return new Intl.DateTimeFormat(locale, { weekday: 'long' });
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
@
|
|
56
|
-
currentDate = new Date();
|
|
50
|
+
@observable
|
|
51
|
+
accessor currentDate = new Date();
|
|
57
52
|
|
|
58
|
-
@
|
|
53
|
+
@computed
|
|
59
54
|
get dateGrid() {
|
|
60
55
|
let startDate = new Date(this.currentDate);
|
|
61
56
|
startDate.setDate(1);
|
package/source/PageNav.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { computed, observable } from 'mobx';
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
3
|
import { PureComponent } from 'react';
|
|
4
4
|
import { Nav, NavProps } from 'react-bootstrap';
|
|
@@ -19,18 +19,13 @@ export interface PageNavProps extends NavProps {
|
|
|
19
19
|
export class PageNav extends PureComponent<PageNavProps> {
|
|
20
20
|
static displayName = 'PageNav';
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
MobX.makeObservable?.(this);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@MobX.observable
|
|
28
|
-
list: HeadingMeta[] = [];
|
|
22
|
+
@observable
|
|
23
|
+
accessor list: HeadingMeta[] = [];
|
|
29
24
|
|
|
30
|
-
@
|
|
31
|
-
scrollY = 0;
|
|
25
|
+
@observable
|
|
26
|
+
accessor scrollY = 0;
|
|
32
27
|
|
|
33
|
-
@
|
|
28
|
+
@computed
|
|
34
29
|
get currentActiveId() {
|
|
35
30
|
const { list, scrollY } = this;
|
|
36
31
|
const index = list.findIndex(({ top }) => top > scrollY);
|
package/source/TypeEcho.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
+
import { observable } from 'mobx';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
2
4
|
import { PropsWithoutRef, PureComponent, RefCallback } from 'react';
|
|
3
5
|
import { sleep } from 'web-utility';
|
|
4
6
|
|
|
@@ -7,12 +9,13 @@ export type TypeEchoProps = PropsWithoutRef<{
|
|
|
7
9
|
text: string;
|
|
8
10
|
intervals?: number;
|
|
9
11
|
}>;
|
|
10
|
-
type State = { echoed: string };
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
@observer
|
|
14
|
+
export class TypeEcho extends PureComponent<TypeEchoProps> {
|
|
13
15
|
static displayName = 'TypeEcho';
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
@observable
|
|
18
|
+
accessor echoed = '';
|
|
16
19
|
|
|
17
20
|
init: RefCallback<HTMLPreElement> = node =>
|
|
18
21
|
node &&
|
|
@@ -26,13 +29,13 @@ export class TypeEcho extends PureComponent<TypeEchoProps, State> {
|
|
|
26
29
|
for (const char of text) {
|
|
27
30
|
await sleep(intervals / 1000);
|
|
28
31
|
|
|
29
|
-
this.
|
|
32
|
+
this.echoed += char;
|
|
30
33
|
}
|
|
31
34
|
}).observe(node);
|
|
32
35
|
|
|
33
36
|
render() {
|
|
34
37
|
const { className, text } = this.props,
|
|
35
|
-
{ echoed } = this
|
|
38
|
+
{ echoed } = this;
|
|
36
39
|
|
|
37
40
|
return (
|
|
38
41
|
<pre className={classNames('text-wrap', className)} ref={this.init}>
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "ES6",
|
|
4
|
+
"moduleResolution": "Node",
|
|
4
5
|
"esModuleInterop": true,
|
|
5
6
|
"downlevelIteration": true,
|
|
6
|
-
"
|
|
7
|
+
"useDefineForClassFields": true,
|
|
7
8
|
"jsx": "react-jsx",
|
|
8
9
|
"skipLibCheck": true,
|
|
9
|
-
"lib": ["
|
|
10
|
+
"lib": ["ES2023", "DOM"]
|
|
10
11
|
},
|
|
11
12
|
"include": ["source/**/*", "stories/**/*"],
|
|
12
13
|
"typedocOptions": {
|
package/.vscode/extensions.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"yzhang.markdown-all-in-one",
|
|
4
|
-
"jock.svg",
|
|
5
|
-
"redhat.vscode-yaml",
|
|
6
|
-
"clinyong.vscode-css-modules",
|
|
7
|
-
"akamud.vscode-caniuse",
|
|
8
|
-
"visualstudioexptteam.intellicode-api-usage-examples",
|
|
9
|
-
"pflannery.vscode-versionlens",
|
|
10
|
-
"christian-kohler.npm-intellisense",
|
|
11
|
-
"esbenp.prettier-vscode",
|
|
12
|
-
"rangav.vscode-thunder-client",
|
|
13
|
-
"eamodio.gitlens",
|
|
14
|
-
"github.vscode-pull-request-github",
|
|
15
|
-
"github.vscode-github-actions"
|
|
16
|
-
]
|
|
17
|
-
}
|