Skip to content

Commit 8bf10c7

Browse files
committed
28.0.1 release
1 parent 7114e20 commit 8bf10c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+12282
-11968
lines changed

ChangeLog

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
10-JUL-2025: 28.0.1
2+
3+
- Adds some HTML to SVG conversion
4+
5+
10-JUL-2025: 28.0.0
6+
7+
- Fixes possible ClipboardItem.supports is not a function
8+
- Fixes possible overflow for sidebars on small screens
9+
- Fixes Alt+Click in sidebar and shape picker [jgraph/drawio#4720]
10+
- Fixes possible NPE in mxGraph.intersects
11+
- Removes Twitter and Facebook button in Embed dialog [DID-15625]
12+
- Enables PlantUML menu option if URL was customized [DID-15625]\
13+
- Adds gapi-stealth URL parameter for stealth mode with Google Drive [DID-15625]
14+
- Adds resizing for metadata dialog [jgraph/drawio#375,jgraph/drawio#5142]
15+
- Hides Publish and Embed menu when offline [DID-15625]
16+
- Hides Publish and Embed menu when offline in Minimal theme [DID-15625]
17+
- Updates icon cache
18+
19+
30-JUN-2025: 27.2.0
20+
21+
- Adds copy as SVG, improves handling of clipboard data
22+
- Fixes theme buttons on touch devices
23+
- Fixes justifyfull [jgraph/drawio#526]
24+
- Fixes enter keystroke in omni search box
25+
- Fixes use of generic font-families [jgraph/drawio#4998]
26+
- Fixes window tooltips i18n [jgraph/drawio#4654]
27+
- Adds shadows option for print and PDF export, uses CSS filter for global shadow [jgraph/drawio-desktop#2133]
28+
- Fixes floating panels on mobile [jgraph/drawio#5134]
29+
- Fixes exported SVG image sizes [jgraph/drawio#4814]
30+
- Fixes diagram insert position in Notion extension [jgraph/drawio#5123]
31+
- Fixes disabled dark mode in Firefox 140
32+
- Adds miterlimit property for shapes [jgraph/drawio#4706]
33+
- Fixes PDF title and page numbers [jgraph/drawio-desktop#2130,jgraph/drawio#4102]
34+
- Adds experimental pipe shape, improves edge style panel [jgraph/drawio#5144]
35+
- Fixes miter limit default value
36+
- Adds support for SVG background images with dark mode
37+
- Fixes offsets in image export [jgraph/drawio#5122]
38+
- Fixes possible NPE in Find dialog [jgraph/drawio#5143]
39+
140
16-JUN-2025: 27.1.6
241

342
- Hides dark mode toggle in unsupported browsers

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
27.1.6
1+
28.0.1

src/main/webapp/export3.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
page-break-inside: avoid;
1414
page-break-after: always;
1515
}
16-
g[style*="filter: drop-shadow("] {
17-
filter: none !important;
18-
}
1916
}
2017
</style>
2118
<link rel="stylesheet" href="mxgraph/css/common.css" charset="UTF-8" type="text/css">

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

Lines changed: 3762 additions & 3764 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/diagramly/ElectronApp.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ window.TEMPLATE_PATH = 'templates';
33
window.DRAW_MATH_URL = 'math/es5';
44
window.DRAWIO_BASE_URL = '.'; //Prevent access to online website since it is not allowed
55
window.DRAWIO_SERVER_URL = '.';
6-
FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
76
EditorUi.draftSaveDelay = 5000;
87
//Disables eval for JS (uses shapes-14-6-5.min.js)
98
mxStencilRegistry.allowEval = false;
@@ -222,11 +221,6 @@ mxStencilRegistry.allowEval = false;
222221
menusInit.apply(this, arguments);
223222

224223
var editorUi = this.editorUi;
225-
226-
editorUi.actions.put('useOffline', new Action('useOffline' + '...', function()
227-
{
228-
editorUi.openLink('https://www.draw.io/')
229-
}));
230224

231225
this.put('openRecent', new Menu(function(menu, parent)
232226
{
@@ -634,15 +628,15 @@ mxStencilRegistry.allowEval = false;
634628
{
635629
origCut();
636630
cloneMxCLipboardToSys();
637-
}, null, 'sprite-cut', Editor.ctrlKey + '+X');
631+
}, null, '', Editor.ctrlKey + '+X');
638632

639633
var origCopy = this.actions.get('copy').funct;
640634

641635
editorUi.actions.addAction('copy', function()
642636
{
643637
origCopy();
644638
cloneMxCLipboardToSys();
645-
}, null, 'sprite-copy', Editor.ctrlKey + '+C');
639+
}, null, '', Editor.ctrlKey + '+C');
646640

647641
//Get data from system clipboard for pase/pasteHere
648642
var origPaste = this.actions.get('paste').funct;
@@ -651,7 +645,7 @@ mxStencilRegistry.allowEval = false;
651645
{
652646
cloneSysCLipboardToMx();
653647
origPaste();
654-
}, false, 'sprite-paste', Editor.ctrlKey + '+V');
648+
}, false, '', Editor.ctrlKey + '+V');
655649

656650
var origPasteHere = this.actions.get('pasteHere').funct;
657651

@@ -669,7 +663,7 @@ mxStencilRegistry.allowEval = false;
669663
var pasteHere = this.actions.get('pasteHere');
670664

671665
paste.setEnabled(this.editor.graph.cellEditor.isContentEditing() ||
672-
(graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent())));
666+
(graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent())));
673667
pasteHere.setEnabled(paste.isEnabled());
674668
};
675669

@@ -1838,7 +1832,7 @@ mxStencilRegistry.allowEval = false;
18381832
/**
18391833
* Copies the given cells and XML to the clipboard as an embedded image.
18401834
*/
1841-
EditorUi.prototype.writeImageToClipboard = async function(dataUrl, w, h, error)
1835+
EditorUi.prototype.writeImageToClipboard = async function(dataUrl, w, h, type, success, error)
18421836
{
18431837
try
18441838
{
@@ -1847,10 +1841,18 @@ mxStencilRegistry.allowEval = false;
18471841
method: 'writeImage',
18481842
data: {dataUrl: dataUrl, w: w, h: h}
18491843
});
1844+
1845+
if (success != null)
1846+
{
1847+
success();
1848+
}
18501849
}
18511850
catch (e)
18521851
{
1853-
error(e);
1852+
if (error != null)
1853+
{
1854+
error(e);
1855+
}
18541856
}
18551857
};
18561858

@@ -1874,7 +1876,7 @@ mxStencilRegistry.allowEval = false;
18741876

18751877
EditorUi.prototype.saveRequest = function(filename, format, fn, data, base64Encoded, mimeType)
18761878
{
1877-
var xhr = fn(null, '1');
1879+
var xhr = fn(filename, '1');
18781880

18791881
if (xhr != null && this.spinner.spin(document.body, mxResources.get('saving')))
18801882
{
@@ -1939,11 +1941,11 @@ mxStencilRegistry.allowEval = false;
19391941
// Direct export to pdf
19401942
EditorUi.prototype.createDownloadRequest = function(filename, format, ignoreSelection, base64,
19411943
transparent, currentPage, scale, border, grid, includeXml, pageRange, w, h, crop, margin,
1942-
fit, sheetsAcross, sheetsDown)
1944+
fit, sheetsAcross, sheetsDown, shadows)
19431945
{
19441946
var params = this.downloadRequestBuilder(filename, format, ignoreSelection, base64,
19451947
transparent, currentPage, scale, border, grid, includeXml, pageRange, w, h, crop,
1946-
margin, fit, sheetsAcross, sheetsDown);
1948+
margin, fit, sheetsAcross, sheetsDown, shadows);
19471949

19481950
return new mxElectronRequest('export', params);
19491951
};
@@ -1976,7 +1978,8 @@ mxStencilRegistry.allowEval = false;
19761978

19771979
editorUi.hideDialog();
19781980

1979-
if ((format == 'png' || format == 'jpg' || format == 'jpeg') && editorUi.isExportToCanvas())
1981+
if ((format == 'png' || format == 'jpg' || format == 'jpeg') &&
1982+
editorUi.editor.isExportToCanvas())
19801983
{
19811984
if (format == 'png')
19821985
{

src/main/webapp/js/export.js

Lines changed: 56 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ var mxIsElectron = navigator.userAgent != null &&
33
navigator.userAgent.indexOf(' draw.io/') > -1;
44
var GOOGLE_APPS_MAX_AREA = 25000000;
55
var GOOGLE_SHEET_MAX_AREA = 1000000; // The maximum number of pixels is 1 million.
6+
var shadowBlocker = null;
7+
8+
/**
9+
* Adds shadow blocker style.
10+
*/
11+
function addShadowBlocker()
12+
{
13+
if (shadowBlocker == null)
14+
{
15+
shadowBlocker = document.createElement('style');
16+
shadowBlocker.setAttribute('type', 'text/css');
17+
shadowBlocker.innerHTML = '@media print {\n' +
18+
' g[style*="filter: drop-shadow("] {\n' +
19+
' filter: none !important;\n' +
20+
' }\n' +
21+
'}\n';
22+
23+
var head = document.getElementsByTagName('head')[0];
24+
25+
if (head != null)
26+
{
27+
head.appendChild(shadowBlocker);
28+
}
29+
}
30+
}
631

732
/**
833
* Adds meta tag to the page.
@@ -84,6 +109,11 @@ var cssPreload = {};
84109

85110
function render(data)
86111
{
112+
if (data.shadows == '0')
113+
{
114+
addShadowBlocker();
115+
}
116+
87117
if (data.csv != null)
88118
{
89119
// CSV loads orgChart asynchronously and needs mxscript
@@ -189,9 +219,14 @@ function render(data)
189219
Graph.translateDiagram = true;
190220
}
191221

192-
if (extras != null && extras.globalVars != null && extras.globalVars.filename != null)
222+
if (data.fileTitle != null)
193223
{
194-
document.title = extras.globalVars.filename + '.pdf';
224+
document.title = data.fileTitle;
225+
}
226+
else if (extras != null && extras.globalVars != null &&
227+
extras.globalVars.filename != null)
228+
{
229+
document.title = extras.globalVars.filename;
195230
}
196231

197232
// Overrides graph bounds to include background images
@@ -216,13 +251,13 @@ function render(data)
216251
return bounds;
217252
};
218253

219-
//PNG+XML format
254+
// PNG+XML format
220255
if (data.xml.substring(0, 5) == 'iVBOR' || (extras != null && extras.isPng))
221256
{
222257
data.xml = Editor.extractGraphModelFromPng('data:image/png;base64,' + data.xml);
223258
}
224259

225-
//IE11 sends incorrect xml
260+
// IE11 sends incorrect xml
226261
if (data.xml.substring(0, 11) == '<#document>')
227262
{
228263
data.xml = data.xml.substring(11, data.xml.length - 12);
@@ -832,11 +867,6 @@ function render(data)
832867
graph.pageScale = ps;
833868
}
834869

835-
if (data.fileTitle != null)
836-
{
837-
document.title = data.fileTitle;
838-
}
839-
840870
var pf = graph.pageFormat;
841871
var temp = data.scale;
842872
pf.width = Math.ceil(pf.width * graph.pageScale);
@@ -1076,7 +1106,18 @@ function render(data)
10761106
{
10771107
div.classList.add('geDisableMathJax')
10781108
}
1079-
1109+
1110+
// Adds shadow
1111+
if (xmlDoc.documentElement.getAttribute('shadow') == '1')
1112+
{
1113+
var svgs = div.getElementsByTagName('svg');
1114+
1115+
for (var i = 0; i < svgs.length; i++)
1116+
{
1117+
graph.addSvgShadow(svgs[i]);
1118+
}
1119+
}
1120+
10801121
waitForGoogleFontImports(div);
10811122
};
10821123

@@ -1096,25 +1137,6 @@ function render(data)
10961137
preview.appendGraph(graph, scale, x0, y0, null, null, anchorId, pf);
10971138
}
10981139

1099-
// Adds shadow
1100-
// NOTE: Shadow rasterizes output
1101-
/*if (mxClient.IS_SVG && xmlDoc.documentElement.getAttribute('shadow') == '1')
1102-
{
1103-
var svgs = document.getElementsByTagName('svg');
1104-
1105-
for (var i = 0; i < svgs.length; i++)
1106-
{
1107-
var svg = svgs[i];
1108-
1109-
var filter = graph.addSvgShadow(svg, null, true);
1110-
filter.setAttribute('id', 'shadow-' + i);
1111-
svg.appendChild(filter);
1112-
svg.setAttribute('filter', 'url(#' + 'shadow-' + i + ')');
1113-
}
1114-
1115-
border = 7;
1116-
}*/
1117-
11181140
bounds = new mxRectangle(0, 0, pf.width, pf.height);
11191141
}
11201142
else
@@ -1141,13 +1163,11 @@ function render(data)
11411163
}
11421164

11431165
// Adds shadow
1144-
// NOTE: PDF shadow rasterizes output so it's disabled
1145-
if (data.format != 'pdf' && mxClient.IS_SVG && xmlDoc.documentElement.getAttribute('shadow') == '1')
1166+
if (xmlDoc.documentElement.getAttribute('shadow') == '1')
11461167
{
1147-
graph.addSvgShadow(graph.view.canvas.ownerSVGElement, null, true);
1148-
graph.setShadowVisible(true);
1149-
bounds.width += 7;
1150-
bounds.height += 7;
1168+
var size = graph.setShadowVisible(true);
1169+
bounds.width += size;
1170+
bounds.height += size;
11511171
}
11521172

11531173
document.body.style.width = Math.ceil(bounds.x + bounds.width) + 'px';
@@ -1195,7 +1215,7 @@ function render(data)
11951215
return (diagrams == null) ? 'Page-1' :
11961216
(diagrams[from].getAttribute('name') || ('Page-' + (from + 1)));
11971217
}
1198-
else if (name == 'pagenumber')
1218+
else if (name == 'pagenumber' && data.from != null)
11991219
{
12001220
return from + 1;
12011221
}

0 commit comments

Comments
 (0)