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

1 line
26 KiB
JavaScript
Raw Normal View History

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