Skip to content

Commit f9fe38e

Browse files
committed
Merge branch 'release/1.3.0'
2 parents e770636 + 1943172 commit f9fe38e

145 files changed

Lines changed: 1832 additions & 2999 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.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* @liujuping @JackLian
66

77
/modules/material-parser @akirakai
8-
/modules/code-generator @leoyuan
8+
/modules/code-generator @qingniaotonghua

.github/workflows/publish docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3434
- name: Get version
3535
id: get_version
36-
run: echo "::set-output name=version::$(node -p "require('./docs/package.json').version")"
36+
run: echo "version=$(node -p "require('./docs/package.json').version")" >> $GITHUB_OUTPUT
3737

3838
comment-pr:
3939
needs: publish-docs

.github/workflows/publish engine beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2828
- name: Get version
2929
id: get_version
30-
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
30+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

.github/workflows/publish engine.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3131
- name: Get version
3232
id: get_version
33-
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
33+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,5 @@ typings/
108108
# codealike
109109
codealike.json
110110
.node
111+
112+
.must.config.js

docs/docs/api/common.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,22 @@ const { intl, getLocale, setLocale } = common.utils.createIntl({
145145

146146
```
147147

148+
#### intl
149+
150+
i18n 转换方法
151+
152+
```typescript
153+
/**
154+
* i18n 转换方法
155+
*/
156+
intl(data: IPublicTypeI18nData | string, params?: object): string;
157+
```
158+
159+
##### 示例
160+
```
161+
const title = common.utils.intl(node.title)
162+
```
163+
148164
### skeletonCabin
149165
#### Workbench
150166
编辑器框架 View

docs/docs/api/commonUI.md

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
---
2+
title: commonUI - UI 组件库
3+
sidebar_position: 11
4+
---
5+
6+
## 简介
7+
CommonUI API 是一个专为低代码引擎设计的组件 UI 库,使用它开发的插件,可以保证在不同项目和主题切换中能够保持一致性和兼容性。
8+
9+
## 组件列表
10+
11+
### Tip
12+
13+
提示组件
14+
15+
| 参数 | 说明 | 类型 | 默认值 |
16+
|-----------|--------------|---------------------------------------|--------|
17+
| className | className | string (optional) | |
18+
| children | tip 的内容 | IPublicTypeI18nData \| ReactNode | |
19+
| direction | tip 的方向 | 'top' \| 'bottom' \| 'left' \| 'right' | |
20+
21+
22+
### HelpTip
23+
24+
带 help icon 的提示组件
25+
26+
| 参数 | 说明 | 类型 | 默认值 |
27+
|-----------|--------|-----------------------------------|--------|
28+
| help | 描述 | IPublicTypeHelpTipConfig | |
29+
| direction | 方向 | IPublicTypeTipConfig['direction'] | 'top' |
30+
| size | 方向 | IconProps['size'] | 'small'|
31+
32+
### Title
33+
34+
标题组件
35+
36+
| 参数 | 说明 | 类型 | 默认值 |
37+
|-----------|------------|-----------------------------|--------|
38+
| title | 标题内容 | IPublicTypeTitleContent | |
39+
| className | className | string (optional) | |
40+
| onClick | 点击事件 | () => void (optional) | |
41+
42+
### ContextMenu
43+
44+
| 参数 | 说明 | 类型 | 默认值 |
45+
|--------|----------------------------------------------------|------------------------------------|--------|
46+
| menus | 定义上下文菜单的动作数组 | IPublicTypeContextMenuAction[] | |
47+
| children | 组件的子元素 | React.ReactElement[] | |
48+
49+
**IPublicTypeContextMenuAction Interface**
50+
51+
| 参数 | 说明 | 类型 | 默认值 |
52+
|------------|--------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|----------------------------------------|
53+
| name | 动作的唯一标识符<br/>Unique identifier for the action | string | |
54+
| title | 显示的标题,可以是字符串或国际化数据<br/>Display title, can be a string or internationalized data | string \| IPublicTypeI18nData (optional) | |
55+
| type | 菜单项类型<br/>Menu item type | IPublicEnumContextMenuType (optional) | IPublicEnumContextMenuType.MENU_ITEM |
56+
| action | 点击时执行的动作,可选<br/>Action to execute on click, optional | (nodes: IPublicModelNode[]) => void (optional) | |
57+
| items | 子菜单项或生成子节点的函数,可选,仅支持两级<br/>Sub-menu items or function to generate child node, optional | Omit<IPublicTypeContextMenuAction, 'items'>[] \| ((nodes: IPublicModelNode[]) => Omit<IPublicTypeContextMenuAction, 'items'>[]) (optional) | |
58+
| condition | 显示条件函数<br/>Function to determine display condition | (nodes: IPublicModelNode[]) => boolean (optional) | |
59+
| disabled | 禁用条件函数,可选<br/>Function to determine disabled condition, optional | (nodes: IPublicModelNode[]) => boolean (optional) | |
60+
61+
**ContextMenu 示例**
62+
63+
```typescript
64+
const App = () => {
65+
const menuItems: IPublicTypeContextMenuAction[] = [
66+
{
67+
name: 'a',
68+
title: '选项 1',
69+
action: () => console.log('选项 1 被点击'),
70+
},
71+
{
72+
name: 'b',
73+
title: '选项 2',
74+
action: () => console.log('选项 2 被点击'),
75+
},
76+
];
77+
78+
const ContextMenu = ctx.commonUI.ContextMenu;
79+
80+
return (
81+
<div>
82+
<ContextMenu menus={menuItems}>
83+
<div>右键点击这里</div>
84+
</ContextMenu>
85+
</div>
86+
);
87+
};
88+
89+
export default App;
90+
```
91+
92+
**ContextMenu.create 示例**
93+
94+
```typescript
95+
const App = () => {
96+
const menuItems: IPublicTypeContextMenuAction[] = [
97+
{
98+
name: 'a',
99+
title: '选项 1',
100+
action: () => console.log('选项 1 被点击'),
101+
},
102+
{
103+
name: 'b',
104+
title: '选项 2',
105+
action: () => console.log('选项 2 被点击'),
106+
},
107+
];
108+
109+
const ContextMenu = ctx.commonUI.ContextMenu;
110+
111+
return (
112+
<div>
113+
<div onClick={(e) => {
114+
ContextMenu.create(menuItems, e);
115+
}}>点击这里</div>
116+
</div>
117+
);
118+
};
119+
120+
export default App;
121+
```
122+
123+
### Balloon
124+
125+
详细文档: [Balloon Documentation](https://fusion.design/pc/component/balloon)
126+
127+
### Breadcrumb
128+
详细文档: [Breadcrumb Documentation](https://fusion.design/pc/component/breadcrumb)
129+
130+
### Button
131+
详细文档: [Button Documentation](https://fusion.design/pc/component/button)
132+
133+
### Card
134+
详细文档:[Card Documentation](https://fusion.design/pc/component/card)
135+
136+
### Checkbox
137+
详细文档:[Checkbox Documentation](https://fusion.design/pc/component/checkbox)
138+
139+
### DatePicker
140+
详细文档:[DatePicker Documentation](https://fusion.design/pc/component/datepicker)
141+
142+
### Dialog
143+
详细文档:[Dialog Documentation](https://fusion.design/pc/component/dialog)
144+
145+
### Dropdown
146+
详细文档:[Dropdown Documentation](https://fusion.design/pc/component/dropdown)
147+
148+
### Form
149+
详细文档:[Form Documentation](https://fusion.design/pc/component/form)
150+
151+
### Icon
152+
详细文档:[Icon Documentation](https://fusion.design/pc/component/icon)
153+
154+
引擎默认主题支持的 icon 列表:https://fusion.design/64063/component/icon?themeid=20133
155+
156+
157+
### Input
158+
详细文档:[Input Documentation](https://fusion.design/pc/component/input)
159+
160+
### Loading
161+
详细文档:[Loading Documentation](https://fusion.design/pc/component/loading)
162+
163+
### Message
164+
详细文档:[Message Documentation](https://fusion.design/pc/component/message)
165+
166+
### Overlay
167+
详细文档:[Overlay Documentation](https://fusion.design/pc/component/overlay)
168+
169+
### Pagination
170+
详细文档:[Pagination Documentation](https://fusion.design/pc/component/pagination)
171+
172+
### Radio
173+
详细文档:[Radio Documentation](https://fusion.design/pc/component/radio)
174+
175+
### Search
176+
详细文档:[Search Documentation](https://fusion.design/pc/component/search)
177+
178+
### Select
179+
详细文档:[Select Documentation](https://fusion.design/pc/component/select)
180+
181+
### SplitButton
182+
详细文档:[SplitButton Documentation](https://fusion.design/pc/component/splitbutton)
183+
184+
### Step
185+
详细文档:[Step Documentation](https://fusion.design/pc/component/step)
186+
187+
### Switch
188+
详细文档:[Switch Documentation](https://fusion.design/pc/component/switch)
189+
190+
### Tab
191+
详细文档:[Tab Documentation](https://fusion.design/pc/component/tab)
192+
193+
### Table
194+
详细文档:[Table Documentation](https://fusion.design/pc/component/table)
195+
196+
### Tree
197+
详细文档:[Tree Documentation](https://fusion.design/pc/component/tree)
198+
199+
### TreeSelect
200+
详细文档:[TreeSelect Documentation](https://fusion.design/pc/component/treeselect)
201+
202+
### Upload
203+
详细文档:[Upload Documentation](https://fusion.design/pc/component/upload)
204+
205+
### Divider
206+
详细文档:[Divider Documentation](https://fusion.design/pc/component/divider)
207+
208+
## 说明
209+
210+
如果需要其他组件,可以提 issue 给我们。

docs/docs/api/configOptions.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ config.set('enableCondition', false)
185185

186186
`@type {boolean}` `@default {false}`
187187

188+
#### enableContextMenu - 开启右键菜单
189+
190+
`@type {boolean}` `@default {false}`
191+
192+
是否开启右键菜单
193+
188194
#### disableDetecting
189195

190196
`@type {boolean}` `@default {false}`
@@ -216,6 +222,12 @@ config.set('enableCondition', false)
216222

217223
是否在只有一个 item 的时候隐藏设置 tabs
218224

225+
#### hideComponentAction
226+
227+
`@type {boolean}` `@default {false}`
228+
229+
隐藏设计器辅助层
230+
219231
#### thisRequiredInJSE
220232

221233
`@type {boolean}` `@default {true}`

docs/docs/api/material.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,90 @@ material.modifyBuiltinComponentAction('remove', (action) => {
237237
});
238238
```
239239

240+
### 右键菜单项
241+
#### addContextMenuOption
242+
243+
添加右键菜单项
244+
245+
```typescript
246+
/**
247+
* 添加右键菜单项
248+
* @param action
249+
*/
250+
addContextMenuOption(action: IPublicTypeContextMenuAction): void;
251+
```
252+
253+
示例
254+
255+
```typescript
256+
import { IPublicEnumContextMenuType } from '@alilc/lowcode-types';
257+
258+
material.addContextMenuOption({
259+
name: 'parentItem',
260+
title: 'Parent Item',
261+
condition: (nodes) => true,
262+
items: [
263+
{
264+
name: 'childItem1',
265+
title: 'Child Item 1',
266+
action: (nodes) => console.log('Child Item 1 clicked', nodes),
267+
condition: (nodes) => true
268+
},
269+
// 分割线
270+
{
271+
type: IPublicEnumContextMenuType.SEPARATOR
272+
name: 'separator.1'
273+
}
274+
// 更多子菜单项...
275+
]
276+
});
277+
278+
```
279+
280+
#### removeContextMenuOption
281+
282+
删除特定右键菜单项
283+
284+
```typescript
285+
/**
286+
* 删除特定右键菜单项
287+
* @param name
288+
*/
289+
removeContextMenuOption(name: string): void;
290+
```
291+
292+
#### adjustContextMenuLayout
293+
294+
调整右键菜单项布局,每次调用都会覆盖之前注册的调整函数,只有最后注册的函数会被应用。
295+
296+
```typescript
297+
/**
298+
* 调整右键菜单项布局
299+
* @param actions
300+
*/
301+
adjustContextMenuLayout(fn: (actions: IPublicTypeContextMenuItem[]) => IPublicTypeContextMenuItem[]): void;
302+
```
303+
304+
**示例**
305+
306+
通过 adjustContextMenuLayout 补充分割线
307+
308+
```typescript
309+
material.adjustContextMenuLayout((actions: IPublicTypeContextMenuAction) => {
310+
const names = ['a', 'b'];
311+
const newActions = [];
312+
actions.forEach(d => {
313+
newActions.push(d);
314+
if (names.include(d.name)) {
315+
newActions.push({ type: 'separator' })
316+
}
317+
});
318+
return newActions
319+
})
320+
```
321+
240322
### 物料元数据
323+
241324
#### getComponentMeta
242325
获取指定名称的物料元数据
243326

docs/docs/guide/appendix/npms.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ sidebar_position: 3
1212
| @alilc/lowcode-engine | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/engine |
1313
| @alilc/lowcode-plugin-designer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/plugin-designer |
1414
| @alilc/lowcode-plugin-outline-pane | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/plugin-outline-pane |
15-
| @alilc/lowcode-rax-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/rax-renderer |
16-
| @alilc/lowcode-rax-simulator-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/rax-simulator-renderer |
1715
| @alilc/lowcode-react-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/react-renderer |
1816
| @alilc/lowcode-react-simulator-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/react-simulator-renderer |
1917
| @alilc/lowcode-renderer-core | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/renderer-core |

0 commit comments

Comments
 (0)