Skip to content

Commit

Permalink
18.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed May 5, 2022
1 parent f768ed7 commit becda6b
Show file tree
Hide file tree
Showing 17 changed files with 2,332 additions and 2,267 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
@@ -1,3 +1,12 @@
05-MAY-2022: 18.0.1

- Adds support for windows line break in CSV files
- [conf cloud] Fixes trailing space in diagram name during page IDs import
- FIxes timestamp check in watchFile [819] [DND-487]
- Hides menus and dropdowns if clicked again [2745]
- Fixes cursor handling for composite cells [2756]
- [desktop] Adds strict CSP after loading plugins (disabling unsafe-inline scripts)

04-MAY-2022: 18.0.0

- Replaces sanitizer with DOMpurify
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
18.0.0
18.0.1
1,032 changes: 516 additions & 516 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main/webapp/js/diagramly/EditorUi.js
Expand Up @@ -13329,7 +13329,7 @@

while (index < lines.length && lines[index].charAt(0) == '#')
{
var text = lines[index];
var text = lines[index].replace(/\r$/,''); // Remove trailing \r if the file uses \r\n line breaks
index++;

while (index < lines.length && text.charAt(text.length - 1) == '\\' &&
Expand Down Expand Up @@ -13455,7 +13455,7 @@
}

// Converts identity and parent to index and validates XML attribute names
var keys = this.editor.csvToArray(lines[index]);
var keys = this.editor.csvToArray(lines[index].replace(/\r$/,''));
var identityIndex = null;
var parentIndex = null;
var attribs = [];
Expand Down Expand Up @@ -13497,7 +13497,7 @@

for (var i = index + 1; i < lines.length; i++)
{
var values = this.editor.csvToArray(lines[i]);
var values = this.editor.csvToArray(lines[i].replace(/\r$/,''));

if (values == null)
{
Expand Down
53 changes: 33 additions & 20 deletions src/main/webapp/js/diagramly/ElectronApp.js
Expand Up @@ -146,6 +146,21 @@ mxStencilRegistry.allowEval = false;
}
}

//Remove old relaxed CSP and add strict one
var allMeta = document.getElementsByTagName('meta');

for (var i = 0; i < allMeta.length; i++)
{
if (allMeta[i].getAttribute('http-equiv') == 'Content-Security-Policy')
{
allMeta[i].parentNode.removeChild(allMeta[i]);
}

break;
}

mxmeta(null, 'default-src \'self\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy');

//Disable web plugins loading
urlParams['plugins'] = '0';
origAppMain.apply(this, arguments);
Expand Down Expand Up @@ -838,38 +853,36 @@ mxStencilRegistry.allowEval = false;
path: file.fileObject.path,
listener: mxUtils.bind(this, function(curr, prev)
{
EditorUi.debug('EditorUi.watchFile', [this],
'file', [file], 'stat', [file.stat],
'curr', [curr], 'prev', [prev],
'inConflictState', file.inConflictState,
'unwatchedSaves', file.unwatchedSaves);

//File is changed (not just accessed) && File is not already in a conflict state
if (curr.mtimeMs != prev.mtimeMs && !file.inConflictState)
{
//Ignore our own changes
if (file.unwatchedSaves || (file.state != null && file.stat.mtimeMs == curr.mtimeMs))
if (file.unwatchedSaves || (file.stat != null && file.stat.mtimeMs == curr.mtimeMs))
{
file.unwatchedSaves = false;
return;
}

file.inConflictState = true;

this.showError(mxResources.get('externalChanges'),
mxResources.get('fileChangedSyncDialog'),
mxResources.get('merge'), mxUtils.bind(this, function()

file.addConflictStatus(mxUtils.bind(this, function()
{
file.ui.editor.setStatus(mxUtils.htmlEntities(
mxResources.get('updatingDocument')));
file.synchronizeFile(mxUtils.bind(this, function()
{
if (this.spinner.spin(document.body, mxResources.get('updatingDocument')))
{
file.synchronizeFile(mxUtils.bind(this, function()
{
this.spinner.stop();
}), mxUtils.bind(this, function(err)
{
file.handleFileError(err, true);
}));
}
}), null, null, null,
mxResources.get('cancel'), mxUtils.bind(this, function()
file.handleFileSuccess(false);
}), mxUtils.bind(this, function(err)
{
this.hideDialog();
file.handleFileError(null, false);
}), 340, 130);
file.handleFileError(err, true);
}));
}));
}
})
});
Expand Down
69 changes: 41 additions & 28 deletions src/main/webapp/js/diagramly/Minimal.js
Expand Up @@ -2323,41 +2323,54 @@ EditorUi.initMinimalTheme = function()

if (urlParams['embed'] != '1')
{
if (ui.statusContainer.children.length == 0 ||
(ui.statusContainer.children.length == 1 &&
typeof ui.statusContainer.firstChild.getAttribute === 'function' &&
ui.statusContainer.firstChild.getAttribute('class') == null))
ui.statusContainer.style.display = 'inline-block';
statusVisible = true;

if (ui.statusContainer.children.length == 1 &&
ui.editor.getStatus() == '')
{
var title = (ui.statusContainer.firstChild != null &&
typeof ui.statusContainer.firstChild.getAttribute === 'function') ?
ui.statusContainer.firstChild.getAttribute('title') :
ui.editor.getStatus();
setNotificationTitle(title);
var file = ui.getCurrentFile();
var key = (file != null) ? file.savingStatusKey : DrawioFile.prototype.savingStatusKey;

if (title == mxResources.get(key) + '...')
menubar.style.visibility = 'hidden';
}
else
{
if (ui.statusContainer.children.length == 0 ||
(ui.statusContainer.children.length == 1 &&
typeof ui.statusContainer.firstChild.getAttribute === 'function' &&
ui.statusContainer.firstChild.getAttribute('class') == null))
{
var title = (ui.statusContainer.firstChild != null &&
typeof ui.statusContainer.firstChild.getAttribute === 'function') ?
ui.statusContainer.firstChild.getAttribute('title') :
ui.editor.getStatus();
setNotificationTitle(title);
var file = ui.getCurrentFile();
var key = (file != null) ? file.savingStatusKey :
DrawioFile.prototype.savingStatusKey;

if (title == mxResources.get(key) + '...')
{
ui.statusContainer.innerHTML = '<img title="' + mxUtils.htmlEntities(
mxResources.get(key)) + '...' + '"src="' + Editor.tailSpin + '">';
ui.statusContainer.style.display = 'inline-block';
statusVisible = true;
}
else if (ui.buttonContainer.clientWidth > 6)
{
ui.statusContainer.style.display = 'none';
statusVisible = false;
}
}
else
{
ui.statusContainer.innerHTML = '<img title="' + mxUtils.htmlEntities(
mxResources.get(key)) + '...' + '"src="' + Editor.tailSpin + '">';
ui.statusContainer.style.display = 'inline-block';
setNotificationTitle(null);
statusVisible = true;
}
else if (ui.buttonContainer.clientWidth > 6)
{
ui.statusContainer.style.display = 'none';
statusVisible = false;
}
}
else
{
ui.statusContainer.style.display = 'inline-block';
setNotificationTitle(null);
statusVisible = true;

menubar.style.visibility = (menubar.clientWidth < 20 &&
!statusVisible) ? 'hidden' : '';
}
}

menubar.style.visibility = (menubar.clientWidth < 20 && !statusVisible) ? 'hidden' : '';
}));

elt = addMenu('diagram', null, Editor.menuImage);
Expand Down
18 changes: 9 additions & 9 deletions src/main/webapp/js/diagramly/sidebar/Sidebar-ER.js
Expand Up @@ -65,25 +65,25 @@

return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'List');
}),
this.addEntry(dt + ' list', function()
{
return sb.createVertexTemplateFromCells([row.clone()], row.geometry.width, row.geometry.height, 'List Item 1');
this.addEntry(dt + ' list', function()
{
return sb.createVertexTemplateFromCells([row.clone()], row.geometry.width, row.geometry.height, 'List Item 1');
}),
this.addEntry(dt + 'table row', function()
{
this.addEntry(dt + 'table row', function()
{
var cell = new mxCell(row.value, new mxGeometry(0, 0, 90, row.geometry.height), 'shape=partialRectangle;fillColor=none;align=left;verticalAlign=middle;strokeColor=none;spacingLeft=34;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;');
cell.vertex = true;
cell.vertex = true;

var cell1 = sb.cloneCell(row, '');
var cell1 = sb.cloneCell(row, '');
cell1.connectable = false;
cell1.style = 'shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;stokeWidth=1;dashed=1;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;'
cell1.geometry.width = 30;
cell.insert(cell1);

return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'List Item 2');
}),
this.addEntry(dt + 'table row divider hline line separator', function()
{
this.addEntry(dt + 'table row divider hline line separator', function()
{
var divider = new mxCell('', new mxGeometry(0, 0, 60, 10), 'line;strokeWidth=1;rotatable=0;dashed=0;labelPosition=right;align=left;verticalAlign=middle;spacingTop=0;spacingLeft=6;points=[];portConstraint=eastwest;');
divider.vertex = true;

Expand Down

0 comments on commit becda6b

Please sign in to comment.