fx-platform-ui 0.0.13-alpha15 → 0.0.13-alpha17
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.
- package/lib/fx-platform-ui.mjs +65333 -32078
- package/lib/fx-platform-ui.umd.js +113 -69
- package/lib/packages/components/area/src/index.vue.d.ts +2 -2
- package/lib/packages/components/confirm/index.d.ts +2 -0
- package/lib/packages/components/confirm/src/confirm.vue.d.ts +2 -0
- package/lib/packages/components/confirm/src/index.d.ts +2 -0
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/.DS_Store +0 -0
- package/packages/component.ts +3 -2
- package/packages/components/confirm/index.ts +9 -0
- package/packages/components/confirm/src/confirm.vue +75 -0
- package/packages/components/confirm/src/index.module.less +61 -0
- package/packages/components/confirm/src/index.tsx +91 -0
- package/packages/components/confirm/src/plat-confirm-props.ts +40 -0
- package/packages/components/editor/src/index.vue +22 -21
- package/packages/components/table/src/hook/useTableMethods.tsx +1 -1
- package/packages/components/table/src/plat-table-emits.ts +1 -1
- package/CHANGELOG.md +0 -46
- package/lib/tinymce/CHANGELOG.md +0 -2957
- package/lib/tinymce/README.md +0 -71
- package/lib/tinymce/bower.json +0 -27
- package/lib/tinymce/composer.json +0 -52
- package/lib/tinymce/icons/default/icons.js +0 -182
- package/lib/tinymce/icons/default/icons.min.js +0 -1
- package/lib/tinymce/icons/default/index.js +0 -7
- package/lib/tinymce/license.txt +0 -21
- package/lib/tinymce/models/dom/index.js +0 -7
- package/lib/tinymce/models/dom/model.js +0 -7975
- package/lib/tinymce/models/dom/model.min.js +0 -4
- package/lib/tinymce/package.json +0 -32
- package/lib/tinymce/plugins/advlist/index.js +0 -7
- package/lib/tinymce/plugins/advlist/plugin.js +0 -246
- package/lib/tinymce/plugins/advlist/plugin.min.js +0 -4
- package/lib/tinymce/plugins/anchor/index.js +0 -7
- package/lib/tinymce/plugins/anchor/plugin.js +0 -195
- package/lib/tinymce/plugins/anchor/plugin.min.js +0 -4
- package/lib/tinymce/plugins/autolink/index.js +0 -7
- package/lib/tinymce/plugins/autolink/plugin.js +0 -232
- package/lib/tinymce/plugins/autolink/plugin.min.js +0 -4
- package/lib/tinymce/plugins/autoresize/index.js +0 -7
- package/lib/tinymce/plugins/autoresize/plugin.js +0 -156
- package/lib/tinymce/plugins/autoresize/plugin.min.js +0 -4
- package/lib/tinymce/plugins/autosave/index.js +0 -7
- package/lib/tinymce/plugins/autosave/plugin.js +0 -232
- package/lib/tinymce/plugins/autosave/plugin.min.js +0 -4
- package/lib/tinymce/plugins/charmap/index.js +0 -7
- package/lib/tinymce/plugins/charmap/plugin.js +0 -1636
- package/lib/tinymce/plugins/charmap/plugin.min.js +0 -4
- package/lib/tinymce/plugins/code/index.js +0 -7
- package/lib/tinymce/plugins/code/plugin.js +0 -85
- package/lib/tinymce/plugins/code/plugin.min.js +0 -4
- package/lib/tinymce/plugins/codesample/index.js +0 -7
- package/lib/tinymce/plugins/codesample/plugin.js +0 -2451
- package/lib/tinymce/plugins/codesample/plugin.min.js +0 -4
- package/lib/tinymce/plugins/directionality/index.js +0 -7
- package/lib/tinymce/plugins/directionality/plugin.js +0 -384
- package/lib/tinymce/plugins/directionality/plugin.min.js +0 -4
- package/lib/tinymce/plugins/emoticons/index.js +0 -7
- package/lib/tinymce/plugins/emoticons/js/emojiimages.js +0 -1
- package/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +0 -3
- package/lib/tinymce/plugins/emoticons/js/emojis.js +0 -1
- package/lib/tinymce/plugins/emoticons/js/emojis.min.js +0 -2
- package/lib/tinymce/plugins/emoticons/plugin.js +0 -577
- package/lib/tinymce/plugins/emoticons/plugin.min.js +0 -4
- package/lib/tinymce/plugins/fullscreen/index.js +0 -7
- package/lib/tinymce/plugins/fullscreen/plugin.js +0 -1190
- package/lib/tinymce/plugins/fullscreen/plugin.min.js +0 -4
- package/lib/tinymce/plugins/help/index.js +0 -7
- package/lib/tinymce/plugins/help/plugin.js +0 -848
- package/lib/tinymce/plugins/help/plugin.min.js +0 -4
- package/lib/tinymce/plugins/image/index.js +0 -7
- package/lib/tinymce/plugins/image/plugin.js +0 -1475
- package/lib/tinymce/plugins/image/plugin.min.js +0 -4
- package/lib/tinymce/plugins/importcss/index.js +0 -7
- package/lib/tinymce/plugins/importcss/plugin.js +0 -342
- package/lib/tinymce/plugins/importcss/plugin.min.js +0 -4
- package/lib/tinymce/plugins/insertdatetime/index.js +0 -7
- package/lib/tinymce/plugins/insertdatetime/plugin.js +0 -176
- package/lib/tinymce/plugins/insertdatetime/plugin.min.js +0 -4
- package/lib/tinymce/plugins/link/index.js +0 -7
- package/lib/tinymce/plugins/link/plugin.js +0 -1190
- package/lib/tinymce/plugins/link/plugin.min.js +0 -4
- package/lib/tinymce/plugins/lists/index.js +0 -7
- package/lib/tinymce/plugins/lists/plugin.js +0 -1820
- package/lib/tinymce/plugins/lists/plugin.min.js +0 -4
- package/lib/tinymce/plugins/media/index.js +0 -7
- package/lib/tinymce/plugins/media/plugin.js +0 -1157
- package/lib/tinymce/plugins/media/plugin.min.js +0 -4
- package/lib/tinymce/plugins/nonbreaking/index.js +0 -7
- package/lib/tinymce/plugins/nonbreaking/plugin.js +0 -111
- package/lib/tinymce/plugins/nonbreaking/plugin.min.js +0 -4
- package/lib/tinymce/plugins/pagebreak/index.js +0 -7
- package/lib/tinymce/plugins/pagebreak/plugin.js +0 -105
- package/lib/tinymce/plugins/pagebreak/plugin.min.js +0 -4
- package/lib/tinymce/plugins/preview/index.js +0 -7
- package/lib/tinymce/plugins/preview/plugin.js +0 -97
- package/lib/tinymce/plugins/preview/plugin.min.js +0 -4
- package/lib/tinymce/plugins/quickbars/index.js +0 -7
- package/lib/tinymce/plugins/quickbars/plugin.js +0 -421
- package/lib/tinymce/plugins/quickbars/plugin.min.js +0 -4
- package/lib/tinymce/plugins/save/index.js +0 -7
- package/lib/tinymce/plugins/save/plugin.js +0 -118
- package/lib/tinymce/plugins/save/plugin.min.js +0 -4
- package/lib/tinymce/plugins/searchreplace/index.js +0 -7
- package/lib/tinymce/plugins/searchreplace/plugin.js +0 -1079
- package/lib/tinymce/plugins/searchreplace/plugin.min.js +0 -4
- package/lib/tinymce/plugins/table/index.js +0 -7
- package/lib/tinymce/plugins/table/plugin.js +0 -3393
- package/lib/tinymce/plugins/table/plugin.min.js +0 -4
- package/lib/tinymce/plugins/template/index.js +0 -7
- package/lib/tinymce/plugins/template/plugin.js +0 -548
- package/lib/tinymce/plugins/template/plugin.min.js +0 -4
- package/lib/tinymce/plugins/visualblocks/index.js +0 -7
- package/lib/tinymce/plugins/visualblocks/plugin.js +0 -98
- package/lib/tinymce/plugins/visualblocks/plugin.min.js +0 -4
- package/lib/tinymce/plugins/visualchars/index.js +0 -7
- package/lib/tinymce/plugins/visualchars/plugin.js +0 -506
- package/lib/tinymce/plugins/visualchars/plugin.min.js +0 -4
- package/lib/tinymce/plugins/wordcount/index.js +0 -7
- package/lib/tinymce/plugins/wordcount/plugin.js +0 -404
- package/lib/tinymce/plugins/wordcount/plugin.min.js +0 -4
- package/lib/tinymce/themes/silver/index.js +0 -7
- package/lib/tinymce/themes/silver/theme.js +0 -26184
- package/lib/tinymce/themes/silver/theme.min.js +0 -4
- package/lib/tinymce/tinymce.d.ts +0 -2895
- package/lib/tinymce/tinymce.js +0 -29400
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 6.1.2 (2022-07-29)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
(function () {
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
|
-
|
|
10
|
-
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
|
|
11
|
-
|
|
12
|
-
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
13
|
-
|
|
14
|
-
const option = name => editor => editor.options.get(name);
|
|
15
|
-
const register$2 = editor => {
|
|
16
|
-
const registerOption = editor.options.register;
|
|
17
|
-
registerOption('allow_html_in_named_anchor', {
|
|
18
|
-
processor: 'boolean',
|
|
19
|
-
default: false
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const allowHtmlInNamedAnchor = option('allow_html_in_named_anchor');
|
|
23
|
-
|
|
24
|
-
const namedAnchorSelector = 'a:not([href])';
|
|
25
|
-
const isEmptyString = str => !str;
|
|
26
|
-
const getIdFromAnchor = elm => {
|
|
27
|
-
const id = elm.getAttribute('id') || elm.getAttribute('name');
|
|
28
|
-
return id || '';
|
|
29
|
-
};
|
|
30
|
-
const isAnchor = elm => elm && elm.nodeName.toLowerCase() === 'a';
|
|
31
|
-
const isNamedAnchor = elm => isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
|
|
32
|
-
const isEmptyNamedAnchor = elm => isNamedAnchor(elm) && !elm.firstChild;
|
|
33
|
-
|
|
34
|
-
const removeEmptyNamedAnchorsInSelection = editor => {
|
|
35
|
-
const dom = editor.dom;
|
|
36
|
-
global$1(dom).walk(editor.selection.getRng(), nodes => {
|
|
37
|
-
global.each(nodes, node => {
|
|
38
|
-
if (isEmptyNamedAnchor(node)) {
|
|
39
|
-
dom.remove(node, false);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const isValidId = id => /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
|
|
45
|
-
const getNamedAnchor = editor => editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector);
|
|
46
|
-
const getId = editor => {
|
|
47
|
-
const anchor = getNamedAnchor(editor);
|
|
48
|
-
if (anchor) {
|
|
49
|
-
return getIdFromAnchor(anchor);
|
|
50
|
-
} else {
|
|
51
|
-
return '';
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const createAnchor = (editor, id) => {
|
|
55
|
-
editor.undoManager.transact(() => {
|
|
56
|
-
if (!allowHtmlInNamedAnchor(editor)) {
|
|
57
|
-
editor.selection.collapse(true);
|
|
58
|
-
}
|
|
59
|
-
if (editor.selection.isCollapsed()) {
|
|
60
|
-
editor.insertContent(editor.dom.createHTML('a', { id }));
|
|
61
|
-
} else {
|
|
62
|
-
removeEmptyNamedAnchorsInSelection(editor);
|
|
63
|
-
editor.formatter.remove('namedAnchor', null, null, true);
|
|
64
|
-
editor.formatter.apply('namedAnchor', { value: id });
|
|
65
|
-
editor.addVisual();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const updateAnchor = (editor, id, anchorElement) => {
|
|
70
|
-
anchorElement.removeAttribute('name');
|
|
71
|
-
anchorElement.id = id;
|
|
72
|
-
editor.addVisual();
|
|
73
|
-
editor.undoManager.add();
|
|
74
|
-
};
|
|
75
|
-
const insert = (editor, id) => {
|
|
76
|
-
const anchor = getNamedAnchor(editor);
|
|
77
|
-
if (anchor) {
|
|
78
|
-
updateAnchor(editor, id, anchor);
|
|
79
|
-
} else {
|
|
80
|
-
createAnchor(editor, id);
|
|
81
|
-
}
|
|
82
|
-
editor.focus();
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const insertAnchor = (editor, newId) => {
|
|
86
|
-
if (!isValidId(newId)) {
|
|
87
|
-
editor.windowManager.alert('ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.');
|
|
88
|
-
return false;
|
|
89
|
-
} else {
|
|
90
|
-
insert(editor, newId);
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const open = editor => {
|
|
95
|
-
const currentId = getId(editor);
|
|
96
|
-
editor.windowManager.open({
|
|
97
|
-
title: 'Anchor',
|
|
98
|
-
size: 'normal',
|
|
99
|
-
body: {
|
|
100
|
-
type: 'panel',
|
|
101
|
-
items: [{
|
|
102
|
-
name: 'id',
|
|
103
|
-
type: 'input',
|
|
104
|
-
label: 'ID',
|
|
105
|
-
placeholder: 'example'
|
|
106
|
-
}]
|
|
107
|
-
},
|
|
108
|
-
buttons: [
|
|
109
|
-
{
|
|
110
|
-
type: 'cancel',
|
|
111
|
-
name: 'cancel',
|
|
112
|
-
text: 'Cancel'
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
type: 'submit',
|
|
116
|
-
name: 'save',
|
|
117
|
-
text: 'Save',
|
|
118
|
-
primary: true
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
initialData: { id: currentId },
|
|
122
|
-
onSubmit: api => {
|
|
123
|
-
if (insertAnchor(editor, api.getData().id)) {
|
|
124
|
-
api.close();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const register$1 = editor => {
|
|
131
|
-
editor.addCommand('mceAnchor', () => {
|
|
132
|
-
open(editor);
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const isNamedAnchorNode = node => node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
|
|
137
|
-
const isEmptyNamedAnchorNode = node => isNamedAnchorNode(node) && !node.firstChild;
|
|
138
|
-
const setContentEditable = state => nodes => {
|
|
139
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
140
|
-
const node = nodes[i];
|
|
141
|
-
if (isEmptyNamedAnchorNode(node)) {
|
|
142
|
-
node.attr('contenteditable', state);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
const setup = editor => {
|
|
147
|
-
editor.on('PreInit', () => {
|
|
148
|
-
editor.parser.addNodeFilter('a', setContentEditable('false'));
|
|
149
|
-
editor.serializer.addNodeFilter('a', setContentEditable(null));
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const registerFormats = editor => {
|
|
154
|
-
editor.formatter.register('namedAnchor', {
|
|
155
|
-
inline: 'a',
|
|
156
|
-
selector: namedAnchorSelector,
|
|
157
|
-
remove: 'all',
|
|
158
|
-
split: true,
|
|
159
|
-
deep: true,
|
|
160
|
-
attributes: { id: '%value' },
|
|
161
|
-
onmatch: (node, _fmt, _itemName) => {
|
|
162
|
-
return isNamedAnchor(node);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const register = editor => {
|
|
168
|
-
editor.ui.registry.addToggleButton('anchor', {
|
|
169
|
-
icon: 'bookmark',
|
|
170
|
-
tooltip: 'Anchor',
|
|
171
|
-
onAction: () => editor.execCommand('mceAnchor'),
|
|
172
|
-
onSetup: buttonApi => editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind
|
|
173
|
-
});
|
|
174
|
-
editor.ui.registry.addMenuItem('anchor', {
|
|
175
|
-
icon: 'bookmark',
|
|
176
|
-
text: 'Anchor...',
|
|
177
|
-
onAction: () => editor.execCommand('mceAnchor')
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
var Plugin = () => {
|
|
182
|
-
global$2.add('anchor', editor => {
|
|
183
|
-
register$2(editor);
|
|
184
|
-
setup(editor);
|
|
185
|
-
register$1(editor);
|
|
186
|
-
register(editor);
|
|
187
|
-
editor.on('PreInit', () => {
|
|
188
|
-
registerFormats(editor);
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
Plugin();
|
|
194
|
-
|
|
195
|
-
})();
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 6.1.2 (2022-07-29)
|
|
3
|
-
*/
|
|
4
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");const o=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>e&&"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),c=(e,a)=>{const r=s(e);r?((e,t,n)=>{n.removeAttribute("name"),n.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{o(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const o=e.dom;t(o).walk(e.selection.getRng(),(e=>{n.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&o.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",null,null,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},d=e=>(e=>e&&r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let n=0;n<t.length;n++){const o=t[n];d(o)&&o.attr("contenteditable",e)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(c(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:()=>e.execCommand("mceAnchor"),onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:()=>e.execCommand("mceAnchor")})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,n)=>l(e)})})(e)}))}))}();
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 6.1.2 (2022-07-29)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
(function () {
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
|
-
|
|
10
|
-
const link = () => /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
|
|
11
|
-
|
|
12
|
-
const option = name => editor => editor.options.get(name);
|
|
13
|
-
const register = editor => {
|
|
14
|
-
const registerOption = editor.options.register;
|
|
15
|
-
registerOption('autolink_pattern', {
|
|
16
|
-
processor: 'regexp',
|
|
17
|
-
default: new RegExp('^' + link().source + '$', 'i')
|
|
18
|
-
});
|
|
19
|
-
registerOption('link_default_target', { processor: 'string' });
|
|
20
|
-
registerOption('link_default_protocol', {
|
|
21
|
-
processor: 'string',
|
|
22
|
-
default: 'https'
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
const getAutoLinkPattern = option('autolink_pattern');
|
|
26
|
-
const getDefaultLinkTarget = option('link_default_target');
|
|
27
|
-
const getDefaultLinkProtocol = option('link_default_protocol');
|
|
28
|
-
|
|
29
|
-
const hasProto = (v, constructor, predicate) => {
|
|
30
|
-
var _a;
|
|
31
|
-
if (predicate(v, constructor.prototype)) {
|
|
32
|
-
return true;
|
|
33
|
-
} else {
|
|
34
|
-
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const typeOf = x => {
|
|
38
|
-
const t = typeof x;
|
|
39
|
-
if (x === null) {
|
|
40
|
-
return 'null';
|
|
41
|
-
} else if (t === 'object' && Array.isArray(x)) {
|
|
42
|
-
return 'array';
|
|
43
|
-
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
44
|
-
return 'string';
|
|
45
|
-
} else {
|
|
46
|
-
return t;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const isType = type => value => typeOf(value) === type;
|
|
50
|
-
const isString = isType('string');
|
|
51
|
-
const isNullable = a => a === null || a === undefined;
|
|
52
|
-
const isNonNullable = a => !isNullable(a);
|
|
53
|
-
|
|
54
|
-
const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
|
|
55
|
-
const contains = (str, substr) => {
|
|
56
|
-
return str.indexOf(substr) !== -1;
|
|
57
|
-
};
|
|
58
|
-
const startsWith = (str, prefix) => {
|
|
59
|
-
return checkRange(str, prefix, 0);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const rangeEqualsBracketOrSpace = rangeString => /^[(\[{ \u00a0]$/.test(rangeString);
|
|
63
|
-
const isTextNode = node => node.nodeType === 3;
|
|
64
|
-
const isElement = node => node.nodeType === 1;
|
|
65
|
-
const scopeIndex = (container, index) => {
|
|
66
|
-
if (index < 0) {
|
|
67
|
-
index = 0;
|
|
68
|
-
}
|
|
69
|
-
if (isTextNode(container)) {
|
|
70
|
-
const len = container.data.length;
|
|
71
|
-
if (index > len) {
|
|
72
|
-
index = len;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return index;
|
|
76
|
-
};
|
|
77
|
-
const setStart = (rng, container, offset) => {
|
|
78
|
-
if (!isElement(container) || container.hasChildNodes()) {
|
|
79
|
-
rng.setStart(container, scopeIndex(container, offset));
|
|
80
|
-
} else {
|
|
81
|
-
rng.setStartBefore(container);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const setEnd = (rng, container, offset) => {
|
|
85
|
-
if (!isElement(container) || container.hasChildNodes()) {
|
|
86
|
-
rng.setEnd(container, scopeIndex(container, offset));
|
|
87
|
-
} else {
|
|
88
|
-
rng.setEndAfter(container);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
|
|
92
|
-
const isPunctuation = char => /[?!,.;:]/.test(char);
|
|
93
|
-
const parseCurrentLine = (editor, endOffset) => {
|
|
94
|
-
let end, endContainer, text, prev, len, rngText;
|
|
95
|
-
const autoLinkPattern = getAutoLinkPattern(editor);
|
|
96
|
-
if (editor.dom.getParent(editor.selection.getNode(), 'a[href]') !== null) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const rng = editor.selection.getRng().cloneRange();
|
|
100
|
-
if (rng.startOffset < 5) {
|
|
101
|
-
prev = rng.endContainer.previousSibling;
|
|
102
|
-
if (!prev) {
|
|
103
|
-
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
prev = rng.endContainer.firstChild.nextSibling;
|
|
107
|
-
}
|
|
108
|
-
len = prev.length;
|
|
109
|
-
setStart(rng, prev, len);
|
|
110
|
-
setEnd(rng, prev, len);
|
|
111
|
-
if (rng.endOffset < 5) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
end = rng.endOffset;
|
|
115
|
-
endContainer = prev;
|
|
116
|
-
} else {
|
|
117
|
-
endContainer = rng.endContainer;
|
|
118
|
-
if (!isTextNode(endContainer) && endContainer.firstChild) {
|
|
119
|
-
while (!isTextNode(endContainer) && endContainer.firstChild) {
|
|
120
|
-
endContainer = endContainer.firstChild;
|
|
121
|
-
}
|
|
122
|
-
if (isTextNode(endContainer)) {
|
|
123
|
-
setStart(rng, endContainer, 0);
|
|
124
|
-
setEnd(rng, endContainer, endContainer.nodeValue.length);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (rng.endOffset === 1) {
|
|
128
|
-
end = 2;
|
|
129
|
-
} else {
|
|
130
|
-
end = rng.endOffset - 1 - endOffset;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
const start = end;
|
|
134
|
-
do {
|
|
135
|
-
setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
|
|
136
|
-
setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
|
|
137
|
-
end -= 1;
|
|
138
|
-
rngText = rng.toString();
|
|
139
|
-
} while (!rangeEqualsBracketOrSpace(rngText) && end - 2 >= 0);
|
|
140
|
-
if (rangeEqualsBracketOrSpace(rng.toString())) {
|
|
141
|
-
setStart(rng, endContainer, end);
|
|
142
|
-
setEnd(rng, endContainer, start);
|
|
143
|
-
end += 1;
|
|
144
|
-
} else if (rng.startOffset === 0) {
|
|
145
|
-
setStart(rng, endContainer, 0);
|
|
146
|
-
setEnd(rng, endContainer, start);
|
|
147
|
-
} else {
|
|
148
|
-
setStart(rng, endContainer, end);
|
|
149
|
-
setEnd(rng, endContainer, start);
|
|
150
|
-
}
|
|
151
|
-
text = rng.toString();
|
|
152
|
-
if (isPunctuation(text.charAt(text.length - 1))) {
|
|
153
|
-
setEnd(rng, endContainer, start - 1);
|
|
154
|
-
}
|
|
155
|
-
text = rng.toString().trim();
|
|
156
|
-
const matches = text.match(autoLinkPattern);
|
|
157
|
-
const protocol = getDefaultLinkProtocol(editor);
|
|
158
|
-
if (matches) {
|
|
159
|
-
let url = matches[0];
|
|
160
|
-
if (startsWith(url, 'www.')) {
|
|
161
|
-
url = protocol + '://' + url;
|
|
162
|
-
} else if (contains(url, '@') && !hasProtocol(url)) {
|
|
163
|
-
url = 'mailto:' + url;
|
|
164
|
-
}
|
|
165
|
-
return {
|
|
166
|
-
rng,
|
|
167
|
-
url
|
|
168
|
-
};
|
|
169
|
-
} else {
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
const convertToLink = (editor, result) => {
|
|
174
|
-
const defaultLinkTarget = getDefaultLinkTarget(editor);
|
|
175
|
-
const {rng, url} = result;
|
|
176
|
-
const bookmark = editor.selection.getBookmark();
|
|
177
|
-
editor.selection.setRng(rng);
|
|
178
|
-
const command = 'createlink';
|
|
179
|
-
const args = {
|
|
180
|
-
command,
|
|
181
|
-
ui: false,
|
|
182
|
-
value: url
|
|
183
|
-
};
|
|
184
|
-
const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
|
|
185
|
-
if (!beforeExecEvent.isDefaultPrevented()) {
|
|
186
|
-
editor.getDoc().execCommand(command, false, url);
|
|
187
|
-
editor.dispatch('ExecCommand', args);
|
|
188
|
-
if (isString(defaultLinkTarget)) {
|
|
189
|
-
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
editor.selection.moveToBookmark(bookmark);
|
|
193
|
-
editor.nodeChanged();
|
|
194
|
-
};
|
|
195
|
-
const handleSpacebar = editor => {
|
|
196
|
-
const result = parseCurrentLine(editor, 0);
|
|
197
|
-
if (isNonNullable(result)) {
|
|
198
|
-
convertToLink(editor, result);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
const handleBracket = handleSpacebar;
|
|
202
|
-
const handleEnter = editor => {
|
|
203
|
-
const result = parseCurrentLine(editor, -1);
|
|
204
|
-
if (isNonNullable(result)) {
|
|
205
|
-
convertToLink(editor, result);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const setup = editor => {
|
|
209
|
-
editor.on('keydown', e => {
|
|
210
|
-
if (e.keyCode === 13 && !e.isDefaultPrevented()) {
|
|
211
|
-
handleEnter(editor);
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
editor.on('keyup', e => {
|
|
215
|
-
if (e.keyCode === 32) {
|
|
216
|
-
handleSpacebar(editor);
|
|
217
|
-
} else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
|
|
218
|
-
handleBracket(editor);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
var Plugin = () => {
|
|
224
|
-
global.add('autolink', editor => {
|
|
225
|
-
register(editor);
|
|
226
|
-
setup(editor);
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
Plugin();
|
|
231
|
-
|
|
232
|
-
})();
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 6.1.2 (2022-07-29)
|
|
3
|
-
*/
|
|
4
|
-
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>e.options.get(t),n=e("autolink_pattern"),o=e("link_default_target"),r=e("link_default_protocol"),i=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(n=o=t,(r=String).prototype.isPrototypeOf(n)||(null===(i=o.constructor)||void 0===i?void 0:i.name)===r.name)?"string":e;var n,o,r,i})(t));const s=t=>!(t=>null==t)(t),l=t=>/^[(\[{ \u00a0]$/.test(t),a=t=>3===t.nodeType,d=t=>1===t.nodeType,c=(t,e)=>{if(e<0&&(e=0),a(t)){const n=t.data.length;e>n&&(e=n)}return e},f=(t,e,n)=>{!d(e)||e.hasChildNodes()?t.setStart(e,c(e,n)):t.setStartBefore(e)},g=(t,e,n)=>{!d(e)||e.hasChildNodes()?t.setEnd(e,c(e,n)):t.setEndAfter(e)},u=(t,e)=>{let o,i,s,d,c,u;const h=n(t);if(null!==t.dom.getParent(t.selection.getNode(),"a[href]"))return;const p=t.selection.getRng().cloneRange();if(p.startOffset<5){if(d=p.endContainer.previousSibling,!d){if(!p.endContainer.firstChild||!p.endContainer.firstChild.nextSibling)return;d=p.endContainer.firstChild.nextSibling}if(c=d.length,f(p,d,c),g(p,d,c),p.endOffset<5)return;o=p.endOffset,i=d}else{if(i=p.endContainer,!a(i)&&i.firstChild){for(;!a(i)&&i.firstChild;)i=i.firstChild;a(i)&&(f(p,i,0),g(p,i,i.nodeValue.length))}o=1===p.endOffset?2:p.endOffset-1-e}const m=o;do{f(p,i,o>=2?o-2:0),g(p,i,o>=1?o-1:0),o-=1,u=p.toString()}while(!l(u)&&o-2>=0);var C;l(p.toString())?(f(p,i,o),g(p,i,m),o+=1):0===p.startOffset?(f(p,i,0),g(p,i,m)):(f(p,i,o),g(p,i,m)),s=p.toString(),C=s.charAt(s.length-1),/[?!,.;:]/.test(C)&&g(p,i,m-1),s=p.toString().trim();const k=s.match(h),y=r(t);if(k){let t=k[0];return v="www.",(w=t).length>=v.length&&w.substr(0,0+v.length)===v?t=y+"://"+t:((t,e)=>-1!==t.indexOf("@"))(t)&&!(t=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t))(t)&&(t="mailto:"+t),{rng:p,url:t}}var w,v;return null},h=(t,e)=>{const n=o(t),{rng:r,url:s}=e,l=t.selection.getBookmark();t.selection.setRng(r);const a="createlink",d={command:a,ui:!1,value:s};t.dispatch("BeforeExecCommand",d).isDefaultPrevented()||(t.getDoc().execCommand(a,!1,s),t.dispatch("ExecCommand",d),i(n)&&t.dom.setAttrib(t.selection.getNode(),"target",n)),t.selection.moveToBookmark(l),t.nodeChanged()},p=t=>{const e=u(t,0);s(e)&&h(t,e)},m=p;t.add("autolink",(t=>{(t=>{const e=t.options.register;e("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),e("link_default_target",{processor:"string"}),e("link_default_protocol",{processor:"string",default:"https"})})(t),(t=>{t.on("keydown",(e=>{13!==e.keyCode||e.isDefaultPrevented()||(t=>{const e=u(t,-1);s(e)&&h(t,e)})(t)})),t.on("keyup",(e=>{32===e.keyCode?p(t):(48===e.keyCode&&e.shiftKey||221===e.keyCode)&&m(t)}))})(t)}))}();
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 6.1.2 (2022-07-29)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
(function () {
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
const Cell = initial => {
|
|
9
|
-
let value = initial;
|
|
10
|
-
const get = () => {
|
|
11
|
-
return value;
|
|
12
|
-
};
|
|
13
|
-
const set = v => {
|
|
14
|
-
value = v;
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
get,
|
|
18
|
-
set
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
23
|
-
|
|
24
|
-
var global = tinymce.util.Tools.resolve('tinymce.Env');
|
|
25
|
-
|
|
26
|
-
const fireResizeEditor = editor => editor.dispatch('ResizeEditor');
|
|
27
|
-
|
|
28
|
-
const option = name => editor => editor.options.get(name);
|
|
29
|
-
const register$1 = editor => {
|
|
30
|
-
const registerOption = editor.options.register;
|
|
31
|
-
registerOption('autoresize_overflow_padding', {
|
|
32
|
-
processor: 'number',
|
|
33
|
-
default: 1
|
|
34
|
-
});
|
|
35
|
-
registerOption('autoresize_bottom_margin', {
|
|
36
|
-
processor: 'number',
|
|
37
|
-
default: 50
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
const getMinHeight = option('min_height');
|
|
41
|
-
const getMaxHeight = option('max_height');
|
|
42
|
-
const getAutoResizeOverflowPadding = option('autoresize_overflow_padding');
|
|
43
|
-
const getAutoResizeBottomMargin = option('autoresize_bottom_margin');
|
|
44
|
-
|
|
45
|
-
const isFullscreen = editor => editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
|
|
46
|
-
const toggleScrolling = (editor, state) => {
|
|
47
|
-
const body = editor.getBody();
|
|
48
|
-
if (body) {
|
|
49
|
-
body.style.overflowY = state ? '' : 'hidden';
|
|
50
|
-
if (!state) {
|
|
51
|
-
body.scrollTop = 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const parseCssValueToInt = (dom, elm, name, computed) => {
|
|
56
|
-
const value = parseInt(dom.getStyle(elm, name, computed), 10);
|
|
57
|
-
return isNaN(value) ? 0 : value;
|
|
58
|
-
};
|
|
59
|
-
const shouldScrollIntoView = trigger => {
|
|
60
|
-
if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
|
|
61
|
-
const setContentEvent = trigger;
|
|
62
|
-
return setContentEvent.selection === true || setContentEvent.paste === true;
|
|
63
|
-
} else {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const resize = (editor, oldSize, trigger) => {
|
|
68
|
-
var _a;
|
|
69
|
-
const dom = editor.dom;
|
|
70
|
-
const doc = editor.getDoc();
|
|
71
|
-
if (!doc) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (isFullscreen(editor)) {
|
|
75
|
-
toggleScrolling(editor, true);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const docEle = doc.documentElement;
|
|
79
|
-
const resizeBottomMargin = getAutoResizeBottomMargin(editor);
|
|
80
|
-
const minHeight = (_a = getMinHeight(editor)) !== null && _a !== void 0 ? _a : editor.getElement().offsetHeight;
|
|
81
|
-
let resizeHeight = minHeight;
|
|
82
|
-
const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
|
|
83
|
-
const marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
|
|
84
|
-
let contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
|
|
85
|
-
if (contentHeight < 0) {
|
|
86
|
-
contentHeight = 0;
|
|
87
|
-
}
|
|
88
|
-
const containerHeight = editor.getContainer().offsetHeight;
|
|
89
|
-
const contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
|
|
90
|
-
const chromeHeight = containerHeight - contentAreaHeight;
|
|
91
|
-
if (contentHeight + chromeHeight > minHeight) {
|
|
92
|
-
resizeHeight = contentHeight + chromeHeight;
|
|
93
|
-
}
|
|
94
|
-
const maxHeight = getMaxHeight(editor);
|
|
95
|
-
if (maxHeight && resizeHeight > maxHeight) {
|
|
96
|
-
resizeHeight = maxHeight;
|
|
97
|
-
toggleScrolling(editor, true);
|
|
98
|
-
} else {
|
|
99
|
-
toggleScrolling(editor, false);
|
|
100
|
-
}
|
|
101
|
-
if (resizeHeight !== oldSize.get()) {
|
|
102
|
-
const deltaSize = resizeHeight - oldSize.get();
|
|
103
|
-
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
|
|
104
|
-
oldSize.set(resizeHeight);
|
|
105
|
-
fireResizeEditor(editor);
|
|
106
|
-
if (global.browser.isSafari() && (global.os.isMacOS() || global.os.isiOS())) {
|
|
107
|
-
const win = editor.getWin();
|
|
108
|
-
win.scrollTo(win.pageXOffset, win.pageYOffset);
|
|
109
|
-
}
|
|
110
|
-
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
|
|
111
|
-
editor.selection.scrollIntoView();
|
|
112
|
-
}
|
|
113
|
-
if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
|
|
114
|
-
resize(editor, oldSize, trigger);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const setup = (editor, oldSize) => {
|
|
119
|
-
editor.on('init', () => {
|
|
120
|
-
const overflowPadding = getAutoResizeOverflowPadding(editor);
|
|
121
|
-
const dom = editor.dom;
|
|
122
|
-
dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
|
|
123
|
-
dom.setStyles(editor.getBody(), {
|
|
124
|
-
'paddingLeft': overflowPadding,
|
|
125
|
-
'paddingRight': overflowPadding,
|
|
126
|
-
'min-height': 0
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', e => {
|
|
130
|
-
resize(editor, oldSize, e);
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const register = (editor, oldSize) => {
|
|
135
|
-
editor.addCommand('mceAutoResize', () => {
|
|
136
|
-
resize(editor, oldSize);
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
var Plugin = () => {
|
|
141
|
-
global$1.add('autoresize', editor => {
|
|
142
|
-
register$1(editor);
|
|
143
|
-
if (!editor.options.isSet('resize')) {
|
|
144
|
-
editor.options.set('resize', false);
|
|
145
|
-
}
|
|
146
|
-
if (!editor.inline) {
|
|
147
|
-
const oldSize = Cell(0);
|
|
148
|
-
register(editor, oldSize);
|
|
149
|
-
setup(editor, oldSize);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
Plugin();
|
|
155
|
-
|
|
156
|
-
})();
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 6.1.2 (2022-07-29)
|
|
3
|
-
*/
|
|
4
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),n=o("min_height"),s=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},a=(e,t,o,n)=>{const s=parseInt(e.getStyle(t,o,n),10);return isNaN(s)?0:s},g=(e,o,i)=>{var c;const u=e.dom,d=e.getDoc();if(!d)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const f=d.documentElement,m=r(e),p=null!==(c=n(e))&&void 0!==c?c:e.getElement().offsetHeight;let h=p;const y=a(u,f,"margin-top",!0),v=a(u,f,"margin-bottom",!0);let C=f.offsetHeight+y+v+m;C<0&&(C=0);const S=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+S>p&&(h=C+S);const z=s(e);if(z&&h>z?(h=z,l(e,!0)):l(e,!1),h!==o.get()){const n=h-o.get();if(u.setStyle(e.getContainer(),"height",h+"px"),o.set(h),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(i)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&n<0&&g(e,o,i)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const t=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{g(e,t)}))})(e,t),((e,t)=>{e.on("init",(()=>{const t=i(e),o=e.dom;o.setStyles(e.getDoc().documentElement,{height:"auto"}),o.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t,"min-height":0})})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(o=>{g(e,t,o)}))})(e,t)}}))}();
|