Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
JackLian committed May 31, 2023
2 parents 9d2214e + 9695add commit 0e90ea8
Show file tree
Hide file tree
Showing 171 changed files with 1,766 additions and 617 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/check base branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check Base Branch

on:
pull_request:
types: [opened]

jobs:
code-review:
name: Check
runs-on: ubuntu-latest

steps:
# 判断用户是否有写仓库权限
- name: 'Check User Permission'
uses: 'lannonbr/[email protected]'
with:
permission: 'write'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Check base branch name is develop or not'
if: github.event.pull_request.base.ref != 'develop' # check the target branch if it's master
uses: actions-cool/issues-helper@v2
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
感谢你的 PR,根据引擎的 [研发协作流程](https://lowcode-engine.cn/site/docs/participate/flow),请将目标合入分支设置为 **develop**。
Thanks in advance, according to the [Contribution Guideline](https://lowcode-engine.cn/site/docs/participate/flow), please set the base branch to **develop**.
@${{ github.event.pull_request.user.login }}
4 changes: 2 additions & 2 deletions .github/workflows/cov packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
package-manager: yarn
annotations: none

cov-utils:
cov-utils:
runs-on: ubuntu-latest
# skip fork's PR, otherwise it fails while making a comment
if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }}
Expand All @@ -91,6 +91,6 @@ cov-utils:
- uses: ArtiomTr/jest-coverage-report-action@v2
with:
working-directory: packages/utils
test-script: npm test
test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json
package-manager: yarn
annotations: none
2 changes: 1 addition & 1 deletion .github/workflows/help wanted.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Issue Reply
name: Help Wanted

on:
issues:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/insufficient information.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Issue Reply
name: Insufficient Info

on:
issues:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test modules.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lint & test
name: Lint & Test (Mods)

on:
push:
Expand Down
54 changes: 51 additions & 3 deletions .github/workflows/test packages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lint & test
name: Lint & Test (Pkgs)

on:
push:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
- name: test
run: cd packages/designer && npm test

editor-skeleton:
test-editor-skeleton:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -57,4 +57,52 @@ jobs:
run: npm i && npm run setup:skip-build

- name: test
run: cd packages/editor-skeleton && npm test
run: cd packages/editor-skeleton && npm test

test-renderer-core:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: install
run: npm i && npm run setup:skip-build

- name: test
run: cd packages/renderer-core && npm test

test-react-simulator-renderer:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: install
run: npm i && npm run setup:skip-build

- name: test
run: cd packages/react-simulator-renderer && npm test

test-utils:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: install
run: npm i && npm run setup:skip-build

- name: test
run: cd packages/utils && npm test
13 changes: 12 additions & 1 deletion docs/docs/api/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ common.utils.startTransaction(() => {
}, IPublicEnumTransitionType.repaint);
```

#### getConvertedExtraKey

props key 转化工具

```typescript
getConvertedExtraKey(key: string): string

```

**@since v1.0.17**

#### createIntl
i18n 相关工具
```typescript
Expand Down Expand Up @@ -144,4 +155,4 @@ const { intl, getLocale, setLocale } = common.utils.createIntl({
* get Workbench Component
*/
get Workbench(): Component;
```
```
11 changes: 11 additions & 0 deletions docs/docs/api/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ getPreference(): IPublicModelPreference;

**@since v1.1.0**

示例

```javascript
import { config } from '@alilc/lowcode-engine';

const panelName = 'outline-master-pane';

// 设置大纲树面板钉住,在大纲树下次重新打开时生效
config.getPreference().set(`${panelName}-pinned-status-isFloat`, false, 'skeleton')
```

## 事件

### onceGot
Expand Down
10 changes: 10 additions & 0 deletions docs/docs/api/material.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ material.getComponentMeta('Input');
```

#### getComponentMetasMap

获取所有已注册的物料元数据

```typescript
Expand All @@ -264,6 +265,15 @@ import { material } from '@alilc/lowcode-engine';
material.getComponentMetasMap();
```

#### refreshComponentMetasMap

刷新 componentMetasMap,可触发模拟器里的 components 重新构建

**@since v1.1.7**

```typescript
refreshComponentMetasMap(): void;
```

### 物料元数据管道函数
#### registerMetadataTransducer
Expand Down
21 changes: 21 additions & 0 deletions docs/docs/api/model/editor-view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: EditorView
sidebar_position: 12
---

> **[@experimental](./#experimental)**<br/>
> **@types** [IPublicModelEditorView](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/editor-view.ts)<br/>
> **@since** v1.1.7
窗口编辑视图

## 类型定义

```
import { IPublicModelPluginContext } from "./plugin-context";
export interface IPublicModelEditorView extends IPublicModelPluginContext {};
```

相关类型定义: [IPublicModelPluginContext](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/plugin-context.ts)
6 changes: 3 additions & 3 deletions docs/docs/api/model/node-children.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ delete(node: IPublicModelNode): boolean;
```typescript
/**
* 删除指定节点
* delete the node
* 插入一个节点
* insert the node
* @param node
*/
delete(node: IPublicModelNode): boolean;
insert(node: IPublicModelNode): boolean;
```
相关类型:[IPublicModelNode](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/node.ts)
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/api/model/window.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ sidebar_position: 12

关联模型 [IPublicModelResource](./resource)

### currentEditorView
窗口当前视图

`@type {IPublicModelEditorView}`

关联模型 [IPublicModelEditorView](./editor-view)

**@since v1.1.7**

### editorViews

窗口所有视图

`@type {IPublicModelEditorView[]}`

关联模型 [IPublicModelEditorView](./editor-view)

**@since v1.1.7**

## 方法

### importSchema
Expand Down Expand Up @@ -74,3 +93,15 @@ onChangeViewType(fn: (viewName: string) => void): IPublicTypeDisposable;
```

相关类型:[IPublicTypeDisposable](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/disposable.ts)

### onSave

窗口视图保存事件

```
onSave(fn: () => void): IPublicTypeDisposable;
```

相关类型:[IPublicTypeDisposable](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/disposable.ts)

**@since v1.1.7**
2 changes: 1 addition & 1 deletion docs/docs/api/setters.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class AltStringSetter extends React.PureComponent<AltStringSetter
```typescript
import AltStringSetter from './AltStringSetter';
import { setters } from '@alilc/lowcode-engine';
const { registerSetter } = registerSetter;
const { registerSetter } = setters;
registerSetter('AltStringSetter', AltStringSetter);
```
注册之后,我们就可以在物料中使用了,其中核心配置如下:
Expand Down
15 changes: 6 additions & 9 deletions docs/docs/demoUsage/panels/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ window.Next.Message.success('成功')

- 读取:每次打开面板时,都会尝试读取 schema 中的 originCode 字段,如果没有,则从 schema 上的字段还原代码;
- 写入:在关闭代码编辑面板(主动点击叉或者点击非代码编辑区块的被动关闭都算)时,将自动写入到 schema 中;您也可以在编辑过程中点击“保存”按钮手动保存;
| 源码面板中 | schema 中 |

| 源码面板中 | Schema 中 |
| --- | --- |
| 本地数据初始值设置:
![image.png](https://img.alicdn.com/imgextra/i4/O1CN01V6iaTY1gVNHi7gQfK_!!6000000004147-2-tps-370-146.png) | ![image.png](https://img.alicdn.com/imgextra/i2/O1CN010rhIPa268BEfGmzO6_!!6000000007616-2-tps-2098-826.png) |
| 生命周期方法:
![image.png](https://img.alicdn.com/imgextra/i4/O1CN010Y1TxV1QOvrVLRUjD_!!6000000001967-2-tps-478-260.png) | ![image.png](https://img.alicdn.com/imgextra/i3/O1CN01pbJzVQ1VSfAL7Lh8G_!!6000000002652-2-tps-2010-836.png) |
| 自定义函数:
![image.png](https://img.alicdn.com/imgextra/i4/O1CN01S2gjFk1CU3fm61eiD_!!6000000000083-2-tps-660-642.png) | ![image.png](https://img.alicdn.com/imgextra/i2/O1CN01X35YxU1GUkjj1YWVj_!!6000000000626-2-tps-1862-822.png) |
| 编译前全量代码:
![image.png](https://img.alicdn.com/imgextra/i2/O1CN01sbiK9N1kc1Uxp1OHY_!!6000000004703-2-tps-762-1122.png) | ![image.png](https://img.alicdn.com/imgextra/i3/O1CN01adKSg61QXAzRjQ4bm_!!6000000001985-2-tps-1906-796.png) |
| 本地数据初始值设置:![image.png](https://img.alicdn.com/imgextra/i4/O1CN01V6iaTY1gVNHi7gQfK_!!6000000004147-2-tps-370-146.png) | ![image.png](https://img.alicdn.com/imgextra/i2/O1CN010rhIPa268BEfGmzO6_!!6000000007616-2-tps-2098-826.png) |
| 生命周期方法:![image.png](https://img.alicdn.com/imgextra/i4/O1CN010Y1TxV1QOvrVLRUjD_!!6000000001967-2-tps-478-260.png) | ![image.png](https://img.alicdn.com/imgextra/i3/O1CN01pbJzVQ1VSfAL7Lh8G_!!6000000002652-2-tps-2010-836.png) |
| 自定义函数:![image.png](https://img.alicdn.com/imgextra/i4/O1CN01S2gjFk1CU3fm61eiD_!!6000000000083-2-tps-660-642.png) | ![image.png](https://img.alicdn.com/imgextra/i2/O1CN01X35YxU1GUkjj1YWVj_!!6000000000626-2-tps-1862-822.png) |
| 编译前全量代码:![image.png](https://img.alicdn.com/imgextra/i2/O1CN01sbiK9N1kc1Uxp1OHY_!!6000000004703-2-tps-762-1122.png) | ![image.png](https://img.alicdn.com/imgextra/i3/O1CN01adKSg61QXAzRjQ4bm_!!6000000001985-2-tps-1906-796.png) |


- 异常处理:如果代码解析失败,它将无法被正常保存到 schema 中,此时编辑器会弹层提示:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guide/design/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ simulator-renderer 通过调用 host 的方法,将 schema、components 等参
1. **画布内拖拽:**此时 sensor 是 simulatorHost,拖拽完成之后,会根据拖拽的位置来完成节点的精确插入。
2. **从组件面板拖拽到画布**:此时的 sensor 还是 simulatorHost,因为拖拽结束的目标还是画布。
3. **大纲树面板拖拽到画布中**:此时有两个 sensor,一个是大纲树,当我们拖拽到画布区域时,画布区域内的 simulatorHost 开始接管。
4. **画布拖拽到画布中**:从画布中开始拖拽时,最新生效的是 simulatorHost,当离开画布到大纲树时,大纲树 sensor 开始接管生效。当拖拽到大纲树的某一个节点下时,大纲树会将大纲树中的信息转化为 schema,然后渲染到画布中。
4. **画布拖拽到大纲树中**:从画布中开始拖拽时,最新生效的是 simulatorHost,当离开画布到大纲树时,大纲树 sensor 开始接管生效。当拖拽到大纲树的某一个节点下时,大纲树会将大纲树中的信息转化为 schema,然后渲染到画布中。
### 其他

引擎的编排能力远远不止上述所描述的功能,这里只描述了其核心和关键的功能。在整个引擎的迭代和设计过程中还有很多细节来使我们的引擎更好用、更容易扩展。
Expand Down
Loading

0 comments on commit 0e90ea8

Please sign in to comment.