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 x},__experimentalRichText:function(){return Ze},__unstableCreateElement:function(){return E},__unstableFormatEdit:function(){return Je},__unstableInsertLineSeparator:function(){return G},__unstableIsEmptyLine:function(){return B},__unstableToDom:function(){return pe},__unstableUseRichText:function(){return Ge},applyFormat:function(){return T},concat:function(){return W},create:function(){return F},getActiveFormat:function(){return M},getActiveFormats:function(){return k},getActiveObject:function(){return $},getTextContent:function(){return P},insert:function(){return K},insertObject:function(){return Z},isCollapsed:function(){return V},isEmpty:function(){return I},join:function(){return H},registerFormatType:function(){return z},remove:function(){return X},removeFormat:function(){return U},replace:function(){return Y},slice:function(){return J},split:function(){return Q},store:function(){return h},toHTMLString:function(){return ye},toggleFormat:function(){return Le},unregisterFormatType:function(){return De},useAnchor:function(){return $e},useAnchorRef:function(){return Me}});var n={};e.r(n),e.d(n,{getFormatType:function(){return f},getFormatTypeForBareElement:function(){return d},getFormatTypeForClassName:function(){return m},getFormatTypes:function(){return u}});var r={};e.r(r),e.d(r,{addFormatTypes:function(){return p},removeFormatTypes:function(){return g}});var a=window.wp.data,o=window.lodash;var i=(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(0,o.omit)(e,t.names)}return e}}),s={};function c(e){return[e]}function l(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 u=function(e,t){var n,r=t||c;function a(e){var t,r,a,o,i,c=n,l=!0;for(t=0;t<e.length;t++){if(r=e[t],!(i=r)||"object"!=typeof i){l=!1;break}c.has(r)?c=c.get(r):(a=new WeakMap,c.set(r,a),c=a)}return c.has(s)||((o=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,c.set(s,o)),c.get(s)}function o(){n=new WeakMap}function i(){var t,n,o,i,s,c=arguments.length;for(i=new Array(c),o=0;o<c;o++)i[o]=arguments[o];for((t=a(s=r.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!l(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(l(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 i.getDependants=r,i.clear=o,o(),i}((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function f(e,t){return e.formatTypes[t]}function d(e,t){return(0,o.find)(u(e),(e=>{let{className:n,tagName:r}=e;return null===n&&t===r}))}function m(e,t){return(0,o.find)(u(e),(e=>{let{className:n}=e;return null!==n&&` ${t} `.indexOf(` ${n} `)>=0}))}function p(e){return{type:"ADD_FORMAT_TYPES",formatTypes:(0,o.castArray)(e)}}function g(e){return{type:"REMOVE_FORMAT_TYPES",names:(0,o.castArray)(e)}}const h=(0,a.createReduxStore)("core/rich-text",{reducer:i,selectors:n,actions:r});function v(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const a=Object.keys(n),o=Object.keys(r);if(a.length!==o.length)return!1;const i