| Línea 1... |
Línea 1... |
| 1 |
/**
|
1 |
/**
|
| 2 |
* TinyMCE version 6.8.3 (2024-02-08)
|
2 |
* TinyMCE version 7.7.1 (2025-03-05)
|
| 3 |
*/
|
3 |
*/
|
| Línea 4... |
Línea 4... |
| 4 |
|
4 |
|
| 5 |
(function () {
|
5 |
(function () {
|
| Línea 6... |
Línea 6... |
| 6 |
'use strict';
|
6 |
'use strict';
|
| Línea -... |
Línea 7... |
| - |
|
7 |
|
| - |
|
8 |
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
| 7 |
|
9 |
|
| 8 |
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
10 |
const random = () => window.crypto.getRandomValues(new Uint32Array(1))[0] / 4294967295;
|
| 9 |
|
11 |
|
| 10 |
let unique = 0;
|
12 |
let unique = 0;
|
| 11 |
const generate = prefix => {
|
13 |
const generate = prefix => {
|
| 12 |
const date = new Date();
|
14 |
const date = new Date();
|
| 13 |
const time = date.getTime();
|
15 |
const time = date.getTime();
|
| 14 |
const random = Math.floor(Math.random() * 1000000000);
|
16 |
const random$1 = Math.floor(random() * 1000000000);
|
| Línea 15... |
Línea 17... |
| 15 |
unique++;
|
17 |
unique++;
|
| 16 |
return prefix + '_' + random + unique + String(time);
|
18 |
return prefix + '_' + random$1 + unique + String(time);
|
| 17 |
};
|
19 |
};
|
| Línea 346... |
Línea 348... |
| 346 |
return Optional.from(cs[index]).map(SugarElement.fromDom);
|
348 |
return Optional.from(cs[index]).map(SugarElement.fromDom);
|
| 347 |
};
|
349 |
};
|
| 348 |
const firstChild = element => child(element, 0);
|
350 |
const firstChild = element => child(element, 0);
|
| Línea 349... |
Línea 351... |
| 349 |
|
351 |
|
| 350 |
const isShadowRoot = dos => isDocumentFragment(dos) && isNonNullable(dos.dom.host);
|
- |
|
| 351 |
const supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
|
352 |
const isShadowRoot = dos => isDocumentFragment(dos) && isNonNullable(dos.dom.host);
|
| 352 |
const getRootNode = supported ? e => SugarElement.fromDom(e.dom.getRootNode()) : documentOrOwner;
|
353 |
const getRootNode = e => SugarElement.fromDom(e.dom.getRootNode());
|
| 353 |
const getShadowRoot = e => {
|
354 |
const getShadowRoot = e => {
|
| 354 |
const r = getRootNode(e);
|
355 |
const r = getRootNode(e);
|
| 355 |
return isShadowRoot(r) ? Optional.some(r) : Optional.none();
|
356 |
return isShadowRoot(r) ? Optional.some(r) : Optional.none();
|
| 356 |
};
|
357 |
};
|
| Línea 746... |
Línea 747... |
| 746 |
};
|
747 |
};
|
| 747 |
const isAtDetailsStart = editor => {
|
748 |
const isAtDetailsStart = editor => {
|
| 748 |
const rng = editor.selection.getRng();
|
749 |
const rng = editor.selection.getRng();
|
| 749 |
return isDetails(rng.startContainer) && rng.collapsed && rng.startOffset === 0;
|
750 |
return isDetails(rng.startContainer) && rng.collapsed && rng.startOffset === 0;
|
| 750 |
};
|
751 |
};
|
| 751 |
const isInsertAllowed = editor => !isInSummary(editor) && editor.dom.isEditable(editor.selection.getNode());
|
752 |
const isInsertAllowed = editor => !isInSummary(editor) && editor.dom.isEditable(editor.selection.getNode()) && !editor.mode.isReadOnly();
|
| 752 |
const getSelectedDetails = editor => Optional.from(editor.dom.getParent(editor.selection.getNode(), isDetails));
|
753 |
const getSelectedDetails = editor => Optional.from(editor.dom.getParent(editor.selection.getNode(), isDetails));
|
| 753 |
const isDetailsSelected = editor => getSelectedDetails(editor).isSome();
|
754 |
const isDetailsSelected = editor => getSelectedDetails(editor).isSome();
|
| 754 |
const insertBogus = element => {
|
755 |
const insertBogus = element => {
|
| 755 |
element.innerHTML = '<br data-mce-bogus="1" />';
|
756 |
element.innerHTML = '<br data-mce-bogus="1" />';
|
| 756 |
return element;
|
757 |
return element;
|
| Línea 826... |
Línea 827... |
| 826 |
getSelectedDetails(editor).each(details => {
|
827 |
getSelectedDetails(editor).each(details => {
|
| 827 |
fireToggleAccordionEvent(editor, details, toggleDetailsElement(details, state));
|
828 |
fireToggleAccordionEvent(editor, details, toggleDetailsElement(details, state));
|
| 828 |
});
|
829 |
});
|
| 829 |
};
|
830 |
};
|
| 830 |
const removeAccordion = editor => {
|
831 |
const removeAccordion = editor => {
|
| - |
|
832 |
if (!editor.mode.isReadOnly()) {
|
| 831 |
getSelectedDetails(editor).each(details => {
|
833 |
getSelectedDetails(editor).each(details => {
|
| 832 |
const {nextSibling} = details;
|
834 |
const {nextSibling} = details;
|
| 833 |
if (nextSibling) {
|
835 |
if (nextSibling) {
|
| 834 |
editor.selection.select(nextSibling, true);
|
836 |
editor.selection.select(nextSibling, true);
|
| 835 |
editor.selection.collapse(true);
|
837 |
editor.selection.collapse(true);
|
| 836 |
} else {
|
838 |
} else {
|
| 837 |
insertAndSelectParagraphAfter(editor, details);
|
839 |
insertAndSelectParagraphAfter(editor, details);
|
| 838 |
}
|
840 |
}
|
| 839 |
details.remove();
|
841 |
details.remove();
|
| 840 |
});
|
842 |
});
|
| - |
|
843 |
}
|
| 841 |
};
|
844 |
};
|
| 842 |
const toggleAllAccordions = (editor, state) => {
|
845 |
const toggleAllAccordions = (editor, state) => {
|
| 843 |
const accordions = Array.from(editor.getBody().querySelectorAll('details'));
|
846 |
const accordions = Array.from(editor.getBody().querySelectorAll('details'));
|
| 844 |
if (accordions.length === 0) {
|
847 |
if (accordions.length === 0) {
|
| 845 |
return;
|
848 |
return;
|