/*! This file is auto-generated */ !function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);var n=window.wp.element,o=window.wp.i18n;var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function a(e){return e.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],s=/[^A-Z0-9]+/gi;function l(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function c(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?i:n,r=t.stripRegexp,c=void 0===r?s:r,p=t.transform,u=void 0===p?a:p,d=t.delimiter,f=void 0===d?" ":d,m=l(l(e,o,"$1\0$2"),c,"\0"),w=0,b=m.length;"\0"===m.charAt(w);)w++;for(;"\0"===m.charAt(b-1);)b--;return m.slice(w,b).split("\0").map(u).join(f)}(e,r({delimiter:"."},t))}var p=window.wp.apiFetch,u=e.n(p);var d=async function(e){const t=await u()({path:"/wp/v2/types/wp_block"}),n=await u()({path:`/wp/v2/${t.rest_base}/${e}?context=edit`}),o=n.title.raw,a=n.content.raw,i=n.wp_pattern_sync_status,s=JSON.stringify({__file:"wp_block",title:o,content:a,syncStatus:i},null,2);var l;!function(e,t,n){const o=new window.Blob([t],{type:n});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(o,e);else{const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}}((void 0===l&&(l={}),c(o,r({delimiter:"-"},l))+".json"),s,"application/json")},f=window.wp.compose,m=window.wp.components;var w=async function(e){const t=await function(e){const t=new window.FileReader;return new Promise((n=>{t.onload=()=>{n(t.result)},t.readAsText(e)}))}(e);let n;try{n=JSON.parse(t)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==n.__file||!n.title||!n.content||"string"!=typeof n.title||"string"!=typeof n.content||n.syncStatus&&"string"!=typeof n.syncStatus)throw new Error("Invalid pattern JSON file");const o=await u()({path:"/wp/v2/types/wp_block"});return await u()({path:`/wp/v2/${o.rest_base}`,data:{title:n.title,content:n.content,status:"publish",meta:"unsynced"===n.syncStatus?{wp_pattern_sync_status:n.syncStatus}:void 0},method:"POST"})};var b=(0,f.withInstanceId)((function({instanceId:e,onUpload:t}){const r="list-reusable-blocks-import-form-"+e,a=(0,n.useRef)(),[i,s]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),[p,u]=(0,n.useState)(null);return(0,n.createElement)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),p&&(s({isLoading:!0}),w(p).then((e=>{a&&(s(!1),t(e))})).catch((e=>{if(!a)return;let t;switch(e.message){case"Invalid JSON file":t=(0,o.__)("Invalid JSON file");break;case"Invalid pattern JSON file":t=(0,o.__)("Invalid pattern JSON file");break;default:t=(0,o.__)("Unknown error")}s(!1),c(t)})))},ref:a},l&&(0,n.createElement)(m.Notice,{status:"error",onRemove:()=>{c(null)}},l),(0,n.createElement)("label",{htmlFor:r,className:"list-reusable-blocks-import-form__label"},(0,o.__)("File")),(0,n.createElement)("input",{id:r,type:"file",onChange:e=>{u(e.target.files[0]),c(null)}}),(0,n.createElement)(m.Button,{type:"submit",isBusy:i,disabled:!p||i,variant:"secondary",className:"list-reusable-blocks-import-form__button"},(0,o._x)("Import","button label")))}));var v=function({onUpload:e}){return(0,n.createElement)(m.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(m.Button,{"aria-expanded":e,onClick:t,variant:"primary"},(0,o.__)("Import from JSON")),renderContent:({onClose:t})=>(0,n.createElement)(b,{onUpload:(0,f.pipe)(t,e)})})};document.body.addEventListener("click",(e=>{e.target.classList.contains("wp-list-reusable-blocks__export")&&(e.preventDefault(),d(e.target.dataset.id))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".page-title-action");if(!e)return;const t=document.createElement("div");t.className="list-reusable-blocks__container",e.parentNode.insertBefore(t,e),(0,n.createRoot)(t).render((0,n.createElement)(v,{onUpload:()=>{const e=document.createElement("div");e.className="notice notice-success is-dismissible",e.innerHTML=`<p>${(0,o.__)("Pattern imported successfully!")}</p>`;const t=document.querySelector(".wp-header-end");t&&t.parentNode.insertBefore(e,t)}}))})),(window.wp=window.wp||{}).listReusableBlocks=t}();
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
development | Folder | 0777 |
|
|
vendor | Folder | 0777 |
|
|
a11y.js | File | 8.46 KB | 0777 |
|
a11y.min.js | File | 2.39 KB | 0777 |
|
annotations.js | File | 30.6 KB | 0777 |
|
annotations.min.js | File | 6.53 KB | 0777 |
|
api-fetch.js | File | 22.29 KB | 0777 |
|
api-fetch.min.js | File | 5.27 KB | 0777 |
|
autop.js | File | 15.9 KB | 0777 |
|
autop.min.js | File | 5.54 KB | 0777 |
|
blob.js | File | 3.62 KB | 0777 |
|
blob.min.js | File | 917 B | 0777 |
|
block-directory.js | File | 75.95 KB | 0777 |
|
block-directory.min.js | File | 20.6 KB | 0777 |
|
block-editor.js | File | 2.13 MB | 0777 |
|
block-editor.min.js | File | 714.6 KB | 0777 |
|
block-library.js | File | 1.86 MB | 0777 |
|
block-library.min.js | File | 788.04 KB | 0777 |
|
block-serialization-default-parser.js | File | 14.93 KB | 0777 |
|
block-serialization-default-parser.min.js | File | 2.39 KB | 0777 |
|
blocks.js | File | 540.82 KB | 0777 |
|
blocks.min.js | File | 167.71 KB | 0777 |
|
commands.js | File | 183.14 KB | 0777 |
|
commands.min.js | File | 46.66 KB | 0777 |
|
components.js | File | 2.63 MB | 0777 |
|
components.min.js | File | 790.84 KB | 0777 |
|
compose.js | File | 193.9 KB | 0777 |
|
compose.min.js | File | 36.67 KB | 0777 |
|
core-commands.js | File | 21.2 KB | 0777 |
|
core-commands.min.js | File | 7.94 KB | 0777 |
|
core-data.js | File | 230.15 KB | 0777 |
|
core-data.min.js | File | 55.19 KB | 0777 |
|
customize-widgets.js | File | 110.11 KB | 0777 |
|
customize-widgets.min.js | File | 39.5 KB | 0777 |
|
data-controls.js | File | 7.3 KB | 0777 |
|
data-controls.min.js | File | 1.59 KB | 0777 |
|
data.js | File | 152.25 KB | 0777 |
|
data.min.js | File | 26.7 KB | 0777 |
|
date.js | File | 798.3 KB | 0777 |
|
date.min.js | File | 765.34 KB | 0777 |
|
deprecated.js | File | 4.67 KB | 0777 |
|
deprecated.min.js | File | 729 B | 0777 |
|
dom-ready.js | File | 2.45 KB | 0777 |
|
dom-ready.min.js | File | 498 B | 0777 |
|
dom.js | File | 62.11 KB | 0777 |
|
dom.min.js | File | 12.77 KB | 0777 |
|
edit-post.js | File | 355.9 KB | 0777 |
|
edit-post.min.js | File | 125.19 KB | 0777 |
|
edit-site.js | File | 1.29 MB | 0777 |
|
edit-site.min.js | File | 505.33 KB | 0777 |
|
edit-widgets.js | File | 163.6 KB | 0777 |
|
edit-widgets.min.js | File | 57.64 KB | 0777 |
|
editor.js | File | 419.89 KB | 0777 |
|
editor.min.js | File | 147.66 KB | 0777 |
|
element.js | File | 66.15 KB | 0777 |
|
element.min.js | File | 12.35 KB | 0777 |
|
escape-html.js | File | 6.21 KB | 0777 |
|
escape-html.min.js | File | 1.11 KB | 0777 |
|
format-library.js | File | 63.81 KB | 0777 |
|
format-library.min.js | File | 22.46 KB | 0777 |
|
hooks.js | File | 19.58 KB | 0777 |
|
hooks.min.js | File | 4.52 KB | 0777 |
|
html-entities.js | File | 3.62 KB | 0777 |
|
html-entities.min.js | File | 837 B | 0777 |
|
i18n.js | File | 49.01 KB | 0777 |
|
i18n.min.js | File | 9.22 KB | 0777 |
|
interactivity.js | File | 80.97 KB | 0777 |
|
interactivity.min.js | File | 31.62 KB | 0777 |
|
is-shallow-equal.js | File | 4.33 KB | 0777 |
|
is-shallow-equal.min.js | File | 1.07 KB | 0777 |
|
keyboard-shortcuts.js | File | 31.74 KB | 0777 |
|
keyboard-shortcuts.min.js | File | 4.09 KB | 0777 |
|
keycodes.js | File | 33.33 KB | 0777 |
|
keycodes.min.js | File | 3.94 KB | 0777 |
|
list-reusable-blocks.js | File | 30.16 KB | 0777 |
|
list-reusable-blocks.min.js | File | 4.97 KB | 0777 |
|
media-utils.js | File | 22.02 KB | 0777 |
|
media-utils.min.js | File | 7.27 KB | 0777 |
|
notices.js | File | 21.81 KB | 0777 |
|
notices.min.js | File | 2.21 KB | 0777 |
|
nux.js | File | 20.58 KB | 0777 |
|
nux.min.js | File | 4.51 KB | 0777 |
|
patterns.js | File | 26.97 KB | 0777 |
|
patterns.min.js | File | 8.68 KB | 0777 |
|
plugins.js | File | 17.54 KB | 0777 |
|
plugins.min.js | File | 4.24 KB | 0777 |
|
preferences-persistence.js | File | 28.17 KB | 0777 |
|
preferences-persistence.min.js | File | 4.85 KB | 0777 |
|
preferences.js | File | 11.42 KB | 0777 |
|
preferences.min.js | File | 2.58 KB | 0777 |
|
primitives.js | File | 9.59 KB | 0777 |
|
primitives.min.js | File | 2.46 KB | 0777 |
|
priority-queue.js | File | 13.98 KB | 0777 |
|
priority-queue.min.js | File | 3.36 KB | 0777 |
|
private-apis.js | File | 8.57 KB | 0777 |
|
private-apis.min.js | File | 2.63 KB | 0777 |
|
redux-routine.js | File | 23.52 KB | 0777 |
|
redux-routine.min.js | File | 8.79 KB | 0777 |
|
reusable-blocks.js | File | 20.37 KB | 0777 |
|
reusable-blocks.min.js | File | 6.5 KB | 0777 |
|
rich-text.js | File | 123.03 KB | 0777 |
|
rich-text.min.js | File | 30.4 KB | 0777 |
|
router.js | File | 25.91 KB | 0777 |
|
router.min.js | File | 4.25 KB | 0777 |
|
server-side-render.js | File | 14.42 KB | 0777 |
|
server-side-render.min.js | File | 4.4 KB | 0777 |
|
shortcode.js | File | 14.96 KB | 0777 |
|
shortcode.min.js | File | 2.87 KB | 0777 |
|
style-engine.js | File | 36.88 KB | 0777 |
|
style-engine.min.js | File | 5.51 KB | 0777 |
|
token-list.js | File | 6.48 KB | 0777 |
|
token-list.min.js | File | 1.27 KB | 0777 |
|
undo-manager.js | File | 8.32 KB | 0777 |
|
undo-manager.min.js | File | 1.75 KB | 0777 |
|
url.js | File | 33.88 KB | 0777 |
|
url.min.js | File | 9.4 KB | 0777 |
|
viewport.js | File | 10.53 KB | 0777 |
|
viewport.min.js | File | 1.94 KB | 0777 |
|
warning.js | File | 2.46 KB | 0777 |
|
warning.min.js | File | 352 B | 0777 |
|
widgets.js | File | 53.63 KB | 0777 |
|
widgets.min.js | File | 20.71 KB | 0777 |
|
wordcount.js | File | 14.68 KB | 0777 |
|
wordcount.min.js | File | 2.47 KB | 0777 |
|