Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/jgraph/drawio into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 30, 2024
2 parents 8f463e7 + 0f2ab0c commit 5f5e488
Show file tree
Hide file tree
Showing 23 changed files with 5,682 additions and 5,574 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
29-MAY-2024: 24.4.10

- Improves edge label positions in Explorer Plugin [drawio-4424]
- Fixes shift+drag for new lines with anchor points [drawio-4197]
- Adds new teams domain to frame ancestor CSP

27-MAY-2024: 24.4.9

- Uses 4 digits after the decimal poin for inches [drawio-desktop-1739]
- Fixes inconcistent handling of Ctrl and Cmd key for edges

24-MAY-2024: 24.4.8

- Fixes default shadow opacity [drawio-desktop-1750]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.4.8
24.4.10
5,634 changes: 2,829 additions & 2,805 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/Devel.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if (!mxIsElectron)
replace(/%connect-src%/g, 'https://*.dropboxapi.com https://api.trello.com').
replace(/%frame-src%/g, '').
replace(/%style-src%/g, '').
replace(/ /g, ' ') + ' frame-ancestors \'self\' https://teams.microsoft.com;';
replace(/ /g, ' ') + ' frame-ancestors \'self\' https://teams.microsoft.com https://*.cloud.microsoft;';
console.log('app.diagrams.net:', app_diagrams_net);

var viewer_diagrams_net = hashes.replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com https://app.diagrams.net') +
Expand Down
59 changes: 35 additions & 24 deletions src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6982,28 +6982,36 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
mxEvent.addGestureListeners(compareBtn, function(e)
{
// Gets current state of page with given ID
var curr = (diagrams[currentPage] != null) ? currentDiagrams[
diagrams[currentPage].getAttribute('id')] : null;
mxUtils.setOpacity(compareBtn, 20);
errorNode.innerText = '';

if (curr == null)
try
{
mxUtils.write(errorNode, mxResources.get('pageNotFound'));
var curr = (diagrams[currentPage] != null) ? currentDiagrams[
diagrams[currentPage].getAttribute('id')] : null;
mxUtils.setOpacity(compareBtn, 20);
errorNode.innerText = '';

if (curr == null)
{
mxUtils.write(errorNode, mxResources.get('pageNotFound'));
}
else
{
prevFileInfo = fileInfo.innerHTML;
fileInfo.innerHTML = mxResources.get('current');
container.style.display = 'none';
cmpContainer.style.display = '';
cmpContainer.style.backgroundColor = container.style.backgroundColor;

var tempNode = Editor.parseDiagramNode(curr);
var codec = new mxCodec(tempNode.ownerDocument);
codec.decode(tempNode, cmpGraph.getModel());
cmpGraph.view.scaleAndTranslate(graph.view.scale,
graph.view.translate.x, graph.view.translate.y);
}
}
else
catch (e)
{
prevFileInfo = fileInfo.innerHTML;
fileInfo.innerHTML = mxResources.get('current');
container.style.display = 'none';
cmpContainer.style.display = '';
cmpContainer.style.backgroundColor = container.style.backgroundColor;

var tempNode = Editor.parseDiagramNode(curr);
var codec = new mxCodec(tempNode.ownerDocument);
codec.decode(tempNode, cmpGraph.getModel());
cmpGraph.view.scaleAndTranslate(graph.view.scale,
graph.view.translate.x, graph.view.translate.y);
errorNode.innerText = '';
mxUtils.write(errorNode, mxResources.get('pageNotFound') + ': ' + e.message);
}
}, null, function()
{
Expand Down Expand Up @@ -12616,16 +12624,19 @@ var FontDialog = function(editorUi, curFontname, curUrl, curType, fn)
function validateFn(fontName, fontUrl, type)
{
var urlPattern = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var elt = table.querySelector('.dlg_fontName_' + type);

if (fontName == null || fontName.length == 0)
if (elt != null && (fontName == null || fontName.length == 0))
{
table.querySelector('.dlg_fontName_' + type).style.border = '1px solid red';
elt.style.border = '1px solid red';
return false;
}

elt = table.querySelector('.dlg_fontUrl');

if (type == 'w' && !urlPattern.test(fontUrl))
if (elt != null && type == 'w' && !urlPattern.test(fontUrl))
{
table.querySelector('.dlg_fontUrl').style.border = '1px solid red';
elt.style.border = '1px solid red';
return false;
}

Expand Down Expand Up @@ -13415,7 +13426,7 @@ var ConnectionPointsDialog = function(editorUi, cell)
// Add cell and current connection points on it
var geo = cell.geometry;
var mainCell = new mxCell(cell.value, new mxGeometry(0, 0, geo.width, geo.height),
cell.style + ';rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;');
cell.style + ';rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;');
mainCell.vertex = true;
editingGraph.addCell(mainCell);

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@
if (!graph.isSelectionEmpty())
{
var cells = graph.cloneCells(graph.getSelectionCells());
var bbox = graph.getBoundingBoxFromGeometry(cells);
var bbox = graph.getBoundingBoxFromGeometry(cells, true);
cells = graph.moveCells(cells, -bbox.x, -bbox.y);

editorUi.showTextDialog('Create Sidebar Entry', 'this.addDataEntry(\'tag1 tag2\', ' +
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/js/diagramly/Pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,8 @@ EditorUi.prototype.clonePage = function(page)
EditorUi.transientViewStateProperties)
result.root = this.editor.graph.model.cloneCell(
page.root, null, true);

result.diagramModified = page.diagramModified;

return result;
};

Expand Down
14 changes: 12 additions & 2 deletions src/main/webapp/js/diagramly/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,19 @@ var mxSettings =
},
load: function()
{
if (isLocalStorage && typeof(JSON) !== 'undefined')
try
{
mxSettings.parse(localStorage.getItem(mxSettings.key));
if (isLocalStorage && typeof(JSON) !== 'undefined')
{
mxSettings.parse(localStorage.getItem(mxSettings.key));
}
}
catch (e)
{
if (window.console != null)
{
console.log('Error loading settings:', mxSettings.key, e);
}
}

if (mxSettings.settings == null)
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/js/diagramly/vsdx/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3764,7 +3764,7 @@ var com;
var connectElem = connectNode;
var connect = new com.mxgraph.io.vsdx.mxVsdxConnect(connectElem);
var fromSheet = connect.getFromSheet();
this.connectsMap[fromSheet] = true;
this.connectsMap[fromSheet] = (this.connectsMap[fromSheet] || 0) + 1;
var previousConnect = (fromSheet != null && fromSheet > -1) ? (function (m, k) { if (m.entries == null)
m.entries = []; for (var i = 0; i < m.entries.length; i++)
if (m.entries[i].key.equals != null && m.entries[i].key.equals(k) || m.entries[i].key === k) {
Expand Down Expand Up @@ -10119,8 +10119,8 @@ var com;

// TODO It's hard to detect edges that should be treated like vertexes whhen they are groups and have child shapes.
// TODO Check this again if more complains are received or if we can have an edge group
_this.vertex = vertex; //|| (!page.connectsMap[_this.Id] && (_this.childShapes != null && !(function (m) { if (m.entries == null)
//m.entries = []; return m.entries.length == 0; })(_this.childShapes)) || (_this.geomList != null && (!_this.geomList.isNoFill() || _this.geomList.getGeoCount() > 1)));
_this.vertex = vertex || (page.connectsMap[_this.Id] != 2 && (_this.childShapes != null && !(function (m) { if (m.entries == null)
m.entries = []; return m.entries.length == 0; })(_this.childShapes)) || (_this.geomList != null && (!_this.geomList.isNoFill() || _this.geomList.getGeoCount() > 1)));
_this.layerMember = _this.getValue(_this.getCellElement$java_lang_String("LayerMember"));

if (_this.layerMember)
Expand Down
Loading

0 comments on commit 5f5e488

Please sign in to comment.