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

2 lines
33 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__UNSTABLE_LINE_SEPARATOR:function(){return E},__experimentalRichText:function(){return Ge},__unstableCreateElement:function(){return T},__unstableFormatEdit:function(){return Ze},__unstableInsertLineSeparator:function(){return Y},__unstableIsEmptyLine:function(){return I},__unstableToDom:function(){return me},__unstableUseRichText:function(){return Ye},applyFormat:function(){return b},concat:function(){return O},create:function(){return _},getActiveFormat:function(){return k},getActiveFormats:function(){return W},getActiveObject:function(){return M},getTextContent:function(){return j},insert:function(){return q},insertObject:function(){return G},isCollapsed:function(){return P},isEmpty:function(){return V},join:function(){return B},registerFormatType:function(){return H},remove:function(){return K},removeFormat:function(){return z},replace:function(){return X},slice:function(){return Z},split:function(){return J},store:function(){return g},toHTMLString:function(){return ve},toggleFormat:function(){return Se},unregisterFormatType:function(){return Le},useAnchor:function(){return Me},useAnchorRef:function(){return ke}});var n={};e.r(n),e.d(n,{getFormatType:function(){return u},getFormatTypeForBareElement:function(){return f},getFormatTypeForClassName:function(){return d},getFormatTypes:function(){return l}});var r={};e.r(r),e.d(r,{addFormatTypes:function(){return m},removeFormatTypes:function(){return p}});var a=window.wp.data;var o=(0,a.combineReducers)({formatTypes:function(){let 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{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.names.includes(n)})))}return e}}),i={};function s(e){return[e]}function c(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const l=function(e,t){var n,r=t||s;function a(e){var t,r,a,o,s,c=n,l=!0;for(t=0;t<e.length;t++){if(r=e[t],!(s=r)||"object"!=typeof s){l=!1;break}c.has(r)?c=c.get(r):(a=new WeakMap,c.set(r,a),c=a)}return c.has(i)||((o=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,c.set(i,o)),c.get(i)}function o(){n=new WeakMap}function l(){var t,n,o,i,s,l=arguments.length;for(i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];for((t=a(s=r.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!c(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(c(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return l.getDependants=r,l.clear=o,o(),l}((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function u(e,t){return e.formatTypes[t]}function f(e,t){const n=l(e);return n.find((e=>{let{className:n,tagName:r}=e;return null===n&&t===r}))||n.find((e=>{let{className:t,tagName:n}=e;return null===t&&"*"===n}))}function d(e,t){return l(e).find((e=>{let{className:n}=e;return null!==n&&` ${t} `.indexOf(` ${n} `)>=0}))}function m(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function p(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const g=(0,a.createReduxStore)("core/rich-text",{reducer:o,selectors:n,actions:r});function h(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r