mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-23 15:19:15 +00:00
The following package versions were changed: @wordpress/a11y: 2.6.0 -> 2.7.0 @wordpress/annotations: 1.10.0 -> 1.11.0 @wordpress/api-fetch: 3.9.0 -> 3.10.0 @wordpress/autop: 2.5.1 -> 2.6.0 @wordpress/blob: 2.6.0 -> 2.7.0 @wordpress/block-directory: 1.3.0 -> 1.4.0 @wordpress/block-editor: 3.5.0 -> 3.6.0 @wordpress/block-library: 2.12.0 -> 2.13.0 @wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0 @wordpress/blocks: 6.10.0 -> 6.11.0 @wordpress/components: 9.0.0 -> 9.1.0 @wordpress/compose: 3.10.0 -> 3.11.0 @wordpress/core-data: 2.10.0 -> 2.11.0 @wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/data: 4.12.0 -> 4.13.0 @wordpress/data-controls: 1.6.0 -> 1.7.0 @wordpress/date: 3.7.0 -> 3.8.0 @wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0 @wordpress/deprecated: 2.6.1 -> 2.7.0 @wordpress/dom: 2.7.0 -> 2.8.0 @wordpress/dom-ready: 2.6.0 -> 2.7.0 @wordpress/e2e-test-utils: 4.1.0 -> 4.2.0 @wordpress/edit-post: 3.11.0 -> 3.12.0 @wordpress/editor: 9.10.0 -> 9.11.0 @wordpress/element: 2.10.0 -> 2.11.0 @wordpress/escape-html: 1.6.0 -> 1.7.0 @wordpress/format-library: 1.12.0 -> 1.13.0 @wordpress/hooks: 2.6.0 -> 2.7.0 @wordpress/html-entities: 2.5.0 -> 2.6.0 @wordpress/i18n: 3.8.0 -> 3.9.0 @wordpress/is-shallow-equal: 1.7.0 -> 1.8.0 @wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0 @wordpress/keycodes: 2.8.0 -> 2.9.0 @wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0 @wordpress/media-utils: 1.5.0 -> 1.6.0 @wordpress/notices: 1.11.0 -> 1.12.0 @wordpress/nux: 3.10.0 -> 3.11.0 @wordpress/plugins: 2.10.0 -> 2.11.0 @wordpress/priority-queue: 1.4.0 -> 1.5.0 @wordpress/redux-routine: 3.6.2 -> 3.7.0 @wordpress/rich-text: 3.10.0 -> 3.11.0 @wordpress/scripts: 6.2.0 -> 7.0.0 @wordpress/server-side-render: 1.6.0 -> 1.7.0 @wordpress/shortcode: 2.5.0 -> 2.6.0 @wordpress/token-list: 1.8.0 -> 1.9.0 @wordpress/url: 2.9.0 -> 2.10.0 @wordpress/viewport: 2.11.0 -> 2.12.0 @wordpress/wordcount: 2.6.2 -> 2.7.0 Added these new packages: @wordpress/warning @wordpress/primitives @wordpress/icons Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198. Props gziolo, itsjonq, youknowriad, mcsf, andraganescu. Fixes #49358. Built from https://develop.svn.wordpress.org/trunk@47199 git-svn-id: http://core.svn.wordpress.org/trunk@46999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
/*! This file is auto-generated */
|
|
this.wp=this.wp||{},this.wp.formatLibrary=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=421)}({0:function(t,e){!function(){t.exports=this.wp.element}()},1:function(t,e){!function(){t.exports=this.wp.i18n}()},12:function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return o}))},13:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},14:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(32),o=n(7);function i(t,e){return!e||"object"!==Object(r.a)(e)&&"function"!=typeof e?Object(o.a)(t):e}},15:function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},16:function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}n.d(e,"a",(function(){return o}))},19:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(41);function o(t,e){if(null==t)return{};var n,o,i=Object(r.a)(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o<c.length;o++)n=c[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}},2:function(t,e){!function(){t.exports=this.lodash}()},20:function(t,e){!function(){t.exports=this.wp.keycodes}()},24:function(t,e){!function(){t.exports=this.wp.richText}()},26:function(t,e){!function(){t.exports=this.wp.url}()},3:function(t,e){!function(){t.exports=this.wp.components}()},32:function(t,e,n){"use strict";function r(t){return(r="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)}n.d(e,"a",(function(){return r}))},41:function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}n.d(e,"a",(function(){return r}))},421:function(t,e,n){"use strict";n.r(e);var r=n(19),o=n(24),i=n(0),c=n(1),a=n(6),u="core/bold",l=Object(c.__)("Bold"),s={name:u,title:l,tagName:"strong",className:null,edit:function(t){var e=t.isActive,n=t.value,r=t.onChange,c=t.onFocus;function s(){r(Object(o.toggleFormat)(n,{type:u}))}return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.RichTextShortcut,{type:"primary",character:"b",onUse:s}),Object(i.createElement)(a.RichTextToolbarButton,{name:"bold",icon:"editor-bold",title:l,onClick:function(){s(),c()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),Object(i.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:s}))}},b="core/code",p=Object(c.__)("Inline Code"),f={name:b,title:p,tagName:"code",className:null,__unstableInputRule:function(t){var e=t,n=e.start,r=e.text;if("`"!==r.slice(n-1,n))return t;var i=r.slice(0,n-1).lastIndexOf("`");if(-1===i)return t;var c=i,a=n-2;return c===a?t:(t=Object(o.remove)(t,c,c+1),t=Object(o.remove)(t,a,a+1),t=Object(o.applyFormat)(t,{type:b},c,a))},edit:function(t){var e=t.value,n=t.onChange,r=t.onFocus,c=t.isActive;return Object(i.createElement)(a.RichTextToolbarButton,{icon:"editor-code",title:p,onClick:function(){n(Object(o.toggleFormat)(e,{type:b})),r()},isActive:c})}},d=n(5),m=n(13),O=n(12),h=n(14),j=n(15),y=n(7),v=n(16),g=n(3),k=n(20);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){Object(d.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var E=["image"],x=Object(c.__)("Inline image"),T=function(t){return t.stopPropagation()};var C={name:"core/image",title:x,keywords:[Object(c.__)("photo"),Object(c.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(t){function e(){var t;return Object(m.a)(this,e),(t=Object(h.a)(this,Object(j.a)(e).apply(this,arguments))).onChange=t.onChange.bind(Object(y.a)(t)),t.onKeyDown=t.onKeyDown.bind(Object(y.a)(t)),t.openModal=t.openModal.bind(Object(y.a)(t)),t.closeModal=t.closeModal.bind(Object(y.a)(t)),t.state={modal:!1},t}return Object(v.a)(e,t),Object(O.a)(e,[{key:"onChange",value:function(t){this.setState({width:t})}},{key:"onKeyDown",value:function(t){[k.LEFT,k.DOWN,k.RIGHT,k.UP,k.BACKSPACE,k.ENTER].indexOf(t.keyCode)>-1&&t.stopPropagation()}},{key:"openModal",value:function(){this.setState({modal:!0})}},{key:"closeModal",value:function(){this.setState({modal:!1})}},{key:"render",value:function(){var t,e=this,n=this.props,r=n.value,u=n.onChange,l=n.onFocus,s=n.isObjectActive,b=n.activeObjectAttributes;return Object(i.createElement)(a.MediaUploadCheck,null,Object(i.createElement)(a.RichTextToolbarButton,{icon:Object(i.createElement)(g.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(g.Path,{d:"M4 16h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2zM4 5h10v9H4V5zm14 9v2h4v-2h-4zM2 20h20v-2H2v2zm6.4-8.8L7 9.4 5 12h8l-2.6-3.4-2 2.6z"})),title:x,onClick:this.openModal,isActive:s}),this.state.modal&&Object(i.createElement)(a.MediaUpload,{allowedTypes:E,onSelect:function(t){var n=t.id,i=t.url,c=t.alt,a=t.width;e.closeModal(),u(Object(o.insertObject)(r,{type:"core/image",attributes:{className:"wp-image-".concat(n),style:"width: ".concat(Math.min(a,150),"px;"),url:i,alt:c}})),l()},onClose:this.closeModal,render:function(t){return(0,t.open)(),null}}),s&&Object(i.createElement)(g.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:(t=window.getSelection(),t.rangeCount?t.getRangeAt(0):null)},Object(i.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onKeyPress:T,onKeyDown:this.onKeyDown,onSubmit:function(t){var n=r.replacements.slice();n[r.start]={type:"core/image",attributes:_({},b,{style:"width: ".concat(e.state.width,"px;")})},u(_({},r,{replacements:n})),t.preventDefault()}},Object(i.createElement)(g.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:Object(c.__)("Width"),value:this.state.width,min:1,onChange:this.onChange}),Object(i.createElement)(g.Button,{icon:"editor-break",label:Object(c.__)("Apply"),type:"submit"}))))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.activeObjectAttributes.style;return n===e.previousStyle?null:n?{width:n.replace(/\D/g,""),previousStyle:n}:{width:void 0,previousStyle:n}}}]),e}(i.Component)},S="core/italic",P=Object(c.__)("Italic"),F={name:S,title:P,tagName:"em",className:null,edit:function(t){var e=t.isActive,n=t.value,r=t.onChange,c=t.onFocus;function u(){r(Object(o.toggleFormat)(n,{type:S}))}return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.RichTextShortcut,{type:"primary",character:"i",onUse:u}),Object(i.createElement)(a.RichTextToolbarButton,{name:"italic",icon:"editor-italic",title:P,onClick:function(){u(),c()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),Object(i.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:u}))}},A=n(26),R=n(56),L=n(2);var N=Object(g.withSpokenMessages)((function(t){var e=t.isActive,n=t.activeAttributes,r=t.addingLink,u=t.value,l=t.onChange,s=t.onFocus,b=t.speak,p=t.stopAddingLink,f=Object(i.useMemo)(L.uniqueId,[r]),d=Object(i.useMemo)((function(){var t=window.getSelection();if(t.rangeCount){var n=t.getRangeAt(0);if(r&&!e)return n;var o=n.startContainer;for(o=o.nextElementSibling||o;o.nodeType!==window.Node.ELEMENT_NODE;)o=o.parentNode;return o.closest("a")}}),[r,u.start,u.end]),m={url:n.url,opensInNewTab:"_blank"===n.target};return Object(i.createElement)(g.Popover,{key:f,anchorRef:d,focusOnMount:!!r&&"firstElement",onClose:p,position:"bottom center"},Object(i.createElement)(a.__experimentalLinkControl,{value:m,onChange:function(t){var n=Object(A.prependHTTP)(t.url),r=Object(o.getTextContent)(Object(o.slice)(u)),i=function(t){var e=t.url,n=t.opensInNewWindow,r=t.text,o={type:"core/link",attributes:{url:e}};if(n){var i=Object(c.sprintf)(Object(c.__)("%s (opens in a new tab)"),r);o.attributes.target="_blank",o.attributes.rel="noreferrer noopener",o.attributes["aria-label"]=i}return o}({url:n,opensInNewWindow:t.opensInNewTab,text:r});if(Object(o.isCollapsed)(u)&&!e){var a=Object(o.applyFormat)(Object(o.create)({text:n}),i,0,n.length);l(Object(o.insert)(u,a))}else l(Object(o.applyFormat)(u,i));s(),p(),!function(t){if(!t)return!1;var e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){var n=Object(A.getProtocol)(e);if(!Object(A.isValidProtocol)(n))return!1;if(Object(L.startsWith)(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;var r=Object(A.getAuthority)(e);if(!Object(A.isValidAuthority)(r))return!1;var o=Object(A.getPath)(e);if(o&&!Object(A.isValidPath)(o))return!1;var i=Object(A.getQueryString)(e);if(i&&!Object(A.isValidQueryString)(i))return!1;var c=Object(A.getFragment)(e);if(c&&!Object(A.isValidFragment)(c))return!1}return!(Object(L.startsWith)(e,"#")&&!Object(A.isValidFragment)(e))}(n)?b(Object(c.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive"):b(e?Object(c.__)("Link edited."):Object(c.__)("Link inserted."),"assertive")}}))})),M=Object(c.__)("Link"),I={name:"core/link",title:M,tagName:"a",className:null,attributes:{url:"href",target:"target"},__unstablePasteRule:function(t,e){var n=e.html,r=e.plainText;if(Object(o.isCollapsed)(t))return t;var i=(n||r).replace(/<[^>]+>/g,"").trim();return Object(A.isURL)(i)?(window.console.log("Created link:\n\n",i),Object(o.applyFormat)(t,{type:"core/link",attributes:{url:Object(R.decodeEntities)(i)}})):t},edit:Object(g.withSpokenMessages)(function(t){function e(){var t;return Object(m.a)(this,e),(t=Object(h.a)(this,Object(j.a)(e).apply(this,arguments))).addLink=t.addLink.bind(Object(y.a)(t)),t.stopAddingLink=t.stopAddingLink.bind(Object(y.a)(t)),t.onRemoveFormat=t.onRemoveFormat.bind(Object(y.a)(t)),t.state={addingLink:!1},t}return Object(v.a)(e,t),Object(O.a)(e,[{key:"addLink",value:function(){var t=this.props,e=t.value,n=t.onChange,r=Object(o.getTextContent)(Object(o.slice)(e));r&&Object(A.isURL)(r)?n(Object(o.applyFormat)(e,{type:"core/link",attributes:{url:r}})):r&&Object(A.isEmail)(r)?n(Object(o.applyFormat)(e,{type:"core/link",attributes:{url:"mailto:".concat(r)}})):this.setState({addingLink:!0})}},{key:"stopAddingLink",value:function(){this.setState({addingLink:!1})}},{key:"onRemoveFormat",value:function(){var t=this.props,e=t.value,n=t.onChange,r=t.speak;n(Object(o.removeFormat)(e,"core/link")),r(Object(c.__)("Link removed."),"assertive")}},{key:"render",value:function(){var t=this.props,e=t.isActive,n=t.activeAttributes,r=t.value,o=t.onChange,u=t.onFocus;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.RichTextShortcut,{type:"primary",character:"k",onUse:this.addLink}),Object(i.createElement)(a.RichTextShortcut,{type:"primaryShift",character:"k",onUse:this.onRemoveFormat}),e&&Object(i.createElement)(a.RichTextToolbarButton,{name:"link",icon:"editor-unlink",title:Object(c.__)("Unlink"),onClick:this.onRemoveFormat,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&Object(i.createElement)(a.RichTextToolbarButton,{name:"link",icon:"admin-links",title:M,onClick:this.addLink,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(this.state.addingLink||e)&&Object(i.createElement)(N,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:e,activeAttributes:n,value:r,onChange:o,onFocus:u}))}}]),e}(i.Component))},D="core/strikethrough",U=Object(c.__)("Strikethrough");[s,f,C,F,I,{name:D,title:U,tagName:"s",className:null,edit:function(t){var e=t.isActive,n=t.value,r=t.onChange,c=t.onFocus;return Object(i.createElement)(a.RichTextToolbarButton,{icon:"editor-strikethrough",title:U,onClick:function(){r(Object(o.toggleFormat)(n,{type:D})),c()},isActive:e})}},{name:"core/underline",title:Object(c.__)("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit:function(t){var e=t.value,n=t.onChange,r=function(){n(Object(o.toggleFormat)(e,{type:"core/underline",attributes:{style:"text-decoration: underline;"}}))};return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.RichTextShortcut,{type:"primary",character:"u",onUse:r}),Object(i.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:r}))}}].forEach((function(t){var e=t.name,n=Object(r.a)(t,["name"]);return Object(o.registerFormatType)(e,n)}))},5:function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},56:function(t,e){!function(){t.exports=this.wp.htmlEntities}()},6:function(t,e){!function(){t.exports=this.wp.blockEditor}()},7:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))}}); |