|
|
|
@@ -0,0 +1,10 @@
|
|
|
|
|
(()=>{var e={224:e=>{var t;globalThis,t=()=>(()=>{var e={184:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var l=r.apply(null,n);l&&e.push(l)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},703:(e,t,n)=>{"use strict";var o=n(414);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,l){if(l!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},921:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.module.reference")},864:(e,t,n)=>{"use strict";n(921)},251:(e,t,n)=>{"use strict";var o=n(196),r=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var o,s={},u=null,c=null;for(o in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,o)&&!a.hasOwnProperty(o)&&(s[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===s[o]&&(s[o]=t[o]);return{$$typeof:r,type:e,key:u,ref:c,props:s,_owner:l.current}}},893:(e,t,n)=>{"use strict";e.exports=n(251)},196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};return(()=>{"use strict";n.r(o),n.d(o,{Autocomplete:()=>Ae,Checkbox:()=>$e,ColorPicker:()=>nn,SortableList:()=>zr,SortableListItem:()=>Ar,Stack:()=>Hr,Table:()=>Ai});var e=n(196),t=n.n(e);const r=window.wp.element,i=window.wp.components,l=window.wp.i18n,a=window.wp.primitives;var s=n(893);const u=(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(a.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})});function c(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(null,arguments)}var g=n(697),p=n.n(g);n(864);const f=e=>"object"==typeof e&&null!=e&&1===e.nodeType,h=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,m=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return h(n.overflowY,t)||h(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},v=(e,t,n,o,r,i,l,a)=>i<e&&l>t||i>e&&l<t?0:i<=e&&a<=n||l>=t&&a>=n?i-e-o:l>t&&a<n||i<e&&a>n?l-t+r:0,b=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var y=function(){return y=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},y.apply(this,aLine truncated
|
|
|
|
|
(0,o.__)("Included %s","generatecloud"),null!==(u=y.singular)&&void 0!==u?u:l);var E;return"taxonomy"===v&&(x=(0,o.sprintf)(/* translators: %s: singular label of the entity being shared. */ /* translators: %s: singular label of the entity being shared. */
|
|
|
|
|
(0,o.__)("%s Collections","generatecloud"),null!==(E=y.singular)&&void 0!==E?E:l)),(0,e.createElement)("section",{className:"gb-cloud-public-key-form__library"},(0,e.createElement)("header",null,(0,e.createElement)("h3",null,null!==(c=null!==(d=y.plural)&&void 0!==d?d:y.singular)&&void 0!==c?c:l)),(0,e.createElement)(t.TextControl,{label:(0,o.sprintf)(/* translators: %s: singular label of the entity being shared. */ /* translators: %s: singular label of the entity being shared. */
|
|
|
|
|
(0,o.__)("%s Library Name","generatecloud"),null!==(g=y.singular)&&void 0!==g?g:l),help:(0,o.__)("Set the name of the library other sites will import. Defaults to the key name.","generatecloud"),value:f,placeholder:n,onChange:e=>{r({slug:l,type:"SET_NAME",payload:{name:e}})},onBlur:()=>{f||r({slug:l,type:"SET_NAME",payload:{name:n}})}}),(0,e.createElement)(Po,{isMulti:!0,isSearchable:!0,label:x,help:"taxonomy"===v?(0,o.__)("Choose which collections should be included in this library.","generatecloud"):(0,o.sprintf)(
|
|
|
|
|
// Translators: %s: singular label of the entity being shared.
|
|
|
|
|
// Translators: %s: singular label of the entity being shared.
|
|
|
|
|
(0,o.__)("Choose which %s should be included in this library.","generatecloud"),(null!==(p=y.singular)&&void 0!==p?p:l).toLowerCase()),options:w,value:S,onChange:e=>{r({slug:l,type:"SET_INCLUDES",payload:{includes:e.map((e=>e.value))}})},isLoading:0===w.length}))}function Ho({postId:n,onCancel:s}){var u,c;const[d]=function(e){return(0,r.useSelect)((t=>{const{isResolving:n,getEntityRecord:o,hasFinishedResolution:r}=t(i.store),a=["postType",l,e];return[o(...a),!r("getEntityRecord",a)||n("getEntityRecord",a)]}),[e])}(-1!==n?n:void 0),g=function(){const{saveEntityRecord:e}=(0,r.useDispatch)(i.store);return async(t,n,o,r)=>{await e("postType",l,{title:t,permissions:o,status:"publish",public_key:n})&&r()}}(),p=function(){const{editEntityRecord:e,saveEditedEntityRecord:t}=(0,r.useDispatch)(i.store);return async(n,o,r,i,a)=>{await e("postType",l,n,{title:o,permissions:i,public_key:r});const s=await t("postType",l,n);s?.id&&a(s)}}(),[f,h]=(0,a.useState)(null!==(u=d?.title?.raw)&&void 0!==u?u:""),[m,b]=(0,a.useState)((()=>d?.public_key||v())),[y,w]=(0,a.useReducer)(No,null!==(c=d?.permissions)&&void 0!==c?c:{});return 0===To.length&&console.warn("No permissions found. Please check the generateCloud global object.","generatecloud"),(0,e.createElement)("div",{className:"gb-cloud-public-key-form"},(0,e.createElement)(t.TextControl,{label:(0,o.__)("Name","generatecloud"),value:f||"",onChange:h}),(0,e.createElement)(t.BaseControl,{label:(0,o.__)("Key","generatecloud"),id:"gblocks-public-key"},(0,e.createElement)("div",{className:"gb-cloud-public-key-form__key"},(0,e.createElement)(t.TextControl,{id:"gblocks-public-key",className:"gb-cloud-public-key-form__key-field",value:m||"",disabled:!0}),(0,e.createElement)(t.Button,{size:"compact",isDestructive:!0,onClick:()=>{b(v())},icon:Fo,label:(0,o.__)("Regenerate key","generatecloud"),showTooltip:!0}))),(0,e.createElement)("div",{className:"gb-cloud-public-key-form__permissions"},(0,e.createElement)("h4",null,(0,o.__)("Provides","generatecloud")),(0,e.createElement)("p",{className:"gb-cloud-public-key-form__description"},(0,o.__)("Choose what this key provides.","generatecloud")),(0,e.createElement)(Ao,{permissions:y,dispatch:w}),To.map((([t,n])=>{var o;const{enabled:r=!1}=null!==(o=y[t])&&void 0!==o?o:{};return r&&(0,e.createElement)(zo,{key:t,keyName:f,slug:t,config:n,permission:y[t],dispatch:w})}))),(0,e.createElement)("div",{style:{display:"flex",gap:"20px",justifyContent:"right"}},(0,e.createElement)(t.Button,{variant:"tertiary",onClick:s},(0,o.__)("Cancel","generatecloud")),(0,e.createElement)(t.Button,{variant:"primary",onClick:async()=>{d?.id?await p(d.id,f,m,y,s):await g(f,m,y,s)}},(0,o.__)("Save","generatecloud"))))}const Bo=(0,e.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(s.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),jo=(0,e.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(s.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,e.createElement)(s.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),Go=(0,e.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(s.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"}));function Uo({onSelectKey:n,publicKeys:s,setKeys:u}){const c=function(){const{deleteEntityRecord:e}=(0,r.useDispatch)(i.store);return async t=>{await e("postType",l,t)}}(),d=function(){const{editEntityRecord:e,saveEditedEntityRecord:t}=(0,r.useDispatch)(i.store);return async(n,o)=>{await e("postType",l,n,{status:o}),await t("postType",l,n)}}(),[g,f]=(0,a.useState)(null),h=(0,a.useMemo)((()=>[{id:"name",header:(0,o.__)("Name","generatecloud"),accessorKey:"title.rendered",cell:t=>(0,e.createElement)("div",{className:"gb-cloud-public-keys__text"},t.getValue())},{id:"key",header:(0,o.__)("Key","generatecloud"),accessorKey:"public_key",cell:t=>(0,e.createElement)("div",{className:"gb-cloud-public-keys__copy-key"},(0,e.createElement)("span",{className:"gb-cloud-public-keys__key"},t.getValue()),(0,e.createElement)(p,{text:t.getValue(),messages:{success:(0,o.__)("Key copied!","generatecloud")}}))},{id:"permissions",header:(0,o.__)("Permissions","generatecloud"),accessorKey:"permissions",cell:t=>{const n=t.getValue(),o=Object.entries(n).map((([e,t])=>"1"===t.enabled?e:null)).filter(Boolean);return(0,e.createElement)("div",{className:"gb-cloud-pLine truncated
|
|
|
|
|
// translators: %1$s: current page, %2$s: total pages
|
|
|
|
|
// translators: %1$s: current page, %2$s: total pages
|
|
|
|
|
(0,o.__)("Page %1$s of %2$s","generatecloud"),u,f)),(0,e.createElement)(t.Button,{disabled:u===f,onClick:()=>v(u+1),variant:"secondary"},(0,o.__)("Next","generatecloud")))),!!n&&(0,e.createElement)(t.Modal,{onRequestClose:()=>s(void 0),title:-1!==n?(0,o.__)("Edit key","generatecloud"):(0,o.__)("Create key","generatecloud")},(0,e.createElement)(Ho,{postId:n,onCancel:()=>s(void 0)})))}window.addEventListener("DOMContentLoaded",(()=>{var t,n;t=(0,e.createElement)($o,null),n=document.getElementById("gblocks-public-keys"),void 0!==a.createRoot?(0,a.createRoot)(n).render(t):(0,a.render)(t,n)}))})()})();
|