@dangl/angular-material-shared 2.9.0-beta0047 → 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.
Files changed (165) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/icons/default/icons.js +9 -46
  3. package/tinymce-assets/icons/default/icons.min.js +1 -1
  4. package/tinymce-assets/models/dom/model.js +7239 -8193
  5. package/tinymce-assets/models/dom/model.min.js +1 -1
  6. package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
  7. package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
  8. package/tinymce-assets/plugins/advlist/plugin.js +200 -412
  9. package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
  10. package/tinymce-assets/plugins/anchor/plugin.js +166 -189
  11. package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
  12. package/tinymce-assets/plugins/autolink/plugin.js +220 -310
  13. package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
  14. package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
  15. package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
  16. package/tinymce-assets/plugins/autosave/plugin.js +189 -208
  17. package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
  18. package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
  19. package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
  20. package/tinymce-assets/plugins/code/plugin.js +61 -73
  21. package/tinymce-assets/plugins/code/plugin.min.js +4 -0
  22. package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
  23. package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
  24. package/tinymce-assets/plugins/directionality/plugin.js +304 -545
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
  28. package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
  29. package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
  30. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
  31. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
  32. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
  33. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
  34. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
  35. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
  69. package/tinymce-assets/plugins/help/plugin.js +809 -739
  70. package/tinymce-assets/plugins/help/plugin.min.js +5 -1
  71. package/tinymce-assets/plugins/image/plugin.js +1291 -1475
  72. package/tinymce-assets/plugins/image/plugin.min.js +5 -1
  73. package/tinymce-assets/plugins/importcss/plugin.js +269 -328
  74. package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
  75. package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
  76. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
  77. package/tinymce-assets/plugins/link/plugin.js +1084 -1419
  78. package/tinymce-assets/plugins/link/plugin.min.js +5 -1
  79. package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
  80. package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
  81. package/tinymce-assets/plugins/media/plugin.js +1047 -1305
  82. package/tinymce-assets/plugins/media/plugin.min.js +5 -1
  83. package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
  84. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
  85. package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
  86. package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
  87. package/tinymce-assets/plugins/preview/plugin.js +74 -742
  88. package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
  89. package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
  90. package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
  91. package/tinymce-assets/plugins/save/plugin.js +82 -100
  92. package/tinymce-assets/plugins/save/plugin.min.js +5 -1
  93. package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
  94. package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
  95. package/tinymce-assets/plugins/table/plugin.js +3094 -3651
  96. package/tinymce-assets/plugins/table/plugin.min.js +5 -1
  97. package/tinymce-assets/plugins/template/index.js +7 -0
  98. package/tinymce-assets/plugins/template/plugin.js +567 -0
  99. package/tinymce-assets/plugins/template/plugin.min.js +5 -0
  100. package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
  101. package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
  102. package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
  103. package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
  104. package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
  105. package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
  106. package/tinymce-assets/skins/content/dark/content.css +4 -0
  107. package/tinymce-assets/skins/content/dark/content.js +6 -1
  108. package/tinymce-assets/skins/content/dark/content.min.css +4 -0
  109. package/tinymce-assets/skins/content/default/content.css +4 -0
  110. package/tinymce-assets/skins/content/default/content.js +6 -1
  111. package/tinymce-assets/skins/content/default/content.min.css +4 -0
  112. package/tinymce-assets/skins/content/document/content.css +4 -0
  113. package/tinymce-assets/skins/content/document/content.js +6 -1
  114. package/tinymce-assets/skins/content/document/content.min.css +4 -0
  115. package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
  116. package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
  117. package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
  118. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
  119. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
  120. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
  121. package/tinymce-assets/skins/content/writer/content.css +4 -0
  122. package/tinymce-assets/skins/content/writer/content.js +6 -1
  123. package/tinymce-assets/skins/content/writer/content.min.css +4 -0
  124. package/tinymce-assets/skins/ui/oxide/content.css +53 -148
  125. package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
  126. package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
  127. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
  128. package/tinymce-assets/skins/ui/oxide/content.js +6 -1
  129. package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
  130. package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
  131. package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
  132. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
  134. package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
  135. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
  136. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
  137. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
  138. package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
  139. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
  140. package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
  141. package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
  142. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
  144. package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
  145. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
  146. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
  147. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
  148. package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
  149. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
  150. package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
  151. package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
  152. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
  154. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
  155. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
  156. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
  164. package/tinymce-assets/themes/silver/theme.js +28439 -32466
  165. package/tinymce-assets/themes/silver/theme.min.js +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 7.9.3 (2026-05-19)
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
- const cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
12
- editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
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 = (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
- });
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 = (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,disc,circle,square'.split(',')
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
- /* eslint-disable @typescript-eslint/no-wrapper-object-types */
40
- const isNullable = (a) => a === null || a === undefined;
41
- const isNonNullable = (a) => !isNullable(a);
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
- // The internal representation has a `tag` and a `value`, but both are
60
- // private: able to be console.logged, but not able to be accessed by code
61
- constructor(tag, value) {
62
- this.tag = tag;
63
- this.value = value;
64
- }
65
- // --- Identities ---
66
- /**
67
- * Creates a new `Optional<T>` that **does** contain a value.
68
- */
69
- static some(value) {
70
- return new Optional(true, value);
71
- }
72
- /**
73
- * Create a new `Optional<T>` that **does not** contain a value. `T` can be
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
- * Get the value out of the inside of the `Optional` object, using a default
187
- * `replacement` value if the provided `Optional` object does not contain a
188
- * value. Unlike `getOr`, in this method the `replacement` value is
189
- * "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
190
- * pass a function which (if called) will **return** the `value` you want to
191
- * use.
192
- */
193
- getOrThunk(thunk) {
194
- return this.tag ? this.value : thunk();
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
- * Get the value out of the inside of the `Optional` object, using a default
198
- * `replacement` value if the provided Optional object does not contain a
199
- * value.
200
- *
201
- * Unlike `or`, in this method the `replacement` value is "thunked" - that is
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
- * Get the value out of the inside of the `Optional` object, throwing an
213
- * exception if the provided `Optional` object does not contain a value.
214
- *
215
- * WARNING:
216
- * You should only be using this function if you know that the `Optional`
217
- * object **is not** empty (otherwise you're throwing exceptions in production
218
- * code, which is bad).
219
- *
220
- * In tests this is more acceptable.
221
- *
222
- * Prefer other methods to this, such as `.each`.
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
- // --- Interop with null and undefined ---
233
- /**
234
- * Creates an `Optional` value from a nullable (or undefined-able) input.
235
- * Null, or undefined, is converted to `None`, and anything else is converted
236
- * to `Some`.
237
- */
238
- static from(value) {
239
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
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
- * Converts an `Optional` to a nullable type, by getting the value if it
243
- * exists, or returning `null` if it does not.
244
- */
245
- getOrNull() {
246
- return this.tag ? this.value : null;
247
- }
248
- /**
249
- * Converts an `Optional` to an undefined-able type, by getting the value if
250
- * it exists, or returning `undefined` if it does not.
251
- */
252
- getOrUndefined() {
253
- return this.value;
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
- for (let i = 0, len = xs.length; i < len; i++) {
300
- const x = xs[i];
301
- if (pred(x, i)) {
302
- return Optional.some(x);
303
- }
304
- else if (until(x, i)) {
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 = (list) => /\btox\-/.test(list.className);
149
+ const isCustomList = list => /\btox\-/.test(list.className);
342
150
  const isChildOfBody = (editor, elm) => {
343
- return editor.dom.isChildOf(elm, editor.getBody());
151
+ return editor.dom.isChildOf(elm, editor.getBody());
344
152
  };
345
- const matchNodeNames = (regex) => (node) => isNonNullable(node) && regex.test(node.nodeName);
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, (parent) => isListNode(parent) && !isCustomList(parent), isTableCellNode)
349
- .exists((list) => list.nodeName === nodeName && isChildOfBody(editor, list));
350
- const getSelectedStyleType = (editor) => {
351
- const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
352
- const style = editor.dom.getStyle(listElm, 'listStyleType');
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
- const parentList = editor.dom.getParent(element, 'ol,ul,dl');
359
- return isWithinNonEditable(editor, parentList) || !editor.selection.isEditable();
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
- const initialNode = editor.selection.getNode();
363
- // Set the initial state
364
- nodeChangeHandler({
365
- parents: editor.dom.getParents(initialNode),
366
- element: initialNode
367
- });
368
- editor.on('NodeChange', nodeChangeHandler);
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
- // <ListStyles>
373
- const styleValueToText = (styleValue) => {
374
- return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, (chr) => {
375
- return chr.toUpperCase();
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 = (styleValue) => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
379
- const makeSetupHandler = (editor, nodeName) => (api) => {
380
- const updateButtonState = (editor, parents) => {
381
- const element = editor.selection.getStart(true);
382
- api.setActive(inList(editor, parents, nodeName));
383
- api.setEnabled(!isWithinNonEditableList(editor, element));
384
- };
385
- const nodeChangeHandler = (e) => updateButtonState(editor, e.parents);
386
- return setNodeChangeHandler(editor, nodeChangeHandler);
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
- const listStyleTypeAliases = {
390
- 'lower-latin': 'lower-alpha',
391
- 'upper-latin': 'upper-alpha',
392
- 'lower-alpha': 'lower-latin',
393
- 'upper-alpha': 'upper-latin'
394
- };
395
- const stylesContainsAliasMap = map(listStyleTypeAliases, (alias) => contains(styles, alias));
396
- editor.ui.registry.addSplitButton(id, {
397
- tooltip,
398
- icon: nodeName === "OL" /* ListType.OrderedList */ ? 'ordered-list' : 'unordered-list',
399
- presets: 'listpreview',
400
- columns: nodeName === "OL" /* ListType.OrderedList */ ? 3 : 4,
401
- fetch: (callback) => {
402
- const items = global.map(styles, (styleValue) => {
403
- const iconStyle = nodeName === "OL" /* ListType.OrderedList */ ? 'num' : 'bull';
404
- const iconName = styleValue === 'decimal' ? 'default' : styleValue;
405
- const itemValue = normalizeStyleValue(styleValue);
406
- const displayText = styleValueToText(styleValue);
407
- return {
408
- type: 'choiceitem',
409
- value: itemValue,
410
- icon: 'list-' + iconStyle + '-' + iconName,
411
- text: displayText
412
- };
413
- });
414
- callback(items);
415
- },
416
- onAction: () => editor.execCommand(cmd),
417
- onItemAction: (_splitButtonApi, value) => {
418
- applyListFormat(editor, nodeName, value);
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
- editor.ui.registry.addToggleButton(id, {
429
- active: false,
430
- tooltip,
431
- icon: nodeName === "OL" /* ListType.OrderedList */ ? 'ordered-list' : 'unordered-list',
432
- onSetup: makeSetupHandler(editor, nodeName),
433
- // Need to make sure the button removes rather than applies if a list of the same type is selected
434
- onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
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
- if (styles.length > 1) {
439
- addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
440
- }
441
- else {
442
- addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
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 = (editor) => {
446
- addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', "OL" /* ListType.OrderedList */, getNumberStyles(editor));
447
- addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', "UL" /* ListType.UnorderedList */, getBulletStyles(editor));
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
- global$1.add('advlist', (editor) => {
452
- if (editor.hasPlugin('lists')) {
453
- register$1(editor);
454
- register(editor);
455
- register$2(editor);
456
- }
457
- else {
458
- // eslint-disable-next-line no-console
459
- console.error('Please use the Lists plugin together with the List Styles plugin.');
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
  })();