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

2 lines
33 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
Editor: Sync changes from the Gutenberg plugin 14.1 release Updated WordPress packages necessary for releasing WordPress 6.1 Beta 1: - @wordpress/a11y@3.17.1 - @wordpress/annotations@2.17.2 - @wordpress/api-fetch@6.14.1 - @wordpress/autop@3.17.1 - @wordpress/babel-plugin-import-jsx-pragma@4.0.1 - @wordpress/babel-plugin-makepot@5.1.1 - @wordpress/babel-preset-default@7.1.1 - @wordpress/base-styles@4.8.1 - @wordpress/blob@3.17.1 - @wordpress/block-directory@3.15.2 - @wordpress/block-editor@10.0.2 - @wordpress/block-library@7.14.2 - @wordpress/block-serialization-default-parser@4.17.1 - @wordpress/block-serialization-spec-parser@4.17.1 - @wordpress/blocks@11.16.2 - @wordpress/browserslist-config@5.0.1 - @wordpress/components@21.0.2 - @wordpress/compose@5.15.2 - @wordpress/core-data@5.0.2 - @wordpress/create-block-tutorial-template@2.5.1 - @wordpress/create-block@4.1.1 - @wordpress/custom-templated-path-webpack-plugin@2.1.3 - @wordpress/customize-widgets@3.14.2 - @wordpress/data-controls@2.17.2 - @wordpress/data@7.1.2 - @wordpress/date@4.17.1 - @wordpress/dependency-extraction-webpack-plugin@4.0.2 - @wordpress/deprecated@3.17.1 - @wordpress/docgen@1.26.1 - @wordpress/dom-ready@3.17.1 - @wordpress/dom@3.17.2 - @wordpress/e2e-test-utils@8.1.1 - @wordpress/e2e-tests@5.1.2 - @wordpress/edit-post@6.14.2 - @wordpress/edit-site@4.14.2 - @wordpress/edit-widgets@4.14.2 - @wordpress/editor@12.16.2 - @wordpress/element@4.15.1 - @wordpress/env@5.2.1 - @wordpress/escape-html@2.17.1 - @wordpress/eslint-plugin@13.1.1 - @wordpress/format-library@3.15.2 - @wordpress/hooks@3.17.1 - @wordpress/html-entities@3.17.1 - @wordpress/i18n@4.17.1 - @wordpress/icons@9.8.1 - @wordpress/interface@4.16.2 - @wordpress/is-shallow-equal@4.17.1 - @wordpress/jest-console@6.0.1 - @wordpress/jest-preset-default@9.0.1 - @wordpress/jest-puppeteer-axe@5.0.1 - @wordpress/keyboard-shortcuts@3.15.2 - @wordpress/keycodes@3.17.1 - @wordpress/lazy-import@1.4.3 - @wordpress/library-export-default-webpack-plugin@2.3.3 - @wordpress/list-reusable-blocks@3.15.2 - @wordpress/media-utils@4.8.1 - @wordpress/notices@3.17.2 - @wordpress/npm-package-json-lint-config@4.2.1 - @wordpress/nux@5.15.2 - @wordpress/plugins@4.15.2 - @wordpress/postcss-plugins-preset@4.1.1 - @wordpress/postcss-themes@5.0.1 - @wordpress/preferences-persistence@1.9.1 - @wordpress/preferences@2.9.2 - @wordpress/prettier-config@2.0.1 - @wordpress/primitives@3.15.1 - @wordpress/priority-queue@2.17.2 - @wordpress/project-management-automation@1.16.1 - @wordpress/react-i18n@3.15.1 - @wordpress/readable-js-assets-webpack-plugin@2.0.1 - @wordpress/redux-routine@4.17.1 - @wordpress/reusable-blocks@3.15.2 - @wordpress/rich-text@5.15.2 - @wordpress/scripts@24.1.2 - @wordpress/server-side-render@3.15.2 - @wordpress/shortcode@3.17.1 - @wordpress/style-engine@1.0.1 - @wordpress/stylelint-config@21.0.1 - @wordpress/token-list@2.17.1 - @wordpress/url@3.18.1 - @wordpress/viewport@4.15.2 - @wordpress/warning@2.17.1 - @wordpress/widgets@2.15.2 - @wordpress/wordcount@3.17.1 Props bernhard-reiter, cbravobernal, czapla, oandregal, isabel_brison, andrewserong, mciampini. See #56467. Built from https://develop.svn.wordpress.org/trunk@54257 git-svn-id: http://core.svn.wordpress.org/trunk@53816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-20 17:43:29 +02:00
!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