fx-platform-ui 0.0.13-alpha15 → 0.0.13-alpha17

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 (127) hide show
  1. package/lib/fx-platform-ui.mjs +65333 -32078
  2. package/lib/fx-platform-ui.umd.js +113 -69
  3. package/lib/packages/components/area/src/index.vue.d.ts +2 -2
  4. package/lib/packages/components/confirm/index.d.ts +2 -0
  5. package/lib/packages/components/confirm/src/confirm.vue.d.ts +2 -0
  6. package/lib/packages/components/confirm/src/index.d.ts +2 -0
  7. package/lib/style.css +1 -1
  8. package/package.json +1 -1
  9. package/packages/.DS_Store +0 -0
  10. package/packages/component.ts +3 -2
  11. package/packages/components/confirm/index.ts +9 -0
  12. package/packages/components/confirm/src/confirm.vue +75 -0
  13. package/packages/components/confirm/src/index.module.less +61 -0
  14. package/packages/components/confirm/src/index.tsx +91 -0
  15. package/packages/components/confirm/src/plat-confirm-props.ts +40 -0
  16. package/packages/components/editor/src/index.vue +22 -21
  17. package/packages/components/table/src/hook/useTableMethods.tsx +1 -1
  18. package/packages/components/table/src/plat-table-emits.ts +1 -1
  19. package/CHANGELOG.md +0 -46
  20. package/lib/tinymce/CHANGELOG.md +0 -2957
  21. package/lib/tinymce/README.md +0 -71
  22. package/lib/tinymce/bower.json +0 -27
  23. package/lib/tinymce/composer.json +0 -52
  24. package/lib/tinymce/icons/default/icons.js +0 -182
  25. package/lib/tinymce/icons/default/icons.min.js +0 -1
  26. package/lib/tinymce/icons/default/index.js +0 -7
  27. package/lib/tinymce/license.txt +0 -21
  28. package/lib/tinymce/models/dom/index.js +0 -7
  29. package/lib/tinymce/models/dom/model.js +0 -7975
  30. package/lib/tinymce/models/dom/model.min.js +0 -4
  31. package/lib/tinymce/package.json +0 -32
  32. package/lib/tinymce/plugins/advlist/index.js +0 -7
  33. package/lib/tinymce/plugins/advlist/plugin.js +0 -246
  34. package/lib/tinymce/plugins/advlist/plugin.min.js +0 -4
  35. package/lib/tinymce/plugins/anchor/index.js +0 -7
  36. package/lib/tinymce/plugins/anchor/plugin.js +0 -195
  37. package/lib/tinymce/plugins/anchor/plugin.min.js +0 -4
  38. package/lib/tinymce/plugins/autolink/index.js +0 -7
  39. package/lib/tinymce/plugins/autolink/plugin.js +0 -232
  40. package/lib/tinymce/plugins/autolink/plugin.min.js +0 -4
  41. package/lib/tinymce/plugins/autoresize/index.js +0 -7
  42. package/lib/tinymce/plugins/autoresize/plugin.js +0 -156
  43. package/lib/tinymce/plugins/autoresize/plugin.min.js +0 -4
  44. package/lib/tinymce/plugins/autosave/index.js +0 -7
  45. package/lib/tinymce/plugins/autosave/plugin.js +0 -232
  46. package/lib/tinymce/plugins/autosave/plugin.min.js +0 -4
  47. package/lib/tinymce/plugins/charmap/index.js +0 -7
  48. package/lib/tinymce/plugins/charmap/plugin.js +0 -1636
  49. package/lib/tinymce/plugins/charmap/plugin.min.js +0 -4
  50. package/lib/tinymce/plugins/code/index.js +0 -7
  51. package/lib/tinymce/plugins/code/plugin.js +0 -85
  52. package/lib/tinymce/plugins/code/plugin.min.js +0 -4
  53. package/lib/tinymce/plugins/codesample/index.js +0 -7
  54. package/lib/tinymce/plugins/codesample/plugin.js +0 -2451
  55. package/lib/tinymce/plugins/codesample/plugin.min.js +0 -4
  56. package/lib/tinymce/plugins/directionality/index.js +0 -7
  57. package/lib/tinymce/plugins/directionality/plugin.js +0 -384
  58. package/lib/tinymce/plugins/directionality/plugin.min.js +0 -4
  59. package/lib/tinymce/plugins/emoticons/index.js +0 -7
  60. package/lib/tinymce/plugins/emoticons/js/emojiimages.js +0 -1
  61. package/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +0 -3
  62. package/lib/tinymce/plugins/emoticons/js/emojis.js +0 -1
  63. package/lib/tinymce/plugins/emoticons/js/emojis.min.js +0 -2
  64. package/lib/tinymce/plugins/emoticons/plugin.js +0 -577
  65. package/lib/tinymce/plugins/emoticons/plugin.min.js +0 -4
  66. package/lib/tinymce/plugins/fullscreen/index.js +0 -7
  67. package/lib/tinymce/plugins/fullscreen/plugin.js +0 -1190
  68. package/lib/tinymce/plugins/fullscreen/plugin.min.js +0 -4
  69. package/lib/tinymce/plugins/help/index.js +0 -7
  70. package/lib/tinymce/plugins/help/plugin.js +0 -848
  71. package/lib/tinymce/plugins/help/plugin.min.js +0 -4
  72. package/lib/tinymce/plugins/image/index.js +0 -7
  73. package/lib/tinymce/plugins/image/plugin.js +0 -1475
  74. package/lib/tinymce/plugins/image/plugin.min.js +0 -4
  75. package/lib/tinymce/plugins/importcss/index.js +0 -7
  76. package/lib/tinymce/plugins/importcss/plugin.js +0 -342
  77. package/lib/tinymce/plugins/importcss/plugin.min.js +0 -4
  78. package/lib/tinymce/plugins/insertdatetime/index.js +0 -7
  79. package/lib/tinymce/plugins/insertdatetime/plugin.js +0 -176
  80. package/lib/tinymce/plugins/insertdatetime/plugin.min.js +0 -4
  81. package/lib/tinymce/plugins/link/index.js +0 -7
  82. package/lib/tinymce/plugins/link/plugin.js +0 -1190
  83. package/lib/tinymce/plugins/link/plugin.min.js +0 -4
  84. package/lib/tinymce/plugins/lists/index.js +0 -7
  85. package/lib/tinymce/plugins/lists/plugin.js +0 -1820
  86. package/lib/tinymce/plugins/lists/plugin.min.js +0 -4
  87. package/lib/tinymce/plugins/media/index.js +0 -7
  88. package/lib/tinymce/plugins/media/plugin.js +0 -1157
  89. package/lib/tinymce/plugins/media/plugin.min.js +0 -4
  90. package/lib/tinymce/plugins/nonbreaking/index.js +0 -7
  91. package/lib/tinymce/plugins/nonbreaking/plugin.js +0 -111
  92. package/lib/tinymce/plugins/nonbreaking/plugin.min.js +0 -4
  93. package/lib/tinymce/plugins/pagebreak/index.js +0 -7
  94. package/lib/tinymce/plugins/pagebreak/plugin.js +0 -105
  95. package/lib/tinymce/plugins/pagebreak/plugin.min.js +0 -4
  96. package/lib/tinymce/plugins/preview/index.js +0 -7
  97. package/lib/tinymce/plugins/preview/plugin.js +0 -97
  98. package/lib/tinymce/plugins/preview/plugin.min.js +0 -4
  99. package/lib/tinymce/plugins/quickbars/index.js +0 -7
  100. package/lib/tinymce/plugins/quickbars/plugin.js +0 -421
  101. package/lib/tinymce/plugins/quickbars/plugin.min.js +0 -4
  102. package/lib/tinymce/plugins/save/index.js +0 -7
  103. package/lib/tinymce/plugins/save/plugin.js +0 -118
  104. package/lib/tinymce/plugins/save/plugin.min.js +0 -4
  105. package/lib/tinymce/plugins/searchreplace/index.js +0 -7
  106. package/lib/tinymce/plugins/searchreplace/plugin.js +0 -1079
  107. package/lib/tinymce/plugins/searchreplace/plugin.min.js +0 -4
  108. package/lib/tinymce/plugins/table/index.js +0 -7
  109. package/lib/tinymce/plugins/table/plugin.js +0 -3393
  110. package/lib/tinymce/plugins/table/plugin.min.js +0 -4
  111. package/lib/tinymce/plugins/template/index.js +0 -7
  112. package/lib/tinymce/plugins/template/plugin.js +0 -548
  113. package/lib/tinymce/plugins/template/plugin.min.js +0 -4
  114. package/lib/tinymce/plugins/visualblocks/index.js +0 -7
  115. package/lib/tinymce/plugins/visualblocks/plugin.js +0 -98
  116. package/lib/tinymce/plugins/visualblocks/plugin.min.js +0 -4
  117. package/lib/tinymce/plugins/visualchars/index.js +0 -7
  118. package/lib/tinymce/plugins/visualchars/plugin.js +0 -506
  119. package/lib/tinymce/plugins/visualchars/plugin.min.js +0 -4
  120. package/lib/tinymce/plugins/wordcount/index.js +0 -7
  121. package/lib/tinymce/plugins/wordcount/plugin.js +0 -404
  122. package/lib/tinymce/plugins/wordcount/plugin.min.js +0 -4
  123. package/lib/tinymce/themes/silver/index.js +0 -7
  124. package/lib/tinymce/themes/silver/theme.js +0 -26184
  125. package/lib/tinymce/themes/silver/theme.min.js +0 -4
  126. package/lib/tinymce/tinymce.d.ts +0 -2895
  127. package/lib/tinymce/tinymce.js +0 -29400
@@ -1,1190 +0,0 @@
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$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
23
-
24
- const get$5 = fullscreenState => ({ isFullscreen: () => fullscreenState.get() !== null });
25
-
26
- const hasProto = (v, constructor, predicate) => {
27
- var _a;
28
- if (predicate(v, constructor.prototype)) {
29
- return true;
30
- } else {
31
- return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
32
- }
33
- };
34
- const typeOf = x => {
35
- const t = typeof x;
36
- if (x === null) {
37
- return 'null';
38
- } else if (t === 'object' && Array.isArray(x)) {
39
- return 'array';
40
- } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
41
- return 'string';
42
- } else {
43
- return t;
44
- }
45
- };
46
- const isType$1 = type => value => typeOf(value) === type;
47
- const isSimpleType = type => value => typeof value === type;
48
- const eq$1 = t => a => t === a;
49
- const isString = isType$1('string');
50
- const isArray = isType$1('array');
51
- const isNull = eq$1(null);
52
- const isBoolean = isSimpleType('boolean');
53
- const isNullable = a => a === null || a === undefined;
54
- const isNonNullable = a => !isNullable(a);
55
- const isFunction = isSimpleType('function');
56
- const isNumber = isSimpleType('number');
57
-
58
- const noop = () => {
59
- };
60
- const compose = (fa, fb) => {
61
- return (...args) => {
62
- return fa(fb.apply(null, args));
63
- };
64
- };
65
- const compose1 = (fbc, fab) => a => fbc(fab(a));
66
- const constant = value => {
67
- return () => {
68
- return value;
69
- };
70
- };
71
- function curry(fn, ...initialArgs) {
72
- return (...restArgs) => {
73
- const all = initialArgs.concat(restArgs);
74
- return fn.apply(null, all);
75
- };
76
- }
77
- const never = constant(false);
78
- const always = constant(true);
79
-
80
- class Optional {
81
- constructor(tag, value) {
82
- this.tag = tag;
83
- this.value = value;
84
- }
85
- static some(value) {
86
- return new Optional(true, value);
87
- }
88
- static none() {
89
- return Optional.singletonNone;
90
- }
91
- fold(onNone, onSome) {
92
- if (this.tag) {
93
- return onSome(this.value);
94
- } else {
95
- return onNone();
96
- }
97
- }
98
- isSome() {
99
- return this.tag;
100
- }
101
- isNone() {
102
- return !this.tag;
103
- }
104
- map(mapper) {
105
- if (this.tag) {
106
- return Optional.some(mapper(this.value));
107
- } else {
108
- return Optional.none();
109
- }
110
- }
111
- bind(binder) {
112
- if (this.tag) {
113
- return binder(this.value);
114
- } else {
115
- return Optional.none();
116
- }
117
- }
118
- exists(predicate) {
119
- return this.tag && predicate(this.value);
120
- }
121
- forall(predicate) {
122
- return !this.tag || predicate(this.value);
123
- }
124
- filter(predicate) {
125
- if (!this.tag || predicate(this.value)) {
126
- return this;
127
- } else {
128
- return Optional.none();
129
- }
130
- }
131
- getOr(replacement) {
132
- return this.tag ? this.value : replacement;
133
- }
134
- or(replacement) {
135
- return this.tag ? this : replacement;
136
- }
137
- getOrThunk(thunk) {
138
- return this.tag ? this.value : thunk();
139
- }
140
- orThunk(thunk) {
141
- return this.tag ? this : thunk();
142
- }
143
- getOrDie(message) {
144
- if (!this.tag) {
145
- throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
146
- } else {
147
- return this.value;
148
- }
149
- }
150
- static from(value) {
151
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
152
- }
153
- getOrNull() {
154
- return this.tag ? this.value : null;
155
- }
156
- getOrUndefined() {
157
- return this.value;
158
- }
159
- each(worker) {
160
- if (this.tag) {
161
- worker(this.value);
162
- }
163
- }
164
- toArray() {
165
- return this.tag ? [this.value] : [];
166
- }
167
- toString() {
168
- return this.tag ? `some(${ this.value })` : 'none()';
169
- }
170
- }
171
- Optional.singletonNone = new Optional(false);
172
-
173
- const singleton = doRevoke => {
174
- const subject = Cell(Optional.none());
175
- const revoke = () => subject.get().each(doRevoke);
176
- const clear = () => {
177
- revoke();
178
- subject.set(Optional.none());
179
- };
180
- const isSet = () => subject.get().isSome();
181
- const get = () => subject.get();
182
- const set = s => {
183
- revoke();
184
- subject.set(Optional.some(s));
185
- };
186
- return {
187
- clear,
188
- isSet,
189
- get,
190
- set
191
- };
192
- };
193
- const unbindable = () => singleton(s => s.unbind());
194
- const value = () => {
195
- const subject = singleton(noop);
196
- const on = f => subject.get().each(f);
197
- return {
198
- ...subject,
199
- on
200
- };
201
- };
202
-
203
- const first = (fn, rate) => {
204
- let timer = null;
205
- const cancel = () => {
206
- if (!isNull(timer)) {
207
- clearTimeout(timer);
208
- timer = null;
209
- }
210
- };
211
- const throttle = (...args) => {
212
- if (isNull(timer)) {
213
- timer = setTimeout(() => {
214
- timer = null;
215
- fn.apply(null, args);
216
- }, rate);
217
- }
218
- };
219
- return {
220
- cancel,
221
- throttle
222
- };
223
- };
224
-
225
- const nativePush = Array.prototype.push;
226
- const map = (xs, f) => {
227
- const len = xs.length;
228
- const r = new Array(len);
229
- for (let i = 0; i < len; i++) {
230
- const x = xs[i];
231
- r[i] = f(x, i);
232
- }
233
- return r;
234
- };
235
- const each$1 = (xs, f) => {
236
- for (let i = 0, len = xs.length; i < len; i++) {
237
- const x = xs[i];
238
- f(x, i);
239
- }
240
- };
241
- const filter$1 = (xs, pred) => {
242
- const r = [];
243
- for (let i = 0, len = xs.length; i < len; i++) {
244
- const x = xs[i];
245
- if (pred(x, i)) {
246
- r.push(x);
247
- }
248
- }
249
- return r;
250
- };
251
- const findUntil = (xs, pred, until) => {
252
- for (let i = 0, len = xs.length; i < len; i++) {
253
- const x = xs[i];
254
- if (pred(x, i)) {
255
- return Optional.some(x);
256
- } else if (until(x, i)) {
257
- break;
258
- }
259
- }
260
- return Optional.none();
261
- };
262
- const find$1 = (xs, pred) => {
263
- return findUntil(xs, pred, never);
264
- };
265
- const flatten = xs => {
266
- const r = [];
267
- for (let i = 0, len = xs.length; i < len; ++i) {
268
- if (!isArray(xs[i])) {
269
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
270
- }
271
- nativePush.apply(r, xs[i]);
272
- }
273
- return r;
274
- };
275
- const bind$3 = (xs, f) => flatten(map(xs, f));
276
- const get$4 = (xs, i) => i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
277
- const head = xs => get$4(xs, 0);
278
- const findMap = (arr, f) => {
279
- for (let i = 0; i < arr.length; i++) {
280
- const r = f(arr[i], i);
281
- if (r.isSome()) {
282
- return r;
283
- }
284
- }
285
- return Optional.none();
286
- };
287
-
288
- const keys = Object.keys;
289
- const each = (obj, f) => {
290
- const props = keys(obj);
291
- for (let k = 0, len = props.length; k < len; k++) {
292
- const i = props[k];
293
- const x = obj[i];
294
- f(x, i);
295
- }
296
- };
297
-
298
- const contains = (str, substr) => {
299
- return str.indexOf(substr) !== -1;
300
- };
301
-
302
- const isSupported$1 = dom => dom.style !== undefined && isFunction(dom.style.getPropertyValue);
303
-
304
- const fromHtml = (html, scope) => {
305
- const doc = scope || document;
306
- const div = doc.createElement('div');
307
- div.innerHTML = html;
308
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
309
- const message = 'HTML does not have a single root node';
310
- console.error(message, html);
311
- throw new Error(message);
312
- }
313
- return fromDom(div.childNodes[0]);
314
- };
315
- const fromTag = (tag, scope) => {
316
- const doc = scope || document;
317
- const node = doc.createElement(tag);
318
- return fromDom(node);
319
- };
320
- const fromText = (text, scope) => {
321
- const doc = scope || document;
322
- const node = doc.createTextNode(text);
323
- return fromDom(node);
324
- };
325
- const fromDom = node => {
326
- if (node === null || node === undefined) {
327
- throw new Error('Node cannot be null or undefined');
328
- }
329
- return { dom: node };
330
- };
331
- const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
332
- const SugarElement = {
333
- fromHtml,
334
- fromTag,
335
- fromText,
336
- fromDom,
337
- fromPoint
338
- };
339
-
340
- typeof window !== 'undefined' ? window : Function('return this;')();
341
-
342
- const DOCUMENT = 9;
343
- const DOCUMENT_FRAGMENT = 11;
344
- const ELEMENT = 1;
345
- const TEXT = 3;
346
-
347
- const type = element => element.dom.nodeType;
348
- const isType = t => element => type(element) === t;
349
- const isElement = isType(ELEMENT);
350
- const isText = isType(TEXT);
351
- const isDocument = isType(DOCUMENT);
352
- const isDocumentFragment = isType(DOCUMENT_FRAGMENT);
353
-
354
- const is = (element, selector) => {
355
- const dom = element.dom;
356
- if (dom.nodeType !== ELEMENT) {
357
- return false;
358
- } else {
359
- const elem = dom;
360
- if (elem.matches !== undefined) {
361
- return elem.matches(selector);
362
- } else if (elem.msMatchesSelector !== undefined) {
363
- return elem.msMatchesSelector(selector);
364
- } else if (elem.webkitMatchesSelector !== undefined) {
365
- return elem.webkitMatchesSelector(selector);
366
- } else if (elem.mozMatchesSelector !== undefined) {
367
- return elem.mozMatchesSelector(selector);
368
- } else {
369
- throw new Error('Browser lacks native selectors');
370
- }
371
- }
372
- };
373
- const bypassSelector = dom => dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
374
- const all$1 = (selector, scope) => {
375
- const base = scope === undefined ? document : scope.dom;
376
- return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom);
377
- };
378
-
379
- const eq = (e1, e2) => e1.dom === e2.dom;
380
-
381
- const owner = element => SugarElement.fromDom(element.dom.ownerDocument);
382
- const documentOrOwner = dos => isDocument(dos) ? dos : owner(dos);
383
- const parent = element => Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
384
- const parents = (element, isRoot) => {
385
- const stop = isFunction(isRoot) ? isRoot : never;
386
- let dom = element.dom;
387
- const ret = [];
388
- while (dom.parentNode !== null && dom.parentNode !== undefined) {
389
- const rawParent = dom.parentNode;
390
- const p = SugarElement.fromDom(rawParent);
391
- ret.push(p);
392
- if (stop(p) === true) {
393
- break;
394
- } else {
395
- dom = rawParent;
396
- }
397
- }
398
- return ret;
399
- };
400
- const siblings$2 = element => {
401
- const filterSelf = elements => filter$1(elements, x => !eq(element, x));
402
- return parent(element).map(children).map(filterSelf).getOr([]);
403
- };
404
- const children = element => map(element.dom.childNodes, SugarElement.fromDom);
405
-
406
- const isShadowRoot = dos => isDocumentFragment(dos) && isNonNullable(dos.dom.host);
407
- const supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
408
- const isSupported = constant(supported);
409
- const getRootNode = supported ? e => SugarElement.fromDom(e.dom.getRootNode()) : documentOrOwner;
410
- const getShadowRoot = e => {
411
- const r = getRootNode(e);
412
- return isShadowRoot(r) ? Optional.some(r) : Optional.none();
413
- };
414
- const getShadowHost = e => SugarElement.fromDom(e.dom.host);
415
- const getOriginalEventTarget = event => {
416
- if (isSupported() && isNonNullable(event.target)) {
417
- const el = SugarElement.fromDom(event.target);
418
- if (isElement(el) && isOpenShadowHost(el)) {
419
- if (event.composed && event.composedPath) {
420
- const composedPath = event.composedPath();
421
- if (composedPath) {
422
- return head(composedPath);
423
- }
424
- }
425
- }
426
- }
427
- return Optional.from(event.target);
428
- };
429
- const isOpenShadowHost = element => isNonNullable(element.dom.shadowRoot);
430
-
431
- const inBody = element => {
432
- const dom = isText(element) ? element.dom.parentNode : element.dom;
433
- if (dom === undefined || dom === null || dom.ownerDocument === null) {
434
- return false;
435
- }
436
- const doc = dom.ownerDocument;
437
- return getShadowRoot(SugarElement.fromDom(dom)).fold(() => doc.body.contains(dom), compose1(inBody, getShadowHost));
438
- };
439
- const getBody = doc => {
440
- const b = doc.dom.body;
441
- if (b === null || b === undefined) {
442
- throw new Error('Body is not available yet');
443
- }
444
- return SugarElement.fromDom(b);
445
- };
446
-
447
- const rawSet = (dom, key, value) => {
448
- if (isString(value) || isBoolean(value) || isNumber(value)) {
449
- dom.setAttribute(key, value + '');
450
- } else {
451
- console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
452
- throw new Error('Attribute value was not simple');
453
- }
454
- };
455
- const set = (element, key, value) => {
456
- rawSet(element.dom, key, value);
457
- };
458
- const get$3 = (element, key) => {
459
- const v = element.dom.getAttribute(key);
460
- return v === null ? undefined : v;
461
- };
462
- const remove = (element, key) => {
463
- element.dom.removeAttribute(key);
464
- };
465
-
466
- const internalSet = (dom, property, value) => {
467
- if (!isString(value)) {
468
- console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);
469
- throw new Error('CSS value must be a string: ' + value);
470
- }
471
- if (isSupported$1(dom)) {
472
- dom.style.setProperty(property, value);
473
- }
474
- };
475
- const setAll = (element, css) => {
476
- const dom = element.dom;
477
- each(css, (v, k) => {
478
- internalSet(dom, k, v);
479
- });
480
- };
481
- const get$2 = (element, property) => {
482
- const dom = element.dom;
483
- const styles = window.getComputedStyle(dom);
484
- const r = styles.getPropertyValue(property);
485
- return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
486
- };
487
- const getUnsafeProperty = (dom, property) => isSupported$1(dom) ? dom.style.getPropertyValue(property) : '';
488
-
489
- const mkEvent = (target, x, y, stop, prevent, kill, raw) => ({
490
- target,
491
- x,
492
- y,
493
- stop,
494
- prevent,
495
- kill,
496
- raw
497
- });
498
- const fromRawEvent = rawEvent => {
499
- const target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target));
500
- const stop = () => rawEvent.stopPropagation();
501
- const prevent = () => rawEvent.preventDefault();
502
- const kill = compose(prevent, stop);
503
- return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent);
504
- };
505
- const handle = (filter, handler) => rawEvent => {
506
- if (filter(rawEvent)) {
507
- handler(fromRawEvent(rawEvent));
508
- }
509
- };
510
- const binder = (element, event, filter, handler, useCapture) => {
511
- const wrapped = handle(filter, handler);
512
- element.dom.addEventListener(event, wrapped, useCapture);
513
- return { unbind: curry(unbind, element, event, wrapped, useCapture) };
514
- };
515
- const bind$2 = (element, event, filter, handler) => binder(element, event, filter, handler, false);
516
- const unbind = (element, event, handler, useCapture) => {
517
- element.dom.removeEventListener(event, handler, useCapture);
518
- };
519
-
520
- const filter = always;
521
- const bind$1 = (element, event, handler) => bind$2(element, event, filter, handler);
522
-
523
- const cached = f => {
524
- let called = false;
525
- let r;
526
- return (...args) => {
527
- if (!called) {
528
- called = true;
529
- r = f.apply(null, args);
530
- }
531
- return r;
532
- };
533
- };
534
-
535
- const DeviceType = (os, browser, userAgent, mediaMatch) => {
536
- const isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
537
- const isiPhone = os.isiOS() && !isiPad;
538
- const isMobile = os.isiOS() || os.isAndroid();
539
- const isTouch = isMobile || mediaMatch('(pointer:coarse)');
540
- const isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');
541
- const isPhone = isiPhone || isMobile && !isTablet;
542
- const iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
543
- const isDesktop = !isPhone && !isTablet && !iOSwebview;
544
- return {
545
- isiPad: constant(isiPad),
546
- isiPhone: constant(isiPhone),
547
- isTablet: constant(isTablet),
548
- isPhone: constant(isPhone),
549
- isTouch: constant(isTouch),
550
- isAndroid: os.isAndroid,
551
- isiOS: os.isiOS,
552
- isWebView: constant(iOSwebview),
553
- isDesktop: constant(isDesktop)
554
- };
555
- };
556
-
557
- const firstMatch = (regexes, s) => {
558
- for (let i = 0; i < regexes.length; i++) {
559
- const x = regexes[i];
560
- if (x.test(s)) {
561
- return x;
562
- }
563
- }
564
- return undefined;
565
- };
566
- const find = (regexes, agent) => {
567
- const r = firstMatch(regexes, agent);
568
- if (!r) {
569
- return {
570
- major: 0,
571
- minor: 0
572
- };
573
- }
574
- const group = i => {
575
- return Number(agent.replace(r, '$' + i));
576
- };
577
- return nu$2(group(1), group(2));
578
- };
579
- const detect$3 = (versionRegexes, agent) => {
580
- const cleanedAgent = String(agent).toLowerCase();
581
- if (versionRegexes.length === 0) {
582
- return unknown$2();
583
- }
584
- return find(versionRegexes, cleanedAgent);
585
- };
586
- const unknown$2 = () => {
587
- return nu$2(0, 0);
588
- };
589
- const nu$2 = (major, minor) => {
590
- return {
591
- major,
592
- minor
593
- };
594
- };
595
- const Version = {
596
- nu: nu$2,
597
- detect: detect$3,
598
- unknown: unknown$2
599
- };
600
-
601
- const detectBrowser$1 = (browsers, userAgentData) => {
602
- return findMap(userAgentData.brands, uaBrand => {
603
- const lcBrand = uaBrand.brand.toLowerCase();
604
- return find$1(browsers, browser => {
605
- var _a;
606
- return lcBrand === ((_a = browser.brand) === null || _a === void 0 ? void 0 : _a.toLowerCase());
607
- }).map(info => ({
608
- current: info.name,
609
- version: Version.nu(parseInt(uaBrand.version, 10), 0)
610
- }));
611
- });
612
- };
613
-
614
- const detect$2 = (candidates, userAgent) => {
615
- const agent = String(userAgent).toLowerCase();
616
- return find$1(candidates, candidate => {
617
- return candidate.search(agent);
618
- });
619
- };
620
- const detectBrowser = (browsers, userAgent) => {
621
- return detect$2(browsers, userAgent).map(browser => {
622
- const version = Version.detect(browser.versionRegexes, userAgent);
623
- return {
624
- current: browser.name,
625
- version
626
- };
627
- });
628
- };
629
- const detectOs = (oses, userAgent) => {
630
- return detect$2(oses, userAgent).map(os => {
631
- const version = Version.detect(os.versionRegexes, userAgent);
632
- return {
633
- current: os.name,
634
- version
635
- };
636
- });
637
- };
638
-
639
- const normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
640
- const checkContains = target => {
641
- return uastring => {
642
- return contains(uastring, target);
643
- };
644
- };
645
- const browsers = [
646
- {
647
- name: 'Edge',
648
- versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
649
- search: uastring => {
650
- return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
651
- }
652
- },
653
- {
654
- name: 'Chromium',
655
- brand: 'Chromium',
656
- versionRegexes: [
657
- /.*?chrome\/([0-9]+)\.([0-9]+).*/,
658
- normalVersionRegex
659
- ],
660
- search: uastring => {
661
- return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe');
662
- }
663
- },
664
- {
665
- name: 'IE',
666
- versionRegexes: [
667
- /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
668
- /.*?rv:([0-9]+)\.([0-9]+).*/
669
- ],
670
- search: uastring => {
671
- return contains(uastring, 'msie') || contains(uastring, 'trident');
672
- }
673
- },
674
- {
675
- name: 'Opera',
676
- versionRegexes: [
677
- normalVersionRegex,
678
- /.*?opera\/([0-9]+)\.([0-9]+).*/
679
- ],
680
- search: checkContains('opera')
681
- },
682
- {
683
- name: 'Firefox',
684
- versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
685
- search: checkContains('firefox')
686
- },
687
- {
688
- name: 'Safari',
689
- versionRegexes: [
690
- normalVersionRegex,
691
- /.*?cpu os ([0-9]+)_([0-9]+).*/
692
- ],
693
- search: uastring => {
694
- return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit');
695
- }
696
- }
697
- ];
698
- const oses = [
699
- {
700
- name: 'Windows',
701
- search: checkContains('win'),
702
- versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
703
- },
704
- {
705
- name: 'iOS',
706
- search: uastring => {
707
- return contains(uastring, 'iphone') || contains(uastring, 'ipad');
708
- },
709
- versionRegexes: [
710
- /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
711
- /.*cpu os ([0-9]+)_([0-9]+).*/,
712
- /.*cpu iphone os ([0-9]+)_([0-9]+).*/
713
- ]
714
- },
715
- {
716
- name: 'Android',
717
- search: checkContains('android'),
718
- versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
719
- },
720
- {
721
- name: 'macOS',
722
- search: checkContains('mac os x'),
723
- versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]
724
- },
725
- {
726
- name: 'Linux',
727
- search: checkContains('linux'),
728
- versionRegexes: []
729
- },
730
- {
731
- name: 'Solaris',
732
- search: checkContains('sunos'),
733
- versionRegexes: []
734
- },
735
- {
736
- name: 'FreeBSD',
737
- search: checkContains('freebsd'),
738
- versionRegexes: []
739
- },
740
- {
741
- name: 'ChromeOS',
742
- search: checkContains('cros'),
743
- versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/]
744
- }
745
- ];
746
- const PlatformInfo = {
747
- browsers: constant(browsers),
748
- oses: constant(oses)
749
- };
750
-
751
- const edge = 'Edge';
752
- const chromium = 'Chromium';
753
- const ie = 'IE';
754
- const opera = 'Opera';
755
- const firefox = 'Firefox';
756
- const safari = 'Safari';
757
- const unknown$1 = () => {
758
- return nu$1({
759
- current: undefined,
760
- version: Version.unknown()
761
- });
762
- };
763
- const nu$1 = info => {
764
- const current = info.current;
765
- const version = info.version;
766
- const isBrowser = name => () => current === name;
767
- return {
768
- current,
769
- version,
770
- isEdge: isBrowser(edge),
771
- isChromium: isBrowser(chromium),
772
- isIE: isBrowser(ie),
773
- isOpera: isBrowser(opera),
774
- isFirefox: isBrowser(firefox),
775
- isSafari: isBrowser(safari)
776
- };
777
- };
778
- const Browser = {
779
- unknown: unknown$1,
780
- nu: nu$1,
781
- edge: constant(edge),
782
- chromium: constant(chromium),
783
- ie: constant(ie),
784
- opera: constant(opera),
785
- firefox: constant(firefox),
786
- safari: constant(safari)
787
- };
788
-
789
- const windows = 'Windows';
790
- const ios = 'iOS';
791
- const android = 'Android';
792
- const linux = 'Linux';
793
- const macos = 'macOS';
794
- const solaris = 'Solaris';
795
- const freebsd = 'FreeBSD';
796
- const chromeos = 'ChromeOS';
797
- const unknown = () => {
798
- return nu({
799
- current: undefined,
800
- version: Version.unknown()
801
- });
802
- };
803
- const nu = info => {
804
- const current = info.current;
805
- const version = info.version;
806
- const isOS = name => () => current === name;
807
- return {
808
- current,
809
- version,
810
- isWindows: isOS(windows),
811
- isiOS: isOS(ios),
812
- isAndroid: isOS(android),
813
- isMacOS: isOS(macos),
814
- isLinux: isOS(linux),
815
- isSolaris: isOS(solaris),
816
- isFreeBSD: isOS(freebsd),
817
- isChromeOS: isOS(chromeos)
818
- };
819
- };
820
- const OperatingSystem = {
821
- unknown,
822
- nu,
823
- windows: constant(windows),
824
- ios: constant(ios),
825
- android: constant(android),
826
- linux: constant(linux),
827
- macos: constant(macos),
828
- solaris: constant(solaris),
829
- freebsd: constant(freebsd),
830
- chromeos: constant(chromeos)
831
- };
832
-
833
- const detect$1 = (userAgent, userAgentDataOpt, mediaMatch) => {
834
- const browsers = PlatformInfo.browsers();
835
- const oses = PlatformInfo.oses();
836
- const browser = userAgentDataOpt.bind(userAgentData => detectBrowser$1(browsers, userAgentData)).orThunk(() => detectBrowser(browsers, userAgent)).fold(Browser.unknown, Browser.nu);
837
- const os = detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
838
- const deviceType = DeviceType(os, browser, userAgent, mediaMatch);
839
- return {
840
- browser,
841
- os,
842
- deviceType
843
- };
844
- };
845
- const PlatformDetection = { detect: detect$1 };
846
-
847
- const mediaMatch = query => window.matchMedia(query).matches;
848
- let platform = cached(() => PlatformDetection.detect(navigator.userAgent, Optional.from(navigator.userAgentData), mediaMatch));
849
- const detect = () => platform();
850
-
851
- const r = (left, top) => {
852
- const translate = (x, y) => r(left + x, top + y);
853
- return {
854
- left,
855
- top,
856
- translate
857
- };
858
- };
859
- const SugarPosition = r;
860
-
861
- const get$1 = _DOC => {
862
- const doc = _DOC !== undefined ? _DOC.dom : document;
863
- const x = doc.body.scrollLeft || doc.documentElement.scrollLeft;
864
- const y = doc.body.scrollTop || doc.documentElement.scrollTop;
865
- return SugarPosition(x, y);
866
- };
867
-
868
- const get = _win => {
869
- const win = _win === undefined ? window : _win;
870
- if (detect().browser.isFirefox()) {
871
- return Optional.none();
872
- } else {
873
- return Optional.from(win.visualViewport);
874
- }
875
- };
876
- const bounds = (x, y, width, height) => ({
877
- x,
878
- y,
879
- width,
880
- height,
881
- right: x + width,
882
- bottom: y + height
883
- });
884
- const getBounds = _win => {
885
- const win = _win === undefined ? window : _win;
886
- const doc = win.document;
887
- const scroll = get$1(SugarElement.fromDom(doc));
888
- return get(win).fold(() => {
889
- const html = win.document.documentElement;
890
- const width = html.clientWidth;
891
- const height = html.clientHeight;
892
- return bounds(scroll.left, scroll.top, width, height);
893
- }, visualViewport => bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height));
894
- };
895
- const bind = (name, callback, _win) => get(_win).map(visualViewport => {
896
- const handler = e => callback(fromRawEvent(e));
897
- visualViewport.addEventListener(name, handler);
898
- return { unbind: () => visualViewport.removeEventListener(name, handler) };
899
- }).getOrThunk(() => ({ unbind: noop }));
900
-
901
- var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
902
-
903
- var global = tinymce.util.Tools.resolve('tinymce.Env');
904
-
905
- const fireFullscreenStateChanged = (editor, state) => {
906
- editor.dispatch('FullscreenStateChanged', { state });
907
- editor.dispatch('ResizeEditor');
908
- };
909
-
910
- const option = name => editor => editor.options.get(name);
911
- const register$2 = editor => {
912
- const registerOption = editor.options.register;
913
- registerOption('fullscreen_native', {
914
- processor: 'boolean',
915
- default: false
916
- });
917
- };
918
- const getFullscreenNative = option('fullscreen_native');
919
-
920
- const getFullscreenRoot = editor => {
921
- const elem = SugarElement.fromDom(editor.getElement());
922
- return getShadowRoot(elem).map(getShadowHost).getOrThunk(() => getBody(owner(elem)));
923
- };
924
- const getFullscreenElement = root => {
925
- if (root.fullscreenElement !== undefined) {
926
- return root.fullscreenElement;
927
- } else if (root.msFullscreenElement !== undefined) {
928
- return root.msFullscreenElement;
929
- } else if (root.webkitFullscreenElement !== undefined) {
930
- return root.webkitFullscreenElement;
931
- } else {
932
- return null;
933
- }
934
- };
935
- const getFullscreenchangeEventName = () => {
936
- if (document.fullscreenElement !== undefined) {
937
- return 'fullscreenchange';
938
- } else if (document.msFullscreenElement !== undefined) {
939
- return 'MSFullscreenChange';
940
- } else if (document.webkitFullscreenElement !== undefined) {
941
- return 'webkitfullscreenchange';
942
- } else {
943
- return 'fullscreenchange';
944
- }
945
- };
946
- const requestFullscreen = sugarElem => {
947
- const elem = sugarElem.dom;
948
- if (elem.requestFullscreen) {
949
- elem.requestFullscreen();
950
- } else if (elem.msRequestFullscreen) {
951
- elem.msRequestFullscreen();
952
- } else if (elem.webkitRequestFullScreen) {
953
- elem.webkitRequestFullScreen();
954
- }
955
- };
956
- const exitFullscreen = sugarDoc => {
957
- const doc = sugarDoc.dom;
958
- if (doc.exitFullscreen) {
959
- doc.exitFullscreen();
960
- } else if (doc.msExitFullscreen) {
961
- doc.msExitFullscreen();
962
- } else if (doc.webkitCancelFullScreen) {
963
- doc.webkitCancelFullScreen();
964
- }
965
- };
966
- const isFullscreenElement = elem => elem.dom === getFullscreenElement(owner(elem).dom);
967
-
968
- const ancestors$1 = (scope, predicate, isRoot) => filter$1(parents(scope, isRoot), predicate);
969
- const siblings$1 = (scope, predicate) => filter$1(siblings$2(scope), predicate);
970
-
971
- const all = selector => all$1(selector);
972
- const ancestors = (scope, selector, isRoot) => ancestors$1(scope, e => is(e, selector), isRoot);
973
- const siblings = (scope, selector) => siblings$1(scope, e => is(e, selector));
974
-
975
- const attr = 'data-ephox-mobile-fullscreen-style';
976
- const siblingStyles = 'display:none!important;';
977
- const ancestorPosition = 'position:absolute!important;';
978
- const ancestorStyles = 'top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;';
979
- const bgFallback = 'background-color:rgb(255,255,255)!important;';
980
- const isAndroid = global.os.isAndroid();
981
- const matchColor = editorBody => {
982
- const color = get$2(editorBody, 'background-color');
983
- return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback;
984
- };
985
- const clobberStyles = (dom, container, editorBody) => {
986
- const gatherSiblings = element => {
987
- return siblings(element, '*:not(.tox-silver-sink)');
988
- };
989
- const clobber = clobberStyle => element => {
990
- const styles = get$3(element, 'style');
991
- const backup = styles === undefined ? 'no-styles' : styles.trim();
992
- if (backup === clobberStyle) {
993
- return;
994
- } else {
995
- set(element, attr, backup);
996
- setAll(element, dom.parseStyle(clobberStyle));
997
- }
998
- };
999
- const ancestors$1 = ancestors(container, '*');
1000
- const siblings$1 = bind$3(ancestors$1, gatherSiblings);
1001
- const bgColor = matchColor(editorBody);
1002
- each$1(siblings$1, clobber(siblingStyles));
1003
- each$1(ancestors$1, clobber(ancestorPosition + ancestorStyles + bgColor));
1004
- const containerStyles = isAndroid === true ? '' : ancestorPosition;
1005
- clobber(containerStyles + ancestorStyles + bgColor)(container);
1006
- };
1007
- const restoreStyles = dom => {
1008
- const clobberedEls = all('[' + attr + ']');
1009
- each$1(clobberedEls, element => {
1010
- const restore = get$3(element, attr);
1011
- if (restore !== 'no-styles') {
1012
- setAll(element, dom.parseStyle(restore));
1013
- } else {
1014
- remove(element, 'style');
1015
- }
1016
- remove(element, attr);
1017
- });
1018
- };
1019
-
1020
- const DOM = global$1.DOM;
1021
- const getScrollPos = () => getBounds(window);
1022
- const setScrollPos = pos => window.scrollTo(pos.x, pos.y);
1023
- const viewportUpdate = get().fold(() => ({
1024
- bind: noop,
1025
- unbind: noop
1026
- }), visualViewport => {
1027
- const editorContainer = value();
1028
- const resizeBinder = unbindable();
1029
- const scrollBinder = unbindable();
1030
- const refreshScroll = () => {
1031
- document.body.scrollTop = 0;
1032
- document.documentElement.scrollTop = 0;
1033
- };
1034
- const refreshVisualViewport = () => {
1035
- window.requestAnimationFrame(() => {
1036
- editorContainer.on(container => setAll(container, {
1037
- top: visualViewport.offsetTop + 'px',
1038
- left: visualViewport.offsetLeft + 'px',
1039
- height: visualViewport.height + 'px',
1040
- width: visualViewport.width + 'px'
1041
- }));
1042
- });
1043
- };
1044
- const update = first(() => {
1045
- refreshScroll();
1046
- refreshVisualViewport();
1047
- }, 50);
1048
- const bind$1 = element => {
1049
- editorContainer.set(element);
1050
- update.throttle();
1051
- resizeBinder.set(bind('resize', update.throttle));
1052
- scrollBinder.set(bind('scroll', update.throttle));
1053
- };
1054
- const unbind = () => {
1055
- editorContainer.on(() => {
1056
- resizeBinder.clear();
1057
- scrollBinder.clear();
1058
- });
1059
- editorContainer.clear();
1060
- };
1061
- return {
1062
- bind: bind$1,
1063
- unbind
1064
- };
1065
- });
1066
- const toggleFullscreen = (editor, fullscreenState) => {
1067
- const body = document.body;
1068
- const documentElement = document.documentElement;
1069
- const editorContainer = editor.getContainer();
1070
- const editorContainerS = SugarElement.fromDom(editorContainer);
1071
- const fullscreenRoot = getFullscreenRoot(editor);
1072
- const fullscreenInfo = fullscreenState.get();
1073
- const editorBody = SugarElement.fromDom(editor.getBody());
1074
- const isTouch = global.deviceType.isTouch();
1075
- const editorContainerStyle = editorContainer.style;
1076
- const iframe = editor.iframeElement;
1077
- const iframeStyle = iframe.style;
1078
- const handleClasses = handler => {
1079
- handler(body, 'tox-fullscreen');
1080
- handler(documentElement, 'tox-fullscreen');
1081
- handler(editorContainer, 'tox-fullscreen');
1082
- getShadowRoot(editorContainerS).map(root => getShadowHost(root).dom).each(host => {
1083
- handler(host, 'tox-fullscreen');
1084
- handler(host, 'tox-shadowhost');
1085
- });
1086
- };
1087
- const cleanup = () => {
1088
- if (isTouch) {
1089
- restoreStyles(editor.dom);
1090
- }
1091
- handleClasses(DOM.removeClass);
1092
- viewportUpdate.unbind();
1093
- Optional.from(fullscreenState.get()).each(info => info.fullscreenChangeHandler.unbind());
1094
- };
1095
- if (!fullscreenInfo) {
1096
- const fullscreenChangeHandler = bind$1(owner(fullscreenRoot), getFullscreenchangeEventName(), _evt => {
1097
- if (getFullscreenNative(editor)) {
1098
- if (!isFullscreenElement(fullscreenRoot) && fullscreenState.get() !== null) {
1099
- toggleFullscreen(editor, fullscreenState);
1100
- }
1101
- }
1102
- });
1103
- const newFullScreenInfo = {
1104
- scrollPos: getScrollPos(),
1105
- containerWidth: editorContainerStyle.width,
1106
- containerHeight: editorContainerStyle.height,
1107
- containerTop: editorContainerStyle.top,
1108
- containerLeft: editorContainerStyle.left,
1109
- iframeWidth: iframeStyle.width,
1110
- iframeHeight: iframeStyle.height,
1111
- fullscreenChangeHandler
1112
- };
1113
- if (isTouch) {
1114
- clobberStyles(editor.dom, editorContainerS, editorBody);
1115
- }
1116
- iframeStyle.width = iframeStyle.height = '100%';
1117
- editorContainerStyle.width = editorContainerStyle.height = '';
1118
- handleClasses(DOM.addClass);
1119
- viewportUpdate.bind(editorContainerS);
1120
- editor.on('remove', cleanup);
1121
- fullscreenState.set(newFullScreenInfo);
1122
- if (getFullscreenNative(editor)) {
1123
- requestFullscreen(fullscreenRoot);
1124
- }
1125
- fireFullscreenStateChanged(editor, true);
1126
- } else {
1127
- fullscreenInfo.fullscreenChangeHandler.unbind();
1128
- if (getFullscreenNative(editor) && isFullscreenElement(fullscreenRoot)) {
1129
- exitFullscreen(owner(fullscreenRoot));
1130
- }
1131
- iframeStyle.width = fullscreenInfo.iframeWidth;
1132
- iframeStyle.height = fullscreenInfo.iframeHeight;
1133
- editorContainerStyle.width = fullscreenInfo.containerWidth;
1134
- editorContainerStyle.height = fullscreenInfo.containerHeight;
1135
- editorContainerStyle.top = fullscreenInfo.containerTop;
1136
- editorContainerStyle.left = fullscreenInfo.containerLeft;
1137
- cleanup();
1138
- setScrollPos(fullscreenInfo.scrollPos);
1139
- fullscreenState.set(null);
1140
- fireFullscreenStateChanged(editor, false);
1141
- editor.off('remove', cleanup);
1142
- }
1143
- };
1144
-
1145
- const register$1 = (editor, fullscreenState) => {
1146
- editor.addCommand('mceFullScreen', () => {
1147
- toggleFullscreen(editor, fullscreenState);
1148
- });
1149
- };
1150
-
1151
- const makeSetupHandler = (editor, fullscreenState) => api => {
1152
- api.setActive(fullscreenState.get() !== null);
1153
- const editorEventCallback = e => api.setActive(e.state);
1154
- editor.on('FullscreenStateChanged', editorEventCallback);
1155
- return () => editor.off('FullscreenStateChanged', editorEventCallback);
1156
- };
1157
- const register = (editor, fullscreenState) => {
1158
- const onAction = () => editor.execCommand('mceFullScreen');
1159
- editor.ui.registry.addToggleMenuItem('fullscreen', {
1160
- text: 'Fullscreen',
1161
- icon: 'fullscreen',
1162
- shortcut: 'Meta+Shift+F',
1163
- onAction,
1164
- onSetup: makeSetupHandler(editor, fullscreenState)
1165
- });
1166
- editor.ui.registry.addToggleButton('fullscreen', {
1167
- tooltip: 'Fullscreen',
1168
- icon: 'fullscreen',
1169
- onAction,
1170
- onSetup: makeSetupHandler(editor, fullscreenState)
1171
- });
1172
- };
1173
-
1174
- var Plugin = () => {
1175
- global$2.add('fullscreen', editor => {
1176
- const fullscreenState = Cell(null);
1177
- if (editor.inline) {
1178
- return get$5(fullscreenState);
1179
- }
1180
- register$2(editor);
1181
- register$1(editor, fullscreenState);
1182
- register(editor, fullscreenState);
1183
- editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen');
1184
- return get$5(fullscreenState);
1185
- });
1186
- };
1187
-
1188
- Plugin();
1189
-
1190
- })();