tinymce-rails 7.6.1 → 7.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +91 -74
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/models/dom/model.js +2 -2
  5. data/vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js +2 -2
  6. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +2 -2
  8. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -2
  9. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -2
  10. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +2 -2
  11. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +2 -2
  12. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
  14. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +2 -2
  15. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
  16. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
  17. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
  18. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
  19. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +2 -2
  20. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
  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 +2 -2
  27. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +2 -2
  28. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -2
  29. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
  30. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  31. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +2 -2
  32. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +2 -2
  33. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -2
  34. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +3 -1
  35. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +3 -1
  36. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.js +1 -1
  37. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +3 -1
  38. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.js +1 -1
  39. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +3 -1
  40. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  41. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.js +1 -1
  42. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  43. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +3 -1
  44. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +3 -1
  45. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +3 -1
  47. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.js +1 -1
  48. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +3 -1
  49. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  50. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.js +1 -1
  51. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  52. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.css +3 -1
  53. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.css +3 -1
  54. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.js +1 -1
  55. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.min.css +3 -1
  56. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.js +1 -1
  57. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.min.css +3 -1
  58. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -1
  59. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.js +1 -1
  60. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  61. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.css +3 -1
  62. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.css +3 -1
  63. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -1
  64. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +3 -1
  65. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.js +1 -1
  66. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.min.css +3 -1
  67. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -1
  68. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -1
  69. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  70. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +69 -69
  71. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +127 -127
  72. data/vendor/assets/javascripts/tinymce/tinymce.js +3 -3
  73. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 108a2e3d66785771c3e2040f691f1781db4023556c698a4e1019344449f9fba3
4
- data.tar.gz: d1e5a7b68e1491d54327ad2a68082ed5910242314942ff6d28358045f6cf415c
3
+ metadata.gz: 7466b9263f71c8bf26b42f49bed34814bab1766c14134c319ac65118863ff8f6
4
+ data.tar.gz: b756d96a935a5ceab211ccc5d4777a62fd5094ff55126d63ab41f5aff4f430e9
5
5
  SHA512:
6
- metadata.gz: c4a38667622760437f895456ffedef16520e6a52664f2d51665ed4dcc3ce48f39e4f9527d1b01f84a0dfbb381af4f272df8524e3b639c50c6c2bd2d79b0c7d9d
7
- data.tar.gz: 97f452f65cb6416aa2f5baf7ec2d5cb7b46ce7d706b05bdeb58b3208aefa7bc570aa1840d44314c2018e9929d2f86397920f73abfd9682415c43f6e85763bb65
6
+ metadata.gz: 0bc72a704bbf315f70b2b12c6e2e85dee0b0d9e95d4d5dfc82345a2580904e40dba2af1f3248e74ff511af10d618240b107ac2cea32205dab4442e0de7b4d80a
7
+ data.tar.gz: 990d704b28c0cb6cb131f1fefdf1d20763dbad39388892a13154d2ce9986fa8ec347ab511f6428ea92f2047b32f1280c437bb4582fab75d9e5ef89922b3720d2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 7.6.1 (2025-01-22)
2
+ * TinyMCE version 7.7.0 (TBD)
3
3
  */
4
4
 
5
5
  (function () {
@@ -1999,6 +1999,7 @@
1999
1999
  const isImg = matchNodeName('img');
2000
2000
  const isContentEditableTrue$3 = hasContentEditableState('true');
2001
2001
  const isContentEditableFalse$b = hasContentEditableState('false');
2002
+ const isEditingHost = node => isHTMLElement(node) && node.isContentEditable && isNonNullable(node.parentElement) && !node.parentElement.isContentEditable;
2002
2003
  const isTableCell$3 = matchNodeNames([
2003
2004
  'td',
2004
2005
  'th'
@@ -4067,7 +4068,7 @@
4067
4068
  delete this.events[id];
4068
4069
  try {
4069
4070
  delete target[this.expando];
4070
- } catch (ex) {
4071
+ } catch (_a) {
4071
4072
  target[this.expando] = null;
4072
4073
  }
4073
4074
  }
@@ -7364,7 +7365,7 @@
7364
7365
  });
7365
7366
  registerOption('iframe_aria_text', {
7366
7367
  processor: 'string',
7367
- default: 'Rich Text Area. Press ALT-0 for help.'
7368
+ default: 'Rich Text Area'.concat(editor.hasPlugin('help') ? '. Press ALT-0 for help.' : '')
7368
7369
  });
7369
7370
  registerOption('setup', { processor: 'function' });
7370
7371
  registerOption('init_instance_callback', { processor: 'function' });
@@ -8076,8 +8077,8 @@
8076
8077
  const isElement$2 = isElement$6;
8077
8078
  const isText$4 = isText$b;
8078
8079
  const isCaretCandidate$1 = isCaretCandidate$3;
8079
- const isForwards = direction => direction > 0;
8080
- const isBackwards = direction => direction < 0;
8080
+ const isForwards = direction => direction === 1;
8081
+ const isBackwards = direction => direction === -1;
8081
8082
  const skipCaretContainers = (walk, shallow) => {
8082
8083
  let node;
8083
8084
  while (node = walk(shallow)) {
@@ -8290,11 +8291,6 @@
8290
8291
  return inSameBlock;
8291
8292
  };
8292
8293
 
8293
- var HDirection;
8294
- (function (HDirection) {
8295
- HDirection[HDirection['Backwards'] = -1] = 'Backwards';
8296
- HDirection[HDirection['Forwards'] = 1] = 'Forwards';
8297
- }(HDirection || (HDirection = {})));
8298
8294
  const isContentEditableFalse$6 = isContentEditableFalse$b;
8299
8295
  const isText$3 = isText$b;
8300
8296
  const isElement$1 = isElement$6;
@@ -8351,7 +8347,7 @@
8351
8347
  return CaretPosition.before(nextSibling);
8352
8348
  }
8353
8349
  } else {
8354
- return findCaretPosition$1(HDirection.Forwards, CaretPosition.after(nextNode), root);
8350
+ return findCaretPosition$1(1, CaretPosition.after(nextNode), root);
8355
8351
  }
8356
8352
  };
8357
8353
  const findCaretPosition$1 = (direction, startPos, root) => {
@@ -8445,10 +8441,10 @@
8445
8441
  };
8446
8442
  const CaretWalker = root => ({
8447
8443
  next: caretPosition => {
8448
- return findCaretPosition$1(HDirection.Forwards, caretPosition, root);
8444
+ return findCaretPosition$1(1, caretPosition, root);
8449
8445
  },
8450
8446
  prev: caretPosition => {
8451
- return findCaretPosition$1(HDirection.Backwards, caretPosition, root);
8447
+ return findCaretPosition$1(-1, caretPosition, root);
8452
8448
  }
8453
8449
  });
8454
8450
 
@@ -9121,7 +9117,8 @@
9121
9117
  const findContent = (start, node, offset) => walkText(start, node, offset, isContent);
9122
9118
  const findWordEndPoint = (dom, body, container, offset, start, includeTrailingSpaces) => {
9123
9119
  let lastTextNode;
9124
- const rootNode = dom.getParent(container, dom.isBlock) || body;
9120
+ const closestRoot = dom.getParent(container, node => isEditingHost(node) || dom.isBlock(node));
9121
+ const rootNode = isNonNullable(closestRoot) ? closestRoot : body;
9125
9122
  const walk = (container, offset, pred) => {
9126
9123
  const textSeeker = TextSeeker(dom);
9127
9124
  const walker = start ? textSeeker.backwards : textSeeker.forwards;
@@ -9195,7 +9192,7 @@
9195
9192
  return isAtBlockBoundary$1(dom, root, parent, siblingName);
9196
9193
  }
9197
9194
  };
9198
- const findParentContainer = (dom, formatList, container, offset, start) => {
9195
+ const findParentContainer = (dom, formatList, container, offset, start, expandToBlock) => {
9199
9196
  let parent = container;
9200
9197
  const siblingName = start ? 'previousSibling' : 'nextSibling';
9201
9198
  const root = dom.getRoot();
@@ -9205,8 +9202,11 @@
9205
9202
  }
9206
9203
  }
9207
9204
  while (parent) {
9205
+ if (isEditingHost(parent)) {
9206
+ return container;
9207
+ }
9208
9208
  if (!formatList[0].block_expand && dom.isBlock(parent)) {
9209
- return parent;
9209
+ return expandToBlock ? parent : container;
9210
9210
  }
9211
9211
  for (let sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
9212
9212
  const allowSpaces = isText$b(sibling) && !isAtBlockBoundary$1(dom, root, sibling, siblingName);
@@ -9223,7 +9223,10 @@
9223
9223
  return container;
9224
9224
  };
9225
9225
  const isSelfOrParentBookmark = container => isBookmarkNode(container.parentNode) || isBookmarkNode(container);
9226
- const expandRng = (dom, rng, formatList, includeTrailingSpace = false) => {
9226
+ const expandRng = (dom, rng, formatList, expandOptions = {}) => {
9227
+ const {includeTrailingSpace = false, expandToBlock = true} = expandOptions;
9228
+ const editableHost = dom.getParent(rng.commonAncestorContainer, node => isEditingHost(node));
9229
+ const root = isNonNullable(editableHost) ? editableHost : dom.getRoot();
9227
9230
  let {startContainer, startOffset, endContainer, endOffset} = rng;
9228
9231
  const format = formatList[0];
9229
9232
  if (isElement$6(startContainer) && startContainer.hasChildNodes()) {
@@ -9263,12 +9266,12 @@
9263
9266
  }
9264
9267
  }
9265
9268
  if (rng.collapsed) {
9266
- const startPoint = findWordEndPoint(dom, dom.getRoot(), startContainer, startOffset, true, includeTrailingSpace);
9269
+ const startPoint = findWordEndPoint(dom, root, startContainer, startOffset, true, includeTrailingSpace);
9267
9270
  startPoint.each(({container, offset}) => {
9268
9271
  startContainer = container;
9269
9272
  startOffset = offset;
9270
9273
  });
9271
- const endPoint = findWordEndPoint(dom, dom.getRoot(), endContainer, endOffset, false, includeTrailingSpace);
9274
+ const endPoint = findWordEndPoint(dom, root, endContainer, endOffset, false, includeTrailingSpace);
9272
9275
  endPoint.each(({container, offset}) => {
9273
9276
  endContainer = container;
9274
9277
  endOffset = offset;
@@ -9276,10 +9279,10 @@
9276
9279
  }
9277
9280
  if (isInlineFormat(format) || format.block_expand) {
9278
9281
  if (!isInlineFormat(format) || (!isText$b(startContainer) || startOffset === 0)) {
9279
- startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true);
9282
+ startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true, expandToBlock);
9280
9283
  }
9281
9284
  if (!isInlineFormat(format) || (!isText$b(endContainer) || endOffset === endContainer.data.length)) {
9282
- endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false);
9285
+ endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false, expandToBlock);
9283
9286
  }
9284
9287
  }
9285
9288
  if (shouldExpandToSelector(format)) {
@@ -9291,13 +9294,13 @@
9291
9294
  endContainer = findBlockEndPoint(dom, formatList, endContainer, 'nextSibling');
9292
9295
  if (isBlockFormat(format)) {
9293
9296
  if (!dom.isBlock(startContainer)) {
9294
- startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true);
9297
+ startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true, expandToBlock);
9295
9298
  if (isText$b(startContainer)) {
9296
9299
  startOffset = 0;
9297
9300
  }
9298
9301
  }
9299
9302
  if (!dom.isBlock(endContainer)) {
9300
- endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false);
9303
+ endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false, expandToBlock);
9301
9304
  if (isText$b(endContainer)) {
9302
9305
  endOffset = endContainer.data.length;
9303
9306
  }
@@ -9690,7 +9693,7 @@
9690
9693
  rng.setStart(bookmark.start.dom, bookmark.soffset);
9691
9694
  rng.setEnd(bookmark.finish.dom, bookmark.foffset);
9692
9695
  return Optional.some(rng);
9693
- } catch (_) {
9696
+ } catch (_a) {
9694
9697
  return Optional.none();
9695
9698
  }
9696
9699
  };
@@ -9808,7 +9811,7 @@
9808
9811
  try {
9809
9812
  const root = getRootNode(SugarElement.fromDom(editor.getElement()));
9810
9813
  return active$1(root).fold(() => document.body, x => x.dom);
9811
- } catch (ex) {
9814
+ } catch (_a) {
9812
9815
  return document.body;
9813
9816
  }
9814
9817
  };
@@ -9903,7 +9906,7 @@
9903
9906
  if (body.setActive) {
9904
9907
  try {
9905
9908
  body.setActive();
9906
- } catch (ex) {
9909
+ } catch (_a) {
9907
9910
  body.focus();
9908
9911
  }
9909
9912
  } else {
@@ -10033,7 +10036,7 @@
10033
10036
  const rootDocument = document;
10034
10037
  const rootElement = editor.getBody();
10035
10038
  let selectedElm, selectedElmGhost, resizeHelper, selectedHandle, resizeBackdrop;
10036
- let startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
10039
+ let startX, startY, startW, startH, ratio, resizeStarted;
10037
10040
  let width;
10038
10041
  let height;
10039
10042
  let startScrollWidth;
@@ -10150,12 +10153,6 @@
10150
10153
  display: 'block'
10151
10154
  });
10152
10155
  resizeHelper.innerHTML = width + ' &times; ' + height;
10153
- if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
10154
- dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
10155
- }
10156
- if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
10157
- dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
10158
- }
10159
10156
  deltaX = rootElement.scrollWidth - startScrollWidth;
10160
10157
  deltaY = rootElement.scrollHeight - startScrollHeight;
10161
10158
  if (deltaX + deltaY !== 0) {
@@ -10331,7 +10328,7 @@
10331
10328
  const disableGeckoResize = () => {
10332
10329
  try {
10333
10330
  editor.getDoc().execCommand('enableObjectResizing', false, 'false');
10334
- } catch (ex) {
10331
+ } catch (_a) {
10335
10332
  }
10336
10333
  };
10337
10334
  editor.on('init', () => {
@@ -10792,7 +10789,10 @@
10792
10789
  };
10793
10790
  const expand = (rng, options = { type: 'word' }) => {
10794
10791
  if (options.type === 'word') {
10795
- const rangeLike = expandRng(dom, rng, [{ inline: 'span' }]);
10792
+ const rangeLike = expandRng(dom, rng, [{ inline: 'span' }], {
10793
+ includeTrailingSpace: false,
10794
+ expandToBlock: false
10795
+ });
10796
10796
  const newRange = dom.createRng();
10797
10797
  newRange.setStart(rangeLike.startContainer, rangeLike.startOffset);
10798
10798
  newRange.setEnd(rangeLike.endContainer, rangeLike.endOffset);
@@ -13095,14 +13095,20 @@
13095
13095
  return false;
13096
13096
  }
13097
13097
  };
13098
+ const isEditableEmptyBlock = (dom, node) => {
13099
+ if (dom.isBlock(node) && dom.isEditable(node)) {
13100
+ const childNodes = node.childNodes;
13101
+ return childNodes.length === 1 && isBr$6(childNodes[0]) || childNodes.length === 0;
13102
+ } else {
13103
+ return false;
13104
+ }
13105
+ };
13098
13106
  const validInsertion = (editor, value, parentNode) => {
13099
13107
  var _a;
13100
13108
  if (parentNode.getAttribute('data-mce-bogus') === 'all') {
13101
13109
  (_a = parentNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(editor.dom.createFragment(value), parentNode);
13102
13110
  } else {
13103
- const node = parentNode.firstChild;
13104
- const node2 = parentNode.lastChild;
13105
- if (!node || node === node2 && node.nodeName === 'BR') {
13111
+ if (isEditableEmptyBlock(editor.dom, parentNode)) {
13106
13112
  editor.dom.setHTML(parentNode, value);
13107
13113
  } else {
13108
13114
  editor.selection.setContent(value, { no_events: true });
@@ -13809,7 +13815,7 @@
13809
13815
  if (hasContentAfter) {
13810
13816
  const bookmark = selection.getBookmark();
13811
13817
  rng.collapse(true);
13812
- let expandedRng = expandRng(dom, rng, formatList, true);
13818
+ let expandedRng = expandRng(dom, rng, formatList, { includeTrailingSpace: true });
13813
13819
  expandedRng = split(expandedRng);
13814
13820
  editor.formatter.remove(name, vars, expandedRng, similar);
13815
13821
  selection.moveToBookmark(bookmark);
@@ -14371,7 +14377,7 @@
14371
14377
  const removeRngStyle = rng => {
14372
14378
  let startContainer;
14373
14379
  let endContainer;
14374
- let expandedRng = expandRng(dom, rng, formatList, rng.collapsed);
14380
+ let expandedRng = expandRng(dom, rng, formatList, { includeTrailingSpace: rng.collapsed });
14375
14381
  if (format.split) {
14376
14382
  expandedRng = split(expandedRng);
14377
14383
  startContainer = getContainer(ed, expandedRng, true);
@@ -15056,7 +15062,7 @@
15056
15062
  if (base64Encoded) {
15057
15063
  try {
15058
15064
  str = atob(data);
15059
- } catch (e) {
15065
+ } catch (_a) {
15060
15066
  return Optional.none();
15061
15067
  }
15062
15068
  }
@@ -16901,7 +16907,7 @@
16901
16907
  const decodeUri = encodedUri => {
16902
16908
  try {
16903
16909
  return decodeURIComponent(encodedUri);
16904
- } catch (ex) {
16910
+ } catch (_a) {
16905
16911
  return unescape(encodedUri);
16906
16912
  }
16907
16913
  };
@@ -17334,14 +17340,23 @@
17334
17340
  USE_PROFILES: { mathMl: true }
17335
17341
  };
17336
17342
  const purify$1 = purify();
17343
+ const allowedEncodings = settings.allow_mathml_annotation_encodings;
17344
+ const hasAllowedEncodings = isArray$1(allowedEncodings) && allowedEncodings.length > 0;
17345
+ const hasValidEncoding = el => {
17346
+ const encoding = el.getAttribute('encoding');
17347
+ return hasAllowedEncodings && isString(encoding) && contains$2(allowedEncodings, encoding);
17348
+ };
17337
17349
  purify$1.addHook('uponSanitizeElement', (node, evt) => {
17338
17350
  var _a;
17339
17351
  const lcTagName = (_a = evt.tagName) !== null && _a !== void 0 ? _a : node.nodeName.toLowerCase();
17340
- const allowedEncodings = settings.allow_mathml_annotation_encodings;
17341
- if (lcTagName === 'annotation' && isArray$1(allowedEncodings) && allowedEncodings.length > 0) {
17342
- const encoding = node.getAttribute('encoding');
17343
- if (isString(encoding) && contains$2(allowedEncodings, encoding)) {
17344
- evt.allowedTags[lcTagName] = true;
17352
+ if (hasAllowedEncodings && lcTagName === 'semantics') {
17353
+ evt.allowedTags[lcTagName] = true;
17354
+ }
17355
+ if (lcTagName === 'annotation') {
17356
+ const keepElement = hasValidEncoding(node);
17357
+ evt.allowedTags[lcTagName] = keepElement;
17358
+ if (!keepElement) {
17359
+ node.remove();
17345
17360
  }
17346
17361
  }
17347
17362
  });
@@ -18857,7 +18872,7 @@
18857
18872
  const tryCompareBoundaryPoints = (how, sourceRange, destinationRange) => {
18858
18873
  try {
18859
18874
  return sourceRange.compareBoundaryPoints(how, destinationRange);
18860
- } catch (ex) {
18875
+ } catch (_a) {
18861
18876
  return -1;
18862
18877
  }
18863
18878
  };
@@ -18878,7 +18893,7 @@
18878
18893
  }
18879
18894
  rng = processRanges(editor, [rng])[0];
18880
18895
  }
18881
- } catch (ex) {
18896
+ } catch (_a) {
18882
18897
  }
18883
18898
  if (!rng) {
18884
18899
  rng = doc.createRange();
@@ -18913,7 +18928,7 @@
18913
18928
  try {
18914
18929
  sel.removeAllRanges();
18915
18930
  sel.addRange(rng);
18916
- } catch (ex) {
18931
+ } catch (_a) {
18917
18932
  }
18918
18933
  if (forward === false && sel.extend) {
18919
18934
  sel.collapse(rng.endContainer, rng.endOffset);
@@ -18959,7 +18974,7 @@
18959
18974
  anchorRange.collapse(true);
18960
18975
  focusRange.setStart(focusNode, sel.focusOffset);
18961
18976
  focusRange.collapse(true);
18962
- } catch (e) {
18977
+ } catch (_a) {
18963
18978
  return true;
18964
18979
  }
18965
18980
  return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
@@ -19878,7 +19893,7 @@
19878
19893
  const setEditorCommandState = (editor, cmd, state) => {
19879
19894
  try {
19880
19895
  editor.getDoc().execCommand(cmd, false, String(state));
19881
- } catch (ex) {
19896
+ } catch (_a) {
19882
19897
  }
19883
19898
  };
19884
19899
  const setCommonEditorCommands = (editor, state) => {
@@ -21790,7 +21805,7 @@
21790
21805
  if (!isText$b(range.commonAncestorContainer)) {
21791
21806
  return Optional.none();
21792
21807
  }
21793
- const direction = forward ? HDirection.Forwards : HDirection.Backwards;
21808
+ const direction = forward ? 1 : -1;
21794
21809
  const caretWalker = CaretWalker(editor.getBody());
21795
21810
  const getNextPosFn = curry(getVisualCaretPosition, forward ? caretWalker.next : caretWalker.prev);
21796
21811
  const isBeforeFn = forward ? isBeforeBoundary : isAfterBoundary;
@@ -22280,10 +22295,10 @@
22280
22295
  BreakType[BreakType['Wrap'] = 2] = 'Wrap';
22281
22296
  BreakType[BreakType['Eol'] = 3] = 'Eol';
22282
22297
  }(BreakType || (BreakType = {})));
22283
- const flip = (direction, positions) => direction === HDirection.Backwards ? reverse(positions) : positions;
22284
- const walk$1 = (direction, caretWalker, pos) => direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos);
22298
+ const flip = (direction, positions) => direction === -1 ? reverse(positions) : positions;
22299
+ const walk$1 = (direction, caretWalker, pos) => direction === 1 ? caretWalker.next(pos) : caretWalker.prev(pos);
22285
22300
  const getBreakType = (scope, direction, currentPos, nextPos) => {
22286
- if (isBr$6(nextPos.getNode(direction === HDirection.Forwards))) {
22301
+ if (isBr$6(nextPos.getNode(direction === 1))) {
22287
22302
  return BreakType.Br;
22288
22303
  } else if (isInSameBlock(currentPos, nextPos) === false) {
22289
22304
  return BreakType.Block;
@@ -22301,7 +22316,7 @@
22301
22316
  break;
22302
22317
  }
22303
22318
  if (isBr$6(nextPos.getNode(false))) {
22304
- if (direction === HDirection.Forwards) {
22319
+ if (direction === 1) {
22305
22320
  return {
22306
22321
  positions: flip(direction, positions).concat([nextPos]),
22307
22322
  breakType: BreakType.Br,
@@ -22338,7 +22353,7 @@
22338
22353
  };
22339
22354
  const getAdjacentLinePositions = (direction, getPositionsUntilBreak, scope, start) => getPositionsUntilBreak(scope, start).breakAt.map(pos => {
22340
22355
  const positions = getPositionsUntilBreak(scope, pos).positions;
22341
- return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions);
22356
+ return direction === -1 ? positions.concat(pos) : [pos].concat(positions);
22342
22357
  }).getOr([]);
22343
22358
  const findClosestHorizontalPositionFromPoint = (positions, x) => foldl(positions, (acc, newPos) => acc.fold(() => Optional.some(newPos), lastPos => lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), (lastRect, newRect) => {
22344
22359
  const lastDist = Math.abs(x - lastRect.left);
@@ -22412,7 +22427,7 @@
22412
22427
  const result = [];
22413
22428
  const add = node => {
22414
22429
  let clientRects = getClientRects([node]);
22415
- if (direction === -1) {
22430
+ if (direction === VDirection.Up) {
22416
22431
  clientRects = clientRects.reverse();
22417
22432
  }
22418
22433
  for (let i = 0; i < clientRects.length; i++) {
@@ -22457,7 +22472,7 @@
22457
22472
  let caretPosition;
22458
22473
  const result = [];
22459
22474
  let line = 0;
22460
- if (direction === 1) {
22475
+ if (direction === VDirection.Down) {
22461
22476
  walkFn = caretWalker.next;
22462
22477
  isBelowFn = isBelow$1;
22463
22478
  isAboveFn = isAbove$1;
@@ -22499,17 +22514,17 @@
22499
22514
  };
22500
22515
  const renderRangeCaretOpt = (editor, range, scrollIntoView) => Optional.some(renderRangeCaret(editor, range, scrollIntoView));
22501
22516
  const moveHorizontally = (editor, direction, range, isBefore, isAfter, isElement) => {
22502
- const forwards = direction === HDirection.Forwards;
22517
+ const forwards = direction === 1;
22503
22518
  const caretWalker = CaretWalker(editor.getBody());
22504
22519
  const getNextPosFn = curry(getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev);
22505
22520
  const isBeforeFn = forwards ? isBefore : isAfter;
22506
22521
  if (!range.collapsed) {
22507
22522
  const node = getSelectedNode(range);
22508
22523
  if (isElement(node)) {
22509
- return showCaret(direction, editor, node, direction === HDirection.Backwards, false);
22524
+ return showCaret(direction, editor, node, direction === -1, false);
22510
22525
  } else if (isCefAtEdgeSelected(editor)) {
22511
22526
  const newRange = range.cloneRange();
22512
- newRange.collapse(direction === HDirection.Backwards);
22527
+ newRange.collapse(direction === -1);
22513
22528
  return Optional.from(newRange);
22514
22529
  }
22515
22530
  }
@@ -22875,7 +22890,7 @@
22875
22890
  };
22876
22891
  const deleteCaret = (editor, forward) => {
22877
22892
  const isNearMedia = forward ? isBeforeMedia : isAfterMedia;
22878
- const direction = forward ? HDirection.Forwards : HDirection.Backwards;
22893
+ const direction = forward ? 1 : -1;
22879
22894
  const fromPos = getNormalizedRangeEndPoint(direction, editor.getBody(), editor.selection.getRng());
22880
22895
  if (isNearMedia(fromPos)) {
22881
22896
  return deleteElement(editor, forward, fromPos.getNode(!forward));
@@ -23301,7 +23316,7 @@
23301
23316
  }
23302
23317
  };
23303
23318
  const getHorizontalRange = (editor, forward) => {
23304
- const direction = forward ? HDirection.Forwards : HDirection.Backwards;
23319
+ const direction = forward ? 1 : -1;
23305
23320
  const range = editor.selection.getRng();
23306
23321
  return moveToCeFalseHorizontally(direction, editor, range).orThunk(() => {
23307
23322
  exitPreBlock(editor, direction, range);
@@ -23428,7 +23443,7 @@
23428
23443
  const executeWithDelayedAction = (patterns, evt) => findMap(matchDelayed(patterns, evt), pattern => pattern.action());
23429
23444
 
23430
23445
  const moveH$1 = (editor, forward) => {
23431
- const direction = forward ? HDirection.Forwards : HDirection.Backwards;
23446
+ const direction = forward ? 1 : -1;
23432
23447
  const range = editor.selection.getRng();
23433
23448
  return moveHorizontally(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia$2).exists(newRange => {
23434
23449
  moveToRange(editor, newRange);
@@ -26756,7 +26771,7 @@
26756
26771
  const contentType = dataTransfer.types[i];
26757
26772
  try {
26758
26773
  items[contentType] = dataTransfer.getData(contentType);
26759
- } catch (ex) {
26774
+ } catch (_a) {
26760
26775
  items[contentType] = '';
26761
26776
  }
26762
26777
  }
@@ -26949,7 +26964,7 @@
26949
26964
  clipboardData.setData('text/plain', text);
26950
26965
  clipboardData.setData(internalHtmlMime(), html);
26951
26966
  return true;
26952
- } catch (e) {
26967
+ } catch (_a) {
26953
26968
  return false;
26954
26969
  }
26955
26970
  } else {
@@ -27488,6 +27503,8 @@
27488
27503
  clientX: 0,
27489
27504
  clientY: 0,
27490
27505
  ctrlKey: false,
27506
+ layerX: 0,
27507
+ layerY: 0,
27491
27508
  metaKey: false,
27492
27509
  movementX: 0,
27493
27510
  movementY: 0,
@@ -28738,7 +28755,7 @@
28738
28755
  const setEditorCommandState = (cmd, state) => {
28739
28756
  try {
28740
28757
  editor.getDoc().execCommand(cmd, false, String(state));
28741
- } catch (ex) {
28758
+ } catch (_a) {
28742
28759
  }
28743
28760
  };
28744
28761
  const isDefaultPrevented = e => {
@@ -30063,7 +30080,7 @@
30063
30080
  let failed;
30064
30081
  try {
30065
30082
  doc.execCommand(command);
30066
- } catch (ex) {
30083
+ } catch (_a) {
30067
30084
  failed = true;
30068
30085
  }
30069
30086
  if (command === 'paste' && !doc.queryCommandEnabled(command)) {
@@ -31836,8 +31853,8 @@
31836
31853
  documentBaseURL: null,
31837
31854
  suffix: null,
31838
31855
  majorVersion: '7',
31839
- minorVersion: '6.1',
31840
- releaseDate: '2025-01-22',
31856
+ minorVersion: '7.0',
31857
+ releaseDate: 'TBD',
31841
31858
  i18n: I18n,
31842
31859
  activeEditor: null,
31843
31860
  focusedEditor: null,
@@ -32359,7 +32376,7 @@
32359
32376
  localStorage = window.localStorage;
32360
32377
  localStorage.setItem(test, test);
32361
32378
  localStorage.removeItem(test);
32362
- } catch (e) {
32379
+ } catch (_a) {
32363
32380
  localStorage = create();
32364
32381
  }
32365
32382
  var LocalStorage = localStorage;
@@ -32442,7 +32459,7 @@
32442
32459
  if (typeof module === 'object') {
32443
32460
  try {
32444
32461
  module.exports = tinymce;
32445
- } catch (_) {
32462
+ } catch (_a) {
32446
32463
  }
32447
32464
  }
32448
32465
  };
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "7.6.1"
4
- TINYMCE_VERSION = "7.6.1"
3
+ VERSION = "7.7.0"
4
+ TINYMCE_VERSION = "7.7.0"
5
5
  end
6
6
  end