Skip to content

Commit 58f5bb8

Browse files
authored
Merge branch 'develop' into filter-highlight
2 parents e6ac33f + 09707ce commit 58f5bb8

File tree

107 files changed

+436
-873
lines changed

Some content is hidden

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

107 files changed

+436
-873
lines changed

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ yarn build
3636

3737

3838
## 功能
39-
- [x] 支持本地离线搜搜
39+
- [x] 支持本地离线搜索
4040
- [x] 版本化文档管理
4141
- [x] 离线静态部署
4242
- [x] 主题(fork 宜搭开发者中心)

docs/docs/api/command.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ sidebar_position: 10
2525

2626
注册一个新命令及其处理函数。
2727

28-
```
29-
typescriptCopy code
28+
```typescript
3029
/**
3130
* 注册一个新的命令及其处理程序。
3231
* @param command {IPublicTypeCommand} - 要注册的命令。
@@ -38,8 +37,7 @@ registerCommand(command: IPublicTypeCommand): void;
3837

3938
注销一个已存在的命令。
4039

41-
```
42-
typescriptCopy code
40+
```typescript
4341
/**
4442
* 注销一个已存在的命令。
4543
* @param name {string} - 要注销的命令的名称。
@@ -51,8 +49,7 @@ unregisterCommand(name: string): void;
5149

5250
根据名称和提供的参数执行命令,确保参数符合命令的定义。
5351

54-
```
55-
typescriptCopy code
52+
```typescript
5653
/**
5754
* 根据名称和提供的参数执行命令。
5855
* @param name {string} - 要执行的命令的名称。
@@ -65,8 +62,7 @@ executeCommand(name: string, args?: IPublicTypeCommandHandlerArgs): void;
6562

6663
批量执行命令,在所有命令执行后进行重绘,历史记录中只记录一次。
6764

68-
```
69-
typescriptCopy code
65+
```typescript
7066
/**
7167
* 批量执行命令,随后进行重绘,历史记录中只记录一次。
7268
* @param commands {Array} - 命令对象的数组,包含名称和可选参数。
@@ -78,8 +74,7 @@ batchExecuteCommand(commands: { name: string; args?: IPublicTypeCommandHandlerAr
7874

7975
列出所有已注册的命令。
8076

81-
```
82-
typescriptCopy code
77+
```typescript
8378
/**
8479
* 列出所有已注册的命令。
8580
* @returns {IPublicTypeListCommand[]} - 已注册命令的数组。
@@ -91,8 +86,7 @@ listCommands(): IPublicTypeListCommand[];
9186

9287
为命令执行过程中的错误注册错误处理回调函数。
9388

94-
```
95-
typescriptCopy code
89+
```typescript
9690
/**
9791
* 为命令执行过程中的错误注册一个回调函数。
9892
* @param callback {(name: string, error: Error) => void} - 错误处理的回调函数。

docs/docs/api/commonUI.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: commonUI - UI 组件库
33
sidebar_position: 10
44
---
55

6+
> **@since** v1.3.0
7+
68
## 简介
79
CommonUI API 是一个专为低代码引擎设计的组件 UI 库,使用它开发的插件,可以保证在不同项目和主题切换中能够保持一致性和兼容性。
810

docs/docs/api/hotkey.md

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ bind(
3232
- [IPublicTypeHotkeyCallback](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/hotkey-callback.ts)
3333
- [IPublicTypeDisposable](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/disposable.ts)
3434

35+
### mount
36+
37+
给指定窗口绑定快捷键
38+
39+
```typescript
40+
/**
41+
* 给指定窗口绑定快捷键
42+
* @param window 窗口的 window 对象
43+
*/
44+
mount(window: Window): IPublicTypeDisposable;
45+
46+
```
47+
3548

3649
## 使用示例
3750
### 基础示例

docs/docs/api/skeleton.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ sidebar_position: 10
1111

1212
![image.png](https://img.alicdn.com/imgextra/i4/O1CN01eVA0U41xYRP3e5zo0_!!6000000006455-2-tps-1780-996.png)
1313

14-
页面上可以扩展的区域共 5 个,具体如下:
15-
![image.png](https://img.alicdn.com/imgextra/i3/O1CN014d2AcS1D5c9TshEiQ_!!6000000000165-2-tps-1892-974.png)
14+
页面上可以扩展的区域共 6 个,具体如下:
15+
![image](https://github.com/alibaba/lowcode-engine/assets/11935995/ba4641dd-d346-4ef7-8b71-8ca211e6eaf4)
16+
1617
### 基本概念
1718
#### 扩展区域位置 (area)
1819
##### topArea
@@ -41,6 +42,11 @@ sidebar_position: 10
4142
##### rightArea
4243

4344
右侧区域,常用于组件的配置。常见的扩展有:统一处理组件的配置项,例如统一删除某一个配置项,统一添加某一个配置项的。
45+
46+
##### bottomArea
47+
48+
底部扩展区域。
49+
4450
##### toolbar
4551

4652
跟 topArea 类似,按需放置面板插件~

docs/docs/guide/appendix/npms.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ sidebar_position: 3
4343
| @alilc/lowcode-materials | [https://github.com/alibaba/lowcode-materials](https://github.com/alibaba/lowcode-materials) | packages/fusion-lowcode-materials |
4444
| @alilc/antd-lowcode-materials | [https://github.com/alibaba/lowcode-materials](https://github.com/alibaba/lowcode-materials) | packages/antd-lowcode-materials |
4545
| @alifd/layout(原 @alifd/pro-layout 升级后的版本) | [https://github.com/alibaba-fusion/layout](https://github.com/alibaba-fusion/layout) | |
46-
| | | |
46+
| @alilc/lowcode-engine-docs | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | docs |
4747
| | | |

docs/docs/guide/create/useRenderer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sidebar_position: 1
2020
[在 Demo 中](https://lowcode-engine.cn/demo/demo-general/index.html),右上角有渲染模块的示例使用方式:
2121
![Mar-13-2022 16-52-49.gif](https://img.alicdn.com/imgextra/i2/O1CN01PRsEl61o7Zct5fJML_!!6000000005178-1-tps-1534-514.gif)
2222

23-
基于官方提供的渲染模块 [@alifd/lowcode-react-renderer](https://github.com/alibaba/lowcode-engine/tree/main/packages/react-renderer),你可以在 React 上下文渲染低代码编辑器产出的页面。
23+
基于官方提供的渲染模块 [@alilc/lowcode-react-renderer](https://github.com/alibaba/lowcode-engine/tree/main/packages/react-renderer),你可以在 React 上下文渲染低代码编辑器产出的页面。
2424

2525
### 构造渲染模块所需数据
2626

docs/docs/participate/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ npm start
7070
在 lowcode-engine 目录下执行下面命令
7171
```
7272
cd docs
73-
73+
npm install
7474
npm start
7575
```
7676

docs/docs/specs/lowcode-spec.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sidebar_position: 0
2020
### 1.2 协议草案起草人
2121

2222
- 撰写:月飞、康为、林熠
23-
- 审阅:大果、潕量、九神、元彦、戊子、屹凡、金禅、前道、天晟、戊子、游鹿、光弘、力皓
23+
- 审阅:大果、潕量、九神、元彦、戊子、屹凡、金禅、前道、天晟、游鹿、光弘、力皓
2424

2525

2626
### 1.3 版本号
@@ -94,7 +94,7 @@ sidebar_position: 0
9494

9595
### 1.9 使用范围
9696

97-
本协议描述的是低代码搭建平台产物(应用、页面、区块、组件)的 schema 结构,以及实现其数据状态更新(内置 api)、能力扩展、国际化等方面完整,只在低代码搭建场景下可用;
97+
本协议描述的是低代码搭建平台产物(应用、页面、区块、组件)的 schema 结构,以及实现其数据状态更新(内置 api、能力扩展、国际化等方面完整,只在低代码搭建场景下可用;
9898

9999
### 1.10 协议目标
100100

@@ -430,7 +430,7 @@ import { Input as CustomInput } from '@ali/custom/lib/input';
430430
| 参数 | 说明 | 类型 | 支持变量 | 默认值 | 备注 |
431431
| ----------- | ---------------------- | -------------------------------------- | -------- | ------ | ----------------------------------------------------------------------------------------------------------- |
432432
| list[] | 数据源列表 | **ComponentDataSourceItem**[] | - | - | 成为为单个请求配置, 内容定义详见 [ComponentDataSourceItem 对象描述](#2314-componentdatasourceitem-对象描述) |
433-
| dataHandler | 所有请求数据的处理函数 | Function | - | - | 详见 [dataHandler Function 描述](#2317-datahandler-function 描述) |
433+
| dataHandler | 所有请求数据的处理函数 | Function | - | - | 详见 [dataHandler Function 描述](#2317-datahandler-function-描述) |
434434

435435
##### 2.3.1.4 ComponentDataSourceItem 对象描述
436436

@@ -447,7 +447,7 @@ import { Input as CustomInput } from '@ali/custom/lib/input';
447447
| errorHandler | request 失败后的回调函数 | Function | - | - | 参数:请求出错 promise 的 error 内容 |
448448
| options {} | 请求参数 | **ComponentDataSourceItemOptions**| - | - | 每种请求类型对应不同参数,详见 | 每种请求类型对应不同参数,详见 [ComponentDataSourceItemOptions 对象描述](#2315-componentdatasourceitemoptions-对象描述) |
449449

450-
**关于 dataHandler errorHandler 的细节说明:**
450+
**关于 dataHandler errorHandler 的细节说明:**
451451

452452
request 返回的是一个 promise,dataHandler 和 errorHandler 遵循 Promise 对象的 then 方法,实际使用方式如下:
453453

@@ -560,7 +560,7 @@ try {
560560
| 参数 | 说明 | 类型 | 支持变量 | 默认值 | 备注 |
561561
| ------------- | ---------------------- | ---------------- | -------- | ----------------- | ---------------------------------------------------------------------------------------------------------- |
562562
| id | 组件唯一标识 | String | - | | 可选,组件 id 由引擎随机生成(UUID),并保证唯一性,消费方为上层应用平台,在组件发生移动等场景需保持 id 不变 |
563-
| componentName | 组件名称 | String | - | Div | 必填,首字母大写,同 [componentsMap](#22-组件映射关系 a) 中的要求 |
563+
| componentName | 组件名称 | String | - | Div | 必填,首字母大写,同 [componentsMap](#22-组件映射关系a) 中的要求 |
564564
| props {} | 组件属性对象 | **Props**| - | {} | 必填,详见 | 必填,详见 [Props 结构描述](#2311-props-结构描述) |
565565
| condition | 渲染条件 | Boolean || true | 选填,根据表达式结果判断是否渲染物料;支持变量表达式 |
566566
| loop | 循环数据 | Array || - | 选填,默认不进行循环渲染;支持变量表达式 |
@@ -797,7 +797,7 @@ try {
797797
| 参数 | 说明 | 值类型 | 默认值 | 备注 |
798798
| ------ | ---------- | --------------------- | -------- | -------------------------------------------------------------- |
799799
| type | 值类型描述 | String | 'JSSlot' | 固定值 |
800-
| value | 具体的值 | NodeSchema \| NodeSchema[] | null | 内容为 NodeSchema 类型,详见[组件结构描述](#232-组件结构描述 a) |
800+
| value | 具体的值 | NodeSchema \| NodeSchema[] | null | 内容为 NodeSchema 类型,详见[组件结构描述](#232-组件结构描述(A)) |
801801
| params | 函数的参数 | String[] | null | 函数的入参,其子节点可以通过 `this[参数名]` 来获取对应的参数。 |
802802

803803

@@ -1124,7 +1124,7 @@ this.setState((prevState) => ({ count: prevState.count + 1 }));
11241124
| utils[] | 工具类扩展映射关系 | **UtilItem**[] | - | |
11251125
| *UtilItem*.name | 工具类扩展项名称 | String | - | |
11261126
| *UtilItem*.type | 工具类扩展项类型 | 枚举, `'npm'` (代表公网 npm 类型) / `'tnpm'` (代表阿里巴巴内部 npm 类型) / `'function'` (代表 Javascript 函数类型) | - | |
1127-
| *UtilItem*.content | 工具类扩展项内容 | [ComponentMap 类型](#22-组件映射关系 a) 或 [JSFunction](#2432事件函数类型 a) | - | |
1127+
| *UtilItem*.content | 工具类扩展项内容 | [ComponentMap 类型](#22-组件映射关系a)[JSFunction](#2342事件函数类型a) | - | |
11281128

11291129
描述示例:
11301130

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alilc/lowcode-engine-docs",
3-
"version": "1.2.31",
3+
"version": "1.2.36",
44
"description": "低代码引擎版本化文档",
55
"license": "MIT",
66
"files": [

packages/designer/jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const jestConfig = {
2222
// testMatch: ['**/selection.test.ts'],
2323
// testMatch: ['**/plugin/sequencify.test.ts'],
2424
// testMatch: ['**/builtin-simulator/utils/parse-metadata.test.ts'],
25+
// testMatch: ['**/setting/setting-top-entry.test.ts'],
2526
transformIgnorePatterns: [
2627
`/node_modules/(?!${esModules})/`,
2728
],

packages/designer/src/context-menu-actions.ts

+13-23
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@ import { Menu } from '@alifd/next';
55
import { engineConfig } from '@alilc/lowcode-editor-core';
66
import './context-menu-actions.scss';
77

8-
export interface IContextMenuActions {
9-
actions: IPublicTypeContextMenuAction[];
10-
11-
adjustMenuLayoutFn: (actions: IPublicTypeContextMenuItem[]) => IPublicTypeContextMenuItem[];
12-
13-
addMenuAction: IPublicApiMaterial['addContextMenuOption'];
14-
15-
removeMenuAction: IPublicApiMaterial['removeContextMenuOption'];
16-
17-
adjustMenuLayout: IPublicApiMaterial['adjustContextMenuLayout'];
18-
}
19-
208
let adjustMenuLayoutFn: Function = (actions: IPublicTypeContextMenuAction[]) => actions;
219

2210
export class GlobalContextMenuActions {
@@ -116,7 +104,7 @@ export class GlobalContextMenuActions {
116104

117105
const globalContextMenuActions = new GlobalContextMenuActions();
118106

119-
export class ContextMenuActions implements IContextMenuActions {
107+
export class ContextMenuActions {
120108
actions: IPublicTypeContextMenuAction[] = [];
121109

122110
designer: IDesigner;
@@ -204,30 +192,32 @@ export class ContextMenuActions implements IContextMenuActions {
204192
originalEvent.stopPropagation();
205193
originalEvent.preventDefault();
206194
// 如果右键的节点不在 当前选中的节点中,选中该节点
207-
if (!designer.currentSelection.has(node.id)) {
208-
designer.currentSelection.select(node.id);
195+
if (!designer.currentSelection?.has(node.id)) {
196+
designer.currentSelection?.select(node.id);
209197
}
210-
const nodes = designer.currentSelection.getNodes();
198+
const nodes = designer.currentSelection?.getNodes();
211199
this.handleContextMenu(nodes, originalEvent);
212200
}),
213201
);
214202
}
215203

216-
addMenuAction(action: IPublicTypeContextMenuAction) {
204+
addMenuAction: IPublicApiMaterial['addContextMenuOption'] = (action: IPublicTypeContextMenuAction) => {
217205
this.actions.push({
218206
type: IPublicEnumContextMenuType.MENU_ITEM,
219207
...action,
220208
});
221-
}
209+
};
222210

223-
removeMenuAction(name: string) {
211+
removeMenuAction: IPublicApiMaterial['removeContextMenuOption'] = (name: string) => {
224212
const i = this.actions.findIndex((action) => action.name === name);
225213
if (i > -1) {
226214
this.actions.splice(i, 1);
227215
}
228-
}
216+
};
229217

230-
adjustMenuLayout(fn: (actions: IPublicTypeContextMenuItem[]) => IPublicTypeContextMenuItem[]) {
218+
adjustMenuLayout: IPublicApiMaterial['adjustContextMenuLayout'] = (fn: (actions: IPublicTypeContextMenuItem[]) => IPublicTypeContextMenuItem[]) => {
231219
adjustMenuLayoutFn = fn;
232-
}
233-
}
220+
};
221+
}
222+
223+
export interface IContextMenuActions extends ContextMenuActions {}

packages/designer/src/designer/designer-view.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Component } from 'react';
22
import classNames from 'classnames';
33
import BuiltinDragGhostComponent from './drag-ghost';
4-
import { Designer, DesignerProps } from './designer';
4+
import { Designer, DesignerProps, IDesigner } from './designer';
55
import { ProjectView } from '../project';
66
import './designer.less';
77

88
type IProps = DesignerProps & {
9-
designer?: Designer;
9+
designer?: IDesigner;
1010
};
1111

1212
export class DesignerView extends Component<IProps> {
13-
readonly designer: Designer;
13+
readonly designer: IDesigner;
1414
readonly viewName: string | undefined;
1515

1616
constructor(props: IProps) {

0 commit comments

Comments
 (0)