fx-platform-ui 0.0.13-alpha14 → 0.0.13-alpha15

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 (114) hide show
  1. package/lib/fx-platform-ui.mjs +37583 -21323
  2. package/lib/fx-platform-ui.umd.js +75 -32
  3. package/lib/style.css +1 -1
  4. package/lib/tinymce/CHANGELOG.md +2957 -0
  5. package/lib/tinymce/README.md +71 -0
  6. package/lib/tinymce/bower.json +27 -0
  7. package/lib/tinymce/composer.json +52 -0
  8. package/lib/tinymce/icons/default/icons.js +182 -0
  9. package/lib/tinymce/icons/default/icons.min.js +1 -0
  10. package/lib/tinymce/icons/default/index.js +7 -0
  11. package/lib/tinymce/license.txt +21 -0
  12. package/lib/tinymce/models/dom/index.js +7 -0
  13. package/lib/tinymce/models/dom/model.js +7975 -0
  14. package/lib/tinymce/models/dom/model.min.js +4 -0
  15. package/lib/tinymce/package.json +32 -0
  16. package/lib/tinymce/plugins/advlist/index.js +7 -0
  17. package/lib/tinymce/plugins/advlist/plugin.js +246 -0
  18. package/lib/tinymce/plugins/advlist/plugin.min.js +4 -0
  19. package/lib/tinymce/plugins/anchor/index.js +7 -0
  20. package/lib/tinymce/plugins/anchor/plugin.js +195 -0
  21. package/lib/tinymce/plugins/anchor/plugin.min.js +4 -0
  22. package/lib/tinymce/plugins/autolink/index.js +7 -0
  23. package/lib/tinymce/plugins/autolink/plugin.js +232 -0
  24. package/lib/tinymce/plugins/autolink/plugin.min.js +4 -0
  25. package/lib/tinymce/plugins/autoresize/index.js +7 -0
  26. package/lib/tinymce/plugins/autoresize/plugin.js +156 -0
  27. package/lib/tinymce/plugins/autoresize/plugin.min.js +4 -0
  28. package/lib/tinymce/plugins/autosave/index.js +7 -0
  29. package/lib/tinymce/plugins/autosave/plugin.js +232 -0
  30. package/lib/tinymce/plugins/autosave/plugin.min.js +4 -0
  31. package/lib/tinymce/plugins/charmap/index.js +7 -0
  32. package/lib/tinymce/plugins/charmap/plugin.js +1636 -0
  33. package/lib/tinymce/plugins/charmap/plugin.min.js +4 -0
  34. package/lib/tinymce/plugins/code/index.js +7 -0
  35. package/lib/tinymce/plugins/code/plugin.js +85 -0
  36. package/lib/tinymce/plugins/code/plugin.min.js +4 -0
  37. package/lib/tinymce/plugins/codesample/index.js +7 -0
  38. package/lib/tinymce/plugins/codesample/plugin.js +2451 -0
  39. package/lib/tinymce/plugins/codesample/plugin.min.js +4 -0
  40. package/lib/tinymce/plugins/directionality/index.js +7 -0
  41. package/lib/tinymce/plugins/directionality/plugin.js +384 -0
  42. package/lib/tinymce/plugins/directionality/plugin.min.js +4 -0
  43. package/lib/tinymce/plugins/emoticons/index.js +7 -0
  44. package/lib/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
  45. package/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
  46. package/lib/tinymce/plugins/emoticons/js/emojis.js +1 -0
  47. package/lib/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  48. package/lib/tinymce/plugins/emoticons/plugin.js +577 -0
  49. package/lib/tinymce/plugins/emoticons/plugin.min.js +4 -0
  50. package/lib/tinymce/plugins/fullscreen/index.js +7 -0
  51. package/lib/tinymce/plugins/fullscreen/plugin.js +1190 -0
  52. package/lib/tinymce/plugins/fullscreen/plugin.min.js +4 -0
  53. package/lib/tinymce/plugins/help/index.js +7 -0
  54. package/lib/tinymce/plugins/help/plugin.js +848 -0
  55. package/lib/tinymce/plugins/help/plugin.min.js +4 -0
  56. package/lib/tinymce/plugins/image/index.js +7 -0
  57. package/lib/tinymce/plugins/image/plugin.js +1475 -0
  58. package/lib/tinymce/plugins/image/plugin.min.js +4 -0
  59. package/lib/tinymce/plugins/importcss/index.js +7 -0
  60. package/lib/tinymce/plugins/importcss/plugin.js +342 -0
  61. package/lib/tinymce/plugins/importcss/plugin.min.js +4 -0
  62. package/lib/tinymce/plugins/insertdatetime/index.js +7 -0
  63. package/lib/tinymce/plugins/insertdatetime/plugin.js +176 -0
  64. package/lib/tinymce/plugins/insertdatetime/plugin.min.js +4 -0
  65. package/lib/tinymce/plugins/link/index.js +7 -0
  66. package/lib/tinymce/plugins/link/plugin.js +1190 -0
  67. package/lib/tinymce/plugins/link/plugin.min.js +4 -0
  68. package/lib/tinymce/plugins/lists/index.js +7 -0
  69. package/lib/tinymce/plugins/lists/plugin.js +1820 -0
  70. package/lib/tinymce/plugins/lists/plugin.min.js +4 -0
  71. package/lib/tinymce/plugins/media/index.js +7 -0
  72. package/lib/tinymce/plugins/media/plugin.js +1157 -0
  73. package/lib/tinymce/plugins/media/plugin.min.js +4 -0
  74. package/lib/tinymce/plugins/nonbreaking/index.js +7 -0
  75. package/lib/tinymce/plugins/nonbreaking/plugin.js +111 -0
  76. package/lib/tinymce/plugins/nonbreaking/plugin.min.js +4 -0
  77. package/lib/tinymce/plugins/pagebreak/index.js +7 -0
  78. package/lib/tinymce/plugins/pagebreak/plugin.js +105 -0
  79. package/lib/tinymce/plugins/pagebreak/plugin.min.js +4 -0
  80. package/lib/tinymce/plugins/preview/index.js +7 -0
  81. package/lib/tinymce/plugins/preview/plugin.js +97 -0
  82. package/lib/tinymce/plugins/preview/plugin.min.js +4 -0
  83. package/lib/tinymce/plugins/quickbars/index.js +7 -0
  84. package/lib/tinymce/plugins/quickbars/plugin.js +421 -0
  85. package/lib/tinymce/plugins/quickbars/plugin.min.js +4 -0
  86. package/lib/tinymce/plugins/save/index.js +7 -0
  87. package/lib/tinymce/plugins/save/plugin.js +118 -0
  88. package/lib/tinymce/plugins/save/plugin.min.js +4 -0
  89. package/lib/tinymce/plugins/searchreplace/index.js +7 -0
  90. package/lib/tinymce/plugins/searchreplace/plugin.js +1079 -0
  91. package/lib/tinymce/plugins/searchreplace/plugin.min.js +4 -0
  92. package/lib/tinymce/plugins/table/index.js +7 -0
  93. package/lib/tinymce/plugins/table/plugin.js +3393 -0
  94. package/lib/tinymce/plugins/table/plugin.min.js +4 -0
  95. package/lib/tinymce/plugins/template/index.js +7 -0
  96. package/lib/tinymce/plugins/template/plugin.js +548 -0
  97. package/lib/tinymce/plugins/template/plugin.min.js +4 -0
  98. package/lib/tinymce/plugins/visualblocks/index.js +7 -0
  99. package/lib/tinymce/plugins/visualblocks/plugin.js +98 -0
  100. package/lib/tinymce/plugins/visualblocks/plugin.min.js +4 -0
  101. package/lib/tinymce/plugins/visualchars/index.js +7 -0
  102. package/lib/tinymce/plugins/visualchars/plugin.js +506 -0
  103. package/lib/tinymce/plugins/visualchars/plugin.min.js +4 -0
  104. package/lib/tinymce/plugins/wordcount/index.js +7 -0
  105. package/lib/tinymce/plugins/wordcount/plugin.js +404 -0
  106. package/lib/tinymce/plugins/wordcount/plugin.min.js +4 -0
  107. package/lib/tinymce/themes/silver/index.js +7 -0
  108. package/lib/tinymce/themes/silver/theme.js +26184 -0
  109. package/lib/tinymce/themes/silver/theme.min.js +4 -0
  110. package/lib/tinymce/tinymce.d.ts +2895 -0
  111. package/lib/tinymce/tinymce.js +29400 -0
  112. package/package.json +1 -1
  113. package/packages/components/editor/src/hook/useEditorState.ts +3 -3
  114. package/packages/components/editor/src/index.vue +2 -2
@@ -0,0 +1,7 @@
1
+ // Exports the "visualchars" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/visualchars')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/visualchars'
7
+ require('./plugin.js');
@@ -0,0 +1,506 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+
5
+ (function () {
6
+ 'use strict';
7
+
8
+ const Cell = initial => {
9
+ let value = initial;
10
+ const get = () => {
11
+ return value;
12
+ };
13
+ const set = v => {
14
+ value = v;
15
+ };
16
+ return {
17
+ get,
18
+ set
19
+ };
20
+ };
21
+
22
+ var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
23
+
24
+ const get$2 = toggleState => {
25
+ const isEnabled = () => {
26
+ return toggleState.get();
27
+ };
28
+ return { isEnabled };
29
+ };
30
+
31
+ const fireVisualChars = (editor, state) => {
32
+ return editor.dispatch('VisualChars', { state });
33
+ };
34
+
35
+ const hasProto = (v, constructor, predicate) => {
36
+ var _a;
37
+ if (predicate(v, constructor.prototype)) {
38
+ return true;
39
+ } else {
40
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
41
+ }
42
+ };
43
+ const typeOf = x => {
44
+ const t = typeof x;
45
+ if (x === null) {
46
+ return 'null';
47
+ } else if (t === 'object' && Array.isArray(x)) {
48
+ return 'array';
49
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
50
+ return 'string';
51
+ } else {
52
+ return t;
53
+ }
54
+ };
55
+ const isType$1 = type => value => typeOf(value) === type;
56
+ const isSimpleType = type => value => typeof value === type;
57
+ const eq = t => a => t === a;
58
+ const isString = isType$1('string');
59
+ const isNull = eq(null);
60
+ const isBoolean = isSimpleType('boolean');
61
+ const isNullable = a => a === null || a === undefined;
62
+ const isNonNullable = a => !isNullable(a);
63
+ const isNumber = isSimpleType('number');
64
+
65
+ class Optional {
66
+ constructor(tag, value) {
67
+ this.tag = tag;
68
+ this.value = value;
69
+ }
70
+ static some(value) {
71
+ return new Optional(true, value);
72
+ }
73
+ static none() {
74
+ return Optional.singletonNone;
75
+ }
76
+ fold(onNone, onSome) {
77
+ if (this.tag) {
78
+ return onSome(this.value);
79
+ } else {
80
+ return onNone();
81
+ }
82
+ }
83
+ isSome() {
84
+ return this.tag;
85
+ }
86
+ isNone() {
87
+ return !this.tag;
88
+ }
89
+ map(mapper) {
90
+ if (this.tag) {
91
+ return Optional.some(mapper(this.value));
92
+ } else {
93
+ return Optional.none();
94
+ }
95
+ }
96
+ bind(binder) {
97
+ if (this.tag) {
98
+ return binder(this.value);
99
+ } else {
100
+ return Optional.none();
101
+ }
102
+ }
103
+ exists(predicate) {
104
+ return this.tag && predicate(this.value);
105
+ }
106
+ forall(predicate) {
107
+ return !this.tag || predicate(this.value);
108
+ }
109
+ filter(predicate) {
110
+ if (!this.tag || predicate(this.value)) {
111
+ return this;
112
+ } else {
113
+ return Optional.none();
114
+ }
115
+ }
116
+ getOr(replacement) {
117
+ return this.tag ? this.value : replacement;
118
+ }
119
+ or(replacement) {
120
+ return this.tag ? this : replacement;
121
+ }
122
+ getOrThunk(thunk) {
123
+ return this.tag ? this.value : thunk();
124
+ }
125
+ orThunk(thunk) {
126
+ return this.tag ? this : thunk();
127
+ }
128
+ getOrDie(message) {
129
+ if (!this.tag) {
130
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
131
+ } else {
132
+ return this.value;
133
+ }
134
+ }
135
+ static from(value) {
136
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
137
+ }
138
+ getOrNull() {
139
+ return this.tag ? this.value : null;
140
+ }
141
+ getOrUndefined() {
142
+ return this.value;
143
+ }
144
+ each(worker) {
145
+ if (this.tag) {
146
+ worker(this.value);
147
+ }
148
+ }
149
+ toArray() {
150
+ return this.tag ? [this.value] : [];
151
+ }
152
+ toString() {
153
+ return this.tag ? `some(${ this.value })` : 'none()';
154
+ }
155
+ }
156
+ Optional.singletonNone = new Optional(false);
157
+
158
+ const map = (xs, f) => {
159
+ const len = xs.length;
160
+ const r = new Array(len);
161
+ for (let i = 0; i < len; i++) {
162
+ const x = xs[i];
163
+ r[i] = f(x, i);
164
+ }
165
+ return r;
166
+ };
167
+ const each$1 = (xs, f) => {
168
+ for (let i = 0, len = xs.length; i < len; i++) {
169
+ const x = xs[i];
170
+ f(x, i);
171
+ }
172
+ };
173
+ const filter = (xs, pred) => {
174
+ const r = [];
175
+ for (let i = 0, len = xs.length; i < len; i++) {
176
+ const x = xs[i];
177
+ if (pred(x, i)) {
178
+ r.push(x);
179
+ }
180
+ }
181
+ return r;
182
+ };
183
+
184
+ const keys = Object.keys;
185
+ const each = (obj, f) => {
186
+ const props = keys(obj);
187
+ for (let k = 0, len = props.length; k < len; k++) {
188
+ const i = props[k];
189
+ const x = obj[i];
190
+ f(x, i);
191
+ }
192
+ };
193
+
194
+ typeof window !== 'undefined' ? window : Function('return this;')();
195
+
196
+ const TEXT = 3;
197
+
198
+ const type = element => element.dom.nodeType;
199
+ const value = element => element.dom.nodeValue;
200
+ const isType = t => element => type(element) === t;
201
+ const isText = isType(TEXT);
202
+
203
+ const rawSet = (dom, key, value) => {
204
+ if (isString(value) || isBoolean(value) || isNumber(value)) {
205
+ dom.setAttribute(key, value + '');
206
+ } else {
207
+ console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
208
+ throw new Error('Attribute value was not simple');
209
+ }
210
+ };
211
+ const set = (element, key, value) => {
212
+ rawSet(element.dom, key, value);
213
+ };
214
+ const get$1 = (element, key) => {
215
+ const v = element.dom.getAttribute(key);
216
+ return v === null ? undefined : v;
217
+ };
218
+ const remove$3 = (element, key) => {
219
+ element.dom.removeAttribute(key);
220
+ };
221
+
222
+ const read = (element, attr) => {
223
+ const value = get$1(element, attr);
224
+ return value === undefined || value === '' ? [] : value.split(' ');
225
+ };
226
+ const add$2 = (element, attr, id) => {
227
+ const old = read(element, attr);
228
+ const nu = old.concat([id]);
229
+ set(element, attr, nu.join(' '));
230
+ return true;
231
+ };
232
+ const remove$2 = (element, attr, id) => {
233
+ const nu = filter(read(element, attr), v => v !== id);
234
+ if (nu.length > 0) {
235
+ set(element, attr, nu.join(' '));
236
+ } else {
237
+ remove$3(element, attr);
238
+ }
239
+ return false;
240
+ };
241
+
242
+ const supports = element => element.dom.classList !== undefined;
243
+ const get = element => read(element, 'class');
244
+ const add$1 = (element, clazz) => add$2(element, 'class', clazz);
245
+ const remove$1 = (element, clazz) => remove$2(element, 'class', clazz);
246
+
247
+ const add = (element, clazz) => {
248
+ if (supports(element)) {
249
+ element.dom.classList.add(clazz);
250
+ } else {
251
+ add$1(element, clazz);
252
+ }
253
+ };
254
+ const cleanClass = element => {
255
+ const classList = supports(element) ? element.dom.classList : get(element);
256
+ if (classList.length === 0) {
257
+ remove$3(element, 'class');
258
+ }
259
+ };
260
+ const remove = (element, clazz) => {
261
+ if (supports(element)) {
262
+ const classList = element.dom.classList;
263
+ classList.remove(clazz);
264
+ } else {
265
+ remove$1(element, clazz);
266
+ }
267
+ cleanClass(element);
268
+ };
269
+
270
+ const fromHtml = (html, scope) => {
271
+ const doc = scope || document;
272
+ const div = doc.createElement('div');
273
+ div.innerHTML = html;
274
+ if (!div.hasChildNodes() || div.childNodes.length > 1) {
275
+ const message = 'HTML does not have a single root node';
276
+ console.error(message, html);
277
+ throw new Error(message);
278
+ }
279
+ return fromDom(div.childNodes[0]);
280
+ };
281
+ const fromTag = (tag, scope) => {
282
+ const doc = scope || document;
283
+ const node = doc.createElement(tag);
284
+ return fromDom(node);
285
+ };
286
+ const fromText = (text, scope) => {
287
+ const doc = scope || document;
288
+ const node = doc.createTextNode(text);
289
+ return fromDom(node);
290
+ };
291
+ const fromDom = node => {
292
+ if (node === null || node === undefined) {
293
+ throw new Error('Node cannot be null or undefined');
294
+ }
295
+ return { dom: node };
296
+ };
297
+ const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
298
+ const SugarElement = {
299
+ fromHtml,
300
+ fromTag,
301
+ fromText,
302
+ fromDom,
303
+ fromPoint
304
+ };
305
+
306
+ const charMap = {
307
+ '\xA0': 'nbsp',
308
+ '\xAD': 'shy'
309
+ };
310
+ const charMapToRegExp = (charMap, global) => {
311
+ let regExp = '';
312
+ each(charMap, (_value, key) => {
313
+ regExp += key;
314
+ });
315
+ return new RegExp('[' + regExp + ']', global ? 'g' : '');
316
+ };
317
+ const charMapToSelector = charMap => {
318
+ let selector = '';
319
+ each(charMap, value => {
320
+ if (selector) {
321
+ selector += ',';
322
+ }
323
+ selector += 'span.mce-' + value;
324
+ });
325
+ return selector;
326
+ };
327
+ const regExp = charMapToRegExp(charMap);
328
+ const regExpGlobal = charMapToRegExp(charMap, true);
329
+ const selector = charMapToSelector(charMap);
330
+ const nbspClass = 'mce-nbsp';
331
+
332
+ const wrapCharWithSpan = value => '<span data-mce-bogus="1" class="mce-' + charMap[value] + '">' + value + '</span>';
333
+
334
+ const isMatch = n => {
335
+ const value$1 = value(n);
336
+ return isText(n) && value$1 !== undefined && regExp.test(value$1);
337
+ };
338
+ const filterDescendants = (scope, predicate) => {
339
+ let result = [];
340
+ const dom = scope.dom;
341
+ const children = map(dom.childNodes, SugarElement.fromDom);
342
+ each$1(children, x => {
343
+ if (predicate(x)) {
344
+ result = result.concat([x]);
345
+ }
346
+ result = result.concat(filterDescendants(x, predicate));
347
+ });
348
+ return result;
349
+ };
350
+ const findParentElm = (elm, rootElm) => {
351
+ while (elm.parentNode) {
352
+ if (elm.parentNode === rootElm) {
353
+ return elm;
354
+ }
355
+ elm = elm.parentNode;
356
+ }
357
+ };
358
+ const replaceWithSpans = text => text.replace(regExpGlobal, wrapCharWithSpan);
359
+
360
+ const isWrappedNbsp = node => node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap');
361
+ const show = (editor, rootElm) => {
362
+ const nodeList = filterDescendants(SugarElement.fromDom(rootElm), isMatch);
363
+ each$1(nodeList, n => {
364
+ const parent = n.dom.parentNode;
365
+ if (isWrappedNbsp(parent)) {
366
+ add(SugarElement.fromDom(parent), nbspClass);
367
+ } else {
368
+ const withSpans = replaceWithSpans(editor.dom.encode(value(n)));
369
+ const div = editor.dom.create('div', null, withSpans);
370
+ let node;
371
+ while (node = div.lastChild) {
372
+ editor.dom.insertAfter(node, n.dom);
373
+ }
374
+ editor.dom.remove(n.dom);
375
+ }
376
+ });
377
+ };
378
+ const hide = (editor, rootElm) => {
379
+ const nodeList = editor.dom.select(selector, rootElm);
380
+ each$1(nodeList, node => {
381
+ if (isWrappedNbsp(node)) {
382
+ remove(SugarElement.fromDom(node), nbspClass);
383
+ } else {
384
+ editor.dom.remove(node, true);
385
+ }
386
+ });
387
+ };
388
+ const toggle = editor => {
389
+ const body = editor.getBody();
390
+ const bookmark = editor.selection.getBookmark();
391
+ let parentNode = findParentElm(editor.selection.getNode(), body);
392
+ parentNode = parentNode !== undefined ? parentNode : body;
393
+ hide(editor, parentNode);
394
+ show(editor, parentNode);
395
+ editor.selection.moveToBookmark(bookmark);
396
+ };
397
+
398
+ const applyVisualChars = (editor, toggleState) => {
399
+ fireVisualChars(editor, toggleState.get());
400
+ const body = editor.getBody();
401
+ if (toggleState.get() === true) {
402
+ show(editor, body);
403
+ } else {
404
+ hide(editor, body);
405
+ }
406
+ };
407
+ const toggleVisualChars = (editor, toggleState) => {
408
+ toggleState.set(!toggleState.get());
409
+ const bookmark = editor.selection.getBookmark();
410
+ applyVisualChars(editor, toggleState);
411
+ editor.selection.moveToBookmark(bookmark);
412
+ };
413
+
414
+ const register$2 = (editor, toggleState) => {
415
+ editor.addCommand('mceVisualChars', () => {
416
+ toggleVisualChars(editor, toggleState);
417
+ });
418
+ };
419
+
420
+ const option = name => editor => editor.options.get(name);
421
+ const register$1 = editor => {
422
+ const registerOption = editor.options.register;
423
+ registerOption('visualchars_default_state', {
424
+ processor: 'boolean',
425
+ default: false
426
+ });
427
+ };
428
+ const isEnabledByDefault = option('visualchars_default_state');
429
+
430
+ const setup$1 = (editor, toggleState) => {
431
+ editor.on('init', () => {
432
+ applyVisualChars(editor, toggleState);
433
+ });
434
+ };
435
+
436
+ const first = (fn, rate) => {
437
+ let timer = null;
438
+ const cancel = () => {
439
+ if (!isNull(timer)) {
440
+ clearTimeout(timer);
441
+ timer = null;
442
+ }
443
+ };
444
+ const throttle = (...args) => {
445
+ if (isNull(timer)) {
446
+ timer = setTimeout(() => {
447
+ timer = null;
448
+ fn.apply(null, args);
449
+ }, rate);
450
+ }
451
+ };
452
+ return {
453
+ cancel,
454
+ throttle
455
+ };
456
+ };
457
+
458
+ const setup = (editor, toggleState) => {
459
+ const debouncedToggle = first(() => {
460
+ toggle(editor);
461
+ }, 300);
462
+ editor.on('keydown', e => {
463
+ if (toggleState.get() === true) {
464
+ e.keyCode === 13 ? toggle(editor) : debouncedToggle.throttle();
465
+ }
466
+ });
467
+ editor.on('remove', debouncedToggle.cancel);
468
+ };
469
+
470
+ const toggleActiveState = (editor, enabledStated) => api => {
471
+ api.setActive(enabledStated.get());
472
+ const editorEventCallback = e => api.setActive(e.state);
473
+ editor.on('VisualChars', editorEventCallback);
474
+ return () => editor.off('VisualChars', editorEventCallback);
475
+ };
476
+ const register = (editor, toggleState) => {
477
+ const onAction = () => editor.execCommand('mceVisualChars');
478
+ editor.ui.registry.addToggleButton('visualchars', {
479
+ tooltip: 'Show invisible characters',
480
+ icon: 'visualchars',
481
+ onAction,
482
+ onSetup: toggleActiveState(editor, toggleState)
483
+ });
484
+ editor.ui.registry.addToggleMenuItem('visualchars', {
485
+ text: 'Show invisible characters',
486
+ icon: 'visualchars',
487
+ onAction,
488
+ onSetup: toggleActiveState(editor, toggleState)
489
+ });
490
+ };
491
+
492
+ var Plugin = () => {
493
+ global.add('visualchars', editor => {
494
+ register$1(editor);
495
+ const toggleState = Cell(isEnabledByDefault(editor));
496
+ register$2(editor, toggleState);
497
+ register(editor, toggleState);
498
+ setup(editor, toggleState);
499
+ setup$1(editor, toggleState);
500
+ return get$2(toggleState);
501
+ });
502
+ };
503
+
504
+ Plugin();
505
+
506
+ })();
@@ -0,0 +1,4 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+ !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,n=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(n=o=t,(s=String).prototype.isPrototypeOf(n)||(null===(r=o.constructor)||void 0===r?void 0:r.name)===s.name)?"string":e;var n,o,s,r})(t),o=(null,t=>null===t);const s=e("boolean"),r=e("number");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return null==t?a.none():a.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const i=(t,e)=>{for(let n=0,o=t.length;n<o;n++)e(t[n],n)},l=Object.keys,u=(t,e)=>{const n=l(t);for(let o=0,s=n.length;o<s;o++){const s=n[o];e(t[s],s)}};"undefined"!=typeof window?window:Function("return this;")();const c=t=>t.dom.nodeValue,d=t=>3===(t=>t.dom.nodeType)(t),h=(t,e,o)=>{((t,e,o)=>{if(!(n(o)||s(o)||r(o)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",o,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,o+"")})(t.dom,e,o)},g=(t,e)=>{t.dom.removeAttribute(e)},m=(t,e)=>{const n=((t,e)=>{const n=t.dom.getAttribute(e);return null===n?void 0:n})(t,e);return void 0===n||""===n?[]:n.split(" ")},v=t=>void 0!==t.dom.classList,p=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},f=p,y={"\xa0":"nbsp","\xad":"shy"},b=(t,e)=>{let n="";return u(t,((t,e)=>{n+=e})),new RegExp("["+n+"]",e?"g":"")},w=b(y),A=b(y,!0),k=(t=>{let e="";return u(t,(t=>{e&&(e+=","),e+="span.mce-"+t})),e})(y),N="mce-nbsp",C=t=>'<span data-mce-bogus="1" class="mce-'+y[t]+'">'+t+"</span>",T=t=>{const e=c(t);return d(t)&&void 0!==e&&w.test(e)},O=(t,e)=>{let n=[];const o=((t,e)=>{const n=t.length,o=new Array(n);for(let s=0;s<n;s++){const n=t[s];o[s]=e(n,s)}return o})(t.dom.childNodes,f);return i(o,(t=>{e(t)&&(n=n.concat([t])),n=n.concat(O(t,e))})),n},B=t=>"span"===t.nodeName.toLowerCase()&&t.classList.contains("mce-nbsp-wrap"),S=(t,e)=>{const n=O(f(e),T);i(n,(e=>{const n=e.dom.parentNode;if(B(n))o=f(n),s=N,v(o)?o.dom.classList.add(s):((t,e)=>{((t,e,n)=>{const o=m(t,e).concat([n]);h(t,e,o.join(" "))})(t,"class",e)})(o,s);else{const n=t.dom.encode(c(e)).replace(A,C),o=t.dom.create("div",null,n);let s;for(;s=o.lastChild;)t.dom.insertAfter(s,e.dom);t.dom.remove(e.dom)}var o,s}))},V=(t,e)=>{const n=t.dom.select(k,e);i(n,(e=>{var n,o;B(e)?(n=f(e),o=N,v(n)?n.dom.classList.remove(o):((t,e)=>{((t,e,n)=>{const o=((t,e)=>{const o=[];for(let e=0,s=t.length;e<s;e++){const s=t[e];s!==n&&o.push(s)}return o})(m(t,e));o.length>0?h(t,e,o.join(" ")):g(t,e)})(t,"class",e)})(n,o),(t=>{const e=v(t)?t.dom.classList:(t=>m(t,"class"))(t);0===e.length&&g(t,"class")})(n)):t.dom.remove(e,!0)}))},E=t=>{const e=t.getBody(),n=t.selection.getBookmark();let o=((t,e)=>{for(;t.parentNode;){if(t.parentNode===e)return t;t=t.parentNode}})(t.selection.getNode(),e);o=void 0!==o?o:e,V(t,o),S(t,o),t.selection.moveToBookmark(n)},L=(t,e)=>{((t,e)=>{t.dispatch("VisualChars",{state:e})})(t,e.get());const n=t.getBody();!0===e.get()?S(t,n):V(t,n)},_=("visualchars_default_state",t=>t.options.get("visualchars_default_state"));const j=(t,e)=>{const n=((t,e)=>{let n=null;return{cancel:()=>{o(n)||(clearTimeout(n),n=null)},throttle:(...e)=>{o(n)&&(n=setTimeout((()=>{n=null,t.apply(null,e)}),300))}}})((()=>{E(t)}));t.on("keydown",(o=>{!0===e.get()&&(13===o.keyCode?E(t):n.throttle())})),t.on("remove",n.cancel)},x=(t,e)=>n=>{n.setActive(e.get());const o=t=>n.setActive(t.state);return t.on("VisualChars",o),()=>t.off("VisualChars",o)};t.add("visualchars",(t=>{(t=>{(0,t.options.register)("visualchars_default_state",{processor:"boolean",default:!1})})(t);const e=(t=>{let e=t;return{get:()=>e,set:t=>{e=t}}})(_(t));return((t,e)=>{t.addCommand("mceVisualChars",(()=>{((t,e)=>{e.set(!e.get());const n=t.selection.getBookmark();L(t,e),t.selection.moveToBookmark(n)})(t,e)}))})(t,e),((t,e)=>{const n=()=>t.execCommand("mceVisualChars");t.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:n,onSetup:x(t,e)}),t.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:n,onSetup:x(t,e)})})(t,e),j(t,e),((t,e)=>{t.on("init",(()=>{L(t,e)}))})(t,e),(t=>({isEnabled:()=>t.get()}))(e)}))}();
@@ -0,0 +1,7 @@
1
+ // Exports the "wordcount" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/wordcount')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/wordcount'
7
+ require('./plugin.js');