@dangl/angular-material-shared 2.9.0-beta0037 → 2.9.0-beta0039

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 (173) hide show
  1. package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs +29 -35
  2. package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs.map +1 -1
  3. package/fesm2022/dangl-angular-material-shared.mjs +36 -51
  4. package/fesm2022/dangl-angular-material-shared.mjs.map +1 -1
  5. package/package.json +11 -10
  6. package/tinymce-assets/icons/default/icons.js +46 -9
  7. package/tinymce-assets/icons/default/icons.min.js +1 -1
  8. package/tinymce-assets/models/dom/model.js +8198 -7244
  9. package/tinymce-assets/models/dom/model.min.js +1 -4
  10. package/tinymce-assets/plugins/accordion/plugin.js +1174 -879
  11. package/tinymce-assets/plugins/accordion/plugin.min.js +1 -4
  12. package/tinymce-assets/plugins/advlist/plugin.js +412 -200
  13. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -4
  14. package/tinymce-assets/plugins/anchor/plugin.js +189 -166
  15. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -4
  16. package/tinymce-assets/plugins/autolink/plugin.js +310 -220
  17. package/tinymce-assets/plugins/autolink/plugin.min.js +1 -4
  18. package/tinymce-assets/plugins/autoresize/plugin.js +180 -149
  19. package/tinymce-assets/plugins/autoresize/plugin.min.js +1 -4
  20. package/tinymce-assets/plugins/autosave/plugin.js +208 -189
  21. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -4
  22. package/tinymce-assets/plugins/charmap/plugin.js +905 -1566
  23. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -4
  24. package/tinymce-assets/plugins/code/plugin.js +73 -61
  25. package/tinymce-assets/plugins/code/plugin.min.js +0 -3
  26. package/tinymce-assets/plugins/codesample/plugin.js +3593 -2402
  27. package/tinymce-assets/plugins/codesample/plugin.min.js +8 -3
  28. package/tinymce-assets/plugins/directionality/plugin.js +545 -304
  29. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -4
  30. package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +0 -2
  31. package/tinymce-assets/plugins/emoticons/js/emojis.min.js +0 -1
  32. package/tinymce-assets/plugins/emoticons/plugin.js +702 -488
  33. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -4
  34. package/tinymce-assets/plugins/fullscreen/plugin.js +1409 -1049
  35. package/tinymce-assets/plugins/fullscreen/plugin.min.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +4 -1
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +4 -1
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +4 -1
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +4 -1
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +4 -1
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +4 -1
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +4 -1
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +4 -1
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +4 -1
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +4 -1
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +4 -1
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +4 -1
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +4 -1
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +4 -1
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +4 -1
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +4 -1
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +4 -1
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +4 -1
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +4 -1
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +4 -1
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +4 -1
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +4 -1
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +4 -1
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +4 -1
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +4 -1
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +4 -1
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +4 -1
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +4 -1
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +4 -1
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +4 -1
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +4 -1
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +5 -2
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +4 -1
  69. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +4 -1
  70. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +4 -1
  71. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +4 -1
  72. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +4 -1
  73. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +8 -5
  74. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +4 -1
  75. package/tinymce-assets/plugins/help/plugin.js +739 -809
  76. package/tinymce-assets/plugins/help/plugin.min.js +1 -4
  77. package/tinymce-assets/plugins/image/plugin.js +1475 -1291
  78. package/tinymce-assets/plugins/image/plugin.min.js +1 -4
  79. package/tinymce-assets/plugins/importcss/plugin.js +328 -269
  80. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -4
  81. package/tinymce-assets/plugins/insertdatetime/plugin.js +140 -141
  82. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +1 -4
  83. package/tinymce-assets/plugins/link/plugin.js +1419 -1084
  84. package/tinymce-assets/plugins/link/plugin.min.js +1 -4
  85. package/tinymce-assets/plugins/lists/plugin.js +2177 -1805
  86. package/tinymce-assets/plugins/lists/plugin.min.js +1 -4
  87. package/tinymce-assets/plugins/media/plugin.js +1305 -1047
  88. package/tinymce-assets/plugins/media/plugin.min.js +1 -4
  89. package/tinymce-assets/plugins/nonbreaking/plugin.js +93 -88
  90. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +0 -3
  91. package/tinymce-assets/plugins/pagebreak/plugin.js +91 -85
  92. package/tinymce-assets/plugins/pagebreak/plugin.min.js +0 -3
  93. package/tinymce-assets/plugins/preview/plugin.js +742 -74
  94. package/tinymce-assets/plugins/preview/plugin.min.js +1 -4
  95. package/tinymce-assets/plugins/quickbars/plugin.js +582 -375
  96. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -4
  97. package/tinymce-assets/plugins/save/plugin.js +100 -82
  98. package/tinymce-assets/plugins/save/plugin.min.js +1 -4
  99. package/tinymce-assets/plugins/searchreplace/plugin.js +1183 -906
  100. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -4
  101. package/tinymce-assets/plugins/table/plugin.js +3651 -3094
  102. package/tinymce-assets/plugins/table/plugin.min.js +1 -4
  103. package/tinymce-assets/plugins/visualblocks/plugin.js +71 -63
  104. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -4
  105. package/tinymce-assets/plugins/visualchars/plugin.js +685 -436
  106. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -4
  107. package/tinymce-assets/plugins/wordcount/plugin.js +382 -307
  108. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -4
  109. package/tinymce-assets/skins/content/dark/content.css +9 -0
  110. package/tinymce-assets/skins/content/dark/content.js +10 -2
  111. package/tinymce-assets/skins/content/dark/content.min.css +9 -0
  112. package/tinymce-assets/skins/content/default/content.css +9 -0
  113. package/tinymce-assets/skins/content/default/content.js +10 -2
  114. package/tinymce-assets/skins/content/default/content.min.css +9 -0
  115. package/tinymce-assets/skins/content/document/content.css +9 -0
  116. package/tinymce-assets/skins/content/document/content.js +10 -2
  117. package/tinymce-assets/skins/content/document/content.min.css +9 -0
  118. package/tinymce-assets/skins/content/tinymce-5/content.css +9 -0
  119. package/tinymce-assets/skins/content/tinymce-5/content.js +10 -2
  120. package/tinymce-assets/skins/content/tinymce-5/content.min.css +9 -0
  121. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +9 -0
  122. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +10 -2
  123. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +9 -0
  124. package/tinymce-assets/skins/content/writer/content.css +9 -0
  125. package/tinymce-assets/skins/content/writer/content.js +10 -2
  126. package/tinymce-assets/skins/content/writer/content.min.css +9 -0
  127. package/tinymce-assets/skins/ui/oxide/content.css +157 -49
  128. package/tinymce-assets/skins/ui/oxide/content.inline.css +157 -49
  129. package/tinymce-assets/skins/ui/oxide/content.inline.js +10 -2
  130. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +10 -1
  131. package/tinymce-assets/skins/ui/oxide/content.js +10 -2
  132. package/tinymce-assets/skins/ui/oxide/content.min.css +10 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.css +1592 -214
  134. package/tinymce-assets/skins/ui/oxide/skin.js +1 -2
  135. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  136. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +1 -2
  137. package/tinymce-assets/skins/ui/oxide-dark/content.css +157 -42
  138. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +157 -49
  139. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +10 -2
  140. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +10 -1
  141. package/tinymce-assets/skins/ui/oxide-dark/content.js +10 -2
  142. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +10 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.css +1595 -217
  144. package/tinymce-assets/skins/ui/oxide-dark/skin.js +1 -2
  145. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  146. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +1 -2
  147. package/tinymce-assets/skins/ui/tinymce-5/content.css +157 -49
  148. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +157 -49
  149. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +10 -2
  150. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +10 -1
  151. package/tinymce-assets/skins/ui/tinymce-5/content.js +10 -2
  152. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +10 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.css +1606 -203
  154. package/tinymce-assets/skins/ui/tinymce-5/skin.js +1 -2
  155. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  156. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +1 -2
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +157 -42
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +157 -49
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +10 -2
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +10 -1
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +10 -2
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +10 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +1607 -204
  164. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +1 -2
  165. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  166. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -2
  167. package/tinymce-assets/themes/silver/theme.js +32786 -28738
  168. package/tinymce-assets/themes/silver/theme.min.js +1 -4
  169. package/types/dangl-angular-material-shared-tiny-mce.d.ts +12 -13
  170. package/types/dangl-angular-material-shared.d.ts +26 -26
  171. package/tinymce-assets/plugins/template/index.js +0 -7
  172. package/tinymce-assets/plugins/template/plugin.js +0 -567
  173. package/tinymce-assets/plugins/template/plugin.min.js +0 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.8.3 (2024-02-08)
2
+ * TinyMCE version 7.9.3 (2026-05-19)
3
3
  */
4
4
 
5
5
  (function () {
@@ -8,252 +8,464 @@
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,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,disc,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
- const isNullable = a => a === null || a === undefined;
40
- const isNonNullable = a => !isNullable(a);
41
-
42
- var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
39
+ /* eslint-disable @typescript-eslint/no-wrapper-object-types */
40
+ const isNullable = (a) => a === null || a === undefined;
41
+ const isNonNullable = (a) => !isNullable(a);
43
42
 
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
+ */
44
58
  class Optional {
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();
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;
60
184
  }
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();
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();
73
195
  }
74
- }
75
- bind(binder) {
76
- if (this.tag) {
77
- return binder(this.value);
78
- } else {
79
- return Optional.none();
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();
80
210
  }
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();
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
+ }
93
231
  }
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;
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();
112
240
  }
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);
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()';
126
288
  }
127
- }
128
- toArray() {
129
- return this.tag ? [this.value] : [];
130
- }
131
- toString() {
132
- return this.tag ? `some(${ this.value })` : 'none()';
133
- }
134
289
  }
290
+ // Sneaky optimisation: every instance of Optional.none is identical, so just
291
+ // reuse the same object
135
292
  Optional.singletonNone = new Optional(false);
136
293
 
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;
137
298
  const findUntil = (xs, pred, until) => {
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;
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);
144
322
  }
145
- }
146
- return Optional.none();
147
323
  };
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');
148
340
 
149
- const isCustomList = list => /\btox\-/.test(list.className);
341
+ const isCustomList = (list) => /\btox\-/.test(list.className);
150
342
  const isChildOfBody = (editor, elm) => {
151
- return editor.dom.isChildOf(elm, editor.getBody());
343
+ return editor.dom.isChildOf(elm, editor.getBody());
152
344
  };
153
- const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);
345
+ const matchNodeNames = (regex) => (node) => isNonNullable(node) && regex.test(node.nodeName);
154
346
  const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
155
347
  const isTableCellNode = matchNodeNames(/^(TH|TD)$/);
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);
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);
161
354
  };
355
+ // Lists/core/Util.ts - Duplicated in Lists plugin
162
356
  const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
163
357
  const isWithinNonEditableList = (editor, element) => {
164
- const parentList = editor.dom.getParent(element, 'ol,ul,dl');
165
- return isWithinNonEditable(editor, parentList) && editor.selection.isEditable();
358
+ const parentList = editor.dom.getParent(element, 'ol,ul,dl');
359
+ return isWithinNonEditable(editor, parentList) || !editor.selection.isEditable();
166
360
  };
167
361
  const setNodeChangeHandler = (editor, 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);
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);
175
370
  };
176
371
 
177
- const styleValueToText = styleValue => {
178
- return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, chr => {
179
- return chr.toUpperCase();
180
- });
372
+ // <ListStyles>
373
+ const styleValueToText = (styleValue) => {
374
+ return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, (chr) => {
375
+ return chr.toUpperCase();
376
+ });
181
377
  };
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);
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);
191
387
  };
192
388
  const addSplitButton = (editor, id, tooltip, cmd, nodeName, styles) => {
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
- });
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
+ });
223
426
  };
224
427
  const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
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
- });
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
+ });
232
436
  };
233
437
  const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
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
- }
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
+ }
239
444
  };
240
- const register = editor => {
241
- addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
242
- addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
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));
243
448
  };
244
449
 
245
450
  var Plugin = () => {
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
- });
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
+ });
255
462
  };
256
463
 
257
464
  Plugin();
465
+ /** *****
466
+ * DO NOT EXPORT ANYTHING
467
+ *
468
+ * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
469
+ *******/
258
470
 
259
471
  })();