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

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 (175) 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/styles/material-theme.scss +1 -1
  7. package/styles/material-variables.scss +5 -5
  8. package/tinymce-assets/icons/default/icons.js +46 -9
  9. package/tinymce-assets/icons/default/icons.min.js +1 -1
  10. package/tinymce-assets/models/dom/model.js +8198 -7244
  11. package/tinymce-assets/models/dom/model.min.js +1 -4
  12. package/tinymce-assets/plugins/accordion/plugin.js +1174 -879
  13. package/tinymce-assets/plugins/accordion/plugin.min.js +1 -4
  14. package/tinymce-assets/plugins/advlist/plugin.js +412 -200
  15. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -4
  16. package/tinymce-assets/plugins/anchor/plugin.js +189 -166
  17. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -4
  18. package/tinymce-assets/plugins/autolink/plugin.js +310 -220
  19. package/tinymce-assets/plugins/autolink/plugin.min.js +1 -4
  20. package/tinymce-assets/plugins/autoresize/plugin.js +180 -149
  21. package/tinymce-assets/plugins/autoresize/plugin.min.js +1 -4
  22. package/tinymce-assets/plugins/autosave/plugin.js +208 -189
  23. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -4
  24. package/tinymce-assets/plugins/charmap/plugin.js +905 -1566
  25. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -4
  26. package/tinymce-assets/plugins/code/plugin.js +73 -61
  27. package/tinymce-assets/plugins/code/plugin.min.js +0 -3
  28. package/tinymce-assets/plugins/codesample/plugin.js +3593 -2402
  29. package/tinymce-assets/plugins/codesample/plugin.min.js +8 -3
  30. package/tinymce-assets/plugins/directionality/plugin.js +545 -304
  31. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -4
  32. package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +0 -2
  33. package/tinymce-assets/plugins/emoticons/js/emojis.min.js +0 -1
  34. package/tinymce-assets/plugins/emoticons/plugin.js +702 -488
  35. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -4
  36. package/tinymce-assets/plugins/fullscreen/plugin.js +1409 -1049
  37. package/tinymce-assets/plugins/fullscreen/plugin.min.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +4 -1
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +4 -1
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +4 -1
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +4 -1
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +4 -1
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +4 -1
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +4 -1
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +4 -1
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +4 -1
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +4 -1
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +4 -1
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +4 -1
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +4 -1
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +4 -1
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +4 -1
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +4 -1
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +4 -1
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +4 -1
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +4 -1
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +4 -1
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +4 -1
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +4 -1
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +4 -1
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +4 -1
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +4 -1
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +4 -1
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +4 -1
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +4 -1
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +4 -1
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +4 -1
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +4 -1
  69. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +5 -2
  70. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +4 -1
  71. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +4 -1
  72. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +4 -1
  73. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +4 -1
  74. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +4 -1
  75. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +8 -5
  76. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +4 -1
  77. package/tinymce-assets/plugins/help/plugin.js +739 -809
  78. package/tinymce-assets/plugins/help/plugin.min.js +1 -4
  79. package/tinymce-assets/plugins/image/plugin.js +1475 -1291
  80. package/tinymce-assets/plugins/image/plugin.min.js +1 -4
  81. package/tinymce-assets/plugins/importcss/plugin.js +328 -269
  82. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -4
  83. package/tinymce-assets/plugins/insertdatetime/plugin.js +140 -141
  84. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +1 -4
  85. package/tinymce-assets/plugins/link/plugin.js +1419 -1084
  86. package/tinymce-assets/plugins/link/plugin.min.js +1 -4
  87. package/tinymce-assets/plugins/lists/plugin.js +2177 -1805
  88. package/tinymce-assets/plugins/lists/plugin.min.js +1 -4
  89. package/tinymce-assets/plugins/media/plugin.js +1305 -1047
  90. package/tinymce-assets/plugins/media/plugin.min.js +1 -4
  91. package/tinymce-assets/plugins/nonbreaking/plugin.js +93 -88
  92. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +0 -3
  93. package/tinymce-assets/plugins/pagebreak/plugin.js +91 -85
  94. package/tinymce-assets/plugins/pagebreak/plugin.min.js +0 -3
  95. package/tinymce-assets/plugins/preview/plugin.js +742 -74
  96. package/tinymce-assets/plugins/preview/plugin.min.js +1 -4
  97. package/tinymce-assets/plugins/quickbars/plugin.js +582 -375
  98. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -4
  99. package/tinymce-assets/plugins/save/plugin.js +100 -82
  100. package/tinymce-assets/plugins/save/plugin.min.js +1 -4
  101. package/tinymce-assets/plugins/searchreplace/plugin.js +1183 -906
  102. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -4
  103. package/tinymce-assets/plugins/table/plugin.js +3651 -3094
  104. package/tinymce-assets/plugins/table/plugin.min.js +1 -4
  105. package/tinymce-assets/plugins/visualblocks/plugin.js +71 -63
  106. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -4
  107. package/tinymce-assets/plugins/visualchars/plugin.js +685 -436
  108. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -4
  109. package/tinymce-assets/plugins/wordcount/plugin.js +382 -307
  110. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -4
  111. package/tinymce-assets/skins/content/dark/content.css +9 -0
  112. package/tinymce-assets/skins/content/dark/content.js +10 -2
  113. package/tinymce-assets/skins/content/dark/content.min.css +9 -0
  114. package/tinymce-assets/skins/content/default/content.css +9 -0
  115. package/tinymce-assets/skins/content/default/content.js +10 -2
  116. package/tinymce-assets/skins/content/default/content.min.css +9 -0
  117. package/tinymce-assets/skins/content/document/content.css +9 -0
  118. package/tinymce-assets/skins/content/document/content.js +10 -2
  119. package/tinymce-assets/skins/content/document/content.min.css +9 -0
  120. package/tinymce-assets/skins/content/tinymce-5/content.css +9 -0
  121. package/tinymce-assets/skins/content/tinymce-5/content.js +10 -2
  122. package/tinymce-assets/skins/content/tinymce-5/content.min.css +9 -0
  123. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +9 -0
  124. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +10 -2
  125. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +9 -0
  126. package/tinymce-assets/skins/content/writer/content.css +9 -0
  127. package/tinymce-assets/skins/content/writer/content.js +10 -2
  128. package/tinymce-assets/skins/content/writer/content.min.css +9 -0
  129. package/tinymce-assets/skins/ui/oxide/content.css +157 -49
  130. package/tinymce-assets/skins/ui/oxide/content.inline.css +157 -49
  131. package/tinymce-assets/skins/ui/oxide/content.inline.js +10 -2
  132. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +10 -1
  133. package/tinymce-assets/skins/ui/oxide/content.js +10 -2
  134. package/tinymce-assets/skins/ui/oxide/content.min.css +10 -1
  135. package/tinymce-assets/skins/ui/oxide/skin.css +1592 -214
  136. package/tinymce-assets/skins/ui/oxide/skin.js +1 -2
  137. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  138. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +1 -2
  139. package/tinymce-assets/skins/ui/oxide-dark/content.css +157 -42
  140. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +157 -49
  141. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +10 -2
  142. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +10 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/content.js +10 -2
  144. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +10 -1
  145. package/tinymce-assets/skins/ui/oxide-dark/skin.css +1595 -217
  146. package/tinymce-assets/skins/ui/oxide-dark/skin.js +1 -2
  147. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  148. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +1 -2
  149. package/tinymce-assets/skins/ui/tinymce-5/content.css +157 -49
  150. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +157 -49
  151. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +10 -2
  152. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +10 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/content.js +10 -2
  154. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +10 -1
  155. package/tinymce-assets/skins/ui/tinymce-5/skin.css +1606 -203
  156. package/tinymce-assets/skins/ui/tinymce-5/skin.js +1 -2
  157. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  158. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +1 -2
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +157 -42
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +157 -49
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +10 -2
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +10 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +10 -2
  164. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +10 -1
  165. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +1607 -204
  166. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +1 -2
  167. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  168. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -2
  169. package/tinymce-assets/themes/silver/theme.js +32786 -28738
  170. package/tinymce-assets/themes/silver/theme.min.js +1 -4
  171. package/types/dangl-angular-material-shared-tiny-mce.d.ts +12 -13
  172. package/types/dangl-angular-material-shared.d.ts +26 -26
  173. package/tinymce-assets/plugins/template/index.js +0 -7
  174. package/tinymce-assets/plugins/template/plugin.js +0 -567
  175. 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,194 +8,425 @@
8
8
  var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
9
 
10
10
  const fireInsertCustomChar = (editor, chr) => {
11
- return editor.dispatch('insertCustomChar', { chr });
11
+ return editor.dispatch('insertCustomChar', { chr });
12
12
  };
13
13
 
14
14
  const insertChar = (editor, chr) => {
15
- const evtChr = fireInsertCustomChar(editor, chr).chr;
16
- editor.execCommand('mceInsertContent', false, evtChr);
15
+ const evtChr = fireInsertCustomChar(editor, chr).chr;
16
+ editor.execCommand('mceInsertContent', false, evtChr);
17
17
  };
18
18
 
19
+ /* eslint-disable @typescript-eslint/no-wrapper-object-types */
19
20
  const hasProto = (v, constructor, predicate) => {
20
- var _a;
21
- if (predicate(v, constructor.prototype)) {
22
- return true;
23
- } else {
24
- return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
25
- }
21
+ var _a;
22
+ if (predicate(v, constructor.prototype)) {
23
+ return true;
24
+ }
25
+ else {
26
+ // String-based fallback time
27
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
28
+ }
26
29
  };
27
- const typeOf = x => {
28
- const t = typeof x;
29
- if (x === null) {
30
- return 'null';
31
- } else if (t === 'object' && Array.isArray(x)) {
32
- return 'array';
33
- } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
34
- return 'string';
35
- } else {
36
- return t;
37
- }
30
+ const typeOf = (x) => {
31
+ const t = typeof x;
32
+ if (x === null) {
33
+ return 'null';
34
+ }
35
+ else if (t === 'object' && Array.isArray(x)) {
36
+ return 'array';
37
+ }
38
+ else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
39
+ return 'string';
40
+ }
41
+ else {
42
+ return t;
43
+ }
38
44
  };
39
- const isType = type => value => typeOf(value) === type;
40
- const isSimpleType = type => value => typeof value === type;
41
- const eq = t => a => t === a;
45
+ const isType = (type) => (value) => typeOf(value) === type;
46
+ const isSimpleType = (type) => (value) => typeof value === type;
47
+ const eq = (t) => (a) => t === a;
42
48
  const isArray$1 = isType('array');
43
49
  const isNull = eq(null);
44
50
  const isUndefined = eq(undefined);
45
- const isNullable = a => a === null || a === undefined;
46
- const isNonNullable = a => !isNullable(a);
51
+ const isNullable = (a) => a === null || a === undefined;
52
+ const isNonNullable = (a) => !isNullable(a);
47
53
  const isFunction = isSimpleType('function');
48
54
 
49
- const constant = value => {
50
- return () => {
51
- return value;
52
- };
55
+ const constant = (value) => {
56
+ return () => {
57
+ return value;
58
+ };
53
59
  };
54
60
  const never = constant(false);
55
61
 
62
+ /**
63
+ * The `Optional` type represents a value (of any type) that potentially does
64
+ * not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
65
+ * value does exist) or a `None` (in which case the value does not exist). This
66
+ * module defines a whole lot of FP-inspired utility functions for dealing with
67
+ * `Optional` objects.
68
+ *
69
+ * Comparison with null or undefined:
70
+ * - We don't get fancy null coalescing operators with `Optional`
71
+ * - We do get fancy helper functions with `Optional`
72
+ * - `Optional` support nesting, and allow for the type to still be nullable (or
73
+ * another `Optional`)
74
+ * - There is no option to turn off strict-optional-checks like there is for
75
+ * strict-null-checks
76
+ */
56
77
  class Optional {
57
- constructor(tag, value) {
58
- this.tag = tag;
59
- this.value = value;
60
- }
61
- static some(value) {
62
- return new Optional(true, value);
63
- }
64
- static none() {
65
- return Optional.singletonNone;
66
- }
67
- fold(onNone, onSome) {
68
- if (this.tag) {
69
- return onSome(this.value);
70
- } else {
71
- return onNone();
78
+ // The internal representation has a `tag` and a `value`, but both are
79
+ // private: able to be console.logged, but not able to be accessed by code
80
+ constructor(tag, value) {
81
+ this.tag = tag;
82
+ this.value = value;
83
+ }
84
+ // --- Identities ---
85
+ /**
86
+ * Creates a new `Optional<T>` that **does** contain a value.
87
+ */
88
+ static some(value) {
89
+ return new Optional(true, value);
90
+ }
91
+ /**
92
+ * Create a new `Optional<T>` that **does not** contain a value. `T` can be
93
+ * any type because we don't actually have a `T`.
94
+ */
95
+ static none() {
96
+ return Optional.singletonNone;
97
+ }
98
+ /**
99
+ * Perform a transform on an `Optional` type. Regardless of whether this
100
+ * `Optional` contains a value or not, `fold` will return a value of type `U`.
101
+ * If this `Optional` does not contain a value, the `U` will be created by
102
+ * calling `onNone`. If this `Optional` does contain a value, the `U` will be
103
+ * created by calling `onSome`.
104
+ *
105
+ * For the FP enthusiasts in the room, this function:
106
+ * 1. Could be used to implement all of the functions below
107
+ * 2. Forms a catamorphism
108
+ */
109
+ fold(onNone, onSome) {
110
+ if (this.tag) {
111
+ return onSome(this.value);
112
+ }
113
+ else {
114
+ return onNone();
115
+ }
116
+ }
117
+ /**
118
+ * Determine if this `Optional` object contains a value.
119
+ */
120
+ isSome() {
121
+ return this.tag;
122
+ }
123
+ /**
124
+ * Determine if this `Optional` object **does not** contain a value.
125
+ */
126
+ isNone() {
127
+ return !this.tag;
128
+ }
129
+ // --- Functor (name stolen from Haskell / maths) ---
130
+ /**
131
+ * Perform a transform on an `Optional` object, **if** there is a value. If
132
+ * you provide a function to turn a T into a U, this is the function you use
133
+ * to turn an `Optional<T>` into an `Optional<U>`. If this **does** contain
134
+ * a value then the output will also contain a value (that value being the
135
+ * output of `mapper(this.value)`), and if this **does not** contain a value
136
+ * then neither will the output.
137
+ */
138
+ map(mapper) {
139
+ if (this.tag) {
140
+ return Optional.some(mapper(this.value));
141
+ }
142
+ else {
143
+ return Optional.none();
144
+ }
145
+ }
146
+ // --- Monad (name stolen from Haskell / maths) ---
147
+ /**
148
+ * Perform a transform on an `Optional` object, **if** there is a value.
149
+ * Unlike `map`, here the transform itself also returns an `Optional`.
150
+ */
151
+ bind(binder) {
152
+ if (this.tag) {
153
+ return binder(this.value);
154
+ }
155
+ else {
156
+ return Optional.none();
157
+ }
158
+ }
159
+ // --- Traversable (name stolen from Haskell / maths) ---
160
+ /**
161
+ * For a given predicate, this function finds out if there **exists** a value
162
+ * inside this `Optional` object that meets the predicate. In practice, this
163
+ * means that for `Optional`s that do not contain a value it returns false (as
164
+ * no predicate-meeting value exists).
165
+ */
166
+ exists(predicate) {
167
+ return this.tag && predicate(this.value);
168
+ }
169
+ /**
170
+ * For a given predicate, this function finds out if **all** the values inside
171
+ * this `Optional` object meet the predicate. In practice, this means that
172
+ * for `Optional`s that do not contain a value it returns true (as all 0
173
+ * objects do meet the predicate).
174
+ */
175
+ forall(predicate) {
176
+ return !this.tag || predicate(this.value);
177
+ }
178
+ filter(predicate) {
179
+ if (!this.tag || predicate(this.value)) {
180
+ return this;
181
+ }
182
+ else {
183
+ return Optional.none();
184
+ }
185
+ }
186
+ // --- Getters ---
187
+ /**
188
+ * Get the value out of the inside of the `Optional` object, using a default
189
+ * `replacement` value if the provided `Optional` object does not contain a
190
+ * value.
191
+ */
192
+ getOr(replacement) {
193
+ return this.tag ? this.value : replacement;
194
+ }
195
+ /**
196
+ * Get the value out of the inside of the `Optional` object, using a default
197
+ * `replacement` value if the provided `Optional` object does not contain a
198
+ * value. Unlike `getOr`, in this method the `replacement` object is also
199
+ * `Optional` - meaning that this method will always return an `Optional`.
200
+ */
201
+ or(replacement) {
202
+ return this.tag ? this : replacement;
203
+ }
204
+ /**
205
+ * Get the value out of the inside of the `Optional` object, using a default
206
+ * `replacement` value if the provided `Optional` object does not contain a
207
+ * value. Unlike `getOr`, in this method the `replacement` value is
208
+ * "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
209
+ * pass a function which (if called) will **return** the `value` you want to
210
+ * use.
211
+ */
212
+ getOrThunk(thunk) {
213
+ return this.tag ? this.value : thunk();
214
+ }
215
+ /**
216
+ * Get the value out of the inside of the `Optional` object, using a default
217
+ * `replacement` value if the provided Optional object does not contain a
218
+ * value.
219
+ *
220
+ * Unlike `or`, in this method the `replacement` value is "thunked" - that is
221
+ * to say that you don't pass a value to `orThunk`, you pass a function which
222
+ * (if called) will **return** the `value` you want to use.
223
+ *
224
+ * Unlike `getOrThunk`, in this method the `replacement` value is also
225
+ * `Optional`, meaning that this method will always return an `Optional`.
226
+ */
227
+ orThunk(thunk) {
228
+ return this.tag ? this : thunk();
229
+ }
230
+ /**
231
+ * Get the value out of the inside of the `Optional` object, throwing an
232
+ * exception if the provided `Optional` object does not contain a value.
233
+ *
234
+ * WARNING:
235
+ * You should only be using this function if you know that the `Optional`
236
+ * object **is not** empty (otherwise you're throwing exceptions in production
237
+ * code, which is bad).
238
+ *
239
+ * In tests this is more acceptable.
240
+ *
241
+ * Prefer other methods to this, such as `.each`.
242
+ */
243
+ getOrDie(message) {
244
+ if (!this.tag) {
245
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
246
+ }
247
+ else {
248
+ return this.value;
249
+ }
250
+ }
251
+ // --- Interop with null and undefined ---
252
+ /**
253
+ * Creates an `Optional` value from a nullable (or undefined-able) input.
254
+ * Null, or undefined, is converted to `None`, and anything else is converted
255
+ * to `Some`.
256
+ */
257
+ static from(value) {
258
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
72
259
  }
73
- }
74
- isSome() {
75
- return this.tag;
76
- }
77
- isNone() {
78
- return !this.tag;
79
- }
80
- map(mapper) {
81
- if (this.tag) {
82
- return Optional.some(mapper(this.value));
83
- } else {
84
- return Optional.none();
260
+ /**
261
+ * Converts an `Optional` to a nullable type, by getting the value if it
262
+ * exists, or returning `null` if it does not.
263
+ */
264
+ getOrNull() {
265
+ return this.tag ? this.value : null;
85
266
  }
86
- }
87
- bind(binder) {
88
- if (this.tag) {
89
- return binder(this.value);
90
- } else {
91
- return Optional.none();
267
+ /**
268
+ * Converts an `Optional` to an undefined-able type, by getting the value if
269
+ * it exists, or returning `undefined` if it does not.
270
+ */
271
+ getOrUndefined() {
272
+ return this.value;
92
273
  }
93
- }
94
- exists(predicate) {
95
- return this.tag && predicate(this.value);
96
- }
97
- forall(predicate) {
98
- return !this.tag || predicate(this.value);
99
- }
100
- filter(predicate) {
101
- if (!this.tag || predicate(this.value)) {
102
- return this;
103
- } else {
104
- return Optional.none();
274
+ // --- Utilities ---
275
+ /**
276
+ * If the `Optional` contains a value, perform an action on that value.
277
+ * Unlike the rest of the methods on this type, `.each` has side-effects. If
278
+ * you want to transform an `Optional<T>` **into** something, then this is not
279
+ * the method for you. If you want to use an `Optional<T>` to **do**
280
+ * something, then this is the method for you - provided you're okay with not
281
+ * doing anything in the case where the `Optional` doesn't have a value inside
282
+ * it. If you're not sure whether your use-case fits into transforming
283
+ * **into** something or **doing** something, check whether it has a return
284
+ * value. If it does, you should be performing a transform.
285
+ */
286
+ each(worker) {
287
+ if (this.tag) {
288
+ worker(this.value);
289
+ }
105
290
  }
106
- }
107
- getOr(replacement) {
108
- return this.tag ? this.value : replacement;
109
- }
110
- or(replacement) {
111
- return this.tag ? this : replacement;
112
- }
113
- getOrThunk(thunk) {
114
- return this.tag ? this.value : thunk();
115
- }
116
- orThunk(thunk) {
117
- return this.tag ? this : thunk();
118
- }
119
- getOrDie(message) {
120
- if (!this.tag) {
121
- throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
122
- } else {
123
- return this.value;
291
+ /**
292
+ * Turn the `Optional` object into an array that contains all of the values
293
+ * stored inside the `Optional`. In practice, this means the output will have
294
+ * either 0 or 1 elements.
295
+ */
296
+ toArray() {
297
+ return this.tag ? [this.value] : [];
124
298
  }
125
- }
126
- static from(value) {
127
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
128
- }
129
- getOrNull() {
130
- return this.tag ? this.value : null;
131
- }
132
- getOrUndefined() {
133
- return this.value;
134
- }
135
- each(worker) {
136
- if (this.tag) {
137
- worker(this.value);
299
+ /**
300
+ * Turn the `Optional` object into a string for debugging or printing. Not
301
+ * recommended for production code, but good for debugging. Also note that
302
+ * these days an `Optional` object can be logged to the console directly, and
303
+ * its inner value (if it exists) will be visible.
304
+ */
305
+ toString() {
306
+ return this.tag ? `some(${this.value})` : 'none()';
138
307
  }
139
- }
140
- toArray() {
141
- return this.tag ? [this.value] : [];
142
- }
143
- toString() {
144
- return this.tag ? `some(${ this.value })` : 'none()';
145
- }
146
308
  }
309
+ // Sneaky optimisation: every instance of Optional.none is identical, so just
310
+ // reuse the same object
147
311
  Optional.singletonNone = new Optional(false);
148
312
 
313
+ /* eslint-disable @typescript-eslint/unbound-method */
314
+ const nativeSlice = Array.prototype.slice;
149
315
  const nativePush = Array.prototype.push;
150
316
  const map = (xs, f) => {
151
- const len = xs.length;
152
- const r = new Array(len);
153
- for (let i = 0; i < len; i++) {
154
- const x = xs[i];
155
- r[i] = f(x, i);
156
- }
157
- return r;
317
+ // pre-allocating array size when it's guaranteed to be known
318
+ // http://jsperf.com/push-allocated-vs-dynamic/22
319
+ const len = xs.length;
320
+ const r = new Array(len);
321
+ for (let i = 0; i < len; i++) {
322
+ const x = xs[i];
323
+ r[i] = f(x, i);
324
+ }
325
+ return r;
158
326
  };
327
+ // Unwound implementing other functions in terms of each.
328
+ // The code size is roughly the same, and it should allow for better optimisation.
329
+ // const each = function<T, U>(xs: T[], f: (x: T, i?: number, xs?: T[]) => void): void {
159
330
  const each = (xs, f) => {
160
- for (let i = 0, len = xs.length; i < len; i++) {
161
- const x = xs[i];
162
- f(x, i);
163
- }
331
+ for (let i = 0, len = xs.length; i < len; i++) {
332
+ const x = xs[i];
333
+ f(x, i);
334
+ }
164
335
  };
165
336
  const findUntil = (xs, pred, until) => {
166
- for (let i = 0, len = xs.length; i < len; i++) {
167
- const x = xs[i];
168
- if (pred(x, i)) {
169
- return Optional.some(x);
170
- } else if (until(x, i)) {
171
- break;
337
+ for (let i = 0, len = xs.length; i < len; i++) {
338
+ const x = xs[i];
339
+ if (pred(x, i)) {
340
+ return Optional.some(x);
341
+ }
342
+ else if (until(x, i)) {
343
+ break;
344
+ }
172
345
  }
173
- }
174
- return Optional.none();
346
+ return Optional.none();
175
347
  };
176
348
  const find = (xs, pred) => {
177
- return findUntil(xs, pred, never);
349
+ return findUntil(xs, pred, never);
178
350
  };
179
- const flatten = xs => {
180
- const r = [];
181
- for (let i = 0, len = xs.length; i < len; ++i) {
182
- if (!isArray$1(xs[i])) {
183
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
351
+ const flatten = (xs) => {
352
+ // Note, this is possible because push supports multiple arguments:
353
+ // http://jsperf.com/concat-push/6
354
+ // Note that in the past, concat() would silently work (very slowly) for array-like objects.
355
+ // With this change it will throw an error.
356
+ const r = [];
357
+ for (let i = 0, len = xs.length; i < len; ++i) {
358
+ // Ensure that each value is an array itself
359
+ if (!isArray$1(xs[i])) {
360
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
361
+ }
362
+ nativePush.apply(r, xs[i]);
184
363
  }
185
- nativePush.apply(r, xs[i]);
186
- }
187
- return r;
364
+ return r;
188
365
  };
189
366
  const bind = (xs, f) => flatten(map(xs, f));
367
+ isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
368
+
369
+ const Cell = (initial) => {
370
+ let value = initial;
371
+ const get = () => {
372
+ return value;
373
+ };
374
+ const set = (v) => {
375
+ value = v;
376
+ };
377
+ return {
378
+ get,
379
+ set
380
+ };
381
+ };
382
+
383
+ const contains = (str, substr, start = 0, end) => {
384
+ const idx = str.indexOf(substr, start);
385
+ if (idx !== -1) {
386
+ return isUndefined(end) ? true : idx + substr.length <= end;
387
+ }
388
+ else {
389
+ return false;
390
+ }
391
+ };
392
+ const fromCodePoint = String.fromCodePoint;
393
+
394
+ // Run a function fn after rate ms. If another invocation occurs
395
+ // during the time it is waiting, reschedule the function again
396
+ // with the new arguments.
397
+ const last = (fn, rate) => {
398
+ let timer = null;
399
+ const cancel = () => {
400
+ if (!isNull(timer)) {
401
+ clearTimeout(timer);
402
+ timer = null;
403
+ }
404
+ };
405
+ const throttle = (...args) => {
406
+ cancel();
407
+ timer = setTimeout(() => {
408
+ timer = null;
409
+ fn.apply(null, args);
410
+ }, rate);
411
+ };
412
+ return {
413
+ cancel,
414
+ throttle
415
+ };
416
+ };
190
417
 
191
418
  var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
192
419
 
193
- const option = name => editor => editor.options.get(name);
194
- const register$2 = editor => {
195
- const registerOption = editor.options.register;
196
- const charMapProcessor = value => isFunction(value) || isArray$1(value);
197
- registerOption('charmap', { processor: charMapProcessor });
198
- registerOption('charmap_append', { processor: charMapProcessor });
420
+ const option = (name) => (editor) => editor.options.get(name);
421
+ const register$2 = (editor) => {
422
+ const registerOption = editor.options.register;
423
+ const charMapProcessor = (value) => isFunction(value) || isArray$1(value);
424
+ registerOption('charmap', {
425
+ processor: charMapProcessor,
426
+ });
427
+ registerOption('charmap_append', {
428
+ processor: charMapProcessor
429
+ });
199
430
  };
200
431
  const getCharMap$1 = option('charmap');
201
432
  const getCharMapAppend = option('charmap_append');
@@ -203,1456 +434,564 @@
203
434
  const isArray = global.isArray;
204
435
  const UserDefined = 'User Defined';
205
436
  const getDefaultCharMap = () => {
206
- return [
207
- {
208
- name: 'Currency',
209
- characters: [
210
- [
211
- 36,
212
- 'dollar sign'
213
- ],
214
- [
215
- 162,
216
- 'cent sign'
217
- ],
218
- [
219
- 8364,
220
- 'euro sign'
221
- ],
222
- [
223
- 163,
224
- 'pound sign'
225
- ],
226
- [
227
- 165,
228
- 'yen sign'
229
- ],
230
- [
231
- 164,
232
- 'currency sign'
233
- ],
234
- [
235
- 8352,
236
- 'euro-currency sign'
237
- ],
238
- [
239
- 8353,
240
- 'colon sign'
241
- ],
242
- [
243
- 8354,
244
- 'cruzeiro sign'
245
- ],
246
- [
247
- 8355,
248
- 'french franc sign'
249
- ],
250
- [
251
- 8356,
252
- 'lira sign'
253
- ],
254
- [
255
- 8357,
256
- 'mill sign'
257
- ],
258
- [
259
- 8358,
260
- 'naira sign'
261
- ],
262
- [
263
- 8359,
264
- 'peseta sign'
265
- ],
266
- [
267
- 8360,
268
- 'rupee sign'
269
- ],
270
- [
271
- 8361,
272
- 'won sign'
273
- ],
274
- [
275
- 8362,
276
- 'new sheqel sign'
277
- ],
278
- [
279
- 8363,
280
- 'dong sign'
281
- ],
282
- [
283
- 8365,
284
- 'kip sign'
285
- ],
286
- [
287
- 8366,
288
- 'tugrik sign'
289
- ],
290
- [
291
- 8367,
292
- 'drachma sign'
293
- ],
294
- [
295
- 8368,
296
- 'german penny symbol'
297
- ],
298
- [
299
- 8369,
300
- 'peso sign'
301
- ],
302
- [
303
- 8370,
304
- 'guarani sign'
305
- ],
306
- [
307
- 8371,
308
- 'austral sign'
309
- ],
310
- [
311
- 8372,
312
- 'hryvnia sign'
313
- ],
314
- [
315
- 8373,
316
- 'cedi sign'
317
- ],
318
- [
319
- 8374,
320
- 'livre tournois sign'
321
- ],
322
- [
323
- 8375,
324
- 'spesmilo sign'
325
- ],
326
- [
327
- 8376,
328
- 'tenge sign'
329
- ],
330
- [
331
- 8377,
332
- 'indian rupee sign'
333
- ],
334
- [
335
- 8378,
336
- 'turkish lira sign'
337
- ],
338
- [
339
- 8379,
340
- 'nordic mark sign'
341
- ],
342
- [
343
- 8380,
344
- 'manat sign'
345
- ],
346
- [
347
- 8381,
348
- 'ruble sign'
349
- ],
350
- [
351
- 20870,
352
- 'yen character'
353
- ],
354
- [
355
- 20803,
356
- 'yuan character'
357
- ],
358
- [
359
- 22291,
360
- 'yuan character, in hong kong and taiwan'
361
- ],
362
- [
363
- 22278,
364
- 'yen/yuan character variant one'
365
- ]
366
- ]
367
- },
368
- {
369
- name: 'Text',
370
- characters: [
371
- [
372
- 169,
373
- 'copyright sign'
374
- ],
375
- [
376
- 174,
377
- 'registered sign'
378
- ],
379
- [
380
- 8482,
381
- 'trade mark sign'
382
- ],
383
- [
384
- 8240,
385
- 'per mille sign'
386
- ],
387
- [
388
- 181,
389
- 'micro sign'
390
- ],
391
- [
392
- 183,
393
- 'middle dot'
394
- ],
395
- [
396
- 8226,
397
- 'bullet'
398
- ],
399
- [
400
- 8230,
401
- 'three dot leader'
402
- ],
403
- [
404
- 8242,
405
- 'minutes / feet'
406
- ],
407
- [
408
- 8243,
409
- 'seconds / inches'
410
- ],
411
- [
412
- 167,
413
- 'section sign'
414
- ],
415
- [
416
- 182,
417
- 'paragraph sign'
418
- ],
419
- [
420
- 223,
421
- 'sharp s / ess-zed'
422
- ]
423
- ]
424
- },
425
- {
426
- name: 'Quotations',
427
- characters: [
428
- [
429
- 8249,
430
- 'single left-pointing angle quotation mark'
431
- ],
432
- [
433
- 8250,
434
- 'single right-pointing angle quotation mark'
435
- ],
436
- [
437
- 171,
438
- 'left pointing guillemet'
439
- ],
440
- [
441
- 187,
442
- 'right pointing guillemet'
443
- ],
444
- [
445
- 8216,
446
- 'left single quotation mark'
447
- ],
448
- [
449
- 8217,
450
- 'right single quotation mark'
451
- ],
452
- [
453
- 8220,
454
- 'left double quotation mark'
455
- ],
456
- [
457
- 8221,
458
- 'right double quotation mark'
459
- ],
460
- [
461
- 8218,
462
- 'single low-9 quotation mark'
463
- ],
464
- [
465
- 8222,
466
- 'double low-9 quotation mark'
467
- ],
468
- [
469
- 60,
470
- 'less-than sign'
471
- ],
472
- [
473
- 62,
474
- 'greater-than sign'
475
- ],
476
- [
477
- 8804,
478
- 'less-than or equal to'
479
- ],
480
- [
481
- 8805,
482
- 'greater-than or equal to'
483
- ],
484
- [
485
- 8211,
486
- 'en dash'
487
- ],
488
- [
489
- 8212,
490
- 'em dash'
491
- ],
492
- [
493
- 175,
494
- 'macron'
495
- ],
496
- [
497
- 8254,
498
- 'overline'
499
- ],
500
- [
501
- 164,
502
- 'currency sign'
503
- ],
504
- [
505
- 166,
506
- 'broken bar'
507
- ],
508
- [
509
- 168,
510
- 'diaeresis'
511
- ],
512
- [
513
- 161,
514
- 'inverted exclamation mark'
515
- ],
516
- [
517
- 191,
518
- 'turned question mark'
519
- ],
520
- [
521
- 710,
522
- 'circumflex accent'
523
- ],
524
- [
525
- 732,
526
- 'small tilde'
527
- ],
528
- [
529
- 176,
530
- 'degree sign'
531
- ],
532
- [
533
- 8722,
534
- 'minus sign'
535
- ],
536
- [
537
- 177,
538
- 'plus-minus sign'
539
- ],
540
- [
541
- 247,
542
- 'division sign'
543
- ],
544
- [
545
- 8260,
546
- 'fraction slash'
547
- ],
548
- [
549
- 215,
550
- 'multiplication sign'
551
- ],
552
- [
553
- 185,
554
- 'superscript one'
555
- ],
556
- [
557
- 178,
558
- 'superscript two'
559
- ],
560
- [
561
- 179,
562
- 'superscript three'
563
- ],
564
- [
565
- 188,
566
- 'fraction one quarter'
567
- ],
568
- [
569
- 189,
570
- 'fraction one half'
571
- ],
572
- [
573
- 190,
574
- 'fraction three quarters'
575
- ]
576
- ]
577
- },
578
- {
579
- name: 'Mathematical',
580
- characters: [
581
- [
582
- 402,
583
- 'function / florin'
584
- ],
585
- [
586
- 8747,
587
- 'integral'
588
- ],
589
- [
590
- 8721,
591
- 'n-ary sumation'
592
- ],
593
- [
594
- 8734,
595
- 'infinity'
596
- ],
597
- [
598
- 8730,
599
- 'square root'
600
- ],
601
- [
602
- 8764,
603
- 'similar to'
604
- ],
605
- [
606
- 8773,
607
- 'approximately equal to'
608
- ],
609
- [
610
- 8776,
611
- 'almost equal to'
612
- ],
613
- [
614
- 8800,
615
- 'not equal to'
616
- ],
617
- [
618
- 8801,
619
- 'identical to'
620
- ],
621
- [
622
- 8712,
623
- 'element of'
624
- ],
625
- [
626
- 8713,
627
- 'not an element of'
628
- ],
629
- [
630
- 8715,
631
- 'contains as member'
632
- ],
633
- [
634
- 8719,
635
- 'n-ary product'
636
- ],
637
- [
638
- 8743,
639
- 'logical and'
640
- ],
641
- [
642
- 8744,
643
- 'logical or'
644
- ],
645
- [
646
- 172,
647
- 'not sign'
648
- ],
649
- [
650
- 8745,
651
- 'intersection'
652
- ],
653
- [
654
- 8746,
655
- 'union'
656
- ],
657
- [
658
- 8706,
659
- 'partial differential'
660
- ],
661
- [
662
- 8704,
663
- 'for all'
664
- ],
665
- [
666
- 8707,
667
- 'there exists'
668
- ],
669
- [
670
- 8709,
671
- 'diameter'
672
- ],
673
- [
674
- 8711,
675
- 'backward difference'
676
- ],
677
- [
678
- 8727,
679
- 'asterisk operator'
680
- ],
681
- [
682
- 8733,
683
- 'proportional to'
684
- ],
685
- [
686
- 8736,
687
- 'angle'
688
- ]
689
- ]
690
- },
691
- {
692
- name: 'Extended Latin',
693
- characters: [
694
- [
695
- 192,
696
- 'A - grave'
697
- ],
698
- [
699
- 193,
700
- 'A - acute'
701
- ],
702
- [
703
- 194,
704
- 'A - circumflex'
705
- ],
706
- [
707
- 195,
708
- 'A - tilde'
709
- ],
710
- [
711
- 196,
712
- 'A - diaeresis'
713
- ],
714
- [
715
- 197,
716
- 'A - ring above'
717
- ],
718
- [
719
- 256,
720
- 'A - macron'
721
- ],
722
- [
723
- 198,
724
- 'ligature AE'
725
- ],
726
- [
727
- 199,
728
- 'C - cedilla'
729
- ],
730
- [
731
- 200,
732
- 'E - grave'
733
- ],
734
- [
735
- 201,
736
- 'E - acute'
737
- ],
738
- [
739
- 202,
740
- 'E - circumflex'
741
- ],
742
- [
743
- 203,
744
- 'E - diaeresis'
745
- ],
746
- [
747
- 274,
748
- 'E - macron'
749
- ],
750
- [
751
- 204,
752
- 'I - grave'
753
- ],
754
- [
755
- 205,
756
- 'I - acute'
757
- ],
758
- [
759
- 206,
760
- 'I - circumflex'
761
- ],
762
- [
763
- 207,
764
- 'I - diaeresis'
765
- ],
766
- [
767
- 298,
768
- 'I - macron'
769
- ],
770
- [
771
- 208,
772
- 'ETH'
773
- ],
774
- [
775
- 209,
776
- 'N - tilde'
777
- ],
778
- [
779
- 210,
780
- 'O - grave'
781
- ],
782
- [
783
- 211,
784
- 'O - acute'
785
- ],
786
- [
787
- 212,
788
- 'O - circumflex'
789
- ],
790
- [
791
- 213,
792
- 'O - tilde'
793
- ],
794
- [
795
- 214,
796
- 'O - diaeresis'
797
- ],
798
- [
799
- 216,
800
- 'O - slash'
801
- ],
802
- [
803
- 332,
804
- 'O - macron'
805
- ],
806
- [
807
- 338,
808
- 'ligature OE'
809
- ],
810
- [
811
- 352,
812
- 'S - caron'
813
- ],
814
- [
815
- 217,
816
- 'U - grave'
817
- ],
818
- [
819
- 218,
820
- 'U - acute'
821
- ],
822
- [
823
- 219,
824
- 'U - circumflex'
825
- ],
826
- [
827
- 220,
828
- 'U - diaeresis'
829
- ],
830
- [
831
- 362,
832
- 'U - macron'
833
- ],
834
- [
835
- 221,
836
- 'Y - acute'
837
- ],
838
- [
839
- 376,
840
- 'Y - diaeresis'
841
- ],
842
- [
843
- 562,
844
- 'Y - macron'
845
- ],
846
- [
847
- 222,
848
- 'THORN'
849
- ],
850
- [
851
- 224,
852
- 'a - grave'
853
- ],
854
- [
855
- 225,
856
- 'a - acute'
857
- ],
858
- [
859
- 226,
860
- 'a - circumflex'
861
- ],
862
- [
863
- 227,
864
- 'a - tilde'
865
- ],
866
- [
867
- 228,
868
- 'a - diaeresis'
869
- ],
870
- [
871
- 229,
872
- 'a - ring above'
873
- ],
874
- [
875
- 257,
876
- 'a - macron'
877
- ],
878
- [
879
- 230,
880
- 'ligature ae'
881
- ],
882
- [
883
- 231,
884
- 'c - cedilla'
885
- ],
886
- [
887
- 232,
888
- 'e - grave'
889
- ],
890
- [
891
- 233,
892
- 'e - acute'
893
- ],
894
- [
895
- 234,
896
- 'e - circumflex'
897
- ],
898
- [
899
- 235,
900
- 'e - diaeresis'
901
- ],
902
- [
903
- 275,
904
- 'e - macron'
905
- ],
906
- [
907
- 236,
908
- 'i - grave'
909
- ],
910
- [
911
- 237,
912
- 'i - acute'
913
- ],
914
- [
915
- 238,
916
- 'i - circumflex'
917
- ],
918
- [
919
- 239,
920
- 'i - diaeresis'
921
- ],
922
- [
923
- 299,
924
- 'i - macron'
925
- ],
926
- [
927
- 240,
928
- 'eth'
929
- ],
930
- [
931
- 241,
932
- 'n - tilde'
933
- ],
934
- [
935
- 242,
936
- 'o - grave'
937
- ],
938
- [
939
- 243,
940
- 'o - acute'
941
- ],
942
- [
943
- 244,
944
- 'o - circumflex'
945
- ],
946
- [
947
- 245,
948
- 'o - tilde'
949
- ],
950
- [
951
- 246,
952
- 'o - diaeresis'
953
- ],
954
- [
955
- 248,
956
- 'o slash'
957
- ],
958
- [
959
- 333,
960
- 'o macron'
961
- ],
962
- [
963
- 339,
964
- 'ligature oe'
965
- ],
966
- [
967
- 353,
968
- 's - caron'
969
- ],
970
- [
971
- 249,
972
- 'u - grave'
973
- ],
974
- [
975
- 250,
976
- 'u - acute'
977
- ],
978
- [
979
- 251,
980
- 'u - circumflex'
981
- ],
982
- [
983
- 252,
984
- 'u - diaeresis'
985
- ],
986
- [
987
- 363,
988
- 'u - macron'
989
- ],
990
- [
991
- 253,
992
- 'y - acute'
993
- ],
994
- [
995
- 254,
996
- 'thorn'
997
- ],
998
- [
999
- 255,
1000
- 'y - diaeresis'
1001
- ],
1002
- [
1003
- 563,
1004
- 'y - macron'
1005
- ],
1006
- [
1007
- 913,
1008
- 'Alpha'
1009
- ],
1010
- [
1011
- 914,
1012
- 'Beta'
1013
- ],
1014
- [
1015
- 915,
1016
- 'Gamma'
1017
- ],
1018
- [
1019
- 916,
1020
- 'Delta'
1021
- ],
1022
- [
1023
- 917,
1024
- 'Epsilon'
1025
- ],
1026
- [
1027
- 918,
1028
- 'Zeta'
1029
- ],
1030
- [
1031
- 919,
1032
- 'Eta'
1033
- ],
1034
- [
1035
- 920,
1036
- 'Theta'
1037
- ],
1038
- [
1039
- 921,
1040
- 'Iota'
1041
- ],
1042
- [
1043
- 922,
1044
- 'Kappa'
1045
- ],
1046
- [
1047
- 923,
1048
- 'Lambda'
1049
- ],
1050
- [
1051
- 924,
1052
- 'Mu'
1053
- ],
1054
- [
1055
- 925,
1056
- 'Nu'
1057
- ],
1058
- [
1059
- 926,
1060
- 'Xi'
1061
- ],
1062
- [
1063
- 927,
1064
- 'Omicron'
1065
- ],
1066
- [
1067
- 928,
1068
- 'Pi'
1069
- ],
1070
- [
1071
- 929,
1072
- 'Rho'
1073
- ],
1074
- [
1075
- 931,
1076
- 'Sigma'
1077
- ],
1078
- [
1079
- 932,
1080
- 'Tau'
1081
- ],
1082
- [
1083
- 933,
1084
- 'Upsilon'
1085
- ],
1086
- [
1087
- 934,
1088
- 'Phi'
1089
- ],
1090
- [
1091
- 935,
1092
- 'Chi'
1093
- ],
1094
- [
1095
- 936,
1096
- 'Psi'
1097
- ],
1098
- [
1099
- 937,
1100
- 'Omega'
1101
- ],
1102
- [
1103
- 945,
1104
- 'alpha'
1105
- ],
1106
- [
1107
- 946,
1108
- 'beta'
1109
- ],
1110
- [
1111
- 947,
1112
- 'gamma'
1113
- ],
1114
- [
1115
- 948,
1116
- 'delta'
1117
- ],
1118
- [
1119
- 949,
1120
- 'epsilon'
1121
- ],
1122
- [
1123
- 950,
1124
- 'zeta'
1125
- ],
1126
- [
1127
- 951,
1128
- 'eta'
1129
- ],
1130
- [
1131
- 952,
1132
- 'theta'
1133
- ],
1134
- [
1135
- 953,
1136
- 'iota'
1137
- ],
1138
- [
1139
- 954,
1140
- 'kappa'
1141
- ],
1142
- [
1143
- 955,
1144
- 'lambda'
1145
- ],
1146
- [
1147
- 956,
1148
- 'mu'
1149
- ],
1150
- [
1151
- 957,
1152
- 'nu'
1153
- ],
1154
- [
1155
- 958,
1156
- 'xi'
1157
- ],
1158
- [
1159
- 959,
1160
- 'omicron'
1161
- ],
1162
- [
1163
- 960,
1164
- 'pi'
1165
- ],
1166
- [
1167
- 961,
1168
- 'rho'
1169
- ],
1170
- [
1171
- 962,
1172
- 'final sigma'
1173
- ],
1174
- [
1175
- 963,
1176
- 'sigma'
1177
- ],
1178
- [
1179
- 964,
1180
- 'tau'
1181
- ],
1182
- [
1183
- 965,
1184
- 'upsilon'
1185
- ],
1186
- [
1187
- 966,
1188
- 'phi'
1189
- ],
1190
- [
1191
- 967,
1192
- 'chi'
1193
- ],
1194
- [
1195
- 968,
1196
- 'psi'
1197
- ],
1198
- [
1199
- 969,
1200
- 'omega'
1201
- ]
1202
- ]
1203
- },
1204
- {
1205
- name: 'Symbols',
1206
- characters: [
1207
- [
1208
- 8501,
1209
- 'alef symbol'
1210
- ],
1211
- [
1212
- 982,
1213
- 'pi symbol'
1214
- ],
1215
- [
1216
- 8476,
1217
- 'real part symbol'
1218
- ],
1219
- [
1220
- 978,
1221
- 'upsilon - hook symbol'
1222
- ],
1223
- [
1224
- 8472,
1225
- 'Weierstrass p'
1226
- ],
1227
- [
1228
- 8465,
1229
- 'imaginary part'
1230
- ]
1231
- ]
1232
- },
1233
- {
1234
- name: 'Arrows',
1235
- characters: [
1236
- [
1237
- 8592,
1238
- 'leftwards arrow'
1239
- ],
1240
- [
1241
- 8593,
1242
- 'upwards arrow'
1243
- ],
1244
- [
1245
- 8594,
1246
- 'rightwards arrow'
1247
- ],
1248
- [
1249
- 8595,
1250
- 'downwards arrow'
1251
- ],
1252
- [
1253
- 8596,
1254
- 'left right arrow'
1255
- ],
1256
- [
1257
- 8629,
1258
- 'carriage return'
1259
- ],
1260
- [
1261
- 8656,
1262
- 'leftwards double arrow'
1263
- ],
1264
- [
1265
- 8657,
1266
- 'upwards double arrow'
1267
- ],
1268
- [
1269
- 8658,
1270
- 'rightwards double arrow'
1271
- ],
1272
- [
1273
- 8659,
1274
- 'downwards double arrow'
1275
- ],
1276
- [
1277
- 8660,
1278
- 'left right double arrow'
1279
- ],
1280
- [
1281
- 8756,
1282
- 'therefore'
1283
- ],
1284
- [
1285
- 8834,
1286
- 'subset of'
1287
- ],
1288
- [
1289
- 8835,
1290
- 'superset of'
1291
- ],
1292
- [
1293
- 8836,
1294
- 'not a subset of'
1295
- ],
1296
- [
1297
- 8838,
1298
- 'subset of or equal to'
1299
- ],
1300
- [
1301
- 8839,
1302
- 'superset of or equal to'
1303
- ],
1304
- [
1305
- 8853,
1306
- 'circled plus'
1307
- ],
1308
- [
1309
- 8855,
1310
- 'circled times'
1311
- ],
1312
- [
1313
- 8869,
1314
- 'perpendicular'
1315
- ],
1316
- [
1317
- 8901,
1318
- 'dot operator'
1319
- ],
1320
- [
1321
- 8968,
1322
- 'left ceiling'
1323
- ],
1324
- [
1325
- 8969,
1326
- 'right ceiling'
1327
- ],
1328
- [
1329
- 8970,
1330
- 'left floor'
1331
- ],
1332
- [
1333
- 8971,
1334
- 'right floor'
1335
- ],
1336
- [
1337
- 9001,
1338
- 'left-pointing angle bracket'
1339
- ],
1340
- [
1341
- 9002,
1342
- 'right-pointing angle bracket'
1343
- ],
1344
- [
1345
- 9674,
1346
- 'lozenge'
1347
- ],
1348
- [
1349
- 9824,
1350
- 'black spade suit'
1351
- ],
1352
- [
1353
- 9827,
1354
- 'black club suit'
1355
- ],
1356
- [
1357
- 9829,
1358
- 'black heart suit'
1359
- ],
1360
- [
1361
- 9830,
1362
- 'black diamond suit'
1363
- ],
1364
- [
1365
- 8194,
1366
- 'en space'
1367
- ],
1368
- [
1369
- 8195,
1370
- 'em space'
1371
- ],
1372
- [
1373
- 8201,
1374
- 'thin space'
1375
- ],
1376
- [
1377
- 8204,
1378
- 'zero width non-joiner'
1379
- ],
1380
- [
1381
- 8205,
1382
- 'zero width joiner'
1383
- ],
1384
- [
1385
- 8206,
1386
- 'left-to-right mark'
1387
- ],
1388
- [
1389
- 8207,
1390
- 'right-to-left mark'
1391
- ]
1392
- ]
1393
- }
1394
- ];
437
+ return [
438
+ // TODO: Merge categories with TBIO
439
+ // {
440
+ // name: 'Unknown',
441
+ // characters : [
442
+ // [160, 'no-break space'],
443
+ // [173, 'soft hyphen'],
444
+ // [34, 'quotation mark']
445
+ // ]
446
+ // },
447
+ { name: 'Currency',
448
+ characters: [
449
+ [36, 'dollar sign'],
450
+ [162, 'cent sign'],
451
+ [8364, 'euro sign'],
452
+ [163, 'pound sign'],
453
+ [165, 'yen sign'],
454
+ [164, 'currency sign'],
455
+ [8352, 'euro-currency sign'],
456
+ [8353, 'colon sign'],
457
+ [8354, 'cruzeiro sign'],
458
+ [8355, 'french franc sign'],
459
+ [8356, 'lira sign'],
460
+ [8357, 'mill sign'],
461
+ [8358, 'naira sign'],
462
+ [8359, 'peseta sign'],
463
+ [8360, 'rupee sign'],
464
+ [8361, 'won sign'],
465
+ [8362, 'new sheqel sign'],
466
+ [8363, 'dong sign'],
467
+ [8365, 'kip sign'],
468
+ [8366, 'tugrik sign'],
469
+ [8367, 'drachma sign'],
470
+ [8368, 'german penny symbol'],
471
+ [8369, 'peso sign'],
472
+ [8370, 'guarani sign'],
473
+ [8371, 'austral sign'],
474
+ [8372, 'hryvnia sign'],
475
+ [8373, 'cedi sign'],
476
+ [8374, 'livre tournois sign'],
477
+ [8375, 'spesmilo sign'],
478
+ [8376, 'tenge sign'],
479
+ [8377, 'indian rupee sign'],
480
+ [8378, 'turkish lira sign'],
481
+ [8379, 'nordic mark sign'],
482
+ [8380, 'manat sign'],
483
+ [8381, 'ruble sign'],
484
+ [20870, 'yen character'],
485
+ [20803, 'yuan character'],
486
+ [22291, 'yuan character, in hong kong and taiwan'],
487
+ [22278, 'yen/yuan character variant one']
488
+ ]
489
+ },
490
+ { name: 'Text',
491
+ characters: [
492
+ [169, 'copyright sign'],
493
+ [174, 'registered sign'],
494
+ [8482, 'trade mark sign'],
495
+ [8240, 'per mille sign'],
496
+ [181, 'micro sign'],
497
+ [183, 'middle dot'],
498
+ [8226, 'bullet'],
499
+ [8230, 'three dot leader'],
500
+ [8242, 'minutes / feet'],
501
+ [8243, 'seconds / inches'],
502
+ [167, 'section sign'],
503
+ [182, 'paragraph sign'],
504
+ [223, 'sharp s / ess-zed']
505
+ ]
506
+ },
507
+ { name: 'Quotations',
508
+ characters: [
509
+ [8249, 'single left-pointing angle quotation mark'],
510
+ [8250, 'single right-pointing angle quotation mark'],
511
+ [171, 'left pointing guillemet'],
512
+ [187, 'right pointing guillemet'],
513
+ [8216, 'left single quotation mark'],
514
+ [8217, 'right single quotation mark'],
515
+ [8220, 'left double quotation mark'],
516
+ [8221, 'right double quotation mark'],
517
+ [8218, 'single low-9 quotation mark'],
518
+ [8222, 'double low-9 quotation mark'],
519
+ [60, 'less-than sign'],
520
+ [62, 'greater-than sign'],
521
+ [8804, 'less-than or equal to'],
522
+ [8805, 'greater-than or equal to'],
523
+ [8211, 'en dash'],
524
+ [8212, 'em dash'],
525
+ [175, 'macron'],
526
+ [8254, 'overline'],
527
+ [164, 'currency sign'],
528
+ [166, 'broken bar'],
529
+ [168, 'diaeresis'],
530
+ [161, 'inverted exclamation mark'],
531
+ [191, 'turned question mark'],
532
+ [710, 'circumflex accent'],
533
+ [732, 'small tilde'],
534
+ [176, 'degree sign'],
535
+ [8722, 'minus sign'],
536
+ [177, 'plus-minus sign'],
537
+ [247, 'division sign'],
538
+ [8260, 'fraction slash'],
539
+ [215, 'multiplication sign'],
540
+ [185, 'superscript one'],
541
+ [178, 'superscript two'],
542
+ [179, 'superscript three'],
543
+ [188, 'fraction one quarter'],
544
+ [189, 'fraction one half'],
545
+ [190, 'fraction three quarters']
546
+ ]
547
+ },
548
+ {
549
+ name: 'Mathematical',
550
+ characters: [
551
+ [402, 'function / florin'],
552
+ [8747, 'integral'],
553
+ [8721, 'n-ary sumation'],
554
+ [8734, 'infinity'],
555
+ [8730, 'square root'],
556
+ [8764, 'similar to'],
557
+ [8773, 'approximately equal to'],
558
+ [8776, 'almost equal to'],
559
+ [8800, 'not equal to'],
560
+ [8801, 'identical to'],
561
+ [8712, 'element of'],
562
+ [8713, 'not an element of'],
563
+ [8715, 'contains as member'],
564
+ [8719, 'n-ary product'],
565
+ [8743, 'logical and'],
566
+ [8744, 'logical or'],
567
+ [172, 'not sign'],
568
+ [8745, 'intersection'],
569
+ [8746, 'union'],
570
+ [8706, 'partial differential'],
571
+ [8704, 'for all'],
572
+ [8707, 'there exists'],
573
+ [8709, 'diameter'],
574
+ [8711, 'backward difference'],
575
+ [8727, 'asterisk operator'],
576
+ [8733, 'proportional to'],
577
+ [8736, 'angle']
578
+ ]
579
+ },
580
+ // TODO: Merge categories with TBIO
581
+ // {
582
+ // name: 'Undefined',
583
+ // characters: [
584
+ // [180, 'acute accent'],
585
+ // [184, 'cedilla'],
586
+ // [170, 'feminine ordinal indicator'],
587
+ // [186, 'masculine ordinal indicator'],
588
+ // [8224, 'dagger'],
589
+ // [8225, 'double dagger']
590
+ // ]
591
+ // },
592
+ {
593
+ name: 'Extended Latin',
594
+ characters: [
595
+ [192, 'A - grave'],
596
+ [193, 'A - acute'],
597
+ [194, 'A - circumflex'],
598
+ [195, 'A - tilde'],
599
+ [196, 'A - diaeresis'],
600
+ [197, 'A - ring above'],
601
+ [256, 'A - macron'],
602
+ [198, 'ligature AE'],
603
+ [199, 'C - cedilla'],
604
+ [200, 'E - grave'],
605
+ [201, 'E - acute'],
606
+ [202, 'E - circumflex'],
607
+ [203, 'E - diaeresis'],
608
+ [274, 'E - macron'],
609
+ [204, 'I - grave'],
610
+ [205, 'I - acute'],
611
+ [206, 'I - circumflex'],
612
+ [207, 'I - diaeresis'],
613
+ [298, 'I - macron'],
614
+ [208, 'ETH'],
615
+ [209, 'N - tilde'],
616
+ [210, 'O - grave'],
617
+ [211, 'O - acute'],
618
+ [212, 'O - circumflex'],
619
+ [213, 'O - tilde'],
620
+ [214, 'O - diaeresis'],
621
+ [216, 'O - slash'],
622
+ [332, 'O - macron'],
623
+ [338, 'ligature OE'],
624
+ [352, 'S - caron'],
625
+ [217, 'U - grave'],
626
+ [218, 'U - acute'],
627
+ [219, 'U - circumflex'],
628
+ [220, 'U - diaeresis'],
629
+ [362, 'U - macron'],
630
+ [221, 'Y - acute'],
631
+ [376, 'Y - diaeresis'],
632
+ [562, 'Y - macron'],
633
+ [222, 'THORN'],
634
+ [224, 'a - grave'],
635
+ [225, 'a - acute'],
636
+ [226, 'a - circumflex'],
637
+ [227, 'a - tilde'],
638
+ [228, 'a - diaeresis'],
639
+ [229, 'a - ring above'],
640
+ [257, 'a - macron'],
641
+ [230, 'ligature ae'],
642
+ [231, 'c - cedilla'],
643
+ [232, 'e - grave'],
644
+ [233, 'e - acute'],
645
+ [234, 'e - circumflex'],
646
+ [235, 'e - diaeresis'],
647
+ [275, 'e - macron'],
648
+ [236, 'i - grave'],
649
+ [237, 'i - acute'],
650
+ [238, 'i - circumflex'],
651
+ [239, 'i - diaeresis'],
652
+ [299, 'i - macron'],
653
+ [240, 'eth'],
654
+ [241, 'n - tilde'],
655
+ [242, 'o - grave'],
656
+ [243, 'o - acute'],
657
+ [244, 'o - circumflex'],
658
+ [245, 'o - tilde'],
659
+ [246, 'o - diaeresis'],
660
+ [248, 'o slash'],
661
+ [333, 'o macron'],
662
+ [339, 'ligature oe'],
663
+ [353, 's - caron'],
664
+ [249, 'u - grave'],
665
+ [250, 'u - acute'],
666
+ [251, 'u - circumflex'],
667
+ [252, 'u - diaeresis'],
668
+ [363, 'u - macron'],
669
+ [253, 'y - acute'],
670
+ [254, 'thorn'],
671
+ [255, 'y - diaeresis'],
672
+ [563, 'y - macron'],
673
+ [913, 'Alpha'],
674
+ [914, 'Beta'],
675
+ [915, 'Gamma'],
676
+ [916, 'Delta'],
677
+ [917, 'Epsilon'],
678
+ [918, 'Zeta'],
679
+ [919, 'Eta'],
680
+ [920, 'Theta'],
681
+ [921, 'Iota'],
682
+ [922, 'Kappa'],
683
+ [923, 'Lambda'],
684
+ [924, 'Mu'],
685
+ [925, 'Nu'],
686
+ [926, 'Xi'],
687
+ [927, 'Omicron'],
688
+ [928, 'Pi'],
689
+ [929, 'Rho'],
690
+ [931, 'Sigma'],
691
+ [932, 'Tau'],
692
+ [933, 'Upsilon'],
693
+ [934, 'Phi'],
694
+ [935, 'Chi'],
695
+ [936, 'Psi'],
696
+ [937, 'Omega'],
697
+ [945, 'alpha'],
698
+ [946, 'beta'],
699
+ [947, 'gamma'],
700
+ [948, 'delta'],
701
+ [949, 'epsilon'],
702
+ [950, 'zeta'],
703
+ [951, 'eta'],
704
+ [952, 'theta'],
705
+ [953, 'iota'],
706
+ [954, 'kappa'],
707
+ [955, 'lambda'],
708
+ [956, 'mu'],
709
+ [957, 'nu'],
710
+ [958, 'xi'],
711
+ [959, 'omicron'],
712
+ [960, 'pi'],
713
+ [961, 'rho'],
714
+ [962, 'final sigma'],
715
+ [963, 'sigma'],
716
+ [964, 'tau'],
717
+ [965, 'upsilon'],
718
+ [966, 'phi'],
719
+ [967, 'chi'],
720
+ [968, 'psi'],
721
+ [969, 'omega']
722
+ ]
723
+ },
724
+ {
725
+ name: 'Symbols',
726
+ characters: [
727
+ [8501, 'alef symbol'],
728
+ [982, 'pi symbol'],
729
+ [8476, 'real part symbol'],
730
+ [978, 'upsilon - hook symbol'],
731
+ [8472, 'Weierstrass p'],
732
+ [8465, 'imaginary part']
733
+ ]
734
+ },
735
+ {
736
+ name: 'Arrows',
737
+ characters: [
738
+ [8592, 'leftwards arrow'],
739
+ [8593, 'upwards arrow'],
740
+ [8594, 'rightwards arrow'],
741
+ [8595, 'downwards arrow'],
742
+ [8596, 'left right arrow'],
743
+ [8629, 'carriage return'],
744
+ [8656, 'leftwards double arrow'],
745
+ [8657, 'upwards double arrow'],
746
+ [8658, 'rightwards double arrow'],
747
+ [8659, 'downwards double arrow'],
748
+ [8660, 'left right double arrow'],
749
+ [8756, 'therefore'],
750
+ [8834, 'subset of'],
751
+ [8835, 'superset of'],
752
+ [8836, 'not a subset of'],
753
+ [8838, 'subset of or equal to'],
754
+ [8839, 'superset of or equal to'],
755
+ [8853, 'circled plus'],
756
+ [8855, 'circled times'],
757
+ [8869, 'perpendicular'],
758
+ [8901, 'dot operator'],
759
+ [8968, 'left ceiling'],
760
+ [8969, 'right ceiling'],
761
+ [8970, 'left floor'],
762
+ [8971, 'right floor'],
763
+ [9001, 'left-pointing angle bracket'],
764
+ [9002, 'right-pointing angle bracket'],
765
+ [9674, 'lozenge'],
766
+ [9824, 'black spade suit'],
767
+ [9827, 'black club suit'],
768
+ [9829, 'black heart suit'],
769
+ [9830, 'black diamond suit'],
770
+ [8194, 'en space'],
771
+ [8195, 'em space'],
772
+ [8201, 'thin space'],
773
+ [8204, 'zero width non-joiner'],
774
+ [8205, 'zero width joiner'],
775
+ [8206, 'left-to-right mark'],
776
+ [8207, 'right-to-left mark']
777
+ ]
778
+ }
779
+ ];
1395
780
  };
1396
- const charmapFilter = charmap => {
1397
- return global.grep(charmap, item => {
1398
- return isArray(item) && item.length === 2;
1399
- });
781
+ const charmapFilter = (charmap) => {
782
+ return global.grep(charmap, (item) => {
783
+ return isArray(item) && item.length === 2;
784
+ });
1400
785
  };
1401
- const getCharsFromOption = optionValue => {
1402
- if (isArray(optionValue)) {
1403
- return charmapFilter(optionValue);
1404
- }
1405
- if (typeof optionValue === 'function') {
1406
- return optionValue();
1407
- }
1408
- return [];
786
+ const getCharsFromOption = (optionValue) => {
787
+ if (isArray(optionValue)) {
788
+ return charmapFilter(optionValue);
789
+ }
790
+ if (typeof optionValue === 'function') {
791
+ return optionValue();
792
+ }
793
+ return [];
1409
794
  };
1410
795
  const extendCharMap = (editor, charmap) => {
1411
- const userCharMap = getCharMap$1(editor);
1412
- if (userCharMap) {
1413
- charmap = [{
1414
- name: UserDefined,
1415
- characters: getCharsFromOption(userCharMap)
1416
- }];
1417
- }
1418
- const userCharMapAppend = getCharMapAppend(editor);
1419
- if (userCharMapAppend) {
1420
- const userDefinedGroup = global.grep(charmap, cg => cg.name === UserDefined);
1421
- if (userDefinedGroup.length) {
1422
- userDefinedGroup[0].characters = [
1423
- ...userDefinedGroup[0].characters,
1424
- ...getCharsFromOption(userCharMapAppend)
1425
- ];
1426
- return charmap;
796
+ const userCharMap = getCharMap$1(editor);
797
+ if (userCharMap) {
798
+ charmap = [{ name: UserDefined, characters: getCharsFromOption(userCharMap) }];
1427
799
  }
1428
- return charmap.concat({
1429
- name: UserDefined,
1430
- characters: getCharsFromOption(userCharMapAppend)
1431
- });
1432
- }
1433
- return charmap;
1434
- };
1435
- const getCharMap = editor => {
1436
- const groups = extendCharMap(editor, getDefaultCharMap());
1437
- return groups.length > 1 ? [{
1438
- name: 'All',
1439
- characters: bind(groups, g => g.characters)
1440
- }].concat(groups) : groups;
1441
- };
1442
-
1443
- const get = editor => {
1444
- const getCharMap$1 = () => {
1445
- return getCharMap(editor);
1446
- };
1447
- const insertChar$1 = chr => {
1448
- insertChar(editor, chr);
1449
- };
1450
- return {
1451
- getCharMap: getCharMap$1,
1452
- insertChar: insertChar$1
1453
- };
800
+ const userCharMapAppend = getCharMapAppend(editor);
801
+ if (userCharMapAppend) {
802
+ const userDefinedGroup = global.grep(charmap, (cg) => cg.name === UserDefined);
803
+ if (userDefinedGroup.length) {
804
+ userDefinedGroup[0].characters = [...userDefinedGroup[0].characters, ...getCharsFromOption(userCharMapAppend)];
805
+ return charmap;
806
+ }
807
+ return charmap.concat({ name: UserDefined, characters: getCharsFromOption(userCharMapAppend) });
808
+ }
809
+ return charmap;
1454
810
  };
1455
-
1456
- const Cell = initial => {
1457
- let value = initial;
1458
- const get = () => {
1459
- return value;
1460
- };
1461
- const set = v => {
1462
- value = v;
1463
- };
1464
- return {
1465
- get,
1466
- set
1467
- };
811
+ const getCharMap = (editor) => {
812
+ const groups = extendCharMap(editor, getDefaultCharMap());
813
+ return groups.length > 1 ? [
814
+ {
815
+ name: 'All',
816
+ characters: bind(groups, (g) => g.characters)
817
+ }
818
+ ].concat(groups) : groups;
1468
819
  };
1469
820
 
1470
- const last = (fn, rate) => {
1471
- let timer = null;
1472
- const cancel = () => {
1473
- if (!isNull(timer)) {
1474
- clearTimeout(timer);
1475
- timer = null;
1476
- }
1477
- };
1478
- const throttle = (...args) => {
1479
- cancel();
1480
- timer = setTimeout(() => {
1481
- timer = null;
1482
- fn.apply(null, args);
1483
- }, rate);
1484
- };
1485
- return {
1486
- cancel,
1487
- throttle
1488
- };
821
+ const get = (editor) => {
822
+ const getCharMap$1 = () => {
823
+ return getCharMap(editor);
824
+ };
825
+ const insertChar$1 = (chr) => {
826
+ insertChar(editor, chr);
827
+ };
828
+ return {
829
+ getCharMap: getCharMap$1,
830
+ insertChar: insertChar$1
831
+ };
1489
832
  };
1490
833
 
1491
- const contains = (str, substr, start = 0, end) => {
1492
- const idx = str.indexOf(substr, start);
1493
- if (idx !== -1) {
1494
- return isUndefined(end) ? true : idx + substr.length <= end;
1495
- } else {
1496
- return false;
1497
- }
1498
- };
1499
- const fromCodePoint = String.fromCodePoint;
1500
-
1501
834
  const charMatches = (charCode, name, lowerCasePattern) => {
1502
- if (contains(fromCodePoint(charCode).toLowerCase(), lowerCasePattern)) {
1503
- return true;
1504
- } else {
1505
- return contains(name.toLowerCase(), lowerCasePattern) || contains(name.toLowerCase().replace(/\s+/g, ''), lowerCasePattern);
1506
- }
835
+ if (contains(fromCodePoint(charCode).toLowerCase(), lowerCasePattern)) {
836
+ return true;
837
+ }
838
+ else {
839
+ return contains(name.toLowerCase(), lowerCasePattern) || contains(name.toLowerCase().replace(/\s+/g, ''), lowerCasePattern);
840
+ }
1507
841
  };
1508
842
  const scan = (group, pattern) => {
1509
- const matches = [];
1510
- const lowerCasePattern = pattern.toLowerCase();
1511
- each(group.characters, g => {
1512
- if (charMatches(g[0], g[1], lowerCasePattern)) {
1513
- matches.push(g);
1514
- }
1515
- });
1516
- return map(matches, m => ({
1517
- text: m[1],
1518
- value: fromCodePoint(m[0]),
1519
- icon: fromCodePoint(m[0])
1520
- }));
843
+ const matches = [];
844
+ const lowerCasePattern = pattern.toLowerCase();
845
+ each(group.characters, (g) => {
846
+ if (charMatches(g[0], g[1], lowerCasePattern)) {
847
+ matches.push(g);
848
+ }
849
+ });
850
+ return map(matches, (m) => ({
851
+ text: m[1],
852
+ value: fromCodePoint(m[0]),
853
+ icon: fromCodePoint(m[0])
854
+ }));
1521
855
  };
1522
856
 
1523
857
  const patternName = 'pattern';
1524
858
  const open = (editor, charMap) => {
1525
- const makeGroupItems = () => [
1526
- {
1527
- label: 'Search',
1528
- type: 'input',
1529
- name: patternName
1530
- },
1531
- {
1532
- type: 'collection',
1533
- name: 'results'
1534
- }
1535
- ];
1536
- const makeTabs = () => map(charMap, charGroup => ({
1537
- title: charGroup.name,
1538
- name: charGroup.name,
1539
- items: makeGroupItems()
1540
- }));
1541
- const makePanel = () => ({
1542
- type: 'panel',
1543
- items: makeGroupItems()
1544
- });
1545
- const makeTabPanel = () => ({
1546
- type: 'tabpanel',
1547
- tabs: makeTabs()
1548
- });
1549
- const currentTab = charMap.length === 1 ? Cell(UserDefined) : Cell('All');
1550
- const scanAndSet = (dialogApi, pattern) => {
1551
- find(charMap, group => group.name === currentTab.get()).each(f => {
1552
- const items = scan(f, pattern);
1553
- dialogApi.setData({ results: items });
1554
- });
1555
- };
1556
- const SEARCH_DELAY = 40;
1557
- const updateFilter = last(dialogApi => {
1558
- const pattern = dialogApi.getData().pattern;
1559
- scanAndSet(dialogApi, pattern);
1560
- }, SEARCH_DELAY);
1561
- const body = charMap.length === 1 ? makePanel() : makeTabPanel();
1562
- const initialData = {
1563
- pattern: '',
1564
- results: scan(charMap[0], '')
1565
- };
1566
- const bridgeSpec = {
1567
- title: 'Special Character',
1568
- size: 'normal',
1569
- body,
1570
- buttons: [{
1571
- type: 'cancel',
1572
- name: 'close',
1573
- text: 'Close',
1574
- primary: true
1575
- }],
1576
- initialData,
1577
- onAction: (api, details) => {
1578
- if (details.name === 'results') {
1579
- insertChar(editor, details.value);
1580
- api.close();
1581
- }
1582
- },
1583
- onTabChange: (dialogApi, details) => {
1584
- currentTab.set(details.newTabName);
1585
- updateFilter.throttle(dialogApi);
1586
- },
1587
- onChange: (dialogApi, changeData) => {
1588
- if (changeData.name === patternName) {
1589
- updateFilter.throttle(dialogApi);
1590
- }
1591
- }
1592
- };
1593
- const dialogApi = editor.windowManager.open(bridgeSpec);
1594
- dialogApi.focus(patternName);
859
+ const makeGroupItems = () => [
860
+ {
861
+ label: 'Search',
862
+ type: 'input',
863
+ name: patternName
864
+ },
865
+ {
866
+ type: 'collection',
867
+ name: 'results'
868
+ // TODO TINY-3229 implement collection columns properly
869
+ // columns: 'auto'
870
+ }
871
+ ];
872
+ const makeTabs = () => map(charMap, (charGroup) => ({
873
+ title: charGroup.name,
874
+ name: charGroup.name,
875
+ items: makeGroupItems()
876
+ }));
877
+ const makePanel = () => ({ type: 'panel', items: makeGroupItems() });
878
+ const makeTabPanel = () => ({ type: 'tabpanel', tabs: makeTabs() });
879
+ const currentTab = charMap.length === 1 ? Cell(UserDefined) : Cell('All');
880
+ const scanAndSet = (dialogApi, pattern) => {
881
+ find(charMap, (group) => group.name === currentTab.get()).each((f) => {
882
+ const items = scan(f, pattern);
883
+ dialogApi.setData({
884
+ results: items
885
+ });
886
+ });
887
+ };
888
+ const SEARCH_DELAY = 40;
889
+ const updateFilter = last((dialogApi) => {
890
+ const pattern = dialogApi.getData().pattern;
891
+ scanAndSet(dialogApi, pattern);
892
+ }, SEARCH_DELAY);
893
+ const body = charMap.length === 1 ? makePanel() : makeTabPanel();
894
+ const initialData = {
895
+ pattern: '',
896
+ results: scan(charMap[0], '')
897
+ };
898
+ const bridgeSpec = {
899
+ title: 'Special Character',
900
+ size: 'normal',
901
+ body,
902
+ buttons: [
903
+ {
904
+ type: 'cancel',
905
+ name: 'close',
906
+ text: 'Close',
907
+ primary: true
908
+ }
909
+ ],
910
+ initialData,
911
+ onAction: (api, details) => {
912
+ if (details.name === 'results') {
913
+ insertChar(editor, details.value);
914
+ api.close();
915
+ }
916
+ },
917
+ onTabChange: (dialogApi, details) => {
918
+ currentTab.set(details.newTabName);
919
+ updateFilter.throttle(dialogApi);
920
+ },
921
+ onChange: (dialogApi, changeData) => {
922
+ if (changeData.name === patternName) {
923
+ updateFilter.throttle(dialogApi);
924
+ }
925
+ }
926
+ };
927
+ const dialogApi = editor.windowManager.open(bridgeSpec);
928
+ dialogApi.focus(patternName);
1595
929
  };
1596
930
 
1597
931
  const register$1 = (editor, charMap) => {
1598
- editor.addCommand('mceShowCharmap', () => {
1599
- open(editor, charMap);
1600
- });
932
+ editor.addCommand('mceShowCharmap', () => {
933
+ open(editor, charMap);
934
+ });
1601
935
  };
1602
936
 
1603
937
  const init = (editor, all) => {
1604
- editor.ui.registry.addAutocompleter('charmap', {
1605
- trigger: ':',
1606
- columns: 'auto',
1607
- minChars: 2,
1608
- fetch: (pattern, _maxResults) => new Promise((resolve, _reject) => {
1609
- resolve(scan(all, pattern));
1610
- }),
1611
- onAction: (autocompleteApi, rng, value) => {
1612
- editor.selection.setRng(rng);
1613
- editor.insertContent(value);
1614
- autocompleteApi.hide();
1615
- }
1616
- });
938
+ editor.ui.registry.addAutocompleter('charmap', {
939
+ trigger: ':',
940
+ columns: 'auto',
941
+ minChars: 2,
942
+ fetch: (pattern, _maxResults) => new Promise((resolve, _reject) => {
943
+ resolve(scan(all, pattern));
944
+ }),
945
+ onAction: (autocompleteApi, rng, value) => {
946
+ editor.selection.setRng(rng);
947
+ editor.insertContent(value);
948
+ autocompleteApi.hide();
949
+ }
950
+ });
1617
951
  };
1618
952
 
1619
- const onSetupEditable = editor => api => {
1620
- const nodeChanged = () => {
1621
- api.setEnabled(editor.selection.isEditable());
1622
- };
1623
- editor.on('NodeChange', nodeChanged);
1624
- nodeChanged();
1625
- return () => {
1626
- editor.off('NodeChange', nodeChanged);
1627
- };
953
+ const onSetupEditable = (editor) => (api) => {
954
+ const nodeChanged = () => {
955
+ api.setEnabled(editor.selection.isEditable());
956
+ };
957
+ editor.on('NodeChange', nodeChanged);
958
+ nodeChanged();
959
+ return () => {
960
+ editor.off('NodeChange', nodeChanged);
961
+ };
1628
962
  };
1629
- const register = editor => {
1630
- const onAction = () => editor.execCommand('mceShowCharmap');
1631
- editor.ui.registry.addButton('charmap', {
1632
- icon: 'insert-character',
1633
- tooltip: 'Special character',
1634
- onAction,
1635
- onSetup: onSetupEditable(editor)
1636
- });
1637
- editor.ui.registry.addMenuItem('charmap', {
1638
- icon: 'insert-character',
1639
- text: 'Special character...',
1640
- onAction,
1641
- onSetup: onSetupEditable(editor)
1642
- });
963
+ const register = (editor) => {
964
+ const onAction = () => editor.execCommand('mceShowCharmap');
965
+ editor.ui.registry.addButton('charmap', {
966
+ icon: 'insert-character',
967
+ tooltip: 'Special character',
968
+ onAction,
969
+ onSetup: onSetupEditable(editor)
970
+ });
971
+ editor.ui.registry.addMenuItem('charmap', {
972
+ icon: 'insert-character',
973
+ text: 'Special character...',
974
+ onAction,
975
+ onSetup: onSetupEditable(editor)
976
+ });
1643
977
  };
1644
978
 
1645
979
  var Plugin = () => {
1646
- global$1.add('charmap', editor => {
1647
- register$2(editor);
1648
- const charMap = getCharMap(editor);
1649
- register$1(editor, charMap);
1650
- register(editor);
1651
- init(editor, charMap[0]);
1652
- return get(editor);
1653
- });
980
+ global$1.add('charmap', (editor) => {
981
+ register$2(editor);
982
+ const charMap = getCharMap(editor);
983
+ register$1(editor, charMap);
984
+ register(editor);
985
+ init(editor, charMap[0]);
986
+ return get(editor);
987
+ });
1654
988
  };
1655
989
 
1656
990
  Plugin();
991
+ /** *****
992
+ * DO NOT EXPORT ANYTHING
993
+ *
994
+ * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
995
+ *******/
1657
996
 
1658
997
  })();