@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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 6.8.6 (TBD)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -8,464 +8,252 @@
|
|
|
8
8
|
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
9
|
|
|
10
10
|
const applyListFormat = (editor, listName, styleValue) => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
|
|
12
|
+
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const register$2 =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const register$2 = editor => {
|
|
16
|
+
editor.addCommand('ApplyUnorderedListStyle', (ui, value) => {
|
|
17
|
+
applyListFormat(editor, 'UL', value['list-style-type']);
|
|
18
|
+
});
|
|
19
|
+
editor.addCommand('ApplyOrderedListStyle', (ui, value) => {
|
|
20
|
+
applyListFormat(editor, 'OL', value['list-style-type']);
|
|
21
|
+
});
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const option =
|
|
25
|
-
const register$1 =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
const option = name => editor => editor.options.get(name);
|
|
25
|
+
const register$1 = editor => {
|
|
26
|
+
const registerOption = editor.options.register;
|
|
27
|
+
registerOption('advlist_number_styles', {
|
|
28
|
+
processor: 'string[]',
|
|
29
|
+
default: 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'.split(',')
|
|
30
|
+
});
|
|
31
|
+
registerOption('advlist_bullet_styles', {
|
|
32
|
+
processor: 'string[]',
|
|
33
|
+
default: 'default,circle,square'.split(',')
|
|
34
|
+
});
|
|
35
35
|
};
|
|
36
36
|
const getNumberStyles = option('advlist_number_styles');
|
|
37
37
|
const getBulletStyles = option('advlist_bullet_styles');
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
39
|
+
const isNullable = a => a === null || a === undefined;
|
|
40
|
+
const isNonNullable = a => !isNullable(a);
|
|
41
|
+
|
|
42
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
42
43
|
|
|
43
|
-
/**
|
|
44
|
-
* The `Optional` type represents a value (of any type) that potentially does
|
|
45
|
-
* not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
|
|
46
|
-
* value does exist) or a `None` (in which case the value does not exist). This
|
|
47
|
-
* module defines a whole lot of FP-inspired utility functions for dealing with
|
|
48
|
-
* `Optional` objects.
|
|
49
|
-
*
|
|
50
|
-
* Comparison with null or undefined:
|
|
51
|
-
* - We don't get fancy null coalescing operators with `Optional`
|
|
52
|
-
* - We do get fancy helper functions with `Optional`
|
|
53
|
-
* - `Optional` support nesting, and allow for the type to still be nullable (or
|
|
54
|
-
* another `Optional`)
|
|
55
|
-
* - There is no option to turn off strict-optional-checks like there is for
|
|
56
|
-
* strict-null-checks
|
|
57
|
-
*/
|
|
58
44
|
class Optional {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* any type because we don't actually have a `T`.
|
|
75
|
-
*/
|
|
76
|
-
static none() {
|
|
77
|
-
return Optional.singletonNone;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Perform a transform on an `Optional` type. Regardless of whether this
|
|
81
|
-
* `Optional` contains a value or not, `fold` will return a value of type `U`.
|
|
82
|
-
* If this `Optional` does not contain a value, the `U` will be created by
|
|
83
|
-
* calling `onNone`. If this `Optional` does contain a value, the `U` will be
|
|
84
|
-
* created by calling `onSome`.
|
|
85
|
-
*
|
|
86
|
-
* For the FP enthusiasts in the room, this function:
|
|
87
|
-
* 1. Could be used to implement all of the functions below
|
|
88
|
-
* 2. Forms a catamorphism
|
|
89
|
-
*/
|
|
90
|
-
fold(onNone, onSome) {
|
|
91
|
-
if (this.tag) {
|
|
92
|
-
return onSome(this.value);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return onNone();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Determine if this `Optional` object contains a value.
|
|
100
|
-
*/
|
|
101
|
-
isSome() {
|
|
102
|
-
return this.tag;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Determine if this `Optional` object **does not** contain a value.
|
|
106
|
-
*/
|
|
107
|
-
isNone() {
|
|
108
|
-
return !this.tag;
|
|
109
|
-
}
|
|
110
|
-
// --- Functor (name stolen from Haskell / maths) ---
|
|
111
|
-
/**
|
|
112
|
-
* Perform a transform on an `Optional` object, **if** there is a value. If
|
|
113
|
-
* you provide a function to turn a T into a U, this is the function you use
|
|
114
|
-
* to turn an `Optional<T>` into an `Optional<U>`. If this **does** contain
|
|
115
|
-
* a value then the output will also contain a value (that value being the
|
|
116
|
-
* output of `mapper(this.value)`), and if this **does not** contain a value
|
|
117
|
-
* then neither will the output.
|
|
118
|
-
*/
|
|
119
|
-
map(mapper) {
|
|
120
|
-
if (this.tag) {
|
|
121
|
-
return Optional.some(mapper(this.value));
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
return Optional.none();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
// --- Monad (name stolen from Haskell / maths) ---
|
|
128
|
-
/**
|
|
129
|
-
* Perform a transform on an `Optional` object, **if** there is a value.
|
|
130
|
-
* Unlike `map`, here the transform itself also returns an `Optional`.
|
|
131
|
-
*/
|
|
132
|
-
bind(binder) {
|
|
133
|
-
if (this.tag) {
|
|
134
|
-
return binder(this.value);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
return Optional.none();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
// --- Traversable (name stolen from Haskell / maths) ---
|
|
141
|
-
/**
|
|
142
|
-
* For a given predicate, this function finds out if there **exists** a value
|
|
143
|
-
* inside this `Optional` object that meets the predicate. In practice, this
|
|
144
|
-
* means that for `Optional`s that do not contain a value it returns false (as
|
|
145
|
-
* no predicate-meeting value exists).
|
|
146
|
-
*/
|
|
147
|
-
exists(predicate) {
|
|
148
|
-
return this.tag && predicate(this.value);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* For a given predicate, this function finds out if **all** the values inside
|
|
152
|
-
* this `Optional` object meet the predicate. In practice, this means that
|
|
153
|
-
* for `Optional`s that do not contain a value it returns true (as all 0
|
|
154
|
-
* objects do meet the predicate).
|
|
155
|
-
*/
|
|
156
|
-
forall(predicate) {
|
|
157
|
-
return !this.tag || predicate(this.value);
|
|
158
|
-
}
|
|
159
|
-
filter(predicate) {
|
|
160
|
-
if (!this.tag || predicate(this.value)) {
|
|
161
|
-
return this;
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
return Optional.none();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
// --- Getters ---
|
|
168
|
-
/**
|
|
169
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
170
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
171
|
-
* value.
|
|
172
|
-
*/
|
|
173
|
-
getOr(replacement) {
|
|
174
|
-
return this.tag ? this.value : replacement;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
178
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
179
|
-
* value. Unlike `getOr`, in this method the `replacement` object is also
|
|
180
|
-
* `Optional` - meaning that this method will always return an `Optional`.
|
|
181
|
-
*/
|
|
182
|
-
or(replacement) {
|
|
183
|
-
return this.tag ? this : replacement;
|
|
45
|
+
constructor(tag, value) {
|
|
46
|
+
this.tag = tag;
|
|
47
|
+
this.value = value;
|
|
48
|
+
}
|
|
49
|
+
static some(value) {
|
|
50
|
+
return new Optional(true, value);
|
|
51
|
+
}
|
|
52
|
+
static none() {
|
|
53
|
+
return Optional.singletonNone;
|
|
54
|
+
}
|
|
55
|
+
fold(onNone, onSome) {
|
|
56
|
+
if (this.tag) {
|
|
57
|
+
return onSome(this.value);
|
|
58
|
+
} else {
|
|
59
|
+
return onNone();
|
|
184
60
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
61
|
+
}
|
|
62
|
+
isSome() {
|
|
63
|
+
return this.tag;
|
|
64
|
+
}
|
|
65
|
+
isNone() {
|
|
66
|
+
return !this.tag;
|
|
67
|
+
}
|
|
68
|
+
map(mapper) {
|
|
69
|
+
if (this.tag) {
|
|
70
|
+
return Optional.some(mapper(this.value));
|
|
71
|
+
} else {
|
|
72
|
+
return Optional.none();
|
|
195
73
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
* to say that you don't pass a value to `orThunk`, you pass a function which
|
|
203
|
-
* (if called) will **return** the `value` you want to use.
|
|
204
|
-
*
|
|
205
|
-
* Unlike `getOrThunk`, in this method the `replacement` value is also
|
|
206
|
-
* `Optional`, meaning that this method will always return an `Optional`.
|
|
207
|
-
*/
|
|
208
|
-
orThunk(thunk) {
|
|
209
|
-
return this.tag ? this : thunk();
|
|
74
|
+
}
|
|
75
|
+
bind(binder) {
|
|
76
|
+
if (this.tag) {
|
|
77
|
+
return binder(this.value);
|
|
78
|
+
} else {
|
|
79
|
+
return Optional.none();
|
|
210
80
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
*/
|
|
224
|
-
getOrDie(message) {
|
|
225
|
-
if (!this.tag) {
|
|
226
|
-
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
return this.value;
|
|
230
|
-
}
|
|
81
|
+
}
|
|
82
|
+
exists(predicate) {
|
|
83
|
+
return this.tag && predicate(this.value);
|
|
84
|
+
}
|
|
85
|
+
forall(predicate) {
|
|
86
|
+
return !this.tag || predicate(this.value);
|
|
87
|
+
}
|
|
88
|
+
filter(predicate) {
|
|
89
|
+
if (!this.tag || predicate(this.value)) {
|
|
90
|
+
return this;
|
|
91
|
+
} else {
|
|
92
|
+
return Optional.none();
|
|
231
93
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
94
|
+
}
|
|
95
|
+
getOr(replacement) {
|
|
96
|
+
return this.tag ? this.value : replacement;
|
|
97
|
+
}
|
|
98
|
+
or(replacement) {
|
|
99
|
+
return this.tag ? this : replacement;
|
|
100
|
+
}
|
|
101
|
+
getOrThunk(thunk) {
|
|
102
|
+
return this.tag ? this.value : thunk();
|
|
103
|
+
}
|
|
104
|
+
orThunk(thunk) {
|
|
105
|
+
return this.tag ? this : thunk();
|
|
106
|
+
}
|
|
107
|
+
getOrDie(message) {
|
|
108
|
+
if (!this.tag) {
|
|
109
|
+
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
110
|
+
} else {
|
|
111
|
+
return this.value;
|
|
240
112
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
// --- Utilities ---
|
|
256
|
-
/**
|
|
257
|
-
* If the `Optional` contains a value, perform an action on that value.
|
|
258
|
-
* Unlike the rest of the methods on this type, `.each` has side-effects. If
|
|
259
|
-
* you want to transform an `Optional<T>` **into** something, then this is not
|
|
260
|
-
* the method for you. If you want to use an `Optional<T>` to **do**
|
|
261
|
-
* something, then this is the method for you - provided you're okay with not
|
|
262
|
-
* doing anything in the case where the `Optional` doesn't have a value inside
|
|
263
|
-
* it. If you're not sure whether your use-case fits into transforming
|
|
264
|
-
* **into** something or **doing** something, check whether it has a return
|
|
265
|
-
* value. If it does, you should be performing a transform.
|
|
266
|
-
*/
|
|
267
|
-
each(worker) {
|
|
268
|
-
if (this.tag) {
|
|
269
|
-
worker(this.value);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Turn the `Optional` object into an array that contains all of the values
|
|
274
|
-
* stored inside the `Optional`. In practice, this means the output will have
|
|
275
|
-
* either 0 or 1 elements.
|
|
276
|
-
*/
|
|
277
|
-
toArray() {
|
|
278
|
-
return this.tag ? [this.value] : [];
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Turn the `Optional` object into a string for debugging or printing. Not
|
|
282
|
-
* recommended for production code, but good for debugging. Also note that
|
|
283
|
-
* these days an `Optional` object can be logged to the console directly, and
|
|
284
|
-
* its inner value (if it exists) will be visible.
|
|
285
|
-
*/
|
|
286
|
-
toString() {
|
|
287
|
-
return this.tag ? `some(${this.value})` : 'none()';
|
|
113
|
+
}
|
|
114
|
+
static from(value) {
|
|
115
|
+
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
116
|
+
}
|
|
117
|
+
getOrNull() {
|
|
118
|
+
return this.tag ? this.value : null;
|
|
119
|
+
}
|
|
120
|
+
getOrUndefined() {
|
|
121
|
+
return this.value;
|
|
122
|
+
}
|
|
123
|
+
each(worker) {
|
|
124
|
+
if (this.tag) {
|
|
125
|
+
worker(this.value);
|
|
288
126
|
}
|
|
127
|
+
}
|
|
128
|
+
toArray() {
|
|
129
|
+
return this.tag ? [this.value] : [];
|
|
130
|
+
}
|
|
131
|
+
toString() {
|
|
132
|
+
return this.tag ? `some(${ this.value })` : 'none()';
|
|
133
|
+
}
|
|
289
134
|
}
|
|
290
|
-
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
291
|
-
// reuse the same object
|
|
292
135
|
Optional.singletonNone = new Optional(false);
|
|
293
136
|
|
|
294
|
-
const nativeIndexOf = Array.prototype.indexOf;
|
|
295
|
-
/* eslint-enable */
|
|
296
|
-
const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);
|
|
297
|
-
const contains = (xs, x) => rawIndexOf(xs, x) > -1;
|
|
298
137
|
const findUntil = (xs, pred, until) => {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return Optional.none();
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
// There are many variations of Object iteration that are faster than the 'for-in' style:
|
|
312
|
-
// http://jsperf.com/object-keys-iteration/107
|
|
313
|
-
//
|
|
314
|
-
// Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
|
|
315
|
-
const keys = Object.keys;
|
|
316
|
-
const each = (obj, f) => {
|
|
317
|
-
const props = keys(obj);
|
|
318
|
-
for (let k = 0, len = props.length; k < len; k++) {
|
|
319
|
-
const i = props[k];
|
|
320
|
-
const x = obj[i];
|
|
321
|
-
f(x, i);
|
|
138
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
139
|
+
const x = xs[i];
|
|
140
|
+
if (pred(x, i)) {
|
|
141
|
+
return Optional.some(x);
|
|
142
|
+
} else if (until(x, i)) {
|
|
143
|
+
break;
|
|
322
144
|
}
|
|
145
|
+
}
|
|
146
|
+
return Optional.none();
|
|
323
147
|
};
|
|
324
|
-
const map = (obj, f) => {
|
|
325
|
-
return tupleMap(obj, (x, i) => ({
|
|
326
|
-
k: i,
|
|
327
|
-
v: f(x, i)
|
|
328
|
-
}));
|
|
329
|
-
};
|
|
330
|
-
const tupleMap = (obj, f) => {
|
|
331
|
-
const r = {};
|
|
332
|
-
each(obj, (x, i) => {
|
|
333
|
-
const tuple = f(x, i);
|
|
334
|
-
r[tuple.k] = tuple.v;
|
|
335
|
-
});
|
|
336
|
-
return r;
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
340
148
|
|
|
341
|
-
const isCustomList =
|
|
149
|
+
const isCustomList = list => /\btox\-/.test(list.className);
|
|
342
150
|
const isChildOfBody = (editor, elm) => {
|
|
343
|
-
|
|
151
|
+
return editor.dom.isChildOf(elm, editor.getBody());
|
|
344
152
|
};
|
|
345
|
-
const matchNodeNames =
|
|
153
|
+
const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);
|
|
346
154
|
const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
|
|
347
155
|
const isTableCellNode = matchNodeNames(/^(TH|TD)$/);
|
|
348
|
-
const inList = (editor, parents, nodeName) => findUntil(parents,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
return Optional.from(style);
|
|
156
|
+
const inList = (editor, parents, nodeName) => findUntil(parents, parent => isListNode(parent) && !isCustomList(parent), isTableCellNode).exists(list => list.nodeName === nodeName && isChildOfBody(editor, list));
|
|
157
|
+
const getSelectedStyleType = editor => {
|
|
158
|
+
const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
|
|
159
|
+
const style = editor.dom.getStyle(listElm, 'listStyleType');
|
|
160
|
+
return Optional.from(style);
|
|
354
161
|
};
|
|
355
|
-
// Lists/core/Util.ts - Duplicated in Lists plugin
|
|
356
162
|
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
|
|
357
163
|
const isWithinNonEditableList = (editor, element) => {
|
|
358
|
-
|
|
359
|
-
|
|
164
|
+
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
|
165
|
+
return isWithinNonEditable(editor, parentList) && editor.selection.isEditable();
|
|
360
166
|
};
|
|
361
167
|
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
return () => editor.off('NodeChange', nodeChangeHandler);
|
|
168
|
+
const initialNode = editor.selection.getNode();
|
|
169
|
+
nodeChangeHandler({
|
|
170
|
+
parents: editor.dom.getParents(initialNode),
|
|
171
|
+
element: initialNode
|
|
172
|
+
});
|
|
173
|
+
editor.on('NodeChange', nodeChangeHandler);
|
|
174
|
+
return () => editor.off('NodeChange', nodeChangeHandler);
|
|
370
175
|
};
|
|
371
176
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
return
|
|
375
|
-
|
|
376
|
-
});
|
|
177
|
+
const styleValueToText = styleValue => {
|
|
178
|
+
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, chr => {
|
|
179
|
+
return chr.toUpperCase();
|
|
180
|
+
});
|
|
377
181
|
};
|
|
378
|
-
const normalizeStyleValue =
|
|
379
|
-
const makeSetupHandler = (editor, nodeName) =>
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
182
|
+
const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
|
|
183
|
+
const makeSetupHandler = (editor, nodeName) => api => {
|
|
184
|
+
const updateButtonState = (editor, parents) => {
|
|
185
|
+
const element = editor.selection.getStart(true);
|
|
186
|
+
api.setActive(inList(editor, parents, nodeName));
|
|
187
|
+
api.setEnabled(!isWithinNonEditableList(editor, element) && editor.selection.isEditable());
|
|
188
|
+
};
|
|
189
|
+
const nodeChangeHandler = e => updateButtonState(editor, e.parents);
|
|
190
|
+
return setNodeChangeHandler(editor, nodeChangeHandler);
|
|
387
191
|
};
|
|
388
192
|
const addSplitButton = (editor, id, tooltip, cmd, nodeName, styles) => {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
},
|
|
420
|
-
select: (value) => {
|
|
421
|
-
const listStyleType = getSelectedStyleType(editor);
|
|
422
|
-
return listStyleType.exists((listStyle) => value === listStyle || (listStyleTypeAliases[listStyle] === value && !stylesContainsAliasMap[value]));
|
|
423
|
-
},
|
|
424
|
-
onSetup: makeSetupHandler(editor, nodeName)
|
|
425
|
-
});
|
|
193
|
+
editor.ui.registry.addSplitButton(id, {
|
|
194
|
+
tooltip,
|
|
195
|
+
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
|
|
196
|
+
presets: 'listpreview',
|
|
197
|
+
columns: 3,
|
|
198
|
+
fetch: callback => {
|
|
199
|
+
const items = global.map(styles, styleValue => {
|
|
200
|
+
const iconStyle = nodeName === 'OL' ? 'num' : 'bull';
|
|
201
|
+
const iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
|
|
202
|
+
const itemValue = normalizeStyleValue(styleValue);
|
|
203
|
+
const displayText = styleValueToText(styleValue);
|
|
204
|
+
return {
|
|
205
|
+
type: 'choiceitem',
|
|
206
|
+
value: itemValue,
|
|
207
|
+
icon: 'list-' + iconStyle + '-' + iconName,
|
|
208
|
+
text: displayText
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
callback(items);
|
|
212
|
+
},
|
|
213
|
+
onAction: () => editor.execCommand(cmd),
|
|
214
|
+
onItemAction: (_splitButtonApi, value) => {
|
|
215
|
+
applyListFormat(editor, nodeName, value);
|
|
216
|
+
},
|
|
217
|
+
select: value => {
|
|
218
|
+
const listStyleType = getSelectedStyleType(editor);
|
|
219
|
+
return listStyleType.map(listStyle => value === listStyle).getOr(false);
|
|
220
|
+
},
|
|
221
|
+
onSetup: makeSetupHandler(editor, nodeName)
|
|
222
|
+
});
|
|
426
223
|
};
|
|
427
224
|
const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
});
|
|
225
|
+
editor.ui.registry.addToggleButton(id, {
|
|
226
|
+
active: false,
|
|
227
|
+
tooltip,
|
|
228
|
+
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
|
|
229
|
+
onSetup: makeSetupHandler(editor, nodeName),
|
|
230
|
+
onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
|
|
231
|
+
});
|
|
436
232
|
};
|
|
437
233
|
const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
234
|
+
if (styles.length > 1) {
|
|
235
|
+
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
|
|
236
|
+
} else {
|
|
237
|
+
addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
|
|
238
|
+
}
|
|
444
239
|
};
|
|
445
|
-
const register =
|
|
446
|
-
|
|
447
|
-
|
|
240
|
+
const register = editor => {
|
|
241
|
+
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
|
|
242
|
+
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
|
|
448
243
|
};
|
|
449
244
|
|
|
450
245
|
var Plugin = () => {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
});
|
|
246
|
+
global$1.add('advlist', editor => {
|
|
247
|
+
if (editor.hasPlugin('lists')) {
|
|
248
|
+
register$1(editor);
|
|
249
|
+
register(editor);
|
|
250
|
+
register$2(editor);
|
|
251
|
+
} else {
|
|
252
|
+
console.error('Please use the Lists plugin together with the Advanced List plugin.');
|
|
253
|
+
}
|
|
254
|
+
});
|
|
462
255
|
};
|
|
463
256
|
|
|
464
257
|
Plugin();
|
|
465
|
-
/** *****
|
|
466
|
-
* DO NOT EXPORT ANYTHING
|
|
467
|
-
*
|
|
468
|
-
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
469
|
-
*******/
|
|
470
258
|
|
|
471
259
|
})();
|