WordPress/wp-includes/js/dist/edit-post.min.js

6 lines
86 KiB
JavaScript
Raw Normal View History

this.wp=this.wp||{},this.wp.editPost=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=364)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,n){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return o}))},106:function(e,t){!function(){e.exports=this.wp.mediaUtils}()},11:function(e,t,n){"use strict";function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}n.d(t,"a",(function(){return r}))},117:function(e,t,n){"use strict";var o=n(0),r=n(3),c=Object(r.createSlotFill)("PluginPostStatusInfo"),i=c.Fill,a=c.Slot,l=function(e){var t=e.children,n=e.className;return Object(o.createElement)(i,null,Object(o.createElement)(r.PanelRow,{className:n},t))};l.Slot=a,t.a=l},118:function(e,t,n){"use strict";var o=n(0),r=n(3),c=n(8),i=n(52),a=n(4),l=n(53),s=Object(r.createSlotFill)("PluginDocumentSettingPanel"),u=s.Fill,d=s.Slot,b=Object(c.compose)(Object(i.withPluginContext)((function(e,t){return{icon:t.icon||e.icon,panelName:"".concat(e.name,"/").concat(t.name)}})),Object(a.withSelect)((function(e,t){var n=t.panelName;return{opened:e("core/edit-post").isEditorPanelOpened(n),isEnabled:e("core/edit-post").isEditorPanelEnabled(n)}})),Object(a.withDispatch)((function(e,t){var n=t.panelName;return{onToggle:function(){return e("core/edit-post").toggleEditorPanelOpened(n)}}})))((function(e){var t=e.isEnabled,n=e.panelName,c=e.opened,i=e.onToggle,a=e.className,s=e.title,d=e.icon,b=e.children;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.d,{label:s,panelName:n}),Object(o.createElement)(u,null,t&&Object(o.createElement)(r.PanelBody,{className:a,title:s,icon:d,opened:c,onToggle:i},b)))}));b.Slot=d,t.a=b},119:function(e,t,n){"use strict";var o=n(0),r=n(8),c=n(52),i=n(3),a=Object(i.createSlotFill)("PluginPostPublishPanel"),l=a.Fill,s=a.Slot,u=Object(r.compose)(Object(c.withPluginContext)((function(e,t){return{icon:t.icon||e.icon}})))((function(e){var t=e.children,n=e.className,r=e.title,c=e.initialOpen,a=void 0!==c&&c,s=e.icon;return Object(o.createElement)(l,null,Object(o.createElement)(i.PanelBody,{className:n,initialOpen:a||!r,title:r,icon:s},t))}));u.Slot=s,t.a=u},12:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return o}))},120:function(e,t,n){"use strict";var o=n(0),r=n(3),c=n(8),i=n(52),a=Object(r.createSlotFill)("PluginPrePublishPanel"),l=a.Fill,s=a.Slot,u=Object(c.compose)(Object(i.withPluginContext)((function(e,t){return{icon:t.icon||e.icon}})))((function(e){var t=e.children,n=e.className,c=e.title,i=e.initialOpen,a=void 0!==i&&i,s=e.icon;return Object(o.createElement)(l,null,Object(o.createElement)(r.PanelBody,{className:n,initialOpen:a||!c,title:c,icon:s},t))}));u.Slot=s,t.a=u},121:function(e,t,n){"use strict";var o=n(18),r=n(21),c=n(0),i=n(2),a=n(8),l=n(3),s=n(52),u=n(124);t.a=Object(a.compose)(Object(s.withPluginContex
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var c=typeof o;if("string"===c||"number"===c)e.push(o);else if(Array.isArray(o)&&o.length){var i=r.apply(null,o);i&&e.push(i)}else if("object"===c)for(var a in o)n.call(o,a)&&o[a]&&e.push(a)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},161:function(e,t){!function(){e.exports=this.wp.blockLibrary}()},163:function(e,t,n){"use strict";var o=n(18),r=n(21),c=n(17),i=n(7),a=n(12),l=n(11),s=n(13),u=n(14),d=n(15),b=n(0),p=n(45),m=n.n(p),O=n(2),f=n(4),j=n(24),h=n(3),E=n(8),g={"t a l e s o f g u t e n b e r g":function(e){(document.activeElement.classList.contains("edit-post-visual-editor")||document.activeElement===document.body)&&(e.preventDefault(),window.wp.data.dispatch("core/block-editor").insertBlock(window.wp.blocks.createBlock("core/paragraph",{content:"🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮"})))}},v=n(16),_=n.n(v),y=n(1),S=n(52),k=n(43),P=n(26);var w=function(e){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(u.a)(t).apply(this,arguments))).state={historyId:null},e}return Object(d.a)(t,e),Object(l.a)(t,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.postId,o=t.postStatus,r=t.postType,c=this.state.historyId;"trash"!==o?n===e.postId&&n===c||"auto-draft"===o||this.setBrowserURL(n):this.setTrashURL(n,r)}},{key:"setTrashURL",value:function(e,t){window.location.href=function(e,t){return Object(P.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}},{key:"setBrowserURL",value:function(e){window.history.replaceState({id:e},"Post "+e,function(e){return Object(P.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((function(){return{historyId:e}}))}},{key:"render",value:function(){return null}}]),t}(b.Component),C=Object(f.withSelect)((function(e){var t=(0,e("core/editor").getCurrentPost)();return{postId:t.id,postStatus:t.status,postType:t.type}}))(w),T=n(63);var x=Object(f.withSelect)((function(e){var t=e("core/editor").getCurrentPostType,n=e("core/edit-post").isFeatureActive,o=e("core").getPostType;return{isActive:n("fullscreenMode"),postType:o(t())}}))((function(e){var t=e.isActive,n=e.postType;return t&&n?Object(b.createElement)(h.Toolbar,{className:"edit-post-fullscreen-mode-close__toolbar"},Object(b.createElement)(h.IconButton,{icon:"arrow-left-alt2",href:Object(P.addQueryArgs)("edit.php",{post_type:n.slug}),label:Object(O.get)(n,["labels","view_items"],Object(y.__)("Back"))})):null})),N=n(6);var A=Object(E.compose)([Object(f.withSelect)((function(e){return{hasFixedToolbar:e("core/edit-post").isFeatureActive("fixedToolbar"),showInserter:"visual"===e("core/edit-post").getEditorMode()&&e("core/editor").getEditorSettings().richEditingEnabled,isTextModeEnabled:"text"===e("core/edit-post").getEditorMode()}})),Object(k.withViewportMatch)({isLargeViewport:"medium"})])((function(e){var t=e.hasFixedToolbar,n=e.isLargeViewport,o=e.showInserter,r=e.isTextModeEnabled,c=t?Object(y.__)("Document and block tools"):Object(y.__)("Document tools");return Object(b.createElement)(N.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":c},Object(b.createElement)("div",null,Object(b.createElement)(N.Inserter,{disabled:!o,position:"bottom right",showInserterHelpPanel:!0}),Object(b.createElement)(T.DotTip,{tipId:"core/editor.inserter"},Object(y.__)("Welcome to the wonderful world of blocks! Click the + (Add block) button to add a new block. There are blocks available for all kinds of content: you can insert text, headings, images, lists, and lots more!"))),Object(b.createElement)(j.EditorHistoryUndo,null),Object(b.createElement)(j.EditorHistoryRedo,null),Object(b.createElement)(j.TableOfContents,{hasOutlineItemsDisabled:r}),Object(b.createElement)(N.BlockNavigationDropdown,{isDisabled:r}),t&&n&&Object(b.createElem