浏览代码

20.8.9 release

David Benson 2 年之前
父节点
当前提交
b4bd165ff4

+ 7 - 1
ChangeLog

@@ -1,6 +1,12 @@
+20-JAN-2023: 20.8.9
+
+- Handles possible errors in custom links
+- Adds paste data in style tab for multiple cells
+- Improves error logging in P2PCollab [drawio-nextcloud-27]
+
 19-JAN-2023: 20.8.8
 
-- Updates actions after undo history events [3294]
+- Updates actions after undo history events [drawio-3294]
 - Adds navigation items to context menu in simple UI
 - Mermaid Updated to v9.3.0
 - Updates express dependency of nodeImport (vsd server) [CSP-1246]

+ 1 - 1
VERSION

@@ -1 +1 @@
-20.8.8
+20.8.9

+ 1 - 1
etc/dependencies/package.json

@@ -12,7 +12,7 @@
 	  "jsZip": "3.10.1",
 	  "perfect-freehand": "1.0.16",
 	  "jquery": "3.6.0",
-	  "mermaid": "9.1.3",
+	  "mermaid": "9.3.0",
 	  "pako": "2.0.3",
 	  "crypto-js": "3.1.2",
 	  "dompurify": "2.4.3",

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


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

@@ -4592,7 +4592,7 @@
 			}
 			else if (ss.cells.length >= 1)
 			{
-				this.addActions(div, ['pasteStyle']);
+				this.addActions(div, ['pasteStyle', 'pasteData']);
 			}
 			
 			return styleFormatPanelAddStyleOps.apply(this, arguments);

+ 17 - 6
src/main/webapp/js/diagramly/EditorUi.js

@@ -9816,6 +9816,11 @@
 				{
 					this.addMenuItems(menu, ['-', 'addToScratchpad'], null, evt);
 				}
+
+				if (graph.isSelectionEmpty() && Editor.currentTheme == 'simple')
+				{
+					this.addMenuItems(menu, ['-', 'exitGroup', 'home'], null, evt);
+				}
 			};
 
 			var menusAddPopupMenuEditItems = Menus.prototype.addPopupMenuEditItems;
@@ -9884,6 +9889,11 @@
 							}
 						}
 
+						if (graph.getSelectionCount() == 1)
+						{
+							this.addMenuItems(menu, ['enterGroup'], null, evt);
+						}
+
 						// Shows table cell options
 						var ss = ui.getSelectionState();
 
@@ -17069,10 +17079,6 @@
 		var autoModeAction = this.actions.get('autoMode');
 		autoModeAction.setEnabled(autoModeAction.isEnabled() && Editor.currentTheme != 'atlas');
 		
-		// Updates undo history states
-		this.actions.get('undo').setEnabled(this.canUndo() && editable);
-		this.actions.get('redo').setEnabled(this.canRedo() && editable);
-	
 		// Disables menus
 		this.menus.get('edit').setEnabled(active);
 		this.menus.get('view').setEnabled(active);
@@ -17172,14 +17178,19 @@
 		var file = this.getCurrentFile();
 		var ss = this.getSelectionState();
 		var active = this.isDiagramActive();
-
-		this.actions.get('pageSetup').setEnabled(active);
+		var editable = (urlParams['embed'] == '1' &&
+			this.editor.graph.isEnabled()) ||
+			(file != null && file.isEditable());
+		
+		this.actions.get('undo').setEnabled(this.canUndo() && editable);
+		this.actions.get('redo').setEnabled(this.canRedo() && editable);
 		this.actions.get('autosave').setEnabled(file != null && file.isEditable() && file.isAutosaveOptional());
 		this.actions.get('guides').setEnabled(active);
 		this.actions.get('editData').setEnabled(graph.isEnabled());
 		this.actions.get('editConnectionPoints').setEnabled(active && ss.edges.length == 0 && ss.vertices.length == 1);
 		this.actions.get('editImage').setEnabled(active && ss.image && ss.cells.length > 0);
 		this.actions.get('crop').setEnabled(active && ss.image && ss.cells.length > 0);
+		this.actions.get('pageSetup').setEnabled(active);
 		this.actions.get('shadowVisible').setEnabled(active);
 		this.actions.get('connectionArrows').setEnabled(active);
 		this.actions.get('connectionPoints').setEnabled(active);

+ 14 - 7
src/main/webapp/js/diagramly/GraphViewer.js

@@ -481,18 +481,25 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)
 				
 				this.graph.customLinkClicked = function(href)
 				{
-					if (Graph.isPageLink(href))
+					try
 					{
-						var comma = href.indexOf(',');
-						
-						if (!self.selectPageById(href.substring(comma + 1)))
+						if (Graph.isPageLink(href))
 						{
-							alert(mxResources.get('pageNotFound') || 'Page not found');
+							var comma = href.indexOf(',');
+							
+							if (!self.selectPageById(href.substring(comma + 1)))
+							{
+								alert(mxResources.get('pageNotFound') || 'Page not found');
+							}
+						}
+						else
+						{
+							this.handleCustomLink(href);
 						}
 					}
-					else
+					catch (e)
 					{
-						this.handleCustomLink(href);
+						alert(e.message);
 					}
 					
 					return true;

+ 8 - 6
src/main/webapp/js/diagramly/P2PCollab.js

@@ -109,7 +109,7 @@ function P2PCollab(ui, sync, channelId)
 		{
 			if (window.console != null)
 			{
-				console.log('Error:', e);
+				console.error(e, type, data);
 			}
 		}
 	};
@@ -479,7 +479,7 @@ function P2PCollab(ui, sync, channelId)
 		{
 			if (window.console != null)
 			{
-				console.log('P2PCollab.processMsg', e);
+				console.error(e, msg, fromCId);
 			}
 		}
 	};
@@ -659,8 +659,8 @@ function P2PCollab(ui, sync, channelId)
 					sync.scheduleCleanup();
 				}
 			});
-		
-			ws.addEventListener('message', mxUtils.bind(this, function(event)
+
+			function messageListener(event)
 			{
 				try
 				{
@@ -702,10 +702,12 @@ function P2PCollab(ui, sync, channelId)
 				{
 					if (window.console != null)
 					{
-						console.log('P2PCollab.message', e);
+						console.error(e, event);
 					}
 				}
-			}));
+			};
+		
+			ws.addEventListener('message', messageListener);
 
 			var rejoinCalled = false;
 				

文件差异内容过多而无法显示
+ 1283 - 2
src/main/webapp/js/extensions.min.js


+ 5 - 6
src/main/webapp/js/grapheditor/EditorUi.js

@@ -4382,15 +4382,11 @@ EditorUi.prototype.setGridColor = function(value)
  */
 EditorUi.prototype.addUndoListener = function()
 {
-	var undo = this.actions.get('undo');
-	var redo = this.actions.get('redo');
-	
 	var undoMgr = this.editor.undoManager;
 	
     var undoListener = mxUtils.bind(this, function()
     {
-    	undo.setEnabled(this.canUndo());
-    	redo.setEnabled(this.canRedo());
+		this.updateActionStates();
     });
 
     undoMgr.addListener(mxEvent.ADD, undoListener);
@@ -4427,6 +4423,7 @@ EditorUi.prototype.updateActionStates = function()
 	var graph = this.editor.graph;
 	var ss = this.getSelectionState();
     var unlocked = graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent());
+	var editable = !this.editor.chromeless || this.editor.editable;
 
 	// Updates action states
 	var actions = ['cut', 'copy', 'bold', 'italic', 'underline', 'delete', 'duplicate',
@@ -4441,7 +4438,9 @@ EditorUi.prototype.updateActionStates = function()
 		this.actions.get(actions[i]).setEnabled(ss.cells.length > 0);
 	}
 
-	this.actions.get('grid').setEnabled(!this.editor.chromeless || this.editor.editable);
+	this.actions.get('grid').setEnabled(editable);
+	this.actions.get('undo').setEnabled(this.canUndo() && editable);
+	this.actions.get('redo').setEnabled(this.canRedo() && editable);
 	this.actions.get('pasteSize').setEnabled(this.copiedSize != null && ss.vertices.length > 0);
 	this.actions.get('pasteData').setEnabled(this.copiedValue != null && ss.cells.length > 0);
 	this.actions.get('setAsDefaultStyle').setEnabled(graph.getSelectionCount() == 1);

文件差异内容过多而无法显示
+ 1410 - 129
src/main/webapp/js/integrate.min.js


文件差异内容过多而无法显示
+ 1284 - 3
src/main/webapp/js/mermaid/mermaid.min.js


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


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


文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/mxgraph/mxClient.js


文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/service-worker.js


文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/service-worker.js.map