mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
增加 Symbol,history 增加 isModified
This commit is contained in:
parent
e5b7390dde
commit
984a76993f
@ -174,6 +174,10 @@ export class History {
|
||||
this.emitter.removeAllListeners();
|
||||
this.records = [];
|
||||
}
|
||||
|
||||
isModified() {
|
||||
return this.point !== this.session.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
class Session {
|
||||
|
||||
@ -25,6 +25,7 @@ import DragEngine from './drag-engine';
|
||||
import Viewport from './viewport';
|
||||
import Project from './project';
|
||||
import { designer, editor } from './editor';
|
||||
import Symbols from './symbols';
|
||||
|
||||
import './vision.less';
|
||||
|
||||
@ -109,6 +110,7 @@ const VisualEngine = {
|
||||
Version,
|
||||
Project,
|
||||
logger,
|
||||
Symbols,
|
||||
};
|
||||
|
||||
(window as any).VisualEngine = VisualEngine;
|
||||
@ -156,6 +158,7 @@ export {
|
||||
Version,
|
||||
Project,
|
||||
logger,
|
||||
Symbols,
|
||||
};
|
||||
|
||||
|
||||
|
||||
17
packages/vision-preset/src/symbols.ts
Normal file
17
packages/vision-preset/src/symbols.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export class SymbolManager {
|
||||
private symbolMap: { [symbolName: string]: symbol } = {};
|
||||
|
||||
public create(name: string): symbol {
|
||||
if (this.symbolMap[name]) {
|
||||
return this.symbolMap[name];
|
||||
}
|
||||
this.symbolMap[name] = Symbol(name);
|
||||
return this.symbolMap[name];
|
||||
}
|
||||
|
||||
public get(name: string) {
|
||||
return this.symbolMap[name];
|
||||
}
|
||||
}
|
||||
|
||||
export default new SymbolManager();
|
||||
Loading…
x
Reference in New Issue
Block a user