Changeset 3418046
- Timestamp:
- 12/12/2025 09:10:54 AM (2 months ago)
- Location:
- trash-post-in-block-editor
- Files:
-
- 43 added
- 5 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/LICENSE (added)
-
tags/1.1.0/dist (added)
-
tags/1.1.0/dist/app.asset.php (added)
-
tags/1.1.0/dist/app.js (added)
-
tags/1.1.0/dist/app.js.map (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-ar-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-ar.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-ar.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-da_DK-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-da_DK.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-da_DK.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-de_DE-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-de_DE.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-de_DE.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-es_ES-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-es_ES.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-es_ES.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-fr_FR-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-fr_FR.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-fr_FR.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-he_IL-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-he_IL.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-he_IL.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-hi_IN-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-hi_IN.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-hi_IN.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-hr-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-hr.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-hr.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-it_IT-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-it_IT.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-it_IT.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-ru_RU-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-ru_RU.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-ru_RU.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-zh_CN-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-zh_CN.mo (added)
-
tags/1.1.0/languages/trash-post-in-block-editor-zh_CN.po (added)
-
tags/1.1.0/languages/trash-post-in-block-editor.pot (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/trash-post-in-block-editor.php (added)
-
trunk/dist/app.asset.php (modified) (1 diff)
-
trunk/dist/app.js (modified) (1 diff)
-
trunk/dist/app.js.map (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/trash-post-in-block-editor.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trash-post-in-block-editor/trunk/dist/app.asset.php
r3336483 r3418046 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-plugins', 'wp-primitives'), 'version' => ' 1eb92f549e591d70f230');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-plugins', 'wp-primitives'), 'version' => '0d0d451af845b1e927eb'); -
trash-post-in-block-editor/trunk/dist/app.js
r3336483 r3418046 1 (()=>{"use strict";var t={20:(t,e,n)=>{var o=n(609),r=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var o,c={},p=null,u=null;for(o in void 0!==n&&(p=""+n),void 0!==e.key&&(p=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,o)&&!i.hasOwnProperty(o)&&(c[o]=e[o]);if(t&&t.defaultProps)for(o in e=t.defaultProps)void 0===c[o]&&(c[o]=e[o]);return{$$typeof:r,type:t,key:p,ref:u,props:c,_owner:s.current}}e.jsx=c,e.jsxs=c},31:t=>{t.exports=window.wp.keyboardShortcuts},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var a={},s=[],i=0;i<t.length;i++){var c=t[i],p=o.base?c[0]+o.base:c[0],u=a[p]||0,l="".concat(p," ").concat(u);a[p]=u+1;var d=n(l),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var h=r(f,o);o.byIndex=i,e.splice(i,0,{identifier:l,updater:h,references:1})}s.push(l)}return s}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var a=o(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<a.length;s++){var i=n(a[s]);e[i].references--}for(var c=o(t,r),p=0;p<a.length;p++){var u=n(a[p]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}a=c}}},87:t=>{t.exports=window.wp.element},100:(t,e,n)=>{n.d(e,{A:()=>i});var o=n(354),r=n.n(o),a=n(314),s=n.n(a)()(r());s.push([t.id,"#trash-post-modal__button-group{display:flex;gap:10px}#trash-post-modal__button-group button{margin:0;width:50%;justify-content:center;width:calc(50% - 5px);box-sizing:border-box}","",{version:3,sources:["webpack://./src/styles/app.scss"],names:[],mappings:"AACC,gCACC,YAAA,CACA,QAAA,CAEA,uCACC,QAAA,CACA,SAAA,CACA,sBAAA,CACA,qBAAA,CACA,qBAAA",sourcesContent:["#trash-post-modal {\n\t&__button-group {\n\t\tdisplay: flex;\n\t\tgap: 10px;\n\n\t\tbutton {\n\t\t\tmargin: 0;\n\t\t\twidth: 50%;\n\t\t\tjustify-content: center;\n\t\t\twidth: calc(50% - 5px);\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const i=s},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},143:t=>{t.exports=window.wp.data},279:t=>{t.exports=window.wp.plugins},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,o,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var p=0;p<t.length;p++){var u=[].concat(t[p]);o&&s[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},349:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(609),r=n(573);const a=(0,o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"}))},354:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),a="/*# ".concat(r," */");return[e].concat([a]).join("\n")}return[e].join("\n")}},427:t=>{t.exports=window.wp.components},455:t=>{t.exports=window.wp.apiFetch},482:(t,e,n)=>{n.d(e,{r:()=>c});var o=n(723),r=n(143),a=n(87),s=n(31),i=n(900);const c=({onKeyDown:t})=>((0,r.useDispatch)()("core/keyboard-shortcuts").registerShortcut({name:"trash-post-in-block-editor/shortcut",keyCombination:(0,i.x)(),category:"global",description:(0,o.__)("Trash Post in Block Editor","trash-post-in-block-editor")}),(0,s.useShortcut)("trash-post-in-block-editor/shortcut",(0,a.useCallback)(()=>{t()},[])),null)},533:(t,e,n)=>{var o=n(72),r=n.n(o),a=n(825),s=n.n(a),i=n(659),c=n.n(i),p=n(56),u=n.n(p),l=n(540),d=n.n(l),f=n(113),h=n.n(f),v=n(100),m={};m.styleTagTransform=h(),m.setAttributes=u(),m.insert=c().bind(null,"head"),m.domAPI=s(),m.insertStyleElement=d(),r()(v.A,m),v.A&&v.A.locals&&v.A.locals},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},573:t=>{t.exports=window.wp.primitives},609:t=>{t.exports=window.React},619:t=>{t.exports=window.wp.hooks},659:t=>{var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},723:t=>{t.exports=window.wp.i18n},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},848:(t,e,n)=>{t.exports=n(20)},900:(t,e,n)=>{n.d(e,{r:()=>i,x:()=>c});var o=n(455),r=n.n(o),a=n(619),s=n(143);const i=()=>{return t=void 0,e=void 0,o=function*(){const{getCurrentPostId:t}=(0,s.select)("core/editor"),{createWarningNotice:e}=(0,s.dispatch)("core/notices");try{yield r()({path:"/tpbe/v1/trash",method:"POST",data:{id:t()}}), window.location.href=`${tpbe.url}`}catch(t){e(t)}},new((n=void 0)||(n=Promise))(function(r,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function i(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,i)}c((o=o.apply(t,e||[])).next())});var t,e,n,o},c=()=>(0,a.applyFilters)("trash-post-in-block-editor.keyboardShortcut",{modifier:"primaryShift",character:"v"})}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nc=void 0;var o=n(848),r=n(723),a=n(349),s=n(87),i=n(279),c=n(427),p=n(482),u=n(900);n(533);(0,i.registerPlugin)("trash-post-in-block-editor",{icon:null,render:()=>{const[t,e]=(0,s.useState)(!1),{wpVersion:n}=tpbe,i=parseFloat(n)>=6.6?"PinnedItems/core":"PinnedItems/core/edit-post";return(0,o.jsxs)(c.Fill,{name:i,children:[(0,o.jsx)(c.Tooltip,{text:(0,r.__)("Trash Post","trash-post-in-block-editor"),children:(0,o.jsx)(c.Button,{icon:a.A,onClick:()=>e(!0),"data-testid":"tpbe-trash-btn"})}),(0,o.jsx)(p.r,{onKeyDown:()=>e(!0)}),t&&(0,o.jsxs)(c.Modal,{title:(0,r.__)("Trash Post","trash-post-in-block-editor"),focusOnMount:"firstContentElement",onRequestClose:()=>e(!1),className:"trash-post-modal",children:[(0,o.jsx)("p",{style:{textAlign:"center"},children:(0,r.__)("Are you sure you want to delete this Post?","trash-post-in-block-editor")}),(0,o.jsxs)("div",{id:"trash-post-modal__button-group",children:[(0,o.jsx)(c.Button,{variant:"primary",onClick:u.r,children:(0,r.__)("Yes","trash-post-in-block-editor")}),(0,o.jsx)(c.Button,{variant:"secondary",onClick:()=>e(!1),children:(0,r.__)("No","trash-post-in-block-editor")})]})]})]})}})})();1 (()=>{"use strict";var t={20:(t,e,n)=>{var o=n(609),r=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var o,c={},p=null,u=null;for(o in void 0!==n&&(p=""+n),void 0!==e.key&&(p=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,o)&&!i.hasOwnProperty(o)&&(c[o]=e[o]);if(t&&t.defaultProps)for(o in e=t.defaultProps)void 0===c[o]&&(c[o]=e[o]);return{$$typeof:r,type:t,key:p,ref:u,props:c,_owner:s.current}}e.jsx=c,e.jsxs=c},31:t=>{t.exports=window.wp.keyboardShortcuts},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var a={},s=[],i=0;i<t.length;i++){var c=t[i],p=o.base?c[0]+o.base:c[0],u=a[p]||0,l="".concat(p," ").concat(u);a[p]=u+1;var d=n(l),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var h=r(f,o);o.byIndex=i,e.splice(i,0,{identifier:l,updater:h,references:1})}s.push(l)}return s}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var a=o(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<a.length;s++){var i=n(a[s]);e[i].references--}for(var c=o(t,r),p=0;p<a.length;p++){var u=n(a[p]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}a=c}}},87:t=>{t.exports=window.wp.element},100:(t,e,n)=>{n.d(e,{A:()=>i});var o=n(354),r=n.n(o),a=n(314),s=n.n(a)()(r());s.push([t.id,"#trash-post-modal__button-group{display:flex;gap:10px}#trash-post-modal__button-group button{margin:0;width:50%;justify-content:center;width:calc(50% - 5px);box-sizing:border-box}","",{version:3,sources:["webpack://./src/styles/app.scss"],names:[],mappings:"AACC,gCACC,YAAA,CACA,QAAA,CAEA,uCACC,QAAA,CACA,SAAA,CACA,sBAAA,CACA,qBAAA,CACA,qBAAA",sourcesContent:["#trash-post-modal {\n\t&__button-group {\n\t\tdisplay: flex;\n\t\tgap: 10px;\n\n\t\tbutton {\n\t\t\tmargin: 0;\n\t\t\twidth: 50%;\n\t\t\tjustify-content: center;\n\t\t\twidth: calc(50% - 5px);\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const i=s},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},143:t=>{t.exports=window.wp.data},279:t=>{t.exports=window.wp.plugins},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,o,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var p=0;p<t.length;p++){var u=[].concat(t[p]);o&&s[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},349:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(609),r=n(573);const a=(0,o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"}))},354:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),a="/*# ".concat(r," */");return[e].concat([a]).join("\n")}return[e].join("\n")}},427:t=>{t.exports=window.wp.components},455:t=>{t.exports=window.wp.apiFetch},482:(t,e,n)=>{n.d(e,{r:()=>c});var o=n(723),r=n(143),a=n(87),s=n(31),i=n(900);const c=({onKeyDown:t})=>((0,r.useDispatch)()("core/keyboard-shortcuts").registerShortcut({name:"trash-post-in-block-editor/shortcut",keyCombination:(0,i.x)(),category:"global",description:(0,o.__)("Trash Post in Block Editor","trash-post-in-block-editor")}),(0,s.useShortcut)("trash-post-in-block-editor/shortcut",(0,a.useCallback)(()=>{t()},[])),null)},533:(t,e,n)=>{var o=n(72),r=n.n(o),a=n(825),s=n.n(a),i=n(659),c=n.n(i),p=n(56),u=n.n(p),l=n(540),d=n.n(l),f=n(113),h=n.n(f),v=n(100),m={};m.styleTagTransform=h(),m.setAttributes=u(),m.insert=c().bind(null,"head"),m.domAPI=s(),m.insertStyleElement=d(),r()(v.A,m),v.A&&v.A.locals&&v.A.locals},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},573:t=>{t.exports=window.wp.primitives},609:t=>{t.exports=window.React},619:t=>{t.exports=window.wp.hooks},659:t=>{var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},723:t=>{t.exports=window.wp.i18n},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},848:(t,e,n)=>{t.exports=n(20)},900:(t,e,n)=>{n.d(e,{r:()=>i,x:()=>c});var o=n(455),r=n.n(o),a=n(619),s=n(143);const i=()=>{return t=void 0,e=void 0,o=function*(){const{getCurrentPostId:t}=(0,s.select)("core/editor"),{createWarningNotice:e}=(0,s.dispatch)("core/notices");try{yield r()({path:"/tpbe/v1/trash",method:"POST",data:{id:t()}}),(0,a.doAction)("tpbe.afterTrashPost",t(),tpbe.url),window.location.href=`${tpbe.url}`}catch(t){e(t)}},new((n=void 0)||(n=Promise))(function(r,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function i(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,i)}c((o=o.apply(t,e||[])).next())});var t,e,n,o},c=()=>(0,a.applyFilters)("trash-post-in-block-editor.keyboardShortcut",{modifier:"primaryShift",character:"v"})}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nc=void 0;var o=n(848),r=n(723),a=n(349),s=n(87),i=n(279),c=n(427),p=n(482),u=n(900);n(533);(0,i.registerPlugin)("trash-post-in-block-editor",{icon:null,render:()=>{const[t,e]=(0,s.useState)(!1),{wpVersion:n}=tpbe,i=parseFloat(n)>=6.6?"PinnedItems/core":"PinnedItems/core/edit-post";return(0,o.jsxs)(c.Fill,{name:i,children:[(0,o.jsx)(c.Tooltip,{text:(0,r.__)("Trash Post","trash-post-in-block-editor"),children:(0,o.jsx)(c.Button,{icon:a.A,onClick:()=>e(!0),"data-testid":"tpbe-trash-btn"})}),(0,o.jsx)(p.r,{onKeyDown:()=>e(!0)}),t&&(0,o.jsxs)(c.Modal,{title:(0,r.__)("Trash Post","trash-post-in-block-editor"),focusOnMount:"firstContentElement",onRequestClose:()=>e(!1),className:"trash-post-modal",children:[(0,o.jsx)("p",{style:{textAlign:"center"},children:(0,r.__)("Are you sure you want to delete this Post?","trash-post-in-block-editor")}),(0,o.jsxs)("div",{id:"trash-post-modal__button-group",children:[(0,o.jsx)(c.Button,{variant:"primary",onClick:u.r,children:(0,r.__)("Yes","trash-post-in-block-editor")}),(0,o.jsx)(c.Button,{variant:"secondary",onClick:()=>e(!1),children:(0,r.__)("No","trash-post-in-block-editor")})]})]})]})}})})(); 2 2 //# sourceMappingURL=app.js.map -
trash-post-in-block-editor/trunk/dist/app.js.map
r3336483 r3418046 1 {"version":3,"file":"app.js","mappings":"2CASiBA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAgDC,GAA7BF,OAAOC,IAAI,kBAAoBE,OAAOC,UAAUC,gBAAeC,EAAER,EAAES,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,EAAEE,IAAI,MAAM,CAACM,SAASzB,EAAE0B,KAAKV,EAAEL,IAAIU,E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C,IAAAhE,IAAI,MAAO,iCAEd,SAAC,EAAA+D,OAAM,CACNQ,QAAQ,YACRP,QAAU,IAAMT,GAAmB,GAAO,UAExC,IAAAvD,IAAI,KAAM,2C","sources":["webpack://trash-post-in-block-editor/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"keyboardShortcuts\"]","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"element\"]","webpack://trash-post-in-block-editor/./src/styles/app.scss","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"data\"]","webpack://trash-post-in-block-editor/external window [\"wp\",\"plugins\"]","webpack://trash-post-in-block-editor/./node_modules/css-loader/dist/runtime/api.js","webpack://trash-post-in-block-editor/./node_modules/@wordpress/icons/build-module/library/trash.js","webpack://trash-post-in-block-editor/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"components\"]","webpack://trash-post-in-block-editor/external window [\"wp\",\"apiFetch\"]","webpack://trash-post-in-block-editor/./src/components/Shortcut.tsx","webpack://trash-post-in-block-editor/./src/styles/app.scss?4dc7","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"primitives\"]","webpack://trash-post-in-block-editor/external window \"React\"","webpack://trash-post-in-block-editor/external window [\"wp\",\"hooks\"]","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"i18n\"]","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://trash-post-in-block-editor/./node_modules/react/jsx-runtime.js","webpack://trash-post-in-block-editor/./src/utils.tsx","webpack://trash-post-in-block-editor/webpack/bootstrap","webpack://trash-post-in-block-editor/webpack/runtime/compat get default export","webpack://trash-post-in-block-editor/webpack/runtime/define property getters","webpack://trash-post-in-block-editor/webpack/runtime/hasOwnProperty shorthand","webpack://trash-post-in-block-editor/webpack/runtime/nonce","webpack://trash-post-in-block-editor/./src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","module.exports = window[\"wp\"][\"keyboardShortcuts\"];","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = window[\"wp\"][\"element\"];","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `#trash-post-modal__button-group{display:flex;gap:10px}#trash-post-modal__button-group button{margin:0;width:50%;justify-content:center;width:calc(50% - 5px);box-sizing:border-box}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/styles/app.scss\"],\"names\":[],\"mappings\":\"AACC,gCACC,YAAA,CACA,QAAA,CAEA,uCACC,QAAA,CACA,SAAA,CACA,sBAAA,CACA,qBAAA,CACA,qBAAA\",\"sourcesContent\":[\"#trash-post-modal {\\n\\t&__button-group {\\n\\t\\tdisplay: flex;\\n\\t\\tgap: 10px;\\n\\n\\t\\tbutton {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\twidth: 50%;\\n\\t\\t\\tjustify-content: center;\\n\\t\\t\\twidth: calc(50% - 5px);\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"plugins\"];","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"apiFetch\"];","import { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\n\nimport { getShortcut } from '../utils';\n\n/**\n * Shortcut for Block Editor.\n *\n * This method implements the custom shortcut\n * functionality for this plugin.\n *\n * @since 1.0.1\n *\n * @param {Object} props - The properties object.\n * @param {Function} props.onKeyDown - The function to call when the shortcut is triggered.\n *\n * @return {JSX.Element|null} Shortcut.\n */\nexport const Shortcut = ( { onKeyDown } ): JSX.Element | null => {\n\tconst dispatch = useDispatch();\n\n\tdispatch( 'core/keyboard-shortcuts' ).registerShortcut( {\n\t\tname: 'trash-post-in-block-editor/shortcut',\n\t\tkeyCombination: getShortcut(),\n\t\tcategory: 'global',\n\t\tdescription: __(\n\t\t\t'Trash Post in Block Editor',\n\t\t\t'trash-post-in-block-editor'\n\t\t),\n\t} );\n\n\tuseShortcut(\n\t\t'trash-post-in-block-editor/shortcut',\n\t\tuseCallback( () => {\n\t\t\tonKeyDown();\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [] )\n\t);\n\n\treturn null;\n};\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n export default content && content.locals ? content.locals : undefined;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"hooks\"];","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","module.exports = window[\"wp\"][\"i18n\"];","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import apiFetch from '@wordpress/api-fetch';\nimport { applyFilters } from '@wordpress/hooks';\nimport { select, dispatch } from '@wordpress/data';\n\n/**\n * Trash Post\n *\n * This function trashes the post based\n * on the Post ID.\n *\n * @since 1.0.0\n *\n * @return {void}\n */\nexport const trashPost = async () => {\n\tconst { getCurrentPostId } = select( 'core/editor' );\n\tconst { createWarningNotice } = dispatch( 'core/notices' ) as any;\n\n\ttry {\n\t\tawait apiFetch( {\n\t\t\tpath: '/tpbe/v1/trash',\n\t\t\tmethod: 'POST',\n\t\t\tdata: {\n\t\t\t\tid: getCurrentPostId(),\n\t\t\t},\n\t\t} );\n\n\t\twindow.location.href = `${ tpbe.url }`;\n\t} catch ( e ) {\n\t\tcreateWarningNotice( e );\n\t}\n};\n\n/**\n * Get ShortCut.\n *\n * This function filters the user's preferred\n * shortcut option.\n *\n * @since 1.0.5\n *\n * @return {Object} Shortcut Option.\n */\nexport const getShortcut = (): { modifier: string; character: string } => {\n\tconst options = {\n\t\tCMD: {\n\t\t\tmodifier: 'primary',\n\t\t\tcharacter: 'v',\n\t\t},\n\t\tSHIFT: {\n\t\t\tmodifier: 'primaryShift',\n\t\t\tcharacter: 'v',\n\t\t},\n\t\tALT: {\n\t\t\tmodifier: 'primaryAlt',\n\t\t\tcharacter: 'v',\n\t\t},\n\t};\n\n\t/**\n\t * Filter Keyboard Shortcut.\n\t *\n\t * By default the passed option would be SHIFT which\n\t * represents `CMD + SHIFT + V`.\n\t *\n\t * @since 1.0.5\n\t *\n\t * @param {Object} Shortcut Option.\n\t * @return {Object}\n\t */\n\treturn applyFilters(\n\t\t'trash-post-in-block-editor.keyboardShortcut',\n\t\toptions.SHIFT\n\t) as { modifier: string; character: string };\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;","import { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\nimport { useState } from '@wordpress/element';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { Modal, Tooltip, Button, Fill } from '@wordpress/components';\n\nimport { Shortcut } from './components/Shortcut';\nimport { trashPost } from './utils';\n\nimport './styles/app.scss';\n\n/**\n * Trash Post In Block Editor.\n *\n * This function returns a JSX component that comprises\n * the Plugin Sidebar and Trash icon.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} TrashPostInBlockEditor\n */\nconst TrashPostInBlockEditor = (): JSX.Element => {\n\tconst [ isModalVisible, setIsModalVisible ] = useState( false );\n\tconst { wpVersion } = tpbe;\n\n\t// Slot fill name changed in WP 6.6.\n\tconst fillName =\n\t\tparseFloat( wpVersion ) >= 6.6\n\t\t\t? 'PinnedItems/core'\n\t\t\t: 'PinnedItems/core/edit-post';\n\n\treturn (\n\t\t<Fill name={ fillName }>\n\t\t\t<Tooltip text={ __( 'Trash Post', 'trash-post-in-block-editor' ) }>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ trash }\n\t\t\t\t\tonClick={ () => setIsModalVisible( true ) }\n\t\t\t\t\tdata-testid=\"tpbe-trash-btn\"\n\t\t\t\t></Button>\n\t\t\t</Tooltip>\n\t\t\t<Shortcut onKeyDown={ () => setIsModalVisible( true ) } />\n\t\t\t{ isModalVisible && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Trash Post', 'trash-post-in-block-editor' ) }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tonRequestClose={ () => setIsModalVisible( false ) }\n\t\t\t\t\tclassName=\"trash-post-modal\"\n\t\t\t\t>\n\t\t\t\t\t<p style={ { textAlign: 'center' } }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Are you sure you want to delete this Post?',\n\t\t\t\t\t\t\t'trash-post-in-block-editor'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<div id=\"trash-post-modal__button-group\">\n\t\t\t\t\t\t<Button variant=\"primary\" onClick={ trashPost }>\n\t\t\t\t\t\t\t{ __( 'Yes', 'trash-post-in-block-editor' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => setIsModalVisible( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'No', 'trash-post-in-block-editor' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</Fill>\n\t);\n};\n\nregisterPlugin( 'trash-post-in-block-editor', {\n\ticon: null,\n\trender: TrashPostInBlockEditor,\n} );\n\nexport default TrashPostInBlockEditor;\n"],"names":["f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","jsx","jsxs","module","window","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","id","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","___CSS_LOADER_EXPORT___","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","cssWithMappingToString","toString","this","map","content","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","_k","createElement","SVG","xmlns","viewBox","Path","fillRule","clipRule","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","Shortcut","onKeyDown","useDispatch","dispatch","registerShortcut","name","keyCombination","category","description","__","useShortcut","useCallback","styleTagTransform","setAttributes","insert","insertStyleElement","locals","element","attributes","memo","style","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","Error","apply","parentNode","removeStyleElement","trashPost","getCurrentPostId","select","createWarningNotice","path","method","location","href","tpbe","url","getShortcut","applyFilters","modifier","character","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","prop","nc","registerPlugin","icon","render","isModalVisible","setIsModalVisible","useState","wpVersion","fillName","parseFloat","Fill","Tooltip","text","Button","onClick","Modal","title","focusOnMount","onRequestClose","className","textAlign","variant"],"sourceRoot":""}1 {"version":3,"file":"app.js","mappings":"2CASiBA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAgDC,GAA7BF,OAAOC,IAAI,kBAAoBE,OAAOC,UAAUC,gBAAeC,EAAER,EAAES,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EA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jE,KAAO+D,EAAQ,WACpB,SAAC,EAAAG,QAAO,CAACC,MAAO,IAAA/D,IAAI,aAAc,8BAA8B,UAC/D,SAAC,EAAAgE,OAAM,CACNX,KAAO,IACPY,QAAU,IAAMT,GAAmB,GAAM,cAC7B,sBAGd,SAAC,IAAQ,CAAChE,UAAY,IAAMgE,GAAmB,KAC7CD,IACD,UAAC,EAAAW,MAAK,CACLC,OAAQ,IAAAnE,IAAI,aAAc,8BAC1BoE,aAAa,sBACbC,eAAiB,IAAMb,GAAmB,GAC1Cc,UAAU,mBAAkB,WAE5B,cAAG3D,MAAQ,CAAE4D,UAAW,UAAU,UAC/B,IAAAvE,IACD,6CACA,iCAGF,iBAAKzE,GAAG,iCAAgC,WACvC,SAAC,EAAAyI,OAAM,CAACQ,QAAQ,UAAUP,QAAU,IAAS,UAC1C,IAAAjE,IAAI,MAAO,iCAEd,SAAC,EAAAgE,OAAM,CACNQ,QAAQ,YACRP,QAAU,IAAMT,GAAmB,GAAO,UAExC,IAAAxD,IAAI,KAAM,2C","sources":["webpack://trash-post-in-block-editor/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"keyboardShortcuts\"]","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"element\"]","webpack://trash-post-in-block-editor/./src/styles/app.scss","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"data\"]","webpack://trash-post-in-block-editor/external window [\"wp\",\"plugins\"]","webpack://trash-post-in-block-editor/./node_modules/css-loader/dist/runtime/api.js","webpack://trash-post-in-block-editor/./node_modules/@wordpress/icons/build-module/library/trash.js","webpack://trash-post-in-block-editor/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"components\"]","webpack://trash-post-in-block-editor/external window [\"wp\",\"apiFetch\"]","webpack://trash-post-in-block-editor/./src/components/Shortcut.tsx","webpack://trash-post-in-block-editor/./src/styles/app.scss?4dc7","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"primitives\"]","webpack://trash-post-in-block-editor/external window \"React\"","webpack://trash-post-in-block-editor/external window [\"wp\",\"hooks\"]","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://trash-post-in-block-editor/external window [\"wp\",\"i18n\"]","webpack://trash-post-in-block-editor/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://trash-post-in-block-editor/./node_modules/react/jsx-runtime.js","webpack://trash-post-in-block-editor/./src/utils.tsx","webpack://trash-post-in-block-editor/webpack/bootstrap","webpack://trash-post-in-block-editor/webpack/runtime/compat get default export","webpack://trash-post-in-block-editor/webpack/runtime/define property getters","webpack://trash-post-in-block-editor/webpack/runtime/hasOwnProperty shorthand","webpack://trash-post-in-block-editor/webpack/runtime/nonce","webpack://trash-post-in-block-editor/./src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","module.exports = window[\"wp\"][\"keyboardShortcuts\"];","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = window[\"wp\"][\"element\"];","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `#trash-post-modal__button-group{display:flex;gap:10px}#trash-post-modal__button-group button{margin:0;width:50%;justify-content:center;width:calc(50% - 5px);box-sizing:border-box}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/styles/app.scss\"],\"names\":[],\"mappings\":\"AACC,gCACC,YAAA,CACA,QAAA,CAEA,uCACC,QAAA,CACA,SAAA,CACA,sBAAA,CACA,qBAAA,CACA,qBAAA\",\"sourcesContent\":[\"#trash-post-modal {\\n\\t&__button-group {\\n\\t\\tdisplay: flex;\\n\\t\\tgap: 10px;\\n\\n\\t\\tbutton {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\twidth: 50%;\\n\\t\\t\\tjustify-content: center;\\n\\t\\t\\twidth: calc(50% - 5px);\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"plugins\"];","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"apiFetch\"];","import { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\n\nimport { getShortcut } from '../utils';\n\n/**\n * Shortcut for Block Editor.\n *\n * This method implements the custom shortcut\n * functionality for this plugin.\n *\n * @since 1.0.1\n *\n * @param {Object} props - The properties object.\n * @param {Function} props.onKeyDown - The function to call when the shortcut is triggered.\n *\n * @return {JSX.Element|null} Shortcut.\n */\nexport const Shortcut = ( { onKeyDown } ): JSX.Element | null => {\n\tconst dispatch = useDispatch();\n\n\tdispatch( 'core/keyboard-shortcuts' ).registerShortcut( {\n\t\tname: 'trash-post-in-block-editor/shortcut',\n\t\tkeyCombination: getShortcut(),\n\t\tcategory: 'global',\n\t\tdescription: __(\n\t\t\t'Trash Post in Block Editor',\n\t\t\t'trash-post-in-block-editor'\n\t\t),\n\t} );\n\n\tuseShortcut(\n\t\t'trash-post-in-block-editor/shortcut',\n\t\tuseCallback( () => {\n\t\t\tonKeyDown();\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [] )\n\t);\n\n\treturn null;\n};\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n export default content && content.locals ? content.locals : undefined;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"hooks\"];","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","module.exports = window[\"wp\"][\"i18n\"];","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import apiFetch from '@wordpress/api-fetch';\nimport { applyFilters, doAction } from '@wordpress/hooks';\nimport { select, dispatch } from '@wordpress/data';\n\n/**\n * Trash Post\n *\n * This function trashes the post based\n * on the Post ID.\n *\n * @since 1.0.0\n *\n * @return {void}\n */\nexport const trashPost = async (): Promise< void > => {\n\tconst { getCurrentPostId } = select( 'core/editor' );\n\tconst { createWarningNotice } = dispatch( 'core/notices' ) as any;\n\n\ttry {\n\t\tawait apiFetch( {\n\t\t\tpath: '/tpbe/v1/trash',\n\t\t\tmethod: 'POST',\n\t\t\tdata: {\n\t\t\t\tid: getCurrentPostId(),\n\t\t\t},\n\t\t} );\n\n\t\t/**\n\t\t * Fires after post is deleted.\n\t\t *\n\t\t * @since 1.1.0\n\t\t *\n\t\t * @param {number} postId Post ID.\n\t\t * @param {string} redirectUrl Redirect URL.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdoAction( 'tpbe.afterTrashPost', getCurrentPostId(), tpbe.url );\n\n\t\twindow.location.href = `${ tpbe.url }`;\n\t} catch ( e ) {\n\t\tcreateWarningNotice( e );\n\t}\n};\n\n/**\n * Get ShortCut.\n *\n * This function filters the user's preferred\n * shortcut option.\n *\n * @since 1.0.5\n *\n * @return {Object} Shortcut Option.\n */\nexport const getShortcut = (): { modifier: string; character: string } => {\n\tconst options = {\n\t\tCMD: {\n\t\t\tmodifier: 'primary',\n\t\t\tcharacter: 'v',\n\t\t},\n\t\tSHIFT: {\n\t\t\tmodifier: 'primaryShift',\n\t\t\tcharacter: 'v',\n\t\t},\n\t\tALT: {\n\t\t\tmodifier: 'primaryAlt',\n\t\t\tcharacter: 'v',\n\t\t},\n\t};\n\n\t/**\n\t * Filter Keyboard Shortcut.\n\t *\n\t * By default the passed option would be SHIFT which\n\t * represents `CMD + SHIFT + V`.\n\t *\n\t * @since 1.0.5\n\t *\n\t * @param {Object} Shortcut Option.\n\t * @return {Object}\n\t */\n\treturn applyFilters(\n\t\t'trash-post-in-block-editor.keyboardShortcut',\n\t\toptions.SHIFT\n\t) as { modifier: string; character: string };\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;","import { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\nimport { useState } from '@wordpress/element';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { Modal, Tooltip, Button, Fill } from '@wordpress/components';\n\nimport { Shortcut } from './components/Shortcut';\nimport { trashPost } from './utils';\n\nimport './styles/app.scss';\n\n/**\n * Trash Post In Block Editor.\n *\n * This function returns a JSX component that comprises\n * the Plugin Sidebar and Trash icon.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} TrashPostInBlockEditor\n */\nconst TrashPostInBlockEditor = (): JSX.Element => {\n\tconst [ isModalVisible, setIsModalVisible ] = useState( false );\n\tconst { wpVersion } = tpbe;\n\n\t// Slot fill name changed in WP 6.6.\n\tconst fillName =\n\t\tparseFloat( wpVersion ) >= 6.6\n\t\t\t? 'PinnedItems/core'\n\t\t\t: 'PinnedItems/core/edit-post';\n\n\treturn (\n\t\t<Fill name={ fillName }>\n\t\t\t<Tooltip text={ __( 'Trash Post', 'trash-post-in-block-editor' ) }>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ trash }\n\t\t\t\t\tonClick={ () => setIsModalVisible( true ) }\n\t\t\t\t\tdata-testid=\"tpbe-trash-btn\"\n\t\t\t\t></Button>\n\t\t\t</Tooltip>\n\t\t\t<Shortcut onKeyDown={ () => setIsModalVisible( true ) } />\n\t\t\t{ isModalVisible && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Trash Post', 'trash-post-in-block-editor' ) }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tonRequestClose={ () => setIsModalVisible( false ) }\n\t\t\t\t\tclassName=\"trash-post-modal\"\n\t\t\t\t>\n\t\t\t\t\t<p style={ { textAlign: 'center' } }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Are you sure you want to delete this Post?',\n\t\t\t\t\t\t\t'trash-post-in-block-editor'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<div id=\"trash-post-modal__button-group\">\n\t\t\t\t\t\t<Button variant=\"primary\" onClick={ trashPost }>\n\t\t\t\t\t\t\t{ __( 'Yes', 'trash-post-in-block-editor' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => setIsModalVisible( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'No', 'trash-post-in-block-editor' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</Fill>\n\t);\n};\n\nregisterPlugin( 'trash-post-in-block-editor', {\n\ticon: null,\n\trender: TrashPostInBlockEditor,\n} );\n\nexport default TrashPostInBlockEditor;\n"],"names":["f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","jsx","jsxs","module","window","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","id","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","___CSS_LOADER_EXPORT___","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","cssWithMappingToString","toString","this","map","content","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","_k","createElement","SVG","xmlns","viewBox","Path","fillRule","clipRule","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","Shortcut","onKeyDown","useDispatch","dispatch","registerShortcut","name","keyCombination","category","description","__","useShortcut","useCallback","styleTagTransform","setAttributes","insert","insertStyleElement","locals","element","attributes","memo","style","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","Error","apply","parentNode","removeStyleElement","trashPost","getCurrentPostId","select","createWarningNotice","path","method","doAction","tpbe","url","location","href","getShortcut","applyFilters","modifier","character","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","prop","nc","registerPlugin","icon","render","isModalVisible","setIsModalVisible","useState","wpVersion","fillName","parseFloat","Fill","Tooltip","text","Button","onClick","Modal","title","focusOnMount","onRequestClose","className","textAlign","variant"],"ignoreList":[],"sourceRoot":""} -
trash-post-in-block-editor/trunk/readme.txt
r3345253 r3418046 4 4 Requires at least: 6.6 5 5 Tested up to: 6.8 6 Stable tag: 1. 0.66 Stable tag: 1.1.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 42 42 43 43 == Changelog == 44 45 = 1.1.0 = 46 * Feat: Add custom hooks - `tpbe_redirect_url`, `tpbe.afterTrashPost`. 47 * Improve `/trash` REST endpoint. 48 * Tested up to WP 6.8 49 * Update README docs. 44 50 45 51 = 1.0.6 = -
trash-post-in-block-editor/trunk/trash-post-in-block-editor.php
r3345253 r3418046 4 4 * Plugin URI: https://github.com/badasswp/trash-post-in-block-editor 5 5 * Description: Delete a Post from within the WP Block Editor. 6 * Version: 1. 0.66 * Version: 1.1.0 7 7 * Author: badasswp 8 8 * Author URI: https://github.com/badasswp … … 46 46 ); 47 47 48 /** 49 * Filter Redirect URL. 50 * 51 * @since 1.1.0 52 * 53 * @param string $redirect_url Redirect URL. 54 * @return string 55 */ 56 $redirect_url = apply_filters( 57 'tpbe_redirect_url', 58 add_query_arg( 59 [ 60 'post_type' => get_post_type() 61 ], 62 sprintf( '%s/%s', untrailingslashit( get_admin_url() ), 'edit.php' ) 63 ), 64 ); 65 48 66 wp_localize_script( 49 67 'trash-post-in-block-editor', … … 51 69 [ 52 70 'wpVersion' => $wp_version, 53 'url' => add_query_arg( 54 [ 55 'post_type' => get_post_type() 56 ], 57 sprintf( '%s/%s', untrailingslashit( get_admin_url() ), 'edit.php' ) 58 ), 71 'url' => esc_url( $redirect_url ), 59 72 ] 60 73 ); … … 80 93 * 81 94 * @since 1.0.0 95 * @since 1.1.0 Use validate & sanitize callbacks. 82 96 * 83 97 * @wp-hook 'rest_api_init' … … 88 102 '/trash', 89 103 [ 104 'args' => [ 105 'id' => [ 106 'validate_callback' => function ( $param ) { 107 return is_numeric( $param ); 108 }, 109 'sanitize_callback' => 'absint', 110 ], 111 ], 90 112 'methods' => \WP_REST_Server::CREATABLE, 91 113 'callback' => __NAMESPACE__ . '\trash_post', … … 112 134 113 135 // Get Post ID. 114 $post_id = (int) ( $args['id'] ?? '' ); 115 116 // Bail out, if it does NOT exists. 117 if ( ! get_post( $post_id ) ) { 118 return new \WP_Error( 119 'tpbe-bad-request', 120 sprintf( 121 'Fatal Error: Bad Request, Post does not exists for ID: %s', 122 $post_id 123 ), 124 [ 125 'status' => 400, 126 'request' => $args, 127 ] 128 ); 129 } 136 $post_id = $args['id']; 130 137 131 138 if ( ! wp_delete_post( $post_id ) ) { … … 166 173 $http_error = rest_authorization_required_code(); 167 174 168 if ( ! current_user_can( ' administrator' ) ) {175 if ( ! current_user_can( 'edit_posts' ) ) { 169 176 return new \WP_Error( 170 177 'tpbe-rest-forbidden',
Note: See TracChangeset
for help on using the changeset viewer.