@tabler/core 1.0.0-beta12 → 1.0.0-beta14
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/dist/css/demo.css +188 -248
- package/dist/css/demo.min.css +3 -3
- package/dist/css/demo.rtl.css +188 -248
- package/dist/css/demo.rtl.min.css +3 -3
- package/dist/css/tabler-flags.css +529 -266
- package/dist/css/tabler-flags.min.css +3 -3
- package/dist/css/tabler-flags.rtl.css +529 -266
- package/dist/css/tabler-flags.rtl.min.css +3 -3
- package/dist/css/tabler-payments.css +252 -127
- package/dist/css/tabler-payments.min.css +2 -2
- package/dist/css/tabler-payments.rtl.css +252 -127
- package/dist/css/tabler-payments.rtl.min.css +2 -2
- package/dist/css/tabler-vendors.css +739 -469
- package/dist/css/tabler-vendors.min.css +3 -3
- package/dist/css/tabler-vendors.rtl.css +739 -469
- package/dist/css/tabler-vendors.rtl.min.css +3 -3
- package/dist/css/tabler.css +13218 -8130
- package/dist/css/tabler.min.css +4 -4
- package/dist/css/tabler.rtl.css +13222 -8135
- package/dist/css/tabler.rtl.min.css +4 -4
- package/dist/js/demo-theme.js +2 -2
- package/dist/js/demo-theme.min.js +2 -2
- package/dist/js/demo.js +2 -2
- package/dist/js/demo.min.js +2 -2
- package/dist/js/tabler.esm.js +138 -77
- package/dist/js/tabler.esm.min.js +5 -5
- package/dist/js/tabler.js +140 -79
- package/dist/js/tabler.min.js +5 -5
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +66 -72
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +2 -2
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +65 -71
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +2 -2
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.js +66 -72
- package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js +2 -2
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -1
- package/dist/libs/tinymce/CHANGELOG.md +45 -0
- package/dist/libs/tinymce/composer.json +1 -1
- package/dist/libs/tinymce/icons/default/icons.js +2 -0
- package/dist/libs/tinymce/icons/default/icons.min.js +1 -1
- package/dist/libs/tinymce/models/dom/model.js +14 -10
- package/dist/libs/tinymce/models/dom/model.min.js +2 -2
- package/dist/libs/tinymce/package.json +1 -1
- package/dist/libs/tinymce/plugins/advlist/plugin.js +16 -9
- package/dist/libs/tinymce/plugins/advlist/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/anchor/plugin.js +7 -6
- package/dist/libs/tinymce/plugins/anchor/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/autolink/plugin.js +93 -97
- package/dist/libs/tinymce/plugins/autolink/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/autoresize/plugin.js +3 -2
- package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/autosave/plugin.js +11 -10
- package/dist/libs/tinymce/plugins/autosave/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/charmap/plugin.js +17 -7
- package/dist/libs/tinymce/plugins/charmap/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/code/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/code/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/codesample/plugin.js +4 -6
- package/dist/libs/tinymce/plugins/codesample/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/directionality/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/emoticons/plugin.js +10 -4
- package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/fullscreen/plugin.js +11 -5
- package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/help/plugin.js +92 -19
- package/dist/libs/tinymce/plugins/help/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/image/plugin.js +50 -37
- package/dist/libs/tinymce/plugins/image/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/importcss/plugin.js +8 -6
- package/dist/libs/tinymce/plugins/importcss/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +2 -3
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/link/plugin.js +57 -43
- package/dist/libs/tinymce/plugins/link/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/lists/plugin.js +120 -74
- package/dist/libs/tinymce/plugins/lists/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/media/plugin.js +39 -24
- package/dist/libs/tinymce/plugins/media/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/pagebreak/plugin.js +2 -2
- package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/preview/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/preview/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/quickbars/plugin.js +3 -2
- package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/save/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/save/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/searchreplace/plugin.js +13 -13
- package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/table/plugin.js +42 -37
- package/dist/libs/tinymce/plugins/table/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/template/plugin.js +7 -4
- package/dist/libs/tinymce/plugins/template/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/visualblocks/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/visualchars/plugin.js +9 -6
- package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/wordcount/plugin.js +6 -5
- package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +2 -2
- package/dist/libs/tinymce/skins/ui/oxide/content.css +28 -0
- package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +28 -0
- package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide/skin.css +39 -4
- package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +28 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +28 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +39 -4
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +28 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +28 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +45 -4
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +28 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +28 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +44 -3
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/dist/libs/tinymce/themes/silver/theme.js +2494 -1999
- package/dist/libs/tinymce/themes/silver/theme.min.js +2 -2
- package/dist/libs/tinymce/tinymce.d.ts +345 -169
- package/dist/libs/tinymce/tinymce.js +2988 -2392
- package/dist/libs/tinymce/tinymce.min.js +2 -2
- package/dist/libs/tom-select/dist/js/plugins/caret_position.js +164 -160
- package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/change_listener.js +1 -1
- package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +12 -7
- package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/clear_button.js +94 -89
- package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +1 -1
- package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +121 -116
- package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +234 -230
- package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +1 -1
- package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +1 -1
- package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +1 -1
- package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +112 -107
- package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/remove_button.js +149 -144
- package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +1 -1
- package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -1
- package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +277 -269
- package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -1
- package/dist/libs/tom-select/dist/js/tom-select.base.js +756 -272
- package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -1
- package/dist/libs/tom-select/dist/js/tom-select.base.min.js +329 -272
- package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -1
- package/dist/libs/tom-select/dist/js/tom-select.complete.js +761 -273
- package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -1
- package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +268 -209
- package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -1
- package/dist/libs/tom-select/dist/js/tom-select.popular.js +753 -269
- package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -1
- package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +348 -291
- package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -1
- package/package.json +22 -24
- package/src/js/src/dropdown.js +5 -2
- package/src/js/tabler.js +2 -2
- package/src/scss/_core.scss +1 -0
- package/src/scss/_utilities.scss +2 -4
- package/src/scss/_variables.scss +136 -105
- package/src/scss/demo/_examples.scss +2 -2
- package/src/scss/demo/_highlight.scss +13 -277
- package/src/scss/demo.scss +3 -3
- package/src/scss/layout/_core.scss +1 -1
- package/src/scss/layout/_dark.scss +24 -36
- package/src/scss/layout/_footer.scss +1 -1
- package/src/scss/layout/_navbar.scss +36 -44
- package/src/scss/layout/_page.scss +3 -3
- package/src/scss/layout/_root.scss +15 -0
- package/src/scss/mixins/_mixins.scss +7 -6
- package/src/scss/ui/_alerts.scss +2 -2
- package/src/scss/ui/_avatars.scss +3 -3
- package/src/scss/ui/_badges.scss +3 -3
- package/src/scss/ui/_buttons.scss +24 -12
- package/src/scss/ui/_calendars.scss +4 -4
- package/src/scss/ui/_cards.scss +40 -53
- package/src/scss/ui/_carousel.scss +4 -4
- package/src/scss/ui/_dropdowns.scss +2 -1
- package/src/scss/ui/_empty.scss +1 -1
- package/src/scss/ui/_flags.scss +1 -1
- package/src/scss/ui/_forms.scss +2 -2
- package/src/scss/ui/_grid.scss +3 -3
- package/src/scss/ui/_lists.scss +4 -4
- package/src/scss/ui/_modals.scss +1 -1
- package/src/scss/ui/_nav.scss +12 -12
- package/src/scss/ui/_offcanvas.scss +1 -5
- package/src/scss/ui/_progress.scss +1 -1
- package/src/scss/ui/_ribbons.scss +12 -7
- package/src/scss/ui/_status.scss +2 -2
- package/src/scss/ui/_steps.scss +2 -2
- package/src/scss/ui/_tables.scss +2 -2
- package/src/scss/ui/_toasts.scss +1 -1
- package/src/scss/ui/_tracking.scss +29 -0
- package/src/scss/ui/_type.scss +35 -47
- package/src/scss/ui/forms/_form-colorinput.scss +1 -1
- package/src/scss/ui/forms/_form-imagecheck.scss +12 -4
- package/src/scss/ui/forms/_form-selectgroup.scss +2 -2
- package/src/scss/utils/_colors.scss +5 -3
- package/src/scss/vendor/_apexcharts.scss +26 -0
- package/src/scss/vendor/_jsvectormap.scss +2 -2
- package/src/scss/vendor/_litepicker.scss +4 -3
- package/src/scss/vendor/_tinymce.scss +14 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
const getNumberStyles = option('advlist_number_styles');
|
|
37
37
|
const getBulletStyles = option('advlist_bullet_styles');
|
|
38
38
|
|
|
39
|
-
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
40
|
-
|
|
41
39
|
const isNullable = a => a === null || a === undefined;
|
|
42
40
|
const isNonNullable = a => !isNullable(a);
|
|
43
41
|
|
|
42
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
43
|
+
|
|
44
44
|
class Optional {
|
|
45
45
|
constructor(tag, value) {
|
|
46
46
|
this.tag = tag;
|
|
@@ -138,16 +138,21 @@
|
|
|
138
138
|
return editor.dom.isChildOf(elm, editor.getBody());
|
|
139
139
|
};
|
|
140
140
|
const isTableCellNode = node => {
|
|
141
|
-
return node && /^(TH|TD)$/.test(node.nodeName);
|
|
141
|
+
return isNonNullable(node) && /^(TH|TD)$/.test(node.nodeName);
|
|
142
142
|
};
|
|
143
143
|
const isListNode = editor => node => {
|
|
144
|
-
return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
|
|
144
|
+
return isNonNullable(node) && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
|
|
145
145
|
};
|
|
146
146
|
const getSelectedStyleType = editor => {
|
|
147
147
|
const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
|
|
148
148
|
const style = editor.dom.getStyle(listElm, 'listStyleType');
|
|
149
149
|
return Optional.from(style);
|
|
150
150
|
};
|
|
151
|
+
const isWithinNonEditable = (editor, element) => element !== null && editor.dom.getContentEditableParent(element) === 'false';
|
|
152
|
+
const isWithinNonEditableList = (editor, element) => {
|
|
153
|
+
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
|
154
|
+
return isWithinNonEditable(editor, parentList);
|
|
155
|
+
};
|
|
151
156
|
|
|
152
157
|
const findIndex = (list, predicate) => {
|
|
153
158
|
for (let index = 0; index < list.length; index++) {
|
|
@@ -163,6 +168,7 @@
|
|
|
163
168
|
return chr.toUpperCase();
|
|
164
169
|
});
|
|
165
170
|
};
|
|
171
|
+
const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
|
|
166
172
|
const isWithinList = (editor, e, nodeName) => {
|
|
167
173
|
const tableCellIndex = findIndex(e.parents, isTableCellNode);
|
|
168
174
|
const parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
|
|
@@ -172,6 +178,7 @@
|
|
|
172
178
|
const makeSetupHandler = (editor, nodeName) => api => {
|
|
173
179
|
const nodeChangeHandler = e => {
|
|
174
180
|
api.setActive(isWithinList(editor, e, nodeName));
|
|
181
|
+
api.setEnabled(!isWithinNonEditableList(editor, e.element));
|
|
175
182
|
};
|
|
176
183
|
editor.on('NodeChange', nodeChangeHandler);
|
|
177
184
|
return () => editor.off('NodeChange', nodeChangeHandler);
|
|
@@ -186,7 +193,7 @@
|
|
|
186
193
|
const items = global.map(styles, styleValue => {
|
|
187
194
|
const iconStyle = nodeName === 'OL' ? 'num' : 'bull';
|
|
188
195
|
const iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
|
|
189
|
-
const itemValue = styleValue
|
|
196
|
+
const itemValue = normalizeStyleValue(styleValue);
|
|
190
197
|
const displayText = styleValueToText(styleValue);
|
|
191
198
|
return {
|
|
192
199
|
type: 'choiceitem',
|
|
@@ -208,20 +215,20 @@
|
|
|
208
215
|
onSetup: makeSetupHandler(editor, nodeName)
|
|
209
216
|
});
|
|
210
217
|
};
|
|
211
|
-
const addButton = (editor, id, tooltip, cmd, nodeName,
|
|
218
|
+
const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
|
|
212
219
|
editor.ui.registry.addToggleButton(id, {
|
|
213
220
|
active: false,
|
|
214
221
|
tooltip,
|
|
215
222
|
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
|
|
216
223
|
onSetup: makeSetupHandler(editor, nodeName),
|
|
217
|
-
onAction: () => editor.execCommand(cmd)
|
|
224
|
+
onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
|
|
218
225
|
});
|
|
219
226
|
};
|
|
220
227
|
const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
|
|
221
228
|
if (styles.length > 1) {
|
|
222
229
|
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
|
|
223
230
|
} else {
|
|
224
|
-
addButton(editor, id, tooltip, cmd, nodeName);
|
|
231
|
+
addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
|
|
225
232
|
}
|
|
226
233
|
};
|
|
227
234
|
const register = editor => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
|
-
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,r)=>{const s="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(s,!1,!1===r?null:{"list-style-type":r})},r=t=>e=>e.options.get(t),s=r("advlist_number_styles"),n=r("advlist_bullet_styles");var
|
|
4
|
+
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,r)=>{const s="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(s,!1,!1===r?null:{"list-style-type":r})},r=t=>e=>e.options.get(t),s=r("advlist_number_styles"),n=r("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return i(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>i(t)&&/^(TH|TD)$/.test(t.nodeName),d=t=>l(t)||"default"===t?"":t,g=(t,e)=>r=>{const s=s=>{r.setActive(((t,e,r)=>{const s=((t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r]))return r;return-1})(e.parents,u),n=-1!==s?e.parents.slice(0,s):e.parents,l=o.grep(n,(t=>e=>i(e)&&/^(OL|UL|DL)$/.test(e.nodeName)&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))(t));return l.length>0&&l[0].nodeName===r})(t,s,e)),r.setEnabled(!((t,e)=>{const r=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&"false"===t.dom.getContentEditableParent(e))(t,r)})(t,s.element))};return t.on("NodeChange",s),()=>t.off("NodeChange",s)},h=(t,r,s,n,l,i)=>{i.length>1?((t,r,s,n,l,i)=>{t.ui.registry.addSplitButton(r,{tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(i,(t=>{const e="OL"===l?"num":"bull",r="disc"===t||"decimal"===t?"default":t,s=d(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:s,icon:"list-"+e+"-"+r,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(r,s)=>{e(t,l,s)},select:e=>{const r=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(e,"listStyleType");return a.from(r)})(t);return r.map((t=>e===t)).getOr(!1)},onSetup:g(t,l)})})(t,r,s,n,l,i):((t,r,s,n,l,i)=>{t.ui.registry.addToggleButton(r,{active:!1,tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:g(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,r,s,n,l,d(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{h(t,"numlist","Numbered list","InsertOrderedList","OL",s(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((r,s)=>{e(t,"UL",s["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((r,s)=>{e(t,"OL",s["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
const id = elm.getAttribute('id') || elm.getAttribute('name');
|
|
28
28
|
return id || '';
|
|
29
29
|
};
|
|
30
|
-
const isAnchor = elm => elm
|
|
30
|
+
const isAnchor = elm => elm.nodeName.toLowerCase() === 'a';
|
|
31
31
|
const isNamedAnchor = elm => isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
|
|
32
32
|
const isEmptyNamedAnchor = elm => isNamedAnchor(elm) && !elm.firstChild;
|
|
33
33
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
editor.insertContent(editor.dom.createHTML('a', { id }));
|
|
61
61
|
} else {
|
|
62
62
|
removeEmptyNamedAnchorsInSelection(editor);
|
|
63
|
-
editor.formatter.remove('namedAnchor',
|
|
63
|
+
editor.formatter.remove('namedAnchor', undefined, undefined, true);
|
|
64
64
|
editor.formatter.apply('namedAnchor', { value: id });
|
|
65
65
|
editor.addVisual();
|
|
66
66
|
}
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
});
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
const isNamedAnchorNode = node =>
|
|
136
|
+
const isNamedAnchorNode = node => isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
|
|
137
137
|
const isEmptyNamedAnchorNode = node => isNamedAnchorNode(node) && !node.firstChild;
|
|
138
138
|
const setContentEditable = state => nodes => {
|
|
139
139
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -165,16 +165,17 @@
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
const register = editor => {
|
|
168
|
+
const onAction = () => editor.execCommand('mceAnchor');
|
|
168
169
|
editor.ui.registry.addToggleButton('anchor', {
|
|
169
170
|
icon: 'bookmark',
|
|
170
171
|
tooltip: 'Anchor',
|
|
171
|
-
onAction
|
|
172
|
+
onAction,
|
|
172
173
|
onSetup: buttonApi => editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind
|
|
173
174
|
});
|
|
174
175
|
editor.ui.registry.addMenuItem('anchor', {
|
|
175
176
|
icon: 'bookmark',
|
|
176
177
|
text: 'Anchor...',
|
|
177
|
-
onAction
|
|
178
|
+
onAction
|
|
178
179
|
});
|
|
179
180
|
};
|
|
180
181
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),
|
|
4
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("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=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.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)?(d(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=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t})})(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,o)=>l(e)})})(e)}))}))}();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
8
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
9
|
|
|
10
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
11
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
const getAutoLinkPattern = option('autolink_pattern');
|
|
26
26
|
const getDefaultLinkTarget = option('link_default_target');
|
|
27
27
|
const getDefaultLinkProtocol = option('link_default_protocol');
|
|
28
|
+
const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
|
|
28
29
|
|
|
29
30
|
const hasProto = (v, constructor, predicate) => {
|
|
30
31
|
var _a;
|
|
@@ -47,123 +48,113 @@
|
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
const isType = type => value => typeOf(value) === type;
|
|
51
|
+
const eq = t => a => t === a;
|
|
50
52
|
const isString = isType('string');
|
|
53
|
+
const isUndefined = eq(undefined);
|
|
51
54
|
const isNullable = a => a === null || a === undefined;
|
|
52
55
|
const isNonNullable = a => !isNullable(a);
|
|
53
56
|
|
|
57
|
+
const not = f => t => !f(t);
|
|
58
|
+
|
|
59
|
+
const hasOwnProperty = Object.hasOwnProperty;
|
|
60
|
+
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
|
61
|
+
|
|
54
62
|
const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
|
|
55
|
-
const contains = (str, substr) => {
|
|
56
|
-
|
|
63
|
+
const contains = (str, substr, start = 0, end) => {
|
|
64
|
+
const idx = str.indexOf(substr, start);
|
|
65
|
+
if (idx !== -1) {
|
|
66
|
+
return isUndefined(end) ? true : idx + substr.length <= end;
|
|
67
|
+
} else {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
57
70
|
};
|
|
58
71
|
const startsWith = (str, prefix) => {
|
|
59
72
|
return checkRange(str, prefix, 0);
|
|
60
73
|
};
|
|
61
74
|
|
|
62
|
-
const
|
|
75
|
+
const zeroWidth = '\uFEFF';
|
|
76
|
+
const isZwsp = char => char === zeroWidth;
|
|
77
|
+
const removeZwsp = s => s.replace(/\uFEFF/g, '');
|
|
78
|
+
|
|
79
|
+
var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
|
|
80
|
+
|
|
63
81
|
const isTextNode = node => node.nodeType === 3;
|
|
64
82
|
const isElement = node => node.nodeType === 1;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
|
|
83
|
+
const isBracketOrSpace = char => /^[(\[{ \u00a0]$/.test(char);
|
|
84
|
+
const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
|
|
85
|
+
const isPunctuation = char => /[?!,.;:]/.test(char);
|
|
86
|
+
const findChar = (text, index, predicate) => {
|
|
87
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
88
|
+
const char = text.charAt(i);
|
|
89
|
+
if (!isZwsp(char) && predicate(char)) {
|
|
90
|
+
return i;
|
|
73
91
|
}
|
|
74
92
|
}
|
|
75
|
-
return
|
|
93
|
+
return -1;
|
|
76
94
|
};
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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);
|
|
95
|
+
const freefallRtl = (container, offset) => {
|
|
96
|
+
let tempNode = container;
|
|
97
|
+
let tempOffset = offset;
|
|
98
|
+
while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
|
|
99
|
+
tempNode = tempNode.childNodes[tempOffset];
|
|
100
|
+
tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
|
|
89
101
|
}
|
|
102
|
+
return {
|
|
103
|
+
container: tempNode,
|
|
104
|
+
offset: tempOffset
|
|
105
|
+
};
|
|
90
106
|
};
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
|
|
108
|
+
const parseCurrentLine = (editor, offset) => {
|
|
109
|
+
var _a;
|
|
110
|
+
const voidElements = editor.schema.getVoidElements();
|
|
95
111
|
const autoLinkPattern = getAutoLinkPattern(editor);
|
|
96
|
-
|
|
97
|
-
|
|
112
|
+
const {dom, selection} = editor;
|
|
113
|
+
if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
|
|
114
|
+
return null;
|
|
98
115
|
}
|
|
99
|
-
const rng =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
}
|
|
116
|
+
const rng = selection.getRng();
|
|
117
|
+
const textSeeker = global(dom, node => {
|
|
118
|
+
return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false';
|
|
119
|
+
});
|
|
120
|
+
const {
|
|
121
|
+
container: endContainer,
|
|
122
|
+
offset: endOffset
|
|
123
|
+
} = freefallRtl(rng.endContainer, rng.endOffset);
|
|
124
|
+
const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
|
|
125
|
+
const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
|
|
126
|
+
const text = node.data;
|
|
127
|
+
const idx = findChar(text, offset, not(isBracketOrSpace));
|
|
128
|
+
return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
|
|
129
|
+
}, root);
|
|
130
|
+
if (!endSpot) {
|
|
131
|
+
return null;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
setStart(
|
|
142
|
-
setEnd(rng, endContainer, start);
|
|
143
|
-
end += 1;
|
|
144
|
-
} else if (rng.startOffset === 0) {
|
|
145
|
-
setStart(rng, endContainer, 0);
|
|
146
|
-
setEnd(rng, endContainer, start);
|
|
133
|
+
let lastTextNode = endSpot.container;
|
|
134
|
+
const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
|
|
135
|
+
lastTextNode = node;
|
|
136
|
+
const idx = findChar(node.data, offset, isBracketOrSpace);
|
|
137
|
+
return idx === -1 ? idx : idx + 1;
|
|
138
|
+
}, root);
|
|
139
|
+
const newRng = dom.createRng();
|
|
140
|
+
if (!startSpot) {
|
|
141
|
+
newRng.setStart(lastTextNode, 0);
|
|
147
142
|
} else {
|
|
148
|
-
setStart(
|
|
149
|
-
setEnd(rng, endContainer, start);
|
|
143
|
+
newRng.setStart(startSpot.container, startSpot.offset);
|
|
150
144
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
text = rng.toString().trim();
|
|
156
|
-
const matches = text.match(autoLinkPattern);
|
|
157
|
-
const protocol = getDefaultLinkProtocol(editor);
|
|
145
|
+
newRng.setEnd(endSpot.container, endSpot.offset);
|
|
146
|
+
const rngText = removeZwsp(newRng.toString());
|
|
147
|
+
const matches = rngText.match(autoLinkPattern);
|
|
158
148
|
if (matches) {
|
|
159
149
|
let url = matches[0];
|
|
160
150
|
if (startsWith(url, 'www.')) {
|
|
151
|
+
const protocol = getDefaultLinkProtocol(editor);
|
|
161
152
|
url = protocol + '://' + url;
|
|
162
153
|
} else if (contains(url, '@') && !hasProtocol(url)) {
|
|
163
154
|
url = 'mailto:' + url;
|
|
164
155
|
}
|
|
165
156
|
return {
|
|
166
|
-
rng,
|
|
157
|
+
rng: newRng,
|
|
167
158
|
url
|
|
168
159
|
};
|
|
169
160
|
} else {
|
|
@@ -171,10 +162,10 @@
|
|
|
171
162
|
}
|
|
172
163
|
};
|
|
173
164
|
const convertToLink = (editor, result) => {
|
|
174
|
-
const
|
|
165
|
+
const {dom, selection} = editor;
|
|
175
166
|
const {rng, url} = result;
|
|
176
|
-
const bookmark =
|
|
177
|
-
|
|
167
|
+
const bookmark = selection.getBookmark();
|
|
168
|
+
selection.setRng(rng);
|
|
178
169
|
const command = 'createlink';
|
|
179
170
|
const args = {
|
|
180
171
|
command,
|
|
@@ -185,22 +176,27 @@
|
|
|
185
176
|
if (!beforeExecEvent.isDefaultPrevented()) {
|
|
186
177
|
editor.getDoc().execCommand(command, false, url);
|
|
187
178
|
editor.dispatch('ExecCommand', args);
|
|
179
|
+
const defaultLinkTarget = getDefaultLinkTarget(editor);
|
|
188
180
|
if (isString(defaultLinkTarget)) {
|
|
189
|
-
|
|
181
|
+
const anchor = selection.getNode();
|
|
182
|
+
dom.setAttrib(anchor, 'target', defaultLinkTarget);
|
|
183
|
+
if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
|
|
184
|
+
dom.setAttrib(anchor, 'rel', 'noopener');
|
|
185
|
+
}
|
|
190
186
|
}
|
|
191
187
|
}
|
|
192
|
-
|
|
188
|
+
selection.moveToBookmark(bookmark);
|
|
193
189
|
editor.nodeChanged();
|
|
194
190
|
};
|
|
195
191
|
const handleSpacebar = editor => {
|
|
196
|
-
const result = parseCurrentLine(editor,
|
|
192
|
+
const result = parseCurrentLine(editor, -1);
|
|
197
193
|
if (isNonNullable(result)) {
|
|
198
194
|
convertToLink(editor, result);
|
|
199
195
|
}
|
|
200
196
|
};
|
|
201
197
|
const handleBracket = handleSpacebar;
|
|
202
198
|
const handleEnter = editor => {
|
|
203
|
-
const result = parseCurrentLine(editor,
|
|
199
|
+
const result = parseCurrentLine(editor, 0);
|
|
204
200
|
if (isNonNullable(result)) {
|
|
205
201
|
convertToLink(editor, result);
|
|
206
202
|
}
|
|
@@ -221,7 +217,7 @@
|
|
|
221
217
|
};
|
|
222
218
|
|
|
223
219
|
var Plugin = () => {
|
|
224
|
-
global.add('autolink', editor => {
|
|
220
|
+
global$1.add('autolink', editor => {
|
|
225
221
|
register(editor);
|
|
226
222
|
setup(editor);
|
|
227
223
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
|
-
!function(){"use strict";var
|
|
4
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),h=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),w=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),h);if(!w)return null;let v=w.container;const _=k.backwards(w.container,w.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),h),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(w.container,w.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=$.length&&b.substr(0,0+$.length)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("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")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
const parseCssValueToInt = (dom, elm, name, computed) => {
|
|
56
|
-
|
|
56
|
+
var _a;
|
|
57
|
+
const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
|
|
57
58
|
return isNaN(value) ? 0 : value;
|
|
58
59
|
};
|
|
59
60
|
const shouldScrollIntoView = trigger => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
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
|
|
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)=>{var s;const i=parseInt(null!==(s=e.getStyle(t,o,n))&&void 0!==s?s:"",10);return isNaN(i)?0:i},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 v=a(u,f,"margin-top",!0),y=a(u,f,"margin-bottom",!0);let C=f.offsetHeight+v+y+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)}}))}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
m: 60000
|
|
49
49
|
};
|
|
50
50
|
const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
|
|
51
|
-
return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
|
|
51
|
+
return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
const option = name => editor => editor.options.get(name);
|
|
@@ -112,7 +112,8 @@
|
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
const hasDraft = editor => {
|
|
115
|
-
|
|
115
|
+
var _a;
|
|
116
|
+
const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
|
|
116
117
|
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
|
|
117
118
|
removeDraft(editor, false);
|
|
118
119
|
return false;
|
|
@@ -139,9 +140,10 @@
|
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
const restoreDraft = editor => {
|
|
143
|
+
var _a;
|
|
142
144
|
const prefix = getAutoSavePrefix(editor);
|
|
143
145
|
if (hasDraft(editor)) {
|
|
144
|
-
editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' });
|
|
146
|
+
editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
|
|
145
147
|
fireRestoreDraft(editor);
|
|
146
148
|
}
|
|
147
149
|
};
|
|
@@ -195,20 +197,19 @@
|
|
|
195
197
|
};
|
|
196
198
|
const register = editor => {
|
|
197
199
|
startStoreDraft(editor);
|
|
200
|
+
const onAction = () => {
|
|
201
|
+
restoreLastDraft(editor);
|
|
202
|
+
};
|
|
198
203
|
editor.ui.registry.addButton('restoredraft', {
|
|
199
204
|
tooltip: 'Restore last draft',
|
|
200
205
|
icon: 'restore-draft',
|
|
201
|
-
onAction
|
|
202
|
-
restoreLastDraft(editor);
|
|
203
|
-
},
|
|
206
|
+
onAction,
|
|
204
207
|
onSetup: makeSetupHandler(editor)
|
|
205
208
|
});
|
|
206
209
|
editor.ui.registry.addMenuItem('restoredraft', {
|
|
207
210
|
text: 'Restore last draft',
|
|
208
211
|
icon: 'restore-draft',
|
|
209
|
-
onAction
|
|
210
|
-
restoreLastDraft(editor);
|
|
211
|
-
},
|
|
212
|
+
onAction,
|
|
212
213
|
onSetup: makeSetupHandler(editor)
|
|
213
214
|
});
|
|
214
215
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version 6.
|
|
2
|
+
* TinyMCE version 6.2.0 (2022-09-08)
|
|
3
3
|
*/
|
|
4
|
-
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),
|
|
4
|
+
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();
|