mirror of
https://github.com/NetEase/tango.git
synced 2026-08-31 20:06:59 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f46137c56 | |||
| 1db52948db | |||
| 2550411c1c |
@@ -12,6 +12,7 @@ import {
|
||||
CodeEditor,
|
||||
Sandbox,
|
||||
DndQuery,
|
||||
themeLight,
|
||||
} from '@music163/tango-designer';
|
||||
import { createEngine, Workspace } from '@music163/tango-core';
|
||||
import { Logo, ProjectDetail, bootHelperVariables } from './share';
|
||||
@@ -52,6 +53,7 @@ export default function App() {
|
||||
const [menuData, setMenuData] = useState(false);
|
||||
return (
|
||||
<Designer
|
||||
theme={themeLight}
|
||||
engine={engine}
|
||||
config={{
|
||||
customActionVariables: bootHelperVariables,
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.5.9](https://github.com/netease/tango/compare/@music163/tango-designer@0.5.8...@music163/tango-designer@0.5.9) (2023-11-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- update theme ([2550411](https://github.com/netease/tango/commit/2550411c1c93037931d44aa9f7822ffe8caa900b))
|
||||
|
||||
## [0.5.8](https://github.com/netease/tango/compare/@music163/tango-designer@0.5.7...@music163/tango-designer@0.5.8) (2023-11-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@music163/tango-designer",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"description": "lowcode designer",
|
||||
"keywords": [
|
||||
"react"
|
||||
@@ -37,8 +37,8 @@
|
||||
"@music163/tango-core": "^0.2.7",
|
||||
"@music163/tango-helpers": "^0.1.8",
|
||||
"@music163/tango-sandbox": "^0.1.12",
|
||||
"@music163/tango-setting-form": "^0.2.11",
|
||||
"@music163/tango-ui": "^0.1.11",
|
||||
"@music163/tango-setting-form": "^0.2.12",
|
||||
"@music163/tango-ui": "^0.1.12",
|
||||
"antd": "^4.24.2",
|
||||
"cash-dom": "^8.1.2",
|
||||
"classnames": "^2.3.2",
|
||||
|
||||
@@ -36,6 +36,8 @@ export function DesignerPanel(props: DesignerPanelProps) {
|
||||
height="48px"
|
||||
bg="colors.custom.topNavBg"
|
||||
color="colors.custom.topNavColor"
|
||||
borderBottom="solid"
|
||||
borderColor="colors.custom.topNavBorderColor"
|
||||
className="DesignerPanelHeader"
|
||||
>
|
||||
<Box display="flex" alignItems="center">
|
||||
|
||||
@@ -3,9 +3,9 @@ import { SystemProvider, extendTheme } from 'coral-system';
|
||||
import { ConfigProvider } from 'antd';
|
||||
import { TangoEngineProvider, ITangoEngineContext } from '@music163/tango-context';
|
||||
import { createFromIconfontCN } from '@ant-design/icons';
|
||||
import { DesignerProvider, IDesignerContext } from './context';
|
||||
import { theme as baseTheme } from './theme';
|
||||
import zhCN from 'antd/lib/locale/zh_CN';
|
||||
import { DesignerProvider, IDesignerContext } from './context';
|
||||
import defaultTheme from './themes/default';
|
||||
|
||||
export interface DesignerProps extends IDesignerContext, ITangoEngineContext {
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ export function Designer(props: DesignerProps) {
|
||||
iconfontScriptUrl = '//at.alicdn.com/t/c/font_2891794_lzc7rtwuzf.js',
|
||||
children,
|
||||
} = props;
|
||||
const theme = useMemo(() => extendTheme(themeProp, baseTheme), [themeProp]);
|
||||
const theme = useMemo(() => extendTheme(themeProp, defaultTheme), [themeProp]);
|
||||
useEffect(() => {
|
||||
createFromIconfontCN({
|
||||
scriptUrl: iconfontScriptUrl,
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './sidebar';
|
||||
export * from './toolbar';
|
||||
export * from './selection-menu';
|
||||
export * from './widgets';
|
||||
export * from './themes';
|
||||
|
||||
export { register as registerSetter } from '@music163/tango-setting-form';
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@ const navigatorStyle = css`
|
||||
|
||||
.navigatorInput {
|
||||
flex: 1;
|
||||
border-color: transparent;
|
||||
background-color: var(--tango-colors-fill2);
|
||||
|
||||
&:focus {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -68,7 +74,7 @@ export class Navigator extends React.Component<NavigatorProps, NavigatorState> {
|
||||
className="navigator"
|
||||
bg="white"
|
||||
px="l"
|
||||
py="4px"
|
||||
py="m"
|
||||
borderBottom="solid"
|
||||
borderBottomColor="line.normal"
|
||||
css={navigatorStyle}
|
||||
|
||||
@@ -30,7 +30,6 @@ export const VariablePanel = observer(
|
||||
|
||||
return (
|
||||
<Panel
|
||||
shape="solid"
|
||||
className="ModelView"
|
||||
height={wrapperHeight}
|
||||
title="视图模型与变量管理"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { extendTheme } from 'coral-system';
|
||||
|
||||
export const theme = extendTheme({
|
||||
export default extendTheme({
|
||||
colors: {
|
||||
primary: {
|
||||
10: '#e8f3ff',
|
||||
@@ -27,11 +27,16 @@ export const theme = extendTheme({
|
||||
custom: {
|
||||
topNavBg: '#222',
|
||||
topNavColor: '#fff',
|
||||
topNavBorderColor: '#222',
|
||||
toolbarDividerColor: 'gray.60',
|
||||
toolbarButtonBg: 'rgba(223, 223, 223, 0.08)',
|
||||
toolbarButtonBgHover: '#4080ff',
|
||||
toolbarButtonBgDisabled: 'rgb(223,223,223)',
|
||||
toolbarButtonBgActive: '#4080ff',
|
||||
toolbarButtonTextColor: '#f5f5f5',
|
||||
toolbarButtonTextColorHover: '#FFF',
|
||||
toolbarButtonTextColorDisabled: '#bfbfbf',
|
||||
toolbarButtonTextColorDisabled: 'rgb(201,205,212)',
|
||||
toolbarButtonTextColorActive: '#fff',
|
||||
sidebarBg: '#fff',
|
||||
sidebarExpandBg: '#fff',
|
||||
sidebarItemActiveBg: '#f2f3f5',
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as themeDefault } from './default';
|
||||
export { default as themeLight } from './light';
|
||||
@@ -0,0 +1,25 @@
|
||||
import { extendTheme } from 'coral-system';
|
||||
|
||||
export default extendTheme({
|
||||
colors: {
|
||||
custom: {
|
||||
topNavBg: '#FFF',
|
||||
topNavColor: '#333',
|
||||
topNavBorderColor: 'rgb(229,230,235)',
|
||||
toolbarDividerColor: 'rgb(229,230,235)',
|
||||
toolbarButtonBg: 'rgb(242,243,245)',
|
||||
toolbarButtonBgHover: 'rgb(229,230,235)',
|
||||
toolbarButtonBgDisabled: 'rgb(247,248,250)',
|
||||
toolbarButtonBgActive: 'colors.brand',
|
||||
toolbarButtonTextColor: 'colors.text2',
|
||||
toolbarButtonTextColorHover: 'colors.text2',
|
||||
toolbarButtonTextColorDisabled: 'colors.text4',
|
||||
toolbarButtonTextColorActive: '#FFF',
|
||||
sidebarBg: '#fff',
|
||||
sidebarExpandBg: '#fff',
|
||||
sidebarItemActiveBg: '#f2f3f5',
|
||||
sidebarItemHoverBg: '#f2f3f5',
|
||||
viewportBg: '#f0f2f5',
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -10,7 +10,7 @@ export const HistoryTool = observer(() => {
|
||||
<ToggleButton
|
||||
shape="ghost"
|
||||
disabled={!workspace.history.couldBack || workspace.history.index === 0}
|
||||
tip="撤销"
|
||||
tooltip="撤销"
|
||||
onClick={() => {
|
||||
workspace.history.back();
|
||||
workspace.selectSource.clear();
|
||||
@@ -21,7 +21,7 @@ export const HistoryTool = observer(() => {
|
||||
<ToggleButton
|
||||
shape="ghost"
|
||||
disabled={!workspace.history.couldForward}
|
||||
tip="重做"
|
||||
tooltip="重做"
|
||||
onClick={() => {
|
||||
workspace.history.forward();
|
||||
workspace.selectSource.clear();
|
||||
|
||||
@@ -17,7 +17,7 @@ export const PreviewTool = observer(() => {
|
||||
designer.setActiveView('design');
|
||||
}
|
||||
}}
|
||||
tip="预览"
|
||||
tooltip="预览"
|
||||
>
|
||||
<EyeOutlined />
|
||||
</ToggleButton>
|
||||
|
||||
@@ -71,6 +71,7 @@ function PageSelect({ value, onSelect, onRemove, onUpdate, onCopy, options }: Pa
|
||||
}}
|
||||
/>
|
||||
}
|
||||
icon={<FileOutlined />}
|
||||
>
|
||||
{current?.name || current?.label || value}
|
||||
</ToggleButton>
|
||||
|
||||
@@ -81,7 +81,7 @@ function ToolbarItem({ placement, widgetProps, children }: ToolbarItemProps) {
|
||||
}
|
||||
|
||||
function Separator() {
|
||||
return <Box className="Separator" width={1} height={16} bg="gray.60" />;
|
||||
return <Box className="Separator" width={1} height={16} bg="colors.custom.toolbarDividerColor" />;
|
||||
}
|
||||
|
||||
Toolbar.Item = ToolbarItem;
|
||||
|
||||
@@ -17,7 +17,7 @@ export const ViewportSwitchTool = observer(() => {
|
||||
onClick={() => {
|
||||
designer.setSimulator('desktop');
|
||||
}}
|
||||
tip="桌面视图"
|
||||
tooltip="桌面视图"
|
||||
>
|
||||
<DesktopOutlined />
|
||||
</ToggleButton>
|
||||
@@ -27,7 +27,7 @@ export const ViewportSwitchTool = observer(() => {
|
||||
onClick={() => {
|
||||
designer.setSimulator('phone');
|
||||
}}
|
||||
tip="手机视图"
|
||||
tooltip="手机视图"
|
||||
>
|
||||
<MobileOutlined />
|
||||
</ToggleButton>
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.2.12](https://github.com/netease/tango/compare/@music163/tango-setting-form@0.2.11...@music163/tango-setting-form@0.2.12) (2023-11-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- update theme ([2550411](https://github.com/netease/tango/commit/2550411c1c93037931d44aa9f7822ffe8caa900b))
|
||||
- update type ([1db5294](https://github.com/netease/tango/commit/1db52948dbdc28f4533eb968f7da1bf6d16173d4))
|
||||
|
||||
## [0.2.11](https://github.com/netease/tango/compare/@music163/tango-setting-form@0.2.10...@music163/tango-setting-form@0.2.11) (2023-11-27)
|
||||
|
||||
**Note:** Version bump only for package @music163/tango-setting-form
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@music163/tango-setting-form",
|
||||
"version": "0.2.11",
|
||||
"version": "0.2.12",
|
||||
"description": "setting form of tango-apps",
|
||||
"author": "wwsun <ww.sun@outlook.com>",
|
||||
"homepage": "",
|
||||
@@ -30,7 +30,7 @@
|
||||
"@ant-design/icons": "^4.8.0",
|
||||
"@music163/tango-core": "^0.2.7",
|
||||
"@music163/tango-helpers": "^0.1.8",
|
||||
"@music163/tango-ui": "^0.1.11",
|
||||
"@music163/tango-ui": "^0.1.12",
|
||||
"antd": "^4.24.2",
|
||||
"coral-system": "^1.0.5",
|
||||
"mobx": "6.9.0",
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.1.12](https://github.com/netease/tango/compare/@music163/tango-ui@0.1.11...@music163/tango-ui@0.1.12) (2023-11-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- update theme ([2550411](https://github.com/netease/tango/commit/2550411c1c93037931d44aa9f7822ffe8caa900b))
|
||||
|
||||
## [0.1.11](https://github.com/netease/tango/compare/@music163/tango-ui@0.1.10...@music163/tango-ui@0.1.11) (2023-11-23)
|
||||
|
||||
**Note:** Version bump only for package @music163/tango-ui
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@music163/tango-ui",
|
||||
"version": "0.1.11",
|
||||
"version": "0.1.12",
|
||||
"description": "ui widgets of tango",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import cx from 'classnames';
|
||||
import { css, Button, HTMLCoralProps } from 'coral-system';
|
||||
import { css, Button, HTMLCoralProps, Box } from 'coral-system';
|
||||
import { DropDownProps, Dropdown, MenuProps, Tooltip, TooltipProps } from 'antd';
|
||||
import { DownOutlined } from '@ant-design/icons';
|
||||
|
||||
@@ -26,19 +26,11 @@ const buttonStyle = css`
|
||||
&.size-m {
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
|
||||
.anticon {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
&.size-l {
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
|
||||
.anticon {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
&.size-xl {
|
||||
@@ -106,10 +98,12 @@ const buttonStyle = css`
|
||||
|
||||
&.disabled {
|
||||
color: var(--tango-colors-custom-toolbarButtonTextColorDisabled, rgb(201, 205, 212));
|
||||
background-color: var(--tango-colors-custom-toolbarButtonBgDisabled, rgb(247, 248, 250));
|
||||
}
|
||||
|
||||
&.selected {
|
||||
background-color: var(--tango-colors-brand);
|
||||
color: var(--tango-colors-custom-toolbarButtonTextColorActive);
|
||||
background-color: var(--tango-colors-custom-toolbarButtonBgActive);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +118,7 @@ export interface ToggleButtonProps extends Omit<HTMLCoralProps<'button'>, 'type'
|
||||
type?: 'normal' | 'primary';
|
||||
selected?: boolean;
|
||||
disabled?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
/**
|
||||
* 提示文案
|
||||
* @deprecated 使用 tooltip 代替
|
||||
@@ -167,6 +162,7 @@ export function ToggleButton(props: ToggleButtonProps) {
|
||||
disabled,
|
||||
selected,
|
||||
children,
|
||||
icon,
|
||||
tip,
|
||||
tooltip = tip,
|
||||
tooltipPlacement = 'bottom',
|
||||
@@ -189,7 +185,14 @@ export function ToggleButton(props: ToggleButtonProps) {
|
||||
|
||||
let btn = (
|
||||
<Button css={buttonStyle} className={clazz} type="button" {...rest}>
|
||||
{children}
|
||||
<Box as="span">
|
||||
{icon && (
|
||||
<Box as="span" className="buttonIcon" mr="s">
|
||||
{icon}
|
||||
</Box>
|
||||
)}
|
||||
{children}
|
||||
</Box>
|
||||
{showDropdown ? <DownOutlined /> : null}
|
||||
</Button>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user