Merge branch 'polyfill/vision' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into polyfill/vision

This commit is contained in:
mario.gk 2020-04-28 17:10:35 +08:00
commit 3010ae2b82
5 changed files with 14 additions and 10 deletions

View File

@ -1,6 +1,7 @@
{ {
"entry": { "entry": {
"index": "src/vision/index.ts", "index": "src/vision/index.ts",
"vision-preset": "../vision-preset/src/index.ts",
"react-simulator-renderer": "../react-simulator-renderer/src/index.ts" "react-simulator-renderer": "../react-simulator-renderer/src/index.ts"
}, },
"vendor": false, "vendor": false,
@ -13,6 +14,7 @@
"react-dom": "var window.ReactDOM", "react-dom": "var window.ReactDOM",
"prop-types": "var window.PropTypes", "prop-types": "var window.PropTypes",
"@alifd/next": "var window.Next", "@alifd/next": "var window.Next",
"@ali/visualengine": "var window.VisualEngine",
"@ali/visualengine-utils": "var window.VisualEngineUtils" "@ali/visualengine-utils": "var window.VisualEngineUtils"
}, },
"plugins": [ "plugins": [

View File

@ -16,10 +16,7 @@
<script src="https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js"></script> <script src="https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js"></script>
<link rel="stylesheet" href="https://alifd.alicdn.com/npm/@alifd/next/1.11.6/next.min.css" /> <link rel="stylesheet" href="https://alifd.alicdn.com/npm/@alifd/next/1.11.6/next.min.css" />
<script src="https://unpkg.alibaba-inc.com/@alifd/next@1.18.17/dist/next.min.js"></script> <script src="https://unpkg.alibaba-inc.com/@alifd/next@1.18.17/dist/next.min.js"></script>
<!-- lowcode engine core --> <link rel="stylesheet" href="/css/vision-preset.css" />
<link rel="stylesheet" href="/dist/core.css" />
<!-- lowcode engine vision-prest -->
<link rel="stylesheet" href="/dist/vision-preset.css" />
<script> <script>
window.pageConfig = { window.pageConfig = {
env: 'release', env: 'release',
@ -71,9 +68,7 @@
<body> <body>
<!-- lowcode engine globals --> <!-- lowcode engine globals -->
<script src="/dist/core.js"></script> <script src="/js/vision-preset.js"></script>
<!-- lowcode engine globals -->
<script src="/dist/vision-preset.js"></script>
<script src="https://dev.g.alicdn.com/vision/visualengine-utils/5.0.0/engine-utils.js"></script> <script src="https://dev.g.alicdn.com/vision/visualengine-utils/5.0.0/engine-utils.js"></script>
</body> </body>
</html> </html>

View File

@ -298,8 +298,8 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
'click', 'click',
(e) => { (e) => {
// stop response document click event // stop response document click event
e.preventDefault(); // e.preventDefault();
e.stopPropagation(); // e.stopPropagation();
// todo: catch link redirect // todo: catch link redirect
}, },
true, true,

View File

@ -62,6 +62,10 @@ export default class Widget implements IWidget {
this.align = props.align; this.align = props.align;
} }
getId() {
return this.id;
}
getName() { getName() {
return this.name; return this.name;
} }

View File

@ -1,6 +1,7 @@
import { skeleton, editor } from './editor'; import { skeleton, editor } from './editor';
import { ReactElement } from 'react'; import { ReactElement } from 'react';
import { IWidgetBaseConfig } from '@ali/lowcode-editor-skeleton'; import { IWidgetBaseConfig } from '@ali/lowcode-editor-skeleton';
import { uniqueId } from '@ali/lowcode-utils';
export interface IContentItemConfig { export interface IContentItemConfig {
title: string; title: string;
@ -204,13 +205,15 @@ const widgets = skeleton.mainArea;
const stages = Object.assign(skeleton.stages, { const stages = Object.assign(skeleton.stages, {
getStage(name: string) { getStage(name: string) {
skeleton.stages.container.get(name); return skeleton.stages.container.get(name);
}, },
createStage(config: any) { createStage(config: any) {
config = upgradeConfig(config); config = upgradeConfig(config);
if (config.id) { if (config.id) {
config.name = config.id; config.name = config.id;
} else if (!config.name) {
config.name = uniqueId('stage');
} }
const stage = skeleton.stages.add(config); const stage = skeleton.stages.add(config);