beer-assembly-biz 1.1.3-alpha.9 → 1.1.5-beta.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beer-assembly-biz",
3
3
  "private": false,
4
- "version": "1.1.3-alpha.9",
4
+ "version": "1.1.5-beta.1",
5
5
  "scripts": {
6
6
  "pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
7
7
  "copy": "cp -a src/rich/AIEditor.css dist/rich/AIEditor.css && cp -a src/icon dist/icon && cp -a src/images dist/images",
@@ -10,41 +10,43 @@
10
10
  "dependencies": {
11
11
  "@ant-design/icons": "5.5.2",
12
12
  "@ant-design/pro-components": "2.8.4",
13
- "@emotion/css": "^11.11.2",
14
- "aieditor": "^1.3.6",
13
+ "@emotion/css": "11.13.5",
14
+ "aieditor": "1.4.2",
15
15
  "antd": "5.23.2",
16
+ "beer-assembly-plus": "1.1.3",
16
17
  "beer-network": "1.2.3",
17
- "beer-assembly-plus": "1.1.2-alpha.8",
18
- "dayjs": "^1.11.13",
19
- "react": "^18.2.0",
20
- "react-dom": "^18.2.0",
21
- "react-router-dom": "^6.15.0"
18
+ "dayjs": "^1",
19
+ "react": "18.3.1",
20
+ "react-dom": "18.3.1",
21
+ "react-fast-marquee": "1.6.5",
22
+ "react-router-dom": "6.30.1"
22
23
  },
23
24
  "devDependencies": {
24
- "@babel/core": "^7.16.0",
25
- "@svgr/webpack": "^5.5.0",
26
- "@types/lodash": "^4.17.16",
27
- "@types/node": "^16.18.101",
28
- "@types/react": "^18.3.3",
29
- "@types/react-dom": "^18.3.0",
30
- "@types/webpack": "^5.28.5",
31
- "@typescript-eslint/eslint-plugin": "^8.26.1",
32
- "@typescript-eslint/parser": "^8.26.1",
33
- "babel-loader": "^8.2.3",
34
- "babel-plugin-named-asset-import": "^0.3.8",
35
- "babel-preset-react-app": "^10.0.1",
36
- "customize-cra": "^1.0.0",
37
- "dotenv": "^16.4.7",
38
- "eslint": "^8.3.0",
39
- "eslint-config-airbnb": "^19.0.4",
40
- "eslint-config-airbnb-base": "^15.0.0",
41
- "eslint-plugin-import": "^2.29.1",
42
- "eslint-plugin-react": "^7.37.4",
43
- "less": "^4.2.2",
44
- "less-loader": "^12.2.0",
45
- "react-app-rewired": "^2.2.1",
46
- "react-scripts": "^5.0.1",
47
- "serve": "^14.2.4",
48
- "typescript": "^5.7.3"
25
+ "@babel/core": "7.27.4",
26
+ "@svgr/webpack": "5.5.0",
27
+ "@types/node": "16.18.126",
28
+ "@types/react": "18.3.23",
29
+ "@types/react-dom": "18.3.7",
30
+ "@types/webpack": "5.28.5",
31
+ "@typescript-eslint/eslint-plugin": "8.35.0",
32
+ "@typescript-eslint/parser": "8.35.0",
33
+ "babel-loader": "8.4.1",
34
+ "babel-plugin-named-asset-import": "0.3.8",
35
+ "babel-preset-react-app": "10.1.0",
36
+ "customize-cra": "1.0.0",
37
+ "dotenv": "16.5.0",
38
+ "eslint": "8.57.1",
39
+ "eslint-config-airbnb": "19.0.4",
40
+ "eslint-config-airbnb-base": "15.0.0",
41
+ "eslint-plugin-import": "2.32.0",
42
+ "eslint-plugin-react": "7.37.5",
43
+ "less": "4.3.0",
44
+ "less-loader": "12.3.0",
45
+ "react-app-rewired": "2.2.1",
46
+ "react-scripts": "5.0.1",
47
+ "serve": "14.2.4",
48
+ "typescript": "5.8.3",
49
+ "webpack": "5.99.9",
50
+ "webpack-cli": "5.1.4"
49
51
  }
50
52
  }
package/promises.js CHANGED
@@ -21,18 +21,16 @@ export class Promises {
21
21
  * 异步任务管理工具.
22
22
  */
23
23
  export class Async {
24
- constructor() {
25
- this.isRun = false;
26
- }
24
+ isRun = false;
27
25
  /**
28
26
  * 同时只有一个函数能运行.
29
27
  * @param func
30
28
  */
31
29
  async run(func) {
30
+ if (this.isRun) {
31
+ return undefined;
32
+ }
32
33
  try {
33
- if (this.isRun) {
34
- return undefined;
35
- }
36
34
  this.isRun = true;
37
35
  return await func();
38
36
  }
package/rich/AIEditor.js CHANGED
@@ -6,7 +6,7 @@ import { Session } from 'beer-network/session';
6
6
  * AIEditor 的富文本编辑器.
7
7
  * @see https://aieditor.dev/zh/
8
8
  */
9
- export const AIEditor = forwardRef(function AIEditor({ actionImage, params, headers, placeholder, defaultValue, value, onChange, options, ...props }, ref) {
9
+ export const AIEditor = forwardRef(({ actionImage, params, headers, placeholder, defaultValue, value, onChange, options, ...props }, ref) => {
10
10
  const divRef = useRef(null);
11
11
  const aiEditorRef = useRef(null);
12
12
  const getAction = () => {
@@ -21,8 +21,9 @@ export const AIEditor = forwardRef(function AIEditor({ actionImage, params, head
21
21
  return actionImage + '?' + paramQuery.toString();
22
22
  };
23
23
  useEffect(() => {
24
- if (!divRef.current)
25
- return;
24
+ if (!divRef.current) {
25
+ return undefined;
26
+ }
26
27
  if (!aiEditorRef.current) {
27
28
  aiEditorRef.current = new AiEditor({
28
29
  element: divRef.current,
File without changes
@@ -1,337 +0,0 @@
1
- "use strict";
2
- // import React, { CSSProperties, FC, ReactNode, useEffect, useState } from 'react';
3
- // import { App, ConfigProvider, Dropdown, Select, Skeleton, theme, Tree } from 'antd';
4
- // import { css } from '@emotion/css';
5
- // import { CaretDownOutlined, MenuOutlined, PlusOutlined } from '@ant-design/icons';
6
- // import type { ItemType } from 'antd/es/menu/interface';
7
- // import Flux from './Flux';
8
- //
9
- // export declare type Module = {
10
- // code: string
11
- // name: string
12
- // };
13
- // export declare type ModuleItem = {
14
- // code?: string | undefined
15
- // name?: string | ReactNode | undefined
16
- // children?: ModuleItem[] | undefined
17
- // };
18
- // export declare type DirectoryMenusPanel = {
19
- // /**
20
- // * 宽度.
21
- // */
22
- // width?: number | undefined
23
- // /**
24
- // * 字体大小.
25
- // */
26
- // fontSize?: number | undefined
27
- // /**
28
- // * 样式.
29
- // */
30
- // style?: CSSProperties | undefined
31
- // /**
32
- // * 模块列表.
33
- // */
34
- // appList?: Module[] | undefined
35
- // /**
36
- // * 模块菜单明细.
37
- // */
38
- // appItems?: ModuleItem[] | undefined
39
- // /**
40
- // * 创建事件.
41
- // */
42
- // onCreate?: () => void | undefined
43
- // /**
44
- // * 模块切换事件.
45
- // * @param app 模块.
46
- // */
47
- // onAppChange?: (app: Module | undefined) => Promise<void> | undefined
48
- // /**
49
- // * 模块明细切换事件.
50
- // * @param code 明细.
51
- // */
52
- // onAppItemChange?: (code: string) => Promise<void> | undefined
53
- // /**
54
- // * 目录右侧菜单.
55
- // */
56
- // directoryMenus?: ItemType[] | undefined
57
- // /**
58
- // * 明细右侧菜单.
59
- // */
60
- // itemMenus?: ItemType[] | undefined
61
- // /**
62
- // * 是否允许创建.
63
- // */
64
- // isAllowCreate?: boolean | undefined
65
- // };
66
- // export const Component: FC<DirectoryMenusPanel> = (props) => {
67
- // const { token } = theme.useToken();
68
- //
69
- // const [appList, setAppList] = useState<Module[]>([]);
70
- // const [app, setApp] = useState<string>('');
71
- // const [appModuleLoading, setAppModuleLoading] = useState(false);
72
- // const [appModuleItems, setAppModuleItems] = useState<ModuleItem[]>([]);
73
- //
74
- // const TreeTitle = (titleProps: { children?: ReactNode | undefined }) => {
75
- // return <Flux className={css`
76
- // & .menus {
77
- // display: none;
78
- // }
79
- //
80
- // &:hover {
81
- // .menus {
82
- // display: flex;
83
- // }
84
- // }
85
- // `}>
86
- // {titleProps.children}
87
- // {props?.directoryMenus === undefined || props?.directoryMenus.length <= 0 ? undefined : <Dropdown menu={{
88
- // items: props?.directoryMenus
89
- // }} trigger={['click']}>
90
- // <div className="menus" style={{
91
- // alignItems: 'center',
92
- // justifyContent: 'center',
93
- // position: 'absolute',
94
- // top: 0,
95
- // right: 4,
96
- // bottom: 0,
97
- // width: 30
98
- // }} onClick={(e) => {
99
- // e.stopPropagation();
100
- // }}>
101
- // <div style={{
102
- // width: 24,
103
- // maxWidth: 24,
104
- // height: 24,
105
- // display: 'flex',
106
- // alignItems: 'center',
107
- // justifyContent: 'center',
108
- // fontSize: token.fontSize + 1
109
- // }}>
110
- // <MenuOutlined style={{ display: 'block' }}/>
111
- // </div>
112
- // </div>
113
- // </Dropdown>}
114
- // </Flux>;
115
- // };
116
- // const TreeLabel = (labelProps: { children?: ReactNode | undefined }) => {
117
- // return <Flux style={{
118
- // marginLeft: 18,
119
- // overflow: 'hidden',
120
- // position: 'relative'
121
- // }} className={css`
122
- // & .menus {
123
- // display: none;
124
- // }
125
- //
126
- // &:hover {
127
- // .menus {
128
- // display: flex;
129
- // }
130
- // }
131
- // `}>
132
- // {labelProps.children}
133
- // {props?.itemMenus === undefined || props?.itemMenus.length <= 0 ? undefined : <Dropdown menu={{
134
- // items: props?.itemMenus
135
- // }} trigger={['click']}>
136
- // <div className="menus" style={{
137
- // alignItems: 'center',
138
- // justifyContent: 'center',
139
- // position: 'absolute',
140
- // top: 0,
141
- // right: 0,
142
- // bottom: 0,
143
- // width: 30
144
- // }}>
145
- // <div style={{
146
- // width: 24,
147
- // maxWidth: 24,
148
- // height: 24,
149
- // display: 'flex',
150
- // alignItems: 'center',
151
- // justifyContent: 'center',
152
- // fontSize: token.fontSize + 1
153
- // }}>
154
- // <MenuOutlined style={{ display: 'block' }}/>
155
- // </div>
156
- // </div>
157
- // </Dropdown>}
158
- // </Flux>;
159
- // };
160
- //
161
- // const onConfirmApp = (code: string) => {
162
- // setApp(code);
163
- // };
164
- // const onSelectItem = (itemCode: string) => {
165
- // props?.onAppItemChange?.(itemCode);
166
- // };
167
- //
168
- // useEffect(() => {
169
- // if (app === undefined || app === '') {
170
- // return;
171
- // }
172
- // setAppModuleLoading(true);
173
- // const change = props?.onAppChange;
174
- // if (change === undefined) {
175
- // setAppModuleLoading(false);
176
- // return;
177
- // }
178
- // change(appList.find(it => it.code === app))
179
- // ?.then(() => setAppModuleLoading(false));
180
- // }, [app]);
181
- // useEffect(() => {
182
- // setAppList(props.appList || []);
183
- // const code = props?.appList?.[0]?.code;
184
- // if (code !== undefined) {
185
- // setApp(code);
186
- // }
187
- // }, [props.appList]);
188
- // useEffect(() => {
189
- // setAppModuleItems(props?.appItems?.map((it: any) => {
190
- // it.title = <TreeTitle>{it.name}</TreeTitle>;
191
- // it.key = it.code;
192
- // it.children = it?.children?.map((c: any) => {
193
- // return {
194
- // ...c,
195
- // key: c.code,
196
- // title: <TreeLabel>{c.name}</TreeLabel>
197
- // };
198
- // });
199
- // return it;
200
- // }) || []);
201
- // }, [props.appItems]);
202
- // return <App style={{
203
- // width: props.width || 320,
204
- // minWidth: props.width || 320,
205
- // maxWidth: props.width || 320,
206
- // height: '100%',
207
- // background: '#fff',
208
- // overflow: 'hidden',
209
- // display: 'flex',
210
- // flexDirection: 'column',
211
- // ...(props.style || {})
212
- // }}>
213
- // <ConfigProvider
214
- // theme={{
215
- // token: {
216
- // fontSize: props?.fontSize || 13
217
- // },
218
- // components: {
219
- // Tree: {
220
- // motion: false,
221
- // directoryNodeSelectedBg: '#eee',
222
- // directoryNodeSelectedColor: '#333',
223
- // titleHeight: 32,
224
- // padding: 0
225
- // }
226
- // }
227
- // }}>
228
- // <div style={{
229
- // padding: '10px 16px',
230
- // borderBottom: '1px solid #eee',
231
- // fontSize: token.fontSize + 2,
232
- // fontWeight: 500
233
- // }}>
234
- // <Flux style={{
235
- // height: 32
236
- // }} size={10}>
237
- // <Select
238
- // variant="filled"
239
- // placeholder="选择模块"
240
- // className={css`
241
- // flex: 1;
242
- //
243
- // .ant-select-selection-item {
244
- // font-size: 14px;
245
- // font-weight: 500;
246
- // }`}
247
- // value={app}
248
- // onChange={(e) => onConfirmApp(e)}
249
- // options={appList.map(it => {
250
- // return {
251
- // value: it.code,
252
- // label: it.name
253
- // };
254
- // })}
255
- // />
256
- // {props?.isAllowCreate ? <a className={css`
257
- // background: rgba(0, 0, 0, 0.04);
258
- // width: 30px;
259
- // height: 30px;
260
- // display: flex;
261
- // align-items: center;
262
- // justify-content: center;
263
- // color: #333;
264
- // border-radius: ${token.borderRadius}px;
265
- // overflow: hidden;
266
- // font-size: 16px;
267
- //
268
- // &:hover {
269
- // color: #333;
270
- // background: rgba(0, 0, 0, 0.08);
271
- // }
272
- // `} onClick={() => props?.onCreate?.()}>
273
- // <PlusOutlined/>
274
- // </a> : undefined}
275
- // </Flux>
276
- // </div>
277
- // {appModuleLoading ? <Skeleton style={{
278
- // minHeight: 400,
279
- // padding: '5px 16px'
280
- // }} active/> : <div
281
- // style={{
282
- // flexGrow: 1,
283
- // overflowX: 'hidden',
284
- // overflowY: 'auto'
285
- // }}
286
- // className={css`
287
- // .ant-tree-treenode {
288
- // &:before {
289
- // bottom: 0 !important;
290
- // }
291
- //
292
- // padding: 1px 0 !important;
293
- // margin: 0 !important;
294
- // }
295
- //
296
- // .ant-tree-node-content-wrapper {
297
- // padding: 0 4px !important;
298
- // }
299
- //
300
- // .ant-tree-switcher {
301
- // &:before {
302
- // display: none;
303
- // }
304
- //
305
- // width: 18px !important;
306
- // margin: 0 0 0 10px !important;
307
- // }
308
- //
309
- // .ant-tree-switcher-noop {
310
- // width: 0 !important;
311
- // }
312
- //
313
- // .ant-tree-indent {
314
- // width: 0 !important;
315
- // }
316
- // `}>
317
- // <Tree.DirectoryTree
318
- // style={{
319
- // background: '#fff'
320
- // }}
321
- // treeData={appModuleItems as never}
322
- // icon={false}
323
- // showIcon={false}
324
- // blockNode={true}
325
- // switcherIcon={<CaretDownOutlined style={{
326
- // fontSize: token.fontSize - 1
327
- // }}/>}
328
- // onSelect={(e) => {
329
- // onSelectItem(e.toString());
330
- // }}
331
- // />
332
- // </div>}
333
- // </ConfigProvider>
334
- // </App>;
335
- // };
336
- //
337
- // export default Component;
File without changes