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

2 lines
47 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r: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,{PluginBlockSettingsMenuItem:()=>co,PluginDocumentSettingPanel:()=>uo,PluginMoreMenuItem:()=>po,PluginPostPublishPanel:()=>go,PluginPostStatusInfo:()=>ho,PluginPrePublishPanel:()=>mo,PluginSidebar:()=>Eo,PluginSidebarMoreMenuItem:()=>bo,__experimentalFullscreenModeClose:()=>rt,__experimentalMainDashboardButton:()=>kt,__experimentalPluginPostExcerpt:()=>wo,initializeEditor:()=>yo,reinitializeEditor:()=>vo,store:()=>Qe});var o={};e.r(o),e.d(o,{__experimentalSetPreviewDeviceType:()=>le,__unstableCreateTemplate:()=>pe,closeGeneralSidebar:()=>z,closeModal:()=>q,closePublishSidebar:()=>Q,hideBlockTypes:()=>se,initializeMetaBoxes:()=>ge,metaBoxUpdatesFailure:()=>ae,metaBoxUpdatesSuccess:()=>ne,openGeneralSidebar:()=>H,openModal:()=>W,openPublishSidebar:()=>$,removeEditorPanel:()=>Y,requestMetaBoxUpdates:()=>re,setAvailableMetaBoxesPerLocation:()=>ie,setIsEditingTemplate:()=>ue,setIsInserterOpened:()=>ce,setIsListViewOpened:()=>de,showBlockTypes:()=>oe,switchEditorMode:()=>J,toggleDistractionFree:()=>he,toggleEditorPanelEnabled:()=>j,toggleEditorPanelOpened:()=>Z,toggleFeature:()=>K,togglePinnedPluginItem:()=>ee,togglePublishSidebar:()=>X,updatePreferredStyleVariations:()=>te});var s={};e.r(s),e.d(s,{__experimentalGetInsertionPoint:()=>He,__experimentalGetPreviewDeviceType:()=>Ge,areMetaBoxesInitialized:()=>qe,getActiveGeneralSidebarName:()=>fe,getActiveMetaBoxLocations:()=>Re,getAllMetaBoxes:()=>Le,getEditedPostTemplate:()=>$e,getEditorMode:()=>ye,getHiddenBlockTypes:()=>ke,getMetaBoxesPerLocation:()=>Fe,getPreference:()=>Pe,getPreferences:()=>Se,hasMetaBoxes:()=>Ne,isEditingTemplate:()=>We,isEditorPanelEnabled:()=>Te,isEditorPanelOpened:()=>xe,isEditorPanelRemoved:()=>Be,isEditorSidebarOpened:()=>ve,isFeatureActive:()=>Ae,isInserterOpened:()=>Ue,isListViewOpened:()=>ze,isMetaBoxLocationActive:()=>De,isMetaBoxLocationVisible:()=>Oe,isModalActive:()=>Ie,isPluginItemPinned:()=>Ce,isPluginSidebarOpened:()=>_e,isPublishSidebarOpened:()=>Me,isSavingMetaBoxes:()=>Ve});const i=window.React,r=window.wp.blocks,n=window.wp.blockLibrary,a=window.wp.deprecated;var l=e.n(a);const c=window.wp.element,d=window.wp.data,u=window.wp.preferences,p=window.wp.widgets,m=window.wp.editor,g=window.wp.hooks,h=window.wp.mediaUtils;(0,g.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>h.MediaUpload));const E=window.wp.components,b=window.wp.blockEditor,w=window.wp.i18n,y=window.wp.compose;function v(e,t){if(Array.isArray(e)&&e.length)for(const o of e){if(o.name===t)return o;const e=v(o.innerBlocks,t);if(e)return e}}const _=(0,y.compose)((0,d.withSelect)(((e,t)=>{if((0,r.hasBlockSupport)(t.name,"multiple",!0))return{};const o=v(e(b.store).getBlocks(),t.name);return{originalBlockClientId:o&&o.clientId!==t.clientId&&o.clientId}})),(0,d.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(b.store).selectBlock(t)})))),f=(0,y.createHigherOrderComponent)((e=>_((({originalBlockClientId:t,selectFirst:o,...s})=>{if(!t)return(0,i.createElement)(e,{...s});const n=(0,r.getBlockType)(s.name),a=function(e){const t=(0,r.findTransform)((0,r.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,r.getBlockType)(t.blocks[0])}(s.name);return[(0,i.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,i.createElement)(e,{key:"block-edit",...s})),(0,i.createElement)(b.Warning,{key:"multiple-use-warning",actions:[(0,i.createElement)(E.Button,{key:"find-original",variant:"secondary",onClick:o},(0,w.__)("Find original")),(0,i.createElement)(E.Button,{key:"remove",variant:"secondary",onClick:()=>s.onReplace([])},(0,w.__)("Remove")),a&&(0,i.createEleme