tinymce-rails 8.10.0 → 8.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +167 -154
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/tinymce.js +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0aa0b46f0c60b3f5299265cf18434083cc20c90edca680e7aea3d4a51a7eb845
|
|
4
|
+
data.tar.gz: eea41881902fe912d5802a770b797817b44f6ec21d196ce40c72dc4a2862ddf0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 51ef53c4b01237071b3e711594fe9ed2e3762f8fd0eec78166ad33a2473aae1a197f09ff2c30866b1e354723fc097b52768a04245d828854f43827d364749e3c
|
|
7
|
+
data.tar.gz: 07df40aa209cf71d6e976945167463bc56219b5c8ea6265c9800b5b631f5553a42a0f1ae67f7131c99bedb4ea60e338792018e815c8ca16e3074b96ebd32a8e4
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 8.10.
|
|
2
|
+
* TinyMCE version 8.10.1 (2026-10-28)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -16569,156 +16569,6 @@
|
|
|
16569
16569
|
};
|
|
16570
16570
|
};
|
|
16571
16571
|
|
|
16572
|
-
const getNormalizedPoint$1 = (container, offset) => {
|
|
16573
|
-
if (isText$b(container)) {
|
|
16574
|
-
return { container, offset };
|
|
16575
|
-
}
|
|
16576
|
-
const node = RangeUtils.getNode(container, offset);
|
|
16577
|
-
if (isText$b(node)) {
|
|
16578
|
-
return {
|
|
16579
|
-
container: node,
|
|
16580
|
-
offset: offset >= container.childNodes.length ? node.data.length : 0
|
|
16581
|
-
};
|
|
16582
|
-
}
|
|
16583
|
-
else if (node.previousSibling && isText$b(node.previousSibling)) {
|
|
16584
|
-
return {
|
|
16585
|
-
container: node.previousSibling,
|
|
16586
|
-
offset: node.previousSibling.data.length
|
|
16587
|
-
};
|
|
16588
|
-
}
|
|
16589
|
-
else if (node.nextSibling && isText$b(node.nextSibling)) {
|
|
16590
|
-
return {
|
|
16591
|
-
container: node.nextSibling,
|
|
16592
|
-
offset: 0
|
|
16593
|
-
};
|
|
16594
|
-
}
|
|
16595
|
-
return { container, offset };
|
|
16596
|
-
};
|
|
16597
|
-
const normalizeRange$1 = (rng) => {
|
|
16598
|
-
const outRng = rng.cloneRange();
|
|
16599
|
-
const rangeStart = getNormalizedPoint$1(rng.startContainer, rng.startOffset);
|
|
16600
|
-
outRng.setStart(rangeStart.container, rangeStart.offset);
|
|
16601
|
-
const rangeEnd = getNormalizedPoint$1(rng.endContainer, rng.endOffset);
|
|
16602
|
-
outRng.setEnd(rangeEnd.container, rangeEnd.offset);
|
|
16603
|
-
return outRng;
|
|
16604
|
-
};
|
|
16605
|
-
|
|
16606
|
-
const DOM$b = DOMUtils.DOM;
|
|
16607
|
-
const defaultMarker = () => DOM$b.create('span', { 'data-mce-type': 'bookmark' });
|
|
16608
|
-
const setupEndPoint = (container, offset, createMarker) => {
|
|
16609
|
-
if (isElement$7(container)) {
|
|
16610
|
-
const offsetNode = createMarker();
|
|
16611
|
-
if (container.hasChildNodes()) {
|
|
16612
|
-
if (offset === container.childNodes.length) {
|
|
16613
|
-
container.appendChild(offsetNode);
|
|
16614
|
-
}
|
|
16615
|
-
else {
|
|
16616
|
-
container.insertBefore(offsetNode, container.childNodes[offset]);
|
|
16617
|
-
}
|
|
16618
|
-
}
|
|
16619
|
-
else {
|
|
16620
|
-
container.appendChild(offsetNode);
|
|
16621
|
-
}
|
|
16622
|
-
return { container: offsetNode, offset: 0 };
|
|
16623
|
-
}
|
|
16624
|
-
else {
|
|
16625
|
-
return { container, offset };
|
|
16626
|
-
}
|
|
16627
|
-
};
|
|
16628
|
-
const restoreEndPoint = (container, offset) => {
|
|
16629
|
-
const nodeIndex = (container) => {
|
|
16630
|
-
let node = container.parentNode?.firstChild;
|
|
16631
|
-
let idx = 0;
|
|
16632
|
-
while (node) {
|
|
16633
|
-
if (node === container) {
|
|
16634
|
-
return idx;
|
|
16635
|
-
}
|
|
16636
|
-
// Skip data-mce-type=bookmark nodes
|
|
16637
|
-
if (!isElement$7(node) || node.getAttribute('data-mce-type') !== 'bookmark') {
|
|
16638
|
-
idx++;
|
|
16639
|
-
}
|
|
16640
|
-
node = node.nextSibling;
|
|
16641
|
-
}
|
|
16642
|
-
return -1;
|
|
16643
|
-
};
|
|
16644
|
-
if (isElement$7(container) && isNonNullable(container.parentNode)) {
|
|
16645
|
-
const node = container;
|
|
16646
|
-
offset = nodeIndex(container);
|
|
16647
|
-
container = container.parentNode;
|
|
16648
|
-
DOM$b.remove(node);
|
|
16649
|
-
if (!container.hasChildNodes() && DOM$b.isBlock(container)) {
|
|
16650
|
-
container.appendChild(DOM$b.create('br'));
|
|
16651
|
-
}
|
|
16652
|
-
}
|
|
16653
|
-
return { container, offset };
|
|
16654
|
-
};
|
|
16655
|
-
const createNormalizedRange = (startContainer, startOffset, endContainer, endOffset) => {
|
|
16656
|
-
const rng = DOM$b.createRng();
|
|
16657
|
-
rng.setStart(startContainer, startOffset);
|
|
16658
|
-
rng.setEnd(endContainer, endOffset);
|
|
16659
|
-
return normalizeRange$1(rng);
|
|
16660
|
-
};
|
|
16661
|
-
/**
|
|
16662
|
-
* Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
|
|
16663
|
-
* index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
|
|
16664
|
-
* added to them since they can be restored after a dom operation.
|
|
16665
|
-
*
|
|
16666
|
-
* So this: <p><b>|</b><b>|</b></p>
|
|
16667
|
-
* becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
|
|
16668
|
-
*/
|
|
16669
|
-
const createBookmark = (rng, createMarker = defaultMarker) => {
|
|
16670
|
-
const { container: startContainer, offset: startOffset } = setupEndPoint(rng.startContainer, rng.startOffset, createMarker);
|
|
16671
|
-
if (rng.collapsed) {
|
|
16672
|
-
return { startContainer, startOffset };
|
|
16673
|
-
}
|
|
16674
|
-
else {
|
|
16675
|
-
const { container: endContainer, offset: endOffset } = setupEndPoint(rng.endContainer, rng.endOffset, createMarker);
|
|
16676
|
-
return { startContainer, startOffset, endContainer, endOffset };
|
|
16677
|
-
}
|
|
16678
|
-
};
|
|
16679
|
-
const resolveBookmark = (bookmark) => {
|
|
16680
|
-
const { container: startContainer, offset: startOffset } = restoreEndPoint(bookmark.startContainer, bookmark.startOffset);
|
|
16681
|
-
if (!isUndefined(bookmark.endContainer) && !isUndefined(bookmark.endOffset)) {
|
|
16682
|
-
const { container: endContainer, offset: endOffset } = restoreEndPoint(bookmark.endContainer, bookmark.endOffset);
|
|
16683
|
-
return createNormalizedRange(startContainer, startOffset, endContainer, endOffset);
|
|
16684
|
-
}
|
|
16685
|
-
else {
|
|
16686
|
-
return createNormalizedRange(startContainer, startOffset, startContainer, startOffset);
|
|
16687
|
-
}
|
|
16688
|
-
};
|
|
16689
|
-
|
|
16690
|
-
const applyStyles = (dom, elm, format, vars) => {
|
|
16691
|
-
Tools.each(format.styles, (value, name) => {
|
|
16692
|
-
dom.setStyle(elm, name, replaceVars(value, vars));
|
|
16693
|
-
});
|
|
16694
|
-
// Needed for the WebKit span spam bug
|
|
16695
|
-
// TODO: Remove this once WebKit/Blink fixes this
|
|
16696
|
-
if (format.styles) {
|
|
16697
|
-
const styleVal = dom.getAttrib(elm, 'style');
|
|
16698
|
-
if (styleVal) {
|
|
16699
|
-
dom.setAttrib(elm, 'data-mce-style', styleVal);
|
|
16700
|
-
}
|
|
16701
|
-
}
|
|
16702
|
-
};
|
|
16703
|
-
const setElementFormat = (ed, elm, fmt, vars, node) => {
|
|
16704
|
-
const dom = ed.dom;
|
|
16705
|
-
if (isFunction(fmt.onformat)) {
|
|
16706
|
-
fmt.onformat(elm, fmt, vars, node);
|
|
16707
|
-
}
|
|
16708
|
-
applyStyles(dom, elm, fmt, vars);
|
|
16709
|
-
Tools.each(fmt.attributes, (value, name) => {
|
|
16710
|
-
dom.setAttrib(elm, name, replaceVars(value, vars));
|
|
16711
|
-
});
|
|
16712
|
-
Tools.each(fmt.classes, (value) => {
|
|
16713
|
-
const newValue = replaceVars(value, vars);
|
|
16714
|
-
if (!dom.hasClass(elm, newValue)) {
|
|
16715
|
-
dom.addClass(elm, newValue);
|
|
16716
|
-
}
|
|
16717
|
-
});
|
|
16718
|
-
};
|
|
16719
|
-
|
|
16720
|
-
const isApplyFormat = (format) => !isArray$1(format.attributes) && !isArray$1(format.styles);
|
|
16721
|
-
|
|
16722
16572
|
const isEq$3 = isEq$5;
|
|
16723
16573
|
const matchesUnInheritedFormatSelector = (ed, node, name) => {
|
|
16724
16574
|
const formatList = ed.formatter.get(name);
|
|
@@ -17227,6 +17077,156 @@
|
|
|
17227
17077
|
return has$2(inlineElements, name(element)) && !isCaretNode(element.dom) && !isBogus$1(element.dom);
|
|
17228
17078
|
};
|
|
17229
17079
|
|
|
17080
|
+
const getNormalizedPoint$1 = (container, offset) => {
|
|
17081
|
+
if (isText$b(container)) {
|
|
17082
|
+
return { container, offset };
|
|
17083
|
+
}
|
|
17084
|
+
const node = RangeUtils.getNode(container, offset);
|
|
17085
|
+
if (isText$b(node)) {
|
|
17086
|
+
return {
|
|
17087
|
+
container: node,
|
|
17088
|
+
offset: offset >= container.childNodes.length ? node.data.length : 0
|
|
17089
|
+
};
|
|
17090
|
+
}
|
|
17091
|
+
else if (node.previousSibling && isText$b(node.previousSibling)) {
|
|
17092
|
+
return {
|
|
17093
|
+
container: node.previousSibling,
|
|
17094
|
+
offset: node.previousSibling.data.length
|
|
17095
|
+
};
|
|
17096
|
+
}
|
|
17097
|
+
else if (node.nextSibling && isText$b(node.nextSibling)) {
|
|
17098
|
+
return {
|
|
17099
|
+
container: node.nextSibling,
|
|
17100
|
+
offset: 0
|
|
17101
|
+
};
|
|
17102
|
+
}
|
|
17103
|
+
return { container, offset };
|
|
17104
|
+
};
|
|
17105
|
+
const normalizeRange$1 = (rng) => {
|
|
17106
|
+
const outRng = rng.cloneRange();
|
|
17107
|
+
const rangeStart = getNormalizedPoint$1(rng.startContainer, rng.startOffset);
|
|
17108
|
+
outRng.setStart(rangeStart.container, rangeStart.offset);
|
|
17109
|
+
const rangeEnd = getNormalizedPoint$1(rng.endContainer, rng.endOffset);
|
|
17110
|
+
outRng.setEnd(rangeEnd.container, rangeEnd.offset);
|
|
17111
|
+
return outRng;
|
|
17112
|
+
};
|
|
17113
|
+
|
|
17114
|
+
const DOM$b = DOMUtils.DOM;
|
|
17115
|
+
const defaultMarker = () => DOM$b.create('span', { 'data-mce-type': 'bookmark' });
|
|
17116
|
+
const setupEndPoint = (container, offset, createMarker) => {
|
|
17117
|
+
if (isElement$7(container)) {
|
|
17118
|
+
const offsetNode = createMarker();
|
|
17119
|
+
if (container.hasChildNodes()) {
|
|
17120
|
+
if (offset === container.childNodes.length) {
|
|
17121
|
+
container.appendChild(offsetNode);
|
|
17122
|
+
}
|
|
17123
|
+
else {
|
|
17124
|
+
container.insertBefore(offsetNode, container.childNodes[offset]);
|
|
17125
|
+
}
|
|
17126
|
+
}
|
|
17127
|
+
else {
|
|
17128
|
+
container.appendChild(offsetNode);
|
|
17129
|
+
}
|
|
17130
|
+
return { container: offsetNode, offset: 0 };
|
|
17131
|
+
}
|
|
17132
|
+
else {
|
|
17133
|
+
return { container, offset };
|
|
17134
|
+
}
|
|
17135
|
+
};
|
|
17136
|
+
const restoreEndPoint = (container, offset) => {
|
|
17137
|
+
const nodeIndex = (container) => {
|
|
17138
|
+
let node = container.parentNode?.firstChild;
|
|
17139
|
+
let idx = 0;
|
|
17140
|
+
while (node) {
|
|
17141
|
+
if (node === container) {
|
|
17142
|
+
return idx;
|
|
17143
|
+
}
|
|
17144
|
+
// Skip data-mce-type=bookmark nodes
|
|
17145
|
+
if (!isElement$7(node) || node.getAttribute('data-mce-type') !== 'bookmark') {
|
|
17146
|
+
idx++;
|
|
17147
|
+
}
|
|
17148
|
+
node = node.nextSibling;
|
|
17149
|
+
}
|
|
17150
|
+
return -1;
|
|
17151
|
+
};
|
|
17152
|
+
if (isElement$7(container) && isNonNullable(container.parentNode)) {
|
|
17153
|
+
const node = container;
|
|
17154
|
+
offset = nodeIndex(container);
|
|
17155
|
+
container = container.parentNode;
|
|
17156
|
+
DOM$b.remove(node);
|
|
17157
|
+
if (!container.hasChildNodes() && DOM$b.isBlock(container)) {
|
|
17158
|
+
container.appendChild(DOM$b.create('br'));
|
|
17159
|
+
}
|
|
17160
|
+
}
|
|
17161
|
+
return { container, offset };
|
|
17162
|
+
};
|
|
17163
|
+
const createNormalizedRange = (startContainer, startOffset, endContainer, endOffset) => {
|
|
17164
|
+
const rng = DOM$b.createRng();
|
|
17165
|
+
rng.setStart(startContainer, startOffset);
|
|
17166
|
+
rng.setEnd(endContainer, endOffset);
|
|
17167
|
+
return normalizeRange$1(rng);
|
|
17168
|
+
};
|
|
17169
|
+
/**
|
|
17170
|
+
* Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
|
|
17171
|
+
* index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
|
|
17172
|
+
* added to them since they can be restored after a dom operation.
|
|
17173
|
+
*
|
|
17174
|
+
* So this: <p><b>|</b><b>|</b></p>
|
|
17175
|
+
* becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
|
|
17176
|
+
*/
|
|
17177
|
+
const createBookmark = (rng, createMarker = defaultMarker) => {
|
|
17178
|
+
const { container: startContainer, offset: startOffset } = setupEndPoint(rng.startContainer, rng.startOffset, createMarker);
|
|
17179
|
+
if (rng.collapsed) {
|
|
17180
|
+
return { startContainer, startOffset };
|
|
17181
|
+
}
|
|
17182
|
+
else {
|
|
17183
|
+
const { container: endContainer, offset: endOffset } = setupEndPoint(rng.endContainer, rng.endOffset, createMarker);
|
|
17184
|
+
return { startContainer, startOffset, endContainer, endOffset };
|
|
17185
|
+
}
|
|
17186
|
+
};
|
|
17187
|
+
const resolveBookmark = (bookmark) => {
|
|
17188
|
+
const { container: startContainer, offset: startOffset } = restoreEndPoint(bookmark.startContainer, bookmark.startOffset);
|
|
17189
|
+
if (!isUndefined(bookmark.endContainer) && !isUndefined(bookmark.endOffset)) {
|
|
17190
|
+
const { container: endContainer, offset: endOffset } = restoreEndPoint(bookmark.endContainer, bookmark.endOffset);
|
|
17191
|
+
return createNormalizedRange(startContainer, startOffset, endContainer, endOffset);
|
|
17192
|
+
}
|
|
17193
|
+
else {
|
|
17194
|
+
return createNormalizedRange(startContainer, startOffset, startContainer, startOffset);
|
|
17195
|
+
}
|
|
17196
|
+
};
|
|
17197
|
+
|
|
17198
|
+
const applyStyles = (dom, elm, format, vars) => {
|
|
17199
|
+
Tools.each(format.styles, (value, name) => {
|
|
17200
|
+
dom.setStyle(elm, name, replaceVars(value, vars));
|
|
17201
|
+
});
|
|
17202
|
+
// Needed for the WebKit span spam bug
|
|
17203
|
+
// TODO: Remove this once WebKit/Blink fixes this
|
|
17204
|
+
if (format.styles) {
|
|
17205
|
+
const styleVal = dom.getAttrib(elm, 'style');
|
|
17206
|
+
if (styleVal) {
|
|
17207
|
+
dom.setAttrib(elm, 'data-mce-style', styleVal);
|
|
17208
|
+
}
|
|
17209
|
+
}
|
|
17210
|
+
};
|
|
17211
|
+
const setElementFormat = (ed, elm, fmt, vars, node) => {
|
|
17212
|
+
const dom = ed.dom;
|
|
17213
|
+
if (isFunction(fmt.onformat)) {
|
|
17214
|
+
fmt.onformat(elm, fmt, vars, node);
|
|
17215
|
+
}
|
|
17216
|
+
applyStyles(dom, elm, fmt, vars);
|
|
17217
|
+
Tools.each(fmt.attributes, (value, name) => {
|
|
17218
|
+
dom.setAttrib(elm, name, replaceVars(value, vars));
|
|
17219
|
+
});
|
|
17220
|
+
Tools.each(fmt.classes, (value) => {
|
|
17221
|
+
const newValue = replaceVars(value, vars);
|
|
17222
|
+
if (!dom.hasClass(elm, newValue)) {
|
|
17223
|
+
dom.addClass(elm, newValue);
|
|
17224
|
+
}
|
|
17225
|
+
});
|
|
17226
|
+
};
|
|
17227
|
+
|
|
17228
|
+
const isApplyFormat = (format) => !isArray$1(format.attributes) && !isArray$1(format.styles);
|
|
17229
|
+
|
|
17230
17230
|
const listItemStyles = ['fontWeight', 'fontStyle', 'color', 'fontSize', 'fontFamily'];
|
|
17231
17231
|
const hasListStyles = (fmt) => isObject(fmt.styles) && exists(keys(fmt.styles), (name) => contains$2(listItemStyles, name));
|
|
17232
17232
|
const findExpandedListItemFormat = (formats) => find$2(formats, (fmt) => isInlineFormat(fmt) && fmt.inline === 'span' && hasListStyles(fmt));
|
|
@@ -22877,6 +22877,18 @@
|
|
|
22877
22877
|
}
|
|
22878
22878
|
selection.setRng(rng);
|
|
22879
22879
|
};
|
|
22880
|
+
const isWholeBlockContentInInlineFormat = (editor, rng) => {
|
|
22881
|
+
const dom = editor.dom;
|
|
22882
|
+
const ancestor = rng.commonAncestorContainer;
|
|
22883
|
+
const elm = isText$b(ancestor) ? ancestor.parentNode : ancestor;
|
|
22884
|
+
if (!isElement$7(elm) || !dom.isEditable(elm) || !isFormatElement(editor, SugarElement.fromDom(elm))) {
|
|
22885
|
+
return false;
|
|
22886
|
+
}
|
|
22887
|
+
const block = dom.getParent(elm, dom.isBlock);
|
|
22888
|
+
return isNonNullable(block)
|
|
22889
|
+
&& prevPosition(block, CaretPosition.fromRangeStart(rng)).isNone()
|
|
22890
|
+
&& nextPosition(block, CaretPosition.fromRangeEnd(rng)).isNone();
|
|
22891
|
+
};
|
|
22880
22892
|
const deleteSelectedContent = (editor) => {
|
|
22881
22893
|
const dom = editor.dom;
|
|
22882
22894
|
// Fix for #2595 seems that delete removes one extra character on
|
|
@@ -22890,8 +22902,9 @@
|
|
|
22890
22902
|
deleteCellContents(editor, rng, SugarElement.fromDom(startCell));
|
|
22891
22903
|
// TINY-9193: If the selection is over the whole text node in an element then Firefox incorrectly moves the caret to the previous line
|
|
22892
22904
|
// TINY-11953: If the selection is over the whole anchor node, then Chrome incorrectly removes parent node alongside with it's child - anchor
|
|
22905
|
+
// TINY-11317: If the whole block content is selected inside a common inline format element, native delete removes the format element
|
|
22893
22906
|
}
|
|
22894
|
-
else if (isSelectionOverWholeAnchor(rng) || isSelectionOverWholeTextNode(rng)) {
|
|
22907
|
+
else if (isSelectionOverWholeAnchor(rng) || isSelectionOverWholeTextNode(rng) || isWholeBlockContentInInlineFormat(editor, rng)) {
|
|
22895
22908
|
rng.deleteContents();
|
|
22896
22909
|
}
|
|
22897
22910
|
else {
|
|
@@ -42144,14 +42157,14 @@
|
|
|
42144
42157
|
* @property minorVersion
|
|
42145
42158
|
* @type String
|
|
42146
42159
|
*/
|
|
42147
|
-
minorVersion: '10.
|
|
42160
|
+
minorVersion: '10.1',
|
|
42148
42161
|
/**
|
|
42149
42162
|
* Release date of TinyMCE build.
|
|
42150
42163
|
*
|
|
42151
42164
|
* @property releaseDate
|
|
42152
42165
|
* @type String
|
|
42153
42166
|
*/
|
|
42154
|
-
releaseDate: '2026-10-
|
|
42167
|
+
releaseDate: '2026-10-28',
|
|
42155
42168
|
/**
|
|
42156
42169
|
* Collection of language pack data.
|
|
42157
42170
|
*
|