Skip to content

Commit f958763

Browse files
committed
20.8.23 release
1 parent 1a85816 commit f958763

21 files changed

+5812
-5636
lines changed

ChangeLog

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
22-FEB-2023: 20.8.23
2+
3+
- Fixes file extension for .drawio.pdf files [drawio-3368]
4+
- [conf cloud] Workaround for invalid JSON response from getContentProperty API [DID-7519]
5+
6+
20-FEB-2023: 20.8.22
7+
8+
- Internal release to update hidden flag template functionality [DS-942]
9+
10+
20-FEB-2023: 20.8.21
11+
12+
- [vsdx] Adds special case of text field esc(0) format [DID-7420]
13+
- Avoids NPE with bad libraries configurations [DID-7439]
14+
- [conf cloud] Improved Gliffy mass import logs (page links start end time) [DID-7470]
15+
116
10-FEB-2023: 20.8.20
217

318
- Fixes rubberband, links for cells in locked layers [drawio-3343]

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.8.20
1+
20.8.23

src/main/webapp/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta name="Description" content="draw.io is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams">
99
<meta name="Keywords" content="drawio, diagram, online, flow chart, flowchart maker, uml, erd">
1010
<meta itemprop="name" content="draw.io - free flowchart maker and diagrams online">
11-
<meta itemprop="description" content="draw.io is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship,
11+
<meta itemprop="description" content="draw.io is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship,
1212
org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic
1313
circuit and social network diagrams.">
1414
<meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png">

src/main/webapp/js/app.min.js

+1,973-1,951
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/diagramly/Dialogs.js

+29-1
Original file line numberDiff line numberDiff line change
@@ -3244,7 +3244,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
32443244
previewText.style.textAlign = 'center';
32453245
previewText.style.top = '50%';
32463246

3247-
mxUtils.write(previewText, mxResources.get('preview'));
3247+
mxUtils.write(previewText, mxResources.get('blankDiagram'));
32483248
preview.appendChild(previewText);
32493249

32503250
// Adds diagram type options
@@ -3351,8 +3351,36 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
33513351
);
33523352
});
33533353

3354+
button.setAttribute('disabled', 'disabled');
33543355
button.className = 'geBtn gePrimaryBtn';
33553356

3357+
mxEvent.addListener(description, 'change', function(e)
3358+
{
3359+
if (description.value != '')
3360+
{
3361+
button.removeAttribute('disabled');
3362+
}
3363+
else
3364+
{
3365+
button.setAttribute('disabled', 'disabled');
3366+
}
3367+
});
3368+
3369+
mxEvent.addListener(description, 'keydown', function(e)
3370+
{
3371+
window.setTimeout(function()
3372+
{
3373+
if (description.value != '')
3374+
{
3375+
button.removeAttribute('disabled');
3376+
}
3377+
else
3378+
{
3379+
button.setAttribute('disabled', 'disabled');
3380+
}
3381+
}, 0);
3382+
});
3383+
33563384
mxEvent.addListener(description, 'keydown', function(e)
33573385
{
33583386
if (e.keyCode == 13)

src/main/webapp/js/diagramly/EditorUi.js

+122-81
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
*/
114114
EditorUi.mermaidDiagramTypes = ['flowchart', 'classDiagram', 'sequenceDiagram',
115115
'stateDiagram', 'mindmap', 'graph', 'erDiagram', 'requirementDiagram',
116-
'journey', 'gantt', 'pie', 'gitGraph', 'C4Context'];
116+
'journey', 'gantt', 'pie', 'gitGraph'];
117117

118118
/**
119119
* Default Mermaid config without using foreign objects in flowcharts.
@@ -7942,88 +7942,110 @@
79427942
*/
79437943
EditorUi.prototype.generateOpenAiMermaidDiagram = function(key, prompt, success, error)
79447944
{
7945-
if (this.spinner.spin(document.body, mxResources.get('loading')))
7945+
var maxRetries = 3;
7946+
var retryCount = 0;
7947+
7948+
var fn = mxUtils.bind(this, function()
79467949
{
7947-
this.createTimeout(15000, mxUtils.bind(this, function(timeout)
7950+
if (this.spinner.spin(document.body, mxResources.get('loading')))
79487951
{
7949-
EditorUi.logEvent({category: 'OPENAI-DIAGRAM',
7950-
action: 'generateOpenAiMermaidDiagram',
7951-
label: prompt});
7952-
var url = 'https://api.openai.com/v1/engines/text-davinci-003/completions';
7952+
this.createTimeout(40000, mxUtils.bind(this, function(timeout)
7953+
{
7954+
EditorUi.logEvent({category: 'OPENAI-DIAGRAM',
7955+
action: 'generateOpenAiMermaidDiagram',
7956+
label: prompt});
7957+
var url = 'https://api.openai.com/v1/engines/text-davinci-003/completions';
79537958

7954-
var params = {
7955-
prompt: prompt,
7956-
temperature: 0.9,
7957-
max_tokens: 4000
7958-
};
7959+
var params = {
7960+
prompt: prompt,
7961+
temperature: 0.9,
7962+
max_tokens: 4000
7963+
};
79597964

7960-
var req = new mxXmlRequest(url, JSON.stringify(params), 'POST');
7961-
7962-
req.setRequestHeaders = mxUtils.bind(this, function(request, params)
7963-
{
7964-
request.setRequestHeader('Authorization', 'Bearer ' + key);
7965-
request.setRequestHeader('Content-Type', 'application/json');
7966-
});
7965+
var req = new mxXmlRequest(url, JSON.stringify(params), 'POST');
7966+
7967+
req.setRequestHeaders = mxUtils.bind(this, function(request, params)
7968+
{
7969+
request.setRequestHeader('Authorization', 'Bearer ' + key);
7970+
request.setRequestHeader('Content-Type', 'application/json');
7971+
});
79677972

7968-
var handleError = mxUtils.bind(this, function(e)
7969-
{
7970-
if (timeout.clear())
7973+
var handleError = mxUtils.bind(this, function(e)
79717974
{
7972-
this.spinner.stop();
7973-
error(e);
7974-
}
7975-
});
7975+
if (timeout.clear())
7976+
{
7977+
this.spinner.stop();
7978+
error(e);
7979+
}
7980+
});
79767981

7977-
req.send(mxUtils.bind(this, function(req)
7978-
{
7979-
if (timeout.isAlive())
7982+
req.send(mxUtils.bind(this, function(req)
79807983
{
7981-
if (req.getStatus() >= 200 && req.getStatus() <= 299)
7984+
if (timeout.isAlive())
79827985
{
7983-
this.tryAndHandle(mxUtils.bind(this, function()
7986+
if (req.getStatus() >= 200 && req.getStatus() <= 299)
79847987
{
7985-
var response = JSON.parse(req.getText());
7986-
var text = mxUtils.trim(response.choices[0].text);
7987-
var result = this.extractMermaidDeclaration(text);
7988-
7989-
this.generateMermaidImage(result, null, mxUtils.bind(this, function(data, w, h)
7988+
this.tryAndHandle(mxUtils.bind(this, function()
79907989
{
7991-
this.tryAndHandle(mxUtils.bind(this, function()
7990+
var response = JSON.parse(req.getText());
7991+
var text = mxUtils.trim(response.choices[0].text);
7992+
var result = this.extractMermaidDeclaration(text);
7993+
7994+
this.generateMermaidImage(result, null, mxUtils.bind(this, function(data, w, h)
79927995
{
7993-
if (timeout.clear())
7996+
this.tryAndHandle(mxUtils.bind(this, function()
79947997
{
7995-
EditorUi.debug('EditorUi.generateOpenAiMermaidDiagram',
7996-
'\nrequest:', params, '\nresponse:', response,
7997-
'\nprompt:', prompt, '\noutput:', text,
7998-
'\nresult:', result);
7999-
8000-
this.spinner.stop();
8001-
success(result, data, w, h);
7998+
if (timeout.clear())
7999+
{
8000+
EditorUi.debug('EditorUi.generateOpenAiMermaidDiagram',
8001+
'\nrequest:', params, '\nresponse:', response,
8002+
'\nprompt:', prompt, '\noutput:', text,
8003+
'\nresult:', result);
8004+
8005+
this.spinner.stop();
8006+
success(result, data, w, h);
8007+
}
8008+
}), handleError);
8009+
}), handleError, mxUtils.bind(this, function(e)
8010+
{
8011+
if (retryCount++ < maxRetries)
8012+
{
8013+
if (timeout.clear())
8014+
{
8015+
this.spinner.stop();
8016+
fn();
8017+
}
80028018
}
8003-
}), handleError);
8019+
else
8020+
{
8021+
handleError(e);
8022+
}
8023+
}));
80048024
}), handleError);
8005-
}), handleError);
8006-
}
8007-
else
8008-
{
8009-
var e = null;
8010-
8011-
try
8012-
{
8013-
e = JSON.parse(req.getText());
8014-
e = e.error;
80158025
}
8016-
catch (e)
8026+
else
80178027
{
8018-
// ignore
8019-
}
8028+
var e = null;
80208029

8021-
handleError(e);
8030+
try
8031+
{
8032+
e = JSON.parse(req.getText());
8033+
e = e.error;
8034+
}
8035+
catch (e)
8036+
{
8037+
// ignore
8038+
}
8039+
8040+
handleError(e);
8041+
}
80228042
}
8023-
}
8024-
}), handleError);
8025-
}), error);
8026-
}
8043+
}), handleError);
8044+
}), error);
8045+
}
8046+
});
8047+
8048+
fn();
80278049
};
80288050

80298051
/**
@@ -8076,7 +8098,7 @@
80768098
/**
80778099
* Generates a Mermaid image.
80788100
*/
8079-
EditorUi.prototype.generateMermaidImage = function(data, config, success, error)
8101+
EditorUi.prototype.generateMermaidImage = function(data, config, success, error, parseErrorHandler)
80808102
{
80818103
var onerror = mxUtils.bind(this, function(e)
80828104
{
@@ -8109,7 +8131,7 @@
81098131

81108132
mermaid.mermaidAPI.initialize(config);
81118133

8112-
mermaid.mermaidAPI.render('geMermaidOutput-' + new Date().getTime(), data, mxUtils.bind(this, function(svg)
8134+
mermaid.mermaidAPI.renderAsync('geMermaidOutput-' + new Date().getTime(), data, mxUtils.bind(this, function(svg)
81138135
{
81148136
try
81158137
{
@@ -8123,7 +8145,7 @@
81238145
var doc = mxUtils.parseXml(svg);
81248146
var svgs = doc.getElementsByTagName('svg');
81258147

8126-
if (svgs.length > 0)
8148+
if (svgs.length > 0 && svgs[0].getAttribute('aria-roledescription') != 'error')
81278149
{
81288150
var w = parseFloat(svgs[0].getAttribute('width'));
81298151
var h = parseFloat(svgs[0].getAttribute('height'));
@@ -8148,7 +8170,14 @@
81488170
}
81498171
else
81508172
{
8151-
error({message: mxResources.get('invalidInput')});
8173+
if (parseErrorHandler != null)
8174+
{
8175+
parseErrorHandler();
8176+
}
8177+
else
8178+
{
8179+
error({message: mxResources.get('invalidInput')});
8180+
}
81528181
}
81538182
}
81548183
catch (e)
@@ -8169,13 +8198,23 @@
81698198

81708199
if (urlParams['dev'] == '1')
81718200
{
8172-
/*mxMermaidToDrawio.addListener(mxUtils.bind(this, function(modelXml)
8173-
{
8174-
this.importXml(modelXml, null, null, null, null, null, true);
8175-
}));*/
8201+
if (urlParams['mermaidToDrawioTest'] == '1')
8202+
{
8203+
mxMermaidToDrawio.addListener(mxUtils.bind(this, function(modelXml)
8204+
{
8205+
this.importXml(modelXml, null, null, null, null, null, true);
8206+
}));
8207+
}
81768208

8177-
mxscript('js/mermaid/mermaid.min.js', delayed,
8178-
null, null, null, onerror);
8209+
mxscript('js/mermaid/mermaid.min.js', function()
8210+
{
8211+
// Load mindmap plugin in dev only so far
8212+
mxscript('js/mermaid/mermaid-mindmap.min.js', async function()
8213+
{
8214+
await mermaid.registerExternalDiagrams([window['mermaid-mindmap']]);
8215+
delayed();
8216+
}, null, null, null, onerror);
8217+
}, null, null, null, onerror);
81798218
}
81808219
else
81818220
{
@@ -14737,21 +14776,23 @@
1473714776

1473814777
return cells;
1473914778
};
14740-
14779+
1474114780
/**
1474214781
* Opens the given files in the editor.
1474314782
*/
1474414783
EditorUi.prototype.openFileHandle = function(data, name, file, temp, fileHandle)
1474514784
{
1474614785
if (name != null && name.length > 0)
1474714786
{
14748-
if (!this.useCanvasForExport && /(\.png)$/i.test(name))
14787+
if ((!this.useCanvasForExport && /(\.png)$/i.test(name)) ||
14788+
/(\.pdf)$/i.test(name))
1474914789
{
14750-
name = name.substring(0, name.length - 4) + '.drawio';
14751-
}
14752-
else if (/(\.pdf)$/i.test(name))
14753-
{
14754-
name = name.substring(0, name.length - 4) + '.drawio';
14790+
name = name.substring(0, name.length - 4);
14791+
14792+
if (!/(\.drawio)$/i.test(name))
14793+
{
14794+
name = name + '.drawio';
14795+
}
1475514796
}
1475614797

1475714798
var handleResult = mxUtils.bind(this, function(xml)

0 commit comments

Comments
 (0)