diff --git a/packages/demo/build.json b/packages/demo/build.json index 38868b6b0..376c27c63 100644 --- a/packages/demo/build.json +++ b/packages/demo/build.json @@ -1,6 +1,7 @@ { "entry": { "index": "src/vision/index.ts", + "vision-preset": "../vision-preset/src/index.ts", "react-simulator-renderer": "../react-simulator-renderer/src/index.ts" }, "vendor": false, @@ -13,6 +14,7 @@ "react-dom": "var window.ReactDOM", "prop-types": "var window.PropTypes", "@alifd/next": "var window.Next", + "@ali/visualengine": "var window.VisualEngine", "@ali/visualengine-utils": "var window.VisualEngineUtils" }, "plugins": [ diff --git a/packages/demo/public/index.html b/packages/demo/public/index.html index 353373def..4ba88b9a7 100644 --- a/packages/demo/public/index.html +++ b/packages/demo/public/index.html @@ -16,10 +16,7 @@ - - - - + - - + diff --git a/packages/designer/src/builtin-simulator/host.ts b/packages/designer/src/builtin-simulator/host.ts index ffd2cbfe2..e90056a67 100644 --- a/packages/designer/src/builtin-simulator/host.ts +++ b/packages/designer/src/builtin-simulator/host.ts @@ -298,8 +298,8 @@ export class BuiltinSimulatorHost implements ISimulatorHost { // stop response document click event - e.preventDefault(); - e.stopPropagation(); + // e.preventDefault(); + // e.stopPropagation(); // todo: catch link redirect }, true, diff --git a/packages/editor-skeleton/src/widget/widget.ts b/packages/editor-skeleton/src/widget/widget.ts index 91bd90344..4fc91ea3d 100644 --- a/packages/editor-skeleton/src/widget/widget.ts +++ b/packages/editor-skeleton/src/widget/widget.ts @@ -62,6 +62,10 @@ export default class Widget implements IWidget { this.align = props.align; } + getId() { + return this.id; + } + getName() { return this.name; } diff --git a/packages/vision-preset/src/panes.ts b/packages/vision-preset/src/panes.ts index 0462972d9..750307496 100644 --- a/packages/vision-preset/src/panes.ts +++ b/packages/vision-preset/src/panes.ts @@ -1,6 +1,7 @@ import { skeleton, editor } from './editor'; import { ReactElement } from 'react'; import { IWidgetBaseConfig } from '@ali/lowcode-editor-skeleton'; +import { uniqueId } from '@ali/lowcode-utils'; export interface IContentItemConfig { title: string; @@ -204,13 +205,15 @@ const widgets = skeleton.mainArea; const stages = Object.assign(skeleton.stages, { getStage(name: string) { - skeleton.stages.container.get(name); + return skeleton.stages.container.get(name); }, createStage(config: any) { config = upgradeConfig(config); if (config.id) { config.name = config.id; + } else if (!config.name) { + config.name = uniqueId('stage'); } const stage = skeleton.stages.add(config);