Skip to content

Commit

Permalink
Update to TinyMCE 7.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Jun 7, 2024
1 parent caac7fa commit 2a14215
Show file tree
Hide file tree
Showing 34 changed files with 52 additions and 48 deletions.
24 changes: 14 additions & 10 deletions app/assets/source/tinymce/tinymce.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* TinyMCE version 7.1.1 (2024-05-22)
* TinyMCE version 7.1.2 (TBD)
*/

(function () {
Expand Down Expand Up @@ -3564,8 +3564,8 @@
return hexColour(value);
};

const rgbRegex = /^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i;
const rgbaRegex = /^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i;
const rgbRegex = /^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i;
const rgbaRegex = /^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i;
const rgbaColour = (red, green, blue, alpha) => ({
red,
green,
Expand All @@ -3579,10 +3579,15 @@
const a = parseFloat(alpha);
return rgbaColour(r, g, b, a);
};
const fromString = rgbaString => {
if (rgbaString === 'transparent') {
return Optional.some(rgbaColour(0, 0, 0, 0));
const getColorFormat = colorString => {
if (rgbRegex.test(colorString)) {
return 'rgb';
} else if (rgbaRegex.test(colorString)) {
return 'rgba';
}
return 'other';
};
const fromString = rgbaString => {
const rgbMatch = rgbRegex.exec(rgbaString);
if (rgbMatch !== null) {
return Optional.some(fromStringValues(rgbMatch[1], rgbMatch[2], rgbMatch[3], '1'));
Expand All @@ -3601,7 +3606,6 @@
const urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi;
const styleRegExp = /\s*([^:]+):\s*([^;]+);?/g;
const trimRightRegExp = /\s+$/;
const rgbaRegExp = /rgba *\(/i;
const encodingLookup = {};
let validStyles;
let invalidStyles;
Expand Down Expand Up @@ -3755,7 +3759,7 @@
} else if (name === 'color' || name === 'background-color') {
value = value.toLowerCase();
}
if (!rgbaRegExp.test(value)) {
if (getColorFormat(value) === 'rgb') {
fromString(value).each(rgba => {
value = rgbaToHexString(toString(rgba)).toLowerCase();
});
Expand Down Expand Up @@ -31338,8 +31342,8 @@
documentBaseURL: null,
suffix: null,
majorVersion: '7',
minorVersion: '1.1',
releaseDate: '2024-05-22',
minorVersion: '1.2',
releaseDate: 'TBD',
i18n: I18n,
activeEditor: null,
focusedEditor: null,
Expand Down
4 changes: 2 additions & 2 deletions lib/tinymce/rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TinyMCE
module Rails
VERSION = "7.1.1"
TINYMCE_VERSION = "7.1.1"
VERSION = "7.1.2"
TINYMCE_VERSION = "7.1.2"
end
end
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/tinymce/models/dom/model.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2a14215

Please sign in to comment.