tinymce-rails 6.1.0 → 6.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +140 -142
  3. data/lib/tinymce/rails/configuration.rb +5 -0
  4. data/lib/tinymce/rails/configuration_file.rb +2 -1
  5. data/lib/tinymce/rails/version.rb +2 -2
  6. data/vendor/assets/javascripts/tinymce/models/dom/model.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -2
  10. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
  15. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
  23. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  26. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  29. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  33. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  37. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  38. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e5616bd4ae252319c2980791ffd7215d68f6baa91a8130d023ae88c0248af28
4
- data.tar.gz: b4d0dfe88f2382836c0fdf1fad5590a3d0c053f29b20ce7fbd41dc64c92b93c3
3
+ metadata.gz: 1baae60d37594fc70751b6cfbb80edb53a259fecd1e7371710b23ac24bcb4f69
4
+ data.tar.gz: 591e22769b36ae6eb3f817c326b6964033bd6aad442c045b18ef891bb42e4d57
5
5
  SHA512:
6
- metadata.gz: c780f724b655b6a1f1ddaec0fb8ee4884515d98a10a23190f6995fa0879d70678800071fda4d00f01bc270fdf23589c5ca17ca620045d5308855a97e3126ed8a
7
- data.tar.gz: 70c1066af735c2211362ff75a7fcf13ad58a071e2f2d387433c466d9f28bc44c66f9a997c3554336cc3ce7d2c8fbe7484c2be1a737c2b957e2426b08fa23982f
6
+ metadata.gz: ce3445fcf5dc095d2016ec82984364b713e52db1a4f011174c6120934358b7d0085be56df491e4fdb2cb088695b288c1eb8c770124c1354611367decb3980893
7
+ data.tar.gz: 69969f7830db9a0eeb739d559b0fd202a2be20fc8d12277dcf501fee846b5daec6b1cb166a963d4a8f55d40da66b63cd10a9daa5210c581792e49f930a9379e2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.1.0 (2022-06-29)
2
+ * TinyMCE version 6.1.1 (2022-07-27)
3
3
  */
4
4
 
5
5
  (function () {
@@ -2239,6 +2239,79 @@
2239
2239
  const isZwsp$1 = char => char === zeroWidth;
2240
2240
  const removeZwsp = s => s.replace(/\uFEFF/g, '');
2241
2241
 
2242
+ const descendants$1 = (scope, predicate) => {
2243
+ let result = [];
2244
+ each$f(children(scope), x => {
2245
+ if (predicate(x)) {
2246
+ result = result.concat([x]);
2247
+ }
2248
+ result = result.concat(descendants$1(x, predicate));
2249
+ });
2250
+ return result;
2251
+ };
2252
+
2253
+ const descendants = (scope, selector) => all(selector, scope);
2254
+
2255
+ const NodeValue = (is, name) => {
2256
+ const get = element => {
2257
+ if (!is(element)) {
2258
+ throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
2259
+ }
2260
+ return getOption(element).getOr('');
2261
+ };
2262
+ const getOption = element => is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();
2263
+ const set = (element, value) => {
2264
+ if (!is(element)) {
2265
+ throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
2266
+ }
2267
+ element.dom.nodeValue = value;
2268
+ };
2269
+ return {
2270
+ get,
2271
+ getOption,
2272
+ set
2273
+ };
2274
+ };
2275
+
2276
+ const api$1 = NodeValue(isText$a, 'text');
2277
+ const get$3 = element => api$1.get(element);
2278
+ const getOption = element => api$1.getOption(element);
2279
+
2280
+ const getLastChildren$1 = elm => {
2281
+ const children = [];
2282
+ let rawNode = elm.dom;
2283
+ while (rawNode) {
2284
+ children.push(SugarElement.fromDom(rawNode));
2285
+ rawNode = rawNode.lastChild;
2286
+ }
2287
+ return children;
2288
+ };
2289
+ const removeTrailingBr = elm => {
2290
+ const allBrs = descendants(elm, 'br');
2291
+ const brs = filter$6(getLastChildren$1(elm).slice(-1), isBr$5);
2292
+ if (allBrs.length === brs.length) {
2293
+ each$f(brs, remove$6);
2294
+ }
2295
+ };
2296
+ const createPaddingBr = () => {
2297
+ const br = SugarElement.fromTag('br');
2298
+ set$2(br, 'data-mce-bogus', '1');
2299
+ return br;
2300
+ };
2301
+ const fillWithPaddingBr = elm => {
2302
+ empty(elm);
2303
+ append$1(elm, createPaddingBr());
2304
+ };
2305
+ const trimBlockTrailingBr = elm => {
2306
+ lastChild(elm).each(lastChild => {
2307
+ prevSibling(lastChild).each(lastChildPrevSibling => {
2308
+ if (isBlock$2(elm) && isBr$5(lastChild) && isBlock$2(lastChildPrevSibling)) {
2309
+ remove$6(lastChild);
2310
+ }
2311
+ });
2312
+ });
2313
+ };
2314
+
2242
2315
  const ZWSP$1 = zeroWidth;
2243
2316
  const isZwsp = isZwsp$1;
2244
2317
  const trim$1 = removeZwsp;
@@ -2302,17 +2375,12 @@
2302
2375
  }
2303
2376
  return container.data.charAt(pos.offset() - 1) === ZWSP$1 || pos.isAtEnd() && isCaretContainerInline(container.nextSibling);
2304
2377
  };
2305
- const createBogusBr = () => {
2306
- const br = document.createElement('br');
2307
- br.setAttribute('data-mce-bogus', '1');
2308
- return br;
2309
- };
2310
2378
  const insertBlock = (blockName, node, before) => {
2311
2379
  const doc = node.ownerDocument;
2312
2380
  const blockNode = doc.createElement(blockName);
2313
2381
  blockNode.setAttribute('data-mce-caret', before ? 'before' : 'after');
2314
2382
  blockNode.setAttribute('data-mce-bogus', 'all');
2315
- blockNode.appendChild(createBogusBr());
2383
+ blockNode.appendChild(createPaddingBr().dom);
2316
2384
  const parentNode = node.parentNode;
2317
2385
  if (!before) {
2318
2386
  if (node.nextSibling) {
@@ -5037,19 +5105,6 @@
5037
5105
  };
5038
5106
  };
5039
5107
 
5040
- const descendants$1 = (scope, predicate) => {
5041
- let result = [];
5042
- each$f(children(scope), x => {
5043
- if (predicate(x)) {
5044
- result = result.concat([x]);
5045
- }
5046
- result = result.concat(descendants$1(x, predicate));
5047
- });
5048
- return result;
5049
- };
5050
-
5051
- const descendants = (scope, selector) => all(selector, scope);
5052
-
5053
5108
  const annotation = constant('mce-annotation');
5054
5109
  const dataAnnotation = constant('data-mce-annotation');
5055
5110
  const dataAnnotationId = constant('data-mce-annotation-uid');
@@ -8461,21 +8516,21 @@
8461
8516
  return [node].concat(getFirstChildren(child));
8462
8517
  });
8463
8518
  };
8464
- const getLastChildren$1 = node => {
8519
+ const getLastChildren = node => {
8465
8520
  return lastChild(node).fold(constant([node]), child => {
8466
8521
  if (name(child) === 'br') {
8467
8522
  return prevSibling(child).map(sibling => {
8468
- return [node].concat(getLastChildren$1(sibling));
8523
+ return [node].concat(getLastChildren(sibling));
8469
8524
  }).getOr([]);
8470
8525
  } else {
8471
- return [node].concat(getLastChildren$1(child));
8526
+ return [node].concat(getLastChildren(child));
8472
8527
  }
8473
8528
  });
8474
8529
  };
8475
8530
  const hasAllContentsSelected = (elm, rng) => {
8476
8531
  return lift2(getStartNode(rng), getEndNode(rng), (startNode, endNode) => {
8477
8532
  const start = find$2(getFirstChildren(elm), curry(eq, startNode));
8478
- const end = find$2(getLastChildren$1(elm), curry(eq, endNode));
8533
+ const end = find$2(getLastChildren(elm), curry(eq, endNode));
8479
8534
  return start.isSome() && end.isSome();
8480
8535
  }).getOr(false);
8481
8536
  };
@@ -8540,31 +8595,6 @@
8540
8595
  selection.moveToBookmark(bookmark);
8541
8596
  };
8542
8597
 
8543
- const NodeValue = (is, name) => {
8544
- const get = element => {
8545
- if (!is(element)) {
8546
- throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
8547
- }
8548
- return getOption(element).getOr('');
8549
- };
8550
- const getOption = element => is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();
8551
- const set = (element, value) => {
8552
- if (!is(element)) {
8553
- throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
8554
- }
8555
- element.dom.nodeValue = value;
8556
- };
8557
- return {
8558
- get,
8559
- getOption,
8560
- set
8561
- };
8562
- };
8563
-
8564
- const api$1 = NodeValue(isText$a, 'text');
8565
- const get$3 = element => api$1.get(element);
8566
- const getOption = element => api$1.getOption(element);
8567
-
8568
8598
  const validBlocks = [
8569
8599
  'pre[class*=language-][contenteditable="false"]',
8570
8600
  'figure.image',
@@ -11103,36 +11133,6 @@
11103
11133
  const isBeforeContentEditableFalse = matchesElementPosition(true, isCefNode);
11104
11134
  const isAfterContentEditableFalse = matchesElementPosition(false, isCefNode);
11105
11135
 
11106
- const getLastChildren = elm => {
11107
- const children = [];
11108
- let rawNode = elm.dom;
11109
- while (rawNode) {
11110
- children.push(SugarElement.fromDom(rawNode));
11111
- rawNode = rawNode.lastChild;
11112
- }
11113
- return children;
11114
- };
11115
- const removeTrailingBr = elm => {
11116
- const allBrs = descendants(elm, 'br');
11117
- const brs = filter$6(getLastChildren(elm).slice(-1), isBr$5);
11118
- if (allBrs.length === brs.length) {
11119
- each$f(brs, remove$6);
11120
- }
11121
- };
11122
- const fillWithPaddingBr = elm => {
11123
- empty(elm);
11124
- append$1(elm, SugarElement.fromHtml('<br data-mce-bogus="1">'));
11125
- };
11126
- const trimBlockTrailingBr = elm => {
11127
- lastChild(elm).each(lastChild => {
11128
- prevSibling(lastChild).each(lastChildPrevSibling => {
11129
- if (isBlock$2(elm) && isBr$5(lastChild) && isBlock$2(lastChildPrevSibling)) {
11130
- remove$6(lastChild);
11131
- }
11132
- });
11133
- });
11134
- };
11135
-
11136
11136
  const dropLast = xs => xs.slice(0, -1);
11137
11137
  const parentsUntil = (start, root, predicate) => {
11138
11138
  if (contains(root, start)) {
@@ -11478,15 +11478,9 @@
11478
11478
  return Optional.none();
11479
11479
  }
11480
11480
  };
11481
- const placeCaretInEmptyBody = editor => {
11482
- const body = editor.getBody();
11483
- const node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body;
11484
- editor.selection.setCursorLocation(node, 0);
11485
- };
11486
- const paddEmptyBody = editor => {
11481
+ const paddEmptyBody = (editor, moveSelection = true) => {
11487
11482
  if (editor.dom.isEmpty(editor.getBody())) {
11488
- editor.setContent('');
11489
- placeCaretInEmptyBody(editor);
11483
+ editor.setContent('', { no_selection: !moveSelection });
11490
11484
  }
11491
11485
  };
11492
11486
  const willDeleteLastPositionInElement = (forward, fromPos, elm) => lift2(firstPositionIn(elm), lastPositionIn(elm), (firstPos, lastPos) => {
@@ -11504,10 +11498,13 @@
11504
11498
  return child.bind(freefallRtl).orThunk(() => Optional.some(root));
11505
11499
  };
11506
11500
  const deleteRangeContents = (editor, rng, root, moveSelection = true) => {
11501
+ var _a;
11507
11502
  rng.deleteContents();
11508
11503
  const lastNode = freefallRtl(root).getOr(root);
11509
- const lastBlock = SugarElement.fromDom(editor.dom.getParent(lastNode.dom, editor.dom.isBlock));
11510
- if (isEmpty$2(lastBlock)) {
11504
+ const lastBlock = SugarElement.fromDom((_a = editor.dom.getParent(lastNode.dom, editor.dom.isBlock)) !== null && _a !== void 0 ? _a : root.dom);
11505
+ if (lastBlock.dom === editor.getBody()) {
11506
+ paddEmptyBody(editor, moveSelection);
11507
+ } else if (isEmpty$2(lastBlock)) {
11511
11508
  fillWithPaddingBr(lastBlock);
11512
11509
  if (moveSelection) {
11513
11510
  editor.selection.setCursorLocation(lastBlock.dom, 0);
@@ -12135,14 +12132,22 @@
12135
12132
  return insertMiddle(liTarget, liElms, rootNode, rng);
12136
12133
  };
12137
12134
 
12138
- const wrappedElements = ['pre'];
12139
- const shouldPasteContentOnly = (fragment, parentNode) => {
12135
+ const mergeableWrappedElements = ['pre'];
12136
+ const shouldPasteContentOnly = (dom, fragment, parentNode, root) => {
12137
+ var _a;
12140
12138
  const firstNode = fragment.firstChild;
12141
- const isAFlattenableTag = contains$2(wrappedElements, firstNode.name);
12142
- const isPastingInTheSameTag = firstNode.name === parentNode.tagName.toLowerCase();
12143
- const lastNode = fragment.lastChild.attr('data-mce-type') === 'bookmark' ? fragment.lastChild.prev : fragment.lastChild;
12144
- const isCopingOnlyOneTag = firstNode === lastNode;
12145
- return isCopingOnlyOneTag && isAFlattenableTag && isPastingInTheSameTag;
12139
+ const lastNode = fragment.lastChild;
12140
+ const last = lastNode.attr('data-mce-type') === 'bookmark' ? lastNode.prev : lastNode;
12141
+ const isPastingSingleElement = firstNode === last;
12142
+ const isWrappedElement = contains$2(mergeableWrappedElements, firstNode.name);
12143
+ if (isPastingSingleElement && isWrappedElement) {
12144
+ const isContentEditable = firstNode.attr('contenteditable') !== 'false';
12145
+ const isPastingInTheSameBlockTag = ((_a = dom.getParent(parentNode, dom.isBlock)) === null || _a === void 0 ? void 0 : _a.nodeName.toLowerCase()) === firstNode.name;
12146
+ const isPastingInContentEditable = Optional.from(getContentEditableRoot$1(root, parentNode)).forall(isContentEditableTrue$5);
12147
+ return isContentEditable && isPastingInTheSameBlockTag && isPastingInContentEditable;
12148
+ } else {
12149
+ return false;
12150
+ }
12146
12151
  };
12147
12152
  const isTableCell$1 = isTableCell$5;
12148
12153
  const isTableCellContentSelected = (dom, rng, cell) => {
@@ -12273,6 +12278,7 @@
12273
12278
  }
12274
12279
  };
12275
12280
  const insertHtmlAtCaret = (editor, value, details) => {
12281
+ var _a;
12276
12282
  let parentNode;
12277
12283
  let rng, node;
12278
12284
  const selection = editor.selection;
@@ -12311,8 +12317,8 @@
12311
12317
  selection.setRng(rng);
12312
12318
  return value;
12313
12319
  }
12314
- if (details.paste === true && shouldPasteContentOnly(fragment, parentNode)) {
12315
- fragment.firstChild.unwrap();
12320
+ if (details.paste === true && shouldPasteContentOnly(dom, fragment, parentNode, editor.getBody())) {
12321
+ (_a = fragment.firstChild) === null || _a === void 0 ? void 0 : _a.unwrap();
12316
12322
  }
12317
12323
  markFragmentElements(fragment);
12318
12324
  node = fragment.lastChild;
@@ -16044,6 +16050,7 @@
16044
16050
  };
16045
16051
  const setupPurify = (settings, schema) => {
16046
16052
  const purify$1 = purify();
16053
+ const specialElements = schema.getSpecialElements();
16047
16054
  const validate = settings.validate;
16048
16055
  let uid = 0;
16049
16056
  purify$1.addHook('uponSanitizeElement', (ele, evt) => {
@@ -16056,6 +16063,7 @@
16056
16063
  return;
16057
16064
  }
16058
16065
  const element = SugarElement.fromDom(ele);
16066
+ const lcTagName = tagName.toLowerCase();
16059
16067
  const isInternalElement = has$1(element, internalElementAttr);
16060
16068
  const bogus = get$9(element, 'data-mce-bogus');
16061
16069
  if (!isInternalElement && isString(bogus)) {
@@ -16066,9 +16074,13 @@
16066
16074
  }
16067
16075
  return;
16068
16076
  }
16069
- const rule = schema.getElementRule(tagName.toLowerCase());
16077
+ const rule = schema.getElementRule(lcTagName);
16070
16078
  if (validate && !rule) {
16071
- unwrap(element);
16079
+ if (has$2(specialElements, lcTagName)) {
16080
+ remove$6(element);
16081
+ } else {
16082
+ unwrap(element);
16083
+ }
16072
16084
  return;
16073
16085
  } else {
16074
16086
  evt.allowedTags[tagName] = true;
@@ -16090,7 +16102,7 @@
16090
16102
  unwrap(element);
16091
16103
  return;
16092
16104
  }
16093
- if (rule.outputName && rule.outputName !== tagName.toLowerCase()) {
16105
+ if (rule.outputName && rule.outputName !== lcTagName) {
16094
16106
  mutate(element, rule.outputName);
16095
16107
  }
16096
16108
  }
@@ -21246,6 +21258,7 @@
21246
21258
  }
21247
21259
  return false;
21248
21260
  };
21261
+ const createRootBlock = editor => editor.dom.create(getForcedRootBlock(editor), getForcedRootBlockAttrs(editor));
21249
21262
  const addRootBlocks = editor => {
21250
21263
  const dom = editor.dom, selection = editor.selection;
21251
21264
  const schema = editor.schema, blockElements = schema.getBlockElements();
@@ -21276,7 +21289,7 @@
21276
21289
  continue;
21277
21290
  }
21278
21291
  if (!rootBlockNode) {
21279
- rootBlockNode = dom.create(forcedRootBlock, getForcedRootBlockAttrs(editor));
21292
+ rootBlockNode = createRootBlock(editor);
21280
21293
  node.parentNode.insertBefore(rootBlockNode, node);
21281
21294
  wrapped = true;
21282
21295
  }
@@ -21295,6 +21308,16 @@
21295
21308
  editor.nodeChanged();
21296
21309
  }
21297
21310
  };
21311
+ const insertEmptyLine = (editor, root, insertBlock) => {
21312
+ const block = SugarElement.fromDom(createRootBlock(editor));
21313
+ const br = createPaddingBr();
21314
+ append$1(block, br);
21315
+ insertBlock(root, block);
21316
+ const rng = document.createRange();
21317
+ rng.setStartBefore(br.dom);
21318
+ rng.setEndBefore(br.dom);
21319
+ return rng;
21320
+ };
21298
21321
  const setup$n = editor => {
21299
21322
  editor.on('NodeChange', curry(addRootBlocks, editor));
21300
21323
  };
@@ -21475,27 +21498,6 @@
21475
21498
  });
21476
21499
 
21477
21500
  const isTarget = node => contains$2(['figcaption'], name(node));
21478
- const rangeBefore = target => {
21479
- const rng = document.createRange();
21480
- rng.setStartBefore(target.dom);
21481
- rng.setEndBefore(target.dom);
21482
- return rng;
21483
- };
21484
- const insertElement = (root, elm, forward) => {
21485
- if (forward) {
21486
- append$1(root, elm);
21487
- } else {
21488
- prepend(root, elm);
21489
- }
21490
- };
21491
- const insertEmptyLine = (root, forward, blockName, attrs) => {
21492
- const block = SugarElement.fromTag(blockName);
21493
- const br = SugarElement.fromTag('br');
21494
- setAll$1(block, attrs);
21495
- append$1(block, br);
21496
- insertElement(root, block, forward);
21497
- return rangeBefore(br);
21498
- };
21499
21501
  const getClosestTargetBlock = (pos, root) => {
21500
21502
  const isRoot = curry(eq, root);
21501
21503
  return closest$4(SugarElement.fromDom(pos.container()), isBlock$2, isRoot).filter(isTarget);
@@ -21504,11 +21506,10 @@
21504
21506
  const moveCaretToNewEmptyLine = (editor, forward) => {
21505
21507
  const root = SugarElement.fromDom(editor.getBody());
21506
21508
  const pos = CaretPosition.fromRangeStart(editor.selection.getRng());
21507
- const rootBlock = getForcedRootBlock(editor);
21508
- const rootBlockAttrs = getForcedRootBlockAttrs(editor);
21509
21509
  return getClosestTargetBlock(pos, root).exists(() => {
21510
21510
  if (isAtFirstOrLastLine(root, forward, pos)) {
21511
- const rng = insertEmptyLine(root, forward, rootBlock, rootBlockAttrs);
21511
+ const insertFn = forward ? append$1 : prepend;
21512
+ const rng = insertEmptyLine(editor, root, insertFn);
21512
21513
  editor.selection.setRng(rng);
21513
21514
  return true;
21514
21515
  } else {
@@ -21739,22 +21740,12 @@
21739
21740
  const getClosestBelowPosition = (root, table, start) => findClosestPositionInBelowCell(table, start).orThunk(() => head(start.getClientRects()).bind(rect => findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition.after(table)), rect.left))).getOr(CaretPosition.after(table));
21740
21741
  const getTable = (previous, pos) => {
21741
21742
  const node = pos.getNode(previous);
21742
- return isElement$6(node) && node.nodeName === 'TABLE' ? Optional.some(node) : Optional.none();
21743
+ return isTable$3(node) ? Optional.some(node) : Optional.none();
21743
21744
  };
21744
21745
  const renderBlock = (down, editor, table) => {
21745
- const forcedRootBlock = getForcedRootBlock(editor);
21746
21746
  editor.undoManager.transact(() => {
21747
- const element = SugarElement.fromTag(forcedRootBlock);
21748
- setAll$1(element, getForcedRootBlockAttrs(editor));
21749
- append$1(element, SugarElement.fromTag('br'));
21750
- if (down) {
21751
- after$4(SugarElement.fromDom(table), element);
21752
- } else {
21753
- before$3(SugarElement.fromDom(table), element);
21754
- }
21755
- const rng = editor.dom.createRng();
21756
- rng.setStart(element.dom, 0);
21757
- rng.setEnd(element.dom, 0);
21747
+ const insertFn = down ? after$4 : before$3;
21748
+ const rng = insertEmptyLine(editor, SugarElement.fromDom(table), insertFn);
21758
21749
  moveToRange(editor, rng);
21759
21750
  });
21760
21751
  };
@@ -26514,7 +26505,14 @@
26514
26505
  editor.contentDocument = iframe.contentDocument;
26515
26506
  contentBodyLoaded(editor);
26516
26507
  });
26517
- iframe.srcdoc = editor.iframeHTML;
26508
+ if (Env.browser.isFirefox()) {
26509
+ const doc = editor.getDoc();
26510
+ doc.open();
26511
+ doc.write(editor.iframeHTML);
26512
+ doc.close();
26513
+ } else {
26514
+ iframe.srcdoc = editor.iframeHTML;
26515
+ }
26518
26516
  } else {
26519
26517
  contentBodyLoaded(editor);
26520
26518
  }
@@ -28791,8 +28789,8 @@
28791
28789
  documentBaseURL: null,
28792
28790
  suffix: null,
28793
28791
  majorVersion: '6',
28794
- minorVersion: '1.0',
28795
- releaseDate: '2022-06-29',
28792
+ minorVersion: '1.1',
28793
+ releaseDate: '2022-07-27',
28796
28794
  i18n: I18n,
28797
28795
  activeEditor: null,
28798
28796
  focusedEditor: null,
@@ -98,10 +98,15 @@ module TinyMCE::Rails
98
98
  FUNCTION_REGEX =~ value.to_s
99
99
  end
100
100
 
101
+ def valid_property_name?(key)
102
+ key =~ /^(?![0-9])[a-zA-Z0-9$_]+$/
103
+ end
104
+
101
105
  def preprocess_options(options)
102
106
  result = {}
103
107
 
104
108
  options.each do |key, value|
109
+ key = "'#{key}'" unless valid_property_name?(key)
105
110
  result[key] = preprocess_option(key, value)
106
111
  end
107
112
 
@@ -43,7 +43,8 @@ module TinyMCE::Rails
43
43
  end
44
44
 
45
45
  def load_yaml(path)
46
- YAML::load(ERB.new(IO.read(path)).result)
46
+ result = ERB.new(IO.read(path)).result
47
+ YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(result) : YAML.load(result)
47
48
  end
48
49
  end
49
50
  end
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "6.1.0"
4
- TINYMCE_VERSION = "6.1.0"
3
+ VERSION = "6.1.1"
4
+ TINYMCE_VERSION = "6.1.1"
5
5
  end
6
6
  end