MCPcopy
hub / github.com/alibaba/lowcode-engine / DocumentModel

Class DocumentModel

packages/designer/src/document/document-model.ts:156–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156export class DocumentModel implements IDocumentModel {
157 /**
158 * 根节点 类型有:Page/Component/Block
159 */
160 rootNode: IRootNode | null;
161
162 /**
163 * 文档编号
164 */
165 id: string = uniqueId('doc');
166
167 /**
168 * 选区控制
169 */
170 readonly selection: ISelection = new Selection(this);
171
172 /**
173 * 操作记录控制
174 */
175 readonly history: IHistory;
176
177 /**
178 * 模态节点管理
179 */
180 modalNodesManager: IModalNodesManager;
181
182 private _nodesMap = new Map<string, INode>();
183
184 readonly project: IProject;
185
186 readonly designer: IDesigner;
187
188 @obx.shallow private nodes = new Set<INode>();
189
190 private seqId = 0;
191
192 private emitter: IEventBus;
193
194 private rootNodeVisitorMap: { [visitorName: string]: any } = {};
195
196 /**
197 * @deprecated
198 */
199 private _addons: Array<{ name: string; exportData: any }> = [];
200
201 /**
202 * 模拟器
203 */
204 get simulator(): ISimulatorHost | null {
205 return this.project.simulator;
206 }
207
208 get nodesMap(): Map<string, INode> {
209 return this._nodesMap;
210 }
211
212 get fileName(): string {
213 return this.rootNode?.getExtraProp('fileName', false)?.getAsString() || this.id;

Callers

nothing calls this directly

Calls 1

uniqueIdFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…