mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 18:37:07 +00:00
支持 defaultOutlinePaneProps 配置项
Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/6857662 * feat: 增加 defaultOutlinePaneProps 配置项来传入大纲树的参数 * Revert "refactor: get Editor -> editor" This reverts commit 2546a453827c39fc14f5e8b6cbee1bc90326acfb.
This commit is contained in:
parent
b02b62fbe3
commit
90eec64be0
@ -180,7 +180,7 @@ export class BoxResizingInstance extends Component<{
|
|||||||
metaData.experimental.callbacks.onResizeEnd(e, node);
|
metaData.experimental.callbacks.onResizeEnd(e, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export class LiveEditing {
|
|||||||
const targetElement = event.target as HTMLElement;
|
const targetElement = event.target as HTMLElement;
|
||||||
const { liveTextEditing } = node.componentMeta;
|
const { liveTextEditing } = node.componentMeta;
|
||||||
|
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || '';
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || '';
|
||||||
|
|||||||
@ -62,7 +62,7 @@ export default class InstanceNodeSelector extends React.Component<IProps, IState
|
|||||||
|
|
||||||
if (canClick && typeof node.select === 'function') {
|
if (canClick && typeof node.select === 'function') {
|
||||||
node.select();
|
node.select();
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import clipboard from './clipboard';
|
|||||||
function isInLiveEditing() {
|
function isInLiveEditing() {
|
||||||
if (globalContext.has(Editor)) {
|
if (globalContext.has(Editor)) {
|
||||||
return Boolean(
|
return Boolean(
|
||||||
globalContext.get('editor').get('designer')?.project?.simulator?.liveEditing?.editing,
|
globalContext.get(Editor).get('designer')?.project?.simulator?.liveEditing?.editing,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,7 +115,7 @@ export class History {
|
|||||||
}
|
}
|
||||||
const cursor = this.session.cursor - 1;
|
const cursor = this.session.cursor - 1;
|
||||||
this.go(cursor);
|
this.go(cursor);
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ export class History {
|
|||||||
}
|
}
|
||||||
const cursor = this.session.cursor + 1;
|
const cursor = this.session.cursor + 1;
|
||||||
this.go(cursor);
|
this.go(cursor);
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -330,7 +330,6 @@ function getKeyInfo(combination: string, action?: string): KeyInfo {
|
|||||||
*/
|
*/
|
||||||
function fireCallback(callback: HotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void {
|
function fireCallback(callback: HotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void {
|
||||||
try {
|
try {
|
||||||
// 这里不能简化成 editor,单测时没有注册
|
|
||||||
const editor = globalContext.get(Editor);
|
const editor = globalContext.get(Editor);
|
||||||
const designer = editor.get('designer');
|
const designer = editor.get('designer');
|
||||||
const node = designer?.currentSelection?.getNodes()?.[0];
|
const node = designer?.currentSelection?.getNodes()?.[0];
|
||||||
|
|||||||
@ -116,12 +116,12 @@ export class DraggableLineView extends Component<{ panel: Panel }> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 抛出事件,对于有些需要 panel 插件随着 度变化进行再次渲染的,由panel插件内部监听事件实现
|
// 抛出事件,对于有些需要 panel 插件随着 度变化进行再次渲染的,由panel插件内部监听事件实现
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
editor?.emit('dockpane.drag', width);
|
editor?.emit('dockpane.drag', width);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDragChange(type: 'start' | 'end') {
|
onDragChange(type: 'start' | 'end') {
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
editor?.emit('dockpane.dragchange', type);
|
editor?.emit('dockpane.dragchange', type);
|
||||||
// builtinSimulator 屏蔽掉 鼠标事件
|
// builtinSimulator 屏蔽掉 鼠标事件
|
||||||
editor?.emit('designer.builtinSimulator.disabledEvents', type === 'start');
|
editor?.emit('designer.builtinSimulator.disabledEvents', type === 'start');
|
||||||
@ -185,7 +185,7 @@ export class TitledPanelView extends Component<{ panel: Panel; area?: string }>
|
|||||||
if (!panel.inited) {
|
if (!panel.inited) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
||||||
editor?.emit('skeleton.panel.toggle', {
|
editor?.emit('skeleton.panel.toggle', {
|
||||||
name: panelName || '',
|
name: panelName || '',
|
||||||
@ -247,7 +247,7 @@ export class PanelView extends Component<{
|
|||||||
if (!panel.inited) {
|
if (!panel.inited) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
||||||
editor?.emit('skeleton.panel.toggle', {
|
editor?.emit('skeleton.panel.toggle', {
|
||||||
name: panelName || '',
|
name: panelName || '',
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export class Workbench extends Component<{ skeleton: Skeleton; config?: EditorCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// componentDidCatch(error: any) {
|
// componentDidCatch(error: any) {
|
||||||
// globalContext.get('editor').emit('editor.skeleton.workbench.error', error);
|
// globalContext.get(Editor).emit('editor.skeleton.workbench.error', error);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@ -168,6 +168,7 @@ plugins.register((ctx: ILowCodePluginContext) => {
|
|||||||
panelProps: {
|
panelProps: {
|
||||||
area: isInFloatArea ? 'leftFloatArea' : 'leftFixedArea',
|
area: isInFloatArea ? 'leftFloatArea' : 'leftFixedArea',
|
||||||
keepVisibleWhileDragging: true,
|
keepVisibleWhileDragging: true,
|
||||||
|
...engineConfig.get('defaultOutlinePaneProps'),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
skeleton.add({
|
skeleton.add({
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { IconLock, IconUnlock } from '../icons';
|
|||||||
|
|
||||||
|
|
||||||
function emitOutlineEvent(type: string, treeNode: TreeNode, rest?: Record<string, unknown>) {
|
function emitOutlineEvent(type: string, treeNode: TreeNode, rest?: Record<string, unknown>) {
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const node = treeNode?.node;
|
const node = treeNode?.node;
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
|
|||||||
@ -66,7 +66,7 @@ export default class TreeView extends Component<{ tree: Tree }> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
selection.select(id);
|
selection.select(id);
|
||||||
const editor = globalContext.get('editor');
|
const editor = globalContext.get(Editor);
|
||||||
const selectedNode = designer.currentSelection?.getNodes()?.[0];
|
const selectedNode = designer.currentSelection?.getNodes()?.[0];
|
||||||
const npm = selectedNode?.componentMeta?.npm;
|
const npm = selectedNode?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user