Skip to content

Commit cc632b0

Browse files
author
th37rose
authored
Merge branch 'dev' into feature/bundle
2 parents 1a72537 + ccfa44b commit cc632b0

File tree

20 files changed

+2486
-73
lines changed

20 files changed

+2486
-73
lines changed

client/packages/lowcoder-design/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export { ReactComponent as InviteUserIcon } from "./icon-application-invite-user
125125
export { ReactComponent as HomeEmptyIcon } from "./icon-application-empty.svg";
126126
export { ReactComponent as HomeListIcon } from "./icon-application-list.svg";
127127
export { ReactComponent as HomeCardIcon } from "./icon-application-card.svg";
128+
export { ReactComponent as APIDocsIcon } from "./remix/instance-line.svg";
128129
// export { ReactComponent as AllAppIcon } from "./icon-all-app.svg";
129130

130131

client/packages/lowcoder/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@rjsf/core": "^5.15.1",
3030
"@rjsf/utils": "^5.15.1",
3131
"@rjsf/validator-ajv8": "^5.15.1",
32+
"@stoplight/elements": "^8.1.3",
3233
"@types/lodash": "^4.14.194",
3334
"@types/node": "^16.7.13",
3435
"@types/react": "^18.2.45",
@@ -128,6 +129,7 @@
128129
"vite-plugin-checker": "^0.5.1",
129130
"vite-plugin-dynamic-import": "^1.5.0",
130131
"vite-plugin-html": "^3.2.0",
132+
"vite-plugin-node-polyfills": "^0.22.0",
131133
"vite-plugin-svgr": "^2.2.2",
132134
"vite-tsconfig-paths": "^3.6.0"
133135
}

client/packages/lowcoder/src/app.tsx

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import {
2727
ADMIN_APP_URL,
2828
ORG_AUTH_FORGOT_PASSWORD_URL,
2929
ORG_AUTH_RESET_PASSWORD_URL,
30+
API_DOCS_URL,
3031
} from "constants/routesURL";
31-
3232
import React from "react";
3333
import { createRoot } from "react-dom/client";
3434
import { Helmet } from "react-helmet";
@@ -123,10 +123,43 @@ class AppIndex extends React.Component<AppIndexProps, any> {
123123
{<title>{this.props.brandName}</title>}
124124
{<link rel="icon" href={this.props.favicon} />}
125125
<meta name="description" content={trans("productDesc")} />
126+
<meta name="keywords" content="Lowcoder, Applications, App Builder, Internal Applications, Websites, Dashboards, Data Visualization, Customer Applications, CRM, ERP, eCommerce, VideoMeeting, Rapid Development" />
127+
<meta name="author" content="Lowcoder Software LTD" />
128+
<meta name="robots" content="index, follow" />
129+
130+
131+
<meta key="og:title" property="og:title" content={this.props.brandName} />
132+
<meta key="og:description" property="og:description" content={trans("productDesc")} />
133+
<meta key="og:image" property="og:image" content="https://raw.githubusercontent.com/lowcoder-org/lowcoder-media-assets/main/images/App%20Editor%20%7C%20Main%20Screeen%20clean%20v2.4.0.png" />
134+
<meta key="og:url" property="og:url" content={window.location.href} />
135+
<meta key="og:type" property="og:type" content="website" />
136+
137+
<meta key="twitter:card" name="twitter:card" content="summary_large_image" />
138+
<meta key="twitter:title" name="twitter:title" content={this.props.brandName} />
139+
<meta key="twitter:description" name="twitter:description" content={trans("productDesc")} />
140+
<meta key="twitter:image" name="twitter:image" content="https://raw.githubusercontent.com/lowcoder-org/lowcoder-media-assets/main/images/App%20Editor%20%7C%20Main%20Screeen%20clean%20v2.4.0.png" />
141+
142+
<meta key="viewport" name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
143+
<meta key="mobile-web-app-capable" name="mobile-web-app-capable" content="yes" />
144+
<meta key="theme-color" name="theme-color" content="#b480de" />
145+
146+
<meta key="apple-mobile-web-app-capable" name="apple-mobile-web-app-capable" content="yes" />
147+
<meta key="apple-mobile-web-app-status-bar-style" name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
148+
<meta key="apple-mobile-web-app-title" name="apple-mobile-web-app-title" content={this.props.brandName} />
149+
<link key="apple-touch-icon" rel="apple-touch-icon" href="https://raw.githubusercontent.com/lowcoder-org/lowcoder-media-assets/main/images/Lowcoder%20Logo%20512.png" />
150+
<link key="apple-touch-startup-image" rel="apple-touch-startup-image" href="https://raw.githubusercontent.com/lowcoder-org/lowcoder-media-assets/main/images/Lowcoder%20Logo%20512.png" />
151+
152+
<meta key="application-name" name="application-name" content={this.props.brandName} />
153+
<meta key="msapplication-TileColor" name="msapplication-TileColor" content="#b480de" />
154+
<meta key="msapplication-TileImage" name="msapplication-TileImage" content="https://raw.githubusercontent.com/lowcoder-org/lowcoder-media-assets/main/images/Lowcoder%20Logo%20150.png" />
155+
{/* }<meta key="msapplication-config" name="msapplication-config" content="https://www.yourdomain.com/path/to/browserconfig.xml" />, */}
156+
157+
<link rel="canonical" href={window.location.href} />
126158
{isLowCoderDomain && [
127159
// Adding Support for iframely to be able to embedd the component explorer in the docu
128-
<meta key="iframely:title" property="iframely:title" content="Lowcoder" />,
129-
<meta key="iframely:description" property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />,
160+
<meta key="iframely:title" property="iframely:title" content={this.props.brandName} />,
161+
<meta key="iframely:description" property="iframely:description" content={trans("productDesc")} />,
162+
130163
<link key="preconnect-googleapis" rel="preconnect" href="https://fonts.googleapis.com" />,
131164
<link key="preconnect-gstatic" rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />,
132165
<link key="font-ubuntu" href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet" />,
@@ -176,6 +209,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
176209
SETTING,
177210
MARKETPLACE_URL,
178211
ADMIN_APP_URL,
212+
API_DOCS_URL,
179213
]}
180214
// component={ApplicationListPage}
181215
component={LazyApplicationHome}
@@ -189,7 +223,6 @@ class AppIndex extends React.Component<AppIndexProps, any> {
189223
<LazyRoute path={`${COMPONENT_DOC_URL}/:name`} component={LazyComponentDoc} />
190224
<LazyRoute path={`/playground/:name/:dsl`} component={LazyComponentPlayground} />
191225
<Redirect to={`${COMPONENT_DOC_URL}/input`} path="/components" />
192-
193226
{developEnv() && (
194227
<>
195228
<LazyRoute path="/debug_comp/:name" component={LazyDebugComp} />
Binary file not shown.

client/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ function UIView(props: {
219219
viewFn: any;
220220
}) {
221221
const comp = props.comp;
222-
223222
const childrenProps = childrenToProps(comp.children);
224223
const parentDisabled = useContext(DisabledContext);
225224
const disabled = childrenProps["disabled"];
@@ -236,6 +235,17 @@ function UIView(props: {
236235
}
237236
//END ADD BY FRED
238237

238+
if (comp.children.hasOwnProperty('showMask') && comp.children.hasOwnProperty('maskClosable')) {
239+
return (
240+
<HidableView hidden={childrenProps.hidden as boolean}>
241+
{props.viewFn(
242+
childrenProps,
243+
comp.dispatch
244+
)}
245+
</HidableView>
246+
);
247+
}
248+
239249
return (
240250
<div
241251
ref={props.innerRef}

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ let TmpDrawerComp = (function () {
167167
zIndex={Layers.drawer}
168168
maskClosable={props.maskClosable}
169169
mask={props.showMask}
170+
className={props.className as string}
171+
data-testid={props.dataTestId as string}
170172
>
171173
<ButtonStyle
172174
$closePosition={props.closePosition}

client/packages/lowcoder/src/comps/hooks/hookComp.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { trans } from "i18n";
2626
import _ from "lodash";
2727
import dayjs from "dayjs";
2828
import { ConstructorToComp } from "lowcoder-core";
29-
import { Section, sectionNames } from "lowcoder-design";
29+
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
3030
import React, { useContext, useEffect, useMemo } from "react";
3131
import { useInterval, useTitle, useWindowSize } from "react-use";
3232
import { useCurrentUser } from "util/currentUser";
@@ -204,7 +204,9 @@ export class HookComp extends HookTmpComp {
204204
return (
205205
<>
206206
<CompName name={this.children.name.getView()} />
207-
{this.children.comp.getPropertyView()}
207+
<ScrollBar>
208+
{this.children.comp.getPropertyView()}
209+
</ScrollBar>
208210
</>
209211
);
210212
}

client/packages/lowcoder/src/comps/hooks/modalComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ let TmpModalComp = (function () {
155155
zIndex={Layers.modal}
156156
modalRender={(node) => <ModalStyled $style={props.style}>{node}</ModalStyled>}
157157
mask={props.showMask}
158+
className={props.className as string}
159+
data-testid={props.dataTestId as string}
158160
>
159161
<InnerGrid
160162
{...otherContainerProps}

client/packages/lowcoder/src/constants/routesURL.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const DATASOURCE_URL = `/datasource`;
3131
export const DATASOURCE_CREATE_URL = `${DATASOURCE_URL}/new/:datasourceType`;
3232
export const DATASOURCE_EDIT_URL = `${DATASOURCE_URL}/:datasourceId`;
3333
export const QUERY_LIBRARY_URL = `/query-library`;
34+
export const API_DOCS_URL = `/lowcoder-api`;
3435
export const FOLDER_URL_PREFIX = `/folder`;
3536
export const FOLDER_URL = `${FOLDER_URL_PREFIX}/:folderId`;
3637
export const FOLDERS_URL = `/folders`;

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,7 @@ export const en = {
21992199
"theme": "Themes",
22002200
"plugin": "Plugins",
22012201
"advanced": "Advanced",
2202+
"apiDocs": "API Docs",
22022203
"lab": "Lab",
22032204
"branding": "Branding",
22042205
"oauthProviders": "User Authentication",
@@ -2936,6 +2937,7 @@ export const en = {
29362937
"yourFolders" : "Your Folders",
29372938
"modules": "Modules",
29382939
"module": "Module",
2940+
"api" : "Lowcoder API",
29392941
"trash": "Trash",
29402942
"marketplace": "Marketplace",
29412943
"allCategories": "All Categories",
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
import styled, { createGlobalStyle } from "styled-components";
2+
import { trans } from "../../i18n";
3+
import { API } from '@stoplight/elements';
4+
import React from 'react';
5+
import { useLocation } from "react-router-dom";
6+
import history from "util/history";
7+
import { Card } from "antd";
8+
import { default as AntdBreadcrumb } from "antd/es/breadcrumb";
9+
import { ALL_APPLICATIONS_URL, API_DOCS_URL } from "constants/routesURL";
10+
import { ArrowIcon } from "lowcoder-design";
11+
12+
import './components/stoplight.styles.css';
13+
14+
const Wrapper = styled.div`
15+
display: flex;
16+
flex-direction: column;
17+
width: 100%;
18+
height: 100%;
19+
`;
20+
21+
const HeaderWrapper = styled.div`
22+
height: 84px;
23+
width: 100%;
24+
display: flex;
25+
padding: 0 36px;
26+
align-items: center;
27+
flex-shrink: 0;
28+
@media screen and (max-width: 500px) {
29+
padding: 0 24px;
30+
}
31+
`;
32+
33+
const ContentWrapper = styled.div`
34+
position: relative;
35+
`;
36+
37+
const Breadcrumb = styled(AntdBreadcrumb)`
38+
font-size: 20px;
39+
40+
li:not(:last-child) {
41+
color: #8b8fa3;
42+
}
43+
44+
li:last-child {
45+
font-weight: 500;
46+
color: #222222;
47+
}
48+
49+
li.ant-breadcrumb-separator {
50+
display: flex;
51+
flex-direction: column;
52+
justify-content: center;
53+
}
54+
`;
55+
56+
const BreadcrumbItem = styled.div`
57+
cursor: pointer;
58+
`;
59+
60+
const ApiDocView = styled.div`
61+
font-size: 14px;
62+
color: #8b8fa3;
63+
flex-grow: 1;
64+
padding-top: 0px;
65+
padding-left: 40px;
66+
max-width: 98%;
67+
`;
68+
69+
const StyleApiDocCover = styled.div`
70+
background: rgb(9,52,121);
71+
background: -moz-linear-gradient(139deg, rgba(9,52,121,1) 19%, rgba(5,98,180,1) 67%, rgba(0,76,255,1) 100%);
72+
background: -webkit-linear-gradient(139deg, rgba(9,52,121,1) 19%, rgba(5,98,180,1) 67%, rgba(0,76,255,1) 100%);
73+
background: linear-gradient(139deg, rgba(9,52,121,1) 19%, rgba(5,98,180,1) 67%, rgba(0,76,255,1) 100%);
74+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#093479",endColorstr="#004cff",GradientType=1);
75+
padding: 25px;
76+
height: 120px;
77+
border-radius:10px 10px 0 0;
78+
`;
79+
80+
81+
const isSelfHost = window.location.host !== 'app.lowcoder.cloud';
82+
83+
export type ApiDocBreadcrumbType = { text: string; path: string };
84+
85+
export interface ApiDocLayoutProps {
86+
breadcrumb?: ApiDocBreadcrumbType[];
87+
}
88+
89+
export function ApiDoc(props: ApiDocLayoutProps) {
90+
91+
const { breadcrumb = []} = props;
92+
const currentPath = useLocation().pathname;
93+
94+
const breadcrumbItems = [
95+
{
96+
key: 0,
97+
title: trans("home.home"),
98+
onClick: () =>
99+
currentPath !== ALL_APPLICATIONS_URL && history.push(ALL_APPLICATIONS_URL),
100+
},
101+
...breadcrumb.map((b, i) => ({
102+
key: i+1,
103+
title: b.text,
104+
onClick: () => currentPath !== b.path && history.push(b.path)
105+
}))
106+
]
107+
108+
return (
109+
<Wrapper>
110+
<HeaderWrapper>
111+
<Breadcrumb
112+
separator={<ArrowIcon />}
113+
items={breadcrumbItems}
114+
itemRender={(item) => (
115+
<BreadcrumbItem
116+
key={item.key}
117+
onClick={item.onClick}
118+
>
119+
{item.title}
120+
</BreadcrumbItem>
121+
)}
122+
>
123+
</Breadcrumb>
124+
</HeaderWrapper>
125+
126+
<ContentWrapper>
127+
<ApiDocView>
128+
<StyleApiDocCover>
129+
<h1 style={{color: "#ffffff", marginTop : "12px"}}>{trans("home.api")}</h1>
130+
</StyleApiDocCover>
131+
<Card style={{ marginBottom: "20px", minHeight : "800px", width: "100%" }}>
132+
<div style={{width : "100%"}}> {/* className={styles.stoplightApidoc} */}
133+
<API
134+
layout="responsive"
135+
hideSchemas={true}
136+
hideInternal={true}
137+
hideExport={true}
138+
tryItCredentialsPolicy="include"
139+
tryItCorsProxy={isSelfHost ? undefined : 'https://api-service.lowcoder.cloud'}
140+
basePath="lowcoder-api"
141+
apiDescriptionUrl="https://api-service.lowcoder.cloud/api/docs/api-docs"
142+
/>
143+
</div>
144+
</Card>
145+
146+
</ApiDocView>
147+
</ContentWrapper>
148+
</Wrapper>
149+
);
150+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Helmet } from "react-helmet";
2+
import { ApiDoc } from "./ApiDocLayout";
3+
import { trans } from "i18n";
4+
5+
export function ApiDocView() {
6+
7+
return (
8+
<><Helmet>
9+
{<title>{trans("productName")} {trans("home.api")}</title>}
10+
</Helmet><ApiDoc /></>
11+
);
12+
13+
};

client/packages/lowcoder/src/pages/ApplicationV2/MoveToFolderModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ export const MoveToFolderModal = (props: { source?: HomeRes; onClose: () => void
107107
{
108108
label: (
109109
<FolderSelectLabel>
110-
<FolderIcon style={{ marginRight: "8px", flexShrink: 0 }} />
111-
{trans("home.rootFolder")}
110+
<FolderIcon style={{ marginRight: "8px", width: "24px", flexShrink: 0 }} />
111+
{trans("home.rootFolder")}
112112
</FolderSelectLabel>
113113
),
114114
value: "",
@@ -120,7 +120,7 @@ export const MoveToFolderModal = (props: { source?: HomeRes; onClose: () => void
120120
.map((f) => ({
121121
label: (
122122
<FolderSelectLabel>
123-
<FolderIcon style={{ marginRight: "8px", flexShrink: 0 }} />
123+
<FolderIcon style={{ marginRight: "8px", width: "24px", flexShrink: 0 }} />
124124
{f.name}
125125
</FolderSelectLabel>
126126
),

client/packages/lowcoder/src/pages/ApplicationV2/components/stoplight.styles.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)