living-documentation 7.43.0 → 7.45.0
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/dist/src/frontend/diagram/custom-shapes.js +11 -3
- package/dist/src/frontend/diagram/main.js +3 -1
- package/dist/src/frontend/diagram/network.js +1000 -497
- package/dist/src/frontend/diagram/node-panel.js +47 -0
- package/dist/src/frontend/diagram/node-rendering.js +117 -23
- package/dist/src/frontend/diagram/persistence.js +1 -0
- package/dist/src/frontend/diagram/ports.js +7 -5
- package/dist/src/frontend/diagram/selection-overlay.js +64 -13
- package/dist/src/frontend/diagram.html +34 -0
- package/dist/src/frontend/i18n/en.json +14 -1
- package/dist/src/frontend/i18n/fr.json +14 -1
- package/dist/src/frontend/shape-editor.html +385 -165
- package/dist/src/routes/shape-libraries.d.ts +1 -1
- package/dist/src/routes/shape-libraries.d.ts.map +1 -1
- package/dist/src/routes/shape-libraries.js +46 -26
- package/dist/src/routes/shape-libraries.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { st } from './state.js';
|
|
|
2
2
|
|
|
3
3
|
export const CUSTOM_SHAPE_TYPE = 'custom-shape';
|
|
4
4
|
export const CUSTOM_SHAPE_TOOL_PREFIX = 'custom-shape:';
|
|
5
|
+
export const CUSTOM_SHAPE_DEFAULT_SIZE = 65;
|
|
5
6
|
|
|
6
7
|
export const DEFAULT_CUSTOM_ANCHORS = [
|
|
7
8
|
{ id: 'N', x: 0.5, y: 0 },
|
|
@@ -29,7 +30,10 @@ export function getCustomShapeDefinition(id) {
|
|
|
29
30
|
|
|
30
31
|
export function getCustomShapeDefaultSize(id) {
|
|
31
32
|
const def = getCustomShapeDefinition(id);
|
|
32
|
-
return [
|
|
33
|
+
return [
|
|
34
|
+
(def && def.width) || CUSTOM_SHAPE_DEFAULT_SIZE,
|
|
35
|
+
(def && def.height) || CUSTOM_SHAPE_DEFAULT_SIZE,
|
|
36
|
+
];
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export function getCustomShapeAnchors(id) {
|
|
@@ -41,7 +45,9 @@ export function getCustomShapeAnchors(id) {
|
|
|
41
45
|
|
|
42
46
|
export function getCustomShapeLabelPlacement(id) {
|
|
43
47
|
const def = getCustomShapeDefinition(id);
|
|
44
|
-
return def &&
|
|
48
|
+
return def && ['center', 'below', 'above', 'right', 'left'].includes(def.labelPlacement)
|
|
49
|
+
? def.labelPlacement
|
|
50
|
+
: 'below';
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
export async function loadCustomShapeLibraries() {
|
|
@@ -69,7 +75,9 @@ export function renderCustomShapeBar() {
|
|
|
69
75
|
body.innerHTML = '';
|
|
70
76
|
const libraries = st.customShapeLibraries || [];
|
|
71
77
|
const shapes = libraries.flatMap((library) =>
|
|
72
|
-
(library.shapes || [])
|
|
78
|
+
(library.shapes || [])
|
|
79
|
+
.filter((shape) => shape.showInDiagram !== false)
|
|
80
|
+
.map((shape) => ({ ...shape, libraryName: library.name })),
|
|
73
81
|
);
|
|
74
82
|
bar.classList.toggle('hidden', shapes.length === 0);
|
|
75
83
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { st, markDirty } from './state.js';
|
|
5
5
|
import { TOOL_BTN_MAP } from './constants.js';
|
|
6
|
-
import { showNodePanel, hideNodePanel, setNodeColor, setNodeBgOpacity, changeNodeFontSize, setTextAlign, setTextValign, changeZOrder, activateStamp, cancelStamp, stepRotate, toggleNodeLock } from './node-panel.js';
|
|
6
|
+
import { showNodePanel, hideNodePanel, setNodeColor, setNodeBgOpacity, changeNodeFontSize, setTextAlign, setTextValign, setCustomShapeLabelPlacement, changeZOrder, activateStamp, cancelStamp, stepRotate, toggleNodeLock } from './node-panel.js';
|
|
7
7
|
import { groupNodes, ungroupNodes } from './groups.js';
|
|
8
8
|
import { showLinkPanel, hideLinkPanel } from './link-panel.js';
|
|
9
9
|
import { hideEdgePanel, setEdgeArrow, setEdgeDashes, changeEdgeFontSize, stepEdgeLabelRotation, clearEdgePorts, setEdgeColor, changeEdgeWidth, toggleEdgeLock, resetEdgeLabelWidth, stepEdgeLabelOffset, resetEdgeLabelOffset } from './edge-panel.js';
|
|
@@ -164,6 +164,8 @@ initEvidenceMode();
|
|
|
164
164
|
document.getElementById('nodePanel').addEventListener('click', (e) => {
|
|
165
165
|
const colorBtn = e.target.closest('[data-color]');
|
|
166
166
|
if (colorBtn) setNodeColor(colorBtn.dataset.color);
|
|
167
|
+
const labelPlacementBtn = e.target.closest('[data-label-placement]');
|
|
168
|
+
if (labelPlacementBtn) setCustomShapeLabelPlacement(labelPlacementBtn.dataset.labelPlacement);
|
|
167
169
|
});
|
|
168
170
|
document.getElementById('btnNodeLock').addEventListener('click', toggleNodeLock);
|
|
169
171
|
document.getElementById('btnNodeLabelEdit').addEventListener('click', startLabelEdit);
|