@dangl/angular-material-shared 2.9.0-beta0047 → 2.9.0-beta0048

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/icons/default/icons.js +9 -46
  3. package/tinymce-assets/icons/default/icons.min.js +1 -1
  4. package/tinymce-assets/models/dom/model.js +7239 -8193
  5. package/tinymce-assets/models/dom/model.min.js +1 -1
  6. package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
  7. package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
  8. package/tinymce-assets/plugins/advlist/plugin.js +200 -412
  9. package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
  10. package/tinymce-assets/plugins/anchor/plugin.js +166 -189
  11. package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
  12. package/tinymce-assets/plugins/autolink/plugin.js +220 -310
  13. package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
  14. package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
  15. package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
  16. package/tinymce-assets/plugins/autosave/plugin.js +189 -208
  17. package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
  18. package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
  19. package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
  20. package/tinymce-assets/plugins/code/plugin.js +61 -73
  21. package/tinymce-assets/plugins/code/plugin.min.js +4 -0
  22. package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
  23. package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
  24. package/tinymce-assets/plugins/directionality/plugin.js +304 -545
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
  28. package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
  29. package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
  30. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
  31. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
  32. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
  33. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
  34. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
  35. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
  69. package/tinymce-assets/plugins/help/plugin.js +809 -739
  70. package/tinymce-assets/plugins/help/plugin.min.js +5 -1
  71. package/tinymce-assets/plugins/image/plugin.js +1291 -1475
  72. package/tinymce-assets/plugins/image/plugin.min.js +5 -1
  73. package/tinymce-assets/plugins/importcss/plugin.js +269 -328
  74. package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
  75. package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
  76. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
  77. package/tinymce-assets/plugins/link/plugin.js +1084 -1419
  78. package/tinymce-assets/plugins/link/plugin.min.js +5 -1
  79. package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
  80. package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
  81. package/tinymce-assets/plugins/media/plugin.js +1047 -1305
  82. package/tinymce-assets/plugins/media/plugin.min.js +5 -1
  83. package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
  84. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
  85. package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
  86. package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
  87. package/tinymce-assets/plugins/preview/plugin.js +74 -742
  88. package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
  89. package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
  90. package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
  91. package/tinymce-assets/plugins/save/plugin.js +82 -100
  92. package/tinymce-assets/plugins/save/plugin.min.js +5 -1
  93. package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
  94. package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
  95. package/tinymce-assets/plugins/table/plugin.js +3094 -3651
  96. package/tinymce-assets/plugins/table/plugin.min.js +5 -1
  97. package/tinymce-assets/plugins/template/index.js +7 -0
  98. package/tinymce-assets/plugins/template/plugin.js +567 -0
  99. package/tinymce-assets/plugins/template/plugin.min.js +5 -0
  100. package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
  101. package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
  102. package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
  103. package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
  104. package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
  105. package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
  106. package/tinymce-assets/skins/content/dark/content.css +4 -0
  107. package/tinymce-assets/skins/content/dark/content.js +6 -1
  108. package/tinymce-assets/skins/content/dark/content.min.css +4 -0
  109. package/tinymce-assets/skins/content/default/content.css +4 -0
  110. package/tinymce-assets/skins/content/default/content.js +6 -1
  111. package/tinymce-assets/skins/content/default/content.min.css +4 -0
  112. package/tinymce-assets/skins/content/document/content.css +4 -0
  113. package/tinymce-assets/skins/content/document/content.js +6 -1
  114. package/tinymce-assets/skins/content/document/content.min.css +4 -0
  115. package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
  116. package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
  117. package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
  118. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
  119. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
  120. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
  121. package/tinymce-assets/skins/content/writer/content.css +4 -0
  122. package/tinymce-assets/skins/content/writer/content.js +6 -1
  123. package/tinymce-assets/skins/content/writer/content.min.css +4 -0
  124. package/tinymce-assets/skins/ui/oxide/content.css +53 -148
  125. package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
  126. package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
  127. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
  128. package/tinymce-assets/skins/ui/oxide/content.js +6 -1
  129. package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
  130. package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
  131. package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
  132. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
  134. package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
  135. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
  136. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
  137. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
  138. package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
  139. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
  140. package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
  141. package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
  142. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
  144. package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
  145. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
  146. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
  147. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
  148. package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
  149. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
  150. package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
  151. package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
  152. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
  154. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
  155. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
  156. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
  164. package/tinymce-assets/themes/silver/theme.js +28439 -32466
  165. package/tinymce-assets/themes/silver/theme.min.js +1 -1
@@ -1,765 +1,97 @@
1
1
  /**
2
- * TinyMCE version 7.9.3 (2026-05-19)
2
+ * TinyMCE version 6.8.6 (TBD)
3
3
  */
4
4
 
5
5
  (function () {
6
6
  'use strict';
7
7
 
8
- var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
+ var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
9
 
10
- /* eslint-disable @typescript-eslint/no-wrapper-object-types */
11
- const eq = (t) => (a) => t === a;
12
- const isUndefined = eq(undefined);
13
- const isNullable = (a) => a === null || a === undefined;
14
- const isNonNullable = (a) => !isNullable(a);
15
-
16
- const constant = (value) => {
17
- return () => {
18
- return value;
19
- };
20
- };
21
- const never = constant(false);
22
-
23
- /**
24
- * The `Optional` type represents a value (of any type) that potentially does
25
- * not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
26
- * value does exist) or a `None` (in which case the value does not exist). This
27
- * module defines a whole lot of FP-inspired utility functions for dealing with
28
- * `Optional` objects.
29
- *
30
- * Comparison with null or undefined:
31
- * - We don't get fancy null coalescing operators with `Optional`
32
- * - We do get fancy helper functions with `Optional`
33
- * - `Optional` support nesting, and allow for the type to still be nullable (or
34
- * another `Optional`)
35
- * - There is no option to turn off strict-optional-checks like there is for
36
- * strict-null-checks
37
- */
38
- class Optional {
39
- // The internal representation has a `tag` and a `value`, but both are
40
- // private: able to be console.logged, but not able to be accessed by code
41
- constructor(tag, value) {
42
- this.tag = tag;
43
- this.value = value;
44
- }
45
- // --- Identities ---
46
- /**
47
- * Creates a new `Optional<T>` that **does** contain a value.
48
- */
49
- static some(value) {
50
- return new Optional(true, value);
51
- }
52
- /**
53
- * Create a new `Optional<T>` that **does not** contain a value. `T` can be
54
- * any type because we don't actually have a `T`.
55
- */
56
- static none() {
57
- return Optional.singletonNone;
58
- }
59
- /**
60
- * Perform a transform on an `Optional` type. Regardless of whether this
61
- * `Optional` contains a value or not, `fold` will return a value of type `U`.
62
- * If this `Optional` does not contain a value, the `U` will be created by
63
- * calling `onNone`. If this `Optional` does contain a value, the `U` will be
64
- * created by calling `onSome`.
65
- *
66
- * For the FP enthusiasts in the room, this function:
67
- * 1. Could be used to implement all of the functions below
68
- * 2. Forms a catamorphism
69
- */
70
- fold(onNone, onSome) {
71
- if (this.tag) {
72
- return onSome(this.value);
73
- }
74
- else {
75
- return onNone();
76
- }
77
- }
78
- /**
79
- * Determine if this `Optional` object contains a value.
80
- */
81
- isSome() {
82
- return this.tag;
83
- }
84
- /**
85
- * Determine if this `Optional` object **does not** contain a value.
86
- */
87
- isNone() {
88
- return !this.tag;
89
- }
90
- // --- Functor (name stolen from Haskell / maths) ---
91
- /**
92
- * Perform a transform on an `Optional` object, **if** there is a value. If
93
- * you provide a function to turn a T into a U, this is the function you use
94
- * to turn an `Optional<T>` into an `Optional<U>`. If this **does** contain
95
- * a value then the output will also contain a value (that value being the
96
- * output of `mapper(this.value)`), and if this **does not** contain a value
97
- * then neither will the output.
98
- */
99
- map(mapper) {
100
- if (this.tag) {
101
- return Optional.some(mapper(this.value));
102
- }
103
- else {
104
- return Optional.none();
105
- }
106
- }
107
- // --- Monad (name stolen from Haskell / maths) ---
108
- /**
109
- * Perform a transform on an `Optional` object, **if** there is a value.
110
- * Unlike `map`, here the transform itself also returns an `Optional`.
111
- */
112
- bind(binder) {
113
- if (this.tag) {
114
- return binder(this.value);
115
- }
116
- else {
117
- return Optional.none();
118
- }
119
- }
120
- // --- Traversable (name stolen from Haskell / maths) ---
121
- /**
122
- * For a given predicate, this function finds out if there **exists** a value
123
- * inside this `Optional` object that meets the predicate. In practice, this
124
- * means that for `Optional`s that do not contain a value it returns false (as
125
- * no predicate-meeting value exists).
126
- */
127
- exists(predicate) {
128
- return this.tag && predicate(this.value);
129
- }
130
- /**
131
- * For a given predicate, this function finds out if **all** the values inside
132
- * this `Optional` object meet the predicate. In practice, this means that
133
- * for `Optional`s that do not contain a value it returns true (as all 0
134
- * objects do meet the predicate).
135
- */
136
- forall(predicate) {
137
- return !this.tag || predicate(this.value);
138
- }
139
- filter(predicate) {
140
- if (!this.tag || predicate(this.value)) {
141
- return this;
142
- }
143
- else {
144
- return Optional.none();
145
- }
146
- }
147
- // --- Getters ---
148
- /**
149
- * Get the value out of the inside of the `Optional` object, using a default
150
- * `replacement` value if the provided `Optional` object does not contain a
151
- * value.
152
- */
153
- getOr(replacement) {
154
- return this.tag ? this.value : replacement;
155
- }
156
- /**
157
- * Get the value out of the inside of the `Optional` object, using a default
158
- * `replacement` value if the provided `Optional` object does not contain a
159
- * value. Unlike `getOr`, in this method the `replacement` object is also
160
- * `Optional` - meaning that this method will always return an `Optional`.
161
- */
162
- or(replacement) {
163
- return this.tag ? this : replacement;
164
- }
165
- /**
166
- * Get the value out of the inside of the `Optional` object, using a default
167
- * `replacement` value if the provided `Optional` object does not contain a
168
- * value. Unlike `getOr`, in this method the `replacement` value is
169
- * "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
170
- * pass a function which (if called) will **return** the `value` you want to
171
- * use.
172
- */
173
- getOrThunk(thunk) {
174
- return this.tag ? this.value : thunk();
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.
180
- *
181
- * Unlike `or`, in this method the `replacement` value is "thunked" - that is
182
- * to say that you don't pass a value to `orThunk`, you pass a function which
183
- * (if called) will **return** the `value` you want to use.
184
- *
185
- * Unlike `getOrThunk`, in this method the `replacement` value is also
186
- * `Optional`, meaning that this method will always return an `Optional`.
187
- */
188
- orThunk(thunk) {
189
- return this.tag ? this : thunk();
190
- }
191
- /**
192
- * Get the value out of the inside of the `Optional` object, throwing an
193
- * exception if the provided `Optional` object does not contain a value.
194
- *
195
- * WARNING:
196
- * You should only be using this function if you know that the `Optional`
197
- * object **is not** empty (otherwise you're throwing exceptions in production
198
- * code, which is bad).
199
- *
200
- * In tests this is more acceptable.
201
- *
202
- * Prefer other methods to this, such as `.each`.
203
- */
204
- getOrDie(message) {
205
- if (!this.tag) {
206
- throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
207
- }
208
- else {
209
- return this.value;
210
- }
211
- }
212
- // --- Interop with null and undefined ---
213
- /**
214
- * Creates an `Optional` value from a nullable (or undefined-able) input.
215
- * Null, or undefined, is converted to `None`, and anything else is converted
216
- * to `Some`.
217
- */
218
- static from(value) {
219
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
220
- }
221
- /**
222
- * Converts an `Optional` to a nullable type, by getting the value if it
223
- * exists, or returning `null` if it does not.
224
- */
225
- getOrNull() {
226
- return this.tag ? this.value : null;
227
- }
228
- /**
229
- * Converts an `Optional` to an undefined-able type, by getting the value if
230
- * it exists, or returning `undefined` if it does not.
231
- */
232
- getOrUndefined() {
233
- return this.value;
234
- }
235
- // --- Utilities ---
236
- /**
237
- * If the `Optional` contains a value, perform an action on that value.
238
- * Unlike the rest of the methods on this type, `.each` has side-effects. If
239
- * you want to transform an `Optional<T>` **into** something, then this is not
240
- * the method for you. If you want to use an `Optional<T>` to **do**
241
- * something, then this is the method for you - provided you're okay with not
242
- * doing anything in the case where the `Optional` doesn't have a value inside
243
- * it. If you're not sure whether your use-case fits into transforming
244
- * **into** something or **doing** something, check whether it has a return
245
- * value. If it does, you should be performing a transform.
246
- */
247
- each(worker) {
248
- if (this.tag) {
249
- worker(this.value);
250
- }
251
- }
252
- /**
253
- * Turn the `Optional` object into an array that contains all of the values
254
- * stored inside the `Optional`. In practice, this means the output will have
255
- * either 0 or 1 elements.
256
- */
257
- toArray() {
258
- return this.tag ? [this.value] : [];
259
- }
260
- /**
261
- * Turn the `Optional` object into a string for debugging or printing. Not
262
- * recommended for production code, but good for debugging. Also note that
263
- * these days an `Optional` object can be logged to the console directly, and
264
- * its inner value (if it exists) will be visible.
265
- */
266
- toString() {
267
- return this.tag ? `some(${this.value})` : 'none()';
268
- }
269
- }
270
- // Sneaky optimisation: every instance of Optional.none is identical, so just
271
- // reuse the same object
272
- Optional.singletonNone = new Optional(false);
273
-
274
- const findUntil = (xs, pred, until) => {
275
- for (let i = 0, len = xs.length; i < len; i++) {
276
- const x = xs[i];
277
- if (pred(x, i)) {
278
- return Optional.some(x);
279
- }
280
- else if (until(x, i)) {
281
- break;
282
- }
283
- }
284
- return Optional.none();
285
- };
286
- const find$1 = (xs, pred) => {
287
- return findUntil(xs, pred, never);
288
- };
289
- const findMap = (arr, f) => {
290
- for (let i = 0; i < arr.length; i++) {
291
- const r = f(arr[i], i);
292
- if (r.isSome()) {
293
- return r;
294
- }
295
- }
296
- return Optional.none();
297
- };
298
-
299
- const contains = (str, substr, start = 0, end) => {
300
- const idx = str.indexOf(substr, start);
301
- if (idx !== -1) {
302
- return isUndefined(end) ? true : idx + substr.length <= end;
303
- }
304
- else {
305
- return false;
306
- }
307
- };
308
-
309
- const cached = (f) => {
310
- let called = false;
311
- let r;
312
- return (...args) => {
313
- if (!called) {
314
- called = true;
315
- r = f.apply(null, args);
316
- }
317
- return r;
318
- };
319
- };
320
-
321
- const DeviceType = (os, browser, userAgent, mediaMatch) => {
322
- const isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
323
- const isiPhone = os.isiOS() && !isiPad;
324
- const isMobile = os.isiOS() || os.isAndroid();
325
- const isTouch = isMobile || mediaMatch('(pointer:coarse)');
326
- const isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');
327
- const isPhone = isiPhone || isMobile && !isTablet;
328
- const iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
329
- const isDesktop = !isPhone && !isTablet && !iOSwebview;
330
- return {
331
- isiPad: constant(isiPad),
332
- isiPhone: constant(isiPhone),
333
- isTablet: constant(isTablet),
334
- isPhone: constant(isPhone),
335
- isTouch: constant(isTouch),
336
- isAndroid: os.isAndroid,
337
- isiOS: os.isiOS,
338
- isWebView: constant(iOSwebview),
339
- isDesktop: constant(isDesktop)
340
- };
341
- };
342
-
343
- const firstMatch = (regexes, s) => {
344
- for (let i = 0; i < regexes.length; i++) {
345
- const x = regexes[i];
346
- if (x.test(s)) {
347
- return x;
348
- }
349
- }
350
- return undefined;
351
- };
352
- const find = (regexes, agent) => {
353
- const r = firstMatch(regexes, agent);
354
- if (!r) {
355
- return { major: 0, minor: 0 };
356
- }
357
- const group = (i) => {
358
- return Number(agent.replace(r, '$' + i));
359
- };
360
- return nu$2(group(1), group(2));
361
- };
362
- const detect$3 = (versionRegexes, agent) => {
363
- const cleanedAgent = String(agent).toLowerCase();
364
- if (versionRegexes.length === 0) {
365
- return unknown$2();
366
- }
367
- return find(versionRegexes, cleanedAgent);
368
- };
369
- const unknown$2 = () => {
370
- return nu$2(0, 0);
371
- };
372
- const nu$2 = (major, minor) => {
373
- return { major, minor };
374
- };
375
- const Version = {
376
- nu: nu$2,
377
- detect: detect$3,
378
- unknown: unknown$2
379
- };
380
-
381
- const detectBrowser$1 = (browsers, userAgentData) => {
382
- return findMap(userAgentData.brands, (uaBrand) => {
383
- const lcBrand = uaBrand.brand.toLowerCase();
384
- return find$1(browsers, (browser) => { var _a; return lcBrand === ((_a = browser.brand) === null || _a === void 0 ? void 0 : _a.toLowerCase()); })
385
- .map((info) => ({
386
- current: info.name,
387
- version: Version.nu(parseInt(uaBrand.version, 10), 0)
388
- }));
389
- });
390
- };
391
-
392
- const detect$2 = (candidates, userAgent) => {
393
- const agent = String(userAgent).toLowerCase();
394
- return find$1(candidates, (candidate) => {
395
- return candidate.search(agent);
396
- });
397
- };
398
- // They (browser and os) are the same at the moment, but they might
399
- // not stay that way.
400
- const detectBrowser = (browsers, userAgent) => {
401
- return detect$2(browsers, userAgent).map((browser) => {
402
- const version = Version.detect(browser.versionRegexes, userAgent);
403
- return {
404
- current: browser.name,
405
- version
406
- };
407
- });
408
- };
409
- const detectOs = (oses, userAgent) => {
410
- return detect$2(oses, userAgent).map((os) => {
411
- const version = Version.detect(os.versionRegexes, userAgent);
412
- return {
413
- current: os.name,
414
- version
415
- };
416
- });
417
- };
418
-
419
- const normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
420
- const checkContains = (target) => {
421
- return (uastring) => {
422
- return contains(uastring, target);
423
- };
424
- };
425
- const browsers = [
426
- // This is legacy Edge
427
- {
428
- name: 'Edge',
429
- versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
430
- search: (uastring) => {
431
- return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
432
- }
433
- },
434
- // This is Google Chrome and Chromium Edge
435
- {
436
- name: 'Chromium',
437
- brand: 'Chromium',
438
- versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/, normalVersionRegex],
439
- search: (uastring) => {
440
- return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe');
441
- }
442
- },
443
- {
444
- name: 'IE',
445
- versionRegexes: [/.*?msie\ ?([0-9]+)\.([0-9]+).*/, /.*?rv:([0-9]+)\.([0-9]+).*/],
446
- search: (uastring) => {
447
- return contains(uastring, 'msie') || contains(uastring, 'trident');
448
- }
449
- },
450
- // INVESTIGATE: Is this still the Opera user agent?
451
- {
452
- name: 'Opera',
453
- versionRegexes: [normalVersionRegex, /.*?opera\/([0-9]+)\.([0-9]+).*/],
454
- search: checkContains('opera')
455
- },
456
- {
457
- name: 'Firefox',
458
- versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
459
- search: checkContains('firefox')
460
- },
461
- {
462
- name: 'Safari',
463
- versionRegexes: [normalVersionRegex, /.*?cpu os ([0-9]+)_([0-9]+).*/],
464
- search: (uastring) => {
465
- return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit');
466
- }
467
- }
468
- ];
469
- const oses = [
470
- {
471
- name: 'Windows',
472
- search: checkContains('win'),
473
- versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
474
- },
475
- {
476
- name: 'iOS',
477
- search: (uastring) => {
478
- return contains(uastring, 'iphone') || contains(uastring, 'ipad');
479
- },
480
- versionRegexes: [/.*?version\/\ ?([0-9]+)\.([0-9]+).*/, /.*cpu os ([0-9]+)_([0-9]+).*/, /.*cpu iphone os ([0-9]+)_([0-9]+).*/]
481
- },
482
- {
483
- name: 'Android',
484
- search: checkContains('android'),
485
- versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
486
- },
487
- {
488
- name: 'macOS',
489
- search: checkContains('mac os x'),
490
- versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]
491
- },
492
- {
493
- name: 'Linux',
494
- search: checkContains('linux'),
495
- versionRegexes: []
496
- },
497
- { name: 'Solaris',
498
- search: checkContains('sunos'),
499
- versionRegexes: []
500
- },
501
- {
502
- name: 'FreeBSD',
503
- search: checkContains('freebsd'),
504
- versionRegexes: []
505
- },
506
- {
507
- name: 'ChromeOS',
508
- search: checkContains('cros'),
509
- versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/]
510
- }
511
- ];
512
- const PlatformInfo = {
513
- browsers: constant(browsers),
514
- oses: constant(oses)
515
- };
516
-
517
- const edge = 'Edge';
518
- const chromium = 'Chromium';
519
- const ie = 'IE';
520
- const opera = 'Opera';
521
- const firefox = 'Firefox';
522
- const safari = 'Safari';
523
- const unknown$1 = () => {
524
- return nu$1({
525
- current: undefined,
526
- version: Version.unknown()
527
- });
528
- };
529
- const nu$1 = (info) => {
530
- const current = info.current;
531
- const version = info.version;
532
- const isBrowser = (name) => () => current === name;
533
- return {
534
- current,
535
- version,
536
- isEdge: isBrowser(edge),
537
- isChromium: isBrowser(chromium),
538
- // NOTE: isIe just looks too weird
539
- isIE: isBrowser(ie),
540
- isOpera: isBrowser(opera),
541
- isFirefox: isBrowser(firefox),
542
- isSafari: isBrowser(safari)
543
- };
544
- };
545
- const Browser = {
546
- unknown: unknown$1,
547
- nu: nu$1,
548
- edge: constant(edge),
549
- chromium: constant(chromium),
550
- ie: constant(ie),
551
- opera: constant(opera),
552
- firefox: constant(firefox),
553
- safari: constant(safari)
554
- };
555
-
556
- const windows = 'Windows';
557
- const ios = 'iOS';
558
- const android = 'Android';
559
- const linux = 'Linux';
560
- const macos = 'macOS';
561
- const solaris = 'Solaris';
562
- const freebsd = 'FreeBSD';
563
- const chromeos = 'ChromeOS';
564
- // Though there is a bit of dupe with this and Browser, trying to
565
- // reuse code makes it much harder to follow and change.
566
- const unknown = () => {
567
- return nu({
568
- current: undefined,
569
- version: Version.unknown()
570
- });
571
- };
572
- const nu = (info) => {
573
- const current = info.current;
574
- const version = info.version;
575
- const isOS = (name) => () => current === name;
576
- return {
577
- current,
578
- version,
579
- isWindows: isOS(windows),
580
- // TODO: Fix capitalisation
581
- isiOS: isOS(ios),
582
- isAndroid: isOS(android),
583
- isMacOS: isOS(macos),
584
- isLinux: isOS(linux),
585
- isSolaris: isOS(solaris),
586
- isFreeBSD: isOS(freebsd),
587
- isChromeOS: isOS(chromeos)
588
- };
589
- };
590
- const OperatingSystem = {
591
- unknown,
592
- nu,
593
- windows: constant(windows),
594
- ios: constant(ios),
595
- android: constant(android),
596
- linux: constant(linux),
597
- macos: constant(macos),
598
- solaris: constant(solaris),
599
- freebsd: constant(freebsd),
600
- chromeos: constant(chromeos)
601
- };
602
-
603
- const detect$1 = (userAgent, userAgentDataOpt, mediaMatch) => {
604
- const browsers = PlatformInfo.browsers();
605
- const oses = PlatformInfo.oses();
606
- const browser = userAgentDataOpt.bind((userAgentData) => detectBrowser$1(browsers, userAgentData))
607
- .orThunk(() => detectBrowser(browsers, userAgent))
608
- .fold(Browser.unknown, Browser.nu);
609
- const os = detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
610
- const deviceType = DeviceType(os, browser, userAgent, mediaMatch);
611
- return {
612
- browser,
613
- os,
614
- deviceType
615
- };
616
- };
617
- const PlatformDetection = {
618
- detect: detect$1
619
- };
620
-
621
- const mediaMatch = (query) => window.matchMedia(query).matches;
622
- // IMPORTANT: Must be in a thunk, otherwise rollup thinks calling this immediately
623
- // causes side effects and won't tree shake this away
624
- // Note: navigator.userAgentData is not part of the native typescript types yet
625
- let platform = cached(() => PlatformDetection.detect(window.navigator.userAgent, Optional.from((window.navigator.userAgentData)), mediaMatch));
626
- const detect = () => platform();
627
-
628
- const isMacOS = () => detect().os.isMacOS();
629
- const isiOS = () => detect().os.isiOS();
630
-
631
- const getPreventClicksOnLinksScript = () => {
632
- const isMacOSOrIOS = isMacOS() || isiOS();
633
- const fn = (isMacOSOrIOS) => {
634
- document.addEventListener('click', (e) => {
635
- for (let elm = e.target; elm; elm = elm.parentNode) {
636
- if (elm.nodeName === 'A') {
637
- const anchor = elm;
638
- const href = anchor.getAttribute('href');
639
- if (href && href.startsWith('#')) {
640
- e.preventDefault();
641
- const targetElement = document.getElementById(href.substring(1));
642
- if (targetElement) {
643
- targetElement.scrollIntoView({ behavior: 'smooth' });
644
- }
645
- return;
646
- }
647
- const isMetaKeyPressed = isMacOSOrIOS ? e.metaKey : e.ctrlKey && !e.altKey;
648
- if (!isMetaKeyPressed) {
649
- e.preventDefault();
650
- }
651
- }
652
- }
653
- }, false);
654
- };
655
- return `<script>(${fn.toString()})(${isMacOSOrIOS})</script>`;
656
- };
10
+ var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
657
11
 
658
12
  var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
659
13
 
660
- const option = (name) => (editor) => editor.options.get(name);
14
+ const option = name => editor => editor.options.get(name);
661
15
  const getContentStyle = option('content_style');
662
16
  const shouldUseContentCssCors = option('content_css_cors');
663
17
  const getBodyClass = option('body_class');
664
18
  const getBodyId = option('body_id');
665
19
 
666
- const getPreviewHtml = (editor) => {
667
- var _a;
668
- let headHtml = '';
669
- const encode = editor.dom.encode;
670
- const contentStyle = (_a = getContentStyle(editor)) !== null && _a !== void 0 ? _a : '';
671
- headHtml += `<base href="${encode(editor.documentBaseURI.getURI())}">`;
672
- const cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
673
- global.each(editor.contentCSS, (url) => {
674
- headHtml += '<link type="text/css" rel="stylesheet" href="' + encode(editor.documentBaseURI.toAbsolute(url)) + '"' + cors + '>';
675
- });
676
- if (contentStyle) {
677
- headHtml += '<style type="text/css">' + contentStyle + '</style>';
678
- }
679
- const bodyId = getBodyId(editor);
680
- const bodyClass = getBodyClass(editor);
681
- const directionality = editor.getBody().dir;
682
- const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
683
- const previewHtml = ('<!DOCTYPE html>' +
684
- '<html>' +
685
- '<head>' +
686
- headHtml +
687
- '</head>' +
688
- '<body id="' + encode(bodyId) + '" class="mce-content-body ' + encode(bodyClass) + '"' + dirAttr + '>' +
689
- editor.getContent() +
690
- getPreventClicksOnLinksScript() +
691
- '</body>' +
692
- '</html>');
693
- return previewHtml;
694
- };
695
-
696
- const open = (editor) => {
697
- const content = getPreviewHtml(editor);
698
- const dataApi = editor.windowManager.open({
699
- title: 'Preview',
700
- size: 'large',
701
- body: {
702
- type: 'panel',
703
- items: [
704
- {
705
- name: 'preview',
706
- type: 'iframe',
707
- sandboxed: true,
708
- transparent: false
709
- }
710
- ]
711
- },
712
- buttons: [
713
- {
714
- type: 'cancel',
715
- name: 'close',
716
- text: 'Close',
717
- primary: true
718
- }
719
- ],
720
- initialData: {
721
- preview: content
722
- }
723
- });
724
- // Focus the close button, as by default the first element in the body is selected
725
- // which we don't want to happen here since the body only has the iframe content
726
- dataApi.focus('close');
727
- };
728
-
729
- const register$1 = (editor) => {
730
- editor.addCommand('mcePreview', () => {
731
- open(editor);
732
- });
733
- };
734
-
735
- const register = (editor) => {
736
- const onAction = () => editor.execCommand('mcePreview');
737
- editor.ui.registry.addButton('preview', {
738
- icon: 'preview',
739
- tooltip: 'Preview',
740
- onAction,
741
- context: 'any'
742
- });
743
- editor.ui.registry.addMenuItem('preview', {
744
- icon: 'preview',
745
- text: 'Preview',
746
- onAction,
747
- context: 'any'
748
- });
20
+ const getPreviewHtml = editor => {
21
+ var _a;
22
+ let headHtml = '';
23
+ const encode = editor.dom.encode;
24
+ const contentStyle = (_a = getContentStyle(editor)) !== null && _a !== void 0 ? _a : '';
25
+ headHtml += '<base href="' + encode(editor.documentBaseURI.getURI()) + '">';
26
+ const cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
27
+ global.each(editor.contentCSS, url => {
28
+ headHtml += '<link type="text/css" rel="stylesheet" href="' + encode(editor.documentBaseURI.toAbsolute(url)) + '"' + cors + '>';
29
+ });
30
+ if (contentStyle) {
31
+ headHtml += '<style type="text/css">' + contentStyle + '</style>';
32
+ }
33
+ const bodyId = getBodyId(editor);
34
+ const bodyClass = getBodyClass(editor);
35
+ const isMetaKeyPressed = global$1.os.isMacOS() || global$1.os.isiOS() ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
36
+ const preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
37
+ const directionality = editor.getBody().dir;
38
+ const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
39
+ const previewHtml = '<!DOCTYPE html>' + '<html>' + '<head>' + headHtml + '</head>' + '<body id="' + encode(bodyId) + '" class="mce-content-body ' + encode(bodyClass) + '"' + dirAttr + '>' + editor.getContent() + preventClicksOnLinksScript + '</body>' + '</html>';
40
+ return previewHtml;
41
+ };
42
+
43
+ const open = editor => {
44
+ const content = getPreviewHtml(editor);
45
+ const dataApi = editor.windowManager.open({
46
+ title: 'Preview',
47
+ size: 'large',
48
+ body: {
49
+ type: 'panel',
50
+ items: [{
51
+ name: 'preview',
52
+ type: 'iframe',
53
+ sandboxed: true,
54
+ transparent: false
55
+ }]
56
+ },
57
+ buttons: [{
58
+ type: 'cancel',
59
+ name: 'close',
60
+ text: 'Close',
61
+ primary: true
62
+ }],
63
+ initialData: { preview: content }
64
+ });
65
+ dataApi.focus('close');
66
+ };
67
+
68
+ const register$1 = editor => {
69
+ editor.addCommand('mcePreview', () => {
70
+ open(editor);
71
+ });
72
+ };
73
+
74
+ const register = editor => {
75
+ const onAction = () => editor.execCommand('mcePreview');
76
+ editor.ui.registry.addButton('preview', {
77
+ icon: 'preview',
78
+ tooltip: 'Preview',
79
+ onAction
80
+ });
81
+ editor.ui.registry.addMenuItem('preview', {
82
+ icon: 'preview',
83
+ text: 'Preview',
84
+ onAction
85
+ });
749
86
  };
750
87
 
751
88
  var Plugin = () => {
752
- global$1.add('preview', (editor) => {
753
- register$1(editor);
754
- register(editor);
755
- });
89
+ global$2.add('preview', editor => {
90
+ register$1(editor);
91
+ register(editor);
92
+ });
756
93
  };
757
94
 
758
95
  Plugin();
759
- /** *****
760
- * DO NOT EXPORT ANYTHING
761
- *
762
- * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
763
- *******/
764
96
 
765
97
  })();