- md5
- e24d11a2d96ebd04b3568bd4b9197611
- sha1
- 720cf586606008e75aa60c19f3f8afc95fd735cb
- sha256
- 7a0ed2f72bc312ade6c05d63382866df664ed6c696eac93aaa48cea0314b7749
var G=Object.create;var E=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var q=(e,r,i,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of W(r))!X.call(e,s)&&s!==i&&E(e,s,{get:()=>r[s],enumerable:!(n=V(r,s))||n.enumerable});return e};var a=(e,r,i)=>(i=e!=null?G(J(e)):{},q(r||!e||!e.__esModule?E(i,"default",{value:e,enumerable:!0}):i,e));var h=u((ne,I)=>{I.exports=window.wp.data});var A=u((ie,y)=>{y.exports=window.wp.privateApis});var N=u((me,D)=>{D.exports=window.wp.components});var O=u((de,P)=>{P.exports=window.wp.element});var j=u((fe,L)=>{L.exports=window.wp.i18n});var B=u((ge,z)=>{z.exports=window.ReactJSXRuntime});var b=a(h(),1);var f=a(h(),1);var R=a(A(),1),{lock:T,unlock:m}=(0,R.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/connectors");var w="core/connectors",Q={connectors:{}},Z={registerConnector(e,r){return{type:"REGISTER_CONNECTOR",slug:e,config:r}}};function $(e=Q,r){return r.type==="REGISTER_CONNECTOR"?{...e,connectors:{...e.connectors,[r.slug]:{slug:r.slug,...r.config}}}:e}var U={getConnectors(e){return Object.values(e.connectors)},getConnector(e,r){return e.connectors[r]}},l=(0,f.createReduxStore)(w,{reducer:$});(0,f.register)(l);m(l).registerPrivateActions(Z);m(l).registerPrivateSelectors(U);function ee(e,r){m((0,b.dispatch)(l)).registerConnector(e,r)}var o=a(N(),1),g=a(O(),1),p=a(j(),1),t=a(B(),1);function re({className:e,icon:r,name:i,description:n,actionArea:s,children:c}){return(0,t.jsx)(o.__experimentalItem,{className:e,children:(0,t.jsxs)(o.__experimentalVStack,{spacing:4,children:[(0,t.jsxs)(o.__experimentalHStack,{alignment:"center",spacing:4,children:[r,(0,t.jsx)(o.FlexBlock,{children:(0,t.jsxs)(o.__experimentalVStack,{spacing:0,children:[(0,t.jsx)(o.__experimentalText,{weight:600,size:15,children:i}),(0,t.jsx)(o.__experimentalText,{variant:"muted",size:12,children:n})]})}),s]}),c]})})}function te({onSave:e,onRemove:r,initialValue:i="",helpUrl:n,helpLabel:s,readOnly:c=!1}){let[x,H]=(0,g.useState)(i),[v,S]=(0,g.useState)(!1),[k,_]=(0,g.useState)(null),C=s||n?.replace(/^https?:\/\//,""),K=n?(0,t.jsxs)(t.Fragment,{children:[(0,p.__)("Get your API key at")," ",(0,t.jsx)(o.ExternalLink,{href:n,children:C})]}):void 0,M=()=>c?(0,t.jsxs)(t.Fragment,{children:[(0,p.__)("Your API key is stored securely. You can reset it at")," ",n?(0,t.jsx)(o.ExternalLink,{href:n,children:C}):void 0]}):k?(0,t.jsx)("span",{style:{color:"#cc1818"},children:k}):K,Y=async()=>{_(null),S(!0);try{await e?.(x)}catch(d){_(d instanceof Error?d.message:(0,p.__)("It was not possible to connect to the provider using this key."))}finally{S(!1)}};return(0,t.jsxs)(o.__experimentalVStack,{spacing:4,className:"connector-settings",style:c?{"--wp-components-color-background":"#f0f0f0"}:void 0,children:[(0,t.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,p.__)("API Key"),value:x,onChange:d=>{c||(_(null),H(d))},placeholder:"YOUR_API_KEY",disabled:c||v,help:M()}),c?(0,t.jsx)(o.Button,{variant:"link",isDestructive:!0,onClick:r,children:(0,p.__)("Remove and replace")}):(0,t.jsx)(o.__experimentalHStack,{justify:"flex-start",children:(0,t.jsx)(o.Button,{__next40pxDefaultSize:!0,variant:"primary",disabled:!x||v,accessibleWhenDisabled:!0,isBusy:v,onClick:Y,children:(0,p.__)("Save")})})]})}var F={};T(F,{store:l,STORE_NAME:w});export{re as __experimentalConnectorItem,te as __experimentalDefaultConnectorSettings,ee as __experimentalRegisterConnector,F as privateApis};
No other release has this exact content. See every version of this file.