Skip to content

Commit

Permalink
24.0.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Mar 8, 2024
1 parent 62c0b20 commit ab93af8
Show file tree
Hide file tree
Showing 19 changed files with 7,889 additions and 7,808 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
08-MAR-2024: 24.0.3

- [conf cloud] Enables direct editing without custom content
- [conf cloud] Fixed imported libraries name if end with ".xml" [DID-10920]
- Adds block padding and margin properties to style panel [drawio-4198]
- Uses default spacing for Textbox shape
- Fixes default font for sketch mode [drawio-4216]
- Fixes broken MathJax output after zoom [drawio-4242]
- Fixes custom fonts and images in background pages [drawio-4239,drawio-3712,drawio-3281,drawio-2733,drawio-2367]

05-MAR-2024: 24.0.2

- Fixes DRAWIO_SERVER_URL if query string contains forward slash
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
24.0.2
24.0.3
1 change: 0 additions & 1 deletion src/main/mxgraph/view/mxCellRenderer.js
Expand Up @@ -1048,7 +1048,6 @@ mxCellRenderer.prototype.isTextShapeInvalid = function(state, shape)
check('background', mxConstants.STYLE_LABEL_BACKGROUNDCOLOR) ||
check('border', mxConstants.STYLE_LABEL_BORDERCOLOR) ||
check('opacity', mxConstants.STYLE_TEXT_OPACITY, 100) ||
check('textShadow', mxConstants.STYLE_TEXT_SHADOW, false) ||
check('textDirection', mxConstants.STYLE_TEXT_DIRECTION, mxConstants.DEFAULT_TEXT_DIRECTION);
};

Expand Down
19 changes: 12 additions & 7 deletions src/main/mxgraph/view/mxGraphView.js
Expand Up @@ -913,13 +913,18 @@ mxGraphView.prototype.getBackgroundPageBounds = function()
*/
mxGraphView.prototype.redrawBackgroundImage = function(backgroundImage, bg)
{
backgroundImage.scale = this.scale;
backgroundImage.bounds.x = this.scale * (this.translate.x + bg.x);
backgroundImage.bounds.y = this.scale * (this.translate.y + bg.y);
backgroundImage.bounds.width = this.scale * bg.width;
backgroundImage.bounds.height = this.scale * bg.height;

backgroundImage.redraw();
var bounds = new mxRectangle(
this.scale * (this.translate.x + bg.x),
this.scale * (this.translate.y + bg.y),
this.scale * bg.width, this.scale * bg.height);

if (backgroundImage.scale != this.scale ||
!bounds.equals(backgroundImage.bounds))
{
backgroundImage.scale = this.scale;
backgroundImage.bounds = bounds;
backgroundImage.redraw();
}
};

/**
Expand Down
4,142 changes: 2,071 additions & 2,071 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

199 changes: 83 additions & 116 deletions src/main/webapp/js/diagramly/Editor.js
Expand Up @@ -4954,7 +4954,7 @@
/**
* Create Properties Panel
*/
StyleFormatPanel.prototype.addProperties = function(div, properties, state)
BaseFormatPanel.prototype.addProperties = function(div, properties, state, hideId)
{
var that = this;
var graph = this.editorUi.editor.graph;
Expand All @@ -4965,98 +4965,105 @@
curElem.parentNode.insertBefore(newElem, curElem.nextSibling);
};

function applyStyleVal(pName, newVal, prop, delIndex)
function applyStyleVal(pName, newVal, prop, delIndex, input)
{
graph.getModel().beginUpdate();
try
if (prop.valueChanged != null)
{
var changedProps = [];
var changedVals = [];

if (prop.index != null)
prop.valueChanged(newVal, input);
}
else
{
graph.getModel().beginUpdate();
try
{
var allVals = [];
var curVal = prop.parentRow.nextSibling;

while(curVal && curVal.getAttribute('data-pName') == pName)
{
allVals.push(curVal.getAttribute('data-pValue'));
curVal = curVal.nextSibling;
}

if (prop.index < allVals.length)
var changedProps = [];
var changedVals = [];

if (prop.index != null)
{
if (delIndex != null)
var allVals = [];
var curVal = prop.parentRow.nextSibling;

while(curVal && curVal.getAttribute('data-pName') == pName)
{
allVals.splice(delIndex, 1);
allVals.push(curVal.getAttribute('data-pValue'));
curVal = curVal.nextSibling;
}

if (prop.index < allVals.length)
{
if (delIndex != null)
{
allVals.splice(delIndex, 1);
}
else
{
allVals[prop.index] = newVal;
}
}
else
{
allVals[prop.index] = newVal;
allVals.push(newVal);
}
}
else
{
allVals.push(newVal);
}

if (prop.size != null && allVals.length > prop.size) //trim the array to the specifies size
{
allVals = allVals.slice(0, prop.size);
}

newVal = allVals.join(',');

if (prop.countProperty != null)
{
graph.setCellStyles(prop.countProperty, allVals.length, graph.getSelectionCells());

changedProps.push(prop.countProperty);
changedVals.push(allVals.length);
}
}

graph.setCellStyles(pName, newVal, graph.getSelectionCells());
changedProps.push(pName);
changedVals.push(newVal);

if (prop.dependentProps != null)
{
for (var i = 0; i < prop.dependentProps.length; i++)
{
var defVal = prop.dependentPropsDefVal[i];
var vals = prop.dependentPropsVals[i];
if (prop.size != null && allVals.length > prop.size) //trim the array to the specifies size
{
allVals = allVals.slice(0, prop.size);
}

newVal = allVals.join(',');

if (vals.length > newVal)
if (prop.countProperty != null)
{
vals = vals.slice(0, newVal);
graph.setCellStyles(prop.countProperty, allVals.length, graph.getSelectionCells());

changedProps.push(prop.countProperty);
changedVals.push(allVals.length);
}
else
}

graph.setCellStyles(pName, newVal, graph.getSelectionCells());
changedProps.push(pName);
changedVals.push(newVal);

if (prop.dependentProps != null)
{
for (var i = 0; i < prop.dependentProps.length; i++)
{
for (var j = vals.length; j < newVal; j++)
var defVal = prop.dependentPropsDefVal[i];
var vals = prop.dependentPropsVals[i];

if (vals.length > newVal)
{
vals.push(defVal);
vals = vals.slice(0, newVal);
}
else
{
for (var j = vals.length; j < newVal; j++)
{
vals.push(defVal);
}
}

vals = vals.join(',');
graph.setCellStyles(prop.dependentProps[i], vals, graph.getSelectionCells());
changedProps.push(prop.dependentProps[i]);
changedVals.push(vals);
}

vals = vals.join(',');
graph.setCellStyles(prop.dependentProps[i], vals, graph.getSelectionCells());
changedProps.push(prop.dependentProps[i]);
changedVals.push(vals);
}

if (typeof(prop.onChange) == 'function')
{
prop.onChange(graph, newVal);
}

that.editorUi.fireEvent(new mxEventObject('styleChanged', 'keys', changedProps,
'values', changedVals, 'cells', graph.getSelectionCells()));
}

if (typeof(prop.onChange) == 'function')
finally
{
prop.onChange(graph, newVal);
graph.getModel().endUpdate();
}

that.editorUi.fireEvent(new mxEventObject('styleChanged', 'keys', changedProps,
'values', changedVals, 'cells', graph.getSelectionCells()));
}
finally
{
graph.getModel().endUpdate();
}
}

Expand Down Expand Up @@ -5358,7 +5365,7 @@
// ignores parsing errors
}

applyStyleVal(pName, newVal, prop);
applyStyleVal(pName, newVal, prop, null, input);
}

mxEvent.addListener(input, 'keypress', function(e)
Expand Down Expand Up @@ -5484,7 +5491,7 @@
}

//Add it to top (always)
if (cellId != null)
if (cellId != null && !hideId)
{
grid.appendChild(createPropertyRow('id', mxUtils.htmlEntities(cellId), {dispName: 'ID', type: 'readOnly'}, true, false));
}
Expand All @@ -5498,8 +5505,8 @@
if (!prop.isVisible(state, this)) continue;
}

var pValue = state.style[key] != null? mxUtils.htmlEntities(state.style[key] + '') :
((prop.getDefaultValue != null) ? prop.getDefaultValue(state, this) : prop.defVal); //or undefined if defVal is undefined
var pValue = (prop.getValue != null) ? prop.getValue() : (state.style[key] != null? mxUtils.htmlEntities(state.style[key] + '') :
((prop.getDefaultValue != null) ? prop.getDefaultValue(state, this) : prop.defVal)); //or undefined if defVal is undefined

if (prop.type == 'separator')
{
Expand Down Expand Up @@ -7104,46 +7111,6 @@
}
};

/**
* Adds workaround for math rendering in Chrome.
*
* Workaround for https://bugs.webkit.org/show_bug.cgi?id=93358 in WebKit
*
* Adding an absolute position DIV before the SVG seems to mitigate the problem.
*/
var graphViewValidateBackgroundPage = mxGraphView.prototype.validateBackgroundPage;

mxGraphView.prototype.validateBackgroundPage = function()
{
graphViewValidateBackgroundPage.apply(this, arguments);

if (mxClient.IS_GC && this.getDrawPane() != null)
{
var g = this.getDrawPane().parentNode;

if (this.graph.mathEnabled && !mxClient.NO_FO &&
(this.webKitForceRepaintNode == null ||
this.webKitForceRepaintNode.parentNode == null) &&
this.graph.container.firstChild.nodeName == 'svg')
{
this.webKitForceRepaintNode = document.createElement('div');
this.webKitForceRepaintNode.style.cssText = 'position:absolute;';
g.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode, g.ownerSVGElement);
}
else if (this.webKitForceRepaintNode != null && (!this.graph.mathEnabled ||
(this.graph.container.firstChild.nodeName != 'svg' &&
this.graph.container.firstChild != this.webKitForceRepaintNode)))
{
if (this.webKitForceRepaintNode.parentNode != null)
{
this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode);
}

this.webKitForceRepaintNode = null;
}
}
};

/**
* Updates the SVG for the background image if it references another page.
*/
Expand Down
32 changes: 22 additions & 10 deletions src/main/webapp/js/diagramly/EditorUi.js
Expand Up @@ -4226,14 +4226,6 @@
Editor.configurationKey = '.sketch-configuration';
Editor.settingsKey = '.sketch-config';
}

if (Editor.currentTheme == 'sketch')
{
Graph.prototype.defaultVertexStyle['fontFamily'] = Editor.sketchFontFamily;
Graph.prototype.defaultVertexStyle['fontSource'] = Editor.sketchFontSource;
Graph.prototype.defaultEdgeStyle['fontFamily'] = Editor.sketchFontFamily;
Graph.prototype.defaultEdgeStyle['fontSource'] = Editor.sketchFontSource;
}
};

EditorUi.initTheme();
Expand Down Expand Up @@ -5747,6 +5739,15 @@
doSave(svgRoot);
}
});

// Converts background pages to subtrees so that
// images can be converted and embedded next
if (Editor.replaceSvgDataUris && embedImages &&
this.editor.graph.backgroundImage != null &&
this.editor.graph.backgroundImage.originalSrc != null)
{
this.embedSvgImages(svgRoot);
}

var done = mxUtils.bind(this, function(svgRoot)
{
Expand Down Expand Up @@ -14036,21 +14037,30 @@
setStyle(graph.defaultEdgeStyle, 'targetPerimeterSpacing', '8');
}
}

// Skipped if defaultFonts configured
if (Editor.config == null || Editor.config.defaultFonts == null)
{
// Skipped if defaultFonts, defaultVertexStyle or defaultEdgeStyle configured
if (Editor.config == null || (Editor.config.defaultVertexStyle == null &&
Editor.config.defaultEdgeStyle == null))
{
if (Editor.currentTheme == 'sketch' || Editor.sketchMode)
{
setStyle(graph.defaultVertexStyle, 'fontFamily', Editor.sketchFontFamily);
setStyle(graph.defaultVertexStyle, 'fontSource', Editor.sketchFontSource);

setStyle(graph.defaultEdgeStyle, 'fontFamily', Editor.sketchFontFamily);
setStyle(graph.defaultEdgeStyle, 'fontSource', Editor.sketchFontSource);
}

if (Editor.sketchMode)
{
setStyle(graph.defaultVertexStyle, 'sketch', '1');
setStyle(graph.defaultVertexStyle, 'curveFitting', Editor.sketchDefaultCurveFitting);
setStyle(graph.defaultVertexStyle, 'jiggle', Editor.sketchDefaultJiggle);
setStyle(graph.defaultVertexStyle, 'hachureGap', '4');

setStyle(graph.defaultEdgeStyle, 'sketch', '1');
setStyle(graph.defaultEdgeStyle, 'curveFitting', Editor.sketchDefaultCurveFitting);
setStyle(graph.defaultEdgeStyle, 'jiggle', Editor.sketchDefaultJiggle);
Expand Down Expand Up @@ -17984,6 +17994,8 @@
this.actions.get('makeCopy').setEnabled(file != null && !file.isRestricted());
this.actions.get('editDiagram').setEnabled(active && (file == null || !file.isRestricted()));
this.actions.get('publishLink').setEnabled(file != null && !file.isRestricted());
this.actions.get('removeFormat').setEnabled(graph.isEnabled() &&
!graph.isSelectionEmpty() && !graph.isEditing());
this.actions.get('tags').setEnabled(this.diagramContainer.style.visibility != 'hidden');
this.actions.get('layers').setEnabled(this.diagramContainer.style.visibility != 'hidden');
this.actions.get('outline').setEnabled(this.diagramContainer.style.visibility != 'hidden');
Expand Down

0 comments on commit ab93af8

Please sign in to comment.