@peter.prib/renderengine 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/REFERENCE.md +2227 -2205
- package/dist/renderengine-workspace.umd.js +4073 -3451
- package/dist/renderengine.umd.js +4345 -3919
- package/package.json +1 -1
- package/src/charting/FormDialog.js +1 -1
- package/src/charting/ModelComparisonDialog.js +122 -0
- package/src/charting/diagramModel/ComparedKind.js +67 -0
- package/src/charting/diagramModel/DiagramView.js +11 -0
- package/src/charting/diagramModel/MergeModelCommand.js +37 -0
- package/src/charting/diagramModel/ModelComparison.js +100 -0
- package/src/charting/diagramModel/ViewSetModel.js +260 -243
- package/src/charting/diagramModel/ViewsCompared.js +39 -0
- package/src/charting/diagramModel/index.js +10 -6
- package/src/charting/diagrams/ArchimateModel.js +1170 -1155
- package/src/charting/diagrams/ArchimateViewsCompared.js +70 -0
- package/src/charting/diagrams/ConceptsCompared.js +76 -0
- package/src/charting/modelTree/ModelTreePanel.js +886 -914
- package/src/charting/modelTree/viewFolders.js +31 -0
- package/src/workspace/parts/ArchimateCanvasPart.js +345 -345
- package/src/workspace/parts/DiagramEditorPart.js +135 -135
- package/src/workspace/parts/EditorPart.js +26 -7
- package/src/workspace/parts/ModelsPart.js +58 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** What a view shows in the tree, by its kind ('canvas', else a diagram). */
|
|
2
|
+
const VIEW_ICONS = Object.freeze({ canvas: '🎨' });
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The tree nodes for some views at one depth of the Views folder, as Archi
|
|
6
|
+
* keeps them: each view remembers its sub-folder path (`archiFolder`, folder
|
|
7
|
+
* steps {id, name}). A folder node per sub-folder at this depth (holding the
|
|
8
|
+
* views under it, opened a level deeper), then the views that sit here, each
|
|
9
|
+
* in the model's order.
|
|
10
|
+
* @param {Array<Object>} views
|
|
11
|
+
* @param {number} [depth]
|
|
12
|
+
* @returns {Array<Object>} TreeBuilder nodes: {id, label, icon, type: 'view-folder'|'view', ...}
|
|
13
|
+
*/
|
|
14
|
+
export function viewFolderNodes(views, depth = 0) {
|
|
15
|
+
const folders = new Map();
|
|
16
|
+
const here = [];
|
|
17
|
+
for (const view of views) {
|
|
18
|
+
const step = view.archiFolder?.[depth];
|
|
19
|
+
if (!step) { here.push(view); continue; }
|
|
20
|
+
if (!folders.has(step.id)) folders.set(step.id, { step, views: [] });
|
|
21
|
+
folders.get(step.id).views.push(view);
|
|
22
|
+
}
|
|
23
|
+
return [
|
|
24
|
+
...[...folders.values()].map(({ step, views: inside }) => ({
|
|
25
|
+
id: `view-folder-${step.id}`, label: step.name || 'Untitled Folder', icon: '📁', type: 'view-folder', _views: inside, _depth: depth + 1,
|
|
26
|
+
})),
|
|
27
|
+
...here.map(view => ({
|
|
28
|
+
id: view.id, label: view.name || view.title || 'Untitled View', icon: VIEW_ICONS[view.constructor.kind] ?? '📄', type: 'view', _view: view,
|
|
29
|
+
})),
|
|
30
|
+
];
|
|
31
|
+
}
|