mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-13 04:03:07 +00:00
commit
ca68ef9e10
155
README-zh_CN.md
Normal file
155
README-zh_CN.md
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<p align="center">
|
||||||
|
<a href="https://lowcode-engine.cn">
|
||||||
|
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01i8K9cD1d0HU7TjDtv_!!6000000003673-2-tps-500-591.png">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h1 align="center">LowCodeEngine</h1>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
一套面向扩展设计的企业级低代码技术体系
|
||||||
|
|
||||||
|
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
|
||||||
|
|
||||||
|
[![Discussions][discussions-image]][discussions-url] [![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
|
||||||
|
|
||||||
|
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
|
||||||
|
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
|
||||||
|
|
||||||
|
[download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square
|
||||||
|
[download-url]: https://npmjs.org/package/@alilc/lowcode-engine
|
||||||
|
[help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open
|
||||||
|
[help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
|
||||||
|
[discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square
|
||||||
|
[discussions-url]: https://github.com/alibaba/lowcode-engine/discussions
|
||||||
|
|
||||||
|
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
|
||||||
|
[issues-helper-url]: https://github.com/actions-cool/issues-helper
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[](https://lowcode-engine.cn)
|
||||||
|
|
||||||
|
简体中文 | [English](./README.md)
|
||||||
|
|
||||||
|
## ✨ 特性
|
||||||
|
|
||||||
|
- 🌈 提炼自企业级低代码平台的面向扩展设计的内核引擎,奉行最小内核,最强生态的设计理念
|
||||||
|
- 📦 开箱即用的高质量生态元素,包括 物料体系、设置器、插件 等
|
||||||
|
- ⚙️ 完善的工具链,支持 物料体系、设置器、插件 等生态元素的全链路研发周期
|
||||||
|
- 🔌 强大的扩展能力,已支撑近 100 个各种垂直类低代码平台
|
||||||
|
- 🛡 使用 TypeScript 开发,提供完整的类型定义文件
|
||||||
|
|
||||||
|
## 🎯 兼容环境
|
||||||
|
|
||||||
|
- 现代浏览器(Chrome >= 80, Edge >= 80, last 2 safari versions, last 2 firefox versions)
|
||||||
|
|
||||||
|
## 📚 引擎协议
|
||||||
|
|
||||||
|
引擎完整实现了《阿里巴巴中后台前端基础搭建协议规范》和《阿里巴巴中后台前端物料协议规范》,协议栈是低代码领域的物料能否流通的关键部分。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 🌰 使用示例
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @alilc/lowcode-engine --save-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
> **TIPS:仅支持 cdn 方式引入,npm 包用于提供 typings 等代码提示能力**
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { init, skeleton } from '@alilc/lowcode-engine';
|
||||||
|
|
||||||
|
skeleton.add({
|
||||||
|
area: 'topArea',
|
||||||
|
type: 'Widget',
|
||||||
|
name: 'logo',
|
||||||
|
content: YourFantaticLogo,
|
||||||
|
contentProps: {
|
||||||
|
logo:
|
||||||
|
'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png',
|
||||||
|
href: '/',
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
init(document.getElementById('lce'));
|
||||||
|
```
|
||||||
|
|
||||||
|
### 工程化配置:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"externals": {
|
||||||
|
"@alilc/lowcode-engine": "var window.AliLowCodeEngine",
|
||||||
|
"@alilc/lowcode-engine-ext": "var window.AliLowCodeEngineExt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### cdn 可选方式:
|
||||||
|
#### 方式 1(推荐):alifd cdn
|
||||||
|
```html
|
||||||
|
https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
||||||
|
|
||||||
|
https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 方式 2:unpkg
|
||||||
|
```html
|
||||||
|
https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
||||||
|
|
||||||
|
https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 方式 3:jsdelivr
|
||||||
|
```html
|
||||||
|
https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
||||||
|
|
||||||
|
https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 方式 4:使用自有 cdn
|
||||||
|
将源码中 packages/engine/dist 和 packages/(react|rax)-simulator-renderer/dist 下的文件传至你的 cdn 提供商
|
||||||
|
|
||||||
|
## 🔗 相关链接
|
||||||
|
|
||||||
|
- [官网首页](https://lowcode-engine.cn/)
|
||||||
|
- [Demo 马上玩](https://lowcode-engine.cn/demo) | [引擎 Demo 仓库](https://github.com/alibaba/lowcode-demo)
|
||||||
|
- [官方物料](https://github.com/alibaba/lowcode-materials)
|
||||||
|
- [官方设置器(setter)](https://github.com/alibaba/lowcode-engine-ext)
|
||||||
|
- [官方插件(plugin)](https://github.com/alibaba/lowcode-plugins)
|
||||||
|
- [生态元素(物料、setter、插件)工具链](https://www.yuque.com/lce/doc/ulvlkz)
|
||||||
|
- [用户文档](https://lowcode-engine.cn/doc)
|
||||||
|
- [API [WIP]](https://lowcode-engine.cn/doc?url=vlmeme)
|
||||||
|
|
||||||
|
## 💻 本地调试
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git clone git@github.com:alibaba/lowcode-engine.git
|
||||||
|
$ cd lowcode-engine
|
||||||
|
$ npm install
|
||||||
|
$ npm run setup
|
||||||
|
$ npm start
|
||||||
|
```
|
||||||
|
|
||||||
|
> 📢 npm 访问速度较慢,阿里员工可以使用 tnpm,其他同学建议使用 cnpm 或者指定镜像 registry。
|
||||||
|
>
|
||||||
|
> 📢 node 版本限定在 14
|
||||||
|
>
|
||||||
|
> 📢 windows 环境必须使用 [WSL](https://docs.microsoft.com/zh-cn/windows/wsl/install),其他终端不保证能正常运行
|
||||||
|
|
||||||
|
lowcode-engine 启动后,提供了几个 umd 文件,可以结合 [lowcode-demo](https://github.com/alibaba/lowcode-demo) 项目做调试,文件代理规则参考[这里](https://www.yuque.com/lce/doc/glz0fx)。
|
||||||
|
|
||||||
|
## 🤝 参与共建
|
||||||
|
|
||||||
|
请先阅读:
|
||||||
|
1. [如何配置引擎调试环境?](https://www.yuque.com/lce/doc/glz0fx)
|
||||||
|
2. [关于引擎的研发协作流程](https://www.yuque.com/lce/doc/contributing)
|
||||||
|
3. [引擎的工程化配置](https://www.yuque.com/lce/doc/gxwqg6)
|
||||||
|
|
||||||
|
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。(此段参考 [antd](https://github.com/ant-design/ant-design))
|
||||||
155
README.md
Normal file
155
README.md
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<p align="center">
|
||||||
|
<a href="http://lowcode-engine.cn">
|
||||||
|
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01i8K9cD1d0HU7TjDtv_!!6000000003673-2-tps-500-591.png">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h1 align="center">LowCodeEngine</h1>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
An enterprise-class low-code technology stack for scale-out design
|
||||||
|
|
||||||
|
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
|
||||||
|
|
||||||
|
[![Discussions][discussions-image]][discussions-url] [![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
|
||||||
|
|
||||||
|
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
|
||||||
|
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
|
||||||
|
|
||||||
|
[download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square
|
||||||
|
[download-url]: https://npmjs.org/package/@alilc/lowcode-engine
|
||||||
|
[help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open
|
||||||
|
[help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
|
||||||
|
[discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square
|
||||||
|
[discussions-url]: https://github.com/alibaba/lowcode-engine/discussions
|
||||||
|
|
||||||
|
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
|
||||||
|
[issues-helper-url]: https://github.com/actions-cool/issues-helper
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[](http://lowcode-engine.cn)
|
||||||
|
|
||||||
|
English | [简体中文](./README-zh_CN.md)
|
||||||
|
|
||||||
|
## ✨ Features
|
||||||
|
|
||||||
|
- 🌈 An extension-oriented kernel engine extracted from an enterprise-level low-code platform, pursuing the design concept of the smallest kernel and the strongest ecology
|
||||||
|
- 📦 Out-of-the-box high-quality ecological elements, including material systems, setters, plugins, etc.
|
||||||
|
- ⚙️ A complete tool chain, supporting the full-link R&D cycle of ecological elements such as material systems, setters, and plug-ins
|
||||||
|
- 🔌 Powerful expansion capability, has supported nearly 100 various vertical low-code platforms
|
||||||
|
- 🛡 Developed with TypeScript, providing complete type definition files
|
||||||
|
|
||||||
|
## 🎯 Compatible Environments
|
||||||
|
|
||||||
|
- Modern browsers (Chrome >= 80, Edge >= 80, last 2 safari versions, last 2 firefox versions)
|
||||||
|
|
||||||
|
## 📚 Engine Protocol
|
||||||
|
|
||||||
|
The engine fully implements the "Alibaba Mid-Backend Front-End Basic Construction Protocol Specification" and "Alibaba Mid-Backend Front-End Material Protocol Specification". The protocol stack is a key part of whether materials in the low-code field can be circulated.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 🌰 Usage example
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @alilc/lowcode-engine --save-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
> **TIPS: Only cdn import is supported, npm package is used to provide code hinting capabilities such as typings**
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { init, skeleton } from '@alilc/lowcode-engine';
|
||||||
|
|
||||||
|
skeleton.add({
|
||||||
|
area: 'topArea',
|
||||||
|
type: 'Widget',
|
||||||
|
name: 'logo',
|
||||||
|
content: YourFantaticLogo,
|
||||||
|
contentProps: {
|
||||||
|
logo:
|
||||||
|
'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png',
|
||||||
|
href: '/',
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
init(document.getElementById('lce'));
|
||||||
|
```
|
||||||
|
|
||||||
|
### Engineering configuration:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"externals": {
|
||||||
|
"@alilc/lowcode-engine": "var window.AliLowCodeEngine",
|
||||||
|
"@alilc/lowcode-engine-ext": "var window.AliLowCodeEngineExt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### cdn optional method:
|
||||||
|
#### Method 1: alifd cdn
|
||||||
|
```html
|
||||||
|
https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
||||||
|
|
||||||
|
https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Method 2: unpkg
|
||||||
|
```html
|
||||||
|
https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
||||||
|
|
||||||
|
https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Method 3: jsdelivr
|
||||||
|
```html
|
||||||
|
https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
||||||
|
|
||||||
|
https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Method 4: Use your own cdn
|
||||||
|
Pass the files under packages/engine/dist and packages/(react|rax)-simulator-renderer/dist in the source code to your cdn provider
|
||||||
|
|
||||||
|
## 🔗 Related Links
|
||||||
|
|
||||||
|
- [Official website home page](http://lowcode-engine.cn/)
|
||||||
|
- [Demo Play Now](http://lowcode-engine.cn/demo) | [Engine Demo Repository](https://github.com/alibaba/lowcode-demo)
|
||||||
|
- [Official Materials](https://github.com/alibaba/lowcode-materials)
|
||||||
|
- [official setter](https://github.com/alibaba/lowcode-engine-ext)
|
||||||
|
- [Official plugin (plugin)](https://github.com/alibaba/lowcode-plugins)
|
||||||
|
- [Ecological elements (materials, setters, plugins) toolchain](https://www.yuque.com/lce/doc/ulvlkz)
|
||||||
|
- [User Documentation](http://lowcode-engine.cn/doc)
|
||||||
|
- [API [WIP]](http://lowcode-engine.cn/doc?url=vlmeme)
|
||||||
|
|
||||||
|
## 💻 Local debugging
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git clone git@github.com: alibaba/lowcode-engine.git
|
||||||
|
$ cd lowcode-engine
|
||||||
|
$ npm install
|
||||||
|
$ npm run setup
|
||||||
|
$ npm start
|
||||||
|
```
|
||||||
|
|
||||||
|
> 📢 npm access speed is slow, Alibaba employees can use tnpm, other students recommend using cnpm or specifying a mirror registry.
|
||||||
|
>
|
||||||
|
> 📢 node version limited to 14
|
||||||
|
>
|
||||||
|
> 📢 Windows environment must use [WSL](https://docs.microsoft.com/zh-cn/windows/wsl/install), other terminals are not guaranteed to work normally
|
||||||
|
|
||||||
|
After lowcode-engine is started, several umd files are provided, which can be debugged in combination with the [lowcode-demo](https://github.com/alibaba/lowcode-demo) project. Refer to the file proxy rules [here](https:/ /www.yuque.com/lce/doc/glz0fx).
|
||||||
|
|
||||||
|
## 🤝 Participate in co-construction
|
||||||
|
|
||||||
|
Please read first:
|
||||||
|
1. [How to configure the engine debugging environment? ](https://www.yuque.com/lce/doc/glz0fx)
|
||||||
|
2. [About the R&D collaboration process of the engine](https://www.yuque.com/lce/doc/contributing)
|
||||||
|
3. [Engineering Configuration of Engine](https://www.yuque.com/lce/doc/gxwqg6)
|
||||||
|
|
||||||
|
> Strongly recommend reading ["The Wisdom of Asking Questions"](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way), ["How to Ask Questions to the Open Source Community"](https: //github.com/seajs/seajs/issues/545) and [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html), [ "How to Submit Unanswerable Questions to Open Source Projects"](https://zhuanlan.zhihu.com/p/25795393), better questions are easier to get help. (This paragraph refers to [antd](https://github.com/ant-design/ant-design))
|
||||||
@ -86,7 +86,7 @@ export class DocumentModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get fileName(): string {
|
get fileName(): string {
|
||||||
return this.rootNode?.getExtraProp('fileName')?.getAsString() || this.id;
|
return this.rootNode?.getExtraProp('fileName', false)?.getAsString() || this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
set fileName(fileName: string) {
|
set fileName(fileName: string) {
|
||||||
|
|||||||
@ -232,19 +232,39 @@ export class EngineConfig {
|
|||||||
this.config = config || {};
|
this.config = config || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定 key 是否有值
|
||||||
|
* @param key
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
has(key: string): boolean {
|
has(key: string): boolean {
|
||||||
return this.config[key] !== undefined;
|
return this.config[key] !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定 key 的值
|
||||||
|
* @param key
|
||||||
|
* @param defaultValue
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
get(key: string, defaultValue?: any): any {
|
get(key: string, defaultValue?: any): any {
|
||||||
return lodashGet(this.config, key, defaultValue);
|
return lodashGet(this.config, key, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置指定 key 的值
|
||||||
|
* @param key
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
set(key: string, value: any) {
|
set(key: string, value: any) {
|
||||||
this.config[key] = value;
|
this.config[key] = value;
|
||||||
this.notifyGot(key);
|
this.notifyGot(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量设值,set 的对象版本
|
||||||
|
* @param config
|
||||||
|
*/
|
||||||
setConfig(config: { [key: string]: any }) {
|
setConfig(config: { [key: string]: any }) {
|
||||||
if (config) {
|
if (config) {
|
||||||
Object.keys(config).forEach((key) => {
|
Object.keys(config).forEach((key) => {
|
||||||
@ -281,6 +301,12 @@ export class EngineConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定 key 的值,若此时还未赋值,则等待,若已有值,则直接返回值
|
||||||
|
* 注:此函数返回 Promise 实例,只会执行(fullfill)一次
|
||||||
|
* @param key
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
onceGot(key: string): Promise<any> {
|
onceGot(key: string): Promise<any> {
|
||||||
const val = this.config[key];
|
const val = this.config[key];
|
||||||
if (val !== undefined) {
|
if (val !== undefined) {
|
||||||
@ -291,6 +317,12 @@ export class EngineConfig {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定 key 的值,函数回调模式,若多次被赋值,回调会被多次调用
|
||||||
|
* @param key
|
||||||
|
* @param fn
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
onGot(key: string, fn: (data: any) => void): () => void {
|
onGot(key: string, fn: (data: any) => void): () => void {
|
||||||
const val = this.config?.[key];
|
const val = this.config?.[key];
|
||||||
if (val !== undefined) {
|
if (val !== undefined) {
|
||||||
|
|||||||
@ -187,7 +187,7 @@ class SettingFieldView extends Component<SettingFieldViewProps, SettingFieldView
|
|||||||
// eslint-disable-next-line react/no-unused-state
|
// eslint-disable-next-line react/no-unused-state
|
||||||
value,
|
value,
|
||||||
});
|
});
|
||||||
field.setValue(value);
|
field.setValue(value, true);
|
||||||
if (_onChange) _onChange(value, field);
|
if (_onChange) _onChange(value, field);
|
||||||
},
|
},
|
||||||
onInitial: () => {
|
onInitial: () => {
|
||||||
@ -199,7 +199,7 @@ class SettingFieldView extends Component<SettingFieldViewProps, SettingFieldView
|
|||||||
// eslint-disable-next-line react/no-unused-state
|
// eslint-disable-next-line react/no-unused-state
|
||||||
value,
|
value,
|
||||||
});
|
});
|
||||||
field.setValue(value);
|
field.setValue(value, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeProp: () => {
|
removeProp: () => {
|
||||||
|
|||||||
1
packages/engine/README-zh_CN.md
Symbolic link
1
packages/engine/README-zh_CN.md
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../README-zh_CN.md
|
||||||
@ -1,153 +0,0 @@
|
|||||||
<p align="center">
|
|
||||||
<a href="http://lowcode-engine.cn">
|
|
||||||
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01i8K9cD1d0HU7TjDtv_!!6000000003673-2-tps-500-591.png">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h1 align="center">LowCodeEngine</h1>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
一套面向扩展设计的企业级低代码技术体系
|
|
||||||
|
|
||||||
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
|
|
||||||
|
|
||||||
[![Discussions][discussions-image]][discussions-url] [![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
|
|
||||||
|
|
||||||
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
|
|
||||||
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
|
|
||||||
|
|
||||||
[download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square
|
|
||||||
[download-url]: https://npmjs.org/package/@alilc/lowcode-engine
|
|
||||||
[help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open
|
|
||||||
[help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
|
|
||||||
[discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square
|
|
||||||
[discussions-url]: https://github.com/alibaba/lowcode-engine/discussions
|
|
||||||
|
|
||||||
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
|
|
||||||
[issues-helper-url]: https://github.com/actions-cool/issues-helper
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
[](http://lowcode-engine.cn)
|
|
||||||
|
|
||||||
## ✨ 特性
|
|
||||||
|
|
||||||
- 🌈 提炼自企业级低代码平台的面向扩展设计的内核引擎,奉行最小内核,最强生态的设计理念
|
|
||||||
- 📦 开箱即用的高质量生态元素,包括 物料体系、设置器、插件 等
|
|
||||||
- ⚙️ 完善的工具链,支持 物料体系、设置器、插件 等生态元素的全链路研发周期
|
|
||||||
- 🔌 强大的扩展能力,已支撑近 100 个各种垂直类低代码平台
|
|
||||||
- 🛡 使用 TypeScript 开发,提供完整的类型定义文件
|
|
||||||
|
|
||||||
## 🎯 兼容环境
|
|
||||||
|
|
||||||
- 现代浏览器(Chrome >= 80, Edge >= 80, last 2 safari versions, last 2 firefox versions)
|
|
||||||
|
|
||||||
## 📚 引擎协议
|
|
||||||
|
|
||||||
引擎完整实现了《阿里巴巴中后台前端基础搭建协议规范》和《阿里巴巴中后台前端物料协议规范》,协议栈是低代码领域的物料能否流通的关键部分。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 🌰 使用示例
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install @alilc/lowcode-engine --save-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
> **TIPS:仅支持 cdn 方式引入,npm 包用于提供 typings 等代码提示能力**
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { init, skeleton } from '@alilc/lowcode-engine';
|
|
||||||
|
|
||||||
skeleton.add({
|
|
||||||
area: 'topArea',
|
|
||||||
type: 'Widget',
|
|
||||||
name: 'logo',
|
|
||||||
content: YourFantaticLogo,
|
|
||||||
contentProps: {
|
|
||||||
logo:
|
|
||||||
'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png',
|
|
||||||
href: '/',
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
align: 'left',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
init(document.getElementById('lce'));
|
|
||||||
```
|
|
||||||
|
|
||||||
### 工程化配置:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"externals": {
|
|
||||||
"@alilc/lowcode-engine": "var window.AliLowCodeEngine",
|
|
||||||
"@alilc/lowcode-engine-ext": "var window.AliLowCodeEngineExt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### cdn 可选方式:
|
|
||||||
#### 方式 1:alifd cdn
|
|
||||||
```html
|
|
||||||
https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
|
||||||
|
|
||||||
https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 方式 2:unpkg
|
|
||||||
```html
|
|
||||||
https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
|
||||||
|
|
||||||
https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 方式 3:jsdelivr
|
|
||||||
```html
|
|
||||||
https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
|
|
||||||
|
|
||||||
https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 方式 4:使用自有 cdn
|
|
||||||
将源码中 packages/engine/dist 和 packages/(react|rax)-simulator-renderer/dist 下的文件传至你的 cdn 提供商
|
|
||||||
|
|
||||||
## 🔗 相关链接
|
|
||||||
|
|
||||||
- [官网首页](http://lowcode-engine.cn/)
|
|
||||||
- [Demo 马上玩](http://lowcode-engine.cn/demo) | [引擎 Demo 仓库](https://github.com/alibaba/lowcode-demo)
|
|
||||||
- [官方物料](https://github.com/alibaba/lowcode-materials)
|
|
||||||
- [官方设置器(setter)](https://github.com/alibaba/lowcode-engine-ext)
|
|
||||||
- [官方插件(plugin)](https://github.com/alibaba/lowcode-plugins)
|
|
||||||
- [生态元素(物料、setter、插件)工具链](https://www.yuque.com/lce/doc/ulvlkz)
|
|
||||||
- [用户文档](http://lowcode-engine.cn/doc)
|
|
||||||
- [API [WIP]](http://lowcode-engine.cn/doc?url=vlmeme)
|
|
||||||
|
|
||||||
## 💻 本地调试
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ git clone git@github.com:alibaba/lowcode-engine.git
|
|
||||||
$ cd lowcode-engine
|
|
||||||
$ npm install
|
|
||||||
$ npm run setup
|
|
||||||
$ npm start
|
|
||||||
```
|
|
||||||
|
|
||||||
> 📢 npm 访问速度较慢,阿里员工可以使用 tnpm,其他同学建议使用 cnpm 或者指定镜像 registry。
|
|
||||||
>
|
|
||||||
> 📢 node 版本限定在 14
|
|
||||||
>
|
|
||||||
> 📢 windows 环境必须使用 [WSL](https://docs.microsoft.com/zh-cn/windows/wsl/install),其他终端不保证能正常运行
|
|
||||||
|
|
||||||
lowcode-engine 启动后,提供了几个 umd 文件,可以结合 [lowcode-demo](https://github.com/alibaba/lowcode-demo) 项目做调试,文件代理规则参考[这里](https://www.yuque.com/lce/doc/glz0fx)。
|
|
||||||
|
|
||||||
## 🤝 参与共建
|
|
||||||
|
|
||||||
请先阅读:
|
|
||||||
1. [如何配置引擎调试环境?](https://www.yuque.com/lce/doc/glz0fx)
|
|
||||||
2. [关于引擎的研发协作流程](https://www.yuque.com/lce/doc/contributing)
|
|
||||||
3. [引擎的工程化配置](https://www.yuque.com/lce/doc/gxwqg6)
|
|
||||||
|
|
||||||
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。(此段参考 [antd](https://github.com/ant-design/ant-design))
|
|
||||||
1
packages/engine/README.md
Symbolic link
1
packages/engine/README.md
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../README.md
|
||||||
@ -48,7 +48,7 @@ const plugins = new LowCodePluginManager(editor).toProxy();
|
|||||||
editor.set('plugins' as any, plugins);
|
editor.set('plugins' as any, plugins);
|
||||||
|
|
||||||
const { project: innerProject } = designer;
|
const { project: innerProject } = designer;
|
||||||
const skeletonCabin = getSkeletonCabin();
|
const skeletonCabin = getSkeletonCabin(innerSkeleton);
|
||||||
const { Workbench } = skeletonCabin;
|
const { Workbench } = skeletonCabin;
|
||||||
|
|
||||||
const hotkey = new Hotkey();
|
const hotkey = new Hotkey();
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
import {
|
|
||||||
createSettingFieldView,
|
|
||||||
PopupContext,
|
|
||||||
PopupPipe,
|
|
||||||
Workbench,
|
|
||||||
} from '@alilc/lowcode-editor-skeleton';
|
|
||||||
|
|
||||||
export default function getSkeletonCabin() {
|
|
||||||
return {
|
|
||||||
createSettingFieldView,
|
|
||||||
PopupContext,
|
|
||||||
PopupPipe,
|
|
||||||
Workbench,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
16
packages/engine/src/modules/skeleton-cabin.tsx
Normal file
16
packages/engine/src/modules/skeleton-cabin.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import {
|
||||||
|
Skeleton as InnerSkeleton,
|
||||||
|
createSettingFieldView,
|
||||||
|
PopupContext,
|
||||||
|
PopupPipe,
|
||||||
|
Workbench as InnerWorkbench,
|
||||||
|
} from '@alilc/lowcode-editor-skeleton';
|
||||||
|
|
||||||
|
export default function getSkeletonCabin(skeleton: InnerSkeleton) {
|
||||||
|
return {
|
||||||
|
createSettingFieldView,
|
||||||
|
PopupContext,
|
||||||
|
PopupPipe,
|
||||||
|
Workbench: (props: any) => <InnerWorkbench {...props} skeleton={skeleton} />, // hijack skeleton
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -10,7 +10,7 @@
|
|||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "build-scripts start --disable-open"
|
"start": "build-scripts start --disable-open --port 5555"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -348,7 +348,7 @@ export default class Node {
|
|||||||
* @param useMutator
|
* @param useMutator
|
||||||
*/
|
*/
|
||||||
insertBefore(node: Node, ref?: Node | undefined, useMutator?: boolean) {
|
insertBefore(node: Node, ref?: Node | undefined, useMutator?: boolean) {
|
||||||
this[nodeSymbol].insertBefore(node[nodeSymbol], ref?.[nodeSymbol], useMutator);
|
this[nodeSymbol].insertBefore(node[nodeSymbol] || node, ref?.[nodeSymbol], useMutator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -358,7 +358,7 @@ export default class Node {
|
|||||||
* @param useMutator
|
* @param useMutator
|
||||||
*/
|
*/
|
||||||
insertAfter(node: Node, ref?: Node | undefined, useMutator?: boolean) {
|
insertAfter(node: Node, ref?: Node | undefined, useMutator?: boolean) {
|
||||||
this[nodeSymbol].insertAfter(node[nodeSymbol], ref?.[nodeSymbol], useMutator);
|
this[nodeSymbol].insertAfter(node[nodeSymbol] || node, ref?.[nodeSymbol], useMutator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user