@grafloria/element 0.3.0 → 0.3.1
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/package.json +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js.map +1 -1
- package/src/lib/dashboard-kit/index.d.ts +1 -1
- package/src/lib/dashboard-kit/index.js.map +1 -1
- package/src/lib/grafloria.d.ts +2 -1
- package/src/lib/grafloria.js +3 -1
- package/src/lib/grafloria.js.map +1 -1
- package/esm/src/index.js +0 -284
- package/esm/src/index.js.map +0 -1
- package/esm/src/lib/dashboard-kit/dashboard.js +0 -590
- package/esm/src/lib/dashboard-kit/dashboard.js.map +0 -1
- package/esm/src/lib/dashboard-kit/grid-binder.js +0 -1632
- package/esm/src/lib/dashboard-kit/grid-binder.js.map +0 -1
- package/esm/src/lib/dashboard-kit/grid-mapping.js +0 -164
- package/esm/src/lib/dashboard-kit/grid-mapping.js.map +0 -1
- package/esm/src/lib/dashboard-kit/index.js +0 -8
- package/esm/src/lib/dashboard-kit/index.js.map +0 -1
- package/esm/src/lib/dashboard-kit/styles.js +0 -199
- package/esm/src/lib/dashboard-kit/styles.js.map +0 -1
- package/esm/src/lib/dashboard-kit/widgets.js +0 -379
- package/esm/src/lib/dashboard-kit/widgets.js.map +0 -1
- package/esm/src/lib/diagram-kit/card.js +0 -199
- package/esm/src/lib/diagram-kit/card.js.map +0 -1
- package/esm/src/lib/diagram-kit/editing.js +0 -286
- package/esm/src/lib/diagram-kit/editing.js.map +0 -1
- package/esm/src/lib/diagram-kit/er.js +0 -160
- package/esm/src/lib/diagram-kit/er.js.map +0 -1
- package/esm/src/lib/diagram-kit/handles.js +0 -312
- package/esm/src/lib/diagram-kit/handles.js.map +0 -1
- package/esm/src/lib/diagram-kit/index.js +0 -9
- package/esm/src/lib/diagram-kit/index.js.map +0 -1
- package/esm/src/lib/diagram-kit/rows.js +0 -144
- package/esm/src/lib/diagram-kit/rows.js.map +0 -1
- package/esm/src/lib/diagram-kit/styles.js +0 -110
- package/esm/src/lib/diagram-kit/styles.js.map +0 -1
- package/esm/src/lib/diagram-kit/uml.js +0 -135
- package/esm/src/lib/diagram-kit/uml.js.map +0 -1
- package/esm/src/lib/diagram-kit/update.js +0 -244
- package/esm/src/lib/diagram-kit/update.js.map +0 -1
- package/esm/src/lib/grafloria-flow-element.js +0 -266
- package/esm/src/lib/grafloria-flow-element.js.map +0 -1
- package/esm/src/lib/grafloria.js +0 -67
- package/esm/src/lib/grafloria.js.map +0 -1
- package/esm/src/lib/load.js +0 -252
- package/esm/src/lib/load.js.map +0 -1
- package/esm/src/lib/node-type-registry.js +0 -42
- package/esm/src/lib/node-type-registry.js.map +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UML class-diagram kit — typed builders for the full relationship vocabulary.
|
|
3
|
-
*
|
|
4
|
-
* The packaged form of demos/diagrams/class-uml.html + uml-relationships.html:
|
|
5
|
-
* three-compartment class cards («stereotype», name, attributes, methods) and
|
|
6
|
-
* every standard relationship with its real notation:
|
|
7
|
-
*
|
|
8
|
-
* inheritance ── solid, hollow triangle at the parent
|
|
9
|
-
* realization ┄┄ dashed, hollow triangle at the interface
|
|
10
|
-
* association ── plain line (multiplicity chips optional)
|
|
11
|
-
* directed-association ── open arrow at the target
|
|
12
|
-
* aggregation ── hollow diamond at the whole (source)
|
|
13
|
-
* composition ── FILLED diamond at the whole (source)
|
|
14
|
-
* dependency ┄┄ dashed, open arrow («uses»)
|
|
15
|
-
*
|
|
16
|
-
* ```ts
|
|
17
|
-
* const spec = umlDiagram({
|
|
18
|
-
* classes: [{ id: 'Shape', abstract: true, attributes: ['# x: float'], methods: ['+ area(): float'] }],
|
|
19
|
-
* relationships: [{ from: 'Circle', to: 'Shape', kind: 'inheritance' }],
|
|
20
|
-
* });
|
|
21
|
-
* const api = render(spec, container);
|
|
22
|
-
* spec.finalize(api); // attaches multiplicity chips (needs the live model)
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
import { ensureDiagramKitStyles } from './styles';
|
|
26
|
-
import { bindRowInteractions } from './rows';
|
|
27
|
-
import { classCardContent, classAutoHeight } from './card';
|
|
28
|
-
import { bindCardEditing } from './editing';
|
|
29
|
-
const DEFAULT_WIDTH = 200;
|
|
30
|
-
const STROKE = '#475569';
|
|
31
|
-
const DASH = '6,4';
|
|
32
|
-
/**
|
|
33
|
-
* The notation table. Every kind sets arrowHead EXPLICITLY — a plain line must
|
|
34
|
-
* carry `arrowHead: none`, or the renderer paints its default arrow (the
|
|
35
|
-
* stray-arrowhead bug the demos hit live).
|
|
36
|
-
*/
|
|
37
|
-
function edgeStyleFor(kind) {
|
|
38
|
-
const none = { type: 'none', size: 0, filled: false };
|
|
39
|
-
switch (kind) {
|
|
40
|
-
case 'inheritance':
|
|
41
|
-
return { stroke: STROKE, strokeWidth: 1.5, arrowHead: { type: 'generalization', size: 16, filled: false }, arrowTail: none };
|
|
42
|
-
case 'realization':
|
|
43
|
-
return { stroke: STROKE, strokeWidth: 1.5, strokeDasharray: DASH, arrowHead: { type: 'generalization', size: 16, filled: false }, arrowTail: none };
|
|
44
|
-
case 'association':
|
|
45
|
-
return { stroke: STROKE, strokeWidth: 1.5, arrowHead: none, arrowTail: none };
|
|
46
|
-
case 'directed-association':
|
|
47
|
-
return { stroke: STROKE, strokeWidth: 1.5, arrowHead: { type: 'open-arrow', size: 12, filled: false }, arrowTail: none };
|
|
48
|
-
case 'aggregation':
|
|
49
|
-
return { stroke: STROKE, strokeWidth: 1.5, arrowHead: none, arrowTail: { type: 'hollow-diamond', size: 14, filled: false } };
|
|
50
|
-
case 'composition':
|
|
51
|
-
return { stroke: STROKE, strokeWidth: 1.5, arrowHead: none, arrowTail: { type: 'filled-diamond', size: 14, filled: true } };
|
|
52
|
-
case 'dependency':
|
|
53
|
-
return { stroke: STROKE, strokeWidth: 1.5, strokeDasharray: DASH, arrowHead: { type: 'open-arrow', size: 12, filled: false }, arrowTail: none };
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/** Multiplicity chip, positioned near an edge end. */
|
|
57
|
-
const chip = (text, slot) => ({
|
|
58
|
-
text,
|
|
59
|
-
slot,
|
|
60
|
-
offset: { x: 0, y: -7 },
|
|
61
|
-
style: { fontSize: 11, fontWeight: '600', color: '#0f172a', background: '#ffffffdd', padding: 1, borderRadius: 2 },
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Build a render() spec for a UML class diagram. Call `spec.finalize(api)`
|
|
65
|
-
* after render() — multiplicity chips are positioned labels, which only the
|
|
66
|
-
* live model's `link.addLabel` can express.
|
|
67
|
-
*/
|
|
68
|
-
export function umlDiagram(options) {
|
|
69
|
-
var _a;
|
|
70
|
-
ensureDiagramKitStyles();
|
|
71
|
-
const editable = options.editable === true;
|
|
72
|
-
const nodes = options.classes.map((cls, i) => {
|
|
73
|
-
var _a, _b;
|
|
74
|
-
return {
|
|
75
|
-
id: cls.id,
|
|
76
|
-
position: (_a = cls.position) !== null && _a !== void 0 ? _a : { x: 80 + (i % 3) * 320, y: 60 + Math.floor(i / 3) * 260 },
|
|
77
|
-
size: { width: (_b = cls.width) !== null && _b !== void 0 ? _b : DEFAULT_WIDTH, height: classAutoHeight(cls, editable) },
|
|
78
|
-
// interactive: members are real DOM targets (hover, row selection, inline
|
|
79
|
-
// editing); node drag/select stay geometric in the binder.
|
|
80
|
-
metadata: Object.assign({ html: { content: classCardContent(cls, editable), interactive: true }, kitClass: cls, kitEditable: editable }, (options.rowSelection === false ? { kitRowSelection: false } : {})),
|
|
81
|
-
shape: { type: 'rect', fill: 'none', stroke: 'none' },
|
|
82
|
-
style: { fill: 'transparent', stroke: 'transparent', strokeWidth: 0 },
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
const rels = (_a = options.relationships) !== null && _a !== void 0 ? _a : [];
|
|
86
|
-
const edges = rels.map((rel, i) => {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
return (Object.assign(Object.assign(Object.assign({ id: (_a = rel.id) !== null && _a !== void 0 ? _a : `uml-rel-${i + 1}`, source: rel.from, target: rel.to, label: rel.label, type: 'orthogonal' }, (rel.fromSide ? { sourceHandle: rel.fromSide } : {})), (rel.toSide ? { targetHandle: rel.toSide } : {})), { style: edgeStyleFor((_b = rel.kind) !== null && _b !== void 0 ? _b : 'association') }));
|
|
89
|
-
});
|
|
90
|
-
// finalize is idempotent per api: render() auto-runs it, and a demo may also
|
|
91
|
-
// call it — chips must not be added twice.
|
|
92
|
-
const finalized = new WeakSet();
|
|
93
|
-
const finalize = (api) => {
|
|
94
|
-
var _a, _b, _c, _d, _e, _f;
|
|
95
|
-
const a0 = api;
|
|
96
|
-
// Own card ring only — suppress the node resize handles on the live model
|
|
97
|
-
// (the render-input path does not honour a spec-level `behavior`).
|
|
98
|
-
const m0 = (_a = a0 === null || a0 === void 0 ? void 0 : a0.getModel) === null || _a === void 0 ? void 0 : _a.call(a0);
|
|
99
|
-
if (m0)
|
|
100
|
-
for (const cls of options.classes)
|
|
101
|
-
(_d = (_c = (_b = m0.getNode) === null || _b === void 0 ? void 0 : _b.call(m0, cls.id)) === null || _c === void 0 ? void 0 : _c.setBehavior) === null || _d === void 0 ? void 0 : _d.call(_c, { resizable: false });
|
|
102
|
-
if (options.rowSelection !== false) {
|
|
103
|
-
const a = api;
|
|
104
|
-
// bindRowInteractions disposes any prior binding for the container, so it
|
|
105
|
-
// is safe to run twice.
|
|
106
|
-
if (a === null || a === void 0 ? void 0 : a.container)
|
|
107
|
-
bindRowInteractions(a);
|
|
108
|
-
}
|
|
109
|
-
if (editable && (a0 === null || a0 === void 0 ? void 0 : a0.container))
|
|
110
|
-
bindCardEditing(a0);
|
|
111
|
-
if (api && typeof api === 'object') {
|
|
112
|
-
if (finalized.has(api))
|
|
113
|
-
return;
|
|
114
|
-
finalized.add(api);
|
|
115
|
-
}
|
|
116
|
-
const model = (_e = api === null || api === void 0 ? void 0 : api.getModel) === null || _e === void 0 ? void 0 : _e.call(api);
|
|
117
|
-
if (!model)
|
|
118
|
-
return;
|
|
119
|
-
let added = false;
|
|
120
|
-
rels.forEach((rel, i) => {
|
|
121
|
-
if (!rel.multiplicity)
|
|
122
|
-
return;
|
|
123
|
-
const link = model.getLink(edges[i].id);
|
|
124
|
-
if (!link)
|
|
125
|
-
return;
|
|
126
|
-
link.addLabel(chip(rel.multiplicity[0], 'start'));
|
|
127
|
-
link.addLabel(chip(rel.multiplicity[1], 'end'));
|
|
128
|
-
added = true;
|
|
129
|
-
});
|
|
130
|
-
if (added)
|
|
131
|
-
(_f = api === null || api === void 0 ? void 0 : api.renderNow) === null || _f === void 0 ? void 0 : _f.call(api);
|
|
132
|
-
};
|
|
133
|
-
return { nodes, edges, finalize };
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=uml.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uml.js","sourceRoot":"","sources":["../../../../../../../libs/element/src/lib/diagram-kit/uml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,aAAa,GAAG,GAAG,CAAC;AAoE1B,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,IAAI,GAAG,KAAK,CAAC;AAEnB;;;;GAIG;AACH,SAAS,YAAY,CAAC,IAAqB;IACzC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACtD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa;YAChB,OAAO,EAAE,MAAM,EAAE,MAAM,EA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AC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACtB,IAAI,CAAC,GAAG,CAAC,YAAY;gBAAE,OAAO;YAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAE,KAAK,CAAC,CAAC,CAAoB,CAAC,EAAE,CAAC,CAAC;YAC5D,IAAI,CAAC,IAAI;gBAAE,OAAO;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YAChD,KAAK,GAAG,IAAI,CAAC;QACf,CAAC,CAAC,CAAC;QACH,IAAI,KAAK;YAAE,MAAC,GAAkC,aAAlC,GAAG,uBAAH,GAAG,CAAiC,SAAS,mDAAI,CAAC;IAChE,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Live editing — `updateEntity` / `updateClass` mutate a rendered kit card in
|
|
3
|
-
* place (P3, the foundation the in-canvas editing chrome is built on).
|
|
4
|
-
*
|
|
5
|
-
* A delta changes the DATA (a table's name, its columns; a class's name,
|
|
6
|
-
* attributes, methods, width/height) and this module:
|
|
7
|
-
* 1. reads the stored spec (`kitEntity` / `kitClass`) — the source of truth;
|
|
8
|
-
* 2. applies the delta to a NEW spec (the caller's objects are never mutated,
|
|
9
|
-
* so undo can restore the old one cleanly);
|
|
10
|
-
* 3. regenerates the card html from the SAME builder er.ts/uml.ts use
|
|
11
|
-
* (`card.ts`), so an edited card is identical to a freshly-built one;
|
|
12
|
-
* 4. recomputes the node size;
|
|
13
|
-
* 5. RECONCILES the field ports — every port pinned to a surviving column
|
|
14
|
-
* moves to that column's new row (`erRowCenterY`), ports on a removed
|
|
15
|
-
* column are dropped along with their edges. Port ids never change, so an
|
|
16
|
-
* edge stays glued to its row across inserts/removes/reorders (the exact
|
|
17
|
-
* failure this solves: a port frozen at the old row while the rows shifted
|
|
18
|
-
* under it);
|
|
19
|
-
* 6. repaints — as ONE undoable step.
|
|
20
|
-
*
|
|
21
|
-
* ONE UNDO STEP. The change is applied through `api.getEngine().commandManager`
|
|
22
|
-
* — the same public seam `renderer/ext/public-api.ts` uses — wrapped in a
|
|
23
|
-
* single kit-local {@link Command}. There is no `SetNodeMetadataCommand` in the
|
|
24
|
-
* engine (the html/kit-spec mutation has no built-in command), so rather than
|
|
25
|
-
* reach into engine internals or compose a half-undoable macro, the whole edit
|
|
26
|
-
* lives in one Command subclass here (subclassing `Command` is the engine's
|
|
27
|
-
* intended extension point — every basic command does it). When no engine is
|
|
28
|
-
* present the edit still applies, just non-undoably.
|
|
29
|
-
*/
|
|
30
|
-
import { __awaiter } from "tslib";
|
|
31
|
-
import { Command, PortModel, LinkModel } from '@grafloria/engine';
|
|
32
|
-
import { entityCardContent, entityAutoHeight, classCardContent, classAutoHeight, erRowCenterY, rowIndexFromY, matchColumns, } from './card';
|
|
33
|
-
/**
|
|
34
|
-
* The single undoable edit. Captures the card's whole before-state on first
|
|
35
|
-
* execute and restores it on undo, so an edit — however many rows and edges it
|
|
36
|
-
* touched — is one Ctrl+Z.
|
|
37
|
-
*/
|
|
38
|
-
class UpdateCardCommand extends Command {
|
|
39
|
-
constructor(nodeId, kind, build) {
|
|
40
|
-
super(kind === 'er' ? 'Edit table' : 'Edit class');
|
|
41
|
-
this.nodeId = nodeId;
|
|
42
|
-
this.kind = kind;
|
|
43
|
-
this.build = build;
|
|
44
|
-
this.captured = false;
|
|
45
|
-
}
|
|
46
|
-
execute(context) {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
|
-
const model = context.diagram;
|
|
49
|
-
const node = model.getNode(this.nodeId);
|
|
50
|
-
if (!node)
|
|
51
|
-
return;
|
|
52
|
-
const kitKey = this.kind === 'er' ? 'kitEntity' : 'kitClass';
|
|
53
|
-
const oldKit = ((_a = node.getMetadata(kitKey)) !== null && _a !== void 0 ? _a : {});
|
|
54
|
-
if (!this.captured) {
|
|
55
|
-
this.captured = true;
|
|
56
|
-
this.before = {
|
|
57
|
-
html: node.getMetadata('html'),
|
|
58
|
-
kit: oldKit,
|
|
59
|
-
size: Object.assign({}, node.size),
|
|
60
|
-
ports: node.getPorts().map((p) => p.serialize()),
|
|
61
|
-
links: [],
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const result = this.build(oldKit);
|
|
65
|
-
const newWidth = (_b = result.width) !== null && _b !== void 0 ? _b : node.size.width;
|
|
66
|
-
const removedLinks = [];
|
|
67
|
-
if (this.kind === 'er') {
|
|
68
|
-
const oldCols = ((_c = oldKit['columns']) !== null && _c !== void 0 ? _c : []);
|
|
69
|
-
const newCols = ((_d = result.newKit['columns']) !== null && _d !== void 0 ? _d : []);
|
|
70
|
-
const map = matchColumns(oldCols, newCols);
|
|
71
|
-
for (const port of [...node.getPorts()]) {
|
|
72
|
-
const args = (_e = port.layout) === null || _e === void 0 ? void 0 : _e.args;
|
|
73
|
-
if (((_f = port.layout) === null || _f === void 0 ? void 0 : _f.strategy) !== 'absolute' || !args || args.units !== 'px' || args.y == null)
|
|
74
|
-
continue;
|
|
75
|
-
const oldIdx = rowIndexFromY(args.y);
|
|
76
|
-
if (oldIdx < 0 || oldIdx >= oldCols.length)
|
|
77
|
-
continue; // not a row-pinned field port
|
|
78
|
-
const newIdx = map.get(oldIdx);
|
|
79
|
-
if (newIdx === undefined) {
|
|
80
|
-
// The column is gone — drop the port and every edge riding it.
|
|
81
|
-
for (const link of model.getLinks()) {
|
|
82
|
-
if (link.sourcePortId === port.id || link.targetPortId === port.id)
|
|
83
|
-
removedLinks.push(link.serialize());
|
|
84
|
-
}
|
|
85
|
-
for (const link of model.getLinks().filter((l) => l.sourcePortId === port.id || l.targetPortId === port.id)) {
|
|
86
|
-
model.removeLink(link.id);
|
|
87
|
-
}
|
|
88
|
-
node.removePort(port.id);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
// Move the port to its column's NEW row; keep the ±dy spread. x tracks
|
|
92
|
-
// the (possibly changed) width by side, so a widened table stays pinned.
|
|
93
|
-
args.y = erRowCenterY(newIdx);
|
|
94
|
-
const side = (_g = port.alignment) === null || _g === void 0 ? void 0 : _g.side;
|
|
95
|
-
args.x = side === 'left' ? 0 : side === 'right' ? newWidth : newWidth / 2;
|
|
96
|
-
// A nested-arg mutation is not tracked — nudge the port so the model
|
|
97
|
-
// marks it dirty and the renderer repositions it this frame.
|
|
98
|
-
port.setOffset(Object.assign({}, ((_h = port.offset) !== null && _h !== void 0 ? _h : { x: 0, y: 0 })));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
node.setMetadata('html', { content: result.content, interactive: true });
|
|
103
|
-
node.setMetadata(kitKey, result.newKit);
|
|
104
|
-
node.setSize(newWidth, result.height);
|
|
105
|
-
if (this.before)
|
|
106
|
-
this.before.links = removedLinks;
|
|
107
|
-
}
|
|
108
|
-
undo(context) {
|
|
109
|
-
var _a;
|
|
110
|
-
const model = context.diagram;
|
|
111
|
-
const node = model.getNode(this.nodeId);
|
|
112
|
-
if (!node || !this.before)
|
|
113
|
-
return;
|
|
114
|
-
node.setMetadata('html', this.before.html);
|
|
115
|
-
node.setMetadata(this.kind === 'er' ? 'kitEntity' : 'kitClass', this.before.kit);
|
|
116
|
-
node.setSize(this.before.size.width, this.before.size.height);
|
|
117
|
-
const beforeIds = new Set(this.before.ports.map((p) => p['id']));
|
|
118
|
-
for (const p of [...node.getPorts()])
|
|
119
|
-
if (!beforeIds.has(p.id))
|
|
120
|
-
node.removePort(p.id);
|
|
121
|
-
for (const sp of this.before.ports) {
|
|
122
|
-
const live = node.getPort(sp['id']);
|
|
123
|
-
if (live) {
|
|
124
|
-
live.layout = sp['layout'];
|
|
125
|
-
live.setOffset(Object.assign({}, ((_a = sp['offset']) !== null && _a !== void 0 ? _a : { x: 0, y: 0 })));
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
node.addPort(PortModel.fromJSON(sp));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
for (const sl of this.before.links) {
|
|
132
|
-
if (!model.getLink(sl['id']))
|
|
133
|
-
model.addLink(LinkModel.fromJSON(sl));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
canExecute(context) {
|
|
137
|
-
var _a;
|
|
138
|
-
return !!((_a = context.diagram) === null || _a === void 0 ? void 0 : _a.getNode(this.nodeId));
|
|
139
|
-
}
|
|
140
|
-
serialize() {
|
|
141
|
-
return { id: this.id, name: this.name, timestamp: this.timestamp, data: { nodeId: this.nodeId, kind: this.kind } };
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/** Route a build through the engine's command stack (one undo step) or apply it directly. */
|
|
145
|
-
function runUpdate(api, nodeId, kind, build) {
|
|
146
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
var _a, _b, _c, _d, _e;
|
|
148
|
-
const model = (_a = api.getModel) === null || _a === void 0 ? void 0 : _a.call(api);
|
|
149
|
-
const node = (_b = model === null || model === void 0 ? void 0 : model.getNode) === null || _b === void 0 ? void 0 : _b.call(model, nodeId);
|
|
150
|
-
if (!model || !node)
|
|
151
|
-
return false;
|
|
152
|
-
const command = new UpdateCardCommand(nodeId, kind, build);
|
|
153
|
-
const cm = (_d = (_c = api.getEngine) === null || _c === void 0 ? void 0 : _c.call(api)) === null || _d === void 0 ? void 0 : _d.commandManager;
|
|
154
|
-
if (cm === null || cm === void 0 ? void 0 : cm.execute) {
|
|
155
|
-
yield cm.execute(command); // ONE undoable step (Command enters history once)
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
command.execute({ diagram: model }); // no engine — apply, non-undoably
|
|
159
|
-
}
|
|
160
|
-
(_e = api.renderNow) === null || _e === void 0 ? void 0 : _e.call(api);
|
|
161
|
-
return true;
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
const isEditable = (node) => (node === null || node === void 0 ? void 0 : node.getMetadata('kitEditable')) === true;
|
|
165
|
-
/**
|
|
166
|
-
* Edit a rendered ER table in place. `delta` may change the name, the column
|
|
167
|
-
* list (add / remove / reorder / rename / retype), and the width/height. Field
|
|
168
|
-
* ports and their edges are reconciled so the diagram stays correct, as ONE
|
|
169
|
-
* undoable step.
|
|
170
|
-
*
|
|
171
|
-
* @returns whether the node existed and the edit was applied.
|
|
172
|
-
*/
|
|
173
|
-
export function updateEntity(api, entityId, delta) {
|
|
174
|
-
var _a, _b, _c;
|
|
175
|
-
const editable = isEditable((_c = (_b = (_a = api.getModel) === null || _a === void 0 ? void 0 : _a.call(api)) === null || _b === void 0 ? void 0 : _b.getNode) === null || _c === void 0 ? void 0 : _c.call(_b, entityId));
|
|
176
|
-
const build = (oldKit) => {
|
|
177
|
-
const newEntity = Object.assign({}, oldKit);
|
|
178
|
-
if (delta.name !== undefined)
|
|
179
|
-
newEntity.name = delta.name;
|
|
180
|
-
if (delta.width !== undefined)
|
|
181
|
-
newEntity.width = delta.width;
|
|
182
|
-
if (delta.height !== undefined)
|
|
183
|
-
newEntity.height = delta.height;
|
|
184
|
-
if (delta.columns !== undefined)
|
|
185
|
-
newEntity.columns = delta.columns;
|
|
186
|
-
return {
|
|
187
|
-
newKit: newEntity,
|
|
188
|
-
content: entityCardContent(newEntity, editable),
|
|
189
|
-
height: entityAutoHeight(newEntity, editable),
|
|
190
|
-
width: newEntity.width,
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
return runUpdate(api, entityId, 'er', build);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Edit a rendered UML class in place. `delta` may change the name, stereotype,
|
|
197
|
-
* abstract flag, attributes, methods, and width/height. One undoable step.
|
|
198
|
-
*/
|
|
199
|
-
export function updateClass(api, classId, delta) {
|
|
200
|
-
var _a, _b, _c;
|
|
201
|
-
const editable = isEditable((_c = (_b = (_a = api.getModel) === null || _a === void 0 ? void 0 : _a.call(api)) === null || _b === void 0 ? void 0 : _b.getNode) === null || _c === void 0 ? void 0 : _c.call(_b, classId));
|
|
202
|
-
const build = (oldKit) => {
|
|
203
|
-
const newClass = Object.assign({}, oldKit);
|
|
204
|
-
if (delta.name !== undefined)
|
|
205
|
-
newClass.name = delta.name;
|
|
206
|
-
if (delta.stereotype !== undefined)
|
|
207
|
-
newClass.stereotype = delta.stereotype;
|
|
208
|
-
if (delta.abstract !== undefined)
|
|
209
|
-
newClass.abstract = delta.abstract;
|
|
210
|
-
if (delta.width !== undefined)
|
|
211
|
-
newClass.width = delta.width;
|
|
212
|
-
if (delta.height !== undefined)
|
|
213
|
-
newClass.height = delta.height;
|
|
214
|
-
if (delta.attributes !== undefined)
|
|
215
|
-
newClass.attributes = delta.attributes;
|
|
216
|
-
if (delta.methods !== undefined)
|
|
217
|
-
newClass.methods = delta.methods;
|
|
218
|
-
return {
|
|
219
|
-
newKit: newClass,
|
|
220
|
-
content: classCardContent(newClass, editable),
|
|
221
|
-
height: classAutoHeight(newClass, editable),
|
|
222
|
-
width: newClass.width,
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
return runUpdate(api, classId, 'uml', build);
|
|
226
|
-
}
|
|
227
|
-
// -- small column helpers, for the editing chrome and embedders --------------
|
|
228
|
-
/** Append a column (immutably) — returns the new column array. */
|
|
229
|
-
export function addColumnAt(columns, column, at = columns.length) {
|
|
230
|
-
const next = columns.slice();
|
|
231
|
-
next.splice(Math.max(0, Math.min(at, next.length)), 0, column);
|
|
232
|
-
return next;
|
|
233
|
-
}
|
|
234
|
-
/** Remove the column at `index` — returns the new column array. */
|
|
235
|
-
export function removeColumnAt(columns, index) {
|
|
236
|
-
const next = columns.slice();
|
|
237
|
-
next.splice(index, 1);
|
|
238
|
-
return next;
|
|
239
|
-
}
|
|
240
|
-
/** Rename the column at `index` — returns a new array with a NEW object there. */
|
|
241
|
-
export function renameColumnAt(columns, index, name) {
|
|
242
|
-
return columns.map((c, i) => (i === index ? Object.assign(Object.assign({}, c), { name }) : c));
|
|
243
|
-
}
|
|
244
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../../../libs/element/src/lib/diagram-kit/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,YAAY,GAEb,MAAM,QAAQ,CAAC;AA4EhB;;;;GAIG;AACH,MAAM,iBAAkB,SAAQ,OAAO;IAUrC,YACU,MAAc,EACd,IAAU,EACV,KAAuD;QAE/D,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAJ3C,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAM;QACV,UAAK,GAAL,KAAK,CAAkD;QAZzD,aAAQ,GAAG,KAAK,CAAC;IAezB,CAAC;IAEQ,OAAO,CAAC,OAA+B;;QAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;QAC7D,MAAM,MAAM,GAAG,CAAC,MAAA,IAAI,CAAC,WAAW,CA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