@dangl/angular-material-shared 2.9.0-beta0040 → 2.9.0-beta0048
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/package.json +1 -1
- package/tinymce-assets/icons/default/icons.js +9 -46
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- package/tinymce-assets/models/dom/model.js +7239 -8193
- package/tinymce-assets/models/dom/model.min.js +1 -1
- package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
- package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
- package/tinymce-assets/plugins/advlist/plugin.js +200 -412
- package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
- package/tinymce-assets/plugins/anchor/plugin.js +166 -189
- package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autolink/plugin.js +220 -310
- package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
- package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autosave/plugin.js +189 -208
- package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
- package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
- package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
- package/tinymce-assets/plugins/code/plugin.js +61 -73
- package/tinymce-assets/plugins/code/plugin.min.js +4 -0
- package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
- package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
- package/tinymce-assets/plugins/directionality/plugin.js +304 -545
- package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
- package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
- package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
- package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
- package/tinymce-assets/plugins/help/plugin.js +809 -739
- package/tinymce-assets/plugins/help/plugin.min.js +5 -1
- package/tinymce-assets/plugins/image/plugin.js +1291 -1475
- package/tinymce-assets/plugins/image/plugin.min.js +5 -1
- package/tinymce-assets/plugins/importcss/plugin.js +269 -328
- package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
- package/tinymce-assets/plugins/link/plugin.js +1084 -1419
- package/tinymce-assets/plugins/link/plugin.min.js +5 -1
- package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
- package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
- package/tinymce-assets/plugins/media/plugin.js +1047 -1305
- package/tinymce-assets/plugins/media/plugin.min.js +5 -1
- package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
- package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
- package/tinymce-assets/plugins/preview/plugin.js +74 -742
- package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
- package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
- package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
- package/tinymce-assets/plugins/save/plugin.js +82 -100
- package/tinymce-assets/plugins/save/plugin.min.js +5 -1
- package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
- package/tinymce-assets/plugins/table/plugin.js +3094 -3651
- package/tinymce-assets/plugins/table/plugin.min.js +5 -1
- package/tinymce-assets/plugins/template/index.js +7 -0
- package/tinymce-assets/plugins/template/plugin.js +567 -0
- package/tinymce-assets/plugins/template/plugin.min.js +5 -0
- package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
- package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
- package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
- package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
- package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
- package/tinymce-assets/skins/content/dark/content.css +4 -0
- package/tinymce-assets/skins/content/dark/content.js +6 -1
- package/tinymce-assets/skins/content/dark/content.min.css +4 -0
- package/tinymce-assets/skins/content/default/content.css +4 -0
- package/tinymce-assets/skins/content/default/content.js +6 -1
- package/tinymce-assets/skins/content/default/content.min.css +4 -0
- package/tinymce-assets/skins/content/document/content.css +4 -0
- package/tinymce-assets/skins/content/document/content.js +6 -1
- package/tinymce-assets/skins/content/document/content.min.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
- package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
- package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
- package/tinymce-assets/skins/content/writer/content.css +4 -0
- package/tinymce-assets/skins/content/writer/content.js +6 -1
- package/tinymce-assets/skins/content/writer/content.min.css +4 -0
- package/tinymce-assets/skins/ui/oxide/content.css +53 -148
- package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide/content.js +6 -1
- package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
- package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
- package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
- package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
- package/tinymce-assets/themes/silver/theme.js +28439 -32466
- package/tinymce-assets/themes/silver/theme.min.js +1 -1
|
@@ -1,828 +1,898 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 6.8.6 (TBD)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
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$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
23
|
+
|
|
24
|
+
let unique = 0;
|
|
25
|
+
const generate = prefix => {
|
|
26
|
+
const date = new Date();
|
|
27
|
+
const time = date.getTime();
|
|
28
|
+
const random = Math.floor(Math.random() * 1000000000);
|
|
29
|
+
unique++;
|
|
30
|
+
return prefix + '_' + random + unique + String(time);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const get$1 = customTabs => {
|
|
34
|
+
const addTab = spec => {
|
|
10
35
|
var _a;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
36
|
+
const name = (_a = spec.name) !== null && _a !== void 0 ? _a : generate('tab-name');
|
|
37
|
+
const currentCustomTabs = customTabs.get();
|
|
38
|
+
currentCustomTabs[name] = spec;
|
|
39
|
+
customTabs.set(currentCustomTabs);
|
|
40
|
+
};
|
|
41
|
+
return { addTab };
|
|
18
42
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
|
|
44
|
+
const register$2 = (editor, dialogOpener) => {
|
|
45
|
+
editor.addCommand('mceHelp', dialogOpener);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const option = name => editor => editor.options.get(name);
|
|
49
|
+
const register$1 = editor => {
|
|
50
|
+
const registerOption = editor.options.register;
|
|
51
|
+
registerOption('help_tabs', { processor: 'array' });
|
|
52
|
+
};
|
|
53
|
+
const getHelpTabs = option('help_tabs');
|
|
54
|
+
const getForcedPlugins = option('forced_plugins');
|
|
55
|
+
|
|
56
|
+
const register = (editor, dialogOpener) => {
|
|
57
|
+
editor.ui.registry.addButton('help', {
|
|
58
|
+
icon: 'help',
|
|
59
|
+
tooltip: 'Help',
|
|
60
|
+
onAction: dialogOpener
|
|
61
|
+
});
|
|
62
|
+
editor.ui.registry.addMenuItem('help', {
|
|
63
|
+
text: 'Help',
|
|
64
|
+
icon: 'help',
|
|
65
|
+
shortcut: 'Alt+0',
|
|
66
|
+
onAction: dialogOpener
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const hasProto = (v, constructor, predicate) => {
|
|
71
|
+
var _a;
|
|
72
|
+
if (predicate(v, constructor.prototype)) {
|
|
73
|
+
return true;
|
|
74
|
+
} else {
|
|
75
|
+
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
76
|
+
}
|
|
33
77
|
};
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
78
|
+
const typeOf = x => {
|
|
79
|
+
const t = typeof x;
|
|
80
|
+
if (x === null) {
|
|
81
|
+
return 'null';
|
|
82
|
+
} else if (t === 'object' && Array.isArray(x)) {
|
|
83
|
+
return 'array';
|
|
84
|
+
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
85
|
+
return 'string';
|
|
86
|
+
} else {
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const isType = type => value => typeOf(value) === type;
|
|
91
|
+
const isSimpleType = type => value => typeof value === type;
|
|
92
|
+
const eq = t => a => t === a;
|
|
37
93
|
const isString = isType('string');
|
|
38
94
|
const isUndefined = eq(undefined);
|
|
39
|
-
const isNullable =
|
|
40
|
-
const isNonNullable =
|
|
95
|
+
const isNullable = a => a === null || a === undefined;
|
|
96
|
+
const isNonNullable = a => !isNullable(a);
|
|
41
97
|
const isFunction = isSimpleType('function');
|
|
42
98
|
|
|
43
|
-
const constant =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
99
|
+
const constant = value => {
|
|
100
|
+
return () => {
|
|
101
|
+
return value;
|
|
102
|
+
};
|
|
47
103
|
};
|
|
48
104
|
const never = constant(false);
|
|
49
105
|
|
|
50
|
-
/**
|
|
51
|
-
* The `Optional` type represents a value (of any type) that potentially does
|
|
52
|
-
* not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
|
|
53
|
-
* value does exist) or a `None` (in which case the value does not exist). This
|
|
54
|
-
* module defines a whole lot of FP-inspired utility functions for dealing with
|
|
55
|
-
* `Optional` objects.
|
|
56
|
-
*
|
|
57
|
-
* Comparison with null or undefined:
|
|
58
|
-
* - We don't get fancy null coalescing operators with `Optional`
|
|
59
|
-
* - We do get fancy helper functions with `Optional`
|
|
60
|
-
* - `Optional` support nesting, and allow for the type to still be nullable (or
|
|
61
|
-
* another `Optional`)
|
|
62
|
-
* - There is no option to turn off strict-optional-checks like there is for
|
|
63
|
-
* strict-null-checks
|
|
64
|
-
*/
|
|
65
106
|
class Optional {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
return this.tag && predicate(this.value);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* For a given predicate, this function finds out if **all** the values inside
|
|
159
|
-
* this `Optional` object meet the predicate. In practice, this means that
|
|
160
|
-
* for `Optional`s that do not contain a value it returns true (as all 0
|
|
161
|
-
* objects do meet the predicate).
|
|
162
|
-
*/
|
|
163
|
-
forall(predicate) {
|
|
164
|
-
return !this.tag || predicate(this.value);
|
|
165
|
-
}
|
|
166
|
-
filter(predicate) {
|
|
167
|
-
if (!this.tag || predicate(this.value)) {
|
|
168
|
-
return this;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
return Optional.none();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// --- Getters ---
|
|
175
|
-
/**
|
|
176
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
177
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
178
|
-
* value.
|
|
179
|
-
*/
|
|
180
|
-
getOr(replacement) {
|
|
181
|
-
return this.tag ? this.value : replacement;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
185
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
186
|
-
* value. Unlike `getOr`, in this method the `replacement` object is also
|
|
187
|
-
* `Optional` - meaning that this method will always return an `Optional`.
|
|
188
|
-
*/
|
|
189
|
-
or(replacement) {
|
|
190
|
-
return this.tag ? this : replacement;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
194
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
195
|
-
* value. Unlike `getOr`, in this method the `replacement` value is
|
|
196
|
-
* "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
|
|
197
|
-
* pass a function which (if called) will **return** the `value` you want to
|
|
198
|
-
* use.
|
|
199
|
-
*/
|
|
200
|
-
getOrThunk(thunk) {
|
|
201
|
-
return this.tag ? this.value : thunk();
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
205
|
-
* `replacement` value if the provided Optional object does not contain a
|
|
206
|
-
* value.
|
|
207
|
-
*
|
|
208
|
-
* Unlike `or`, in this method the `replacement` value is "thunked" - that is
|
|
209
|
-
* to say that you don't pass a value to `orThunk`, you pass a function which
|
|
210
|
-
* (if called) will **return** the `value` you want to use.
|
|
211
|
-
*
|
|
212
|
-
* Unlike `getOrThunk`, in this method the `replacement` value is also
|
|
213
|
-
* `Optional`, meaning that this method will always return an `Optional`.
|
|
214
|
-
*/
|
|
215
|
-
orThunk(thunk) {
|
|
216
|
-
return this.tag ? this : thunk();
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Get the value out of the inside of the `Optional` object, throwing an
|
|
220
|
-
* exception if the provided `Optional` object does not contain a value.
|
|
221
|
-
*
|
|
222
|
-
* WARNING:
|
|
223
|
-
* You should only be using this function if you know that the `Optional`
|
|
224
|
-
* object **is not** empty (otherwise you're throwing exceptions in production
|
|
225
|
-
* code, which is bad).
|
|
226
|
-
*
|
|
227
|
-
* In tests this is more acceptable.
|
|
228
|
-
*
|
|
229
|
-
* Prefer other methods to this, such as `.each`.
|
|
230
|
-
*/
|
|
231
|
-
getOrDie(message) {
|
|
232
|
-
if (!this.tag) {
|
|
233
|
-
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
return this.value;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
// --- Interop with null and undefined ---
|
|
240
|
-
/**
|
|
241
|
-
* Creates an `Optional` value from a nullable (or undefined-able) input.
|
|
242
|
-
* Null, or undefined, is converted to `None`, and anything else is converted
|
|
243
|
-
* to `Some`.
|
|
244
|
-
*/
|
|
245
|
-
static from(value) {
|
|
246
|
-
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Converts an `Optional` to a nullable type, by getting the value if it
|
|
250
|
-
* exists, or returning `null` if it does not.
|
|
251
|
-
*/
|
|
252
|
-
getOrNull() {
|
|
253
|
-
return this.tag ? this.value : null;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Converts an `Optional` to an undefined-able type, by getting the value if
|
|
257
|
-
* it exists, or returning `undefined` if it does not.
|
|
258
|
-
*/
|
|
259
|
-
getOrUndefined() {
|
|
260
|
-
return this.value;
|
|
261
|
-
}
|
|
262
|
-
// --- Utilities ---
|
|
263
|
-
/**
|
|
264
|
-
* If the `Optional` contains a value, perform an action on that value.
|
|
265
|
-
* Unlike the rest of the methods on this type, `.each` has side-effects. If
|
|
266
|
-
* you want to transform an `Optional<T>` **into** something, then this is not
|
|
267
|
-
* the method for you. If you want to use an `Optional<T>` to **do**
|
|
268
|
-
* something, then this is the method for you - provided you're okay with not
|
|
269
|
-
* doing anything in the case where the `Optional` doesn't have a value inside
|
|
270
|
-
* it. If you're not sure whether your use-case fits into transforming
|
|
271
|
-
* **into** something or **doing** something, check whether it has a return
|
|
272
|
-
* value. If it does, you should be performing a transform.
|
|
273
|
-
*/
|
|
274
|
-
each(worker) {
|
|
275
|
-
if (this.tag) {
|
|
276
|
-
worker(this.value);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Turn the `Optional` object into an array that contains all of the values
|
|
281
|
-
* stored inside the `Optional`. In practice, this means the output will have
|
|
282
|
-
* either 0 or 1 elements.
|
|
283
|
-
*/
|
|
284
|
-
toArray() {
|
|
285
|
-
return this.tag ? [this.value] : [];
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Turn the `Optional` object into a string for debugging or printing. Not
|
|
289
|
-
* recommended for production code, but good for debugging. Also note that
|
|
290
|
-
* these days an `Optional` object can be logged to the console directly, and
|
|
291
|
-
* its inner value (if it exists) will be visible.
|
|
292
|
-
*/
|
|
293
|
-
toString() {
|
|
294
|
-
return this.tag ? `some(${this.value})` : 'none()';
|
|
295
|
-
}
|
|
107
|
+
constructor(tag, value) {
|
|
108
|
+
this.tag = tag;
|
|
109
|
+
this.value = value;
|
|
110
|
+
}
|
|
111
|
+
static some(value) {
|
|
112
|
+
return new Optional(true, value);
|
|
113
|
+
}
|
|
114
|
+
static none() {
|
|
115
|
+
return Optional.singletonNone;
|
|
116
|
+
}
|
|
117
|
+
fold(onNone, onSome) {
|
|
118
|
+
if (this.tag) {
|
|
119
|
+
return onSome(this.value);
|
|
120
|
+
} else {
|
|
121
|
+
return onNone();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
isSome() {
|
|
125
|
+
return this.tag;
|
|
126
|
+
}
|
|
127
|
+
isNone() {
|
|
128
|
+
return !this.tag;
|
|
129
|
+
}
|
|
130
|
+
map(mapper) {
|
|
131
|
+
if (this.tag) {
|
|
132
|
+
return Optional.some(mapper(this.value));
|
|
133
|
+
} else {
|
|
134
|
+
return Optional.none();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
bind(binder) {
|
|
138
|
+
if (this.tag) {
|
|
139
|
+
return binder(this.value);
|
|
140
|
+
} else {
|
|
141
|
+
return Optional.none();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exists(predicate) {
|
|
145
|
+
return this.tag && predicate(this.value);
|
|
146
|
+
}
|
|
147
|
+
forall(predicate) {
|
|
148
|
+
return !this.tag || predicate(this.value);
|
|
149
|
+
}
|
|
150
|
+
filter(predicate) {
|
|
151
|
+
if (!this.tag || predicate(this.value)) {
|
|
152
|
+
return this;
|
|
153
|
+
} else {
|
|
154
|
+
return Optional.none();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
getOr(replacement) {
|
|
158
|
+
return this.tag ? this.value : replacement;
|
|
159
|
+
}
|
|
160
|
+
or(replacement) {
|
|
161
|
+
return this.tag ? this : replacement;
|
|
162
|
+
}
|
|
163
|
+
getOrThunk(thunk) {
|
|
164
|
+
return this.tag ? this.value : thunk();
|
|
165
|
+
}
|
|
166
|
+
orThunk(thunk) {
|
|
167
|
+
return this.tag ? this : thunk();
|
|
168
|
+
}
|
|
169
|
+
getOrDie(message) {
|
|
170
|
+
if (!this.tag) {
|
|
171
|
+
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
172
|
+
} else {
|
|
173
|
+
return this.value;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
static from(value) {
|
|
177
|
+
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
178
|
+
}
|
|
179
|
+
getOrNull() {
|
|
180
|
+
return this.tag ? this.value : null;
|
|
181
|
+
}
|
|
182
|
+
getOrUndefined() {
|
|
183
|
+
return this.value;
|
|
184
|
+
}
|
|
185
|
+
each(worker) {
|
|
186
|
+
if (this.tag) {
|
|
187
|
+
worker(this.value);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
toArray() {
|
|
191
|
+
return this.tag ? [this.value] : [];
|
|
192
|
+
}
|
|
193
|
+
toString() {
|
|
194
|
+
return this.tag ? `some(${ this.value })` : 'none()';
|
|
195
|
+
}
|
|
296
196
|
}
|
|
297
|
-
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
298
|
-
// reuse the same object
|
|
299
197
|
Optional.singletonNone = new Optional(false);
|
|
300
198
|
|
|
301
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
302
199
|
const nativeSlice = Array.prototype.slice;
|
|
303
200
|
const nativeIndexOf = Array.prototype.indexOf;
|
|
304
|
-
/* eslint-enable */
|
|
305
201
|
const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);
|
|
306
202
|
const contains = (xs, x) => rawIndexOf(xs, x) > -1;
|
|
307
203
|
const map = (xs, f) => {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
return r;
|
|
204
|
+
const len = xs.length;
|
|
205
|
+
const r = new Array(len);
|
|
206
|
+
for (let i = 0; i < len; i++) {
|
|
207
|
+
const x = xs[i];
|
|
208
|
+
r[i] = f(x, i);
|
|
209
|
+
}
|
|
210
|
+
return r;
|
|
317
211
|
};
|
|
318
212
|
const filter = (xs, pred) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
213
|
+
const r = [];
|
|
214
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
215
|
+
const x = xs[i];
|
|
216
|
+
if (pred(x, i)) {
|
|
217
|
+
r.push(x);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return r;
|
|
327
221
|
};
|
|
328
222
|
const findUntil = (xs, pred, until) => {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
return Optional.none();
|
|
223
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
224
|
+
const x = xs[i];
|
|
225
|
+
if (pred(x, i)) {
|
|
226
|
+
return Optional.some(x);
|
|
227
|
+
} else if (until(x, i)) {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return Optional.none();
|
|
339
232
|
};
|
|
340
233
|
const find = (xs, pred) => {
|
|
341
|
-
|
|
234
|
+
return findUntil(xs, pred, never);
|
|
342
235
|
};
|
|
343
236
|
const sort = (xs, comparator) => {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
237
|
+
const copy = nativeSlice.call(xs, 0);
|
|
238
|
+
copy.sort(comparator);
|
|
239
|
+
return copy;
|
|
347
240
|
};
|
|
348
|
-
isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
|
|
349
241
|
|
|
350
|
-
// There are many variations of Object iteration that are faster than the 'for-in' style:
|
|
351
|
-
// http://jsperf.com/object-keys-iteration/107
|
|
352
|
-
//
|
|
353
|
-
// Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
|
|
354
242
|
const keys = Object.keys;
|
|
355
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
356
243
|
const hasOwnProperty = Object.hasOwnProperty;
|
|
357
|
-
const get
|
|
358
|
-
|
|
244
|
+
const get = (obj, key) => {
|
|
245
|
+
return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
|
|
359
246
|
};
|
|
360
247
|
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
|
361
248
|
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
get,
|
|
372
|
-
set
|
|
373
|
-
};
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Adds two numbers, and wrap to a range.
|
|
378
|
-
* If the result overflows to the right, snap to the left.
|
|
379
|
-
* If the result overflows to the left, snap to the right.
|
|
380
|
-
*/
|
|
381
|
-
// the division is meant to get a number between 0 and 1 for more information check this discussion: https://stackoverflow.com/questions/58285941/how-to-replace-math-random-with-crypto-getrandomvalues-and-keep-same-result
|
|
382
|
-
const random = () => window.crypto.getRandomValues(new Uint32Array(1))[0] / 4294967295;
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Generate a unique identifier.
|
|
386
|
-
*
|
|
387
|
-
* The unique portion of the identifier only contains an underscore
|
|
388
|
-
* and digits, so that it may safely be used within HTML attributes.
|
|
389
|
-
*
|
|
390
|
-
* The chance of generating a non-unique identifier has been minimized
|
|
391
|
-
* by combining the current time, a random number and a one-up counter.
|
|
392
|
-
*
|
|
393
|
-
* generate :: String -> String
|
|
394
|
-
*/
|
|
395
|
-
let unique = 0;
|
|
396
|
-
const generate = (prefix) => {
|
|
397
|
-
const date = new Date();
|
|
398
|
-
const time = date.getTime();
|
|
399
|
-
const random$1 = Math.floor(random() * 1000000000);
|
|
400
|
-
unique++;
|
|
401
|
-
return prefix + '_' + random$1 + unique + String(time);
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
const cat = (arr) => {
|
|
405
|
-
const r = [];
|
|
406
|
-
const push = (x) => {
|
|
407
|
-
r.push(x);
|
|
408
|
-
};
|
|
409
|
-
for (let i = 0; i < arr.length; i++) {
|
|
410
|
-
arr[i].each(push);
|
|
411
|
-
}
|
|
412
|
-
return r;
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
416
|
-
|
|
417
|
-
const get = (customTabs) => {
|
|
418
|
-
const addTab = (spec) => {
|
|
419
|
-
var _a;
|
|
420
|
-
const name = (_a = spec.name) !== null && _a !== void 0 ? _a : generate('tab-name');
|
|
421
|
-
const currentCustomTabs = customTabs.get();
|
|
422
|
-
currentCustomTabs[name] = spec;
|
|
423
|
-
customTabs.set(currentCustomTabs);
|
|
424
|
-
};
|
|
425
|
-
return {
|
|
426
|
-
addTab
|
|
427
|
-
};
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
const register$2 = (editor, dialogOpener) => {
|
|
431
|
-
editor.addCommand('mceHelp', dialogOpener);
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
const option = (name) => (editor) => editor.options.get(name);
|
|
435
|
-
const register$1 = (editor) => {
|
|
436
|
-
const registerOption = editor.options.register;
|
|
437
|
-
registerOption('help_tabs', {
|
|
438
|
-
processor: 'array'
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
const getHelpTabs = option('help_tabs');
|
|
442
|
-
const getForcedPlugins = option('forced_plugins');
|
|
443
|
-
|
|
444
|
-
const register = (editor, dialogOpener) => {
|
|
445
|
-
editor.ui.registry.addButton('help', {
|
|
446
|
-
icon: 'help',
|
|
447
|
-
tooltip: 'Help',
|
|
448
|
-
onAction: dialogOpener,
|
|
449
|
-
context: 'any'
|
|
450
|
-
});
|
|
451
|
-
editor.ui.registry.addMenuItem('help', {
|
|
452
|
-
text: 'Help',
|
|
453
|
-
icon: 'help',
|
|
454
|
-
shortcut: 'Alt+0',
|
|
455
|
-
onAction: dialogOpener,
|
|
456
|
-
context: 'any'
|
|
457
|
-
});
|
|
249
|
+
const cat = arr => {
|
|
250
|
+
const r = [];
|
|
251
|
+
const push = x => {
|
|
252
|
+
r.push(x);
|
|
253
|
+
};
|
|
254
|
+
for (let i = 0; i < arr.length; i++) {
|
|
255
|
+
arr[i].each(push);
|
|
256
|
+
}
|
|
257
|
+
return r;
|
|
458
258
|
};
|
|
459
259
|
|
|
460
260
|
var global$3 = tinymce.util.Tools.resolve('tinymce.Resource');
|
|
461
261
|
|
|
462
262
|
var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n');
|
|
463
263
|
|
|
464
|
-
const pLoadHtmlByLangCode = (baseUrl, langCode) => global$3.load(`tinymce.html-i18n.help-keynav.${langCode}`, `${baseUrl}/js/i18n/keynav/${langCode}.js`);
|
|
465
|
-
const pLoadI18nHtml = (baseUrl) =>
|
|
466
|
-
// TINY-9928: Load language file for the current language, or English if the file is not available
|
|
467
|
-
pLoadHtmlByLangCode(baseUrl, global$2.getCode()).catch(() => pLoadHtmlByLangCode(baseUrl, 'en'));
|
|
264
|
+
const pLoadHtmlByLangCode = (baseUrl, langCode) => global$3.load(`tinymce.html-i18n.help-keynav.${ langCode }`, `${ baseUrl }/js/i18n/keynav/${ langCode }.js`);
|
|
265
|
+
const pLoadI18nHtml = baseUrl => pLoadHtmlByLangCode(baseUrl, global$2.getCode()).catch(() => pLoadHtmlByLangCode(baseUrl, 'en'));
|
|
468
266
|
const initI18nLoad = (editor, baseUrl) => {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
});
|
|
267
|
+
editor.on('init', () => {
|
|
268
|
+
pLoadI18nHtml(baseUrl);
|
|
269
|
+
});
|
|
473
270
|
};
|
|
474
271
|
|
|
475
|
-
const pTab = async
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
272
|
+
const pTab = async pluginUrl => {
|
|
273
|
+
const body = {
|
|
274
|
+
type: 'htmlpanel',
|
|
275
|
+
presets: 'document',
|
|
276
|
+
html: await pLoadI18nHtml(pluginUrl)
|
|
277
|
+
};
|
|
278
|
+
return {
|
|
279
|
+
name: 'keyboardnav',
|
|
280
|
+
title: 'Keyboard Navigation',
|
|
281
|
+
items: [body]
|
|
282
|
+
};
|
|
486
283
|
};
|
|
487
284
|
|
|
488
285
|
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
|
489
286
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
});
|
|
511
|
-
return isMac ? (updated.join('')).replace(/\s/, '') : updated.join('+');
|
|
287
|
+
const convertText = source => {
|
|
288
|
+
const isMac = global$1.os.isMacOS() || global$1.os.isiOS();
|
|
289
|
+
const mac = {
|
|
290
|
+
alt: '⌥',
|
|
291
|
+
ctrl: '⌃',
|
|
292
|
+
shift: '⇧',
|
|
293
|
+
meta: '⌘',
|
|
294
|
+
access: '⌃⌥'
|
|
295
|
+
};
|
|
296
|
+
const other = {
|
|
297
|
+
meta: 'Ctrl ',
|
|
298
|
+
access: 'Shift + Alt '
|
|
299
|
+
};
|
|
300
|
+
const replace = isMac ? mac : other;
|
|
301
|
+
const shortcut = source.split('+');
|
|
302
|
+
const updated = map(shortcut, segment => {
|
|
303
|
+
const search = segment.toLowerCase().trim();
|
|
304
|
+
return has(replace, search) ? replace[search] : segment;
|
|
305
|
+
});
|
|
306
|
+
return isMac ? updated.join('').replace(/\s/, '') : updated.join('+');
|
|
512
307
|
};
|
|
513
308
|
|
|
514
309
|
const shortcuts = [
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
310
|
+
{
|
|
311
|
+
shortcuts: ['Meta + B'],
|
|
312
|
+
action: 'Bold'
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
shortcuts: ['Meta + I'],
|
|
316
|
+
action: 'Italic'
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
shortcuts: ['Meta + U'],
|
|
320
|
+
action: 'Underline'
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
shortcuts: ['Meta + A'],
|
|
324
|
+
action: 'Select all'
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
shortcuts: [
|
|
328
|
+
'Meta + Y',
|
|
329
|
+
'Meta + Shift + Z'
|
|
330
|
+
],
|
|
331
|
+
action: 'Redo'
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
shortcuts: ['Meta + Z'],
|
|
335
|
+
action: 'Undo'
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
shortcuts: ['Access + 1'],
|
|
339
|
+
action: 'Heading 1'
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
shortcuts: ['Access + 2'],
|
|
343
|
+
action: 'Heading 2'
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
shortcuts: ['Access + 3'],
|
|
347
|
+
action: 'Heading 3'
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
shortcuts: ['Access + 4'],
|
|
351
|
+
action: 'Heading 4'
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
shortcuts: ['Access + 5'],
|
|
355
|
+
action: 'Heading 5'
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
shortcuts: ['Access + 6'],
|
|
359
|
+
action: 'Heading 6'
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
shortcuts: ['Access + 7'],
|
|
363
|
+
action: 'Paragraph'
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
shortcuts: ['Access + 8'],
|
|
367
|
+
action: 'Div'
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
shortcuts: ['Access + 9'],
|
|
371
|
+
action: 'Address'
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
shortcuts: ['Alt + 0'],
|
|
375
|
+
action: 'Open help dialog'
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
shortcuts: ['Alt + F9'],
|
|
379
|
+
action: 'Focus to menubar'
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
shortcuts: ['Alt + F10'],
|
|
383
|
+
action: 'Focus to toolbar'
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
shortcuts: ['Alt + F11'],
|
|
387
|
+
action: 'Focus to element path'
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
shortcuts: ['Ctrl + F9'],
|
|
391
|
+
action: 'Focus to contextual toolbar'
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
shortcuts: ['Shift + Enter'],
|
|
395
|
+
action: 'Open popup menu for split buttons'
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
shortcuts: ['Meta + K'],
|
|
399
|
+
action: 'Insert link (if link plugin activated)'
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
shortcuts: ['Meta + S'],
|
|
403
|
+
action: 'Save (if save plugin activated)'
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
shortcuts: ['Meta + F'],
|
|
407
|
+
action: 'Find (if searchreplace plugin activated)'
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
shortcuts: ['Meta + Shift + F'],
|
|
411
|
+
action: 'Switch to or from fullscreen mode'
|
|
412
|
+
}
|
|
541
413
|
];
|
|
542
414
|
|
|
543
415
|
const tab$2 = () => {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
416
|
+
const shortcutList = map(shortcuts, shortcut => {
|
|
417
|
+
const shortcutText = map(shortcut.shortcuts, convertText).join(' or ');
|
|
418
|
+
return [
|
|
419
|
+
shortcut.action,
|
|
420
|
+
shortcutText
|
|
421
|
+
];
|
|
422
|
+
});
|
|
423
|
+
const tablePanel = {
|
|
424
|
+
type: 'table',
|
|
425
|
+
header: [
|
|
426
|
+
'Action',
|
|
427
|
+
'Shortcut'
|
|
428
|
+
],
|
|
429
|
+
cells: shortcutList
|
|
430
|
+
};
|
|
431
|
+
return {
|
|
432
|
+
name: 'shortcuts',
|
|
433
|
+
title: 'Handy Shortcuts',
|
|
434
|
+
items: [tablePanel]
|
|
435
|
+
};
|
|
561
436
|
};
|
|
562
437
|
|
|
563
|
-
// These lists are automatically sorted when generating the dialog.
|
|
564
438
|
const urls = map([
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
439
|
+
{
|
|
440
|
+
key: 'accordion',
|
|
441
|
+
name: 'Accordion'
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
key: 'advlist',
|
|
445
|
+
name: 'Advanced List'
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
key: 'anchor',
|
|
449
|
+
name: 'Anchor'
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
key: 'autolink',
|
|
453
|
+
name: 'Autolink'
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
key: 'autoresize',
|
|
457
|
+
name: 'Autoresize'
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
key: 'autosave',
|
|
461
|
+
name: 'Autosave'
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
key: 'charmap',
|
|
465
|
+
name: 'Character Map'
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
key: 'code',
|
|
469
|
+
name: 'Code'
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
key: 'codesample',
|
|
473
|
+
name: 'Code Sample'
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
key: 'colorpicker',
|
|
477
|
+
name: 'Color Picker'
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
key: 'directionality',
|
|
481
|
+
name: 'Directionality'
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
key: 'emoticons',
|
|
485
|
+
name: 'Emoticons'
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
key: 'fullscreen',
|
|
489
|
+
name: 'Full Screen'
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
key: 'help',
|
|
493
|
+
name: 'Help'
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
key: 'image',
|
|
497
|
+
name: 'Image'
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
key: 'importcss',
|
|
501
|
+
name: 'Import CSS'
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
key: 'insertdatetime',
|
|
505
|
+
name: 'Insert Date/Time'
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
key: 'link',
|
|
509
|
+
name: 'Link'
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
key: 'lists',
|
|
513
|
+
name: 'Lists'
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
key: 'media',
|
|
517
|
+
name: 'Media'
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
key: 'nonbreaking',
|
|
521
|
+
name: 'Nonbreaking'
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
key: 'pagebreak',
|
|
525
|
+
name: 'Page Break'
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
key: 'preview',
|
|
529
|
+
name: 'Preview'
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
key: 'quickbars',
|
|
533
|
+
name: 'Quick Toolbars'
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
key: 'save',
|
|
537
|
+
name: 'Save'
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
key: 'searchreplace',
|
|
541
|
+
name: 'Search and Replace'
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
key: 'table',
|
|
545
|
+
name: 'Table'
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
key: 'template',
|
|
549
|
+
name: 'Template'
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
key: 'textcolor',
|
|
553
|
+
name: 'Text Color'
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
key: 'visualblocks',
|
|
557
|
+
name: 'Visual Blocks'
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
key: 'visualchars',
|
|
561
|
+
name: 'Visual Characters'
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
key: 'wordcount',
|
|
565
|
+
name: 'Word Count'
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
key: 'a11ychecker',
|
|
569
|
+
name: 'Accessibility Checker',
|
|
570
|
+
type: 'premium'
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
key: 'advcode',
|
|
574
|
+
name: 'Advanced Code Editor',
|
|
575
|
+
type: 'premium'
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
key: 'advtable',
|
|
579
|
+
name: 'Advanced Tables',
|
|
580
|
+
type: 'premium'
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
key: 'advtemplate',
|
|
584
|
+
name: 'Advanced Templates',
|
|
585
|
+
type: 'premium',
|
|
586
|
+
slug: 'advanced-templates'
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
key: 'ai',
|
|
590
|
+
name: 'AI Assistant',
|
|
591
|
+
type: 'premium'
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
key: 'casechange',
|
|
595
|
+
name: 'Case Change',
|
|
596
|
+
type: 'premium'
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
key: 'checklist',
|
|
600
|
+
name: 'Checklist',
|
|
601
|
+
type: 'premium'
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
key: 'editimage',
|
|
605
|
+
name: 'Enhanced Image Editing',
|
|
606
|
+
type: 'premium'
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
key: 'footnotes',
|
|
610
|
+
name: 'Footnotes',
|
|
611
|
+
type: 'premium'
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
key: 'typography',
|
|
615
|
+
name: 'Advanced Typography',
|
|
616
|
+
type: 'premium',
|
|
617
|
+
slug: 'advanced-typography'
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
key: 'mediaembed',
|
|
621
|
+
name: 'Enhanced Media Embed',
|
|
622
|
+
type: 'premium',
|
|
623
|
+
slug: 'introduction-to-mediaembed'
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
key: 'export',
|
|
627
|
+
name: 'Export',
|
|
628
|
+
type: 'premium'
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
key: 'formatpainter',
|
|
632
|
+
name: 'Format Painter',
|
|
633
|
+
type: 'premium'
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
key: 'inlinecss',
|
|
637
|
+
name: 'Inline CSS',
|
|
638
|
+
type: 'premium',
|
|
639
|
+
slug: 'inline-css'
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
key: 'linkchecker',
|
|
643
|
+
name: 'Link Checker',
|
|
644
|
+
type: 'premium'
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
key: 'mentions',
|
|
648
|
+
name: 'Mentions',
|
|
649
|
+
type: 'premium'
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
key: 'mergetags',
|
|
653
|
+
name: 'Merge Tags',
|
|
654
|
+
type: 'premium'
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
key: 'pageembed',
|
|
658
|
+
name: 'Page Embed',
|
|
659
|
+
type: 'premium'
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
key: 'permanentpen',
|
|
663
|
+
name: 'Permanent Pen',
|
|
664
|
+
type: 'premium'
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
key: 'powerpaste',
|
|
668
|
+
name: 'PowerPaste',
|
|
669
|
+
type: 'premium',
|
|
670
|
+
slug: 'introduction-to-powerpaste'
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
key: 'rtc',
|
|
674
|
+
name: 'Real-Time Collaboration',
|
|
675
|
+
type: 'premium',
|
|
676
|
+
slug: 'rtc-introduction'
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
key: 'tinymcespellchecker',
|
|
680
|
+
name: 'Spell Checker Pro',
|
|
681
|
+
type: 'premium',
|
|
682
|
+
slug: 'introduction-to-tiny-spellchecker'
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
key: 'autocorrect',
|
|
686
|
+
name: 'Spelling Autocorrect',
|
|
687
|
+
type: 'premium'
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
key: 'tableofcontents',
|
|
691
|
+
name: 'Table of Contents',
|
|
692
|
+
type: 'premium'
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
key: 'tinycomments',
|
|
696
|
+
name: 'Tiny Comments',
|
|
697
|
+
type: 'premium',
|
|
698
|
+
slug: 'introduction-to-tiny-comments'
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
key: 'tinydrive',
|
|
702
|
+
name: 'Tiny Drive',
|
|
703
|
+
type: 'premium',
|
|
704
|
+
slug: 'tinydrive-introduction'
|
|
705
|
+
}
|
|
706
|
+
], item => ({
|
|
707
|
+
...item,
|
|
708
|
+
type: item.type || 'opensource',
|
|
709
|
+
slug: item.slug || item.key
|
|
633
710
|
}));
|
|
634
711
|
|
|
635
|
-
const tab$1 =
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
const name = x.type === "premium" /* PluginUrls.PluginType.Premium */ ? `${x.name}*` : x.name;
|
|
670
|
-
const html = makeLink({ name, url: `https://www.tiny.cloud/docs/tinymce/7/${x.slug}/` });
|
|
671
|
-
return { name, html };
|
|
712
|
+
const tab$1 = editor => {
|
|
713
|
+
const availablePlugins = () => {
|
|
714
|
+
const premiumPlugins = filter(urls, ({type}) => {
|
|
715
|
+
return type === 'premium';
|
|
716
|
+
});
|
|
717
|
+
const sortedPremiumPlugins = sort(map(premiumPlugins, p => p.name), (s1, s2) => s1.localeCompare(s2));
|
|
718
|
+
const premiumPluginList = map(sortedPremiumPlugins, pluginName => `<li>${ pluginName }</li>`).join('');
|
|
719
|
+
return '<div>' + '<p><b>' + global$2.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" ">' + '<a href="https://www.tiny.cloud/pricing/?utm_campaign=help_dialog_plugin_tab&utm_source=tiny&utm_medium=referral&utm_term=read_more&utm_content=premium_plugin_heading" rel="noopener" target="_blank"' + ' data-alloy-tabstop="true" tabindex="-1">' + global$2.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
|
|
720
|
+
};
|
|
721
|
+
const makeLink = p => `<a data-alloy-tabstop="true" tabindex="-1" href="${ p.url }" target="_blank" rel="noopener">${ p.name }</a>`;
|
|
722
|
+
const identifyUnknownPlugin = (editor, key) => {
|
|
723
|
+
const getMetadata = editor.plugins[key].getMetadata;
|
|
724
|
+
if (isFunction(getMetadata)) {
|
|
725
|
+
const metadata = getMetadata();
|
|
726
|
+
return {
|
|
727
|
+
name: metadata.name,
|
|
728
|
+
html: makeLink(metadata)
|
|
729
|
+
};
|
|
730
|
+
} else {
|
|
731
|
+
return {
|
|
732
|
+
name: key,
|
|
733
|
+
html: key
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
const getPluginData = (editor, key) => find(urls, x => {
|
|
738
|
+
return x.key === key;
|
|
739
|
+
}).fold(() => {
|
|
740
|
+
return identifyUnknownPlugin(editor, key);
|
|
741
|
+
}, x => {
|
|
742
|
+
const name = x.type === 'premium' ? `${ x.name }*` : x.name;
|
|
743
|
+
const html = makeLink({
|
|
744
|
+
name,
|
|
745
|
+
url: `https://www.tiny.cloud/docs/tinymce/6/${ x.slug }/`
|
|
672
746
|
});
|
|
673
|
-
const getPluginKeys = (editor) => {
|
|
674
|
-
const keys$1 = keys(editor.plugins);
|
|
675
|
-
const forcedPlugins = getForcedPlugins(editor);
|
|
676
|
-
const hiddenPlugins = isUndefined(forcedPlugins) ? ['onboarding'] : forcedPlugins.concat(['onboarding']);
|
|
677
|
-
return filter(keys$1, (k) => !contains(hiddenPlugins, k));
|
|
678
|
-
};
|
|
679
|
-
const pluginLister = (editor) => {
|
|
680
|
-
const pluginKeys = getPluginKeys(editor);
|
|
681
|
-
const sortedPluginData = sort(map(pluginKeys, (k) => getPluginData(editor, k)), (pd1, pd2) => pd1.name.localeCompare(pd2.name));
|
|
682
|
-
const pluginLis = map(sortedPluginData, (key) => {
|
|
683
|
-
return '<li>' + key.html + '</li>';
|
|
684
|
-
});
|
|
685
|
-
const count = pluginLis.length;
|
|
686
|
-
const pluginsString = pluginLis.join('');
|
|
687
|
-
const html = '<p><b>' + global$2.translate(['Plugins installed ({0}):', count]) + '</b></p>' +
|
|
688
|
-
'<ul>' + pluginsString + '</ul>';
|
|
689
|
-
return html;
|
|
690
|
-
};
|
|
691
|
-
const installedPlugins = (editor) => {
|
|
692
|
-
if (editor == null) {
|
|
693
|
-
return '';
|
|
694
|
-
}
|
|
695
|
-
return '<div>' +
|
|
696
|
-
pluginLister(editor) +
|
|
697
|
-
'</div>';
|
|
698
|
-
};
|
|
699
|
-
const htmlPanel = {
|
|
700
|
-
type: 'htmlpanel',
|
|
701
|
-
presets: 'document',
|
|
702
|
-
html: [
|
|
703
|
-
installedPlugins(editor),
|
|
704
|
-
availablePlugins()
|
|
705
|
-
].join('')
|
|
706
|
-
};
|
|
707
747
|
return {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
items: [
|
|
711
|
-
htmlPanel
|
|
712
|
-
]
|
|
748
|
+
name,
|
|
749
|
+
html
|
|
713
750
|
};
|
|
751
|
+
});
|
|
752
|
+
const getPluginKeys = editor => {
|
|
753
|
+
const keys$1 = keys(editor.plugins);
|
|
754
|
+
const forcedPlugins = getForcedPlugins(editor);
|
|
755
|
+
return isUndefined(forcedPlugins) ? keys$1 : filter(keys$1, k => !contains(forcedPlugins, k));
|
|
756
|
+
};
|
|
757
|
+
const pluginLister = editor => {
|
|
758
|
+
const pluginKeys = getPluginKeys(editor);
|
|
759
|
+
const sortedPluginData = sort(map(pluginKeys, k => getPluginData(editor, k)), (pd1, pd2) => pd1.name.localeCompare(pd2.name));
|
|
760
|
+
const pluginLis = map(sortedPluginData, key => {
|
|
761
|
+
return '<li>' + key.html + '</li>';
|
|
762
|
+
});
|
|
763
|
+
const count = pluginLis.length;
|
|
764
|
+
const pluginsString = pluginLis.join('');
|
|
765
|
+
const html = '<p><b>' + global$2.translate([
|
|
766
|
+
'Plugins installed ({0}):',
|
|
767
|
+
count
|
|
768
|
+
]) + '</b></p>' + '<ul>' + pluginsString + '</ul>';
|
|
769
|
+
return html;
|
|
770
|
+
};
|
|
771
|
+
const installedPlugins = editor => {
|
|
772
|
+
if (editor == null) {
|
|
773
|
+
return '';
|
|
774
|
+
}
|
|
775
|
+
return '<div>' + pluginLister(editor) + '</div>';
|
|
776
|
+
};
|
|
777
|
+
const htmlPanel = {
|
|
778
|
+
type: 'htmlpanel',
|
|
779
|
+
presets: 'document',
|
|
780
|
+
html: [
|
|
781
|
+
installedPlugins(editor),
|
|
782
|
+
availablePlugins()
|
|
783
|
+
].join('')
|
|
784
|
+
};
|
|
785
|
+
return {
|
|
786
|
+
name: 'plugins',
|
|
787
|
+
title: 'Plugins',
|
|
788
|
+
items: [htmlPanel]
|
|
789
|
+
};
|
|
714
790
|
};
|
|
715
791
|
|
|
716
792
|
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
|
717
793
|
|
|
718
794
|
const tab = () => {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
795
|
+
const getVersion = (major, minor) => major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor;
|
|
796
|
+
const version = getVersion(global.majorVersion, global.minorVersion);
|
|
797
|
+
const changeLogLink = '<a data-alloy-tabstop="true" tabindex="-1" href="https://www.tiny.cloud/docs/tinymce/6/changelog/?utm_campaign=help_dialog_version_tab&utm_source=tiny&utm_medium=referral" rel="noopener" target="_blank">TinyMCE ' + version + '</a>';
|
|
798
|
+
const htmlPanel = {
|
|
799
|
+
type: 'htmlpanel',
|
|
800
|
+
html: '<p>' + global$2.translate([
|
|
801
|
+
'You are using {0}',
|
|
802
|
+
changeLogLink
|
|
803
|
+
]) + '</p>',
|
|
804
|
+
presets: 'document'
|
|
805
|
+
};
|
|
806
|
+
return {
|
|
807
|
+
name: 'versions',
|
|
808
|
+
title: 'Version',
|
|
809
|
+
items: [htmlPanel]
|
|
810
|
+
};
|
|
734
811
|
};
|
|
735
812
|
|
|
736
813
|
const parseHelpTabsSetting = (tabsFromSettings, tabs) => {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
return { tabs: newTabs, names };
|
|
814
|
+
const newTabs = {};
|
|
815
|
+
const names = map(tabsFromSettings, t => {
|
|
816
|
+
var _a;
|
|
817
|
+
if (isString(t)) {
|
|
818
|
+
if (has(tabs, t)) {
|
|
819
|
+
newTabs[t] = tabs[t];
|
|
820
|
+
}
|
|
821
|
+
return t;
|
|
822
|
+
} else {
|
|
823
|
+
const name = (_a = t.name) !== null && _a !== void 0 ? _a : generate('tab-name');
|
|
824
|
+
newTabs[name] = t;
|
|
825
|
+
return name;
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
return {
|
|
829
|
+
tabs: newTabs,
|
|
830
|
+
names
|
|
831
|
+
};
|
|
756
832
|
};
|
|
757
|
-
const getNamesFromTabs =
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
833
|
+
const getNamesFromTabs = tabs => {
|
|
834
|
+
const names = keys(tabs);
|
|
835
|
+
const idx = names.indexOf('versions');
|
|
836
|
+
if (idx !== -1) {
|
|
837
|
+
names.splice(idx, 1);
|
|
838
|
+
names.push('versions');
|
|
839
|
+
}
|
|
840
|
+
return {
|
|
841
|
+
tabs,
|
|
842
|
+
names
|
|
843
|
+
};
|
|
766
844
|
};
|
|
767
845
|
const pParseCustomTabs = async (editor, customTabs, pluginUrl) => {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
846
|
+
const shortcuts = tab$2();
|
|
847
|
+
const nav = await pTab(pluginUrl);
|
|
848
|
+
const plugins = tab$1(editor);
|
|
849
|
+
const versions = tab();
|
|
850
|
+
const tabs = {
|
|
851
|
+
[shortcuts.name]: shortcuts,
|
|
852
|
+
[nav.name]: nav,
|
|
853
|
+
[plugins.name]: plugins,
|
|
854
|
+
[versions.name]: versions,
|
|
855
|
+
...customTabs.get()
|
|
856
|
+
};
|
|
857
|
+
return Optional.from(getHelpTabs(editor)).fold(() => getNamesFromTabs(tabs), tabsFromSettings => parseHelpTabsSetting(tabsFromSettings, tabs));
|
|
780
858
|
};
|
|
781
859
|
const init = (editor, customTabs, pluginUrl) => () => {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
}
|
|
801
|
-
],
|
|
802
|
-
initialData: {}
|
|
803
|
-
});
|
|
860
|
+
pParseCustomTabs(editor, customTabs, pluginUrl).then(({tabs, names}) => {
|
|
861
|
+
const foundTabs = map(names, name => get(tabs, name));
|
|
862
|
+
const dialogTabs = cat(foundTabs);
|
|
863
|
+
const body = {
|
|
864
|
+
type: 'tabpanel',
|
|
865
|
+
tabs: dialogTabs
|
|
866
|
+
};
|
|
867
|
+
editor.windowManager.open({
|
|
868
|
+
title: 'Help',
|
|
869
|
+
size: 'medium',
|
|
870
|
+
body,
|
|
871
|
+
buttons: [{
|
|
872
|
+
type: 'cancel',
|
|
873
|
+
name: 'close',
|
|
874
|
+
text: 'Close',
|
|
875
|
+
primary: true
|
|
876
|
+
}],
|
|
877
|
+
initialData: {}
|
|
804
878
|
});
|
|
879
|
+
});
|
|
805
880
|
};
|
|
806
881
|
|
|
807
882
|
var Plugin = () => {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
883
|
+
global$4.add('help', (editor, pluginUrl) => {
|
|
884
|
+
const customTabs = Cell({});
|
|
885
|
+
const api = get$1(customTabs);
|
|
886
|
+
register$1(editor);
|
|
887
|
+
const dialogOpener = init(editor, customTabs, pluginUrl);
|
|
888
|
+
register(editor, dialogOpener);
|
|
889
|
+
register$2(editor, dialogOpener);
|
|
890
|
+
editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp');
|
|
891
|
+
initI18nLoad(editor, pluginUrl);
|
|
892
|
+
return api;
|
|
893
|
+
});
|
|
819
894
|
};
|
|
820
895
|
|
|
821
896
|
Plugin();
|
|
822
|
-
/** *****
|
|
823
|
-
* DO NOT EXPORT ANYTHING
|
|
824
|
-
*
|
|
825
|
-
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
826
|
-
*******/
|
|
827
897
|
|
|
828
898
|
})();
|