WordPress/wp-includes/js/dist/rich-text.min.js

1 line
22 KiB
JavaScript
Raw Normal View History

this.wp=this.wp||{},this.wp.richText=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=308)}({15:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",function(){return n})},19:function(t,e,r){"use strict";var n=r(32);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||Object(n.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}r.d(e,"a",function(){return o})},2:function(t,e){!function(){t.exports=this.lodash}()},28:function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)})(t)}r.d(e,"a",function(){return o})},30:function(t,e){!function(){t.exports=this.wp.deprecated}()},308:function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"getFormatTypes",function(){return s}),r.d(n,"getFormatType",function(){return l});var o={};r.r(o),r.d(o,"addFormatTypes",function(){return d}),r.d(o,"removeFormatTypes",function(){return p});var i=r(5),a=r(8),u=r(2);var c=Object(i.combineReducers)({formatTypes:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"ADD_FORMAT_TYPES":return Object(a.a)({},t,Object(u.keyBy)(e.formatTypes,"name"));case"REMOVE_FORMAT_TYPES":return Object(u.omit)(t,e.names)}return t}}),f=r(34),s=Object(f.a)(function(t){return Object.values(t.formatTypes)},function(t){return[t.formatTypes]});function l(t,e){return t.formatTypes[e]}function d(t){return{type:"ADD_FORMAT_TYPES",formatTypes:Object(u.castArray)(t)}}function p(t){return{type:"REMOVE_FORMAT_TYPES",names:Object(u.castArray)(t)}}function m(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.type!==e.type)return!1;var r=t.attributes,n=e.attributes;if(r===n)return!0;if(!r||!n)return!1;var o=Object.keys(r),i=Object.keys(n);if(o.length!==i.length)return!1;for(var a=o.length,u=0;u<a;u++){var c=o[u];if(r[c]!==n[c])return!1}return!0}function v(t){var e=t.formats,r=t.text,n=t.start,o=t.end,i=e.slice(0);return i.forEach(function(t,e){var r=i[e-1];if(r){var n=t.slice(0);n.forEach(function(t,e){var o=r[e];m(t,o)&&(n[e]=o)}),i[e]=n}}),{formats:i,text:r,start:n,end:o}}function g(t,e){var r=t.formats,n=t.text,o=t.start,i=t.end,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,f=r.slice(0);if(a===c){var s=Object(u.find)(f[a],{type:e.type});if(!s){var l=f[a-1]||[];return{formats:r,text:n,start:o,end:i,formatPlaceholder:{index:a,format:Object(u.find)(l,{type:e.type})?void 0:e}}}for(;Object(u.find)(f[a],s);)h(f,a,e),a--;for(c++;Object(u.find)(f[c],s);)h(f,c,e),c++}else for(var d=a;d<c;d++)h(f,d,e);return v({formats:f,text:n,start:o,end:i})}function h(t,e,r){if(t[e]