mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 10:57:19 +00:00
Merge remote-tracking branch 'origin/release/1.0.28' into release/0.9.54
This commit is contained in:
commit
681d775af4
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@ packages/*/lib/
|
||||
packages/*/es/
|
||||
packages/*/dist/
|
||||
packages/*/output/
|
||||
packages/demo/
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
deploy-space/packages
|
||||
|
||||
51
CHANGELOG.md
51
CHANGELOG.md
@ -3,6 +3,57 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package undefined
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package undefined
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package undefined
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 支持小程序低代码组件 ([b0aeed3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/b0aeed3))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package undefined
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package undefined
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"lerna": "2.11.0",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"npmClient": "tyarn",
|
||||
"registry": "http://registry.npm.alibaba-inc.com",
|
||||
"useWorkspaces": true,
|
||||
@ -29,6 +29,7 @@
|
||||
"**/*.md",
|
||||
"**/test/**"
|
||||
],
|
||||
"message": "chore(release): publish %v",
|
||||
"conventionalCommits": true
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
"clean": "rm -rf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build",
|
||||
"lint": "eslint --ext .ts,.tsx,.js,.jsx ./ --quiet",
|
||||
"lint:fix": "eslint --ext .ts,.tsx,.js,.jsx ./ --quiet --fix",
|
||||
"pub": "lerna publish --force-publish --cd-version patch --message \"chore(release): publish %v\"",
|
||||
"pub:prerelease": "lerna publish --force-publish --cd-version prerelease --npm-tag beta --preid beta --message \"chore(release): publish %v\"",
|
||||
"pub:prepatch": "lerna publish --force-publish --cd-version prepatch --npm-tag beta --preid beta --message \"chore(release): publish %v\"",
|
||||
"pub": "lerna publish --force-publish --cd-version patch",
|
||||
"pub:prepatch": "lerna publish --force-publish --cd-version prepatch --npm-tag beta --preid beta",
|
||||
"pub:prerelease": "lerna publish --force-publish --cd-version prerelease --npm-tag beta --preid beta",
|
||||
"setup": "./scripts/setup.sh",
|
||||
"start": "./scripts/start.sh",
|
||||
"start:demo": "./scripts/start.sh @ali/lowcode-demo",
|
||||
"start:server": "./scripts/start-server.sh",
|
||||
"test": "lerna run test --stream",
|
||||
"test:snapshot": "lerna run test:snapshot",
|
||||
|
||||
@ -14,6 +14,8 @@ module.exports = {
|
||||
'no-useless-constructor': 1,
|
||||
'no-empty-function': 1,
|
||||
'@typescript-eslint/member-ordering': 0,
|
||||
'lines-between-class-members': 0
|
||||
'lines-between-class-members': 0,
|
||||
'no-await-in-loop': 0,
|
||||
'no-plusplus': 0,
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-designer
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-designer
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-designer
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-designer
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-designer
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-designer
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-designer",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Designer for Ali LowCode Engine",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -14,15 +14,16 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ali/lowcode-editor-core": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-core": "^1.0.27",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"classnames": "^2.2.6",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.5",
|
||||
"event": "^1.0.0",
|
||||
"react": "^16",
|
||||
"react-dom": "^16.7.0"
|
||||
"react-dom": "^16.7.0",
|
||||
"zen-logger": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ali/lowcode-test-mate": "^1.0.1",
|
||||
|
||||
@ -640,11 +640,11 @@ export class DocumentModel {
|
||||
const map: any = {};
|
||||
for (const node of this._nodesMap.values()) {
|
||||
const { componentName } = node || {};
|
||||
if (!map[componentName] && node?.componentMeta?.npm?.package) {
|
||||
if (!map[componentName] && node.componentMeta?.npm?.package) {
|
||||
map[componentName] = true;
|
||||
componentsMap.push({
|
||||
...node.componentMeta.npm,
|
||||
componentName,
|
||||
package: node?.componentMeta?.npm?.package,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,3 +4,4 @@ export * from './designer';
|
||||
export * from './document';
|
||||
export * from './project';
|
||||
export * from './builtin-simulator';
|
||||
export * from './plugin';
|
||||
|
||||
3
packages/designer/src/plugin/index.ts
Normal file
3
packages/designer/src/plugin/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from './plugin-context';
|
||||
export * from './plugin-manager';
|
||||
export * from './plugin';
|
||||
42
packages/designer/src/plugin/plugin-context.ts
Normal file
42
packages/designer/src/plugin/plugin-context.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import { Editor, Hotkey, hotkey } from '@ali/lowcode-editor-core';
|
||||
import { Skeleton } from '@ali/lowcode-editor-skeleton';
|
||||
import { ILowCodePluginConfig, ILowCodePluginManager, ILowCodePluginContext, IDesignerHelper } from '@ali/lowcode-types';
|
||||
import { getLogger, Logger } from '../utils';
|
||||
import {
|
||||
registerMetadataTransducer,
|
||||
addBuiltinComponentAction,
|
||||
removeBuiltinComponentAction,
|
||||
} from '../component-meta';
|
||||
import { Designer } from '../designer';
|
||||
|
||||
export default class PluginContext implements ILowCodePluginContext {
|
||||
editor: Editor;
|
||||
skeleton: Skeleton;
|
||||
designer: Designer;
|
||||
hotkey: Hotkey;
|
||||
logger: Logger;
|
||||
plugins: ILowCodePluginManager;
|
||||
designerHelper: IDesignerHelper;
|
||||
|
||||
constructor(editor: Editor, plugins: ILowCodePluginManager) {
|
||||
this.editor = editor;
|
||||
this.designer = editor.get('designer')!;
|
||||
this.skeleton = editor.get('skeleton')!;
|
||||
this.hotkey = hotkey;
|
||||
this.plugins = plugins;
|
||||
this.designerHelper = this.createDesignerHelper();
|
||||
}
|
||||
|
||||
private createDesignerHelper(): IDesignerHelper {
|
||||
return {
|
||||
registerMetadataTransducer,
|
||||
addBuiltinComponentAction,
|
||||
removeBuiltinComponentAction,
|
||||
};
|
||||
}
|
||||
|
||||
setLogger(config: ILowCodePluginConfig): void {
|
||||
this.logger = getLogger({ level: 'log', bizName: `designer:plugin:${config.name}` });
|
||||
}
|
||||
}
|
||||
|
||||
113
packages/designer/src/plugin/plugin-manager.ts
Normal file
113
packages/designer/src/plugin/plugin-manager.ts
Normal file
@ -0,0 +1,113 @@
|
||||
import { Editor } from '@ali/lowcode-editor-core';
|
||||
import { CompositeObject, ILowCodePlugin, ILowCodePluginConfig, ILowCodePluginManager, ILowCodePluginContext } from '@ali/lowcode-types';
|
||||
import { LowCodePlugin } from './plugin';
|
||||
import LowCodePluginContext from './plugin-context';
|
||||
import { getLogger, invariant } from '../utils';
|
||||
import sequencify from './sequencify';
|
||||
|
||||
const logger = getLogger({ level: 'warn', bizName: 'designer:pluginManager' });
|
||||
|
||||
export class LowCodePluginManager implements ILowCodePluginManager {
|
||||
private plugins: ILowCodePlugin[] = [];
|
||||
|
||||
private pluginsMap: Map<string, ILowCodePlugin> = new Map();
|
||||
|
||||
private editor: Editor;
|
||||
|
||||
constructor(editor: Editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
private _getLowCodePluginContext() {
|
||||
return new LowCodePluginContext(this.editor, this);
|
||||
}
|
||||
|
||||
register(
|
||||
pluginConfig: (ctx: ILowCodePluginContext, options: CompositeObject) => ILowCodePluginConfig,
|
||||
options: CompositeObject,
|
||||
): void {
|
||||
const ctx = this._getLowCodePluginContext();
|
||||
const config = pluginConfig(ctx, options);
|
||||
invariant(config.name, `${config.name} required`, config);
|
||||
ctx.setLogger(config);
|
||||
invariant(!this.pluginsMap.has(config.name), `${config.name} already exists`, this.pluginsMap.get(config.name));
|
||||
const plugin = new LowCodePlugin(this, config, options);
|
||||
this.plugins.push(plugin);
|
||||
this.pluginsMap.set(plugin.name, plugin);
|
||||
logger.log('plugin registered with config:', config, ', options:', options);
|
||||
}
|
||||
|
||||
get(pluginName: string): ILowCodePlugin | undefined {
|
||||
return this.pluginsMap.get(pluginName);
|
||||
}
|
||||
|
||||
getAll(): ILowCodePlugin[] {
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
has(pluginName: string): boolean {
|
||||
return this.pluginsMap.has(pluginName);
|
||||
}
|
||||
|
||||
async delete(pluginName: string): Promise<boolean> {
|
||||
const idx = this.plugins.findIndex(plugin => plugin.name === pluginName);
|
||||
if (idx < -1) return false;
|
||||
const plugin = this.plugins[idx];
|
||||
await plugin.destroy();
|
||||
|
||||
this.plugins.splice(idx, 1);
|
||||
return this.pluginsMap.delete(pluginName);
|
||||
}
|
||||
|
||||
async init() {
|
||||
const pluginNames: string[] = [];
|
||||
const pluginObj: { [name: string]: ILowCodePlugin } = {};
|
||||
this.plugins.forEach(plugin => {
|
||||
pluginNames.push(plugin.name);
|
||||
pluginObj[plugin.name] = plugin;
|
||||
});
|
||||
const { missingTasks, sequence } = sequencify(pluginObj, pluginNames);
|
||||
invariant(!missingTasks.length, 'plugin dependency missing', missingTasks);
|
||||
logger.log('load plugin sequence:', sequence);
|
||||
|
||||
for (const pluginName of sequence) {
|
||||
await this.pluginsMap.get(pluginName)!.init();
|
||||
}
|
||||
}
|
||||
|
||||
async destroy() {
|
||||
for (const plugin of this.plugins) {
|
||||
await plugin.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
get size() {
|
||||
return this.pluginsMap.size;
|
||||
}
|
||||
|
||||
toProxy() {
|
||||
return new Proxy(this, {
|
||||
get(target, prop, receiver) {
|
||||
if (target.pluginsMap.has(prop as string)) {
|
||||
// 禁用态的插件,直接返回 undefined
|
||||
if (target.pluginsMap.get(prop as string)!.disabled) {
|
||||
return undefined;
|
||||
}
|
||||
return target.pluginsMap.get(prop as string)?.toProxy();
|
||||
}
|
||||
return Reflect.get(target, prop, receiver);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
setDisabled(pluginName: string, flag = true) {
|
||||
logger.warn(`plugin:${pluginName} has been set disable:${flag}`);
|
||||
this.pluginsMap.get(pluginName)?.setDisabled(flag);
|
||||
}
|
||||
|
||||
async dispose() {
|
||||
await this.destroy();
|
||||
this.plugins = [];
|
||||
this.pluginsMap.clear();
|
||||
}
|
||||
}
|
||||
99
packages/designer/src/plugin/plugin.ts
Normal file
99
packages/designer/src/plugin/plugin.ts
Normal file
@ -0,0 +1,99 @@
|
||||
import {
|
||||
ILowCodePlugin,
|
||||
ILowCodePluginConfig,
|
||||
ILowCodePluginManager,
|
||||
CompositeObject,
|
||||
} from '@ali/lowcode-types';
|
||||
import { EventEmitter } from 'events';
|
||||
import { getLogger, Logger, invariant } from '../utils';
|
||||
|
||||
export class LowCodePlugin implements ILowCodePlugin {
|
||||
config: ILowCodePluginConfig;
|
||||
|
||||
logger: Logger;
|
||||
|
||||
private manager: ILowCodePluginManager;
|
||||
|
||||
private options?: CompositeObject;
|
||||
|
||||
private emitter: EventEmitter;
|
||||
|
||||
private _inited: boolean;
|
||||
|
||||
/**
|
||||
* 标识插件状态,是否被 disabled
|
||||
*/
|
||||
private _disabled: boolean;
|
||||
|
||||
constructor(
|
||||
manager: ILowCodePluginManager,
|
||||
config: ILowCodePluginConfig,
|
||||
options: CompositeObject = {},
|
||||
) {
|
||||
this.manager = manager;
|
||||
this.config = config;
|
||||
this.options = options;
|
||||
this.emitter = new EventEmitter();
|
||||
this.logger = getLogger({ level: 'warn', bizName: `designer:plugin:${config.name}` });
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this.config.name;
|
||||
}
|
||||
|
||||
get dep() {
|
||||
return this.config.dep || [];
|
||||
}
|
||||
|
||||
get disabled() {
|
||||
return this._disabled;
|
||||
}
|
||||
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): any {
|
||||
return this.emitter.on(event, listener);
|
||||
}
|
||||
|
||||
emit(event: string | symbol, ...args: any[]) {
|
||||
return this.emitter.emit(event, ...args);
|
||||
}
|
||||
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): any {
|
||||
return this.emitter.off(event, listener);
|
||||
}
|
||||
|
||||
removeAllListeners(event: string | symbol): any {
|
||||
return this.emitter.removeAllListeners(event);
|
||||
}
|
||||
|
||||
async init() {
|
||||
this.logger.log('method init called');
|
||||
await this.config.init?.call(undefined);
|
||||
this._inited = true;
|
||||
}
|
||||
|
||||
async destroy() {
|
||||
this.logger.log('method destroy called');
|
||||
await this.config?.destroy?.call(undefined);
|
||||
}
|
||||
|
||||
setDisabled(flag = true) {
|
||||
this._disabled = flag;
|
||||
}
|
||||
|
||||
toProxy() {
|
||||
invariant(this._inited, 'Could not call toProxy before init');
|
||||
const exports = this.config.exports?.();
|
||||
return new Proxy(this, {
|
||||
get(target, prop, receiver) {
|
||||
if ({}.hasOwnProperty.call(exports, prop)) {
|
||||
return exports?.[prop as string];
|
||||
}
|
||||
return Reflect.get(target, prop, receiver);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
dispose() {
|
||||
return this.manager.delete(this.name);
|
||||
}
|
||||
}
|
||||
40
packages/designer/src/plugin/sequencify.ts
Normal file
40
packages/designer/src/plugin/sequencify.ts
Normal file
@ -0,0 +1,40 @@
|
||||
function sequence(tasks, names, results, missing, recursive, nest) {
|
||||
names.forEach((name) => {
|
||||
if (results.indexOf(name) !== -1) {
|
||||
return; // de-dup results
|
||||
}
|
||||
const node = tasks[name];
|
||||
if (!node) {
|
||||
missing.push(name);
|
||||
} else if (nest.indexOf(name) > -1) {
|
||||
nest.push(name);
|
||||
recursive.push(nest.slice(0));
|
||||
nest.pop(name);
|
||||
} else if (node.dep.length) {
|
||||
nest.push(name);
|
||||
sequence(tasks, node.dep, results, missing, recursive, nest); // recurse
|
||||
nest.pop(name);
|
||||
}
|
||||
results.push(name);
|
||||
});
|
||||
}
|
||||
|
||||
// tasks: object with keys as task names
|
||||
// names: array of task names
|
||||
export default function (tasks, names) {
|
||||
let results = []; // the final sequence
|
||||
const missing = []; // missing tasks
|
||||
const recursive = []; // recursive task dependencies
|
||||
|
||||
sequence(tasks, names, results, missing, recursive, []);
|
||||
|
||||
if (missing.length || recursive.length) {
|
||||
results = []; // results are incomplete at best, completely wrong at worst, remove them to avoid confusion
|
||||
}
|
||||
|
||||
return {
|
||||
sequence: results,
|
||||
missingTasks: missing,
|
||||
recursiveDependencies: recursive,
|
||||
};
|
||||
}
|
||||
@ -47,6 +47,7 @@ export class Project {
|
||||
return {
|
||||
...this.data,
|
||||
// todo: future change this filter
|
||||
componentsMap: this.currentDocument?.getComponentsMap(),
|
||||
componentsTree: this.documents.filter((doc) => !doc.isBlank()).map((doc) => doc.schema),
|
||||
};
|
||||
}
|
||||
|
||||
4
packages/designer/src/utils/index.ts
Normal file
4
packages/designer/src/utils/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export * from './invariant';
|
||||
export * from './slot';
|
||||
export * from './tree';
|
||||
export * from './logger';
|
||||
5
packages/designer/src/utils/invariant.ts
Normal file
5
packages/designer/src/utils/invariant.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export function invariant(check: any, message: string, thing?: any) {
|
||||
if (!check) {
|
||||
throw new Error('[designer] Invariant failed: ' + message + (thing ? ` in '${thing}'` : ''));
|
||||
}
|
||||
}
|
||||
7
packages/designer/src/utils/logger.ts
Normal file
7
packages/designer/src/utils/logger.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import Logger, { Level } from 'zen-logger';
|
||||
|
||||
export { Logger };
|
||||
|
||||
export function getLogger(config: { level: Level, bizName: string }): Logger {
|
||||
return new Logger(config);
|
||||
}
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-core
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-core
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-core
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-core
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-core
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-core
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-editor-core",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Core Api for Ali lowCode engine",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
@ -15,8 +15,8 @@
|
||||
"cloud-build": "build-scripts build --skip-demo"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@alifd/next": "^1.19.16",
|
||||
"@recore/obx": "^1.0.9",
|
||||
"@recore/obx-react": "^1.0.8",
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-editor-preset-general",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Ali General Editor Preset",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
@ -14,12 +14,12 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ali/lowcode-editor-core": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-skeleton": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-plugin-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-plugin-outline-pane": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-core": "^1.0.27",
|
||||
"@ali/lowcode-editor-skeleton": "^1.0.27",
|
||||
"@ali/lowcode-plugin-designer": "^1.0.27",
|
||||
"@ali/lowcode-plugin-outline-pane": "^1.0.27",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@alifd/next": "^1.19.12",
|
||||
"@alife/theme-lowcode-dark": "^0.1.0",
|
||||
"@alife/theme-lowcode-light": "^0.1.0",
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-editor-preset-vision",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Vision Polyfill for Ali lowCode engine",
|
||||
"main": "lib/index.js",
|
||||
"private": true,
|
||||
@ -11,19 +11,20 @@
|
||||
],
|
||||
"scripts": {
|
||||
"start": "build-scripts start",
|
||||
"build": "build-scripts build --skip-demo",
|
||||
"version:update": "node ./scripts/version.js",
|
||||
"build": "tnpm run version:update && build-scripts build --skip-demo",
|
||||
"cloud-build": "build-scripts build --skip-demo",
|
||||
"test": "build-scripts test --config build.test.json"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-core": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-designer": "^1.0.27",
|
||||
"@ali/lowcode-editor-core": "^1.0.27",
|
||||
"@ali/lowcode-editor-setters": "^1.0.22",
|
||||
"@ali/lowcode-editor-skeleton": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-plugin-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-plugin-outline-pane": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-skeleton": "^1.0.27",
|
||||
"@ali/lowcode-plugin-designer": "^1.0.27",
|
||||
"@ali/lowcode-plugin-outline-pane": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@ali/ve-i18n-util": "^2.0.0",
|
||||
"@ali/ve-icons": "^4.1.9",
|
||||
"@ali/ve-less-variables": "2.0.3",
|
||||
@ -50,6 +51,7 @@
|
||||
"build-plugin-fusion": "^0.1.0",
|
||||
"build-plugin-moment-locales": "^0.1.0",
|
||||
"build-plugin-react-app": "^1.1.2",
|
||||
"fs-extra": "^9.0.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"tsconfig-paths-webpack-plugin": "^3.2.0"
|
||||
},
|
||||
|
||||
21
packages/editor-preset-vision/scripts/version.js
Normal file
21
packages/editor-preset-vision/scripts/version.js
Normal file
@ -0,0 +1,21 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||
const { execSync } = require('child_process');
|
||||
const { join } = require('path');
|
||||
const fse = require('fs-extra');
|
||||
|
||||
const gitBranchName = execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf-8' });
|
||||
const reBranchVersion = /^(?:[a-z]+\/)(\d+\.\d+\.\d+)$/im;
|
||||
|
||||
const match = reBranchVersion.exec(gitBranchName);
|
||||
if (!match) {
|
||||
throw new Error(`[checkversion] gitBranchName: ${gitBranchName}`);
|
||||
}
|
||||
|
||||
const releaseVersion = match[1];
|
||||
|
||||
const indexFile = join(__dirname, '../src/index.ts');
|
||||
|
||||
const indexContent = fse.readFileSync(indexFile, 'utf-8');
|
||||
|
||||
fse.writeFileSync(indexFile, indexContent.replace('{VERSION}', releaseVersion));
|
||||
@ -1,7 +1,7 @@
|
||||
import { isJSBlock, isJSExpression, isJSSlot } from '@ali/lowcode-types';
|
||||
import { isPlainObject, hasOwnProperty, cloneDeep, isI18NObject, isUseI18NSetter, convertToI18NObject, isString } from '@ali/lowcode-utils';
|
||||
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
||||
import { Designer, LiveEditing, TransformStage, Node, getConvertedExtraKey } from '@ali/lowcode-designer';
|
||||
import { Designer, LiveEditing, TransformStage, Node, getConvertedExtraKey, LowCodePluginManager } from '@ali/lowcode-designer';
|
||||
import Outline, { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||
import bus from './bus';
|
||||
import { VE_EVENTS } from './base/const';
|
||||
@ -35,6 +35,9 @@ export const designer = new Designer({ editor });
|
||||
editor.set(Designer, designer);
|
||||
editor.set('designer', designer);
|
||||
|
||||
export const plugins = (new LowCodePluginManager(editor)).toProxy();
|
||||
editor.set('plugins', plugins);
|
||||
|
||||
designer.project.onCurrentDocumentChange((doc) => {
|
||||
bus.emit(VE_EVENTS.VE_PAGE_PAGE_READY);
|
||||
editor.set('currentDocument', doc);
|
||||
|
||||
@ -9,12 +9,12 @@ import {
|
||||
registerMetadataTransducer,
|
||||
addBuiltinComponentAction,
|
||||
removeBuiltinComponentAction,
|
||||
modifyBuiltinComponentAction,
|
||||
// modifyBuiltinComponentAction,
|
||||
} from '@ali/lowcode-designer';
|
||||
import { createElement } from 'react';
|
||||
import { VE_EVENTS as EVENTS, VE_HOOKS as HOOKS, VERSION as Version } from './base/const';
|
||||
import Bus from './bus';
|
||||
import { skeleton, designer, editor } from './editor';
|
||||
import { skeleton, designer, editor, plugins } from './editor';
|
||||
import { Workbench } from '@ali/lowcode-editor-skeleton';
|
||||
import Panes from './panes';
|
||||
import Exchange from './exchange';
|
||||
@ -37,13 +37,14 @@ import '@ali/lowcode-editor-setters';
|
||||
|
||||
import './vision.less';
|
||||
|
||||
function init(container?: Element) {
|
||||
async function init(container?: Element) {
|
||||
if (!container) {
|
||||
container = document.createElement('div');
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
container.id = 'engine';
|
||||
|
||||
await plugins.init();
|
||||
render(
|
||||
createElement(Workbench, {
|
||||
skeleton,
|
||||
@ -125,6 +126,7 @@ const VisualEngine = {
|
||||
logger,
|
||||
Symbols,
|
||||
registerMetadataTransducer,
|
||||
plugins,
|
||||
// Flags,
|
||||
};
|
||||
|
||||
@ -177,12 +179,12 @@ export {
|
||||
logger,
|
||||
Symbols,
|
||||
registerMetadataTransducer,
|
||||
plugins,
|
||||
};
|
||||
|
||||
const version = '6.0.0 (LowcodeEngine 0.9.32)';
|
||||
|
||||
console.log(
|
||||
`%c VisionEngine %c v${version} `,
|
||||
'%c AliLowCodeEngine %c v1.0.28 ',
|
||||
'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;',
|
||||
'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
|
||||
);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { findIndex } from 'lodash';
|
||||
import { DocumentModel, Node, Root } from '@ali/lowcode-designer';
|
||||
import { DocumentModel, Node, RootNode } from '@ali/lowcode-designer';
|
||||
|
||||
/**
|
||||
* RootNodeVisitor for VisualEngine Page
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-editor-skeleton",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "alibaba lowcode editor skeleton",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -19,10 +19,10 @@
|
||||
"editor"
|
||||
],
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-core": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-designer": "^1.0.27",
|
||||
"@ali/lowcode-editor-core": "^1.0.27",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@ali/ve-icons": "latest",
|
||||
"@ali/ve-less-variables": "^2.0.0",
|
||||
"@alifd/next": "^1.20.12",
|
||||
|
||||
@ -178,6 +178,9 @@ export default function (metadata: TransformedComponentMetadata): TransformedCom
|
||||
name: 'style',
|
||||
title: { type: 'i18n', 'zh-CN': '行内样式', 'en-US': 'Style' },
|
||||
setter: 'StyleSetter',
|
||||
extraProps: {
|
||||
display: 'block',
|
||||
},
|
||||
});
|
||||
}
|
||||
if (stylesGroup.length > 0) {
|
||||
|
||||
@ -69,7 +69,7 @@ function propTypeToSetter(propType: PropType): SetterType {
|
||||
const componentName = dataSource.length >= 4 ? 'SelectSetter' : 'RadioGroupSetter';
|
||||
return {
|
||||
componentName,
|
||||
props: { dataSource },
|
||||
props: { dataSource, options: dataSource },
|
||||
isRequired,
|
||||
initialValue: dataSource[0] ? dataSource[0].value : null,
|
||||
};
|
||||
@ -139,6 +139,11 @@ function propTypeToSetter(propType: PropType): SetterType {
|
||||
componentName: 'FunctionSetter',
|
||||
isRequired,
|
||||
};
|
||||
case 'color':
|
||||
return {
|
||||
componentName: 'ColorSetter',
|
||||
isRequired,
|
||||
};
|
||||
case 'oneOfType':
|
||||
return {
|
||||
componentName: 'MixedSetter',
|
||||
@ -148,6 +153,8 @@ function propTypeToSetter(propType: PropType): SetterType {
|
||||
},
|
||||
isRequired,
|
||||
};
|
||||
default:
|
||||
// do nothing
|
||||
}
|
||||
return {
|
||||
componentName: 'MixedSetter',
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-ignitor
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-ignitor
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-ignitor
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-ignitor
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-ignitor
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-ignitor
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-ignitor",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "点火器,bootstrap lce project",
|
||||
"main": "lib/index.js",
|
||||
"private": true,
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-plugin-designer",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "alibaba lowcode editor designer plugin",
|
||||
"files": [
|
||||
"es",
|
||||
@ -20,8 +20,8 @@
|
||||
],
|
||||
"author": "xiayang.xy",
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-core": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-designer": "^1.0.27",
|
||||
"@ali/lowcode-editor-core": "^1.0.27",
|
||||
"react": "^16.8.1",
|
||||
"react-dom": "^16.8.1"
|
||||
},
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-plugin-outline-pane",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Outline pane for Ali lowCode engine",
|
||||
"files": [
|
||||
"es",
|
||||
@ -14,10 +14,10 @@
|
||||
"test:snapshot": "ava --update-snapshots"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-editor-core": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-designer": "^1.0.27",
|
||||
"@ali/lowcode-editor-core": "^1.0.27",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@alifd/next": "^1.19.16",
|
||||
"classnames": "^2.2.6",
|
||||
"react": "^16",
|
||||
|
||||
@ -3,7 +3,58 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-renderer
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-renderer
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-renderer
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 支持小程序低代码组件 ([b0aeed3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/b0aeed3))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-renderer
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-renderer
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -14,7 +65,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
|
||||
<a name="1.0.25-beta.1"></a>
|
||||
<a name="1.0.25-beta.1"></a>
|
||||
## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-rax-renderer",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Rax renderer for Ali lowCode engine",
|
||||
"main": "lib/index.js",
|
||||
"module": "lib/index.js",
|
||||
@ -37,7 +37,7 @@
|
||||
"@ali/bzb-request": "2.6.1",
|
||||
"@ali/lib-mtop": "^2.5.1",
|
||||
"@ali/lowcode-datasource-engine": "^1.0.22",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@ali/ui-table": "^1.0.1-beta.6",
|
||||
"classnames": "^2.2.6",
|
||||
"debug": "^4.1.1",
|
||||
@ -6,6 +6,7 @@ import Debug from 'debug';
|
||||
import classnames from 'classnames';
|
||||
import { isSchema, getFileCssName } from '../utils';
|
||||
import BaseEngine from './base';
|
||||
import AppContext from '../context/appContext';
|
||||
|
||||
const debug = Debug('engine:comp');
|
||||
|
||||
@ -66,6 +67,35 @@ export default class CompEngine extends BaseEngine {
|
||||
debug(`comp.componentDidCatch - ${this.props.__schema.fileName}`);
|
||||
}
|
||||
|
||||
__createContextDom = (childCtx, currCtx, props) => (
|
||||
<AppContext.Consumer>
|
||||
{(context) => {
|
||||
this.context = context;
|
||||
this.__generateCtx(currCtx);
|
||||
this.__render();
|
||||
return (
|
||||
<AppContext.Provider
|
||||
value={{
|
||||
...this.context,
|
||||
...childCtx,
|
||||
}}
|
||||
>
|
||||
{context.engine.createElement(
|
||||
props.__components.Component,
|
||||
{
|
||||
...props,
|
||||
ref: this.__getRef,
|
||||
className: classnames(getFileCssName(props.__schema.fileName), props.className),
|
||||
__id: props.__schema.id,
|
||||
},
|
||||
this.__createDom(),
|
||||
)}
|
||||
</AppContext.Provider>
|
||||
);
|
||||
}}
|
||||
</AppContext.Consumer>
|
||||
);
|
||||
|
||||
render() {
|
||||
const { __schema } = this.props;
|
||||
|
||||
@ -106,6 +136,7 @@ export default class CompEngine extends BaseEngine {
|
||||
{
|
||||
component: this,
|
||||
},
|
||||
this.props,
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
@ -3,6 +3,57 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 支持小程序低代码组件 ([b0aeed3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/b0aeed3))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-rax-simulator-renderer",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "rax simulator renderer for alibaba lowcode designer",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -13,10 +13,10 @@
|
||||
"test:snapshot": "ava --update-snapshots"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-rax-renderer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-designer": "^1.0.27",
|
||||
"@ali/lowcode-rax-renderer": "^1.0.27",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@ali/recore-rax": "^1.2.4",
|
||||
"@ali/vu-css-style": "^1.0.2",
|
||||
"@recore/obx": "^1.0.8",
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { BuiltinSimulatorRenderer, Component, DocumentModel, Node, NodeInstance } from '@ali/lowcode-designer';
|
||||
import { ComponentSchema, NodeSchema, NpmInfo, RootSchema } from '@ali/lowcode-types';
|
||||
import { ComponentSchema, NodeSchema, NpmInfo, RootSchema, TransformStage } from '@ali/lowcode-types';
|
||||
import { Asset, cursor, isElement, isESModule, isReactComponent, setNativeSelection } from '@ali/lowcode-utils';
|
||||
import { computed, obx } from '@recore/obx';
|
||||
import DriverUniversal from 'driver-universal';
|
||||
import { EventEmitter } from 'events';
|
||||
import { createMemoryHistory, MemoryHistory } from 'history';
|
||||
// @ts-ignore
|
||||
import { ComponentType, createElement, render as raxRender, shared } from 'rax';
|
||||
import Rax, { ComponentType, createElement, render as raxRender, shared } from 'rax';
|
||||
import Leaf from './builtin-components/leaf';
|
||||
import Slot from './builtin-components/slot';
|
||||
import { host } from './host';
|
||||
@ -25,6 +25,8 @@ export interface LibraryMap {
|
||||
const SYMBOL_VNID = Symbol('_LCNodeId');
|
||||
const SYMBOL_VDID = Symbol('_LCDocId');
|
||||
|
||||
const INTERNAL = '_internal';
|
||||
|
||||
function accessLibrary(library: string | object) {
|
||||
if (typeof library !== 'string') {
|
||||
return library;
|
||||
@ -410,7 +412,9 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
||||
}
|
||||
instance = Instance.get(dom);
|
||||
while (instance && instance[INTERNAL]) {
|
||||
if (isValidDesignModeRaxComponentInstance(instance)) {
|
||||
// 剔除低代码组件的内部组件
|
||||
if (isValidDesignModeRaxComponentInstance(instance) && !findComponentCreator(instance)) {
|
||||
// if (instance && SYMBOL_VNID in instance) {
|
||||
// const docId = (instance.props as any).schema.docId;
|
||||
return {
|
||||
docId: instance.props._leaf.document.id,
|
||||
@ -489,97 +493,31 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
||||
};
|
||||
}
|
||||
|
||||
createComponent(schema: ComponentSchema): Component | null {
|
||||
return null;
|
||||
// TODO: use ComponentEngine refactor
|
||||
/*
|
||||
const _schema = {
|
||||
createComponent(schema: NodeSchema): Component | null {
|
||||
const _schema: any = {
|
||||
...schema,
|
||||
};
|
||||
_schema.methods = {};
|
||||
_schema.lifeCycles = {};
|
||||
|
||||
const node = host.document.createNode(_schema);
|
||||
_schema = node.export(TransformStage.Render);
|
||||
|
||||
const processPropsSchema = (propsSchema: any, propsMap: any): any => {
|
||||
if (!propsSchema) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const result = { ...propsSchema };
|
||||
const reg = /^(?:this\.props|props)\.(\S+)$/;
|
||||
Object.keys(result).map((key: string) => {
|
||||
if (result[key]?.type === 'JSExpression') {
|
||||
const { value } = result[key];
|
||||
const matched = reg.exec(value);
|
||||
if (matched) {
|
||||
const propName = matched[1];
|
||||
result[key] = propsMap[propName];
|
||||
}
|
||||
} else if (result[key]?.type === 'JSSlot') {
|
||||
const schema = result[key].value;
|
||||
result[key] = createElement(Ele, {schema, propsMap: {}});
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
const renderer = this;
|
||||
const componentsMap = renderer.componentsMap;
|
||||
|
||||
class Ele extends React.Component<{ schema: any, propsMap: any }> {
|
||||
private isModal: boolean;
|
||||
|
||||
constructor(props: any){
|
||||
super(props);
|
||||
const componentMeta = host.document.getComponentMeta(props.schema.componentName);
|
||||
if (componentMeta?.prototype?.isModal()) {
|
||||
this.isModal = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.isModal) {
|
||||
return null;
|
||||
}
|
||||
const { schema, propsMap } = this.props;
|
||||
const Com = componentsMap[schema.componentName];
|
||||
if (!Com) {
|
||||
return null;
|
||||
}
|
||||
let children = null;
|
||||
if (schema.children && schema.children.length > 0) {
|
||||
children = schema.children.map((item: any) => createElement(Ele, {schema: item, propsMap}));
|
||||
}
|
||||
const props = processPropsSchema(schema.props, propsMap);
|
||||
const _leaf = host.document.createNode(schema);
|
||||
|
||||
return createElement(Com, {...props, _leaf}, children);
|
||||
}
|
||||
const _leaf = this.document.designer.currentDocument?.createNode(schema);
|
||||
const node = this.document.createNode(schema);
|
||||
let props = processPropsSchema(schema.props, propsMap);
|
||||
props = this.document.designer.transformProps(props, node, TransformStage.Init);
|
||||
props = this.document.designer.transformProps(props, node, TransformStage.Render);
|
||||
return createElement(Com, { ...props, _leaf }, children);
|
||||
};
|
||||
|
||||
const container = this;
|
||||
class Com extends React.Component {
|
||||
render() {
|
||||
const componentsMap = container.componentsMap;
|
||||
let children = null;
|
||||
if (_schema.children && Array.isArray(_schema.children)) {
|
||||
children = _schema.children?.map((item: any) => getElement(componentsMap, item, this.props));
|
||||
}
|
||||
}
|
||||
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||
const doc = window.document;
|
||||
const s = doc.createElement('style');
|
||||
s.setAttribute('type', 'text/css');
|
||||
s.setAttribute('id', `Component-${schema.id || ''}`);
|
||||
s.appendChild(doc.createTextNode((schema as ComponentSchema).css || ''));
|
||||
doc.getElementsByTagName('head')[0].appendChild(s);
|
||||
}
|
||||
|
||||
return Com;
|
||||
*/
|
||||
// const node = host.currentDocument?.createNode(_schema);
|
||||
// _schema = node?.export(TransformStage.Render) || {};
|
||||
|
||||
|
||||
|
||||
const renderer = this;
|
||||
const { componentsMap } = renderer;
|
||||
|
||||
return getComponentController(schema, componentsMap);
|
||||
}
|
||||
|
||||
private _running = false;
|
||||
@ -661,4 +599,101 @@ function findComponent(libraryMap: LibraryMap, componentName: string, npm?: NpmI
|
||||
return getSubComponent(library, paths);
|
||||
}
|
||||
|
||||
const processPropsSchema = (propsSchema: any, propsMap: any, componentsMap: any): any => {
|
||||
if (!propsSchema) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const result = { ...propsSchema };
|
||||
const reg = /^(?:this\.props|props)\.(\S+)$/;
|
||||
Object.keys(result).map((key: string) => {
|
||||
if (result[key]?.type === 'JSExpression') {
|
||||
const { value } = result[key];
|
||||
const matched = reg.exec(value);
|
||||
if (matched) {
|
||||
const propName = matched[1];
|
||||
result[key] = propsMap[propName];
|
||||
}
|
||||
} else if (result[key]?.type === 'JSSlot') {
|
||||
const schema = result[key].value;
|
||||
result[key] = createElement(ComponentCreator, { schema, propsMap: {}, componentsMap });
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
function findComponentCreator(instance: any) {
|
||||
let isComponentCreator = false;
|
||||
while (instance && !isComponentCreator) {
|
||||
instance = instance[INTERNAL]?.__parentInstance;
|
||||
isComponentCreator = instance instanceof ComponentCreator;
|
||||
}
|
||||
return isComponentCreator;
|
||||
}
|
||||
|
||||
class ComponentCreator extends Rax.Component<{ schema: any; propsMap: any, componentsMap: any }> {
|
||||
private isModal: boolean;
|
||||
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
const componentMeta = host.currentDocument?.getComponentMeta(props.schema.componentName);
|
||||
if (componentMeta?.prototype?.isModal()) {
|
||||
this.isModal = true;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.isModal) {
|
||||
return null;
|
||||
}
|
||||
const { schema, propsMap, componentsMap } = this.props;
|
||||
const ComponentClass = componentsMap[schema.componentName];
|
||||
if (!ComponentClass) {
|
||||
return null;
|
||||
}
|
||||
let children = null;
|
||||
if (schema.children && schema.children.length > 0) {
|
||||
children = schema.children.map((item: any, index: number) => createElement(ComponentCreator, { schema: item, propsMap, componentsMap, key: item?.id || index }));
|
||||
}
|
||||
const props = processPropsSchema(schema.props, propsMap, componentsMap);
|
||||
const _leaf = host.currentDocument?.createNode(schema);
|
||||
|
||||
return createElement(ComponentClass, { ...props, _leaf }, children);
|
||||
}
|
||||
}
|
||||
|
||||
function getComponentController(schema: NodeSchema, componentsMap: any) {
|
||||
class ComponentController extends Rax.Component<{ schema: any }> {
|
||||
renderSchema: any;
|
||||
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
const node = host.currentDocument?.createNode(schema);
|
||||
this.renderSchema = node?.export(TransformStage.Render) || {};
|
||||
}
|
||||
|
||||
// TODO: 暂时解决性能问题
|
||||
shouldComponentUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { renderSchema } = this;
|
||||
const { componentName } = renderSchema;
|
||||
if (componentName === 'Component') {
|
||||
let children = [] as any;
|
||||
const propsMap = this.props || {};
|
||||
if (renderSchema.children && Array.isArray(renderSchema.children)) {
|
||||
children = renderSchema.children.map((item: any, index: number) => createElement(ComponentCreator, { schema: item, propsMap, componentsMap, key: item?.id || index }));
|
||||
}
|
||||
return createElement('div', {}, children);
|
||||
} else {
|
||||
return createElement(ComponentCreator, { schema, propsMap: {}, componentsMap });
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComponentController;
|
||||
}
|
||||
|
||||
export default new SimulatorRendererContainer();
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-renderer
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-renderer
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-renderer
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-renderer
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-renderer
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-renderer
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-react-renderer",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "react renderer for ali lowcode engine",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-react-simulator-renderer",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "react simulator renderer for alibaba lowcode designer",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -16,10 +16,10 @@
|
||||
"build": "build-scripts build --skip-demo"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-react-renderer": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-utils": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-designer": "^1.0.27",
|
||||
"@ali/lowcode-react-renderer": "^1.0.27",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@ali/lowcode-utils": "^1.0.27",
|
||||
"@ali/vu-css-style": "^1.0.2",
|
||||
"@recore/obx": "^1.0.8",
|
||||
"@recore/obx-react": "^1.0.7",
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-types
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-types
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-types
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-types
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-types
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-types
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-types",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Types for Ali lowCode engine",
|
||||
"files": [
|
||||
"es",
|
||||
|
||||
@ -17,3 +17,4 @@ export * from './node';
|
||||
export * from './transform-stage';
|
||||
export * from './code-intermediate';
|
||||
export * from './code-result';
|
||||
export * from './plugin';
|
||||
|
||||
64
packages/types/src/plugin.ts
Normal file
64
packages/types/src/plugin.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import { CompositeObject, ComponentAction } from '@ali/lowcode-types';
|
||||
import Logger from 'zen-logger';
|
||||
import { Skeleton } from '@ali/lowcode-editor-skeleton';
|
||||
import { Editor, Hotkey } from '@ali/lowcode-editor-core';
|
||||
import {
|
||||
MetadataTransducer,
|
||||
Designer,
|
||||
} from '@ali/lowcode-designer';
|
||||
|
||||
export interface ILowCodePluginConfig {
|
||||
name: string;
|
||||
dep?: string[]; // 依赖插件名
|
||||
init(): void;
|
||||
destroy?(): void;
|
||||
exports?(): CompositeObject;
|
||||
}
|
||||
|
||||
export interface ILowCodePlugin {
|
||||
name: string;
|
||||
dep: string[];
|
||||
disabled: boolean;
|
||||
config: ILowCodePluginConfig;
|
||||
logger: Logger;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): any;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): any;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
removeAllListeners(event?: string | symbol): this;
|
||||
init(): void;
|
||||
destroy(): void;
|
||||
toProxy(): any;
|
||||
setDisabled(flag: boolean): void;
|
||||
}
|
||||
|
||||
export interface IDesignerHelper {
|
||||
registerMetadataTransducer: (transducer: MetadataTransducer, level: number, id?: string) => void;
|
||||
addBuiltinComponentAction: (action: ComponentAction) => void;
|
||||
removeBuiltinComponentAction: (actionName: string) => void;
|
||||
}
|
||||
|
||||
export interface ILowCodePluginContext {
|
||||
skeleton: Skeleton;
|
||||
designer: Designer;
|
||||
editor: Editor;
|
||||
hotkey: Hotkey;
|
||||
logger: Logger;
|
||||
plugins: ILowCodePluginManager;
|
||||
designerHelper: IDesignerHelper;
|
||||
/**
|
||||
其他暂不增加,按需增加
|
||||
*/
|
||||
}
|
||||
|
||||
export interface ILowCodePluginManager {
|
||||
register(
|
||||
pluginConfig: (ctx: ILowCodePluginContext, options: CompositeObject) => ILowCodePluginConfig,
|
||||
options: CompositeObject,
|
||||
): void;
|
||||
get(pluginName: string): ILowCodePlugin | undefined;
|
||||
getAll(): ILowCodePlugin[];
|
||||
has(pluginName: string): boolean;
|
||||
delete(pluginName: string): any;
|
||||
setDisabled(pluginName: string, flag: boolean): void;
|
||||
dispose(): void;
|
||||
}
|
||||
@ -14,14 +14,4 @@ export type ExternalUtils = {
|
||||
};
|
||||
|
||||
export type UtilItem = InternalUtils | ExternalUtils;
|
||||
export type UtilsMap = Array<
|
||||
| {
|
||||
name: string;
|
||||
type: 'npm';
|
||||
content: NpmInfo;
|
||||
}
|
||||
| {
|
||||
name: string;
|
||||
type: '';
|
||||
}
|
||||
>;
|
||||
export type UtilsMap = UtilItem[];
|
||||
|
||||
@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="1.0.27"></a>
|
||||
## [1.0.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.2...v1.0.27) (2020-12-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-utils
|
||||
|
||||
<a name="1.0.27-beta.2"></a>
|
||||
## [1.0.27-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.1...v1.0.27-beta.2) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-utils
|
||||
|
||||
<a name="1.0.27-beta.1"></a>
|
||||
## [1.0.27-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.27-beta.0...v1.0.27-beta.1) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-utils
|
||||
|
||||
<a name="1.0.27-beta.0"></a>
|
||||
## [1.0.27-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26...v1.0.27-beta.0) (2020-12-23)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-utils
|
||||
|
||||
<a name="1.0.26"></a>
|
||||
## [1.0.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.1...v1.0.26) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-utils
|
||||
|
||||
<a name="1.0.26-beta.1"></a>
|
||||
## [1.0.26-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.26-beta.0...v1.0.26-beta.1) (2020-12-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-utils
|
||||
|
||||
<a name="1.0.26-beta.0"></a>
|
||||
## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-utils",
|
||||
"version": "1.0.26-beta.0",
|
||||
"version": "1.0.27",
|
||||
"description": "Utils for Ali lowCode engine",
|
||||
"files": [
|
||||
"es",
|
||||
@ -14,7 +14,7 @@
|
||||
"test:snapshot": "ava --update-snapshots"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-types": "^1.0.26-beta.0",
|
||||
"@ali/lowcode-types": "^1.0.27",
|
||||
"@alifd/next": "^1.19.16",
|
||||
"lodash.get": "^4.4.2",
|
||||
"react": "^16"
|
||||
|
||||
@ -7,3 +7,6 @@ lerna clean -y
|
||||
find ./packages -type f -name "package-lock.json" -exec rm -f {} \;
|
||||
|
||||
lerna bootstrap
|
||||
|
||||
lerna exec --scope @ali/lowcode-react-renderer -- npm run build
|
||||
lerna exec --scope @ali/lowcode-rax-renderer -- npm run build
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
lerna exec --scope @ali/lowcode-react-renderer -- npm build
|
||||
lerna exec --scope @ali/lowcode-rax-renderer -- npm build
|
||||
lerna exec --scope @ali/lowcode-ignitor -- npm start
|
||||
pkgName="@ali/lowcode-ignitor"
|
||||
|
||||
if [ "$1" ]; then
|
||||
pkgName="$1"
|
||||
fi
|
||||
|
||||
lerna exec --scope $pkgName -- npm start
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user