| 154 | } |
| 155 | |
| 156 | export 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; |
nothing calls this directly
no test coverage detected
searching dependent graphs…