Skip to content

Commit 465c3f1

Browse files
author
FalkWolsky
committed
SDK Website, Refresh of Admin Area, Previews in Marketplace
1 parent 9b20b57 commit 465c3f1

71 files changed

Lines changed: 4276 additions & 915 deletions

File tree

Some content is hidden

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

‎client/packages/lowcoder-design/src/components/button.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ const TacoButton = forwardRef(
198198
return (
199199
<StyledAntdButton
200200
{...restProps}
201+
data-button-type={buttonType ?? "normal"}
201202
$buttonType={props.buttonType ?? "normal"}
202203
$loading={!!props.loading}
203204
ref={ref}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<meta name="robots" content="noindex,nofollow" />
7+
<title>App layout preview</title>
8+
<script>
9+
window.global = window;
10+
</script>
11+
<style>
12+
html,
13+
body,
14+
#root {
15+
margin: 0;
16+
width: 100%;
17+
height: 100%;
18+
overflow: hidden;
19+
}
20+
* {
21+
animation: none !important;
22+
caret-color: transparent !important;
23+
}
24+
</style>
25+
</head>
26+
<body>
27+
<div id="root"></div>
28+
<script type="module" src="/src/marketplace-preview.tsx"></script>
29+
</body>
30+
</html>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
-------------------------------
2+
UBUNTU FONT LICENCE Version 1.0
3+
-------------------------------
4+
5+
PREAMBLE
6+
This licence allows the licensed fonts to be used, studied, modified and
7+
redistributed freely. The fonts, including any derivative works, can be
8+
bundled, embedded, and redistributed provided the terms of this licence
9+
are met. The fonts and derivatives, however, cannot be released under
10+
any other licence. The requirement for fonts to remain under this
11+
licence does not require any document created using the fonts or their
12+
derivatives to be published under this licence, as long as the primary
13+
purpose of the document is not to be a vehicle for the distribution of
14+
the fonts.
15+
16+
DEFINITIONS
17+
"Font Software" refers to the set of files released by the Copyright
18+
Holder(s) under this licence and clearly marked as such. This may
19+
include source files, build scripts and documentation.
20+
21+
"Original Version" refers to the collection of Font Software components
22+
as received under this licence.
23+
24+
"Modified Version" refers to any derivative made by adding to, deleting,
25+
or substituting -- in part or in whole -- any of the components of the
26+
Original Version, by changing formats or by porting the Font Software to
27+
a new environment.
28+
29+
"Copyright Holder(s)" refers to all individuals and companies who have a
30+
copyright ownership of the Font Software.
31+
32+
"Substantially Changed" refers to Modified Versions which can be easily
33+
identified as dissimilar to the Font Software by users of the Font
34+
Software comparing the Original Version with the Modified Version.
35+
36+
To "Propagate" a work means to do anything with it that, without
37+
permission, would make you directly or secondarily liable for
38+
infringement under applicable copyright law, except executing it on a
39+
computer or modifying a private copy. Propagation includes copying,
40+
distribution (with or without modification and with or without charging
41+
a redistribution fee), making available to the public, and in some
42+
countries other activities as well.
43+
44+
PERMISSION & CONDITIONS
45+
This licence does not grant any rights under trademark law and all such
46+
rights are reserved.
47+
48+
Permission is hereby granted, free of charge, to any person obtaining a
49+
copy of the Font Software, to propagate the Font Software, subject to
50+
the below conditions:
51+
52+
1) Each copy of the Font Software must contain the above copyright
53+
notice and this licence. These can be included either as stand-alone
54+
text files, human-readable headers or in the appropriate machine-
55+
readable metadata fields within text or binary files as long as those
56+
fields can be easily viewed by the user.
57+
58+
2) The font name complies with the following:
59+
(a) The Original Version must retain its name, unmodified.
60+
(b) Modified Versions which are Substantially Changed must be renamed to
61+
avoid use of the name of the Original Version or similar names entirely.
62+
(c) Modified Versions which are not Substantially Changed must be
63+
renamed to both (i) retain the name of the Original Version and (ii) add
64+
additional naming elements to distinguish the Modified Version from the
65+
Original Version. The name of such Modified Versions must be the name of
66+
the Original Version, with "derivative X" where X represents the name of
67+
the new work, appended to that name.
68+
69+
3) The name(s) of the Copyright Holder(s) and any contributor to the
70+
Font Software shall not be used to promote, endorse or advertise any
71+
Modified Version, except (i) as required by this licence, (ii) to
72+
acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with
73+
their explicit written permission.
74+
75+
4) The Font Software, modified or unmodified, in part or in whole, must
76+
be distributed entirely under this licence, and must not be distributed
77+
under any other licence. The requirement for fonts to remain under this
78+
licence does not affect any document created using the Font Software,
79+
except any version of the Font Software extracted from a document
80+
created using the Font Software may only be distributed under this
81+
licence.
82+
83+
TERMINATION
84+
This licence becomes null and void if any of the above conditions are
85+
not met.
86+
87+
DISCLAIMER
88+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
89+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
90+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
91+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
92+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
93+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
94+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
95+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
96+
DEALINGS IN THE FONT SOFTWARE.
13.8 KB
Binary file not shown.
13.9 KB
Binary file not shown.
14.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Alert, Button } from "antd";
2+
import { trans } from "i18n";
3+
4+
export function AdminListError({ retry }: { retry: () => void }) {
5+
return <Alert type="error" showIcon message={trans("admin.loadError")}
6+
action={<Button size="small" onClick={retry}>{trans("admin.retry")}</Button>} />;
7+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Pagination } from "antd";
2+
import { trans } from "i18n";
3+
4+
interface Props {
5+
currentPage: number;
6+
pageSize: number;
7+
total: number;
8+
setCurrentPage: (page: number) => void;
9+
setPageSize: (size: number) => void;
10+
simple?: boolean;
11+
}
12+
13+
export function AdminPagination({ currentPage, pageSize, total, setCurrentPage, setPageSize, simple }: Props) {
14+
if (total === 0) return null;
15+
return <Pagination
16+
style={{ display: "flex", justifyContent: "center", flexWrap: "wrap", padding: simple ? "12px 8px" : "20px 16px", gap: 4 }}
17+
current={currentPage}
18+
pageSize={pageSize}
19+
total={total}
20+
simple={simple}
21+
responsive
22+
showSizeChanger={!simple}
23+
showTotal={simple ? undefined : (count, range) => trans("admin.resultCount", { start: range[0], end: range[1], total: count })}
24+
onChange={(page, size) => size !== pageSize ? setPageSize(size) : setCurrentPage(page)}
25+
/>;
26+
}

‎client/packages/lowcoder/src/components/layout/Layout.tsx‎

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import styled from "styled-components";
1212
import { useSelector } from "react-redux";
1313
import { MenuOutlined } from "@ant-design/icons";
1414
import { Drawer, Button } from "antd";
15+
import { trans } from "i18n";
1516
import { getBrandingSetting } from "@lowcoder-ee/redux/selectors/enterpriseSelectors";
1617

1718
type LayoutProps = {
@@ -24,26 +25,30 @@ const SideBarV2 = styled(SideBar)<{
2425
$activeBgColor?: string,
2526
$activeFontColor?: string,
2627
}>`
27-
background: ${props => props.$bgColor ? props.$bgColor : '#f7f9fc'} !important;
28+
background: ${props => props.$bgColor ? props.$bgColor : '#f8f3fb'} !important;
2829
${props => props.$fontColor && `color: ${props.$fontColor}`};
29-
padding: 28px 10px;
30-
border-right: 1px solid #ebebeb;
30+
padding: 20px 14px;
31+
overflow-y: auto;
32+
flex-shrink: 0;
33+
border-right: 1px solid #e9e0ee;
3134
3235
.sidebar-section:not(:last-child)::after {
3336
content: "";
3437
display: block;
35-
width: 204px;
38+
width: calc(100% - 24px);
3639
height: 1px;
37-
background: #ebebeb !important;
38-
margin: 0 auto 4px;
40+
background: #e9e0ee;
41+
margin: 12px auto;
3942
}
4043
`;
4144

4245
const MobileMenuButton = styled(Button)`
4346
display: none;
4447
position: fixed;
45-
top: 75px;
46-
right: 22px;
48+
top: 12px;
49+
left: 12px;
50+
width: 36px;
51+
height: 36px;
4752
z-index: 1000;
4853
4954
@media screen and (max-width: 720px) {
@@ -59,7 +64,7 @@ const DrawerContentWrapper = styled.div`
5964

6065
export function Layout(props: LayoutProps) {
6166
const [drawerVisible, setDrawerVisible] = useState(false);
62-
const [isMobile, setIsMobile] = useState(false);
67+
const [isMobile, setIsMobile] = useState(() => window.innerWidth <= 720);
6368
const brandingSettings = useSelector(getBrandingSetting);
6469

6570
const toggleDrawer = () => {
@@ -100,12 +105,14 @@ export function Layout(props: LayoutProps) {
100105

101106
return (
102107
<AntdLayout style={{ height: "100%" }}>
103-
<AppHeader />
108+
<AppHeader showBrandName />
104109
<HelpDropdown />
105110

106111
{/* Mobile Hamburger Button */}
107112
{isMobile && (
108113
<MobileMenuButton
114+
aria-label={trans("admin.navigation")}
115+
aria-expanded={drawerVisible}
109116
type="primary"
110117
shape="circle"
111118
icon={<MenuOutlined />}
@@ -115,10 +122,11 @@ export function Layout(props: LayoutProps) {
115122

116123
{/* Drawer for Mobile Sidebar */}
117124
<Drawer
118-
width={"240px"}
119-
placement="right"
125+
title={trans("admin.navigation")}
126+
width={280}
127+
placement="left"
120128
closable={true}
121-
onClose={toggleDrawer}
129+
onClose={() => setDrawerVisible(false)}
122130
open={drawerVisible}
123131
styles={{
124132
body: { padding: "0px" }
@@ -127,6 +135,8 @@ export function Layout(props: LayoutProps) {
127135
>
128136
<DrawerContentWrapper>
129137
<SideBarV2
138+
width="100%"
139+
style={{ height: "100%" }}
130140
className={CNSidebar}
131141
$bgColor={brandingSettings?.config_set?.adminSidebarColor}
132142
$fontColor={brandingSettings?.config_set?.adminSidebarFontColor}
@@ -163,10 +173,10 @@ export function Layout(props: LayoutProps) {
163173
))}
164174
</SideBarV2>
165175
)}
166-
<MainContent className={CNMainContent}>
176+
<MainContent id="admin-main" tabIndex={-1} className={CNMainContent}>
167177
<Switch>{routes}</Switch>
168178
</MainContent>
169179
</AntdLayout>
170180
</AntdLayout>
171181
);
172-
}
182+
}

‎client/packages/lowcoder/src/components/layout/SideBarItem.tsx‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,35 @@ import { useLocation } from "react-router-dom";
66

77
type SideBarSize = "medium" | "small";
88

9-
const Wrapper = styled.div<{
9+
const Wrapper = styled.button<{
1010
$size?: SideBarSize;
1111
$selected?: boolean;
1212
$selectedBgColor?: string;
1313
$selectedFontColor?: string;
1414
}>`
15+
appearance: none;
16+
border: 0;
17+
background: transparent;
18+
color: inherit;
19+
font: inherit;
20+
text-align: left;
21+
transition: background 150ms, color 150ms;
1522
width: 100%;
1623
height: ${(props) => (props.$size === "small" ? "36px" : "44px")};
17-
border-radius: 4px;
24+
border-radius: 10px;
1825
display: flex;
1926
align-items: center;
20-
padding: 0 8px 0 26px;
27+
padding: 0 12px;
28+
gap: 4px;
2129
cursor: pointer;
2230
2331
&:hover {
2432
background: ${(props) => (props.$selected ? (
25-
`${props.$selectedBgColor ? props.$selectedBgColor : '#ebf0f7'}`
33+
`${props.$selectedBgColor ? props.$selectedBgColor : '#eadcf3'}`
2634
) : (
27-
`${props.$selectedBgColor ? props.$selectedBgColor : '#efeff1'}`
35+
`${props.$selectedBgColor ? props.$selectedBgColor : '#f0e6f6'}`
2836
))};
29-
color: ${(props) => props.$selectedFontColor ? props.$selectedFontColor : '#4965f2'}
37+
color: ${(props) => props.$selectedFontColor ? props.$selectedFontColor : '#683e86'}
3038
}
3139
3240
svg {
@@ -36,8 +44,8 @@ const Wrapper = styled.div<{
3644
${(props) =>
3745
props.$selected &&
3846
css`
39-
color: ${props.$selectedFontColor ? props.$selectedFontColor : '#4965f2'};
40-
background: ${props.$selectedBgColor ? props.$selectedBgColor : '#ebf0f7'};
47+
color: ${props.$selectedFontColor ? props.$selectedFontColor : '#683e86'};
48+
background: ${props.$selectedBgColor ? props.$selectedBgColor : '#eadcf3'};
4149
`}
4250
`;
4351

@@ -47,6 +55,8 @@ export const SideBarItem = (props: SideBarItemProps) => {
4755
const currentPath = useLocation().pathname;
4856
return (
4957
<Wrapper
58+
type="button"
59+
aria-current={props.selected ? "page" : undefined}
5060
style={props.style}
5161
className={CNSidebarItem}
5262
$size={props.size}

0 commit comments

Comments
 (0)