Skip to content

Commit ab18284

Browse files
authored
Merge branch 'dev' into feature/aliyun-oss
2 parents ccc323b + 80b006a commit ab18284

File tree

275 files changed

+16999
-3385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+16999
-3385
lines changed

client/config/test/jest.config.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ export function currentDirName(importMetaUrl) {
66
return dirname(fileURLToPath(importMetaUrl));
77
}
88

9-
109
const globals = {};
1110
buildVars.forEach(({ name, defaultValue }) => {
1211
globals[name] = process.env[name] || defaultValue;
1312
});
14-
const edition = process.env.REACT_APP_EDITION;
15-
const isEEGlobal = edition === "enterprise-global";
16-
const isEE = edition === "enterprise" || isEEGlobal;
1713
const currentDir = currentDirName(import.meta.url);
1814

1915
export default {
@@ -22,8 +18,7 @@ export default {
2218
"react-markdown": path.resolve(currentDir, "./mocks/react-markdown.js"),
2319
"\\.md\\?url$": path.resolve(currentDir, "./mocks/markdown-url-module.js"),
2420
"^@lowcoder-ee(.*)$": path.resolve(
25-
currentDir,
26-
isEE ? "../../packages/lowcoder/src/ee/$1" : "../../packages/lowcoder/src/$1"
21+
currentDir, "../../packages/lowcoder/src/$1"
2722
),
2823
"lowcoder-sdk": path.resolve(currentDir, "../../packages/lowcoder/src/index.sdk"),
2924
},

client/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"start": "yarn workspace lowcoder start",
1414
"start-win": "LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start",
1515
"start:ee": "REACT_APP_EDITION=enterprise yarn workspace lowcoder start",
16-
"start:ee-global": "REACT_APP_EDITION=enterprise-global yarn workspace lowcoder start",
1716
"build": "yarn node ./scripts/build.js",
1817
"test": "jest && yarn workspace lowcoder-comps test",
1918
"prepare": "yarn workspace lowcoder prepare",
@@ -35,6 +34,7 @@
3534
"@types/react-resizable": "^3.0.5",
3635
"@types/react-router-dom": "^5.3.2",
3736
"@types/shelljs": "^0.8.11",
37+
"@types/simplebar": "^5.3.3",
3838
"@types/stylis": "^4.0.2",
3939
"@types/tern": "0.23.4",
4040
"@types/ua-parser-js": "^0.7.36",
@@ -51,7 +51,6 @@
5151
"mq-polyfill": "^1.1.8",
5252
"prettier": "^3.1.0",
5353
"rimraf": "^3.0.2",
54-
"rollup": "^2.79.0",
5554
"shelljs": "^0.8.5",
5655
"svgo": "^3.0.0",
5756
"typescript": "^4.8.4",
@@ -75,10 +74,13 @@
7574
"@testing-library/react": "^14.1.2",
7675
"@testing-library/user-event": "^14.5.1",
7776
"@types/styled-components": "^5.1.34",
78-
"antd-mobile": "^5.28.0",
77+
"antd-mobile": "^5.34.0",
7978
"chalk": "4",
8079
"number-precision": "^1.6.0",
8180
"react-player": "^2.11.0",
81+
"resize-observer-polyfill": "^1.5.1",
82+
"rollup": "^4.13.0",
83+
"simplebar": "^6.2.5",
8284
"tui-image-editor": "^3.15.3"
8385
}
8486
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/lib
22
/node_modules
3+
/package
34
*.tgz

client/packages/lowcoder-comps/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "ESNext",
44
"experimentalDecorators": true,
55
"lib": ["dom", "dom.iterable", "esnext"],
66
"allowJs": true,

client/packages/lowcoder-design/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"react-virtualized": "^9.22.3",
1414
"rehype-raw": "^6.1.1",
1515
"rehype-sanitize": "^5.0.1",
16-
"remark-gfm": "^3.0.1"
16+
"remark-gfm": "^3.0.1",
17+
"simplebar": "^6.2.5",
18+
"simplebar-react": "^3.2.4"
1719
},
1820
"devDependencies": {
1921
"@rollup/plugin-commonjs": "^23.0.2",
@@ -23,6 +25,7 @@
2325
"@rollup/plugin-typescript": "^9.0.2",
2426
"@rollup/plugin-url": "^8.0.1",
2527
"@svgr/rollup": "^6.5.1",
28+
"@types/simplebar": "^5.3.3",
2629
"rollup": "^2",
2730
"rollup-plugin-cleaner": "^1.0.0",
2831
"rollup-plugin-polyfill-node": "^0.11.0",

client/packages/lowcoder-design/src/components/GlobalInstances.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { App } from 'antd';
2-
import type { MessageInstance } from 'antd/es/message/interface';
3-
import type { ModalStaticFunctions } from 'antd/es/modal/confirm';
4-
import type { NotificationInstance } from 'antd/es/notification/interface';
1+
import { default as App } from "antd/es/app";
2+
import type { MessageInstance } from "antd/es/message/interface";
3+
import type { ModalStaticFunctions } from "antd/es/modal/confirm";
4+
import type { NotificationInstance } from "antd/es/notification/interface";
55

66
let messageInstance: MessageInstance;
77
let notificationInstance: NotificationInstance;

client/packages/lowcoder-design/src/components/ScrollBar.tsx

+38-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from "react";
22
import SimpleBar from "simplebar-react";
3+
import 'simplebar-react/dist/simplebar.min.css';
34
import styled from "styled-components";
5+
import { DebouncedFunc } from 'lodash'; // Assuming you're using lodash's DebouncedFunc type
46

5-
const ScrollBarWrapper = styled.div`
7+
8+
const ScrollBarWrapper = styled.div<{ $hideplaceholder?: boolean }>`
69
min-height: 0;
710
height: 100%;
811
width: 100%;
@@ -33,19 +36,48 @@ const ScrollBarWrapper = styled.div`
3336
top: 10px;
3437
bottom: 10px;
3538
}
39+
40+
${props => Boolean(props.$hideplaceholder) && `
41+
.simplebar-placeholder {
42+
display: none !important;
43+
}
44+
`}
3645
`;
3746

38-
interface IProps extends SimpleBar.Props {
47+
// .simplebar-placeholder { added by Falk Wolsky to hide the placeholder - as it doubles the vertical space of a Module on a page
48+
49+
interface IProps {
3950
children: React.ReactNode;
4051
className?: string;
4152
height?: string;
53+
style?: React.CSSProperties; // Add this line to include a style prop
54+
scrollableNodeProps?: {
55+
onScroll: DebouncedFunc<(e: any) => void>;
56+
};
57+
$hideplaceholder?: boolean;
58+
hideScrollbar?: boolean;
4259
}
4360

44-
export const ScrollBar = (props: IProps) => {
45-
const { height = "100%", className, children, ...otherProps } = props;
46-
return (
61+
export const ScrollBar = ({
62+
height = "100%",
63+
className,
64+
children,
65+
style,
66+
scrollableNodeProps,
67+
hideScrollbar = false,
68+
$hideplaceholder = false,
69+
...otherProps
70+
}: IProps) => {
71+
// You can now use the style prop directly or pass it to SimpleBar
72+
const combinedStyle = { ...style, height }; // Example of combining height with passed style
73+
74+
return hideScrollbar ? (
75+
<ScrollBarWrapper className={className}>
76+
{children}
77+
</ScrollBarWrapper>
78+
) : (
4779
<ScrollBarWrapper className={className}>
48-
<SimpleBar forceVisible="y" style={{ height: height }} {...otherProps}>
80+
<SimpleBar style={combinedStyle} scrollableNodeProps={scrollableNodeProps} {...otherProps}>
4981
{children}
5082
</SimpleBar>
5183
</ScrollBarWrapper>

client/packages/lowcoder-design/src/components/Section.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const ShowChildren = styled.div<{ $show?: string; $noMargin?: boolean }>`
7575

7676
interface ISectionConfig<T> {
7777
name?: string;
78+
open?: boolean;
7879
width?: number;
7980
noMargin?: boolean;
8081
style?: React.CSSProperties;
@@ -103,7 +104,9 @@ export const PropertySectionContext = React.createContext<PropertySectionContext
103104
export const BaseSection = (props: ISectionConfig<ReactNode>) => {
104105
const { name } = props;
105106
const { compName, state, toggle } = useContext(PropertySectionContext);
106-
const open = name ? state[compName]?.[name] !== false : true;
107+
const open = props.open !== undefined ? props.open : name ? state[compName]?.[name] !== false : true;
108+
109+
// console.log("open", open, props.open);
107110

108111
const handleToggle = () => {
109112
if (!name) {

client/packages/lowcoder-design/src/components/Trees.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styled, { css } from "styled-components";
22
import { ReactComponent as Folded } from "icons/icon-folded.svg";
3-
import { DataNode, TreeProps } from "antd/lib/tree";
4-
import DirectoryTree from "antd/lib/tree/DirectoryTree";
3+
import { DataNode, TreeProps } from "antd/es/tree";
4+
import DirectoryTree from "antd/es/tree/DirectoryTree";
55

66
export const Treediv = styled.div<{ $height?: number }>`
77
padding-left: 24px;

client/packages/lowcoder-design/src/components/audio.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { CSSProperties } from "react";
2-
import { Ref } from "react";
3-
import ReactPlayer from "react-player";
2+
import { lazy, Ref } from "react";
3+
import type {default as ReactPlayerType} from "react-player";
44
import styled from "styled-components";
55

6+
const ReactPlayer = lazy(() => import("react-player"));
7+
68
const Audio = styled(ReactPlayer)`
79
height: 32px !important;
810
`;
@@ -14,7 +16,7 @@ export function TacoAudio(props: {
1416
onEnded?: () => void;
1517
className?: string;
1618
style?: CSSProperties;
17-
audioRef?: Ref<ReactPlayer>;
19+
audioRef?: Ref<ReactPlayerType>;
1820
autoPlay?: boolean;
1921
loop?: boolean;
2022
}) {

client/packages/lowcoder-design/src/components/colorSelect/colorUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { colord, extend } from "colord";
22
import namesPlugin from "colord/plugins/names";
3-
import { generate } from "@ant-design/colors";
3+
import { generate } from "@ant-design/colors/es";
44

55
extend([namesPlugin]);
66

client/packages/lowcoder-design/src/components/iconSelect/index.tsx

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
22
import type { IconDefinition } from "@fortawesome/free-regular-svg-icons";
33
// import type { IconDefinition as IconDefinitionBrands } from "@fortawesome/free-brands-svg-icons";
4-
import { Popover } from "antd";
5-
import { ActionType } from "@rc-component/trigger/lib/interface";
4+
import { default as Popover } from "antd/lib/popover";
5+
import type { ActionType } from "@rc-component/trigger/lib/interface";
66
import { TacoInput } from "components/tacoInput";
77
import { Tooltip } from "components/toolTip";
88
import { trans } from "i18n/design";
9-
import _ from "lodash";
9+
import { upperFirst, sortBy } from "lodash";
1010
import {
1111
ReactNode,
1212
useEffect,
1313
useCallback,
1414
useMemo,
1515
useRef,
1616
useState,
17+
Suspense
1718
} from "react";
1819
import Draggable from "react-draggable";
19-
import { default as List, ListRowProps } from "react-virtualized/dist/es/List";
20+
import { default as List, type ListRowProps } from "react-virtualized/dist/es/List";
2021
import styled from "styled-components";
2122
import { CloseIcon, SearchIcon } from "icons";
2223
import { ANTDICON } from "icons/antIcon";
23-
import { Divider } from "antd-mobile";
2424

2525
const PopupContainer = styled.div`
2626
width: 580px;
@@ -141,7 +141,7 @@ class Icon {
141141
readonly title: string;
142142
constructor(readonly def: IconDefinition | any, readonly names: string[]) {
143143
if (def?.iconName) {
144-
this.title = def.iconName.split("-").map(_.upperFirst).join(" ");
144+
this.title = def.iconName.split("-").map(upperFirst).join(" ");
145145
} else {
146146
this.title = names[0].slice(5);
147147
this.def = def;
@@ -231,7 +231,7 @@ function search(
231231
.toLowerCase()
232232
.split(/\s+/g)
233233
.filter((t) => t);
234-
return _.sortBy(
234+
return sortBy(
235235
Object.entries(allIcons).filter(([key, icon]) => {
236236
if (icon.names.length === 0) {
237237
return false;
@@ -297,7 +297,11 @@ const IconPopup = (props: {
297297
onChangeIcon(key);
298298
}}
299299
>
300-
<IconWrapper>{icon.getView()}</IconWrapper>
300+
<IconWrapper>
301+
<Suspense fallback={null}>
302+
{icon.getView()}
303+
</Suspense>
304+
</IconWrapper>
301305
<IconKeyDisplay>{key}</IconKeyDisplay>
302306
</IconItemContainer>
303307
</Tooltip>

client/packages/lowcoder-design/src/components/markdown.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { css } from "styled-components";
2-
import ReactMarkdown from "react-markdown";
2+
import { lazy } from "react";
3+
// import ReactMarkdown from "react-markdown";
34
import rehypeRaw from "rehype-raw";
45
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
56
import remarkGfm from "remark-gfm";
6-
import { ReactMarkdownOptions } from "react-markdown/lib/react-markdown";
7+
import type { ReactMarkdownOptions } from "react-markdown/lib/react-markdown";
8+
9+
const ReactMarkdown = lazy(() => import('react-markdown'));
710

811
export const markdownCompCss = css`
912
.markdown-body {

client/packages/lowcoder-design/src/components/query.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styled, { css } from "styled-components";
22
import { default as Alert } from "antd/es/alert";
33
import { ReactNode } from "react";
4-
import { AlertProps } from "antd/lib/alert";
4+
import { AlertProps } from "antd/es/alert";
55
import { ToolTipLabel } from "./toolTip";
66
import { DocLink } from "components/ExternalLink";
77

client/packages/lowcoder-design/src/components/video.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import ReactPlayer from "react-player";
1+
// import ReactPlayer from "react-player";
2+
import { lazy } from 'react';
23
import styled from "styled-components";
34
import { videoPlayTriangle } from "icons";
45

6+
const ReactPlayer = lazy(() => import("react-player"));
7+
58
export const Video = styled(ReactPlayer)`
69
height: 100% !important;
710
width: 100% !important;

0 commit comments

Comments
 (0)