tinymce-rails 6.7.0 → 6.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +68 -107
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/models/dom/model.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
  23. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  26. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  29. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  33. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  36. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  37. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1ce0ad13d60afa861fa00e6c52bd760ef860f0308a1a97ae7a593d521135f37
4
- data.tar.gz: 756d019a00e9594df9bb1353561981874192cb33eee4bb654eba526ca4d6b0a3
3
+ metadata.gz: e8cb3bb1be1e6c958cc4f8e6fc8df3b024d332c47ca7865de15ab2f748917794
4
+ data.tar.gz: ec9f124fdacb7df7454c15f8425e6cf8905bc33d0764bf747b34af48fffb2a1d
5
5
  SHA512:
6
- metadata.gz: b3b76844b3007da7b15f5837727034c4b3033b73a9cc2fcd142341434b65a1acfd0ddf3e27daf6ce1ce502302ec3238d0549f6cba57f814d1391121b8c6cf77b
7
- data.tar.gz: c0f49240d820146ae5e225830b7f53d771d5804087e2681444303c2d870bc0189a7aa083eb46aa7493872e0bb2a3a0f988a8aa88efcd0c21ff346868231d38dd
6
+ metadata.gz: 6f823ccd4ce822d75bf44e4f8e553c90b6c73c4746ed96ab2269283c5f606de81cb9c8c6a4ceb739bda0a7701648303eb362e368ae52c06133d7850c5bfd8d24
7
+ data.tar.gz: 55b84f91107e3c663ce4c09ca5c73a3ec6bfa4971dc7470a9efafce203eb2e16ab7f52d58a385b6f86fd1eda985d1349dfcf4b45f6ec8c88693faebdd6b9dd12
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.7.0 (2023-08-30)
2
+ * TinyMCE version 6.7.2 (2023-10-25)
3
3
  */
4
4
 
5
5
  (function () {
@@ -735,7 +735,7 @@
735
735
  return checkRange(str, suffix, str.length - suffix.length);
736
736
  };
737
737
  const blank = r => s => s.replace(r, '');
738
- const trim$3 = blank(/^\s+|\s+$/g);
738
+ const trim$4 = blank(/^\s+|\s+$/g);
739
739
  const lTrim = blank(/^\s+/g);
740
740
  const rTrim = blank(/\s+$/g);
741
741
  const isNotEmpty = s => s.length > 0;
@@ -1005,7 +1005,7 @@
1005
1005
  };
1006
1006
 
1007
1007
  const whiteSpaceRegExp$1 = /^\s*|\s*$/g;
1008
- const trim$2 = str => {
1008
+ const trim$3 = str => {
1009
1009
  return isNullable(str) ? '' : ('' + str).replace(whiteSpaceRegExp$1, '');
1010
1010
  };
1011
1011
  const is$3 = (obj, type) => {
@@ -1072,7 +1072,7 @@
1072
1072
  } else if (s === '') {
1073
1073
  return [];
1074
1074
  } else {
1075
- return map$1(s.split(d || ','), trim$2);
1075
+ return map$1(s.split(d || ','), trim$3);
1076
1076
  }
1077
1077
  };
1078
1078
  const _addCacheSuffix = url => {
@@ -1083,7 +1083,7 @@
1083
1083
  return url;
1084
1084
  };
1085
1085
  const Tools = {
1086
- trim: trim$2,
1086
+ trim: trim$3,
1087
1087
  isArray: isArray,
1088
1088
  is: is$3,
1089
1089
  toArray: toArray$1,
@@ -1564,7 +1564,7 @@
1564
1564
  const remove$6 = (element, property) => {
1565
1565
  const dom = element.dom;
1566
1566
  internalRemove(dom, property);
1567
- if (is$2(getOpt(element, 'style').map(trim$3), '')) {
1567
+ if (is$2(getOpt(element, 'style').map(trim$4), '')) {
1568
1568
  remove$a(element, 'style');
1569
1569
  }
1570
1570
  };
@@ -2170,7 +2170,7 @@
2170
2170
 
2171
2171
  const ZWSP$1 = zeroWidth;
2172
2172
  const isZwsp$1 = isZwsp$2;
2173
- const trim$1 = removeZwsp;
2173
+ const trim$2 = removeZwsp;
2174
2174
 
2175
2175
  const isElement$5 = isElement$6;
2176
2176
  const isText$9 = isText$a;
@@ -3820,6 +3820,9 @@
3820
3820
  if (isNonNullable(originalEvent.composedPath)) {
3821
3821
  event.composedPath = () => originalEvent.composedPath();
3822
3822
  }
3823
+ if (isNonNullable(originalEvent.getModifierState)) {
3824
+ event.getModifierState = keyArg => originalEvent.getModifierState(keyArg);
3825
+ }
3823
3826
  return event;
3824
3827
  };
3825
3828
  const normalize$3 = (type, originalEvent, fallbackTarget, data) => {
@@ -6309,7 +6312,7 @@
6309
6312
  };
6310
6313
  const getBookmark$2 = (selection, type, normalized = false) => {
6311
6314
  if (type === 2) {
6312
- return getOffsetBookmark(trim$1, normalized, selection);
6315
+ return getOffsetBookmark(trim$2, normalized, selection);
6313
6316
  } else if (type === 3) {
6314
6317
  return getCaretBookmark(selection);
6315
6318
  } else if (type) {
@@ -6603,7 +6606,7 @@
6603
6606
  const arr = item.split('=');
6604
6607
  const key = arr[0];
6605
6608
  const val = arr.length > 1 ? arr[1] : key;
6606
- output[trim$3(key)] = trim$3(val);
6609
+ output[trim$4(key)] = trim$4(val);
6607
6610
  return output;
6608
6611
  }, {});
6609
6612
  };
@@ -6838,7 +6841,7 @@
6838
6841
  if (valid) {
6839
6842
  if (isString(value)) {
6840
6843
  return {
6841
- value: map$3(value.split(','), trim$3),
6844
+ value: map$3(value.split(','), trim$4),
6842
6845
  valid
6843
6846
  };
6844
6847
  } else if (isArray$1(value)) {
@@ -6875,7 +6878,7 @@
6875
6878
  processor: value => {
6876
6879
  const valid = isString(value) || isArrayOf(value, isString);
6877
6880
  if (valid) {
6878
- const newValue = isArray$1(value) ? value : map$3(value.split(','), trim$3);
6881
+ const newValue = isArray$1(value) ? value : map$3(value.split(','), trim$4);
6879
6882
  return {
6880
6883
  value: newValue,
6881
6884
  valid
@@ -7455,7 +7458,7 @@
7455
7458
  }
7456
7459
  };
7457
7460
  const trimCount = text => {
7458
- const trimmedText = trim$1(text);
7461
+ const trimmedText = trim$2(text);
7459
7462
  return {
7460
7463
  count: text.length - trimmedText.length,
7461
7464
  text: trimmedText
@@ -11165,85 +11168,51 @@
11165
11168
  }
11166
11169
  }
11167
11170
 
11168
- const isConditionalComment = (html, startIndex) => /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(html.substr(startIndex));
11169
- const findCommentEndIndex = (html, isBogus, startIndex = 0) => {
11170
- const lcHtml = html.toLowerCase();
11171
- if (lcHtml.indexOf('[if ', startIndex) !== -1 && isConditionalComment(lcHtml, startIndex)) {
11172
- const endIfIndex = lcHtml.indexOf('[endif]', startIndex);
11173
- return lcHtml.indexOf('>', endIfIndex);
11174
- } else {
11175
- if (isBogus) {
11176
- const endIndex = lcHtml.indexOf('>', startIndex);
11177
- return endIndex !== -1 ? endIndex : lcHtml.length;
11171
+ const getTemporaryNodeSelector = tempAttrs => `${ tempAttrs.length === 0 ? '' : `${ map$3(tempAttrs, attr => `[${ attr }]`).join(',') },` }[data-mce-bogus="all"]`;
11172
+ const getTemporaryNodes = (body, tempAttrs) => body.querySelectorAll(getTemporaryNodeSelector(tempAttrs));
11173
+ const createCommentWalker = body => document.createTreeWalker(body, NodeFilter.SHOW_COMMENT, null);
11174
+ const hasComments = body => createCommentWalker(body).nextNode() !== null;
11175
+ const hasTemporaryNodes = (body, tempAttrs) => body.querySelector(getTemporaryNodeSelector(tempAttrs)) !== null;
11176
+ const trimTemporaryNodes = (body, tempAttrs) => {
11177
+ each$e(getTemporaryNodes(body, tempAttrs), elm => {
11178
+ const element = SugarElement.fromDom(elm);
11179
+ if (get$9(element, 'data-mce-bogus') === 'all') {
11180
+ remove$5(element);
11178
11181
  } else {
11179
- const endCommentRegexp = /--!?>/g;
11180
- endCommentRegexp.lastIndex = startIndex;
11181
- const match = endCommentRegexp.exec(html);
11182
- return match ? match.index + match[0].length : lcHtml.length;
11182
+ each$e(tempAttrs, attr => {
11183
+ if (has$1(element, attr)) {
11184
+ remove$a(element, attr);
11185
+ }
11186
+ });
11183
11187
  }
11184
- }
11188
+ });
11185
11189
  };
11186
- const findMatchingEndTagIndex = (schema, html, startIndex) => {
11187
- const startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
11188
- const endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
11189
- const voidElements = schema.getVoidElements();
11190
- let count = 1, index = startIndex;
11191
- while (count !== 0) {
11192
- startTagRegExp.lastIndex = index;
11193
- while (true) {
11194
- const startMatch = startTagRegExp.exec(html);
11195
- if (startMatch === null) {
11196
- return index;
11197
- } else if (startMatch[1] === '!') {
11198
- if (startsWith(startMatch[2], '--')) {
11199
- index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
11200
- } else {
11201
- index = findCommentEndIndex(html, true, startMatch.index + 1);
11202
- }
11203
- break;
11204
- } else {
11205
- endTagRegExp.lastIndex = startTagRegExp.lastIndex;
11206
- const endMatch = endTagRegExp.exec(html);
11207
- if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
11208
- continue;
11209
- }
11210
- if (startMatch[1] === '/') {
11211
- count -= 1;
11212
- } else if (!has$2(voidElements, startMatch[2])) {
11213
- count += 1;
11214
- }
11215
- index = startTagRegExp.lastIndex + endMatch[0].length;
11216
- break;
11217
- }
11190
+ const removeCommentsContainingZwsp = body => {
11191
+ const walker = createCommentWalker(body);
11192
+ let nextNode = walker.nextNode();
11193
+ while (nextNode !== null) {
11194
+ const comment = walker.currentNode;
11195
+ nextNode = walker.nextNode();
11196
+ if (isString(comment.nodeValue) && comment.nodeValue.includes(ZWSP$1)) {
11197
+ remove$5(SugarElement.fromDom(comment));
11218
11198
  }
11219
11199
  }
11220
- return index;
11221
- };
11222
- const trimHtml$1 = (tempAttrs, html) => {
11223
- const trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi');
11224
- return html.replace(trimContentRegExp, '');
11225
11200
  };
11226
- const trimInternal = (serializer, html) => {
11227
- const bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
11228
- const schema = serializer.schema;
11229
- let content = trimHtml$1(serializer.getTempAttrs(), html);
11230
- const voidElements = schema.getVoidElements();
11231
- let matches;
11232
- while (matches = bogusAllRegExp.exec(content)) {
11233
- const index = bogusAllRegExp.lastIndex;
11234
- const matchLength = matches[0].length;
11235
- let endTagIndex;
11236
- if (voidElements[matches[1]]) {
11237
- endTagIndex = index;
11238
- } else {
11239
- endTagIndex = findMatchingEndTagIndex(schema, content, index);
11201
+ const deepClone = body => body.cloneNode(true);
11202
+ const trim$1 = (body, tempAttrs) => {
11203
+ let trimmed = body;
11204
+ if (hasComments(body)) {
11205
+ trimmed = deepClone(body);
11206
+ removeCommentsContainingZwsp(trimmed);
11207
+ if (hasTemporaryNodes(trimmed, tempAttrs)) {
11208
+ trimTemporaryNodes(trimmed, tempAttrs);
11240
11209
  }
11241
- content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
11242
- bogusAllRegExp.lastIndex = index - matchLength;
11210
+ } else if (hasTemporaryNodes(body, tempAttrs)) {
11211
+ trimmed = deepClone(body);
11212
+ trimTemporaryNodes(trimmed, tempAttrs);
11243
11213
  }
11244
- return trim$1(content);
11214
+ return trimmed;
11245
11215
  };
11246
- const trimExternal = trimInternal;
11247
11216
 
11248
11217
  const cleanupBogusElements = parent => {
11249
11218
  const bogusElements = descendants(parent, '[data-mce-bogus]');
@@ -11286,14 +11255,14 @@
11286
11255
  cleanupInputNames(offscreenDiv);
11287
11256
  const root = getContentContainer(dos);
11288
11257
  append$1(root, offscreenDiv);
11289
- const content = trim$1(offscreenDiv.dom.innerText);
11258
+ const content = trim$2(offscreenDiv.dom.innerText);
11290
11259
  remove$5(offscreenDiv);
11291
11260
  return content;
11292
11261
  };
11293
11262
  const getContentFromBody = (editor, args, body) => {
11294
11263
  let content;
11295
11264
  if (args.format === 'raw') {
11296
- content = Tools.trim(trimExternal(editor.serializer, body.innerHTML));
11265
+ content = Tools.trim(trim$2(trim$1(body, editor.serializer.getTempAttrs()).innerHTML));
11297
11266
  } else if (args.format === 'text') {
11298
11267
  content = getPlainTextContent(editor, body);
11299
11268
  } else if (args.format === 'tree') {
@@ -17477,7 +17446,7 @@
17477
17446
 
17478
17447
  const isCollapsibleWhitespace = (text, index) => index >= 0 && index < text.length && isWhiteSpace(text.charAt(index));
17479
17448
  const getInnerText = bin => {
17480
- return trim$1(bin.innerText);
17449
+ return trim$2(bin.innerText);
17481
17450
  };
17482
17451
  const getContextNodeName = parentBlockOpt => parentBlockOpt.map(block => block.nodeName).getOr('div').toLowerCase();
17483
17452
  const getTextContent = editor => Optional.from(editor.selection.getRng()).map(rng => {
@@ -17493,7 +17462,7 @@
17493
17462
  'style': 'overflow: hidden; opacity: 0;'
17494
17463
  }, rangeContentClone.dom);
17495
17464
  const text = getInnerText(bin);
17496
- const nonRenderedText = trim$1((_a = bin.textContent) !== null && _a !== void 0 ? _a : '');
17465
+ const nonRenderedText = trim$2((_a = bin.textContent) !== null && _a !== void 0 ? _a : '');
17497
17466
  editor.dom.remove(bin);
17498
17467
  if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) {
17499
17468
  const parentBlock = parentBlockOpt.getOr(body);
@@ -17715,11 +17684,9 @@
17715
17684
  }
17716
17685
  });
17717
17686
  };
17718
- const read$2 = elm => {
17719
- return filter$5(map$3(from(elm.childNodes), getOuterHtml), item => {
17720
- return item.length > 0;
17721
- });
17722
- };
17687
+ const read$2 = (elm, trimZwsp) => filter$5(map$3(from(elm.childNodes), trimZwsp ? compose(trim$2, getOuterHtml) : getOuterHtml), item => {
17688
+ return item.length > 0;
17689
+ });
17723
17690
  const write = (fragments, elm) => {
17724
17691
  const currentFragments = map$3(from(elm.childNodes), getOuterHtml);
17725
17692
  applyDiff(diff(currentFragments, fragments), elm);
@@ -17727,9 +17694,7 @@
17727
17694
  };
17728
17695
 
17729
17696
  const lazyTempDocument = cached(() => document.implementation.createHTMLDocument('undo'));
17730
- const hasIframes = html => {
17731
- return html.indexOf('</iframe>') !== -1;
17732
- };
17697
+ const hasIframes = body => body.querySelector('iframe') !== null;
17733
17698
  const createFragmentedLevel = fragments => {
17734
17699
  return {
17735
17700
  type: 'fragmented',
@@ -17749,13 +17714,9 @@
17749
17714
  };
17750
17715
  };
17751
17716
  const createFromEditor = editor => {
17752
- const fragments = read$2(editor.getBody());
17753
- const trimmedFragments = bind$3(fragments, html => {
17754
- const trimmed = trimInternal(editor.serializer, html);
17755
- return trimmed.length > 0 ? [trimmed] : [];
17756
- });
17757
- const content = trimmedFragments.join('');
17758
- return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content);
17717
+ const tempAttrs = editor.serializer.getTempAttrs();
17718
+ const body = trim$1(editor.getBody(), tempAttrs);
17719
+ return hasIframes(body) ? createFragmentedLevel(read$2(body, true)) : createCompleteLevel(trim$2(body.innerHTML));
17759
17720
  };
17760
17721
  const applyToEditor = (editor, level, before) => {
17761
17722
  const bookmark = before ? level.beforeBookmark : level.bookmark;
@@ -18812,7 +18773,7 @@
18812
18773
  }
18813
18774
  };
18814
18775
  const getHtmlFromNode = (dom, node, args) => {
18815
- const html = trim$1(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
18776
+ const html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
18816
18777
  return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html);
18817
18778
  };
18818
18779
  const parseHtml = (htmlParser, html, args) => {
@@ -23075,7 +23036,7 @@
23075
23036
  };
23076
23037
 
23077
23038
  const isValidTextRange = rng => rng.collapsed && isText$a(rng.startContainer);
23078
- const getText = rng => trim$1(rng.toString().replace(/\u00A0/g, ' '));
23039
+ const getText = rng => trim$2(rng.toString().replace(/\u00A0/g, ' '));
23079
23040
  const isWhitespace = chr => chr !== '' && ' \xA0\f\n\r\t\x0B'.indexOf(chr) !== -1;
23080
23041
 
23081
23042
  const stripTrigger = (text, trigger) => text.substring(trigger.length);
@@ -24377,7 +24338,7 @@
24377
24338
  const trimZwsp = fragment => {
24378
24339
  each$e(descendants$1(SugarElement.fromDom(fragment), isText$b), text => {
24379
24340
  const rawNode = text.dom;
24380
- rawNode.nodeValue = trim$1(rawNode.data);
24341
+ rawNode.nodeValue = trim$2(rawNode.data);
24381
24342
  });
24382
24343
  };
24383
24344
  const isWithinNonEditableList = (editor, node) => {
@@ -28933,7 +28894,7 @@
28933
28894
  return [];
28934
28895
  } else {
28935
28896
  const pluginNames = isArray$1(plugins) ? plugins : plugins.split(/[ ,]/);
28936
- const trimmedPlugins = map$3(pluginNames, trim$3);
28897
+ const trimmedPlugins = map$3(pluginNames, trim$4);
28937
28898
  return filter$5(trimmedPlugins, isNotEmpty);
28938
28899
  }
28939
28900
  };
@@ -30914,8 +30875,8 @@
30914
30875
  documentBaseURL: null,
30915
30876
  suffix: null,
30916
30877
  majorVersion: '6',
30917
- minorVersion: '7.0',
30918
- releaseDate: '2023-08-30',
30878
+ minorVersion: '7.2',
30879
+ releaseDate: '2023-10-25',
30919
30880
  i18n: I18n,
30920
30881
  activeEditor: null,
30921
30882
  focusedEditor: null,
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "6.7.0"
4
- TINYMCE_VERSION = "6.7.0"
3
+ VERSION = "6.7.2"
4
+ TINYMCE_VERSION = "6.7.2"
5
5
  end
6
6
  end