浏览代码

13.4.5 release

David Benson [draw.io] 5 年之前
父节点
当前提交
d851398458

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+16-JUL-2020: 13.4.5
+
+- Fixes ignored right meta key on macOS
+
 15-JUL-2020: 13.4.4
 
 - Fixes shape picker container insert

+ 1 - 1
VERSION

@@ -1 +1 @@
-13.4.4
+13.4.5

文件差异内容过多而无法显示
+ 530 - 527
src/main/webapp/js/app.min.js


+ 3 - 6
src/main/webapp/js/diagramly/App.js

@@ -1189,10 +1189,7 @@ App.prototype.initializeEmbedMode = function()
 	{
 		if (window.location.hostname == 'app.diagrams.net')
 		{
-			if (window.console != null)
-			{
-				console.warn('[Deprecation] app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net.');
-			}
+			this.showBanner('EmbedDeprecationFooter', 'app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net.');
 		}
 		
 		if (App.embedModePluginsCount > 0 || this.initEmbedDone)
@@ -2758,7 +2755,7 @@ App.prototype.start = function()
 				}
 
 				if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && !this.isOfflineApp() &&
-					urlParams['open'] == null && /.*\.draw\.io$/.test(window.location.hostname) &&
+					urlParams['open'] == null && /www\.draw\.io$/.test(window.location.hostname) &&
 					(!this.editor.chromeless || this.editor.editable))
 				{
 					this.showNameChangeBanner();
@@ -3300,7 +3297,7 @@ App.prototype.showSplash = function(force)
 			showSecondDialog();
 		}), rowLimit);
 		
-		this.showDialog(dlg.container, (rowLimit < 3) ? 240 : 300,
+		this.showDialog(dlg.container, (rowLimit < 3) ? 260 : 320,
 			(serviceCount >= 4) ? 440 : ((this.isOfflineApp()) ? 300 : 320), true, false);
 		dlg.init();
 	}

+ 32 - 24
src/main/webapp/js/diagramly/Devel.js

@@ -13,48 +13,56 @@ if (!mxIsElectron && location.protocol !== 'http:')
 		var csp = 'default-src \'self\'; ' +
 			// storage.googleapis.com is needed for workbox-service-worker
 			'script-src %script-src% \'self\' https://storage.googleapis.com ' +
-				'https://apis.google.com https://*.pusher.com https://code.jquery.com '+
-				'https://www.dropbox.com https://api.trello.com ' +
+				'https://apis.google.com https://*.pusher.com https://code.jquery.com ' +
 				// Scripts in index.html (not checked here)
 				'\'sha256-JqdgAC+ydIDMtmQclZEqgbw94J4IeABIfXAxwEJGDJs=\' ' +
 				'\'sha256-4Dg3/NrB8tLC7TUSCbrtUDWD/J6bSLka01GHn+qtNZ0=\'; ' +
-			'connect-src \'self\' https://*.draw.io https://*.diagrams.net https://*.googleapis.com wss://*.pusher.com https://*.pusher.com ' +
+			'connect-src %connect-src% \'self\' https://*.draw.io https://*.diagrams.net https://*.googleapis.com wss://*.pusher.com https://*.pusher.com ' +
 				'https://api.github.com https://raw.githubusercontent.com https://gitlab.com ' +
 				'https://graph.microsoft.com https://*.sharepoint.com  https://*.1drv.com ' +
-				'https://*.dropboxapi.com https://api.trello.com https://*.google.com ' +
-				'https://fonts.gstatic.com https://fonts.googleapis.com; ' +
+				'https://*.google.com https://fonts.gstatic.com https://fonts.googleapis.com; ' +
 			// font-src about: is required for MathJax HTML-CSS output with STIX
 			'img-src * data:; media-src * data:; font-src * about:; ' +
-			// www.draw.io required for browser data migration to app.diagrams.net
-			'frame-src %frame-src% \'self\' https://www.draw.io https://*.google.com; ' +
+			// www.draw.io required for browser data migration to app.diagrams.net and
+			// viewer.diagrams.net required for iframe embed preview
+			'frame-src %frame-src% \'self\' https://viewer.diagrams.net https://www.draw.io https://*.google.com; ' +
 			'style-src %style-src% \'self\' \'unsafe-inline\' https://fonts.googleapis.com;'
 
 		var devCsp = csp.
 			// Adds script tags and loads shapes with eval
-			replace(/%script-src%/g, 'https://devhost.jgraph.com \'unsafe-eval\'').
+			replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com https://devhost.jgraph.com \'unsafe-eval\'').
 			// Loads common.css from mxgraph
+			replace(/%connect-src%/g, 'https://*.dropboxapi.com https://api.trello.com').
 			replace(/%style-src%/g, 'https://devhost.jgraph.com').
 			replace(/%frame-src%/g, '').
 			replace(/  /g, ' ');
 		mxmeta(null, devCsp, 'Content-Security-Policy');
 
-		console.log('Content-Security-Policy')
-		console.log('Development:', devCsp)
-		console.log('app.diagrams.net:',
-			csp.replace(/%script-src%/g, '').
+		if (urlParams['print-csp'] == '1')
+		{
+			console.log('Content-Security-Policy')
+			console.log('Development:', devCsp)
+			console.log('app.diagrams.net:',
+				csp.replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com').
+				replace(/%connect-src%/g, 'https://*.dropboxapi.com https://api.trello.com').
 				replace(/%frame-src%/g, '').
-				replace(/%style-src%/g, '').
-				replace(/  /g, ' '));
-		console.log('confluence.draw.io:',
-			csp.replace(/%script-src%/g, 'https://aui-cdn.atlassian.com https://connect-cdn.atl-paas.net https://ajax.googleapis.com').
-				replace(/%frame-src%/g, 'https://www.lucidchart.com https://app.lucidchart.com').
-				replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
-				replace(/  /g, ' '));
-		console.log('jira.draw.io:',
-			csp.replace(/%script-src%/g, 'https://connect-cdn.atl-paas.net').
-				replace(/%frame-src%/g, '').
-				replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
-				replace(/  /g, ' '));
+					replace(/%style-src%/g, '').
+					replace(/  /g, ' '));
+			console.log('confluence.draw.io:',
+				csp.replace(/%script-src%/g, 'https://aui-cdn.atlassian.com https://connect-cdn.atl-paas.net https://ajax.googleapis.com').
+					replace(/%frame-src%/g, 'https://www.lucidchart.com https://app.lucidchart.com').
+					replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
+					replace(/%connect-src%/g, '').
+					replace(/  /g, ' '));
+			console.log('jira.draw.io:',
+				csp.replace(/%script-src%/g, 'https://connect-cdn.atl-paas.net').
+					replace(/%frame-src%/g, '').
+					replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
+					replace(/%connect-src%/g, '').
+					replace(/  /g, ' '));
+			console.log('import.diagrams.net:', 'default-src \'self\'; worker-src blob:; img-src \'self\' blob: data: https://www.lucidchart.com ' +
+					'https://app.lucidchart.com; style-src \'self\' \'unsafe-inline\'; frame-src https://www.lucidchart.com https://app.lucidchart.com;');
+		}
 	})();
 }
 			

+ 76 - 74
src/main/webapp/js/diagramly/Dialogs.js

@@ -51,18 +51,6 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 		div.appendChild(help);
 	}
 
-	var demo = document.createElement('div');
-	demo.style.position = 'absolute';
-	demo.style.cursor = 'pointer';
-	demo.style.fontSize = '12px';
-	demo.style.bottom = bottom;
-	demo.style.color = 'gray';
-	demo.style.userSelect = 'none';
-	
-	mxUtils.write(demo, mxResources.get('decideLater'));
-	mxUtils.setPrefixedStyle(demo.style, 'transform', 'translate(-50%,0)');
-	demo.style.left = '50%';
-	
 	this.init = function()
 	{
 		if (mxClient.IS_QUIRKS || document.documentMode == 8)
@@ -70,17 +58,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 			demo.style.marginLeft = -Math.round(demo.clientWidth / 2) + 'px';
 		}
 	};
-	
-	div.appendChild(demo);
-	
-	mxEvent.addListener(demo, 'click', function()
-	{
-		editorUi.hideDialog();
-		var prev = Editor.useLocalStorage;
-		editorUi.createFile(editorUi.defaultFilename, null, null, null, null, null, null, true);
-		Editor.useLocalStorage = prev;
-	});
-	
+
 	var buttons = document.createElement('div');
 	
 	if (mxClient.IS_QUIRKS)
@@ -354,7 +332,6 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 	{
 		var showMore = document.createElement('a');
 		showMore.style.color = 'gray';
-		showMore.style.fontSize = '12px';
 		showMore.style.cursor = 'pointer';
 		showMore.style.userSelect = 'none';
 		mxUtils.write(showMore, ((StorageDialog.extended) ? mxResources.get('showLess') : mxResources.get('showMore')) + '...');
@@ -372,23 +349,54 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 			mxEvent.consume(evt);
 		});
 	}
-
-	p2.appendChild(cb);
 	
-	var span = document.createElement('span');
-	span.style.color = 'gray';
-	span.style.fontSize = '12px';
-	span.style.userSelect = 'none';
-	mxUtils.write(span, ' ' + mxResources.get('rememberThisSetting'));
-	p2.appendChild(span);
-	mxUtils.br(p2);
 	
+	var demo = document.createElement('div');
+	demo.style.cursor = 'pointer';
+	demo.style.color = 'gray';
+	demo.style.userSelect = 'none';
+
+	mxUtils.write(demo, mxResources.get('import') + ': ' + mxResources.get('gliffy') + ', ' +
+		mxResources.get('formatVssx') + ', ' + mxResources.get('formatVsdx') + ', ' +
+		mxResources.get('lucidchart') + '...');
+
+	mxEvent.addListener(demo, 'click', function()
+	{
+		if (editorUi.storageFileInputElt == null) 
+		{
+			var input = document.createElement('input');
+			input.setAttribute('type', 'file');
+			
+			mxEvent.addListener(input, 'change', function()
+			{
+				if (input.files != null)
+				{
+					// Using null for position will disable crop of input file
+					editorUi.hideDialog();
+					editorUi.openFiles(input.files, true);
+					
+		    		// Resets input to force change event for same file (type reset required for IE)
+					input.type = '';
+					input.type = 'file';
+		    		input.value = '';
+				}
+			});
+			
+			input.style.display = 'none';
+			document.body.appendChild(input);
+			editorUi.storageFileInputElt = input;
+		}
+		
+		editorUi.storageFileInputElt.click();
+	});
+
+	p2.appendChild(demo);
 	var recent = editorUi.getRecent();
 
 	if (!editorUi.isOfflineApp() && recent != null && recent.length > 0)
 	{
 		var recentSelect = document.createElement('select');
-		recentSelect.style.marginTop = '8px';
+		recentSelect.style.marginTop = '12px';
 		recentSelect.style.maxWidth = '170px';
 
 		var titleOption = document.createElement('option');
@@ -445,57 +453,51 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 		
 		var link = document.createElement('a');
 		link.style.cursor = 'pointer';
-		link.style.fontSize = '12px';
 		link.style.color = 'gray';
 		link.style.userSelect = 'none';
 		
-		mxUtils.write(link, mxResources.get('import') + ': ' + mxResources.get('gliffy') + ', ' +
-				mxResources.get('formatVssx') + ', ' + mxResources.get('formatVsdx') + ', ' +
-				mxResources.get('lucidchart') + '...');
-		
+		mxUtils.write(link, mxResources.get('decideLater'));
 		mxEvent.addListener(link, 'click', function()
 		{
-			if (editorUi.storageFileInputElt == null) 
-			{
-				var input = document.createElement('input');
-				input.setAttribute('type', 'file');
-				
-				mxEvent.addListener(input, 'change', function()
-				{
-					if (input.files != null)
-					{
-						// Using null for position will disable crop of input file
-						editorUi.hideDialog();
-						editorUi.openFiles(input.files, true);
-						
-			    		// Resets input to force change event for same file (type reset required for IE)
-						input.type = '';
-						input.type = 'file';
-			    		input.value = '';
-					}
-				});
-				
-				input.style.display = 'none';
-				document.body.appendChild(input);
-				editorUi.storageFileInputElt = input;
-			}
-			
-			editorUi.storageFileInputElt.click();
+			editorUi.hideDialog();
+			var prev = Editor.useLocalStorage;
+			editorUi.createFile(editorUi.defaultFilename, null, null, null, null, null, null, true);
+			Editor.useLocalStorage = prev;
 		});
-		
+
 		temp.appendChild(link);
 		p2.appendChild(temp);
 		buttons.style.paddingBottom = '4px';
 	}
 	
 	buttons.appendChild(p2);
-	
-	mxEvent.addListener(span, 'click', function(evt)
-	{
-		cb.checked = !cb.checked;
-		mxEvent.consume(evt);
-	});
 
+	var temp = document.createElement('div');
+	temp.style.position = 'absolute';
+	temp.style.display = (mxClient.IS_QUIRKS) ? 'inline' : 'inline-block';
+	temp.style.cursor = 'pointer';
+	temp.style.fontSize = '12px';
+	temp.style.bottom = '27px';
+	temp.style.left = '0px';
+	temp.style.right = '0px';
+	temp.style.color = 'gray';
+	temp.style.userSelect = 'none';
+	
+	cb.setAttribute('id', 'geRememberSettingCheckbox');
+	cb.style.marginRight = '6px';
+	cb.style.cursor = 'inherit';
+	temp.appendChild(cb);
+	
+	var label = document.createElement('label');
+	label.setAttribute('for', 'geRememberSettingCheckbox');
+	mxUtils.write(label, mxResources.get('rememberThisSetting'));
+	label.style.cursor = 'inherit';
+	temp.appendChild(label);
+		
+	mxUtils.setPrefixedStyle(temp.style, 'transform', 'translate(-50%,0)');
+	temp.style.left = '50%';
+	div.appendChild(temp);
+	
 	// Checks if Google Drive is missing after a 5 sec delay
 	if (mxClient.IS_SVG && isLocalStorage && urlParams['gapi'] != '0' &&
 		(document.documentMode == null || document.documentMode >= 10))
@@ -506,7 +508,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 			{
 				// To check for Disconnect plugin in chrome use mxClient.IS_GC and check for URL:
 				// chrome-extension://jeoacafpbcihiomhlakheieifhpjdfeo/scripts/vendor/jquery/jquery-2.0.3.min.map
-				p3.style.padding = '8px';
+				p3.style.padding = '7px';
 				p3.style.fontSize = '9pt';
 				p3.style.marginTop = '-14px';
 				p3.innerHTML = '<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" ' +
@@ -6499,7 +6501,7 @@ var FindWindow = function(ui, x, y, w, h)
 	mxEvent.addListener(searchInput, 'keyup', function(evt)
 	{
 		// Ctrl or Cmd keys
-		if (evt.keyCode == 91 || evt.keyCode == 17)
+		if (evt.keyCode == 91 || evt.keyCode == 93 || evt.keyCode == 17)
 		{
 			// Workaround for lost focus on show
 			mxEvent.consume(evt);

+ 1 - 1
src/main/webapp/js/diagramly/DrawioFile.js

@@ -1494,7 +1494,7 @@ DrawioFile.prototype.addUnsavedStatus = function(err)
 				((msg != null && msg != '') ? ' (' + mxUtils.htmlEntities(msg) + ')' : '');
 			this.ui.editor.setStatus('<div title="'+ status +
 				'" class="geStatusAlertOrange" style="cursor:pointer;overflow:hidden;">' + status + ' <img src="' +
-				Editor.saveImage + '" align="top" style="width:16px;margin-top:-2px"/></div>');
+				Editor.saveImage + '" align="top" style="width:16px;margin-top:' + ((mxClient.IS_FF) ? -3 : -2) + 'px"/></div>');
 			
 			// Installs click handler for saving
 			var links = this.ui.statusContainer.getElementsByTagName('div');

+ 1 - 1
src/main/webapp/js/diagramly/DriveClient.js

@@ -1656,7 +1656,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 							{
 								file.saveLevel = 9;
 								
-								if (realOverwrite)
+								if (realOverwrite || etag == null)
 								{
 									doExecuteSave(realOverwrite);
 								}

+ 1 - 1
src/main/webapp/js/diagramly/DriveFile.js

@@ -229,7 +229,7 @@ DriveFile.prototype.saveFile = function(title, revision, success, error, unloadi
 											}
 										}), error, token);
 									}
-									else
+									else if (success != null)
 									{
 										success(resp);
 									}

+ 12 - 7
src/main/webapp/js/diagramly/Editor.js

@@ -230,6 +230,11 @@
 	 */
 	Editor.configVersion = null;
 
+	/**
+	 * Default border for image export (to allow for sketch style).
+	 */
+	Editor.defaultBorder = 5;
+
 	/**
 	 * Common properties for all edges.
 	 */
@@ -3056,7 +3061,7 @@
 				bg = (keepTheme) ? this.graph.defaultPageBackgroundColor : '#ffffff';;
 			}
 			
-			this.convertImages(graph.getSvg(null, null, null, noCrop, null, ignoreSelection,
+			this.convertImages(graph.getSvg(null, null, border, noCrop, null, ignoreSelection,
 				null, null, null, addShadow, null, keepTheme), mxUtils.bind(this, function(svgRoot)
 			{
 				try
@@ -3077,8 +3082,8 @@
 								scale = (!limitHeight) ? width / w : Math.min(1, Math.min((width * 3) / (h * 4), width / w));
 							}
 							
-							w = Math.ceil(scale * w) + 2 * border;
-							h = Math.ceil(scale * h) + 2 * border;
+							w = Math.ceil(scale * w);
+							h = Math.ceil(scale * h);
 							
 							canvas.setAttribute('width', w);
 					   		canvas.setAttribute('height', h);
@@ -3101,13 +3106,13 @@
 						   		{			   		
 									window.setTimeout(function()
 									{
-										ctx.drawImage(img, border / scale, border / scale);
+										ctx.drawImage(img, 0, 0);
 										callback(canvas);
 									}, 0);
 						   		}
 						   		else
 						   		{
-						   			ctx.drawImage(img, border / scale, border / scale);
+						   			ctx.drawImage(img, 0, 0);
 						   			callback(canvas);
 						   		}
 						    };
@@ -3125,8 +3130,8 @@
 				                var b = graph.getGraphBounds();
 								var tx = view.translate.x * curViewScale;
 								var ty = view.translate.y * curViewScale;
-								var x0 = tx + (b.x - tx) / curViewScale;
-								var y0 = ty + (b.y - ty) / curViewScale;
+								var x0 = tx + (b.x - tx) / curViewScale - border;
+								var y0 = ty + (b.y - ty) / curViewScale - border;
 								
 								var background = new Image();
 		

+ 24 - 13
src/main/webapp/js/diagramly/EditorUi.js

@@ -37,6 +37,11 @@
 	 */
 	EditorUi.drawHost = window.DRAWIO_BASE_URL;
 	
+	/**
+	 * Protocol and hostname to use for embedded files. Default is https://www.draw.io
+	 */
+	EditorUi.lightboxHost = window.DRAWIO_LIGHTBOX_URL;
+	
 	/**
 	 * Switch to disable logging for mode and search terms.
 	 */
@@ -4513,7 +4518,7 @@
 				   	{
 				   		this.spinner.stop();
 				   		this.handleError(e);
-				   	}), null, null, null, null, null, null, null, 5);
+				   	}), null, null, null, null, null, null, null, Editor.defaultBorder);
 					
 					mxEvent.addListener(this.editor.graph.container, 'click', clickHandler);
 				   	document.body.appendChild(this.exportDialog);
@@ -5055,7 +5060,7 @@
 	 */
 	EditorUi.prototype.createLink = function(linkTarget, linkColor, allPages, lightbox, editLink, layers, url, ignoreFile, params)
 	{
-		params = (params != null) ? params : this.createUrlParameters(linkTarget, linkColor, allPages, lightbox, editLink, layers);
+		params = (params != null) ? params : this.createUrlParameters(linkTarget, linkColor, allPages, false, editLink, layers);
 		var file = this.getCurrentFile();
 		var addTitle = true;
 		var data = '';
@@ -5087,8 +5092,9 @@
 			params.push('title=' + encodeURIComponent(file.getTitle()));
 		}
 
-		return ((mxClient.IS_CHROMEAPP || EditorUi.isElectronApp || !(/.*\.draw\.io$/.test(window.location.hostname))) ?
-			EditorUi.drawHost : 'https://' + window.location.host) + '/' +
+		return ((lightbox) ? EditorUi.lightboxHost : (((mxClient.IS_CHROMEAPP ||
+			EditorUi.isElectronApp || !(/.*\.draw\.io$/.test(window.location.hostname))) ?
+			EditorUi.drawHost : 'https://' + window.location.host))) + '/' +
 			((params.length > 0) ? '?' + params.join('&') : '') + data;
 	};
 	
@@ -5415,10 +5421,18 @@
 			allPages = this.addCheckbox(div, mxResources.get('allPages'), hasPages, !hasPages);
 		}
 		
-		var lightbox = this.addCheckbox(div, mxResources.get('lightbox'), true);
+		var lightbox = this.addCheckbox(div, mxResources.get('lightbox'), true, null, null, !showFrameOption);
 		var editSection = this.addEditButton(div, lightbox);
 		var edit = editSection.getEditInput();
 
+		// Cannot disable lightbox in iframes
+		if (showFrameOption)
+		{
+			edit.style.marginLeft = lightbox.style.marginLeft;
+			lightbox.style.display = 'none';
+			dy -= 30;
+		}
+		
 		var layers = this.addCheckbox(div, mxResources.get('layers'), true);
 		layers.style.marginLeft = edit.style.marginLeft;
 		layers.style.marginBottom = '16px';
@@ -5819,7 +5833,7 @@
 			{
 				// KNOWN: Message passing does not seem to work in IE11
 				onclick = " onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(" +
-					"img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('" + EditorUi.drawHost + "/?client=1&lightbox=1" +
+					"img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('" + EditorUi.lightboxHost + "/?client=1" +
 					((edit) ? "&edit=_blank" : "") +
 					((layers) ? '&layers=1' : '') + "');}})(this);\"";
 				css += 'cursor:pointer;';
@@ -5842,9 +5856,6 @@
 		
 		if (this.isExportToCanvas())
 		{
-			var scale = 1;
-			var ignoreSelection = true;
-
 			this.editor.exportToCanvas(mxUtils.bind(this, function(canvas)
 		   	{
 	   			var xml = (lightbox) ? this.getFileData(true) : null;
@@ -5853,7 +5864,7 @@
 		   	}), null, null, null, mxUtils.bind(this, function(e)
 		   	{
 		   		err({message: mxResources.get('unknownError')});
-		   	}), null, true, (retina) ? 2 : 1, null, shadow);
+		   	}), null, true, (retina) ? 2 : 1, null, shadow, null, null, Editor.defaultBorder);
 		}
 		else
 		{
@@ -5943,7 +5954,7 @@
 			{
 				// KNOWN: Message passing does not seem to work in IE11
 				onclick = "onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(" +
-					"img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('" + EditorUi.drawHost + "/?client=1&lightbox=1" +
+					"img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('" + EditorUi.lightboxHost + "/?client=1" +
 					((edit) ? "&edit=_blank" : "") + ((layers) ? '&layers=1' : '') + "');}})(this);\"";
 				css += 'cursor:pointer;';
 			}
@@ -5978,7 +5989,7 @@
 					"svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};" +
 					"window.addEventListener('message',r);" +
 					// Opens lightbox window
-					"svg.wnd=window.open('" + EditorUi.drawHost + "/?client=1&lightbox=1" +
+					"svg.wnd=window.open('" + EditorUi.lightboxHost + "/?client=1" +
 					((edit) ? "&edit=_blank" : "") + ((layers) ? '&layers=1' : '') + "');}}})(this);";
 				svgRoot.setAttribute('onclick', js);
 				css += 'cursor:pointer;';
@@ -9359,7 +9370,7 @@
 				this.dialog == null && source.nodeName != 'INPUT' && source.nodeName != 'TEXTAREA')
 			{
 				if (evt.keyCode == 224 /* FF */ || (!mxClient.IS_MAC && evt.keyCode == 17 /* Control */) ||
-					(mxClient.IS_MAC && evt.keyCode == 91 /* Meta */))
+					(mxClient.IS_MAC && (evt.keyCode == 91 || evt.keyCode == 93) /* Left/Right Meta */))
 				{
 					// Cannot use parentNode for check in IE
 					if (!restoreFocus)

+ 11 - 4
src/main/webapp/js/diagramly/Init.js

@@ -19,6 +19,7 @@ window.isSvgBrowser = window.isSvgBrowser || navigator.userAgent == null ||
 // CUSTOM_PARAMETERS - URLs for save and export
 window.DRAWIO_BASE_URL = window.DRAWIO_BASE_URL || ((/.*\.draw\.io$/.test(window.location.hostname)) ?
 	window.location.protocol + '//' + window.location.hostname : 'https://app.diagrams.net');
+window.DRAWIO_LIGHTBOX_URL = window.DRAWIO_LIGHTBOX_URL || 'https://viewer.diagrams.net';
 window.EXPORT_URL = window.EXPORT_URL || 'https://exp.draw.io/ImageExport4/export';
 window.PLANT_URL = window.PLANT_URL || 'https://plant-aws.diagrams.net';
 window.DRAW_MATH_URL = window.DRAW_MATH_URL || window.DRAWIO_BASE_URL + '/math';
@@ -331,17 +332,23 @@ if (urlParams['offline'] == '1' || urlParams['demo'] == '1' || urlParams['stealt
 	urlParams['tr'] = '0';
 }
 
+// Disables math in offline mode
+if (urlParams['offline'] == '1' || urlParams['local'] == '1')
+{
+	urlParams['math'] = '0';
+}
+
 // Uses embed mode on embed domain
 if (window.location.hostname == 'embed.diagrams.net')
 {
 	urlParams['embed'] = '1';
 }	
 
-// Disables math in offline mode
-if (urlParams['offline'] == '1' || urlParams['local'] == '1')
+// Uses lightbox mode on viewer domain
+if (window.location.hostname == 'viewer.diagrams.net')
 {
-	urlParams['math'] = '0';
-}
+	urlParams['lightbox'] = '1';
+}	
 
 // Lightbox enables chromeless mode
 if (urlParams['lightbox'] == '1')

+ 2 - 6
src/main/webapp/js/diagramly/Menus.js

@@ -665,17 +665,13 @@
 
 		editorUi.actions.addAction('keyboardShortcuts...', function()
 		{
-			if (mxClient.IS_CHROMEAPP || EditorUi.isElectronApp)
-			{
-				editorUi.openLink('https://www.draw.io/shortcuts.svg');
-			}
-			else if (mxClient.IS_SVG)
+			if (mxClient.IS_SVG && !mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
 			{
 				editorUi.openLink('shortcuts.svg');
 			}
 			else
 			{
-				editorUi.openLink('https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg');
+				editorUi.openLink('https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg');
 			}
 		});
 

+ 2 - 0
src/main/webapp/js/mxgraph/EditorUi.js

@@ -1185,6 +1185,7 @@ EditorUi.prototype.installShapePicker = function()
 		{
 			if (cell == null && ui.sidebar != null && !mxEvent.isShiftDown(evt))
 			{
+				mxEvent.consume(evt);
 				var pt = mxUtils.convertPoint(this.container, mxEvent.getClientX(evt), mxEvent.getClientY(evt));
 				ui.showShapePicker(pt.x, pt.y);
 			}
@@ -1217,6 +1218,7 @@ EditorUi.prototype.installShapePicker = function()
 				{
 					var temp = graph.getCompositeParent(state.cell);
 					var geo = graph.getCellGeometry(temp);
+					me.consume();
 					
 					while (temp != null && graph.model.isVertex(temp) && geo != null && geo.relative)
 					{

文件差异内容过多而无法显示
+ 791 - 789
src/main/webapp/js/viewer-static.min.js


文件差异内容过多而无法显示
+ 791 - 789
src/main/webapp/js/viewer.min.js


+ 3 - 3
src/main/webapp/package.json

@@ -1,6 +1,6 @@
 {
   "name": "draw.io",
-  "version": "13.3.6",
+  "version": "13.4.5",
   "description": "diagrams.net desktop",
   "main": "electron.js",
   "scripts": {
@@ -27,11 +27,11 @@
     "electron-log": "^4.2.0",
     "electron-updater": "^4.3.1",
     "electron-progressbar": "^1.2.0",
-    "electron-store": "^5.1.1",
+    "electron-store": "^5.2.0",
     "compression": "^1.7.4",
     "crc": "^3.8.0"
   },
   "devDependencies": {
-    "electron": "^9.0.4"
+    "electron": "^9.1.0"
   }
 }

+ 1 - 1
src/main/webapp/service-worker.js

@@ -6,7 +6,7 @@ if (workbox)
 	workbox.precaching.precacheAndRoute([
   {
     "url": "js/app.min.js",
-    "revision": "78e00fca1f842a747fb1385f0b553fe5"
+    "revision": "11cff84625b1ac0ec2f4f4460e9cc44e"
   },
   {
     "url": "js/extensions.min.js",

+ 17 - 17
src/main/webapp/yarn.lock

@@ -31,14 +31,14 @@
     defer-to-connect "^1.0.1"
 
 "@types/node@*":
-  version "14.0.14"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.14.tgz#24a0b5959f16ac141aeb0c5b3cd7a15b7c64cbce"
-  integrity sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ==
+  version "14.0.23"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806"
+  integrity sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==
 
 "@types/node@^12.0.12":
-  version "12.12.47"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.47.tgz#5007b8866a2f9150de82335ca7e24dd1d59bdfb5"
-  integrity sha512-yzBInQFhdY8kaZmqoL2+3U5dSTMrKaYcb561VU+lDzAYvqt+2lojvBEy+hmpSNuXnPTx7m9+04CzWYOUqWME2A==
+  version "12.12.50"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.50.tgz#e9b2e85fafc15f2a8aa8fdd41091b983da5fd6ee"
+  integrity sha512-5ImO01Fb8YsEOYpV+aeyGYztcYcjGsBvN4D7G5r1ef2cuQOpymjWNQi5V0rKHE6PC2ru3HkoUr/Br2/8GUA84w==
 
 "@types/semver@^7.1.0":
   version "7.3.1"
@@ -56,9 +56,9 @@ accepts@~1.3.5:
     negotiator "0.6.2"
 
 ajv@^6.10.2:
-  version "6.12.2"
-  resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd"
-  integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==
+  version "6.12.3"
+  resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.3.tgz#18c5af38a111ddeb4f2697bd78d68abc1cabd706"
+  integrity sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==
   dependencies:
     fast-deep-equal "^3.1.1"
     fast-json-stable-stringify "^2.0.0"
@@ -283,7 +283,7 @@ electron-progressbar@^1.2.0:
   dependencies:
     extend "^3.0.1"
 
-electron-store@^5.1.1:
+electron-store@^5.2.0:
   version "5.2.0"
   resolved "https://registry.yarnpkg.com/electron-store/-/electron-store-5.2.0.tgz#a15718fc1fa21acfd07af55f9b94f9fa6a536665"
   integrity sha512-iU3WDqEDAYNYR9XV7p0tJajq/zs9z7Nrn0sAoR5nDyn8h/9dr9kusKbTxD8NtVEBD1TB1pkGMqcbIt/y6knDwQ==
@@ -304,10 +304,10 @@ electron-updater@^4.3.1:
     lodash.isequal "^4.5.0"
     semver "^7.1.3"
 
-electron@^9.0.4:
-  version "9.0.5"
-  resolved "https://registry.yarnpkg.com/electron/-/electron-9.0.5.tgz#189ee117cc2a2777cccf40fae0766acec5faae57"
-  integrity sha512-bnL9H48LuQ250DML8xUscsKiuSu+xv5umXbpBXYJ0BfvYVmFfNbG3jCfhrsH7aP6UcQKVxOG1R/oQExd0EFneQ==
+electron@^9.1.0:
+  version "9.1.0"
+  resolved "https://registry.yarnpkg.com/electron/-/electron-9.1.0.tgz#ca77600c9e4cd591298c340e013384114d3d8d05"
+  integrity sha512-VRAF8KX1m0py9I9sf0kw1kWfeC87mlscfFcbcRdLBsNJ44/GrJhi3+E8rKbpHUeZNQxsPaVA5Zu5Lxb6dV/scQ==
   dependencies:
     "@electron/get" "^1.0.1"
     "@types/node" "^12.0.12"
@@ -579,9 +579,9 @@ lodash.isequal@^4.5.0:
   integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
 
 lodash@^4.17.10:
-  version "4.17.15"
-  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
-  integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
+  version "4.17.19"
+  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
+  integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
 
 lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
   version "1.0.1"