tinymce-rails 5.9.2 → 5.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +720 -1059
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -2
  8. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +2 -2
  10. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
  13. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +2 -2
  14. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +2 -2
  15. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +2 -2
  18. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
  19. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
  20. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
  22. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +2 -2
  23. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -2
  25. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +2 -2
  26. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
  27. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
  28. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
  29. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +2 -2
  33. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  37. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +2 -2
  39. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  41. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  42. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +2 -2
  43. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +2 -2
  44. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  48. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -1
  49. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -1
  50. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  51. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -1
  52. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  53. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  54. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.css +1 -1
  55. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -1
  56. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -1
  57. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -1
  58. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  59. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  60. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  61. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  62. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +1 -1
  63. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
  64. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
  65. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  66. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +9 -1
  67. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  68. metadata +2 -2
@@ -4,7 +4,7 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  (function () {
10
10
  'use strict';
@@ -1681,7 +1681,11 @@
1681
1681
 
1682
1682
  var get$7 = function (_win) {
1683
1683
  var win = _win === undefined ? window : _win;
1684
- return Optional.from(win['visualViewport']);
1684
+ if (detect().browser.isFirefox()) {
1685
+ return Optional.none();
1686
+ } else {
1687
+ return Optional.from(win['visualViewport']);
1688
+ }
1685
1689
  };
1686
1690
  var bounds = function (x, y, width, height) {
1687
1691
  return {
@@ -1974,499 +1978,217 @@
1974
1978
 
1975
1979
  var exports$1 = {}, module$1 = { exports: exports$1 };
1976
1980
  (function (define, exports, module, require) {
1977
- (function (f) {
1978
- if (typeof exports === 'object' && typeof module !== 'undefined') {
1979
- module.exports = f();
1980
- } else if (typeof define === 'function' && define.amd) {
1981
- define([], f);
1982
- } else {
1983
- var g;
1984
- if (typeof window !== 'undefined') {
1985
- g = window;
1986
- } else if (typeof global !== 'undefined') {
1987
- g = global;
1988
- } else if (typeof self !== 'undefined') {
1989
- g = self;
1990
- } else {
1991
- g = this;
1992
- }
1993
- g.EphoxContactWrapper = f();
1994
- }
1995
- }(function () {
1996
- return function () {
1997
- function r(e, n, t) {
1998
- function o(i, f) {
1999
- if (!n[i]) {
2000
- if (!e[i]) {
2001
- var c = 'function' == typeof require && require;
2002
- if (!f && c)
2003
- return c(i, !0);
2004
- if (u)
2005
- return u(i, !0);
2006
- var a = new Error('Cannot find module \'' + i + '\'');
2007
- throw a.code = 'MODULE_NOT_FOUND', a;
2008
- }
2009
- var p = n[i] = { exports: {} };
2010
- e[i][0].call(p.exports, function (r) {
2011
- var n = e[i][1][r];
2012
- return o(n || r);
2013
- }, p, p.exports, r, e, n, t);
2014
- }
2015
- return n[i].exports;
1981
+ (function (global, factory) {
1982
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EphoxContactWrapper = factory());
1983
+ }(this, function () {
1984
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1985
+ var promise = { exports: {} };
1986
+ (function (module) {
1987
+ (function (root) {
1988
+ var setTimeoutFunc = setTimeout;
1989
+ function noop() {
1990
+ }
1991
+ function bind(fn, thisArg) {
1992
+ return function () {
1993
+ fn.apply(thisArg, arguments);
1994
+ };
2016
1995
  }
2017
- for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)
2018
- o(t[i]);
2019
- return o;
2020
- }
2021
- return r;
2022
- }()({
2023
- 1: [
2024
- function (require, module, exports) {
2025
- var process = module.exports = {};
2026
- var cachedSetTimeout;
2027
- var cachedClearTimeout;
2028
- function defaultSetTimout() {
2029
- throw new Error('setTimeout has not been defined');
1996
+ function Promise(fn) {
1997
+ if (typeof this !== 'object')
1998
+ throw new TypeError('Promises must be constructed via new');
1999
+ if (typeof fn !== 'function')
2000
+ throw new TypeError('not a function');
2001
+ this._state = 0;
2002
+ this._handled = false;
2003
+ this._value = undefined;
2004
+ this._deferreds = [];
2005
+ doResolve(fn, this);
2006
+ }
2007
+ function handle(self, deferred) {
2008
+ while (self._state === 3) {
2009
+ self = self._value;
2030
2010
  }
2031
- function defaultClearTimeout() {
2032
- throw new Error('clearTimeout has not been defined');
2011
+ if (self._state === 0) {
2012
+ self._deferreds.push(deferred);
2013
+ return;
2033
2014
  }
2034
- (function () {
2035
- try {
2036
- if (typeof setTimeout === 'function') {
2037
- cachedSetTimeout = setTimeout;
2038
- } else {
2039
- cachedSetTimeout = defaultSetTimout;
2040
- }
2041
- } catch (e) {
2042
- cachedSetTimeout = defaultSetTimout;
2015
+ self._handled = true;
2016
+ Promise._immediateFn(function () {
2017
+ var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
2018
+ if (cb === null) {
2019
+ (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
2020
+ return;
2043
2021
  }
2022
+ var ret;
2044
2023
  try {
2045
- if (typeof clearTimeout === 'function') {
2046
- cachedClearTimeout = clearTimeout;
2047
- } else {
2048
- cachedClearTimeout = defaultClearTimeout;
2049
- }
2024
+ ret = cb(self._value);
2050
2025
  } catch (e) {
2051
- cachedClearTimeout = defaultClearTimeout;
2052
- }
2053
- }());
2054
- function runTimeout(fun) {
2055
- if (cachedSetTimeout === setTimeout) {
2056
- return setTimeout(fun, 0);
2057
- }
2058
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
2059
- cachedSetTimeout = setTimeout;
2060
- return setTimeout(fun, 0);
2026
+ reject(deferred.promise, e);
2027
+ return;
2061
2028
  }
2062
- try {
2063
- return cachedSetTimeout(fun, 0);
2064
- } catch (e) {
2065
- try {
2066
- return cachedSetTimeout.call(null, fun, 0);
2067
- } catch (e) {
2068
- return cachedSetTimeout.call(this, fun, 0);
2029
+ resolve(deferred.promise, ret);
2030
+ });
2031
+ }
2032
+ function resolve(self, newValue) {
2033
+ try {
2034
+ if (newValue === self)
2035
+ throw new TypeError('A promise cannot be resolved with itself.');
2036
+ if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
2037
+ var then = newValue.then;
2038
+ if (newValue instanceof Promise) {
2039
+ self._state = 3;
2040
+ self._value = newValue;
2041
+ finale(self);
2042
+ return;
2043
+ } else if (typeof then === 'function') {
2044
+ doResolve(bind(then, newValue), self);
2045
+ return;
2069
2046
  }
2070
2047
  }
2048
+ self._state = 1;
2049
+ self._value = newValue;
2050
+ finale(self);
2051
+ } catch (e) {
2052
+ reject(self, e);
2071
2053
  }
2072
- function runClearTimeout(marker) {
2073
- if (cachedClearTimeout === clearTimeout) {
2074
- return clearTimeout(marker);
2075
- }
2076
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
2077
- cachedClearTimeout = clearTimeout;
2078
- return clearTimeout(marker);
2079
- }
2080
- try {
2081
- return cachedClearTimeout(marker);
2082
- } catch (e) {
2083
- try {
2084
- return cachedClearTimeout.call(null, marker);
2085
- } catch (e) {
2086
- return cachedClearTimeout.call(this, marker);
2054
+ }
2055
+ function reject(self, newValue) {
2056
+ self._state = 2;
2057
+ self._value = newValue;
2058
+ finale(self);
2059
+ }
2060
+ function finale(self) {
2061
+ if (self._state === 2 && self._deferreds.length === 0) {
2062
+ Promise._immediateFn(function () {
2063
+ if (!self._handled) {
2064
+ Promise._unhandledRejectionFn(self._value);
2087
2065
  }
2088
- }
2066
+ });
2089
2067
  }
2090
- var queue = [];
2091
- var draining = false;
2092
- var currentQueue;
2093
- var queueIndex = -1;
2094
- function cleanUpNextTick() {
2095
- if (!draining || !currentQueue) {
2096
- return;
2097
- }
2098
- draining = false;
2099
- if (currentQueue.length) {
2100
- queue = currentQueue.concat(queue);
2101
- } else {
2102
- queueIndex = -1;
2103
- }
2104
- if (queue.length) {
2105
- drainQueue();
2106
- }
2068
+ for (var i = 0, len = self._deferreds.length; i < len; i++) {
2069
+ handle(self, self._deferreds[i]);
2107
2070
  }
2108
- function drainQueue() {
2109
- if (draining) {
2071
+ self._deferreds = null;
2072
+ }
2073
+ function Handler(onFulfilled, onRejected, promise) {
2074
+ this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
2075
+ this.onRejected = typeof onRejected === 'function' ? onRejected : null;
2076
+ this.promise = promise;
2077
+ }
2078
+ function doResolve(fn, self) {
2079
+ var done = false;
2080
+ try {
2081
+ fn(function (value) {
2082
+ if (done)
2083
+ return;
2084
+ done = true;
2085
+ resolve(self, value);
2086
+ }, function (reason) {
2087
+ if (done)
2088
+ return;
2089
+ done = true;
2090
+ reject(self, reason);
2091
+ });
2092
+ } catch (ex) {
2093
+ if (done)
2110
2094
  return;
2111
- }
2112
- var timeout = runTimeout(cleanUpNextTick);
2113
- draining = true;
2114
- var len = queue.length;
2115
- while (len) {
2116
- currentQueue = queue;
2117
- queue = [];
2118
- while (++queueIndex < len) {
2119
- if (currentQueue) {
2120
- currentQueue[queueIndex].run();
2121
- }
2122
- }
2123
- queueIndex = -1;
2124
- len = queue.length;
2125
- }
2126
- currentQueue = null;
2127
- draining = false;
2128
- runClearTimeout(timeout);
2095
+ done = true;
2096
+ reject(self, ex);
2129
2097
  }
2130
- process.nextTick = function (fun) {
2131
- var args = new Array(arguments.length - 1);
2132
- if (arguments.length > 1) {
2133
- for (var i = 1; i < arguments.length; i++) {
2134
- args[i - 1] = arguments[i];
2135
- }
2136
- }
2137
- queue.push(new Item(fun, args));
2138
- if (queue.length === 1 && !draining) {
2139
- runTimeout(drainQueue);
2140
- }
2141
- };
2142
- function Item(fun, array) {
2143
- this.fun = fun;
2144
- this.array = array;
2145
- }
2146
- Item.prototype.run = function () {
2147
- this.fun.apply(null, this.array);
2148
- };
2149
- process.title = 'browser';
2150
- process.browser = true;
2151
- process.env = {};
2152
- process.argv = [];
2153
- process.version = '';
2154
- process.versions = {};
2155
- function noop() {
2156
- }
2157
- process.on = noop;
2158
- process.addListener = noop;
2159
- process.once = noop;
2160
- process.off = noop;
2161
- process.removeListener = noop;
2162
- process.removeAllListeners = noop;
2163
- process.emit = noop;
2164
- process.prependListener = noop;
2165
- process.prependOnceListener = noop;
2166
- process.listeners = function (name) {
2167
- return [];
2168
- };
2169
- process.binding = function (name) {
2170
- throw new Error('process.binding is not supported');
2171
- };
2172
- process.cwd = function () {
2173
- return '/';
2174
- };
2175
- process.chdir = function (dir) {
2176
- throw new Error('process.chdir is not supported');
2177
- };
2178
- process.umask = function () {
2179
- return 0;
2180
- };
2181
- },
2182
- {}
2183
- ],
2184
- 2: [
2185
- function (require, module, exports) {
2186
- (function (setImmediate) {
2187
- (function (root) {
2188
- var setTimeoutFunc = setTimeout;
2189
- function noop() {
2190
- }
2191
- function bind(fn, thisArg) {
2192
- return function () {
2193
- fn.apply(thisArg, arguments);
2194
- };
2195
- }
2196
- function Promise(fn) {
2197
- if (typeof this !== 'object')
2198
- throw new TypeError('Promises must be constructed via new');
2199
- if (typeof fn !== 'function')
2200
- throw new TypeError('not a function');
2201
- this._state = 0;
2202
- this._handled = false;
2203
- this._value = undefined;
2204
- this._deferreds = [];
2205
- doResolve(fn, this);
2206
- }
2207
- function handle(self, deferred) {
2208
- while (self._state === 3) {
2209
- self = self._value;
2210
- }
2211
- if (self._state === 0) {
2212
- self._deferreds.push(deferred);
2213
- return;
2214
- }
2215
- self._handled = true;
2216
- Promise._immediateFn(function () {
2217
- var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
2218
- if (cb === null) {
2219
- (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
2220
- return;
2221
- }
2222
- var ret;
2223
- try {
2224
- ret = cb(self._value);
2225
- } catch (e) {
2226
- reject(deferred.promise, e);
2227
- return;
2228
- }
2229
- resolve(deferred.promise, ret);
2230
- });
2231
- }
2232
- function resolve(self, newValue) {
2233
- try {
2234
- if (newValue === self)
2235
- throw new TypeError('A promise cannot be resolved with itself.');
2236
- if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
2237
- var then = newValue.then;
2238
- if (newValue instanceof Promise) {
2239
- self._state = 3;
2240
- self._value = newValue;
2241
- finale(self);
2242
- return;
2243
- } else if (typeof then === 'function') {
2244
- doResolve(bind(then, newValue), self);
2245
- return;
2246
- }
2247
- }
2248
- self._state = 1;
2249
- self._value = newValue;
2250
- finale(self);
2251
- } catch (e) {
2252
- reject(self, e);
2253
- }
2254
- }
2255
- function reject(self, newValue) {
2256
- self._state = 2;
2257
- self._value = newValue;
2258
- finale(self);
2259
- }
2260
- function finale(self) {
2261
- if (self._state === 2 && self._deferreds.length === 0) {
2262
- Promise._immediateFn(function () {
2263
- if (!self._handled) {
2264
- Promise._unhandledRejectionFn(self._value);
2265
- }
2266
- });
2267
- }
2268
- for (var i = 0, len = self._deferreds.length; i < len; i++) {
2269
- handle(self, self._deferreds[i]);
2270
- }
2271
- self._deferreds = null;
2272
- }
2273
- function Handler(onFulfilled, onRejected, promise) {
2274
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
2275
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
2276
- this.promise = promise;
2277
- }
2278
- function doResolve(fn, self) {
2279
- var done = false;
2280
- try {
2281
- fn(function (value) {
2282
- if (done)
2283
- return;
2284
- done = true;
2285
- resolve(self, value);
2286
- }, function (reason) {
2287
- if (done)
2288
- return;
2289
- done = true;
2290
- reject(self, reason);
2291
- });
2292
- } catch (ex) {
2293
- if (done)
2098
+ }
2099
+ Promise.prototype['catch'] = function (onRejected) {
2100
+ return this.then(null, onRejected);
2101
+ };
2102
+ Promise.prototype.then = function (onFulfilled, onRejected) {
2103
+ var prom = new this.constructor(noop);
2104
+ handle(this, new Handler(onFulfilled, onRejected, prom));
2105
+ return prom;
2106
+ };
2107
+ Promise.all = function (arr) {
2108
+ var args = Array.prototype.slice.call(arr);
2109
+ return new Promise(function (resolve, reject) {
2110
+ if (args.length === 0)
2111
+ return resolve([]);
2112
+ var remaining = args.length;
2113
+ function res(i, val) {
2114
+ try {
2115
+ if (val && (typeof val === 'object' || typeof val === 'function')) {
2116
+ var then = val.then;
2117
+ if (typeof then === 'function') {
2118
+ then.call(val, function (val) {
2119
+ res(i, val);
2120
+ }, reject);
2294
2121
  return;
2295
- done = true;
2296
- reject(self, ex);
2297
- }
2298
- }
2299
- Promise.prototype['catch'] = function (onRejected) {
2300
- return this.then(null, onRejected);
2301
- };
2302
- Promise.prototype.then = function (onFulfilled, onRejected) {
2303
- var prom = new this.constructor(noop);
2304
- handle(this, new Handler(onFulfilled, onRejected, prom));
2305
- return prom;
2306
- };
2307
- Promise.all = function (arr) {
2308
- var args = Array.prototype.slice.call(arr);
2309
- return new Promise(function (resolve, reject) {
2310
- if (args.length === 0)
2311
- return resolve([]);
2312
- var remaining = args.length;
2313
- function res(i, val) {
2314
- try {
2315
- if (val && (typeof val === 'object' || typeof val === 'function')) {
2316
- var then = val.then;
2317
- if (typeof then === 'function') {
2318
- then.call(val, function (val) {
2319
- res(i, val);
2320
- }, reject);
2321
- return;
2322
- }
2323
- }
2324
- args[i] = val;
2325
- if (--remaining === 0) {
2326
- resolve(args);
2327
- }
2328
- } catch (ex) {
2329
- reject(ex);
2330
- }
2331
- }
2332
- for (var i = 0; i < args.length; i++) {
2333
- res(i, args[i]);
2334
2122
  }
2335
- });
2336
- };
2337
- Promise.resolve = function (value) {
2338
- if (value && typeof value === 'object' && value.constructor === Promise) {
2339
- return value;
2340
2123
  }
2341
- return new Promise(function (resolve) {
2342
- resolve(value);
2343
- });
2344
- };
2345
- Promise.reject = function (value) {
2346
- return new Promise(function (resolve, reject) {
2347
- reject(value);
2348
- });
2349
- };
2350
- Promise.race = function (values) {
2351
- return new Promise(function (resolve, reject) {
2352
- for (var i = 0, len = values.length; i < len; i++) {
2353
- values[i].then(resolve, reject);
2354
- }
2355
- });
2356
- };
2357
- Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
2358
- setImmediate(fn);
2359
- } : function (fn) {
2360
- setTimeoutFunc(fn, 0);
2361
- };
2362
- Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
2363
- if (typeof console !== 'undefined' && console) {
2364
- console.warn('Possible Unhandled Promise Rejection:', err);
2124
+ args[i] = val;
2125
+ if (--remaining === 0) {
2126
+ resolve(args);
2365
2127
  }
2366
- };
2367
- Promise._setImmediateFn = function _setImmediateFn(fn) {
2368
- Promise._immediateFn = fn;
2369
- };
2370
- Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
2371
- Promise._unhandledRejectionFn = fn;
2372
- };
2373
- if (typeof module !== 'undefined' && module.exports) {
2374
- module.exports = Promise;
2375
- } else if (!root.Promise) {
2376
- root.Promise = Promise;
2128
+ } catch (ex) {
2129
+ reject(ex);
2377
2130
  }
2378
- }(this));
2379
- }.call(this, require('timers').setImmediate));
2380
- },
2381
- { 'timers': 3 }
2382
- ],
2383
- 3: [
2384
- function (require, module, exports) {
2385
- (function (setImmediate, clearImmediate) {
2386
- var nextTick = require('process/browser.js').nextTick;
2387
- var apply = Function.prototype.apply;
2388
- var slice = Array.prototype.slice;
2389
- var immediateIds = {};
2390
- var nextImmediateId = 0;
2391
- exports.setTimeout = function () {
2392
- return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
2393
- };
2394
- exports.setInterval = function () {
2395
- return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
2396
- };
2397
- exports.clearTimeout = exports.clearInterval = function (timeout) {
2398
- timeout.close();
2399
- };
2400
- function Timeout(id, clearFn) {
2401
- this._id = id;
2402
- this._clearFn = clearFn;
2403
2131
  }
2404
- Timeout.prototype.unref = Timeout.prototype.ref = function () {
2405
- };
2406
- Timeout.prototype.close = function () {
2407
- this._clearFn.call(window, this._id);
2408
- };
2409
- exports.enroll = function (item, msecs) {
2410
- clearTimeout(item._idleTimeoutId);
2411
- item._idleTimeout = msecs;
2412
- };
2413
- exports.unenroll = function (item) {
2414
- clearTimeout(item._idleTimeoutId);
2415
- item._idleTimeout = -1;
2416
- };
2417
- exports._unrefActive = exports.active = function (item) {
2418
- clearTimeout(item._idleTimeoutId);
2419
- var msecs = item._idleTimeout;
2420
- if (msecs >= 0) {
2421
- item._idleTimeoutId = setTimeout(function onTimeout() {
2422
- if (item._onTimeout)
2423
- item._onTimeout();
2424
- }, msecs);
2425
- }
2426
- };
2427
- exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) {
2428
- var id = nextImmediateId++;
2429
- var args = arguments.length < 2 ? false : slice.call(arguments, 1);
2430
- immediateIds[id] = true;
2431
- nextTick(function onNextTick() {
2432
- if (immediateIds[id]) {
2433
- if (args) {
2434
- fn.apply(null, args);
2435
- } else {
2436
- fn.call(null);
2437
- }
2438
- exports.clearImmediate(id);
2439
- }
2440
- });
2441
- return id;
2442
- };
2443
- exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) {
2444
- delete immediateIds[id];
2445
- };
2446
- }.call(this, require('timers').setImmediate, require('timers').clearImmediate));
2447
- },
2448
- {
2449
- 'process/browser.js': 1,
2450
- 'timers': 3
2451
- }
2452
- ],
2453
- 4: [
2454
- function (require, module, exports) {
2455
- var promisePolyfill = require('promise-polyfill');
2456
- var Global = function () {
2457
- if (typeof window !== 'undefined') {
2458
- return window;
2459
- } else {
2460
- return Function('return this;')();
2132
+ for (var i = 0; i < args.length; i++) {
2133
+ res(i, args[i]);
2461
2134
  }
2462
- }();
2463
- module.exports = { boltExport: Global.Promise || promisePolyfill };
2464
- },
2465
- { 'promise-polyfill': 2 }
2466
- ]
2467
- }, {}, [4])(4);
2135
+ });
2136
+ };
2137
+ Promise.resolve = function (value) {
2138
+ if (value && typeof value === 'object' && value.constructor === Promise) {
2139
+ return value;
2140
+ }
2141
+ return new Promise(function (resolve) {
2142
+ resolve(value);
2143
+ });
2144
+ };
2145
+ Promise.reject = function (value) {
2146
+ return new Promise(function (resolve, reject) {
2147
+ reject(value);
2148
+ });
2149
+ };
2150
+ Promise.race = function (values) {
2151
+ return new Promise(function (resolve, reject) {
2152
+ for (var i = 0, len = values.length; i < len; i++) {
2153
+ values[i].then(resolve, reject);
2154
+ }
2155
+ });
2156
+ };
2157
+ Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
2158
+ setImmediate(fn);
2159
+ } : function (fn) {
2160
+ setTimeoutFunc(fn, 0);
2161
+ };
2162
+ Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
2163
+ if (typeof console !== 'undefined' && console) {
2164
+ console.warn('Possible Unhandled Promise Rejection:', err);
2165
+ }
2166
+ };
2167
+ Promise._setImmediateFn = function _setImmediateFn(fn) {
2168
+ Promise._immediateFn = fn;
2169
+ };
2170
+ Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
2171
+ Promise._unhandledRejectionFn = fn;
2172
+ };
2173
+ if (module.exports) {
2174
+ module.exports = Promise;
2175
+ } else if (!root.Promise) {
2176
+ root.Promise = Promise;
2177
+ }
2178
+ }(commonjsGlobal));
2179
+ }(promise));
2180
+ var promisePolyfill = promise.exports;
2181
+ var Global = function () {
2182
+ if (typeof window !== 'undefined') {
2183
+ return window;
2184
+ } else {
2185
+ return Function('return this;')();
2186
+ }
2187
+ }();
2188
+ var promisePolyfill_1 = { boltExport: Global.Promise || promisePolyfill };
2189
+ return promisePolyfill_1;
2468
2190
  }));
2469
- }(undefined, exports$1, module$1, undefined));
2191
+ }(undefined, exports$1, module$1));
2470
2192
  var Promise$1 = module$1.exports.boltExport;
2471
2193
 
2472
2194
  var nu$1 = function (baseFn) {
@@ -2882,183 +2604,7 @@
2882
2604
  return ClosestOrAncestor(is, ancestor$2, scope, selector, isRoot);
2883
2605
  };
2884
2606
 
2885
- var promise = function () {
2886
- var bind = function (fn, thisArg) {
2887
- return function () {
2888
- var args = [];
2889
- for (var _i = 0; _i < arguments.length; _i++) {
2890
- args[_i] = arguments[_i];
2891
- }
2892
- fn.apply(thisArg, args);
2893
- };
2894
- };
2895
- var isArray = Array.isArray || function (value) {
2896
- return Object.prototype.toString.call(value) === '[object Array]';
2897
- };
2898
- var Promise = function (fn) {
2899
- if (typeof this !== 'object') {
2900
- throw new TypeError('Promises must be constructed via new');
2901
- }
2902
- if (typeof fn !== 'function') {
2903
- throw new TypeError('not a function');
2904
- }
2905
- this._state = null;
2906
- this._value = null;
2907
- this._deferreds = [];
2908
- doResolve(fn, bind(resolve, this), bind(reject, this));
2909
- };
2910
- var asap = Promise.immediateFn || typeof setImmediate === 'function' && setImmediate || function (fn) {
2911
- return setTimeout(fn, 1);
2912
- };
2913
- function handle(deferred) {
2914
- var me = this;
2915
- if (this._state === null) {
2916
- this._deferreds.push(deferred);
2917
- return;
2918
- }
2919
- asap(function () {
2920
- var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
2921
- if (cb === null) {
2922
- (me._state ? deferred.resolve : deferred.reject)(me._value);
2923
- return;
2924
- }
2925
- var ret;
2926
- try {
2927
- ret = cb(me._value);
2928
- } catch (e) {
2929
- deferred.reject(e);
2930
- return;
2931
- }
2932
- deferred.resolve(ret);
2933
- });
2934
- }
2935
- function resolve(newValue) {
2936
- try {
2937
- if (newValue === this) {
2938
- throw new TypeError('A promise cannot be resolved with itself.');
2939
- }
2940
- if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
2941
- var then = newValue.then;
2942
- if (typeof then === 'function') {
2943
- doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
2944
- return;
2945
- }
2946
- }
2947
- this._state = true;
2948
- this._value = newValue;
2949
- finale.call(this);
2950
- } catch (e) {
2951
- reject.call(this, e);
2952
- }
2953
- }
2954
- function reject(newValue) {
2955
- this._state = false;
2956
- this._value = newValue;
2957
- finale.call(this);
2958
- }
2959
- function finale() {
2960
- for (var i = 0, len = this._deferreds.length; i < len; i++) {
2961
- handle.call(this, this._deferreds[i]);
2962
- }
2963
- this._deferreds = null;
2964
- }
2965
- function Handler(onFulfilled, onRejected, resolve, reject) {
2966
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
2967
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
2968
- this.resolve = resolve;
2969
- this.reject = reject;
2970
- }
2971
- var doResolve = function (fn, onFulfilled, onRejected) {
2972
- var done = false;
2973
- try {
2974
- fn(function (value) {
2975
- if (done) {
2976
- return;
2977
- }
2978
- done = true;
2979
- onFulfilled(value);
2980
- }, function (reason) {
2981
- if (done) {
2982
- return;
2983
- }
2984
- done = true;
2985
- onRejected(reason);
2986
- });
2987
- } catch (ex) {
2988
- if (done) {
2989
- return;
2990
- }
2991
- done = true;
2992
- onRejected(ex);
2993
- }
2994
- };
2995
- Promise.prototype.catch = function (onRejected) {
2996
- return this.then(null, onRejected);
2997
- };
2998
- Promise.prototype.then = function (onFulfilled, onRejected) {
2999
- var me = this;
3000
- return new Promise(function (resolve, reject) {
3001
- handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
3002
- });
3003
- };
3004
- Promise.all = function () {
3005
- var values = [];
3006
- for (var _i = 0; _i < arguments.length; _i++) {
3007
- values[_i] = arguments[_i];
3008
- }
3009
- var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);
3010
- return new Promise(function (resolve, reject) {
3011
- if (args.length === 0) {
3012
- return resolve([]);
3013
- }
3014
- var remaining = args.length;
3015
- var res = function (i, val) {
3016
- try {
3017
- if (val && (typeof val === 'object' || typeof val === 'function')) {
3018
- var then = val.then;
3019
- if (typeof then === 'function') {
3020
- then.call(val, function (val) {
3021
- res(i, val);
3022
- }, reject);
3023
- return;
3024
- }
3025
- }
3026
- args[i] = val;
3027
- if (--remaining === 0) {
3028
- resolve(args);
3029
- }
3030
- } catch (ex) {
3031
- reject(ex);
3032
- }
3033
- };
3034
- for (var i = 0; i < args.length; i++) {
3035
- res(i, args[i]);
3036
- }
3037
- });
3038
- };
3039
- Promise.resolve = function (value) {
3040
- if (value && typeof value === 'object' && value.constructor === Promise) {
3041
- return value;
3042
- }
3043
- return new Promise(function (resolve) {
3044
- resolve(value);
3045
- });
3046
- };
3047
- Promise.reject = function (value) {
3048
- return new Promise(function (resolve, reject) {
3049
- reject(value);
3050
- });
3051
- };
3052
- Promise.race = function (values) {
3053
- return new Promise(function (resolve, reject) {
3054
- for (var i = 0, len = values.length; i < len; i++) {
3055
- values[i].then(resolve, reject);
3056
- }
3057
- });
3058
- };
3059
- return Promise;
3060
- };
3061
- var promiseObj = window.Promise ? window.Promise : promise();
2607
+ var promiseObj = window.Promise ? window.Promise : Promise$1;
3062
2608
 
3063
2609
  var requestAnimationFramePromise;
3064
2610
  var requestAnimationFrame = function (callback, element) {
@@ -7010,7 +6556,7 @@
7010
6556
  var keepValues = settings.keep_values;
7011
6557
  var keepUrlHook = {
7012
6558
  set: function ($elm, value, name) {
7013
- if (settings.url_converter) {
6559
+ if (settings.url_converter && value !== null) {
7014
6560
  value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name, $elm[0]);
7015
6561
  }
7016
6562
  $elm.attr('data-mce-' + name, value).attr(name, value);
@@ -10851,8 +10397,8 @@
10851
10397
  var dom = editor.dom;
10852
10398
  var root = dom.getRoot();
10853
10399
  var format = formatList[0];
10854
- if (isBlockFormat(format) && !format.wrapper) {
10855
- node = dom.getParent(container, format.block, root);
10400
+ if (isBlockFormat(format)) {
10401
+ node = format.wrapper ? null : dom.getParent(container, format.block, root);
10856
10402
  }
10857
10403
  if (!node) {
10858
10404
  var scopeRoot = dom.getParent(container, 'LI,TD,TH');
@@ -11478,6 +11024,7 @@
11478
11024
  DELETE: 46,
11479
11025
  DOWN: 40,
11480
11026
  ENTER: 13,
11027
+ ESC: 27,
11481
11028
  LEFT: 37,
11482
11029
  RIGHT: 39,
11483
11030
  SPACEBAR: 32,
@@ -11712,7 +11259,10 @@
11712
11259
  };
11713
11260
  startScrollWidth = rootElement.scrollWidth;
11714
11261
  startScrollHeight = rootElement.scrollHeight;
11715
- resizeBackdrop = dom.add(rootElement, 'div', { class: 'mce-resize-backdrop' });
11262
+ resizeBackdrop = dom.add(rootElement, 'div', {
11263
+ 'class': 'mce-resize-backdrop',
11264
+ 'data-mce-bogus': 'all'
11265
+ });
11716
11266
  dom.setStyles(resizeBackdrop, {
11717
11267
  position: 'fixed',
11718
11268
  left: '0',
@@ -12378,7 +11928,7 @@
12378
11928
  };
12379
11929
  var createMarker = function (element, offset) {
12380
11930
  var startPoint = descend(element, offset);
12381
- var span = SugarElement.fromHtml('<span data-mce-bogus="all">' + ZWSP$1 + '</span>');
11931
+ var span = SugarElement.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">' + ZWSP$1 + '</span>');
12382
11932
  before$4(startPoint.element, span);
12383
11933
  return markerInfo(span, function () {
12384
11934
  return remove$7(span);
@@ -13378,17 +12928,24 @@
13378
12928
  }
13379
12929
  };
13380
12930
 
12931
+ var each$d = Tools.each, trim = Tools.trim;
12932
+ var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
12933
+ var DEFAULT_PORTS = {
12934
+ ftp: 21,
12935
+ http: 80,
12936
+ https: 443,
12937
+ mailto: 25
12938
+ };
13381
12939
  var safeSvgDataUrlElements = [
13382
12940
  'img',
13383
12941
  'video'
13384
12942
  ];
13385
- var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
13386
- var isValidPrefixAttrName = function (name) {
13387
- return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
13388
- };
13389
12943
  var blockSvgDataUris = function (allowSvgDataUrls, tagName) {
13390
- var allowed = isNullable(allowSvgDataUrls) ? contains$3(safeSvgDataUrlElements, tagName) : allowSvgDataUrls;
13391
- return !allowed;
12944
+ if (isNonNullable(allowSvgDataUrls)) {
12945
+ return !allowSvgDataUrls;
12946
+ } else {
12947
+ return isNonNullable(tagName) ? !contains$3(safeSvgDataUrlElements, tagName) : true;
12948
+ }
13392
12949
  };
13393
12950
  var isInvalidUri = function (settings, uri, tagName) {
13394
12951
  if (settings.allow_html_data_urls) {
@@ -13399,29 +12956,289 @@
13399
12956
  return /^data:/i.test(uri);
13400
12957
  }
13401
12958
  };
13402
- var findMatchingEndTagIndex = function (schema, html, startIndex) {
13403
- var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
13404
- var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
13405
- var shortEndedElements = schema.getShortEndedElements();
13406
- var count = 1, index = startIndex;
13407
- while (count !== 0) {
13408
- startTagRegExp.lastIndex = index;
13409
- while (true) {
13410
- var startMatch = startTagRegExp.exec(html);
13411
- if (startMatch === null) {
13412
- return index;
13413
- } else if (startMatch[1] === '!') {
13414
- if (startsWith(startMatch[2], '--')) {
13415
- index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
13416
- } else {
13417
- index = findCommentEndIndex(html, true, startMatch.index + 1);
13418
- }
13419
- break;
13420
- } else {
13421
- endTagRegExp.lastIndex = startTagRegExp.lastIndex;
13422
- var endMatch = endTagRegExp.exec(html);
13423
- if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
13424
- continue;
12959
+ var URI = function () {
12960
+ function URI(url, settings) {
12961
+ url = trim(url);
12962
+ this.settings = settings || {};
12963
+ var baseUri = this.settings.base_uri;
12964
+ var self = this;
12965
+ if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
12966
+ self.source = url;
12967
+ return;
12968
+ }
12969
+ var isProtocolRelative = url.indexOf('//') === 0;
12970
+ if (url.indexOf('/') === 0 && !isProtocolRelative) {
12971
+ url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
12972
+ }
12973
+ if (!/^[\w\-]*:?\/\//.test(url)) {
12974
+ var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
12975
+ if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
12976
+ url = '//mce_host' + self.toAbsPath(baseUrl, url);
12977
+ } else {
12978
+ var match = /([^#?]*)([#?]?.*)/.exec(url);
12979
+ url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
12980
+ }
12981
+ }
12982
+ url = url.replace(/@@/g, '(mce_at)');
12983
+ var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
12984
+ each$d(queryParts, function (v, i) {
12985
+ var part = urlMatch[i];
12986
+ if (part) {
12987
+ part = part.replace(/\(mce_at\)/g, '@@');
12988
+ }
12989
+ self[v] = part;
12990
+ });
12991
+ if (baseUri) {
12992
+ if (!self.protocol) {
12993
+ self.protocol = baseUri.protocol;
12994
+ }
12995
+ if (!self.userInfo) {
12996
+ self.userInfo = baseUri.userInfo;
12997
+ }
12998
+ if (!self.port && self.host === 'mce_host') {
12999
+ self.port = baseUri.port;
13000
+ }
13001
+ if (!self.host || self.host === 'mce_host') {
13002
+ self.host = baseUri.host;
13003
+ }
13004
+ self.source = '';
13005
+ }
13006
+ if (isProtocolRelative) {
13007
+ self.protocol = '';
13008
+ }
13009
+ }
13010
+ URI.parseDataUri = function (uri) {
13011
+ var type;
13012
+ var uriComponents = decodeURIComponent(uri).split(',');
13013
+ var matches = /data:([^;]+)/.exec(uriComponents[0]);
13014
+ if (matches) {
13015
+ type = matches[1];
13016
+ }
13017
+ return {
13018
+ type: type,
13019
+ data: uriComponents[1]
13020
+ };
13021
+ };
13022
+ URI.isDomSafe = function (uri, context, options) {
13023
+ if (options === void 0) {
13024
+ options = {};
13025
+ }
13026
+ if (options.allow_script_urls) {
13027
+ return true;
13028
+ } else {
13029
+ var decodedUri = Entities.decode(uri).replace(/[\s\u0000-\u001F]+/g, '');
13030
+ try {
13031
+ decodedUri = decodeURIComponent(decodedUri);
13032
+ } catch (ex) {
13033
+ decodedUri = unescape(decodedUri);
13034
+ }
13035
+ if (/((java|vb)script|mhtml):/i.test(decodedUri)) {
13036
+ return false;
13037
+ }
13038
+ return !isInvalidUri(options, decodedUri, context);
13039
+ }
13040
+ };
13041
+ URI.getDocumentBaseUrl = function (loc) {
13042
+ var baseUrl;
13043
+ if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
13044
+ baseUrl = loc.href;
13045
+ } else {
13046
+ baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
13047
+ }
13048
+ if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
13049
+ baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
13050
+ if (!/[\/\\]$/.test(baseUrl)) {
13051
+ baseUrl += '/';
13052
+ }
13053
+ }
13054
+ return baseUrl;
13055
+ };
13056
+ URI.prototype.setPath = function (path) {
13057
+ var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
13058
+ this.path = pathMatch[0];
13059
+ this.directory = pathMatch[1];
13060
+ this.file = pathMatch[2];
13061
+ this.source = '';
13062
+ this.getURI();
13063
+ };
13064
+ URI.prototype.toRelative = function (uri) {
13065
+ var output;
13066
+ if (uri === './') {
13067
+ return uri;
13068
+ }
13069
+ var relativeUri = new URI(uri, { base_uri: this });
13070
+ if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
13071
+ return relativeUri.getURI();
13072
+ }
13073
+ var tu = this.getURI(), uu = relativeUri.getURI();
13074
+ if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
13075
+ return tu;
13076
+ }
13077
+ output = this.toRelPath(this.path, relativeUri.path);
13078
+ if (relativeUri.query) {
13079
+ output += '?' + relativeUri.query;
13080
+ }
13081
+ if (relativeUri.anchor) {
13082
+ output += '#' + relativeUri.anchor;
13083
+ }
13084
+ return output;
13085
+ };
13086
+ URI.prototype.toAbsolute = function (uri, noHost) {
13087
+ var absoluteUri = new URI(uri, { base_uri: this });
13088
+ return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
13089
+ };
13090
+ URI.prototype.isSameOrigin = function (uri) {
13091
+ if (this.host == uri.host && this.protocol == uri.protocol) {
13092
+ if (this.port == uri.port) {
13093
+ return true;
13094
+ }
13095
+ var defaultPort = DEFAULT_PORTS[this.protocol];
13096
+ if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
13097
+ return true;
13098
+ }
13099
+ }
13100
+ return false;
13101
+ };
13102
+ URI.prototype.toRelPath = function (base, path) {
13103
+ var breakPoint = 0, out = '', i, l;
13104
+ var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
13105
+ var items = path.split('/');
13106
+ if (normalizedBase.length >= items.length) {
13107
+ for (i = 0, l = normalizedBase.length; i < l; i++) {
13108
+ if (i >= items.length || normalizedBase[i] !== items[i]) {
13109
+ breakPoint = i + 1;
13110
+ break;
13111
+ }
13112
+ }
13113
+ }
13114
+ if (normalizedBase.length < items.length) {
13115
+ for (i = 0, l = items.length; i < l; i++) {
13116
+ if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
13117
+ breakPoint = i + 1;
13118
+ break;
13119
+ }
13120
+ }
13121
+ }
13122
+ if (breakPoint === 1) {
13123
+ return path;
13124
+ }
13125
+ for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
13126
+ out += '../';
13127
+ }
13128
+ for (i = breakPoint - 1, l = items.length; i < l; i++) {
13129
+ if (i !== breakPoint - 1) {
13130
+ out += '/' + items[i];
13131
+ } else {
13132
+ out += items[i];
13133
+ }
13134
+ }
13135
+ return out;
13136
+ };
13137
+ URI.prototype.toAbsPath = function (base, path) {
13138
+ var i, nb = 0, o = [], outPath;
13139
+ var tr = /\/$/.test(path) ? '/' : '';
13140
+ var normalizedBase = base.split('/');
13141
+ var normalizedPath = path.split('/');
13142
+ each$d(normalizedBase, function (k) {
13143
+ if (k) {
13144
+ o.push(k);
13145
+ }
13146
+ });
13147
+ normalizedBase = o;
13148
+ for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
13149
+ if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
13150
+ continue;
13151
+ }
13152
+ if (normalizedPath[i] === '..') {
13153
+ nb++;
13154
+ continue;
13155
+ }
13156
+ if (nb > 0) {
13157
+ nb--;
13158
+ continue;
13159
+ }
13160
+ o.push(normalizedPath[i]);
13161
+ }
13162
+ i = normalizedBase.length - nb;
13163
+ if (i <= 0) {
13164
+ outPath = reverse(o).join('/');
13165
+ } else {
13166
+ outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
13167
+ }
13168
+ if (outPath.indexOf('/') !== 0) {
13169
+ outPath = '/' + outPath;
13170
+ }
13171
+ if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
13172
+ outPath += tr;
13173
+ }
13174
+ return outPath;
13175
+ };
13176
+ URI.prototype.getURI = function (noProtoHost) {
13177
+ if (noProtoHost === void 0) {
13178
+ noProtoHost = false;
13179
+ }
13180
+ var s;
13181
+ if (!this.source || noProtoHost) {
13182
+ s = '';
13183
+ if (!noProtoHost) {
13184
+ if (this.protocol) {
13185
+ s += this.protocol + '://';
13186
+ } else {
13187
+ s += '//';
13188
+ }
13189
+ if (this.userInfo) {
13190
+ s += this.userInfo + '@';
13191
+ }
13192
+ if (this.host) {
13193
+ s += this.host;
13194
+ }
13195
+ if (this.port) {
13196
+ s += ':' + this.port;
13197
+ }
13198
+ }
13199
+ if (this.path) {
13200
+ s += this.path;
13201
+ }
13202
+ if (this.query) {
13203
+ s += '?' + this.query;
13204
+ }
13205
+ if (this.anchor) {
13206
+ s += '#' + this.anchor;
13207
+ }
13208
+ this.source = s;
13209
+ }
13210
+ return this.source;
13211
+ };
13212
+ return URI;
13213
+ }();
13214
+
13215
+ var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
13216
+ var isValidPrefixAttrName = function (name) {
13217
+ return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
13218
+ };
13219
+ var findMatchingEndTagIndex = function (schema, html, startIndex) {
13220
+ var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
13221
+ var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
13222
+ var shortEndedElements = schema.getShortEndedElements();
13223
+ var count = 1, index = startIndex;
13224
+ while (count !== 0) {
13225
+ startTagRegExp.lastIndex = index;
13226
+ while (true) {
13227
+ var startMatch = startTagRegExp.exec(html);
13228
+ if (startMatch === null) {
13229
+ return index;
13230
+ } else if (startMatch[1] === '!') {
13231
+ if (startsWith(startMatch[2], '--')) {
13232
+ index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
13233
+ } else {
13234
+ index = findCommentEndIndex(html, true, startMatch.index + 1);
13235
+ }
13236
+ break;
13237
+ } else {
13238
+ endTagRegExp.lastIndex = startTagRegExp.lastIndex;
13239
+ var endMatch = endTagRegExp.exec(html);
13240
+ if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
13241
+ continue;
13425
13242
  }
13426
13243
  if (startMatch[1] === '/') {
13427
13244
  count -= 1;
@@ -13500,7 +13317,6 @@
13500
13317
  var anyAttributesRequired, attrValue, idCount = 0;
13501
13318
  var decode = Entities.decode;
13502
13319
  var filteredUrlAttrs = Tools.makeMap('src,href,data,background,action,formaction,poster,xlink:href');
13503
- var scriptUriRegExp = /((java|vb)script|mhtml):/i;
13504
13320
  var parsingMode = format === 'html' ? 0 : 1;
13505
13321
  var processEndTag = function (name) {
13506
13322
  var pos, i;
@@ -13547,21 +13363,19 @@
13547
13363
  return endIndex + 1;
13548
13364
  };
13549
13365
  var parseAttribute = function (tagName, name, value, val2, val3) {
13550
- var attrRule, i;
13551
- var trimRegExp = /[\s\u0000-\u001F]+/g;
13552
13366
  name = name.toLowerCase();
13553
13367
  value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || ''));
13554
13368
  if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
13555
- attrRule = validAttributesMap[name];
13369
+ var attrRule = validAttributesMap[name];
13556
13370
  if (!attrRule && validAttributePatterns) {
13557
- i = validAttributePatterns.length;
13558
- while (i--) {
13559
- attrRule = validAttributePatterns[i];
13371
+ var i_1 = validAttributePatterns.length;
13372
+ while (i_1--) {
13373
+ attrRule = validAttributePatterns[i_1];
13560
13374
  if (attrRule.pattern.test(name)) {
13561
13375
  break;
13562
13376
  }
13563
13377
  }
13564
- if (i === -1) {
13378
+ if (i_1 === -1) {
13565
13379
  attrRule = null;
13566
13380
  }
13567
13381
  }
@@ -13576,19 +13390,8 @@
13576
13390
  if (isNameOrId && tagName in filteredClobberElements && (value in doc || value in form)) {
13577
13391
  return;
13578
13392
  }
13579
- if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
13580
- var uri = value.replace(trimRegExp, '');
13581
- try {
13582
- uri = decodeURIComponent(uri);
13583
- } catch (ex) {
13584
- uri = unescape(uri);
13585
- }
13586
- if (scriptUriRegExp.test(uri)) {
13587
- return;
13588
- }
13589
- if (isInvalidUri(settings, uri, tagName)) {
13590
- return;
13591
- }
13393
+ if (filteredUrlAttrs[name] && !URI.isDomSafe(value, tagName, settings)) {
13394
+ return;
13592
13395
  }
13593
13396
  if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
13594
13397
  return;
@@ -13881,7 +13684,7 @@
13881
13684
  });
13882
13685
  };
13883
13686
 
13884
- var each$d = Tools.each;
13687
+ var each$c = Tools.each;
13885
13688
  var ElementUtils = function (dom) {
13886
13689
  var compare = function (node1, node2) {
13887
13690
  if (node1.nodeName !== node2.nodeName) {
@@ -13889,7 +13692,7 @@
13889
13692
  }
13890
13693
  var getAttribs = function (node) {
13891
13694
  var attribs = {};
13892
- each$d(dom.getAttribs(node), function (attr) {
13695
+ each$c(dom.getAttribs(node), function (attr) {
13893
13696
  var name = attr.nodeName.toLowerCase();
13894
13697
  if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
13895
13698
  attribs[name] = dom.getAttrib(node, name);
@@ -14899,48 +14702,80 @@
14899
14702
  }
14900
14703
  });
14901
14704
  };
14902
- var setCursorInCell = function (editor, cell) {
14705
+ var deleteContentInsideCell = function (editor, cell, rng, isFirstCellInSelection) {
14706
+ var insideTableRng = rng.cloneRange();
14707
+ if (isFirstCellInSelection) {
14708
+ insideTableRng.setStart(rng.startContainer, rng.startOffset);
14709
+ insideTableRng.setEndAfter(cell.dom.lastChild);
14710
+ } else {
14711
+ insideTableRng.setStartBefore(cell.dom.firstChild);
14712
+ insideTableRng.setEnd(rng.endContainer, rng.endOffset);
14713
+ }
14714
+ deleteCellContents(editor, insideTableRng, cell, false);
14715
+ };
14716
+ var collapseAndRestoreCellSelection = function (editor) {
14903
14717
  var selectedCells = getCellsFromEditor(editor);
14904
- editor.selection.setCursorLocation(cell.dom, 0);
14905
- if (selectedCells.length > 1) {
14906
- set$1(cell, 'data-mce-selected', '1');
14718
+ var selectedNode = SugarElement.fromDom(editor.selection.getNode());
14719
+ if (isTableCell$5(selectedNode.dom) && isEmpty$2(selectedNode)) {
14720
+ editor.selection.setCursorLocation(selectedNode.dom, 0);
14721
+ } else {
14722
+ editor.selection.collapse(true);
14723
+ }
14724
+ if (selectedCells.length > 1 && exists(selectedCells, function (cell) {
14725
+ return eq(cell, selectedNode);
14726
+ })) {
14727
+ set$1(selectedNode, 'data-mce-selected', '1');
14907
14728
  }
14908
14729
  };
14909
14730
  var emptySingleTableCells = function (editor, cells, outsideDetails) {
14910
- cleanCells(cells);
14911
- outsideDetails.map(function (_a) {
14731
+ var editorRng = editor.selection.getRng();
14732
+ var cellsToClean = outsideDetails.bind(function (_a) {
14912
14733
  var rng = _a.rng, isStartInTable = _a.isStartInTable;
14913
14734
  var outsideBlock = getOutsideBlock(editor, isStartInTable ? rng.endContainer : rng.startContainer);
14914
14735
  rng.deleteContents();
14915
14736
  handleEmptyBlock(editor, isStartInTable, outsideBlock.filter(isEmpty$2));
14916
- });
14917
- if (outsideDetails.forall(function (details) {
14918
- return details.isStartInTable;
14919
- })) {
14920
- setCursorInCell(editor, cells[0]);
14921
- } else {
14922
- editor.selection.collapse(true);
14923
- }
14737
+ var endPointCell = isStartInTable ? cells[0] : cells[cells.length - 1];
14738
+ deleteContentInsideCell(editor, endPointCell, editorRng, isStartInTable);
14739
+ if (!isEmpty$2(endPointCell)) {
14740
+ return Optional.some(isStartInTable ? cells.slice(1) : cells.slice(0, -1));
14741
+ } else {
14742
+ return Optional.none();
14743
+ }
14744
+ }).getOr(cells);
14745
+ cleanCells(cellsToClean);
14746
+ collapseAndRestoreCellSelection(editor);
14924
14747
  return true;
14925
14748
  };
14926
14749
  var emptyMultiTableCells = function (editor, startTableCells, endTableCells, betweenRng) {
14927
- cleanCells(startTableCells.concat(endTableCells));
14750
+ var rng = editor.selection.getRng();
14751
+ var startCell = startTableCells[0];
14752
+ var endCell = endTableCells[endTableCells.length - 1];
14753
+ deleteContentInsideCell(editor, startCell, rng, true);
14754
+ deleteContentInsideCell(editor, endCell, rng, false);
14755
+ var startTableCellsToClean = isEmpty$2(startCell) ? startTableCells : startTableCells.slice(1);
14756
+ var endTableCellsToClean = isEmpty$2(endCell) ? endTableCells : endTableCells.slice(0, -1);
14757
+ cleanCells(startTableCellsToClean.concat(endTableCellsToClean));
14928
14758
  betweenRng.deleteContents();
14929
- setCursorInCell(editor, startTableCells[0]);
14759
+ collapseAndRestoreCellSelection(editor);
14930
14760
  return true;
14931
14761
  };
14932
- var deleteCellContents = function (editor, rng, cell) {
14762
+ var deleteCellContents = function (editor, rng, cell, moveSelection) {
14763
+ if (moveSelection === void 0) {
14764
+ moveSelection = true;
14765
+ }
14933
14766
  rng.deleteContents();
14934
14767
  var lastNode = freefallRtl(cell).getOr(cell);
14935
14768
  var lastBlock = SugarElement.fromDom(editor.dom.getParent(lastNode.dom, editor.dom.isBlock));
14936
14769
  if (isEmpty$2(lastBlock)) {
14937
14770
  fillWithPaddingBr(lastBlock);
14938
- editor.selection.setCursorLocation(lastBlock.dom, 0);
14771
+ if (moveSelection) {
14772
+ editor.selection.setCursorLocation(lastBlock.dom, 0);
14773
+ }
14939
14774
  }
14940
14775
  if (!eq(cell, lastBlock)) {
14941
14776
  var additionalCleanupNodes = is$1(parent(lastBlock), cell) ? [] : siblings(lastBlock);
14942
14777
  each$k(additionalCleanupNodes.concat(children(cell)), function (node) {
14943
- if (!eq(node, lastBlock) && !contains$1(node, lastBlock)) {
14778
+ if (!eq(node, lastBlock) && !contains$1(node, lastBlock) && isEmpty$2(node)) {
14944
14779
  remove$7(node);
14945
14780
  }
14946
14781
  });
@@ -15285,23 +15120,14 @@
15285
15120
  var nextRng;
15286
15121
  var dom = editor.dom;
15287
15122
  var selection = editor.selection;
15288
- var getContentEditableFalseParent = function (node) {
15289
- var root = editor.getBody();
15290
- for (; node && node !== root; node = node.parentNode) {
15291
- if (dom.getContentEditable(node) === 'false') {
15292
- return node;
15293
- }
15294
- }
15295
- return null;
15296
- };
15297
15123
  if (!marker) {
15298
15124
  return;
15299
15125
  }
15300
15126
  selection.scrollIntoView(marker);
15301
- var parentEditableFalseElm = getContentEditableFalseParent(marker);
15302
- if (parentEditableFalseElm) {
15127
+ var parentEditableElm = getContentEditableRoot$1(editor.getBody(), marker);
15128
+ if (dom.getContentEditable(parentEditableElm) === 'false') {
15303
15129
  dom.remove(marker);
15304
- selection.select(parentEditableFalseElm);
15130
+ selection.select(parentEditableElm);
15305
15131
  return;
15306
15132
  }
15307
15133
  var rng = dom.createRng();
@@ -16047,7 +15873,7 @@
16047
15873
 
16048
15874
  var postProcessHooks = {};
16049
15875
  var filter = filter$2;
16050
- var each$c = each$i;
15876
+ var each$b = each$i;
16051
15877
  var addPostProcessHook = function (name, hook) {
16052
15878
  var hooks = postProcessHooks[name];
16053
15879
  if (!hooks) {
@@ -16056,7 +15882,7 @@
16056
15882
  postProcessHooks[name].push(hook);
16057
15883
  };
16058
15884
  var postProcess$1 = function (name, editor) {
16059
- each$c(postProcessHooks[name], function (hook) {
15885
+ each$b(postProcessHooks[name], function (hook) {
16060
15886
  hook(editor);
16061
15887
  });
16062
15888
  };
@@ -16073,13 +15899,13 @@
16073
15899
  var isPre = matchNodeNames(['pre']);
16074
15900
  if (!rng.collapsed) {
16075
15901
  blocks = editor.selection.getSelectedBlocks();
16076
- each$c(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
15902
+ each$b(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
16077
15903
  joinPre(pre.previousSibling, pre);
16078
15904
  });
16079
15905
  }
16080
15906
  });
16081
15907
 
16082
- var each$b = Tools.each;
15908
+ var each$a = Tools.each;
16083
15909
  var isElementNode$1 = function (node) {
16084
15910
  return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
16085
15911
  };
@@ -16123,9 +15949,9 @@
16123
15949
  var clearChildStyles = function (dom, format, node) {
16124
15950
  if (format.clear_child_styles) {
16125
15951
  var selector = format.links ? '*:not(a)' : '*';
16126
- each$b(dom.select(selector, node), function (node) {
15952
+ each$a(dom.select(selector, node), function (node) {
16127
15953
  if (isElementNode$1(node)) {
16128
- each$b(format.styles, function (value, name) {
15954
+ each$a(format.styles, function (value, name) {
16129
15955
  dom.setStyle(node, name, '');
16130
15956
  });
16131
15957
  }
@@ -16133,7 +15959,7 @@
16133
15959
  }
16134
15960
  };
16135
15961
  var processChildElements = function (node, filter, process) {
16136
- each$b(node.childNodes, function (node) {
15962
+ each$a(node.childNodes, function (node) {
16137
15963
  if (isElementNode$1(node)) {
16138
15964
  if (filter(node)) {
16139
15965
  process(node);
@@ -16170,7 +15996,7 @@
16170
15996
  { removed: [] }
16171
15997
  ]);
16172
15998
  var MCE_ATTR_RE = /^(src|href|style)$/;
16173
- var each$a = Tools.each;
15999
+ var each$9 = Tools.each;
16174
16000
  var isEq$2 = isEq$5;
16175
16001
  var isTableCellOrRow = function (node) {
16176
16002
  return /^(TR|TH|TD)$/.test(node.nodeName);
@@ -16304,7 +16130,7 @@
16304
16130
  }
16305
16131
  }
16306
16132
  if (format.remove !== 'all') {
16307
- each$a(format.styles, function (value, name) {
16133
+ each$9(format.styles, function (value, name) {
16308
16134
  value = normalizeStyleValue(dom, replaceVars(value, vars), name + '');
16309
16135
  if (isNumber(name)) {
16310
16136
  name = value;
@@ -16319,7 +16145,7 @@
16319
16145
  elm.removeAttribute('style');
16320
16146
  elm.removeAttribute('data-mce-style');
16321
16147
  }
16322
- each$a(format.attributes, function (value, name) {
16148
+ each$9(format.attributes, function (value, name) {
16323
16149
  var valueOut;
16324
16150
  value = replaceVars(value, vars);
16325
16151
  if (isNumber(name)) {
@@ -16356,7 +16182,7 @@
16356
16182
  elm.removeAttribute(name);
16357
16183
  }
16358
16184
  });
16359
- each$a(format.classes, function (value) {
16185
+ each$9(format.classes, function (value) {
16360
16186
  value = replaceVars(value, vars);
16361
16187
  if (!compareNode || dom.hasClass(compareNode, value)) {
16362
16188
  dom.removeClass(elm, value);
@@ -16609,7 +16435,7 @@
16609
16435
  fireFormatRemove(ed, name, node, vars);
16610
16436
  };
16611
16437
 
16612
- var each$9 = Tools.each;
16438
+ var each$8 = Tools.each;
16613
16439
  var mergeTextDecorationsAndColor = function (dom, format, vars, node) {
16614
16440
  var processTextDecorationsAndColor = function (n) {
16615
16441
  if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) {
@@ -16638,9 +16464,9 @@
16638
16464
  }
16639
16465
  };
16640
16466
  var mergeWithChildren = function (editor, formatList, vars, node) {
16641
- each$9(formatList, function (format) {
16467
+ each$8(formatList, function (format) {
16642
16468
  if (isInlineFormat(format)) {
16643
- each$9(editor.dom.select(format.inline, node), function (child) {
16469
+ each$8(editor.dom.select(format.inline, node), function (child) {
16644
16470
  if (!isElementNode$1(child)) {
16645
16471
  return;
16646
16472
  }
@@ -16666,7 +16492,7 @@
16666
16492
  }
16667
16493
  };
16668
16494
 
16669
- var each$8 = Tools.each;
16495
+ var each$7 = Tools.each;
16670
16496
  var isElementNode = function (node) {
16671
16497
  return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
16672
16498
  };
@@ -16704,7 +16530,7 @@
16704
16530
  if (isFunction(fmt.onformat)) {
16705
16531
  fmt.onformat(elm, fmt, vars, node);
16706
16532
  }
16707
- each$8(fmt.styles, function (value, name) {
16533
+ each$7(fmt.styles, function (value, name) {
16708
16534
  dom.setStyle(elm, name, replaceVars(value, vars));
16709
16535
  });
16710
16536
  if (fmt.styles) {
@@ -16713,10 +16539,10 @@
16713
16539
  dom.setAttrib(elm, 'data-mce-style', styleVal);
16714
16540
  }
16715
16541
  }
16716
- each$8(fmt.attributes, function (value, name) {
16542
+ each$7(fmt.attributes, function (value, name) {
16717
16543
  dom.setAttrib(elm, name, replaceVars(value, vars));
16718
16544
  });
16719
- each$8(fmt.classes, function (value) {
16545
+ each$7(fmt.classes, function (value) {
16720
16546
  value = replaceVars(value, vars);
16721
16547
  if (!dom.hasClass(elm, value)) {
16722
16548
  dom.addClass(elm, value);
@@ -16725,7 +16551,7 @@
16725
16551
  };
16726
16552
  var applyNodeStyle = function (formatList, node) {
16727
16553
  var found = false;
16728
- each$8(formatList, function (format) {
16554
+ each$7(formatList, function (format) {
16729
16555
  if (!isSelectorFormat(format)) {
16730
16556
  return false;
16731
16557
  }
@@ -18246,29 +18072,36 @@
18246
18072
  function SelectorChanged (dom, editor) {
18247
18073
  var selectorChangedData;
18248
18074
  var currentSelectors;
18075
+ var findMatchingNode = function (selector, nodes) {
18076
+ return find$3(nodes, function (node) {
18077
+ return dom.is(node, selector);
18078
+ });
18079
+ };
18080
+ var getParents = function (elem) {
18081
+ return dom.getParents(elem, null, dom.getRoot());
18082
+ };
18249
18083
  return {
18250
18084
  selectorChangedWithUnbind: function (selector, callback) {
18251
18085
  if (!selectorChangedData) {
18252
18086
  selectorChangedData = {};
18253
18087
  currentSelectors = {};
18254
18088
  editor.on('NodeChange', function (e) {
18255
- var node = e.element, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
18089
+ var node = e.element;
18090
+ var parents = getParents(node);
18091
+ var matchedSelectors = {};
18256
18092
  Tools.each(selectorChangedData, function (callbacks, selector) {
18257
- Tools.each(parents, function (node) {
18258
- if (dom.is(node, selector)) {
18259
- if (!currentSelectors[selector]) {
18260
- Tools.each(callbacks, function (callback) {
18261
- callback(true, {
18262
- node: node,
18263
- selector: selector,
18264
- parents: parents
18265
- });
18093
+ findMatchingNode(selector, parents).each(function (node) {
18094
+ if (!currentSelectors[selector]) {
18095
+ each$k(callbacks, function (callback) {
18096
+ callback(true, {
18097
+ node: node,
18098
+ selector: selector,
18099
+ parents: parents
18266
18100
  });
18267
- currentSelectors[selector] = callbacks;
18268
- }
18269
- matchedSelectors[selector] = callbacks;
18270
- return false;
18101
+ });
18102
+ currentSelectors[selector] = callbacks;
18271
18103
  }
18104
+ matchedSelectors[selector] = callbacks;
18272
18105
  });
18273
18106
  });
18274
18107
  Tools.each(currentSelectors, function (callbacks, selector) {
@@ -18289,6 +18122,9 @@
18289
18122
  selectorChangedData[selector] = [];
18290
18123
  }
18291
18124
  selectorChangedData[selector].push(callback);
18125
+ findMatchingNode(selector, getParents(editor.selection.getStart())).each(function () {
18126
+ currentSelectors[selector] = selectorChangedData[selector];
18127
+ });
18292
18128
  return {
18293
18129
  unbind: function () {
18294
18130
  deleteFromCallbackMap(selectorChangedData, selector, callback);
@@ -18522,7 +18358,11 @@
18522
18358
  return scrollContainer;
18523
18359
  };
18524
18360
  var scrollIntoView = function (elm, alignToTop) {
18525
- return scrollElementIntoView(editor, elm, alignToTop);
18361
+ if (isNonNullable(elm)) {
18362
+ scrollElementIntoView(editor, elm, alignToTop);
18363
+ } else {
18364
+ scrollRangeIntoView(editor, getRng$1(), alignToTop);
18365
+ }
18526
18366
  };
18527
18367
  var placeCaretAt = function (clientX, clientY) {
18528
18368
  return setRng(fromPoint(clientX, clientY, editor.getDoc()));
@@ -19045,7 +18885,7 @@
19045
18885
  registerBase64ImageFilter(parser, settings);
19046
18886
  };
19047
18887
 
19048
- var makeMap = Tools.makeMap, each$7 = Tools.each, explode$2 = Tools.explode, extend$4 = Tools.extend;
18888
+ var makeMap = Tools.makeMap, each$6 = Tools.each, explode$2 = Tools.explode, extend$4 = Tools.extend;
19049
18889
  var DomParser = function (settings, schema) {
19050
18890
  if (schema === void 0) {
19051
18891
  schema = Schema();
@@ -19185,7 +19025,7 @@
19185
19025
  return node;
19186
19026
  };
19187
19027
  var addNodeFilter = function (name, callback) {
19188
- each$7(explode$2(name), function (name) {
19028
+ each$6(explode$2(name), function (name) {
19189
19029
  var list = nodeFilters[name];
19190
19030
  if (!list) {
19191
19031
  nodeFilters[name] = list = [];
@@ -19206,7 +19046,7 @@
19206
19046
  return out;
19207
19047
  };
19208
19048
  var addAttributeFilter = function (name, callback) {
19209
- each$7(explode$2(name), function (name) {
19049
+ each$6(explode$2(name), function (name) {
19210
19050
  var i;
19211
19051
  for (i = 0; i < attributeFilters.length; i++) {
19212
19052
  if (attributeFilters[i].name === name) {
@@ -19920,6 +19760,44 @@
19920
19760
  };
19921
19761
  var deepMerge = baseMerge(deep);
19922
19762
 
19763
+ var deprecatedSettings = ('autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,' + 'boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,' + 'force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,' + 'non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,' + 'tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,' + 'paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists').split(',');
19764
+ var deprecatedPlugins = 'bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor'.split(',');
19765
+ var movedToPremiumPlugins = 'imagetools,toc'.split(',');
19766
+ var getDeprecatedSettings = function (settings) {
19767
+ var settingNames = filter$4(deprecatedSettings, function (setting) {
19768
+ return has$2(settings, setting);
19769
+ });
19770
+ var forcedRootBlock = settings.forced_root_block;
19771
+ if (forcedRootBlock === false || forcedRootBlock === '') {
19772
+ settingNames.push('forced_root_block (false only)');
19773
+ }
19774
+ return sort(settingNames);
19775
+ };
19776
+ var getDeprecatedPlugins = function (settings) {
19777
+ var plugins = Tools.makeMap(settings.plugins, ' ');
19778
+ var hasPlugin = function (plugin) {
19779
+ return has$2(plugins, plugin);
19780
+ };
19781
+ var pluginNames = __spreadArray(__spreadArray([], filter$4(deprecatedPlugins, hasPlugin), true), bind(movedToPremiumPlugins, function (plugin) {
19782
+ return hasPlugin(plugin) ? [plugin + ' (moving to premium)'] : [];
19783
+ }), true);
19784
+ return sort(pluginNames);
19785
+ };
19786
+ var logDeprecationsWarning = function (rawSettings, finalSettings) {
19787
+ var deprecatedSettings = getDeprecatedSettings(rawSettings);
19788
+ var deprecatedPlugins = getDeprecatedPlugins(finalSettings);
19789
+ var hasDeprecatedPlugins = deprecatedPlugins.length > 0;
19790
+ var hasDeprecatedSettings = deprecatedSettings.length > 0;
19791
+ var isLegacyMobileTheme = finalSettings.theme === 'mobile';
19792
+ if (hasDeprecatedPlugins || hasDeprecatedSettings || isLegacyMobileTheme) {
19793
+ var listJoiner = '\n- ';
19794
+ var themesMessage = isLegacyMobileTheme ? '\n\nThemes:' + listJoiner + 'mobile' : '';
19795
+ var pluginsMessage = hasDeprecatedPlugins ? '\n\nPlugins:' + listJoiner + deprecatedPlugins.join(listJoiner) : '';
19796
+ var settingsMessage = hasDeprecatedSettings ? '\n\nSettings:' + listJoiner + deprecatedSettings.join(listJoiner) : '';
19797
+ console.warn('The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. ' + 'See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information.' + themesMessage + pluginsMessage + settingsMessage);
19798
+ }
19799
+ };
19800
+
19923
19801
  var sectionResult = function (sections, settings) {
19924
19802
  return {
19925
19803
  sections: constant(sections),
@@ -20066,7 +19944,11 @@
20066
19944
  };
20067
19945
  var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
20068
19946
  var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor);
20069
- return combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings);
19947
+ var finalSettings = combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings);
19948
+ if (finalSettings.deprecation_warnings !== false) {
19949
+ logDeprecationsWarning(settings, finalSettings);
19950
+ }
19951
+ return finalSettings;
20070
19952
  };
20071
19953
  var getFiltered = function (predicate, editor, name) {
20072
19954
  return Optional.from(editor.settings[name]).filter(predicate);
@@ -20267,8 +20149,9 @@
20267
20149
  timeout: 0
20268
20150
  }, false);
20269
20151
  }
20152
+ reposition();
20270
20153
  });
20271
- editor.on('ResizeEditor ResizeWindow NodeChange', function () {
20154
+ editor.on('show ResizeEditor ResizeWindow NodeChange', function () {
20272
20155
  Delay.requestAnimationFrame(reposition);
20273
20156
  });
20274
20157
  editor.on('remove', function () {
@@ -20440,9 +20323,9 @@
20440
20323
  var console = window.console;
20441
20324
  if (console) {
20442
20325
  if (console.error) {
20443
- console.error.apply(console, __spreadArray([message], x));
20326
+ console.error.apply(console, __spreadArray([message], x, false));
20444
20327
  } else {
20445
- console.log.apply(console, __spreadArray([message], x));
20328
+ console.log.apply(console, __spreadArray([message], x, false));
20446
20329
  }
20447
20330
  }
20448
20331
  };
@@ -21374,7 +21257,7 @@
21374
21257
  };
21375
21258
  };
21376
21259
 
21377
- var each$6 = Tools.each;
21260
+ var each$5 = Tools.each;
21378
21261
  var dom = DOMUtils.DOM;
21379
21262
  var parsedSelectorToHtml = function (ancestry, editor) {
21380
21263
  var elm, item, fragment;
@@ -21535,19 +21418,19 @@
21535
21418
  previewFrag = parsedSelectorToHtml([name], editor);
21536
21419
  }
21537
21420
  var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild;
21538
- each$6(format.styles, function (value, name) {
21421
+ each$5(format.styles, function (value, name) {
21539
21422
  var newValue = removeVars(value);
21540
21423
  if (newValue) {
21541
21424
  dom.setStyle(previewElm, name, newValue);
21542
21425
  }
21543
21426
  });
21544
- each$6(format.attributes, function (value, name) {
21427
+ each$5(format.attributes, function (value, name) {
21545
21428
  var newValue = removeVars(value);
21546
21429
  if (newValue) {
21547
21430
  dom.setAttrib(previewElm, name, newValue);
21548
21431
  }
21549
21432
  });
21550
- each$6(format.classes, function (value) {
21433
+ each$5(format.classes, function (value) {
21551
21434
  var newValue = removeVars(value);
21552
21435
  if (!dom.hasClass(previewElm, newValue)) {
21553
21436
  dom.addClass(previewElm, newValue);
@@ -21561,7 +21444,7 @@
21561
21444
  editor.getBody().appendChild(previewFrag);
21562
21445
  parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
21563
21446
  parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
21564
- each$6(previewStyles.split(' '), function (name) {
21447
+ each$5(previewStyles.split(' '), function (name) {
21565
21448
  var value = dom.getStyle(previewElm, name, true);
21566
21449
  if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
21567
21450
  value = dom.getStyle(editor.getBody(), name, true);
@@ -23000,17 +22883,23 @@
23000
22883
  var isInsideY = function (clientY, clientRect) {
23001
22884
  return clientY >= clientRect.top && clientY <= clientRect.bottom;
23002
22885
  };
23003
- var findClosestClientRect = function (clientRects, clientX) {
22886
+ var isNodeClientRect = function (rect) {
22887
+ return hasNonNullableKey(rect, 'node');
22888
+ };
22889
+ var findClosestClientRect = function (clientRects, clientX, allowInside) {
22890
+ if (allowInside === void 0) {
22891
+ allowInside = always;
22892
+ }
23004
22893
  return reduce(clientRects, function (oldClientRect, clientRect) {
23005
- var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
23006
- var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
23007
22894
  if (isInsideX(clientX, clientRect)) {
23008
- return clientRect;
22895
+ return allowInside(clientRect) ? clientRect : oldClientRect;
23009
22896
  }
23010
22897
  if (isInsideX(clientX, oldClientRect)) {
23011
- return oldClientRect;
22898
+ return allowInside(oldClientRect) ? oldClientRect : clientRect;
23012
22899
  }
23013
- if (newDistance === oldDistance && isContentEditableFalse$3(clientRect.node)) {
22900
+ var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
22901
+ var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
22902
+ if (newDistance === oldDistance && isNodeClientRect(clientRect) && isContentEditableFalse$3(clientRect.node)) {
23014
22903
  return clientRect;
23015
22904
  }
23016
22905
  if (newDistance < oldDistance) {
@@ -23056,10 +22945,13 @@
23056
22945
  var closestFakeCaret = function (root, clientX, clientY) {
23057
22946
  var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root));
23058
22947
  var targetNodeRects = filter$4(fakeTargetNodeRects, curry(isInsideY, clientY));
23059
- var closestNodeRect = findClosestClientRect(targetNodeRects, clientX);
22948
+ var checkInside = function (clientRect) {
22949
+ return !isTable$3(clientRect.node) && !isMedia$2(clientRect.node);
22950
+ };
22951
+ var closestNodeRect = findClosestClientRect(targetNodeRects, clientX, checkInside);
23060
22952
  if (closestNodeRect) {
23061
- var includeChildren = !isTable$3(closestNodeRect.node) && !isMedia$2(closestNodeRect.node);
23062
- closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX);
22953
+ var includeChildren = checkInside(closestNodeRect);
22954
+ closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX, checkInside);
23063
22955
  if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
23064
22956
  return caretInfo(closestNodeRect, clientX);
23065
22957
  }
@@ -24602,7 +24494,7 @@
24602
24494
  var filteredClasses = filter$4(currentClasses, function (clazz) {
24603
24495
  return !contains$3(attrClasses, clazz);
24604
24496
  });
24605
- var newClasses = __spreadArray(__spreadArray([], attrClasses), filteredClasses);
24497
+ var newClasses = __spreadArray(__spreadArray([], attrClasses, true), filteredClasses, true);
24606
24498
  dom.setAttrib(node, 'class', newClasses.join(' '));
24607
24499
  });
24608
24500
  var appliedAttrs = [
@@ -25669,6 +25561,7 @@
25669
25561
  });
25670
25562
  }
25671
25563
  }
25564
+ editor.fire('dragend');
25672
25565
  }
25673
25566
  });
25674
25567
  removeDragState(state);
@@ -25707,6 +25600,11 @@
25707
25600
  pageDom.unbind(rootDocument, 'mousemove', dragHandler);
25708
25601
  pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
25709
25602
  });
25603
+ editor.on('keydown', function (e) {
25604
+ if (e.keyCode === VK.ESC) {
25605
+ dragEndHandler();
25606
+ }
25607
+ });
25710
25608
  };
25711
25609
  var blockIeDrop = function (editor) {
25712
25610
  editor.on('drop', function (e) {
@@ -25882,13 +25780,18 @@
25882
25780
  editor.on('blur NewBlock', removeElementSelection);
25883
25781
  editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition);
25884
25782
  var hasNormalCaretPosition = function (elm) {
25885
- var caretWalker = CaretWalker(elm);
25886
- if (!elm.firstChild) {
25783
+ var start = elm.firstChild;
25784
+ if (isNullable(start)) {
25887
25785
  return false;
25888
25786
  }
25889
- var startPos = CaretPosition.before(elm.firstChild);
25890
- var newPos = caretWalker.next(startPos);
25891
- return newPos && !isNearFakeSelectionElement(newPos);
25787
+ var startPos = CaretPosition.before(start);
25788
+ if (isBr$5(startPos.getNode()) && elm.childNodes.length === 1) {
25789
+ return !isNearFakeSelectionElement(startPos);
25790
+ } else {
25791
+ var caretWalker = CaretWalker(elm);
25792
+ var newPos = caretWalker.next(startPos);
25793
+ return newPos && !isNearFakeSelectionElement(newPos);
25794
+ }
25892
25795
  };
25893
25796
  var isInSameBlock = function (node1, node2) {
25894
25797
  var block1 = dom.getParent(node1, isBlock);
@@ -25898,10 +25801,13 @@
25898
25801
  var hasBetterMouseTarget = function (targetNode, caretNode) {
25899
25802
  var targetBlock = dom.getParent(targetNode, isBlock);
25900
25803
  var caretBlock = dom.getParent(caretNode, isBlock);
25901
- if (targetBlock && targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse(getContentEditableRoot(editor, targetBlock)) === false) {
25804
+ if (isNullable(targetBlock)) {
25805
+ return false;
25806
+ }
25807
+ if (targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse(getContentEditableRoot(editor, targetBlock)) === false) {
25902
25808
  return true;
25903
25809
  }
25904
- return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
25810
+ return !dom.isChildOf(caretBlock, targetBlock) && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
25905
25811
  };
25906
25812
  editor.on('tap', function (e) {
25907
25813
  var targetElm = e.target;
@@ -25943,8 +25849,8 @@
25943
25849
  if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) {
25944
25850
  e.preventDefault();
25945
25851
  var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false);
25946
- editor.getBody().focus();
25947
25852
  setRange(range);
25853
+ editor.getBody().focus();
25948
25854
  }
25949
25855
  }
25950
25856
  }
@@ -27527,7 +27433,7 @@
27527
27433
  insertContent(editor, result.content, result.details);
27528
27434
  };
27529
27435
 
27530
- var each$5 = Tools.each;
27436
+ var each$4 = Tools.each;
27531
27437
  var map = Tools.map, inArray = Tools.inArray;
27532
27438
  var EditorCommands = function () {
27533
27439
  function EditorCommands(editor) {
@@ -27570,7 +27476,7 @@
27570
27476
  });
27571
27477
  return true;
27572
27478
  }
27573
- each$5(this.editor.plugins, function (p) {
27479
+ each$4(this.editor.plugins, function (p) {
27574
27480
  if (p.execCommand && p.execCommand(command, ui, value)) {
27575
27481
  self.editor.fire('ExecCommand', {
27576
27482
  command: command,
@@ -27640,8 +27546,8 @@
27640
27546
  type = 'exec';
27641
27547
  }
27642
27548
  var self = this;
27643
- each$5(commandList, function (callback, command) {
27644
- each$5(command.toLowerCase().split(','), function (command) {
27549
+ each$4(commandList, function (callback, command) {
27550
+ each$4(command.toLowerCase().split(','), function (command) {
27645
27551
  self.commands[type][command] = callback;
27646
27552
  });
27647
27553
  });
@@ -27751,7 +27657,7 @@
27751
27657
  if (align === 'full') {
27752
27658
  align = 'justify';
27753
27659
  }
27754
- each$5('left,center,right,justify'.split(','), function (name) {
27660
+ each$4('left,center,right,justify'.split(','), function (name) {
27755
27661
  if (align !== name) {
27756
27662
  editor.formatter.remove('align' + name);
27757
27663
  }
@@ -28131,9 +28037,9 @@
28131
28037
  this.toggleEvent(currentName, true);
28132
28038
  }
28133
28039
  if (prepend) {
28134
- handlers = __spreadArray([wrappedCallback], handlers);
28040
+ handlers = __spreadArray([wrappedCallback], handlers, true);
28135
28041
  } else {
28136
- handlers = __spreadArray(__spreadArray([], handlers), [wrappedCallback]);
28042
+ handlers = __spreadArray(__spreadArray([], handlers, true), [wrappedCallback], false);
28137
28043
  }
28138
28044
  this.bindings[currentName] = handlers;
28139
28045
  }
@@ -28444,7 +28350,7 @@
28444
28350
  };
28445
28351
  };
28446
28352
 
28447
- var each$4 = Tools.each, explode$1 = Tools.explode;
28353
+ var each$3 = Tools.each, explode$1 = Tools.explode;
28448
28354
  var keyCodeLookup = {
28449
28355
  f1: 112,
28450
28356
  f2: 113,
@@ -28463,7 +28369,7 @@
28463
28369
  var parseShortcut = function (pattern) {
28464
28370
  var key;
28465
28371
  var shortcut = {};
28466
- each$4(explode$1(pattern.toLowerCase(), '+'), function (value) {
28372
+ each$3(explode$1(pattern.toLowerCase(), '+'), function (value) {
28467
28373
  if (value in modifierNames) {
28468
28374
  shortcut[value] = true;
28469
28375
  } else {
@@ -28510,7 +28416,7 @@
28510
28416
  var self = this;
28511
28417
  editor.on('keyup keypress keydown', function (e) {
28512
28418
  if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) {
28513
- each$4(self.shortcuts, function (shortcut) {
28419
+ each$3(self.shortcuts, function (shortcut) {
28514
28420
  if (self.matchShortcut(e, shortcut)) {
28515
28421
  self.pendingPatterns = shortcut.subpatterns.slice(0);
28516
28422
  if (e.type === 'keydown') {
@@ -28533,7 +28439,7 @@
28533
28439
  Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) {
28534
28440
  var self = this;
28535
28441
  var func = self.normalizeCommandFunc(cmdFunc);
28536
- each$4(explode$1(Tools.trim(pattern)), function (pattern) {
28442
+ each$3(explode$1(Tools.trim(pattern)), function (pattern) {
28537
28443
  var shortcut = self.createShortcut(pattern, desc, func, scope);
28538
28444
  self.shortcuts[shortcut.id] = shortcut;
28539
28445
  });
@@ -28667,251 +28573,6 @@
28667
28573
  };
28668
28574
  };
28669
28575
 
28670
- var each$3 = Tools.each, trim = Tools.trim;
28671
- var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
28672
- var DEFAULT_PORTS = {
28673
- ftp: 21,
28674
- http: 80,
28675
- https: 443,
28676
- mailto: 25
28677
- };
28678
- var URI = function () {
28679
- function URI(url, settings) {
28680
- url = trim(url);
28681
- this.settings = settings || {};
28682
- var baseUri = this.settings.base_uri;
28683
- var self = this;
28684
- if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
28685
- self.source = url;
28686
- return;
28687
- }
28688
- var isProtocolRelative = url.indexOf('//') === 0;
28689
- if (url.indexOf('/') === 0 && !isProtocolRelative) {
28690
- url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
28691
- }
28692
- if (!/^[\w\-]*:?\/\//.test(url)) {
28693
- var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
28694
- if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
28695
- url = '//mce_host' + self.toAbsPath(baseUrl, url);
28696
- } else {
28697
- var match = /([^#?]*)([#?]?.*)/.exec(url);
28698
- url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
28699
- }
28700
- }
28701
- url = url.replace(/@@/g, '(mce_at)');
28702
- var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
28703
- each$3(queryParts, function (v, i) {
28704
- var part = urlMatch[i];
28705
- if (part) {
28706
- part = part.replace(/\(mce_at\)/g, '@@');
28707
- }
28708
- self[v] = part;
28709
- });
28710
- if (baseUri) {
28711
- if (!self.protocol) {
28712
- self.protocol = baseUri.protocol;
28713
- }
28714
- if (!self.userInfo) {
28715
- self.userInfo = baseUri.userInfo;
28716
- }
28717
- if (!self.port && self.host === 'mce_host') {
28718
- self.port = baseUri.port;
28719
- }
28720
- if (!self.host || self.host === 'mce_host') {
28721
- self.host = baseUri.host;
28722
- }
28723
- self.source = '';
28724
- }
28725
- if (isProtocolRelative) {
28726
- self.protocol = '';
28727
- }
28728
- }
28729
- URI.parseDataUri = function (uri) {
28730
- var type;
28731
- var uriComponents = decodeURIComponent(uri).split(',');
28732
- var matches = /data:([^;]+)/.exec(uriComponents[0]);
28733
- if (matches) {
28734
- type = matches[1];
28735
- }
28736
- return {
28737
- type: type,
28738
- data: uriComponents[1]
28739
- };
28740
- };
28741
- URI.getDocumentBaseUrl = function (loc) {
28742
- var baseUrl;
28743
- if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
28744
- baseUrl = loc.href;
28745
- } else {
28746
- baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
28747
- }
28748
- if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
28749
- baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
28750
- if (!/[\/\\]$/.test(baseUrl)) {
28751
- baseUrl += '/';
28752
- }
28753
- }
28754
- return baseUrl;
28755
- };
28756
- URI.prototype.setPath = function (path) {
28757
- var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
28758
- this.path = pathMatch[0];
28759
- this.directory = pathMatch[1];
28760
- this.file = pathMatch[2];
28761
- this.source = '';
28762
- this.getURI();
28763
- };
28764
- URI.prototype.toRelative = function (uri) {
28765
- var output;
28766
- if (uri === './') {
28767
- return uri;
28768
- }
28769
- var relativeUri = new URI(uri, { base_uri: this });
28770
- if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
28771
- return relativeUri.getURI();
28772
- }
28773
- var tu = this.getURI(), uu = relativeUri.getURI();
28774
- if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
28775
- return tu;
28776
- }
28777
- output = this.toRelPath(this.path, relativeUri.path);
28778
- if (relativeUri.query) {
28779
- output += '?' + relativeUri.query;
28780
- }
28781
- if (relativeUri.anchor) {
28782
- output += '#' + relativeUri.anchor;
28783
- }
28784
- return output;
28785
- };
28786
- URI.prototype.toAbsolute = function (uri, noHost) {
28787
- var absoluteUri = new URI(uri, { base_uri: this });
28788
- return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
28789
- };
28790
- URI.prototype.isSameOrigin = function (uri) {
28791
- if (this.host == uri.host && this.protocol == uri.protocol) {
28792
- if (this.port == uri.port) {
28793
- return true;
28794
- }
28795
- var defaultPort = DEFAULT_PORTS[this.protocol];
28796
- if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
28797
- return true;
28798
- }
28799
- }
28800
- return false;
28801
- };
28802
- URI.prototype.toRelPath = function (base, path) {
28803
- var breakPoint = 0, out = '', i, l;
28804
- var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
28805
- var items = path.split('/');
28806
- if (normalizedBase.length >= items.length) {
28807
- for (i = 0, l = normalizedBase.length; i < l; i++) {
28808
- if (i >= items.length || normalizedBase[i] !== items[i]) {
28809
- breakPoint = i + 1;
28810
- break;
28811
- }
28812
- }
28813
- }
28814
- if (normalizedBase.length < items.length) {
28815
- for (i = 0, l = items.length; i < l; i++) {
28816
- if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
28817
- breakPoint = i + 1;
28818
- break;
28819
- }
28820
- }
28821
- }
28822
- if (breakPoint === 1) {
28823
- return path;
28824
- }
28825
- for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
28826
- out += '../';
28827
- }
28828
- for (i = breakPoint - 1, l = items.length; i < l; i++) {
28829
- if (i !== breakPoint - 1) {
28830
- out += '/' + items[i];
28831
- } else {
28832
- out += items[i];
28833
- }
28834
- }
28835
- return out;
28836
- };
28837
- URI.prototype.toAbsPath = function (base, path) {
28838
- var i, nb = 0, o = [], outPath;
28839
- var tr = /\/$/.test(path) ? '/' : '';
28840
- var normalizedBase = base.split('/');
28841
- var normalizedPath = path.split('/');
28842
- each$3(normalizedBase, function (k) {
28843
- if (k) {
28844
- o.push(k);
28845
- }
28846
- });
28847
- normalizedBase = o;
28848
- for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
28849
- if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
28850
- continue;
28851
- }
28852
- if (normalizedPath[i] === '..') {
28853
- nb++;
28854
- continue;
28855
- }
28856
- if (nb > 0) {
28857
- nb--;
28858
- continue;
28859
- }
28860
- o.push(normalizedPath[i]);
28861
- }
28862
- i = normalizedBase.length - nb;
28863
- if (i <= 0) {
28864
- outPath = reverse(o).join('/');
28865
- } else {
28866
- outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
28867
- }
28868
- if (outPath.indexOf('/') !== 0) {
28869
- outPath = '/' + outPath;
28870
- }
28871
- if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
28872
- outPath += tr;
28873
- }
28874
- return outPath;
28875
- };
28876
- URI.prototype.getURI = function (noProtoHost) {
28877
- if (noProtoHost === void 0) {
28878
- noProtoHost = false;
28879
- }
28880
- var s;
28881
- if (!this.source || noProtoHost) {
28882
- s = '';
28883
- if (!noProtoHost) {
28884
- if (this.protocol) {
28885
- s += this.protocol + '://';
28886
- } else {
28887
- s += '//';
28888
- }
28889
- if (this.userInfo) {
28890
- s += this.userInfo + '@';
28891
- }
28892
- if (this.host) {
28893
- s += this.host;
28894
- }
28895
- if (this.port) {
28896
- s += ':' + this.port;
28897
- }
28898
- }
28899
- if (this.path) {
28900
- s += this.path;
28901
- }
28902
- if (this.query) {
28903
- s += '?' + this.query;
28904
- }
28905
- if (this.anchor) {
28906
- s += '#' + this.anchor;
28907
- }
28908
- this.source = s;
28909
- }
28910
- return this.source;
28911
- };
28912
- return URI;
28913
- }();
28914
-
28915
28576
  var DOM$1 = DOMUtils.DOM;
28916
28577
  var extend$3 = Tools.extend, each$2 = Tools.each;
28917
28578
  var resolve = Tools.resolve;
@@ -29339,8 +29000,8 @@
29339
29000
  suffix: null,
29340
29001
  $: DomQuery,
29341
29002
  majorVersion: '5',
29342
- minorVersion: '9.2',
29343
- releaseDate: '2021-09-08',
29003
+ minorVersion: '10.0',
29004
+ releaseDate: '2021-10-11',
29344
29005
  editors: legacyEditors,
29345
29006
  i18n: I18n,
29346
29007
  activeEditor: null,