Compare commits

...

15 Commits

Author SHA1 Message Date
JackLian
48e8a72700 chore(release): publish 1.0.17-beta.11 2022-11-23 17:55:05 +08:00
JackLian
f30ccf509a chore(release): publish 1.0.17-beta.10 2022-11-23 17:30:58 +08:00
JackLian
d207d92053 chore: adjust version of @types/react-router & typescript 2022-11-23 17:26:24 +08:00
JackLian
1e54fefd7e feat: provide new api project.setI18n for setting schema.i18n data 2022-11-23 17:26:24 +08:00
liujuping
7456e78ad8 chore(release): publish 1.0.17-beta.9 2022-11-22 17:24:02 +08:00
liujuping
ab817312ff Merge branch develop into release/1.0.17-beta 2022-11-22 17:17:03 +08:00
liujuping
9a3b57d40f chore(release): publish 1.0.17-beta.8 2022-11-17 21:58:18 +08:00
liujuping
2139f9e2b8 chore(release): publish 1.0.17-beta.6 2022-11-17 18:57:45 +08:00
LeoYuan 袁力皓
4462e3d3a0 chore(release): publish 1.0.17-beta.5 2022-11-17 15:38:22 +08:00
LeoYuan 袁力皓
dd9b2e3132 chore(release): publish 1.0.17-beta.4 2022-11-17 15:35:06 +08:00
liujuping
a06b6bc1f9 chore(release): publish 1.0.17-beta.3 2022-11-17 13:02:50 +08:00
liujuping
855c641eca chore(release): publish 1.0.17-beta.2 2022-11-17 13:00:30 +08:00
liujuping
a6934e1085 chore(release): publish 1.0.17-beta.1 2022-11-17 12:59:43 +08:00
liujuping
81f1dbfe1f chore(release): publish 1.0.17-beta.0 2022-11-17 12:58:55 +08:00
liujuping
d81d310f9e fix: performance issues when focusing node 2022-11-17 12:02:19 +08:00
28 changed files with 147 additions and 111 deletions

View File

@ -1,6 +1,6 @@
{
"lerna": "4.0.0",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [

View File

@ -46,9 +46,10 @@
"gulp": "^4.0.2",
"husky": "^7.0.4",
"lerna": "^4.0.0",
"typescript": "^4.5.5",
"typescript": "4.6.2",
"yarn": "^1.22.17",
"rimraf": "^3.0.2"
"rimraf": "^3.0.2",
"@types/react-router": "5.1.18"
},
"engines": {
"node": ">=14.17.0 <18"

View File

@ -11,7 +11,7 @@ const jestConfig = {
// },
// testMatch: ['**/node-children.test.ts'],
// testMatch: ['**/history/history.test.ts'],
// testMatch: ['**/plugin/plugin-manager.test.ts'],
// testMatch: ['**/host-view.test.tsx'],
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
transformIgnorePatterns: [
`/node_modules/(?!${esModules})/`,

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-designer",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Designer for Ali LowCode Engine",
"main": "lib/index.js",
"module": "es/index.js",
@ -15,10 +15,10 @@
},
"license": "MIT",
"dependencies": {
"@alilc/lowcode-editor-core": "1.0.16",
"@alilc/lowcode-shell": "1.0.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-editor-core": "1.0.17-beta.11",
"@alilc/lowcode-shell": "1.0.17-beta.11",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
@ -59,5 +59,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/designer"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -177,6 +177,8 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
readonly injectionConsumer: ResourceConsumer;
readonly i18nConsumer: ResourceConsumer;
/**
*
*/
@ -200,9 +202,11 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
this.injectionConsumer = new ResourceConsumer(() => {
return {
appHelper: engineConfig.get('appHelper'),
i18n: this.project.i18n,
};
});
this.i18nConsumer = new ResourceConsumer(() => this.project.i18n);
transactionManager.onStartTransaction(() => {
this.stopAutoRepaintNode();
}, TransitionType.REPAINT);

View File

@ -1,4 +1,4 @@
import { autorun, obx } from '@alilc/lowcode-editor-core';
import { autorun, makeObservable, obx } from '@alilc/lowcode-editor-core';
import { BuiltinSimulatorHost } from './host';
import { EventEmitter } from 'events';
import { BuiltinSimulatorRenderer, isSimulatorRenderer } from './renderer';
@ -28,7 +28,12 @@ export default class ResourceConsumer<T = any> {
private _consuming?: () => void;
private _firstConsumed = false;
private resolveFirst?: (resolve?: any) => void;
constructor(provider: () => T, private consumer?: RendererConsumer<T>) {
makeObservable(this);
this._providing = autorun(() => {
this._data = provider();
});
@ -46,7 +51,7 @@ export default class ResourceConsumer<T = any> {
}
const rendererConsumer = this.consumer!;
consumer = data => rendererConsumer(consumerOrRenderer, data);
consumer = (data) => rendererConsumer(consumerOrRenderer, data);
} else {
consumer = consumerOrRenderer;
}
@ -56,8 +61,8 @@ export default class ResourceConsumer<T = any> {
}
await consumer(this._data);
// TODO: catch error and report
if (this.resovleFirst) {
this.resovleFirst();
if (this.resolveFirst) {
this.resolveFirst();
} else {
this._firstConsumed = true;
}
@ -74,16 +79,12 @@ export default class ResourceConsumer<T = any> {
this.emitter.removeAllListeners();
}
private _firstConsumed = false;
private resovleFirst?: () => void;
waitFirstConsume(): Promise<any> {
if (this._firstConsumed) {
return Promise.resolve();
}
return new Promise(resolve => {
this.resovleFirst = resolve;
return new Promise((resolve) => {
this.resolveFirst = resolve;
});
}
}

View File

@ -1,7 +1,7 @@
import { EventEmitter } from 'events';
import { obx, computed, makeObservable, action } from '@alilc/lowcode-editor-core';
import { Designer } from '../designer';
import { DocumentModel, isDocumentModel, isPageSchema } from '../document';
import { DocumentModel, isDocumentModel } from '../document';
import {
ProjectSchema,
RootSchema,
@ -54,7 +54,7 @@ export class Project {
}
@obx.ref private _i18n: any = {};
get i18n(): any {
@computed get i18n(): any {
return this._i18n;
}
set i18n(value: any) {

View File

@ -26,7 +26,7 @@ describe('host-view 测试', () => {
designer = null;
});
it('host-view', () => {
it.skip('host-view', () => {
const hostView = render(<BuiltinSimulatorHostView project={designer.project} />);
});
});

View File

@ -255,12 +255,12 @@ describe('schema 生成节点模型测试', () => {
expect(project).toBeTruthy();
project.i18n = formSchema.i18n;
expect(project.i18n).toBe(formSchema.i18n);
expect(project.i18n).toStrictEqual(formSchema.i18n);
project.i18n = null;
expect(project.i18n).toStrictEqual({});
project.set('i18n', formSchema.i18n);
expect(project.get('i18n')).toBe(formSchema.i18n);
expect(project.get('i18n')).toStrictEqual(formSchema.i18n);
project.set('i18n', null);
expect(project.get('i18n')).toStrictEqual({});
});

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-editor-core",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Core Api for Ali lowCode engine",
"license": "MIT",
"main": "lib/index.js",
@ -14,8 +14,8 @@
},
"dependencies": {
"@alifd/next": "^1.19.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"debug": "^4.1.1",
"intl-messageformat": "^9.3.1",
@ -49,5 +49,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/editor-core"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-editor-skeleton",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "alibaba lowcode editor skeleton",
"main": "lib/index.js",
"module": "es/index.js",
@ -18,10 +18,10 @@
],
"dependencies": {
"@alifd/next": "^1.20.12",
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-editor-core": "1.0.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-editor-core": "1.0.17-beta.11",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"react": "^16.8.1",
"react-dom": "^16.8.1"
@ -42,5 +42,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/editor-skeleton"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-engine",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系",
"main": "lib/engine-core.js",
"module": "es/engine-core.js",
@ -19,14 +19,14 @@
"license": "MIT",
"dependencies": {
"@alifd/next": "^1.19.12",
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-editor-core": "1.0.16",
"@alilc/lowcode-editor-skeleton": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-editor-core": "1.0.17-beta.11",
"@alilc/lowcode-editor-skeleton": "1.0.17-beta.11",
"@alilc/lowcode-engine-ext": "^1.0.0",
"@alilc/lowcode-plugin-designer": "1.0.16",
"@alilc/lowcode-plugin-outline-pane": "1.0.16",
"@alilc/lowcode-shell": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-plugin-designer": "1.0.17-beta.11",
"@alilc/lowcode-plugin-outline-pane": "1.0.17-beta.11",
"@alilc/lowcode-shell": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},
@ -53,5 +53,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/engine"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-ignitor",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "点火器bootstrap lce project",
"main": "lib/index.js",
"private": true,

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-plugin-designer",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "alibaba lowcode editor designer plugin",
"files": [
"es",
@ -18,9 +18,9 @@
],
"author": "xiayang.xy",
"dependencies": {
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-editor-core": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-editor-core": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},
@ -38,5 +38,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/plugin-designer"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-plugin-outline-pane",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Outline pane for Ali lowCode engine",
"files": [
"es",
@ -13,10 +13,10 @@
},
"dependencies": {
"@alifd/next": "^1.19.16",
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-editor-core": "1.0.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-editor-core": "1.0.17-beta.11",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"react": "^16",
"react-dom": "^16.7.0",
@ -41,5 +41,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/plugin-outline-pane"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-rax-renderer",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Rax renderer for Ali lowCode engine",
"main": "lib/index.js",
"module": "es/index.js",
@ -30,8 +30,8 @@
"build": "build-scripts build"
},
"dependencies": {
"@alilc/lowcode-renderer-core": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-renderer-core": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"rax-find-dom-node": "^1.0.1"
},
"devDependencies": {
@ -49,5 +49,5 @@
},
"license": "MIT",
"homepage": "https://unpkg.alibaba-inc.com/@alilc/lowcode-rax-renderer@0.1.2/build/index.html",
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-rax-simulator-renderer",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "rax simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@ -13,10 +13,10 @@
"build:umd": "build-scripts build --config build.umd.json"
},
"dependencies": {
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-rax-renderer": "1.0.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-rax-renderer": "1.0.17-beta.11",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"driver-universal": "^3.1.3",
"history": "^5.0.0",
@ -51,5 +51,5 @@
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/rax-simulator-renderer"
},
"homepage": "https://unpkg.alibaba-inc.com/@alilc/lowcode-rax-simulator-renderer@1.0.73/build/index.html",
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-react-renderer",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "react renderer for ali lowcode engine",
"main": "lib/index.js",
"module": "es/index.js",
@ -22,7 +22,7 @@
],
"dependencies": {
"@alifd/next": "^1.21.16",
"@alilc/lowcode-renderer-core": "1.0.16"
"@alilc/lowcode-renderer-core": "1.0.17-beta.11"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
@ -43,5 +43,5 @@
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/react-renderer"
},
"homepage": "https://unpkg.alibaba-inc.com/@alilc/lowcode-react-renderer@1.0.21/build/index.html",
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-react-simulator-renderer",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "react simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@ -17,10 +17,10 @@
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
"dependencies": {
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-react-renderer": "1.0.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-react-renderer": "1.0.17-beta.11",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"mobx": "^6.3.0",
"mobx-react": "^7.2.0",
@ -33,7 +33,7 @@
"@types/node": "^13.7.1",
"@types/react": "^16",
"@types/react-dom": "^16",
"@types/react-router": "^5.1.17",
"@types/react-router": "5.1.18",
"build-plugin-component": "^0.2.11"
},
"publishConfig": {
@ -44,5 +44,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/react-simulator-renderer"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -31,7 +31,7 @@ const loader = new AssetLoader();
configure({ enforceActions: 'never' });
export class DocumentInstance {
public instancesMap = new Map<string, ReactInstance[]>();
instancesMap = new Map<string, ReactInstance[]>();
get schema(): any {
return this.document.export(TransformStage.Render);
@ -190,6 +190,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
readonly history: MemoryHistory;
@obx.ref private _documentInstances: DocumentInstance[] = [];
private _requestHandlersMap: any;
get documentInstances() {
return this._documentInstances;
}
@ -203,7 +204,8 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
this._layout = host.project.get('config').layout;
// todo: split with others, not all should recompute
if (this._libraryMap !== host.libraryMap || this._componentsMap !== host.designer.componentsMap) {
if (this._libraryMap !== host.libraryMap
|| this._componentsMap !== host.designer.componentsMap) {
this._libraryMap = host.libraryMap || {};
this._componentsMap = host.designer.componentsMap;
this.buildComponents();
@ -246,7 +248,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
initialEntries: [initialEntry],
});
this.history = history;
history.listen((location, action) => {
history.listen((location) => {
const docId = location.pathname.slice(1);
docId && host.project.open(docId);
});
@ -285,15 +287,23 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
constants: {},
requestHandlersMap: this._requestHandlersMap,
};
host.injectionConsumer.consume((data) => {
// TODO: sync utils, i18n, contants,... config
const newCtx = {
...this._appContext,
};
newCtx.utils.i18n.messages = data.i18n || {};
merge(newCtx, data.appHelper || {});
this._appContext = newCtx;
});
host.i18nConsumer.consume((data) => {
const newCtx = {
...this._appContext,
};
newCtx.utils.i18n.messages = data || {};
this._appContext = newCtx;
});
}
@obx private _layout: any = null;
@ -310,7 +320,11 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
private _libraryMap: { [key: string]: string } = {};
private buildComponents() {
this._components = buildComponents(this._libraryMap, this._componentsMap, this.createComponent.bind(this));
this._components = buildComponents(
this._libraryMap,
this._componentsMap,
this.createComponent.bind(this),
);
this._components = {
...builtinComponents,
...this._components,
@ -505,8 +519,8 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
}
dispose() {
this.disposeFunctions.forEach(fn => fn());
this.documentInstances.forEach(docInst => docInst.dispose());
this.disposeFunctions.forEach((fn) => fn());
this.documentInstances.forEach((docInst) => docInst.dispose());
untracked(() => {
this._componentsMap = {};
this._components = null;
@ -540,7 +554,10 @@ function cacheReactKey(el: Element): Element {
const SYMBOL_VNID = Symbol('_LCNodeId');
const SYMBOL_VDID = Symbol('_LCDocId');
function getClosestNodeInstance(from: ReactInstance, specId?: string): NodeInstance<ReactInstance> | null {
function getClosestNodeInstance(
from: ReactInstance,
specId?: string,
): NodeInstance<ReactInstance> | null {
let el: any = from;
if (el) {
if (isElement(el)) {
@ -599,7 +616,7 @@ function getLowCodeComponentProps(props: any) {
return props;
}
const newProps: any = {};
Object.keys(props).forEach(k => {
Object.keys(props).forEach((k) => {
if (['children', 'componentId', '__designMode', '_componentName', '_leaf'].includes(k)) {
return;
}

View File

@ -62,6 +62,10 @@ class Host {
consume() {}
}
i18nConsumer = {
consume() {}
}
/** 下列的函数或者方法是方便测试用 */
mockSchema = (schema: any) => {
this.schema = schema;

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-renderer-core",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "renderer core",
"license": "MIT",
"main": "lib/index.js",
@ -16,8 +16,8 @@
},
"dependencies": {
"@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"debug": "^4.1.1",
"fetch-jsonp": "^1.1.3",
@ -33,7 +33,7 @@
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
"@alifd/next": "^1.26.0",
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-test-mate": "^1.0.1",
"@babel/plugin-transform-typescript": "^7.16.8",
"@testing-library/react": "^11.2.2",
@ -59,5 +59,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/renderer-core"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -174,7 +174,7 @@ export default function baseRendererFactory(): IBaseRenderComponent {
this.__compScopes = {};
this.__instanceMap = {};
this.__bindCustomMethods(props);
this.__initI18nAPIs(props);
this.__initI18nAPIs();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@ -358,12 +358,12 @@ export default function baseRendererFactory(): IBaseRenderComponent {
* init i18n apis
* @PRIVATE
*/
__initI18nAPIs = (props: IBaseRendererProps) => {
__initI18nAPIs = () => {
this.i18n = (key: string, values = {}) => {
const { locale, messages } = props;
const { locale, messages } = this.props;
return getI18n(key, values, locale, messages);
};
this.getLocale = () => props.locale;
this.getLocale = () => this.props.locale;
this.setLocale = (loc: string) => {
const setLocaleFn = this.appHelper?.utils?.i18n?.setLocale;
if (!setLocaleFn || typeof setLocaleFn !== 'function') {

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-shell",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Shell Layer for AliLowCodeEngine",
"main": "lib/index.js",
"module": "es/index.js",
@ -15,11 +15,11 @@
},
"license": "MIT",
"dependencies": {
"@alilc/lowcode-designer": "1.0.16",
"@alilc/lowcode-editor-core": "1.0.16",
"@alilc/lowcode-editor-skeleton": "1.0.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-utils": "1.0.16",
"@alilc/lowcode-designer": "1.0.17-beta.11",
"@alilc/lowcode-editor-core": "1.0.17-beta.11",
"@alilc/lowcode-editor-skeleton": "1.0.17-beta.11",
"@alilc/lowcode-types": "1.0.17-beta.11",
"@alilc/lowcode-utils": "1.0.17-beta.11",
"classnames": "^2.2.6",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
@ -57,5 +57,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/shell"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -183,4 +183,14 @@ export default class Project {
}
return offFn;
}
/**
*
* https://github.com/alibaba/lowcode-engine/blob/main/specs/lowcode-spec.md#2434%E5%9B%BD%E9%99%85%E5%8C%96%E5%A4%9A%E8%AF%AD%E8%A8%80%E7%B1%BB%E5%9E%8Baa
* @param value object
* @returns
*/
setI18n(value: object): void {
this[projectSymbol].set('i18n', value);
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-types",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Types for Ali lowCode engine",
"files": [
"es",
@ -30,5 +30,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/types"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-utils",
"version": "1.0.16",
"version": "1.0.17-beta.11",
"description": "Utils for Ali lowCode engine",
"files": [
"lib",
@ -14,11 +14,10 @@
},
"dependencies": {
"@alifd/next": "^1.19.16",
"@alilc/lowcode-types": "1.0.16",
"@alilc/lowcode-types": "1.0.17-beta.11",
"lodash": "^4.17.21",
"mobx": "^6.3.0",
"react": "^16",
"mobx": "^6.3.0",
"zen-logger": "^1.1.0"
},
"devDependencies": {
@ -35,5 +34,5 @@
"type": "http",
"url": "https://github.com/alibaba/lowcode-engine/tree/main/packages/utils"
},
"gitHead": "2669f179e6f899d395ce1942d0fe04f9c5ed48a6"
"gitHead": "f30ccf509a7c3341ef5cffc6b88aff0a0286787e"
}

View File

@ -936,11 +936,11 @@ type Ti18n = {
"i18n": {
"zh-CN": {
"i18n-jwg27yo4": "你好",
"i18n-jwg27yo3": "${name}博士"
"i18n-jwg27yo3": "{name}博士"
},
"en-US": {
"i18n-jwg27yo4": "Hello",
"i18n-jwg27yo3": "Doctor ${name}"
"i18n-jwg27yo3": "Doctor {name}"
}
}
}